ranui 0.2.0-alpha.6 → 0.2.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -3
- package/README.zh-CN.md +40 -10
- package/dist/arrow-down-Bi5kqUrX.js +12 -0
- package/dist/builder.d.ts +2 -2
- package/dist/builder.js +32 -28
- package/dist/builtin-D9djWkCE.js +409 -0
- package/dist/{button-Be_uHDZG.js → button-BfYw0fes.js} +1 -1
- package/dist/button.js +1 -1
- package/dist/{card-BVvXX6KM.js → card-CqJa4Q_v.js} +1 -1
- package/dist/card.js +1 -1
- package/dist/{checkbox-BtoX9X2Z.js → checkbox-CThC9-vy.js} +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{colorpicker-Dukms7ET.js → colorpicker-XNxDRcQ-.js} +5 -6
- package/dist/colorpicker.js +1 -1
- package/dist/components/colorpicker/index.d.ts +3 -3
- package/dist/components/icon/builtin.d.ts +9 -0
- package/dist/components/icon/index.d.ts +8 -0
- package/dist/components/route/index.d.ts +10 -4
- package/dist/components/router/index.d.ts +3 -0
- package/dist/{dropdown-BYS1Trdu.js → dropdown-CCvsambb.js} +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/factory-DCrO37si.js +334 -0
- package/dist/{form-BsB5JhS4.js → form-Ceq3uJzz.js} +1 -1
- package/dist/form.js +1 -1
- package/dist/i18n.d.ts +2 -0
- package/dist/i18n.js +6 -0
- package/dist/{icon-pfolda2m.js → icon-C_ENrJ3F.js} +50 -13
- package/dist/icon.js +4 -3
- package/dist/icons.js +5 -0
- package/dist/iife/button.iife.js +1 -1
- package/dist/iife/card.iife.js +1 -1
- package/dist/iife/checkbox.iife.js +1 -1
- package/dist/iife/colorpicker.iife.js +2 -2
- package/dist/iife/dropdown.iife.js +1 -1
- package/dist/iife/form.iife.js +1 -1
- package/dist/iife/icon.iife.js +1 -1
- package/dist/iife/image.iife.js +1 -1
- package/dist/iife/input.iife.js +1 -1
- package/dist/iife/loading.iife.js +1 -1
- package/dist/iife/math.iife.js +14 -14
- package/dist/iife/message.iife.js +1 -1
- package/dist/iife/modal.iife.js +1 -1
- package/dist/iife/player.iife.js +8 -8
- package/dist/iife/popover.iife.js +1 -1
- package/dist/iife/progress.iife.js +1 -1
- package/dist/iife/radar.iife.js +1 -1
- package/dist/iife/route.iife.js +1 -1
- package/dist/iife/router.iife.js +1 -1
- package/dist/iife/scratch.iife.js +1 -1
- package/dist/iife/section.iife.js +1 -1
- package/dist/iife/select.iife.js +2 -2
- package/dist/iife/skeleton.iife.js +1 -1
- package/dist/iife/tab.iife.js +1 -1
- package/dist/iife/tabpane.iife.js +1 -1
- package/dist/{image-BXpKQ9sU.js → image-B7MBI5n_.js} +1 -1
- package/dist/image.js +1 -1
- package/dist/index.cjs +256 -23
- package/dist/index.d.ts +3 -1
- package/dist/index.iife.js +266 -33
- package/dist/index.js +79 -74
- package/dist/{input-BMMM60e6.js → input-RNqdEHPf.js} +2 -2
- package/dist/input.js +1 -1
- package/dist/{loading-BScjyeVm.js → loading-B9MFI03l.js} +1 -1
- package/dist/loading.js +1 -1
- package/dist/{math-IjzOAwnA.js → math-CudIwEXZ.js} +1 -1
- package/dist/math.js +1 -1
- package/dist/{message-CLpuP8HY.js → message-DW7qWpEm.js} +34 -49
- package/dist/message.js +1 -1
- package/dist/{modal-DOTpABRe.js → modal-CrvGKL2B.js} +1 -1
- package/dist/modal.js +1 -1
- package/dist/{player-5olrw-qB.js → player-BKQaaT7o.js} +2 -2
- package/dist/player.js +1 -1
- package/dist/{popover-DRUQjdPs.js → popover-CvYIVgUS.js} +2 -2
- package/dist/popover.js +1 -1
- package/dist/{progress-BIEXYYd2.js → progress-C6jctsFH.js} +1 -1
- package/dist/progress.js +1 -1
- package/dist/{radar-DAF95_Mj.js → radar-BUb4EzmG.js} +1 -1
- package/dist/radar.js +1 -1
- package/dist/route-Djrf9UR_.js +116 -0
- package/dist/route.js +1 -1
- package/dist/{router-B9rCrWXm.js → router-BU2KhtxV.js} +22 -17
- package/dist/router.js +1 -1
- package/dist/{scratch-QlPyy1f4.js → scratch-CO4I2dIa.js} +1 -1
- package/dist/scratch.js +1 -1
- package/dist/{section-D0qMm9KM.js → section-CsUkp8bv.js} +1 -1
- package/dist/section.js +1 -1
- package/dist/{select-aAaWoveE.js → select-Dn26ajJZ.js} +8 -15
- package/dist/select.js +1 -1
- package/dist/{skeleton-CFqQmKyt.js → skeleton-BuMLhvzQ.js} +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/{tab-CiF2YPck.js → tab-40fDkuox.js} +1 -1
- package/dist/tab.js +1 -1
- package/dist/{tabpane-B-m3xwqu.js → tabpane-F4Pd7JtC.js} +1 -1
- package/dist/tabpane.js +1 -1
- package/dist/test/unit/icon.builtin.test.d.ts +1 -0
- package/dist/test/unit/utils.colorpicker.reconnect.test.d.ts +1 -0
- package/dist/test/unit/utils.route.lazy.test.d.ts +1 -0
- package/dist/test/unit/utils.router.match.test.d.ts +1 -0
- package/dist/test/unit/utils.signal.owner.test.d.ts +1 -0
- package/dist/theme-kOWZbKCq.js +70 -0
- package/dist/theme-switch-B09egc6h.js +104 -0
- package/dist/theme-switch.js +1 -1
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +9 -0
- package/dist/utils/builder/core.d.ts +20 -13
- package/dist/utils/builder/factory.d.ts +1 -1
- package/dist/utils/builder/index.d.ts +2 -2
- package/dist/utils/builder/signal.d.ts +93 -64
- package/dist/utils/i18n/index.d.ts +17 -1
- package/dist/utils/i18n.js +16 -15
- package/dist/utils/router/index.d.ts +13 -3
- package/dist/utils/router.js +95 -54
- package/dist/utils/theme.d.ts +1 -1
- package/dist/warning-circle-fill-Cz0qu7AH.js +23 -0
- package/docs/BUILDER.md +230 -0
- package/docs/COMPONENTS.md +21 -3
- package/package.json +41 -3
- package/dist/factory-BdsO0dEW.js +0 -165
- package/dist/route-MQZpn2BP.js +0 -88
- package/dist/signal-CSSZxlK5.js +0 -57
- package/dist/theme-switch-B_FZvqBN.js +0 -170
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as Oo, c as Wt, f as Xt, g as Uo, h as at, i as xo, m as Ct, n as Mo, r as Po, v as Qo } from "./utils-DBfrRFoE.js";
|
|
2
|
-
import { _ as Bt, i as ie } from "./factory-
|
|
2
|
+
import { _ as Bt, i as ie } from "./factory-DCrO37si.js";
|
|
3
3
|
import { a as No, t as Ko } from "./ssr-DSGwPtEd.js";
|
|
4
|
-
import "./select-
|
|
4
|
+
import "./select-Dn26ajJZ.js";
|
|
5
5
|
var Yo = (y, R) => () => (R || (y((R = { exports: {} }).exports, R), y = null), R.exports), Go = /* @__PURE__ */ Yo(((y, R) => {
|
|
6
6
|
(function O(H) {
|
|
7
7
|
var _ = this, $ = function() {
|
package/dist/player.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as I, i as d, l as n, n as f, r as l, t as b, u } from "./utils-DBfrRFoE.js";
|
|
2
2
|
import { t as T } from "./events-C59wGdni.js";
|
|
3
|
-
import { _ as k, i as g, p as C } from "./factory-
|
|
3
|
+
import { _ as k, i as g, p as C } from "./factory-DCrO37si.js";
|
|
4
4
|
import { a as y, n as D } from "./ssr-DSGwPtEd.js";
|
|
5
|
-
import "./dropdown-
|
|
5
|
+
import "./dropdown-CCvsambb.js";
|
|
6
6
|
var P = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{visibility:hidden;position:absolute}", x = class extends D {
|
|
7
7
|
observer;
|
|
8
8
|
_shadowDom;
|
package/dist/popover.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as n, i as p, n as h, p as i, r as g, t as u } from "./utils-DBfrRFoE.js";
|
|
2
2
|
import { t as l } from "./events-C59wGdni.js";
|
|
3
|
-
import { i as o } from "./factory-
|
|
3
|
+
import { i as o } from "./factory-DCrO37si.js";
|
|
4
4
|
import { a as c, n as d } from "./ssr-DSGwPtEd.js";
|
|
5
5
|
var v = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{display:block;height:var(--ran-progress-height, 20px)}:host:active,:host:focus{outline:0;-webkit-tap-highlight-color:transparent}:host(:focus-visible){outline:var(--ran-progress-focus-outline, 2px solid var(--ran-color-primary, #006bff));outline-offset:var(--ran-progress-focus-outline-offset, 2px);border-radius:var(--ran-radius-full, 9999px)}.ran-progress{position:var(--ran-progress-position, relative);cursor:var(--ran-progress-cursor, pointer);width:var(--ran-progress-width, 100%);height:100%}.ran-progress:active,.ran-progress:focus{outline:0;-webkit-tap-highlight-color:transparent}.ran-progress-wrap{width:var(--ran-progress-wrap-width, 100%);height:var(--ran-progress-wrap-height, 8px);border-radius:var(--ran-progress-wrap-border-radius, 20px);background:var(--ran-progress-wrap-background, var(--ran-gray-200, #ebebeb));position:var(--ran-progress-wrap-position, relative);overflow:var(--ran-progress-wrap-overflow, hidden)}.ran-progress-wrap-value{position:var(--ran-progress-wrap-value-position, absolute);top:var(--ran-progress-wrap-value-top, 0);left:var(--ran-progress-wrap-value-left, 0);height:var(--ran-progress-wrap-value-height, 100%);width:var(--ran-progress-wrap-value-width, 100%);transform:scaleX(var(--progress-percent, 0));transform-origin:var(--ran-progress-wrap-value-transform-origin, 0 0);will-change:var(--ran-progress-wrap-value-will-change, transform);background:var(--ran-progress-wrap-value-background, linear-gradient(90deg, #0bc8bb 2.42%, #00d297 98.79%));border-radius:var(--ran-progress-wrap-value-border-radius, 20px)}.ran-progress-dot{position:var(--ran-progress-dot-position, absolute);top:var(--ran-progress-dot-top, -5px);left:calc(var(--progress-percent, 0) * 100%);transform:translate(-50%);border-radius:var(--ran-progress-dot-border-radius, 50%);width:var(--ran-progress-dot-width, 18px);height:var(--ran-progress-dot-height, 18px);background:var(--ran-progress-dot-background, linear-gradient(90deg, #0bc8bb 2.42%, #00d297 98.79%));cursor:var(--ran-progress-dot-cursor, pointer)}", b = [
|
|
6
6
|
"percent",
|
package/dist/progress.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as f, d as m, i as y, n as R, r as A, t as v } from "./utils-DBfrRFoE.js";
|
|
2
|
-
import { _ as P, i as p } from "./factory-
|
|
2
|
+
import { _ as P, i as p } from "./factory-DCrO37si.js";
|
|
3
3
|
import { a as w, n as D } from "./ssr-DSGwPtEd.js";
|
|
4
4
|
var k = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{--ran-radar-polygon-color: var(--ran-color-border, #e6e6e6);--ran-radar-line-color: var(--ran-color-border, #e6e6e6);--ran-radar-fill-color: rgba(255, 121, 35, .6);--ran-radar-stroke-color: rgba(255, 121, 35, .6)}.ran-radar{position:var(--ran-radar-position, relative);width:var(--ran-radar-width, 100%);height:var(--ran-radar-height, 100%);display:var(--ran-radar-display, block)}.ran-radar canvas{width:100%;height:100%}", M = "rgba(0,0,0,0)", S = "rgba(0,0,0,1)", d = "#e6e6e6", C = "#e6e6e6", O = "黑体", g = "rgba(255,121,35,0.60)", u = "rgba(255,121,35,0.60)", L = class extends D {
|
|
5
5
|
mData;
|
package/dist/radar.js
CHANGED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { a as h, i as o, n, r as i, t as u } from "./utils-DBfrRFoE.js";
|
|
2
|
+
import { c } from "./mocks-CMGoftIc.js";
|
|
3
|
+
import { t as l } from "./events-C59wGdni.js";
|
|
4
|
+
import { E as p, p as d, w as m } from "./factory-DCrO37si.js";
|
|
5
|
+
import { a as _, n as f } from "./ssr-DSGwPtEd.js";
|
|
6
|
+
import { getSSGPath as g, matchPath as b } from "./utils/router.js";
|
|
7
|
+
var v = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{display:block}:host([hidden]){display:none!important}", w = class extends f {
|
|
8
|
+
static get observedAttributes() {
|
|
9
|
+
return [
|
|
10
|
+
"path",
|
|
11
|
+
"exact",
|
|
12
|
+
"src",
|
|
13
|
+
"sheet"
|
|
14
|
+
];
|
|
15
|
+
}
|
|
16
|
+
_events = new l();
|
|
17
|
+
_shadowDom;
|
|
18
|
+
_params = {};
|
|
19
|
+
_mounted = !1;
|
|
20
|
+
_module = null;
|
|
21
|
+
_disposePage = null;
|
|
22
|
+
_pageHost = null;
|
|
23
|
+
_mountToken = 0;
|
|
24
|
+
constructor() {
|
|
25
|
+
super(), this._shadowDom = n(this, v), u(this._shadowDom, "slot", () => d().build());
|
|
26
|
+
}
|
|
27
|
+
get path() {
|
|
28
|
+
return i(this, "path", "/");
|
|
29
|
+
}
|
|
30
|
+
set path(t) {
|
|
31
|
+
o(this, "path", t);
|
|
32
|
+
}
|
|
33
|
+
get exact() {
|
|
34
|
+
return this.hasAttribute("exact");
|
|
35
|
+
}
|
|
36
|
+
get src() {
|
|
37
|
+
return i(this, "src");
|
|
38
|
+
}
|
|
39
|
+
set src(t) {
|
|
40
|
+
o(this, "src", t);
|
|
41
|
+
}
|
|
42
|
+
get params() {
|
|
43
|
+
return { ...this._params };
|
|
44
|
+
}
|
|
45
|
+
get sheet() {
|
|
46
|
+
return i(this, "sheet");
|
|
47
|
+
}
|
|
48
|
+
set sheet(t) {
|
|
49
|
+
o(this, "sheet", t);
|
|
50
|
+
}
|
|
51
|
+
handlerExternalCss = () => {
|
|
52
|
+
h(this, this._shadowDom, "sheet", null, this.sheet);
|
|
53
|
+
};
|
|
54
|
+
_update(t) {
|
|
55
|
+
const { matched: e, params: s } = b(this.path, this.exact, t);
|
|
56
|
+
this._params = s, this.hidden = !e, this.src && !c && (e ? this._mount() : this._unmount()), e && this.dispatchEvent(new CustomEvent("routematch", {
|
|
57
|
+
detail: {
|
|
58
|
+
path: t,
|
|
59
|
+
params: s
|
|
60
|
+
},
|
|
61
|
+
bubbles: !0
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
async _mount() {
|
|
65
|
+
if (this._mounted) return;
|
|
66
|
+
this._mounted = !0;
|
|
67
|
+
const t = ++this._mountToken;
|
|
68
|
+
this._pageHost || (this._pageHost = document.createElement("div"), this._pageHost.setAttribute("part", "page"), this.appendChild(this._pageHost));
|
|
69
|
+
try {
|
|
70
|
+
if (this._module ??= await import(
|
|
71
|
+
/* @vite-ignore */
|
|
72
|
+
this.src
|
|
73
|
+
), t !== this._mountToken) return;
|
|
74
|
+
const e = this._module.default;
|
|
75
|
+
if (typeof e != "function") {
|
|
76
|
+
console.error(`[r-route] "${this.src}" has no default export (host) => void`);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const s = this._pageHost;
|
|
80
|
+
this._disposePage = m((r) => {
|
|
81
|
+
const a = e(s);
|
|
82
|
+
return typeof a == "function" && p(a), r;
|
|
83
|
+
});
|
|
84
|
+
} catch (e) {
|
|
85
|
+
this._mounted = !1, console.error(`[r-route] failed to load "${this.src}":`, e);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
_unmount() {
|
|
89
|
+
this._mounted && (this._mounted = !1, this._mountToken++, this._disposePage?.(), this._disposePage = null, this._pageHost?.replaceChildren());
|
|
90
|
+
}
|
|
91
|
+
_preSerialize() {
|
|
92
|
+
const t = g();
|
|
93
|
+
t !== null && this._update(t);
|
|
94
|
+
}
|
|
95
|
+
connectedCallback() {
|
|
96
|
+
this.handlerExternalCss();
|
|
97
|
+
const t = this.closest("r-router");
|
|
98
|
+
t && t._currentPath && this._update(t._currentPath);
|
|
99
|
+
}
|
|
100
|
+
disconnectedCallback() {
|
|
101
|
+
this._unmount(), this._events.abort();
|
|
102
|
+
}
|
|
103
|
+
attributeChangedCallback(t, e, s) {
|
|
104
|
+
if (e !== s) {
|
|
105
|
+
if (t === "src" && (this._module = null, this._unmount()), t === "path" || t === "exact" || t === "src") {
|
|
106
|
+
const r = this.closest("r-router");
|
|
107
|
+
r && this._update(r._currentPath);
|
|
108
|
+
}
|
|
109
|
+
t === "sheet" && this.handlerExternalCss();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
_("r-route", w);
|
|
114
|
+
export {
|
|
115
|
+
w as t
|
|
116
|
+
};
|
package/dist/route.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a
|
|
1
|
+
import { a, i as n, n as h, r as o, t as r } from "./utils-DBfrRFoE.js";
|
|
2
2
|
import { t as l } from "./events-C59wGdni.js";
|
|
3
|
-
import { p as
|
|
4
|
-
import { a as
|
|
5
|
-
import { useRouter as
|
|
6
|
-
var
|
|
3
|
+
import { p as c } from "./factory-DCrO37si.js";
|
|
4
|
+
import { a as u, n as d } from "./ssr-DSGwPtEd.js";
|
|
5
|
+
import { useRouter as i } from "./utils/router.js";
|
|
6
|
+
var _ = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{display:block;width:100%}", p = class extends d {
|
|
7
7
|
static get observedAttributes() {
|
|
8
8
|
return [
|
|
9
9
|
"mode",
|
|
@@ -15,25 +15,26 @@ var p = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transpar
|
|
|
15
15
|
_shadowDom;
|
|
16
16
|
_slot;
|
|
17
17
|
_currentPath = "";
|
|
18
|
+
_core = null;
|
|
18
19
|
constructor() {
|
|
19
|
-
super(), this._shadowDom = h(this,
|
|
20
|
-
const t = r(this._shadowDom, "slot", () =>
|
|
20
|
+
super(), this._shadowDom = h(this, _);
|
|
21
|
+
const t = r(this._shadowDom, "slot", () => c().build());
|
|
21
22
|
this._slot = t;
|
|
22
23
|
}
|
|
23
24
|
get mode() {
|
|
24
25
|
return this.getAttribute("mode") === "hash" ? "hash" : "history";
|
|
25
26
|
}
|
|
26
27
|
get base() {
|
|
27
|
-
return
|
|
28
|
+
return o(this, "base");
|
|
28
29
|
}
|
|
29
30
|
get sheet() {
|
|
30
|
-
return
|
|
31
|
+
return o(this, "sheet");
|
|
31
32
|
}
|
|
32
33
|
set sheet(t) {
|
|
33
34
|
n(this, "sheet", t);
|
|
34
35
|
}
|
|
35
36
|
handlerExternalCss = () => {
|
|
36
|
-
|
|
37
|
+
a(this, this._shadowDom, "sheet", null, this.sheet);
|
|
37
38
|
};
|
|
38
39
|
_getPath() {
|
|
39
40
|
if (this.mode === "hash") return window.location.hash.slice(1) || "/";
|
|
@@ -41,6 +42,10 @@ var p = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transpar
|
|
|
41
42
|
return t && e.startsWith(t) ? e.slice(t.length) || "/" : e;
|
|
42
43
|
}
|
|
43
44
|
navigate(t, e = !1) {
|
|
45
|
+
if (this._core) {
|
|
46
|
+
e ? this._core.replace(t) : this._core.push(t);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
44
49
|
const s = this.mode === "hash" ? `#${t}` : this.base + t;
|
|
45
50
|
e ? window.history.replaceState(null, "", s) : window.history.pushState(null, "", s), this._syncRoutes();
|
|
46
51
|
}
|
|
@@ -54,7 +59,7 @@ var p = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transpar
|
|
|
54
59
|
}));
|
|
55
60
|
}
|
|
56
61
|
_handlePopState = () => {
|
|
57
|
-
this._syncRoutes();
|
|
62
|
+
this._core ? this._core._notify() : this._syncRoutes();
|
|
58
63
|
};
|
|
59
64
|
_handleNavigate = (t) => {
|
|
60
65
|
const { path: e, replace: s } = t.detail;
|
|
@@ -62,18 +67,18 @@ var p = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transpar
|
|
|
62
67
|
};
|
|
63
68
|
connectedCallback() {
|
|
64
69
|
this.handlerExternalCss(), this._events.on(window, "popstate", this._handlePopState), this._events.on(this, "ran-navigate", this._handleNavigate), this._events.on(this._slot, "slotchange", () => this._syncRoutes());
|
|
65
|
-
const t =
|
|
66
|
-
t && t._bind(this), this._syncRoutes(), typeof customElements < "u" && customElements.whenDefined("r-route").then(() => this._syncRoutes());
|
|
70
|
+
const t = i();
|
|
71
|
+
t && (this._core = t, t._bind(this)), this._syncRoutes(), typeof customElements < "u" && customElements.whenDefined("r-route").then(() => this._syncRoutes());
|
|
67
72
|
}
|
|
68
73
|
disconnectedCallback() {
|
|
69
|
-
const t =
|
|
70
|
-
t && t._unbind(this), this._events.abort();
|
|
74
|
+
const t = i();
|
|
75
|
+
t && t._unbind(this), this._core = null, this._events.abort();
|
|
71
76
|
}
|
|
72
77
|
attributeChangedCallback(t, e, s) {
|
|
73
78
|
e !== s && t === "sheet" && this.handlerExternalCss();
|
|
74
79
|
}
|
|
75
80
|
};
|
|
76
|
-
|
|
81
|
+
u("r-router", p);
|
|
77
82
|
export {
|
|
78
|
-
|
|
83
|
+
p as t
|
|
79
84
|
};
|
package/dist/router.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as r, t as h } from "./utils-DBfrRFoE.js";
|
|
2
|
-
import { _ as o, i as e } from "./factory-
|
|
2
|
+
import { _ as o, i as e } from "./factory-DCrO37si.js";
|
|
3
3
|
import { a as n, n as d } from "./ssr-DSGwPtEd.js";
|
|
4
4
|
var l = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{position:relative;display:block}.ran-scratch-ticket{position:relative;display:block;width:100%;height:100%}.ran-scratch-ticket-award{position:absolute;top:0;left:0;display:block;width:100%;height:100%;background:#000;z-index:1}.ran-scratch-ticket-canvas{position:absolute;top:0;left:0;display:block;width:100%;height:100%;z-index:2}", u = class extends d {
|
|
5
5
|
scratchTicketContainer;
|
package/dist/scratch.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as r, i as s, n as o, r as n, t as h } from "./utils-DBfrRFoE.js";
|
|
2
2
|
import { t as d } from "./events-C59wGdni.js";
|
|
3
|
-
import { i as a, p as l } from "./factory-
|
|
3
|
+
import { i as a, p as l } from "./factory-DCrO37si.js";
|
|
4
4
|
import { a as c, n as b } from "./ssr-DSGwPtEd.js";
|
|
5
5
|
var g = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{display:block;scroll-margin-top:96px;border-width:var(--ran-skin-border-width, 1px);border-style:var(--ran-skin-border-style, solid);border-color:var(--ran-section-border-color, var(--ran-color-border, #eaeaea));border-radius:var(--ran-section-radius, var(--ran-radius-md, 8px));background:var(--ran-section-background, var(--ran-color-bg-elevated, #ffffff));box-shadow:var(--ran-section-shadow, var(--ran-shadow-elevated, none));padding:var(--ran-section-padding, 28px);box-sizing:border-box}.ran-section-header{display:grid;gap:8px;max-width:760px;margin-bottom:22px}.ran-section-heading{margin:0;color:var(--ran-section-heading-color, var(--ran-color-text, #0f172a));font-size:var(--ran-section-heading-font-size, 24px);font-weight:var(--ran-section-heading-font-weight, 700);line-height:1.25;letter-spacing:0}.ran-section-heading:empty{display:none}.ran-section-subtitle{max-width:620px;margin:0;color:var(--ran-section-subtitle-color, var(--ran-color-text-secondary, #607086))}.ran-section-subtitle:empty{display:none}.ran-section-body{min-width:0}", u = class extends b {
|
|
6
6
|
_shadowDom;
|
package/dist/section.js
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import { a as b, c as D, f as S, g as k, i as h, n as w, r as c, s as a, t as m, u } from "./utils-DBfrRFoE.js";
|
|
2
2
|
import { t as x } from "./events-C59wGdni.js";
|
|
3
|
-
import { _ as v, i as l, m as C, p as g, s as O } from "./factory-
|
|
3
|
+
import { _ as v, i as l, m as C, p as g, s as O } from "./factory-DCrO37si.js";
|
|
4
4
|
import { a as f, n as _ } from "./ssr-DSGwPtEd.js";
|
|
5
|
-
import {
|
|
6
|
-
import "./input-
|
|
7
|
-
import "./
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
_identification: !0,
|
|
11
|
-
data: `<svg viewBox="0 0 1024 1024" width="200" height="200" version="1.1"
|
|
12
|
-
fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
|
13
|
-
<path
|
|
14
|
-
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path>
|
|
15
|
-
</svg>`
|
|
16
|
-
}, P = class extends _ {
|
|
5
|
+
import { r as E } from "./icon-C_ENrJ3F.js";
|
|
6
|
+
import "./input-RNqdEHPf.js";
|
|
7
|
+
import { t as T } from "./arrow-down-Bi5kqUrX.js";
|
|
8
|
+
import "./dropdown-CCvsambb.js";
|
|
9
|
+
var L = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{position:var(--ran-select-host-position, relative);display:var(--ran-select-host-display, inline-block);cursor:var(--ran-select-host-cursor, pointer);height:var(--ran-select-host-height, 32px);outline:var(--ran-select-host-outline, 0);-webkit-tap-highlight-color:var(--ran-select-host-tap-highlight-color, transparent)}:host,:host(:focus),:host(:active){outline:var(--ran-select-host-focus-outline, 0);-webkit-tap-highlight-color:transparent}:host ::slotted(r-option){display:var(--ran-select-option-display, none)}:host([disabled]){cursor:var(--ran-select-host-disabled-cursor, not-allowed);pointer-events:var(--ran-select-host-disabled-pointer-events, all);opacity:var(--ran-select-host-disabled-opacity, .6)}:host(:not([disabled]):hover) .ran-select{cursor:var(--ran-select-host-hover-cursor, pointer)}:host(:not([disabled],[type="text"]):hover) .selection{border:var(--ran-select-selection-hover-border, 1px solid var(--ran-color-primary, #006bff))}:host(:not([disabled],[type="text"]):hover) .selection-search{cursor:var(--ran-select-selection-hover-search-cursor, pointer)}:host(:not([disabled],[type="text"]):hover) .selection-item{cursor:var(--ran-select-selection-hover-item-cursor, pointer);color:var(--ran-select-selection-hover-item-color, var(--ran-color-text-disabled, #bfbfbf))}:host([type="text"]) .selection{border:var(--ran-select-selection-text-border, none);background:var(--ran-select-selection-text-background, transparent)}:host([type="text"]) .icon{display:var(--ran-select-icon-text-display, none)}:host(:not([disabled],[type="text"]):focus) .selection{border:var(--ran-select-selection-focus-border, 1px solid var(--ran-color-primary, #006bff))}:host(:not([disabled],[type="text"]):focus) .selection-search{cursor:var(--ran-select-selection-focus-search-cursor, pointer)}:host(:not([disabled],[type="text"]):focus) .selection-item{cursor:var(--ran-select-selection-focus-item-cursor, pointer);color:var(--ran-select-selection-focus-item-color, var(--ran-color-text-disabled, #bfbfbf))}:host .selection-search{display:var(--ran-select-selection-search-display, none)}:host([showSearch]:not([disabled])) .selection-search{cursor:var(--ran-select-selection-search-visible-cursor, text);display:var(--ran-select-selection-search-visible-display, block)}:host([showSearch]:not([disabled])) .selection-item{cursor:var(--ran-select-selection-search-visible-item-cursor, pointer)}:host([showSearch]:not([disabled]):focus) .selection-search{display:var(--ran-select-selection-search-visible-display, block);cursor:var(--ran-select-selection-search-visible-cursor, text);opacity:var(--ran-select-selection-search-visible-opacity, 1)}.ran-select{width:var(--ran-select-root-width, 100%);height:var(--ran-select-root-height, 100%);font-size:var(--ran-select-root-font-size, 14px);box-sizing:var(--ran-select-root-box-sizing, border-box);margin:var(--ran-select-root-margin, 0);padding:var(--ran-select-root-padding, 0);color:var(--ran-select-root-color, var(--ran-color-text, rgba(0, 0, 0, .88)));line-height:var(--ran-select-root-line-height, 1.57142857);list-style:var(--ran-select-root-list-style, none);font-family:var(--ran-select-root-font-family, var(--ran-skin-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));position:var(--ran-select-root-position, relative);display:var(--ran-select-root-display, inline-block)}.ran-select .selection{position:var(--ran-select-selection-position, relative);background-color:var(--ran-select-selection-background-color, var(--ran-color-bg-elevated, #ffffff));background-image:var(--ran-select-selection-background-image, none);border:var(--ran-select-selection-border, 1px solid var(--ran-color-border, #eaeaea));transition:var(--ran-select-selection-transition, none);width:var(--ran-select-selection-width, 100%);height:var(--ran-select-selection-height, 100%);padding:var(--ran-select-selection-padding, 0 11px);box-sizing:var(--ran-select-selection-box-sizing, border-box);margin:var(--ran-select-selection-margin, 0);color:var(--ran-select-selection-color, var(--ran-color-text, rgba(0, 0, 0, .88)));font-size:var(--ran-select-selection-font-size, 14px);line-height:var(--ran-select-selection-line-height, 1.57142857);list-style:var(--ran-select-selection-list-style, none);font-family:var(--ran-select-selection-font-family, inherit);display:var(--ran-select-selection-display, flex);border-radius:var(--ran-select-selection-border-radius, var(--ran-radius-sm, 6px))}.ran-select .selection-search{position:var(--ran-select-selection-search-position, absolute);opacity:var(--ran-select-selection-search-opacity, 0);top:var(--ran-select-selection-search-top, 0);left:var(--ran-select-selection-search-left, 0);height:var(--ran-select-selection-search-height, 100%);inset-inline-start:var(--ran-select-selection-search-inset-inline-start, 11px);inset-inline-end:var(--ran-select-selection-search-inset-inline-end, 11px);margin:var(--ran-select-selection-search-margin, 0);padding:var(--ran-select-selection-search-padding, 0);background:var(--ran-select-selection-search-background, transparent);border:var(--ran-select-selection-search-border, none);outline:var(--ran-select-selection-search-outline, none);appearance:var(--ran-select-selection-search-appearance, none);font-family:var(--ran-select-selection-search-font-family, inherit);cursor:var(--ran-select-selection-search-cursor, not-allowed)}.ran-select .selection-search::-webkit-search-cancel-button{display:var(--ran-select-selection-search-cancel-display, none);-webkit-appearance:var(--ran-select-selection-search-cancel-appearance, none)}.ran-select .selection-search::part(input){border:var(--ran-select-selection-search-input-border, none);padding:var(--ran-select-selection-search-input-padding, 0);height:100%;min-height:100%;box-sizing:border-box;outline:var(--ran-select-selection-search-input-outline, none)}.ran-select .selection-search::part(input):active{border:var(--ran-select-selection-search-input-active-border, none);padding:var(--ran-select-selection-search-input-active-padding, 0);height:var(--ran-select-selection-search-input-active-height, 100%);outline:var(--ran-select-selection-search-input-active-outline, none);border-color:var(--ran-select-selection-search-input-active-border-color, transparent);box-shadow:var(--ran-select-selection-search-input-active-box-shadow, none);border-right-width:var(--ran-select-selection-search-input-active-border-right-width, 0px)}.ran-select .selection-search::part(content){min-height:var(--ran-select-selection-search-input-content-min-height, 0)}.ran-select .selection-item{position:var(--ran-select-selection-item-position, absolute);top:var(--ran-select-selection-item-top, 0);left:var(--ran-select-selection-item-left, 12px);right:var(--ran-select-selection-item-right, 28px);margin:var(--ran-select-selection-item-margin, 0);padding:var(--ran-select-selection-item-padding, 0);background:var(--ran-select-selection-item-background, transparent);border:var(--ran-select-selection-item-border, none);outline:var(--ran-select-selection-item-outline, none);appearance:var(--ran-select-selection-item-appearance, none);font-family:var(--ran-select-selection-item-font-family, inherit);height:var(--ran-select-selection-item-height, 100%);display:var(--ran-select-selection-item-display, flex);align-items:var(--ran-select-selection-item-align-items, center);-webkit-user-select:var(--ran-select-selection-item-user-select, none);user-select:var(--ran-select-selection-item-user-select, none);overflow:var(--ran-select-selection-item-overflow, hidden);white-space:var(--ran-select-selection-item-white-space, nowrap);text-overflow:var(--ran-select-selection-item-text-overflow, ellipsis);cursor:var(--ran-select-selection-item-cursor, pointer)}.ran-select .selection-select{color:var(--ran-select-selection-select-color, var(--ran-color-text-disabled, rgba(0, 0, 0, .25)))}.ran-select .selection .icon{display:var(--ran-select-selection-icon-display, flex);align-items:var(--ran-select-selection-icon-align-items, center);color:var(--ran-select-selection-icon-color, var(--ran-color-text-disabled, rgba(0, 0, 0, .25)));font-style:var(--ran-select-selection-icon-font-style, normal);text-align:var(--ran-select-selection-icon-text-align, center);text-transform:var(--ran-select-selection-icon-text-transform, none);text-rendering:var(--ran-select-selection-icon-text-rendering, optimizeLegibility);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:var(--ran-select-selection-icon-position, absolute);top:var(--ran-select-selection-icon-top, 50%);inset-inline-start:var(--ran-select-selection-icon-inset-inline-start, auto);inset-inline-end:var(--ran-select-selection-icon-inset-inline-end, 8px);height:var(--ran-select-selection-icon-height, 16px);transform:var(--ran-select-selection-icon-transform, translateY(-50%));margin-top:var(--ran-select-selection-icon-margin-top, 0);font-size:var(--ran-select-selection-icon-font-size, 12px);pointer-events:var(--ran-select-selection-icon-pointer-events, none)}', P = class extends _ {
|
|
17
10
|
_option;
|
|
18
11
|
_optionContent;
|
|
19
12
|
_shadowDom;
|
|
@@ -132,7 +125,7 @@ var A = {
|
|
|
132
125
|
remove: "ran-dropdown-up-out"
|
|
133
126
|
}
|
|
134
127
|
};
|
|
135
|
-
E("arrow-down",
|
|
128
|
+
E("arrow-down", T);
|
|
136
129
|
var V = k(), I = 300, z = class extends _ {
|
|
137
130
|
static formAssociated = !0;
|
|
138
131
|
_internals;
|
|
@@ -179,7 +172,7 @@ var V = k(), I = 300, z = class extends _ {
|
|
|
179
172
|
} catch {
|
|
180
173
|
this._internals = void 0;
|
|
181
174
|
}
|
|
182
|
-
this._listboxId = `ran-select-listbox-${Math.random().toString(36).slice(2, 9)}`, this._activeIndex = -1, this._optionList = [], this._optionLabelMapValue = /* @__PURE__ */ new Map(), this._optionValueMapLabel = /* @__PURE__ */ new Map(), this._shadowDom = w(this,
|
|
175
|
+
this._listboxId = `ran-select-listbox-${Math.random().toString(36).slice(2, 9)}`, this._activeIndex = -1, this._optionList = [], this._optionLabelMapValue = /* @__PURE__ */ new Map(), this._optionValueMapLabel = /* @__PURE__ */ new Map(), this._shadowDom = w(this, L);
|
|
183
176
|
const e = m(this._shadowDom, ".ran-select", () => l().class("ran-select").part("select").children(l().class("selection").part("selection").children(v("r-icon").class("icon").part("icon").attr("name", "arrow-down").attr("color", "var(--ran-color-text-secondary)").attr("size", "16"), l().children(C().class("selection-item").part("selection-item"), O().class("selection-search").part("search").attr("type", "search").attr("autocomplete", "off"))), g().class("slot")).build());
|
|
184
177
|
this._select = e, this._selection = e.querySelector(".selection"), this._selector = this._selection.querySelector("div"), this._icon = e.querySelector(".icon"), this._text = e.querySelector(".selection-item"), this._search = e.querySelector(".selection-search"), this._slot = e.querySelector("slot");
|
|
185
178
|
}
|
package/dist/select.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as r, i as n, n as s, r as i, t as o } from "./utils-DBfrRFoE.js";
|
|
2
|
-
import { i as l } from "./factory-
|
|
2
|
+
import { i as l } from "./factory-DCrO37si.js";
|
|
3
3
|
import { a as h, n as d } from "./ssr-DSGwPtEd.js";
|
|
4
4
|
var u = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}@keyframes skeleton{0%{transform:translate(-37.5%)}to{transform:translate(37.5%)}}.ran-skeleton{position:relative;z-index:0;overflow:hidden;background:0 0;width:100%;height:var(--ran-skeleton-height, 16px);background:var(--ran-skeleton-background, var(--ran-gray-alpha-200, rgba(0, 0, 0, .06)));border-radius:var(--ran-skeleton-border-radius, var(--ran-radius-sm, 6px))}.ran-skeleton:after{position:absolute;top:0;inset-inline-end:-150%;bottom:0;inset-inline-start:-150%;background:var(--ran-skeleton-shimmer, linear-gradient(90deg, var(--ran-gray-alpha-200, rgba(0, 0, 0, .06)) 25%, var(--ran-gray-alpha-500, rgba(0, 0, 0, .15)) 37%, var(--ran-gray-alpha-200, rgba(0, 0, 0, .06)) 63%));animation-name:skeleton;animation-duration:var(--ran-skeleton-animation-duration, 1.4s);animation-timing-function:ease;animation-iteration-count:infinite;content:""}', m = class extends d {
|
|
5
5
|
_div;
|
package/dist/skeleton.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as b, i as f, n as v, r as d, s as c, t as p } from "./utils-DBfrRFoE.js";
|
|
2
2
|
import { t as u } from "./events-C59wGdni.js";
|
|
3
|
-
import { _ as g, i as h, p as y } from "./factory-
|
|
3
|
+
import { _ as g, i as h, p as y } from "./factory-DCrO37si.js";
|
|
4
4
|
import { a as A, n as _ } from "./ssr-DSGwPtEd.js";
|
|
5
5
|
var w = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}.ran-tab ::slotted(r-tab){box-sizing:border-box;width:100%;height:100%;padding:10px;flex-shrink:0;overflow:auto;text-align:start}.ran-tab-header{position:relative;overflow:hidden;scroll-behavior:smooth}.ran-tab-header-nav{display:flex;flex-flow:row nowrap;justify-content:flex-start;align-items:center}.ran-tab-header-nav::-webkit-scrollbar{display:none}.ran-tab-header-nav-item{flex-shrink:0}.ran-tab-header-nav .active{color:var(--ran-tab-active-color, var(--ran-color-primary, #006bff))}.ran-tab-header-line{position:absolute;width:0;margin-top:-2px;height:2px;border-radius:2px;background:var(--ran-tab-line-color, var(--ran-color-primary, #006bff));transition:var(--ran-tab-line-transition, left .2s, width .2s, transform .2s)}.ran-tab-content{overflow:hidden}.ran-tab-content-wrap{display:flex;width:100%;height:100%;transition:var(--ran-tab-content-transition, transform .2s)}:host([type="line"]) .ran-tab-header-nav-item{border:solid 1px transparent}:host([type="line"]) .ran-tab-header-nav .active{color:var(--ran-tab-line-color, var(--ran-color-primary, #006bff));border:solid 1px transparent;border-color:var(--ran-tab-border-color, var(--ran-color-border, rgba(0, 0, 0, .2))) var(--ran-tab-border-color, var(--ran-color-border, rgba(0, 0, 0, .2))) transparent;border-radius:var(--ran-tab-border-radius, var(--ran-radius-sm, .25em)) var(--ran-tab-border-radius, var(--ran-radius-sm, .25em)) 0 0}:host([type="line"]) .ran-tab-header-line{transition:none;visibility:hidden}:host([type="line"]) .ran-tab-header-line:after,:host([type="line"]) .ran-tab-header-line:before{content:"";position:absolute;visibility:visible;width:9999px;height:1px;bottom:0;background:var(--ran-tab-border-color, var(--ran-color-border, rgba(0, 0, 0, .2)))}:host([type="line"]) .ran-tab-header-line:after{left:100%}:host([type="line"]) .ran-tab-header-line:before{right:100%}:host([align="center"]) .ran-tab-header-nav{justify-content:center}:host([align="center"]) .ran-tab-header-line{left:50%}:host([align="end"]) .ran-tab-header-nav{justify-content:flex-end}', x = 0, m = class extends _ {
|
|
6
6
|
static get observedAttributes() {
|
package/dist/tab.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as s, i as r, n as a, t as n } from "./utils-DBfrRFoE.js";
|
|
2
2
|
import { t as h } from "./events-C59wGdni.js";
|
|
3
|
-
import { p as o } from "./factory-
|
|
3
|
+
import { p as o } from "./factory-DCrO37si.js";
|
|
4
4
|
import { a as b, n as c } from "./ssr-DSGwPtEd.js";
|
|
5
5
|
var u = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}", d = class extends c {
|
|
6
6
|
static get observedAttributes() {
|
package/dist/tabpane.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@/components/icon/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@/components/colorpicker';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@/components/route';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var i = "ran-theme", s = null, a = null, o = (e) => {
|
|
2
|
+
if (e && "style" in e) return e;
|
|
3
|
+
if (e && "documentElement" in e) return e.documentElement;
|
|
4
|
+
if (!(typeof document > "u"))
|
|
5
|
+
return document.documentElement;
|
|
6
|
+
}, m = (e) => {
|
|
7
|
+
const t = typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
8
|
+
e.setAttribute("data-ran-theme", t ? "dark" : "light"), e.setAttribute("theme", t ? "dark" : "light");
|
|
9
|
+
}, l = () => {
|
|
10
|
+
s && a && (s.removeEventListener("change", a), s = null, a = null);
|
|
11
|
+
}, c = (e, t) => {
|
|
12
|
+
const r = o(t);
|
|
13
|
+
if (r) {
|
|
14
|
+
if (l(), e === "system") {
|
|
15
|
+
if (typeof window > "u") return;
|
|
16
|
+
m(r), s = window.matchMedia("(prefers-color-scheme: dark)"), a = () => m(r), s.addEventListener("change", a);
|
|
17
|
+
try {
|
|
18
|
+
localStorage.setItem(i, "system");
|
|
19
|
+
} catch {
|
|
20
|
+
}
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
r.setAttribute("data-ran-theme", e), r.setAttribute("theme", e);
|
|
24
|
+
try {
|
|
25
|
+
localStorage.setItem(i, e);
|
|
26
|
+
} catch {
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}, h = (e) => {
|
|
30
|
+
const t = o(e);
|
|
31
|
+
if (!t) return "";
|
|
32
|
+
const r = t.getAttribute("data-ran-theme") || t.getAttribute("theme") || "";
|
|
33
|
+
if (r === "light" || r === "dark") {
|
|
34
|
+
try {
|
|
35
|
+
if (localStorage.getItem(i) === "system") return "system";
|
|
36
|
+
} catch {
|
|
37
|
+
}
|
|
38
|
+
return r;
|
|
39
|
+
}
|
|
40
|
+
return "";
|
|
41
|
+
}, u = (e, t, r) => {
|
|
42
|
+
const n = o(r);
|
|
43
|
+
n && n.style.setProperty(e, String(t));
|
|
44
|
+
}, d = (e, t) => {
|
|
45
|
+
const r = o(t);
|
|
46
|
+
r && r.style.removeProperty(e);
|
|
47
|
+
}, f = (e, t) => {
|
|
48
|
+
Object.entries(e).forEach(([r, n]) => {
|
|
49
|
+
if (n == null) {
|
|
50
|
+
d(r, t);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
u(r, n, t);
|
|
54
|
+
});
|
|
55
|
+
}, y = (e) => {
|
|
56
|
+
if (!(typeof localStorage > "u"))
|
|
57
|
+
try {
|
|
58
|
+
const t = localStorage.getItem(i);
|
|
59
|
+
(t === "light" || t === "dark" || t === "system") && c(t, e);
|
|
60
|
+
} catch {
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
export {
|
|
64
|
+
u as a,
|
|
65
|
+
c as i,
|
|
66
|
+
h as n,
|
|
67
|
+
f as o,
|
|
68
|
+
y as r,
|
|
69
|
+
d as t
|
|
70
|
+
};
|