ranui 0.1.9 → 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 (171) 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 +7 -3
  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 +65 -41
  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 +31 -6
  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 +5 -1
  23. package/dist/components/select/index.d.ts +15 -7
  24. package/dist/content.js +6 -0
  25. package/dist/docx-ajDUtnbM.js +3665 -0
  26. package/dist/global-DOfcrQ2N.js +4 -0
  27. package/dist/icon.js +6 -0
  28. package/dist/iconShadowless.js +6 -0
  29. package/dist/image.js +4 -0
  30. package/dist/index-0fvHQjmN.js +298 -0
  31. package/dist/{index-1b73beee.js → index-BLepXisd.js} +55 -90
  32. package/dist/{index-e2e5d725.js → index-BOoNI-Al.js} +113 -305
  33. package/dist/{index-2d16a084.js → index-BPBRPxND.js} +8 -10
  34. package/dist/{index-e03d23e7.js → index-BpOERe9M.js} +1 -1
  35. package/dist/index-Bv6Z6rIe.js +498 -0
  36. package/dist/index-ByJ7zZdQ.js +65641 -0
  37. package/dist/{index-b7790662.js → index-C1x9Popy.js} +1 -1
  38. package/dist/index-CCNK5H8T.js +103 -0
  39. package/dist/{index-458debf7.js → index-CD09p_mF.js} +7 -31
  40. package/dist/{index-1048a998.js → index-CFnsLnrb.js} +68 -19
  41. package/dist/{index-4443363f.js → index-CJZp9lE4.js} +29 -50
  42. package/dist/{index-57492b9b.js → index-CSnBqUsQ.js} +48 -1
  43. package/dist/index-CWWI8SHO.js +206 -0
  44. package/dist/{index-7b8840f9.js → index-CZlEoE62.js} +220 -1010
  45. package/dist/index-CbyMC6Yz.js +59 -0
  46. package/dist/index-CiBVH-oH.js +258 -0
  47. package/dist/{index-3cf72afd.js → index-DUMmFdJ7.js} +9 -23
  48. package/dist/{index-01b17e26.js → index-Du-Biu-I.js} +1 -1
  49. package/dist/index-EnzWG8R0.js +521 -0
  50. package/dist/index-F2RO3OU4.js +501 -0
  51. package/dist/{index-7216d6b0.js → index-GavQwMDL.js} +11 -29
  52. package/dist/{index-0d5b9435.js → index-suip9eAw.js} +2 -2
  53. package/dist/index.d.ts +18 -14
  54. package/dist/index.js +23 -19
  55. package/dist/info-circle-fill-CFeVMdci.js +4 -0
  56. package/dist/input.js +6 -0
  57. package/dist/inputShadowless.js +6 -0
  58. package/dist/jszip.min-Ca6PjkYs.js +2674 -0
  59. package/dist/message.js +5 -0
  60. package/dist/modal.js +4 -0
  61. package/dist/{components/option/index.js → option.js} +3 -6
  62. package/dist/{pdf-bdb7818a.js → pdf-B2a6ll8f.js} +1 -1
  63. package/dist/player.js +8 -0
  64. package/dist/popover.js +6 -0
  65. package/dist/preview.js +7 -0
  66. package/dist/progress.js +7 -0
  67. package/dist/radar.js +6 -0
  68. package/dist/select.js +10 -0
  69. package/dist/selectShadowless.js +10 -0
  70. package/dist/{umd/components/image → shadowless/icon}/index.d.ts +1 -0
  71. package/dist/{umd/components → shadowless}/input/index.d.ts +33 -8
  72. package/dist/{umd/components → shadowless}/select/index.d.ts +16 -12
  73. package/dist/shadowless/shadowless/index.js +14 -0
  74. package/dist/shadowless.d.ts +3 -0
  75. package/dist/skeleton.js +4 -0
  76. package/dist/sprite-CH2zLtZy.js +141 -0
  77. package/dist/style.css +1 -1
  78. package/dist/tab.js +6 -0
  79. package/dist/tabpane.js +4 -0
  80. package/dist/tsconfig.json +29 -0
  81. package/dist/umd/index.umd.cjs +21 -32
  82. package/dist/umd/shadowless/shadowless.umd.cjs +1 -0
  83. package/dist/umd/shadowless/style.css +1 -0
  84. package/dist/umd/style.css +1 -1
  85. package/dist/utils/color.d.ts +52 -0
  86. package/dist/utils/index.d.ts +9 -1
  87. package/dist/{index-7913ec46.js → utils-BMBEcoPj.js} +279 -162
  88. package/dist/vite.config.d.ts +1 -0
  89. package/package.json +61 -36
  90. package/readme.md +14 -14
  91. package/typings.d.ts +101 -0
  92. package/dist/components/button/index.js +0 -8
  93. package/dist/components/icon/index.js +0 -6
  94. package/dist/components/image/index.js +0 -4
  95. package/dist/components/input/index.js +0 -6
  96. package/dist/components/message/index.js +0 -4
  97. package/dist/components/modal/index.js +0 -4
  98. package/dist/components/player/index.js +0 -12
  99. package/dist/components/preview/index.js +0 -8
  100. package/dist/components/progress/index.js +0 -8
  101. package/dist/components/radar/index.js +0 -7
  102. package/dist/components/select/index.js +0 -11
  103. package/dist/components/skeleton/index.js +0 -4
  104. package/dist/components/tab/index.js +0 -7
  105. package/dist/components/tabpane/index.js +0 -4
  106. package/dist/docx-c5d02d8c.js +0 -21
  107. package/dist/index-73ce455b.js +0 -264
  108. package/dist/index-c14450a9.js +0 -662
  109. package/dist/info-circle-fill-90ec9aa9.js +0 -14
  110. package/dist/umd/build/config.d.ts +0 -3
  111. package/dist/umd/build/config.umd.d.ts +0 -2
  112. package/dist/umd/components/button/index.d.ts +0 -35
  113. package/dist/umd/components/form/index.d.ts +0 -2
  114. package/dist/umd/components/icon/index.d.ts +0 -2
  115. package/dist/umd/components/message/index.d.ts +0 -14
  116. package/dist/umd/components/modal/index.d.ts +0 -2
  117. package/dist/umd/components/option/index.d.ts +0 -2
  118. package/dist/umd/components/player/index.d.ts +0 -213
  119. package/dist/umd/components/preview/colz.d.ts +0 -72
  120. package/dist/umd/components/preview/docx.d.ts +0 -8
  121. package/dist/umd/components/preview/excel/excel.d.ts +0 -2
  122. package/dist/umd/components/preview/excel/index.d.ts +0 -1
  123. package/dist/umd/components/preview/excel/media.d.ts +0 -37
  124. package/dist/umd/components/preview/index.d.ts +0 -6
  125. package/dist/umd/components/preview/pdf.d.ts +0 -1
  126. package/dist/umd/components/preview/pptx/index.d.ts +0 -16
  127. package/dist/umd/components/preview/pptx/process_pptx.d.ts +0 -23
  128. package/dist/umd/components/preview/pptx/t_xml.d.ts +0 -1
  129. package/dist/umd/components/preview/pptx/worker.d.ts +0 -1
  130. package/dist/umd/components/progress/index.d.ts +0 -36
  131. package/dist/umd/components/radar/index.d.ts +0 -2
  132. package/dist/umd/components/scratch/index.d.ts +0 -19
  133. package/dist/umd/components/skeleton/index.d.ts +0 -2
  134. package/dist/umd/components/tab/index.d.ts +0 -408
  135. package/dist/umd/components/tabpane/index.d.ts +0 -352
  136. package/dist/umd/index.d.ts +0 -14
  137. package/dist/umd/playwright.config.d.ts +0 -9
  138. package/dist/umd/plugins/auto-import-file.d.ts +0 -0
  139. package/dist/umd/plugins/load-style.d.ts +0 -6
  140. package/dist/umd/plugins/load-svg.d.ts +0 -9
  141. package/dist/umd/tests/button.spec.d.ts +0 -1
  142. package/dist/umd/utils/image.d.ts +0 -32
  143. package/dist/umd/utils/index.d.ts +0 -64
  144. package/dist/umd/utils/math.d.ts +0 -26
  145. package/dist/umd/utils/tween.d.ts +0 -21
  146. package/dist/umd/vite.config.d.ts +0 -6
  147. package/dist/vendor-f71e6f68.js +0 -92126
  148. /package/dist/{add-user-b2bed3e7.js → add-user-BN1JlY7e.js} +0 -0
  149. /package/dist/{book-b11a68eb.js → book-nTEFXU2x.js} +0 -0
  150. /package/dist/{umd/build/config.es.d.ts → build/config.sha.d.ts} +0 -0
  151. /package/dist/{check-circle-fill-dc284144.js → check-circle-fill-B_pd8ZSs.js} +0 -0
  152. /package/dist/{check-circle-74bd09c3.js → check-circle-szyAJiap.js} +0 -0
  153. /package/dist/{close-20925345.js → close-CFnkhudp.js} +0 -0
  154. /package/dist/{close-circle-720c18be.js → close-circle-CwmuN2C6.js} +0 -0
  155. /package/dist/{close-circle-fill-238a66b1.js → close-circle-fill-jSqPPw9i.js} +0 -0
  156. /package/dist/{eye-5e742329.js → eye-D_mEt17f.js} +0 -0
  157. /package/dist/{eye-close-3874f1ae.js → eye-close-BVr3NJtg.js} +0 -0
  158. /package/dist/{home-c4a05e8b.js → home-BUQ4USMk.js} +0 -0
  159. /package/dist/{index-8e1e2573.js → index-CQTJoWhb.js} +0 -0
  160. /package/dist/{info-circle-5826decc.js → info-circle-COnL5bTJ.js} +0 -0
  161. /package/dist/{loading-09ca52df.js → loading-Dcc5RApI.js} +0 -0
  162. /package/dist/{lock-1d2487c9.js → lock-Cr7BnmWN.js} +0 -0
  163. /package/dist/{message-b2bfdea7.js → message-D36_Zo2l.js} +0 -0
  164. /package/dist/{power-off-6ade5a91.js → power-off-lQRbiBak.js} +0 -0
  165. /package/dist/{preview-b291aea8.js → preview-CJbz9GjO.js} +0 -0
  166. /package/dist/{setting-1e5ccb6d.js → setting-DemlgzVC.js} +0 -0
  167. /package/dist/{team-ca6a12e1.js → team-tl4NJXPC.js} +0 -0
  168. /package/dist/{unlock-f56086fd.js → unlock-CeU74z9n.js} +0 -0
  169. /package/dist/{user-5c01e665.js → user-B-eVXwuk.js} +0 -0
  170. /package/dist/{warning-circle-035e025c.js → warning-circle-DDUgEDIv.js} +0 -0
  171. /package/dist/{warning-circle-fill-d17c37c9.js → warning-circle-fill-lODUKz0i.js} +0 -0
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
6
  };
