ranui 0.1.10-alpha.7 → 0.2.0-alpha.0

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 (326) hide show
  1. package/README.md +397 -0
  2. package/README.zh-CN.md +369 -0
  3. package/dist/assets/image/failImage.d.ts +2 -0
  4. package/dist/bin/generate-component-api.d.ts +1 -0
  5. package/dist/bin/generate-style-docs.d.ts +1 -0
  6. package/dist/build/config.bundle.d.ts +2 -0
  7. package/dist/build/config.d.ts +3 -0
  8. package/dist/build/config.es.d.ts +2 -0
  9. package/dist/build/config.umd.d.ts +1 -0
  10. package/dist/builder.d.ts +11 -0
  11. package/dist/builder.js +39 -0
  12. package/dist/button-DukaD6uL.js +117 -0
  13. package/dist/button.js +3 -5
  14. package/dist/card-DQUJoDUQ.js +60 -0
  15. package/dist/card.js +5 -0
  16. package/dist/checkbox-iHZQb-yQ.js +94 -0
  17. package/dist/checkbox.js +3 -5
  18. package/dist/colorpicker-Ch67dWa_.js +302 -0
  19. package/dist/colorpicker.js +3 -9
  20. package/dist/components/button/index.d.ts +44 -0
  21. package/dist/components/card/index.d.ts +21 -0
  22. package/dist/components/checkbox/index.d.ts +35 -0
  23. package/dist/components/colorpicker/index.d.ts +88 -0
  24. package/dist/components/dropdown/index.d.ts +32 -0
  25. package/dist/components/form/index.d.ts +15 -0
  26. package/dist/components/icon/index.d.ts +58 -0
  27. package/dist/components/image/index.d.ts +25 -0
  28. package/dist/components/input/index.d.ts +229 -0
  29. package/dist/components/link/index.d.ts +21 -0
  30. package/dist/components/loading/index.d.ts +76 -0
  31. package/dist/components/math/index.d.ts +16 -0
  32. package/dist/components/message/container.d.ts +8 -0
  33. package/dist/components/message/index.d.ts +32 -0
  34. package/dist/components/modal/index.d.ts +100 -0
  35. package/dist/components/player/core/constants.d.ts +5 -0
  36. package/dist/components/player/core/controller.d.ts +33 -0
  37. package/dist/components/player/core/events.d.ts +10 -0
  38. package/dist/components/player/core/fullscreen.d.ts +5 -0
  39. package/dist/components/player/core/levels.d.ts +20 -0
  40. package/dist/components/player/core/media.d.ts +50 -0
  41. package/dist/components/player/core/playback.d.ts +14 -0
  42. package/dist/components/player/core/progress.d.ts +2 -0
  43. package/dist/components/player/core/state.d.ts +27 -0
  44. package/dist/components/player/core/view.d.ts +39 -0
  45. package/dist/components/player/index.d.ts +277 -0
  46. package/dist/components/popover/content/index.d.ts +12 -0
  47. package/dist/components/popover/index.d.ts +95 -0
  48. package/dist/components/progress/index.d.ts +40 -0
  49. package/dist/components/radar/index.d.ts +52 -0
  50. package/dist/components/route/index.d.ts +26 -0
  51. package/dist/components/router/index.d.ts +24 -0
  52. package/dist/components/scratch/index.d.ts +19 -0
  53. package/dist/components/section/index.d.ts +23 -0
  54. package/dist/components/select/dropdown-item/index.d.ts +21 -0
  55. package/dist/components/select/index.d.ts +135 -0
  56. package/dist/components/select/option/index.d.ts +19 -0
  57. package/dist/components/skeleton/index.d.ts +13 -0
  58. package/dist/components/tab/index.d.ts +58 -0
  59. package/dist/components/tabpane/index.d.ts +33 -0
  60. package/dist/demo/i18n.d.ts +4 -0
  61. package/dist/demo/index.d.ts +3 -0
  62. package/dist/demo/register-icons.d.ts +1 -0
  63. package/dist/dropdown-C5362qTy.js +82 -0
  64. package/dist/dropdown.js +6 -0
  65. package/dist/events-C59wGdni.js +30 -0
  66. package/dist/factory-BdsO0dEW.js +165 -0
  67. package/dist/form-05Lxxl3D.js +44 -0
  68. package/dist/form.js +5 -0
  69. package/dist/icon-DmoEnao5.js +165 -0
  70. package/dist/icon.js +4 -4
  71. package/dist/{index-KS2nvVcO.js → image-6GayFDqX.js} +58 -71
  72. package/dist/image.js +3 -2
  73. package/dist/index.cjs +35 -0
  74. package/dist/index.d.ts +277 -116
  75. package/dist/index.iife.js +306 -0
  76. package/dist/index.js +78 -38
  77. package/dist/input-DoraIb3x.js +198 -0
  78. package/dist/input.js +2 -3
  79. package/dist/katex-es-Bpesphgp.js +23682 -0
  80. package/dist/katex-es-Cnq5Pk8K.cjs +261 -0
  81. package/dist/link-BW-gvrpN.js +77 -0
  82. package/dist/link.js +6 -0
  83. package/dist/loading-Mko22ncl.js +206 -0
  84. package/dist/loading.js +4 -6
  85. package/dist/math-B5PpSnFR.js +52 -0
  86. package/dist/math.js +2 -4
  87. package/dist/message-CQENvkoi.js +137 -0
  88. package/dist/message.js +3 -4
  89. package/dist/mocks-CMGoftIc.js +179 -0
  90. package/dist/modal-DruDj3AB.js +350 -0
  91. package/dist/modal.js +3 -2
  92. package/dist/player-CvfmwWUa.js +13536 -0
  93. package/dist/player.js +3 -6
  94. package/dist/playwright.config.d.ts +2 -0
  95. package/dist/plugins/load-svg.d.ts +9 -0
  96. package/dist/popover-BCvHwLZb.js +213 -0
  97. package/dist/popover.js +3 -5
  98. package/dist/progress-BWkNf2J5.js +123 -0
  99. package/dist/progress.js +3 -5
  100. package/dist/radar-CWsawt2g.js +181 -0
  101. package/dist/radar.js +3 -4
  102. package/dist/ranui.css +1 -0
  103. package/dist/route-BY_E6-2C.js +88 -0
  104. package/dist/route.js +6 -0
  105. package/dist/router-BDcv4F-2.js +79 -0
  106. package/dist/router.js +6 -0
  107. package/dist/scratch-Dbd9G6Q6.js +60 -0
  108. package/dist/scratch.js +4 -0
  109. package/dist/section-CNTvgdQ-.js +63 -0
  110. package/dist/section.js +5 -0
  111. package/dist/select-BmhCUTLb.js +433 -0
  112. package/dist/select.js +3 -8
  113. package/dist/signal-XHfNsQNW.js +57 -0
  114. package/dist/skeleton-DPv9nFhL.js +32 -0
  115. package/dist/skeleton.js +3 -2
  116. package/dist/ssg.js +21 -0
  117. package/dist/ssr-DSGwPtEd.js +34 -0
  118. package/dist/ssr-stream.d.ts +1 -0
  119. package/dist/ssr-stream.js +87 -0
  120. package/dist/ssr.d.ts +1 -0
  121. package/dist/ssr.js +7 -0
  122. package/dist/style.d.ts +1 -0
  123. package/dist/style.js +0 -0
  124. package/dist/tab-C9swK-hm.js +185 -0
  125. package/dist/tab.js +3 -4
  126. package/dist/tabpane-B_M-Jokw.js +87 -0
  127. package/dist/tabpane.js +3 -2
  128. package/dist/test/e2e/button.spec.d.ts +1 -0
  129. package/dist/test/e2e/checkbox.spec.d.ts +1 -0
  130. package/dist/test/e2e/helpers.d.ts +13 -0
  131. package/dist/test/e2e/icon.spec.d.ts +1 -0
  132. package/dist/test/e2e/image.spec.d.ts +1 -0
  133. package/dist/test/e2e/input.spec.d.ts +1 -0
  134. package/dist/test/e2e/loading.spec.d.ts +1 -0
  135. package/dist/test/e2e/message.spec.d.ts +1 -0
  136. package/dist/test/e2e/modal.spec.d.ts +1 -0
  137. package/dist/test/e2e/popover.spec.d.ts +1 -0
  138. package/dist/test/e2e/progress.spec.d.ts +1 -0
  139. package/dist/test/e2e/radar.spec.d.ts +1 -0
  140. package/dist/test/e2e/select.spec.d.ts +1 -0
  141. package/dist/test/e2e/skeleton.spec.d.ts +1 -0
  142. package/dist/test/e2e/tab.spec.d.ts +1 -0
  143. package/dist/test/e2e/visual/colorpicker.spec.d.ts +1 -0
  144. package/dist/test/e2e/visual/components.spec.d.ts +1 -0
  145. package/dist/test/e2e/visual/player.spec.d.ts +1 -0
  146. package/dist/test/integration/composition.test.d.ts +23 -0
  147. package/dist/test/setup.d.ts +0 -0
  148. package/dist/test/ssr/builder.core.ssr.test.d.ts +1 -0
  149. package/dist/test/ssr/builder.factory.ssr.test.d.ts +1 -0
  150. package/dist/test/ssr/builder.mocks.test.d.ts +1 -0
  151. package/dist/test/ssr/components/button.test.d.ts +1 -0
  152. package/dist/test/ssr/css-vars.test.d.ts +1 -0
  153. package/dist/test/ssr/registry.test.d.ts +1 -0
  154. package/dist/test/ssr/router.ssg.test.d.ts +2 -0
  155. package/dist/test/ssr/snapshots/button.test.d.ts +1 -0
  156. package/dist/test/ssr/stream.test.d.ts +2 -0
  157. package/dist/test/ssr/theme.tokens.ssr.test.d.ts +1 -0
  158. package/dist/test/unit/builder.core.browser.test.d.ts +1 -0
  159. package/dist/test/unit/builder.escape.test.d.ts +1 -0
  160. package/dist/test/unit/builder.selectors.test.d.ts +1 -0
  161. package/dist/test/unit/button.contract.test.d.ts +1 -0
  162. package/dist/test/unit/card.contract.test.d.ts +1 -0
  163. package/dist/test/unit/checkbox.contract.test.d.ts +1 -0
  164. package/dist/test/unit/colorpicker.color.utils.test.d.ts +1 -0
  165. package/dist/test/unit/colorpicker.contract.test.d.ts +1 -0
  166. package/dist/test/unit/colorpicker.methods.test.d.ts +1 -0
  167. package/dist/test/unit/component.helpers.test.d.ts +1 -0
  168. package/dist/test/unit/dropdown-item.contract.test.d.ts +1 -0
  169. package/dist/test/unit/dropdown.contract.test.d.ts +1 -0
  170. package/dist/test/unit/form.contract.test.d.ts +1 -0
  171. package/dist/test/unit/helpers/component.d.ts +3 -0
  172. package/dist/test/unit/helpers/dom.d.ts +2 -0
  173. package/dist/test/unit/icon.contract.test.d.ts +1 -0
  174. package/dist/test/unit/image.contract.test.d.ts +1 -0
  175. package/dist/test/unit/input.contract.test.d.ts +1 -0
  176. package/dist/test/unit/link.contract.test.d.ts +1 -0
  177. package/dist/test/unit/loading.contract.test.d.ts +1 -0
  178. package/dist/test/unit/math.contract.test.d.ts +1 -0
  179. package/dist/test/unit/message.component.test.d.ts +1 -0
  180. package/dist/test/unit/message.container.test.d.ts +1 -0
  181. package/dist/test/unit/modal.contract.test.d.ts +1 -0
  182. package/dist/test/unit/option.contract.test.d.ts +1 -0
  183. package/dist/test/unit/package-exports.source.test.d.ts +1 -0
  184. package/dist/test/unit/player-controls.test.d.ts +1 -0
  185. package/dist/test/unit/player-core.test.d.ts +1 -0
  186. package/dist/test/unit/player-event-handlers.test.d.ts +1 -0
  187. package/dist/test/unit/player-events.test.d.ts +1 -0
  188. package/dist/test/unit/player-fullscreen.test.d.ts +1 -0
  189. package/dist/test/unit/player-interactions.test.d.ts +1 -0
  190. package/dist/test/unit/player-levels.test.d.ts +1 -0
  191. package/dist/test/unit/player-media.test.d.ts +1 -0
  192. package/dist/test/unit/player-playback.test.d.ts +1 -0
  193. package/dist/test/unit/player.contract.test.d.ts +1 -0
  194. package/dist/test/unit/popover-accessibility.test.d.ts +1 -0
  195. package/dist/test/unit/popover.contract.test.d.ts +2 -0
  196. package/dist/test/unit/progress.contract.test.d.ts +1 -0
  197. package/dist/test/unit/radar.contract.test.d.ts +1 -0
  198. package/dist/test/unit/route.contract.test.d.ts +1 -0
  199. package/dist/test/unit/router.contract.test.d.ts +2 -0
  200. package/dist/test/unit/scratch.contract.test.d.ts +1 -0
  201. package/dist/test/unit/select-accessibility.test.d.ts +1 -0
  202. package/dist/test/unit/select-option.contract.test.d.ts +1 -0
  203. package/dist/test/unit/select.contract.test.d.ts +1 -0
  204. package/dist/test/unit/skeleton.contract.test.d.ts +1 -0
  205. package/dist/test/unit/ssr.test.d.ts +1 -0
  206. package/dist/test/unit/tab.contract.test.d.ts +2 -0
  207. package/dist/test/unit/theme.semantic-tokens.test.d.ts +1 -0
  208. package/dist/test/unit/theme.skin-tokens.test.d.ts +1 -0
  209. package/dist/test/unit/utils.dom.test.d.ts +1 -0
  210. package/dist/test/unit/utils.error.test.d.ts +1 -0
  211. package/dist/test/unit/utils.i18n.test.d.ts +1 -0
  212. package/dist/test/unit/utils.image.test.d.ts +1 -0
  213. package/dist/test/unit/utils.math.test.d.ts +1 -0
  214. package/dist/test/unit/utils.router.test.d.ts +1 -0
  215. package/dist/test/unit/utils.signal.test.d.ts +1 -0
  216. package/dist/test/unit/utils.ssr-stream.test.d.ts +1 -0
  217. package/dist/test/unit/utils.style.test.d.ts +1 -0
  218. package/dist/test/unit/utils.theme.test.d.ts +1 -0
  219. package/dist/test/unit/utils.tween.test.d.ts +1 -0
  220. package/dist/tsconfig.json +9 -9
  221. package/dist/typings.d.ts +163 -116
  222. package/dist/utils/builder/core.d.ts +70 -0
  223. package/dist/utils/builder/env.d.ts +1 -0
  224. package/dist/utils/builder/escape.d.ts +2 -0
  225. package/dist/utils/builder/events.d.ts +55 -0
  226. package/dist/utils/builder/factory.d.ts +18 -0
  227. package/dist/utils/builder/index.d.ts +9 -0
  228. package/dist/utils/builder/mocks.d.ts +62 -0
  229. package/dist/utils/builder/selectors.d.ts +4 -0
  230. package/dist/utils/builder/signal.d.ts +87 -0
  231. package/dist/utils/color.d.ts +52 -0
  232. package/dist/utils/component.d.ts +16 -0
  233. package/dist/utils/dom.d.ts +39 -0
  234. package/dist/utils/error.d.ts +6 -0
  235. package/dist/utils/i18n/index.d.ts +53 -0
  236. package/dist/utils/i18n.js +88 -0
  237. package/dist/utils/image.d.ts +39 -0
  238. package/dist/utils/index.d.ts +8 -0
  239. package/dist/utils/math.d.ts +26 -0
  240. package/dist/utils/router/index.d.ts +128 -0
  241. package/dist/utils/router.js +197 -0
  242. package/dist/utils/ssg.d.ts +49 -0
  243. package/dist/utils/ssr-registry.d.ts +8 -0
  244. package/dist/utils/ssr-stream.d.ts +23 -0
  245. package/dist/utils/ssr.d.ts +17 -0
  246. package/dist/utils/style.d.ts +12 -0
  247. package/dist/utils/theme.d.ts +9 -0
  248. package/dist/utils/tween.d.ts +21 -0
  249. package/dist/utils/video.d.ts +40 -0
  250. package/dist/utils-D4pPF77E.js +689 -0
  251. package/dist/vite.config.d.ts +6 -0
  252. package/dist/vitest.config.d.ts +2 -0
  253. package/dist/vitest.config.ssr.d.ts +2 -0
  254. package/docs/COMPONENTS.md +326 -0
  255. package/docs/DESIGN.md +182 -0
  256. package/docs/style-tokens-public.md +880 -0
  257. package/package.json +138 -74
  258. package/typings.d.ts +163 -116
  259. package/dist/_commonjs-dynamic-modules-DLbDWi6a.js +0 -12
  260. package/dist/add-user-BN1JlY7e.js +0 -4
  261. package/dist/arrow-down-Beig7FXI.js +0 -652
  262. package/dist/book-nTEFXU2x.js +0 -4
  263. package/dist/check-circle-fill-B_pd8ZSs.js +0 -4
  264. package/dist/check-circle-szyAJiap.js +0 -4
  265. package/dist/close-CFnkhudp.js +0 -4
  266. package/dist/close-circle-CwmuN2C6.js +0 -4
  267. package/dist/close-circle-fill-jSqPPw9i.js +0 -4
  268. package/dist/colz-DJZvo_8B.js +0 -232
  269. package/dist/docx-CHkPTdGU.js +0 -3665
  270. package/dist/drop-4j4abxje.js +0 -36
  271. package/dist/eye-D_mEt17f.js +0 -4
  272. package/dist/eye-close-BVr3NJtg.js +0 -4
  273. package/dist/home-BUQ4USMk.js +0 -4
  274. package/dist/iconShadowless.js +0 -6
  275. package/dist/index-BZR0HaP2.js +0 -40
  276. package/dist/index-Bl6-5Hp8.js +0 -63701
  277. package/dist/index-C0Xh8vJ3.js +0 -146
  278. package/dist/index-C4Sv0T51.js +0 -495
  279. package/dist/index-CGEx9VOA.js +0 -17106
  280. package/dist/index-CILRcFIV.js +0 -100
  281. package/dist/index-CQTJoWhb.js +0 -19
  282. package/dist/index-CWNtaUwu.js +0 -308
  283. package/dist/index-CjSKJE6S.js +0 -158
  284. package/dist/index-Ck9TOxFh.js +0 -279
  285. package/dist/index-CryFK9u4.js +0 -320
  286. package/dist/index-D4twPONc.js +0 -187
  287. package/dist/index-D83djTVa.js +0 -659
  288. package/dist/index-DAxs7Dd2.js +0 -119
  289. package/dist/index-DBecKjmY.js +0 -279
  290. package/dist/index-DC5EA657.js +0 -91
  291. package/dist/index-DHTzB_6b.js +0 -9575
  292. package/dist/index-DL-1C2RQ.js +0 -496
  293. package/dist/index-DN-kAx-A.js +0 -72
  294. package/dist/index-TlwIh-o2.js +0 -306
  295. package/dist/index-WfFw4LJT.js +0 -490
  296. package/dist/index-lLO-8KJ1.js +0 -204
  297. package/dist/index-oD-_YELB.js +0 -511
  298. package/dist/index-qvcQTV5_.js +0 -105
  299. package/dist/info-circle-COnL5bTJ.js +0 -4
  300. package/dist/info-circle-fill-CFeVMdci.js +0 -4
  301. package/dist/inputShadowless.js +0 -6
  302. package/dist/jszip.min-Dhs3nUkD.js +0 -2346
  303. package/dist/katex-es-B5r5vt3m.js +0 -14628
  304. package/dist/loading-Dcc5RApI.js +0 -4
  305. package/dist/loading-scene-BMc2wqKm.js +0 -4
  306. package/dist/lock-Cr7BnmWN.js +0 -4
  307. package/dist/message-D36_Zo2l.js +0 -4
  308. package/dist/pdf-Cx0VWKFo.js +0 -118
  309. package/dist/power-off-lQRbiBak.js +0 -4
  310. package/dist/preview-CJbz9GjO.js +0 -4
  311. package/dist/preview.js +0 -7
  312. package/dist/selectShadowless.js +0 -564
  313. package/dist/setting-DemlgzVC.js +0 -4
  314. package/dist/shadowless.js +0 -8
  315. package/dist/sprite-CH2zLtZy.js +0 -141
  316. package/dist/style.css +0 -1
  317. package/dist/team-tl4NJXPC.js +0 -4
  318. package/dist/umd/index.umd.cjs +0 -60
  319. package/dist/umd/shadowless/shadowless.umd.cjs +0 -1
  320. package/dist/umd/shadowless/style.css +0 -1
  321. package/dist/umd/style.css +0 -1
  322. package/dist/unlock-CeU74z9n.js +0 -4
  323. package/dist/user-B-eVXwuk.js +0 -4
  324. package/dist/warning-circle-DDUgEDIv.js +0 -4
  325. package/dist/warning-circle-fill-lODUKz0i.js +0 -4
  326. package/readme.md +0 -176
