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
package/dist/index-D4qUro5V.js
DELETED
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { _ as __variableDynamicImportRuntimeHelper, s as str2Xml } from "./drop-4j4abxje.js";
|
|
5
|
-
import "./arrow-down-B_hCY3Wt.js";
|
|
6
|
-
const f7170ee498e0dd32cbdcb63fba8f75cc = ".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:var(--ran-icon-host-display, inline-flex)}:host([spin]){animation-name:var(--ran-icon-host-spin-animation-name, rotate);animation-duration:var(--ran-icon-host-spin-animation-name, 1.4s);animation-timing-function:linear;animation-iteration-count:var(--ran-icon-host-spin-animation-name, infinite)}.ran-icon{display:var(--ran-icon-display, flex);align-items:var(--ran-icon-align-items, center);justify-content:var(--ran-icon-justify-content, center)}@keyframes rotate{to{transform:var(--ran-icon-keyframes-to-transform, rotate(360deg))}}";
|
|
7
|
-
const X_LINKS_NS = "http://www.w3.org/1999/xlink";
|
|
8
|
-
const X_LINK_HREF = "xlink:href";
|
|
9
|
-
function Custom() {
|
|
10
|
-
if (typeof window !== "undefined" && !customElements.get("r-icon")) {
|
|
11
|
-
class RIcon extends HTMLElement {
|
|
12
|
-
constructor() {
|
|
13
|
-
super();
|
|
14
|
-
__publicField(this, "_icon");
|
|
15
|
-
__publicField(this, "_div");
|
|
16
|
-
/**
|
|
17
|
-
* @description: 本地加载 icon
|
|
18
|
-
*/
|
|
19
|
-
__publicField(this, "loadLocal", () => {
|
|
20
|
-
return new Promise((resolve, reject) => {
|
|
21
|
-
__variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../assets/icons/add-user.svg": () => import("./add-user-BN1JlY7e.js"), "../../assets/icons/arrow-down.svg": () => import("./arrow-down-B_hCY3Wt.js").then((n) => n.j), "../../assets/icons/book.svg": () => import("./book-nTEFXU2x.js"), "../../assets/icons/check-circle-fill.svg": () => import("./check-circle-fill-B_pd8ZSs.js"), "../../assets/icons/check-circle.svg": () => import("./check-circle-szyAJiap.js"), "../../assets/icons/close-circle-fill.svg": () => import("./close-circle-fill-jSqPPw9i.js"), "../../assets/icons/close-circle.svg": () => import("./close-circle-CwmuN2C6.js"), "../../assets/icons/close.svg": () => import("./close-CFnkhudp.js"), "../../assets/icons/drop.svg": () => import("./drop-4j4abxje.js").then((n) => n.d), "../../assets/icons/eye-close.svg": () => import("./eye-close-BVr3NJtg.js"), "../../assets/icons/eye.svg": () => import("./eye-D_mEt17f.js"), "../../assets/icons/home.svg": () => import("./home-BUQ4USMk.js"), "../../assets/icons/info-circle-fill.svg": () => import("./info-circle-fill-CFeVMdci.js"), "../../assets/icons/info-circle.svg": () => import("./info-circle-COnL5bTJ.js"), "../../assets/icons/loading-scene.svg": () => import("./loading-scene-BMc2wqKm.js"), "../../assets/icons/loading.svg": () => import("./loading-Dcc5RApI.js"), "../../assets/icons/lock.svg": () => import("./lock-Cr7BnmWN.js"), "../../assets/icons/message.svg": () => import("./message-D36_Zo2l.js"), "../../assets/icons/power-off.svg": () => import("./power-off-lQRbiBak.js"), "../../assets/icons/preview.svg": () => import("./preview-CJbz9GjO.js"), "../../assets/icons/setting.svg": () => import("./setting-DemlgzVC.js"), "../../assets/icons/sprite.svg": () => import("./sprite-CH2zLtZy.js"), "../../assets/icons/team.svg": () => import("./team-tl4NJXPC.js"), "../../assets/icons/unlock.svg": () => import("./unlock-CeU74z9n.js"), "../../assets/icons/user.svg": () => import("./user-B-eVXwuk.js"), "../../assets/icons/warning-circle-fill.svg": () => import("./warning-circle-fill-lODUKz0i.js"), "../../assets/icons/warning-circle.svg": () => import("./warning-circle-DDUgEDIv.js") }), `../../assets/icons/${this.name}.svg`, 5).then((result) => {
|
|
22
|
-
if (result && result.default && result.default._identification) {
|
|
23
|
-
const { data } = result.default;
|
|
24
|
-
this._icon && this._div.removeChild(this._icon);
|
|
25
|
-
this._icon = str2Xml(data, "image/svg+xml");
|
|
26
|
-
if (this._icon) {
|
|
27
|
-
this._div.appendChild(this._icon);
|
|
28
|
-
this.setSize();
|
|
29
|
-
this.setColor();
|
|
30
|
-
resolve();
|
|
31
|
-
}
|
|
32
|
-
} else {
|
|
33
|
-
this.loadNs();
|
|
34
|
-
reject(`
|
|
35
|
-
couldn't be loaded by r-icon, message: ${this.name} icon is undefined`);
|
|
36
|
-
}
|
|
37
|
-
}).catch((error) => {
|
|
38
|
-
this.loadNs();
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
/**
|
|
43
|
-
* @description: NS 加载 icon
|
|
44
|
-
*/
|
|
45
|
-
__publicField(this, "loadNs", () => {
|
|
46
|
-
if (this._icon && this._div) {
|
|
47
|
-
this._div.removeChild(this._icon);
|
|
48
|
-
}
|
|
49
|
-
this._icon = document.createElement("svg");
|
|
50
|
-
this._icon.setAttribute("class", "icon");
|
|
51
|
-
this._icon.setAttribute("viewBox", "0 0 1024 1024");
|
|
52
|
-
this._icon.setAttribute("width", "100");
|
|
53
|
-
this._icon.setAttribute("height", "100");
|
|
54
|
-
const use = document.createElementNS(X_LINKS_NS, "use");
|
|
55
|
-
use.setAttributeNS(X_LINKS_NS, X_LINK_HREF, `../../assets/iconfont/icon.svg#icon-${this.name}`);
|
|
56
|
-
this._icon.appendChild(use);
|
|
57
|
-
this._div.appendChild(this._icon);
|
|
58
|
-
});
|
|
59
|
-
/**
|
|
60
|
-
* @description: 根据 name 属性加载对应的 svg
|
|
61
|
-
*/
|
|
62
|
-
__publicField(this, "setIcon", async () => {
|
|
63
|
-
if (this.name) {
|
|
64
|
-
this.loadLocal();
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
/**
|
|
68
|
-
* @description: 设置 icon 的大小
|
|
69
|
-
*/
|
|
70
|
-
__publicField(this, "setSize", () => {
|
|
71
|
-
if (this._icon && this.size) {
|
|
72
|
-
this._icon.setAttribute("width", this.size);
|
|
73
|
-
this._icon.setAttribute("height", this.size);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
/**
|
|
77
|
-
* @description: 设置 icon 的颜色
|
|
78
|
-
*/
|
|
79
|
-
__publicField(this, "setColor", () => {
|
|
80
|
-
if (this._icon) {
|
|
81
|
-
this.color ? this._icon.setAttribute("fill", this.color) : this._icon.setAttribute("fill", "currentColor");
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
/**
|
|
85
|
-
* @description: 设置是否旋转和旋转的速度
|
|
86
|
-
*/
|
|
87
|
-
__publicField(this, "setSpin", () => {
|
|
88
|
-
if (this.spin) {
|
|
89
|
-
this.style.setProperty("animation-duration", `${this.spin}s`);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
this._div = document.createElement("div");
|
|
93
|
-
this._div.setAttribute("class", "ran-icon");
|
|
94
|
-
this._div.setAttribute("part", "ran-icon");
|
|
95
|
-
const shadowRoot = this.attachShadow({ mode: "closed" });
|
|
96
|
-
const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
|
|
97
|
-
F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc;
|
|
98
|
-
shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
|
|
99
|
-
shadowRoot.appendChild(this._div);
|
|
100
|
-
}
|
|
101
|
-
static get observedAttributes() {
|
|
102
|
-
return ["name", "size", "color", "spin"];
|
|
103
|
-
}
|
|
104
|
-
get name() {
|
|
105
|
-
return this.getAttribute("name");
|
|
106
|
-
}
|
|
107
|
-
set name(value) {
|
|
108
|
-
if (value) this.setAttribute("name", value);
|
|
109
|
-
}
|
|
110
|
-
get size() {
|
|
111
|
-
return this.getAttribute("size");
|
|
112
|
-
}
|
|
113
|
-
set size(value) {
|
|
114
|
-
if (value) this.setAttribute("size", value);
|
|
115
|
-
}
|
|
116
|
-
get color() {
|
|
117
|
-
return this.getAttribute("color");
|
|
118
|
-
}
|
|
119
|
-
set color(value) {
|
|
120
|
-
if (value) this.setAttribute("color", value);
|
|
121
|
-
}
|
|
122
|
-
get spin() {
|
|
123
|
-
return this.getAttribute("spin");
|
|
124
|
-
}
|
|
125
|
-
set spin(value) {
|
|
126
|
-
if (value != null) this.setAttribute("spin", value);
|
|
127
|
-
}
|
|
128
|
-
connectedCallback() {
|
|
129
|
-
this.setIcon();
|
|
130
|
-
}
|
|
131
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
132
|
-
if (newValue !== oldValue) {
|
|
133
|
-
if (name === "name") this.setIcon();
|
|
134
|
-
if (name === "size") this.setSize();
|
|
135
|
-
if (name === "color") this.setColor();
|
|
136
|
-
if (name === "spin") this.setSpin();
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
customElements.define("r-icon", RIcon);
|
|
141
|
-
}
|
|
142
|
-
if (typeof window !== "undefined" && !customElements.get("ra-icon")) {
|
|
143
|
-
class RaIcon extends HTMLElement {
|
|
144
|
-
constructor() {
|
|
145
|
-
super();
|
|
146
|
-
__publicField(this, "_icon");
|
|
147
|
-
__publicField(this, "_div");
|
|
148
|
-
/**
|
|
149
|
-
* @description: 本地加载 icon
|
|
150
|
-
*/
|
|
151
|
-
__publicField(this, "loadLocal", () => {
|
|
152
|
-
return new Promise((resolve, reject) => {
|
|
153
|
-
__variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../assets/icons/add-user.svg": () => import("./add-user-BN1JlY7e.js"), "../../assets/icons/arrow-down.svg": () => import("./arrow-down-B_hCY3Wt.js").then((n) => n.j), "../../assets/icons/book.svg": () => import("./book-nTEFXU2x.js"), "../../assets/icons/check-circle-fill.svg": () => import("./check-circle-fill-B_pd8ZSs.js"), "../../assets/icons/check-circle.svg": () => import("./check-circle-szyAJiap.js"), "../../assets/icons/close-circle-fill.svg": () => import("./close-circle-fill-jSqPPw9i.js"), "../../assets/icons/close-circle.svg": () => import("./close-circle-CwmuN2C6.js"), "../../assets/icons/close.svg": () => import("./close-CFnkhudp.js"), "../../assets/icons/drop.svg": () => import("./drop-4j4abxje.js").then((n) => n.d), "../../assets/icons/eye-close.svg": () => import("./eye-close-BVr3NJtg.js"), "../../assets/icons/eye.svg": () => import("./eye-D_mEt17f.js"), "../../assets/icons/home.svg": () => import("./home-BUQ4USMk.js"), "../../assets/icons/info-circle-fill.svg": () => import("./info-circle-fill-CFeVMdci.js"), "../../assets/icons/info-circle.svg": () => import("./info-circle-COnL5bTJ.js"), "../../assets/icons/loading-scene.svg": () => import("./loading-scene-BMc2wqKm.js"), "../../assets/icons/loading.svg": () => import("./loading-Dcc5RApI.js"), "../../assets/icons/lock.svg": () => import("./lock-Cr7BnmWN.js"), "../../assets/icons/message.svg": () => import("./message-D36_Zo2l.js"), "../../assets/icons/power-off.svg": () => import("./power-off-lQRbiBak.js"), "../../assets/icons/preview.svg": () => import("./preview-CJbz9GjO.js"), "../../assets/icons/setting.svg": () => import("./setting-DemlgzVC.js"), "../../assets/icons/sprite.svg": () => import("./sprite-CH2zLtZy.js"), "../../assets/icons/team.svg": () => import("./team-tl4NJXPC.js"), "../../assets/icons/unlock.svg": () => import("./unlock-CeU74z9n.js"), "../../assets/icons/user.svg": () => import("./user-B-eVXwuk.js"), "../../assets/icons/warning-circle-fill.svg": () => import("./warning-circle-fill-lODUKz0i.js"), "../../assets/icons/warning-circle.svg": () => import("./warning-circle-DDUgEDIv.js") }), `../../assets/icons/${this.name}.svg`, 5).then((result) => {
|
|
154
|
-
if (result && result.default && result.default._identification) {
|
|
155
|
-
const { data } = result.default;
|
|
156
|
-
this._icon && this._div.removeChild(this._icon);
|
|
157
|
-
this._icon = str2Xml(data, "image/svg+xml");
|
|
158
|
-
if (this._icon) {
|
|
159
|
-
this._div.appendChild(this._icon);
|
|
160
|
-
this.setSize();
|
|
161
|
-
this.setColor();
|
|
162
|
-
resolve();
|
|
163
|
-
}
|
|
164
|
-
} else {
|
|
165
|
-
this.loadNs();
|
|
166
|
-
reject(`
|
|
167
|
-
couldn't be loaded by r-icon, message: ${this.name} icon is undefined`);
|
|
168
|
-
}
|
|
169
|
-
}).catch((error) => {
|
|
170
|
-
this.loadNs();
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
/**
|
|
175
|
-
* @description: NS 加载 icon
|
|
176
|
-
*/
|
|
177
|
-
__publicField(this, "loadNs", () => {
|
|
178
|
-
if (this._icon && this._div) {
|
|
179
|
-
this._div.removeChild(this._icon);
|
|
180
|
-
}
|
|
181
|
-
this._icon = document.createElement("svg");
|
|
182
|
-
this._icon.setAttribute("class", "icon");
|
|
183
|
-
this._icon.setAttribute("viewBox", "0 0 1024 1024");
|
|
184
|
-
this._icon.setAttribute("width", "100");
|
|
185
|
-
this._icon.setAttribute("height", "100");
|
|
186
|
-
const use = document.createElementNS(X_LINKS_NS, "use");
|
|
187
|
-
use.setAttributeNS(X_LINKS_NS, X_LINK_HREF, `../../assets/iconfont/icon.svg#icon-${this.name}`);
|
|
188
|
-
this._icon.appendChild(use);
|
|
189
|
-
this._div.appendChild(this._icon);
|
|
190
|
-
});
|
|
191
|
-
/**
|
|
192
|
-
* @description: 根据 name 属性加载对应的 svg
|
|
193
|
-
*/
|
|
194
|
-
__publicField(this, "setIcon", async () => {
|
|
195
|
-
if (this.name) {
|
|
196
|
-
this.loadLocal();
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
/**
|
|
200
|
-
* @description: 设置 icon 的大小
|
|
201
|
-
*/
|
|
202
|
-
__publicField(this, "setSize", () => {
|
|
203
|
-
if (this._icon && this.size) {
|
|
204
|
-
this._icon.setAttribute("width", this.size);
|
|
205
|
-
this._icon.setAttribute("height", this.size);
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
/**
|
|
209
|
-
* @description: 设置 icon 的颜色
|
|
210
|
-
*/
|
|
211
|
-
__publicField(this, "setColor", () => {
|
|
212
|
-
if (this._icon) {
|
|
213
|
-
this.color ? this._icon.setAttribute("fill", this.color) : this._icon.setAttribute("fill", "currentColor");
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
/**
|
|
217
|
-
* @description: 设置是否旋转和旋转的速度
|
|
218
|
-
*/
|
|
219
|
-
__publicField(this, "setSpin", () => {
|
|
220
|
-
if (this.spin) {
|
|
221
|
-
this.style.setProperty("animation-duration", `${this.spin}s`);
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
this._div = document.createElement("div");
|
|
225
|
-
this._div.setAttribute("class", "ran-icon");
|
|
226
|
-
this._div.setAttribute("part", "ran-icon");
|
|
227
|
-
}
|
|
228
|
-
static get observedAttributes() {
|
|
229
|
-
return ["name", "size", "color", "spin"];
|
|
230
|
-
}
|
|
231
|
-
get name() {
|
|
232
|
-
return this.getAttribute("name");
|
|
233
|
-
}
|
|
234
|
-
set name(value) {
|
|
235
|
-
if (value) this.setAttribute("name", value);
|
|
236
|
-
}
|
|
237
|
-
get size() {
|
|
238
|
-
return this.getAttribute("size");
|
|
239
|
-
}
|
|
240
|
-
set size(value) {
|
|
241
|
-
if (value) this.setAttribute("size", value);
|
|
242
|
-
}
|
|
243
|
-
get color() {
|
|
244
|
-
return this.getAttribute("color");
|
|
245
|
-
}
|
|
246
|
-
set color(value) {
|
|
247
|
-
if (value) this.setAttribute("color", value);
|
|
248
|
-
}
|
|
249
|
-
get spin() {
|
|
250
|
-
return this.getAttribute("spin");
|
|
251
|
-
}
|
|
252
|
-
set spin(value) {
|
|
253
|
-
if (value != null) this.setAttribute("spin", value);
|
|
254
|
-
}
|
|
255
|
-
connectedCallback() {
|
|
256
|
-
this.appendChild(this._div);
|
|
257
|
-
this.setIcon();
|
|
258
|
-
}
|
|
259
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
260
|
-
if (newValue !== oldValue) {
|
|
261
|
-
if (name === "name") this.setIcon();
|
|
262
|
-
if (name === "size") this.setSize();
|
|
263
|
-
if (name === "color") this.setColor();
|
|
264
|
-
if (name === "spin") this.setSpin();
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
customElements.define("ra-icon", RaIcon);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
const index = Custom();
|
|
272
|
-
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
273
|
-
__proto__: null,
|
|
274
|
-
default: index
|
|
275
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
276
|
-
export {
|
|
277
|
-
index as a,
|
|
278
|
-
index$1 as i
|
|
279
|
-
};
|
package/dist/index-D4y9c1Dj.js
DELETED
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { c as create, i as isMobile } from "./arrow-down-B_hCY3Wt.js";
|
|
5
|
-
import { c as createCustomError, H as HTMLElementSSR } from "./index-DC5EA657.js";
|
|
6
|
-
import "./index-C9z10IgG.js";
|
|
7
|
-
const f7170ee498e0dd32cbdcb63fba8f75cc = ".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:var(--ran-popover-host-display, inline-block)}.ran-popover{box-sizing:var(--ran-popover-box-sizing, border-box);position:var(--ran-popover-position, relative);display:var(--ran-popover-display, inline-block);margin:var(--ran-popover-margin, 0);padding:var(--ran-popover-padding, 0)}.ran-popover-block{display:var(--ran-popover-block-display, inline-block)}";
|
|
8
|
-
const less = ".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}";
|
|
9
|
-
class Content extends HTMLElementSSR() {
|
|
10
|
-
constructor() {
|
|
11
|
-
super();
|
|
12
|
-
__publicField(this, "observer");
|
|
13
|
-
__publicField(this, "_shadowDom");
|
|
14
|
-
__publicField(this, "_slot");
|
|
15
|
-
__publicField(this, "callback", (mutations, observer) => {
|
|
16
|
-
for (const mutation of mutations) {
|
|
17
|
-
if (mutation.type === "childList") {
|
|
18
|
-
this.onChange(mutation);
|
|
19
|
-
} else if (mutation.type === "attributes") {
|
|
20
|
-
this.onChange(mutation);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
__publicField(this, "onChange", (mutation) => {
|
|
25
|
-
this.dispatchEvent(
|
|
26
|
-
new CustomEvent("change", {
|
|
27
|
-
detail: {
|
|
28
|
-
type: mutation.type,
|
|
29
|
-
value: { content: this.children, mutation }
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
);
|
|
33
|
-
});
|
|
34
|
-
this._slot = create("slot").setAttribute("class", "slot").element;
|
|
35
|
-
const shadowRoot = this.attachShadow({ mode: "closed" });
|
|
36
|
-
this._shadowDom = shadowRoot;
|
|
37
|
-
const style = create("style").setTextContent(less);
|
|
38
|
-
shadowRoot.appendChild(style.element);
|
|
39
|
-
shadowRoot.appendChild(this._slot);
|
|
40
|
-
this.observer = new MutationObserver(this.callback);
|
|
41
|
-
}
|
|
42
|
-
connectedCallback() {
|
|
43
|
-
this.observer.observe(this, { attributes: true, childList: true, subtree: true });
|
|
44
|
-
}
|
|
45
|
-
disconnectCallback() {
|
|
46
|
-
this.observer.disconnect();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function Custom$1() {
|
|
50
|
-
if (typeof document !== "undefined" && !customElements.get("r-content")) {
|
|
51
|
-
customElements.define("r-content", Content);
|
|
52
|
-
return Content;
|
|
53
|
-
} else {
|
|
54
|
-
return createCustomError("document is undefined or r-content is exist");
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
Custom$1();
|
|
58
|
-
const arrowHeight = 4;
|
|
59
|
-
const animationTime = 300;
|
|
60
|
-
const placementDirection = {
|
|
61
|
-
bottom: {
|
|
62
|
-
add: "ran-dropdown-down-in",
|
|
63
|
-
remove: "ran-dropdown-down-out"
|
|
64
|
-
},
|
|
65
|
-
top: {
|
|
66
|
-
add: "ran-dropdown-up-in",
|
|
67
|
-
remove: "ran-dropdown-up-out"
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
class Popover extends HTMLElementSSR() {
|
|
71
|
-
constructor() {
|
|
72
|
-
super();
|
|
73
|
-
__publicField(this, "_slot");
|
|
74
|
-
__publicField(this, "popoverBlock");
|
|
75
|
-
__publicField(this, "popoverContent");
|
|
76
|
-
__publicField(this, "popoverInner");
|
|
77
|
-
__publicField(this, "popoverInnerBlock");
|
|
78
|
-
__publicField(this, "_shadowDom");
|
|
79
|
-
__publicField(this, "dropDownInTimeId");
|
|
80
|
-
__publicField(this, "dropDownOutTimeId");
|
|
81
|
-
__publicField(this, "removeTimeId");
|
|
82
|
-
__publicField(this, "stopPropagation", (e) => {
|
|
83
|
-
e.stopPropagation();
|
|
84
|
-
});
|
|
85
|
-
__publicField(this, "createContent", (content) => {
|
|
86
|
-
var _a, _b, _c;
|
|
87
|
-
if (!content) return;
|
|
88
|
-
if (!this.popoverContent) {
|
|
89
|
-
const div = document.createElement("div");
|
|
90
|
-
this.popoverContent = create("r-dropdown").setAttribute("class", "ran-popover-dropdown").setStyle("display", "none").setStyle("position", "absolute").element;
|
|
91
|
-
(_a = this.popoverContent) == null ? void 0 : _a.addEventListener("click", this.stopPropagation);
|
|
92
|
-
this.popoverContent && div.appendChild(this.popoverContent);
|
|
93
|
-
if (this.trigger.includes("hover") && !isMobile()) {
|
|
94
|
-
(_b = this.popoverContent) == null ? void 0 : _b.addEventListener("mouseleave", this.blur);
|
|
95
|
-
(_c = this.popoverContent) == null ? void 0 : _c.addEventListener("mouseenter", this.removeDropDownTimeId);
|
|
96
|
-
}
|
|
97
|
-
document.body.appendChild(div);
|
|
98
|
-
}
|
|
99
|
-
if (this.popoverContent && content.length > 0) {
|
|
100
|
-
this.popoverContent.innerHTML = "";
|
|
101
|
-
const Fragment = document.createDocumentFragment();
|
|
102
|
-
for (const child of content) {
|
|
103
|
-
Fragment.appendChild(child);
|
|
104
|
-
}
|
|
105
|
-
this.popoverContent.appendChild(Fragment);
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
__publicField(this, "watchContent", (e) => {
|
|
109
|
-
const { value } = e.detail;
|
|
110
|
-
this.createContent(value.content);
|
|
111
|
-
});
|
|
112
|
-
/**
|
|
113
|
-
* @description: 焦点移除的情况,需要移除下拉框
|
|
114
|
-
* @return {*}
|
|
115
|
-
*/
|
|
116
|
-
__publicField(this, "blur", () => {
|
|
117
|
-
if (this.removeTimeId) {
|
|
118
|
-
this.removeDropDownTimeId();
|
|
119
|
-
}
|
|
120
|
-
this.removeTimeId = setTimeout(() => {
|
|
121
|
-
this.removeDropDownTimeId();
|
|
122
|
-
this.setDropdownDisplayNone();
|
|
123
|
-
}, 300);
|
|
124
|
-
});
|
|
125
|
-
__publicField(this, "removeDropDownTimeId", () => {
|
|
126
|
-
if (this.trigger.includes("hover") && !isMobile()) {
|
|
127
|
-
clearTimeout(this.removeTimeId);
|
|
128
|
-
this.removeTimeId = void 0;
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
/**
|
|
132
|
-
* @description: 添加 dropdown
|
|
133
|
-
* @return {*}
|
|
134
|
-
*/
|
|
135
|
-
__publicField(this, "setDropdownDisplayBlock", () => {
|
|
136
|
-
var _a;
|
|
137
|
-
if (this.dropDownInTimeId) return;
|
|
138
|
-
if (this.popoverContent && this.popoverContent.style.display !== "block") {
|
|
139
|
-
this.popoverContent.setAttribute("transit", placementDirection[this.placement].add);
|
|
140
|
-
(_a = this.popoverContent) == null ? void 0 : _a.style.setProperty("display", "block");
|
|
141
|
-
this.dropDownInTimeId = setTimeout(() => {
|
|
142
|
-
this.popoverContent && this.popoverContent.removeAttribute("transit");
|
|
143
|
-
clearTimeout(this.dropDownInTimeId);
|
|
144
|
-
this.dropDownInTimeId = void 0;
|
|
145
|
-
}, animationTime);
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
/**
|
|
149
|
-
* @description: 移除 select dropdown
|
|
150
|
-
* @return {*}
|
|
151
|
-
*/
|
|
152
|
-
__publicField(this, "setDropdownDisplayNone", () => {
|
|
153
|
-
if (this.dropDownOutTimeId) return;
|
|
154
|
-
if (this.popoverContent && this.popoverContent.style.display !== "none") {
|
|
155
|
-
this.popoverContent.setAttribute("transit", placementDirection[this.placement].remove);
|
|
156
|
-
this.dropDownOutTimeId = setTimeout(() => {
|
|
157
|
-
var _a;
|
|
158
|
-
(_a = this.popoverContent) == null ? void 0 : _a.style.setProperty("display", "none");
|
|
159
|
-
this.popoverContent && this.popoverContent.removeAttribute("transit");
|
|
160
|
-
clearTimeout(this.dropDownOutTimeId);
|
|
161
|
-
this.dropDownOutTimeId = void 0;
|
|
162
|
-
}, animationTime);
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
__publicField(this, "placementPosition", () => {
|
|
166
|
-
if (!this.popoverContent) return;
|
|
167
|
-
const rect = this.getBoundingClientRect();
|
|
168
|
-
const { top, left, bottom, width, height } = rect;
|
|
169
|
-
let popoverTop = bottom + window.scrollY + arrowHeight;
|
|
170
|
-
let popoverLeft = left + window.scrollX;
|
|
171
|
-
const root = document.getElementById(this.getPopupContainerId);
|
|
172
|
-
const popoverContentRect = this.popoverContent.getBoundingClientRect();
|
|
173
|
-
if (this.placement === "top") {
|
|
174
|
-
popoverTop = top + window.scrollY - popoverContentRect.height - arrowHeight;
|
|
175
|
-
if (this.getPopupContainerId && root) {
|
|
176
|
-
const rootRect = root.getBoundingClientRect();
|
|
177
|
-
popoverLeft = left - rootRect.left;
|
|
178
|
-
popoverTop = top - root.getBoundingClientRect().top - this.popoverContent.clientHeight - arrowHeight;
|
|
179
|
-
popoverLeft = left - root.getBoundingClientRect().left;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
this.popoverContent.style.setProperty("inset", `${popoverTop}px auto auto ${popoverLeft}px`);
|
|
183
|
-
this.popoverContent.style.setProperty("--ran-x", `${popoverLeft}px`);
|
|
184
|
-
this.popoverContent.style.setProperty("--ran-y", `${popoverTop}px`);
|
|
185
|
-
this.popoverContent.style.setProperty("--ran-popover-width", `${width}px`);
|
|
186
|
-
this.popoverContent.style.setProperty("--ran-popover-height", `${popoverContentRect.height}px`);
|
|
187
|
-
});
|
|
188
|
-
__publicField(this, "hoverPopover", (e) => {
|
|
189
|
-
this.clickPopover(e);
|
|
190
|
-
});
|
|
191
|
-
__publicField(this, "clickContent", (e) => {
|
|
192
|
-
e.stopPropagation();
|
|
193
|
-
});
|
|
194
|
-
__publicField(this, "clickPopover", (e) => {
|
|
195
|
-
e.stopPropagation();
|
|
196
|
-
e.preventDefault();
|
|
197
|
-
this.setDropdownDisplayBlock();
|
|
198
|
-
this.placementPosition();
|
|
199
|
-
});
|
|
200
|
-
__publicField(this, "clickRemovePopover", (e) => {
|
|
201
|
-
this.hoverRemovePopover(e);
|
|
202
|
-
});
|
|
203
|
-
__publicField(this, "popoverTrigger", () => {
|
|
204
|
-
this.removeEventListener("mouseenter", this.hoverPopover);
|
|
205
|
-
this.removeEventListener("mouseleave", this.blur);
|
|
206
|
-
this.removeEventListener("click", this.clickPopover);
|
|
207
|
-
if (this.trigger.includes("hover")) {
|
|
208
|
-
this.addEventListener("mouseenter", this.hoverPopover);
|
|
209
|
-
this.addEventListener("mouseleave", this.blur);
|
|
210
|
-
}
|
|
211
|
-
this.addEventListener("click", this.clickPopover);
|
|
212
|
-
});
|
|
213
|
-
__publicField(this, "hoverRemovePopover", (e) => {
|
|
214
|
-
e.stopPropagation();
|
|
215
|
-
this.setDropdownDisplayNone();
|
|
216
|
-
});
|
|
217
|
-
__publicField(this, "changePlacement", () => {
|
|
218
|
-
var _a;
|
|
219
|
-
if (this.placement) {
|
|
220
|
-
const arrow = this.placement === "bottom" ? "top" : "bottom";
|
|
221
|
-
(_a = this.popoverContent) == null ? void 0 : _a.setAttribute("arrow", arrow);
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
this._slot = document.createElement("slot");
|
|
225
|
-
this._slot.setAttribute("class", "slot");
|
|
226
|
-
this.popoverBlock = document.createElement("div");
|
|
227
|
-
this.popoverBlock.setAttribute("class", "ran-popover-block");
|
|
228
|
-
this.popoverBlock.setAttribute("role", "tooltip");
|
|
229
|
-
this.popoverBlock.appendChild(this._slot);
|
|
230
|
-
const shadowRoot = this.attachShadow({ mode: "closed" });
|
|
231
|
-
const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
|
|
232
|
-
F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc;
|
|
233
|
-
shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
|
|
234
|
-
this._shadowDom = shadowRoot;
|
|
235
|
-
shadowRoot.appendChild(this.popoverBlock);
|
|
236
|
-
}
|
|
237
|
-
static get observedAttributes() {
|
|
238
|
-
return ["placement", "arrow", "trigger"];
|
|
239
|
-
}
|
|
240
|
-
get placement() {
|
|
241
|
-
return this.getAttribute("placement") || "top";
|
|
242
|
-
}
|
|
243
|
-
set placement(value) {
|
|
244
|
-
this.setAttribute("placement", value);
|
|
245
|
-
}
|
|
246
|
-
get arrow() {
|
|
247
|
-
return this.getAttribute("arrow") || "";
|
|
248
|
-
}
|
|
249
|
-
set arrow(value) {
|
|
250
|
-
this.setAttribute("arrow", value);
|
|
251
|
-
}
|
|
252
|
-
get trigger() {
|
|
253
|
-
return this.getAttribute("trigger") || "hover";
|
|
254
|
-
}
|
|
255
|
-
set trigger(value) {
|
|
256
|
-
this.setAttribute("trigger", value);
|
|
257
|
-
}
|
|
258
|
-
get getPopupContainerId() {
|
|
259
|
-
return this.getAttribute("getPopupContainerId") || "";
|
|
260
|
-
}
|
|
261
|
-
set getPopupContainerId(value) {
|
|
262
|
-
this.setAttribute("getPopupContainerId", value);
|
|
263
|
-
}
|
|
264
|
-
connectedCallback() {
|
|
265
|
-
for (const element of this.children) {
|
|
266
|
-
if (element.tagName === "R-CONTENT") {
|
|
267
|
-
element.addEventListener("change", this.watchContent);
|
|
268
|
-
this.createContent(element.children);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
this.popoverTrigger();
|
|
272
|
-
this.changePlacement();
|
|
273
|
-
document.addEventListener("click", this.clickRemovePopover);
|
|
274
|
-
}
|
|
275
|
-
disconnectCallback() {
|
|
276
|
-
this.removeEventListener("mouseenter", this.hoverPopover);
|
|
277
|
-
this.removeEventListener("mouseleave", this.hoverRemovePopover);
|
|
278
|
-
this.removeEventListener("click", this.hoverPopover);
|
|
279
|
-
document.removeEventListener("click", this.clickRemovePopover);
|
|
280
|
-
}
|
|
281
|
-
attributeChangedCallback(n, o, v) {
|
|
282
|
-
if (o !== v) {
|
|
283
|
-
if (n === "trigger") {
|
|
284
|
-
this.popoverTrigger();
|
|
285
|
-
}
|
|
286
|
-
if (n === "placement") {
|
|
287
|
-
this.changePlacement();
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
function Custom() {
|
|
293
|
-
if (typeof document !== "undefined" && !customElements.get("r-popover")) {
|
|
294
|
-
customElements.define("r-popover", Popover);
|
|
295
|
-
return Popover;
|
|
296
|
-
} else {
|
|
297
|
-
return createCustomError("document is undefined or r-popover is exist");
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
const index = Custom();
|
|
301
|
-
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
302
|
-
__proto__: null,
|
|
303
|
-
Popover,
|
|
304
|
-
default: index
|
|
305
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
306
|
-
export {
|
|
307
|
-
Popover as P,
|
|
308
|
-
index as a,
|
|
309
|
-
index$1 as i
|
|
310
|
-
};
|