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
|
@@ -1,12 +1,8 @@
|
|
|
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 { i as isDisabled, f as falseList, c as createCustomError } from "./index-57492b9b.js";
|
|
8
|
-
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}.ran-input{position:relative;display:flex;width:calc(100% - 16px);height:calc(100% - 4px);min-width:0;padding:2px 8px;color:#000000d9;font-size:12px;line-height:1.5715;background-color:#fff;background-image:none;border-width:1px;border-style:solid;border-color:#d9d9d9;border-radius:2px;transition:all .3s}.ran-input:active{border-color:#40a9ff;box-shadow:0 0 0 2px #1890ff33;border-right-width:1px;outline:0}.ran-input:hover{border-color:#40a9ff;border-right-width:1px}.ran-input>.ran-input-content:hover~.ran-input-label{color:#40a9ff}.ran-input[value]>.ran-input-label{transform:translateY(calc(-50% - .43em)) scale(.8);color:#00000040}.ran-input[status=error]{border-color:#ff4d4f}.ran-input[status=error]>.ran-input-content~.ran-input-label{color:#ff4d4f}.ran-input[status=warning]{border-color:#ff7875}.ran-input[status=warning]>.ran-input-content~.ran-input-label{color:#ff7875}.ran-input[disabled]{color:#00000040;background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;cursor:not-allowed;opacity:1}.ran-input[disabled]>.ran-input-content{color:#00000040;background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;cursor:not-allowed;opacity:1}.ran-input[disabled]>.ran-input-content~.ran-input-label{color:#00000040;background-color:#f5f5f5}.ran-input[disabled]>.ran-input-label{color:#999;border-color:#d9d9d9;box-shadow:none;cursor:not-allowed}.ran-input-content{writing-mode:horizontal-tb;text-rendering:auto;letter-spacing:normal;word-spacing:normal;text-transform:none;text-indent:0px;text-shadow:none;text-align:start;-webkit-rtl-ordering:logical;cursor:text;touch-action:manipulation;-webkit-appearance:none;text-overflow:ellipsis;box-sizing:border-box;margin:0;font-variant:tabular-nums;list-style:none;font-feature-settings:"tnum";position:relative;border:none;width:100%;min-width:0;color:#000000d9;font-size:14px;line-height:1.48;background-color:#fff;background-image:none;transition:all .3s;outline:none}.ran-input-content:focus,.ran-input-content:hover{border:none;outline:0}.ran-input-content::placeholder{color:#999}.ran-input-content:placeholder-shown~.ran-input-label{transform:translateY(calc(-50% - .43em)) scale(.8)}.ran-input-content:focus~.ran-input-label{transform:translateY(calc(-50% - .43em)) scale(.8)}.ran-input-content::-webkit-search-cancel-button{display:none;-webkit-appearance:none}.ran-input-label{pointer-events:none;position:absolute;font-size:14px;left:8px;transition:transform .3s,color .3s,background-color .3s,backdrop-filter .3s;transform-origin:left;padding:0 .2em;color:#999;background:#fff;opacity:.9}\n';
|
|
9
|
-
class Input extends HTMLElement {
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
import { H as HTMLElementSSR, i as isDisabled, f as falseList, c as createCustomError } from "./index-DC5EA657.js";
|
|
5
|
+
class Input extends HTMLElementSSR() {
|
|
10
6
|
constructor() {
|
|
11
7
|
super();
|
|
12
8
|
__publicField(this, "_input");
|
|
@@ -14,7 +10,7 @@ class Input extends HTMLElement {
|
|
|
14
10
|
__publicField(this, "_inputContent");
|
|
15
11
|
__publicField(this, "_icon");
|
|
16
12
|
/**
|
|
17
|
-
* @description: 原生的input方法
|
|
13
|
+
* @description: 原生的 input 方法
|
|
18
14
|
* @param {Event} event
|
|
19
15
|
*/
|
|
20
16
|
__publicField(this, "customInput", (event) => {
|
|
@@ -32,7 +28,7 @@ class Input extends HTMLElement {
|
|
|
32
28
|
);
|
|
33
29
|
});
|
|
34
30
|
/**
|
|
35
|
-
* @description: 增加change方法,同时兼容大小写的情况
|
|
31
|
+
* @description: 增加 change 方法,同时兼容大小写的情况
|
|
36
32
|
*/
|
|
37
33
|
__publicField(this, "customChange", () => {
|
|
38
34
|
this.dispatchEvent(
|
|
@@ -44,7 +40,7 @@ class Input extends HTMLElement {
|
|
|
44
40
|
);
|
|
45
41
|
});
|
|
46
42
|
/**
|
|
47
|
-
* @description: 监听placeholder属性函数
|
|
43
|
+
* @description: 监听 placeholder 属性函数
|
|
48
44
|
* @param {string} name
|
|
49
45
|
* @param {string} value
|
|
50
46
|
*/
|
|
@@ -58,7 +54,7 @@ class Input extends HTMLElement {
|
|
|
58
54
|
}
|
|
59
55
|
});
|
|
60
56
|
/**
|
|
61
|
-
* @description: 监听label属性函数
|
|
57
|
+
* @description: 监听 label 属性函数
|
|
62
58
|
* @param {string} name
|
|
63
59
|
* @param {string} value
|
|
64
60
|
*/
|
|
@@ -84,7 +80,7 @@ class Input extends HTMLElement {
|
|
|
84
80
|
}
|
|
85
81
|
});
|
|
86
82
|
/**
|
|
87
|
-
* @description: 监听type属性
|
|
83
|
+
* @description: 监听 type 属性
|
|
88
84
|
* @param {string} name
|
|
89
85
|
* @param {string} value
|
|
90
86
|
*/
|
|
@@ -101,7 +97,7 @@ class Input extends HTMLElement {
|
|
|
101
97
|
}
|
|
102
98
|
});
|
|
103
99
|
/**
|
|
104
|
-
* @description: 监听status属性
|
|
100
|
+
* @description: 监听 status 属性
|
|
105
101
|
* @param {string} name
|
|
106
102
|
* @param {string} value
|
|
107
103
|
*/
|
|
@@ -115,7 +111,7 @@ class Input extends HTMLElement {
|
|
|
115
111
|
}
|
|
116
112
|
});
|
|
117
113
|
/**
|
|
118
|
-
* @description: 监听disabled属性
|
|
114
|
+
* @description: 监听 disabled 属性
|
|
119
115
|
* @param {string} name
|
|
120
116
|
* @param {string} value
|
|
121
117
|
*/
|
|
@@ -130,7 +126,7 @@ class Input extends HTMLElement {
|
|
|
130
126
|
}
|
|
131
127
|
});
|
|
132
128
|
/**
|
|
133
|
-
* @description: 监听icon属性
|
|
129
|
+
* @description: 监听 icon 属性
|
|
134
130
|
* @param {string} name
|
|
135
131
|
* @param {string} value
|
|
136
132
|
*/
|
|
@@ -142,11 +138,11 @@ class Input extends HTMLElement {
|
|
|
142
138
|
}
|
|
143
139
|
});
|
|
144
140
|
/**
|
|
145
|
-
* @description: 处理icon属性的问题
|
|
141
|
+
* @description: 处理 icon 属性的问题
|
|
146
142
|
*/
|
|
147
143
|
__publicField(this, "dealIcon", () => {
|
|
148
144
|
if (!this._icon) {
|
|
149
|
-
this._icon = document.createElement("
|
|
145
|
+
this._icon = document.createElement("ra-icon");
|
|
150
146
|
const { width, height } = this._inputContent.getBoundingClientRect();
|
|
151
147
|
const size = Math.min(width, height);
|
|
152
148
|
this._icon.setAttribute("size", `${size}`);
|
|
@@ -171,10 +167,6 @@ class Input extends HTMLElement {
|
|
|
171
167
|
this._input.setAttribute("value", newValue);
|
|
172
168
|
}
|
|
173
169
|
});
|
|
174
|
-
const shadowRoot = this.attachShadow({ mode: "closed" });
|
|
175
|
-
const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
|
|
176
|
-
F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc;
|
|
177
|
-
shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
|
|
178
170
|
this._input = document.createElement("div");
|
|
179
171
|
this._input.setAttribute("class", "ran-input");
|
|
180
172
|
this._input.setAttribute("part", "ran-input");
|
|
@@ -182,7 +174,6 @@ class Input extends HTMLElement {
|
|
|
182
174
|
this._inputContent.setAttribute("class", "ran-input-content");
|
|
183
175
|
this._inputContent.setAttribute("part", "ran-input-content");
|
|
184
176
|
this._input.appendChild(this._inputContent);
|
|
185
|
-
shadowRoot.appendChild(this._input);
|
|
186
177
|
}
|
|
187
178
|
static get observedAttributes() {
|
|
188
179
|
return [
|
|
@@ -193,18 +184,36 @@ class Input extends HTMLElement {
|
|
|
193
184
|
"type",
|
|
194
185
|
"icon",
|
|
195
186
|
"value",
|
|
196
|
-
"status"
|
|
187
|
+
"status",
|
|
188
|
+
// error warning
|
|
189
|
+
"prefix",
|
|
190
|
+
// 前缀
|
|
191
|
+
"suffix",
|
|
192
|
+
// 后缀
|
|
193
|
+
"allowclear",
|
|
194
|
+
// 清除 icon
|
|
195
|
+
"count",
|
|
196
|
+
// 计算输入的数量
|
|
197
|
+
"maxlength",
|
|
198
|
+
"showcount",
|
|
199
|
+
"onPressEnter",
|
|
200
|
+
// 按下回车的回调
|
|
201
|
+
"variant",
|
|
202
|
+
// filled borderless
|
|
203
|
+
"minrows",
|
|
204
|
+
// 当 type 等于 TextArea 时
|
|
205
|
+
"maxrows"
|
|
197
206
|
];
|
|
198
207
|
}
|
|
199
208
|
/**
|
|
200
|
-
* @description: 获取input的值
|
|
209
|
+
* @description: 获取 input 的值
|
|
201
210
|
* @return {String}
|
|
202
211
|
*/
|
|
203
212
|
get value() {
|
|
204
|
-
return this.getAttribute("value");
|
|
213
|
+
return this.getAttribute("value") || "";
|
|
205
214
|
}
|
|
206
215
|
/**
|
|
207
|
-
* @description: 设置input的值
|
|
216
|
+
* @description: 设置 input 的值
|
|
208
217
|
* @param {String} value
|
|
209
218
|
*/
|
|
210
219
|
set value(value) {
|
|
@@ -217,14 +226,14 @@ class Input extends HTMLElement {
|
|
|
217
226
|
}
|
|
218
227
|
}
|
|
219
228
|
/**
|
|
220
|
-
* @description: 获取input的占位字符
|
|
229
|
+
* @description: 获取 input 的占位字符
|
|
221
230
|
* @return {String}
|
|
222
231
|
*/
|
|
223
232
|
get placeholder() {
|
|
224
|
-
return this.getAttribute("placeholder");
|
|
233
|
+
return this.getAttribute("placeholder") || "";
|
|
225
234
|
}
|
|
226
235
|
/**
|
|
227
|
-
* @description: 设置input的占位字符
|
|
236
|
+
* @description: 设置 input 的占位字符
|
|
228
237
|
* @param {String} value
|
|
229
238
|
*/
|
|
230
239
|
set placeholder(value) {
|
|
@@ -235,14 +244,14 @@ class Input extends HTMLElement {
|
|
|
235
244
|
}
|
|
236
245
|
}
|
|
237
246
|
/**
|
|
238
|
-
* @description: input是否为必选
|
|
247
|
+
* @description: input 是否为必选
|
|
239
248
|
* @return {String}
|
|
240
249
|
*/
|
|
241
250
|
get required() {
|
|
242
|
-
return this.getAttribute("required");
|
|
251
|
+
return this.getAttribute("required") || "";
|
|
243
252
|
}
|
|
244
253
|
/**
|
|
245
|
-
* @description: 设置input是否为必选,除非设置成false,否则都是必填
|
|
254
|
+
* @description: 设置 input 是否为必选,除非设置成 false,否则都是必填
|
|
246
255
|
* @param {*} value
|
|
247
256
|
*/
|
|
248
257
|
set required(value) {
|
|
@@ -253,14 +262,14 @@ class Input extends HTMLElement {
|
|
|
253
262
|
}
|
|
254
263
|
}
|
|
255
264
|
/**
|
|
256
|
-
* @description: 获取input上disabled属性
|
|
265
|
+
* @description: 获取 input 上 disabled 属性
|
|
257
266
|
* @return {String | null}
|
|
258
267
|
*/
|
|
259
268
|
get disabled() {
|
|
260
|
-
return isDisabled(this)
|
|
269
|
+
return `${isDisabled(this)}`;
|
|
261
270
|
}
|
|
262
271
|
/**
|
|
263
|
-
* @description: 设置input的disabled属性
|
|
272
|
+
* @description: 设置 input 的 disabled 属性
|
|
264
273
|
* @param {String} value
|
|
265
274
|
*/
|
|
266
275
|
set disabled(value) {
|
|
@@ -275,25 +284,25 @@ class Input extends HTMLElement {
|
|
|
275
284
|
}
|
|
276
285
|
}
|
|
277
286
|
/**
|
|
278
|
-
* @description: 获取类似于Metiral Design的输入体验。
|
|
287
|
+
* @description: 获取类似于 Metiral Design 的输入体验。
|
|
279
288
|
*/
|
|
280
289
|
get label() {
|
|
281
290
|
return this.getAttribute("label") || "";
|
|
282
291
|
}
|
|
283
292
|
/**
|
|
284
|
-
* @description: 设置类似于Metiral Design的输入体验。
|
|
293
|
+
* @description: 设置类似于 Metiral Design 的输入体验。
|
|
285
294
|
*/
|
|
286
295
|
set label(value) {
|
|
287
296
|
this.setAttribute("label", value);
|
|
288
297
|
}
|
|
289
298
|
/**
|
|
290
|
-
* @description: 获取input框的状态
|
|
299
|
+
* @description: 获取 input 框的状态
|
|
291
300
|
*/
|
|
292
301
|
get status() {
|
|
293
302
|
return this.getAttribute("status") || "";
|
|
294
303
|
}
|
|
295
304
|
/**
|
|
296
|
-
* @description: 设置input框的状态
|
|
305
|
+
* @description: 设置 input 框的状态
|
|
297
306
|
*/
|
|
298
307
|
set status(value) {
|
|
299
308
|
if (value) {
|
|
@@ -305,73 +314,70 @@ class Input extends HTMLElement {
|
|
|
305
314
|
}
|
|
306
315
|
}
|
|
307
316
|
/**
|
|
308
|
-
* @description: 与form组件联动时,收集的属性名
|
|
317
|
+
* @description: 与 form 组件联动时,收集的属性名
|
|
309
318
|
* @return {String}
|
|
310
319
|
*/
|
|
311
320
|
get name() {
|
|
312
321
|
return this.getAttribute("name") || "";
|
|
313
322
|
}
|
|
314
323
|
/**
|
|
315
|
-
* @description: 设置name属性
|
|
324
|
+
* @description: 设置 name 属性
|
|
316
325
|
* @param {string} value
|
|
317
326
|
*/
|
|
318
327
|
set name(value) {
|
|
319
328
|
this.setAttribute("name", value);
|
|
320
329
|
}
|
|
321
330
|
/**
|
|
322
|
-
* @description: 当input类型为number类型时,可以获取min属性
|
|
331
|
+
* @description: 当 input 类型为 number 类型时,可以获取 min 属性
|
|
323
332
|
* @return {String}
|
|
324
333
|
*/
|
|
325
334
|
get min() {
|
|
326
335
|
return this.getAttribute("min") || "";
|
|
327
336
|
}
|
|
328
337
|
/**
|
|
329
|
-
* @description: 当input类型为number类型时,设置min属性
|
|
338
|
+
* @description: 当 input 类型为 number 类型时,设置 min 属性
|
|
330
339
|
* @param {string} value
|
|
331
340
|
*/
|
|
332
341
|
set min(value) {
|
|
333
|
-
if (this.type === "number")
|
|
334
|
-
this.setAttribute("min", value);
|
|
342
|
+
if (this.type === "number") this.setAttribute("min", value);
|
|
335
343
|
}
|
|
336
344
|
/**
|
|
337
|
-
* @description: 当input类型为number类型时,可以获取max属性
|
|
345
|
+
* @description: 当 input 类型为 number 类型时,可以获取 max 属性
|
|
338
346
|
* @return {String}
|
|
339
347
|
*/
|
|
340
348
|
get max() {
|
|
341
349
|
return this.getAttribute("max") || "";
|
|
342
350
|
}
|
|
343
351
|
/**
|
|
344
|
-
* @description: 当input类型为number类型时,设置max属性
|
|
352
|
+
* @description: 当 input 类型为 number 类型时,设置 max 属性
|
|
345
353
|
* @param {string} value
|
|
346
354
|
*/
|
|
347
355
|
set max(value) {
|
|
348
|
-
if (this.type === "number")
|
|
349
|
-
this.setAttribute("max", value);
|
|
356
|
+
if (this.type === "number") this.setAttribute("max", value);
|
|
350
357
|
}
|
|
351
358
|
/**
|
|
352
|
-
* @description: 当input类型为number类型时,可以获取step属性
|
|
359
|
+
* @description: 当 input 类型为 number 类型时,可以获取 step 属性
|
|
353
360
|
* @return {String}
|
|
354
361
|
*/
|
|
355
362
|
get step() {
|
|
356
363
|
return this.getAttribute("step") || "";
|
|
357
364
|
}
|
|
358
365
|
/**
|
|
359
|
-
* @description: 当input类型为number类型时,设置step属性
|
|
366
|
+
* @description: 当 input 类型为 number 类型时,设置 step 属性
|
|
360
367
|
* @param {string} value
|
|
361
368
|
*/
|
|
362
369
|
set step(value) {
|
|
363
|
-
if (this.type === "number")
|
|
364
|
-
this.setAttribute("step", value);
|
|
370
|
+
if (this.type === "number") this.setAttribute("step", value);
|
|
365
371
|
}
|
|
366
372
|
/**
|
|
367
|
-
* @description: 获取一个icon
|
|
373
|
+
* @description: 获取一个 icon
|
|
368
374
|
* @return {String}
|
|
369
375
|
*/
|
|
370
376
|
get icon() {
|
|
371
|
-
return this.getAttribute("icon");
|
|
377
|
+
return this.getAttribute("icon") || "";
|
|
372
378
|
}
|
|
373
379
|
/**
|
|
374
|
-
* @description: 设置icon来表示标识
|
|
380
|
+
* @description: 设置 icon 来表示标识
|
|
375
381
|
* @param {string|null} value
|
|
376
382
|
*/
|
|
377
383
|
set icon(value) {
|
|
@@ -382,14 +388,50 @@ class Input extends HTMLElement {
|
|
|
382
388
|
}
|
|
383
389
|
}
|
|
384
390
|
/**
|
|
385
|
-
* @description:
|
|
391
|
+
* @description: 获取前面的 icon
|
|
392
|
+
* @return {String}
|
|
393
|
+
*/
|
|
394
|
+
get prefix() {
|
|
395
|
+
return this.getAttribute("prefix") || "";
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* @description: 设置前面的 icon 来表示标识
|
|
399
|
+
* @param {string|null} value
|
|
400
|
+
*/
|
|
401
|
+
set prefix(value) {
|
|
402
|
+
if (value) {
|
|
403
|
+
this.setAttribute("prefix", value);
|
|
404
|
+
} else {
|
|
405
|
+
this.removeAttribute("prefix");
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* @description: 获取后面的 icon
|
|
410
|
+
* @return {String}
|
|
411
|
+
*/
|
|
412
|
+
get suffix() {
|
|
413
|
+
return this.getAttribute("suffix") || "";
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* @description: 设置后面的 icon 来表示标识
|
|
417
|
+
* @param {string|null} value
|
|
418
|
+
*/
|
|
419
|
+
set suffix(value) {
|
|
420
|
+
if (value) {
|
|
421
|
+
this.setAttribute("suffix", value);
|
|
422
|
+
} else {
|
|
423
|
+
this.removeAttribute("suffix");
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* @description: 获取 input 的类型
|
|
386
428
|
* @return {string|null}
|
|
387
429
|
*/
|
|
388
430
|
get type() {
|
|
389
|
-
return this.getAttribute("type");
|
|
431
|
+
return this.getAttribute("type") || "";
|
|
390
432
|
}
|
|
391
433
|
/**
|
|
392
|
-
* @description: 设置input的类型
|
|
434
|
+
* @description: 设置 input 的类型
|
|
393
435
|
* @param {string|null} value
|
|
394
436
|
*/
|
|
395
437
|
set type(value) {
|
|
@@ -418,6 +460,7 @@ class Input extends HTMLElement {
|
|
|
418
460
|
if (document.readyState === "complete") {
|
|
419
461
|
this.dealIcon();
|
|
420
462
|
}
|
|
463
|
+
this.appendChild(this._input);
|
|
421
464
|
}
|
|
422
465
|
disconnectCallback() {
|
|
423
466
|
this._inputContent.removeEventListener("input", this.customInput);
|
|
@@ -427,11 +470,11 @@ class Input extends HTMLElement {
|
|
|
427
470
|
}
|
|
428
471
|
}
|
|
429
472
|
function Custom() {
|
|
430
|
-
if (typeof window !== "undefined" && !customElements.get("
|
|
431
|
-
customElements.define("
|
|
473
|
+
if (typeof window !== "undefined" && !customElements.get("ra-input")) {
|
|
474
|
+
customElements.define("ra-input", Input);
|
|
432
475
|
return Input;
|
|
433
476
|
} else {
|
|
434
|
-
return createCustomError("document is undefined or
|
|
477
|
+
return createCustomError("document is undefined or ra-input is exist");
|
|
435
478
|
}
|
|
436
479
|
}
|
|
437
480
|
const index = Custom();
|
|
@@ -1,12 +1,9 @@
|
|
|
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 { g as getPixelRatio } from "./index-7913ec46.js";
|
|
8
|
-
import { c as createCustomError } from "./index-57492b9b.js";
|
|
9
|
-
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}.ran-radar{position:relative;width:100%;height:100%;display:block}\n";
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
import { g as getPixelRatio } from "./arrow-down-B_hCY3Wt.js";
|
|
5
|
+
import { 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}.ran-radar{position:var(--ran-radar-position, relative);width:var(--ran-radar-width, 100%);height:var(--ran-radar-height, 100%);display:var(--ran-radar-display, block)}";
|
|
10
7
|
const BACKGROUND_COLOR = "rgba(0,0,0,0)";
|
|
11
8
|
const FONT_COLOR = "rgba(0,0,0,1)";
|
|
12
9
|
const POLYGON_COLOR = "#e6e6e6";
|
|
@@ -43,13 +40,7 @@ function Custom() {
|
|
|
43
40
|
shadowRoot.appendChild(this.abilityRadarChartContainer);
|
|
44
41
|
}
|
|
45
42
|
static get observedAttributes() {
|
|
46
|
-
return [
|
|
47
|
-
"abilitys",
|
|
48
|
-
"colorPolygon",
|
|
49
|
-
"colorLine",
|
|
50
|
-
"fillColor",
|
|
51
|
-
"strokeColor"
|
|
52
|
-
];
|
|
43
|
+
return ["abilitys", "colorPolygon", "colorLine", "fillColor", "strokeColor"];
|
|
53
44
|
}
|
|
54
45
|
get abilitys() {
|
|
55
46
|
const item = this.getAttribute("abilitys");
|
|
@@ -101,8 +92,7 @@ function Custom() {
|
|
|
101
92
|
refreshData() {
|
|
102
93
|
var _a;
|
|
103
94
|
const ctx = this.abilityRadarChart.getContext("2d");
|
|
104
|
-
if (!this.abilityRadarChartContainer || !ctx)
|
|
105
|
-
return;
|
|
95
|
+
if (!this.abilityRadarChartContainer || !ctx) return;
|
|
106
96
|
const radio = getPixelRatio(ctx);
|
|
107
97
|
const width = this.abilityRadarChartContainer.clientWidth * radio;
|
|
108
98
|
const height = this.abilityRadarChartContainer.clientHeight * radio;
|
|
@@ -122,8 +112,7 @@ function Custom() {
|
|
|
122
112
|
this.drawCircle(ctx);
|
|
123
113
|
}
|
|
124
114
|
drawSide(ctx) {
|
|
125
|
-
if (!this.mRadius || !this.mCount || !this.mCenter || !this.mAngle)
|
|
126
|
-
return;
|
|
115
|
+
if (!this.mRadius || !this.mCount || !this.mCenter || !this.mAngle) return;
|
|
127
116
|
ctx.save();
|
|
128
117
|
ctx.strokeStyle = this.colorLine;
|
|
129
118
|
const r = this.mRadius;
|
|
@@ -137,8 +126,7 @@ function Custom() {
|
|
|
137
126
|
}
|
|
138
127
|
// 绘制多边形边
|
|
139
128
|
drawPolygon(ctx) {
|
|
140
|
-
if (!this.mRadius || !this.mCount || !this.mCenter || !this.mAngle)
|
|
141
|
-
return;
|
|
129
|
+
if (!this.mRadius || !this.mCount || !this.mCenter || !this.mAngle) return;
|
|
142
130
|
ctx.save();
|
|
143
131
|
ctx.strokeStyle = this.colorPolygon;
|
|
144
132
|
const r = this.mRadius / 4;
|
|
@@ -158,8 +146,7 @@ function Custom() {
|
|
|
158
146
|
}
|
|
159
147
|
// 顶点连线
|
|
160
148
|
drawLines(ctx) {
|
|
161
|
-
if (!this.mRadius || !this.mCount || !this.mCenter || !this.mAngle)
|
|
162
|
-
return;
|
|
149
|
+
if (!this.mRadius || !this.mCount || !this.mCenter || !this.mAngle) return;
|
|
163
150
|
ctx.save();
|
|
164
151
|
ctx.beginPath();
|
|
165
152
|
ctx.strokeStyle = this.colorLine;
|
|
@@ -175,8 +162,7 @@ function Custom() {
|
|
|
175
162
|
// 绘制文本
|
|
176
163
|
drawText(ctx) {
|
|
177
164
|
var _a, _b, _c, _d;
|
|
178
|
-
if (!this.mRadius || !this.mCount || !this.mCenter || !this.mAngle || !this.mData)
|
|
179
|
-
return;
|
|
165
|
+
if (!this.mRadius || !this.mCount || !this.mCenter || !this.mAngle || !this.mData) return;
|
|
180
166
|
ctx.save();
|
|
181
167
|
const radio = getPixelRatio(ctx);
|
|
182
168
|
const defaultFontSize = this.mCenter / 12;
|
|
@@ -254,21 +240,9 @@ function Custom() {
|
|
|
254
240
|
ctx.fillStyle = color;
|
|
255
241
|
ctx.moveTo(x + radius, y);
|
|
256
242
|
ctx.lineTo(x + width - radius, y);
|
|
257
|
-
ctx.arc(
|
|
258
|
-
x + width - radius,
|
|
259
|
-
y + radius,
|
|
260
|
-
radius,
|
|
261
|
-
Math.PI * 3 / 2,
|
|
262
|
-
Math.PI * 2
|
|
263
|
-
);
|
|
243
|
+
ctx.arc(x + width - radius, y + radius, radius, Math.PI * 3 / 2, Math.PI * 2);
|
|
264
244
|
ctx.lineTo(x + width, y + height - radius);
|
|
265
|
-
ctx.arc(
|
|
266
|
-
x + width - radius,
|
|
267
|
-
y + height - radius,
|
|
268
|
-
radius,
|
|
269
|
-
Math.PI,
|
|
270
|
-
Math.PI / 2
|
|
271
|
-
);
|
|
245
|
+
ctx.arc(x + width - radius, y + height - radius, radius, Math.PI, Math.PI / 2);
|
|
272
246
|
ctx.lineTo(x + radius, y + height);
|
|
273
247
|
ctx.arc(x + radius, y + height - radius, radius, Math.PI / 2, Math.PI);
|
|
274
248
|
ctx.lineTo(x, y + radius);
|
|
@@ -284,8 +258,7 @@ function Custom() {
|
|
|
284
258
|
}
|
|
285
259
|
// 绘制数据区域
|
|
286
260
|
drawRegion(ctx) {
|
|
287
|
-
if (!this.mRadius || !this.mCount || !this.mCenter || !this.mAngle || !this.mData)
|
|
288
|
-
return;
|
|
261
|
+
if (!this.mRadius || !this.mCount || !this.mCenter || !this.mAngle || !this.mData) return;
|
|
289
262
|
const radio = getPixelRatio(ctx);
|
|
290
263
|
ctx.save();
|
|
291
264
|
ctx.beginPath();
|
|
@@ -304,8 +277,7 @@ function Custom() {
|
|
|
304
277
|
}
|
|
305
278
|
// 画点
|
|
306
279
|
drawCircle(ctx) {
|
|
307
|
-
if (!this.mRadius || !this.mCount || !this.mCenter || !this.mAngle || !this.mData)
|
|
308
|
-
return;
|
|
280
|
+
if (!this.mRadius || !this.mCount || !this.mCenter || !this.mAngle || !this.mData) return;
|
|
309
281
|
const radio = getPixelRatio(ctx);
|
|
310
282
|
ctx.save();
|
|
311
283
|
for (let i = 0; i < this.mCount; i++) {
|
|
@@ -325,13 +297,7 @@ function Custom() {
|
|
|
325
297
|
disconnectCallback() {
|
|
326
298
|
}
|
|
327
299
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
328
|
-
const attribute = [
|
|
329
|
-
"abilitys",
|
|
330
|
-
"colorPolygon",
|
|
331
|
-
"colorLine",
|
|
332
|
-
"fillColor",
|
|
333
|
-
"strokeColor"
|
|
334
|
-
];
|
|
300
|
+
const attribute = ["abilitys", "colorPolygon", "colorLine", "fillColor", "strokeColor"];
|
|
335
301
|
if (attribute.includes(name) && this.abilityRadarChartContainer && oldValue !== newValue) {
|
|
336
302
|
this.refreshData();
|
|
337
303
|
}
|