@yoyaflow/yoya-ui 0.3.0 → 0.3.2
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 +46 -25
- package/README.zh-CN.md +46 -25
- package/dist/yoya-ui.umd.js +2 -2
- package/dist/yoya.core.js +104 -80
- package/dist/yoya.echart.js +12 -5
- package/dist/yoya.ssr.js +559 -536
- package/dist/yoya.ui.js +2336 -2304
- package/package.json +1 -1
- package/types/core.d.ts +24 -0
package/dist/yoya.ssr.js
CHANGED
|
@@ -465,7 +465,7 @@ function b() {
|
|
|
465
465
|
}
|
|
466
466
|
var x = b();
|
|
467
467
|
_(v, x);
|
|
468
|
-
var { a: S, abbr: ee, address: te, area: ne, article: C, aside:
|
|
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
469
|
function tn(e) {
|
|
470
470
|
return typeof e == "string" ? {
|
|
471
471
|
name: e,
|
|
@@ -473,20 +473,44 @@ function tn(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 nn = "http://www.w3.org/2000/svg", rn = /* @__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 nn = "http://www.w3.org/2000/svg", rn = /* @__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 fn(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 pn() {
|
|
|
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 bn = 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 bn = 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 bn = 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 bn = 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 bn = 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 bn = 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 wn = 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 En = 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 En = 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,74 +1720,74 @@ 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
1785
|
//#region src/core/request.js
|
|
1762
|
-
var
|
|
1763
|
-
function
|
|
1764
|
-
return
|
|
1786
|
+
var gi = null;
|
|
1787
|
+
function _i({ submit: e } = {}) {
|
|
1788
|
+
return gi = typeof e == "function" ? e : null, gi;
|
|
1765
1789
|
}
|
|
1766
|
-
var
|
|
1790
|
+
var vi = class {
|
|
1767
1791
|
method() {
|
|
1768
1792
|
return "GET";
|
|
1769
1793
|
}
|
|
@@ -1783,10 +1807,10 @@ var hi = class {
|
|
|
1783
1807
|
return "";
|
|
1784
1808
|
}
|
|
1785
1809
|
submit() {
|
|
1786
|
-
if (typeof
|
|
1787
|
-
return
|
|
1810
|
+
if (typeof gi != "function") throw Error("RequestBase: 未注册请求传输,请先 configureRequest({ submit })");
|
|
1811
|
+
return gi(this);
|
|
1788
1812
|
}
|
|
1789
|
-
},
|
|
1813
|
+
}, yi = class e {
|
|
1790
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 } = {}) {
|
|
1791
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;
|
|
1792
1816
|
}
|
|
@@ -1814,16 +1838,16 @@ var hi = class {
|
|
|
1814
1838
|
total: t.total
|
|
1815
1839
|
});
|
|
1816
1840
|
}
|
|
1817
|
-
},
|
|
1818
|
-
function
|
|
1819
|
-
|
|
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");
|
|
1820
1844
|
}
|
|
1821
|
-
function
|
|
1845
|
+
function Si(e) {
|
|
1822
1846
|
let t = [e._defaultPath || "/", e._routes.map((e) => e.pattern).join("|")].join("::"), n = 0;
|
|
1823
1847
|
for (let e = 0; e < t.length; e += 1) n = n * 31 + t.charCodeAt(e) | 0;
|
|
1824
1848
|
return `yoya-ui:router-views:${(n >>> 0).toString(36)}`;
|
|
1825
1849
|
}
|
|
1826
|
-
function
|
|
1850
|
+
function Ci(e) {
|
|
1827
1851
|
if (typeof localStorage > "u") return null;
|
|
1828
1852
|
try {
|
|
1829
1853
|
let t = JSON.parse(localStorage.getItem(e) || "null");
|
|
@@ -1832,7 +1856,7 @@ function yi(e) {
|
|
|
1832
1856
|
return null;
|
|
1833
1857
|
}
|
|
1834
1858
|
}
|
|
1835
|
-
var
|
|
1859
|
+
var wi = class extends h {
|
|
1836
1860
|
constructor(e = null) {
|
|
1837
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);
|
|
1838
1862
|
}
|
|
@@ -1850,7 +1874,7 @@ var bi = class extends h {
|
|
|
1850
1874
|
return n && this.stop(), this._mode = t, n && this.start(), this;
|
|
1851
1875
|
}
|
|
1852
1876
|
route(e, t) {
|
|
1853
|
-
let n =
|
|
1877
|
+
let n = Mi(e, t);
|
|
1854
1878
|
return this._routes.push(n), this;
|
|
1855
1879
|
}
|
|
1856
1880
|
notFound(e) {
|
|
@@ -1866,19 +1890,19 @@ var bi = class extends h {
|
|
|
1866
1890
|
return this._beforeEach = e, this;
|
|
1867
1891
|
}
|
|
1868
1892
|
start() {
|
|
1869
|
-
|
|
1870
|
-
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);
|
|
1871
1895
|
return (this._mode === "history" ? e === "/" || e === "/index.html" : !window.location.hash) && this._defaultPath ? this.navigate(this._defaultPath, { replace: !0 }) : this.refresh();
|
|
1872
1896
|
}
|
|
1873
1897
|
stop() {
|
|
1874
|
-
return this._started
|
|
1898
|
+
return this._started &&= (this._stopListening?.(), this._stopListening = null, !1), this;
|
|
1875
1899
|
}
|
|
1876
1900
|
navigate(e, t = {}) {
|
|
1877
1901
|
let n = Z(e), r = this._resolve(n);
|
|
1878
|
-
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;
|
|
1879
1903
|
}
|
|
1880
1904
|
refresh() {
|
|
1881
|
-
let e =
|
|
1905
|
+
let e = Ji(this._mode), t = this._resolve(e);
|
|
1882
1906
|
return this._canEnter(t.context) && this._renderResolved(t), this;
|
|
1883
1907
|
}
|
|
1884
1908
|
renderPath(e) {
|
|
@@ -1924,16 +1948,16 @@ var bi = class extends h {
|
|
|
1924
1948
|
_resolve(e) {
|
|
1925
1949
|
let t = this._routes.map((t) => ({
|
|
1926
1950
|
route: t,
|
|
1927
|
-
match:
|
|
1951
|
+
match: Gi(t.pattern, e)
|
|
1928
1952
|
})).find(({ match: e }) => e);
|
|
1929
1953
|
if (t) return {
|
|
1930
|
-
context:
|
|
1954
|
+
context: Ki(this, e, t.route, t.match),
|
|
1931
1955
|
route: t.route,
|
|
1932
1956
|
view: t.route.view
|
|
1933
1957
|
};
|
|
1934
1958
|
let n = Q(e);
|
|
1935
1959
|
return {
|
|
1936
|
-
context:
|
|
1960
|
+
context: Ki(this, e, null, {
|
|
1937
1961
|
params: {},
|
|
1938
1962
|
pathname: n.pathname,
|
|
1939
1963
|
query: n.query
|
|
@@ -1943,7 +1967,7 @@ var bi = class extends h {
|
|
|
1943
1967
|
};
|
|
1944
1968
|
}
|
|
1945
1969
|
_handleHashChange() {
|
|
1946
|
-
let e =
|
|
1970
|
+
let e = qi();
|
|
1947
1971
|
return this._ignoreNextHashPath === e ? (this._ignoreNextHashPath = null, this) : (this._ignoreNextHashPath = null, e === this._currentPath ? this : this.refresh());
|
|
1948
1972
|
}
|
|
1949
1973
|
_handlePopState() {
|
|
@@ -1960,7 +1984,7 @@ var bi = class extends h {
|
|
|
1960
1984
|
}
|
|
1961
1985
|
_renderResolved(e) {
|
|
1962
1986
|
let { context: t, route: n, view: r } = e, i = typeof r == "function" ? r(t) : r;
|
|
1963
|
-
if (this._navigationGeneration += 1, !
|
|
1987
|
+
if (this._navigationGeneration += 1, !Ui(i)) {
|
|
1964
1988
|
this._commitView(e, X(i, t));
|
|
1965
1989
|
return;
|
|
1966
1990
|
}
|
|
@@ -1981,32 +2005,32 @@ var bi = class extends h {
|
|
|
1981
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));
|
|
1982
2006
|
}
|
|
1983
2007
|
_buildLoadingView(e, t) {
|
|
1984
|
-
return
|
|
2008
|
+
return Wi(e?.loading ?? this._loadingView ?? Vi, [t]);
|
|
1985
2009
|
}
|
|
1986
2010
|
_buildErrorView(e, t, n) {
|
|
1987
|
-
return
|
|
2011
|
+
return Wi(e?.error ?? this._errorView ?? Hi, [n, t]);
|
|
1988
2012
|
}
|
|
1989
2013
|
_destroyCurrentView() {
|
|
1990
2014
|
this._currentView?.destroy && this._currentView.destroy(), this._currentView = null;
|
|
1991
2015
|
}
|
|
1992
2016
|
};
|
|
1993
|
-
function
|
|
1994
|
-
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);
|
|
1995
2019
|
return m(i, r.options), typeof r.callback == "function" && r.callback(i), i;
|
|
1996
2020
|
}
|
|
1997
|
-
var
|
|
1998
|
-
function
|
|
2021
|
+
var Ei = Ti;
|
|
2022
|
+
function Di(e, t) {
|
|
1999
2023
|
return {
|
|
2000
2024
|
config: t,
|
|
2001
2025
|
pattern: e
|
|
2002
2026
|
};
|
|
2003
2027
|
}
|
|
2004
|
-
function
|
|
2005
|
-
let r = p(e, t, n), i = new
|
|
2006
|
-
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;
|
|
2007
2031
|
}
|
|
2008
|
-
function
|
|
2009
|
-
|
|
2032
|
+
function ki(e, t = null, n = null) {
|
|
2033
|
+
Ni(e);
|
|
2010
2034
|
let r = new h("a"), i = {
|
|
2011
2035
|
exact: !0,
|
|
2012
2036
|
label: null,
|
|
@@ -2015,21 +2039,21 @@ function Ti(e, t = null, n = null) {
|
|
|
2015
2039
|
replace: !1,
|
|
2016
2040
|
to: "/"
|
|
2017
2041
|
}, a = new h("span").className("yoya-vlink-label");
|
|
2018
|
-
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,
|
|
2019
|
-
|
|
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 }));
|
|
2020
2044
|
});
|
|
2021
|
-
let o = e.subscribe(() =>
|
|
2045
|
+
let o = e.subscribe(() => Li(r, i, e)), s = r.destroy.bind(r);
|
|
2022
2046
|
return r.destroy = () => (o(), s()), typeof n == "function" && n(r), r;
|
|
2023
2047
|
}
|
|
2024
|
-
function
|
|
2025
|
-
|
|
2048
|
+
function Ai(e, t = null, n = null) {
|
|
2049
|
+
Ni(e);
|
|
2026
2050
|
let r = new h("div");
|
|
2027
2051
|
r.className("yoya-vrouter-view"), r.attr("data-router-view", "true"), typeof t == "function" ? t(r) : t && r.setup(t), e.outlet(r);
|
|
2028
2052
|
let i = r.destroy.bind(r);
|
|
2029
2053
|
return r.destroy = () => (e.outlet() === r && e.outlet(e), i()), typeof n == "function" && n(r), r;
|
|
2030
2054
|
}
|
|
2031
|
-
function
|
|
2032
|
-
|
|
2055
|
+
function ji(e, t = null, n = null) {
|
|
2056
|
+
Ni(e);
|
|
2033
2057
|
let r = new h("div"), i = new h("header").className("yoya-vrouter-views-titlebar").attr({
|
|
2034
2058
|
role: "tablist",
|
|
2035
2059
|
"aria-label": "已打开页面"
|
|
@@ -2041,7 +2065,7 @@ function Di(e, t = null, n = null) {
|
|
|
2041
2065
|
alignItems: "center",
|
|
2042
2066
|
background: "transparent",
|
|
2043
2067
|
border: "0",
|
|
2044
|
-
color:
|
|
2068
|
+
color: k("color-text-secondary", "#57606a"),
|
|
2045
2069
|
cursor: "pointer",
|
|
2046
2070
|
display: "none",
|
|
2047
2071
|
flexShrink: "0",
|
|
@@ -2061,8 +2085,8 @@ function Di(e, t = null, n = null) {
|
|
|
2061
2085
|
role: "menu",
|
|
2062
2086
|
"aria-label": "已打开页面"
|
|
2063
2087
|
}).styles({
|
|
2064
|
-
background:
|
|
2065
|
-
border:
|
|
2088
|
+
background: k("color-surface", "#ffffff"),
|
|
2089
|
+
border: A("color-border", "#d0d7de"),
|
|
2066
2090
|
borderRadius: "8px",
|
|
2067
2091
|
boxShadow: "0 12px 28px rgba(15, 23, 42, 0.18)",
|
|
2068
2092
|
display: "none",
|
|
@@ -2080,7 +2104,7 @@ function Di(e, t = null, n = null) {
|
|
|
2080
2104
|
overflow: !1,
|
|
2081
2105
|
persist: !0,
|
|
2082
2106
|
popupOpen: !1,
|
|
2083
|
-
storageKey:
|
|
2107
|
+
storageKey: Si(e),
|
|
2084
2108
|
suppressPersist: !1,
|
|
2085
2109
|
tabs: /* @__PURE__ */ new Map(),
|
|
2086
2110
|
title: "工作区",
|
|
@@ -2088,14 +2112,14 @@ function Di(e, t = null, n = null) {
|
|
|
2088
2112
|
titlePosition: "top"
|
|
2089
2113
|
};
|
|
2090
2114
|
r.className("yoya-vrouter-views"), r.styles({
|
|
2091
|
-
border:
|
|
2115
|
+
border: A("color-border", "#d0d7de"),
|
|
2092
2116
|
boxSizing: "border-box",
|
|
2093
2117
|
overflow: "hidden"
|
|
2094
2118
|
}), i.styles({
|
|
2095
|
-
background:
|
|
2096
|
-
borderBottom:
|
|
2119
|
+
background: k("color-surface-hover", "#f6f8fa"),
|
|
2120
|
+
borderBottom: A("color-border", "#d0d7de"),
|
|
2097
2121
|
boxSizing: "border-box",
|
|
2098
|
-
color:
|
|
2122
|
+
color: k("color-text-secondary", "#57606a"),
|
|
2099
2123
|
display: "flex",
|
|
2100
2124
|
flexWrap: "nowrap",
|
|
2101
2125
|
fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
@@ -2145,18 +2169,18 @@ function Di(e, t = null, n = null) {
|
|
|
2145
2169
|
alignItems: t ? "stretch" : null,
|
|
2146
2170
|
display: t ? "flex" : null
|
|
2147
2171
|
}), i.styles({
|
|
2148
|
-
background:
|
|
2149
|
-
borderBottom: t ? null :
|
|
2172
|
+
background: k("color-surface-hover", "#f6f8fa"),
|
|
2173
|
+
borderBottom: t ? null : A("color-border", "#d0d7de"),
|
|
2150
2174
|
borderLeft: e === "right" ? "1px solid" : null,
|
|
2151
|
-
borderLeftColor: e === "right" ?
|
|
2175
|
+
borderLeftColor: e === "right" ? k("color-border", "#d0d7de") : null,
|
|
2152
2176
|
borderLeftStyle: e === "right" ? "solid" : null,
|
|
2153
2177
|
borderLeftWidth: e === "right" ? "1px" : null,
|
|
2154
2178
|
borderRight: e === "left" ? "1px solid" : null,
|
|
2155
|
-
borderRightColor: e === "left" ?
|
|
2179
|
+
borderRightColor: e === "left" ? k("color-border", "#d0d7de") : null,
|
|
2156
2180
|
borderRightStyle: e === "left" ? "solid" : null,
|
|
2157
2181
|
borderRightWidth: e === "left" ? "1px" : null,
|
|
2158
2182
|
boxSizing: "border-box",
|
|
2159
|
-
color:
|
|
2183
|
+
color: k("color-text-secondary", "#57606a"),
|
|
2160
2184
|
display: "flex",
|
|
2161
2185
|
flexDirection: t ? "column" : "row",
|
|
2162
2186
|
flexShrink: t ? "0" : null,
|
|
@@ -2195,31 +2219,31 @@ function Di(e, t = null, n = null) {
|
|
|
2195
2219
|
}
|
|
2196
2220
|
return t ?? "";
|
|
2197
2221
|
}, m = (e, t) => {
|
|
2198
|
-
let n = l.titlePosition,
|
|
2199
|
-
e.
|
|
2200
|
-
background: t ?
|
|
2201
|
-
border:
|
|
2202
|
-
borderBottomColor:
|
|
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"),
|
|
2203
2227
|
borderLeftColor: "transparent",
|
|
2204
|
-
borderRightColor:
|
|
2205
|
-
color: t ?
|
|
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"),
|
|
2206
2230
|
fontWeight: t ? "600" : "400",
|
|
2207
|
-
marginBottom:
|
|
2208
|
-
marginLeft:
|
|
2209
|
-
marginRight:
|
|
2210
|
-
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"
|
|
2211
2235
|
});
|
|
2212
2236
|
}, g = (e) => {
|
|
2213
2237
|
l.overflow = !!e, r.attr("data-title-overflow", l.overflow ? "true" : null), s.style("display", l.overflow ? "inline-flex" : "none");
|
|
2214
2238
|
}, _ = () => {
|
|
2215
|
-
if (l.titlePosition !== "top" || l.tabs.size <=
|
|
2239
|
+
if (l.titlePosition !== "top" || l.tabs.size <= J) {
|
|
2216
2240
|
g(!1);
|
|
2217
2241
|
return;
|
|
2218
2242
|
}
|
|
2219
2243
|
g(!0);
|
|
2220
2244
|
}, v = () => {
|
|
2221
|
-
let e = Array.from(l.tabs.entries()), t = e.slice(0,
|
|
2222
|
-
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")) {
|
|
2223
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);
|
|
2224
2248
|
return;
|
|
2225
2249
|
}
|
|
@@ -2238,7 +2262,7 @@ function Di(e, t = null, n = null) {
|
|
|
2238
2262
|
}, b = null, x = () => {
|
|
2239
2263
|
l.popupOpen = !1, r.attr("data-title-popup", null), s.attr("aria-expanded", "false"), c.style("display", "none"), b &&= (b(), null);
|
|
2240
2264
|
}, S = () => {
|
|
2241
|
-
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]) => {
|
|
2242
2266
|
let r = n.text.textContent(), i = new h("div").className("yoya-vrouter-views-popup-item").attr({
|
|
2243
2267
|
role: "menuitem",
|
|
2244
2268
|
tabIndex: "0",
|
|
@@ -2246,7 +2270,7 @@ function Di(e, t = null, n = null) {
|
|
|
2246
2270
|
}).styles({
|
|
2247
2271
|
alignItems: "center",
|
|
2248
2272
|
borderRadius: "6px",
|
|
2249
|
-
color:
|
|
2273
|
+
color: k("color-text", "#24292f"),
|
|
2250
2274
|
cursor: "pointer",
|
|
2251
2275
|
display: "flex",
|
|
2252
2276
|
fontSize: "13px",
|
|
@@ -2273,8 +2297,8 @@ function Di(e, t = null, n = null) {
|
|
|
2273
2297
|
padding: "2px 4px"
|
|
2274
2298
|
}).text("×");
|
|
2275
2299
|
t === e.currentPath() && (i.attr("aria-current", "true"), i.styles({
|
|
2276
|
-
background:
|
|
2277
|
-
color:
|
|
2300
|
+
background: k("color-primary-subtle", "#e8f0fe"),
|
|
2301
|
+
color: k("color-primary", "#1f6feb")
|
|
2278
2302
|
}));
|
|
2279
2303
|
let s = () => {
|
|
2280
2304
|
x(), e.navigate(t);
|
|
@@ -2287,16 +2311,16 @@ function Di(e, t = null, n = null) {
|
|
|
2287
2311
|
});
|
|
2288
2312
|
}, ee = () => {
|
|
2289
2313
|
if (l.tabs.size === 0) return;
|
|
2290
|
-
|
|
2314
|
+
xi(), S(), l.popupOpen = !0, r.attr("data-title-popup", "true"), s.attr("aria-expanded", "true"), c.styles({ display: "block" }), f();
|
|
2291
2315
|
let e = (e) => {
|
|
2292
2316
|
!c._el?.contains(e.target) && !s._el?.contains(e.target) && x();
|
|
2293
2317
|
}, t = (e) => {
|
|
2294
2318
|
e.key === "Escape" && x();
|
|
2295
|
-
}, n = () =>
|
|
2296
|
-
|
|
2297
|
-
|
|
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();
|
|
2298
2322
|
};
|
|
2299
|
-
function
|
|
2323
|
+
function f() {
|
|
2300
2324
|
let e = s._el?.getBoundingClientRect(), t = c._el?.getBoundingClientRect();
|
|
2301
2325
|
if (!e || !t) return;
|
|
2302
2326
|
let n = window.innerWidth || document.documentElement?.clientWidth || 0, r = window.innerHeight || document.documentElement?.clientHeight || 0, i = e.right - t.width;
|
|
@@ -2313,13 +2337,13 @@ function Di(e, t = null, n = null) {
|
|
|
2313
2337
|
});
|
|
2314
2338
|
let te = r.renderDom.bind(r);
|
|
2315
2339
|
r.renderDom = () => {
|
|
2316
|
-
|
|
2340
|
+
xi();
|
|
2317
2341
|
let e = te();
|
|
2318
2342
|
return _(), e;
|
|
2319
2343
|
}, r.updateOverflow = _, r.titlePosition = (t) => {
|
|
2320
2344
|
if (t === void 0) return l.titlePosition;
|
|
2321
|
-
let n =
|
|
2322
|
-
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) => {
|
|
2323
2347
|
m(t, n === e.currentPath());
|
|
2324
2348
|
}), _(), r;
|
|
2325
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;
|
|
@@ -2327,7 +2351,7 @@ function Di(e, t = null, n = null) {
|
|
|
2327
2351
|
n && n.stopPropagation();
|
|
2328
2352
|
let r = Array.from(l.tabs.entries()).findIndex(([e]) => e === t), o = l.tabs.get(t);
|
|
2329
2353
|
if (!o) return;
|
|
2330
|
-
let s = o.
|
|
2354
|
+
let s = o.label.attr("aria-selected") === "true";
|
|
2331
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;
|
|
2332
2356
|
let c = Array.from(l.tabs.keys());
|
|
2333
2357
|
if (c.length > 0) {
|
|
@@ -2340,8 +2364,8 @@ function Di(e, t = null, n = null) {
|
|
|
2340
2364
|
role: "menu",
|
|
2341
2365
|
"aria-label": "标签页操作"
|
|
2342
2366
|
}).styles({
|
|
2343
|
-
background:
|
|
2344
|
-
border:
|
|
2367
|
+
background: k("color-surface", "#ffffff"),
|
|
2368
|
+
border: A("color-border", "#d0d7de"),
|
|
2345
2369
|
borderRadius: "8px",
|
|
2346
2370
|
boxShadow: "0 12px 28px rgba(15, 23, 42, 0.18)",
|
|
2347
2371
|
display: "none",
|
|
@@ -2349,9 +2373,9 @@ function Di(e, t = null, n = null) {
|
|
|
2349
2373
|
padding: "6px",
|
|
2350
2374
|
position: "fixed",
|
|
2351
2375
|
zIndex: "100"
|
|
2352
|
-
}),
|
|
2353
|
-
C.styles({ display: "none" }), C.clearChildren(), C._el?.remove(),
|
|
2354
|
-
},
|
|
2376
|
+
}), re = null, w = () => {
|
|
2377
|
+
C.styles({ display: "none" }), C.clearChildren(), C._el?.remove(), re &&= (re(), null);
|
|
2378
|
+
}, T = (t, n = null) => {
|
|
2355
2379
|
let r = new Set(t), o = Array.from(l.tabs.entries()), s = o.findIndex(([e]) => r.has(e));
|
|
2356
2380
|
if (o.forEach(([e, t]) => {
|
|
2357
2381
|
r.has(e) && (l.tabs.delete(e), i._children = i.children().filter((e) => e !== t.tab), i._childrenDirty = !0, t.tab.destroy());
|
|
@@ -2363,20 +2387,20 @@ function Di(e, t = null, n = null) {
|
|
|
2363
2387
|
}
|
|
2364
2388
|
let u = n && l.tabs.has(n) ? n : c[Math.min(Math.max(s, 0), c.length - 1)];
|
|
2365
2389
|
e.navigate(u, { replace: !0 });
|
|
2366
|
-
},
|
|
2390
|
+
}, ie = (t) => {
|
|
2367
2391
|
if (typeof navigator > "u" || !navigator.clipboard) return;
|
|
2368
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}`;
|
|
2369
2393
|
navigator.clipboard.writeText(i).catch(() => {});
|
|
2370
|
-
},
|
|
2371
|
-
l.popupOpen && x(),
|
|
2372
|
-
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) => {
|
|
2373
2397
|
let i = new h("div").className("yoya-vrouter-views-context-item").attr({
|
|
2374
2398
|
role: "menuitem",
|
|
2375
2399
|
tabIndex: "0"
|
|
2376
2400
|
}).text(e).styles({
|
|
2377
2401
|
alignItems: "center",
|
|
2378
2402
|
borderRadius: "6px",
|
|
2379
|
-
color: n ?
|
|
2403
|
+
color: n ? k("color-text-danger", "#b91c1c") : k("color-text", "#24292f"),
|
|
2380
2404
|
cursor: r ? "default" : "pointer",
|
|
2381
2405
|
display: "flex",
|
|
2382
2406
|
fontSize: "13px",
|
|
@@ -2385,25 +2409,25 @@ function Di(e, t = null, n = null) {
|
|
|
2385
2409
|
width: "100%"
|
|
2386
2410
|
});
|
|
2387
2411
|
return r ? (i.attr("aria-disabled", "true"), i.styles({ opacity: "0.4" })) : i.on("click", () => {
|
|
2388
|
-
|
|
2412
|
+
w(), t();
|
|
2389
2413
|
}), C.child(i), i;
|
|
2390
2414
|
}, d = () => C.child(new h("div").className("yoya-vrouter-views-context-separator"));
|
|
2391
|
-
u("刷新", () => e.navigate(t, { replace: !0 })), u("复制链接", () =>
|
|
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" });
|
|
2392
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));
|
|
2393
2417
|
C.styles({
|
|
2394
2418
|
left: `${g}px`,
|
|
2395
2419
|
top: `${_}px`
|
|
2396
2420
|
});
|
|
2397
2421
|
let v = (e) => {
|
|
2398
|
-
C._el?.contains(e.target) ||
|
|
2422
|
+
C._el?.contains(e.target) || w();
|
|
2399
2423
|
}, y = (e) => {
|
|
2400
|
-
e.key === "Escape" &&
|
|
2401
|
-
}, b = () =>
|
|
2402
|
-
|
|
2403
|
-
|
|
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();
|
|
2404
2428
|
};
|
|
2405
|
-
},
|
|
2406
|
-
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);
|
|
2407
2431
|
if (a) {
|
|
2408
2432
|
let e = p(t);
|
|
2409
2433
|
a.text.textContent(e), a.closeButton.attr("aria-label", `关闭 ${e}`);
|
|
@@ -2438,23 +2462,24 @@ function Di(e, t = null, n = null) {
|
|
|
2438
2462
|
lineHeight: "1",
|
|
2439
2463
|
padding: "0"
|
|
2440
2464
|
}), c.text("×"), c.on("click", (e) => ne(n, e)), r.on("contextmenu", (e) => {
|
|
2441
|
-
e.preventDefault(), e.stopPropagation(),
|
|
2442
|
-
}), r.child(s, c), i.child(r),
|
|
2465
|
+
e.preventDefault(), e.stopPropagation(), ae(n, e);
|
|
2466
|
+
}), r.child(s, c), i.child(r), a = {
|
|
2443
2467
|
closeButton: c,
|
|
2468
|
+
label: s,
|
|
2444
2469
|
tab: r,
|
|
2445
2470
|
text: o
|
|
2446
|
-
}, l.tabs.set(n, a);
|
|
2471
|
+
}, l.tabs.set(n, a), m(a, !1);
|
|
2447
2472
|
}
|
|
2448
|
-
r.has(n) || (l.tabs.delete(n), l.tabs = new Map([[n, a], ...l.tabs])), l.tabs.forEach((
|
|
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();
|
|
2449
2474
|
}, oe = () => {
|
|
2450
2475
|
if (!l.persist) return;
|
|
2451
|
-
let t =
|
|
2476
|
+
let t = Ci(l.storageKey);
|
|
2452
2477
|
if (t) {
|
|
2453
2478
|
l.suppressPersist = !0;
|
|
2454
2479
|
try {
|
|
2455
2480
|
t.paths.slice().reverse().forEach((t) => {
|
|
2456
2481
|
let n = e._resolve(t);
|
|
2457
|
-
|
|
2482
|
+
E({
|
|
2458
2483
|
...n.context,
|
|
2459
2484
|
path: t
|
|
2460
2485
|
});
|
|
@@ -2469,42 +2494,40 @@ function Di(e, t = null, n = null) {
|
|
|
2469
2494
|
let { persist: e, storageKey: n, title: i, titlePosition: a, titleResolver: o, ...s } = t;
|
|
2470
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);
|
|
2471
2496
|
}
|
|
2472
|
-
e.outlet(a), oe(), (e.currentRoute() || e.currentPath() !== "/") &&
|
|
2497
|
+
e.outlet(a), oe(), (e.currentRoute() || e.currentPath() !== "/") && E({
|
|
2473
2498
|
params: e.currentParams(),
|
|
2474
2499
|
path: e.currentPath(),
|
|
2475
2500
|
query: e.currentQuery(),
|
|
2476
2501
|
route: e.currentRoute(),
|
|
2477
2502
|
router: e
|
|
2478
2503
|
});
|
|
2479
|
-
let se = e.subscribe((e) =>
|
|
2480
|
-
typeof
|
|
2481
|
-
let le = r.destroy.bind(r);
|
|
2482
|
-
return r.destroy = () => (l.popupOpen && x(), T(), typeof window < "u" && window.removeEventListener("resize", ce), se(), e.outlet() === a && e.outlet(e), le()), 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;
|
|
2483
2506
|
}
|
|
2484
2507
|
_(h, {
|
|
2485
|
-
vLink:
|
|
2486
|
-
vRouter:
|
|
2487
|
-
vRouterView:
|
|
2488
|
-
vRouterViews:
|
|
2508
|
+
vLink: ki,
|
|
2509
|
+
vRouter: Oi,
|
|
2510
|
+
vRouterView: Ai,
|
|
2511
|
+
vRouterViews: ji
|
|
2489
2512
|
});
|
|
2490
|
-
function
|
|
2513
|
+
function Mi(e, t) {
|
|
2491
2514
|
let n = {
|
|
2492
2515
|
beforeEnter: null,
|
|
2493
2516
|
error: null,
|
|
2494
2517
|
loading: null,
|
|
2495
|
-
pattern:
|
|
2518
|
+
pattern: Zi(e),
|
|
2496
2519
|
title: null,
|
|
2497
2520
|
view: null
|
|
2498
2521
|
};
|
|
2499
|
-
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);
|
|
2500
2523
|
}
|
|
2501
|
-
function
|
|
2502
|
-
if (!(e instanceof
|
|
2524
|
+
function Ni(e) {
|
|
2525
|
+
if (!(e instanceof wi)) throw TypeError("vLink and vRouterView require a Router instance");
|
|
2503
2526
|
}
|
|
2504
|
-
function
|
|
2527
|
+
function Pi(e) {
|
|
2505
2528
|
return e === "left" || e === "right" ? e : "top";
|
|
2506
2529
|
}
|
|
2507
|
-
function
|
|
2530
|
+
function Fi(e, t) {
|
|
2508
2531
|
if (typeof t == "function") return t(e), e;
|
|
2509
2532
|
if (!t || typeof t != "object") return e;
|
|
2510
2533
|
let { beforeEach: n, default: r, error: i, loading: a, notFound: o, routes: s = [], ...c } = t;
|
|
@@ -2512,7 +2535,7 @@ function ji(e, t) {
|
|
|
2512
2535
|
t?.pattern !== void 0 && e.vRoute(t.pattern, t.config);
|
|
2513
2536
|
}), o !== void 0 && e.notFound(o), e;
|
|
2514
2537
|
}
|
|
2515
|
-
function
|
|
2538
|
+
function Ii(e, t, n) {
|
|
2516
2539
|
if (typeof n == "function") {
|
|
2517
2540
|
n(e);
|
|
2518
2541
|
return;
|
|
@@ -2527,20 +2550,20 @@ function Mi(e, t, n) {
|
|
|
2527
2550
|
}
|
|
2528
2551
|
function Y(e, t, n, r) {
|
|
2529
2552
|
if (r === void 0) return t[n];
|
|
2530
|
-
t[n] = r, n === "to" && t.label === null &&
|
|
2553
|
+
t[n] = r, n === "to" && t.label === null && N(e.children()[0], bn(r));
|
|
2531
2554
|
let i = e._routerInstance;
|
|
2532
|
-
return i &&
|
|
2555
|
+
return i && Li(e, t, i), e;
|
|
2533
2556
|
}
|
|
2534
|
-
function
|
|
2557
|
+
function Li(e, t, n) {
|
|
2535
2558
|
e._routerInstance = n;
|
|
2536
|
-
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));
|
|
2537
2560
|
return a.add("yoya-vlink"), i ? a.add("is-active") : a.delete("is-active"), e.attr({
|
|
2538
2561
|
"aria-current": i ? "page" : null,
|
|
2539
2562
|
class: [...a].join(" "),
|
|
2540
2563
|
href: n.mode() === "history" ? r : `#${r}`
|
|
2541
2564
|
}), e;
|
|
2542
2565
|
}
|
|
2543
|
-
function
|
|
2566
|
+
function Ri(e, t, n) {
|
|
2544
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);
|
|
2545
2568
|
Object.entries(n || {}).forEach(([e, t]) => {
|
|
2546
2569
|
o.delete(e), Array.isArray(t) ? t.forEach((t) => o.append(e, t)) : t != null && o.set(e, t);
|
|
@@ -2548,33 +2571,33 @@ function Pi(e, t, n) {
|
|
|
2548
2571
|
let s = o.toString();
|
|
2549
2572
|
return s ? `${a}?${s}` : a;
|
|
2550
2573
|
}
|
|
2551
|
-
function
|
|
2574
|
+
function zi(e, t, n) {
|
|
2552
2575
|
let r = Z(e), i = Z(t);
|
|
2553
2576
|
if (n) return r === i;
|
|
2554
2577
|
let a = Q(r).pathname, o = Q(i).pathname;
|
|
2555
2578
|
return a === o || a.startsWith(`${o}/`);
|
|
2556
2579
|
}
|
|
2557
|
-
function
|
|
2580
|
+
function Bi(e, t) {
|
|
2558
2581
|
return !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey && (!t.attr("target") || t.attr("target") === "_self");
|
|
2559
2582
|
}
|
|
2560
2583
|
function X(e, t) {
|
|
2561
2584
|
if (e instanceof c) return e;
|
|
2562
2585
|
if (e == null) return d("");
|
|
2563
|
-
if (
|
|
2586
|
+
if ($i(e)) return d(e);
|
|
2564
2587
|
if (typeof e == "object" && e && e.default !== void 0 && typeof e.render != "function") return X(e.default, t);
|
|
2565
2588
|
if (typeof e == "function") return X(e(t), t);
|
|
2566
2589
|
if (typeof e == "object" && typeof e.render == "function") return X(e.render(), t);
|
|
2567
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");
|
|
2568
2591
|
}
|
|
2569
|
-
var
|
|
2570
|
-
function
|
|
2592
|
+
var Vi = () => "加载中…", Hi = (e) => `加载失败:${e?.message ?? String(e)}`;
|
|
2593
|
+
function Ui(e) {
|
|
2571
2594
|
return e !== null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
|
|
2572
2595
|
}
|
|
2573
|
-
function
|
|
2596
|
+
function Wi(e, t) {
|
|
2574
2597
|
return X(typeof e == "function" ? e(...t) : e, t[t.length - 1]);
|
|
2575
2598
|
}
|
|
2576
|
-
function
|
|
2577
|
-
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);
|
|
2578
2601
|
if (i.length !== a.length) return null;
|
|
2579
2602
|
let o = {};
|
|
2580
2603
|
for (let e = 0; e < i.length; e += 1) {
|
|
@@ -2591,7 +2614,7 @@ function Vi(e, t) {
|
|
|
2591
2614
|
query: r.query
|
|
2592
2615
|
};
|
|
2593
2616
|
}
|
|
2594
|
-
function
|
|
2617
|
+
function Ki(e, t, n, r) {
|
|
2595
2618
|
return {
|
|
2596
2619
|
params: { ...r.params },
|
|
2597
2620
|
path: t,
|
|
@@ -2601,24 +2624,24 @@ function Hi(e, t, n, r) {
|
|
|
2601
2624
|
router: e
|
|
2602
2625
|
};
|
|
2603
2626
|
}
|
|
2604
|
-
function
|
|
2627
|
+
function qi() {
|
|
2605
2628
|
return typeof window > "u" ? "/" : Z(window.location.hash.replace(/^#/, "") || "/");
|
|
2606
2629
|
}
|
|
2607
|
-
function
|
|
2608
|
-
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();
|
|
2609
2632
|
}
|
|
2610
|
-
function
|
|
2633
|
+
function Yi(e, t = {}) {
|
|
2611
2634
|
if (typeof window > "u") return !1;
|
|
2612
2635
|
let n = `#${e}`;
|
|
2613
2636
|
return t.replace ? (window.history.replaceState(null, "", n), !0) : window.location.hash !== n && (window.location.hash = n, !0);
|
|
2614
2637
|
}
|
|
2615
|
-
function
|
|
2638
|
+
function Xi(e, t = {}, n = "hash") {
|
|
2616
2639
|
if (typeof window > "u") return !1;
|
|
2617
|
-
if (n !== "history") return
|
|
2618
|
-
let r = Z(e), i =
|
|
2640
|
+
if (n !== "history") return Yi(e, t);
|
|
2641
|
+
let r = Z(e), i = Ji("history");
|
|
2619
2642
|
return !t.replace && i === r ? !1 : (t.replace ? window.history.replaceState(null, "", r) : window.history.pushState(null, "", r), !0);
|
|
2620
2643
|
}
|
|
2621
|
-
function
|
|
2644
|
+
function Zi(e) {
|
|
2622
2645
|
return Z(e).split("?")[0] || "/";
|
|
2623
2646
|
}
|
|
2624
2647
|
function Z(e) {
|
|
@@ -2632,37 +2655,37 @@ function Q(e) {
|
|
|
2632
2655
|
query: Object.fromEntries(new URLSearchParams(n))
|
|
2633
2656
|
};
|
|
2634
2657
|
}
|
|
2635
|
-
function
|
|
2658
|
+
function Qi(e) {
|
|
2636
2659
|
return e.split("/").filter(Boolean);
|
|
2637
2660
|
}
|
|
2638
|
-
function
|
|
2661
|
+
function $i(e) {
|
|
2639
2662
|
return typeof e == "string" || typeof e == "number";
|
|
2640
2663
|
}
|
|
2641
2664
|
//#endregion
|
|
2642
2665
|
//#region src/core/id.js
|
|
2643
|
-
var
|
|
2644
|
-
function
|
|
2666
|
+
var ea = null;
|
|
2667
|
+
function ta() {
|
|
2645
2668
|
let e = 0;
|
|
2646
2669
|
return { next() {
|
|
2647
2670
|
return e += 1, e;
|
|
2648
2671
|
} };
|
|
2649
2672
|
}
|
|
2650
|
-
function
|
|
2651
|
-
let n =
|
|
2652
|
-
|
|
2673
|
+
function na(e, t) {
|
|
2674
|
+
let n = ea;
|
|
2675
|
+
ea = e;
|
|
2653
2676
|
try {
|
|
2654
2677
|
return t();
|
|
2655
2678
|
} finally {
|
|
2656
|
-
|
|
2679
|
+
ea = n;
|
|
2657
2680
|
}
|
|
2658
2681
|
}
|
|
2659
2682
|
//#endregion
|
|
2660
2683
|
//#region src/core/ssr.js
|
|
2661
|
-
function
|
|
2684
|
+
function ra(e = {}, t = {}) {
|
|
2662
2685
|
let { cookie: n = "", url: r = "", acceptLanguage: i = "" } = e || {}, { cookieKey: a = "yoya-lang", queryKey: o = "locale", defaultLanguage: s = "zh-CN" } = t;
|
|
2663
|
-
return
|
|
2686
|
+
return ia(n, a) || aa(r, o) || oa(i) || s;
|
|
2664
2687
|
}
|
|
2665
|
-
function
|
|
2688
|
+
function ia(e, t) {
|
|
2666
2689
|
if (!e || !t) return null;
|
|
2667
2690
|
for (let n of String(e).split(";")) {
|
|
2668
2691
|
let e = n.indexOf("=");
|
|
@@ -2677,18 +2700,18 @@ function ea(e, t) {
|
|
|
2677
2700
|
}
|
|
2678
2701
|
return null;
|
|
2679
2702
|
}
|
|
2680
|
-
function
|
|
2703
|
+
function aa(e, t) {
|
|
2681
2704
|
if (!e || !t) return null;
|
|
2682
2705
|
let n = String(e).indexOf("?");
|
|
2683
2706
|
return n === -1 ? null : new URLSearchParams(String(e).slice(n + 1)).get(t) || null;
|
|
2684
2707
|
}
|
|
2685
|
-
function
|
|
2708
|
+
function oa(e) {
|
|
2686
2709
|
if (!e) return null;
|
|
2687
2710
|
let t = String(e).split(",")[0];
|
|
2688
2711
|
return t && t.split(";")[0].trim() || null;
|
|
2689
2712
|
}
|
|
2690
|
-
function
|
|
2691
|
-
return e ?
|
|
2713
|
+
function sa(e, t, n) {
|
|
2714
|
+
return e ? zr(typeof e == "function" ? e(t) : e, n) : n();
|
|
2692
2715
|
}
|
|
2693
2716
|
function $(e, t = null) {
|
|
2694
2717
|
if (e instanceof c) return e;
|
|
@@ -2696,18 +2719,18 @@ function $(e, t = null) {
|
|
|
2696
2719
|
if (e && typeof e.render == "function") return $(e.render(), t);
|
|
2697
2720
|
throw TypeError("renderToString/mount requires a ViewNode, a component object with render(), or a factory function");
|
|
2698
2721
|
}
|
|
2699
|
-
function
|
|
2722
|
+
function ca(e) {
|
|
2700
2723
|
let t = 1;
|
|
2701
2724
|
return typeof e.children == "function" && e.children().forEach((e) => {
|
|
2702
|
-
t +=
|
|
2725
|
+
t += ca(e instanceof u ? e._resolve() : e);
|
|
2703
2726
|
}), t;
|
|
2704
2727
|
}
|
|
2705
|
-
function
|
|
2706
|
-
let { maxNodes: n = Infinity, state: r = null, i18n: i = null } = t || {}, a =
|
|
2707
|
-
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, () => {
|
|
2708
2731
|
let t = typeof e == "function", i = $(e, r), o;
|
|
2709
2732
|
try {
|
|
2710
|
-
o =
|
|
2733
|
+
o = ca(i) > n ? {
|
|
2711
2734
|
exceeded: !0,
|
|
2712
2735
|
html: "",
|
|
2713
2736
|
state: a
|
|
@@ -2722,7 +2745,7 @@ function aa(e, t = {}) {
|
|
|
2722
2745
|
return o;
|
|
2723
2746
|
}));
|
|
2724
2747
|
}
|
|
2725
|
-
var
|
|
2748
|
+
var ua = class extends v {
|
|
2726
2749
|
constructor() {
|
|
2727
2750
|
super("html", null), this._headCallback = null, this._bodyCallback = null;
|
|
2728
2751
|
}
|
|
@@ -2736,26 +2759,26 @@ var oa = class extends v {
|
|
|
2736
2759
|
return this.body((t) => t.vBody(...e));
|
|
2737
2760
|
}
|
|
2738
2761
|
};
|
|
2739
|
-
function
|
|
2762
|
+
function da(e) {
|
|
2740
2763
|
return String(e ?? "").replace(/&/g, "&").replace(/"/g, """);
|
|
2741
2764
|
}
|
|
2742
|
-
function
|
|
2765
|
+
function fa(e, t = {}, n = {}) {
|
|
2743
2766
|
let { client: r = "/client.js", containerId: i = "app", i18n: a = null, maxNodes: o = Infinity, messages: s, stateId: c = "__YOYA_DATA__" } = n || {}, l = t || {};
|
|
2744
2767
|
if (!e || typeof e.page != "function") throw TypeError("renderPage requires { page: (page, state) => {} }");
|
|
2745
|
-
let u = a || (s ? () =>
|
|
2768
|
+
let u = a || (s ? () => Ir({
|
|
2746
2769
|
language: l.lang || "zh-CN",
|
|
2747
2770
|
messages: s
|
|
2748
|
-
}) : null), d =
|
|
2749
|
-
return
|
|
2750
|
-
let t = new
|
|
2771
|
+
}) : null), d = ma(l);
|
|
2772
|
+
return na(ta(), () => sa(u, l, () => {
|
|
2773
|
+
let t = new ua();
|
|
2751
2774
|
e.page(t, l);
|
|
2752
2775
|
let n = new v("head");
|
|
2753
2776
|
t._headCallback && t._headCallback(n, l);
|
|
2754
2777
|
let a = new v("body");
|
|
2755
2778
|
t._bodyCallback && t._bodyCallback(a, l);
|
|
2756
|
-
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>`;
|
|
2757
2780
|
return n.destroy(), a.destroy(), `<!doctype html>
|
|
2758
|
-
<html lang="${
|
|
2781
|
+
<html lang="${da(l.lang || "zh-CN")}">
|
|
2759
2782
|
${u}
|
|
2760
2783
|
<body>
|
|
2761
2784
|
${p}
|
|
@@ -2765,69 +2788,69 @@ ${h}
|
|
|
2765
2788
|
</html>`;
|
|
2766
2789
|
}));
|
|
2767
2790
|
}
|
|
2768
|
-
function
|
|
2791
|
+
function pa(e, t = {}) {
|
|
2769
2792
|
if (typeof document > "u") return null;
|
|
2770
|
-
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({
|
|
2771
2794
|
language: c?.lang || "zh-CN",
|
|
2772
2795
|
messages: r
|
|
2773
2796
|
}) : null), u = n(o);
|
|
2774
|
-
return u && u.firstElementChild ?
|
|
2797
|
+
return u && u.firstElementChild ? _a(e, o, c, { i18n: l }) : ga(e, o, c, { i18n: l });
|
|
2775
2798
|
}
|
|
2776
|
-
function
|
|
2799
|
+
function ma(e) {
|
|
2777
2800
|
return e == null ? null : JSON.stringify(e).replace(/</g, "\\u003c");
|
|
2778
2801
|
}
|
|
2779
|
-
function
|
|
2802
|
+
function ha(e) {
|
|
2780
2803
|
return e == null || e === "" ? null : JSON.parse(e);
|
|
2781
2804
|
}
|
|
2782
|
-
function
|
|
2783
|
-
return
|
|
2805
|
+
function ga(e, t, r = null, i = {}) {
|
|
2806
|
+
return na(ta(), () => sa(i.i18n, r, () => {
|
|
2784
2807
|
let i = $(e, r), a = n(t);
|
|
2785
2808
|
return a && (a.replaceChildren(), a.appendChild(i.renderDom())), i;
|
|
2786
2809
|
}));
|
|
2787
2810
|
}
|
|
2788
|
-
function
|
|
2789
|
-
return
|
|
2811
|
+
function _a(e, t, r = null, i = {}) {
|
|
2812
|
+
return na(ta(), () => sa(i.i18n, r, () => {
|
|
2790
2813
|
let i = $(e, r), a = n(t);
|
|
2791
2814
|
if (a) {
|
|
2792
2815
|
let e = a.firstElementChild;
|
|
2793
|
-
e ? (
|
|
2816
|
+
e ? (va(i, e), ba(i), ya(i), i.renderDom()) : a.appendChild(i.renderDom());
|
|
2794
2817
|
}
|
|
2795
2818
|
return i;
|
|
2796
2819
|
}));
|
|
2797
2820
|
}
|
|
2798
|
-
function
|
|
2821
|
+
function va(e, t) {
|
|
2799
2822
|
if (e instanceof u) {
|
|
2800
|
-
|
|
2823
|
+
va(e._resolve(), t);
|
|
2801
2824
|
return;
|
|
2802
2825
|
}
|
|
2803
2826
|
if (e instanceof l) {
|
|
2804
|
-
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());
|
|
2805
2828
|
return;
|
|
2806
2829
|
}
|
|
2807
2830
|
if (t && t.nodeType === 1 && t.tagName.toLowerCase() === e._tagName) {
|
|
2808
2831
|
e._el = t, e._hydrated = !0;
|
|
2809
2832
|
let n = Array.from(t.childNodes);
|
|
2810
|
-
e.children().forEach((e, t) =>
|
|
2833
|
+
e.children().forEach((e, t) => va(e, n[t]));
|
|
2811
2834
|
return;
|
|
2812
2835
|
}
|
|
2813
|
-
|
|
2836
|
+
xa(t, e.renderDom());
|
|
2814
2837
|
}
|
|
2815
|
-
function
|
|
2838
|
+
function ya(e) {
|
|
2816
2839
|
if (e instanceof u) {
|
|
2817
|
-
|
|
2840
|
+
ya(e._resolve());
|
|
2818
2841
|
return;
|
|
2819
2842
|
}
|
|
2820
|
-
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));
|
|
2821
2844
|
}
|
|
2822
|
-
function
|
|
2845
|
+
function ba(e) {
|
|
2823
2846
|
if (e instanceof u) {
|
|
2824
|
-
|
|
2847
|
+
ba(e._resolve());
|
|
2825
2848
|
return;
|
|
2826
2849
|
}
|
|
2827
|
-
e instanceof l || (e.children().forEach(
|
|
2850
|
+
e instanceof l || (e.children().forEach(ba), typeof e.hydrateSnapshot == "function" && e.hydrateSnapshot());
|
|
2828
2851
|
}
|
|
2829
|
-
function
|
|
2852
|
+
function xa(e, t) {
|
|
2830
2853
|
e && e.parentNode && e.parentNode.replaceChild(t, e);
|
|
2831
2854
|
}
|
|
2832
2855
|
//#endregion
|
|
2833
|
-
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 };
|