7
- 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}\n";
7
+ 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}";
8
8
  function CustomElement() {
9
9
  if (typeof window !== "undefined" && !customElements.get("r-tab")) {
10
10
  class TabPane extends HTMLElement {
@@ -0,0 +1,103 @@
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 { a as addClassToElement, r as removeClassToElement } from "./utils-BMBEcoPj.js";
8
+ import { H as HTMLElementSSR, f as falseList, c as createCustomError } from "./index-CSnBqUsQ.js";
9
+ class Checkbox extends HTMLElementSSR() {
10
+ constructor() {
11
+ super();
12
+ __publicField(this, "checkInput");
13
+ __publicField(this, "checkInner");
14
+ __publicField(this, "context");
15
+ __publicField(this, "updateChecked", () => {
16
+ const { checked } = this.context;
17
+ if (checked) {
18
+ addClassToElement(this, "ran-checkbox-checked");
19
+ } else {
20
+ removeClassToElement(this, "ran-checkbox-checked");
21
+ }
22
+ });
23
+ __publicField(this, "update", () => {
24
+ this.updateChecked();
25
+ });
26
+ __publicField(this, "onChange", () => {
27
+ const { checked } = this.context;
28
+ this.context.checked = !checked;
29
+ this.dispatchEvent(
30
+ new CustomEvent("change", {
31
+ detail: {
32
+ checked: this.context.checked
33
+ }
34
+ })
35
+ );
36
+ this.update();
37
+ });
38
+ this.checkInput = document.createElement("input");
39
+ this.checkInput.setAttribute("class", "ran-checkbox-input");
40
+ this.checkInput.setAttribute("type", "checkbox");
41
+ this.checkInner = document.createElement("span");
42
+ this.checkInner.setAttribute("class", "ran-checkbox-inner");
43
+ this.context = {
44
+ checked: false
45
+ };
46
+ }
47
+ static get observedAttributes() {
48
+ return ["disabled", "checked"];
49
+ }
50
+ get disabled() {
51
+ return this.getAttribute("disabled") || "";
52
+ }
53
+ set disabled(value) {
54
+ this.setAttribute("disabled", value);
55
+ }
56
+ get checked() {
57
+ const checked = this.getAttribute("checked");
58
+ if (falseList.includes(checked)) {
59
+ this.context.checked = false;
60
+ }
61
+ return `${this.context.checked}`;
62
+ }
63
+ set checked(value) {
64
+ if (falseList.includes(value)) {
65
+ this.setAttribute("checked", "false");
66
+ this.context.checked = false;
67
+ } else {
68
+ this.setAttribute("checked", "true");
69
+ this.context.checked = true;
70
+ }
71
+ this.updateChecked();
72
+ }
73
+ connectedCallback() {
74
+ this.setAttribute("class", "ran-checkbox");
75
+ this.appendChild(this.checkInput);
76
+ this.appendChild(this.checkInner);
77
+ this.addEventListener("click", this.onChange);
78
+ }
79
+ disconnectCallback() {
80
+ this.removeEventListener("click", this.onChange);
81
+ }
82
+ attributeChangedCallback(name, oldValue, newValue) {
83
+ }
84
+ }
85
+ function Custom() {
86
+ if (typeof document !== "undefined" && !customElements.get("r-checkbox")) {
87
+ customElements.define("r-checkbox", Checkbox);
88
+ return Checkbox;
89
+ } else {
90
+ return createCustomError("document is undefined or r-checkbox is exist");
91
+ }
92
+ }
93
+ const index = Custom();
94
+ const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
95
+ __proto__: null,
96
+ Checkbox,
97
+ default: index
98
+ }, Symbol.toStringTag, { value: "Module" }));
99
+ export {
100
+ Checkbox as C,
101
+ index as a,
102
+ index$1 as i
103
+ };
@@ -4,9 +4,9 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
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";
7
+ import { g as getPixelRatio } from "./utils-BMBEcoPj.js";
8
+ import { c as createCustomError } from "./index-CSnBqUsQ.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}";
10
10
  const BACKGROUND_COLOR = "rgba(0,0,0,0)";