@@ -1,490 +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) => __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() {
6
- constructor() {
7
- super();
8
- __publicField(this, "_input");
9
- __publicField(this, "_label");
10
- __publicField(this, "_inputContent");
11
- __publicField(this, "_icon");
12
- /**
13
- * @description: 原生的 input 方法
14
- * @param {Event} event
15
- */
16
- __publicField(this, "customInput", (event) => {
17
- event.stopPropagation();
18
- event.preventDefault();
19
- const { target, data = "" } = event;
20
- this.value = (target == null ? void 0 : target.value) || data || "";
21
- this.customChange();
22
- this.dispatchEvent(
23
- new CustomEvent("input", {
24
- detail: {
25
- value: this.value
26
- }
27
- })
28
- );
29
- });
30
- /**
31
- * @description: 增加 change 方法,同时兼容大小写的情况
32
- */
33
- __publicField(this, "customChange", () => {
34
- this.dispatchEvent(
35
- new CustomEvent("change", {
36
- detail: {
37
- value: this.value
38
- }
39
- })
40
- );
41
- });
42
- /**
43
- * @description: 监听 placeholder 属性函数
44
- * @param {string} name
45
- * @param {string} value
46
- */
47
- __publicField(this, "listenPlaceholder", (name, value) => {
48
- if (name === "placeholder" && this._inputContent) {
49
- if (value != null) {
50
- this._inputContent.setAttribute("placeholder", value);
51
- } else {
52
- this._inputContent.removeAttribute("placeholder");
53
- }
54
- }
55
- });
56
- /**
57
- * @description: 监听 label 属性函数
58
- * @param {string} name
59
- * @param {string} value
60
- */
61
- __publicField(this, "listenLabel", (name, value) => {
62
- if (name === "label" && this._inputContent) {
63
- if (value != null) {
64
- if (this._label) {
65
- this._label.innerHTML = value;
66
- } else {
67
- this._label = document.createElement("label");
68
- this._label.innerHTML = value;
69
- this._label.setAttribute("class", "ran-input-label");
70
- this._label.setAttribute("part", "ran-input-label");
71
- this._input.appendChild(this._label);
72
- }
73
- } else {
74
- this._input.removeAttribute("label");
75
- if (this._label) {
76
- this._input.removeChild(this._label);
77
- this._label = void 0;
78
- }
79
- }
80
- }
81
- });
82
- /**
83
- * @description: 监听 type 属性
84
- * @param {string} name
85
- * @param {string} value
86
- */
87
- __publicField(this, "listenType", (name, value) => {
88
- if (name === "type" && this._inputContent) {
89
- if (value) {
90
- this._inputContent.setAttribute("type", value);
91
- } else {
92
- this._inputContent.removeAttribute("type");
93
- this._inputContent.removeAttribute("min");
94
- this._inputContent.removeAttribute("max");
95
- this._inputContent.removeAttribute("step");
96
- }
97
- }
98
- });
99
- /**
100
- * @description: 监听 status 属性
101
- * @param {string} name
102
- * @param {string} value
103
- */
104
- __publicField(this, "listenStatus", (name, value) => {
105
- if (name === "status" && this._input) {
106
- if (value) {
107
- this._input.setAttribute("status", value);
108
- } else {
109
- this._input.removeAttribute("status");
110
- }
111
- }
112
- });
113
- /**
114
- * @description: 监听 disabled 属性
115
- * @param {string} name
116
- * @param {string} value
117
- */
118
- __publicField(this, "listenDisabled", (name, value) => {
119
- if (name === "disabled" && this._input) {
120
- if (falseList.includes(value)) {
121
- this._input.removeAttribute("disabled");
122
- } else {
123
- this._input.setAttribute("disabled", "");
124
- this._inputContent.setAttribute("disabled", "");
125
- }
126
- }
127
- });
128
- /**
129
- * @description: 监听 icon 属性
130
- * @param {string} name
131
- * @param {string} value
132
- */
133
- __publicField(this, "listenIcon", (name, value, oldValue) => {
134
- if (name === "icon" && value && value !== oldValue) {
135
- this.removeAttribute("label");
136
- this.setAttribute("icon", value);
137
- this.dealIcon();
138
- }
139
- });
140
- /**
141
- * @description: 处理 icon 属性的问题
142
- */
143
- __publicField(this, "dealIcon", () => {
144
- if (!this._icon) {
145
- this._icon = document.createElement("ra-icon");
146
- const { width, height } = this._inputContent.getBoundingClientRect();
147
- const size = Math.min(width, height);
148
- this._icon.setAttribute("size", `${size}`);
149
- this._inputContent.insertAdjacentElement("beforebegin", this._icon);
150
- }
151
- this.icon && this._icon.setAttribute("name", this.icon);
152
- });
153
- /**
154
- * @description: 聚合监听事件
155
- * @param {string} name
156
- * @param {string} oldValue
157
- * @param {string} newValue
158
- */
159
- __publicField(this, "listenEvent", (name, oldValue, newValue) => {
160
- this.listenPlaceholder(name, newValue);
161
- this.listenLabel(name, newValue);
162
- this.listenStatus(name, newValue);
163
- this.listenDisabled(name, newValue);
164
- this.listenIcon(name, newValue, oldValue);
165
- if (name === "value" && oldValue !== newValue) {
166
- this._inputContent.value = newValue;
167
- this._input.setAttribute("value", newValue);
168
- }
169
- });
170
- this._input = document.createElement("div");
171
- this._input.setAttribute("class", "ran-input");
172
- this._input.setAttribute("part", "ran-input");
173
- this._inputContent = document.createElement("input");
174
- this._inputContent.setAttribute("class", "ran-input-content");
175
- this._inputContent.setAttribute("part", "ran-input-content");
176
- this._input.appendChild(this._inputContent);
177
- }
178
- static get observedAttributes() {
179
- return [
180
- "label",
181
- "disabled",
182
- "name",
183
- "placeholder",
184
- "type",
185
- "icon",
186
- "value",
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"
206
- ];
207
- }
208
- /**
209
- * @description: 获取 input 的值
210
- * @return {String}
211
- */
212
- get value() {
213
- return this.getAttribute("value") || "";
214
- }
215
- /**
216
- * @description: 设置 input 的值
217
- * @param {String} value
218
- */
219
- set value(value) {
220
- if (!isDisabled(this) && value) {
221
- this.setAttribute("value", value);
222
- this._input.setAttribute("value", value);
223
- } else {
224
- this.removeAttribute("value");
225
- this._input.removeAttribute("value");
226
- }
227
- }
228
- /**
229
- * @description: 获取 input 的占位字符
230
- * @return {String}
231
- */
232
- get placeholder() {
233
- return this.getAttribute("placeholder") || "";
234
- }
235
- /**
236
- * @description: 设置 input 的占位字符
237
- * @param {String} value
238
- */
239
- set placeholder(value) {
240
- if (value) {
241
- this.setAttribute("placeholder", value);
242
- } else {
243
- this.removeAttribute("placeholder");
244
- }
245
- }
246
- /**
247
- * @description: input 是否为必选
248
- * @return {String}
249
- */
250
- get required() {
251
- return this.getAttribute("required") || "";
252
- }
253
- /**
254
- * @description: 设置 input 是否为必选,除非设置成 false,否则都是必填
255
- * @param {*} value
256
- */
257
- set required(value) {
258
- if (!value || value === "false") {
259
- this.removeAttribute("required");
260
- } else {
261
- this.setAttribute("required", "");
262
- }
263
- }
264
- /**
265
- * @description: 获取 input 上 disabled 属性
266
- * @return {String | null}
267
- */
268
- get disabled() {
269
- return `${isDisabled(this)}`;
270
- }
271
- /**
272
- * @description: 设置 input 的 disabled 属性
273
- * @param {String} value
274
- */
275
- set disabled(value) {
276
- if (falseList.includes(value)) {
277
- this.removeAttribute("disabled");
278
- this._input.removeAttribute("disabled");
279
- this._inputContent.removeAttribute("disabled");
280
- } else {
281
- this.setAttribute("disabled", "");
282
- this._input.setAttribute("disabled", "");
283
- this._inputContent.setAttribute("disabled", "");
284
- }
285
- }
286
- /**
287
- * @description: 获取类似于 Metiral Design 的输入体验。
288
- */
289
- get label() {
290
- return this.getAttribute("label") || "";
291
- }
292
- /**
293
- * @description: 设置类似于 Metiral Design 的输入体验。
294
- */
295
- set label(value) {
296
- this.setAttribute("label", value);
297
- }
298
- /**
299
- * @description: 获取 input 框的状态
300
- */
301
- get status() {
302
- return this.getAttribute("status") || "";
303
- }
304
- /**
305
- * @description: 设置 input 框的状态
306
- */
307
- set status(value) {
308
- if (value) {
309
- this.setAttribute("status", value);
310
- this._input.setAttribute("status", value);
311
- } else {
312
- this.removeAttribute("status");
313
- this._input.removeAttribute("status");
314
- }
315
- }
316
- /**
317
- * @description: 与 form 组件联动时,收集的属性名
318
- * @return {String}
319
- */
320
- get name() {
321
- return this.getAttribute("name") || "";
322
- }
323
- /**
324
- * @description: 设置 name 属性
325
- * @param {string} value
326
- */
327
- set name(value) {
328
- this.setAttribute("name", value);
329
- }
330
- /**
331
- * @description: 当 input 类型为 number 类型时,可以获取 min 属性
332
- * @return {String}
333
- */
334
- get min() {
335
- return this.getAttribute("min") || "";
336
- }
337
- /**
338
- * @description: 当 input 类型为 number 类型时,设置 min 属性
339
- * @param {string} value
340
- */
341
- set min(value) {
342
- if (this.type === "number") this.setAttribute("min", value);
343
- }
344
- /**
345
- * @description: 当 input 类型为 number 类型时,可以获取 max 属性
346
- * @return {String}
347
- */
348
- get max() {
349
- return this.getAttribute("max") || "";
350
- }
351
- /**
352
- * @description: 当 input 类型为 number 类型时,设置 max 属性
353
- * @param {string} value
354
- */
355
- set max(value) {
356
- if (this.type === "number") this.setAttribute("max", value);
357
- }
358
- /**
359
- * @description: 当 input 类型为 number 类型时,可以获取 step 属性
360
- * @return {String}
361
- */
362
- get step() {
363
- return this.getAttribute("step") || "";
364
- }
365
- /**
366
- * @description: 当 input 类型为 number 类型时,设置 step 属性
367
- * @param {string} value
368
- */
369
- set step(value) {
370
- if (this.type === "number") this.setAttribute("step", value);
371
- }
372
- /**
373
- * @description: 获取一个 icon
374
- * @return {String}
375
- */
376
- get icon() {
377
- return this.getAttribute("icon") || "";
378
- }
379
- /**
380
- * @description: 设置 icon 来表示标识
381
- * @param {string|null} value
382
- */
383
- set icon(value) {
384
- if (value) {
385
- this.setAttribute("icon", value);
386
- } else {
387
- this.removeAttribute("icon");
388
- }
389
- }
390
- /**
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 的类型
428
- * @return {string|null}
429
- */
430
- get type() {
431
- return this.getAttribute("type") || "";
432
- }
433
- /**
434
- * @description: 设置 input 的类型
435
- * @param {string|null} value
436
- */
437
- set type(value) {
438
- if (value) {
439
- this.setAttribute("type", value);
440
- } else {
441
- this.removeAttribute("type");
442
- }
443
- }
444
- connectedCallback() {
445
- if (this.value) {
446
- this._inputContent.value = this.value;
447
- this._input.setAttribute("value", this.value);
448
- }
449
- if (this.status) {
450
- this._input.setAttribute("status", this.status);
451
- }
452
- if (isDisabled(this)) {
453
- this._input.setAttribute("disabled", "");
454
- this._inputContent.setAttribute("disabled", "");
455
- }
456
- if (this.type) {
457
- this._inputContent.setAttribute("type", this.type);
458
- }
459
- this._inputContent.addEventListener("input", this.customInput);
460
- if (document.readyState === "complete") {
461
- this.dealIcon();
462
- }
463
- this.appendChild(this._input);
464
- }
465
- disconnectCallback() {
466
- this._inputContent.removeEventListener("input", this.customInput);
467
- }
468
- attributeChangedCallback(name, oldValue, newValue) {
469
- this.listenEvent(name, oldValue, newValue);
470
- }
471
- }
472
- function Custom() {
473
- if (typeof window !== "undefined" && !customElements.get("ra-input")) {
474
- customElements.define("ra-input", Input);
475
- return Input;
476
- } else {
477
- return createCustomError("document is undefined or ra-input is exist");
478
- }
479
- }
480
- const index = Custom();
481
- const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
482
- __proto__: null,
483
- Input,
484
- default: index
485
- }, Symbol.toStringTag, { value: "Module" }));
486
- export {
487
- Input as I,
488
- index as a,
489
- index$1 as i
490
- };
@@ -1,204 +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) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { p as perToNum } from "./arrow-down-Beig7FXI.js";
5
- import { H as HTMLElementSSR, c as createCustomError } from "./index-DC5EA657.js";
6
- const f7170ee498e0dd32cbdcb63fba8f75cc = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host:active,:host:focus{outline:0;-webkit-tap-highlight-color:transparent}.ran-progress{position:var(--ran-progress-position, relative);cursor:var(--ran-progress-cursor, pointer);width:var(--ran-progress-width, 100%);height:var(--ran-progress-height, 100%)}.ran-progress:active,.ran-progress:focus{outline:0;-webkit-tap-highlight-color:transparent}.ran-progress-wrap{width:var(--ran-progress-wrap-width, 100%);height:var(--ran-progress-wrap-height, 8px);border-radius:var(--ran-progress-wrap-border-radius, 20px);background:var(--ran-progress-wrap-background, #5b5b5b);position:var(--ran-progress-wrap-position, relative);overflow:var(--ran-progress-wrap-overflow, hidden)}.ran-progress-wrap-value{position:var(--ran-progress-wrap-value-position, absolute);top:var(--ran-progress-wrap-value-top, 0);left:var(--ran-progress-wrap-value-left, 0);height:var(--ran-progress-wrap-value-height, 100%);width:var(--ran-progress-wrap-value-width, 100%);transform:var(--ran-progress-wrap-value-transform, scaleX(0));transform-origin:var(--ran-progress-wrap-value-transform-origin, 0 0);will-change:var(--ran-progress-wrap-value-will-change, transform);background:var(--ran-progress-wrap-value-background, linear-gradient(90deg, #0bc8bb 2.42%, #00d297 98.79%));border-radius:var(--ran-progress-wrap-value-border-radius, 20px)}.ran-progress-dot{position:var(--ran-progress-dot-position, absolute);top:var(--ran-progress-dot-top, -5px);left:var(--ran-progress-dot-left, -9px);border-radius:var(--ran-progress-dot-border-radius, 50%);width:var(--ran-progress-dot-width, 18px);height:var(--ran-progress-dot-height, 18px);background:var(--ran-progress-dot-background, linear-gradient(90deg, #0bc8bb 2.42%, #00d297 98.79%));cursor:var(--ran-progress-dot-cursor, pointer)}";
7
- const attributes = ["percent", "type", "total", "dot"];
8
- class Progress extends HTMLElementSSR() {
9
- constructor() {
10
- super();
11
- __publicField(this, "_progress");
12
- __publicField(this, "_progressWrap");
13
- __publicField(this, "_progressWrapValue");
14
- __publicField(this, "_progressDot");
15
- __publicField(this, "moveProgress");
16
- __publicField(this, "_shadowDom");
17
- __publicField(this, "progressClick", (e) => {
18
- const rect = this._progress.getBoundingClientRect();
19
- const offsetX = e.clientX - rect.left;
20
- const percentage = Math.min(1, Math.max(0, offsetX / this._progress.offsetWidth));
21
- this.percent = `${percentage * Number(this.total)}`;
22
- this._progressWrapValue.style.setProperty("transform", `scaleX(${percentage})`);
23
- this._progressDot.style.setProperty("transform", `translateX(${percentage * this._progress.offsetWidth}px)`);
24
- this.change();
25
- });
26
- __publicField(this, "progressDotMouseDown", () => {
27
- this.moveProgress.mouseDown = true;
28
- });
29
- __publicField(this, "progressDotMouseMove", (e) => {
30
- if (!this.moveProgress.mouseDown) return;
31
- const rect = this._progress.getBoundingClientRect();
32
- const offsetX = e.clientX - rect.left;
33
- const percentage = Math.min(1, Math.max(0, offsetX / this._progress.offsetWidth));
34
- this.percent = `${percentage * Number(this.total)}`;
35
- this._progressWrapValue.style.setProperty("transform", `scaleX(${percentage})`);
36
- this._progressDot.style.setProperty("transform", `translateX(${percentage * this._progress.offsetWidth}px)`);
37
- this.change();
38
- });
39
- __publicField(this, "progressDotMouseUp", (e) => {
40
- if (!this.moveProgress.mouseDown) return;
41
- this.moveProgress.mouseDown = false;
42
- });
43
- __publicField(this, "change", () => {
44
- this.dispatchEvent(
45
- new CustomEvent("change", {
46
- detail: {
47
- value: this.percent,
48
- percent: this.percent,
49
- total: this.total
50
- }
51
- })
52
- );
53
- });
54
- __publicField(this, "appendProgressDot", () => {
55
- if (this.dot === "true" && !this._progress.contains(this._progressDot)) {
56
- this._progress.appendChild(this._progressDot);
57
- }
58
- if (this.dot === "false" && this._progress.contains(this._progressDot)) {
59
- this._progress.removeChild(this._progressDot);
60
- }
61
- });
62
- __publicField(this, "updateCurrentProgress", () => {
63
- const percent = Number(this.percent) / Number(this.total);
64
- this._progressWrapValue.style.setProperty("transform", `scaleX(${percent})`);
65
- this._progressDot.style.setProperty("transform", `translateX(${percent * this._progress.offsetWidth}px)`);
66
- });
67
- __publicField(this, "dragEvent", () => {
68
- if (this.type !== "drag") return;
69
- this._progress.addEventListener("click", this.progressClick);
70
- this._progressDot.addEventListener("mousedown", this.progressDotMouseDown);
71
- document.addEventListener("mousemove", this.progressDotMouseMove);
72
- document.addEventListener("mouseup", this.progressDotMouseUp);
73
- });
74
- __publicField(this, "resize", () => {
75
- this.updateCurrentProgress();
76
- });
77
- this._progress = document.createElement("div");
78
- this._progress.setAttribute("class", "ran-progress");
79
- this._progress.setAttribute("role", "progressbar");
80
- this._progressWrap = document.createElement("div");
81
- this._progressWrap.setAttribute("class", "ran-progress-wrap");
82
- this._progress.appendChild(this._progressWrap);
83
- this._progressWrapValue = document.createElement("div");
84
- this._progressWrapValue.setAttribute("class", "ran-progress-wrap-value");
85
- this._progressWrap.appendChild(this._progressWrapValue);
86
- this._progressDot = document.createElement("div");
87
- this._progressDot.setAttribute("class", "ran-progress-dot");
88
- this.moveProgress = {
89
- mouseDown: false
90
- };
91
- this._progress.appendChild(this._progressDot);
92
- const shadowRoot = this.attachShadow({ mode: "closed" });
93
- const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
94
- F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc;
95
- shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
96
- this._shadowDom = shadowRoot;
97
- shadowRoot.appendChild(this._progress);
98
- }
99
- static get observedAttributes() {
100
- return attributes;
101
- }
102
- get percent() {
103
- const percent = this.getAttribute("percent") || "";
104
- const num = perToNum(percent);
105
- if (Number(num) > Number(this.total)) {
106
- console.error("percent must be < total");
107
- return this.total;
108
- }
109
- return `${perToNum(percent)}`;
110
- }
111
- set percent(value) {
112
- this.setAttribute("percent", `${value || 0}`);
113
- this.setAttribute("aria-valuenow", `${value || 0}`);
114
- }
115
- get total() {
116
- const total = this.getAttribute("total");
117
- if (!total) return "1";
118
- return `${perToNum(total)}`;
119
- }
120
- set total(value) {
121
- this.setAttribute("total", value || "");
122
- }
123
- get type() {
124
- const result = ["primary", "drag"];
125
- const type = this.getAttribute("type") || "";
126
- if (result.includes(type)) {
127
- return type;
128
- } else {
129
- return "primary";
130
- }
131
- }
132
- set type(value) {
133
- this.setAttribute("type", value || "primary");
134
- }
135
- get animation() {
136
- const result = ["play", "pause"];
137
- const animation = this.getAttribute("animation") || "";
138
- if (result.includes(animation)) {
139
- return animation;
140
- } else {
141
- return "pause";
142
- }
143
- }
144
- set animation(value) {
145
- this.setAttribute("animation", value || "pause");
146
- }
147
- get dot() {
148
- const result = ["true", "false"];
149
- const dot = this.getAttribute("dot") || "";
150
- if (result.includes(dot)) {
151
- return dot;
152
- } else {
153
- return "true";
154
- }
155
- }
156
- set dot(value) {
157
- this.setAttribute("dot", value || "true");
158
- }
159
- connectedCallback() {
160
- const type = this.getAttribute("type");
161
- if (!type) {
162
- this.setAttribute("type", "primary");
163
- }
164
- this.dragEvent();
165
- this.updateCurrentProgress();
166
- window.addEventListener("resize", this.resize);
167
- }
168
- disconnectCallback() {
169
- this._progress.removeEventListener("click", this.progressClick);
170
- this._progressDot.removeEventListener("mousedown", this.progressDotMouseDown);
171
- document.removeEventListener("mousemove", this.progressDotMouseMove);
172
- document.removeEventListener("mouseup", this.progressDotMouseUp);
173
- window.removeEventListener("resize", this.resize);
174
- }
175
- attributeChangedCallback(k, o, n) {
176
- if (o !== n) {
177
- if (k === "dot") {
178
- this.appendProgressDot();
179
- }
180
- if (k === "percent") {
181
- this.updateCurrentProgress();
182
- }
183
- }
184
- }
185
- }
186
- function Custom() {
187
- if (typeof document !== "undefined" && !customElements.get("r-progress")) {
188
- Progress && customElements.define("r-progress", Progress);
189
- return Progress;
190
- } else {
191
- return createCustomError("document is undefined or r-progress is exist");
192
- }
193
- }
194
- const index = Custom();
195
- const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
196
- __proto__: null,
197
- Progress,
198
- default: index
199
- }, Symbol.toStringTag, { value: "Module" }));
200
- export {
201
- Progress as P,
202
- index as a,
203
- index$1 as i
204
- };