ranui 0.1.10-alpha.9 → 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 +216 -37
  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 -114
  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 +8 -8
  221. package/dist/typings.d.ts +163 -114
  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 +136 -77
  258. package/typings.d.ts +163 -114
  259. package/dist/_commonjs-dynamic-modules-DLbDWi6a.js +0 -12
  260. package/dist/add-user-BN1JlY7e.js +0 -4
  261. package/dist/arrow-down-B_hCY3Wt.js +0 -662
  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-15M0olqa.js +0 -204
  276. package/dist/index-1v568_nq.js +0 -140
  277. package/dist/index-B897keW5.js +0 -279
  278. package/dist/index-BZR0HaP2.js +0 -40
  279. package/dist/index-B_GuEcTd.js +0 -9575
  280. package/dist/index-Bc2Bcl8D.js +0 -63701
  281. package/dist/index-C4Sv0T51.js +0 -495
  282. package/dist/index-C6RcMHoH.js +0 -187
  283. package/dist/index-C9z10IgG.js +0 -103
  284. package/dist/index-CFjEuvBW.js +0 -308
  285. package/dist/index-CGEx9VOA.js +0 -17106
  286. package/dist/index-CGYfjKUV.js +0 -72
  287. package/dist/index-CQTJoWhb.js +0 -19
  288. package/dist/index-CiWwvEMM.js +0 -511
  289. package/dist/index-CkM9ENTf.js +0 -496
  290. package/dist/index-CtVOgBDk.js +0 -659
  291. package/dist/index-D4qUro5V.js +0 -279
  292. package/dist/index-D4y9c1Dj.js +0 -310
  293. package/dist/index-DAxs7Dd2.js +0 -119
  294. package/dist/index-DC5EA657.js +0 -91
  295. package/dist/index-DJZmDHz-.js +0 -146
  296. package/dist/index-D_CA5VDZ.js +0 -158
  297. package/dist/index-WfFw4LJT.js +0 -490
  298. package/dist/index-mhFL9MJp.js +0 -320
  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 -195
