ranui 0.1.9 → 0.1.10-alpha.10
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.zh-CN.md +190 -0
- package/dist/_commonjs-dynamic-modules-DLbDWi6a.js +12 -0
- package/dist/arrow-down-B_hCY3Wt.js +662 -0
- package/dist/button.js +7 -0
- package/dist/checkbox.js +7 -0
- package/dist/colorpicker.js +11 -0
- package/dist/{colz-746223ab.js → colz-DJZvo_8B.js} +4 -13
- package/dist/docx-CHkPTdGU.js +3665 -0
- package/dist/drop-4j4abxje.js +36 -0
- package/dist/icon.js +6 -0
- package/dist/iconShadowless.js +6 -0
- package/dist/image.js +4 -0
- package/dist/{index-4443363f.js → index-15M0olqa.js} +40 -68
- package/dist/index-1v568_nq.js +140 -0
- package/dist/index-B897keW5.js +279 -0
- package/dist/{index-e03d23e7.js → index-BZR0HaP2.js} +2 -5
- package/dist/{index-e2e5d725.js → index-B_GuEcTd.js} +1280 -2146
- package/dist/index-Bc2Bcl8D.js +63701 -0
- package/dist/index-C4Sv0T51.js +495 -0
- package/dist/{index-2d16a084.js → index-C6RcMHoH.js} +12 -22
- package/dist/index-C9z10IgG.js +103 -0
- package/dist/{index-3cf72afd.js → index-CFjEuvBW.js} +23 -45
- package/dist/{index-7b8840f9.js → index-CGEx9VOA.js} +1086 -2670
- package/dist/index-CGYfjKUV.js +72 -0
- package/dist/index-CVtBLEpV.js +712 -0
- package/dist/index-CiWwvEMM.js +511 -0
- package/dist/index-CtVOgBDk.js +659 -0
- package/dist/index-D4qUro5V.js +279 -0
- package/dist/index-D4y9c1Dj.js +310 -0
- package/dist/{index-b7790662.js → index-DAxs7Dd2.js} +6 -13
- package/dist/index-DC5EA657.js +91 -0
- package/dist/index-DJZmDHz-.js +146 -0
- package/dist/{index-0d5b9435.js → index-D_CA5VDZ.js} +11 -15
- package/dist/{index-01b17e26.js → index-KS2nvVcO.js} +2 -5
- package/dist/{index-1048a998.js → index-WfFw4LJT.js} +105 -62
- package/dist/{index-458debf7.js → index-mhFL9MJp.js} +15 -49
- package/dist/index.d.ts +211 -14
- package/dist/index.js +24 -24
- package/dist/info-circle-fill-CFeVMdci.js +4 -0
- package/dist/input.js +6 -0
- package/dist/inputShadowless.js +6 -0
- package/dist/jszip.min-Dhs3nUkD.js +2346 -0
- package/dist/katex-es-B5r5vt3m.js +14628 -0
- package/dist/loading-scene-BMc2wqKm.js +4 -0
- package/dist/loading.js +8 -0
- package/dist/math.js +7 -0
- package/dist/message.js +6 -0
- package/dist/modal.js +4 -0
- package/dist/{pdf-bdb7818a.js → pdf-Cx0VWKFo.js} +13 -8
- package/dist/player.js +8 -0
- package/dist/popover.js +8 -0
- package/dist/preview.js +7 -0
- package/dist/progress.js +7 -0
- package/dist/radar.js +6 -0
- package/dist/select.js +10 -0
- package/dist/{index-1b73beee.js → selectShadowless.js} +161 -165
- package/dist/shadowless.js +8 -0
- package/dist/skeleton.js +4 -0
- package/dist/sprite-CH2zLtZy.js +141 -0
- package/dist/style.css +1 -1
- package/dist/tab.js +6 -0
- package/dist/tabpane.js +4 -0
- package/dist/tsconfig.json +31 -0
- package/dist/typings.d.ts +211 -0
- package/dist/umd/index.umd.cjs +21 -32
- package/dist/umd/shadowless/shadowless.umd.cjs +1 -0
- package/dist/umd/shadowless/style.css +1 -0
- package/dist/umd/style.css +1 -1
- package/package.json +113 -69
- package/readme.md +38 -56
- package/typings.d.ts +211 -0
- package/dist/build/config.d.ts +0 -3
- package/dist/build/config.es.d.ts +0 -2
- package/dist/build/config.umd.d.ts +0 -2
- package/dist/components/button/index.d.ts +0 -35
- package/dist/components/button/index.js +0 -8
- package/dist/components/form/index.d.ts +0 -2
- package/dist/components/icon/index.d.ts +0 -2
- package/dist/components/icon/index.js +0 -6
- package/dist/components/image/index.d.ts +0 -2
- package/dist/components/image/index.js +0 -4
- package/dist/components/input/index.d.ts +0 -185
- package/dist/components/input/index.js +0 -6
- package/dist/components/message/index.d.ts +0 -14
- package/dist/components/message/index.js +0 -4
- package/dist/components/modal/index.d.ts +0 -2
- package/dist/components/modal/index.js +0 -4
- package/dist/components/option/index.d.ts +0 -2
- package/dist/components/option/index.js +0 -95
- package/dist/components/player/index.d.ts +0 -213
- package/dist/components/player/index.js +0 -12
- package/dist/components/preview/colz.d.ts +0 -72
- package/dist/components/preview/docx.d.ts +0 -8
- package/dist/components/preview/excel/excel.d.ts +0 -2
- package/dist/components/preview/excel/index.d.ts +0 -1
- package/dist/components/preview/excel/media.d.ts +0 -37
- package/dist/components/preview/index.d.ts +0 -6
- package/dist/components/preview/index.js +0 -8
- package/dist/components/preview/pdf.d.ts +0 -1
- package/dist/components/preview/pptx/index.d.ts +0 -16
- package/dist/components/preview/pptx/process_pptx.d.ts +0 -23
- package/dist/components/preview/pptx/t_xml.d.ts +0 -1
- package/dist/components/preview/pptx/worker.d.ts +0 -1
- package/dist/components/progress/index.d.ts +0 -36
- package/dist/components/progress/index.js +0 -8
- package/dist/components/radar/index.d.ts +0 -2
- package/dist/components/radar/index.js +0 -7
- package/dist/components/scratch/index.d.ts +0 -19
- package/dist/components/select/index.d.ts +0 -105
- package/dist/components/select/index.js +0 -11
- package/dist/components/skeleton/index.d.ts +0 -2
- package/dist/components/skeleton/index.js +0 -4
- package/dist/components/tab/index.d.ts +0 -408
- package/dist/components/tab/index.js +0 -7
- package/dist/components/tabpane/index.d.ts +0 -352
- package/dist/components/tabpane/index.js +0 -4
- package/dist/docx-c5d02d8c.js +0 -21
- package/dist/index-57492b9b.js +0 -48
- package/dist/index-7216d6b0.js +0 -175
- package/dist/index-73ce455b.js +0 -264
- package/dist/index-7913ec46.js +0 -239
- package/dist/index-c14450a9.js +0 -662
- package/dist/info-circle-fill-90ec9aa9.js +0 -14
- package/dist/playwright.config.d.ts +0 -9
- package/dist/plugins/auto-import-file.d.ts +0 -0
- package/dist/plugins/load-style.d.ts +0 -6
- package/dist/plugins/load-svg.d.ts +0 -9
- package/dist/tests/button.spec.d.ts +0 -1
- package/dist/umd/build/config.d.ts +0 -3
- package/dist/umd/build/config.es.d.ts +0 -2
- package/dist/umd/build/config.umd.d.ts +0 -2
- package/dist/umd/components/button/index.d.ts +0 -35
- package/dist/umd/components/form/index.d.ts +0 -2
- package/dist/umd/components/icon/index.d.ts +0 -2
- package/dist/umd/components/image/index.d.ts +0 -2
- package/dist/umd/components/input/index.d.ts +0 -185
- package/dist/umd/components/message/index.d.ts +0 -14
- package/dist/umd/components/modal/index.d.ts +0 -2
- package/dist/umd/components/option/index.d.ts +0 -2
- package/dist/umd/components/player/index.d.ts +0 -213
- package/dist/umd/components/preview/colz.d.ts +0 -72
- package/dist/umd/components/preview/docx.d.ts +0 -8
- package/dist/umd/components/preview/excel/excel.d.ts +0 -2
- package/dist/umd/components/preview/excel/index.d.ts +0 -1
- package/dist/umd/components/preview/excel/media.d.ts +0 -37
- package/dist/umd/components/preview/index.d.ts +0 -6
- package/dist/umd/components/preview/pdf.d.ts +0 -1
- package/dist/umd/components/preview/pptx/index.d.ts +0 -16
- package/dist/umd/components/preview/pptx/process_pptx.d.ts +0 -23
- package/dist/umd/components/preview/pptx/t_xml.d.ts +0 -1
- package/dist/umd/components/preview/pptx/worker.d.ts +0 -1
- package/dist/umd/components/progress/index.d.ts +0 -36
- package/dist/umd/components/radar/index.d.ts +0 -2
- package/dist/umd/components/scratch/index.d.ts +0 -19
- package/dist/umd/components/select/index.d.ts +0 -105
- package/dist/umd/components/skeleton/index.d.ts +0 -2
- package/dist/umd/components/tab/index.d.ts +0 -408
- package/dist/umd/components/tabpane/index.d.ts +0 -352
- package/dist/umd/index.d.ts +0 -14
- package/dist/umd/playwright.config.d.ts +0 -9
- package/dist/umd/plugins/auto-import-file.d.ts +0 -0
- package/dist/umd/plugins/load-style.d.ts +0 -6
- package/dist/umd/plugins/load-svg.d.ts +0 -9
- package/dist/umd/tests/button.spec.d.ts +0 -1
- package/dist/umd/utils/image.d.ts +0 -32
- package/dist/umd/utils/index.d.ts +0 -64
- package/dist/umd/utils/math.d.ts +0 -26
- package/dist/umd/utils/tween.d.ts +0 -21
- package/dist/umd/vite.config.d.ts +0 -6
- package/dist/utils/image.d.ts +0 -32
- package/dist/utils/index.d.ts +0 -64
- package/dist/utils/math.d.ts +0 -26
- package/dist/utils/tween.d.ts +0 -21
- package/dist/vendor-f71e6f68.js +0 -92126
- package/dist/vite.config.d.ts +0 -6
- /package/dist/{add-user-b2bed3e7.js → add-user-BN1JlY7e.js} +0 -0
- /package/dist/{book-b11a68eb.js → book-nTEFXU2x.js} +0 -0
- /package/dist/{check-circle-fill-dc284144.js → check-circle-fill-B_pd8ZSs.js} +0 -0
- /package/dist/{check-circle-74bd09c3.js → check-circle-szyAJiap.js} +0 -0
- /package/dist/{close-20925345.js → close-CFnkhudp.js} +0 -0
- /package/dist/{close-circle-720c18be.js → close-circle-CwmuN2C6.js} +0 -0
- /package/dist/{close-circle-fill-238a66b1.js → close-circle-fill-jSqPPw9i.js} +0 -0
- /package/dist/{eye-5e742329.js → eye-D_mEt17f.js} +0 -0
- /package/dist/{eye-close-3874f1ae.js → eye-close-BVr3NJtg.js} +0 -0
- /package/dist/{home-c4a05e8b.js → home-BUQ4USMk.js} +0 -0
- /package/dist/{index-8e1e2573.js → index-CQTJoWhb.js} +0 -0
- /package/dist/{info-circle-5826decc.js → info-circle-COnL5bTJ.js} +0 -0
- /package/dist/{loading-09ca52df.js → loading-Dcc5RApI.js} +0 -0
- /package/dist/{lock-1d2487c9.js → lock-Cr7BnmWN.js} +0 -0
- /package/dist/{message-b2bfdea7.js → message-D36_Zo2l.js} +0 -0
- /package/dist/{power-off-6ade5a91.js → power-off-lQRbiBak.js} +0 -0
- /package/dist/{preview-b291aea8.js → preview-CJbz9GjO.js} +0 -0
- /package/dist/{setting-1e5ccb6d.js → setting-DemlgzVC.js} +0 -0
- /package/dist/{team-ca6a12e1.js → team-tl4NJXPC.js} +0 -0
- /package/dist/{unlock-f56086fd.js → unlock-CeU74z9n.js} +0 -0
- /package/dist/{user-5c01e665.js → user-B-eVXwuk.js} +0 -0
- /package/dist/{warning-circle-035e025c.js → warning-circle-DDUgEDIv.js} +0 -0
- /package/dist/{warning-circle-fill-d17c37c9.js → warning-circle-fill-lODUKz0i.js} +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const str2Xml = (xmlStr, format = "text/xml") => {
|
|
2
|
+
if (window.DOMParser) return new window.DOMParser().parseFromString(xmlStr, format).documentElement;
|
|
3
|
+
if (typeof window.ActiveXObject !== "undefined") {
|
|
4
|
+
const xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM");
|
|
5
|
+
xmlDoc.async = "false";
|
|
6
|
+
xmlDoc.loadXML(xmlStr);
|
|
7
|
+
return xmlDoc;
|
|
8
|
+
}
|
|
9
|
+
return void 0;
|
|
10
|
+
};
|
|
11
|
+
const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
|
|
12
|
+
const v = glob[path];
|
|
13
|
+
if (v) {
|
|
14
|
+
return typeof v === "function" ? v() : Promise.resolve(v);
|
|
15
|
+
}
|
|
16
|
+
return new Promise((_, reject) => {
|
|
17
|
+
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
|
18
|
+
reject.bind(
|
|
19
|
+
null,
|
|
20
|
+
new Error(
|
|
21
|
+
"Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
|
|
22
|
+
)
|
|
23
|
+
)
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
const drop = { "success": true, "_identification": true, "data": '<svg>\n <filter id="liquid">\n <feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur"></feGaussianBlur>\n <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7" result="liquid"></feColorMatrix>\n </filter>\n </svg>\n' };
|
|
28
|
+
const drop$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
29
|
+
__proto__: null,
|
|
30
|
+
default: drop
|
|
31
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
32
|
+
export {
|
|
33
|
+
__variableDynamicImportRuntimeHelper as _,
|
|
34
|
+
drop$1 as d,
|
|
35
|
+
str2Xml as s
|
|
36
|
+
};
|
package/dist/icon.js
ADDED
package/dist/image.js
ADDED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) =>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
import { p as perToNum } from "./index-7913ec46.js";
|
|
8
|
-
import { c as createCustomError } from "./index-57492b9b.js";
|
|
9
|
-
const index$2 = "";
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
import { p as perToNum } from "./arrow-down-B_hCY3Wt.js";
|
|
5
|
+
import { H as HTMLElementSSR, c as createCustomError } from "./index-DC5EA657.js";
|
|
6
|
+
const f7170ee498e0dd32cbdcb63fba8f75cc = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host:active,:host:focus{outline:0;-webkit-tap-highlight-color:transparent}.ran-progress{position:var(--ran-progress-position, relative);cursor:var(--ran-progress-cursor, pointer);width:var(--ran-progress-width, 100%);height:var(--ran-progress-height, 100%)}.ran-progress:active,.ran-progress:focus{outline:0;-webkit-tap-highlight-color:transparent}.ran-progress-wrap{width:var(--ran-progress-wrap-width, 100%);height:var(--ran-progress-wrap-height, 8px);border-radius:var(--ran-progress-wrap-border-radius, 20px);background:var(--ran-progress-wrap-background, #5b5b5b);position:var(--ran-progress-wrap-position, relative);overflow:var(--ran-progress-wrap-overflow, hidden)}.ran-progress-wrap-value{position:var(--ran-progress-wrap-value-position, absolute);top:var(--ran-progress-wrap-value-top, 0);left:var(--ran-progress-wrap-value-left, 0);height:var(--ran-progress-wrap-value-height, 100%);width:var(--ran-progress-wrap-value-width, 100%);transform:var(--ran-progress-wrap-value-transform, scaleX(0));transform-origin:var(--ran-progress-wrap-value-transform-origin, 0 0);will-change:var(--ran-progress-wrap-value-will-change, transform);background:var(--ran-progress-wrap-value-background, linear-gradient(90deg, #0bc8bb 2.42%, #00d297 98.79%));border-radius:var(--ran-progress-wrap-value-border-radius, 20px)}.ran-progress-dot{position:var(--ran-progress-dot-position, absolute);top:var(--ran-progress-dot-top, -5px);left:var(--ran-progress-dot-left, -9px);border-radius:var(--ran-progress-dot-border-radius, 50%);width:var(--ran-progress-dot-width, 18px);height:var(--ran-progress-dot-height, 18px);background:var(--ran-progress-dot-background, linear-gradient(90deg, #0bc8bb 2.42%, #00d297 98.79%));cursor:var(--ran-progress-dot-cursor, pointer)}";
|
|
10
7
|
const attributes = ["percent", "type", "total", "dot"];
|
|
11
|
-
class Progress extends
|
|
8
|
+
class Progress extends HTMLElementSSR() {
|
|
12
9
|
constructor() {
|
|
13
10
|
super();
|
|
14
11
|
__publicField(this, "_progress");
|
|
@@ -16,50 +13,31 @@ class Progress extends HTMLElement {
|
|
|
16
13
|
__publicField(this, "_progressWrapValue");
|
|
17
14
|
__publicField(this, "_progressDot");
|
|
18
15
|
__publicField(this, "moveProgress");
|
|
16
|
+
__publicField(this, "_shadowDom");
|
|
19
17
|
__publicField(this, "progressClick", (e) => {
|
|
20
18
|
const rect = this._progress.getBoundingClientRect();
|
|
21
19
|
const offsetX = e.clientX - rect.left;
|
|
22
|
-
const percentage = Math.min(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
);
|
|
26
|
-
this.percent = percentage * this.total;
|
|
27
|
-
this._progressWrapValue.style.setProperty(
|
|
28
|
-
"transform",
|
|
29
|
-
`scaleX(${percentage})`
|
|
30
|
-
);
|
|
31
|
-
this._progressDot.style.setProperty(
|
|
32
|
-
"transform",
|
|
33
|
-
`translateX(${percentage * this._progress.offsetWidth}px)`
|
|
34
|
-
);
|
|
20
|
+
const percentage = Math.min(1, Math.max(0, offsetX / this._progress.offsetWidth));
|
|
21
|
+
this.percent = `${percentage * Number(this.total)}`;
|
|
22
|
+
this._progressWrapValue.style.setProperty("transform", `scaleX(${percentage})`);
|
|
23
|
+
this._progressDot.style.setProperty("transform", `translateX(${percentage * this._progress.offsetWidth}px)`);
|
|
35
24
|
this.change();
|
|
36
25
|
});
|
|
37
26
|
__publicField(this, "progressDotMouseDown", () => {
|
|
38
27
|
this.moveProgress.mouseDown = true;
|
|
39
28
|
});
|
|
40
29
|
__publicField(this, "progressDotMouseMove", (e) => {
|
|
41
|
-
if (!this.moveProgress.mouseDown)
|
|
42
|
-
return;
|
|
30
|
+
if (!this.moveProgress.mouseDown) return;
|
|
43
31
|
const rect = this._progress.getBoundingClientRect();
|
|
44
32
|
const offsetX = e.clientX - rect.left;
|
|
45
|
-
const percentage = Math.min(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
);
|
|
49
|
-
this.percent = percentage * this.total;
|
|
50
|
-
this._progressWrapValue.style.setProperty(
|
|
51
|
-
"transform",
|
|
52
|
-
`scaleX(${percentage})`
|
|
53
|
-
);
|
|
54
|
-
this._progressDot.style.setProperty(
|
|
55
|
-
"transform",
|
|
56
|
-
`translateX(${percentage * this._progress.offsetWidth}px)`
|
|
57
|
-
);
|
|
33
|
+
const percentage = Math.min(1, Math.max(0, offsetX / this._progress.offsetWidth));
|
|
34
|
+
this.percent = `${percentage * Number(this.total)}`;
|
|
35
|
+
this._progressWrapValue.style.setProperty("transform", `scaleX(${percentage})`);
|
|
36
|
+
this._progressDot.style.setProperty("transform", `translateX(${percentage * this._progress.offsetWidth}px)`);
|
|
58
37
|
this.change();
|
|
59
38
|
});
|
|
60
39
|
__publicField(this, "progressDotMouseUp", (e) => {
|
|
61
|
-
if (!this.moveProgress.mouseDown)
|
|
62
|
-
return;
|
|
40
|
+
if (!this.moveProgress.mouseDown) return;
|
|
63
41
|
this.moveProgress.mouseDown = false;
|
|
64
42
|
});
|
|
65
43
|
__publicField(this, "change", () => {
|
|
@@ -82,35 +60,23 @@ class Progress extends HTMLElement {
|
|
|
82
60
|
}
|
|
83
61
|
});
|
|
84
62
|
__publicField(this, "updateCurrentProgress", () => {
|
|
85
|
-
const percent = this.percent / this.total;
|
|
86
|
-
this._progressWrapValue.style.setProperty(
|
|
87
|
-
|
|
88
|
-
`scaleX(${percent})`
|
|
89
|
-
);
|
|
90
|
-
this._progressDot.style.setProperty(
|
|
91
|
-
"transform",
|
|
92
|
-
`translateX(${percent * this._progress.offsetWidth}px)`
|
|
93
|
-
);
|
|
63
|
+
const percent = Number(this.percent) / Number(this.total);
|
|
64
|
+
this._progressWrapValue.style.setProperty("transform", `scaleX(${percent})`);
|
|
65
|
+
this._progressDot.style.setProperty("transform", `translateX(${percent * this._progress.offsetWidth}px)`);
|
|
94
66
|
});
|
|
95
67
|
__publicField(this, "dragEvent", () => {
|
|
96
|
-
if (this.type !== "drag")
|
|
97
|
-
return;
|
|
68
|
+
if (this.type !== "drag") return;
|
|
98
69
|
this._progress.addEventListener("click", this.progressClick);
|
|
99
70
|
this._progressDot.addEventListener("mousedown", this.progressDotMouseDown);
|
|
100
71
|
document.addEventListener("mousemove", this.progressDotMouseMove);
|
|
101
72
|
document.addEventListener("mouseup", this.progressDotMouseUp);
|
|
102
73
|
});
|
|
103
|
-
__publicField(this, "createProgress", () => {
|
|
104
|
-
if (!this.contains(this._progress)) {
|
|
105
|
-
this.appendChild(this._progress);
|
|
106
|
-
this._progress.appendChild(this._progressDot);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
74
|
__publicField(this, "resize", () => {
|
|
110
75
|
this.updateCurrentProgress();
|
|
111
76
|
});
|
|
112
77
|
this._progress = document.createElement("div");
|
|
113
78
|
this._progress.setAttribute("class", "ran-progress");
|
|
79
|
+
this._progress.setAttribute("role", "progressbar");
|
|
114
80
|
this._progressWrap = document.createElement("div");
|
|
115
81
|
this._progressWrap.setAttribute("class", "ran-progress-wrap");
|
|
116
82
|
this._progress.appendChild(this._progressWrap);
|
|
@@ -122,6 +88,13 @@ class Progress extends HTMLElement {
|
|
|
122
88
|
this.moveProgress = {
|
|
123
89
|
mouseDown: false
|
|
124
90
|
};
|
|
91
|
+
this._progress.appendChild(this._progressDot);
|
|
92
|
+
const shadowRoot = this.attachShadow({ mode: "closed" });
|
|
93
|
+
const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
|
|
94
|
+
F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc;
|
|
95
|
+
shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
|
|
96
|
+
this._shadowDom = shadowRoot;
|
|
97
|
+
shadowRoot.appendChild(this._progress);
|
|
125
98
|
}
|
|
126
99
|
static get observedAttributes() {
|
|
127
100
|
return attributes;
|
|
@@ -129,20 +102,20 @@ class Progress extends HTMLElement {
|
|
|
129
102
|
get percent() {
|
|
130
103
|
const percent = this.getAttribute("percent") || "";
|
|
131
104
|
const num = perToNum(percent);
|
|
132
|
-
if (num > this.total) {
|
|
105
|
+
if (Number(num) > Number(this.total)) {
|
|
133
106
|
console.error("percent must be < total");
|
|
134
107
|
return this.total;
|
|
135
108
|
}
|
|
136
|
-
return perToNum(percent)
|
|
109
|
+
return `${perToNum(percent)}`;
|
|
137
110
|
}
|
|
138
111
|
set percent(value) {
|
|
139
112
|
this.setAttribute("percent", `${value || 0}`);
|
|
113
|
+
this.setAttribute("aria-valuenow", `${value || 0}`);
|
|
140
114
|
}
|
|
141
115
|
get total() {
|
|
142
116
|
const total = this.getAttribute("total");
|
|
143
|
-
if (!total)
|
|
144
|
-
|
|
145
|
-
return perToNum(total);
|
|
117
|
+
if (!total) return "1";
|
|
118
|
+
return `${perToNum(total)}`;
|
|
146
119
|
}
|
|
147
120
|
set total(value) {
|
|
148
121
|
this.setAttribute("total", value || "");
|
|
@@ -184,25 +157,23 @@ class Progress extends HTMLElement {
|
|
|
184
157
|
this.setAttribute("dot", value || "true");
|
|
185
158
|
}
|
|
186
159
|
connectedCallback() {
|
|
160
|
+
const type = this.getAttribute("type");
|
|
161
|
+
if (!type) {
|
|
162
|
+
this.setAttribute("type", "primary");
|
|
163
|
+
}
|
|
187
164
|
this.dragEvent();
|
|
188
165
|
this.updateCurrentProgress();
|
|
189
166
|
window.addEventListener("resize", this.resize);
|
|
190
167
|
}
|
|
191
168
|
disconnectCallback() {
|
|
192
169
|
this._progress.removeEventListener("click", this.progressClick);
|
|
193
|
-
this._progressDot.removeEventListener(
|
|
194
|
-
"mousedown",
|
|
195
|
-
this.progressDotMouseDown
|
|
196
|
-
);
|
|
170
|
+
this._progressDot.removeEventListener("mousedown", this.progressDotMouseDown);
|
|
197
171
|
document.removeEventListener("mousemove", this.progressDotMouseMove);
|
|
198
172
|
document.removeEventListener("mouseup", this.progressDotMouseUp);
|
|
199
173
|
window.removeEventListener("resize", this.resize);
|
|
200
174
|
}
|
|
201
175
|
attributeChangedCallback(k, o, n) {
|
|
202
176
|
if (o !== n) {
|
|
203
|
-
if (k === "type") {
|
|
204
|
-
this.createProgress();
|
|
205
|
-
}
|
|
206
177
|
if (k === "dot") {
|
|
207
178
|
this.appendProgressDot();
|
|
208
179
|
}
|
|
@@ -214,7 +185,8 @@ class Progress extends HTMLElement {
|
|
|
214
185
|
}
|
|
215
186
|
function Custom() {
|
|
216
187
|
if (typeof document !== "undefined" && !customElements.get("r-progress")) {
|
|
217
|
-
customElements.define("r-progress", Progress);
|
|
188
|
+
Progress && customElements.define("r-progress", Progress);
|
|
189
|
+
return Progress;
|
|
218
190
|
} else {
|
|
219
191
|
return createCustomError("document is undefined or r-progress is exist");
|
|
220
192
|
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
import { c as create, a as addClassToElement, r as removeClassToElement } from "./arrow-down-B_hCY3Wt.js";
|
|
5
|
+
import { H as HTMLElementSSR, f as falseList, c as createCustomError } from "./index-DC5EA657.js";
|
|
6
|
+
const f7170ee498e0dd32cbdcb63fba8f75cc = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{position:var(--ran-checkbox-host-position, relative);display:var(--ran-checkbox-host-display, block);margin:var(--ran-checkbox-host-margin, 0);padding:var(--ran-checkbox-host-padding, 0);box-sizing:var(--ran-checkbox-host-box-sizing, border-box);list-style:var(--ran-checkbox-host-list-style, none)}:host([disabled]){opacity:var(--ran-checkbox-disabled-opacity, .6)}:host([disabled]) .ran-checkbox-input{cursor:var(--ran-checkbox-disabled-cursor, not-allowed);pointer-events:var(--ran-checkbox-disabled-pointer-events, all)}:host([disabled]) .ran-checkbox-inner{background-color:var(--ran-checkbox-checked-background-color, #d9d9d9);border:1px solid #d9d9d9}:host([disabled]) .ran-checkbox-inner:after{cursor:not-allowed;pointer-events:none;opacity:var(--ran-checkbox-checked-after-opacity, 1)}:host([disabled]) .ran-checkbox-checked .ran-checkbox-inner{background-color:var(--ran-checkbox-checked-background-color, #d9d9d9)}:host([disabled]) .ran-checkbox-checked .ran-checkbox-inner:after{opacity:var(--ran-checkbox-checked-after-opacity, 0)}.ran-checkbox{position:var(--ran-checkbox-position, relative);display:var(--ran-checkbox-display, block);box-sizing:var(--ran-checkbox-box-sizing, border-box);margin:var(--ran-checkbox-margin, 0);width:var(--ran-checkbox-width, 16px);height:var(--ran-checkbox-height, 16px);padding:var(--ran-checkbox-padding, 0);color:var(--ran-checkbox-color, rgba(0, 0, 0, .88));font-size:var(--ran-checkbox-font-size, 14px);line-height:var(--ran-checkbox-line-height, 1);list-style:var(--ran-checkbox-list-style, none);font-family:var(--ran-checkbox-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");white-space:var(--ran-checkbox-white-space, nowrap);cursor:var(--ran-checkbox-cursor, pointer);border-radius:var(--ran-checkbox-border-radius, 4px)}.ran-checkbox-input{position:var(--ran-checkbox-input-position, absolute);inset:var(--ran-checkbox-input-inset, 0);z-index:var(--ran-checkbox-input-z-index, 1);cursor:var(--ran-checkbox-input-cursor, pointer);opacity:var(--ran-checkbox-input-opacity, 0);margin:var(--ran-checkbox-input-margin, 0)}.ran-checkbox-inner{box-sizing:var(--ran-checkbox-inner-box-sizing, border-box);display:var(--ran-checkbox-inner-display, block);width:var(--ran-checkbox-inner-width, 16px);height:var(--ran-checkbox-inner-height, 16px);direction:var(--ran-checkbox-inner-direction, ltr);background-color:var(--ran-checkbox-inner-background-color, #fff);border:var(--ran-checkbox-inner-border, 1px solid #d9d9d9);border-radius:var(--ran-checkbox-inner-border-radius, 4px);border-collapse:var(--ran-checkbox-inner-border-collapse, separate)}.ran-checkbox-inner:after{box-sizing:var(--ran-checkbox-inner-after-box-sizing, border-box);position:var(--ran-checkbox-inner-after-position, absolute);top:var(--ran-checkbox-inner-after-top, 50%);inset-inline-start:var(--ran-checkbox-inner-after-inset-inline-start, 25%);display:var(--ran-checkbox-inner-after-display, table);width:var(--ran-checkbox-inner-after-width, calc(16px / 14 * 5));height:var(--ran-checkbox-inner-after-height, calc(16px / 14 * 8));border:var(--ran-checkbox-inner-after-border, 2px solid #fff);border-top:var(--ran-checkbox-inner-after-border-top, 0);border-inline-start:var(--ran-checkbox-inner-after-border-inline-start, 0);opacity:var(--ran-checkbox-inner-after-opacity, 0);content:var(--ran-checkbox-inner-after-content, "");transition:var(--ran-checkbox-inner-after-transition, all .1s cubic-bezier(.71, -.46, .88, .6), opacity .1s);transform:var(--ran-checkbox-inner-after-transform, rotate(45deg) scale(1) translate(-50%, -50%))}.ran-checkbox-checked .ran-checkbox-inner{background-color:var(--ran-checkbox-checked-background-color, #1677ff);border:var(--ran-checkbox-checked-border, 1px solid #1677ff)}.ran-checkbox-checked .ran-checkbox-inner:after{opacity:var(--ran-checkbox-checked-after-opacity, 1)}';
|
|
7
|
+
class Checkbox extends HTMLElementSSR() {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
__publicField(this, "checkInput");
|
|
11
|
+
__publicField(this, "checkInner");
|
|
12
|
+
__publicField(this, "context");
|
|
13
|
+
__publicField(this, "container");
|
|
14
|
+
__publicField(this, "_shadowDom");
|
|
15
|
+
__publicField(this, "updateChecked", () => {
|
|
16
|
+
const { checked } = this.context;
|
|
17
|
+
if (checked) {
|
|
18
|
+
this.setAttribute("checked", "true");
|
|
19
|
+
this.setAttribute("value", "true");
|
|
20
|
+
addClassToElement(this.container, "ran-checkbox-checked");
|
|
21
|
+
} else {
|
|
22
|
+
this.setAttribute("checked", "false");
|
|
23
|
+
this.setAttribute("value", "false");
|
|
24
|
+
removeClassToElement(this.container, "ran-checkbox-checked");
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
__publicField(this, "update", () => {
|
|
28
|
+
this.updateChecked();
|
|
29
|
+
});
|
|
30
|
+
__publicField(this, "onChange", () => {
|
|
31
|
+
if (falseList.includes(this.disabled)) return;
|
|
32
|
+
if (this.hasAttribute("disabled")) return;
|
|
33
|
+
const { checked } = this.context;
|
|
34
|
+
this.context.checked = !checked;
|
|
35
|
+
this.dispatchEvent(
|
|
36
|
+
new CustomEvent("change", {
|
|
37
|
+
detail: {
|
|
38
|
+
checked: this.context.checked
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
);
|
|
42
|
+
this.update();
|
|
43
|
+
});
|
|
44
|
+
this.checkInput = document.createElement("input");
|
|
45
|
+
this.checkInput.setAttribute("class", "ran-checkbox-input");
|
|
46
|
+
this.checkInput.setAttribute("type", "checkbox");
|
|
47
|
+
this.checkInner = document.createElement("span");
|
|
48
|
+
this.checkInner.setAttribute("class", "ran-checkbox-inner");
|
|
49
|
+
this.container = create("div").setAttribute("class", "ran-checkbox").addChild([this.checkInput, this.checkInner]).element;
|
|
50
|
+
const shadowRoot = this.attachShadow({ mode: "closed" });
|
|
51
|
+
const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
|
|
52
|
+
F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc;
|
|
53
|
+
shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
|
|
54
|
+
this._shadowDom = shadowRoot;
|
|
55
|
+
shadowRoot.appendChild(this.container);
|
|
56
|
+
this.context = {
|
|
57
|
+
checked: false
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
static get observedAttributes() {
|
|
61
|
+
return ["disabled", "checked", "value"];
|
|
62
|
+
}
|
|
63
|
+
get disabled() {
|
|
64
|
+
return this.getAttribute("disabled") || "";
|
|
65
|
+
}
|
|
66
|
+
set disabled(value) {
|
|
67
|
+
this.setAttribute("disabled", value);
|
|
68
|
+
}
|
|
69
|
+
get value() {
|
|
70
|
+
const checked = this.getAttribute("value");
|
|
71
|
+
if (falseList.includes(checked)) {
|
|
72
|
+
this.context.checked = false;
|
|
73
|
+
}
|
|
74
|
+
return `${this.context.checked}`;
|
|
75
|
+
}
|
|
76
|
+
set value(value) {
|
|
77
|
+
if (falseList.includes(value)) {
|
|
78
|
+
this.setAttribute("value", "false");
|
|
79
|
+
this.context.checked = false;
|
|
80
|
+
} else {
|
|
81
|
+
this.setAttribute("value", "true");
|
|
82
|
+
this.context.checked = true;
|
|
83
|
+
}
|
|
84
|
+
this.updateChecked();
|
|
85
|
+
}
|
|
86
|
+
get checked() {
|
|
87
|
+
const checked = this.getAttribute("checked");
|
|
88
|
+
if (falseList.includes(checked)) {
|
|
89
|
+
this.context.checked = false;
|
|
90
|
+
}
|
|
91
|
+
return `${this.context.checked}`;
|
|
92
|
+
}
|
|
93
|
+
set checked(value) {
|
|
94
|
+
if (falseList.includes(value)) {
|
|
95
|
+
this.setAttribute("checked", "false");
|
|
96
|
+
this.context.checked = false;
|
|
97
|
+
} else {
|
|
98
|
+
this.setAttribute("checked", "true");
|
|
99
|
+
this.context.checked = true;
|
|
100
|
+
}
|
|
101
|
+
this.updateChecked();
|
|
102
|
+
}
|
|
103
|
+
connectedCallback() {
|
|
104
|
+
this.addEventListener("click", this.onChange);
|
|
105
|
+
}
|
|
106
|
+
disconnectCallback() {
|
|
107
|
+
this.removeEventListener("click", this.onChange);
|
|
108
|
+
}
|
|
109
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
110
|
+
if (oldValue !== newValue) {
|
|
111
|
+
if (name === "checked") {
|
|
112
|
+
this.checked = newValue;
|
|
113
|
+
this.value = newValue;
|
|
114
|
+
}
|
|
115
|
+
if (name === "value") {
|
|
116
|
+
this.checked = newValue;
|
|
117
|
+
this.value = newValue;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function Custom() {
|
|
123
|
+
if (typeof document !== "undefined" && !customElements.get("r-checkbox")) {
|
|
124
|
+
customElements.define("r-checkbox", Checkbox);
|
|
125
|
+
return Checkbox;
|
|
126
|
+
} else {
|
|
127
|
+
return createCustomError("document is undefined or r-checkbox is exist");
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const index = Custom();
|
|
131
|
+
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
132
|
+
__proto__: null,
|
|
133
|
+
Checkbox,
|
|
134
|
+
default: index
|
|
135
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
136
|
+
export {
|
|
137
|
+
Checkbox as C,
|
|
138
|
+
index as a,
|
|
139
|
+
index$1 as i
|
|
140
|
+
};
|