ranui 0.2.0-alpha.6 → 0.2.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -3
- package/README.zh-CN.md +40 -10
- package/dist/arrow-down-Bi5kqUrX.js +12 -0
- package/dist/builder.d.ts +2 -2
- package/dist/builder.js +32 -28
- package/dist/builtin-D9djWkCE.js +409 -0
- package/dist/{button-Be_uHDZG.js → button-BfYw0fes.js} +1 -1
- package/dist/button.js +1 -1
- package/dist/{card-BVvXX6KM.js → card-CqJa4Q_v.js} +1 -1
- package/dist/card.js +1 -1
- package/dist/{checkbox-BtoX9X2Z.js → checkbox-CThC9-vy.js} +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{colorpicker-Dukms7ET.js → colorpicker-XNxDRcQ-.js} +5 -6
- package/dist/colorpicker.js +1 -1
- package/dist/components/colorpicker/index.d.ts +3 -3
- package/dist/components/icon/builtin.d.ts +9 -0
- package/dist/components/icon/index.d.ts +8 -0
- package/dist/components/route/index.d.ts +10 -4
- package/dist/components/router/index.d.ts +3 -0
- package/dist/{dropdown-BYS1Trdu.js → dropdown-CCvsambb.js} +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/factory-DCrO37si.js +334 -0
- package/dist/{form-BsB5JhS4.js → form-Ceq3uJzz.js} +1 -1
- package/dist/form.js +1 -1
- package/dist/i18n.d.ts +2 -0
- package/dist/i18n.js +6 -0
- package/dist/{icon-pfolda2m.js → icon-C_ENrJ3F.js} +50 -13
- package/dist/icon.js +4 -3
- package/dist/icons.js +5 -0
- package/dist/iife/button.iife.js +1 -1
- package/dist/iife/card.iife.js +1 -1
- package/dist/iife/checkbox.iife.js +1 -1
- package/dist/iife/colorpicker.iife.js +2 -2
- package/dist/iife/dropdown.iife.js +1 -1
- package/dist/iife/form.iife.js +1 -1
- package/dist/iife/icon.iife.js +1 -1
- package/dist/iife/image.iife.js +1 -1
- package/dist/iife/input.iife.js +1 -1
- package/dist/iife/loading.iife.js +1 -1
- package/dist/iife/math.iife.js +14 -14
- package/dist/iife/message.iife.js +1 -1
- package/dist/iife/modal.iife.js +1 -1
- package/dist/iife/player.iife.js +8 -8
- package/dist/iife/popover.iife.js +1 -1
- package/dist/iife/progress.iife.js +1 -1
- package/dist/iife/radar.iife.js +1 -1
- package/dist/iife/route.iife.js +1 -1
- package/dist/iife/router.iife.js +1 -1
- package/dist/iife/scratch.iife.js +1 -1
- package/dist/iife/section.iife.js +1 -1
- package/dist/iife/select.iife.js +2 -2
- package/dist/iife/skeleton.iife.js +1 -1
- package/dist/iife/tab.iife.js +1 -1
- package/dist/iife/tabpane.iife.js +1 -1
- package/dist/{image-BXpKQ9sU.js → image-B7MBI5n_.js} +1 -1
- package/dist/image.js +1 -1
- package/dist/index.cjs +256 -23
- package/dist/index.d.ts +3 -1
- package/dist/index.iife.js +266 -33
- package/dist/index.js +79 -74
- package/dist/{input-BMMM60e6.js → input-RNqdEHPf.js} +2 -2
- package/dist/input.js +1 -1
- package/dist/{loading-BScjyeVm.js → loading-B9MFI03l.js} +1 -1
- package/dist/loading.js +1 -1
- package/dist/{math-IjzOAwnA.js → math-CudIwEXZ.js} +1 -1
- package/dist/math.js +1 -1
- package/dist/{message-CLpuP8HY.js → message-DW7qWpEm.js} +34 -49
- package/dist/message.js +1 -1
- package/dist/{modal-DOTpABRe.js → modal-CrvGKL2B.js} +1 -1
- package/dist/modal.js +1 -1
- package/dist/{player-5olrw-qB.js → player-BKQaaT7o.js} +2 -2
- package/dist/player.js +1 -1
- package/dist/{popover-DRUQjdPs.js → popover-CvYIVgUS.js} +2 -2
- package/dist/popover.js +1 -1
- package/dist/{progress-BIEXYYd2.js → progress-C6jctsFH.js} +1 -1
- package/dist/progress.js +1 -1
- package/dist/{radar-DAF95_Mj.js → radar-BUb4EzmG.js} +1 -1
- package/dist/radar.js +1 -1
- package/dist/route-Djrf9UR_.js +116 -0
- package/dist/route.js +1 -1
- package/dist/{router-B9rCrWXm.js → router-BU2KhtxV.js} +22 -17
- package/dist/router.js +1 -1
- package/dist/{scratch-QlPyy1f4.js → scratch-CO4I2dIa.js} +1 -1
- package/dist/scratch.js +1 -1
- package/dist/{section-D0qMm9KM.js → section-CsUkp8bv.js} +1 -1
- package/dist/section.js +1 -1
- package/dist/{select-aAaWoveE.js → select-Dn26ajJZ.js} +8 -15
- package/dist/select.js +1 -1
- package/dist/{skeleton-CFqQmKyt.js → skeleton-BuMLhvzQ.js} +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/{tab-CiF2YPck.js → tab-40fDkuox.js} +1 -1
- package/dist/tab.js +1 -1
- package/dist/{tabpane-B-m3xwqu.js → tabpane-F4Pd7JtC.js} +1 -1
- package/dist/tabpane.js +1 -1
- package/dist/test/unit/icon.builtin.test.d.ts +1 -0
- package/dist/test/unit/utils.colorpicker.reconnect.test.d.ts +1 -0
- package/dist/test/unit/utils.route.lazy.test.d.ts +1 -0
- package/dist/test/unit/utils.router.match.test.d.ts +1 -0
- package/dist/test/unit/utils.signal.owner.test.d.ts +1 -0
- package/dist/theme-kOWZbKCq.js +70 -0
- package/dist/theme-switch-B09egc6h.js +104 -0
- package/dist/theme-switch.js +1 -1
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +9 -0
- package/dist/utils/builder/core.d.ts +20 -13
- package/dist/utils/builder/factory.d.ts +1 -1
- package/dist/utils/builder/index.d.ts +2 -2
- package/dist/utils/builder/signal.d.ts +93 -64
- package/dist/utils/i18n/index.d.ts +17 -1
- package/dist/utils/i18n.js +16 -15
- package/dist/utils/router/index.d.ts +13 -3
- package/dist/utils/router.js +95 -54
- package/dist/utils/theme.d.ts +1 -1
- package/dist/warning-circle-fill-Cz0qu7AH.js +23 -0
- package/docs/BUILDER.md +230 -0
- package/docs/COMPONENTS.md +21 -3
- package/package.json +41 -3
- package/dist/factory-BdsO0dEW.js +0 -165
- package/dist/route-MQZpn2BP.js +0 -88
- package/dist/signal-CSSZxlK5.js +0 -57
- package/dist/theme-switch-B_FZvqBN.js +0 -170
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Registered names available after {@link registerBuiltinIcons} runs. */
|
|
2
|
+
export declare const BUILTIN_ICON_NAMES: string[];
|
|
3
|
+
/**
|
|
4
|
+
* Register every icon ranui ships (see `RAN_ICON_NAMES`) so `<r-icon name="…">`
|
|
5
|
+
* renders it. Idempotent; call once, in the browser, before the first `<r-icon>`
|
|
6
|
+
* connects. Import cost: the bundled SVG strings (~15 KB). To register only a
|
|
7
|
+
* subset, import the specific SVGs yourself and call `registerIcons` instead.
|
|
8
|
+
*/
|
|
9
|
+
export declare const registerBuiltinIcons: () => void;
|
|
@@ -4,6 +4,14 @@ import { EventManager } from '@/utils/builder';
|
|
|
4
4
|
export declare const registerIcon: (name: string, source: unknown) => void;
|
|
5
5
|
/** Batch register icons. */
|
|
6
6
|
export declare const registerIcons: (icons: Record<string, unknown>) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Names of the SVGs ranui ships in `assets/icons/`. This tuple is the source of
|
|
9
|
+
* truth for {@link RanIconName}; a unit test asserts it stays in sync with the
|
|
10
|
+
* asset folder, so adding/removing an SVG without updating this list fails CI.
|
|
11
|
+
*/
|
|
12
|
+
export declare const RAN_ICON_NAMES: readonly ['add-user', 'arrow-down', 'book', 'check-circle', 'check-circle-fill', 'close', 'close-circle', 'close-circle-fill', 'drop', 'eye', 'eye-close', 'github', 'globe', 'home', 'info-circle', 'info-circle-fill', 'issue', 'loading', 'loading-scene', 'lock', 'menu', 'message', 'more', 'plus', 'power-off', 'preview', 'search', 'setting', 'sort', 'team', 'unlock', 'user', 'warning-circle', 'warning-circle-fill', 'without-content'];
|
|
13
|
+
/** A name from ranui's bundled icon set (see {@link registerBuiltinIcons}). */
|
|
14
|
+
export type RanIconName = (typeof RAN_ICON_NAMES)[number];
|
|
7
15
|
export declare class Icon extends RanElement {
|
|
8
16
|
private readonly isDev;
|
|
9
17
|
_events: EventManager;
|
|
@@ -5,19 +5,25 @@ export declare class Route extends RanElement {
|
|
|
5
5
|
_events: EventManager;
|
|
6
6
|
_shadowDom: ShadowRoot;
|
|
7
7
|
_params: Record<string, string>;
|
|
8
|
+
private _mounted;
|
|
9
|
+
private _module;
|
|
10
|
+
private _disposePage;
|
|
11
|
+
private _pageHost;
|
|
12
|
+
private _mountToken;
|
|
8
13
|
constructor();
|
|
9
14
|
get path(): string;
|
|
10
15
|
set path(v: string);
|
|
11
16
|
get exact(): boolean;
|
|
17
|
+
/** Module specifier for lazy, code-split, mount/unmount page rendering. */
|
|
18
|
+
get src(): string;
|
|
19
|
+
set src(v: string);
|
|
12
20
|
get params(): Record<string, string>;
|
|
13
21
|
get sheet(): string;
|
|
14
22
|
set sheet(v: string);
|
|
15
23
|
handlerExternalCss: () => void;
|
|
16
|
-
_matchPath(currentPath: string): {
|
|
17
|
-
matched: boolean;
|
|
18
|
-
params: Record<string, string>;
|
|
19
|
-
};
|
|
20
24
|
_update(currentPath: string): void;
|
|
25
|
+
private _mount;
|
|
26
|
+
private _unmount;
|
|
21
27
|
_preSerialize(): void;
|
|
22
28
|
connectedCallback(): void;
|
|
23
29
|
disconnectedCallback(): void;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { EventManager } from '@/utils/builder';
|
|
2
2
|
import { RanElement } from '@/utils/index';
|
|
3
|
+
import { type RouterCore } from '@/utils/router';
|
|
3
4
|
export declare class Router extends RanElement {
|
|
4
5
|
static get observedAttributes(): string[];
|
|
5
6
|
_events: EventManager;
|
|
6
7
|
_shadowDom: ShadowRoot;
|
|
7
8
|
_slot: HTMLSlotElement;
|
|
8
9
|
_currentPath: string;
|
|
10
|
+
/** Bound RouterCore (when createRouter() was used) — navigation delegates to it. */
|
|
11
|
+
_core: RouterCore | null;
|
|
9
12
|
constructor();
|
|
10
13
|
get mode(): 'history' | 'hash';
|
|
11
14
|
get base(): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as w, c as i, f as d, i as o, n as p, r as a, t as h } from "./utils-DBfrRFoE.js";
|
|
2
|
-
import { i as n, p as l } from "./factory-
|
|
2
|
+
import { i as n, p as l } from "./factory-DCrO37si.js";
|
|
3
3
|
import { a as c, n as f } from "./ssr-DSGwPtEd.js";
|
|
4
4
|
var m = '.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 ranui-dropdown-up-in{0%{transform:scaleY(.8);transform-origin:100% 100%;opacity:0}to{transform:scaleY(1);transform-origin:100% 100%;opacity:1}}@keyframes ranui-dropdown-up-out{0%{transform:scaleY(1);transform-origin:100% 100%;opacity:1}to{transform:scaleY(.8);transform-origin:100% 100%;opacity:0}}@keyframes ranui-dropdown-down-in{0%{transform:scaleY(.8);transform-origin:0% 0%;opacity:0}to{transform:scaleY(1);transform-origin:0% 0%;opacity:1}}@keyframes ranui-dropdown-down-out{0%{transform:scaleY(1);transform-origin:0% 0%;opacity:1}to{transform:scaleY(.8);transform-origin:0% 0%;opacity:0}}@keyframes ranui-dropdown-left-in{0%{transform:scaleX(.8);transform-origin:100% 0%;opacity:0}to{transform:scaleX(1);transform-origin:100% 0%;opacity:1}}@keyframes ranui-dropdown-left-out{0%{transform:scaleX(1);transform-origin:100% 0%;opacity:1}to{transform:scaleX(.8);transform-origin:100% 0%;opacity:0}}@keyframes ranui-dropdown-right-in{0%{transform:scaleX(.8);transform-origin:0% 0%;opacity:0}to{transform:scaleX(1);transform-origin:0% 0%;opacity:1}}@keyframes ranui-dropdown-right-out{0%{transform:scaleX(1);transform-origin:0% 0%;opacity:1}to{transform:scaleX(.8);transform-origin:0% 0%;opacity:0}}.ran-dropdown-down-in{animation:ranui-dropdown-down-in .1s;animation-fill-mode:forwards}.ran-dropdown-down-out{animation:ranui-dropdown-down-out .1s;animation-fill-mode:forwards}.ran-dropdown-up-in{animation:ranui-dropdown-up-in .1s;animation-fill-mode:forwards}.ran-dropdown-up-out{animation:ranui-dropdown-up-out .1s;animation-fill-mode:forwards}.ran-dropdown-left-in{animation:ranui-dropdown-left-in .1s;animation-fill-mode:forwards}.ran-dropdown-left-out{animation:ranui-dropdown-left-out .1s;animation-fill-mode:forwards}.ran-dropdown-right-in{animation:ranui-dropdown-right-in .1s;animation-fill-mode:forwards}.ran-dropdown-right-out{animation:ranui-dropdown-right-out .1s;animation-fill-mode:forwards}:host{text-align:var(--ran-dropdown-host-text-align, left);z-index:var(--ran-dropdown-host-z-index, var(--ran-z-dropdown, 1100))}.ranui-dropdown{transform-origin:var(--ran-x, 50%) var(--ran-y, 50%);box-sizing:var(--ran-dropdown-box-sizing, border-box);margin:var(--ran-dropdown-margin, 0);padding:var(--ran-dropdown-padding, 0);color:var(--ran-dropdown-color, var(--ran-color-text, rgba(0, 0, 0, .88)));font-size:var(--ran-dropdown-font-size, 14px);list-style:var(--ran-dropdown-list-style, none);font-family:var(--ran-dropdown-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"));z-index:var(--ran-dropdown-z-index, 1050);overflow:var(--ran-dropdown-overflow, hidden);font-variant:var(--ran-dropdown-font-variant, initial);background:var(--ran-dropdown-background, var(--ran-color-bg-elevated, #ffffff));border-radius:var(--ran-dropdown-border-radius, var(--ran-radius-md, 12px));outline:var(--ran-dropdown-outline, none);box-shadow:var(--ran-dropdown-box-shadow, var(--ran-shadow-menu, var(--ran-shadow-elevated, 0 6px 16px 0 rgba(0, 0, 0, .08), 0 3px 6px -4px rgba(0, 0, 0, .12), 0 9px 28px 8px rgba(0, 0, 0, .05))));cursor:var(--ran-dropdown-cursor, auto);width:var(--ran-dropdown-width, 100%);height:var(--ran-dropdown-height, 100%);min-height:var(--ran-dropdown-min-height, 100%);min-width:var(--ran-dropdown-min-width, 100%)}.ranui-dropdown-container{position:var(--ran-dropdown-container-position, relative);display:var(--ran-dropdown-container-display, block);width:var(--ran-dropdown-container-width, 100%);height:var(--ran-dropdown-container-height, 100%);box-sizing:var(--ran-dropdown-container-box-sizing, border-box)}.ranui-dropdown-container .top{transform:translate(calc(var(--ran-dropdown-arrow-anchor-width, var(--ran-dropdown-min-width, 100%)) / 2 - calc(var(--ran-dropdown-arrow-width, 16px) / 2))) translateY(calc(-1 * var(--ran-dropdown-arrow-height, var(--ran-dropdown-arrow-width, 16px)) + var(--ran-dropdown-arrow-overlap, 2px))) rotate(0);top:0}.ranui-dropdown-container .bottom{transform:translate(calc(var(--ran-dropdown-arrow-anchor-width, var(--ran-dropdown-min-width, 100%)) / 2 - calc(var(--ran-dropdown-arrow-width, 16px) / 2))) translateY(var(--ran-dropdown-arrow-overlap, 2px)) rotate(180deg);top:max(0px,calc(var(--ran-dropdown-min-height, 100%) - calc(var(--ran-dropdown-arrow-width, 16px) / 4)))}.ranui-dropdown-container .left{transform:translate(calc(0px - var(--ran-dropdown-arrow-width, 16px))) translateY(calc(var(--ran-dropdown-arrow-width, 16px) / 2 + var(--ran-dropdown-arrow-overlap, 2px))) rotate(270deg);top:max(0px,calc(var(--ran-dropdown-arrow-anchor-height, var(--ran-dropdown-min-height, 100%)) / 2 - var(--ran-dropdown-arrow-width, 16px)))}.ranui-dropdown-container .right{left:100%;transform:translate(0) translateY(calc(var(--ran-dropdown-arrow-anchor-height, var(--ran-dropdown-min-height, 100%)) / 2 - calc(var(--ran-dropdown-arrow-width, 16px) / 2) + var(--ran-dropdown-arrow-overlap, 2px))) rotate(90deg);top:0}.ranui-dropdown-arrow{position:var(--ran-dropdown-arrow-position, absolute);box-sizing:var(--ran-dropdown-arrow-box-sizing, border-box);z-index:var(--ran-dropdown-arrow-z-index, 1);display:var(--ran-dropdown-arrow-display, block);pointer-events:var(--ran-dropdown-arrow-pointer-events, none);width:var(--ran-dropdown-arrow-width, var(--ran-dropdown-arrow-width, 16px));height:var(--ran-dropdown-arrow-height, var(--ran-dropdown-arrow-width, 16px));overflow:var(--ran-dropdown-arrow-overflow, hidden)}.ranui-dropdown-arrow:before{background:var(--ran-dropdown-arrow-before-background, var(--ran-color-bg-elevated, #fff));position:var(--ran-dropdown-arrow-before-position, absolute);bottom:var(--ran-dropdown-arrow-before-bottom, 0);inset-inline-start:0;width:var(--ran-dropdown-arrow-before-width, var(--ran-dropdown-arrow-width, 16px));height:var(--ran-dropdown-arrow-before-height, calc(var(--ran-dropdown-arrow-width, 16px) / 2));clip-path:path("M 0 8 A 4 4 0 0 0 2.82842712474619 6.82842712474619 L 6.585786437626905 3.0710678118654755 A 2 2 0 0 1 9.414213562373096 3.0710678118654755 L 13.17157287525381 6.82842712474619 A 4 4 0 0 0 16 8 Z");content:var(--ran-dropdown-arrow-before-content, "")}.ranui-dropdown-arrow:after{content:var(--ran-dropdown-arrow-after-content, "");position:var(--ran-dropdown-arrow-after-position, absolute);width:var(--ran-dropdown-arrow-after-width, 9px);height:var(--ran-dropdown-arrow-after-height, 9px);bottom:var(--ran-dropdown-arrow-after-bottom, 0);inset-inline:0;margin:var(--ran-dropdown-arrow-after-margin, auto);border-radius:var(--ran-dropdown-arrow-after-border-radius, 0 0 2px 0);transform:var(--ran-dropdown-arrow-after-transform, translateY(50%) rotate(-135deg));box-shadow:var(--ran-dropdown-arrow-after-box-shadow, 2px 2px 5px rgba(0, 0, 0, .05));z-index:var(--ran-dropdown-arrow-after-z-index, 0);background:var(--ran-dropdown-arrow-after-background, var(--ran-color-bg-elevated, #fff))}', e = 300, x = /* @__PURE__ */ (function(r) {
|
|
5
5
|
return r.TOP = "top", r.BOTTOM = "bottom", r.LEFT = "left", r.RIGHT = "right", r;
|
package/dist/dropdown.js
CHANGED
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { c as u, n as H } from "./mocks-CMGoftIc.js";
|
|
2
|
+
var f = 0, C = 1, d = 2, o = null, i = null, c = 0, h = /* @__PURE__ */ new Set(), v = !1;
|
|
3
|
+
function T(e, t) {
|
|
4
|
+
const r = t?.equals ?? Object.is, s = {
|
|
5
|
+
value: e,
|
|
6
|
+
observers: /* @__PURE__ */ new Set()
|
|
7
|
+
};
|
|
8
|
+
return [() => (m(s), s.value), (p) => {
|
|
9
|
+
const w = typeof p == "function" ? p(s.value) : p;
|
|
10
|
+
if (!r(s.value, w)) {
|
|
11
|
+
s.value = w;
|
|
12
|
+
for (const z of s.observers) b(z, d);
|
|
13
|
+
c === 0 && O();
|
|
14
|
+
}
|
|
15
|
+
}];
|
|
16
|
+
}
|
|
17
|
+
function j(e, t) {
|
|
18
|
+
const r = g(e, !1, t?.equals);
|
|
19
|
+
return E(r), () => (r.disposed || (y(r), m(r)), r.value);
|
|
20
|
+
}
|
|
21
|
+
function k(e) {
|
|
22
|
+
const t = g(e, !0);
|
|
23
|
+
return E(t), A(t), () => S(t);
|
|
24
|
+
}
|
|
25
|
+
function I(e) {
|
|
26
|
+
c++;
|
|
27
|
+
try {
|
|
28
|
+
e();
|
|
29
|
+
} finally {
|
|
30
|
+
c--, c === 0 && O();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function R(e) {
|
|
34
|
+
const t = o;
|
|
35
|
+
o = null;
|
|
36
|
+
try {
|
|
37
|
+
return e();
|
|
38
|
+
} finally {
|
|
39
|
+
o = t;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function M(e) {
|
|
43
|
+
const t = {
|
|
44
|
+
owned: [],
|
|
45
|
+
cleanups: [],
|
|
46
|
+
owner: i
|
|
47
|
+
}, r = i, s = o;
|
|
48
|
+
i = t, o = null;
|
|
49
|
+
try {
|
|
50
|
+
return e(() => q(t));
|
|
51
|
+
} finally {
|
|
52
|
+
i = r, o = s;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function $(e) {
|
|
56
|
+
i && i.cleanups.push(e);
|
|
57
|
+
}
|
|
58
|
+
function P() {
|
|
59
|
+
return i;
|
|
60
|
+
}
|
|
61
|
+
function V(e, t) {
|
|
62
|
+
const r = i, s = o;
|
|
63
|
+
i = e, o = null;
|
|
64
|
+
try {
|
|
65
|
+
return t();
|
|
66
|
+
} finally {
|
|
67
|
+
i = r, o = s;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function g(e, t, r) {
|
|
71
|
+
return {
|
|
72
|
+
fn: e,
|
|
73
|
+
sources: /* @__PURE__ */ new Set(),
|
|
74
|
+
isEffect: t,
|
|
75
|
+
running: !1,
|
|
76
|
+
disposed: !1,
|
|
77
|
+
state: d,
|
|
78
|
+
observers: /* @__PURE__ */ new Set(),
|
|
79
|
+
value: void 0,
|
|
80
|
+
equals: r ?? Object.is,
|
|
81
|
+
owned: [],
|
|
82
|
+
cleanups: [],
|
|
83
|
+
owner: i
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function E(e) {
|
|
87
|
+
i && i.owned.push(e);
|
|
88
|
+
}
|
|
89
|
+
function m(e) {
|
|
90
|
+
o && (o.sources.add(e), e.observers.add(o));
|
|
91
|
+
}
|
|
92
|
+
function b(e, t) {
|
|
93
|
+
if (e.disposed || e.state >= t) return;
|
|
94
|
+
const r = e.state === f;
|
|
95
|
+
if (e.state = t, e.isEffect) h.add(e);
|
|
96
|
+
else if (r) for (const s of e.observers) b(s, C);
|
|
97
|
+
}
|
|
98
|
+
function O() {
|
|
99
|
+
if (!(c > 0 || v)) {
|
|
100
|
+
v = !0;
|
|
101
|
+
try {
|
|
102
|
+
for (; h.size > 0; ) {
|
|
103
|
+
const e = [...h];
|
|
104
|
+
h.clear();
|
|
105
|
+
for (const t of e) t.disposed || y(t);
|
|
106
|
+
}
|
|
107
|
+
} finally {
|
|
108
|
+
v = !1;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function y(e) {
|
|
113
|
+
if (!(e.disposed || e.state === f)) {
|
|
114
|
+
if (e.state === C)
|
|
115
|
+
for (const t of e.sources) "fn" in t && y(t);
|
|
116
|
+
e.state === d && A(e), e.state = f;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function A(e) {
|
|
120
|
+
if (e.running) throw new Error("ranui reactivity: cyclic dependency detected (a computation triggered itself).");
|
|
121
|
+
L(e);
|
|
122
|
+
const t = o, r = i;
|
|
123
|
+
o = e, i = e, e.running = !0, e.state = f;
|
|
124
|
+
try {
|
|
125
|
+
const s = e.fn();
|
|
126
|
+
if (e.isEffect)
|
|
127
|
+
typeof s == "function" && e.cleanups.push(s);
|
|
128
|
+
else {
|
|
129
|
+
const n = e.value;
|
|
130
|
+
if (e.value = s, e.observers.size > 0 && !e.equals(n, s)) for (const l of e.observers) b(l, d);
|
|
131
|
+
}
|
|
132
|
+
} finally {
|
|
133
|
+
e.running = !1, o = t, i = r;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function L(e) {
|
|
137
|
+
for (const t of e.owned) S(t);
|
|
138
|
+
e.owned.length = 0;
|
|
139
|
+
for (const t of e.cleanups) t();
|
|
140
|
+
e.cleanups.length = 0;
|
|
141
|
+
for (const t of e.sources) t.observers.delete(e);
|
|
142
|
+
e.sources.clear();
|
|
143
|
+
}
|
|
144
|
+
function S(e) {
|
|
145
|
+
e.disposed || (e.disposed = !0, L(e), e.observers.clear());
|
|
146
|
+
}
|
|
147
|
+
function q(e) {
|
|
148
|
+
for (const t of e.owned) S(t);
|
|
149
|
+
e.owned.length = 0;
|
|
150
|
+
for (const t of e.cleanups) t();
|
|
151
|
+
e.cleanups.length = 0;
|
|
152
|
+
}
|
|
153
|
+
var W = () => ({ current: null }), B = class N {
|
|
154
|
+
el;
|
|
155
|
+
constructor(t) {
|
|
156
|
+
this.el = u ? new H(t) : document.createElement(t);
|
|
157
|
+
}
|
|
158
|
+
id(t) {
|
|
159
|
+
return this.el.setAttribute("id", t), this;
|
|
160
|
+
}
|
|
161
|
+
bind(t, r) {
|
|
162
|
+
typeof t == "function" ? k(() => r(t())) : r(t);
|
|
163
|
+
}
|
|
164
|
+
class(t) {
|
|
165
|
+
return this.bind(t, (r) => {
|
|
166
|
+
u ? this.el.attributes.set("class", r) : this.el.className = r;
|
|
167
|
+
}), this;
|
|
168
|
+
}
|
|
169
|
+
addClass(...t) {
|
|
170
|
+
return t.forEach((r) => this.el.classList.add(r)), this;
|
|
171
|
+
}
|
|
172
|
+
removeClass(...t) {
|
|
173
|
+
return t.forEach((r) => this.el.classList.remove(r)), this;
|
|
174
|
+
}
|
|
175
|
+
attr(t, r) {
|
|
176
|
+
return this.bind(r, (s) => this.el.setAttribute(t, s)), this;
|
|
177
|
+
}
|
|
178
|
+
attrs(t) {
|
|
179
|
+
return Object.entries(t).forEach(([r, s]) => {
|
|
180
|
+
s != null && this.el.setAttribute(r, String(s));
|
|
181
|
+
}), this;
|
|
182
|
+
}
|
|
183
|
+
boolAttr(t, r, s = "") {
|
|
184
|
+
return this.bind(r, (n) => {
|
|
185
|
+
n ? this.el.setAttribute(t, s) : this.el.removeAttribute(t);
|
|
186
|
+
}), this;
|
|
187
|
+
}
|
|
188
|
+
part(t) {
|
|
189
|
+
return this.attr("part", t);
|
|
190
|
+
}
|
|
191
|
+
data(t, r) {
|
|
192
|
+
return this.attr(`data-${t}`, r);
|
|
193
|
+
}
|
|
194
|
+
style(t, r) {
|
|
195
|
+
return typeof t == "string" ? this.bind(r ?? "", (s) => this.el.style.setProperty(t, s)) : Object.entries(t).forEach(([s, n]) => this.el.style.setProperty(s, n)), this;
|
|
196
|
+
}
|
|
197
|
+
cssVar(t, r) {
|
|
198
|
+
const s = t.startsWith("--") ? t : `--${t}`;
|
|
199
|
+
return this.style(s, r);
|
|
200
|
+
}
|
|
201
|
+
aria(t, r) {
|
|
202
|
+
return this.attr(`aria-${t}`, r);
|
|
203
|
+
}
|
|
204
|
+
role(t) {
|
|
205
|
+
return this.attr("role", t);
|
|
206
|
+
}
|
|
207
|
+
tabIndex(t) {
|
|
208
|
+
return this.attr("tabindex", String(t));
|
|
209
|
+
}
|
|
210
|
+
label(t) {
|
|
211
|
+
return this.aria("label", t);
|
|
212
|
+
}
|
|
213
|
+
labelledBy(t) {
|
|
214
|
+
return this.aria("labelledby", t);
|
|
215
|
+
}
|
|
216
|
+
describedBy(t) {
|
|
217
|
+
return this.aria("describedby", t);
|
|
218
|
+
}
|
|
219
|
+
ariaHidden(t = !0) {
|
|
220
|
+
return this.aria("hidden", String(t));
|
|
221
|
+
}
|
|
222
|
+
on(t, r, s) {
|
|
223
|
+
return this.el.addEventListener(t, r, s), this;
|
|
224
|
+
}
|
|
225
|
+
listen(t, r, s, n) {
|
|
226
|
+
return t.on(this.el, r, s, n), this;
|
|
227
|
+
}
|
|
228
|
+
delegate(t, r, s, n, l) {
|
|
229
|
+
return t.delegate(this.el, r, s, n, l), this;
|
|
230
|
+
}
|
|
231
|
+
children(...t) {
|
|
232
|
+
const r = (s) => s.reduce((n, l) => Array.isArray(l) ? n.concat(r(l)) : n.concat(l), []);
|
|
233
|
+
return r(t).forEach((s) => {
|
|
234
|
+
s != null && (s instanceof N ? this.el.appendChild(s.build()) : typeof s == "string" ? u ? this.el.appendChild(s) : this.el.appendChild(document.createTextNode(s)) : this.el.appendChild(s));
|
|
235
|
+
}), this;
|
|
236
|
+
}
|
|
237
|
+
replaceChildren(...t) {
|
|
238
|
+
if (u) {
|
|
239
|
+
const r = this.el;
|
|
240
|
+
r.childrenList = [];
|
|
241
|
+
} else this.el.replaceChildren();
|
|
242
|
+
return this.children(...t);
|
|
243
|
+
}
|
|
244
|
+
text(t) {
|
|
245
|
+
return this.bind(t, (r) => {
|
|
246
|
+
this.el.textContent = r;
|
|
247
|
+
}), this;
|
|
248
|
+
}
|
|
249
|
+
ref(t) {
|
|
250
|
+
return t.current = this.el, this;
|
|
251
|
+
}
|
|
252
|
+
shadow(t = { mode: "closed" }) {
|
|
253
|
+
const r = this.el.attachShadow(t);
|
|
254
|
+
return new x(this.el, r, t);
|
|
255
|
+
}
|
|
256
|
+
build() {
|
|
257
|
+
return this.el;
|
|
258
|
+
}
|
|
259
|
+
serialize() {
|
|
260
|
+
if (u) return this.el.serialize();
|
|
261
|
+
const t = document.createElement("div");
|
|
262
|
+
return t.appendChild(this.el.cloneNode(!0)), t.innerHTML;
|
|
263
|
+
}
|
|
264
|
+
}, x = class {
|
|
265
|
+
root;
|
|
266
|
+
hostEl;
|
|
267
|
+
options;
|
|
268
|
+
constructor(e, t, r) {
|
|
269
|
+
this.hostEl = e, this.root = t, this.options = r;
|
|
270
|
+
}
|
|
271
|
+
children(...e) {
|
|
272
|
+
const t = (r) => r.reduce((s, n) => Array.isArray(n) ? s.concat(t(n)) : s.concat(n), []);
|
|
273
|
+
return t(e).forEach((r) => {
|
|
274
|
+
r != null && (r instanceof B ? this.root.appendChild(r.build()) : typeof r == "string" ? u ? this.root.appendChild(r) : this.root.appendChild(document.createTextNode(r)) : this.root.appendChild(r));
|
|
275
|
+
}), this;
|
|
276
|
+
}
|
|
277
|
+
adoptSheet(...e) {
|
|
278
|
+
return this.root.adoptedStyleSheets = [...this.root.adoptedStyleSheets, ...e], this;
|
|
279
|
+
}
|
|
280
|
+
css(e) {
|
|
281
|
+
if (u)
|
|
282
|
+
return this.root.adoptedStyleSheets.push(e), this;
|
|
283
|
+
if (typeof CSSStyleSheet < "u") try {
|
|
284
|
+
const r = new CSSStyleSheet();
|
|
285
|
+
return r.replaceSync(e), this.root.adoptedStyleSheets = [...this.root.adoptedStyleSheets, r], this;
|
|
286
|
+
} catch {
|
|
287
|
+
}
|
|
288
|
+
const t = document.createElement("style");
|
|
289
|
+
return t.textContent = e, this.root.appendChild(t), this;
|
|
290
|
+
}
|
|
291
|
+
done() {
|
|
292
|
+
return {
|
|
293
|
+
host: this.hostEl,
|
|
294
|
+
shadow: this.root
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
serialize() {
|
|
298
|
+
return u ? this.root.serialize() : this.root.innerHTML;
|
|
299
|
+
}
|
|
300
|
+
}, a = (e) => new B(e), F = () => a("div"), K = () => a("span"), U = () => a("slot"), Y = () => a("button"), G = () => a("input"), J = () => a("style"), Q = () => a("label"), X = () => a("ul"), Z = () => a("li"), _ = () => a("section"), tt = () => a("article"), et = () => a("nav"), rt = () => a("header"), st = () => a("footer"), nt = () => a("main"), it = (e = "open", t = !1) => {
|
|
301
|
+
const r = a("template");
|
|
302
|
+
return r.attr("shadowrootmode", e), t && r.attr("shadowrootdelegatesfocus", ""), r;
|
|
303
|
+
};
|
|
304
|
+
export {
|
|
305
|
+
k as C,
|
|
306
|
+
V as D,
|
|
307
|
+
$ as E,
|
|
308
|
+
T as O,
|
|
309
|
+
j as S,
|
|
310
|
+
P as T,
|
|
311
|
+
a as _,
|
|
312
|
+
st as a,
|
|
313
|
+
W as b,
|
|
314
|
+
Q as c,
|
|
315
|
+
et as d,
|
|
316
|
+
_ as f,
|
|
317
|
+
X as g,
|
|
318
|
+
J as h,
|
|
319
|
+
F as i,
|
|
320
|
+
R as k,
|
|
321
|
+
Z as l,
|
|
322
|
+
K as m,
|
|
323
|
+
Y as n,
|
|
324
|
+
rt as o,
|
|
325
|
+
U as p,
|
|
326
|
+
it as r,
|
|
327
|
+
G as s,
|
|
328
|
+
tt as t,
|
|
329
|
+
nt as u,
|
|
330
|
+
B as v,
|
|
331
|
+
M as w,
|
|
332
|
+
I as x,
|
|
333
|
+
x as y
|
|
334
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a, i as o, n as i, r as n, t as h } from "./utils-DBfrRFoE.js";
|
|
2
|
-
import { _ as l, p as m } from "./factory-
|
|
2
|
+
import { _ as l, p as m } from "./factory-DCrO37si.js";
|
|
3
3
|
import { a as u, n as f } from "./ssr-DSGwPtEd.js";
|
|
4
4
|
var c = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}", d = class extends f {
|
|
5
5
|
_form;
|
package/dist/form.js
CHANGED
package/dist/i18n.d.ts
ADDED
package/dist/i18n.js
ADDED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as l, i as c, n as d, r as n, t as
|
|
2
|
-
import { t as
|
|
3
|
-
import { _ as
|
|
1
|
+
import { a as l, i as c, n as d, r as n, t as f } from "./utils-DBfrRFoE.js";
|
|
2
|
+
import { t as u } from "./events-C59wGdni.js";
|
|
3
|
+
import { _ as v, i as g } from "./factory-DCrO37si.js";
|
|
4
4
|
import { a as m, n as p } from "./ssr-DSGwPtEd.js";
|
|
5
|
-
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}: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);color:var(--ran-icon-color, inherit);font-size:var(--ran-icon-font-size, 1em);margin:var(--ran-icon-margin, 0)}.ran-icon svg{width:var(--ran-icon-svg-width, 1em);height:var(--ran-icon-svg-height, 1em);fill:var(--ran-icon-svg-fill, currentColor);stroke:var(--ran-icon-svg-stroke, currentColor)}@keyframes rotate{to{transform:var(--ran-icon-keyframes-to-transform, rotate(360deg))}}",
|
|
5
|
+
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}: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);color:var(--ran-icon-color, inherit);font-size:var(--ran-icon-font-size, 1em);margin:var(--ran-icon-margin, 0)}.ran-icon svg{width:var(--ran-icon-svg-width, 1em);height:var(--ran-icon-svg-height, 1em);fill:var(--ran-icon-svg-fill, currentColor);stroke:var(--ran-icon-svg-stroke, currentColor)}@keyframes rotate{to{transform:var(--ran-icon-keyframes-to-transform, rotate(360deg))}}", w = !1, h = /* @__PURE__ */ new Map(), a = !1, o = (t) => /<svg[\s>]/i.test(t), _ = (t) => {
|
|
6
6
|
if (typeof t == "string") return o(t) ? t : void 0;
|
|
7
7
|
if (!t || typeof t != "object") return;
|
|
8
8
|
const e = t, i = e.data;
|
|
@@ -15,15 +15,51 @@ var b = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transpar
|
|
|
15
15
|
}
|
|
16
16
|
}, y = (t, e) => {
|
|
17
17
|
a = !0;
|
|
18
|
-
const i =
|
|
18
|
+
const i = _(e);
|
|
19
19
|
i && (h.set(`inline:${t}`, i), typeof window < "u" && window.dispatchEvent(new CustomEvent("ranui-icon-registered", { detail: { name: t } })));
|
|
20
|
-
},
|
|
20
|
+
}, x = (t) => {
|
|
21
21
|
a = !0, Object.entries(t).forEach(([e, i]) => {
|
|
22
22
|
y(e, i);
|
|
23
23
|
});
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
}, E = [
|
|
25
|
+
"add-user",
|
|
26
|
+
"arrow-down",
|
|
27
|
+
"book",
|
|
28
|
+
"check-circle",
|
|
29
|
+
"check-circle-fill",
|
|
30
|
+
"close",
|
|
31
|
+
"close-circle",
|
|
32
|
+
"close-circle-fill",
|
|
33
|
+
"drop",
|
|
34
|
+
"eye",
|
|
35
|
+
"eye-close",
|
|
36
|
+
"github",
|
|
37
|
+
"globe",
|
|
38
|
+
"home",
|
|
39
|
+
"info-circle",
|
|
40
|
+
"info-circle-fill",
|
|
41
|
+
"issue",
|
|
42
|
+
"loading",
|
|
43
|
+
"loading-scene",
|
|
44
|
+
"lock",
|
|
45
|
+
"menu",
|
|
46
|
+
"message",
|
|
47
|
+
"more",
|
|
48
|
+
"plus",
|
|
49
|
+
"power-off",
|
|
50
|
+
"preview",
|
|
51
|
+
"search",
|
|
52
|
+
"setting",
|
|
53
|
+
"sort",
|
|
54
|
+
"team",
|
|
55
|
+
"unlock",
|
|
56
|
+
"user",
|
|
57
|
+
"warning-circle",
|
|
58
|
+
"warning-circle-fill",
|
|
59
|
+
"without-content"
|
|
60
|
+
], A = class extends p {
|
|
61
|
+
isDev = w;
|
|
62
|
+
_events = new u();
|
|
27
63
|
static get observedAttributes() {
|
|
28
64
|
return [
|
|
29
65
|
"name",
|
|
@@ -44,7 +80,7 @@ var b = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transpar
|
|
|
44
80
|
};
|
|
45
81
|
constructor() {
|
|
46
82
|
super(), this._shadowDom = d(this, b);
|
|
47
|
-
const t =
|
|
83
|
+
const t = f(this._shadowDom, ".ran-icon", () => g().class("ran-icon").part("ran-icon").build());
|
|
48
84
|
this._div = t;
|
|
49
85
|
}
|
|
50
86
|
get name() {
|
|
@@ -122,7 +158,7 @@ var b = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transpar
|
|
|
122
158
|
parseSvg = (t) => {
|
|
123
159
|
const e = new window.DOMParser().parseFromString(t, "image/svg+xml").documentElement;
|
|
124
160
|
if (!e || e.tagName.toLowerCase() === "parsererror" || e.tagName.toLowerCase() !== "svg") return;
|
|
125
|
-
const i = new XMLSerializer().serializeToString(e), s =
|
|
161
|
+
const i = new XMLSerializer().serializeToString(e), s = v("template").build();
|
|
126
162
|
s.innerHTML = i.trim();
|
|
127
163
|
const r = s.content.firstElementChild;
|
|
128
164
|
if (!(!r || r.tagName.toLowerCase() !== "svg"))
|
|
@@ -161,7 +197,8 @@ var b = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transpar
|
|
|
161
197
|
};
|
|
162
198
|
m("r-icon", A);
|
|
163
199
|
export {
|
|
164
|
-
|
|
165
|
-
|
|
200
|
+
x as i,
|
|
201
|
+
E as n,
|
|
202
|
+
y as r,
|
|
166
203
|
A as t
|
|
167
204
|
};
|
package/dist/icon.js
CHANGED