@@ -1,119 +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
- 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}";
5
- function CustomElement() {
6
- if (typeof window !== "undefined" && !customElements.get("r-tab")) {
7
- class TabPane extends HTMLElement {
8
- constructor() {
9
- super();
10
- __publicField(this, "_div");
11
- __publicField(this, "parent");
12
- /**
13
- * @description: 在页面元素都加载完毕后,设置 tab 上的图标
14
- */
15
- __publicField(this, "initAttribute", () => {
16
- var _a, _b, _c;
17
- this.parent = this.parentNode;
18
- this.key && ((_a = this.parent) == null ? void 0 : _a.updateAttribute(this.key, "icon", this.icon));
19
- this.key && ((_b = this.parent) == null ? void 0 : _b.updateAttribute(this.key, "iconSize", this.iconSize));
20
- this.key && ((_c = this.parent) == null ? void 0 : _c.updateAttribute(this.key, "effect", this.effect));
21
- });
22
- this._div = document.createElement("slot");
23
- const shadowRoot = this.attachShadow({ mode: "closed" });
24
- const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
25
- F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc;
26
- shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
27
- shadowRoot.appendChild(this._div);
28
- }
29
- static get observedAttributes() {
30
- return ["label", "key", "disabled", "icon", "effect", "iconSize"];
31
- }
32
- get label() {
33
- return this.getAttribute("label") || "";
34
- }
35
- set label(value) {
36
- this.setAttribute("label", value);
37
- }
38
- get icon() {
39
- return this.getAttribute("icon");
40
- }
41
- set icon(value) {
42
- if (!value || value === "false") {
43
- this.removeAttribute("icon");
44
- } else {
45
- this.setAttribute("icon", value);
46
- }
47
- }
48
- get iconSize() {
49
- return this.getAttribute("iconSize");
50
- }
51
- set iconSize(value) {
52
- if (!value || value === "false") {
53
- this.removeAttribute("iconSize");
54
- } else {
55
- this.setAttribute("iconSize", value);
56
- }
57
- }
58
- get key() {
59
- return this.getAttribute("r-key");
60
- }
61
- set key(value) {
62
- if (value) {
63
- this.setAttribute("r-key", value);
64
- } else {
65
- this.removeAttribute("r-key");
66
- }
67
- }
68
- get disabled() {
69
- return this.getAttribute("disabled");
70
- }
71
- set disabled(value) {
72
- if (!value || value === "false") {
73
- this.removeAttribute("disabled");
74
- } else {
75
- this.setAttribute("disabled", value);
76
- }
77
- }
78
- get effect() {
79
- return this.getAttribute("effect");
80
- }
81
- set effect(value) {
82
- if (!value || value === "false") {
83
- this.removeAttribute("effect");
84
- } else {
85
- this.setAttribute("effect", value);
86
- }
87
- }
88
- onClick(e) {
89
- }
90
- connectedCallback() {
91
- this._div.addEventListener("click", this.onClick);
92
- document.addEventListener("DOMContentLoaded", this.initAttribute);
93
- }
94
- disconnectCallback() {
95
- document.removeEventListener("DOMContentLoaded", this.initAttribute);
96
- }
97
- attributeChangedCallback(name, oldValue, newValue) {
98
- var _a, _b, _c, _d, _e;
99
- if (oldValue !== newValue && this.key && ((_a = this.parent) == null ? void 0 : _a.updateAttribute)) {
100
- if (name === "icon") (_b = this.parent) == null ? void 0 : _b.updateAttribute(this.key, "icon", newValue);
101
- if (name === "iconSize") (_c = this.parent) == null ? void 0 : _c.updateAttribute(this.key, "iconSize", newValue);
102
- if (name === "effect") (_d = this.parent) == null ? void 0 : _d.updateAttribute(this.key, "effect", newValue);
103
- if (name === "disabled") (_e = this.parent) == null ? void 0 : _e.updateAttribute(this.key, "disabled", newValue);
104
- }
105
- }
106
- }
107
- customElements.define("r-tab", TabPane);
108
- return TabPane;
109
- }
110
- }
111
- const index = CustomElement();
112
- const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
113
- __proto__: null,
114
- default: index
115
- }, Symbol.toStringTag, { value: "Module" }));
116
- export {
117
- index as a,
118
- index$1 as i
119
- };
@@ -1,91 +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
- const falseList = [false, "false", null, void 0];
5
- const isDisabled = (element) => {
6
- const status = element.hasAttribute("disabled");
7
- const value = element.getAttribute("disabled");
8
- if (status && !falseList.includes(value)) return true;
9
- return false;
10
- };
11
- const removeClassToElementChild = (parent, deleteClass) => {
12
- const pre = parent.querySelectorAll(`.${deleteClass}`);
13
- if (pre.length > 0) {
14
- pre.forEach((item) => item.classList.remove(deleteClass));
15
- }
16
- };
17
- const loadScript = (src) => {
18
- return new Promise((resolve, reject) => {
19
- const script = document.createElement("script");
20
- script.src = src;
21
- script.onload = function() {
22
- resolve({ success: true });
23
- };
24
- script.onerror = function(error) {
25
- reject({ success: false, error });
26
- };
27
- document.body.append(script);
28
- });
29
- };
30
- function createCustomError(msg = "") {
31
- return class CustomError {
32
- constructor(message = msg) {
33
- __publicField(this, "message");
34
- this.message = message;
35
- }
36
- };
37
- }
38
- const HTMLElementSSR = () => {
39
- if (typeof document !== "undefined") {
40
- return HTMLElement;
41
- }
42
- return null;
43
- };
44
- const createSignal = (value, options) => {
45
- const signal = {
46
- value,
47
- // 订阅者
48
- subscribers: /* @__PURE__ */ new Set(),
49
- comparator: options == null ? void 0 : options.equals
50
- };
51
- const { subscriber } = options || {};
52
- if (subscriber && Array.isArray(subscriber)) {
53
- subscriber.forEach((item) => {
54
- if (typeof item === "function" && !signal.subscribers.has(item)) {
55
- signal.subscribers.add(item);
56
- }
57
- });
58
- }
59
- const getter = () => {
60
- return signal.value;
61
- };
62
- const updateSignal = (newValue) => {
63
- if (signal.value !== newValue) {
64
- signal.value = newValue;
65
- signal.subscribers.forEach((subscriber2) => subscriber2(newValue));
66
- }
67
- };
68
- const setter = (newValue) => {
69
- const { comparator } = signal;
70
- if (comparator instanceof Function) {
71
- return !comparator(signal.value, newValue) && updateSignal(newValue);
72
- }
73
- if (comparator === void 0) {
74
- if (signal.value !== newValue) {
75
- updateSignal(newValue);
76
- }
77
- } else {
78
- !comparator && updateSignal(newValue);
79
- }
80
- };
81
- return [getter, setter];
82
- };
83
- export {
84
- HTMLElementSSR as H,
85
- createSignal as a,
86
- createCustomError as c,
87
- falseList as f,
88
- isDisabled as i,
89
- loadScript as l,
90
- removeClassToElementChild as r
91
- };
@@ -1,146 +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 { _ as __variableDynamicImportRuntimeHelper, s as str2Xml } from "./drop-4j4abxje.js";
5
- import "./arrow-down-B_hCY3Wt.js";
6
- const X_LINKS_NS = "http://www.w3.org/1999/xlink";
7
- const X_LINK_HREF = "xlink:href";
8
- function Custom() {
9
- if (typeof window !== "undefined" && !customElements.get("ra-icon")) {
10
- class RaIcon extends HTMLElement {
11
- constructor() {
12
- super();
13
- __publicField(this, "_icon");
14
- __publicField(this, "_div");
15
- /**
16
- * @description: 本地加载icon
17
- */
18
- __publicField(this, "loadLocal", () => {
19
- return new Promise((resolve, reject) => {
20
- __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../assets/icons/add-user.svg": () => import("./add-user-BN1JlY7e.js"), "../../assets/icons/arrow-down.svg": () => import("./arrow-down-B_hCY3Wt.js").then((n) => n.j), "../../assets/icons/book.svg": () => import("./book-nTEFXU2x.js"), "../../assets/icons/check-circle-fill.svg": () => import("./check-circle-fill-B_pd8ZSs.js"), "../../assets/icons/check-circle.svg": () => import("./check-circle-szyAJiap.js"), "../../assets/icons/close-circle-fill.svg": () => import("./close-circle-fill-jSqPPw9i.js"), "../../assets/icons/close-circle.svg": () => import("./close-circle-CwmuN2C6.js"), "../../assets/icons/close.svg": () => import("./close-CFnkhudp.js"), "../../assets/icons/drop.svg": () => import("./drop-4j4abxje.js").then((n) => n.d), "../../assets/icons/eye-close.svg": () => import("./eye-close-BVr3NJtg.js"), "../../assets/icons/eye.svg": () => import("./eye-D_mEt17f.js"), "../../assets/icons/home.svg": () => import("./home-BUQ4USMk.js"), "../../assets/icons/info-circle-fill.svg": () => import("./info-circle-fill-CFeVMdci.js"), "../../assets/icons/info-circle.svg": () => import("./info-circle-COnL5bTJ.js"), "../../assets/icons/loading-scene.svg": () => import("./loading-scene-BMc2wqKm.js"), "../../assets/icons/loading.svg": () => import("./loading-Dcc5RApI.js"), "../../assets/icons/lock.svg": () => import("./lock-Cr7BnmWN.js"), "../../assets/icons/message.svg": () => import("./message-D36_Zo2l.js"), "../../assets/icons/power-off.svg": () => import("./power-off-lQRbiBak.js"), "../../assets/icons/preview.svg": () => import("./preview-CJbz9GjO.js"), "../../assets/icons/setting.svg": () => import("./setting-DemlgzVC.js"), "../../assets/icons/sprite.svg": () => import("./sprite-CH2zLtZy.js"), "../../assets/icons/team.svg": () => import("./team-tl4NJXPC.js"), "../../assets/icons/unlock.svg": () => import("./unlock-CeU74z9n.js"), "../../assets/icons/user.svg": () => import("./user-B-eVXwuk.js"), "../../assets/icons/warning-circle-fill.svg": () => import("./warning-circle-fill-lODUKz0i.js"), "../../assets/icons/warning-circle.svg": () => import("./warning-circle-DDUgEDIv.js") }), `../../assets/icons/${this.name}.svg`, 5).then((result) => {
21
- if (result && result.default && result.default._identification) {
22
- const { data } = result.default;
23
- this._icon && this._div.removeChild(this._icon);
24
- this._icon = str2Xml(data, "image/svg+xml");
25
- if (this._icon) {
26
- this._div.appendChild(this._icon);
27
- this.setSize();
28
- this.setColor();
29
- resolve();
30
- }
31
- } else {
32
- this.loadNs();
33
- reject(`
34
- couldn't be loaded by ra-icon, message: ${this.name} icon is undefined`);
35
- }
36
- }).catch((error) => {
37
- this.loadNs();
38
- });
39
- });
40
- });
41
- /**
42
- * @description: NS加载icon
43
- */
44
- __publicField(this, "loadNs", () => {
45
- if (this._icon && this._div) {
46
- this._div.removeChild(this._icon);
47
- }
48
- this._icon = document.createElement("svg");
49
- this._icon.setAttribute("class", "icon");
50
- this._icon.setAttribute("viewBox", "0 0 1024 1024");
51
- this._icon.setAttribute("width", "100");
52
- this._icon.setAttribute("height", "100");
53
- const use = document.createElementNS(X_LINKS_NS, "use");
54
- use.setAttributeNS(X_LINKS_NS, X_LINK_HREF, `../../assets/iconfont/icon.svg#icon-${this.name}`);
55
- this._icon.appendChild(use);
56
- this._div.appendChild(this._icon);
57
- });
58
- /**
59
- * @description: 根据name属性加载对应的svg
60
- */
61
- __publicField(this, "setIcon", async () => {
62
- if (this.name) {
63
- this.loadLocal();
64
- }
65
- });
66
- /**
67
- * @description: 设置icon的大小
68
- */
69
- __publicField(this, "setSize", () => {
70
- if (this._icon && this.size) {
71
- this._icon.setAttribute("width", this.size);
72
- this._icon.setAttribute("height", this.size);
73
- }
74
- });
75
- /**
76
- * @description: 设置icon的颜色
77
- */
78
- __publicField(this, "setColor", () => {
79
- if (this._icon) {
80
- this.color ? this._icon.setAttribute("fill", this.color) : this._icon.setAttribute("fill", "currentColor");
81
- }
82
- });
83
- /**
84
- * @description: 设置是否旋转和旋转的速度
85
- */
86
- __publicField(this, "setSpin", () => {
87
- if (this.spin) {
88
- this.style.setProperty("animation-duration", `${this.spin}s`);
89
- }
90
- });
91
- this._div = document.createElement("div");
92
- this._div.setAttribute("class", "ran-icon");
93
- this._div.setAttribute("part", "ran-icon");
94
- }
95
- static get observedAttributes() {
96
- return ["name", "size", "color", "spin"];
97
- }
98
- get name() {
99
- return this.getAttribute("name");
100
- }
101
- set name(value) {
102
- if (value) this.setAttribute("name", value);
103
- }
104
- get size() {
105
- return this.getAttribute("size");
106
- }
107
- set size(value) {
108
- if (value) this.setAttribute("size", value);
109
- }
110
- get color() {
111
- return this.getAttribute("color");
112
- }
113
- set color(value) {
114
- if (value) this.setAttribute("color", value);
115
- }
116
- get spin() {
117
- return this.getAttribute("spin");
118
- }
119
- set spin(value) {
120
- if (value != null) this.setAttribute("spin", value);
121
- }
122
- connectedCallback() {
123
- this.appendChild(this._div);
124
- this.setIcon();
125
- }
126
- attributeChangedCallback(name, oldValue, newValue) {
127
- if (newValue !== oldValue) {
128
- if (name === "name") this.setIcon();
129
- if (name === "size") this.setSize();
130
- if (name === "color") this.setColor();
131
- if (name === "spin") this.setSpin();
132
- }
133
- }
134
- }
135
- customElements.define("ra-icon", RaIcon);
136
- }
137
- }
138
- const index = Custom();
139
- const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
140
- __proto__: null,
141
- default: index
142
- }, Symbol.toStringTag, { value: "Module" }));
143
- export {
144
- index as a,
145
- index$1 as i
146
- };
@@ -1,158 +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 { c as create } from "./arrow-down-B_hCY3Wt.js";
5
- import "./index-D4qUro5V.js";
6
- const less = '.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([type="toast"]) .ran-message-notice{padding:8px;text-align:center;max-width:90%;margin:0 auto;word-break:break-all}:host([type="toast"]) .ran-message-notice-content{display:inline-block;padding:10px 16px;background:#000000b3;border-radius:7px;pointer-events:all}:host([type="toast"]) .ran-message-notice-content-info{align-items:center;display:flex}:host([type="toast"]) .ran-message-notice-content-info span{margin:0;padding:0;font-size:14px;font-variant:tabular-nums;list-style:none;font-feature-settings:"tnum";z-index:1010;width:100%;pointer-events:none;color:#fff}.ran-message-notice{padding:var(--ran-message-notice-padding, 8px);text-align:var(--ran-message-notice-text-align, center);max-width:var(--ran-message-notice-max-width, 90%);margin:var(--ran-message-notice-margin, 0 auto);word-break:var(--ran-message-notice-word-break, break-all)}.ran-message-notice-content{display:var(--ran-message-notice-content-display, inline-block);padding:var(--ran-message-notice-content-padding, 10px 16px);background:var(--ran-message-notice-content-background, #fff);border-radius:var(--ran-message-notice-content-border-radius, 8px);box-shadow:var(--ran-message-notice-content-box-shadow, 0 3px 6px -4px #0000001f, 0 6px 16px #00000014, 0 9px 28px 8px #0000000d);pointer-events:var(--ran-message-notice-content-pointer-events, all)}.ran-message-notice-content-info{align-items:var(--ran-message-notice-content-info-align-items, center);display:var(--ran-message-notice-content-info-display, flex)}.ran-message-notice-content-info span{margin:var(--ran-message-notice-content-info-span-margin, 0);padding:var(--ran-message-notice-content-info-span-padding, 0);color:var(--ran-message-notice-content-info-span-color, #000000d9);font-size:var(--ran-message-notice-content-info-span-font-size, 14px);font-variant:var(--ran-message-notice-content-info-span-font-variant, tabular-nums);list-style:var(--ran-message-notice-content-info-span-list-style, none);font-feature-settings:var(--ran-message-notice-content-info-span-font-feature-settings, "tnum");z-index:var(--ran-message-notice-content-info-span-z-index, 1010);width:var(--ran-message-notice-content-info-span-width, 100%);pointer-events:var(--ran-message-notice-content-info-span-pointer-events, none)}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes MessageMoveIn{0%{padding:0;transform:translateY(-100%);opacity:0}to{padding:8px;transform:translateY(0);opacity:1}}@keyframes MessageMoveOut{0%{max-height:150px;padding:8px;opacity:1}to{max-height:0;padding:0;opacity:0}}.ranui-message{box-sizing:var(--ran-message-box-sizing, border-box);margin:var(--ran-message-margin, 0);padding:var(--ran-message-padding, 0);color:var(--ran-message-color, #000000d9);font-size:var(--ran-message-font-size, 14px);font-variant:var(--ran-message-font-variant, tabular-nums);line-height:var(--ran-message-line-height, 1.5715);list-style:var(--ran-message-ist-style, none);font-feature-settings:var(--ran-message-font-feature-settings, "tnum");position:var(--ran-message-position, fixed);top:var(--ran-message-top, 8px);left:var(--ran-message-left, 0);z-index:var(--ran-message-z-index, 1010);width:var(--ran-message-width, 100%);pointer-events:var(--ran-message-pointer-events, none)}.ranui-message .message-in{animation-name:var(--ran-message-in-animation-name, MessageMoveIn);animation-duration:var(--ran-message-in-animation-duration, .3s);animation-timing-function:var(--ran-message-in-animation-timing-function, cubic-bezier(.78, .14, .15, .86))}.ranui-message .message-leave{animation-name:var(--ran-message-leave-animation-name, MessageMoveOut);animation-duration:var(--ran-message-leave-animation-duration, .3s);animation-timing-function:var(--ran-message-leave-animation-timing-function, cubic-bezier(.78, .14, .15, .86))}';
7
- const AnimationTime = 300;
8
- const defaultDuration = 3e3;
9
- const typeMapIcon = /* @__PURE__ */ new Map([
10
- ["success", "check-circle-fill"],
11
- ["warning", "warning-circle-fill"],
12
- ["error", "close-circle-fill"],
13
- ["info", "info-circle-fill"],
14
- ["toast", null]
15
- ]);
16
- const typeMapColor = /* @__PURE__ */ new Map([
17
- ["success", "#52c41a"],
18
- ["warning", "#faad14"],
19
- ["error", "#ff4d4f"],
20
- ["info", "#1890ff"],
21
- ["toast", "rgba(0, 0, 0, 0.7)"]
22
- ]);
23
- function Custom() {
24
- if (typeof window !== "undefined" && !customElements.get("r-message")) {
25
- class CustomMessage extends HTMLElement {
26
- constructor() {
27
- super();
28
- __publicField(this, "_info");
29
- __publicField(this, "_notice");
30
- __publicField(this, "_content");
31
- __publicField(this, "_icon");
32
- __publicField(this, "_span");
33
- __publicField(this, "timeId");
34
- __publicField(this, "close");
35
- /**
36
- * @description: 设置图标
37
- * @param {string} value
38
- */
39
- __publicField(this, "setIcon", (value) => {
40
- var _a, _b, _c, _d;
41
- const icon = typeMapIcon.get(value);
42
- const color = typeMapColor.get(value);
43
- if (icon) {
44
- (_a = this._icon) == null ? void 0 : _a.setAttribute("name", icon);
45
- (_b = this._icon) == null ? void 0 : _b.style.setProperty("margin-right", "8px");
46
- (_c = this._icon) == null ? void 0 : _c.setAttribute("size", "18");
47
- color && ((_d = this._icon) == null ? void 0 : _d.setAttribute("color", color));
48
- }
49
- });
50
- this._notice = document.createElement("div");
51
- this._notice.setAttribute("class", "ran-message-notice");
52
- this._content = document.createElement("div");
53
- this._content.setAttribute("class", "ran-message-notice-content");
54
- this._info = document.createElement("div");
55
- this._info.setAttribute("class", "ran-message-notice-content-info");
56
- this._icon = document.createElement("r-icon");
57
- this._span = document.createElement("span");
58
- this._info.appendChild(this._icon);
59
- this._info.appendChild(this._span);
60
- this._content.appendChild(this._info);
61
- this._notice.appendChild(this._content);
62
- const shadowRoot = this.attachShadow({ mode: "closed" });
63
- const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
64
- F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = less;
65
- shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
66
- shadowRoot.appendChild(this._notice);
67
- }
68
- static get observedAttributes() {
69
- return ["type", "content"];
70
- }
71
- get type() {
72
- return this.getAttribute("type");
73
- }
74
- set type(value) {
75
- if (value) this.setAttribute("type", value);
76
- }
77
- get content() {
78
- return this.getAttribute("content");
79
- }
80
- set content(value) {
81
- if (value) this.setAttribute("content", value);
82
- }
83
- attributeChangedCallback(name, oldValue, newValue) {
84
- if (name === "content" && oldValue !== newValue) {
85
- this._span.textContent = newValue;
86
- }
87
- if (name === "type" && oldValue !== newValue) {
88
- this.setIcon(newValue);
89
- }
90
- }
91
- }
92
- customElements.define("r-message", CustomMessage);
93
- const container = document.createElement("div");
94
- const style = create("style").setTextContent(less);
95
- const div = document.createElement("div");
96
- div.setAttribute("class", "ranui-message");
97
- document.body.appendChild(container);
98
- container.appendChild(style.element);
99
- container.appendChild(div);
100
- const commonPrompt = (type) => {
101
- return (options) => {
102
- const message2 = new CustomMessage();
103
- message2.setAttribute("class", "message");
104
- message2.timeId && clearTimeout(message2.timeId);
105
- message2.setAttribute("type", type);
106
- let duration = defaultDuration;
107
- let close;
108
- if (!options) return;
109
- if (typeof options === "string") {
110
- message2.setAttribute("content", options);
111
- } else {
112
- message2.setAttribute("content", options.content);
113
- close = options.close;
114
- duration = options.duration || defaultDuration;
115
- }
116
- const time = setTimeout(() => {
117
- message2.classList.remove("message-in");
118
- message2.classList.add("message-leave");
119
- clearTimeout(time);
120
- }, duration - AnimationTime);
121
- message2.timeId = setTimeout(() => {
122
- message2.classList.remove("message-leave");
123
- div.removeChild(message2);
124
- if (close) close();
125
- }, duration);
126
- div.appendChild(message2);
127
- message2.classList.add("message-in");
128
- setTimeout(() => {
129
- message2.classList.remove("message-in");
130
- }, AnimationTime);
131
- };
132
- };
133
- return {
134
- info: commonPrompt("info"),
135
- success: commonPrompt("success"),
136
- error: commonPrompt("error"),
137
- warning: commonPrompt("warning"),
138
- toast: commonPrompt("toast")
139
- };
140
- }
141
- return {};
142
- }
143
- const message = Custom();
144
- if (typeof window !== "undefined" && message) {
145
- window.message = message;
146
- if (!window.ranui) {
147
- window.ranui = {};
148
- }
149
- window.ranui.message = message;
150
- }
151
- const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
152
- __proto__: null,
153
- default: message
154
- }, Symbol.toStringTag, { value: "Module" }));
155
- export {
156
- index as i,
157
- message as m
158
- };