11
11
  const FONT_COLOR = "rgba(0,0,0,1)";
12
12
  const POLYGON_COLOR = "#e6e6e6";
@@ -43,13 +43,7 @@ function Custom() {
43
43
  shadowRoot.appendChild(this.abilityRadarChartContainer);
44
44
  }
45
45
  static get observedAttributes() {
46
- return [
47
- "abilitys",
48
- "colorPolygon",
49
- "colorLine",
50
- "fillColor",
51
- "strokeColor"
52
- ];
46
+ return ["abilitys", "colorPolygon", "colorLine", "fillColor", "strokeColor"];
53
47
  }
54
48
  get abilitys() {
55
49
  const item = this.getAttribute("abilitys");
@@ -254,21 +248,9 @@ function Custom() {
254
248
  ctx.fillStyle = color;
255
249
  ctx.moveTo(x + radius, y);
256
250
  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
- );
251
+ ctx.arc(x + width - radius, y + radius, radius, Math.PI * 3 / 2, Math.PI * 2);
264
252
  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
- );
253
+ ctx.arc(x + width - radius, y + height - radius, radius, Math.PI, Math.PI / 2);
272
254
  ctx.lineTo(x + radius, y + height);
273
255
  ctx.arc(x + radius, y + height - radius, radius, Math.PI / 2, Math.PI);
