ranui 0.1.8 → 0.1.10-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.
Files changed (176) hide show
  1. package/dist/_commonjs-dynamic-modules-DLbDWi6a.js +12 -0
  2. package/dist/arrow-down-C9jBUUt3.js +30 -0
  3. package/dist/assets/image/failImage.d.ts +2 -0
  4. package/dist/button.js +7 -0
  5. package/dist/checkbox.js +7 -0
  6. package/dist/colorpicker.js +13 -0
  7. package/dist/{colz-746223ab.js → colz-CRDozfZA.js} +1 -5
  8. package/dist/components/button/index.d.ts +38 -1
  9. package/dist/components/checkbox/index.d.ts +27 -0
  10. package/dist/components/colorpicker/index.d.ts +122 -0
  11. package/dist/components/content/index.d.ts +15 -0
  12. package/dist/components/input/index.d.ts +208 -1
  13. package/dist/components/message/index.d.ts +2 -0
  14. package/dist/components/option/index.d.ts +2 -1
  15. package/dist/components/player/index.d.ts +207 -493
  16. package/dist/components/popover/index.d.ts +39 -0
  17. package/dist/components/preview/docx.d.ts +1 -1
  18. package/dist/components/preview/index.d.ts +2 -0
  19. package/dist/components/preview/pptx/process_pptx.d.ts +1 -1
  20. package/dist/components/progress/index.d.ts +11 -5
  21. package/dist/components/radar/index.d.ts +1 -1
  22. package/dist/components/scratch/index.d.ts +23 -0
  23. package/dist/components/select/index.d.ts +18 -6
  24. package/dist/components/tab/index.d.ts +5 -0
  25. package/dist/components/tabpane/index.d.ts +5 -0
  26. package/dist/content.js +6 -0
  27. package/dist/docx-ajDUtnbM.js +3665 -0
  28. package/dist/global-DOfcrQ2N.js +4 -0
  29. package/dist/icon.js +6 -0
  30. package/dist/iconShadowless.js +6 -0
  31. package/dist/image.js +4 -0
  32. package/dist/index-0fvHQjmN.js +298 -0
  33. package/dist/{index-f6d6982d.js → index-BLepXisd.js} +101 -84
  34. package/dist/{index-b2be6bef.js → index-BOoNI-Al.js} +904 -1078
  35. package/dist/index-BPBRPxND.js +195 -0
  36. package/dist/{index-b90299ca.js → index-BpOERe9M.js} +1 -1
  37. package/dist/index-Bv6Z6rIe.js +498 -0
  38. package/dist/index-ByJ7zZdQ.js +65641 -0
  39. package/dist/{index-5975bbc0.js → index-C1x9Popy.js} +1 -1
  40. package/dist/index-CCNK5H8T.js +103 -0
  41. package/dist/{index-a1a53af6.js → index-CD09p_mF.js} +7 -31
  42. package/dist/index-CFnsLnrb.js +496 -0
  43. package/dist/{index-a43b144f.js → index-CJZp9lE4.js} +29 -50
  44. package/dist/{index-57492b9b.js → index-CSnBqUsQ.js} +48 -1
  45. package/dist/index-CWWI8SHO.js +206 -0
  46. package/dist/{index-7b8840f9.js → index-CZlEoE62.js} +220 -1010
  47. package/dist/index-CbyMC6Yz.js +59 -0
  48. package/dist/index-CiBVH-oH.js +258 -0
  49. package/dist/{index-0e7229ea.js → index-DUMmFdJ7.js} +9 -21
  50. package/dist/{index-aea75a9f.js → index-Du-Biu-I.js} +1 -1
  51. package/dist/index-EnzWG8R0.js +521 -0
  52. package/dist/index-F2RO3OU4.js +501 -0
  53. package/dist/{index-7f513a14.js → index-GavQwMDL.js} +11 -29
  54. package/dist/{index-48653b79.js → index-suip9eAw.js} +2 -2
  55. package/dist/index.d.ts +18 -14
  56. package/dist/index.js +23 -19
  57. package/dist/info-circle-fill-CFeVMdci.js +4 -0
  58. package/dist/input.js +6 -0
  59. package/dist/inputShadowless.js +6 -0
  60. package/dist/jszip.min-Ca6PjkYs.js +2674 -0
  61. package/dist/message.js +5 -0
  62. package/dist/modal.js +4 -0
  63. package/dist/{components/option/index.js → option.js} +3 -6
  64. package/dist/{pdf-bdb7818a.js → pdf-B2a6ll8f.js} +1 -1
  65. package/dist/player.js +8 -0
  66. package/dist/popover.js +6 -0
  67. package/dist/preview.js +7 -0
  68. package/dist/progress.js +7 -0
  69. package/dist/radar.js +6 -0
  70. package/dist/select.js +10 -0
  71. package/dist/selectShadowless.js +10 -0
  72. package/dist/{umd/components/image → shadowless/icon}/index.d.ts +1 -0
  73. package/dist/shadowless/input/index.d.ts +210 -0
  74. package/dist/{umd/components → shadowless}/select/index.d.ts +19 -11
  75. package/dist/shadowless/shadowless/index.js +14 -0
  76. package/dist/shadowless.d.ts +3 -0
  77. package/dist/skeleton.js +4 -0
  78. package/dist/sprite-CH2zLtZy.js +141 -0
  79. package/dist/style.css +1 -1
  80. package/dist/tab.js +6 -0
  81. package/dist/tabpane.js +4 -0
  82. package/dist/tsconfig.json +29 -0
  83. package/dist/umd/index.umd.cjs +21 -32
  84. package/dist/umd/shadowless/shadowless.umd.cjs +1 -0
  85. package/dist/umd/shadowless/style.css +1 -0
  86. package/dist/umd/style.css +1 -1
  87. package/dist/utils/color.d.ts +52 -0
  88. package/dist/utils/index.d.ts +9 -1
  89. package/dist/utils-BMBEcoPj.js +356 -0
  90. package/dist/vite.config.d.ts +1 -0
  91. package/package.json +61 -39
  92. package/readme.md +14 -14
  93. package/typings.d.ts +101 -0
  94. package/dist/components/button/index.js +0 -7
  95. package/dist/components/icon/index.js +0 -6
  96. package/dist/components/image/index.js +0 -4
  97. package/dist/components/input/index.js +0 -5
  98. package/dist/components/message/index.js +0 -4
  99. package/dist/components/modal/index.js +0 -4
  100. package/dist/components/player/index.js +0 -11
  101. package/dist/components/preview/index.js +0 -8
  102. package/dist/components/progress/index.js +0 -8
  103. package/dist/components/radar/index.js +0 -7
  104. package/dist/components/select/index.js +0 -11
  105. package/dist/components/skeleton/index.js +0 -4
  106. package/dist/components/tab/index.js +0 -7
  107. package/dist/components/tabpane/index.js +0 -4
  108. package/dist/docx-c5d02d8c.js +0 -21
  109. package/dist/index-183517e7.js +0 -265
  110. package/dist/index-4d873a42.js +0 -195
  111. package/dist/index-a216f328.js +0 -662
  112. package/dist/index-d2d69b06.js +0 -225
  113. package/dist/index-ecaed5cc.js +0 -439
  114. package/dist/info-circle-fill-90ec9aa9.js +0 -14
  115. package/dist/umd/build/config.d.ts +0 -3
  116. package/dist/umd/build/config.umd.d.ts +0 -2
  117. package/dist/umd/components/button/index.d.ts +0 -2
  118. package/dist/umd/components/form/index.d.ts +0 -2
  119. package/dist/umd/components/icon/index.d.ts +0 -2
  120. package/dist/umd/components/input/index.d.ts +0 -2
  121. package/dist/umd/components/message/index.d.ts +0 -14
  122. package/dist/umd/components/modal/index.d.ts +0 -2
  123. package/dist/umd/components/option/index.d.ts +0 -2
  124. package/dist/umd/components/player/index.d.ts +0 -524
  125. package/dist/umd/components/preview/colz.d.ts +0 -72
  126. package/dist/umd/components/preview/docx.d.ts +0 -8
  127. package/dist/umd/components/preview/excel/excel.d.ts +0 -2
  128. package/dist/umd/components/preview/excel/index.d.ts +0 -1
  129. package/dist/umd/components/preview/excel/media.d.ts +0 -37
  130. package/dist/umd/components/preview/index.d.ts +0 -6
  131. package/dist/umd/components/preview/pdf.d.ts +0 -1
  132. package/dist/umd/components/preview/pptx/index.d.ts +0 -16
  133. package/dist/umd/components/preview/pptx/process_pptx.d.ts +0 -23
  134. package/dist/umd/components/preview/pptx/t_xml.d.ts +0 -1
  135. package/dist/umd/components/preview/pptx/worker.d.ts +0 -1
  136. package/dist/umd/components/progress/index.d.ts +0 -36
  137. package/dist/umd/components/radar/index.d.ts +0 -2
  138. package/dist/umd/components/skeleton/index.d.ts +0 -2
  139. package/dist/umd/components/tab/index.d.ts +0 -403
  140. package/dist/umd/components/tabpane/index.d.ts +0 -347
  141. package/dist/umd/index.d.ts +0 -14
  142. package/dist/umd/playwright.config.d.ts +0 -9
  143. package/dist/umd/plugins/auto-import-file.d.ts +0 -0
  144. package/dist/umd/plugins/load-style.d.ts +0 -6
  145. package/dist/umd/plugins/load-svg.d.ts +0 -9
  146. package/dist/umd/tests/button.spec.d.ts +0 -1
  147. package/dist/umd/utils/image.d.ts +0 -32
  148. package/dist/umd/utils/index.d.ts +0 -64
  149. package/dist/umd/utils/math.d.ts +0 -26
  150. package/dist/umd/utils/tween.d.ts +0 -21
  151. package/dist/umd/vite.config.d.ts +0 -6
  152. package/dist/vendor-f71e6f68.js +0 -92126
  153. /package/dist/{add-user-b2bed3e7.js → add-user-BN1JlY7e.js} +0 -0
  154. /package/dist/{book-b11a68eb.js → book-nTEFXU2x.js} +0 -0
  155. /package/dist/{umd/build/config.es.d.ts → build/config.sha.d.ts} +0 -0
  156. /package/dist/{check-circle-fill-dc284144.js → check-circle-fill-B_pd8ZSs.js} +0 -0
  157. /package/dist/{check-circle-74bd09c3.js → check-circle-szyAJiap.js} +0 -0
  158. /package/dist/{close-20925345.js → close-CFnkhudp.js} +0 -0
  159. /package/dist/{close-circle-720c18be.js → close-circle-CwmuN2C6.js} +0 -0
  160. /package/dist/{close-circle-fill-238a66b1.js → close-circle-fill-jSqPPw9i.js} +0 -0
  161. /package/dist/{eye-5e742329.js → eye-D_mEt17f.js} +0 -0
  162. /package/dist/{eye-close-3874f1ae.js → eye-close-BVr3NJtg.js} +0 -0
  163. /package/dist/{home-c4a05e8b.js → home-BUQ4USMk.js} +0 -0
  164. /package/dist/{index-8e1e2573.js → index-CQTJoWhb.js} +0 -0
  165. /package/dist/{info-circle-5826decc.js → info-circle-COnL5bTJ.js} +0 -0
  166. /package/dist/{loading-09ca52df.js → loading-Dcc5RApI.js} +0 -0
  167. /package/dist/{lock-1d2487c9.js → lock-Cr7BnmWN.js} +0 -0
  168. /package/dist/{message-b2bfdea7.js → message-D36_Zo2l.js} +0 -0
  169. /package/dist/{power-off-6ade5a91.js → power-off-lQRbiBak.js} +0 -0
  170. /package/dist/{preview-b291aea8.js → preview-CJbz9GjO.js} +0 -0
  171. /package/dist/{setting-1e5ccb6d.js → setting-DemlgzVC.js} +0 -0
  172. /package/dist/{team-ca6a12e1.js → team-tl4NJXPC.js} +0 -0
  173. /package/dist/{unlock-f56086fd.js → unlock-CeU74z9n.js} +0 -0
  174. /package/dist/{user-5c01e665.js → user-B-eVXwuk.js} +0 -0
  175. /package/dist/{warning-circle-035e025c.js → warning-circle-DDUgEDIv.js} +0 -0
  176. /package/dist/{warning-circle-fill-d17c37c9.js → warning-circle-fill-lODUKz0i.js} +0 -0
