ranui 0.1.8 → 0.1.10-alpha-24
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 +192 -0
- package/dist/assets/image/failImage.d.ts +2 -0
- package/dist/button.js +7 -0
- package/dist/checkbox.js +7 -0
- package/dist/colorpicker.js +11 -0
- package/dist/components/button/index.d.ts +37 -1
- package/dist/components/checkbox/index.d.ts +30 -0
- package/dist/components/colorpicker/index.d.ts +120 -0
- package/dist/components/dropdown/index.d.ts +34 -0
- package/dist/components/input/index.d.ts +209 -1
- package/dist/components/loading/index.d.ts +76 -0
- package/dist/components/math/index.d.ts +16 -0
- package/dist/components/message/index.d.ts +10 -7
- package/dist/components/player/index.d.ts +218 -492
- package/dist/components/popover/content/index.d.ts +16 -0
- package/dist/components/popover/index.d.ts +91 -0
- package/dist/components/preview/constant.d.ts +5 -0
- package/dist/components/preview/index.d.ts +1 -4
- package/dist/components/preview/pdf.d.ts +51 -1
- package/dist/components/preview/types.d.ts +11 -0
- package/dist/components/progress/index.d.ts +12 -7
- package/dist/components/radar/index.d.ts +1 -1
- package/dist/components/scratch/index.d.ts +21 -0
- package/dist/components/select/dropdown-item/index.d.ts +23 -0
- package/dist/components/select/index.d.ts +25 -12
- package/dist/components/select/option/index.d.ts +2 -0
- package/dist/components/tab/index.d.ts +80 -59
- package/dist/components/tabpane/index.d.ts +73 -52
- package/dist/icon.js +6 -0
- package/dist/iconShadowless.js +6 -0
- package/dist/image.js +4 -0
- package/dist/{index-aea75a9f.js → index-BEm1a2pr.js} +3 -6
- package/dist/{index-b2be6bef.js → index-BSyn-jmY.js} +5492 -3716
- package/dist/index-BVD0qcjJ.js +656 -0
- package/dist/{index-b90299ca.js → index-Bb55l8nf.js} +2 -11
- package/dist/{index-48653b79.js → index-BbW0dxzy.js} +12 -16
- package/dist/index-BgUpm4LA.js +103 -0
- package/dist/{index-a1a53af6.js → index-C841uRgZ.js} +16 -51
- package/dist/{index-a43b144f.js → index-CUZna268.js} +41 -69
- package/dist/index-CiA5qRK3.js +381 -0
- package/dist/index-CoJMn8Jm.js +511 -0
- package/dist/{index-5975bbc0.js → index-DAxs7Dd2.js} +6 -13
- package/dist/index-D_cD4u43.js +70 -0
- package/dist/index-DgVgxN1s.js +309 -0
- package/dist/index-DghvN1MU.js +710 -0
- package/dist/index-DvSe_Ms7.js +494 -0
- package/dist/{index-7f513a14.js → index-W52VzrXL.js} +20 -49
- package/dist/index-gBy2cXLV.js +140 -0
- package/dist/index-hdtEL8P_.js +101 -0
- package/dist/index-jVKJoKXA.js +490 -0
- package/dist/index-ltt3w4zP.js +187 -0
- package/dist/index-n4X6wdwJ.js +156 -0
- package/dist/{index-0e7229ea.js → index-s0ioL3L2.js} +23 -43
- package/dist/index.d.ts +276 -14
- package/dist/index.js +24 -24
- package/dist/input.js +7 -0
- package/dist/inputShadowless.js +6 -0
- package/dist/katex-es-CGqSCDjs.js +14634 -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/more-2vsTDpcc.js +31 -0
- package/dist/pdf-Bis_tkvj.js +134 -0
- package/dist/player.js +8 -0
- package/dist/plus-DgJxWGlo.js +56799 -0
- package/dist/popover.js +9 -0
- package/dist/preview.js +7 -0
- package/dist/progress.js +7 -0
- package/dist/radar.js +6 -0
- package/dist/ranui.css +1 -0
- package/dist/search-BWdfjyP8.js +4 -0
- package/dist/select.js +10 -0
- package/dist/{index-f6d6982d.js → selectShadowless.js} +203 -159
- package/dist/{umd/components/form → shadowless/icon}/index.d.ts +1 -0
- package/dist/shadowless/input/index.d.ts +210 -0
- package/dist/{umd/components → shadowless}/select/index.d.ts +22 -15
- package/dist/shadowless/select/option/index.d.ts +2 -0
- package/dist/shadowless.d.ts +3 -0
- package/dist/shadowless.js +8 -0
- package/dist/skeleton.js +4 -0
- package/dist/sort-DWqiUONr.js +4 -0
- package/dist/sprite-CH2zLtZy.js +141 -0
- package/dist/tab.js +6 -0
- package/dist/tabpane.js +4 -0
- package/dist/tsconfig.json +31 -0
- package/dist/typings.d.ts +257 -0
- package/dist/umd/index.css +1 -0
- package/dist/umd/index.umd.cjs +1 -71
- package/dist/umd/shadowless/shadowless.css +1 -0
- package/dist/umd/shadowless/shadowless.umd.cjs +1 -0
- package/dist/utils/color.d.ts +52 -0
- package/dist/utils/image.d.ts +8 -1
- package/dist/utils/index.d.ts +20 -5
- package/dist/utils/math.d.ts +3 -3
- package/dist/vite.config.d.ts +1 -0
- package/dist/without-content-CdJw7vHM.js +4 -0
- package/package.json +115 -67
- package/readme.md +41 -57
- package/typings.d.ts +257 -0
- package/dist/colz-746223ab.js +0 -241
- package/dist/components/button/index.js +0 -7
- package/dist/components/icon/index.js +0 -6
- package/dist/components/image/index.js +0 -4
- package/dist/components/input/index.js +0 -5
- package/dist/components/message/index.js +0 -4
- 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.js +0 -11
- 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.js +0 -8
- 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.js +0 -8
- package/dist/components/radar/index.js +0 -7
- package/dist/components/select/index.js +0 -11
- package/dist/components/skeleton/index.js +0 -4
- package/dist/components/tab/index.js +0 -7
- package/dist/components/tabpane/index.js +0 -4
- package/dist/docx-c5d02d8c.js +0 -21
- package/dist/index-183517e7.js +0 -265
- package/dist/index-4d873a42.js +0 -195
- package/dist/index-57492b9b.js +0 -48
- package/dist/index-7b8840f9.js +0 -18690
- package/dist/index-a216f328.js +0 -662
- package/dist/index-d2d69b06.js +0 -225
- package/dist/index-ecaed5cc.js +0 -439
- package/dist/pdf-bdb7818a.js +0 -113
- package/dist/style.css +0 -1
- package/dist/umd/build/config.d.ts +0 -3
- package/dist/umd/build/config.umd.d.ts +0 -2
- package/dist/umd/components/button/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 -2
- 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 -524
- 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/skeleton/index.d.ts +0 -2
- package/dist/umd/components/tab/index.d.ts +0 -403
- package/dist/umd/components/tabpane/index.d.ts +0 -347
- 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/style.css +0 -1
- 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/vendor-f71e6f68.js +0 -92126
- /package/dist/{add-user-b2bed3e7.js → add-user-BN1JlY7e.js} +0 -0
- /package/dist/{book-b11a68eb.js → book-nTEFXU2x.js} +0 -0
- /package/dist/{umd/build/config.es.d.ts → build/config.sha.d.ts} +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/{info-circle-fill-90ec9aa9.js → info-circle-fill-DjI8gXS3.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
package/dist/index-4d873a42.js
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) => {
|
|
4
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
7
|
-
import { j as judgeDevice } from "./index-d2d69b06.js";
|
|
8
|
-
import { c as createCustomError, i as isDisabled, f as falseList } from "./index-57492b9b.js";
|
|
9
|
-
const f7170ee498e0dd32cbdcb63fba8f75cc = ':host{position:relative;display:inline-block;background-image:none;box-shadow:0 2px #00000004;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;touch-action:manipulation;overflow:hidden;pointer-events:auto}:host .ran-btn{position:relative;display:inline-block;background-image:none;cursor:pointer;transition:all .3s cubic-bezier(.645,.045,.355,1);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;touch-action:manipulation;background:#fff}:host,:host(:active),:host(:focus){outline:0}:host .ran-btn,:host(:active) .ran-btn,:host(:focus) .ran-btn{outline:0}:host(:not([disabled]):hover) .ran-btn-content{border-color:#1890ff;color:#1890ff}:host([type="primary"]) .ran-btn-content{border-color:#1890ff;background-color:#1890ff;color:#fff}:host([type="primary"]:not([disabled])) .ran-btn:after{background-image:radial-gradient(circle,#fff 10%,transparent 10.01%)}:host([type="primary"]:not([disabled]):hover) .ran-btn-content{background-color:#40a9ff;color:#fff}:host([type="warning"]) .ran-btn-content{border-color:#ff4d4f;background-color:#ff4d4f;color:#fff}:host([type="warning"]:not([disabled])) .ran-btn:after{background-image:radial-gradient(circle,#fff 10%,transparent 10.01%)}:host([type="warning"]:not([disabled]):hover) .ran-btn-content{border-color:#ff4d4f;background-color:#ff4d4f;color:#fff}:host([type="text"]) .ran-btn-content{border:none}:host([disabled]){cursor:not-allowed;pointer-events:all;opacity:.6}:host([disabled]) .ran-btn{cursor:not-allowed;pointer-events:all;opacity:.6}:host(:not([disabled]):active) .ran-btn:after{transform:translate(-50%,-50%) scale(0);opacity:.3;transition:0s}@media (min-width: 1024px){:host(:not([disabled],[effect])) .ran-btn:after{content:"";display:block;position:absolute;width:100%;height:100%;left:var(--ran-x, 0);top:var(--ran-y, 0);pointer-events:none;background-image:radial-gradient(circle,#1890ff 10%,transparent 10.01%);background-repeat:no-repeat;background-position:50%;transform:translate(-50%,-50%) scale(10);opacity:0;transition:transform .3s,opacity .8s}}:host .slot{display:block}.ran-btn-content{display:flex;justify-content:space-between;align-items:center;padding:4px 15px;border:1px solid transparent;border-radius:2px;border-color:#d9d9d9;color:#000000d9;line-height:22px;font-size:14px;font-weight:400;white-space:nowrap;text-align:center}.ran-btn-content .icon{margin-right:2px}\n';
|
|
10
|
-
function Custom() {
|
|
11
|
-
if (typeof document !== "undefined" && !customElements.get("r-button")) {
|
|
12
|
-
class Button extends HTMLElement {
|
|
13
|
-
constructor() {
|
|
14
|
-
super();
|
|
15
|
-
__publicField(this, "_btn");
|
|
16
|
-
__publicField(this, "_btnContent");
|
|
17
|
-
__publicField(this, "_iconElement");
|
|
18
|
-
__publicField(this, "_slot");
|
|
19
|
-
__publicField(this, "_shadowDom");
|
|
20
|
-
__publicField(this, "debounceTimeId");
|
|
21
|
-
/**
|
|
22
|
-
* @description: 设置button的icon
|
|
23
|
-
* @return {*}
|
|
24
|
-
*/
|
|
25
|
-
__publicField(this, "setIcon", () => {
|
|
26
|
-
if (this.icon) {
|
|
27
|
-
const { width, height } = this._slot.getBoundingClientRect();
|
|
28
|
-
const size = Math.min(width, height);
|
|
29
|
-
if (this._iconElement) {
|
|
30
|
-
this._iconElement.setAttribute("name", this.icon);
|
|
31
|
-
} else {
|
|
32
|
-
this._iconElement = document.createElement("r-icon");
|
|
33
|
-
this._iconElement.setAttribute("name", this.icon);
|
|
34
|
-
this._iconElement.setAttribute("color", "currentColor");
|
|
35
|
-
this._iconElement.setAttribute("class", "icon");
|
|
36
|
-
this._slot.insertAdjacentElement("beforebegin", this._iconElement);
|
|
37
|
-
}
|
|
38
|
-
if (this.iconSize) {
|
|
39
|
-
this._iconElement.setAttribute("size", this.iconSize);
|
|
40
|
-
} else {
|
|
41
|
-
this._iconElement.setAttribute("size", `${size - 5}`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
__publicField(this, "mousedown", (event) => {
|
|
46
|
-
if (judgeDevice() !== "pc")
|
|
47
|
-
return;
|
|
48
|
-
if (!this.disabled || this.disabled === "false") {
|
|
49
|
-
this.debounceMouseEvent();
|
|
50
|
-
const { left, top } = this.getBoundingClientRect();
|
|
51
|
-
this._btn.style.setProperty("--ran-x", event.clientX - left + "px");
|
|
52
|
-
this._btn.style.setProperty("--ran-y", event.clientY - top + "px");
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
__publicField(this, "mouseup", (event) => {
|
|
56
|
-
if (judgeDevice() !== "pc")
|
|
57
|
-
return;
|
|
58
|
-
if (this.debounceTimeId)
|
|
59
|
-
return;
|
|
60
|
-
this.debounceTimeId = setTimeout(() => {
|
|
61
|
-
this._btn.style.removeProperty("--ran-x");
|
|
62
|
-
this._btn.style.removeProperty("--ran-y");
|
|
63
|
-
this.debounceMouseEvent();
|
|
64
|
-
}, 600);
|
|
65
|
-
});
|
|
66
|
-
__publicField(this, "debounceMouseEvent", () => {
|
|
67
|
-
clearTimeout(this.debounceTimeId);
|
|
68
|
-
this.debounceTimeId = void 0;
|
|
69
|
-
});
|
|
70
|
-
this._slot = document.createElement("slot");
|
|
71
|
-
this._btnContent = document.createElement("div");
|
|
72
|
-
this._btn = document.createElement("div");
|
|
73
|
-
this._btn.setAttribute("class", "ran-btn");
|
|
74
|
-
this._btn.setAttribute("part", "ran-btn");
|
|
75
|
-
this._btnContent.setAttribute("class", "ran-btn-content");
|
|
76
|
-
this._btnContent.setAttribute("part", "ran-btn-content");
|
|
77
|
-
this._btnContent.appendChild(this._slot);
|
|
78
|
-
this._slot.setAttribute("class", "slot");
|
|
79
|
-
const shadowRoot = this.attachShadow({ mode: "closed" });
|
|
80
|
-
const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
|
|
81
|
-
F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc;
|
|
82
|
-
shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
|
|
83
|
-
this._shadowDom = shadowRoot;
|
|
84
|
-
this._btn.appendChild(this._btnContent);
|
|
85
|
-
shadowRoot.appendChild(this._btn);
|
|
86
|
-
}
|
|
87
|
-
static get observedAttributes() {
|
|
88
|
-
return ["disabled", "icon", "effect", "iconSize", "sheet"];
|
|
89
|
-
}
|
|
90
|
-
get sheet() {
|
|
91
|
-
return this.getAttribute("sheet");
|
|
92
|
-
}
|
|
93
|
-
set sheet(value) {
|
|
94
|
-
this.setAttribute("sheet", value || "");
|
|
95
|
-
}
|
|
96
|
-
get disabled() {
|
|
97
|
-
return isDisabled(this);
|
|
98
|
-
}
|
|
99
|
-
set disabled(value) {
|
|
100
|
-
if (!value || value === "false") {
|
|
101
|
-
this.removeAttribute("disabled");
|
|
102
|
-
this.removeAttribute("aria-disabled");
|
|
103
|
-
} else {
|
|
104
|
-
this.setAttribute("disabled", "");
|
|
105
|
-
this.setAttribute("aria-disabled", "true");
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
get iconSize() {
|
|
109
|
-
return this.getAttribute("iconSize");
|
|
110
|
-
}
|
|
111
|
-
set iconSize(value) {
|
|
112
|
-
if (!value || value === "false") {
|
|
113
|
-
this.removeAttribute("iconSize");
|
|
114
|
-
} else {
|
|
115
|
-
this.setAttribute("iconSize", value);
|
|
116
|
-
this.setIcon();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
get icon() {
|
|
120
|
-
return this.getAttribute("icon");
|
|
121
|
-
}
|
|
122
|
-
set icon(value) {
|
|
123
|
-
if (!value || value === "false") {
|
|
124
|
-
this.removeAttribute("icon");
|
|
125
|
-
} else {
|
|
126
|
-
this.setAttribute("icon", value);
|
|
127
|
-
this.setIcon();
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
get effect() {
|
|
131
|
-
return this.getAttribute("effect");
|
|
132
|
-
}
|
|
133
|
-
set effect(value) {
|
|
134
|
-
if (falseList.includes(value) || !value) {
|
|
135
|
-
this.removeAttribute("effect");
|
|
136
|
-
} else {
|
|
137
|
-
this.setAttribute("effect", value);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
handlerExternalCss() {
|
|
141
|
-
if (this.sheet) {
|
|
142
|
-
try {
|
|
143
|
-
const sheet = new CSSStyleSheet();
|
|
144
|
-
sheet.insertRule(this.sheet);
|
|
145
|
-
this._shadowDom.adoptedStyleSheets = [sheet];
|
|
146
|
-
} catch (error) {
|
|
147
|
-
console.error(
|
|
148
|
-
`Failed to parse the rule in CSSStyleSheet: ${this.sheet}`
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
connectedCallback() {
|
|
154
|
-
this._btn.addEventListener("mousedown", this.mousedown);
|
|
155
|
-
this._btn.addEventListener("mouseup", this.mouseup);
|
|
156
|
-
this.handlerExternalCss();
|
|
157
|
-
this.setIcon();
|
|
158
|
-
this.setAttribute("role", "button");
|
|
159
|
-
this.setAttribute("tabindex", "0");
|
|
160
|
-
}
|
|
161
|
-
disconnectCallback() {
|
|
162
|
-
this._btn.removeEventListener("mousedown", this.mousedown);
|
|
163
|
-
this._btn.removeEventListener("mouseup", this.mouseup);
|
|
164
|
-
}
|
|
165
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
166
|
-
if (name === "disabled" && this._btnContent) {
|
|
167
|
-
if (!newValue || newValue === "false") {
|
|
168
|
-
this._btnContent.setAttribute("disabled", "");
|
|
169
|
-
} else {
|
|
170
|
-
this._btnContent.removeAttribute("disabled");
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
if (name === "icon" && this._btnContent && oldValue !== newValue)
|
|
174
|
-
this.setIcon();
|
|
175
|
-
if (name === "iconSize" && this._btnContent && oldValue !== newValue)
|
|
176
|
-
this._btnContent.setAttribute("iconSize", newValue);
|
|
177
|
-
if (name === "sheet" && this._shadowDom && oldValue !== newValue)
|
|
178
|
-
this.handlerExternalCss();
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
customElements.define("r-button", Button);
|
|
182
|
-
return Button;
|
|
183
|
-
} else {
|
|
184
|
-
return createCustomError("document is undefined or r-button is exist");
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
const index = Custom();
|
|
188
|
-
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
189
|
-
__proto__: null,
|
|
190
|
-
default: index
|
|
191
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
192
|
-
export {
|
|
193
|
-
index as a,
|
|
194
|
-
index$1 as i
|
|
195
|
-
};
|
package/dist/index-57492b9b.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) => {
|
|
4
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
7
|
-
const falseList = [false, "false", null, void 0];
|
|
8
|
-
const isDisabled = (element) => {
|
|
9
|
-
const status = element.hasAttribute("disabled");
|
|
10
|
-
const value = element.getAttribute("disabled");
|
|
11
|
-
if (status && !falseList.includes(value))
|
|
12
|
-
return true;
|
|
13
|
-
return false;
|
|
14
|
-
};
|
|
15
|
-
const removeClassToElementChild = (parent, deleteClass) => {
|
|
16
|
-
const pre = parent.querySelectorAll(`.${deleteClass}`);
|
|
17
|
-
if (pre.length > 0) {
|
|
18
|
-
pre.forEach((item) => item.classList.remove(deleteClass));
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
const loadScript = (src) => {
|
|
22
|
-
return new Promise((resolve, reject) => {
|
|
23
|
-
const script = document.createElement("script");
|
|
24
|
-
script.src = src;
|
|
25
|
-
script.onload = function() {
|
|
26
|
-
resolve({ success: true });
|
|
27
|
-
};
|
|
28
|
-
script.onerror = function(error) {
|
|
29
|
-
reject({ success: false, error });
|
|
30
|
-
};
|
|
31
|
-
document.body.append(script);
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
function createCustomError(msg) {
|
|
35
|
-
return class CustomError {
|
|
36
|
-
constructor(message = msg) {
|
|
37
|
-
__publicField(this, "message");
|
|
38
|
-
this.message = message;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
export {
|
|
43
|
-
createCustomError as c,
|
|
44
|
-
falseList as f,
|
|
45
|
-
isDisabled as i,
|
|
46
|
-
loadScript as l,
|
|
47
|
-
removeClassToElementChild as r
|
|
48
|
-
};
|