274
256
  ctx.lineTo(x, y + radius);
@@ -325,13 +307,7 @@ function Custom() {
325
307
  disconnectCallback() {
326
308
  }
327
309
  attributeChangedCallback(name, oldValue, newValue) {
328
- const attribute = [
329
- "abilitys",
330
- "colorPolygon",
331
- "colorLine",
332
- "fillColor",
333
- "strokeColor"
334
- ];
310
+ const attribute = ["abilitys", "colorPolygon", "colorLine", "fillColor", "strokeColor"];
335
311
  if (attribute.includes(name) && this.abilityRadarChartContainer && oldValue !== newValue) {
336
312
  this.refreshData();
337
313
  }
@@ -4,9 +4,8 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
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 {
7
+ import { H as HTMLElementSSR, i as isDisabled, f as falseList, c as createCustomError } from "./index-CSnBqUsQ.js";
8
+ class Input extends HTMLElementSSR() {
10
9
  constructor() {
11
10
  super();
12
11
  __publicField(this, "_input");
@@ -146,7 +145,7 @@ class Input extends HTMLElement {
146
145
  */
147
146
  __publicField(this, "dealIcon", () => {
148
147
  if (!this._icon) {
149
- this._icon = document.createElement("r-icon");
148
+ this._icon = document.createElement("ra-icon");
150
149
  const { width, height } = this._inputContent.getBoundingClientRect();
151
150
  const size = Math.min(width, height);
152
151
  this._icon.setAttribute("size", `${size}`);
@@ -171,10 +170,6 @@ class Input extends HTMLElement {
171
170
  this._input.setAttribute("value", newValue);
172
171
  }
173
172
  });
174
- const shadowRoot = this.attachShadow({ mode: "closed" });
175
- const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
176
- F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc;
177
- shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
178
173
  this._input = document.createElement("div");
179
174
  this._input.setAttribute("class", "ran-input");
180
175
  this._input.setAttribute("part", "ran-input");
@@ -182,7 +177,6 @@ class Input extends HTMLElement {
182
177
  this._inputContent.setAttribute("class", "ran-input-content");
183
178
  this._inputContent.setAttribute("part", "ran-input-content");
184
179
  this._input.appendChild(this._inputContent);
185
- shadowRoot.appendChild(this._input);
186
180
  }
187
181
  static get observedAttributes() {
188
182
  return [
@@ -193,7 +187,25 @@ class Input extends HTMLElement {
193
187
  "type",
194
188
  "icon",
195
189
  "value",
196
- "status"
190
+ "status",
191
+ // error warning
192
+ "prefix",
193
+ // 前缀
194
+ "suffix",
195
+ // 后缀
196
+ "allowclear",
197
+ // 清除 icon
198
+ "count",
199
+ // 计算输入的数量
200
+ "maxlength",
201
+ "showcount",
202
+ "onPressEnter",
203
+ // 按下回车的回调
204
+ "variant",
205
+ // filled borderless
206
+ "minrows",
207
+ // 当 type 等于 TextArea 时
208
+ "maxrows"
197
209
  ];
198
210
  }
199
211
  /**
@@ -201,7 +213,7 @@ class Input extends HTMLElement {
201
213
  * @return {String}
202
214
  */
203
215
  get value() {
204
- return this.getAttribute("value");
216
+ return this.getAttribute("value") || "";
205
217
  }
206
218
  /**
207
219
  * @description: 设置input的值
@@ -221,7 +233,7 @@ class Input extends HTMLElement {
221
233
  * @return {String}
222
234
  */
223
235
  get placeholder() {
224
- return this.getAttribute("placeholder");
236
+ return this.getAttribute("placeholder") || "";
225
237
  }
226
238
  /**
227
239
  * @description: 设置input的占位字符
@@ -239,7 +251,7 @@ class Input extends HTMLElement {
239
251
  * @return {String}
240
252
  */
241
253
  get required() {
242
- return this.getAttribute("required");
254
+ return this.getAttribute("required") || "";
243
255
  }
244
256
  /**
245
257
  * @description: 设置input是否为必选,除非设置成false,否则都是必填
@@ -257,7 +269,7 @@ class Input extends HTMLElement {
257
269
  * @return {String | null}
258
270
  */
259
271
  get disabled() {
260
- return isDisabled(this);
272
+ return `${isDisabled(this)}`;
261
273
  }
262
274
  /**
263
275
  * @description: 设置input的disabled属性
@@ -368,7 +380,7 @@ class Input extends HTMLElement {
368
380
  * @return {String}
369
381
  */
370
382
  get icon() {
371
- return this.getAttribute("icon");
383
+ return this.getAttribute("icon") || "";
372
384
  }
373
385
  /**
374
386
  * @description: 设置icon来表示标识
@@ -381,12 +393,48 @@ class Input extends HTMLElement {
381
393
  this.removeAttribute("icon");
382
394
  }
383
395
  }
396
+ /**
397
+ * @description: 获取前面的icon
398
+ * @return {String}
399
+ */
400
+ get prefix() {
401
+ return this.getAttribute("prefix") || "";
402
+ }
403
+ /**
404
+ * @description: 设置前面的icon来表示标识
405
+ * @param {string|null} value
406
+ */
407
+ set prefix(value) {
408
+ if (value) {
409
+ this.setAttribute("prefix", value);
410
+ } else {
411
+ this.removeAttribute("prefix");
412
+ }
413
+ }
414
+ /**
415
+ * @description: 获取后面的icon
416
+ * @return {String}
417
+ */
418
+ get suffix() {
419
+ return this.getAttribute("suffix") || "";
420
+ }
421
+ /**
422
+ * @description: 设置后面的icon来表示标识
423
+ * @param {string|null} value
424
+ */
425
+ set suffix(value) {
426
+ if (value) {
427
+ this.setAttribute("suffix", value);
428
+ } else {
429
+ this.removeAttribute("suffix");
430
+ }
431
+ }
384
432
  /**
385
433
  * @description: 获取input的类型
386
434
  * @return {string|null}
387
435
  */
388
436
  get type() {
389
- return this.getAttribute("type");
437
+ return this.getAttribute("type") || "";
390
438
  }
391
439
  /**
392
440
  * @description: 设置input的类型
@@ -418,6 +466,7 @@ class Input extends HTMLElement {
418
466
  if (document.readyState === "complete") {
419
467
  this.dealIcon();
420
468
  }
469
+ this.appendChild(this._input);
421
470
  }
422
471
  disconnectCallback() {
423
472
  this._inputContent.removeEventListener("input", this.customInput);
@@ -427,11 +476,11 @@ class Input extends HTMLElement {
427
476
  }
428
477
  }
429
478
  function Custom() {
430
- if (typeof window !== "undefined" && !customElements.get("r-input")) {
431
- customElements.define("r-input", Input);
479
+ if (typeof window !== "undefined" && !customElements.get("ra-input")) {
480
+ customElements.define("ra-input", Input);
432
481
  return Input;
433
482
  } else {
434
- return createCustomError("document is undefined or r-input is exist");
483
+ return createCustomError("document is undefined or ra-input is exist");
435
484
  }
436
485
  }
437
486
  const index = Custom();
@@ -4,11 +4,10 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
6
  };
7
- import { p as perToNum } from "./index-7913ec46.js";
8
- import { c as createCustomError } from "./index-57492b9b.js";
9
- const index$2 = "";
7
+ import { p as perToNum } from "./utils-BMBEcoPj.js";
8
+ import { H as HTMLElementSSR, c as createCustomError } from "./index-CSnBqUsQ.js";
10
9
  const attributes = ["percent", "type", "total", "dot"];
11
- class Progress extends HTMLElement {
10
+ class Progress extends HTMLElementSSR() {
12
11
  constructor() {
13
12
  super();
14
13
  __publicField(this, "_progress");
@@ -19,19 +18,10 @@ class Progress extends HTMLElement {
19
18
  __publicField(this, "progressClick", (e) => {
20
19
  const rect = this._progress.getBoundingClientRect();
21
20
  const offsetX = e.clientX - rect.left;
22
- const percentage = Math.min(
23
- 1,
24
- Math.max(0, offsetX / this._progress.offsetWidth)
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
- );
21
+ const percentage = Math.min(1, Math.max(0, offsetX / this._progress.offsetWidth));
22
+ this.percent = `${percentage * Number(this.total)}`;
23
+ this._progressWrapValue.style.setProperty("transform", `scaleX(${percentage})`);
24
+ this._progressDot.style.setProperty("transform", `translateX(${percentage * this._progress.offsetWidth}px)`);
35
25
  this.change();
36
26
  });
37
27
  __publicField(this, "progressDotMouseDown", () => {
@@ -42,19 +32,10 @@ class Progress extends HTMLElement {
42
32
  return;
43
33
  const rect = this._progress.getBoundingClientRect();
44
34
  const offsetX = e.clientX - rect.left;
45
- const percentage = Math.min(
46
- 1,
47
- Math.max(0, offsetX / this._progress.offsetWidth)
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
- );
35
+ const percentage = Math.min(1, Math.max(0, offsetX / this._progress.offsetWidth));
36
+ this.percent = `${percentage * Number(this.total)}`;
37
+ this._progressWrapValue.style.setProperty("transform", `scaleX(${percentage})`);
38
+ this._progressDot.style.setProperty("transform", `translateX(${percentage * this._progress.offsetWidth}px)`);
58
39
  this.change();
59
40
  });
60
41
  __publicField(this, "progressDotMouseUp", (e) => {
@@ -82,15 +63,9 @@ class Progress extends HTMLElement {
82
63
  }
83
64
  });
84
65
  __publicField(this, "updateCurrentProgress", () => {
85
- const percent = this.percent / this.total;
86
- this._progressWrapValue.style.setProperty(
87
- "transform",
88
- `scaleX(${percent})`
89
- );
90
- this._progressDot.style.setProperty(
91
- "transform",
92
- `translateX(${percent * this._progress.offsetWidth}px)`
93
- );
66
+ const percent = Number(this.percent) / Number(this.total);
67
+ this._progressWrapValue.style.setProperty("transform", `scaleX(${percent})`);
68
+ this._progressDot.style.setProperty("transform", `translateX(${percent * this._progress.offsetWidth}px)`);
94
69
  });
95
70
  __publicField(this, "dragEvent", () => {
96
71
  if (this.type !== "drag")
@@ -101,9 +76,9 @@ class Progress extends HTMLElement {
101
76
  document.addEventListener("mouseup", this.progressDotMouseUp);
102
77
  });
103
78
  __publicField(this, "createProgress", () => {
104
- if (!this.contains(this._progress)) {
105
- this.appendChild(this._progress);
79
+ if (!(this.children.length > 0 && [...this.children].some((item) => item.className === "ran-progress"))) {
106
80
  this._progress.appendChild(this._progressDot);
81
+ this.appendChild(this._progress);
107
82
  }
108
83
  });
109
84
  __publicField(this, "resize", () => {
@@ -111,6 +86,7 @@ class Progress extends HTMLElement {
111
86
  });
112
87
  this._progress = document.createElement("div");
113
88
  this._progress.setAttribute("class", "ran-progress");
89
+ this._progress.setAttribute("role", "progressbar");
114
90
  this._progressWrap = document.createElement("div");
115
91
  this._progressWrap.setAttribute("class", "ran-progress-wrap");
116
92
  this._progress.appendChild(this._progressWrap);
@@ -129,20 +105,21 @@ class Progress extends HTMLElement {
129
105
  get percent() {
130
106
  const percent = this.getAttribute("percent") || "";
131
107
  const num = perToNum(percent);
132
- if (num > this.total) {
108
+ if (Number(num) > Number(this.total)) {
133
109
  console.error("percent must be < total");
134
110
  return this.total;
135
111
  }
136
- return perToNum(percent);
112
+ return `${perToNum(percent)}`;
137
113
  }
138
114
  set percent(value) {
139
115
  this.setAttribute("percent", `${value || 0}`);
116
+ this.setAttribute("aria-valuenow", `${value || 0}`);
140
117
  }
141
118
  get total() {
142
119
  const total = this.getAttribute("total");
143
120
  if (!total)
144
- return 1;
145
- return perToNum(total);
121
+ return "1";
122
+ return `${perToNum(total)}`;
146
123
  }
147
124
  set total(value) {
148
125
  this.setAttribute("total", value || "");
@@ -184,16 +161,17 @@ class Progress extends HTMLElement {
184
161
  this.setAttribute("dot", value || "true");
185
162
  }
186
163
  connectedCallback() {
164
+ const type = this.getAttribute("type");
165
+ if (!type) {
166
+ this.setAttribute("type", "primary");
167
+ }
187
168
  this.dragEvent();
188
169
  this.updateCurrentProgress();
189
170
  window.addEventListener("resize", this.resize);
190
171
  }
191
172
  disconnectCallback() {
192
173
  this._progress.removeEventListener("click", this.progressClick);
193
- this._progressDot.removeEventListener(
194
- "mousedown",
195
- this.progressDotMouseDown
196
- );
174
+ this._progressDot.removeEventListener("mousedown", this.progressDotMouseDown);
197
175
  document.removeEventListener("mousemove", this.progressDotMouseMove);
198
176
  document.removeEventListener("mouseup", this.progressDotMouseUp);
199
177
  window.removeEventListener("resize", this.resize);
@@ -214,7 +192,8 @@ class Progress extends HTMLElement {
214
192
  }
215
193
  function Custom() {
216
194
  if (typeof document !== "undefined" && !customElements.get("r-progress")) {
217
- customElements.define("r-progress", Progress);
195
+ Progress && customElements.define("r-progress", Progress);
196
+ return Progress;
218
197
  } else {
219
198
  return createCustomError("document is undefined or r-progress is exist");
220
199
  }
@@ -31,7 +31,7 @@ const loadScript = (src) => {
31
31
  document.body.append(script);
32
32
  });
33
33
  };
34
- function createCustomError(msg) {
34
+ function createCustomError(msg = "") {
35
35
  return class CustomError {
36
36
  constructor(message = msg) {
37
37
  __publicField(this, "message");
@@ -39,7 +39,54 @@ function createCustomError(msg) {
39
39
  }
40
40
  };
41
41
  }
42
+ const HTMLElementSSR = () => {
43
+ if (typeof document !== "undefined") {
44
+ return HTMLElement;
45
+ }
46
+ return null;
47
+ };
48
+ const createSignal = (value, options) => {
49
+ const signal = {
50
+ value,
51
+ // 订阅者
52
+ subscribers: /* @__PURE__ */ new Set(),
53
+ comparator: options == null ? void 0 : options.equals
54
+ };
55
+ const { subscriber } = options || {};
56
+ if (subscriber && Array.isArray(subscriber)) {
57
+ subscriber.forEach((item) => {
58
+ if (typeof item === "function" && !signal.subscribers.has(item)) {
59
+ signal.subscribers.add(item);
60
+ }
61
+ });
62
+ }
63
+ const getter = () => {
64
+ return signal.value;
65
+ };
66
+ const updateSignal = (newValue) => {
67
+ if (signal.value !== newValue) {
68
+ signal.value = newValue;
69
+ signal.subscribers.forEach((subscriber2) => subscriber2(newValue));
70
+ }
71
+ };
72
+ const setter = (newValue) => {
73
+ const { comparator } = signal;
74
+ if (comparator instanceof Function) {
75
+ return !comparator(signal.value, newValue) && updateSignal(newValue);
76
+ }
77
+ if (comparator === void 0) {
78
+ if (signal.value !== newValue) {
79
+ updateSignal(newValue);
80
+ }
81
+ } else {
82
+ !comparator && updateSignal(newValue);
83
+ }
84
+ };
85
+ return [getter, setter];
86
+ };
42
87
  export {
88
+ HTMLElementSSR as H,
89
+ createSignal as a,
43
90
  createCustomError as c,
44
91
  falseList as f,
45
92
  isDisabled as i,