@yoyaflow/yoya-ui 0.2.1 → 0.3.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/README.md +63 -18
- package/README.zh-CN.md +63 -18
- package/dist/yoya-ui.umd.js +2 -2
- package/dist/yoya.core.js +231 -126
- package/dist/yoya.echart.js +12 -5
- package/dist/yoya.ssr.js +623 -546
- package/dist/yoya.ui.css +35 -11
- package/dist/yoya.ui.js +2286 -1448
- package/package.json +1 -1
- package/types/core.d.ts +87 -0
- package/types/data-display.d.ts +77 -0
- package/types/form.d.ts +21 -0
- package/types/svg.d.ts +1 -0
package/dist/yoya.ssr.js
CHANGED
|
@@ -457,7 +457,7 @@ var v = class extends h {}, y = [
|
|
|
457
457
|
];
|
|
458
458
|
function b() {
|
|
459
459
|
return y.reduce((e, t) => {
|
|
460
|
-
let { aliases: n = [], name: r, tagName: i } =
|
|
460
|
+
let { aliases: n = [], name: r, tagName: i } = tn(t), a = g(i, v);
|
|
461
461
|
return e[r] = a, n.forEach((t) => {
|
|
462
462
|
e[t] = a;
|
|
463
463
|
}), e;
|
|
@@ -465,28 +465,52 @@ function b() {
|
|
|
465
465
|
}
|
|
466
466
|
var x = b();
|
|
467
467
|
_(v, x);
|
|
468
|
-
var { a: S, abbr: ee, address: te, area:
|
|
469
|
-
function
|
|
468
|
+
var { a: S, abbr: ee, address: te, area: ne, article: C, aside: re, audio: w, b: T, base: ie, bdi: ae, bdo: E, blockquote: oe, body: se, br: ce, button: le, canvas: ue, caption: de, cite: fe, code: pe, col: me, colgroup: he, data: ge, datalist: _e, dd: ve, del: ye, details: be, dfn: xe, dialog: Se, div: Ce, dl: we, dt: Te, em: Ee, embed: De, fieldset: Oe, figcaption: ke, figure: Ae, footer: je, form: Me, h1: Ne, h2: Pe, h3: Fe, h4: Ie, h5: Le, h6: Re, head: ze, header: Be, hgroup: Ve, hr: He, html: Ue, i: We, iframe: Ge, img: Ke, input: qe, ins: Je, kbd: Ye, label: Xe, legend: Ze, li: Qe, link: $e, main: et, map: tt, mark: nt, menu: rt, meta: it, meter: at, nav: ot, noscript: st, object: ct, ol: lt, optgroup: ut, option: dt, output: ft, p: pt, picture: mt, pre: ht, progress: gt, q: _t, rp: vt, rt: yt, ruby: bt, s: xt, samp: St, script: Ct, search: wt, section: Tt, select: Et, selectedcontent: Dt, slot: Ot, small: kt, source: At, span: jt, strong: Mt, style: Nt, styleTag: Pt, sub: Ft, summary: It, sup: Lt, table: Rt, tbody: zt, td: Bt, template: Vt, textarea: Ht, tfoot: Ut, th: Wt, thead: Gt, time: Kt, title: qt, tr: Jt, track: Yt, u: Xt, ul: Zt, varTag: Qt, video: $t, wbr: en } = x;
|
|
469
|
+
function tn(e) {
|
|
470
470
|
return typeof e == "string" ? {
|
|
471
471
|
name: e,
|
|
472
472
|
tagName: e
|
|
473
473
|
} : e;
|
|
474
474
|
}
|
|
475
475
|
//#endregion
|
|
476
|
+
//#region src/core/document-events.js
|
|
477
|
+
function D(e, t, n = void 0) {
|
|
478
|
+
return typeof document > "u" ? () => {} : (document.addEventListener(e, t, n), () => {
|
|
479
|
+
document.removeEventListener(e, t, n);
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
function nn(e, t, n = void 0) {
|
|
483
|
+
typeof document > "u" || document.removeEventListener(e, t, n);
|
|
484
|
+
}
|
|
485
|
+
function O(e, t, n = void 0) {
|
|
486
|
+
return typeof window > "u" ? () => {} : (window.addEventListener(e, t, n), () => {
|
|
487
|
+
window.removeEventListener(e, t, n);
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
function rn(e, t = null) {
|
|
491
|
+
if (typeof document > "u") return null;
|
|
492
|
+
if (t) {
|
|
493
|
+
let e = document.querySelector(`[${t}]`);
|
|
494
|
+
if (e) return e;
|
|
495
|
+
}
|
|
496
|
+
let n = document.createElement("style");
|
|
497
|
+
return t && n.setAttribute(t, ""), n.textContent = e, document.head?.appendChild(n), n;
|
|
498
|
+
}
|
|
499
|
+
//#endregion
|
|
476
500
|
//#region src/svg/index.js
|
|
477
|
-
var
|
|
501
|
+
var an = "http://www.w3.org/2000/svg", on = /* @__PURE__ */ new Set([
|
|
478
502
|
"desc",
|
|
479
503
|
"metadata",
|
|
480
504
|
"text",
|
|
481
505
|
"textPath",
|
|
482
506
|
"title",
|
|
483
507
|
"tspan"
|
|
484
|
-
]),
|
|
508
|
+
]), sn = class e extends h {
|
|
485
509
|
setup(e) {
|
|
486
510
|
return typeof e == "string" || typeof e == "number" ? this.child(e) : super.setup(e);
|
|
487
511
|
}
|
|
488
512
|
text(...e) {
|
|
489
|
-
if (
|
|
513
|
+
if (on.has(this._tagName)) {
|
|
490
514
|
let [t, n] = e;
|
|
491
515
|
return e.length > 0 && this.child(t), n != null && this.setup(n), this;
|
|
492
516
|
}
|
|
@@ -494,10 +518,10 @@ var tn = "http://www.w3.org/2000/svg", nn = /* @__PURE__ */ new Set([
|
|
|
494
518
|
}
|
|
495
519
|
style(...e) {
|
|
496
520
|
let [t, n] = e;
|
|
497
|
-
return this._tagName === "style" && e.length <= 1 ? (e.length === 1 && this.child(t), this) : e.length <= 1 &&
|
|
521
|
+
return this._tagName === "style" && e.length <= 1 ? (e.length === 1 && this.child(t), this) : e.length <= 1 && cn(t) ? this._svgChild("style", t) : super.style(t, n);
|
|
498
522
|
}
|
|
499
523
|
renderDom() {
|
|
500
|
-
return this._deleted ? null : (this._el || (this._el = document.createElementNS(
|
|
524
|
+
return this._deleted ? null : (this._el || (this._el = document.createElementNS(an, this._tagName), this._applySnapshotToElement()), this._el);
|
|
501
525
|
}
|
|
502
526
|
_syncClassName() {
|
|
503
527
|
let e = [...this._classes].join(" ");
|
|
@@ -510,32 +534,32 @@ var tn = "http://www.w3.org/2000/svg", nn = /* @__PURE__ */ new Set([
|
|
|
510
534
|
}), this.child(r);
|
|
511
535
|
}
|
|
512
536
|
};
|
|
513
|
-
function
|
|
537
|
+
function cn(e) {
|
|
514
538
|
return e == null || typeof e == "function" || typeof e == "string" || typeof e == "number" || Array.isArray(e);
|
|
515
539
|
}
|
|
516
|
-
var
|
|
517
|
-
function
|
|
540
|
+
var ln = /* @__PURE__ */ "animate.animateMotion.animateTransform.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.foreignObject.g.image.line.linearGradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialGradient.rect.set.stop.a.script.style.switch.text.title.symbol.textPath.tspan.use.view".split(".");
|
|
541
|
+
function un(e) {
|
|
518
542
|
return function(...t) {
|
|
519
|
-
let n = new
|
|
543
|
+
let n = new sn(e);
|
|
520
544
|
return e === "svg" && n.style("display", "block"), t.forEach((e) => {
|
|
521
545
|
e != null && n.setup(e);
|
|
522
546
|
}), n;
|
|
523
547
|
};
|
|
524
548
|
}
|
|
525
|
-
function
|
|
526
|
-
return
|
|
527
|
-
let { aliases: n = [], name: r, tagName: i } =
|
|
549
|
+
function dn() {
|
|
550
|
+
return ln.reduce((e, t) => {
|
|
551
|
+
let { aliases: n = [], name: r, tagName: i } = mn(t), a = un(i);
|
|
528
552
|
return e[r] = a, n.forEach((t) => {
|
|
529
553
|
e[t] = a;
|
|
530
554
|
}), e;
|
|
531
555
|
}, {});
|
|
532
556
|
}
|
|
533
|
-
var
|
|
534
|
-
_(v, { svg:
|
|
535
|
-
svg:
|
|
536
|
-
...
|
|
557
|
+
var fn = un("svg"), pn = dn();
|
|
558
|
+
_(v, { svg: fn }), _(sn, {
|
|
559
|
+
svg: fn,
|
|
560
|
+
...pn
|
|
537
561
|
});
|
|
538
|
-
function
|
|
562
|
+
function mn(e) {
|
|
539
563
|
return typeof e == "string" ? {
|
|
540
564
|
name: e,
|
|
541
565
|
tagName: e
|
|
@@ -543,8 +567,8 @@ function dn(e) {
|
|
|
543
567
|
}
|
|
544
568
|
//#endregion
|
|
545
569
|
//#region src/svg/icons.js
|
|
546
|
-
function
|
|
547
|
-
return
|
|
570
|
+
function hn() {
|
|
571
|
+
return fn((e) => {
|
|
548
572
|
e.className("yoya-icon").attr({
|
|
549
573
|
"aria-hidden": "true",
|
|
550
574
|
fill: "none",
|
|
@@ -561,45 +585,45 @@ function fn() {
|
|
|
561
585
|
}
|
|
562
586
|
//#endregion
|
|
563
587
|
//#region src/components/shared.js
|
|
564
|
-
var
|
|
565
|
-
function
|
|
588
|
+
var gn = "yoya-component";
|
|
589
|
+
function k(e, t) {
|
|
566
590
|
return `var(--yoya-${e}, ${t})`;
|
|
567
591
|
}
|
|
568
|
-
function
|
|
569
|
-
return `${n} solid ${
|
|
592
|
+
function A(e, t, n = "1px") {
|
|
593
|
+
return `${n} solid ${k(e, t)}`;
|
|
570
594
|
}
|
|
571
|
-
function
|
|
595
|
+
function j(e = null, t = null, n = null) {
|
|
572
596
|
return p(e, t, n);
|
|
573
597
|
}
|
|
574
|
-
function
|
|
598
|
+
function _n(e, t) {
|
|
575
599
|
return typeof e.attr == "function" || typeof e.styles == "function" ? m(e, t) : (typeof e.render == "function" && m(e.render(), t), e);
|
|
576
600
|
}
|
|
577
|
-
function
|
|
578
|
-
return
|
|
601
|
+
function M(e, t = null, n = null) {
|
|
602
|
+
return _n(e, t), typeof n == "function" && n(e), e;
|
|
579
603
|
}
|
|
580
|
-
function
|
|
581
|
-
let { first: i, options: a, callback: o } =
|
|
582
|
-
return
|
|
604
|
+
function vn(e, t = null, n = null, r = null) {
|
|
605
|
+
let { first: i, options: a, callback: o } = j(t, n, r);
|
|
606
|
+
return M(i instanceof e ? i : new e(i), a, o);
|
|
583
607
|
}
|
|
584
|
-
function
|
|
585
|
-
return t == null ? e : typeof t == "function" ? (t(e), e) : t instanceof c || Array.isArray(t) || typeof t == "string" || typeof t == "number" ? (e.child(t), e) : (
|
|
608
|
+
function yn(e, t) {
|
|
609
|
+
return t == null ? e : typeof t == "function" ? (t(e), e) : t instanceof c || Array.isArray(t) || typeof t == "string" || typeof t == "number" ? (e.child(t), e) : (xn(t) && e.setup(t), e);
|
|
586
610
|
}
|
|
587
|
-
function
|
|
611
|
+
function bn(e) {
|
|
588
612
|
return e == null ? [] : Array.isArray(e) ? e : [e];
|
|
589
613
|
}
|
|
590
|
-
function
|
|
614
|
+
function N(e, t) {
|
|
591
615
|
return e.children().forEach((e) => e.destroy()), e._children = [], e._el && e._el.replaceChildren(), t.length > 0 && e.child(t), e;
|
|
592
616
|
}
|
|
593
|
-
function
|
|
617
|
+
function xn(e) {
|
|
594
618
|
if (Object.prototype.toString.call(e) !== "[object Object]") return !1;
|
|
595
619
|
let t = Object.getPrototypeOf(e);
|
|
596
620
|
return t === Object.prototype || t === null;
|
|
597
621
|
}
|
|
598
622
|
//#endregion
|
|
599
623
|
//#region src/layout/split-panel.js
|
|
600
|
-
var
|
|
624
|
+
var Sn = class extends v {
|
|
601
625
|
constructor(e = null, t = null, n = null) {
|
|
602
|
-
super("div", null), this.className(
|
|
626
|
+
super("div", null), this.className(gn, "yoya-vsplit-panel"), this.styles({
|
|
603
627
|
boxSizing: "border-box",
|
|
604
628
|
display: "flex",
|
|
605
629
|
minHeight: "0",
|
|
@@ -627,13 +651,13 @@ var yn = class extends v {
|
|
|
627
651
|
background: "transparent",
|
|
628
652
|
boxSizing: "border-box",
|
|
629
653
|
flex: "0 0 auto"
|
|
630
|
-
}).on("mousedown", (e) => this._startDrag(e)).on("dblclick", () => this.reset()).on("keydown", (e) => this._handleKeydown(e)).on("mouseenter", () => this._hoverDivider(!0)).on("mouseleave", () => this._hoverDivider(!1)), this.child(this._first, this._divider, this._second), this._sync(), this._setupSplitPanel(e),
|
|
654
|
+
}).on("mousedown", (e) => this._startDrag(e)).on("dblclick", () => this.reset()).on("keydown", (e) => this._handleKeydown(e)).on("mouseenter", () => this._hoverDivider(!0)).on("mouseleave", () => this._hoverDivider(!1)), this.child(this._first, this._divider, this._second), this._sync(), this._setupSplitPanel(e), M(this, t, n);
|
|
631
655
|
}
|
|
632
656
|
direction(e) {
|
|
633
657
|
return e === void 0 ? this._direction : (this._direction = e === "vertical" ? "vertical" : "horizontal", this._sync(), this);
|
|
634
658
|
}
|
|
635
659
|
size(e) {
|
|
636
|
-
return e === void 0 ? this._firstSize : (this._firstSize =
|
|
660
|
+
return e === void 0 ? this._firstSize : (this._firstSize = wn(e), this._sync(), this);
|
|
637
661
|
}
|
|
638
662
|
minSize(e) {
|
|
639
663
|
if (e === void 0) return this._minSize;
|
|
@@ -644,10 +668,10 @@ var yn = class extends v {
|
|
|
644
668
|
return this.size("50%");
|
|
645
669
|
}
|
|
646
670
|
first(e) {
|
|
647
|
-
return
|
|
671
|
+
return N(this._first, []), typeof e == "function" ? e(this._first) : N(this._first, bn(e)), this;
|
|
648
672
|
}
|
|
649
673
|
second(e) {
|
|
650
|
-
return
|
|
674
|
+
return N(this._second, []), typeof e == "function" ? e(this._second) : N(this._second, bn(e)), this;
|
|
651
675
|
}
|
|
652
676
|
destroy() {
|
|
653
677
|
return this._endDrag(), super.destroy();
|
|
@@ -669,7 +693,7 @@ var yn = class extends v {
|
|
|
669
693
|
}), this._divider.attr("aria-orientation", e ? "horizontal" : "vertical"), this;
|
|
670
694
|
}
|
|
671
695
|
_hoverDivider(e) {
|
|
672
|
-
this._divider.style("background", e ?
|
|
696
|
+
this._divider.style("background", e ? k("color-primary-subtle", "#eff6ff") : "var(--yoya-color-border-faint, #efefef)");
|
|
673
697
|
}
|
|
674
698
|
_startDrag(e) {
|
|
675
699
|
if (e.button !== 0 || !this._el) return;
|
|
@@ -679,22 +703,22 @@ var yn = class extends v {
|
|
|
679
703
|
containerSize: a,
|
|
680
704
|
start: r,
|
|
681
705
|
startSize: i
|
|
682
|
-
}, this._dragMove = (e) => this._onDrag(e), this._dragUp = () => this._endDrag(),
|
|
706
|
+
}, this._dragMove = (e) => this._onDrag(e), this._dragUp = () => this._endDrag(), this._dragUnbindMove = D("mousemove", this._dragMove), this._dragUnbindUp = D("mouseup", this._dragUp);
|
|
683
707
|
}
|
|
684
708
|
_onDrag(e) {
|
|
685
709
|
if (!this._drag) return;
|
|
686
|
-
let t = (this._direction === "horizontal" ? e.clientX : e.clientY) - this._drag.start, n =
|
|
710
|
+
let t = (this._direction === "horizontal" ? e.clientX : e.clientY) - this._drag.start, n = Tn(this._drag.startSize + t, this._minSize, this._drag.containerSize - this._minSize);
|
|
687
711
|
this._firstSize = `${Math.round(n)}px`, this._sync();
|
|
688
712
|
}
|
|
689
713
|
_handleKeydown(e) {
|
|
690
714
|
let t = e.key === "ArrowLeft" || e.key === "ArrowUp" ? -16 : e.key === "ArrowRight" || e.key === "ArrowDown" ? 16 : 0;
|
|
691
715
|
if (!t || !this._el) return;
|
|
692
716
|
e.preventDefault();
|
|
693
|
-
let n = this._direction === "horizontal" ? this._el.offsetWidth : this._el.offsetHeight, r =
|
|
717
|
+
let n = this._direction === "horizontal" ? this._el.offsetWidth : this._el.offsetHeight, r = Tn((Number.parseFloat(this._firstSize) || 0) + t, this._minSize, n - this._minSize);
|
|
694
718
|
this._firstSize = `${Math.round(r)}px`, this._sync();
|
|
695
719
|
}
|
|
696
720
|
_endDrag() {
|
|
697
|
-
this._dragMove
|
|
721
|
+
this._dragMove && (this._dragUnbindMove?.(), this._dragMove = null, this._dragUnbindMove = null), this._dragUp && (this._dragUnbindUp?.(), this._dragUp = null, this._dragUnbindUp = null), this._drag = null;
|
|
698
722
|
}
|
|
699
723
|
_setupSplitPanel(e) {
|
|
700
724
|
if (e != null) {
|
|
@@ -702,7 +726,7 @@ var yn = class extends v {
|
|
|
702
726
|
e(this);
|
|
703
727
|
return;
|
|
704
728
|
}
|
|
705
|
-
if (
|
|
729
|
+
if (xn(e)) {
|
|
706
730
|
let { direction: t, first: n, minSize: r, second: i, size: a, ...o } = e;
|
|
707
731
|
Object.keys(o).length > 0 && this.setup(o), t !== void 0 && this.direction(t), a !== void 0 && this.size(a), r !== void 0 && this.minSize(r), n !== void 0 && this.first(n), i !== void 0 && this.second(i);
|
|
708
732
|
return;
|
|
@@ -711,21 +735,21 @@ var yn = class extends v {
|
|
|
711
735
|
}
|
|
712
736
|
}
|
|
713
737
|
};
|
|
714
|
-
function
|
|
715
|
-
return
|
|
738
|
+
function Cn(e = null, t = null, n = null) {
|
|
739
|
+
return vn(Sn, e, t, n);
|
|
716
740
|
}
|
|
717
|
-
_(v, { vSplitPanel:
|
|
718
|
-
function
|
|
741
|
+
_(v, { vSplitPanel: Cn });
|
|
742
|
+
function wn(e) {
|
|
719
743
|
return typeof e == "number" ? `${e}px` : e;
|
|
720
744
|
}
|
|
721
|
-
function
|
|
745
|
+
function Tn(e, t, n) {
|
|
722
746
|
return Number.isNaN(e) ? t : Math.min(Math.max(e, t), Math.max(n, t));
|
|
723
747
|
}
|
|
724
748
|
//#endregion
|
|
725
749
|
//#region src/layout/masonry.js
|
|
726
|
-
var
|
|
750
|
+
var En = class extends v {
|
|
727
751
|
constructor(e = null) {
|
|
728
|
-
super("div", null), this._columns = 3, this._gap = 16, this._minColumnWidth = null, this.className(
|
|
752
|
+
super("div", null), this._columns = 3, this._gap = 16, this._minColumnWidth = null, this.className(gn, "yoya-vmasonry"), this.attr({ "data-columns": "3" }), this.styles({
|
|
729
753
|
boxSizing: "border-box",
|
|
730
754
|
columnCount: "3",
|
|
731
755
|
columnGap: "16px",
|
|
@@ -756,28 +780,28 @@ var Cn = class extends v {
|
|
|
756
780
|
e(this);
|
|
757
781
|
return;
|
|
758
782
|
}
|
|
759
|
-
if (
|
|
783
|
+
if (xn(e)) {
|
|
760
784
|
let { columns: t, gap: n, minColumnWidth: r, ...i } = e;
|
|
761
785
|
Object.keys(i).length > 0 && this.setup(i), t !== void 0 && this.columns(t), n !== void 0 && this.gap(n), r !== void 0 && this.minColumnWidth(r);
|
|
762
786
|
}
|
|
763
787
|
}
|
|
764
788
|
}
|
|
765
789
|
};
|
|
766
|
-
function
|
|
767
|
-
return
|
|
790
|
+
function Dn(e = null, t = null, n = null) {
|
|
791
|
+
return vn(En, e, t, n);
|
|
768
792
|
}
|
|
769
793
|
//#endregion
|
|
770
794
|
//#region src/layout/theme-shell.js
|
|
771
|
-
var
|
|
795
|
+
var On = class extends v {
|
|
772
796
|
constructor(e = null) {
|
|
773
797
|
super("div", null), this.className("yoya-component", "yoya-vtheme-shell"), this.styles({
|
|
774
|
-
background:
|
|
775
|
-
border: `1px solid ${
|
|
776
|
-
borderRadius:
|
|
798
|
+
background: k("color-surface", "#ffffff"),
|
|
799
|
+
border: `1px solid ${k("color-border", "#d8dee8")}`,
|
|
800
|
+
borderRadius: k("radius-md", "6px"),
|
|
777
801
|
boxSizing: "border-box",
|
|
778
|
-
color:
|
|
802
|
+
color: k("color-text", "#172033"),
|
|
779
803
|
minWidth: "0"
|
|
780
|
-
}),
|
|
804
|
+
}), yn(this, e);
|
|
781
805
|
}
|
|
782
806
|
_requireSingleShellChild() {
|
|
783
807
|
let e = this.children();
|
|
@@ -818,7 +842,7 @@ var Tn = class extends v {
|
|
|
818
842
|
return e === void 0 ? this._styles.background : e === null ? this : (this._styles.background = String(e), this._el && (this._el.style.background = String(e)), this);
|
|
819
843
|
}
|
|
820
844
|
backgroundOpacity(e) {
|
|
821
|
-
let t = this.background() ||
|
|
845
|
+
let t = this.background() || k("color-surface", "#ffffff"), n = Math.max(0, Math.min(1, Number(e) || 0));
|
|
822
846
|
return this.background(`color-mix(in srgb, ${t} ${Math.round(n * 100)}%, transparent)`);
|
|
823
847
|
}
|
|
824
848
|
radius(e) {
|
|
@@ -834,81 +858,81 @@ var Tn = class extends v {
|
|
|
834
858
|
return this.styles({ overflow: e ? "auto" : "visible" });
|
|
835
859
|
}
|
|
836
860
|
};
|
|
837
|
-
function
|
|
838
|
-
return
|
|
861
|
+
function kn(e = null, t = null, n = null) {
|
|
862
|
+
return vn(On, e, t, n);
|
|
839
863
|
}
|
|
840
|
-
_(h, { vThemeShell:
|
|
864
|
+
_(h, { vThemeShell: kn });
|
|
841
865
|
//#endregion
|
|
842
866
|
//#region src/layout/index.js
|
|
843
|
-
var
|
|
844
|
-
function
|
|
845
|
-
return
|
|
867
|
+
var An = /* @__PURE__ */ new Set(/* @__PURE__ */ "align.areas.asideWidth.autoFlow.breakpoint.columns.direction.drawer.gutter.offset.pull.push.span.xs.sm.md.lg.xl.gap.justify.maxWidth.minColumnWidth.mobileDirection.mobileGap.orientation.padding.paddingInline.rows.safeArea.size.breakpoints.viewport.wrap".split(".")), jn = /* @__PURE__ */ new Set(["height", "width"]);
|
|
868
|
+
function Mn(e = null, t = null, n = null) {
|
|
869
|
+
return P("flex", { display: "flex" }, e, I, t, n);
|
|
846
870
|
}
|
|
847
|
-
function
|
|
848
|
-
return
|
|
871
|
+
function Nn(e = null, t = null, n = null) {
|
|
872
|
+
return P("stack", {
|
|
849
873
|
display: "flex",
|
|
850
874
|
flexDirection: "column"
|
|
851
|
-
}, e,
|
|
875
|
+
}, e, I, t, n);
|
|
852
876
|
}
|
|
853
|
-
function
|
|
854
|
-
return
|
|
877
|
+
function Pn(e = null, t = null, n = null) {
|
|
878
|
+
return P("vstack", {
|
|
855
879
|
display: "flex",
|
|
856
880
|
flexDirection: "column"
|
|
857
|
-
}, e,
|
|
881
|
+
}, e, I, t, n);
|
|
858
882
|
}
|
|
859
|
-
function
|
|
860
|
-
return
|
|
883
|
+
function Fn(e = null, t = null, n = null) {
|
|
884
|
+
return P("hstack", {
|
|
861
885
|
display: "flex",
|
|
862
886
|
flexDirection: "row"
|
|
863
|
-
}, e,
|
|
887
|
+
}, e, I, t, n);
|
|
864
888
|
}
|
|
865
|
-
function
|
|
866
|
-
return
|
|
889
|
+
function In(e = null, t = null, n = null) {
|
|
890
|
+
return P("center", {
|
|
867
891
|
display: "flex",
|
|
868
892
|
alignItems: "center",
|
|
869
893
|
justifyContent: "center"
|
|
870
|
-
}, e,
|
|
894
|
+
}, e, I, t, n);
|
|
871
895
|
}
|
|
872
|
-
function
|
|
873
|
-
let r =
|
|
896
|
+
function Ln(e = null, t = null, n = null) {
|
|
897
|
+
let r = j(e, t, n), i = new v("div");
|
|
874
898
|
i.className("yoya-layout", "yoya-vrow"), i.styles({
|
|
875
899
|
boxSizing: "border-box",
|
|
876
900
|
display: "flex",
|
|
877
901
|
flexWrap: "wrap",
|
|
878
902
|
width: "100%"
|
|
879
|
-
}), i._gutter = null, i.gutter = (e) => e === void 0 ? i._gutter : (i._gutter =
|
|
903
|
+
}), i._gutter = null, i.gutter = (e) => e === void 0 ? i._gutter : (i._gutter = B(e), cr(i), i), i.justify = (e) => e === void 0 ? i.style("justifyContent") : (i.style("justifyContent", e), i), i.align = (e) => e === void 0 ? i.style("alignItems") : (i.style("alignItems", e), i), i.wrap = (e) => e === void 0 ? i.style("flexWrap") : (i.style("flexWrap", e === !1 ? "nowrap" : V(e ?? !0)), i);
|
|
880
904
|
let a = i.child.bind(i);
|
|
881
|
-
return i.child = (...e) => (a(...e),
|
|
905
|
+
return i.child = (...e) => (a(...e), cr(i), i), F(i, r.first, lr), cr(i), M(i, r.options, r.callback);
|
|
882
906
|
}
|
|
883
|
-
function
|
|
884
|
-
let r =
|
|
907
|
+
function Rn(e = null, t = null, n = null) {
|
|
908
|
+
let r = j(e, t, n), i = new v("div");
|
|
885
909
|
return i.className("yoya-layout", "yoya-vcol"), i.styles({
|
|
886
910
|
boxSizing: "border-box",
|
|
887
911
|
minWidth: "0"
|
|
888
|
-
}), i._baseCol =
|
|
912
|
+
}), i._baseCol = L({}), i._responsiveCols = [], i._gutter = null, i.refresh = i._refreshCol = () => {
|
|
889
913
|
let e = typeof window > "u" ? null : window.innerWidth, t = (e === null ? null : i._responsiveCols.filter((t) => e >= t.minWidth).at(-1))?.props ?? i._baseCol;
|
|
890
|
-
return i.style("boxSizing", "border-box"), i.style("flex", "0 0 auto"), i.style("left", t.push ? `${
|
|
891
|
-
}, i.span = (e) => e === void 0 ? i._baseCol.span : (i._baseCol.span =
|
|
914
|
+
return i.style("boxSizing", "border-box"), i.style("flex", "0 0 auto"), i.style("left", t.push ? `${z(t.push)}%` : null), i.style("marginLeft", t.offset ? `${z(t.offset)}%` : null), i.style("paddingLeft", i._gutter ? mr(i._gutter) : null), i.style("paddingRight", i._gutter ? mr(i._gutter) : null), i.style("position", t.push || t.pull ? "relative" : null), i.style("right", t.pull ? `${z(t.pull)}%` : null), i.style("width", `${z(t.span)}%`), i;
|
|
915
|
+
}, i.span = (e) => e === void 0 ? i._baseCol.span : (i._baseCol.span = R(e), i._refreshCol(), i), i.offset = (e) => e === void 0 ? i._baseCol.offset : (i._baseCol.offset = R(e), i._refreshCol(), i), i.push = (e) => e === void 0 ? i._baseCol.push : (i._baseCol.push = R(e), i._refreshCol(), i), i.pull = (e) => e === void 0 ? i._baseCol.pull : (i._baseCol.pull = R(e), i._refreshCol(), i), i.gutter = (e) => e === void 0 ? i._gutter : (i._gutter = B(e), i._refreshCol(), i), F(i, r.first, ur), i._refreshCol(), i._responsiveCols.length && (i._colResize = () => i._refreshCol(), i._colResizeUnbind = O("resize", i._colResize), hr(i)), M(i, r.options, r.callback);
|
|
892
916
|
}
|
|
893
|
-
function
|
|
894
|
-
return
|
|
917
|
+
function zn(e = null, t = null, n = null) {
|
|
918
|
+
return P("grid", { display: "grid" }, e, nr, t, n);
|
|
895
919
|
}
|
|
896
|
-
function
|
|
897
|
-
let r =
|
|
898
|
-
return i._responsiveGridBreakpoints =
|
|
920
|
+
function Bn(e = null, t = null, n = null) {
|
|
921
|
+
let r = j(e, t, n), i = P("responsive-grid", { display: "grid" }, r.first, rr, r.options, r.callback), a = U(r.first) ? r.first : {};
|
|
922
|
+
return i._responsiveGridBreakpoints = Or(a.breakpoints), i._responsiveGridMinColumnWidth = Dr(a.minColumnWidth), i._responsiveGridRefresh = () => {
|
|
899
923
|
let e = typeof window > "u" ? null : window.innerWidth, t = e === null ? null : i._responsiveGridBreakpoints.filter((t) => e >= t.minWidth).at(-1);
|
|
900
924
|
return i.style("gridTemplateColumns", t ? `repeat(${t.columns}, minmax(0, 1fr))` : `repeat(auto-fit, minmax(${i._responsiveGridMinColumnWidth}, 1fr))`), i;
|
|
901
|
-
}, i.refresh = i._responsiveGridRefresh, i.minColumnWidth = (e) => e === void 0 ? i._responsiveGridMinColumnWidth : (i._responsiveGridMinColumnWidth =
|
|
925
|
+
}, i.refresh = i._responsiveGridRefresh, i.minColumnWidth = (e) => e === void 0 ? i._responsiveGridMinColumnWidth : (i._responsiveGridMinColumnWidth = Dr(e), i._responsiveGridRefresh(), i), i.breakpoints = (e) => e === void 0 ? i._responsiveGridBreakpoints : (i._responsiveGridBreakpoints = Or(e), i._responsiveGridBreakpoints.length && !i._responsiveGridResize && !i._responsiveGridResizeUnbind && (i._responsiveGridResize = () => i._responsiveGridRefresh(), i._responsiveGridResizeUnbind = O("resize", i._responsiveGridResize), Un(i)), i._responsiveGridRefresh(), i), i._responsiveGridRefresh(), i._responsiveGridBreakpoints.length && (i._responsiveGridResize = () => i._responsiveGridRefresh(), i._responsiveGridResizeUnbind = O("resize", i._responsiveGridResize), Un(i)), i;
|
|
902
926
|
}
|
|
903
|
-
function
|
|
904
|
-
let r =
|
|
927
|
+
function Vn(e = null, t = null, n = null) {
|
|
928
|
+
let r = j(e, t, n), i = new v("div"), a = new v("div").className("yoya-vbody-content"), o = i.child.bind(i);
|
|
905
929
|
return i.className("yoya-layout", "yoya-vbody"), i.attr("data-page-body", "true"), i.styles({
|
|
906
|
-
background:
|
|
930
|
+
background: k("color-bg", "#f9f9f9"),
|
|
907
931
|
boxSizing: "border-box",
|
|
908
|
-
color:
|
|
909
|
-
fontFamily:
|
|
910
|
-
fontSize:
|
|
911
|
-
lineHeight:
|
|
932
|
+
color: k("color-text", "#0d0d0d"),
|
|
933
|
+
fontFamily: k("font-family", "ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif"),
|
|
934
|
+
fontSize: k("font-size", "14px"),
|
|
935
|
+
lineHeight: k("line-height", "1.5"),
|
|
912
936
|
minHeight: "100%",
|
|
913
937
|
padding: "clamp(16px, 3vw, 32px)",
|
|
914
938
|
width: "100%"
|
|
@@ -919,30 +943,30 @@ function Rn(e = null, t = null, n = null) {
|
|
|
919
943
|
marginRight: "auto",
|
|
920
944
|
maxWidth: "1120px",
|
|
921
945
|
width: "100%"
|
|
922
|
-
}), o(a), i.background = (e) => e === void 0 ? i.style("background") : (i.style("background", e), i), i.maxWidth = (e) => e === void 0 ? a.style("maxWidth") : (a.style("maxWidth",
|
|
946
|
+
}), o(a), i.background = (e) => e === void 0 ? i.style("background") : (i.style("background", e), i), i.maxWidth = (e) => e === void 0 ? a.style("maxWidth") : (a.style("maxWidth", B(e)), i), i.padding = (e) => e === void 0 ? i.style("padding") : (i.style("padding", B(e)), i), i.gap = (e) => e === void 0 ? a.style("gap") : (a.style("gap", B(e)), i), i.minHeight = (e) => e === void 0 ? i.style("minHeight") : (i.style("minHeight", B(e)), i), i.content = (e) => e === void 0 ? a : (typeof e == "function" ? e(a) : a.child(e), i), i.child = (...e) => (a.child(...e), i), ir(i, r.first), M(i, r.options, r.callback);
|
|
923
947
|
}
|
|
924
|
-
function
|
|
925
|
-
let n =
|
|
948
|
+
function Hn(e = null, t = null) {
|
|
949
|
+
let n = Vn(e);
|
|
926
950
|
return typeof document < "u" && n.bindTo(t || document.body), n;
|
|
927
951
|
}
|
|
928
|
-
function
|
|
952
|
+
function Un(e) {
|
|
929
953
|
if (e._responsiveGridDestroyWrapped) return;
|
|
930
954
|
e._responsiveGridDestroyWrapped = !0;
|
|
931
955
|
let t = e.destroy.bind(e);
|
|
932
|
-
e.destroy = () => (e.
|
|
956
|
+
e.destroy = () => (e._responsiveGridResizeUnbind?.(), t());
|
|
933
957
|
}
|
|
934
|
-
function
|
|
935
|
-
return
|
|
958
|
+
function Wn(e = null, t = null, n = null) {
|
|
959
|
+
return P("container", {
|
|
936
960
|
width: "100%",
|
|
937
961
|
maxWidth: "1120px",
|
|
938
962
|
marginLeft: "auto",
|
|
939
963
|
marginRight: "auto",
|
|
940
964
|
paddingLeft: "16px",
|
|
941
965
|
paddingRight: "16px"
|
|
942
|
-
}, e,
|
|
966
|
+
}, e, ar, t, n);
|
|
943
967
|
}
|
|
944
|
-
function
|
|
945
|
-
let r =
|
|
968
|
+
function Gn(e = null, t = null, n = null) {
|
|
969
|
+
let r = j(e, t, n), i = new v("div");
|
|
946
970
|
i.className("yoya-layout", "yoya-vcontainer"), i.styles({
|
|
947
971
|
boxSizing: "border-box",
|
|
948
972
|
display: "flex",
|
|
@@ -963,12 +987,12 @@ function Hn(e = null, t = null, n = null) {
|
|
|
963
987
|
minHeight: i._scrollable ? "0" : null,
|
|
964
988
|
overflow: i._scrollable ? "auto" : null,
|
|
965
989
|
overscrollBehavior: i._scrollable ? "contain" : null
|
|
966
|
-
}), i), i._autoDirection = () => i.children().some((e) =>
|
|
990
|
+
}), i), i._autoDirection = () => i.children().some((e) => br(e)) ? "column" : "row", i._syncContainerDirection = () => (i.style("flexDirection", i._direction || i._autoDirection()), i), i.direction = (e) => e === void 0 ? i._direction || i._autoDirection() : (i._direction = e, i._syncContainerDirection(), i);
|
|
967
991
|
let a = i.child.bind(i);
|
|
968
|
-
return i.child = (...e) => (a(...e), i._syncContainerDirection(), i),
|
|
992
|
+
return i.child = (...e) => (a(...e), i._syncContainerDirection(), i), F(i, r.first, xr), i._syncContainerDirection(), M(i, r.options, r.callback);
|
|
969
993
|
}
|
|
970
|
-
function
|
|
971
|
-
let r =
|
|
994
|
+
function Kn(e = null, t = null, n = null) {
|
|
995
|
+
let r = j(e, t, n), i = new v("div");
|
|
972
996
|
i.className("yoya-layout", "yoya-mobile-layout", "yoya-vmobile-layout"), i.attr("data-mobile-layout", "false"), i.styles({
|
|
973
997
|
boxSizing: "border-box",
|
|
974
998
|
display: "flex",
|
|
@@ -978,7 +1002,7 @@ function Un(e = null, t = null, n = null) {
|
|
|
978
1002
|
type: "button",
|
|
979
1003
|
"aria-label": "打开导航",
|
|
980
1004
|
"aria-expanded": "false"
|
|
981
|
-
}).style("display", "none").child(
|
|
1005
|
+
}).style("display", "none").child(hn().styles({
|
|
982
1006
|
height: "18px",
|
|
983
1007
|
width: "18px"
|
|
984
1008
|
})).on("click", () => i.toggleAside()), i._refreshMobileLayout = () => {
|
|
@@ -989,86 +1013,86 @@ function Un(e = null, t = null, n = null) {
|
|
|
989
1013
|
height: i._viewport ? "100dvh" : null,
|
|
990
1014
|
minHeight: i._viewport ? "100vh" : null,
|
|
991
1015
|
overflow: i._viewport ? "hidden" : null
|
|
992
|
-
}), i._safeArea ? (i._safeAreaApplied = !0, i.style("paddingLeft", t ? "max(env(safe-area-inset-left), 0px)" : null), i.style("paddingRight", t ? "max(env(safe-area-inset-right), 0px)" : null), i.style("paddingTop", t ? "max(env(safe-area-inset-top), 0px)" : null), i.style("paddingBottom", t ? "max(env(safe-area-inset-bottom), 0px)" : null)) : i._safeAreaApplied && (i._safeAreaApplied = !1, i.style("paddingLeft", null), i.style("paddingRight", null), i.style("paddingTop", null), i.style("paddingBottom", null)), i.children().forEach((e) =>
|
|
993
|
-
}, i.refresh = i._refreshMobileLayout, i.breakpoint = (e) => e === void 0 ? i._breakpoint : (i._breakpoint = Number(e), (!Number.isFinite(i._breakpoint) || i._breakpoint <= 0) && (i._breakpoint = 768), i._refreshMobileLayout(), i), i.direction = (e, t) => e === void 0 ? i._desktopDirection : (i._desktopDirection = e || "row", t !== void 0 && (i._mobileDirection = t || "column"), i._refreshMobileLayout(), i), i.mobileDirection = (e) => e === void 0 ? i._mobileDirection : (i._mobileDirection = e || "column", i._refreshMobileLayout(), i), i.gap = (e, t) => e === void 0 ? i._desktopGap : (i._desktopGap =
|
|
1016
|
+
}), i._safeArea ? (i._safeAreaApplied = !0, i.style("paddingLeft", t ? "max(env(safe-area-inset-left), 0px)" : null), i.style("paddingRight", t ? "max(env(safe-area-inset-right), 0px)" : null), i.style("paddingTop", t ? "max(env(safe-area-inset-top), 0px)" : null), i.style("paddingBottom", t ? "max(env(safe-area-inset-bottom), 0px)" : null)) : i._safeAreaApplied && (i._safeAreaApplied = !1, i.style("paddingLeft", null), i.style("paddingRight", null), i.style("paddingTop", null), i.style("paddingBottom", null)), i.children().forEach((e) => _r(i, e)), vr(i), i;
|
|
1017
|
+
}, i.refresh = i._refreshMobileLayout, i.breakpoint = (e) => e === void 0 ? i._breakpoint : (i._breakpoint = Number(e), (!Number.isFinite(i._breakpoint) || i._breakpoint <= 0) && (i._breakpoint = 768), i._refreshMobileLayout(), i), i.direction = (e, t) => e === void 0 ? i._desktopDirection : (i._desktopDirection = e || "row", t !== void 0 && (i._mobileDirection = t || "column"), i._refreshMobileLayout(), i), i.mobileDirection = (e) => e === void 0 ? i._mobileDirection : (i._mobileDirection = e || "column", i._refreshMobileLayout(), i), i.gap = (e, t) => e === void 0 ? i._desktopGap : (i._desktopGap = B(e), t !== void 0 && (i._mobileGap = B(t)), i._refreshMobileLayout(), i), i.mobileGap = (e) => e === void 0 ? i._mobileGap : (i._mobileGap = B(e), i._refreshMobileLayout(), i), i.asideWidth = (e) => e === void 0 ? i._asideWidth : (i._asideWidth = B(e), i._refreshMobileLayout(), i), i.viewport = (e = !0) => e === void 0 ? i._viewport : (i._viewport = !!e, i._refreshMobileLayout(), i), i.safeArea = (e = !0) => e === void 0 ? i._safeArea : (i._safeArea = !!e, i._refreshMobileLayout(), i), i.drawer = (e = !0) => e === void 0 ? i._drawerEnabled : (i._drawerEnabled = !!e, i._drawerEnabled || (i._asideOpen = !1), i._refreshMobileLayout(), i), i.asideOpen = (e) => e === void 0 ? i._asideOpen : (i._asideOpen = !!e, i._refreshMobileLayout(), i), i.openAside = () => i.asideOpen(!0), i.closeAside = () => i.asideOpen(!1), i.toggleAside = () => i.asideOpen(!i._asideOpen), i.mobile = () => i._mobile;
|
|
994
1018
|
let a = i.child.bind(i);
|
|
995
|
-
return i.child = (...e) => (a(...e), i._refreshMobileLayout(), i),
|
|
1019
|
+
return i.child = (...e) => (a(...e), i._refreshMobileLayout(), i), F(i, r.first, Sr), i.child(i._asideBackdrop, i._asideToggle), i._mobileLayoutResize = () => i._refreshMobileLayout(), i._mobileLayoutResizeUnbind = O("resize", i._mobileLayoutResize), gr(i), i._refreshMobileLayout(), M(i, r.options, r.callback);
|
|
996
1020
|
}
|
|
997
|
-
var
|
|
998
|
-
function
|
|
999
|
-
return
|
|
1021
|
+
var qn = Kn;
|
|
1022
|
+
function Jn(e = null, t = null, n = null) {
|
|
1023
|
+
return P("vheader", {
|
|
1000
1024
|
boxSizing: "border-box",
|
|
1001
1025
|
flex: "0 0 auto",
|
|
1002
1026
|
height: "60px",
|
|
1003
1027
|
width: "100%"
|
|
1004
|
-
}, e,
|
|
1028
|
+
}, e, Cr, t, n, "header", jn, er);
|
|
1005
1029
|
}
|
|
1006
|
-
function
|
|
1007
|
-
return
|
|
1030
|
+
function Yn(e = null, t = null, n = null) {
|
|
1031
|
+
return P("vaside", {
|
|
1008
1032
|
boxSizing: "border-box",
|
|
1009
1033
|
flex: "0 0 auto",
|
|
1010
1034
|
minWidth: "0",
|
|
1011
1035
|
width: "300px"
|
|
1012
|
-
}, e,
|
|
1036
|
+
}, e, wr, t, n, "aside", jn, tr);
|
|
1013
1037
|
}
|
|
1014
|
-
function
|
|
1015
|
-
return
|
|
1038
|
+
function Xn(e = null, t = null, n = null) {
|
|
1039
|
+
return P("vmain", {
|
|
1016
1040
|
boxSizing: "border-box",
|
|
1017
1041
|
flex: "1 1 auto",
|
|
1018
1042
|
minHeight: "0",
|
|
1019
1043
|
minWidth: "0",
|
|
1020
1044
|
overflow: "auto"
|
|
1021
|
-
}, e,
|
|
1045
|
+
}, e, Tr, t, n, "main", jn, tr);
|
|
1022
1046
|
}
|
|
1023
|
-
function
|
|
1024
|
-
return
|
|
1047
|
+
function Zn(e = null, t = null, n = null) {
|
|
1048
|
+
return P("vfooter", {
|
|
1025
1049
|
boxSizing: "border-box",
|
|
1026
1050
|
flex: "0 0 auto",
|
|
1027
1051
|
height: "60px",
|
|
1028
1052
|
width: "100%"
|
|
1029
|
-
}, e,
|
|
1053
|
+
}, e, Cr, t, n, "footer", jn, er);
|
|
1030
1054
|
}
|
|
1031
|
-
function
|
|
1032
|
-
let r =
|
|
1055
|
+
function Qn(e = null, t = null, n = null) {
|
|
1056
|
+
let r = P("spacer", {
|
|
1033
1057
|
flexGrow: 1,
|
|
1034
1058
|
minWidth: 0,
|
|
1035
1059
|
minHeight: 0
|
|
1036
|
-
}, e,
|
|
1060
|
+
}, e, or, t, n);
|
|
1037
1061
|
return r.attr("aria-hidden", "true"), r;
|
|
1038
1062
|
}
|
|
1039
|
-
function
|
|
1040
|
-
let r =
|
|
1063
|
+
function $n(e = null, t = null, n = null) {
|
|
1064
|
+
let r = P("divider", {}, e, sr, t, n);
|
|
1041
1065
|
return r.attr("role", "separator"), r.attr("aria-orientation") || r.attr("aria-orientation", "horizontal"), r;
|
|
1042
1066
|
}
|
|
1043
1067
|
_(v, {
|
|
1044
|
-
vAside:
|
|
1045
|
-
vCol:
|
|
1046
|
-
vContainer:
|
|
1047
|
-
vFooter:
|
|
1048
|
-
vHeader:
|
|
1049
|
-
vMain:
|
|
1050
|
-
vMasonry:
|
|
1051
|
-
vRow:
|
|
1052
|
-
vSplitPanel:
|
|
1053
|
-
center:
|
|
1054
|
-
container:
|
|
1055
|
-
divider:
|
|
1056
|
-
flex:
|
|
1057
|
-
grid:
|
|
1058
|
-
mobileLayout:
|
|
1059
|
-
responsiveGrid:
|
|
1060
|
-
vMobileLayout:
|
|
1061
|
-
vBody:
|
|
1062
|
-
hstack:
|
|
1063
|
-
spacer:
|
|
1064
|
-
stack:
|
|
1065
|
-
vstack:
|
|
1068
|
+
vAside: Yn,
|
|
1069
|
+
vCol: Rn,
|
|
1070
|
+
vContainer: Gn,
|
|
1071
|
+
vFooter: Zn,
|
|
1072
|
+
vHeader: Jn,
|
|
1073
|
+
vMain: Xn,
|
|
1074
|
+
vMasonry: Dn,
|
|
1075
|
+
vRow: Ln,
|
|
1076
|
+
vSplitPanel: Cn,
|
|
1077
|
+
center: In,
|
|
1078
|
+
container: Wn,
|
|
1079
|
+
divider: $n,
|
|
1080
|
+
flex: Mn,
|
|
1081
|
+
grid: zn,
|
|
1082
|
+
mobileLayout: Kn,
|
|
1083
|
+
responsiveGrid: Bn,
|
|
1084
|
+
vMobileLayout: qn,
|
|
1085
|
+
vBody: Vn,
|
|
1086
|
+
hstack: Fn,
|
|
1087
|
+
spacer: Qn,
|
|
1088
|
+
stack: Nn,
|
|
1089
|
+
vstack: Pn
|
|
1066
1090
|
});
|
|
1067
|
-
function
|
|
1068
|
-
let l =
|
|
1069
|
-
return u.className("yoya-layout", `yoya-${e}`), u.styles(t), c && c(u),
|
|
1091
|
+
function P(e, t, n, r, i, a, o = "div", s = null, c = null) {
|
|
1092
|
+
let l = j(n, i, a), u = new v(o);
|
|
1093
|
+
return u.className("yoya-layout", `yoya-${e}`), u.styles(t), c && c(u), F(u, l.first, r, s), M(u, l.options, l.callback);
|
|
1070
1094
|
}
|
|
1071
|
-
function
|
|
1095
|
+
function er(e) {
|
|
1072
1096
|
e.sticky = (t = !0) => {
|
|
1073
1097
|
if (t === void 0) return e.style("position") === "sticky";
|
|
1074
1098
|
let n = !!t;
|
|
@@ -1079,7 +1103,7 @@ function Zn(e) {
|
|
|
1079
1103
|
}), e;
|
|
1080
1104
|
};
|
|
1081
1105
|
}
|
|
1082
|
-
function
|
|
1106
|
+
function tr(e) {
|
|
1083
1107
|
e.scrollable = (t = !0) => {
|
|
1084
1108
|
if (t === void 0) return e.style("overflow") === "auto";
|
|
1085
1109
|
let n = !!t;
|
|
@@ -1091,59 +1115,59 @@ function Qn(e) {
|
|
|
1091
1115
|
}), e;
|
|
1092
1116
|
};
|
|
1093
1117
|
}
|
|
1094
|
-
function
|
|
1118
|
+
function F(e, t, n, r = null) {
|
|
1095
1119
|
if (t == null) return n(e, {}), e;
|
|
1096
|
-
if (!
|
|
1120
|
+
if (!U(t)) return n(e, {}), e.setup(t);
|
|
1097
1121
|
n(e, t);
|
|
1098
|
-
let i =
|
|
1122
|
+
let i = kr(t, r);
|
|
1099
1123
|
return Object.keys(i).length > 0 && e.setup(i), e;
|
|
1100
1124
|
}
|
|
1101
|
-
function
|
|
1102
|
-
e.styles(
|
|
1125
|
+
function I(e, t) {
|
|
1126
|
+
e.styles(H({
|
|
1103
1127
|
alignItems: t.align,
|
|
1104
1128
|
flexDirection: t.direction,
|
|
1105
|
-
flexWrap:
|
|
1129
|
+
flexWrap: V(t.wrap),
|
|
1106
1130
|
gap: t.gap,
|
|
1107
1131
|
justifyContent: t.justify
|
|
1108
1132
|
}));
|
|
1109
1133
|
}
|
|
1110
|
-
function
|
|
1111
|
-
e.styles(
|
|
1134
|
+
function nr(e, t) {
|
|
1135
|
+
e.styles(H({
|
|
1112
1136
|
gap: t.gap,
|
|
1113
1137
|
gridAutoFlow: t.autoFlow,
|
|
1114
1138
|
gridTemplateAreas: t.areas,
|
|
1115
|
-
gridTemplateColumns:
|
|
1116
|
-
gridTemplateRows:
|
|
1139
|
+
gridTemplateColumns: Er(t.columns),
|
|
1140
|
+
gridTemplateRows: Er(t.rows)
|
|
1117
1141
|
}));
|
|
1118
1142
|
}
|
|
1119
|
-
function
|
|
1120
|
-
e.style("gap", t.gap), e.style("gridTemplateColumns", `repeat(auto-fit, minmax(${
|
|
1143
|
+
function rr(e, t) {
|
|
1144
|
+
e.style("gap", t.gap), e.style("gridTemplateColumns", `repeat(auto-fit, minmax(${Dr(t.minColumnWidth)}, 1fr))`);
|
|
1121
1145
|
}
|
|
1122
|
-
function
|
|
1146
|
+
function ir(e, t) {
|
|
1123
1147
|
if (t == null) return e;
|
|
1124
1148
|
if (typeof t == "function") return t(e), e;
|
|
1125
|
-
if (!
|
|
1149
|
+
if (!U(t)) return e.child(t), e;
|
|
1126
1150
|
let { background: n, children: r, content: i, gap: a, maxWidth: o, minHeight: s, padding: c, ...l } = t;
|
|
1127
1151
|
Object.keys(l).length && e.setup(l), n !== void 0 && e.background(n), o !== void 0 && e.maxWidth(o), c !== void 0 && e.padding(c), a !== void 0 && e.gap(a), s !== void 0 && e.minHeight(s);
|
|
1128
1152
|
let u = i ?? r;
|
|
1129
1153
|
return u !== void 0 && e.content(u), e;
|
|
1130
1154
|
}
|
|
1131
|
-
function
|
|
1155
|
+
function ar(e, t) {
|
|
1132
1156
|
let n = t.paddingInline ?? t.padding;
|
|
1133
|
-
e.styles(
|
|
1157
|
+
e.styles(H({
|
|
1134
1158
|
maxWidth: t.maxWidth,
|
|
1135
1159
|
paddingLeft: n,
|
|
1136
1160
|
paddingRight: n
|
|
1137
1161
|
}));
|
|
1138
1162
|
}
|
|
1139
|
-
function
|
|
1140
|
-
e.styles(
|
|
1163
|
+
function or(e, t) {
|
|
1164
|
+
e.styles(H({
|
|
1141
1165
|
flexBasis: t.size,
|
|
1142
1166
|
height: t.orientation === "vertical" ? t.size : void 0,
|
|
1143
1167
|
width: t.orientation === "horizontal" ? t.size : void 0
|
|
1144
1168
|
}));
|
|
1145
1169
|
}
|
|
1146
|
-
function
|
|
1170
|
+
function sr(e, t) {
|
|
1147
1171
|
let n = t.orientation === "vertical" ? "vertical" : "horizontal";
|
|
1148
1172
|
if (e.attr("aria-orientation", n), n === "vertical") {
|
|
1149
1173
|
e.styles({
|
|
@@ -1161,71 +1185,71 @@ function ir(e, t) {
|
|
|
1161
1185
|
width: "100%"
|
|
1162
1186
|
});
|
|
1163
1187
|
}
|
|
1164
|
-
function
|
|
1188
|
+
function cr(e) {
|
|
1165
1189
|
e.children().forEach((t) => {
|
|
1166
1190
|
let n = t?._resolved ?? t?._resolve?.() ?? t;
|
|
1167
1191
|
n && typeof n.gutter == "function" && n.gutter(e._gutter);
|
|
1168
1192
|
});
|
|
1169
1193
|
}
|
|
1170
|
-
function
|
|
1171
|
-
t.gutter !== void 0 && e.gutter(t.gutter), e.styles(
|
|
1194
|
+
function lr(e, t) {
|
|
1195
|
+
t.gutter !== void 0 && e.gutter(t.gutter), e.styles(H({
|
|
1172
1196
|
alignItems: t.align,
|
|
1173
|
-
flexWrap: t.wrap === void 0 || t.wrap === null ? "wrap" : t.wrap === !1 ? "nowrap" :
|
|
1197
|
+
flexWrap: t.wrap === void 0 || t.wrap === null ? "wrap" : t.wrap === !1 ? "nowrap" : V(t.wrap),
|
|
1174
1198
|
justifyContent: t.justify
|
|
1175
1199
|
}));
|
|
1176
1200
|
}
|
|
1177
|
-
function
|
|
1178
|
-
e._baseCol =
|
|
1201
|
+
function ur(e, t) {
|
|
1202
|
+
e._baseCol = L(t), e._responsiveCols = fr(t), t.gutter !== void 0 && e.gutter(t.gutter);
|
|
1179
1203
|
}
|
|
1180
|
-
var
|
|
1204
|
+
var dr = [
|
|
1181
1205
|
["xs", 0],
|
|
1182
1206
|
["sm", 768],
|
|
1183
1207
|
["md", 992],
|
|
1184
1208
|
["lg", 1200],
|
|
1185
1209
|
["xl", 1920]
|
|
1186
1210
|
];
|
|
1187
|
-
function
|
|
1211
|
+
function L(e = {}) {
|
|
1188
1212
|
return {
|
|
1189
|
-
span:
|
|
1190
|
-
offset:
|
|
1191
|
-
push:
|
|
1192
|
-
pull:
|
|
1213
|
+
span: R(e.span ?? 24),
|
|
1214
|
+
offset: R(e.offset ?? 0),
|
|
1215
|
+
push: R(e.push ?? 0),
|
|
1216
|
+
pull: R(e.pull ?? 0)
|
|
1193
1217
|
};
|
|
1194
1218
|
}
|
|
1195
|
-
function
|
|
1196
|
-
return
|
|
1219
|
+
function fr(e = {}) {
|
|
1220
|
+
return dr.filter(([t]) => e[t] !== void 0).map(([t, n]) => ({
|
|
1197
1221
|
minWidth: n,
|
|
1198
|
-
props:
|
|
1222
|
+
props: pr(e[t])
|
|
1199
1223
|
}));
|
|
1200
1224
|
}
|
|
1201
|
-
function
|
|
1202
|
-
return typeof e == "number" ?
|
|
1225
|
+
function pr(e) {
|
|
1226
|
+
return typeof e == "number" ? L({ span: e }) : U(e) ? L(e) : L({});
|
|
1203
1227
|
}
|
|
1204
|
-
function
|
|
1228
|
+
function R(e) {
|
|
1205
1229
|
let t = Number(e);
|
|
1206
1230
|
return Number.isFinite(t) ? Math.min(24, Math.max(0, Math.round(t))) : 0;
|
|
1207
1231
|
}
|
|
1208
|
-
function
|
|
1232
|
+
function z(e) {
|
|
1209
1233
|
return e / 24 * 100;
|
|
1210
1234
|
}
|
|
1211
|
-
function
|
|
1235
|
+
function mr(e) {
|
|
1212
1236
|
if (typeof e == "number") return `${e / 2}px`;
|
|
1213
1237
|
let t = String(e).match(/^(-?(?:\d+\.?\d*|\.\d+))([a-z%]+)$/i);
|
|
1214
1238
|
return t ? `${Number(t[1]) / 2}${t[2]}` : `calc(${e} * 0.5)`;
|
|
1215
1239
|
}
|
|
1216
|
-
function
|
|
1240
|
+
function hr(e) {
|
|
1217
1241
|
if (e._colDestroyWrapped) return;
|
|
1218
1242
|
e._colDestroyWrapped = !0;
|
|
1219
1243
|
let t = e.destroy.bind(e);
|
|
1220
|
-
e.destroy = () => (e.
|
|
1244
|
+
e.destroy = () => (e._colResizeUnbind?.(), t());
|
|
1221
1245
|
}
|
|
1222
|
-
function
|
|
1246
|
+
function gr(e) {
|
|
1223
1247
|
if (e._mobileLayoutDestroyWrapped) return;
|
|
1224
1248
|
e._mobileLayoutDestroyWrapped = !0;
|
|
1225
1249
|
let t = e.destroy.bind(e);
|
|
1226
|
-
e.destroy = () => (e.
|
|
1250
|
+
e.destroy = () => (e._mobileLayoutResizeUnbind?.(), t());
|
|
1227
1251
|
}
|
|
1228
|
-
function
|
|
1252
|
+
function _r(e, t) {
|
|
1229
1253
|
let n = t?._resolved ?? t?._resolve?.() ?? t;
|
|
1230
1254
|
if (!n || typeof n.styles != "function") return;
|
|
1231
1255
|
let r = n._classes;
|
|
@@ -1270,7 +1294,7 @@ function mr(e, t) {
|
|
|
1270
1294
|
visibility: null,
|
|
1271
1295
|
zIndex: null
|
|
1272
1296
|
})), n._mobileDrawerAriaHiddenApplied && (n._mobileDrawerAriaHiddenApplied = !1, n.attr("aria-hidden", null));
|
|
1273
|
-
let t = e._mobile ? "100%" :
|
|
1297
|
+
let t = e._mobile ? "100%" : B(e._asideWidth);
|
|
1274
1298
|
n.styles({
|
|
1275
1299
|
flex: "0 0 auto",
|
|
1276
1300
|
maxWidth: t,
|
|
@@ -1290,8 +1314,8 @@ function mr(e, t) {
|
|
|
1290
1314
|
width: null
|
|
1291
1315
|
})));
|
|
1292
1316
|
}
|
|
1293
|
-
function
|
|
1294
|
-
let t = e._mobile && e._drawerEnabled &&
|
|
1317
|
+
function vr(e) {
|
|
1318
|
+
let t = e._mobile && e._drawerEnabled && yr(e), n = t && e._asideOpen, r = e._asideBackdrop, i = e._asideToggle;
|
|
1295
1319
|
i && i.attr("aria-expanded", n ? "true" : "false").attr("aria-label", n ? "关闭导航" : "打开导航").styles({
|
|
1296
1320
|
alignItems: "center",
|
|
1297
1321
|
background: "var(--yoya-color-surface, #ffffff)",
|
|
@@ -1317,42 +1341,42 @@ function hr(e) {
|
|
|
1317
1341
|
zIndex: n ? "35" : null
|
|
1318
1342
|
});
|
|
1319
1343
|
}
|
|
1320
|
-
function
|
|
1344
|
+
function yr(e) {
|
|
1321
1345
|
return e.children().some((e) => !!(e?._resolved ?? e?._resolve?.() ?? e)?._classes?.has("yoya-vaside"));
|
|
1322
1346
|
}
|
|
1323
|
-
function
|
|
1347
|
+
function br(e) {
|
|
1324
1348
|
let t = (e?._resolved ?? e?._resolve?.() ?? e)?._classes;
|
|
1325
1349
|
return !!(t?.has("yoya-vheader") || t?.has("yoya-vfooter"));
|
|
1326
1350
|
}
|
|
1327
|
-
function
|
|
1328
|
-
t.direction !== void 0 && e.direction(t.direction), e.styles(
|
|
1351
|
+
function xr(e, t) {
|
|
1352
|
+
t.direction !== void 0 && e.direction(t.direction), e.styles(H({ gap: t.gap }));
|
|
1329
1353
|
}
|
|
1330
|
-
function
|
|
1331
|
-
e.styles(
|
|
1354
|
+
function Sr(e, t) {
|
|
1355
|
+
e.styles(H({
|
|
1332
1356
|
alignItems: t.align,
|
|
1333
|
-
flexWrap:
|
|
1357
|
+
flexWrap: V(t.wrap),
|
|
1334
1358
|
justifyContent: t.justify
|
|
1335
1359
|
})), t.direction === void 0 ? t.mobileDirection !== void 0 && e.mobileDirection(t.mobileDirection) : e.direction(t.direction, t.mobileDirection), t.gap === void 0 ? t.mobileGap !== void 0 && e.mobileGap(t.mobileGap) : e.gap(t.gap, t.mobileGap), t.breakpoint !== void 0 && e.breakpoint(t.breakpoint), t.asideWidth !== void 0 && e.asideWidth(t.asideWidth), t.drawer !== void 0 && e.drawer(t.drawer), t.viewport !== void 0 && e.viewport(t.viewport), t.safeArea !== void 0 && e.safeArea(t.safeArea);
|
|
1336
1360
|
}
|
|
1337
|
-
function
|
|
1338
|
-
e.style("height",
|
|
1361
|
+
function Cr(e, t) {
|
|
1362
|
+
e.style("height", B(t.height ?? t.size ?? 60)), e.style("width", "100%");
|
|
1339
1363
|
}
|
|
1340
|
-
function
|
|
1341
|
-
e.style("width",
|
|
1364
|
+
function wr(e, t) {
|
|
1365
|
+
e.style("width", B(t.width ?? t.size ?? 300));
|
|
1342
1366
|
}
|
|
1343
|
-
function
|
|
1344
|
-
t.height !== void 0 && e.style("height",
|
|
1367
|
+
function Tr(e, t = {}) {
|
|
1368
|
+
t.height !== void 0 && e.style("height", B(t.height));
|
|
1345
1369
|
}
|
|
1346
|
-
function
|
|
1370
|
+
function Er(e) {
|
|
1347
1371
|
if (e != null && e !== !1) return typeof e == "number" ? `repeat(${e}, minmax(0, 1fr))` : String(e);
|
|
1348
1372
|
}
|
|
1349
|
-
function
|
|
1373
|
+
function Dr(e) {
|
|
1350
1374
|
return typeof e == "number" ? `${e}px` : e || "240px";
|
|
1351
1375
|
}
|
|
1352
|
-
function
|
|
1376
|
+
function B(e) {
|
|
1353
1377
|
return typeof e == "number" ? `${e}px` : e;
|
|
1354
1378
|
}
|
|
1355
|
-
function
|
|
1379
|
+
function Or(e) {
|
|
1356
1380
|
return e ? (Array.isArray(e) ? e : Object.entries(e).map(([e, t]) => ({
|
|
1357
1381
|
minWidth: e,
|
|
1358
1382
|
columns: t
|
|
@@ -1361,28 +1385,28 @@ function Tr(e) {
|
|
|
1361
1385
|
minWidth: Number.parseInt(e.minWidth, 10)
|
|
1362
1386
|
})).filter(({ columns: e, minWidth: t }) => Number.isFinite(t) && e > 0).sort((e, t) => e.minWidth - t.minWidth) : [];
|
|
1363
1387
|
}
|
|
1364
|
-
function
|
|
1388
|
+
function V(e) {
|
|
1365
1389
|
if (e === !0) return "wrap";
|
|
1366
1390
|
if (e !== !1 && e != null) return String(e);
|
|
1367
1391
|
}
|
|
1368
|
-
function
|
|
1369
|
-
let n = t ||
|
|
1392
|
+
function kr(e, t = null) {
|
|
1393
|
+
let n = t || An;
|
|
1370
1394
|
return Object.fromEntries(Object.entries(e).filter(([e]) => !n.has(e)));
|
|
1371
1395
|
}
|
|
1372
|
-
function
|
|
1396
|
+
function H(e) {
|
|
1373
1397
|
return Object.fromEntries(Object.entries(e).filter(([, e]) => e != null && e !== !1));
|
|
1374
1398
|
}
|
|
1375
|
-
function
|
|
1399
|
+
function U(e) {
|
|
1376
1400
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
1377
1401
|
}
|
|
1378
1402
|
//#endregion
|
|
1379
1403
|
//#region src/core/client-only.js
|
|
1380
|
-
var
|
|
1404
|
+
var Ar = class extends c {
|
|
1381
1405
|
constructor(e) {
|
|
1382
1406
|
super(null), this._loader = e, this._resolved = null;
|
|
1383
1407
|
}
|
|
1384
1408
|
_resolve() {
|
|
1385
|
-
return this._resolved ||=
|
|
1409
|
+
return this._resolved ||= Mr(this._loader), this._resolved;
|
|
1386
1410
|
}
|
|
1387
1411
|
toHTML() {
|
|
1388
1412
|
return this._deleted ? "" : "<div class=\"yoya-client-only\" data-client-only=\"true\"></div>";
|
|
@@ -1402,21 +1426,21 @@ var Dr = class extends c {
|
|
|
1402
1426
|
return this._resolved && this._resolved.destroy(), super.destroy();
|
|
1403
1427
|
}
|
|
1404
1428
|
};
|
|
1405
|
-
function
|
|
1406
|
-
return new
|
|
1429
|
+
function jr(e) {
|
|
1430
|
+
return new Ar(e);
|
|
1407
1431
|
}
|
|
1408
|
-
function
|
|
1432
|
+
function Mr(e) {
|
|
1409
1433
|
if (e instanceof c) return e;
|
|
1410
|
-
if (typeof e == "function") return
|
|
1411
|
-
if (e && typeof e.render == "function") return
|
|
1434
|
+
if (typeof e == "function") return Mr(e());
|
|
1435
|
+
if (e && typeof e.render == "function") return Mr(e.render());
|
|
1412
1436
|
throw TypeError("vClientOnly loader must return a ViewNode or a component object");
|
|
1413
1437
|
}
|
|
1414
1438
|
//#endregion
|
|
1415
1439
|
//#region src/core/i18n.js
|
|
1416
|
-
var
|
|
1440
|
+
var Nr = "yoya-ui:i18n", W = /* @__PURE__ */ new Map(), Pr = class {
|
|
1417
1441
|
constructor(e = {}) {
|
|
1418
1442
|
let t = e.language || "zh-CN";
|
|
1419
|
-
this._key = e.key || null, this._storage =
|
|
1443
|
+
this._key = e.key || null, this._storage = ei(e.storage), this._storageKey = e.storageKey || null, this._sharedStorageKey = this._key ? Nr : null, this._fallbackLanguage = e.fallbackLanguage || t, this._language = this._readStoredLanguage(t), this._messages = {}, this._listeners = /* @__PURE__ */ new Set(), this.registerMessages(e.messages || {}), this._key && Vr(this);
|
|
1420
1444
|
}
|
|
1421
1445
|
key() {
|
|
1422
1446
|
return this._key;
|
|
@@ -1436,8 +1460,8 @@ var Ar = "yoya-ui:i18n", U = /* @__PURE__ */ new Map(), jr = class {
|
|
|
1436
1460
|
clearPersistedLanguage() {
|
|
1437
1461
|
if (!this._storageKey) {
|
|
1438
1462
|
if (!this._sharedStorageKey) return this;
|
|
1439
|
-
let e =
|
|
1440
|
-
return delete e[this._key],
|
|
1463
|
+
let e = Kr(this._storage, this._sharedStorageKey);
|
|
1464
|
+
return delete e[this._key], qr(this._storage, this._sharedStorageKey, e), this;
|
|
1441
1465
|
}
|
|
1442
1466
|
try {
|
|
1443
1467
|
this._storage.removeItem(this._storageKey);
|
|
@@ -1445,12 +1469,12 @@ var Ar = "yoya-ui:i18n", U = /* @__PURE__ */ new Map(), jr = class {
|
|
|
1445
1469
|
return this;
|
|
1446
1470
|
}
|
|
1447
1471
|
register(e, t = {}) {
|
|
1448
|
-
return e ? (
|
|
1449
|
-
this._messages[e] =
|
|
1472
|
+
return e ? ($r(t).forEach((t) => {
|
|
1473
|
+
this._messages[e] = Xr(this._messages[e] || {}, t);
|
|
1450
1474
|
}), this._notify(), this) : this;
|
|
1451
1475
|
}
|
|
1452
1476
|
registerMessages(e = {}) {
|
|
1453
|
-
return
|
|
1477
|
+
return Qr(e).forEach((e) => {
|
|
1454
1478
|
if (e.language) {
|
|
1455
1479
|
this.register(e.language, e.messages || {});
|
|
1456
1480
|
return;
|
|
@@ -1461,11 +1485,11 @@ var Ar = "yoya-ui:i18n", U = /* @__PURE__ */ new Map(), jr = class {
|
|
|
1461
1485
|
}), this;
|
|
1462
1486
|
}
|
|
1463
1487
|
t(e, t = {}, n = void 0) {
|
|
1464
|
-
let r =
|
|
1465
|
-
return
|
|
1488
|
+
let r = Jr(this._messages[this._language], e) ?? Jr(this._messages[this._fallbackLanguage], e) ?? n ?? e;
|
|
1489
|
+
return Yr(typeof r == "function" ? r(t, this) : r, t);
|
|
1466
1490
|
}
|
|
1467
1491
|
text(e, t = {}, n = void 0) {
|
|
1468
|
-
return new
|
|
1492
|
+
return new Fr(this, e, t, n);
|
|
1469
1493
|
}
|
|
1470
1494
|
subscribe(e) {
|
|
1471
1495
|
return this._listeners.add(e), () => {
|
|
@@ -1478,7 +1502,7 @@ var Ar = "yoya-ui:i18n", U = /* @__PURE__ */ new Map(), jr = class {
|
|
|
1478
1502
|
} catch {
|
|
1479
1503
|
return e;
|
|
1480
1504
|
}
|
|
1481
|
-
return this._sharedStorageKey &&
|
|
1505
|
+
return this._sharedStorageKey && Kr(this._storage, this._sharedStorageKey)[this._key] || e;
|
|
1482
1506
|
}
|
|
1483
1507
|
_persistLanguage() {
|
|
1484
1508
|
if (this._storageKey) {
|
|
@@ -1488,14 +1512,14 @@ var Ar = "yoya-ui:i18n", U = /* @__PURE__ */ new Map(), jr = class {
|
|
|
1488
1512
|
return;
|
|
1489
1513
|
}
|
|
1490
1514
|
if (this._sharedStorageKey) {
|
|
1491
|
-
let e =
|
|
1492
|
-
e[this._key] = this._language,
|
|
1515
|
+
let e = Kr(this._storage, this._sharedStorageKey);
|
|
1516
|
+
e[this._key] = this._language, qr(this._storage, this._sharedStorageKey, e);
|
|
1493
1517
|
}
|
|
1494
1518
|
}
|
|
1495
1519
|
_notify() {
|
|
1496
1520
|
this._listeners.forEach((e) => e(this));
|
|
1497
1521
|
}
|
|
1498
|
-
},
|
|
1522
|
+
}, Fr = class extends l {
|
|
1499
1523
|
constructor(e, t, n = {}, r = void 0) {
|
|
1500
1524
|
super(e.t(t, n, r)), this._i18n = e, this._key = t, this._params = n || {}, this._defaultValue = r, this._unsubscribe = e.subscribe(() => this.refresh());
|
|
1501
1525
|
}
|
|
@@ -1515,16 +1539,16 @@ var Ar = "yoya-ui:i18n", U = /* @__PURE__ */ new Map(), jr = class {
|
|
|
1515
1539
|
return this._unsubscribe &&= (this._unsubscribe(), null), super.destroy();
|
|
1516
1540
|
}
|
|
1517
1541
|
};
|
|
1518
|
-
function
|
|
1519
|
-
return new
|
|
1542
|
+
function Ir(e = {}) {
|
|
1543
|
+
return new Pr(e);
|
|
1520
1544
|
}
|
|
1521
|
-
var
|
|
1522
|
-
function
|
|
1523
|
-
return
|
|
1545
|
+
var G = Ir();
|
|
1546
|
+
function Lr(e, t = {}) {
|
|
1547
|
+
return G.text(e, t);
|
|
1524
1548
|
}
|
|
1525
|
-
var
|
|
1526
|
-
function
|
|
1527
|
-
return
|
|
1549
|
+
var K = G;
|
|
1550
|
+
function Rr(e = G) {
|
|
1551
|
+
return K = e, String.prototype._yoyaUiStringShortcutInstalled ? e : (Object.defineProperty(String.prototype, "_yoyaUiStringShortcutInstalled", {
|
|
1528
1552
|
configurable: !0,
|
|
1529
1553
|
enumerable: !1,
|
|
1530
1554
|
value: !0
|
|
@@ -1532,43 +1556,43 @@ function Fr(e = W) {
|
|
|
1532
1556
|
configurable: !0,
|
|
1533
1557
|
enumerable: !1,
|
|
1534
1558
|
value: function(e, t, n) {
|
|
1535
|
-
let r = String(this), i = {}, a =
|
|
1536
|
-
return
|
|
1559
|
+
let r = String(this), i = {}, a = K;
|
|
1560
|
+
return Br(t) ? a = t : typeof t == "string" ? a = Ur(t) || K : (i = t || {}, Br(n) ? a = n : typeof n == "string" && (a = Ur(n) || K)), a.text(e || r, i, r);
|
|
1537
1561
|
}
|
|
1538
1562
|
}), e);
|
|
1539
1563
|
}
|
|
1540
|
-
function
|
|
1541
|
-
let n =
|
|
1542
|
-
|
|
1564
|
+
function zr(e, t) {
|
|
1565
|
+
let n = K;
|
|
1566
|
+
K = e || n;
|
|
1543
1567
|
try {
|
|
1544
1568
|
return t();
|
|
1545
1569
|
} finally {
|
|
1546
|
-
|
|
1570
|
+
K = n;
|
|
1547
1571
|
}
|
|
1548
1572
|
}
|
|
1549
|
-
function
|
|
1573
|
+
function Br(e) {
|
|
1550
1574
|
return !!(e && typeof e.text == "function");
|
|
1551
1575
|
}
|
|
1552
|
-
function
|
|
1576
|
+
function Vr(e) {
|
|
1553
1577
|
let t = e?.key?.();
|
|
1554
|
-
return t ? (
|
|
1555
|
-
|
|
1578
|
+
return t ? (W.set(t, e), () => {
|
|
1579
|
+
W.get(t) === e && W.delete(t);
|
|
1556
1580
|
}) : () => {};
|
|
1557
1581
|
}
|
|
1558
|
-
function
|
|
1582
|
+
function Hr(e) {
|
|
1559
1583
|
let t = typeof e == "string" ? e : e?.key?.();
|
|
1560
|
-
return t &&
|
|
1584
|
+
return t && W.delete(t), t;
|
|
1561
1585
|
}
|
|
1562
|
-
function
|
|
1563
|
-
return e &&
|
|
1586
|
+
function Ur(e) {
|
|
1587
|
+
return e && W.get(e) || null;
|
|
1564
1588
|
}
|
|
1565
|
-
function
|
|
1566
|
-
return new Map(
|
|
1589
|
+
function Wr() {
|
|
1590
|
+
return new Map(W);
|
|
1567
1591
|
}
|
|
1568
|
-
function
|
|
1569
|
-
return
|
|
1592
|
+
function Gr(e) {
|
|
1593
|
+
return Kr(e || ei(), Nr);
|
|
1570
1594
|
}
|
|
1571
|
-
function
|
|
1595
|
+
function Kr(e, t) {
|
|
1572
1596
|
if (!e) return {};
|
|
1573
1597
|
try {
|
|
1574
1598
|
let n = e.getItem(t);
|
|
@@ -1579,72 +1603,72 @@ function Ur(e, t) {
|
|
|
1579
1603
|
return {};
|
|
1580
1604
|
}
|
|
1581
1605
|
}
|
|
1582
|
-
function
|
|
1606
|
+
function qr(e, t, n) {
|
|
1583
1607
|
if (e) try {
|
|
1584
1608
|
e.setItem(t, JSON.stringify(n));
|
|
1585
1609
|
} catch {}
|
|
1586
1610
|
}
|
|
1587
|
-
|
|
1588
|
-
function
|
|
1611
|
+
Rr(G);
|
|
1612
|
+
function Jr(e, t) {
|
|
1589
1613
|
if (!(!e || !t)) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : String(t).split(".").reduce((e, t) => {
|
|
1590
1614
|
if (e && typeof e == "object" && Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
1591
1615
|
}, e);
|
|
1592
1616
|
}
|
|
1593
|
-
function
|
|
1617
|
+
function Yr(e, t) {
|
|
1594
1618
|
return String(e).replace(/\{([^{}]+)\}/g, (e, n) => {
|
|
1595
1619
|
let r = t?.[n.trim()];
|
|
1596
1620
|
return r == null ? e : String(r);
|
|
1597
1621
|
});
|
|
1598
1622
|
}
|
|
1599
|
-
function
|
|
1623
|
+
function Xr(e, t) {
|
|
1600
1624
|
let n = { ...e };
|
|
1601
1625
|
return Object.entries(t || {}).forEach(([e, t]) => {
|
|
1602
|
-
|
|
1626
|
+
Zr(t) && Zr(n[e]) ? n[e] = Xr(n[e], t) : n[e] = t;
|
|
1603
1627
|
}), n;
|
|
1604
1628
|
}
|
|
1605
|
-
function
|
|
1629
|
+
function Zr(e) {
|
|
1606
1630
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
1607
1631
|
}
|
|
1608
|
-
function
|
|
1609
|
-
return Array.isArray(e) ? e.flatMap((e) =>
|
|
1632
|
+
function Qr(e) {
|
|
1633
|
+
return Array.isArray(e) ? e.flatMap((e) => Qr(e)) : [e || {}];
|
|
1610
1634
|
}
|
|
1611
|
-
function
|
|
1612
|
-
return Array.isArray(e) ? e.flatMap((e) =>
|
|
1635
|
+
function $r(e) {
|
|
1636
|
+
return Array.isArray(e) ? e.flatMap((e) => $r(e)) : [e || {}];
|
|
1613
1637
|
}
|
|
1614
|
-
function
|
|
1638
|
+
function ei(e) {
|
|
1615
1639
|
if (e) return e;
|
|
1616
1640
|
try {
|
|
1617
1641
|
if (typeof globalThis < "u" && globalThis.localStorage) return globalThis.localStorage;
|
|
1618
1642
|
} catch {}
|
|
1619
|
-
return
|
|
1643
|
+
return ni();
|
|
1620
1644
|
}
|
|
1621
|
-
var
|
|
1622
|
-
function
|
|
1645
|
+
var ti = /* @__PURE__ */ new Map();
|
|
1646
|
+
function ni() {
|
|
1623
1647
|
return {
|
|
1624
1648
|
getItem(e) {
|
|
1625
|
-
return
|
|
1649
|
+
return ti.has(e) ? ti.get(e) : null;
|
|
1626
1650
|
},
|
|
1627
1651
|
setItem(e, t) {
|
|
1628
|
-
|
|
1652
|
+
ti.set(e, String(t));
|
|
1629
1653
|
},
|
|
1630
1654
|
removeItem(e) {
|
|
1631
|
-
|
|
1655
|
+
ti.delete(e);
|
|
1632
1656
|
}
|
|
1633
1657
|
};
|
|
1634
1658
|
}
|
|
1635
1659
|
//#endregion
|
|
1636
1660
|
//#region src/core/state-node.js
|
|
1637
|
-
var
|
|
1661
|
+
var ri = /* @__PURE__ */ new Set([
|
|
1638
1662
|
"state",
|
|
1639
1663
|
"render",
|
|
1640
1664
|
"update"
|
|
1641
|
-
]),
|
|
1665
|
+
]), ii = /* @__PURE__ */ new Set([
|
|
1642
1666
|
"destroy",
|
|
1643
1667
|
"getState",
|
|
1644
1668
|
"setState",
|
|
1645
1669
|
"subscribe"
|
|
1646
1670
|
]);
|
|
1647
|
-
function
|
|
1671
|
+
function ai(e = {}) {
|
|
1648
1672
|
if (typeof e.render != "function") throw TypeError("vStateNode requires a render function");
|
|
1649
1673
|
let t = typeof e.state == "function" ? e.state() : { ...e.state || {} }, n = /* @__PURE__ */ new Set(), r = !1, i = null, a = {
|
|
1650
1674
|
destroy() {
|
|
@@ -1679,8 +1703,8 @@ function ni(e = {}) {
|
|
|
1679
1703
|
return n.add(e), () => n.delete(e);
|
|
1680
1704
|
}
|
|
1681
1705
|
};
|
|
1682
|
-
for (let t of Object.keys(e)) if (!(
|
|
1683
|
-
if (
|
|
1706
|
+
for (let t of Object.keys(e)) if (!(ri.has(t) || typeof e[t] != "function")) {
|
|
1707
|
+
if (ii.has(t)) throw TypeError(`vStateNode config key "${t}" conflicts with the built-in API`);
|
|
1684
1708
|
a[t] = e[t];
|
|
1685
1709
|
}
|
|
1686
1710
|
return a;
|
|
@@ -1696,79 +1720,134 @@ function ni(e = {}) {
|
|
|
1696
1720
|
o();
|
|
1697
1721
|
}
|
|
1698
1722
|
}
|
|
1699
|
-
_(h, { vStateNode:
|
|
1723
|
+
_(h, { vStateNode: ai });
|
|
1700
1724
|
//#endregion
|
|
1701
1725
|
//#region src/core/theme.js
|
|
1702
|
-
var
|
|
1726
|
+
var oi = [
|
|
1703
1727
|
"light",
|
|
1704
1728
|
"dark",
|
|
1705
1729
|
"system"
|
|
1706
|
-
],
|
|
1707
|
-
function
|
|
1730
|
+
], si = "yoya-theme-mode", ci = "yoya-theme-name";
|
|
1731
|
+
function li() {
|
|
1708
1732
|
return typeof document > "u" ? null : document.documentElement;
|
|
1709
1733
|
}
|
|
1710
|
-
function
|
|
1734
|
+
function q() {
|
|
1711
1735
|
try {
|
|
1712
1736
|
return typeof localStorage < "u" && localStorage !== null;
|
|
1713
1737
|
} catch {
|
|
1714
1738
|
return !1;
|
|
1715
1739
|
}
|
|
1716
1740
|
}
|
|
1717
|
-
function
|
|
1718
|
-
let n =
|
|
1719
|
-
if (r && (r.dataset.yoyaMode = n), t.persist &&
|
|
1720
|
-
localStorage.setItem(
|
|
1741
|
+
function ui(e = "light", t = {}) {
|
|
1742
|
+
let n = oi.includes(e) ? e : "light", r = li();
|
|
1743
|
+
if (r && (r.dataset.yoyaMode = n), t.persist && q()) try {
|
|
1744
|
+
localStorage.setItem(si, n);
|
|
1721
1745
|
} catch {}
|
|
1722
1746
|
return n;
|
|
1723
1747
|
}
|
|
1724
|
-
function
|
|
1725
|
-
let e =
|
|
1726
|
-
return
|
|
1748
|
+
function di() {
|
|
1749
|
+
let e = li(), t = e && e.dataset.yoyaMode;
|
|
1750
|
+
return oi.includes(t) ? t : "light";
|
|
1727
1751
|
}
|
|
1728
|
-
function
|
|
1729
|
-
let e =
|
|
1752
|
+
function fi() {
|
|
1753
|
+
let e = di();
|
|
1730
1754
|
return e === "system" ? typeof window > "u" || typeof window.matchMedia != "function" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : e;
|
|
1731
1755
|
}
|
|
1732
|
-
function
|
|
1733
|
-
let n =
|
|
1756
|
+
function pi(e = "", t = {}) {
|
|
1757
|
+
let n = li();
|
|
1734
1758
|
if (!e) {
|
|
1735
|
-
if (n && delete n.dataset.yoyaTheme, t.persist &&
|
|
1736
|
-
localStorage.removeItem(
|
|
1759
|
+
if (n && delete n.dataset.yoyaTheme, t.persist && q()) try {
|
|
1760
|
+
localStorage.removeItem(ci);
|
|
1737
1761
|
} catch {}
|
|
1738
1762
|
return "";
|
|
1739
1763
|
}
|
|
1740
|
-
if (n && (n.dataset.yoyaTheme = e), t.persist &&
|
|
1741
|
-
localStorage.setItem(
|
|
1764
|
+
if (n && (n.dataset.yoyaTheme = e), t.persist && q()) try {
|
|
1765
|
+
localStorage.setItem(ci, e);
|
|
1742
1766
|
} catch {}
|
|
1743
1767
|
return e;
|
|
1744
1768
|
}
|
|
1745
|
-
function
|
|
1746
|
-
let e =
|
|
1769
|
+
function mi() {
|
|
1770
|
+
let e = li();
|
|
1747
1771
|
return e && e.dataset.yoyaTheme || "";
|
|
1748
1772
|
}
|
|
1749
|
-
function
|
|
1773
|
+
function hi(e = {}) {
|
|
1750
1774
|
let t = e.mode, n = e.theme;
|
|
1751
|
-
if (t === void 0 &&
|
|
1752
|
-
let e = localStorage.getItem(
|
|
1753
|
-
|
|
1775
|
+
if (t === void 0 && q()) {
|
|
1776
|
+
let e = localStorage.getItem(si);
|
|
1777
|
+
oi.includes(e) && (t = e);
|
|
1754
1778
|
}
|
|
1755
|
-
return n === void 0 &&
|
|
1756
|
-
mode:
|
|
1757
|
-
theme:
|
|
1779
|
+
return n === void 0 && q() && (n = localStorage.getItem(ci) || ""), t !== void 0 && ui(t, { persist: e.persist }), n !== void 0 && pi(n, { persist: e.persist }), {
|
|
1780
|
+
mode: di(),
|
|
1781
|
+
theme: mi()
|
|
1758
1782
|
};
|
|
1759
1783
|
}
|
|
1760
1784
|
//#endregion
|
|
1761
|
-
//#region src/
|
|
1762
|
-
var
|
|
1763
|
-
function
|
|
1764
|
-
|
|
1785
|
+
//#region src/core/request.js
|
|
1786
|
+
var gi = null;
|
|
1787
|
+
function _i({ submit: e } = {}) {
|
|
1788
|
+
return gi = typeof e == "function" ? e : null, gi;
|
|
1789
|
+
}
|
|
1790
|
+
var vi = class {
|
|
1791
|
+
method() {
|
|
1792
|
+
return "GET";
|
|
1793
|
+
}
|
|
1794
|
+
headers() {
|
|
1795
|
+
return {};
|
|
1796
|
+
}
|
|
1797
|
+
cookies() {
|
|
1798
|
+
return null;
|
|
1799
|
+
}
|
|
1800
|
+
body() {
|
|
1801
|
+
return null;
|
|
1802
|
+
}
|
|
1803
|
+
params() {
|
|
1804
|
+
return {};
|
|
1805
|
+
}
|
|
1806
|
+
address() {
|
|
1807
|
+
return "";
|
|
1808
|
+
}
|
|
1809
|
+
submit() {
|
|
1810
|
+
if (typeof gi != "function") throw Error("RequestBase: 未注册请求传输,请先 configureRequest({ submit })");
|
|
1811
|
+
return gi(this);
|
|
1812
|
+
}
|
|
1813
|
+
}, yi = class e {
|
|
1814
|
+
constructor({ ok: e = !0, code: t = "0", msg: n = null, showType: r = 0, data: i = null, kind: a = "detail", pageNum: o = null, pageSize: s = null, total: c = null } = {}) {
|
|
1815
|
+
this.ok = e, this.code = t, this.msg = n, this.showType = r, this.data = i, this.kind = a, this.pageNum = o, this.pageSize = s, this.total = c;
|
|
1816
|
+
}
|
|
1817
|
+
get isSuccess() {
|
|
1818
|
+
return !!this.ok;
|
|
1819
|
+
}
|
|
1820
|
+
get pages() {
|
|
1821
|
+
return this.pageSize > 0 ? Math.ceil((this.total ?? 0) / this.pageSize) : 0;
|
|
1822
|
+
}
|
|
1823
|
+
static from(t, n = {}) {
|
|
1824
|
+
if (!t || t.ok === !1) {
|
|
1825
|
+
let e = Error(t?.msg || "请求失败");
|
|
1826
|
+
throw e.code = t?.code, e.showType = t?.showType, e;
|
|
1827
|
+
}
|
|
1828
|
+
let r = t.data, i = Array.isArray(r) && t.pageNum != null, a = Array.isArray(r);
|
|
1829
|
+
return new e({
|
|
1830
|
+
ok: t.ok,
|
|
1831
|
+
code: t.code,
|
|
1832
|
+
msg: t.msg,
|
|
1833
|
+
showType: t.showType,
|
|
1834
|
+
kind: i ? "page" : a ? "list" : "detail",
|
|
1835
|
+
data: i || a ? (r ?? []).map((e) => n.toItem ? n.toItem(e) : e) : n.toDetail ? n.toDetail(r) : r,
|
|
1836
|
+
pageNum: t.pageNum,
|
|
1837
|
+
pageSize: t.pageSize,
|
|
1838
|
+
total: t.total
|
|
1839
|
+
});
|
|
1840
|
+
}
|
|
1841
|
+
}, J = 8, bi = null;
|
|
1842
|
+
function xi() {
|
|
1843
|
+
bi ||= rn(".yoya-vrouter-views-titlebar,\n.yoya-vrouter-views-popup {\n -ms-overflow-style: none;\n scrollbar-width: none;\n}\n.yoya-vrouter-views-titlebar::-webkit-scrollbar,\n.yoya-vrouter-views-popup::-webkit-scrollbar {\n display: none;\n height: 0;\n width: 0;\n}\n.yoya-vrouter-views-popup-item:hover {\n background: var(--yoya-color-surface-hover, #eef3f9);\n}\n.yoya-vrouter-views-popup-item[aria-current='true'] {\n background: var(--yoya-color-primary-subtle, #e8f0fe);\n color: var(--yoya-color-primary, #1f6feb);\n}\n.yoya-vrouter-views-popup-close {\n color: var(--yoya-color-text-secondary, #57606a);\n opacity: 0.65;\n}\n.yoya-vrouter-views-popup-item:hover .yoya-vrouter-views-popup-close,\n.yoya-vrouter-views-popup-close:hover {\n color: var(--yoya-color-text-danger, #b91c1c);\n opacity: 1;\n}\n.yoya-vrouter-views-context-item:hover {\n background: var(--yoya-color-surface-hover, #f6f8fa);\n}\n.yoya-vrouter-views-context-separator {\n background: var(--yoya-color-border, #d0d7de);\n height: 1px;\n margin: 4px 6px;\n}", "data-yoya-vrouter-views-popup-style");
|
|
1765
1844
|
}
|
|
1766
|
-
function
|
|
1845
|
+
function Si(e) {
|
|
1767
1846
|
let t = [e._defaultPath || "/", e._routes.map((e) => e.pattern).join("|")].join("::"), n = 0;
|
|
1768
1847
|
for (let e = 0; e < t.length; e += 1) n = n * 31 + t.charCodeAt(e) | 0;
|
|
1769
1848
|
return `yoya-ui:router-views:${(n >>> 0).toString(36)}`;
|
|
1770
1849
|
}
|
|
1771
|
-
function
|
|
1850
|
+
function Ci(e) {
|
|
1772
1851
|
if (typeof localStorage > "u") return null;
|
|
1773
1852
|
try {
|
|
1774
1853
|
let t = JSON.parse(localStorage.getItem(e) || "null");
|
|
@@ -1777,7 +1856,7 @@ function hi(e) {
|
|
|
1777
1856
|
return null;
|
|
1778
1857
|
}
|
|
1779
1858
|
}
|
|
1780
|
-
var
|
|
1859
|
+
var wi = class extends h {
|
|
1781
1860
|
constructor(e = null) {
|
|
1782
1861
|
super("div"), this._routes = [], this._defaultPath = null, this._notFoundView = null, this._beforeEach = null, this._currentPath = "/", this._currentParams = {}, this._currentQuery = {}, this._currentRoute = null, this._currentView = null, this._loadingView = null, this._errorView = null, this._navigationGeneration = 0, this._outlet = this, this._subscribers = /* @__PURE__ */ new Set(), this._ignoreNextHashPath = null, this._mode = "hash", this._started = !1, this._onHashChange = () => this._handleHashChange(), this._onPopState = () => this._handlePopState(), this.attr("data-yoya-router", ""), e !== null && this.setup(e);
|
|
1783
1862
|
}
|
|
@@ -1795,7 +1874,7 @@ var gi = class extends h {
|
|
|
1795
1874
|
return n && this.stop(), this._mode = t, n && this.start(), this;
|
|
1796
1875
|
}
|
|
1797
1876
|
route(e, t) {
|
|
1798
|
-
let n =
|
|
1877
|
+
let n = Mi(e, t);
|
|
1799
1878
|
return this._routes.push(n), this;
|
|
1800
1879
|
}
|
|
1801
1880
|
notFound(e) {
|
|
@@ -1811,19 +1890,19 @@ var gi = class extends h {
|
|
|
1811
1890
|
return this._beforeEach = e, this;
|
|
1812
1891
|
}
|
|
1813
1892
|
start() {
|
|
1814
|
-
|
|
1815
|
-
let e =
|
|
1893
|
+
this._started ||= (this._stopListening = this._mode === "history" ? O("popstate", this._onPopState) : O("hashchange", this._onHashChange), !0);
|
|
1894
|
+
let e = Ji(this._mode);
|
|
1816
1895
|
return (this._mode === "history" ? e === "/" || e === "/index.html" : !window.location.hash) && this._defaultPath ? this.navigate(this._defaultPath, { replace: !0 }) : this.refresh();
|
|
1817
1896
|
}
|
|
1818
1897
|
stop() {
|
|
1819
|
-
return this._started
|
|
1898
|
+
return this._started &&= (this._stopListening?.(), this._stopListening = null, !1), this;
|
|
1820
1899
|
}
|
|
1821
1900
|
navigate(e, t = {}) {
|
|
1822
1901
|
let n = Z(e), r = this._resolve(n);
|
|
1823
|
-
return this._canEnter(r.context) ? (
|
|
1902
|
+
return this._canEnter(r.context) ? (Xi(n, t, this._mode) && !t.replace && this._mode === "hash" && (this._ignoreNextHashPath = n), this._renderResolved(r), this) : this;
|
|
1824
1903
|
}
|
|
1825
1904
|
refresh() {
|
|
1826
|
-
let e =
|
|
1905
|
+
let e = Ji(this._mode), t = this._resolve(e);
|
|
1827
1906
|
return this._canEnter(t.context) && this._renderResolved(t), this;
|
|
1828
1907
|
}
|
|
1829
1908
|
renderPath(e) {
|
|
@@ -1869,16 +1948,16 @@ var gi = class extends h {
|
|
|
1869
1948
|
_resolve(e) {
|
|
1870
1949
|
let t = this._routes.map((t) => ({
|
|
1871
1950
|
route: t,
|
|
1872
|
-
match:
|
|
1951
|
+
match: Gi(t.pattern, e)
|
|
1873
1952
|
})).find(({ match: e }) => e);
|
|
1874
1953
|
if (t) return {
|
|
1875
|
-
context:
|
|
1954
|
+
context: Ki(this, e, t.route, t.match),
|
|
1876
1955
|
route: t.route,
|
|
1877
1956
|
view: t.route.view
|
|
1878
1957
|
};
|
|
1879
1958
|
let n = Q(e);
|
|
1880
1959
|
return {
|
|
1881
|
-
context:
|
|
1960
|
+
context: Ki(this, e, null, {
|
|
1882
1961
|
params: {},
|
|
1883
1962
|
pathname: n.pathname,
|
|
1884
1963
|
query: n.query
|
|
@@ -1888,7 +1967,7 @@ var gi = class extends h {
|
|
|
1888
1967
|
};
|
|
1889
1968
|
}
|
|
1890
1969
|
_handleHashChange() {
|
|
1891
|
-
let e =
|
|
1970
|
+
let e = qi();
|
|
1892
1971
|
return this._ignoreNextHashPath === e ? (this._ignoreNextHashPath = null, this) : (this._ignoreNextHashPath = null, e === this._currentPath ? this : this.refresh());
|
|
1893
1972
|
}
|
|
1894
1973
|
_handlePopState() {
|
|
@@ -1905,7 +1984,7 @@ var gi = class extends h {
|
|
|
1905
1984
|
}
|
|
1906
1985
|
_renderResolved(e) {
|
|
1907
1986
|
let { context: t, route: n, view: r } = e, i = typeof r == "function" ? r(t) : r;
|
|
1908
|
-
if (this._navigationGeneration += 1, !
|
|
1987
|
+
if (this._navigationGeneration += 1, !Ui(i)) {
|
|
1909
1988
|
this._commitView(e, X(i, t));
|
|
1910
1989
|
return;
|
|
1911
1990
|
}
|
|
@@ -1926,32 +2005,32 @@ var gi = class extends h {
|
|
|
1926
2005
|
this._destroyCurrentView(), i._children = [], i._el && i._el.replaceChildren(), i.child(t), this._currentPath = n.path, this._currentParams = n.params, this._currentQuery = n.query, this._currentRoute = r, this._currentView = t, this._subscribers.forEach((e) => e(n, this));
|
|
1927
2006
|
}
|
|
1928
2007
|
_buildLoadingView(e, t) {
|
|
1929
|
-
return
|
|
2008
|
+
return Wi(e?.loading ?? this._loadingView ?? Vi, [t]);
|
|
1930
2009
|
}
|
|
1931
2010
|
_buildErrorView(e, t, n) {
|
|
1932
|
-
return
|
|
2011
|
+
return Wi(e?.error ?? this._errorView ?? Hi, [n, t]);
|
|
1933
2012
|
}
|
|
1934
2013
|
_destroyCurrentView() {
|
|
1935
2014
|
this._currentView?.destroy && this._currentView.destroy(), this._currentView = null;
|
|
1936
2015
|
}
|
|
1937
2016
|
};
|
|
1938
|
-
function
|
|
1939
|
-
let r = p(e, t, n), i = new
|
|
2017
|
+
function Ti(e = null, t = null, n = null) {
|
|
2018
|
+
let r = p(e, t, n), i = new wi(r.first);
|
|
1940
2019
|
return m(i, r.options), typeof r.callback == "function" && r.callback(i), i;
|
|
1941
2020
|
}
|
|
1942
|
-
var
|
|
1943
|
-
function
|
|
2021
|
+
var Ei = Ti;
|
|
2022
|
+
function Di(e, t) {
|
|
1944
2023
|
return {
|
|
1945
2024
|
config: t,
|
|
1946
2025
|
pattern: e
|
|
1947
2026
|
};
|
|
1948
2027
|
}
|
|
1949
|
-
function
|
|
1950
|
-
let r = p(e, t, n), i = new
|
|
1951
|
-
return i.vRoute = (e, t) => (i.route(e, t), i),
|
|
2028
|
+
function Oi(e = null, t = null, n = null) {
|
|
2029
|
+
let r = p(e, t, n), i = new wi();
|
|
2030
|
+
return i.vRoute = (e, t) => (i.route(e, t), i), Fi(i, r.first), m(i, r.options), typeof r.callback == "function" && r.callback(i), i;
|
|
1952
2031
|
}
|
|
1953
|
-
function
|
|
1954
|
-
|
|
2032
|
+
function ki(e, t = null, n = null) {
|
|
2033
|
+
Ni(e);
|
|
1955
2034
|
let r = new h("a"), i = {
|
|
1956
2035
|
exact: !0,
|
|
1957
2036
|
label: null,
|
|
@@ -1960,21 +2039,21 @@ function xi(e, t = null, n = null) {
|
|
|
1960
2039
|
replace: !1,
|
|
1961
2040
|
to: "/"
|
|
1962
2041
|
}, a = new h("span").className("yoya-vlink-label");
|
|
1963
|
-
r.className("yoya-vlink"), r.attr("data-router-link", "true"), r.child(a), r.to = (e) => Y(r, i, "to", e), r.params = (e) => Y(r, i, "params", e || {}), r.query = (e) => Y(r, i, "query", e || {}), r.replace = (e) => Y(r, i, "replace", !!e), r.exact = (e) => Y(r, i, "exact", !!e), r.label = (e) => e === void 0 ? i.label : (i.label = e,
|
|
1964
|
-
|
|
2042
|
+
r.className("yoya-vlink"), r.attr("data-router-link", "true"), r.child(a), r.to = (e) => Y(r, i, "to", e), r.params = (e) => Y(r, i, "params", e || {}), r.query = (e) => Y(r, i, "query", e || {}), r.replace = (e) => Y(r, i, "replace", !!e), r.exact = (e) => Y(r, i, "exact", !!e), r.label = (e) => e === void 0 ? i.label : (i.label = e, N(a, bn(e)), r), Ii(r, i, t), Li(r, i, e), r.on("click", (t) => {
|
|
2043
|
+
Bi(t, r) && (t.preventDefault(), e.navigate(Ri(i.to, i.params, i.query), { replace: i.replace }));
|
|
1965
2044
|
});
|
|
1966
|
-
let o = e.subscribe(() =>
|
|
2045
|
+
let o = e.subscribe(() => Li(r, i, e)), s = r.destroy.bind(r);
|
|
1967
2046
|
return r.destroy = () => (o(), s()), typeof n == "function" && n(r), r;
|
|
1968
2047
|
}
|
|
1969
|
-
function
|
|
1970
|
-
|
|
2048
|
+
function Ai(e, t = null, n = null) {
|
|
2049
|
+
Ni(e);
|
|
1971
2050
|
let r = new h("div");
|
|
1972
2051
|
r.className("yoya-vrouter-view"), r.attr("data-router-view", "true"), typeof t == "function" ? t(r) : t && r.setup(t), e.outlet(r);
|
|
1973
2052
|
let i = r.destroy.bind(r);
|
|
1974
2053
|
return r.destroy = () => (e.outlet() === r && e.outlet(e), i()), typeof n == "function" && n(r), r;
|
|
1975
2054
|
}
|
|
1976
|
-
function
|
|
1977
|
-
|
|
2055
|
+
function ji(e, t = null, n = null) {
|
|
2056
|
+
Ni(e);
|
|
1978
2057
|
let r = new h("div"), i = new h("header").className("yoya-vrouter-views-titlebar").attr({
|
|
1979
2058
|
role: "tablist",
|
|
1980
2059
|
"aria-label": "已打开页面"
|
|
@@ -1986,7 +2065,7 @@ function Ci(e, t = null, n = null) {
|
|
|
1986
2065
|
alignItems: "center",
|
|
1987
2066
|
background: "transparent",
|
|
1988
2067
|
border: "0",
|
|
1989
|
-
color:
|
|
2068
|
+
color: k("color-text-secondary", "#57606a"),
|
|
1990
2069
|
cursor: "pointer",
|
|
1991
2070
|
display: "none",
|
|
1992
2071
|
flexShrink: "0",
|
|
@@ -2006,8 +2085,8 @@ function Ci(e, t = null, n = null) {
|
|
|
2006
2085
|
role: "menu",
|
|
2007
2086
|
"aria-label": "已打开页面"
|
|
2008
2087
|
}).styles({
|
|
2009
|
-
background:
|
|
2010
|
-
border:
|
|
2088
|
+
background: k("color-surface", "#ffffff"),
|
|
2089
|
+
border: A("color-border", "#d0d7de"),
|
|
2011
2090
|
borderRadius: "8px",
|
|
2012
2091
|
boxShadow: "0 12px 28px rgba(15, 23, 42, 0.18)",
|
|
2013
2092
|
display: "none",
|
|
@@ -2025,7 +2104,7 @@ function Ci(e, t = null, n = null) {
|
|
|
2025
2104
|
overflow: !1,
|
|
2026
2105
|
persist: !0,
|
|
2027
2106
|
popupOpen: !1,
|
|
2028
|
-
storageKey:
|
|
2107
|
+
storageKey: Si(e),
|
|
2029
2108
|
suppressPersist: !1,
|
|
2030
2109
|
tabs: /* @__PURE__ */ new Map(),
|
|
2031
2110
|
title: "工作区",
|
|
@@ -2033,19 +2112,19 @@ function Ci(e, t = null, n = null) {
|
|
|
2033
2112
|
titlePosition: "top"
|
|
2034
2113
|
};
|
|
2035
2114
|
r.className("yoya-vrouter-views"), r.styles({
|
|
2036
|
-
border:
|
|
2037
|
-
|
|
2115
|
+
border: A("color-border", "#d0d7de"),
|
|
2116
|
+
boxSizing: "border-box",
|
|
2038
2117
|
overflow: "hidden"
|
|
2039
2118
|
}), i.styles({
|
|
2040
|
-
background:
|
|
2041
|
-
borderBottom:
|
|
2119
|
+
background: k("color-surface-hover", "#f6f8fa"),
|
|
2120
|
+
borderBottom: A("color-border", "#d0d7de"),
|
|
2042
2121
|
boxSizing: "border-box",
|
|
2043
|
-
color:
|
|
2122
|
+
color: k("color-text-secondary", "#57606a"),
|
|
2044
2123
|
display: "flex",
|
|
2045
2124
|
flexWrap: "nowrap",
|
|
2046
2125
|
fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
2047
2126
|
fontSize: "13px",
|
|
2048
|
-
gap: "
|
|
2127
|
+
gap: "0px",
|
|
2049
2128
|
msOverflowStyle: "none",
|
|
2050
2129
|
overflowX: "auto",
|
|
2051
2130
|
overflowY: "hidden",
|
|
@@ -2090,25 +2169,25 @@ function Ci(e, t = null, n = null) {
|
|
|
2090
2169
|
alignItems: t ? "stretch" : null,
|
|
2091
2170
|
display: t ? "flex" : null
|
|
2092
2171
|
}), i.styles({
|
|
2093
|
-
background:
|
|
2094
|
-
borderBottom: t ? null :
|
|
2172
|
+
background: k("color-surface-hover", "#f6f8fa"),
|
|
2173
|
+
borderBottom: t ? null : A("color-border", "#d0d7de"),
|
|
2095
2174
|
borderLeft: e === "right" ? "1px solid" : null,
|
|
2096
|
-
borderLeftColor: e === "right" ?
|
|
2175
|
+
borderLeftColor: e === "right" ? k("color-border", "#d0d7de") : null,
|
|
2097
2176
|
borderLeftStyle: e === "right" ? "solid" : null,
|
|
2098
2177
|
borderLeftWidth: e === "right" ? "1px" : null,
|
|
2099
2178
|
borderRight: e === "left" ? "1px solid" : null,
|
|
2100
|
-
borderRightColor: e === "left" ?
|
|
2179
|
+
borderRightColor: e === "left" ? k("color-border", "#d0d7de") : null,
|
|
2101
2180
|
borderRightStyle: e === "left" ? "solid" : null,
|
|
2102
2181
|
borderRightWidth: e === "left" ? "1px" : null,
|
|
2103
2182
|
boxSizing: "border-box",
|
|
2104
|
-
color:
|
|
2183
|
+
color: k("color-text-secondary", "#57606a"),
|
|
2105
2184
|
display: "flex",
|
|
2106
2185
|
flexDirection: t ? "column" : "row",
|
|
2107
2186
|
flexShrink: t ? "0" : null,
|
|
2108
2187
|
flexWrap: "nowrap",
|
|
2109
2188
|
fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
2110
2189
|
fontSize: "13px",
|
|
2111
|
-
gap: "
|
|
2190
|
+
gap: "0px",
|
|
2112
2191
|
msOverflowStyle: "none",
|
|
2113
2192
|
overflowX: t ? "hidden" : "auto",
|
|
2114
2193
|
overflowY: t ? "auto" : "hidden",
|
|
@@ -2140,32 +2219,31 @@ function Ci(e, t = null, n = null) {
|
|
|
2140
2219
|
}
|
|
2141
2220
|
return t ?? "";
|
|
2142
2221
|
}, m = (e, t) => {
|
|
2143
|
-
let n = l.titlePosition,
|
|
2144
|
-
e.
|
|
2145
|
-
background: t ?
|
|
2146
|
-
border:
|
|
2147
|
-
borderBottomColor:
|
|
2148
|
-
borderLeftColor:
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
color: t ? O("color-text", "#24292f") : O("color-text-secondary", "#57606a"),
|
|
2222
|
+
let n = e.tab, r = l.titlePosition, i = r !== "top";
|
|
2223
|
+
e.label.attr("aria-selected", String(t)), n.styles({
|
|
2224
|
+
background: t ? k("color-surface", "#ffffff") : k("color-surface-active", "#eaeef2"),
|
|
2225
|
+
border: A("color-border", "#d0d7de"),
|
|
2226
|
+
borderBottomColor: r === "top" && t ? k("color-surface", "#ffffff") : k("color-border", "#d0d7de"),
|
|
2227
|
+
borderLeftColor: "transparent",
|
|
2228
|
+
borderRightColor: r === "left" && t ? k("color-surface", "#ffffff") : k("color-border", "#d0d7de"),
|
|
2229
|
+
color: t ? k("color-text", "#24292f") : k("color-text-secondary", "#57606a"),
|
|
2152
2230
|
fontWeight: t ? "600" : "400",
|
|
2153
|
-
marginBottom:
|
|
2154
|
-
marginLeft:
|
|
2155
|
-
marginRight:
|
|
2156
|
-
padding:
|
|
2231
|
+
marginBottom: r === "top" ? "-9px" : "0",
|
|
2232
|
+
marginLeft: r === "right" ? "-9px" : "0",
|
|
2233
|
+
marginRight: r === "left" ? "-9px" : "0",
|
|
2234
|
+
padding: i ? "8px 10px" : "7px 14px 8px"
|
|
2157
2235
|
});
|
|
2158
2236
|
}, g = (e) => {
|
|
2159
2237
|
l.overflow = !!e, r.attr("data-title-overflow", l.overflow ? "true" : null), s.style("display", l.overflow ? "inline-flex" : "none");
|
|
2160
2238
|
}, _ = () => {
|
|
2161
|
-
if (l.titlePosition !== "top" || l.tabs.size <=
|
|
2239
|
+
if (l.titlePosition !== "top" || l.tabs.size <= J) {
|
|
2162
2240
|
g(!1);
|
|
2163
2241
|
return;
|
|
2164
2242
|
}
|
|
2165
2243
|
g(!0);
|
|
2166
2244
|
}, v = () => {
|
|
2167
|
-
let e = Array.from(l.tabs.entries()), t = e.slice(0,
|
|
2168
|
-
if (!(e.length >
|
|
2245
|
+
let e = Array.from(l.tabs.entries()), t = e.slice(0, J).map(([, e]) => e.tab).filter((e) => e !== s);
|
|
2246
|
+
if (!(e.length > J && l.titlePosition === "top")) {
|
|
2169
2247
|
l.popupOpen && x(), i._children = t, i._childrenDirty = !0, i._el ? i._el.replaceChildren(...t.map((e) => e.renderDom()).filter(Boolean)) : s._el?.remove(), g(!1);
|
|
2170
2248
|
return;
|
|
2171
2249
|
}
|
|
@@ -2184,7 +2262,7 @@ function Ci(e, t = null, n = null) {
|
|
|
2184
2262
|
}, b = null, x = () => {
|
|
2185
2263
|
l.popupOpen = !1, r.attr("data-title-popup", null), s.attr("aria-expanded", "false"), c.style("display", "none"), b &&= (b(), null);
|
|
2186
2264
|
}, S = () => {
|
|
2187
|
-
c.clearChildren(), c._el && c._el.replaceChildren(), Array.from(l.tabs.entries()).slice(
|
|
2265
|
+
c.clearChildren(), c._el && c._el.replaceChildren(), Array.from(l.tabs.entries()).slice(J).forEach(([t, n]) => {
|
|
2188
2266
|
let r = n.text.textContent(), i = new h("div").className("yoya-vrouter-views-popup-item").attr({
|
|
2189
2267
|
role: "menuitem",
|
|
2190
2268
|
tabIndex: "0",
|
|
@@ -2192,7 +2270,7 @@ function Ci(e, t = null, n = null) {
|
|
|
2192
2270
|
}).styles({
|
|
2193
2271
|
alignItems: "center",
|
|
2194
2272
|
borderRadius: "6px",
|
|
2195
|
-
color:
|
|
2273
|
+
color: k("color-text", "#24292f"),
|
|
2196
2274
|
cursor: "pointer",
|
|
2197
2275
|
display: "flex",
|
|
2198
2276
|
fontSize: "13px",
|
|
@@ -2219,8 +2297,8 @@ function Ci(e, t = null, n = null) {
|
|
|
2219
2297
|
padding: "2px 4px"
|
|
2220
2298
|
}).text("×");
|
|
2221
2299
|
t === e.currentPath() && (i.attr("aria-current", "true"), i.styles({
|
|
2222
|
-
background:
|
|
2223
|
-
color:
|
|
2300
|
+
background: k("color-primary-subtle", "#e8f0fe"),
|
|
2301
|
+
color: k("color-primary", "#1f6feb")
|
|
2224
2302
|
}));
|
|
2225
2303
|
let s = () => {
|
|
2226
2304
|
x(), e.navigate(t);
|
|
@@ -2228,21 +2306,21 @@ function Ci(e, t = null, n = null) {
|
|
|
2228
2306
|
i.on("click", s), i.on("keydown", (e) => {
|
|
2229
2307
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), s());
|
|
2230
2308
|
}), o.on("click", (e) => {
|
|
2231
|
-
e.stopPropagation(),
|
|
2309
|
+
e.stopPropagation(), ne(t, e), l.popupOpen && S();
|
|
2232
2310
|
}), i.child(a, o), c.child(i);
|
|
2233
2311
|
});
|
|
2234
2312
|
}, ee = () => {
|
|
2235
2313
|
if (l.tabs.size === 0) return;
|
|
2236
|
-
|
|
2314
|
+
xi(), S(), l.popupOpen = !0, r.attr("data-title-popup", "true"), s.attr("aria-expanded", "true"), c.styles({ display: "block" }), f();
|
|
2237
2315
|
let e = (e) => {
|
|
2238
2316
|
!c._el?.contains(e.target) && !s._el?.contains(e.target) && x();
|
|
2239
2317
|
}, t = (e) => {
|
|
2240
2318
|
e.key === "Escape" && x();
|
|
2241
|
-
}, n = () =>
|
|
2242
|
-
|
|
2243
|
-
|
|
2319
|
+
}, n = () => f(), i = () => f(), a = D("click", e), o = D("keydown", t), u = O("scroll", n, !0), d = O("resize", i);
|
|
2320
|
+
b = () => {
|
|
2321
|
+
a(), o(), u(), d();
|
|
2244
2322
|
};
|
|
2245
|
-
function
|
|
2323
|
+
function f() {
|
|
2246
2324
|
let e = s._el?.getBoundingClientRect(), t = c._el?.getBoundingClientRect();
|
|
2247
2325
|
if (!e || !t) return;
|
|
2248
2326
|
let n = window.innerWidth || document.documentElement?.clientWidth || 0, r = window.innerHeight || document.documentElement?.clientHeight || 0, i = e.right - t.width;
|
|
@@ -2259,21 +2337,21 @@ function Ci(e, t = null, n = null) {
|
|
|
2259
2337
|
});
|
|
2260
2338
|
let te = r.renderDom.bind(r);
|
|
2261
2339
|
r.renderDom = () => {
|
|
2262
|
-
|
|
2340
|
+
xi();
|
|
2263
2341
|
let e = te();
|
|
2264
2342
|
return _(), e;
|
|
2265
2343
|
}, r.updateOverflow = _, r.titlePosition = (t) => {
|
|
2266
2344
|
if (t === void 0) return l.titlePosition;
|
|
2267
|
-
let n =
|
|
2268
|
-
return l.titlePosition = n, n !== "top" && l.popupOpen && x(), r.attr("data-title-position", l.titlePosition), i.attr("aria-orientation", l.titlePosition === "top" ? "horizontal" : "vertical"), f(l.titlePosition), v(), l.tabs.forEach((
|
|
2345
|
+
let n = Pi(t);
|
|
2346
|
+
return l.titlePosition = n, n !== "top" && l.popupOpen && x(), r.attr("data-title-position", l.titlePosition), i.attr("aria-orientation", l.titlePosition === "top" ? "horizontal" : "vertical"), f(l.titlePosition), v(), l.tabs.forEach((t, n) => {
|
|
2269
2347
|
m(t, n === e.currentPath());
|
|
2270
2348
|
}), _(), r;
|
|
2271
2349
|
}, r.titlePosition(l.titlePosition), r.lockTitle = (e = !0) => e === void 0 ? l.lockTitle : (l.lockTitle = !!e, r.attr("data-title-locked", l.lockTitle ? "true" : null), f(l.titlePosition), _(), r), r.titleLocked = r.lockTitle;
|
|
2272
|
-
let
|
|
2350
|
+
let ne = (t, n = null) => {
|
|
2273
2351
|
n && n.stopPropagation();
|
|
2274
2352
|
let r = Array.from(l.tabs.entries()).findIndex(([e]) => e === t), o = l.tabs.get(t);
|
|
2275
2353
|
if (!o) return;
|
|
2276
|
-
let s = o.
|
|
2354
|
+
let s = o.label.attr("aria-selected") === "true";
|
|
2277
2355
|
if (l.tabs.delete(t), i._children = i.children().filter((e) => e !== o.tab), i._childrenDirty = !0, o.tab.destroy(), v(), y(), !s) return;
|
|
2278
2356
|
let c = Array.from(l.tabs.keys());
|
|
2279
2357
|
if (c.length > 0) {
|
|
@@ -2282,12 +2360,12 @@ function Ci(e, t = null, n = null) {
|
|
|
2282
2360
|
return;
|
|
2283
2361
|
}
|
|
2284
2362
|
a.clearChildren().commit(), e._navigationGeneration += 1, e._currentView = null;
|
|
2285
|
-
},
|
|
2363
|
+
}, C = new h("div").className("yoya-vrouter-views-context").attr({
|
|
2286
2364
|
role: "menu",
|
|
2287
2365
|
"aria-label": "标签页操作"
|
|
2288
2366
|
}).styles({
|
|
2289
|
-
background:
|
|
2290
|
-
border:
|
|
2367
|
+
background: k("color-surface", "#ffffff"),
|
|
2368
|
+
border: A("color-border", "#d0d7de"),
|
|
2291
2369
|
borderRadius: "8px",
|
|
2292
2370
|
boxShadow: "0 12px 28px rgba(15, 23, 42, 0.18)",
|
|
2293
2371
|
display: "none",
|
|
@@ -2295,9 +2373,9 @@ function Ci(e, t = null, n = null) {
|
|
|
2295
2373
|
padding: "6px",
|
|
2296
2374
|
position: "fixed",
|
|
2297
2375
|
zIndex: "100"
|
|
2298
|
-
}),
|
|
2299
|
-
|
|
2300
|
-
},
|
|
2376
|
+
}), re = null, w = () => {
|
|
2377
|
+
C.styles({ display: "none" }), C.clearChildren(), C._el?.remove(), re &&= (re(), null);
|
|
2378
|
+
}, T = (t, n = null) => {
|
|
2301
2379
|
let r = new Set(t), o = Array.from(l.tabs.entries()), s = o.findIndex(([e]) => r.has(e));
|
|
2302
2380
|
if (o.forEach(([e, t]) => {
|
|
2303
2381
|
r.has(e) && (l.tabs.delete(e), i._children = i.children().filter((e) => e !== t.tab), i._childrenDirty = !0, t.tab.destroy());
|
|
@@ -2309,20 +2387,20 @@ function Ci(e, t = null, n = null) {
|
|
|
2309
2387
|
}
|
|
2310
2388
|
let u = n && l.tabs.has(n) ? n : c[Math.min(Math.max(s, 0), c.length - 1)];
|
|
2311
2389
|
e.navigate(u, { replace: !0 });
|
|
2312
|
-
},
|
|
2390
|
+
}, ie = (t) => {
|
|
2313
2391
|
if (typeof navigator > "u" || !navigator.clipboard) return;
|
|
2314
2392
|
let n = typeof window > "u" ? "" : window.location.origin, r = typeof window > "u" ? "" : window.location.pathname, i = e.mode() === "history" ? `${n}${r}${t}` : `${n}${r}#${t}`;
|
|
2315
2393
|
navigator.clipboard.writeText(i).catch(() => {});
|
|
2316
|
-
},
|
|
2317
|
-
l.popupOpen && x(),
|
|
2318
|
-
let r = Array.from(l.tabs.entries()), i = r.findIndex(([e]) => e === t), a = () =>
|
|
2394
|
+
}, ae = (t, n) => {
|
|
2395
|
+
l.popupOpen && x(), w();
|
|
2396
|
+
let r = Array.from(l.tabs.entries()), i = r.findIndex(([e]) => e === t), a = () => T(r.filter(([e]) => e !== t).map(([e]) => e), t), o = () => T(r.slice(0, i).map(([e]) => e), t), s = () => T(r.slice(i + 1).map(([e]) => e), t), c = () => T(r.map(([e]) => e)), u = (e, t, n = !1, r = !1) => {
|
|
2319
2397
|
let i = new h("div").className("yoya-vrouter-views-context-item").attr({
|
|
2320
2398
|
role: "menuitem",
|
|
2321
2399
|
tabIndex: "0"
|
|
2322
2400
|
}).text(e).styles({
|
|
2323
2401
|
alignItems: "center",
|
|
2324
2402
|
borderRadius: "6px",
|
|
2325
|
-
color: n ?
|
|
2403
|
+
color: n ? k("color-text-danger", "#b91c1c") : k("color-text", "#24292f"),
|
|
2326
2404
|
cursor: r ? "default" : "pointer",
|
|
2327
2405
|
display: "flex",
|
|
2328
2406
|
fontSize: "13px",
|
|
@@ -2331,25 +2409,25 @@ function Ci(e, t = null, n = null) {
|
|
|
2331
2409
|
width: "100%"
|
|
2332
2410
|
});
|
|
2333
2411
|
return r ? (i.attr("aria-disabled", "true"), i.styles({ opacity: "0.4" })) : i.on("click", () => {
|
|
2334
|
-
|
|
2335
|
-
}),
|
|
2336
|
-
}, d = () =>
|
|
2337
|
-
u("刷新", () => e.navigate(t, { replace: !0 })), u("复制链接", () =>
|
|
2338
|
-
let f =
|
|
2339
|
-
|
|
2412
|
+
w(), t();
|
|
2413
|
+
}), C.child(i), i;
|
|
2414
|
+
}, d = () => C.child(new h("div").className("yoya-vrouter-views-context-separator"));
|
|
2415
|
+
u("刷新", () => e.navigate(t, { replace: !0 })), u("复制链接", () => ie(t)), d(), u("关闭", () => ne(t), !0), u("关闭其他", a, !1, r.length <= 1), u("关闭左侧", o, !1, i <= 0), u("关闭右侧", s, !1, i === r.length - 1), d(), u("关闭全部", c, !0, r.length === 0), C.bindTo(document.body), C.styles({ display: "block" });
|
|
2416
|
+
let f = C._el.getBoundingClientRect(), p = typeof window > "u" ? 0 : window.innerWidth || 0, m = typeof window > "u" ? 0 : window.innerHeight || 0, g = Math.max(8, Math.min(n.clientX || 0, p - f.width - 8)), _ = Math.max(8, Math.min(n.clientY || 0, m - f.height - 8));
|
|
2417
|
+
C.styles({
|
|
2340
2418
|
left: `${g}px`,
|
|
2341
2419
|
top: `${_}px`
|
|
2342
2420
|
});
|
|
2343
2421
|
let v = (e) => {
|
|
2344
|
-
|
|
2422
|
+
C._el?.contains(e.target) || w();
|
|
2345
2423
|
}, y = (e) => {
|
|
2346
|
-
e.key === "Escape" &&
|
|
2347
|
-
}, b = () =>
|
|
2348
|
-
|
|
2349
|
-
|
|
2424
|
+
e.key === "Escape" && w();
|
|
2425
|
+
}, b = () => w(), S = D("mousedown", v), ee = D("keydown", y), te = O("scroll", b, !0), ae = O("resize", b);
|
|
2426
|
+
re = () => {
|
|
2427
|
+
S(), ee(), te(), ae();
|
|
2350
2428
|
};
|
|
2351
|
-
},
|
|
2352
|
-
let n = t.path || e.currentPath(), r = new Set(l.titlePosition === "top" ? Array.from(l.tabs.keys()).slice(0,
|
|
2429
|
+
}, E = (t = {}) => {
|
|
2430
|
+
let n = t.path || e.currentPath(), r = new Set(l.titlePosition === "top" ? Array.from(l.tabs.keys()).slice(0, J) : Array.from(l.tabs.keys())), a = l.tabs.get(n);
|
|
2353
2431
|
if (a) {
|
|
2354
2432
|
let e = p(t);
|
|
2355
2433
|
a.text.textContent(e), a.closeButton.attr("aria-label", `关闭 ${e}`);
|
|
@@ -2383,24 +2461,25 @@ function Ci(e, t = null, n = null) {
|
|
|
2383
2461
|
font: "inherit",
|
|
2384
2462
|
lineHeight: "1",
|
|
2385
2463
|
padding: "0"
|
|
2386
|
-
}), c.text("×"), c.on("click", (e) =>
|
|
2387
|
-
e.preventDefault(), e.stopPropagation(),
|
|
2388
|
-
}), r.child(s, c), i.child(r),
|
|
2464
|
+
}), c.text("×"), c.on("click", (e) => ne(n, e)), r.on("contextmenu", (e) => {
|
|
2465
|
+
e.preventDefault(), e.stopPropagation(), ae(n, e);
|
|
2466
|
+
}), r.child(s, c), i.child(r), a = {
|
|
2389
2467
|
closeButton: c,
|
|
2468
|
+
label: s,
|
|
2390
2469
|
tab: r,
|
|
2391
2470
|
text: o
|
|
2392
|
-
}, l.tabs.set(n, a);
|
|
2471
|
+
}, l.tabs.set(n, a), m(a, !1);
|
|
2393
2472
|
}
|
|
2394
|
-
r.has(n) || (l.tabs.delete(n), l.tabs = new Map([[n, a], ...l.tabs])), l.tabs.forEach((
|
|
2395
|
-
},
|
|
2473
|
+
r.has(n) || (l.tabs.delete(n), l.tabs = new Map([[n, a], ...l.tabs])), l.tabs.forEach((e, t) => m(e, t === n)), v(), l.popupOpen && S(), y();
|
|
2474
|
+
}, oe = () => {
|
|
2396
2475
|
if (!l.persist) return;
|
|
2397
|
-
let t =
|
|
2476
|
+
let t = Ci(l.storageKey);
|
|
2398
2477
|
if (t) {
|
|
2399
2478
|
l.suppressPersist = !0;
|
|
2400
2479
|
try {
|
|
2401
2480
|
t.paths.slice().reverse().forEach((t) => {
|
|
2402
2481
|
let n = e._resolve(t);
|
|
2403
|
-
|
|
2482
|
+
E({
|
|
2404
2483
|
...n.context,
|
|
2405
2484
|
path: t
|
|
2406
2485
|
});
|
|
@@ -2415,42 +2494,40 @@ function Ci(e, t = null, n = null) {
|
|
|
2415
2494
|
let { persist: e, storageKey: n, title: i, titlePosition: a, titleResolver: o, ...s } = t;
|
|
2416
2495
|
i !== void 0 && (l.title = i), e !== void 0 && (l.persist = !!e), n !== void 0 && (l.storageKey = n), a !== void 0 && r.titlePosition(a), typeof o == "function" && (l.titleResolver = o), Object.keys(s).length > 0 && r.setup(s);
|
|
2417
2496
|
}
|
|
2418
|
-
e.outlet(a),
|
|
2497
|
+
e.outlet(a), oe(), (e.currentRoute() || e.currentPath() !== "/") && E({
|
|
2419
2498
|
params: e.currentParams(),
|
|
2420
2499
|
path: e.currentPath(),
|
|
2421
2500
|
query: e.currentQuery(),
|
|
2422
2501
|
route: e.currentRoute(),
|
|
2423
2502
|
router: e
|
|
2424
2503
|
});
|
|
2425
|
-
let
|
|
2426
|
-
typeof
|
|
2427
|
-
let ce = r.destroy.bind(r);
|
|
2428
|
-
return r.destroy = () => (l.popupOpen && x(), E(), typeof window < "u" && window.removeEventListener("resize", se), oe(), e.outlet() === a && e.outlet(e), ce()), typeof n == "function" && n(r), r;
|
|
2504
|
+
let se = e.subscribe((e) => E(e)), ce = O("resize", () => _()), le = r.destroy.bind(r);
|
|
2505
|
+
return r.destroy = () => (l.popupOpen && x(), w(), ce(), se(), e.outlet() === a && e.outlet(e), le()), typeof n == "function" && n(r), r;
|
|
2429
2506
|
}
|
|
2430
2507
|
_(h, {
|
|
2431
|
-
vLink:
|
|
2432
|
-
vRouter:
|
|
2433
|
-
vRouterView:
|
|
2434
|
-
vRouterViews:
|
|
2508
|
+
vLink: ki,
|
|
2509
|
+
vRouter: Oi,
|
|
2510
|
+
vRouterView: Ai,
|
|
2511
|
+
vRouterViews: ji
|
|
2435
2512
|
});
|
|
2436
|
-
function
|
|
2513
|
+
function Mi(e, t) {
|
|
2437
2514
|
let n = {
|
|
2438
2515
|
beforeEnter: null,
|
|
2439
2516
|
error: null,
|
|
2440
2517
|
loading: null,
|
|
2441
|
-
pattern:
|
|
2518
|
+
pattern: Zi(e),
|
|
2442
2519
|
title: null,
|
|
2443
2520
|
view: null
|
|
2444
2521
|
};
|
|
2445
|
-
return typeof t == "function" || t instanceof c ||
|
|
2522
|
+
return typeof t == "function" || t instanceof c || $i(t) ? (n.view = t, n) : (t && typeof t == "object" && (n.beforeEnter = t.beforeEnter || null, n.error = t.error ?? null, n.loading = t.loading ?? null, n.title = t.title ?? null, n.view = t.view || t.component || null), n);
|
|
2446
2523
|
}
|
|
2447
|
-
function
|
|
2448
|
-
if (!(e instanceof
|
|
2524
|
+
function Ni(e) {
|
|
2525
|
+
if (!(e instanceof wi)) throw TypeError("vLink and vRouterView require a Router instance");
|
|
2449
2526
|
}
|
|
2450
|
-
function
|
|
2527
|
+
function Pi(e) {
|
|
2451
2528
|
return e === "left" || e === "right" ? e : "top";
|
|
2452
2529
|
}
|
|
2453
|
-
function
|
|
2530
|
+
function Fi(e, t) {
|
|
2454
2531
|
if (typeof t == "function") return t(e), e;
|
|
2455
2532
|
if (!t || typeof t != "object") return e;
|
|
2456
2533
|
let { beforeEach: n, default: r, error: i, loading: a, notFound: o, routes: s = [], ...c } = t;
|
|
@@ -2458,7 +2535,7 @@ function Di(e, t) {
|
|
|
2458
2535
|
t?.pattern !== void 0 && e.vRoute(t.pattern, t.config);
|
|
2459
2536
|
}), o !== void 0 && e.notFound(o), e;
|
|
2460
2537
|
}
|
|
2461
|
-
function
|
|
2538
|
+
function Ii(e, t, n) {
|
|
2462
2539
|
if (typeof n == "function") {
|
|
2463
2540
|
n(e);
|
|
2464
2541
|
return;
|
|
@@ -2473,20 +2550,20 @@ function Oi(e, t, n) {
|
|
|
2473
2550
|
}
|
|
2474
2551
|
function Y(e, t, n, r) {
|
|
2475
2552
|
if (r === void 0) return t[n];
|
|
2476
|
-
t[n] = r, n === "to" && t.label === null &&
|
|
2553
|
+
t[n] = r, n === "to" && t.label === null && N(e.children()[0], bn(r));
|
|
2477
2554
|
let i = e._routerInstance;
|
|
2478
|
-
return i &&
|
|
2555
|
+
return i && Li(e, t, i), e;
|
|
2479
2556
|
}
|
|
2480
|
-
function
|
|
2557
|
+
function Li(e, t, n) {
|
|
2481
2558
|
e._routerInstance = n;
|
|
2482
|
-
let r =
|
|
2559
|
+
let r = Ri(t.to, t.params, t.query), i = zi(n.currentPath(), r, t.exact), a = new Set(String(e.attr("class") || "").split(/\s+/).filter(Boolean));
|
|
2483
2560
|
return a.add("yoya-vlink"), i ? a.add("is-active") : a.delete("is-active"), e.attr({
|
|
2484
2561
|
"aria-current": i ? "page" : null,
|
|
2485
2562
|
class: [...a].join(" "),
|
|
2486
2563
|
href: n.mode() === "history" ? r : `#${r}`
|
|
2487
2564
|
}), e;
|
|
2488
2565
|
}
|
|
2489
|
-
function
|
|
2566
|
+
function Ri(e, t, n) {
|
|
2490
2567
|
let [r, i = ""] = Z(e).split("?"), a = r.replace(/:([A-Za-z0-9_]+)/g, (e, n) => t[n] === void 0 ? e : encodeURIComponent(t[n])), o = new URLSearchParams(i);
|
|
2491
2568
|
Object.entries(n || {}).forEach(([e, t]) => {
|
|
2492
2569
|
o.delete(e), Array.isArray(t) ? t.forEach((t) => o.append(e, t)) : t != null && o.set(e, t);
|
|
@@ -2494,33 +2571,33 @@ function Ai(e, t, n) {
|
|
|
2494
2571
|
let s = o.toString();
|
|
2495
2572
|
return s ? `${a}?${s}` : a;
|
|
2496
2573
|
}
|
|
2497
|
-
function
|
|
2574
|
+
function zi(e, t, n) {
|
|
2498
2575
|
let r = Z(e), i = Z(t);
|
|
2499
2576
|
if (n) return r === i;
|
|
2500
2577
|
let a = Q(r).pathname, o = Q(i).pathname;
|
|
2501
2578
|
return a === o || a.startsWith(`${o}/`);
|
|
2502
2579
|
}
|
|
2503
|
-
function
|
|
2580
|
+
function Bi(e, t) {
|
|
2504
2581
|
return !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey && (!t.attr("target") || t.attr("target") === "_self");
|
|
2505
2582
|
}
|
|
2506
2583
|
function X(e, t) {
|
|
2507
2584
|
if (e instanceof c) return e;
|
|
2508
2585
|
if (e == null) return d("");
|
|
2509
|
-
if (
|
|
2586
|
+
if ($i(e)) return d(e);
|
|
2510
2587
|
if (typeof e == "object" && e && e.default !== void 0 && typeof e.render != "function") return X(e.default, t);
|
|
2511
2588
|
if (typeof e == "function") return X(e(t), t);
|
|
2512
2589
|
if (typeof e == "object" && typeof e.render == "function") return X(e.render(), t);
|
|
2513
2590
|
throw TypeError("Router route view must be a ViewNode, string, number, null, undefined, a render() component object, a factory returning one, or a module with a default export");
|
|
2514
2591
|
}
|
|
2515
|
-
var
|
|
2516
|
-
function
|
|
2592
|
+
var Vi = () => "加载中…", Hi = (e) => `加载失败:${e?.message ?? String(e)}`;
|
|
2593
|
+
function Ui(e) {
|
|
2517
2594
|
return e !== null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
|
|
2518
2595
|
}
|
|
2519
|
-
function
|
|
2596
|
+
function Wi(e, t) {
|
|
2520
2597
|
return X(typeof e == "function" ? e(...t) : e, t[t.length - 1]);
|
|
2521
2598
|
}
|
|
2522
|
-
function
|
|
2523
|
-
let n = Q(e), r = Q(t), i =
|
|
2599
|
+
function Gi(e, t) {
|
|
2600
|
+
let n = Q(e), r = Q(t), i = Qi(n.pathname), a = Qi(r.pathname);
|
|
2524
2601
|
if (i.length !== a.length) return null;
|
|
2525
2602
|
let o = {};
|
|
2526
2603
|
for (let e = 0; e < i.length; e += 1) {
|
|
@@ -2537,7 +2614,7 @@ function Li(e, t) {
|
|
|
2537
2614
|
query: r.query
|
|
2538
2615
|
};
|
|
2539
2616
|
}
|
|
2540
|
-
function
|
|
2617
|
+
function Ki(e, t, n, r) {
|
|
2541
2618
|
return {
|
|
2542
2619
|
params: { ...r.params },
|
|
2543
2620
|
path: t,
|
|
@@ -2547,24 +2624,24 @@ function Ri(e, t, n, r) {
|
|
|
2547
2624
|
router: e
|
|
2548
2625
|
};
|
|
2549
2626
|
}
|
|
2550
|
-
function
|
|
2627
|
+
function qi() {
|
|
2551
2628
|
return typeof window > "u" ? "/" : Z(window.location.hash.replace(/^#/, "") || "/");
|
|
2552
2629
|
}
|
|
2553
|
-
function
|
|
2554
|
-
return typeof window > "u" ? "/" : e === "history" ? Z(`${window.location.pathname}${window.location.search}`) :
|
|
2630
|
+
function Ji(e = "hash") {
|
|
2631
|
+
return typeof window > "u" ? "/" : e === "history" ? Z(`${window.location.pathname}${window.location.search}`) : qi();
|
|
2555
2632
|
}
|
|
2556
|
-
function
|
|
2633
|
+
function Yi(e, t = {}) {
|
|
2557
2634
|
if (typeof window > "u") return !1;
|
|
2558
2635
|
let n = `#${e}`;
|
|
2559
2636
|
return t.replace ? (window.history.replaceState(null, "", n), !0) : window.location.hash !== n && (window.location.hash = n, !0);
|
|
2560
2637
|
}
|
|
2561
|
-
function
|
|
2638
|
+
function Xi(e, t = {}, n = "hash") {
|
|
2562
2639
|
if (typeof window > "u") return !1;
|
|
2563
|
-
if (n !== "history") return
|
|
2564
|
-
let r = Z(e), i =
|
|
2640
|
+
if (n !== "history") return Yi(e, t);
|
|
2641
|
+
let r = Z(e), i = Ji("history");
|
|
2565
2642
|
return !t.replace && i === r ? !1 : (t.replace ? window.history.replaceState(null, "", r) : window.history.pushState(null, "", r), !0);
|
|
2566
2643
|
}
|
|
2567
|
-
function
|
|
2644
|
+
function Zi(e) {
|
|
2568
2645
|
return Z(e).split("?")[0] || "/";
|
|
2569
2646
|
}
|
|
2570
2647
|
function Z(e) {
|
|
@@ -2578,37 +2655,37 @@ function Q(e) {
|
|
|
2578
2655
|
query: Object.fromEntries(new URLSearchParams(n))
|
|
2579
2656
|
};
|
|
2580
2657
|
}
|
|
2581
|
-
function
|
|
2658
|
+
function Qi(e) {
|
|
2582
2659
|
return e.split("/").filter(Boolean);
|
|
2583
2660
|
}
|
|
2584
|
-
function
|
|
2661
|
+
function $i(e) {
|
|
2585
2662
|
return typeof e == "string" || typeof e == "number";
|
|
2586
2663
|
}
|
|
2587
2664
|
//#endregion
|
|
2588
2665
|
//#region src/core/id.js
|
|
2589
|
-
var
|
|
2590
|
-
function
|
|
2666
|
+
var ea = null;
|
|
2667
|
+
function ta() {
|
|
2591
2668
|
let e = 0;
|
|
2592
2669
|
return { next() {
|
|
2593
2670
|
return e += 1, e;
|
|
2594
2671
|
} };
|
|
2595
2672
|
}
|
|
2596
|
-
function
|
|
2597
|
-
let n =
|
|
2598
|
-
|
|
2673
|
+
function na(e, t) {
|
|
2674
|
+
let n = ea;
|
|
2675
|
+
ea = e;
|
|
2599
2676
|
try {
|
|
2600
2677
|
return t();
|
|
2601
2678
|
} finally {
|
|
2602
|
-
|
|
2679
|
+
ea = n;
|
|
2603
2680
|
}
|
|
2604
2681
|
}
|
|
2605
2682
|
//#endregion
|
|
2606
2683
|
//#region src/core/ssr.js
|
|
2607
|
-
function
|
|
2684
|
+
function ra(e = {}, t = {}) {
|
|
2608
2685
|
let { cookie: n = "", url: r = "", acceptLanguage: i = "" } = e || {}, { cookieKey: a = "yoya-lang", queryKey: o = "locale", defaultLanguage: s = "zh-CN" } = t;
|
|
2609
|
-
return
|
|
2686
|
+
return ia(n, a) || aa(r, o) || oa(i) || s;
|
|
2610
2687
|
}
|
|
2611
|
-
function
|
|
2688
|
+
function ia(e, t) {
|
|
2612
2689
|
if (!e || !t) return null;
|
|
2613
2690
|
for (let n of String(e).split(";")) {
|
|
2614
2691
|
let e = n.indexOf("=");
|
|
@@ -2623,18 +2700,18 @@ function Xi(e, t) {
|
|
|
2623
2700
|
}
|
|
2624
2701
|
return null;
|
|
2625
2702
|
}
|
|
2626
|
-
function
|
|
2703
|
+
function aa(e, t) {
|
|
2627
2704
|
if (!e || !t) return null;
|
|
2628
2705
|
let n = String(e).indexOf("?");
|
|
2629
2706
|
return n === -1 ? null : new URLSearchParams(String(e).slice(n + 1)).get(t) || null;
|
|
2630
2707
|
}
|
|
2631
|
-
function
|
|
2708
|
+
function oa(e) {
|
|
2632
2709
|
if (!e) return null;
|
|
2633
2710
|
let t = String(e).split(",")[0];
|
|
2634
2711
|
return t && t.split(";")[0].trim() || null;
|
|
2635
2712
|
}
|
|
2636
|
-
function
|
|
2637
|
-
return e ?
|
|
2713
|
+
function sa(e, t, n) {
|
|
2714
|
+
return e ? zr(typeof e == "function" ? e(t) : e, n) : n();
|
|
2638
2715
|
}
|
|
2639
2716
|
function $(e, t = null) {
|
|
2640
2717
|
if (e instanceof c) return e;
|
|
@@ -2642,18 +2719,18 @@ function $(e, t = null) {
|
|
|
2642
2719
|
if (e && typeof e.render == "function") return $(e.render(), t);
|
|
2643
2720
|
throw TypeError("renderToString/mount requires a ViewNode, a component object with render(), or a factory function");
|
|
2644
2721
|
}
|
|
2645
|
-
function
|
|
2722
|
+
function ca(e) {
|
|
2646
2723
|
let t = 1;
|
|
2647
2724
|
return typeof e.children == "function" && e.children().forEach((e) => {
|
|
2648
|
-
t +=
|
|
2725
|
+
t += ca(e instanceof u ? e._resolve() : e);
|
|
2649
2726
|
}), t;
|
|
2650
2727
|
}
|
|
2651
|
-
function
|
|
2652
|
-
let { maxNodes: n = Infinity, state: r = null, i18n: i = null } = t || {}, a =
|
|
2653
|
-
return
|
|
2728
|
+
function la(e, t = {}) {
|
|
2729
|
+
let { maxNodes: n = Infinity, state: r = null, i18n: i = null } = t || {}, a = ma(r);
|
|
2730
|
+
return na(ta(), () => sa(i, r, () => {
|
|
2654
2731
|
let t = typeof e == "function", i = $(e, r), o;
|
|
2655
2732
|
try {
|
|
2656
|
-
o =
|
|
2733
|
+
o = ca(i) > n ? {
|
|
2657
2734
|
exceeded: !0,
|
|
2658
2735
|
html: "",
|
|
2659
2736
|
state: a
|
|
@@ -2668,7 +2745,7 @@ function ta(e, t = {}) {
|
|
|
2668
2745
|
return o;
|
|
2669
2746
|
}));
|
|
2670
2747
|
}
|
|
2671
|
-
var
|
|
2748
|
+
var ua = class extends v {
|
|
2672
2749
|
constructor() {
|
|
2673
2750
|
super("html", null), this._headCallback = null, this._bodyCallback = null;
|
|
2674
2751
|
}
|
|
@@ -2682,26 +2759,26 @@ var na = class extends v {
|
|
|
2682
2759
|
return this.body((t) => t.vBody(...e));
|
|
2683
2760
|
}
|
|
2684
2761
|
};
|
|
2685
|
-
function
|
|
2762
|
+
function da(e) {
|
|
2686
2763
|
return String(e ?? "").replace(/&/g, "&").replace(/"/g, """);
|
|
2687
2764
|
}
|
|
2688
|
-
function
|
|
2765
|
+
function fa(e, t = {}, n = {}) {
|
|
2689
2766
|
let { client: r = "/client.js", containerId: i = "app", i18n: a = null, maxNodes: o = Infinity, messages: s, stateId: c = "__YOYA_DATA__" } = n || {}, l = t || {};
|
|
2690
2767
|
if (!e || typeof e.page != "function") throw TypeError("renderPage requires { page: (page, state) => {} }");
|
|
2691
|
-
let u = a || (s ? () =>
|
|
2768
|
+
let u = a || (s ? () => Ir({
|
|
2692
2769
|
language: l.lang || "zh-CN",
|
|
2693
2770
|
messages: s
|
|
2694
|
-
}) : null), d =
|
|
2695
|
-
return
|
|
2696
|
-
let t = new
|
|
2771
|
+
}) : null), d = ma(l);
|
|
2772
|
+
return na(ta(), () => sa(u, l, () => {
|
|
2773
|
+
let t = new ua();
|
|
2697
2774
|
e.page(t, l);
|
|
2698
2775
|
let n = new v("head");
|
|
2699
2776
|
t._headCallback && t._headCallback(n, l);
|
|
2700
2777
|
let a = new v("body");
|
|
2701
2778
|
t._bodyCallback && t._bodyCallback(a, l);
|
|
2702
|
-
let s =
|
|
2779
|
+
let s = ca(a) > o, u = n.toHTML(), f = `<div id="${da(i)}">`, p = s ? `${f}</div>` : `${f}${a.toHTML()}</div>`, m = `<script type="application/json" id="${da(c)}">${d}<\/script>`, h = `<script type="module" src="${da(r)}"><\/script>`;
|
|
2703
2780
|
return n.destroy(), a.destroy(), `<!doctype html>
|
|
2704
|
-
<html lang="${
|
|
2781
|
+
<html lang="${da(l.lang || "zh-CN")}">
|
|
2705
2782
|
${u}
|
|
2706
2783
|
<body>
|
|
2707
2784
|
${p}
|
|
@@ -2711,69 +2788,69 @@ ${h}
|
|
|
2711
2788
|
</html>`;
|
|
2712
2789
|
}));
|
|
2713
2790
|
}
|
|
2714
|
-
function
|
|
2791
|
+
function pa(e, t = {}) {
|
|
2715
2792
|
if (typeof document > "u") return null;
|
|
2716
|
-
let { messages: r, i18n: i = null, stateId: a = "__YOYA_DATA__", target: o = "#app" } = t || {}, s = document.getElementById(a), c =
|
|
2793
|
+
let { messages: r, i18n: i = null, stateId: a = "__YOYA_DATA__", target: o = "#app" } = t || {}, s = document.getElementById(a), c = ha(s ? s.textContent : ""), l = i || (r ? () => Ir({
|
|
2717
2794
|
language: c?.lang || "zh-CN",
|
|
2718
2795
|
messages: r
|
|
2719
2796
|
}) : null), u = n(o);
|
|
2720
|
-
return u && u.firstElementChild ?
|
|
2797
|
+
return u && u.firstElementChild ? _a(e, o, c, { i18n: l }) : ga(e, o, c, { i18n: l });
|
|
2721
2798
|
}
|
|
2722
|
-
function
|
|
2799
|
+
function ma(e) {
|
|
2723
2800
|
return e == null ? null : JSON.stringify(e).replace(/</g, "\\u003c");
|
|
2724
2801
|
}
|
|
2725
|
-
function
|
|
2802
|
+
function ha(e) {
|
|
2726
2803
|
return e == null || e === "" ? null : JSON.parse(e);
|
|
2727
2804
|
}
|
|
2728
|
-
function
|
|
2729
|
-
return
|
|
2805
|
+
function ga(e, t, r = null, i = {}) {
|
|
2806
|
+
return na(ta(), () => sa(i.i18n, r, () => {
|
|
2730
2807
|
let i = $(e, r), a = n(t);
|
|
2731
2808
|
return a && (a.replaceChildren(), a.appendChild(i.renderDom())), i;
|
|
2732
2809
|
}));
|
|
2733
2810
|
}
|
|
2734
|
-
function
|
|
2735
|
-
return
|
|
2811
|
+
function _a(e, t, r = null, i = {}) {
|
|
2812
|
+
return na(ta(), () => sa(i.i18n, r, () => {
|
|
2736
2813
|
let i = $(e, r), a = n(t);
|
|
2737
2814
|
if (a) {
|
|
2738
2815
|
let e = a.firstElementChild;
|
|
2739
|
-
e ? (
|
|
2816
|
+
e ? (va(i, e), ba(i), ya(i), i.renderDom()) : a.appendChild(i.renderDom());
|
|
2740
2817
|
}
|
|
2741
2818
|
return i;
|
|
2742
2819
|
}));
|
|
2743
2820
|
}
|
|
2744
|
-
function
|
|
2821
|
+
function va(e, t) {
|
|
2745
2822
|
if (e instanceof u) {
|
|
2746
|
-
|
|
2823
|
+
va(e._resolve(), t);
|
|
2747
2824
|
return;
|
|
2748
2825
|
}
|
|
2749
2826
|
if (e instanceof l) {
|
|
2750
|
-
t && t.nodeType === 3 ? (e._textNode = t, e._el = t, t.textContent !== e._content && (t.textContent = e._content)) :
|
|
2827
|
+
t && t.nodeType === 3 ? (e._textNode = t, e._el = t, t.textContent !== e._content && (t.textContent = e._content)) : xa(t, e.renderDom());
|
|
2751
2828
|
return;
|
|
2752
2829
|
}
|
|
2753
2830
|
if (t && t.nodeType === 1 && t.tagName.toLowerCase() === e._tagName) {
|
|
2754
2831
|
e._el = t, e._hydrated = !0;
|
|
2755
2832
|
let n = Array.from(t.childNodes);
|
|
2756
|
-
e.children().forEach((e, t) =>
|
|
2833
|
+
e.children().forEach((e, t) => va(e, n[t]));
|
|
2757
2834
|
return;
|
|
2758
2835
|
}
|
|
2759
|
-
|
|
2836
|
+
xa(t, e.renderDom());
|
|
2760
2837
|
}
|
|
2761
|
-
function
|
|
2838
|
+
function ya(e) {
|
|
2762
2839
|
if (e instanceof u) {
|
|
2763
|
-
|
|
2840
|
+
ya(e._resolve());
|
|
2764
2841
|
return;
|
|
2765
2842
|
}
|
|
2766
|
-
e instanceof l || (e._el && e._hydrated && e._applyBindingsToElement(), e.children().forEach(
|
|
2843
|
+
e instanceof l || (e._el && e._hydrated && e._applyBindingsToElement(), e.children().forEach(ya));
|
|
2767
2844
|
}
|
|
2768
|
-
function
|
|
2845
|
+
function ba(e) {
|
|
2769
2846
|
if (e instanceof u) {
|
|
2770
|
-
|
|
2847
|
+
ba(e._resolve());
|
|
2771
2848
|
return;
|
|
2772
2849
|
}
|
|
2773
|
-
e instanceof l || (e.children().forEach(
|
|
2850
|
+
e instanceof l || (e.children().forEach(ba), typeof e.hydrateSnapshot == "function" && e.hydrateSnapshot());
|
|
2774
2851
|
}
|
|
2775
|
-
function
|
|
2852
|
+
function xa(e, t) {
|
|
2776
2853
|
e && e.parentNode && e.parentNode.replaceChild(t, e);
|
|
2777
2854
|
}
|
|
2778
2855
|
//#endregion
|
|
2779
|
-
export {
|
|
2856
|
+
export { Ar as ClientOnlyNode, u as ComponentNode, h as ElementNode, v as HtmlElementNode, Pr as I18n, Fr as I18nTextNode, ua as PageDocumentNode, vi as RequestBase, yi as Result, wi as Router, l as TextNode, l as VTextNode, l as ViewTextNode, En as VMasonry, Sn as VSplitPanel, On as VThemeShell, c as ViewNode, S as a, ee as abbr, te as address, m as applyElementOptions, ne as area, C as article, re as aside, w as audio, T as b, ie as base, ae as bdi, E as bdo, D as bindDocumentEvent, O as bindWindowEvent, oe as blockquote, se as body, ce as br, le as button, ue as canvas, de as caption, In as center, fe as cite, pe as code, me as col, he as colgroup, _i as configureRequest, Wn as container, g as createElementFactory, b as createHtmlFactories, Ir as createI18n, Ti as createRouter, Hn as createVBodyPage, ge as data, _e as datalist, ve as dd, ye as del, be as details, xe as dfn, Se as dialog, Ce as div, $n as divider, we as dl, Te as dt, Ee as em, De as embed, r as escapeHtml, Oe as fieldset, ke as figcaption, Ae as figure, Mn as flex, je as footer, Me as form, Ur as getI18n, Gr as getPersistedI18nLocales, di as getYoyaMode, mi as getYoyaTheme, zn as grid, Ne as h1, Pe as h2, Fe as h3, Ie as h4, Le as h5, Re as h6, ze as head, Be as header, Ve as hgroup, He as hr, Fn as hstack, Ue as html, _a as hydrate, pa as hydrateOrMount, We as i, G as i18n, Lr as i18nText, Ge as iframe, Ke as img, hi as initYoyaTheme, rn as injectDocumentStyle, qe as input, Je as ins, Rr as installI18nStringShortcut, Ye as kbd, Xe as label, Ze as legend, Qe as li, $e as link, Wr as listI18n, et as main, tt as map, nt as mark, rt as menu, it as meta, at as meter, Kn as mobileLayout, ga as mount, ot as nav, f as normalizeChild, p as normalizeSetupArguments, st as noscript, ct as object, lt as ol, ut as optgroup, dt as option, ft as output, pt as p, ha as parseState, mt as picture, ht as pre, gt as progress, _t as q, _ as registerChildFactories, Vr as registerI18n, fa as renderPage, la as renderToString, ra as resolveLocale, n as resolveTarget, fi as resolveYoyaMode, Bn as responsiveGrid, Ei as router, vt as rp, yt as rt, bt as ruby, xt as s, St as samp, Ct as script, wt as search, Tt as section, Et as select, Dt as selectedcontent, ma as serializeState, ui as setYoyaMode, pi as setYoyaTheme, Ot as slot, kt as small, At as source, Qn as spacer, jt as span, Nn as stack, Mt as strong, Nt as style, Pt as styleTag, Ft as sub, It as summary, Lt as sup, Rt as table, zt as tbody, Bt as td, Vt as template, d as text, d as vText, Ht as textarea, Ut as tfoot, Wt as th, Gt as thead, Kt as time, qt as title, Jt as tr, Yt as track, Xt as u, Zt as ul, nn as unbindDocumentEvent, Hr as unregisterI18n, Yn as vAside, Vn as vBody, jr as vClientOnly, Rn as vCol, Gn as vContainer, Zn as vFooter, Jn as vHeader, ki as vLink, Xn as vMain, Dn as vMasonry, qn as vMobileLayout, Di as vRoute, Oi as vRouter, Ai as vRouterView, ji as vRouterViews, Ln as vRow, Cn as vSplitPanel, ai as vStateNode, kn as vThemeShell, Qt as varTag, $t as video, Pn as vstack, en as wbr, zr as withI18nStringShortcut };
|