ranui 0.1.10-alpha.7 → 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 +369 -0
- 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 -116
- 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 +9 -9
- package/dist/typings.d.ts +163 -116
- 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 +138 -74
- package/typings.d.ts +163 -116
- package/dist/_commonjs-dynamic-modules-DLbDWi6a.js +0 -12
- package/dist/add-user-BN1JlY7e.js +0 -4
- package/dist/arrow-down-Beig7FXI.js +0 -652
- 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-BZR0HaP2.js +0 -40
- package/dist/index-Bl6-5Hp8.js +0 -63701
- package/dist/index-C0Xh8vJ3.js +0 -146
- package/dist/index-C4Sv0T51.js +0 -495
- package/dist/index-CGEx9VOA.js +0 -17106
- package/dist/index-CILRcFIV.js +0 -100
- package/dist/index-CQTJoWhb.js +0 -19
- package/dist/index-CWNtaUwu.js +0 -308
- package/dist/index-CjSKJE6S.js +0 -158
- package/dist/index-Ck9TOxFh.js +0 -279
- package/dist/index-CryFK9u4.js +0 -320
- package/dist/index-D4twPONc.js +0 -187
- package/dist/index-D83djTVa.js +0 -659
- package/dist/index-DAxs7Dd2.js +0 -119
- package/dist/index-DBecKjmY.js +0 -279
- package/dist/index-DC5EA657.js +0 -91
- package/dist/index-DHTzB_6b.js +0 -9575
- package/dist/index-DL-1C2RQ.js +0 -496
- package/dist/index-DN-kAx-A.js +0 -72
- package/dist/index-TlwIh-o2.js +0 -306
- package/dist/index-WfFw4LJT.js +0 -490
- package/dist/index-lLO-8KJ1.js +0 -204
- package/dist/index-oD-_YELB.js +0 -511
- package/dist/index-qvcQTV5_.js +0 -105
- 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 -176
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
import { S as I, c as b, d as w, g as u, l as r, m as D, p as a, s as m, u as h, v as S } from "./utils-D4pPF77E.js";
|
|
2
|
+
import { t as k } from "./events-C59wGdni.js";
|
|
3
|
+
import { _ as v, i as n, m as C, p as g, s as O } from "./factory-BdsO0dEW.js";
|
|
4
|
+
import { a as f, n as _ } from "./ssr-DSGwPtEd.js";
|
|
5
|
+
import { n as E } from "./icon-DmoEnao5.js";
|
|
6
|
+
import "./input-DoraIb3x.js";
|
|
7
|
+
import "./dropdown-C5362qTy.js";
|
|
8
|
+
var T = '.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, #1890ff))}: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, #1890ff))}: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, #d9d9d9));transition:var(--ran-select-selection-transition, all0 .2s cubic-bezier(.645, .045, .355, 1));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)}', L = {
|
|
9
|
+
success: !0,
|
|
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 _ {
|
|
17
|
+
_option;
|
|
18
|
+
_optionContent;
|
|
19
|
+
_shadowDom;
|
|
20
|
+
_slot;
|
|
21
|
+
static get observedAttributes() {
|
|
22
|
+
return [
|
|
23
|
+
"disabled",
|
|
24
|
+
"sheet",
|
|
25
|
+
"value"
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
constructor() {
|
|
29
|
+
super(), this._shadowDom = b(this);
|
|
30
|
+
const e = m(this._shadowDom, ".ran-select-dropdown-option", () => {
|
|
31
|
+
const i = g().build(), s = n().class("ran-select-dropdown-option-content").children(i).build();
|
|
32
|
+
return n().class("ran-select-dropdown-option").children(s).build();
|
|
33
|
+
}), t = e.querySelector(".ran-select-dropdown-option-content"), o = e.querySelector("slot");
|
|
34
|
+
this._slot = o, this._optionContent = t, this._option = e;
|
|
35
|
+
}
|
|
36
|
+
get value() {
|
|
37
|
+
return this.getAttribute("value");
|
|
38
|
+
}
|
|
39
|
+
set value(e) {
|
|
40
|
+
h(this, "value", e);
|
|
41
|
+
}
|
|
42
|
+
get sheet() {
|
|
43
|
+
return this.getAttribute("sheet");
|
|
44
|
+
}
|
|
45
|
+
set sheet(e) {
|
|
46
|
+
h(this, "sheet", e);
|
|
47
|
+
}
|
|
48
|
+
get disabled() {
|
|
49
|
+
return a(this);
|
|
50
|
+
}
|
|
51
|
+
set disabled(e) {
|
|
52
|
+
!e || e === "false" ? this.removeAttribute("disabled") : this.setAttribute("disabled", "");
|
|
53
|
+
}
|
|
54
|
+
handlerExternalCss() {
|
|
55
|
+
w(this, this._shadowDom, "sheet", null, this.sheet);
|
|
56
|
+
}
|
|
57
|
+
connectedCallback() {
|
|
58
|
+
this.classList.contains("ran-option") || this.classList.add("ran-option");
|
|
59
|
+
}
|
|
60
|
+
attributeChangedCallback(e, t, o) {
|
|
61
|
+
t !== o && (e === "disabled" && this._option && (!o || o === "false" ? this._option.setAttribute("disabled", "") : this._option.removeAttribute("disabled")), e === "sheet" && this._shadowDom && this.handlerExternalCss());
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
f("r-option", P);
|
|
65
|
+
var B = '.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}.ranui-dropdown-option-item{position:var(--ran-dropdown-option-item-position, relative);display:var(--ran-dropdown-option-item-display, block);padding:var(--ran-dropdown-option-item-padding, 5px 12px);color:var(--ran-dropdown-option-item-color, var(--ran-color-text, rgba(0, 0, 0, .88)));font-weight:var(--ran-dropdown-option-item-font-weight, normal);font-size:var(--ran-dropdown-option-item-font-size, 14px);transition:var(--ran-dropdown-option-item-transition, background var(--ran-motion-duration-base, .2s) ease);border-radius:var(--ran-dropdown-option-item-border-radius, var(--ran-radius-sm, 6px));cursor:var(--ran-dropdown-option-item-cursor, pointer)}.ranui-dropdown-option-item:hover{background-color:var(--ran-dropdown-option-item-hover-background-color, var(--ran-gray-alpha-100, rgba(0, 0, 0, .04)))}.ranui-dropdown-option-item-content{text-align:var(--ran-dropdown-option-item-content-text-align, left);overflow:var(--ran-dropdown-option-item-content-overflow, hidden);white-space:var(--ran-dropdown-option-item-content-white-space, nowrap);text-overflow:var(--ran-dropdown-option-item-content-text-overflow, ellipsis);color:var(--ran-dropdown-option-item-content-color, var(--ran-color-text, rgba(0, 0, 0, .88)));font-size:var(--ran-dropdown-option-item-content-font-size, 14px);line-height:var(--ran-dropdown-option-item-content-line-height, 1.57142857);box-sizing:var(--ran-dropdown-option-item-content-box-sizing, border-box);list-style:var(--ran-dropdown-option-item-content-list-style, none);font-family:var(--ran-dropdown-option-item-content-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");font-variant:var(--ran-dropdown-option-item-content-font-variant, initial)}.ranui-dropdown-option-active{background-color:var(--ran-dropdown-option-active-background-color, var(--ran-blue-100, #e6f7ff));font-weight:var(--ran-dropdown-option-active-font-weight, bold)}.ranui-dropdown-option-active:hover{background-color:var(--ran-dropdown-option-active-hover-background-color, var(--ran-blue-100, #e6f7ff))}', M = class extends _ {
|
|
66
|
+
ionDropdownItem;
|
|
67
|
+
_slot;
|
|
68
|
+
_shadowDom;
|
|
69
|
+
ionDropdownItemContent;
|
|
70
|
+
static get observedAttributes() {
|
|
71
|
+
return [
|
|
72
|
+
"active",
|
|
73
|
+
"value",
|
|
74
|
+
"title",
|
|
75
|
+
"sheet"
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
constructor() {
|
|
79
|
+
super(), this._shadowDom = b(this, B);
|
|
80
|
+
const e = m(this._shadowDom, ".ranui-dropdown-option-item", () => {
|
|
81
|
+
const i = g().class("slot").build(), s = n().class("ranui-dropdown-option-item-content").part("content").children(i).build();
|
|
82
|
+
return n().class("ranui-dropdown-option-item").part("item").children(s).build();
|
|
83
|
+
}), t = e.querySelector(".ranui-dropdown-option-item-content"), o = e.querySelector("slot");
|
|
84
|
+
this._slot = o, this.ionDropdownItemContent = t, this.ionDropdownItem = e;
|
|
85
|
+
}
|
|
86
|
+
get value() {
|
|
87
|
+
return r(this, "value");
|
|
88
|
+
}
|
|
89
|
+
set value(e) {
|
|
90
|
+
!a(this) && e ? this.setAttribute("value", e) : this.removeAttribute("value");
|
|
91
|
+
}
|
|
92
|
+
get active() {
|
|
93
|
+
return r(this, "active");
|
|
94
|
+
}
|
|
95
|
+
set active(e) {
|
|
96
|
+
e ? this.setAttribute("active", e) : this.removeAttribute("active");
|
|
97
|
+
}
|
|
98
|
+
get title() {
|
|
99
|
+
return r(this, "title");
|
|
100
|
+
}
|
|
101
|
+
set title(e) {
|
|
102
|
+
e ? this.setAttribute("title", e) : this.removeAttribute("title");
|
|
103
|
+
}
|
|
104
|
+
get sheet() {
|
|
105
|
+
return r(this, "sheet");
|
|
106
|
+
}
|
|
107
|
+
set sheet(e) {
|
|
108
|
+
h(this, "sheet", e);
|
|
109
|
+
}
|
|
110
|
+
handlerExternalCss = () => {
|
|
111
|
+
w(this, this._shadowDom, "sheet", null, this.sheet);
|
|
112
|
+
};
|
|
113
|
+
connectedCallback() {
|
|
114
|
+
this.handlerExternalCss(), this.active && D(this.ionDropdownItem, "ranui-dropdown-option-active");
|
|
115
|
+
}
|
|
116
|
+
attributeChangedCallback(e, t, o) {
|
|
117
|
+
if (e === "sheet") {
|
|
118
|
+
this.handlerExternalCss();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
e === "active" && o ? D(this.ionDropdownItem, "ranui-dropdown-option-active") : S(this.ionDropdownItem, "ranui-dropdown-option-active");
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
f("r-dropdown-item", M);
|
|
125
|
+
var x = {
|
|
126
|
+
bottom: {
|
|
127
|
+
add: "ran-dropdown-down-in",
|
|
128
|
+
remove: "ran-dropdown-down-out"
|
|
129
|
+
},
|
|
130
|
+
top: {
|
|
131
|
+
add: "ran-dropdown-up-in",
|
|
132
|
+
remove: "ran-dropdown-up-out"
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
E("arrow-down", L);
|
|
136
|
+
var V = I(), A = 300, z = class extends _ {
|
|
137
|
+
static formAssociated = !0;
|
|
138
|
+
_internals;
|
|
139
|
+
_events = new k();
|
|
140
|
+
removeTimeId;
|
|
141
|
+
_listboxId;
|
|
142
|
+
_activeIndex;
|
|
143
|
+
_slot;
|
|
144
|
+
_shadowDom;
|
|
145
|
+
_select;
|
|
146
|
+
_selection;
|
|
147
|
+
_search;
|
|
148
|
+
_icon;
|
|
149
|
+
_selectDropdown;
|
|
150
|
+
_selectionDropdown;
|
|
151
|
+
_selectDropDownInTimeId;
|
|
152
|
+
_selectDropDownOutTimeId;
|
|
153
|
+
_optionList;
|
|
154
|
+
_optionLabelMapValue;
|
|
155
|
+
_optionValueMapLabel;
|
|
156
|
+
_activeOption;
|
|
157
|
+
_text;
|
|
158
|
+
_selector;
|
|
159
|
+
onSearch;
|
|
160
|
+
static get observedAttributes() {
|
|
161
|
+
return [
|
|
162
|
+
"disabled",
|
|
163
|
+
"sheet",
|
|
164
|
+
"clear",
|
|
165
|
+
"type",
|
|
166
|
+
"value",
|
|
167
|
+
"defaultValue",
|
|
168
|
+
"showSearch",
|
|
169
|
+
"placement",
|
|
170
|
+
"getPopupContainerId",
|
|
171
|
+
"dropdownclass",
|
|
172
|
+
"trigger"
|
|
173
|
+
];
|
|
174
|
+
}
|
|
175
|
+
constructor() {
|
|
176
|
+
super();
|
|
177
|
+
try {
|
|
178
|
+
this._internals = this.attachInternals();
|
|
179
|
+
} catch {
|
|
180
|
+
this._internals = void 0;
|
|
181
|
+
}
|
|
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 = b(this, T);
|
|
183
|
+
const e = m(this._shadowDom, ".ran-select", () => n().class("ran-select").part("select").children(n().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"), n().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
|
+
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
|
+
}
|
|
186
|
+
get value() {
|
|
187
|
+
return this.getAttribute("value") || "";
|
|
188
|
+
}
|
|
189
|
+
set value(e) {
|
|
190
|
+
!a(this) && e ? this.setAttribute("value", e) : this.removeAttribute("value"), this.syncFormValue();
|
|
191
|
+
}
|
|
192
|
+
syncFormValue = () => {
|
|
193
|
+
this._internals?.setFormValue?.(this.value);
|
|
194
|
+
};
|
|
195
|
+
get defaultValue() {
|
|
196
|
+
return this.getAttribute("defaultValue") || "";
|
|
197
|
+
}
|
|
198
|
+
set defaultValue(e) {
|
|
199
|
+
this.setAttribute("defaultValue", e || "");
|
|
200
|
+
}
|
|
201
|
+
get showSearch() {
|
|
202
|
+
return this.getAttribute("showSearch") || "";
|
|
203
|
+
}
|
|
204
|
+
set showSearch(e) {
|
|
205
|
+
this.setAttribute("showSearch", e || "");
|
|
206
|
+
}
|
|
207
|
+
get type() {
|
|
208
|
+
return this.getAttribute("type") || "";
|
|
209
|
+
}
|
|
210
|
+
set type(e) {
|
|
211
|
+
this.setAttribute("type", e || "");
|
|
212
|
+
}
|
|
213
|
+
get placement() {
|
|
214
|
+
return this.getAttribute("placement") || "bottom";
|
|
215
|
+
}
|
|
216
|
+
set placement(e) {
|
|
217
|
+
this.setAttribute("placement", e || "");
|
|
218
|
+
}
|
|
219
|
+
get sheet() {
|
|
220
|
+
return r(this, "sheet");
|
|
221
|
+
}
|
|
222
|
+
set sheet(e) {
|
|
223
|
+
h(this, "sheet", e);
|
|
224
|
+
}
|
|
225
|
+
get getPopupContainerId() {
|
|
226
|
+
return this.getAttribute("getPopupContainerId") || "";
|
|
227
|
+
}
|
|
228
|
+
set getPopupContainerId(e) {
|
|
229
|
+
this.setAttribute("getPopupContainerId", e || "");
|
|
230
|
+
}
|
|
231
|
+
get dropdownclass() {
|
|
232
|
+
return this.getAttribute("dropdownclass") || "";
|
|
233
|
+
}
|
|
234
|
+
set dropdownclass(e) {
|
|
235
|
+
this.setAttribute("dropdownclass", e || "");
|
|
236
|
+
}
|
|
237
|
+
get trigger() {
|
|
238
|
+
return this.getAttribute("trigger") || "click";
|
|
239
|
+
}
|
|
240
|
+
set trigger(e) {
|
|
241
|
+
this.setAttribute("trigger", e || "");
|
|
242
|
+
}
|
|
243
|
+
get disabled() {
|
|
244
|
+
return a(this);
|
|
245
|
+
}
|
|
246
|
+
set disabled(e) {
|
|
247
|
+
!e || e === "false" ? (this.removeAttribute("disabled"), this._selection.removeAttribute("disabled"), this.removeAttribute("aria-disabled"), this.tabIndex = 0) : (this.setAttribute("disabled", ""), this._selection.setAttribute("disabled", ""), this.setAttribute("aria-disabled", "true"), this.tabIndex = -1);
|
|
248
|
+
}
|
|
249
|
+
initAria = () => {
|
|
250
|
+
this.hasAttribute("tabindex") || (this.tabIndex = 0), this.setAttribute("role", "combobox"), this.setAttribute("aria-haspopup", "listbox"), this.setAttribute("aria-controls", this._listboxId), this.setAttribute("aria-expanded", "false"), this.setAttribute("aria-disabled", this.disabled ? "true" : "false");
|
|
251
|
+
};
|
|
252
|
+
updateAriaExpanded = (e) => {
|
|
253
|
+
this.setAttribute("aria-expanded", e ? "true" : "false");
|
|
254
|
+
};
|
|
255
|
+
getDropdownOptions = () => this._selectionDropdown ? Array.from(this._selectionDropdown.querySelectorAll("r-dropdown-item")) : [];
|
|
256
|
+
syncActiveState = () => {
|
|
257
|
+
this.getDropdownOptions().forEach((e, t) => {
|
|
258
|
+
e.setAttribute("role", "option"), e.setAttribute("aria-selected", e === this._activeOption ? "true" : "false"), e.id || (e.id = `${this._listboxId}-option-${t}`);
|
|
259
|
+
}), this._activeOption?.id ? this.setAttribute("aria-activedescendant", this._activeOption.id) : this.removeAttribute("aria-activedescendant");
|
|
260
|
+
};
|
|
261
|
+
setActiveOptionByIndex = (e) => {
|
|
262
|
+
const t = this.getDropdownOptions();
|
|
263
|
+
if (t.length === 0) return;
|
|
264
|
+
const o = Math.max(0, Math.min(e, t.length - 1)), i = t[o];
|
|
265
|
+
if (!i) return;
|
|
266
|
+
this._activeOption && this._activeOption !== i && (this._activeOption.removeAttribute("active"), this._activeOption.setAttribute("aria-selected", "false")), this._activeIndex = o, this._activeOption = i;
|
|
267
|
+
const s = i.getAttribute("value") || "";
|
|
268
|
+
i.setAttribute("active", s), i.setAttribute("aria-selected", "true"), i.scrollIntoView({ block: "nearest" }), this.syncActiveState();
|
|
269
|
+
};
|
|
270
|
+
selectOptionElement = (e, t = !0) => {
|
|
271
|
+
if (!e) return;
|
|
272
|
+
const o = e.getAttribute("title") || e.textContent?.trim() || "", i = e.getAttribute("value") || this._optionLabelMapValue.get(o) || "";
|
|
273
|
+
if (!i) return;
|
|
274
|
+
this.setAttribute("value", i), this.syncFormValue(), this._text.textContent = o, this._text.setAttribute("title", o), this._search.setAttribute("placeholder", o);
|
|
275
|
+
const { height: s } = this.getBoundingClientRect();
|
|
276
|
+
this._text.style.setProperty("line-height", `${s}px`), this._activeOption && this._activeOption !== e && (this._activeOption.removeAttribute("active"), this._activeOption.setAttribute("aria-selected", "false")), this._activeOption = e, this._activeIndex = this.getDropdownOptions().findIndex((l) => l === e), e.setAttribute("active", i), e.setAttribute("aria-selected", "true"), this.syncActiveState(), this.setSelectDropdownDisplayNone(), t && this.dispatchEvent(new CustomEvent("change", { detail: {
|
|
277
|
+
value: i,
|
|
278
|
+
label: o
|
|
279
|
+
} }));
|
|
280
|
+
};
|
|
281
|
+
isDropdownOpen = () => this._selectionDropdown ? this._selectionDropdown.style.display === "block" : !1;
|
|
282
|
+
keydownSelect = (e) => {
|
|
283
|
+
if (!this.disabled) {
|
|
284
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
285
|
+
if (e.preventDefault(), this.isDropdownOpen() || this.selectMouseDown(e), this.getDropdownOptions().length === 0) return;
|
|
286
|
+
const t = e.key === "ArrowDown" ? 1 : -1, o = this._activeIndex >= 0 ? this._activeIndex : 0;
|
|
287
|
+
this.setActiveOptionByIndex(o + t);
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
291
|
+
if (e.preventDefault(), !this.isDropdownOpen()) {
|
|
292
|
+
this.selectMouseDown(e);
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
this._activeOption && this.selectOptionElement(this._activeOption);
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
e.key === "Escape" && (e.preventDefault(), this.setSelectDropdownDisplayNone());
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
handlerExternalCss() {
|
|
302
|
+
w(this, this._shadowDom, "sheet", null, this.sheet);
|
|
303
|
+
}
|
|
304
|
+
setSelectDropdownDisplayNone = () => {
|
|
305
|
+
this._selectDropDownOutTimeId || (this.updateAriaExpanded(!1), this._selectionDropdown && this._selectionDropdown.style.display !== "none" && (this._detachReposition(), this._selectionDropdown.setAttribute("transit", x[this.placement].remove), this._selectDropDownOutTimeId = setTimeout(() => {
|
|
306
|
+
this._selectionDropdown?.style.setProperty("display", "none"), this._selectionDropdown && this._selectionDropdown.removeAttribute("transit"), clearTimeout(this._selectDropDownOutTimeId), this._selectDropDownOutTimeId = void 0;
|
|
307
|
+
}, A)));
|
|
308
|
+
};
|
|
309
|
+
setSelectDropdownDisplayBlock = () => {
|
|
310
|
+
this._selectDropDownInTimeId || (this.updateAriaExpanded(!0), this._selectionDropdown && this._selectionDropdown.style.display !== "block" && (this._selectionDropdown.setAttribute("transit", x[this.placement].add), this._selectionDropdown?.style.setProperty("display", "block"), this._attachReposition(), this._selectDropDownInTimeId = setTimeout(() => {
|
|
311
|
+
this._selectionDropdown && this._selectionDropdown.removeAttribute("transit"), clearTimeout(this._selectDropDownInTimeId), this._selectDropDownInTimeId = void 0;
|
|
312
|
+
}, A)));
|
|
313
|
+
};
|
|
314
|
+
placementPosition = () => {
|
|
315
|
+
!this._selectionDropdown || !this._selectDropdown || requestAnimationFrame(() => {
|
|
316
|
+
if (!this._selectionDropdown || !this._selectDropdown) return;
|
|
317
|
+
const { top: e, left: t, bottom: o, width: i } = this.getBoundingClientRect(), s = this.getRootNode(), l = (s.getElementById ? s.getElementById(this.getPopupContainerId) : null) || document.getElementById(this.getPopupContainerId);
|
|
318
|
+
this._selectionDropdown.style.setProperty("position", "absolute"), this._selectionDropdown.style.setProperty("--ran-x", `${e + window.scrollX}`), this._selectionDropdown.style.setProperty("--ran-y", `${t + window.scrollY}`);
|
|
319
|
+
const c = 4;
|
|
320
|
+
let d = o + window.scrollY + c, y = t + window.scrollX;
|
|
321
|
+
if (this._selectionDropdown.style.setProperty("width", `${i}px`), this.placement === "top" && (d = e + window.scrollY - this._selectionDropdown.clientHeight - c), this.getPopupContainerId && l) {
|
|
322
|
+
const p = l.getBoundingClientRect();
|
|
323
|
+
y = t - p.left, this.placement === "top" ? d = e - p.top - this._selectionDropdown.clientHeight - c : d = o - p.top + c;
|
|
324
|
+
}
|
|
325
|
+
this._selectionDropdown.style.setProperty("inset", `${d}px auto auto ${y}px`);
|
|
326
|
+
});
|
|
327
|
+
};
|
|
328
|
+
_repositionBound = !1;
|
|
329
|
+
_repositionDropdown = () => {
|
|
330
|
+
this._selectionDropdown?.style.display === "block" && this.placementPosition();
|
|
331
|
+
};
|
|
332
|
+
_attachReposition = () => {
|
|
333
|
+
this._repositionBound || typeof window > "u" || (window.addEventListener("scroll", this._repositionDropdown, !0), window.addEventListener("resize", this._repositionDropdown), this._repositionBound = !0);
|
|
334
|
+
};
|
|
335
|
+
_detachReposition = () => {
|
|
336
|
+
!this._repositionBound || typeof window > "u" || (window.removeEventListener("scroll", this._repositionDropdown, !0), window.removeEventListener("resize", this._repositionDropdown), this._repositionBound = !1);
|
|
337
|
+
};
|
|
338
|
+
selectMouseDown = (e) => {
|
|
339
|
+
e.stopPropagation(), !a(this) && (this.removeDropDownTimeId(e), this.setSelectDropdownDisplayNone(), this.setSelectDropdownDisplayBlock(), this.placementPosition());
|
|
340
|
+
};
|
|
341
|
+
removeDropDownTimeId = (e) => {
|
|
342
|
+
e.stopPropagation(), this._search.setAttribute("value", ""), this.trigger.includes("hover") && !u() && (clearTimeout(this.removeTimeId), this.removeTimeId = void 0);
|
|
343
|
+
};
|
|
344
|
+
selectBlur = (e) => {
|
|
345
|
+
e.stopPropagation(), this.removeTimeId && this.removeDropDownTimeId(e), this.removeTimeId = setTimeout(() => {
|
|
346
|
+
this.removeDropDownTimeId(e), this.setSelectDropdownDisplayNone();
|
|
347
|
+
}, 300);
|
|
348
|
+
};
|
|
349
|
+
clickOption = (e) => {
|
|
350
|
+
e.stopPropagation();
|
|
351
|
+
const t = e.target.closest("r-dropdown-item");
|
|
352
|
+
this.selectOptionElement(t), this.removeDropDownTimeId(e);
|
|
353
|
+
};
|
|
354
|
+
createOption = () => {
|
|
355
|
+
if (!this._selectDropdown) {
|
|
356
|
+
const e = this.getRootNode(), t = (e.getElementById ? e.getElementById(this.getPopupContainerId) : null) || document.getElementById(this.getPopupContainerId) || document.body;
|
|
357
|
+
this._selectDropdown = n().style("-webkit-tap-highlight-color", "transparent").style("outline", "0").on("click", this.clickOption).build(), this._selectionDropdown = v("r-dropdown").id(this._listboxId).attr("role", "listbox").style("position", "absolute").style("display", "none").build(), this.dropdownclass && this._selectionDropdown.setAttribute("class", this.dropdownclass), this.trigger.includes("hover") && !u() && (this._selectDropdown.addEventListener("mouseleave", this.selectBlur), this._selectDropdown.addEventListener("mouseenter", this.removeDropDownTimeId)), this._selectDropdown.appendChild(this._selectionDropdown), t.appendChild(this._selectDropdown);
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
removeSelectDropdown = () => {
|
|
361
|
+
try {
|
|
362
|
+
if (this._selectDropdown) {
|
|
363
|
+
const e = this.getRootNode(), t = (e.getElementById ? e.getElementById(this.getPopupContainerId) : null) || document.getElementById(this.getPopupContainerId) || document.body;
|
|
364
|
+
t && this._selectDropdown.parentNode === t && t.removeChild(this._selectDropdown);
|
|
365
|
+
}
|
|
366
|
+
} catch (e) {
|
|
367
|
+
console.error("removeSelectDropdown error", e);
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
addOptionToSlot = () => {
|
|
371
|
+
this._optionList = [], this._optionLabelMapValue.clear(), this._optionValueMapLabel.clear(), this._slot.assignedElements().forEach((e) => {
|
|
372
|
+
if (e.tagName !== "R-OPTION") return;
|
|
373
|
+
const t = e.innerHTML, o = e.getAttribute("value") || "";
|
|
374
|
+
this._optionList?.push({
|
|
375
|
+
label: t,
|
|
376
|
+
value: o
|
|
377
|
+
}), this._optionLabelMapValue.get(t) && console.warn(`${t} is repeat option`), this._optionValueMapLabel.get(o) && console.warn(`${o} is repeat option`), this._optionLabelMapValue.set(t, o), this._optionValueMapLabel.set(o, t);
|
|
378
|
+
}), this.createSelectDropdownContent(this._optionList);
|
|
379
|
+
};
|
|
380
|
+
createSelectDropdownContent = (e = []) => {
|
|
381
|
+
e.length === 0 ? this._selectDropdown?.style.setProperty("display", "none") : this._selectDropdown?.style.setProperty("display", "block"), this._selectionDropdown && (this._selectionDropdown.innerHTML = "", this._activeOption = void 0, this._activeIndex = -1), e.forEach((t) => {
|
|
382
|
+
if (this._selectionDropdown) {
|
|
383
|
+
const { label: o, value: i } = t, s = v("r-dropdown-item").attr("role", "option").attr("value", `${i}`).attr("title", `${o}`).text(`${o}`).build();
|
|
384
|
+
(this.getAttribute("defaultValue") || this.getAttribute("value")) === i ? (s.setAttribute("active", i), this._activeOption = s) : s.removeAttribute("active"), this._selectionDropdown.appendChild(s);
|
|
385
|
+
}
|
|
386
|
+
}), this._activeIndex = this.getDropdownOptions().findIndex((t) => t === this._activeOption), this.syncActiveState(), this.setDefaultValue();
|
|
387
|
+
};
|
|
388
|
+
setDefaultValue = () => {
|
|
389
|
+
const e = this.getAttribute("defaultValue") || this.getAttribute("value");
|
|
390
|
+
if (!e) return;
|
|
391
|
+
const t = this._optionValueMapLabel.get(e);
|
|
392
|
+
if (!t) return;
|
|
393
|
+
this.setAttribute("value", e);
|
|
394
|
+
const { height: o } = this.getBoundingClientRect();
|
|
395
|
+
this._text.style.setProperty("line-height", `${o}px`), this._text.textContent = t, this._text.setAttribute("title", t);
|
|
396
|
+
const i = this.getDropdownOptions().find((s) => s.getAttribute("value") === e) || null;
|
|
397
|
+
i && this.selectOptionElement(i, !1);
|
|
398
|
+
};
|
|
399
|
+
changeSearch = (e) => {
|
|
400
|
+
const t = e.detail.value || "";
|
|
401
|
+
if (this.dispatchEvent(new CustomEvent("search", { detail: { value: t } })), this._selectionDropdown && (this._selectionDropdown.innerHTML = ""), t.length > 0) {
|
|
402
|
+
const o = this._optionList.map((i) => {
|
|
403
|
+
const { label: s } = i;
|
|
404
|
+
if (`${s}`.toLowerCase().includes(t)) return {
|
|
405
|
+
label: s,
|
|
406
|
+
value: i.value
|
|
407
|
+
};
|
|
408
|
+
}).filter((i) => i);
|
|
409
|
+
this.createSelectDropdownContent(o);
|
|
410
|
+
} else this.createSelectDropdownContent(this._optionList);
|
|
411
|
+
};
|
|
412
|
+
clickRemoveSelect = (e) => {
|
|
413
|
+
e.stopPropagation(), this.setSelectDropdownDisplayNone();
|
|
414
|
+
};
|
|
415
|
+
connectedCallback() {
|
|
416
|
+
this.handlerExternalCss(), this.createOption(), this.initAria(), this.syncFormValue(), this._events.on(this._slot, "slotchange", this.addOptionToSlot).on(this, "keydown", this.keydownSelect).on(document, "click", this.clickRemoveSelect), this.trigger.includes("hover") && !u() && this._events.on(this, "mouseenter", this.selectMouseDown).on(this, "mouseleave", this.selectBlur), this.trigger.includes("click") && this._events.on(this, "click", this.selectMouseDown).on(this, "blur", this.selectBlur), this.showSearch && (this.onSearch = V(this.changeSearch), this.onSearch && this._events.on(this._search, "change", this.onSearch).on(this._search, "click", this.onSearch));
|
|
417
|
+
}
|
|
418
|
+
disconnectedCallback() {
|
|
419
|
+
this._events.abort(), this._detachReposition(), this.removeSelectDropdown();
|
|
420
|
+
}
|
|
421
|
+
attributeChangedCallback(e, t, o) {
|
|
422
|
+
t !== o && (e === "disabled" && this._select && (!o || o === "false" ? (this._select.removeAttribute("disabled"), this._selection.removeAttribute("disabled"), this.removeAttribute("aria-disabled"), this.hasAttribute("tabindex") || (this.tabIndex = 0)) : (this._select.setAttribute("disabled", ""), this._selection.setAttribute("disabled", ""), this.setAttribute("aria-disabled", "true"), this.tabIndex = -1)), e === "value" && this.syncSelectedFromValue(o), e === "sheet" && this._shadowDom && this.handlerExternalCss());
|
|
423
|
+
}
|
|
424
|
+
syncSelectedFromValue = (e) => {
|
|
425
|
+
if (!e || this._activeOption?.getAttribute("value") === e) return;
|
|
426
|
+
const t = Array.from(this.querySelectorAll("r-option")).find((o) => o.getAttribute("value") === e);
|
|
427
|
+
t && this.selectOptionElement(t, !1);
|
|
428
|
+
};
|
|
429
|
+
};
|
|
430
|
+
f("r-select", z);
|
|
431
|
+
export {
|
|
432
|
+
z as t
|
|
433
|
+
};
|
package/dist/select.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./arrow-down-Beig7FXI.js";
|
|
3
|
-
import "./index-DC5EA657.js";
|
|
4
|
-
import "./index-qvcQTV5_.js";
|
|
5
|
-
import "./index-Ck9TOxFh.js";
|
|
6
|
-
import "./index-C4Sv0T51.js";
|
|
1
|
+
import { t as e } from "./select-BmhCUTLb.js";
|
|
7
2
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
e as Select,
|
|
4
|
+
e as default
|
|
10
5
|
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var c = null, u = null, f = null;
|
|
2
|
+
function b(r, e) {
|
|
3
|
+
const s = e?.equals ?? Object.is;
|
|
4
|
+
let t = r;
|
|
5
|
+
const n = /* @__PURE__ */ new Set();
|
|
6
|
+
return [() => (c && u && (n.add(c), u.add(n)), t), (o) => {
|
|
7
|
+
const d = typeof o == "function" ? o(t) : o;
|
|
8
|
+
if (!s(t, d))
|
|
9
|
+
if (t = d, f) for (const a of n) f.add(a);
|
|
10
|
+
else for (const a of n) a();
|
|
11
|
+
}];
|
|
12
|
+
}
|
|
13
|
+
function p(r) {
|
|
14
|
+
let e, s = !1;
|
|
15
|
+
const t = /* @__PURE__ */ new Set(), n = () => {
|
|
16
|
+
if (s) return;
|
|
17
|
+
e?.();
|
|
18
|
+
for (const o of t) o.delete(n);
|
|
19
|
+
t.clear();
|
|
20
|
+
const l = c, i = u;
|
|
21
|
+
c = n, u = t;
|
|
22
|
+
try {
|
|
23
|
+
e = r() ?? void 0;
|
|
24
|
+
} finally {
|
|
25
|
+
c = l, u = i;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return n(), () => {
|
|
29
|
+
s = !0, e?.();
|
|
30
|
+
for (const l of t) l.delete(n);
|
|
31
|
+
t.clear();
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function v(r) {
|
|
35
|
+
const [e, s] = b(void 0);
|
|
36
|
+
return p(() => s(r())), e;
|
|
37
|
+
}
|
|
38
|
+
function S(r) {
|
|
39
|
+
if (f) {
|
|
40
|
+
r();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const e = /* @__PURE__ */ new Set();
|
|
44
|
+
f = e;
|
|
45
|
+
try {
|
|
46
|
+
r();
|
|
47
|
+
} finally {
|
|
48
|
+
f = null;
|
|
49
|
+
for (const s of e) s();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
b as i,
|
|
54
|
+
v as n,
|
|
55
|
+
p as r,
|
|
56
|
+
S as t
|
|
57
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { c as r, d as n, l as s, s as i, u as o } from "./utils-D4pPF77E.js";
|
|
2
|
+
import { i as l } from "./factory-BdsO0dEW.js";
|
|
3
|
+
import { a as h, n as d } from "./ssr-DSGwPtEd.js";
|
|
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
|
+
_div;
|
|
6
|
+
_shadowDom;
|
|
7
|
+
static get observedAttributes() {
|
|
8
|
+
return ["disabled", "sheet"];
|
|
9
|
+
}
|
|
10
|
+
constructor() {
|
|
11
|
+
super(), this._shadowDom = r(this, u), this._div = i(this._shadowDom, ".ran-skeleton", () => l().class("ran-skeleton").build());
|
|
12
|
+
}
|
|
13
|
+
get sheet() {
|
|
14
|
+
return s(this, "sheet");
|
|
15
|
+
}
|
|
16
|
+
set sheet(e) {
|
|
17
|
+
o(this, "sheet", e);
|
|
18
|
+
}
|
|
19
|
+
handlerExternalCss = () => {
|
|
20
|
+
n(this, this._shadowDom, "sheet", null, this.sheet);
|
|
21
|
+
};
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
this.handlerExternalCss();
|
|
24
|
+
}
|
|
25
|
+
attributeChangedCallback(e, t, a) {
|
|
26
|
+
t !== a && e === "sheet" && this.handlerExternalCss();
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
h("r-skeleton", m);
|
|
30
|
+
export {
|
|
31
|
+
m as t
|
|
32
|
+
};
|
package/dist/skeleton.js
CHANGED
package/dist/ssg.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { i as n } from "./ssr-DSGwPtEd.js";
|
|
2
|
+
import { clearSSGPath as o, setSSGPath as i, useRouter as S } from "./utils/router.js";
|
|
3
|
+
function c(t, r) {
|
|
4
|
+
i(r);
|
|
5
|
+
try {
|
|
6
|
+
return n(t);
|
|
7
|
+
} finally {
|
|
8
|
+
o();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function m(t, r) {
|
|
12
|
+
const a = S();
|
|
13
|
+
return (r?.paths ?? a?.getStaticPaths() ?? []).map((e) => ({
|
|
14
|
+
path: e,
|
|
15
|
+
html: c(t(), e)
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
m as generateStaticPages,
|
|
20
|
+
c as renderStaticPage
|
|
21
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { c as u, n as s } from "./mocks-CMGoftIc.js";
|
|
2
|
+
var n = /* @__PURE__ */ new Map();
|
|
3
|
+
function d(e, r) {
|
|
4
|
+
u ? (n.set(e, r), r.prototype._ssrTag = e) : customElements.get(e) || customElements.define(e, r);
|
|
5
|
+
}
|
|
6
|
+
function v(e) {
|
|
7
|
+
return n.get(e);
|
|
8
|
+
}
|
|
9
|
+
function l() {
|
|
10
|
+
return n;
|
|
11
|
+
}
|
|
12
|
+
var o = () => typeof document < "u" ? HTMLElement : s, E = o(), g = (e) => {
|
|
13
|
+
if (e.tagName && e.tagName !== "div") return e.tagName;
|
|
14
|
+
const r = l();
|
|
15
|
+
for (const [a, t] of r) if (e instanceof t) return a;
|
|
16
|
+
return e.constructor.name.toLowerCase();
|
|
17
|
+
}, c = (e) => {
|
|
18
|
+
if (!e) return "";
|
|
19
|
+
const r = g(e);
|
|
20
|
+
return typeof e.serialize == "function" || e instanceof s ? e.serialize(r) : "";
|
|
21
|
+
}, R = (e, r = {}, ...a) => {
|
|
22
|
+
const t = new s(e);
|
|
23
|
+
return Object.entries(r).forEach(([i, f]) => t.setAttribute(i, f)), a.forEach((i) => {
|
|
24
|
+
i && t.appendChild(i);
|
|
25
|
+
}), t.serialize();
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
d as a,
|
|
29
|
+
c as i,
|
|
30
|
+
E as n,
|
|
31
|
+
v as o,
|
|
32
|
+
R as r,
|
|
33
|
+
o as t
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { renderHTMLToString, renderToStream } from '@/utils/ssr-stream';
|