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,150 @@
1
+ import { RanElement } from '@/utils/index';
2
+ import '@/components/select/option';
3
+ import '@/components/dropdown';
4
+ import '@/components/select/dropdown-item';
5
+ import '@/components/input';
6
+ import type { Input } from '@/components/input';
7
+ import { EventManager } from '@/utils/builder';
8
+ interface Option {
9
+ label: string | number;
10
+ value: string | number;
11
+ disabled?: boolean;
12
+ }
13
+ export declare class Select extends RanElement {
14
+ static formAssociated: boolean;
15
+ _internals?: ElementInternals;
16
+ _events: EventManager;
17
+ _searchEvents: EventManager;
18
+ removeTimeId?: NodeJS.Timeout;
19
+ _listboxId: string;
20
+ _activeIndex: number;
21
+ _slot: HTMLSlotElement;
22
+ _shadowDom: ShadowRoot;
23
+ _select: HTMLDivElement;
24
+ _selection: HTMLDivElement;
25
+ _search: Input;
26
+ _icon: HTMLElement;
27
+ _selectDropdown?: HTMLDivElement;
28
+ _selectionDropdown?: HTMLElement;
29
+ _selectDropDownInTimeId?: NodeJS.Timeout;
30
+ _selectDropDownOutTimeId?: NodeJS.Timeout;
31
+ _optionList: Option[];
32
+ _optionLabelMapValue: Map<string, string>;
33
+ _optionValueMapLabel: Map<string, string>;
34
+ _activeOption?: HTMLElement;
35
+ _text: HTMLSpanElement;
36
+ _selector: HTMLDivElement;
37
+ onSearch?: (this: HTMLElement, ev: Event) => unknown;
38
+ static get observedAttributes(): string[];
39
+ constructor();
40
+ get value(): string;
41
+ set value(value: string);
42
+ syncFormValue: () => void;
43
+ get defaultValue(): string;
44
+ set defaultValue(value: string);
45
+ get showSearch(): string;
46
+ set showSearch(value: string);
47
+ get type(): string;
48
+ set type(value: string);
49
+ get placement(): string;
50
+ set placement(value: string);
51
+ get sheet(): string;
52
+ set sheet(value: string);
53
+ get getPopupContainerId(): string;
54
+ set getPopupContainerId(value: string);
55
+ get dropdownclass(): string;
56
+ set dropdownclass(value: string);
57
+ get trigger(): string;
58
+ set trigger(value: string);
59
+ get disabled(): boolean;
60
+ set disabled(value: boolean | string | undefined | null);
61
+ initAria: () => void;
62
+ updateAriaExpanded: (isExpanded: boolean) => void;
63
+ getDropdownOptions: () => HTMLElement[];
64
+ syncActiveState: () => void;
65
+ setActiveOptionByIndex: (targetIndex: number) => void;
66
+ selectOptionElement: (optionElement: HTMLElement | null, shouldDispatch?: boolean) => void;
67
+ isDropdownOpen: () => boolean;
68
+ /**
69
+ * Walk from `from` in the direction of `step` (clamped to the list bounds)
70
+ * and return the first non-disabled option index, or -1 if none exists.
71
+ * Keeps keyboard navigation from ever landing on a disabled option.
72
+ */
73
+ _nextEnabledIndex: (from: number, step: number) => number;
74
+ keydownSelect: (e: KeyboardEvent) => void;
75
+ handlerExternalCss(): void;
76
+ /**
77
+ * @description: 移除 select dropdown
78
+ * @return {*}
79
+ */
80
+ setSelectDropdownDisplayNone: () => void;
81
+ /**
82
+ * @description: 添加 select dropdown
83
+ * @return {*}
84
+ */
85
+ setSelectDropdownDisplayBlock: () => void;
86
+ placementPosition: () => void;
87
+ /**
88
+ * The dropdown is mounted on document.body and positioned once on open, so it
89
+ * detaches from the trigger when the page (or any scroll container) scrolls —
90
+ * e.g. a select inside a sticky header. Re-run placement on scroll/resize
91
+ * while it is open. Capture-phase scroll catches nested scroll containers too.
92
+ */
93
+ _repositionBound: boolean;
94
+ _repositionDropdown: () => void;
95
+ _attachReposition: () => void;
96
+ _detachReposition: () => void;
97
+ /**
98
+ * @description: 设置下拉框
99
+ * @return {*}
100
+ */
101
+ selectMouseDown: (e: Event) => void;
102
+ removeDropDownTimeId: (e: Event) => void;
103
+ /**
104
+ * @description: 焦点移除的情况,需要移除 select 下拉框
105
+ * @return {*}
106
+ */
107
+ selectBlur: (e: Event) => void;
108
+ /**
109
+ * @description: 选中一个选项的情况
110
+ * @param {MouseEvent} e
111
+ * @return {*}
112
+ */
113
+ clickOption: (e: MouseEvent) => void;
114
+ /**
115
+ * @description: 初始化创建选项下拉框
116
+ * @return {*}
117
+ */
118
+ createOption: () => void;
119
+ /**
120
+ * @description: 移除选项下拉框
121
+ * @return {*}
122
+ */
123
+ removeSelectDropdown: () => void;
124
+ /**
125
+ * @description: 当 select 中有 option 元素的时候,给 dropdown 添加元素
126
+ * @return {*}
127
+ */
128
+ addOptionToSlot: () => void;
129
+ createSelectDropdownContent: (options?: Option[]) => void;
130
+ setDefaultValue: () => void;
131
+ changeSearch: (e: Event) => void;
132
+ clickRemoveSelect: (e: Event) => void;
133
+ connectedCallback(): void;
134
+ /**
135
+ * (Re)wire the search-box listeners to match the current `showSearch` value.
136
+ * Reactive: abort any previously-registered search listeners first, then
137
+ * re-register only while `showSearch` is truthy. Safe to call on connect and
138
+ * on every `showSearch` attribute change.
139
+ */
140
+ _applyShowSearch: () => void;
141
+ disconnectedCallback(): void;
142
+ attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
143
+ /**
144
+ * Reflect a programmatic `value` change to the closed-state label. Lets
145
+ * `select.value = 'x'` (or setAttribute('value', 'x')) update the displayed
146
+ * selection without the consumer having to "nudge" the active option.
147
+ */
148
+ syncSelectedFromValue: (value: string) => void;
149
+ }
150
+ export default Select;
@@ -0,0 +1,19 @@
1
+ import { RanElement } from '@/utils/index';
2
+ export declare class Option extends RanElement {
3
+ _option: HTMLDivElement;
4
+ _optionContent: HTMLDivElement;
5
+ _shadowDom: ShadowRoot;
6
+ _slot: HTMLSlotElement;
7
+ static get observedAttributes(): string[];
8
+ constructor();
9
+ get value(): string | null;
10
+ set value(value: string | null);
11
+ get sheet(): string | null;
12
+ set sheet(value: string | null);
13
+ get disabled(): boolean | string | undefined | null;
14
+ set disabled(value: boolean | string | undefined | null);
15
+ handlerExternalCss(): void;
16
+ connectedCallback(): void;
17
+ attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
18
+ }
19
+ export default Option;
@@ -0,0 +1,13 @@
1
+ import { RanElement } from '@/utils/index';
2
+ export declare class Skeleton extends RanElement {
3
+ _div: HTMLElement;
4
+ _shadowDom: ShadowRoot;
5
+ static get observedAttributes(): string[];
6
+ constructor();
7
+ get sheet(): string;
8
+ set sheet(value: string);
9
+ handlerExternalCss: () => void;
10
+ connectedCallback(): void;
11
+ attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
12
+ }
13
+ export default Skeleton;
@@ -0,0 +1,58 @@
1
+ import { RanElement } from '@/utils/index';
2
+ import { EventManager } from '@/utils/builder';
3
+ export declare class Tabs extends RanElement {
4
+ static get observedAttributes(): string[];
5
+ _events: EventManager;
6
+ _container: HTMLDivElement;
7
+ _header: HTMLDivElement;
8
+ _nav: HTMLDivElement;
9
+ _line: HTMLDivElement;
10
+ _content: HTMLDivElement;
11
+ _wrap: HTMLDivElement;
12
+ _slot: HTMLSlotElement;
13
+ _shadowDom: ShadowRoot;
14
+ _tabsId: number;
15
+ tabHeaderKeyMapIndex: Record<string, number>;
16
+ constructor();
17
+ get align(): string;
18
+ set align(value: string);
19
+ get type(): string;
20
+ set type(value: string);
21
+ get active(): string | null;
22
+ set active(value: string | null);
23
+ get effect(): string | null;
24
+ set effect(value: string | null);
25
+ get sheet(): string;
26
+ set sheet(value: string);
27
+ handlerExternalCss: () => void;
28
+ initTabHeaderKeyMapIndex: (key: string, index: number) => void;
29
+ createTabHeader(tabPane: Element, index: number): HTMLElement;
30
+ initTabLineAlignCenter: () => void;
31
+ initTabLineAlignEnd: () => void;
32
+ setTabLine: (key: string) => void;
33
+ setTabContent: (key: string) => void;
34
+ clickTabHead: (e: Event) => void;
35
+ /** Select a tab by key: move the indicator, slide content, update classes + ARIA. */
36
+ activateKey: (key: string) => void;
37
+ /** The header's focusable/semantic element — the r-button's inner `_btn`. */
38
+ tabFocusable: (header: Element) => HTMLElement;
39
+ tabIdFor: (key: string) => string;
40
+ panelIdFor: (key: string) => string;
41
+ /**
42
+ * Wire the WAI-ARIA tabs relationships: each header becomes role="tab" (on the
43
+ * button's inner focusable element, so it isn't a nested role="button"), with
44
+ * aria-selected + a roving tabindex (only the active tab is tabbable); each pane
45
+ * becomes role="tabpanel" labelled by its tab. Called on slot changes and every
46
+ * selection change.
47
+ */
48
+ syncTabsAria: () => void;
49
+ /** Roving arrow-key navigation over the tablist, with automatic activation. */
50
+ onNavKeydown: (e: KeyboardEvent) => void;
51
+ updateAttribute: (key: string, attribute: string, value?: string | null) => void;
52
+ initActive: () => void;
53
+ listenSlotChange: () => void;
54
+ connectedCallback(): void;
55
+ disconnectedCallback(): void;
56
+ attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
57
+ }
58
+ export default Tabs;
@@ -0,0 +1,33 @@
1
+ import { EventManager } from '@/utils/builder';
2
+ import { RanElement } from '@/utils/index';
3
+ interface ExtendParentNode {
4
+ updateAttribute: (key: string, attribute: string, value?: string | null) => void;
5
+ }
6
+ export declare class TabPane extends RanElement {
7
+ static get observedAttributes(): string[];
8
+ _events: EventManager;
9
+ _div: HTMLElement;
10
+ parent: (ParentNode & ExtendParentNode) | undefined | null;
11
+ _shadowDom: ShadowRoot;
12
+ constructor();
13
+ get label(): string;
14
+ set label(value: string);
15
+ get icon(): string | null;
16
+ set icon(value: string | null);
17
+ get iconSize(): string | null;
18
+ set iconSize(value: string | null);
19
+ get key(): string | null;
20
+ set key(value: string | null);
21
+ get disabled(): string | null;
22
+ set disabled(value: string | null);
23
+ get effect(): string | null;
24
+ set effect(value: string | null);
25
+ get sheet(): string | null;
26
+ set sheet(value: string | null);
27
+ handlerExternalCss: () => void;
28
+ initAttribute: () => void;
29
+ connectedCallback(): void;
30
+ disconnectedCallback(): void;
31
+ attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
32
+ }
33
+ export default TabPane;
@@ -0,0 +1,4 @@
1
+ export type Lang = 'en' | 'zh';
2
+ export declare const getLang: () => Lang;
3
+ export declare const setLang: (lang: Lang) => void;
4
+ export declare const applyLanguage: (lang: Lang) => void;
@@ -0,0 +1,3 @@
1
+ import './register-icons';
2
+ import '../style';
3
+ import '../index';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,76 @@
1
+ import { c as w, d as p, l as o, m as i, s as h, u as a, v as d } from "./utils-D4pPF77E.js";
2
+ import { i as n, p as l } from "./factory-BdsO0dEW.js";
3
+ import { a as c, n as f } from "./ssr-DSGwPtEd.js";
4
+ var m = '.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}@keyframes ranui-dropdown-up-in{0%{transform:scaleY(.8);transform-origin:100% 100%;opacity:0}to{transform:scaleY(1);transform-origin:100% 100%;opacity:1}}@keyframes ranui-dropdown-up-out{0%{transform:scaleY(1);transform-origin:100% 100%;opacity:1}to{transform:scaleY(.8);transform-origin:100% 100%;opacity:0}}@keyframes ranui-dropdown-down-in{0%{transform:scaleY(.8);transform-origin:0% 0%;opacity:0}to{transform:scaleY(1);transform-origin:0% 0%;opacity:1}}@keyframes ranui-dropdown-down-out{0%{transform:scaleY(1);transform-origin:0% 0%;opacity:1}to{transform:scaleY(.8);transform-origin:0% 0%;opacity:0}}@keyframes ranui-dropdown-left-in{0%{transform:scaleX(.8);transform-origin:100% 0%;opacity:0}to{transform:scaleX(1);transform-origin:100% 0%;opacity:1}}@keyframes ranui-dropdown-left-out{0%{transform:scaleX(1);transform-origin:100% 0%;opacity:1}to{transform:scaleX(.8);transform-origin:100% 0%;opacity:0}}@keyframes ranui-dropdown-right-in{0%{transform:scaleX(.8);transform-origin:0% 0%;opacity:0}to{transform:scaleX(1);transform-origin:0% 0%;opacity:1}}@keyframes ranui-dropdown-right-out{0%{transform:scaleX(1);transform-origin:0% 0%;opacity:1}to{transform:scaleX(.8);transform-origin:0% 0%;opacity:0}}.ran-dropdown-down-in{animation:ranui-dropdown-down-in .1s;animation-fill-mode:forwards}.ran-dropdown-down-out{animation:ranui-dropdown-down-out .1s;animation-fill-mode:forwards}.ran-dropdown-up-in{animation:ranui-dropdown-up-in .1s;animation-fill-mode:forwards}.ran-dropdown-up-out{animation:ranui-dropdown-up-out .1s;animation-fill-mode:forwards}.ran-dropdown-left-in{animation:ranui-dropdown-left-in .1s;animation-fill-mode:forwards}.ran-dropdown-left-out{animation:ranui-dropdown-left-out .1s;animation-fill-mode:forwards}.ran-dropdown-right-in{animation:ranui-dropdown-right-in .1s;animation-fill-mode:forwards}.ran-dropdown-right-out{animation:ranui-dropdown-right-out .1s;animation-fill-mode:forwards}:host{text-align:var(--ran-dropdown-host-text-align, left);z-index:var(--ran-dropdown-host-z-index, var(--ran-z-dropdown, 1100))}.ranui-dropdown{transform-origin:var(--ran-x, 50%) var(--ran-y, 50%);box-sizing:var(--ran-dropdown-box-sizing, border-box);margin:var(--ran-dropdown-margin, 0);padding:var(--ran-dropdown-padding, 0);color:var(--ran-dropdown-color, var(--ran-color-text, rgba(0, 0, 0, .88)));font-size:var(--ran-dropdown-font-size, 14px);list-style:var(--ran-dropdown-list-style, none);font-family:var(--ran-dropdown-font-family, var(--ran-skin-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));z-index:var(--ran-dropdown-z-index, 1050);overflow:var(--ran-dropdown-overflow, hidden);font-variant:var(--ran-dropdown-font-variant, initial);background:var(--ran-dropdown-background, var(--ran-color-bg-elevated, #ffffff));border-radius:var(--ran-dropdown-border-radius, var(--ran-radius-md, 12px));outline:var(--ran-dropdown-outline, none);box-shadow:var(--ran-dropdown-box-shadow, var(--ran-shadow-menu, var(--ran-shadow-elevated, 0 6px 16px 0 rgba(0, 0, 0, .08), 0 3px 6px -4px rgba(0, 0, 0, .12), 0 9px 28px 8px rgba(0, 0, 0, .05))));cursor:var(--ran-dropdown-cursor, auto);width:var(--ran-dropdown-width, 100%);height:var(--ran-dropdown-height, 100%);min-height:var(--ran-dropdown-min-height, 100%);min-width:var(--ran-dropdown-min-width, 100%)}.ranui-dropdown-container{position:var(--ran-dropdown-container-position, relative);display:var(--ran-dropdown-container-display, block);width:var(--ran-dropdown-container-width, 100%);height:var(--ran-dropdown-container-height, 100%);box-sizing:var(--ran-dropdown-container-box-sizing, border-box)}.ranui-dropdown-container .top{transform:translate(calc(var(--ran-dropdown-arrow-anchor-width, var(--ran-dropdown-min-width, 100%)) / 2 - calc(var(--ran-dropdown-arrow-width, 16px) / 2))) translateY(calc(-1 * var(--ran-dropdown-arrow-height, var(--ran-dropdown-arrow-width, 16px)) + var(--ran-dropdown-arrow-overlap, 2px))) rotate(0);top:0}.ranui-dropdown-container .bottom{transform:translate(calc(var(--ran-dropdown-arrow-anchor-width, var(--ran-dropdown-min-width, 100%)) / 2 - calc(var(--ran-dropdown-arrow-width, 16px) / 2))) translateY(var(--ran-dropdown-arrow-overlap, 2px)) rotate(180deg);top:max(0px,calc(var(--ran-dropdown-min-height, 100%) - calc(var(--ran-dropdown-arrow-width, 16px) / 4)))}.ranui-dropdown-container .left{transform:translate(calc(0px - var(--ran-dropdown-arrow-width, 16px))) translateY(calc(var(--ran-dropdown-arrow-width, 16px) / 2 + var(--ran-dropdown-arrow-overlap, 2px))) rotate(270deg);top:max(0px,calc(var(--ran-dropdown-arrow-anchor-height, var(--ran-dropdown-min-height, 100%)) / 2 - var(--ran-dropdown-arrow-width, 16px)))}.ranui-dropdown-container .right{left:100%;transform:translate(0) translateY(calc(var(--ran-dropdown-arrow-anchor-height, var(--ran-dropdown-min-height, 100%)) / 2 - calc(var(--ran-dropdown-arrow-width, 16px) / 2) + var(--ran-dropdown-arrow-overlap, 2px))) rotate(90deg);top:0}.ranui-dropdown-arrow{position:var(--ran-dropdown-arrow-position, absolute);box-sizing:var(--ran-dropdown-arrow-box-sizing, border-box);z-index:var(--ran-dropdown-arrow-z-index, 1);display:var(--ran-dropdown-arrow-display, block);pointer-events:var(--ran-dropdown-arrow-pointer-events, none);width:var(--ran-dropdown-arrow-width, var(--ran-dropdown-arrow-width, 16px));height:var(--ran-dropdown-arrow-height, var(--ran-dropdown-arrow-width, 16px));overflow:var(--ran-dropdown-arrow-overflow, hidden)}.ranui-dropdown-arrow:before{background:var(--ran-dropdown-arrow-before-background, var(--ran-color-bg-elevated, #fff));position:var(--ran-dropdown-arrow-before-position, absolute);bottom:var(--ran-dropdown-arrow-before-bottom, 0);inset-inline-start:0;width:var(--ran-dropdown-arrow-before-width, var(--ran-dropdown-arrow-width, 16px));height:var(--ran-dropdown-arrow-before-height, calc(var(--ran-dropdown-arrow-width, 16px) / 2));clip-path:path("M 0 8 A 4 4 0 0 0 2.82842712474619 6.82842712474619 L 6.585786437626905 3.0710678118654755 A 2 2 0 0 1 9.414213562373096 3.0710678118654755 L 13.17157287525381 6.82842712474619 A 4 4 0 0 0 16 8 Z");content:var(--ran-dropdown-arrow-before-content, "")}.ranui-dropdown-arrow:after{content:var(--ran-dropdown-arrow-after-content, "");position:var(--ran-dropdown-arrow-after-position, absolute);width:var(--ran-dropdown-arrow-after-width, 9px);height:var(--ran-dropdown-arrow-after-height, 9px);bottom:var(--ran-dropdown-arrow-after-bottom, 0);inset-inline:0;margin:var(--ran-dropdown-arrow-after-margin, auto);border-radius:var(--ran-dropdown-arrow-after-border-radius, 0 0 2px 0);transform:var(--ran-dropdown-arrow-after-transform, translateY(50%) rotate(-135deg));box-shadow:var(--ran-dropdown-arrow-after-box-shadow, 2px 2px 5px rgba(0, 0, 0, .05));z-index:var(--ran-dropdown-arrow-after-z-index, 0);background:var(--ran-dropdown-arrow-after-background, var(--ran-color-bg-elevated, #fff))}', e = 300, x = /* @__PURE__ */ (function(r) {
5
+ return r.TOP = "top", r.BOTTOM = "bottom", r.LEFT = "left", r.RIGHT = "right", r;
6
+ })({}), v = class extends f {
7
+ dropdown;
8
+ _slot;
9
+ _shadowDom;
10
+ arrowIcon;
11
+ container;
12
+ static get observedAttributes() {
13
+ return [
14
+ "transit",
15
+ "arrow",
16
+ "sheet"
17
+ ];
18
+ }
19
+ constructor() {
20
+ super(), this._shadowDom = w(this, m);
21
+ const r = h(this._shadowDom, ".ranui-dropdown-container", () => n().class("ranui-dropdown-container").children(n().style("-webkit-tap-highlight-color", "transparent").style("outline", "0").class("ranui-dropdown").part("dropdown").children(l().class("slot"))).build());
22
+ this.container = r, this.dropdown = r.querySelector(".ranui-dropdown"), this._slot = r.querySelector(".slot");
23
+ }
24
+ get transit() {
25
+ return o(this, "transit");
26
+ }
27
+ set transit(r) {
28
+ a(this, "transit", r, { removeEmpty: !0 });
29
+ }
30
+ get arrow() {
31
+ return o(this, "arrow");
32
+ }
33
+ set arrow(r) {
34
+ a(this, "arrow", r, { removeEmpty: !0 });
35
+ }
36
+ get sheet() {
37
+ return o(this, "sheet");
38
+ }
39
+ set sheet(r) {
40
+ a(this, "sheet", r);
41
+ }
42
+ handlerExternalCss = () => {
43
+ p(this, this._shadowDom, "sheet", null, this.sheet);
44
+ };
45
+ handlerTransit = () => {
46
+ this.transit && this.dropdown && (i(this.dropdown, this.transit), setTimeout(() => {
47
+ d(this.dropdown, this.transit);
48
+ }, e));
49
+ };
50
+ handlerArrow = () => {
51
+ const r = (this.arrow || "").trim();
52
+ if (!r) {
53
+ this.arrowIcon && this.container.contains(this.arrowIcon) && this.container.removeChild(this.arrowIcon), this.arrowIcon = void 0;
54
+ return;
55
+ }
56
+ !this.arrowIcon && this.container && (this.arrowIcon = n().class("ranui-dropdown-arrow").build(), this.container.appendChild(this.arrowIcon)), this.arrowIcon && (this.arrowIcon.className = `ranui-dropdown-arrow ${r}`);
57
+ };
58
+ stopPropagation = (r) => {
59
+ r.stopPropagation();
60
+ };
61
+ connectedCallback() {
62
+ this.handlerExternalCss(), this.handlerTransit(), this.handlerArrow();
63
+ }
64
+ disconnectedCallback() {
65
+ }
66
+ attributeChangedCallback(r, s, t) {
67
+ r === "transit" && t && (i(this.dropdown, this.transit), setTimeout(() => {
68
+ d(this.dropdown, this.transit);
69
+ }, e)), r === "arrow" && this.handlerArrow(), r === "sheet" && s !== t && this.handlerExternalCss();
70
+ }
71
+ };
72
+ c("r-dropdown", v);
73
+ export {
74
+ v as n,
75
+ x as t
76
+ };
@@ -0,0 +1,6 @@
1
+ import { n as a, t as r } from "./dropdown-RqHMRhFE.js";
2
+ export {
3
+ r as ARROW_TYPE,
4
+ a as Dropdown,
5
+ a as default
6
+ };
@@ -0,0 +1,30 @@
1
+ var o = class {
2
+ ac;
3
+ constructor() {
4
+ this.ac = new AbortController();
5
+ }
6
+ get signal() {
7
+ return this.ac.signal;
8
+ }
9
+ on(t, a, s, n) {
10
+ return t.addEventListener(a, s, {
11
+ ...n,
12
+ signal: this.ac.signal
13
+ }), this;
14
+ }
15
+ delegate(t, a, s, n, i) {
16
+ return t.addEventListener(s, (e) => {
17
+ const r = e.target?.closest(a);
18
+ r && t.contains(r) && n(e, r);
19
+ }, {
20
+ ...i,
21
+ signal: this.ac.signal
22
+ }), this;
23
+ }
24
+ abort() {
25
+ this.ac.abort(), this.ac = new AbortController();
26
+ }
27
+ };
28
+ export {
29
+ o as t
30
+ };
@@ -0,0 +1,165 @@
1
+ import { c as l, n as d } from "./mocks-CMGoftIc.js";
2
+ var p = () => ({ current: null }), o = class h {
3
+ el;
4
+ constructor(t) {
5
+ this.el = l ? new d(t) : document.createElement(t);
6
+ }
7
+ id(t) {
8
+ return this.el.setAttribute("id", t), this;
9
+ }
10
+ class(t) {
11
+ return l ? this.el.attributes.set("class", t) : this.el.className = t, this;
12
+ }
13
+ addClass(...t) {
14
+ return t.forEach((e) => this.el.classList.add(e)), this;
15
+ }
16
+ removeClass(...t) {
17
+ return t.forEach((e) => this.el.classList.remove(e)), this;
18
+ }
19
+ attr(t, e) {
20
+ return this.el.setAttribute(t, e), this;
21
+ }
22
+ attrs(t) {
23
+ return Object.entries(t).forEach(([e, r]) => {
24
+ r != null && this.el.setAttribute(e, String(r));
25
+ }), this;
26
+ }
27
+ boolAttr(t, e, r = "") {
28
+ return e ? this.el.setAttribute(t, r) : this.el.removeAttribute(t), this;
29
+ }
30
+ part(t) {
31
+ return this.el.setAttribute("part", t), this;
32
+ }
33
+ data(t, e) {
34
+ return this.attr(`data-${t}`, e);
35
+ }
36
+ style(t, e) {
37
+ return typeof t == "string" ? this.el.style.setProperty(t, e ?? "") : Object.entries(t).forEach(([r, a]) => this.el.style.setProperty(r, a)), this;
38
+ }
39
+ cssVar(t, e) {
40
+ const r = t.startsWith("--") ? t : `--${t}`;
41
+ return this.style(r, e);
42
+ }
43
+ aria(t, e) {
44
+ return this.attr(`aria-${t}`, e);
45
+ }
46
+ role(t) {
47
+ return this.attr("role", t);
48
+ }
49
+ tabIndex(t) {
50
+ return this.attr("tabindex", String(t));
51
+ }
52
+ label(t) {
53
+ return this.aria("label", t);
54
+ }
55
+ labelledBy(t) {
56
+ return this.aria("labelledby", t);
57
+ }
58
+ describedBy(t) {
59
+ return this.aria("describedby", t);
60
+ }
61
+ ariaHidden(t = !0) {
62
+ return this.aria("hidden", String(t));
63
+ }
64
+ on(t, e, r) {
65
+ return this.el.addEventListener(t, e, r), this;
66
+ }
67
+ listen(t, e, r, a) {
68
+ return t.on(this.el, e, r, a), this;
69
+ }
70
+ delegate(t, e, r, a, n) {
71
+ return t.delegate(this.el, e, r, a, n), this;
72
+ }
73
+ children(...t) {
74
+ const e = (r) => r.reduce((a, n) => Array.isArray(n) ? a.concat(e(n)) : a.concat(n), []);
75
+ return e(t).forEach((r) => {
76
+ r != null && (r instanceof h ? this.el.appendChild(r.build()) : typeof r == "string" ? l ? this.el.appendChild(r) : this.el.appendChild(document.createTextNode(r)) : this.el.appendChild(r));
77
+ }), this;
78
+ }
79
+ replaceChildren(...t) {
80
+ if (l) {
81
+ const e = this.el;
82
+ e.childrenList = [];
83
+ } else this.el.replaceChildren();
84
+ return this.children(...t);
85
+ }
86
+ text(t) {
87
+ return this.el.textContent = t, this;
88
+ }
89
+ ref(t) {
90
+ return t.current = this.el, this;
91
+ }
92
+ shadow(t = { mode: "closed" }) {
93
+ const e = this.el.attachShadow(t);
94
+ return new u(this.el, e, t);
95
+ }
96
+ build() {
97
+ return this.el;
98
+ }
99
+ serialize() {
100
+ if (l) return this.el.serialize();
101
+ const t = document.createElement("div");
102
+ return t.appendChild(this.el.cloneNode(!0)), t.innerHTML;
103
+ }
104
+ }, u = class {
105
+ root;
106
+ hostEl;
107
+ options;
108
+ constructor(i, t, e) {
109
+ this.hostEl = i, this.root = t, this.options = e;
110
+ }
111
+ children(...i) {
112
+ const t = (e) => e.reduce((r, a) => Array.isArray(a) ? r.concat(t(a)) : r.concat(a), []);
113
+ return t(i).forEach((e) => {
114
+ e != null && (e instanceof o ? this.root.appendChild(e.build()) : typeof e == "string" ? l ? this.root.appendChild(e) : this.root.appendChild(document.createTextNode(e)) : this.root.appendChild(e));
115
+ }), this;
116
+ }
117
+ adoptSheet(...i) {
118
+ return this.root.adoptedStyleSheets = [...this.root.adoptedStyleSheets, ...i], this;
119
+ }
120
+ css(i) {
121
+ if (l)
122
+ return this.root.adoptedStyleSheets.push(i), this;
123
+ if (typeof CSSStyleSheet < "u") try {
124
+ const e = new CSSStyleSheet();
125
+ return e.replaceSync(i), this.root.adoptedStyleSheets = [...this.root.adoptedStyleSheets, e], this;
126
+ } catch {
127
+ }
128
+ const t = document.createElement("style");
129
+ return t.textContent = i, this.root.appendChild(t), this;
130
+ }
131
+ done() {
132
+ return {
133
+ host: this.hostEl,
134
+ shadow: this.root
135
+ };
136
+ }
137
+ serialize() {
138
+ return l ? this.root.serialize() : this.root.innerHTML;
139
+ }
140
+ }, s = (i) => new o(i), f = () => s("div"), S = () => s("span"), y = () => s("slot"), b = () => s("button"), v = () => s("input"), C = () => s("style"), E = () => s("label"), w = () => s("ul"), A = () => s("li"), g = () => s("section"), L = () => s("article"), B = () => s("nav"), m = () => s("header"), x = () => s("footer"), H = () => s("main"), N = (i = "open", t = !1) => {
141
+ const e = s("template");
142
+ return e.attr("shadowrootmode", i), t && e.attr("shadowrootdelegatesfocus", ""), e;
143
+ };
144
+ export {
145
+ s as _,
146
+ x as a,
147
+ p as b,
148
+ E as c,
149
+ B as d,
150
+ g as f,
151
+ w as g,
152
+ C as h,
153
+ f as i,
154
+ A as l,
155
+ S as m,
156
+ b as n,
157
+ m as o,
158
+ y as p,
159
+ N as r,
160
+ v as s,
161
+ L as t,
162
+ H as u,
163
+ o as v,
164
+ u as y
165
+ };
@@ -0,0 +1,44 @@
1
+ import { c as a, d as o, l as i, s as n, u as h } from "./utils-D4pPF77E.js";
2
+ import { _ as l, p as u } from "./factory-BdsO0dEW.js";
3
+ import { a as m, n as c } from "./ssr-DSGwPtEd.js";
4
+ var f = ".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 {
5
+ _form;
6
+ _shadowDom;
7
+ static get observedAttributes() {
8
+ return ["sheet"];
9
+ }
10
+ constructor() {
11
+ super(), this._shadowDom = a(this, f), this._form = n(this._shadowDom, ".r-form", () => l("form").class("r-form").children(u().attr("name", "r-form_content")).build());
12
+ }
13
+ get value() {
14
+ return this.getAttribute("value");
15
+ }
16
+ set value(t) {
17
+ t != null && this.setAttribute("value", t);
18
+ }
19
+ get sheet() {
20
+ return i(this, "sheet");
21
+ }
22
+ set sheet(t) {
23
+ h(this, "sheet", t);
24
+ }
25
+ handlerExternalCss = () => {
26
+ o(this, this._shadowDom, "sheet", null, this.sheet);
27
+ };
28
+ connectedCallback() {
29
+ this.handlerExternalCss();
30
+ const t = {}, e = new FormData(this._form);
31
+ e.forEach((r, s) => {
32
+ t[s] || (t[s] = e.getAll(s).length > 1 ? e.getAll(s) : e.get(s));
33
+ }), this._form.addEventListener("submit", () => {
34
+ this.value = JSON.stringify(t);
35
+ });
36
+ }
37
+ attributeChangedCallback(t, e, r) {
38
+ e !== r && t === "sheet" && this.handlerExternalCss();
39
+ }
40
+ };
41
+ m("r-form", d);
42
+ export {
43
+ d as t
44
+ };
package/dist/form.js ADDED
@@ -0,0 +1,5 @@
1
+ import { t as r } from "./form-05Lxxl3D.js";
2
+ export {
3
+ r as Form,
4
+ r as default
5
+ };