ranui 0.1.10-alpha.9 → 0.2.0-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 (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-BstLjXNe.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-CGh8pRqo.js +315 -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 +99 -0
  24. package/dist/components/dropdown/index.d.ts +30 -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 +31 -0
  28. package/dist/components/input/index.d.ts +222 -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 +38 -0
  45. package/dist/components/player/index.d.ts +276 -0
  46. package/dist/components/popover/content/index.d.ts +12 -0
  47. package/dist/components/popover/index.d.ts +93 -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 +150 -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-RqHMRhFE.js +76 -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-Blm7AbyY.js +167 -0
  70. package/dist/icon.js +4 -4
  71. package/dist/{index-KS2nvVcO.js → image-DKm6z7YQ.js} +60 -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-Dskw1bAl.js +186 -0
  78. package/dist/input.js +2 -3
  79. package/dist/katex-es-BTpuCxxV.cjs +261 -0
  80. package/dist/katex-es-CKRwcaiU.js +23682 -0
  81. package/dist/link-BW-gvrpN.js +77 -0
  82. package/dist/link.js +6 -0
  83. package/dist/loading-C4QUpm70.js +206 -0
  84. package/dist/loading.js +4 -6
  85. package/dist/math-Dv4nXSoI.js +52 -0
  86. package/dist/math.js +2 -4
  87. package/dist/message-De5e1txT.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-CqTAmg_E.js +13534 -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-BY32HNMl.js +206 -0
  97. package/dist/popover.js +3 -5
  98. package/dist/progress-gZo0knzu.js +123 -0
  99. package/dist/progress.js +3 -5
  100. package/dist/radar-19P5Mtld.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-BVdUtQX5.js +454 -0
  112. package/dist/select.js +3 -8
  113. package/dist/signal-XHfNsQNW.js +57 -0
  114. package/dist/skeleton-BAdJ6vyA.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-DH2owP2V.js +184 -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 +324 -0
  255. package/docs/DESIGN.md +198 -0
  256. package/docs/style-tokens-public.md +880 -0
  257. package/package.json +137 -78
  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
@@ -0,0 +1,87 @@
1
+ import { i as y, o as $ } from "./ssr-DSGwPtEd.js";
2
+ function S(t) {
3
+ const o = {}, n = /([\w-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|(\S+)))?/g;
4
+ let e;
5
+ for (; (e = n.exec(t)) !== null; )
6
+ e[1] && (o[e[1]] = e[2] ?? e[3] ?? e[4] ?? "");
7
+ return o;
8
+ }
9
+ function h(t, o, n) {
10
+ const e = `<${o}`, r = `</${o}>`;
11
+ let c = 1, s = n;
12
+ for (; c > 0 && s < t.length; ) {
13
+ const i = t.indexOf(e, s), a = t.indexOf(r, s);
14
+ if (a === -1) return -1;
15
+ if (i !== -1 && i < a) {
16
+ const f = t[i + e.length];
17
+ if (f === " " || f === ">" || f === "/" || f === `
18
+ ` || f === " ") {
19
+ c++, s = i + e.length;
20
+ continue;
21
+ }
22
+ }
23
+ if (c--, c === 0) return a;
24
+ s = a + r.length;
25
+ }
26
+ return -1;
27
+ }
28
+ function w(t) {
29
+ const o = [], n = /<([a-z][a-z0-9]*(?:-[a-z0-9]+)+)/gi;
30
+ let e = 0, r;
31
+ for (n.lastIndex = 0; (r = n.exec(t)) !== null; ) {
32
+ const c = r.index, s = r[1].toLowerCase(), i = c + r[0].length, a = t[i];
33
+ if (a !== ">" && a !== " " && a !== `
34
+ ` && a !== " " && a !== "\r" && a !== "\f") {
35
+ n.lastIndex = i;
36
+ continue;
37
+ }
38
+ const f = t.indexOf(">", i);
39
+ if (f === -1) break;
40
+ const x = t.slice(i, f), l = f + 1, u = h(t, s, l);
41
+ if (u === -1) continue;
42
+ const T = t.slice(l, u), g = u + `</${s}>`.length;
43
+ c > e && o.push({
44
+ type: "static",
45
+ content: t.slice(e, c)
46
+ }), o.push({
47
+ type: "custom-element",
48
+ tagName: s,
49
+ attrs: S(x),
50
+ innerHTML: T
51
+ }), e = g, n.lastIndex = g;
52
+ }
53
+ return e < t.length && o.push({
54
+ type: "static",
55
+ content: t.slice(e)
56
+ }), o;
57
+ }
58
+ async function d(t) {
59
+ const o = [];
60
+ for await (const n of t) o.push(n);
61
+ return o.join("");
62
+ }
63
+ async function* p(t) {
64
+ const o = w(t);
65
+ for (const n of o) {
66
+ if (n.type === "static") {
67
+ yield n.content;
68
+ continue;
69
+ }
70
+ const e = $(n.tagName);
71
+ if (!e) {
72
+ const c = Object.entries(n.attrs).map(([s, i]) => i === "" ? ` ${s}` : ` ${s}="${i}"`).join("");
73
+ yield `<${n.tagName}${c}>${n.innerHTML}</${n.tagName}>`;
74
+ continue;
75
+ }
76
+ const r = new e();
77
+ for (const [c, s] of Object.entries(n.attrs)) r.setAttribute(c, s);
78
+ n.innerHTML.trim() && (r.innerHTML = await d(p(n.innerHTML))), yield y(r);
79
+ }
80
+ }
81
+ async function C(t) {
82
+ return d(p(t));
83
+ }
84
+ export {
85
+ C as renderHTMLToString,
86
+ p as renderToStream
87
+ };
package/dist/ssr.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { HTMLElementSSR, RanElement, h, renderToString } from '@/utils/ssr';
package/dist/ssr.js ADDED
@@ -0,0 +1,7 @@
1
+ import { i as r, n, r as t, t as a } from "./ssr-DSGwPtEd.js";
2
+ export {
3
+ a as HTMLElementSSR,
4
+ n as RanElement,
5
+ t as h,
6
+ r as renderToString
7
+ };
@@ -0,0 +1 @@
1
+ import './theme/index.less';
package/dist/style.js ADDED
File without changes
@@ -0,0 +1,184 @@
1
+ import { c as b, d as f, l as d, p as c, s as v, u as p } from "./utils-D4pPF77E.js";
2
+ import { t as u } from "./events-C59wGdni.js";
3
+ import { _ as g, i as h, p as y } from "./factory-BdsO0dEW.js";
4
+ import { a as A, n as _ } from "./ssr-DSGwPtEd.js";
5
+ var w = '.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-tab ::slotted(r-tab){box-sizing:border-box;width:100%;height:100%;padding:10px;flex-shrink:0;overflow:auto;text-align:start}.ran-tab-header{position:relative;overflow:hidden;scroll-behavior:smooth}.ran-tab-header-nav{display:flex;flex-flow:row nowrap;justify-content:flex-start;align-items:center}.ran-tab-header-nav::-webkit-scrollbar{display:none}.ran-tab-header-nav-item{flex-shrink:0}.ran-tab-header-nav .active{color:var(--ran-tab-active-color, var(--ran-color-primary, #006bff))}.ran-tab-header-line{position:absolute;width:0;margin-top:-2px;height:2px;border-radius:2px;background:var(--ran-tab-line-color, var(--ran-color-primary, #006bff));transition:var(--ran-tab-line-transition, .2s)}.ran-tab-content{overflow:hidden}.ran-tab-content-wrap{display:flex;width:100%;height:100%;transition:var(--ran-tab-content-transition, .2s)}:host([type="line"]) .ran-tab-header-nav-item{border:solid 1px transparent}:host([type="line"]) .ran-tab-header-nav .active{color:var(--ran-tab-line-color, var(--ran-color-primary, #006bff));border:solid 1px transparent;border-color:var(--ran-tab-border-color, var(--ran-color-border, rgba(0, 0, 0, .2))) var(--ran-tab-border-color, var(--ran-color-border, rgba(0, 0, 0, .2))) transparent;border-radius:var(--ran-tab-border-radius, var(--ran-radius-sm, .25em)) var(--ran-tab-border-radius, var(--ran-radius-sm, .25em)) 0 0}:host([type="line"]) .ran-tab-header-line{transition:none;visibility:hidden}:host([type="line"]) .ran-tab-header-line:after,:host([type="line"]) .ran-tab-header-line:before{content:"";position:absolute;visibility:visible;width:9999px;height:1px;bottom:0;background:var(--ran-tab-border-color, var(--ran-color-border, rgba(0, 0, 0, .2)))}:host([type="line"]) .ran-tab-header-line:after{left:100%}:host([type="line"]) .ran-tab-header-line:before{right:100%}:host([align="center"]) .ran-tab-header-nav{justify-content:center}:host([align="center"]) .ran-tab-header-line{left:50%}:host([align="end"]) .ran-tab-header-nav{justify-content:flex-end}', x = 0, m = class extends _ {
6
+ static get observedAttributes() {
7
+ return [
8
+ "active",
9
+ "type",
10
+ "align",
11
+ "effect",
12
+ "sheet"
13
+ ];
14
+ }
15
+ _events = new u();
16
+ _container;
17
+ _header;
18
+ _nav;
19
+ _line;
20
+ _content;
21
+ _wrap;
22
+ _slot;
23
+ _shadowDom;
24
+ _tabsId;
25
+ tabHeaderKeyMapIndex;
26
+ constructor() {
27
+ super(), this._tabsId = ++x, this._shadowDom = b(this, w), this.tabHeaderKeyMapIndex = {};
28
+ const t = v(this._shadowDom, ".ran-tab", () => h().class("ran-tab").part("tabs").children(h().class("ran-tab-header").part("header").children(h().class("ran-tab-header-nav").part("nav"), h().class("ran-tab-header-line").part("indicator")), h().class("ran-tab-content").part("content").children(h().class("ran-tab-content-wrap").part("content-wrap").children(y()))).build());
29
+ this._container = t, this._header = t.querySelector(".ran-tab-header"), this._nav = t.querySelector(".ran-tab-header-nav"), this._line = t.querySelector(".ran-tab-header-line"), this._content = t.querySelector(".ran-tab-content"), this._wrap = t.querySelector(".ran-tab-content-wrap"), this._slot = t.querySelector("slot"), this._nav.setAttribute("role", "tablist");
30
+ }
31
+ get align() {
32
+ return d(this, "align", "start");
33
+ }
34
+ set align(t) {
35
+ this.setAttribute("align", t);
36
+ }
37
+ get type() {
38
+ return d(this, "type", "flat");
39
+ }
40
+ set type(t) {
41
+ this.setAttribute("type", t);
42
+ }
43
+ get active() {
44
+ return this.getAttribute("active");
45
+ }
46
+ set active(t) {
47
+ t ? (this.setAttribute("active", t), this.setTabLine(t), this.setTabContent(t), this.syncTabsAria()) : this.removeAttribute("active");
48
+ }
49
+ get effect() {
50
+ return this.getAttribute("effect");
51
+ }
52
+ set effect(t) {
53
+ !t || t === "false" ? this.removeAttribute("effect") : this.setAttribute("effect", t);
54
+ }
55
+ get sheet() {
56
+ return d(this, "sheet");
57
+ }
58
+ set sheet(t) {
59
+ p(this, "sheet", t);
60
+ }
61
+ handlerExternalCss = () => {
62
+ f(this, this._shadowDom, "sheet", null, this.sheet);
63
+ };
64
+ initTabHeaderKeyMapIndex = (t, i) => {
65
+ if (this.tabHeaderKeyMapIndex[t]) throw new Error("tab 组件的 key 值存在重复,或者某个 tab 组件缺少 key 属性");
66
+ this.tabHeaderKeyMapIndex[t] = i;
67
+ };
68
+ createTabHeader(t, i) {
69
+ const e = t.getAttribute("label") || "", a = t.getAttribute("icon") || "", r = t.getAttribute("iconSize") || "", n = t.getAttribute("r-key") || `${i}`, o = t.getAttribute("type") || "text";
70
+ this.initTabHeaderKeyMapIndex(n, i);
71
+ const s = g("r-button").class("tab-header-nav-item").attr("type", o).attr("r-key", n).text(e);
72
+ return a && s.attr("icon", a), r && s.attr("iconSize", r), c(t) && s.attr("disabled", ""), this.effect && (t.setAttribute("effect", this.effect), this._line.style.setProperty("display", "none")), t.setAttribute("r-key", n), s.build();
73
+ }
74
+ initTabLineAlignCenter = () => {
75
+ const { length: t } = this._nav.children;
76
+ let i = 0;
77
+ for (let e = 0; e < t; e++) {
78
+ const { width: a = 0 } = this._nav.children[e].getBoundingClientRect();
79
+ i += a;
80
+ }
81
+ this._line.style.setProperty("left", `calc(50% - ${i / 2}px)`);
82
+ };
83
+ initTabLineAlignEnd = () => {
84
+ const { length: t } = this._nav.children;
85
+ let i = 0;
86
+ for (let e = 0; e < t; e++) {
87
+ const { width: a = 0 } = this._nav.children[e].getBoundingClientRect();
88
+ i += a;
89
+ }
90
+ this._line.style.setProperty("left", `calc(100% - ${i}px)`);
91
+ };
92
+ setTabLine = (t) => {
93
+ if (t) {
94
+ const i = this.tabHeaderKeyMapIndex[t], { width: e = 0 } = this._nav.children[i].getBoundingClientRect();
95
+ this._line.style.setProperty("width", `${e}px`);
96
+ let a = 0;
97
+ for (let r = 0; r < i; r++) {
98
+ const { width: n = 0 } = this._nav.children[r].getBoundingClientRect();
99
+ a += n;
100
+ }
101
+ this._line.style.setProperty("transform", `translateX(${a}px)`);
102
+ }
103
+ };
104
+ setTabContent = (t) => {
105
+ if (t) {
106
+ const i = this.tabHeaderKeyMapIndex[t];
107
+ this._wrap.style.setProperty("transform", `translateX(${i * -100}%)`);
108
+ }
109
+ };
110
+ clickTabHead = (t) => {
111
+ const i = t.currentTarget ?? t.target, e = i.getAttribute("r-key");
112
+ !c(i) && e && this.activateKey(e);
113
+ };
114
+ activateKey = (t) => {
115
+ this.setAttribute("active", t), this.setTabLine(t), this.setTabContent(t), this._nav.querySelectorAll(".active").forEach((e) => e.classList.remove("active"));
116
+ const i = this.tabHeaderKeyMapIndex[t];
117
+ this._nav.children[i]?.classList.add("active"), this.syncTabsAria();
118
+ };
119
+ tabFocusable = (t) => t._btn ?? t;
120
+ tabIdFor = (t) => `ran-tab-${this._tabsId}-${t}`;
121
+ panelIdFor = (t) => `ran-tabpanel-${this._tabsId}-${t}`;
122
+ syncTabsAria = () => {
123
+ const t = this.active, i = this._slot?.assignedElements?.() ?? [];
124
+ [...this._nav.children].forEach((e, a) => {
125
+ const r = e.getAttribute("r-key") ?? `${a}`, n = r === t, o = c(e), s = this.tabFocusable(e);
126
+ s.setAttribute("role", "tab"), s.id = this.tabIdFor(r), s.setAttribute("aria-controls", this.panelIdFor(r)), s.setAttribute("aria-selected", n ? "true" : "false"), s.tabIndex = n && !o ? 0 : -1;
127
+ const l = i[a];
128
+ l && (l.setAttribute("role", "tabpanel"), l.id = this.panelIdFor(r), l.setAttribute("aria-labelledby", this.tabIdFor(r)), l.setAttribute("tabindex", n ? "0" : "-1"), n ? l.removeAttribute("aria-hidden") : l.setAttribute("aria-hidden", "true"));
129
+ });
130
+ };
131
+ onNavKeydown = (t) => {
132
+ if (![
133
+ "ArrowRight",
134
+ "ArrowLeft",
135
+ "ArrowDown",
136
+ "ArrowUp",
137
+ "Home",
138
+ "End"
139
+ ].includes(t.key)) return;
140
+ const i = [...this._nav.children].filter((o) => !c(o));
141
+ if (!i.length) return;
142
+ const e = t.target?.closest?.(".tab-header-nav-item") ?? t.target;
143
+ let a = i.findIndex((o) => o === e);
144
+ a < 0 && (a = i.findIndex((o) => o.getAttribute("r-key") === this.active)), a < 0 && (a = 0);
145
+ let r = a;
146
+ t.key === "ArrowRight" || t.key === "ArrowDown" ? r = (a + 1) % i.length : t.key === "ArrowLeft" || t.key === "ArrowUp" ? r = (a - 1 + i.length) % i.length : t.key === "Home" ? r = 0 : t.key === "End" && (r = i.length - 1), t.preventDefault();
147
+ const n = i[r].getAttribute("r-key");
148
+ n && (this.activateKey(n), this.tabFocusable(i[r]).focus());
149
+ };
150
+ updateAttribute = (t, i, e = "") => {
151
+ const a = this.tabHeaderKeyMapIndex[t];
152
+ t && e && this._nav.children[a] ? this._nav.children[a]?.setAttribute(i, e) : this._nav.children[a]?.removeAttribute(i);
153
+ };
154
+ initActive = () => {
155
+ const t = [...this._nav.children], i = t.filter((n) => !c(n));
156
+ let e;
157
+ if (this.active != null && (e = i.find((n) => n.getAttribute("r-key") === this.active), e?.setAttribute("r-key", this.active)), e || (e = i.shift()), !e) return;
158
+ const a = t.findIndex((n) => n === e), r = e?.getAttribute("r-key") || `${a}`;
159
+ r != null && (this.setAttribute("active", `${r}`), e.classList.add("active"), this.setTabContent(r), setTimeout(() => {
160
+ this.setTabLine(r);
161
+ }, 200));
162
+ };
163
+ listenSlotChange = () => {
164
+ this._slot.assignedElements().forEach((t, i) => {
165
+ const e = this.createTabHeader(t, i);
166
+ this._nav.appendChild(e), e.addEventListener("click", this.clickTabHead);
167
+ }), this.initActive(), this.syncTabsAria(), this.align && (this.align === "center" && this.initTabLineAlignCenter(), this.align === "end" && this.initTabLineAlignEnd());
168
+ };
169
+ connectedCallback() {
170
+ this.handlerExternalCss(), this._events.on(this._slot, "slotchange", this.listenSlotChange), this._events.on(this._nav, "keydown", this.onNavKeydown);
171
+ }
172
+ disconnectedCallback() {
173
+ this._events.abort();
174
+ }
175
+ attributeChangedCallback(t, i, e) {
176
+ i !== e && (this.dispatchEvent(new CustomEvent("change", { detail: { active: this.active } })), t === "align" && (e === "center" && this.initTabLineAlignCenter(), e === "end" && this.initTabLineAlignEnd()), t === "effect" && [...this._nav.children].forEach((a) => {
177
+ !this.effect || this.effect === "false" ? a.removeAttribute("effect") : a.setAttribute("effect", e);
178
+ }), t === "active" && this.setAttribute(t, e), t === "sheet" && this.handlerExternalCss());
179
+ }
180
+ };
181
+ A("r-tabs", m);
182
+ export {
183
+ m as t
184
+ };
package/dist/tab.js CHANGED
@@ -1,6 +1,5 @@
1
- import { a } from "./index-CFjEuvBW.js";
2
- import "./arrow-down-B_hCY3Wt.js";
3
- import "./index-DC5EA657.js";
1
+ import { t } from "./tab-DH2owP2V.js";
4
2
  export {
5
- a as default
3
+ t as Tabs,
4
+ t as default
6
5
  };
@@ -0,0 +1,87 @@
1
+ import { c as s, d as r, s as a, u as h } from "./utils-D4pPF77E.js";
2
+ import { t as n } from "./events-C59wGdni.js";
3
+ import { p as o } from "./factory-BdsO0dEW.js";
4
+ import { a as b, n as c } from "./ssr-DSGwPtEd.js";
5
+ var u = ".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}", d = class extends c {
6
+ static get observedAttributes() {
7
+ return [
8
+ "label",
9
+ "key",
10
+ "disabled",
11
+ "icon",
12
+ "effect",
13
+ "iconSize",
14
+ "sheet"
15
+ ];
16
+ }
17
+ _events = new n();
18
+ _div;
19
+ parent;
20
+ _shadowDom;
21
+ constructor() {
22
+ super(), this._shadowDom = s(this, u);
23
+ const t = a(this._shadowDom, "slot", () => o().part("content").build());
24
+ this._div = t;
25
+ }
26
+ get label() {
27
+ return this.getAttribute("label") || "";
28
+ }
29
+ set label(t) {
30
+ this.setAttribute("label", t);
31
+ }
32
+ get icon() {
33
+ return this.getAttribute("icon");
34
+ }
35
+ set icon(t) {
36
+ !t || t === "false" ? this.removeAttribute("icon") : this.setAttribute("icon", t);
37
+ }
38
+ get iconSize() {
39
+ return this.getAttribute("iconSize");
40
+ }
41
+ set iconSize(t) {
42
+ !t || t === "false" ? this.removeAttribute("iconSize") : this.setAttribute("iconSize", t);
43
+ }
44
+ get key() {
45
+ return this.getAttribute("r-key");
46
+ }
47
+ set key(t) {
48
+ t ? this.setAttribute("r-key", t) : this.removeAttribute("r-key");
49
+ }
50
+ get disabled() {
51
+ return this.getAttribute("disabled");
52
+ }
53
+ set disabled(t) {
54
+ !t || t === "false" ? this.removeAttribute("disabled") : this.setAttribute("disabled", t);
55
+ }
56
+ get effect() {
57
+ return this.getAttribute("effect");
58
+ }
59
+ set effect(t) {
60
+ !t || t === "false" ? this.removeAttribute("effect") : this.setAttribute("effect", t);
61
+ }
62
+ get sheet() {
63
+ return this.getAttribute("sheet");
64
+ }
65
+ set sheet(t) {
66
+ h(this, "sheet", t);
67
+ }
68
+ handlerExternalCss = () => {
69
+ r(this, this._shadowDom, "sheet", null, this.sheet);
70
+ };
71
+ initAttribute = () => {
72
+ this.parent = this.parentNode, this.key && (this.parent?.updateAttribute(this.key, "icon", this.icon), this.parent?.updateAttribute(this.key, "iconSize", this.iconSize), this.parent?.updateAttribute(this.key, "effect", this.effect));
73
+ };
74
+ connectedCallback() {
75
+ this.handlerExternalCss(), this._events.on(document, "DOMContentLoaded", this.initAttribute);
76
+ }
77
+ disconnectedCallback() {
78
+ this._events.abort();
79
+ }
80
+ attributeChangedCallback(t, i, e) {
81
+ i !== e && (this.key && this.parent?.updateAttribute && (t === "icon" && this.parent?.updateAttribute(this.key, "icon", e), t === "iconSize" && this.parent?.updateAttribute(this.key, "iconSize", e), t === "effect" && this.parent?.updateAttribute(this.key, "effect", e), t === "disabled" && this.parent?.updateAttribute(this.key, "disabled", e)), t === "sheet" && this.handlerExternalCss());
82
+ }
83
+ };
84
+ b("r-tab", d);
85
+ export {
86
+ d as t
87
+ };
package/dist/tabpane.js CHANGED
@@ -1,4 +1,5 @@
1
- import { a } from "./index-DAxs7Dd2.js";
1
+ import { t } from "./tabpane-B_M-Jokw.js";
2
2
  export {
3
- a as default
3
+ t as TabPane,
4
+ t as default
4
5
  };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { Page } from '@playwright/test';
2
+ export declare const FREEZE_ANIMATIONS = "\n *, *::before, *::after {\n animation-duration: 0.001ms !important;\n animation-delay: 0ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.001ms !important;\n transition-delay: 0ms !important;\n }\n";
3
+ /**
4
+ * Navigate to the dev server, wait for a custom element tag to register,
5
+ * freeze all animations, and clear the body for isolated component mounting.
6
+ */
7
+ export declare function isolatedSetup(page: Page, url: string, waitForTag: string): Promise<void>;
8
+ /**
9
+ * Replace body content with arbitrary HTML.
10
+ * Custom elements are already registered from the dev server boot,
11
+ * so they upgrade synchronously when inserted into the DOM.
12
+ */
13
+ export declare function mount(page: Page, html: string): Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Integration tests — component composition scenarios.
3
+ *
4
+ * These cover bugs that unit tests cannot catch: layout interactions between
5
+ * components, slot projection into host, and Custom Elements spec compliance.
6
+ *
7
+ * Rule: every bug found on the demo page or in a composition scenario must
8
+ * produce a failing test here before the fix is merged.
9
+ */
10
+ import '@/components/button';
11
+ import '@/components/card';
12
+ import '@/components/checkbox';
13
+ import '@/components/icon';
14
+ import '@/components/input';
15
+ import '@/components/loading';
16
+ import '@/components/message';
17
+ import '@/components/modal';
18
+ import '@/components/popover';
19
+ import '@/components/progress';
20
+ import '@/components/select';
21
+ import '@/components/select/option';
22
+ import '@/components/tab';
23
+ import '@/components/tabpane';
File without changes
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import '@/components/route';
2
+ import '@/components/router';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import '@/components/button/index';
2
+ import '@/components/progress/index';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import '@/components/button';
@@ -0,0 +1 @@
1
+ import '@/components/card';
@@ -0,0 +1 @@
1
+ import '@/components/checkbox';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import '@/components/colorpicker/index';
@@ -0,0 +1 @@
1
+ import '@/components/colorpicker/index';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import '@/components/select/dropdown-item';
@@ -0,0 +1 @@
1
+ import '@/components/dropdown/index';
@@ -0,0 +1 @@
1
+ import '@/components/form';
@@ -0,0 +1,3 @@
1
+ export declare const sleep: (ms?: number) => Promise<void>;
2
+ export declare function mountElement<T extends HTMLElement>(tagName: string, attributes?: Record<string, string>): Promise<T>;
3
+ export declare function mockRect(element: Element, rect: Partial<DOMRect>): void;
@@ -0,0 +1,2 @@
1
+ export declare const resetDom: () => void;
2
+ export declare const mount: <T extends HTMLElement>(element: T) => T;
@@ -0,0 +1 @@
1
+ import '@/components/icon/index';
@@ -0,0 +1 @@
1
+ import '@/components/image';
@@ -0,0 +1 @@
1
+ import '@/components/input';
@@ -0,0 +1 @@
1
+ import '@/components/link';
@@ -0,0 +1 @@
1
+ import '@/components/loading/index';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import '@/components/modal/index';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import '@/components/player';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import '@/components/player';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import '@/components/player';