ranui 0.1.10-alpha.9 → 0.2.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +397 -0
- package/README.zh-CN.md +216 -37
- package/dist/assets/image/failImage.d.ts +2 -0
- package/dist/bin/generate-component-api.d.ts +1 -0
- package/dist/bin/generate-style-docs.d.ts +1 -0
- package/dist/build/config.bundle.d.ts +2 -0
- package/dist/build/config.d.ts +3 -0
- package/dist/build/config.es.d.ts +2 -0
- package/dist/build/config.umd.d.ts +1 -0
- package/dist/builder.d.ts +11 -0
- package/dist/builder.js +39 -0
- package/dist/button-DukaD6uL.js +117 -0
- package/dist/button.js +3 -5
- package/dist/card-DQUJoDUQ.js +60 -0
- package/dist/card.js +5 -0
- package/dist/checkbox-iHZQb-yQ.js +94 -0
- package/dist/checkbox.js +3 -5
- package/dist/colorpicker-Ch67dWa_.js +302 -0
- package/dist/colorpicker.js +3 -9
- package/dist/components/button/index.d.ts +44 -0
- package/dist/components/card/index.d.ts +21 -0
- package/dist/components/checkbox/index.d.ts +35 -0
- package/dist/components/colorpicker/index.d.ts +88 -0
- package/dist/components/dropdown/index.d.ts +32 -0
- package/dist/components/form/index.d.ts +15 -0
- package/dist/components/icon/index.d.ts +58 -0
- package/dist/components/image/index.d.ts +25 -0
- package/dist/components/input/index.d.ts +229 -0
- package/dist/components/link/index.d.ts +21 -0
- package/dist/components/loading/index.d.ts +76 -0
- package/dist/components/math/index.d.ts +16 -0
- package/dist/components/message/container.d.ts +8 -0
- package/dist/components/message/index.d.ts +32 -0
- package/dist/components/modal/index.d.ts +100 -0
- package/dist/components/player/core/constants.d.ts +5 -0
- package/dist/components/player/core/controller.d.ts +33 -0
- package/dist/components/player/core/events.d.ts +10 -0
- package/dist/components/player/core/fullscreen.d.ts +5 -0
- package/dist/components/player/core/levels.d.ts +20 -0
- package/dist/components/player/core/media.d.ts +50 -0
- package/dist/components/player/core/playback.d.ts +14 -0
- package/dist/components/player/core/progress.d.ts +2 -0
- package/dist/components/player/core/state.d.ts +27 -0
- package/dist/components/player/core/view.d.ts +39 -0
- package/dist/components/player/index.d.ts +277 -0
- package/dist/components/popover/content/index.d.ts +12 -0
- package/dist/components/popover/index.d.ts +95 -0
- package/dist/components/progress/index.d.ts +40 -0
- package/dist/components/radar/index.d.ts +52 -0
- package/dist/components/route/index.d.ts +26 -0
- package/dist/components/router/index.d.ts +24 -0
- package/dist/components/scratch/index.d.ts +19 -0
- package/dist/components/section/index.d.ts +23 -0
- package/dist/components/select/dropdown-item/index.d.ts +21 -0
- package/dist/components/select/index.d.ts +135 -0
- package/dist/components/select/option/index.d.ts +19 -0
- package/dist/components/skeleton/index.d.ts +13 -0
- package/dist/components/tab/index.d.ts +58 -0
- package/dist/components/tabpane/index.d.ts +33 -0
- package/dist/demo/i18n.d.ts +4 -0
- package/dist/demo/index.d.ts +3 -0
- package/dist/demo/register-icons.d.ts +1 -0
- package/dist/dropdown-C5362qTy.js +82 -0
- package/dist/dropdown.js +6 -0
- package/dist/events-C59wGdni.js +30 -0
- package/dist/factory-BdsO0dEW.js +165 -0
- package/dist/form-05Lxxl3D.js +44 -0
- package/dist/form.js +5 -0
- package/dist/icon-DmoEnao5.js +165 -0
- package/dist/icon.js +4 -4
- package/dist/{index-KS2nvVcO.js → image-6GayFDqX.js} +58 -71
- package/dist/image.js +3 -2
- package/dist/index.cjs +35 -0
- package/dist/index.d.ts +277 -114
- package/dist/index.iife.js +306 -0
- package/dist/index.js +78 -38
- package/dist/input-DoraIb3x.js +198 -0
- package/dist/input.js +2 -3
- package/dist/katex-es-Bpesphgp.js +23682 -0
- package/dist/katex-es-Cnq5Pk8K.cjs +261 -0
- package/dist/link-BW-gvrpN.js +77 -0
- package/dist/link.js +6 -0
- package/dist/loading-Mko22ncl.js +206 -0
- package/dist/loading.js +4 -6
- package/dist/math-B5PpSnFR.js +52 -0
- package/dist/math.js +2 -4
- package/dist/message-CQENvkoi.js +137 -0
- package/dist/message.js +3 -4
- package/dist/mocks-CMGoftIc.js +179 -0
- package/dist/modal-DruDj3AB.js +350 -0
- package/dist/modal.js +3 -2
- package/dist/player-CvfmwWUa.js +13536 -0
- package/dist/player.js +3 -6
- package/dist/playwright.config.d.ts +2 -0
- package/dist/plugins/load-svg.d.ts +9 -0
- package/dist/popover-BCvHwLZb.js +213 -0
- package/dist/popover.js +3 -5
- package/dist/progress-BWkNf2J5.js +123 -0
- package/dist/progress.js +3 -5
- package/dist/radar-CWsawt2g.js +181 -0
- package/dist/radar.js +3 -4
- package/dist/ranui.css +1 -0
- package/dist/route-BY_E6-2C.js +88 -0
- package/dist/route.js +6 -0
- package/dist/router-BDcv4F-2.js +79 -0
- package/dist/router.js +6 -0
- package/dist/scratch-Dbd9G6Q6.js +60 -0
- package/dist/scratch.js +4 -0
- package/dist/section-CNTvgdQ-.js +63 -0
- package/dist/section.js +5 -0
- package/dist/select-BmhCUTLb.js +433 -0
- package/dist/select.js +3 -8
- package/dist/signal-XHfNsQNW.js +57 -0
- package/dist/skeleton-DPv9nFhL.js +32 -0
- package/dist/skeleton.js +3 -2
- package/dist/ssg.js +21 -0
- package/dist/ssr-DSGwPtEd.js +34 -0
- package/dist/ssr-stream.d.ts +1 -0
- package/dist/ssr-stream.js +87 -0
- package/dist/ssr.d.ts +1 -0
- package/dist/ssr.js +7 -0
- package/dist/style.d.ts +1 -0
- package/dist/style.js +0 -0
- package/dist/tab-C9swK-hm.js +185 -0
- package/dist/tab.js +3 -4
- package/dist/tabpane-B_M-Jokw.js +87 -0
- package/dist/tabpane.js +3 -2
- package/dist/test/e2e/button.spec.d.ts +1 -0
- package/dist/test/e2e/checkbox.spec.d.ts +1 -0
- package/dist/test/e2e/helpers.d.ts +13 -0
- package/dist/test/e2e/icon.spec.d.ts +1 -0
- package/dist/test/e2e/image.spec.d.ts +1 -0
- package/dist/test/e2e/input.spec.d.ts +1 -0
- package/dist/test/e2e/loading.spec.d.ts +1 -0
- package/dist/test/e2e/message.spec.d.ts +1 -0
- package/dist/test/e2e/modal.spec.d.ts +1 -0
- package/dist/test/e2e/popover.spec.d.ts +1 -0
- package/dist/test/e2e/progress.spec.d.ts +1 -0
- package/dist/test/e2e/radar.spec.d.ts +1 -0
- package/dist/test/e2e/select.spec.d.ts +1 -0
- package/dist/test/e2e/skeleton.spec.d.ts +1 -0
- package/dist/test/e2e/tab.spec.d.ts +1 -0
- package/dist/test/e2e/visual/colorpicker.spec.d.ts +1 -0
- package/dist/test/e2e/visual/components.spec.d.ts +1 -0
- package/dist/test/e2e/visual/player.spec.d.ts +1 -0
- package/dist/test/integration/composition.test.d.ts +23 -0
- package/dist/test/setup.d.ts +0 -0
- package/dist/test/ssr/builder.core.ssr.test.d.ts +1 -0
- package/dist/test/ssr/builder.factory.ssr.test.d.ts +1 -0
- package/dist/test/ssr/builder.mocks.test.d.ts +1 -0
- package/dist/test/ssr/components/button.test.d.ts +1 -0
- package/dist/test/ssr/css-vars.test.d.ts +1 -0
- package/dist/test/ssr/registry.test.d.ts +1 -0
- package/dist/test/ssr/router.ssg.test.d.ts +2 -0
- package/dist/test/ssr/snapshots/button.test.d.ts +1 -0
- package/dist/test/ssr/stream.test.d.ts +2 -0
- package/dist/test/ssr/theme.tokens.ssr.test.d.ts +1 -0
- package/dist/test/unit/builder.core.browser.test.d.ts +1 -0
- package/dist/test/unit/builder.escape.test.d.ts +1 -0
- package/dist/test/unit/builder.selectors.test.d.ts +1 -0
- package/dist/test/unit/button.contract.test.d.ts +1 -0
- package/dist/test/unit/card.contract.test.d.ts +1 -0
- package/dist/test/unit/checkbox.contract.test.d.ts +1 -0
- package/dist/test/unit/colorpicker.color.utils.test.d.ts +1 -0
- package/dist/test/unit/colorpicker.contract.test.d.ts +1 -0
- package/dist/test/unit/colorpicker.methods.test.d.ts +1 -0
- package/dist/test/unit/component.helpers.test.d.ts +1 -0
- package/dist/test/unit/dropdown-item.contract.test.d.ts +1 -0
- package/dist/test/unit/dropdown.contract.test.d.ts +1 -0
- package/dist/test/unit/form.contract.test.d.ts +1 -0
- package/dist/test/unit/helpers/component.d.ts +3 -0
- package/dist/test/unit/helpers/dom.d.ts +2 -0
- package/dist/test/unit/icon.contract.test.d.ts +1 -0
- package/dist/test/unit/image.contract.test.d.ts +1 -0
- package/dist/test/unit/input.contract.test.d.ts +1 -0
- package/dist/test/unit/link.contract.test.d.ts +1 -0
- package/dist/test/unit/loading.contract.test.d.ts +1 -0
- package/dist/test/unit/math.contract.test.d.ts +1 -0
- package/dist/test/unit/message.component.test.d.ts +1 -0
- package/dist/test/unit/message.container.test.d.ts +1 -0
- package/dist/test/unit/modal.contract.test.d.ts +1 -0
- package/dist/test/unit/option.contract.test.d.ts +1 -0
- package/dist/test/unit/package-exports.source.test.d.ts +1 -0
- package/dist/test/unit/player-controls.test.d.ts +1 -0
- package/dist/test/unit/player-core.test.d.ts +1 -0
- package/dist/test/unit/player-event-handlers.test.d.ts +1 -0
- package/dist/test/unit/player-events.test.d.ts +1 -0
- package/dist/test/unit/player-fullscreen.test.d.ts +1 -0
- package/dist/test/unit/player-interactions.test.d.ts +1 -0
- package/dist/test/unit/player-levels.test.d.ts +1 -0
- package/dist/test/unit/player-media.test.d.ts +1 -0
- package/dist/test/unit/player-playback.test.d.ts +1 -0
- package/dist/test/unit/player.contract.test.d.ts +1 -0
- package/dist/test/unit/popover-accessibility.test.d.ts +1 -0
- package/dist/test/unit/popover.contract.test.d.ts +2 -0
- package/dist/test/unit/progress.contract.test.d.ts +1 -0
- package/dist/test/unit/radar.contract.test.d.ts +1 -0
- package/dist/test/unit/route.contract.test.d.ts +1 -0
- package/dist/test/unit/router.contract.test.d.ts +2 -0
- package/dist/test/unit/scratch.contract.test.d.ts +1 -0
- package/dist/test/unit/select-accessibility.test.d.ts +1 -0
- package/dist/test/unit/select-option.contract.test.d.ts +1 -0
- package/dist/test/unit/select.contract.test.d.ts +1 -0
- package/dist/test/unit/skeleton.contract.test.d.ts +1 -0
- package/dist/test/unit/ssr.test.d.ts +1 -0
- package/dist/test/unit/tab.contract.test.d.ts +2 -0
- package/dist/test/unit/theme.semantic-tokens.test.d.ts +1 -0
- package/dist/test/unit/theme.skin-tokens.test.d.ts +1 -0
- package/dist/test/unit/utils.dom.test.d.ts +1 -0
- package/dist/test/unit/utils.error.test.d.ts +1 -0
- package/dist/test/unit/utils.i18n.test.d.ts +1 -0
- package/dist/test/unit/utils.image.test.d.ts +1 -0
- package/dist/test/unit/utils.math.test.d.ts +1 -0
- package/dist/test/unit/utils.router.test.d.ts +1 -0
- package/dist/test/unit/utils.signal.test.d.ts +1 -0
- package/dist/test/unit/utils.ssr-stream.test.d.ts +1 -0
- package/dist/test/unit/utils.style.test.d.ts +1 -0
- package/dist/test/unit/utils.theme.test.d.ts +1 -0
- package/dist/test/unit/utils.tween.test.d.ts +1 -0
- package/dist/tsconfig.json +8 -8
- package/dist/typings.d.ts +163 -114
- package/dist/utils/builder/core.d.ts +70 -0
- package/dist/utils/builder/env.d.ts +1 -0
- package/dist/utils/builder/escape.d.ts +2 -0
- package/dist/utils/builder/events.d.ts +55 -0
- package/dist/utils/builder/factory.d.ts +18 -0
- package/dist/utils/builder/index.d.ts +9 -0
- package/dist/utils/builder/mocks.d.ts +62 -0
- package/dist/utils/builder/selectors.d.ts +4 -0
- package/dist/utils/builder/signal.d.ts +87 -0
- package/dist/utils/color.d.ts +52 -0
- package/dist/utils/component.d.ts +16 -0
- package/dist/utils/dom.d.ts +39 -0
- package/dist/utils/error.d.ts +6 -0
- package/dist/utils/i18n/index.d.ts +53 -0
- package/dist/utils/i18n.js +88 -0
- package/dist/utils/image.d.ts +39 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/math.d.ts +26 -0
- package/dist/utils/router/index.d.ts +128 -0
- package/dist/utils/router.js +197 -0
- package/dist/utils/ssg.d.ts +49 -0
- package/dist/utils/ssr-registry.d.ts +8 -0
- package/dist/utils/ssr-stream.d.ts +23 -0
- package/dist/utils/ssr.d.ts +17 -0
- package/dist/utils/style.d.ts +12 -0
- package/dist/utils/theme.d.ts +9 -0
- package/dist/utils/tween.d.ts +21 -0
- package/dist/utils/video.d.ts +40 -0
- package/dist/utils-D4pPF77E.js +689 -0
- package/dist/vite.config.d.ts +6 -0
- package/dist/vitest.config.d.ts +2 -0
- package/dist/vitest.config.ssr.d.ts +2 -0
- package/docs/COMPONENTS.md +326 -0
- package/docs/DESIGN.md +182 -0
- package/docs/style-tokens-public.md +880 -0
- package/package.json +136 -77
- package/typings.d.ts +163 -114
- package/dist/_commonjs-dynamic-modules-DLbDWi6a.js +0 -12
- package/dist/add-user-BN1JlY7e.js +0 -4
- package/dist/arrow-down-B_hCY3Wt.js +0 -662
- package/dist/book-nTEFXU2x.js +0 -4
- package/dist/check-circle-fill-B_pd8ZSs.js +0 -4
- package/dist/check-circle-szyAJiap.js +0 -4
- package/dist/close-CFnkhudp.js +0 -4
- package/dist/close-circle-CwmuN2C6.js +0 -4
- package/dist/close-circle-fill-jSqPPw9i.js +0 -4
- package/dist/colz-DJZvo_8B.js +0 -232
- package/dist/docx-CHkPTdGU.js +0 -3665
- package/dist/drop-4j4abxje.js +0 -36
- package/dist/eye-D_mEt17f.js +0 -4
- package/dist/eye-close-BVr3NJtg.js +0 -4
- package/dist/home-BUQ4USMk.js +0 -4
- package/dist/iconShadowless.js +0 -6
- package/dist/index-15M0olqa.js +0 -204
- package/dist/index-1v568_nq.js +0 -140
- package/dist/index-B897keW5.js +0 -279
- package/dist/index-BZR0HaP2.js +0 -40
- package/dist/index-B_GuEcTd.js +0 -9575
- package/dist/index-Bc2Bcl8D.js +0 -63701
- package/dist/index-C4Sv0T51.js +0 -495
- package/dist/index-C6RcMHoH.js +0 -187
- package/dist/index-C9z10IgG.js +0 -103
- package/dist/index-CFjEuvBW.js +0 -308
- package/dist/index-CGEx9VOA.js +0 -17106
- package/dist/index-CGYfjKUV.js +0 -72
- package/dist/index-CQTJoWhb.js +0 -19
- package/dist/index-CiWwvEMM.js +0 -511
- package/dist/index-CkM9ENTf.js +0 -496
- package/dist/index-CtVOgBDk.js +0 -659
- package/dist/index-D4qUro5V.js +0 -279
- package/dist/index-D4y9c1Dj.js +0 -310
- package/dist/index-DAxs7Dd2.js +0 -119
- package/dist/index-DC5EA657.js +0 -91
- package/dist/index-DJZmDHz-.js +0 -146
- package/dist/index-D_CA5VDZ.js +0 -158
- package/dist/index-WfFw4LJT.js +0 -490
- package/dist/index-mhFL9MJp.js +0 -320
- package/dist/info-circle-COnL5bTJ.js +0 -4
- package/dist/info-circle-fill-CFeVMdci.js +0 -4
- package/dist/inputShadowless.js +0 -6
- package/dist/jszip.min-Dhs3nUkD.js +0 -2346
- package/dist/katex-es-B5r5vt3m.js +0 -14628
- package/dist/loading-Dcc5RApI.js +0 -4
- package/dist/loading-scene-BMc2wqKm.js +0 -4
- package/dist/lock-Cr7BnmWN.js +0 -4
- package/dist/message-D36_Zo2l.js +0 -4
- package/dist/pdf-Cx0VWKFo.js +0 -118
- package/dist/power-off-lQRbiBak.js +0 -4
- package/dist/preview-CJbz9GjO.js +0 -4
- package/dist/preview.js +0 -7
- package/dist/selectShadowless.js +0 -564
- package/dist/setting-DemlgzVC.js +0 -4
- package/dist/shadowless.js +0 -8
- package/dist/sprite-CH2zLtZy.js +0 -141
- package/dist/style.css +0 -1
- package/dist/team-tl4NJXPC.js +0 -4
- package/dist/umd/index.umd.cjs +0 -60
- package/dist/umd/shadowless/shadowless.umd.cjs +0 -1
- package/dist/umd/shadowless/style.css +0 -1
- package/dist/umd/style.css +0 -1
- package/dist/unlock-CeU74z9n.js +0 -4
- package/dist/user-B-eVXwuk.js +0 -4
- package/dist/warning-circle-DDUgEDIv.js +0 -4
- package/dist/warning-circle-fill-lODUKz0i.js +0 -4
- package/readme.md +0 -195
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { c as p, d as l, l as o, s as d, u as n } from "./utils-D4pPF77E.js";
|
|
2
|
+
import { t as m } from "./events-C59wGdni.js";
|
|
3
|
+
import { p as f } from "./factory-BdsO0dEW.js";
|
|
4
|
+
import { a as _, n as b } from "./ssr-DSGwPtEd.js";
|
|
5
|
+
import { getSSGPath as g } from "./utils/router.js";
|
|
6
|
+
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 b {
|
|
7
|
+
static get observedAttributes() {
|
|
8
|
+
return [
|
|
9
|
+
"path",
|
|
10
|
+
"exact",
|
|
11
|
+
"sheet"
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
_events = new m();
|
|
15
|
+
_shadowDom;
|
|
16
|
+
_params = {};
|
|
17
|
+
constructor() {
|
|
18
|
+
super(), this._shadowDom = p(this, v), d(this._shadowDom, "slot", () => f().build());
|
|
19
|
+
}
|
|
20
|
+
get path() {
|
|
21
|
+
return o(this, "path", "/");
|
|
22
|
+
}
|
|
23
|
+
set path(t) {
|
|
24
|
+
n(this, "path", t);
|
|
25
|
+
}
|
|
26
|
+
get exact() {
|
|
27
|
+
return this.hasAttribute("exact");
|
|
28
|
+
}
|
|
29
|
+
get params() {
|
|
30
|
+
return { ...this._params };
|
|
31
|
+
}
|
|
32
|
+
get sheet() {
|
|
33
|
+
return o(this, "sheet");
|
|
34
|
+
}
|
|
35
|
+
set sheet(t) {
|
|
36
|
+
n(this, "sheet", t);
|
|
37
|
+
}
|
|
38
|
+
handlerExternalCss = () => {
|
|
39
|
+
l(this, this._shadowDom, "sheet", null, this.sheet);
|
|
40
|
+
};
|
|
41
|
+
_matchPath(t) {
|
|
42
|
+
const s = this.path, e = {}, r = [], h = s.split("/").map((a) => a.startsWith(":") ? (r.push(a.slice(1)), "([^/]+)") : a === "*" ? "(.*)" : a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("/"), c = this.exact ? new RegExp(`^${h}$`) : new RegExp(`^${h}(?:/.*)?$`), i = t.match(c);
|
|
43
|
+
return i ? (r.forEach((a, u) => {
|
|
44
|
+
e[a] = decodeURIComponent(i[u + 1] ?? "");
|
|
45
|
+
}), {
|
|
46
|
+
matched: !0,
|
|
47
|
+
params: e
|
|
48
|
+
}) : {
|
|
49
|
+
matched: !1,
|
|
50
|
+
params: e
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
_update(t) {
|
|
54
|
+
const { matched: s, params: e } = this._matchPath(t);
|
|
55
|
+
this._params = e, this.hidden = !s, s && this.dispatchEvent(new CustomEvent("routematch", {
|
|
56
|
+
detail: {
|
|
57
|
+
path: t,
|
|
58
|
+
params: e
|
|
59
|
+
},
|
|
60
|
+
bubbles: !0
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
_preSerialize() {
|
|
64
|
+
const t = g();
|
|
65
|
+
t !== null && this._update(t);
|
|
66
|
+
}
|
|
67
|
+
connectedCallback() {
|
|
68
|
+
this.handlerExternalCss();
|
|
69
|
+
const t = this.closest("r-router");
|
|
70
|
+
t && t._currentPath && this._update(t._currentPath);
|
|
71
|
+
}
|
|
72
|
+
disconnectedCallback() {
|
|
73
|
+
this._events.abort();
|
|
74
|
+
}
|
|
75
|
+
attributeChangedCallback(t, s, e) {
|
|
76
|
+
if (s !== e) {
|
|
77
|
+
if (t === "path" || t === "exact") {
|
|
78
|
+
const r = this.closest("r-router");
|
|
79
|
+
r && this._update(r._currentPath);
|
|
80
|
+
}
|
|
81
|
+
t === "sheet" && this.handlerExternalCss();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
_("r-route", w);
|
|
86
|
+
export {
|
|
87
|
+
w as t
|
|
88
|
+
};
|
package/dist/route.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { c as i, d as n, l as a, s as h, u as r } from "./utils-D4pPF77E.js";
|
|
2
|
+
import { t as l } from "./events-C59wGdni.js";
|
|
3
|
+
import { p as u } from "./factory-BdsO0dEW.js";
|
|
4
|
+
import { a as c, n as d } from "./ssr-DSGwPtEd.js";
|
|
5
|
+
import { useRouter as o } from "./utils/router.js";
|
|
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{display:block;width:100%}", _ = class extends d {
|
|
7
|
+
static get observedAttributes() {
|
|
8
|
+
return [
|
|
9
|
+
"mode",
|
|
10
|
+
"base",
|
|
11
|
+
"sheet"
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
_events = new l();
|
|
15
|
+
_shadowDom;
|
|
16
|
+
_slot;
|
|
17
|
+
_currentPath = "";
|
|
18
|
+
constructor() {
|
|
19
|
+
super(), this._shadowDom = i(this, p);
|
|
20
|
+
const t = h(this._shadowDom, "slot", () => u().build());
|
|
21
|
+
this._slot = t;
|
|
22
|
+
}
|
|
23
|
+
get mode() {
|
|
24
|
+
return this.getAttribute("mode") === "hash" ? "hash" : "history";
|
|
25
|
+
}
|
|
26
|
+
get base() {
|
|
27
|
+
return a(this, "base");
|
|
28
|
+
}
|
|
29
|
+
get sheet() {
|
|
30
|
+
return a(this, "sheet");
|
|
31
|
+
}
|
|
32
|
+
set sheet(t) {
|
|
33
|
+
r(this, "sheet", t);
|
|
34
|
+
}
|
|
35
|
+
handlerExternalCss = () => {
|
|
36
|
+
n(this, this._shadowDom, "sheet", null, this.sheet);
|
|
37
|
+
};
|
|
38
|
+
_getPath() {
|
|
39
|
+
if (this.mode === "hash") return window.location.hash.slice(1) || "/";
|
|
40
|
+
const t = this.base, e = window.location.pathname;
|
|
41
|
+
return t && e.startsWith(t) ? e.slice(t.length) || "/" : e;
|
|
42
|
+
}
|
|
43
|
+
navigate(t, e = !1) {
|
|
44
|
+
const s = this.mode === "hash" ? `#${t}` : this.base + t;
|
|
45
|
+
e ? window.history.replaceState(null, "", s) : window.history.pushState(null, "", s), this._syncRoutes();
|
|
46
|
+
}
|
|
47
|
+
_syncRoutes() {
|
|
48
|
+
const t = this._getPath();
|
|
49
|
+
this._currentPath = t, this.querySelectorAll("r-route").forEach((e) => {
|
|
50
|
+
typeof e._update == "function" && e._update(t);
|
|
51
|
+
}), this.dispatchEvent(new CustomEvent("routechange", {
|
|
52
|
+
detail: { path: t },
|
|
53
|
+
bubbles: !0
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
_handlePopState = () => {
|
|
57
|
+
this._syncRoutes();
|
|
58
|
+
};
|
|
59
|
+
_handleNavigate = (t) => {
|
|
60
|
+
const { path: e, replace: s } = t.detail;
|
|
61
|
+
t.stopPropagation(), this.navigate(e, s);
|
|
62
|
+
};
|
|
63
|
+
connectedCallback() {
|
|
64
|
+
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 = o();
|
|
66
|
+
t && t._bind(this), this._syncRoutes(), typeof customElements < "u" && customElements.whenDefined("r-route").then(() => this._syncRoutes());
|
|
67
|
+
}
|
|
68
|
+
disconnectedCallback() {
|
|
69
|
+
const t = o();
|
|
70
|
+
t && t._unbind(this), this._events.abort();
|
|
71
|
+
}
|
|
72
|
+
attributeChangedCallback(t, e, s) {
|
|
73
|
+
e !== s && t === "sheet" && this.handlerExternalCss();
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
c("r-router", _);
|
|
77
|
+
export {
|
|
78
|
+
_ as t
|
|
79
|
+
};
|
package/dist/router.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { c as r, s as h } from "./utils-D4pPF77E.js";
|
|
2
|
+
import { _ as o, i as e } from "./factory-BdsO0dEW.js";
|
|
3
|
+
import { a as n, n as d } from "./ssr-DSGwPtEd.js";
|
|
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
|
+
scratchTicketContainer;
|
|
6
|
+
scratchTicket;
|
|
7
|
+
state;
|
|
8
|
+
scratchAward;
|
|
9
|
+
_shadowDom;
|
|
10
|
+
static get observedAttributes() {
|
|
11
|
+
return [
|
|
12
|
+
"disabled",
|
|
13
|
+
"icon",
|
|
14
|
+
"effect",
|
|
15
|
+
"iconSize",
|
|
16
|
+
"sheet"
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
constructor() {
|
|
20
|
+
super(), this._shadowDom = r(this, l);
|
|
21
|
+
const t = h(this._shadowDom, ".ran-scratch-ticket", () => {
|
|
22
|
+
const s = o("canvas").class("ran-scratch-ticket-canvas").style("width", "100%").style("height", "100%").build(), i = e().class("ran-scratch-ticket-award").build();
|
|
23
|
+
return e().class("ran-scratch-ticket").children(s, i).build();
|
|
24
|
+
}), c = t.querySelector(".ran-scratch-ticket-award"), a = t.querySelector(".ran-scratch-ticket-canvas");
|
|
25
|
+
this.scratchTicketContainer = t, this.scratchAward = c, this.scratchTicket = a, this.state = {
|
|
26
|
+
touchStart: !1,
|
|
27
|
+
scratchArea: 0
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
touchStartScratch = (t) => {
|
|
31
|
+
this.state.touchStart = !0;
|
|
32
|
+
};
|
|
33
|
+
touchMoveScratch = () => {
|
|
34
|
+
if (this.state.touchStart) {
|
|
35
|
+
const t = this.scratchTicket.getContext("2d");
|
|
36
|
+
if (!t) return;
|
|
37
|
+
this.state.scratchArea += 30, t.beginPath(), t.arc(100, 100, 30, 0, 2 * Math.PI), t.globalCompositeOperation = "destination-out", t.fill(), t.closePath();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
touchEndScratch = () => {
|
|
41
|
+
this.state.touchStart = !1;
|
|
42
|
+
const { width: t, height: c } = this.scratchTicket, a = this.scratchTicket.getContext("2d");
|
|
43
|
+
a && this.state.scratchArea > t * c * 0.03 && (this.state.scratchArea = 0, a.clearRect(0, 0, t, c));
|
|
44
|
+
};
|
|
45
|
+
drawScratchTicket = () => {
|
|
46
|
+
const t = this.scratchTicket.getContext("2d");
|
|
47
|
+
if (!this.scratchTicketContainer || !t) return;
|
|
48
|
+
const c = new Image();
|
|
49
|
+
c.src = "", c.onload = () => {
|
|
50
|
+
t.drawImage(c, 0, 0, this.scratchTicket.width, this.scratchTicket.height);
|
|
51
|
+
}, this.scratchTicket.addEventListener("touchstart", this.touchStartScratch), this.scratchTicket.addEventListener("touchmove", this.touchMoveScratch), this.scratchTicket.addEventListener("touchend", this.touchEndScratch);
|
|
52
|
+
};
|
|
53
|
+
attributeChangedCallback() {
|
|
54
|
+
this._shadowDom.contains(this.scratchTicketContainer) || this._shadowDom.appendChild(this.scratchTicketContainer), this.drawScratchTicket();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
n("r-scratch", u);
|
|
58
|
+
export {
|
|
59
|
+
u as t
|
|
60
|
+
};
|
package/dist/scratch.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { c as o, d as r, l as s, s as h, u as n } from "./utils-D4pPF77E.js";
|
|
2
|
+
import { t as d } from "./events-C59wGdni.js";
|
|
3
|
+
import { i as a, p as l } from "./factory-BdsO0dEW.js";
|
|
4
|
+
import { a as c, n as b } from "./ssr-DSGwPtEd.js";
|
|
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, #d9d9d9));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
|
+
_shadowDom;
|
|
7
|
+
_headerEl;
|
|
8
|
+
_headingEl;
|
|
9
|
+
_subtitleEl;
|
|
10
|
+
_events = new d();
|
|
11
|
+
static get observedAttributes() {
|
|
12
|
+
return [
|
|
13
|
+
"heading",
|
|
14
|
+
"subtitle",
|
|
15
|
+
"sheet"
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
constructor() {
|
|
19
|
+
super(), this._shadowDom = o(this, g);
|
|
20
|
+
const t = h(this._shadowDom, ".ran-section-header", () => {
|
|
21
|
+
const e = a().class("ran-section-header").attr("part", "header").children(a().class("ran-section-heading").attr("part", "heading").attr("role", "heading").attr("aria-level", "2"), a().class("ran-section-subtitle").attr("part", "subtitle")).build(), i = a().class("ran-section-body").attr("part", "body").children(l()).build();
|
|
22
|
+
return this._shadowDom.appendChild(e), this._shadowDom.appendChild(i), e;
|
|
23
|
+
});
|
|
24
|
+
this._headerEl = t, this._headingEl = t.querySelector(".ran-section-heading"), this._subtitleEl = t.querySelector(".ran-section-subtitle");
|
|
25
|
+
}
|
|
26
|
+
get heading() {
|
|
27
|
+
return s(this, "heading");
|
|
28
|
+
}
|
|
29
|
+
set heading(t) {
|
|
30
|
+
n(this, "heading", t);
|
|
31
|
+
}
|
|
32
|
+
get subtitle() {
|
|
33
|
+
return s(this, "subtitle");
|
|
34
|
+
}
|
|
35
|
+
set subtitle(t) {
|
|
36
|
+
n(this, "subtitle", t);
|
|
37
|
+
}
|
|
38
|
+
get sheet() {
|
|
39
|
+
return s(this, "sheet");
|
|
40
|
+
}
|
|
41
|
+
set sheet(t) {
|
|
42
|
+
n(this, "sheet", t);
|
|
43
|
+
}
|
|
44
|
+
_syncHeading() {
|
|
45
|
+
this._headingEl.textContent = this.getAttribute("heading") ?? "", this._headerEl.style.display = this._headingEl.textContent || this._subtitleEl.textContent ? "" : "none";
|
|
46
|
+
}
|
|
47
|
+
_syncSubtitle() {
|
|
48
|
+
this._subtitleEl.textContent = this.getAttribute("subtitle") ?? "", this._headerEl.style.display = this._headingEl.textContent || this._subtitleEl.textContent ? "" : "none";
|
|
49
|
+
}
|
|
50
|
+
connectedCallback() {
|
|
51
|
+
this._syncHeading(), this._syncSubtitle(), r(this, this._shadowDom, "sheet", null, this.sheet);
|
|
52
|
+
}
|
|
53
|
+
disconnectedCallback() {
|
|
54
|
+
this._events.abort();
|
|
55
|
+
}
|
|
56
|
+
attributeChangedCallback(t, e, i) {
|
|
57
|
+
e !== i && (t === "heading" && this._syncHeading(), t === "subtitle" && this._syncSubtitle(), t === "sheet" && r(this, this._shadowDom, t, e, i));
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
c("r-section", u);
|
|
61
|
+
export {
|
|
62
|
+
u as t
|
|
63
|
+
};
|