@@ -1,225 +0,0 @@
1
- import "./vendor-f71e6f68.js";
2
- var __defProp = Object.defineProperty;
3
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
- var __publicField = (obj, key, value) => {
5
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6
- return value;
7
- };
8
- const NEW_LISTENER = "NEW_LISTENER";
9
- class SyncHook {
10
- constructor() {
11
- __publicField(this, "_events");
12
- __publicField(this, "on", (eventName, eventItem) => {
13
- if (this._events[eventName] && eventName !== Symbol.for(NEW_LISTENER)) {
14
- this.emit(Symbol.for(NEW_LISTENER), eventName);
15
- }
16
- const callbacks = this._events[eventName] || [];
17
- if (typeof eventItem === "function") {
18
- callbacks.push({
19
- name: eventName,
20
- callback: eventItem
21
- });
22
- } else {
23
- callbacks.push(eventItem);
24
- }
25
- this._events[eventName] = callbacks;
26
- });
27
- __publicField(this, "emit", (eventName, ...args) => {
28
- const callbacks = this._events[eventName] || [];
29
- callbacks.forEach((item) => {
30
- const { callback } = item;
31
- callback(...args);
32
- });
33
- });
34
- __publicField(this, "once", (eventName, eventItem) => {
35
- let one;
36
- if (typeof eventItem === "function") {
37
- one = {
38
- name: eventName,
39
- callback: (...args) => {
40
- eventItem(...args);
41
- this.off(eventName, one);
42
- },
43
- initialCallback: eventItem
44
- };
45
- } else {
46
- const { callback } = eventItem;
47
- one = {
48
- name: eventName,
49
- callback: (...args) => {
50
- callback(...args);
51
- this.off(eventName, one);
52
- },
53
- initialCallback: callback
54
- };
55
- }
56
- this.on(eventName, one);
57
- });
58
- __publicField(this, "off", (eventName, eventItem) => {
59
- const callbacks = this._events[eventName] || [];
60
- const newCallbacks = callbacks.filter((item) => {
61
- if (typeof eventItem === "function") {
62
- return item.callback !== eventItem && item.initialCallback !== eventItem;
63
- } else {
64
- const { callback } = eventItem;
65
- return item.callback !== callback && item.initialCallback !== callback;
66
- }
67
- });
68
- this._events[eventName] = newCallbacks;
69
- });
70
- this._events = {};
71
- }
72
- }
73
- const str2Xml = (xmlStr, format = "text/xml") => {
74
- if (window.DOMParser)
75
- return new window.DOMParser().parseFromString(xmlStr, format).documentElement;
76
- if (typeof window.ActiveXObject !== "undefined" && new window.ActiveXObject("Microsoft.XMLDOM")) {
77
- const xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM");
78
- xmlDoc.async = "false";
79
- xmlDoc.loadXML(xmlStr);
80
- return xmlDoc;
81
- }
82
- return void 0;
83
- };
84
- function vnode$1(sel, data, children, text, elm) {
85
- const key = data === void 0 ? void 0 : data.key;
86
- return { sel, data, children, text, elm, key };
87
- }
88
- vnode$1("", {}, [], void 0, void 0);
89
- const throttle$1 = (fn, wait = 300) => {
90
- let timer;
91
- return function() {
92
- const context = this;
93
- const args = arguments;
94
- if (!timer) {
95
- timer = setTimeout(() => {
96
- timer = null;
97
- fn.apply(context, args);
98
- }, wait);
99
- }
100
- };
101
- };
102
- const noop = () => {
103
- };
104
- const judgeDevice = () => {
105
- if (typeof window !== "undefined") {
106
- const ua = navigator.userAgent.toLowerCase();
107
- if (/ipad|ipod/.test(ua))
108
- return "ipad";
109
- if (/android/.test(ua))
110
- return "android";
111
- if (/iphone/.test(ua))
112
- return "iphone";
113
- return "pc";
114
- }
115
- return "pc";
116
- };
117
- function formatDuration(time) {
118
- return time < 10 ? `0${time}` : time;
119
- }
120
- function timestampToTime(timestamp) {
121
- let date = /* @__PURE__ */ new Date();
122
- if (timestamp) {
123
- date = new Date(timestamp);
124
- }
125
- date.format = (format = "YYYY-MM-DD HH:mm:ss") => {
126
- const year = date.getFullYear();
127
- const month = formatDuration(date.getMonth() + 1);
128
- const day = formatDuration(date.getDate());
129
- const hour = formatDuration(date.getHours());
130
- const minute = formatDuration(date.getMinutes());
131
- const second = formatDuration(date.getSeconds());
132
- return format.replace(/Y+/gi, `${year}`).replace(/M+/g, `${month}`).replace(/D+/gi, `${day}`).replace(/H+/gi, `${hour}`).replace(/m+/g, `${minute}`).replace(/S+/gi, `${second}`);
133
- };
134
- return date;
135
- }
136
- const getPixelRatio = (context) => {
137
- const backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || 1;
138
- return (window.devicePixelRatio || 1) / backingStore;
139
- };
140
- const addClassToElement = (element, addClass) => {
141
- if (typeof document === "undefined")
142
- return void 0;
143
- const classList = element.classList;
144
- if (!classList.contains(addClass)) {
145
- classList.add(addClass);
146
- }
147
- };
148
- const removeClassToElement = (element, removeClass) => {
149
- if (typeof document === "undefined")
150
- return void 0;
151
- const classList = element.classList;
152
- if (classList.contains(removeClass)) {
153
- classList.remove(removeClass);
154
- }
155
- };
156
- const timeFormat = (time) => {
157
- if (time === 0)
158
- return "00:00";
159
- if (!time)
160
- return "";
161
- const hour = Math.trunc(time / 3600);
162
- const minute = Math.trunc(time % 3600 / 60);
163
- const second = formatDuration(Math.trunc(time - hour * 3600 - minute * 60));
164
- if (hour === 0) {
165
- return `${formatDuration(minute)}:${second}`;
166
- }
167
- return `${formatDuration(hour)}:${formatDuration(minute)}:${second}`;
168
- };
169
- const perToNum = (str = "") => {
170
- if (str.length === 0)
171
- return 0;
172
- if (str.endsWith("%")) {
173
- const value = Number(str.replace("%", ""));
174
- return value > 1 ? value / 100 : value;
175
- } else {
176
- return Number(str);
177
- }
178
- };
179
- const range = (num, min = 0, max = 1) => {
180
- return Math.min(max, Math.max(min, num));
181
- };
182
- const createDocumentFragment = (list) => {
183
- if (typeof document === "undefined")
184
- return void 0;
185
- const Fragment = document.createDocumentFragment();
186
- list.forEach((item) => Fragment.appendChild(item));
187
- return Fragment;
188
- };
189
- const heap = new Array(128).fill(void 0);
190
- heap.push(void 0, null, true, false);
191
- heap.length;
192
- const cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
193
- throw Error("TextDecoder not available");
194
- } };
195
- if (typeof TextDecoder !== "undefined") {
196
- cachedTextDecoder.decode();
197
- }
198
- const cachedTextEncoder = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
199
- throw Error("TextEncoder not available");
200
- } };
201
- typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) {
202
- return cachedTextEncoder.encodeInto(arg, view);
203
- } : function(arg, view) {
204
- const buf = cachedTextEncoder.encode(arg);
205
- view.set(buf);
206
- return {
207
- read: arg.length,
208
- written: buf.length
209
- };
210
- };
211
- export {
212
- SyncHook as S,
213
- addClassToElement as a,
214
- timeFormat as b,
215
- createDocumentFragment as c,
216
- range as d,
217
- throttle$1 as e,
218
- getPixelRatio as g,
219
- judgeDevice as j,
220
- noop as n,
221
- perToNum as p,
222
- removeClassToElement as r,
223
- str2Xml as s,
224
- timestampToTime as t
225
- };
@@ -1,439 +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 { c as createCustomError, i as isDisabled, f as falseList } from "./index-57492b9b.js";
8
- const f7170ee498e0dd32cbdcb63fba8f75cc = '.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
- function Custom() {
10
- if (typeof window !== "undefined" && !customElements.get("r-input")) {
11
- class CustomElement extends HTMLElement {
12
- constructor() {
13
- super();
14
- __publicField(this, "_input");
15
- __publicField(this, "_label");
16
- __publicField(this, "_inputContent");
17
- __publicField(this, "_icon");
18
- /**
19
- * @description: 原生的input方法
20
- * @param {Event} event
21
- */
22
- __publicField(this, "customInput", (event) => {
23
- event.stopPropagation();
24
- const target = event.target;
25
- this.value = target ? target.value : "";
26
- this.customChange();
27
- this.dispatchEvent(
28
- new CustomEvent("input", {
29
- detail: {
30
- value: this.value
31
- }
32
- })
33
- );
34
- });
35
- /**
36
- * @description: 增加change方法,同时兼容大小写的情况
37
- */
38
- __publicField(this, "customChange", () => {
39
- this.dispatchEvent(
40
- new CustomEvent("change", {
41
- detail: {
42
- value: this.value
43
- }
44
- })
45
- );
46
- });
47
- /**
48
- * @description: 处理icon属性的问题
49
- */
50
- __publicField(this, "dealIcon", () => {
51
- if (!this._icon) {
52
- this._icon = document.createElement("r-icon");
53
- const { width, height } = this._inputContent.getBoundingClientRect();
54
- const size = Math.min(width, height);
55
- this._icon.setAttribute("size", `${size}`);
56
- this._inputContent.insertAdjacentElement("beforebegin", this._icon);
57
- }
58
- this.icon && this._icon.setAttribute("name", this.icon);
59
- });
60
- const shadowRoot = this.attachShadow({ mode: "closed" });
61
- const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
62
- F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc;
63
- shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
64
- this._input = document.createElement("div");
65
- this._input.setAttribute("class", "ran-input");
66
- this._input.setAttribute("part", "ran-input");
67
- this._inputContent = document.createElement("input");
68
- this._inputContent.setAttribute("class", "ran-input-content");
69
- this._inputContent.setAttribute("part", "ran-input-content");
70
- this._input.appendChild(this._inputContent);
71
- shadowRoot.appendChild(this._input);
72
- }
73
- static get observedAttributes() {
74
- return [
75
- "label",
76
- "disabled",
77
- "name",
78
- "placeholder",
79
- "type",
80
- "icon",
81
- "status"
82
- ];
83
- }
84
- /**
85
- * @description: 获取input的值
86
- * @return {String}
87
- */
88
- get value() {
89
- return this.getAttribute("value");
90
- }
91
- /**
92
- * @description: 设置input的值
93
- * @param {String} value
94
- */
95
- set value(value) {
96
- if (!isDisabled(this) && value) {
97
- this.setAttribute("value", value);
98
- this._input.setAttribute("value", value);
99
- } else {
100
- this.removeAttribute("value");
101
- this._input.removeAttribute("value");
102
- }
103
- }
104
- /**
105
- * @description: 获取input的占位字符
106
- * @return {String}
107
- */
108
- get placeholder() {
109
- return this.getAttribute("placeholder");
110
- }
111
- /**
112
- * @description: 设置input的占位字符
113
- * @param {String} value
114
- */
115
- set placeholder(value) {
116
- if (value) {
117
- this.setAttribute("placeholder", value);
118
- } else {
119
- this.removeAttribute("placeholder");
120
- }
121
- }
122
- /**
123
- * @description: input是否为必选
124
- * @return {String}
125
- */
126
- get required() {
127
- return this.getAttribute("required");
128
- }
129
- /**
130
- * @description: 设置input是否为必选,除非设置成false,否则都是必填
131
- * @param {*} value
132
- */
133
- set required(value) {
134
- if (!value || value === "false") {
135
- this.removeAttribute("required");
136
- } else {
137
- this.setAttribute("required", "");
138
- }
139
- }
140
- /**
141
- * @description: 获取input上disabled属性
142
- * @return {String | null}
143
- */
144
- get disabled() {
145
- return isDisabled(this);
146
- }
147
- /**
148
- * @description: 设置input的disabled属性
149
- * @param {String} value
150
- */
151
- set disabled(value) {
152
- if (falseList.includes(value)) {
153
- this.removeAttribute("disabled");
154
- this._input.removeAttribute("disabled");
155
- this._inputContent.removeAttribute("disabled");
156
- } else {
157
- this.setAttribute("disabled", "");
158
- this._input.setAttribute("disabled", "");
159
- this._inputContent.setAttribute("disabled", "");
160
- }
161
- }
162
- /**
163
- * @description: 获取类似于Metiral Design的输入体验。
164
- */
165
- get label() {
166
- return this.getAttribute("label") || "";
167
- }
168
- /**
169
- * @description: 设置类似于Metiral Design的输入体验。
170
- */
171
- set label(value) {
172
- this.setAttribute("label", value);
173
- }
174
- /**
175
- * @description: 获取input框的状态
176
- */
177
- get status() {
178
- return this.getAttribute("status") || "";
179
- }
180
- /**
181
- * @description: 设置input框的状态
182
- */
183
- set status(value) {
184
- if (value) {
185
- this.setAttribute("status", value);
186
- this._input.setAttribute("status", value);
187
- } else {
188
- this.removeAttribute("status");
189
- this._input.removeAttribute("status");
190
- }
191
- }
192
- /**
193
- * @description: 与form组件联动时,收集的属性名
194
- * @return {String}
195
- */
196
- get name() {
197
- return this.getAttribute("name") || "";
198
- }
199
- /**
200
- * @description: 设置name属性
201
- * @param {string} value
202
- */
203
- set name(value) {
204
- this.setAttribute("name", value);
205
- }
206
- /**
207
- * @description: 当input类型为number类型时,可以获取min属性
208
- * @return {String}
209
- */
210
- get min() {
211
- return this.getAttribute("min") || "";
212
- }
213
- /**
214
- * @description: 当input类型为number类型时,设置min属性
215
- * @param {string} value
216
- */
217
- set min(value) {
218
- if (this.type === "number")
219
- this.setAttribute("min", value);
220
- }
221
- /**
222
- * @description: 当input类型为number类型时,可以获取max属性
223
- * @return {String}
224
- */
225
- get max() {
226
- return this.getAttribute("max") || "";
227
- }
228
- /**
229
- * @description: 当input类型为number类型时,设置max属性
230
- * @param {string} value
231
- */
232
- set max(value) {
233
- if (this.type === "number")
234
- this.setAttribute("max", value);
235
- }
236
- /**
237
- * @description: 当input类型为number类型时,可以获取step属性
238
- * @return {String}
239
- */
240
- get step() {
241
- return this.getAttribute("step") || "";
242
- }
243
- /**
244
- * @description: 当input类型为number类型时,设置step属性
245
- * @param {string} value
246
- */
247
- set step(value) {
248
- if (this.type === "number")
249
- this.setAttribute("step", value);
250
- }
251
- /**
252
- * @description: 获取一个icon
253
- * @return {String}
254
- */
255
- get icon() {
256
- return this.getAttribute("icon");
257
- }
258
- /**
259
- * @description: 设置icon来表示标识
260
- * @param {string|null} value
261
- */
262
- set icon(value) {
263
- if (value) {
264
- this.setAttribute("icon", value);
265
- } else {
266
- this.removeAttribute("icon");
267
- }
268
- }
269
- /**
270
- * @description: 获取input的类型
271
- * @return {string|null}
272
- */
273
- get type() {
274
- return this.getAttribute("type");
275
- }
276
- /**
277
- * @description: 设置input的类型
278
- * @param {string|null} value
279
- */
280
- set type(value) {
281
- if (value) {
282
- this.setAttribute("type", value);
283
- } else {
284
- this.removeAttribute("type");
285
- }
286
- }
287
- /**
288
- * @description: 监听placeholder属性函数
289
- * @param {string} name
290
- * @param {string} value
291
- */
292
- listenPlaceholder(name, value) {
293
- if (name === "placeholder" && this._inputContent) {
294
- if (value != null) {
295
- this._inputContent.setAttribute("placeholder", value);
296
- } else {
297
- this._inputContent.removeAttribute("placeholder");
298
- }
299
- }
300
- }
301
- /**
302
- * @description: 监听label属性函数
303
- * @param {string} name
304
- * @param {string} value
305
- */
306
- listenLabel(name, value) {
307
- if (name === "label" && this._inputContent) {
308
- if (value != null) {
309
- if (this._label) {
310
- this._label.innerHTML = value;
311
- } else {
312
- this._label = document.createElement("label");
313
- this._label.innerHTML = value;
314
- this._label.setAttribute("class", "ran-input-label");
315
- this._label.setAttribute("part", "ran-input-label");
316
- this._input.appendChild(this._label);
317
- }
318
- } else {
319
- this._input.removeAttribute("label");
320
- if (this._label) {
321
- this._input.removeChild(this._label);
322
- this._label = void 0;
323
- }
324
- }
325
- }
326
- }
327
- /**
328
- * @description: 监听type属性
329
- * @param {string} name
330
- * @param {string} value
331
- */
332
- listenType(name, value) {
333
- if (name === "type" && this._inputContent) {
334
- if (value) {
335
- this._inputContent.setAttribute("type", value);
336
- } else {
337
- this._inputContent.removeAttribute("type");
338
- this._inputContent.removeAttribute("min");
339
- this._inputContent.removeAttribute("max");
340
- this._inputContent.removeAttribute("step");
341
- }
342
- }
343
- }
344
- /**
345
- * @description: 监听status属性
346
- * @param {string} name
347
- * @param {string} value
348
- */
349
- listenStatus(name, value) {
350
- if (name === "status" && this._input) {
351
- if (value) {
352
- this._input.setAttribute("status", value);
353
- } else {
354
- this._input.removeAttribute("status");
355
- }
356
- }
357
- }
358
- /**
359
- * @description: 监听disabled属性
360
- * @param {string} name
361
- * @param {string} value
362
- */
363
- listenDisabled(name, value) {
364
- if (name === "disabled" && this._input) {
365
- if (falseList.includes(value)) {
366
- this._input.removeAttribute("disabled");
367
- } else {
368
- this._input.setAttribute("disabled", "");
369
- this._inputContent.setAttribute("disabled", "");
370
- }
371
- }
372
- }
373
- /**
374
- * @description: 监听icon属性
375
- * @param {string} name
376
- * @param {string} value
377
- */
378
- listenIcon(name, value, oldValue) {
379
- if (name === "icon" && value && value !== oldValue) {
380
- this.removeAttribute("label");
381
- this.setAttribute("icon", value);
382
- this.dealIcon();
383
- }
384
- }
385
- /**
386
- * @description: 聚合监听事件
387
- * @param {string} name
388
- * @param {string} oldValue
389
- * @param {string} newValue
390
- */
391
- listenEvent(name, oldValue, newValue) {
392
- this.listenPlaceholder(name, newValue);
393
- this.listenLabel(name, newValue);
394
- this.listenStatus(name, newValue);
395
- this.listenDisabled(name, newValue);
396
- this.listenIcon(name, newValue, oldValue);
397
- }
398
- connectedCallback() {
399
- if (this.value) {
400
- this._inputContent.value = this.value;
401
- this._input.setAttribute("value", this.value);
402
- }
403
- if (this.status) {
404
- this._input.setAttribute("status", this.status);
405
- }
406
- if (isDisabled(this)) {
407
- this._input.setAttribute("disabled", "");
408
- this._inputContent.setAttribute("disabled", "");
409
- }
410
- if (this.type) {
411
- this._inputContent.setAttribute("type", this.type);
412
- }
413
- this._inputContent.addEventListener("input", this.customInput);
414
- if (document.readyState === "complete") {
415
- this.dealIcon();
416
- }
417
- }
418
- disconnectCallback() {
419
- this._inputContent.removeEventListener("input", this.customInput);
420
- }
421
- attributeChangedCallback(name, oldValue, newValue) {
422
- this.listenEvent(name, oldValue, newValue);
423
- }
424
- }
425
- customElements.define("r-input", CustomElement);
426
- return CustomElement;
427
- } else {
428
- return createCustomError("document is undefined or r-input is exist");
429
- }
430
- }
431
- const index = Custom();
432
- const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
433
- __proto__: null,
434
- default: index
435
- }, Symbol.toStringTag, { value: "Module" }));
436
- export {
437
- index as a,
438
- index$1 as i
439
- };
@@ -1,14 +0,0 @@
1
- const arrowDown = { "success": true, "_identification": true, "data": '<svg viewBox="0 0 1024 1024" width="200" height="200" version="1.1"\n fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path>\n</svg>' };
2
- const arrowDown$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3
- __proto__: null,
4
- default: arrowDown
5
- }, Symbol.toStringTag, { value: "Module" }));
6
- const infoCircleFill = { "success": true, "_identification": true, "data": '<svg t="1667965239916" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8850" width="200" height="200"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64z m32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272z m-32-344c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48z" p-id="8851"></path></svg>' };
7
- const infoCircleFill$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8
- __proto__: null,
9
- default: infoCircleFill
10
- }, Symbol.toStringTag, { value: "Module" }));
11
- export {
12
- arrowDown$1 as a,
13
- infoCircleFill$1 as i
14
- };
@@ -1,3 +0,0 @@
1
- export declare const TIME_OUT = 1000;
2
- export declare const PORT = 5173;
3
- export declare const DEV_SERVER = "http://localhost:5173/";
@@ -1,2 +0,0 @@
1
- declare const _default: import("vite").UserConfig;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import('../../utils/index').CustomErrorType;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: void;
2
- export default _default;