godown 3.13.2 → 3.13.3

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 (768) hide show
  1. package/build/alert.d.ts.map +1 -0
  2. package/build/alert.js +2 -0
  3. package/build/avatar.d.ts.map +1 -0
  4. package/build/avatar.js +2 -0
  5. package/build/badge.d.ts.map +1 -0
  6. package/build/badge.js +2 -0
  7. package/build/breath.d.ts.map +1 -0
  8. package/build/breath.js +2 -0
  9. package/build/button.d.ts.map +1 -0
  10. package/build/button.js +2 -0
  11. package/build/card.d.ts.map +1 -0
  12. package/build/card.js +2 -0
  13. package/build/carousel.d.ts.map +1 -0
  14. package/build/carousel.js +2 -0
  15. package/build/chip.d.ts.map +1 -0
  16. package/build/chip.js +2 -0
  17. package/build/details.d.ts.map +1 -0
  18. package/build/details.js +2 -0
  19. package/build/dialog.d.ts.map +1 -0
  20. package/build/dialog.js +2 -0
  21. package/build/divider.d.ts.map +1 -0
  22. package/build/divider.js +2 -0
  23. package/build/dragbox.d.ts.map +1 -0
  24. package/build/dragbox.js +2 -0
  25. package/build/flex.d.ts.map +1 -0
  26. package/build/flex.js +2 -0
  27. package/build/form.d.ts.map +1 -0
  28. package/build/form.js +2 -0
  29. package/build/godown.iife.js +16 -15
  30. package/build/godown.iife.js.map +1 -1
  31. package/build/godown.umd.js +16 -15
  32. package/build/godown.umd.js.map +1 -1
  33. package/build/grid.d.ts.map +1 -0
  34. package/build/grid.js +2 -0
  35. package/build/heading.d.ts.map +1 -0
  36. package/build/heading.js +2 -0
  37. package/build/index.d.ts.map +1 -0
  38. package/{index.js → build/index.js} +1 -1
  39. package/build/input.d.ts.map +1 -0
  40. package/build/input.js +2 -0
  41. package/build/internal/global-style.d.ts +23 -0
  42. package/build/internal/global-style.d.ts.map +1 -0
  43. package/build/internal/global-style.js +2 -0
  44. package/build/internal/global-style.js.map +1 -0
  45. package/build/internal/icons/caret-down.d.ts.map +1 -0
  46. package/build/internal/icons/caret-down.js.map +1 -0
  47. package/build/internal/icons/caret-left.d.ts.map +1 -0
  48. package/build/internal/icons/caret-left.js.map +1 -0
  49. package/build/internal/icons/caret-right.d.ts.map +1 -0
  50. package/build/internal/icons/caret-right.js.map +1 -0
  51. package/build/internal/icons/eye-slash.d.ts.map +1 -0
  52. package/build/internal/icons/eye-slash.js.map +1 -0
  53. package/build/internal/popover.d.ts.map +1 -0
  54. package/build/internal/popover.js +2 -0
  55. package/build/internal/popover.js.map +1 -0
  56. package/build/internal/reset-style.d.ts.map +1 -0
  57. package/build/internal/reset-style.js.map +1 -0
  58. package/build/internal/ring.d.ts.map +1 -0
  59. package/build/internal/ring.js +2 -0
  60. package/build/internal/ring.js.map +1 -0
  61. package/build/internal/super-input.d.ts.map +1 -0
  62. package/{internal → build/internal}/super-input.js +2 -2
  63. package/build/internal/super-input.js.map +1 -0
  64. package/build/internal/utils.d.ts.map +1 -0
  65. package/build/internal/utils.js +2 -0
  66. package/build/internal/utils.js.map +1 -0
  67. package/build/layout.d.ts.map +1 -0
  68. package/build/layout.js +2 -0
  69. package/build/link.d.ts.map +1 -0
  70. package/build/link.js +2 -0
  71. package/build/popover.d.ts.map +1 -0
  72. package/build/popover.js +2 -0
  73. package/build/progress.d.ts.map +1 -0
  74. package/build/progress.js +2 -0
  75. package/build/range.d.ts.map +1 -0
  76. package/build/range.js +2 -0
  77. package/build/rotate.d.ts.map +1 -0
  78. package/build/rotate.js +2 -0
  79. package/build/router.d.ts.map +1 -0
  80. package/build/router.js +2 -0
  81. package/build/select.d.ts.map +1 -0
  82. package/build/select.js +2 -0
  83. package/build/skeleton.d.ts.map +1 -0
  84. package/build/skeleton.js +2 -0
  85. package/build/split.d.ts.map +1 -0
  86. package/build/split.js +2 -0
  87. package/build/switch.d.ts.map +1 -0
  88. package/build/switch.js +2 -0
  89. package/build/tabs.d.ts.map +1 -0
  90. package/build/tabs.js +2 -0
  91. package/build/text.d.ts.map +1 -0
  92. package/build/text.js +2 -0
  93. package/build/time.d.ts.map +1 -0
  94. package/build/time.js +2 -0
  95. package/build/tooltip.d.ts.map +1 -0
  96. package/build/tooltip.js +2 -0
  97. package/build/typewriter.d.ts.map +1 -0
  98. package/build/typewriter.js +2 -0
  99. package/build/web-components/alert/component.d.ts.map +1 -0
  100. package/build/web-components/alert/component.js +2 -0
  101. package/build/web-components/alert/component.js.map +1 -0
  102. package/build/web-components/alert/definition.d.ts.map +1 -0
  103. package/build/web-components/alert/definition.js +2 -0
  104. package/build/web-components/alert/definition.js.map +1 -0
  105. package/build/web-components/avatar/component.d.ts.map +1 -0
  106. package/build/web-components/avatar/component.js +2 -0
  107. package/build/web-components/avatar/component.js.map +1 -0
  108. package/build/web-components/avatar/definition.d.ts.map +1 -0
  109. package/build/web-components/avatar/definition.js +2 -0
  110. package/build/web-components/avatar/definition.js.map +1 -0
  111. package/build/web-components/badge/component.d.ts.map +1 -0
  112. package/build/web-components/badge/component.js +3 -0
  113. package/build/web-components/badge/component.js.map +1 -0
  114. package/build/web-components/badge/definition.d.ts.map +1 -0
  115. package/build/web-components/badge/definition.js +2 -0
  116. package/build/web-components/badge/definition.js.map +1 -0
  117. package/{web-components → build/web-components}/breath/component.d.ts +1 -0
  118. package/build/web-components/breath/component.d.ts.map +1 -0
  119. package/build/web-components/breath/component.js +2 -0
  120. package/build/web-components/breath/component.js.map +1 -0
  121. package/build/web-components/breath/definition.d.ts.map +1 -0
  122. package/build/web-components/breath/definition.js +2 -0
  123. package/build/web-components/breath/definition.js.map +1 -0
  124. package/build/web-components/button/component.d.ts.map +1 -0
  125. package/build/web-components/button/component.js +2 -0
  126. package/build/web-components/button/component.js.map +1 -0
  127. package/build/web-components/button/definition.d.ts.map +1 -0
  128. package/build/web-components/button/definition.js +2 -0
  129. package/build/web-components/button/definition.js.map +1 -0
  130. package/build/web-components/card/component.d.ts.map +1 -0
  131. package/build/web-components/card/component.js +2 -0
  132. package/build/web-components/card/component.js.map +1 -0
  133. package/build/web-components/card/definition.d.ts.map +1 -0
  134. package/build/web-components/card/definition.js +2 -0
  135. package/build/web-components/card/definition.js.map +1 -0
  136. package/build/web-components/carousel/component.d.ts.map +1 -0
  137. package/build/web-components/carousel/component.js +3 -0
  138. package/build/web-components/carousel/component.js.map +1 -0
  139. package/build/web-components/carousel/definition.d.ts.map +1 -0
  140. package/build/web-components/carousel/definition.js +2 -0
  141. package/build/web-components/carousel/definition.js.map +1 -0
  142. package/build/web-components/chip/component.d.ts.map +1 -0
  143. package/build/web-components/chip/component.js +2 -0
  144. package/build/web-components/chip/component.js.map +1 -0
  145. package/build/web-components/chip/definition.d.ts.map +1 -0
  146. package/build/web-components/chip/definition.js +2 -0
  147. package/build/web-components/chip/definition.js.map +1 -0
  148. package/build/web-components/details/component.d.ts.map +1 -0
  149. package/build/web-components/details/component.js +2 -0
  150. package/build/web-components/details/component.js.map +1 -0
  151. package/build/web-components/details/definition.d.ts.map +1 -0
  152. package/build/web-components/details/definition.js +2 -0
  153. package/build/web-components/details/definition.js.map +1 -0
  154. package/build/web-components/dialog/component.d.ts.map +1 -0
  155. package/build/web-components/dialog/component.js +2 -0
  156. package/build/web-components/dialog/component.js.map +1 -0
  157. package/build/web-components/dialog/definition.d.ts.map +1 -0
  158. package/build/web-components/dialog/definition.js +2 -0
  159. package/build/web-components/dialog/definition.js.map +1 -0
  160. package/build/web-components/divider/component.d.ts.map +1 -0
  161. package/build/web-components/divider/component.js +2 -0
  162. package/build/web-components/divider/component.js.map +1 -0
  163. package/build/web-components/divider/definition.d.ts.map +1 -0
  164. package/build/web-components/divider/definition.js +2 -0
  165. package/build/web-components/divider/definition.js.map +1 -0
  166. package/build/web-components/dragbox/component.d.ts.map +1 -0
  167. package/build/web-components/dragbox/component.js +3 -0
  168. package/build/web-components/dragbox/component.js.map +1 -0
  169. package/build/web-components/dragbox/definition.d.ts.map +1 -0
  170. package/build/web-components/dragbox/definition.js +2 -0
  171. package/build/web-components/dragbox/definition.js.map +1 -0
  172. package/{web-components → build/web-components}/flex/component.d.ts +1 -0
  173. package/build/web-components/flex/component.d.ts.map +1 -0
  174. package/build/web-components/flex/component.js +3 -0
  175. package/build/web-components/flex/component.js.map +1 -0
  176. package/build/web-components/flex/definition.d.ts.map +1 -0
  177. package/build/web-components/flex/definition.js +2 -0
  178. package/build/web-components/flex/definition.js.map +1 -0
  179. package/build/web-components/form/component.d.ts.map +1 -0
  180. package/build/web-components/form/component.js +3 -0
  181. package/build/web-components/form/component.js.map +1 -0
  182. package/build/web-components/form/definition.d.ts.map +1 -0
  183. package/build/web-components/form/definition.js +2 -0
  184. package/build/web-components/form/definition.js.map +1 -0
  185. package/{web-components → build/web-components}/grid/component.d.ts +1 -0
  186. package/build/web-components/grid/component.d.ts.map +1 -0
  187. package/build/web-components/grid/component.js +3 -0
  188. package/build/web-components/grid/component.js.map +1 -0
  189. package/build/web-components/grid/definition.d.ts.map +1 -0
  190. package/build/web-components/grid/definition.js +2 -0
  191. package/build/web-components/grid/definition.js.map +1 -0
  192. package/build/web-components/heading/component.d.ts.map +1 -0
  193. package/build/web-components/heading/component.js +3 -0
  194. package/build/web-components/heading/component.js.map +1 -0
  195. package/build/web-components/heading/definition.d.ts.map +1 -0
  196. package/build/web-components/heading/definition.js +2 -0
  197. package/build/web-components/heading/definition.js.map +1 -0
  198. package/build/web-components/input/component.d.ts.map +1 -0
  199. package/build/web-components/input/component.js +2 -0
  200. package/build/web-components/input/component.js.map +1 -0
  201. package/build/web-components/input/definition.d.ts.map +1 -0
  202. package/build/web-components/input/definition.js +2 -0
  203. package/build/web-components/input/definition.js.map +1 -0
  204. package/build/web-components/layout/component.d.ts.map +1 -0
  205. package/build/web-components/layout/component.js +3 -0
  206. package/build/web-components/layout/component.js.map +1 -0
  207. package/build/web-components/layout/definition.d.ts.map +1 -0
  208. package/build/web-components/layout/definition.js +2 -0
  209. package/build/web-components/layout/definition.js.map +1 -0
  210. package/build/web-components/link/component.d.ts.map +1 -0
  211. package/build/web-components/link/component.js +3 -0
  212. package/build/web-components/link/component.js.map +1 -0
  213. package/build/web-components/link/definition.d.ts.map +1 -0
  214. package/build/web-components/link/definition.js +2 -0
  215. package/build/web-components/link/definition.js.map +1 -0
  216. package/build/web-components/popover/component.d.ts.map +1 -0
  217. package/build/web-components/popover/component.js +3 -0
  218. package/build/web-components/popover/component.js.map +1 -0
  219. package/build/web-components/popover/definition.d.ts.map +1 -0
  220. package/build/web-components/popover/definition.js +2 -0
  221. package/build/web-components/popover/definition.js.map +1 -0
  222. package/build/web-components/progress/component.d.ts.map +1 -0
  223. package/build/web-components/progress/component.js +2 -0
  224. package/build/web-components/progress/component.js.map +1 -0
  225. package/build/web-components/progress/definition.d.ts.map +1 -0
  226. package/build/web-components/progress/definition.js +2 -0
  227. package/build/web-components/progress/definition.js.map +1 -0
  228. package/{web-components → build/web-components}/range/component.d.ts +1 -1
  229. package/build/web-components/range/component.d.ts.map +1 -0
  230. package/build/web-components/range/component.js +2 -0
  231. package/build/web-components/range/component.js.map +1 -0
  232. package/build/web-components/range/definition.d.ts.map +1 -0
  233. package/build/web-components/range/definition.js +2 -0
  234. package/build/web-components/range/definition.js.map +1 -0
  235. package/build/web-components/rotate/component.d.ts.map +1 -0
  236. package/build/web-components/rotate/component.js +2 -0
  237. package/build/web-components/rotate/component.js.map +1 -0
  238. package/build/web-components/rotate/definition.d.ts.map +1 -0
  239. package/build/web-components/rotate/definition.js +2 -0
  240. package/build/web-components/rotate/definition.js.map +1 -0
  241. package/{web-components → build/web-components}/router/component.d.ts +2 -2
  242. package/build/web-components/router/component.d.ts.map +1 -0
  243. package/build/web-components/router/component.js +3 -0
  244. package/build/web-components/router/component.js.map +1 -0
  245. package/build/web-components/router/definition.d.ts.map +1 -0
  246. package/build/web-components/router/definition.js +2 -0
  247. package/build/web-components/router/definition.js.map +1 -0
  248. package/build/web-components/select/component.d.ts.map +1 -0
  249. package/build/web-components/select/component.js +3 -0
  250. package/build/web-components/select/component.js.map +1 -0
  251. package/build/web-components/select/definition.d.ts.map +1 -0
  252. package/build/web-components/select/definition.js +2 -0
  253. package/build/web-components/select/definition.js.map +1 -0
  254. package/build/web-components/skeleton/component.d.ts.map +1 -0
  255. package/build/web-components/skeleton/component.js +2 -0
  256. package/{web-components/skeleton/component.d.ts.map → build/web-components/skeleton/component.js.map} +1 -1
  257. package/build/web-components/skeleton/definition.d.ts.map +1 -0
  258. package/build/web-components/skeleton/definition.js +2 -0
  259. package/build/web-components/skeleton/definition.js.map +1 -0
  260. package/build/web-components/split/component.d.ts.map +1 -0
  261. package/build/web-components/split/component.js +2 -0
  262. package/build/web-components/split/component.js.map +1 -0
  263. package/build/web-components/split/definition.d.ts.map +1 -0
  264. package/build/web-components/split/definition.js +2 -0
  265. package/build/web-components/split/definition.js.map +1 -0
  266. package/build/web-components/switch/component.d.ts.map +1 -0
  267. package/build/web-components/switch/component.js +2 -0
  268. package/{web-components/switch/component.d.ts.map → build/web-components/switch/component.js.map} +1 -1
  269. package/build/web-components/switch/definition.d.ts.map +1 -0
  270. package/build/web-components/switch/definition.js +2 -0
  271. package/build/web-components/switch/definition.js.map +1 -0
  272. package/build/web-components/tabs/component.d.ts.map +1 -0
  273. package/build/web-components/tabs/component.js +2 -0
  274. package/build/web-components/tabs/component.js.map +1 -0
  275. package/build/web-components/tabs/definition.d.ts.map +1 -0
  276. package/build/web-components/tabs/definition.js +2 -0
  277. package/build/web-components/tabs/definition.js.map +1 -0
  278. package/build/web-components/text/component.d.ts.map +1 -0
  279. package/build/web-components/text/component.js +2 -0
  280. package/build/web-components/text/component.js.map +1 -0
  281. package/build/web-components/text/definition.d.ts.map +1 -0
  282. package/build/web-components/text/definition.js +2 -0
  283. package/build/web-components/text/definition.js.map +1 -0
  284. package/build/web-components/time/component.d.ts.map +1 -0
  285. package/build/web-components/time/component.js +2 -0
  286. package/build/web-components/time/component.js.map +1 -0
  287. package/build/web-components/time/definition.d.ts.map +1 -0
  288. package/build/web-components/time/definition.js +2 -0
  289. package/build/web-components/time/definition.js.map +1 -0
  290. package/build/web-components/tooltip/component.d.ts.map +1 -0
  291. package/build/web-components/tooltip/component.js +2 -0
  292. package/build/web-components/tooltip/component.js.map +1 -0
  293. package/build/web-components/tooltip/definition.d.ts.map +1 -0
  294. package/build/web-components/tooltip/definition.js +2 -0
  295. package/build/web-components/tooltip/definition.js.map +1 -0
  296. package/{web-components → build/web-components}/typewriter/component.d.ts +1 -1
  297. package/build/web-components/typewriter/component.d.ts.map +1 -0
  298. package/build/web-components/typewriter/component.js +2 -0
  299. package/build/web-components/typewriter/component.js.map +1 -0
  300. package/build/web-components/typewriter/definition.d.ts.map +1 -0
  301. package/build/web-components/typewriter/definition.js +2 -0
  302. package/build/web-components/typewriter/definition.js.map +1 -0
  303. package/custom-elements.json +1 -1
  304. package/package.json +25 -19
  305. package/src/internal/global-style.ts +50 -45
  306. package/src/internal/popover.ts +1 -1
  307. package/src/internal/ring.ts +2 -3
  308. package/src/internal/super-input.ts +4 -3
  309. package/src/internal/utils.ts +8 -7
  310. package/src/web-components/avatar/component.ts +2 -1
  311. package/src/web-components/breath/component.ts +8 -5
  312. package/src/web-components/button/component.ts +4 -4
  313. package/src/web-components/carousel/component.ts +3 -3
  314. package/src/web-components/dialog/component.ts +3 -3
  315. package/src/web-components/flex/component.ts +19 -15
  316. package/src/web-components/grid/component.ts +20 -15
  317. package/src/web-components/input/component.ts +3 -3
  318. package/src/web-components/popover/component.ts +6 -5
  319. package/src/web-components/progress/component.ts +2 -1
  320. package/src/web-components/range/component.ts +16 -22
  321. package/src/web-components/rotate/component.ts +3 -2
  322. package/src/web-components/router/component.ts +13 -9
  323. package/src/web-components/select/component.ts +3 -3
  324. package/src/web-components/split/component.ts +2 -1
  325. package/src/web-components/switch/component.ts +2 -1
  326. package/src/web-components/typewriter/component.ts +2 -1
  327. package/tsconfig.json +20 -11
  328. package/vscode.css-custom-data.json +6 -1
  329. package/vscode.html-custom-data.json +204 -1
  330. package/web-types.json +1265 -1
  331. package/alert.d.ts.map +0 -1
  332. package/alert.js +0 -2
  333. package/avatar.d.ts.map +0 -1
  334. package/avatar.js +0 -2
  335. package/badge.d.ts.map +0 -1
  336. package/badge.js +0 -2
  337. package/breath.d.ts.map +0 -1
  338. package/breath.js +0 -2
  339. package/build/godown+lit.iife.js +0 -17
  340. package/build/godown+lit.iife.js.map +0 -1
  341. package/build/godown+lit.js +0 -17
  342. package/build/godown+lit.js.map +0 -1
  343. package/build/godown+lit.umd.js +0 -17
  344. package/build/godown+lit.umd.js.map +0 -1
  345. package/build/godown.js +0 -16
  346. package/build/godown.js.map +0 -1
  347. package/button.d.ts.map +0 -1
  348. package/button.js +0 -2
  349. package/card.d.ts.map +0 -1
  350. package/card.js +0 -2
  351. package/carousel.d.ts.map +0 -1
  352. package/carousel.js +0 -2
  353. package/chip.d.ts.map +0 -1
  354. package/chip.js +0 -2
  355. package/details.d.ts.map +0 -1
  356. package/details.js +0 -2
  357. package/dialog.d.ts.map +0 -1
  358. package/dialog.js +0 -2
  359. package/divider.d.ts.map +0 -1
  360. package/divider.js +0 -2
  361. package/dragbox.d.ts.map +0 -1
  362. package/dragbox.js +0 -2
  363. package/flex.d.ts.map +0 -1
  364. package/flex.js +0 -2
  365. package/form.d.ts.map +0 -1
  366. package/form.js +0 -2
  367. package/grid.d.ts.map +0 -1
  368. package/grid.js +0 -2
  369. package/heading.d.ts.map +0 -1
  370. package/heading.js +0 -2
  371. package/index.d.ts.map +0 -1
  372. package/input.d.ts.map +0 -1
  373. package/input.js +0 -2
  374. package/internal/global-style.d.ts +0 -20
  375. package/internal/global-style.d.ts.map +0 -1
  376. package/internal/global-style.js +0 -2
  377. package/internal/global-style.js.map +0 -1
  378. package/internal/icons/caret-down.d.ts.map +0 -1
  379. package/internal/icons/caret-down.js.map +0 -1
  380. package/internal/icons/caret-left.d.ts.map +0 -1
  381. package/internal/icons/caret-left.js.map +0 -1
  382. package/internal/icons/caret-right.d.ts.map +0 -1
  383. package/internal/icons/caret-right.js.map +0 -1
  384. package/internal/icons/eye-slash.d.ts.map +0 -1
  385. package/internal/icons/eye-slash.js.map +0 -1
  386. package/internal/popover.d.ts.map +0 -1
  387. package/internal/popover.js +0 -2
  388. package/internal/popover.js.map +0 -1
  389. package/internal/reset-style.d.ts.map +0 -1
  390. package/internal/reset-style.js.map +0 -1
  391. package/internal/ring.d.ts.map +0 -1
  392. package/internal/ring.js +0 -2
  393. package/internal/ring.js.map +0 -1
  394. package/internal/super-input.d.ts.map +0 -1
  395. package/internal/super-input.js.map +0 -1
  396. package/internal/utils.d.ts.map +0 -1
  397. package/internal/utils.js +0 -2
  398. package/internal/utils.js.map +0 -1
  399. package/layout.d.ts.map +0 -1
  400. package/layout.js +0 -2
  401. package/link.d.ts.map +0 -1
  402. package/link.js +0 -2
  403. package/popover.d.ts.map +0 -1
  404. package/popover.js +0 -2
  405. package/progress.d.ts.map +0 -1
  406. package/progress.js +0 -2
  407. package/range.d.ts.map +0 -1
  408. package/range.js +0 -2
  409. package/rotate.d.ts.map +0 -1
  410. package/rotate.js +0 -2
  411. package/router.d.ts.map +0 -1
  412. package/router.js +0 -2
  413. package/select.d.ts.map +0 -1
  414. package/select.js +0 -2
  415. package/skeleton.d.ts.map +0 -1
  416. package/skeleton.js +0 -2
  417. package/split.d.ts.map +0 -1
  418. package/split.js +0 -2
  419. package/switch.d.ts.map +0 -1
  420. package/switch.js +0 -2
  421. package/tabs.d.ts.map +0 -1
  422. package/tabs.js +0 -2
  423. package/text.d.ts.map +0 -1
  424. package/text.js +0 -2
  425. package/time.d.ts.map +0 -1
  426. package/time.js +0 -2
  427. package/tooltip.d.ts.map +0 -1
  428. package/tooltip.js +0 -2
  429. package/typewriter.d.ts.map +0 -1
  430. package/typewriter.js +0 -2
  431. package/web-components/alert/component.d.ts.map +0 -1
  432. package/web-components/alert/component.js +0 -2
  433. package/web-components/alert/component.js.map +0 -1
  434. package/web-components/alert/definition.d.ts.map +0 -1
  435. package/web-components/alert/definition.js +0 -2
  436. package/web-components/alert/definition.js.map +0 -1
  437. package/web-components/avatar/component.d.ts.map +0 -1
  438. package/web-components/avatar/component.js +0 -2
  439. package/web-components/avatar/component.js.map +0 -1
  440. package/web-components/avatar/definition.d.ts.map +0 -1
  441. package/web-components/avatar/definition.js +0 -2
  442. package/web-components/avatar/definition.js.map +0 -1
  443. package/web-components/badge/component.d.ts.map +0 -1
  444. package/web-components/badge/component.js +0 -3
  445. package/web-components/badge/component.js.map +0 -1
  446. package/web-components/badge/definition.d.ts.map +0 -1
  447. package/web-components/badge/definition.js +0 -2
  448. package/web-components/badge/definition.js.map +0 -1
  449. package/web-components/breath/component.d.ts.map +0 -1
  450. package/web-components/breath/component.js +0 -2
  451. package/web-components/breath/component.js.map +0 -1
  452. package/web-components/breath/definition.d.ts.map +0 -1
  453. package/web-components/breath/definition.js +0 -2
  454. package/web-components/breath/definition.js.map +0 -1
  455. package/web-components/button/component.d.ts.map +0 -1
  456. package/web-components/button/component.js +0 -2
  457. package/web-components/button/component.js.map +0 -1
  458. package/web-components/button/definition.d.ts.map +0 -1
  459. package/web-components/button/definition.js +0 -2
  460. package/web-components/button/definition.js.map +0 -1
  461. package/web-components/card/component.d.ts.map +0 -1
  462. package/web-components/card/component.js +0 -2
  463. package/web-components/card/component.js.map +0 -1
  464. package/web-components/card/definition.d.ts.map +0 -1
  465. package/web-components/card/definition.js +0 -2
  466. package/web-components/card/definition.js.map +0 -1
  467. package/web-components/carousel/component.d.ts.map +0 -1
  468. package/web-components/carousel/component.js +0 -3
  469. package/web-components/carousel/component.js.map +0 -1
  470. package/web-components/carousel/definition.d.ts.map +0 -1
  471. package/web-components/carousel/definition.js +0 -2
  472. package/web-components/carousel/definition.js.map +0 -1
  473. package/web-components/chip/component.d.ts.map +0 -1
  474. package/web-components/chip/component.js +0 -2
  475. package/web-components/chip/component.js.map +0 -1
  476. package/web-components/chip/definition.d.ts.map +0 -1
  477. package/web-components/chip/definition.js +0 -2
  478. package/web-components/chip/definition.js.map +0 -1
  479. package/web-components/details/component.d.ts.map +0 -1
  480. package/web-components/details/component.js +0 -2
  481. package/web-components/details/component.js.map +0 -1
  482. package/web-components/details/definition.d.ts.map +0 -1
  483. package/web-components/details/definition.js +0 -2
  484. package/web-components/details/definition.js.map +0 -1
  485. package/web-components/dialog/component.d.ts.map +0 -1
  486. package/web-components/dialog/component.js +0 -2
  487. package/web-components/dialog/component.js.map +0 -1
  488. package/web-components/dialog/definition.d.ts.map +0 -1
  489. package/web-components/dialog/definition.js +0 -2
  490. package/web-components/dialog/definition.js.map +0 -1
  491. package/web-components/divider/component.d.ts.map +0 -1
  492. package/web-components/divider/component.js +0 -2
  493. package/web-components/divider/component.js.map +0 -1
  494. package/web-components/divider/definition.d.ts.map +0 -1
  495. package/web-components/divider/definition.js +0 -2
  496. package/web-components/divider/definition.js.map +0 -1
  497. package/web-components/dragbox/component.d.ts.map +0 -1
  498. package/web-components/dragbox/component.js +0 -3
  499. package/web-components/dragbox/component.js.map +0 -1
  500. package/web-components/dragbox/definition.d.ts.map +0 -1
  501. package/web-components/dragbox/definition.js +0 -2
  502. package/web-components/dragbox/definition.js.map +0 -1
  503. package/web-components/flex/component.d.ts.map +0 -1
  504. package/web-components/flex/component.js +0 -3
  505. package/web-components/flex/component.js.map +0 -1
  506. package/web-components/flex/definition.d.ts.map +0 -1
  507. package/web-components/flex/definition.js +0 -2
  508. package/web-components/flex/definition.js.map +0 -1
  509. package/web-components/form/component.d.ts.map +0 -1
  510. package/web-components/form/component.js +0 -3
  511. package/web-components/form/component.js.map +0 -1
  512. package/web-components/form/definition.d.ts.map +0 -1
  513. package/web-components/form/definition.js +0 -2
  514. package/web-components/form/definition.js.map +0 -1
  515. package/web-components/grid/component.d.ts.map +0 -1
  516. package/web-components/grid/component.js +0 -3
  517. package/web-components/grid/component.js.map +0 -1
  518. package/web-components/grid/definition.d.ts.map +0 -1
  519. package/web-components/grid/definition.js +0 -2
  520. package/web-components/grid/definition.js.map +0 -1
  521. package/web-components/heading/component.d.ts.map +0 -1
  522. package/web-components/heading/component.js +0 -3
  523. package/web-components/heading/component.js.map +0 -1
  524. package/web-components/heading/definition.d.ts.map +0 -1
  525. package/web-components/heading/definition.js +0 -2
  526. package/web-components/heading/definition.js.map +0 -1
  527. package/web-components/input/component.d.ts.map +0 -1
  528. package/web-components/input/component.js +0 -2
  529. package/web-components/input/component.js.map +0 -1
  530. package/web-components/input/definition.d.ts.map +0 -1
  531. package/web-components/input/definition.js +0 -2
  532. package/web-components/input/definition.js.map +0 -1
  533. package/web-components/layout/component.d.ts.map +0 -1
  534. package/web-components/layout/component.js +0 -3
  535. package/web-components/layout/component.js.map +0 -1
  536. package/web-components/layout/definition.d.ts.map +0 -1
  537. package/web-components/layout/definition.js +0 -2
  538. package/web-components/layout/definition.js.map +0 -1
  539. package/web-components/link/component.d.ts.map +0 -1
  540. package/web-components/link/component.js +0 -3
  541. package/web-components/link/component.js.map +0 -1
  542. package/web-components/link/definition.d.ts.map +0 -1
  543. package/web-components/link/definition.js +0 -2
  544. package/web-components/link/definition.js.map +0 -1
  545. package/web-components/popover/component.d.ts.map +0 -1
  546. package/web-components/popover/component.js +0 -3
  547. package/web-components/popover/component.js.map +0 -1
  548. package/web-components/popover/definition.d.ts.map +0 -1
  549. package/web-components/popover/definition.js +0 -2
  550. package/web-components/popover/definition.js.map +0 -1
  551. package/web-components/progress/component.d.ts.map +0 -1
  552. package/web-components/progress/component.js +0 -2
  553. package/web-components/progress/component.js.map +0 -1
  554. package/web-components/progress/definition.d.ts.map +0 -1
  555. package/web-components/progress/definition.js +0 -2
  556. package/web-components/progress/definition.js.map +0 -1
  557. package/web-components/range/component.d.ts.map +0 -1
  558. package/web-components/range/component.js +0 -2
  559. package/web-components/range/component.js.map +0 -1
  560. package/web-components/range/definition.d.ts.map +0 -1
  561. package/web-components/range/definition.js +0 -2
  562. package/web-components/range/definition.js.map +0 -1
  563. package/web-components/rotate/component.d.ts.map +0 -1
  564. package/web-components/rotate/component.js +0 -2
  565. package/web-components/rotate/component.js.map +0 -1
  566. package/web-components/rotate/definition.d.ts.map +0 -1
  567. package/web-components/rotate/definition.js +0 -2
  568. package/web-components/rotate/definition.js.map +0 -1
  569. package/web-components/router/component.d.ts.map +0 -1
  570. package/web-components/router/component.js +0 -3
  571. package/web-components/router/component.js.map +0 -1
  572. package/web-components/router/definition.d.ts.map +0 -1
  573. package/web-components/router/definition.js +0 -2
  574. package/web-components/router/definition.js.map +0 -1
  575. package/web-components/select/component.d.ts.map +0 -1
  576. package/web-components/select/component.js +0 -3
  577. package/web-components/select/component.js.map +0 -1
  578. package/web-components/select/definition.d.ts.map +0 -1
  579. package/web-components/select/definition.js +0 -2
  580. package/web-components/select/definition.js.map +0 -1
  581. package/web-components/skeleton/component.js +0 -2
  582. package/web-components/skeleton/component.js.map +0 -1
  583. package/web-components/skeleton/definition.d.ts.map +0 -1
  584. package/web-components/skeleton/definition.js +0 -2
  585. package/web-components/skeleton/definition.js.map +0 -1
  586. package/web-components/split/component.d.ts.map +0 -1
  587. package/web-components/split/component.js +0 -2
  588. package/web-components/split/component.js.map +0 -1
  589. package/web-components/split/definition.d.ts.map +0 -1
  590. package/web-components/split/definition.js +0 -2
  591. package/web-components/split/definition.js.map +0 -1
  592. package/web-components/switch/component.js +0 -2
  593. package/web-components/switch/component.js.map +0 -1
  594. package/web-components/switch/definition.d.ts.map +0 -1
  595. package/web-components/switch/definition.js +0 -2
  596. package/web-components/switch/definition.js.map +0 -1
  597. package/web-components/tabs/component.d.ts.map +0 -1
  598. package/web-components/tabs/component.js +0 -2
  599. package/web-components/tabs/component.js.map +0 -1
  600. package/web-components/tabs/definition.d.ts.map +0 -1
  601. package/web-components/tabs/definition.js +0 -2
  602. package/web-components/tabs/definition.js.map +0 -1
  603. package/web-components/text/component.d.ts.map +0 -1
  604. package/web-components/text/component.js +0 -2
  605. package/web-components/text/component.js.map +0 -1
  606. package/web-components/text/definition.d.ts.map +0 -1
  607. package/web-components/text/definition.js +0 -2
  608. package/web-components/text/definition.js.map +0 -1
  609. package/web-components/time/component.d.ts.map +0 -1
  610. package/web-components/time/component.js +0 -2
  611. package/web-components/time/component.js.map +0 -1
  612. package/web-components/time/definition.d.ts.map +0 -1
  613. package/web-components/time/definition.js +0 -2
  614. package/web-components/time/definition.js.map +0 -1
  615. package/web-components/tooltip/component.d.ts.map +0 -1
  616. package/web-components/tooltip/component.js +0 -2
  617. package/web-components/tooltip/component.js.map +0 -1
  618. package/web-components/tooltip/definition.d.ts.map +0 -1
  619. package/web-components/tooltip/definition.js +0 -2
  620. package/web-components/tooltip/definition.js.map +0 -1
  621. package/web-components/typewriter/component.d.ts.map +0 -1
  622. package/web-components/typewriter/component.js +0 -2
  623. package/web-components/typewriter/component.js.map +0 -1
  624. package/web-components/typewriter/definition.d.ts.map +0 -1
  625. package/web-components/typewriter/definition.js +0 -2
  626. package/web-components/typewriter/definition.js.map +0 -1
  627. /package/{alert.d.ts → build/alert.d.ts} +0 -0
  628. /package/{alert.js.map → build/alert.js.map} +0 -0
  629. /package/{avatar.d.ts → build/avatar.d.ts} +0 -0
  630. /package/{avatar.js.map → build/avatar.js.map} +0 -0
  631. /package/{badge.d.ts → build/badge.d.ts} +0 -0
  632. /package/{badge.js.map → build/badge.js.map} +0 -0
  633. /package/{breath.d.ts → build/breath.d.ts} +0 -0
  634. /package/{breath.js.map → build/breath.js.map} +0 -0
  635. /package/{button.d.ts → build/button.d.ts} +0 -0
  636. /package/{button.js.map → build/button.js.map} +0 -0
  637. /package/{card.d.ts → build/card.d.ts} +0 -0
  638. /package/{card.js.map → build/card.js.map} +0 -0
  639. /package/{carousel.d.ts → build/carousel.d.ts} +0 -0
  640. /package/{carousel.js.map → build/carousel.js.map} +0 -0
  641. /package/{chip.d.ts → build/chip.d.ts} +0 -0
  642. /package/{chip.js.map → build/chip.js.map} +0 -0
  643. /package/{details.d.ts → build/details.d.ts} +0 -0
  644. /package/{details.js.map → build/details.js.map} +0 -0
  645. /package/{dialog.d.ts → build/dialog.d.ts} +0 -0
  646. /package/{dialog.js.map → build/dialog.js.map} +0 -0
  647. /package/{divider.d.ts → build/divider.d.ts} +0 -0
  648. /package/{divider.js.map → build/divider.js.map} +0 -0
  649. /package/{dragbox.d.ts → build/dragbox.d.ts} +0 -0
  650. /package/{dragbox.js.map → build/dragbox.js.map} +0 -0
  651. /package/{flex.d.ts → build/flex.d.ts} +0 -0
  652. /package/{flex.js.map → build/flex.js.map} +0 -0
  653. /package/{form.d.ts → build/form.d.ts} +0 -0
  654. /package/{form.js.map → build/form.js.map} +0 -0
  655. /package/{grid.d.ts → build/grid.d.ts} +0 -0
  656. /package/{grid.js.map → build/grid.js.map} +0 -0
  657. /package/{heading.d.ts → build/heading.d.ts} +0 -0
  658. /package/{heading.js.map → build/heading.js.map} +0 -0
  659. /package/{index.d.ts → build/index.d.ts} +0 -0
  660. /package/{index.js.map → build/index.js.map} +0 -0
  661. /package/{input.d.ts → build/input.d.ts} +0 -0
  662. /package/{input.js.map → build/input.js.map} +0 -0
  663. /package/{internal → build/internal}/icons/caret-down.d.ts +0 -0
  664. /package/{internal → build/internal}/icons/caret-down.js +0 -0
  665. /package/{internal → build/internal}/icons/caret-left.d.ts +0 -0
  666. /package/{internal → build/internal}/icons/caret-left.js +0 -0
  667. /package/{internal → build/internal}/icons/caret-right.d.ts +0 -0
  668. /package/{internal → build/internal}/icons/caret-right.js +0 -0
  669. /package/{internal → build/internal}/icons/eye-slash.d.ts +0 -0
  670. /package/{internal → build/internal}/icons/eye-slash.js +0 -0
  671. /package/{internal → build/internal}/popover.d.ts +0 -0
  672. /package/{internal → build/internal}/reset-style.d.ts +0 -0
  673. /package/{internal → build/internal}/reset-style.js +0 -0
  674. /package/{internal → build/internal}/ring.d.ts +0 -0
  675. /package/{internal → build/internal}/super-input.d.ts +0 -0
  676. /package/{internal → build/internal}/utils.d.ts +0 -0
  677. /package/{layout.d.ts → build/layout.d.ts} +0 -0
  678. /package/{layout.js.map → build/layout.js.map} +0 -0
  679. /package/{link.d.ts → build/link.d.ts} +0 -0
  680. /package/{link.js.map → build/link.js.map} +0 -0
  681. /package/{popover.d.ts → build/popover.d.ts} +0 -0
  682. /package/{popover.js.map → build/popover.js.map} +0 -0
  683. /package/{progress.d.ts → build/progress.d.ts} +0 -0
  684. /package/{progress.js.map → build/progress.js.map} +0 -0
  685. /package/{range.d.ts → build/range.d.ts} +0 -0
  686. /package/{range.js.map → build/range.js.map} +0 -0
  687. /package/{rotate.d.ts → build/rotate.d.ts} +0 -0
  688. /package/{rotate.js.map → build/rotate.js.map} +0 -0
  689. /package/{router.d.ts → build/router.d.ts} +0 -0
  690. /package/{router.js.map → build/router.js.map} +0 -0
  691. /package/{select.d.ts → build/select.d.ts} +0 -0
  692. /package/{select.js.map → build/select.js.map} +0 -0
  693. /package/{skeleton.d.ts → build/skeleton.d.ts} +0 -0
  694. /package/{skeleton.js.map → build/skeleton.js.map} +0 -0
  695. /package/{split.d.ts → build/split.d.ts} +0 -0
  696. /package/{split.js.map → build/split.js.map} +0 -0
  697. /package/{switch.d.ts → build/switch.d.ts} +0 -0
  698. /package/{switch.js.map → build/switch.js.map} +0 -0
  699. /package/{tabs.d.ts → build/tabs.d.ts} +0 -0
  700. /package/{tabs.js.map → build/tabs.js.map} +0 -0
  701. /package/{text.d.ts → build/text.d.ts} +0 -0
  702. /package/{text.js.map → build/text.js.map} +0 -0
  703. /package/{time.d.ts → build/time.d.ts} +0 -0
  704. /package/{time.js.map → build/time.js.map} +0 -0
  705. /package/{tooltip.d.ts → build/tooltip.d.ts} +0 -0
  706. /package/{tooltip.js.map → build/tooltip.js.map} +0 -0
  707. /package/{typewriter.d.ts → build/typewriter.d.ts} +0 -0
  708. /package/{typewriter.js.map → build/typewriter.js.map} +0 -0
  709. /package/{web-components → build/web-components}/alert/component.d.ts +0 -0
  710. /package/{web-components → build/web-components}/alert/definition.d.ts +0 -0
  711. /package/{web-components → build/web-components}/avatar/component.d.ts +0 -0
  712. /package/{web-components → build/web-components}/avatar/definition.d.ts +0 -0
  713. /package/{web-components → build/web-components}/badge/component.d.ts +0 -0
  714. /package/{web-components → build/web-components}/badge/definition.d.ts +0 -0
  715. /package/{web-components → build/web-components}/breath/definition.d.ts +0 -0
  716. /package/{web-components → build/web-components}/button/component.d.ts +0 -0
  717. /package/{web-components → build/web-components}/button/definition.d.ts +0 -0
  718. /package/{web-components → build/web-components}/card/component.d.ts +0 -0
  719. /package/{web-components → build/web-components}/card/definition.d.ts +0 -0
  720. /package/{web-components → build/web-components}/carousel/component.d.ts +0 -0
  721. /package/{web-components → build/web-components}/carousel/definition.d.ts +0 -0
  722. /package/{web-components → build/web-components}/chip/component.d.ts +0 -0
  723. /package/{web-components → build/web-components}/chip/definition.d.ts +0 -0
  724. /package/{web-components → build/web-components}/details/component.d.ts +0 -0
  725. /package/{web-components → build/web-components}/details/definition.d.ts +0 -0
  726. /package/{web-components → build/web-components}/dialog/component.d.ts +0 -0
  727. /package/{web-components → build/web-components}/dialog/definition.d.ts +0 -0
  728. /package/{web-components → build/web-components}/divider/component.d.ts +0 -0
  729. /package/{web-components → build/web-components}/divider/definition.d.ts +0 -0
  730. /package/{web-components → build/web-components}/dragbox/component.d.ts +0 -0
  731. /package/{web-components → build/web-components}/dragbox/definition.d.ts +0 -0
  732. /package/{web-components → build/web-components}/flex/definition.d.ts +0 -0
  733. /package/{web-components → build/web-components}/form/component.d.ts +0 -0
  734. /package/{web-components → build/web-components}/form/definition.d.ts +0 -0
  735. /package/{web-components → build/web-components}/grid/definition.d.ts +0 -0
  736. /package/{web-components → build/web-components}/heading/component.d.ts +0 -0
  737. /package/{web-components → build/web-components}/heading/definition.d.ts +0 -0
  738. /package/{web-components → build/web-components}/input/component.d.ts +0 -0
  739. /package/{web-components → build/web-components}/input/definition.d.ts +0 -0
  740. /package/{web-components → build/web-components}/layout/component.d.ts +0 -0
  741. /package/{web-components → build/web-components}/layout/definition.d.ts +0 -0
  742. /package/{web-components → build/web-components}/link/component.d.ts +0 -0
  743. /package/{web-components → build/web-components}/link/definition.d.ts +0 -0
  744. /package/{web-components → build/web-components}/popover/component.d.ts +0 -0
  745. /package/{web-components → build/web-components}/popover/definition.d.ts +0 -0
  746. /package/{web-components → build/web-components}/progress/component.d.ts +0 -0
  747. /package/{web-components → build/web-components}/progress/definition.d.ts +0 -0
  748. /package/{web-components → build/web-components}/range/definition.d.ts +0 -0
  749. /package/{web-components → build/web-components}/rotate/component.d.ts +0 -0
  750. /package/{web-components → build/web-components}/rotate/definition.d.ts +0 -0
  751. /package/{web-components → build/web-components}/router/definition.d.ts +0 -0
  752. /package/{web-components → build/web-components}/select/component.d.ts +0 -0
  753. /package/{web-components → build/web-components}/select/definition.d.ts +0 -0
  754. /package/{web-components → build/web-components}/skeleton/component.d.ts +0 -0
  755. /package/{web-components → build/web-components}/skeleton/definition.d.ts +0 -0
  756. /package/{web-components → build/web-components}/split/component.d.ts +0 -0
  757. /package/{web-components → build/web-components}/split/definition.d.ts +0 -0
  758. /package/{web-components → build/web-components}/switch/component.d.ts +0 -0
  759. /package/{web-components → build/web-components}/switch/definition.d.ts +0 -0
  760. /package/{web-components → build/web-components}/tabs/component.d.ts +0 -0
  761. /package/{web-components → build/web-components}/tabs/definition.d.ts +0 -0
  762. /package/{web-components → build/web-components}/text/component.d.ts +0 -0
  763. /package/{web-components → build/web-components}/text/definition.d.ts +0 -0
  764. /package/{web-components → build/web-components}/time/component.d.ts +0 -0
  765. /package/{web-components → build/web-components}/time/definition.d.ts +0 -0
  766. /package/{web-components → build/web-components}/tooltip/component.d.ts +0 -0
  767. /package/{web-components → build/web-components}/tooltip/definition.d.ts +0 -0
  768. /package/{web-components → build/web-components}/typewriter/definition.d.ts +0 -0
@@ -0,0 +1,3 @@
1
+ import{godown,styles,StyleController,attr,htmlSlot}from"@godown/element";import{css,html}from"lit";import{property}from"lit/decorators.js";import{isNumerical}from"sharekit";import{GlobalStyle}from"../../internal/global-style.js";import _decorate from"@oxc-project/runtime/helpers/decorate";import"../../internal/reset-style.js";const toTemplate=e=>isNumerical(e)?`repeat(${e},1fr)`:e,protoName=`grid`;let Grid=class e extends GlobalStyle{constructor(){super(),new StyleController(this,()=>({":host":{gap:this.gap,"grid-template-columns":toTemplate(this.columns),"grid-template-rows":toTemplate(this.rows),"place-content":this.content,"place-items":this.items}}),()=>[this.gap,this.columns,this.rows,this.content,this.items])}render(){return html`<div part="root" ${attr(this.observedRecord)}> ${htmlSlot()} </div>`}};_decorate([property()],Grid.prototype,`gap`,void 0),_decorate([property()],Grid.prototype,`columns`,void 0),_decorate([property()],Grid.prototype,`rows`,void 0),_decorate([property()],Grid.prototype,`content`,void 0),_decorate([property()],Grid.prototype,`items`,void 0),Grid=_decorate([godown(protoName),styles(css`:host,:host([contents]) [part=root]{display:grid}[part=root]{display:contents}
2
+ `)],Grid);var Grid$1=Grid;export{Grid,Grid$1 as default};
3
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sources":["../../../src/web-components/grid/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, StyleController, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { isNumerical } from \"sharekit\";\n\nimport { GlobalStyle } from \"../../internal/global-style.js\";\n\nconst toTemplate = (s: number | string) => (isNumerical(s) ? `repeat(${s},1fr)` : s);\n\nconst protoName = \"grid\";\n\n/**\n * {@linkcode Grid} provides gird layout.\n *\n * @slot - Grid items.\n * @category layout\n */\n@godown(protoName)\n@styles(css`\n :host,\n :host([contents]) [part=\"root\"] {\n display: grid;\n }\n\n [part=\"root\"] {\n display: contents;\n }\n`)\nclass Grid extends GlobalStyle {\n /**\n * CSS property `gap`.\n */\n @property()\n gap: string;\n\n /**\n * CSS property `grid-template-columns`.\n *\n * If columns is numerical, divide columns equally.\n */\n @property()\n columns: string | number;\n\n /**\n * CSS property `grid-template-rows`.\n *\n * If rows is numerical, divide rows equally.\n */\n @property()\n rows: string | number;\n\n /**\n * CSS property `place-content` (`align-content justify-content`).\n */\n @property()\n content: string;\n\n /**\n * CSS property `place-items` (`align-items justify-items`).\n */\n @property()\n items: string;\n\n constructor() {\n super();\n new StyleController(\n this,\n () => ({\n \":host\": {\n gap: this.gap,\n \"grid-template-columns\": toTemplate(this.columns),\n \"grid-template-rows\": toTemplate(this.rows),\n \"place-content\": this.content,\n \"place-items\": this.items,\n },\n }),\n () => [this.gap, this.columns, this.rows, this.content, this.items],\n );\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${htmlSlot()}\n </div>\n `;\n }\n}\n\nexport default Grid;\nexport { Grid };\n"],"names":["s: number | string","s","Grid"],"mappings":"wUAOA,MAAM,WAAa,AAACA,GAAwB,YAAYC,EAAE,CAAG,CAAC,OAAO,EAAEA,EAAE,KAAK,CAAC,CAAGA,EAE5E,UAAY,OAQlB,IAAA,KAAA,MAWMC,UAAa,WAAY,CAmC7B,aAAc,CACZ,OAAO,CACP,IAAI,gBACF,KACA,KAAO,CACL,QAAS,CACP,IAAK,KAAK,IACV,wBAAyB,WAAW,KAAK,QAAQ,CACjD,qBAAsB,WAAW,KAAK,KAAK,CAC3C,gBAAiB,KAAK,QACtB,cAAe,KAAK,KACrB,IAEH,IAAM,CAAC,KAAK,IAAK,KAAK,QAAS,KAAK,KAAM,KAAK,QAAS,KAAK,KAAM,EAEtE,CAES,QAA4B,CACpC,MAAO,KAAI,CAAA,iBAGP,EAAE,KAAK,KAAK,eAAe,CAAA,EAE3B,EAAE,UAAU,CAAA,OAEhB,CAAC,AACF,CACF,aA1DE,UAAU,AAAA,EAAA,KAAA,UAAA,MAAA,OAAA,YAQV,UAAU,AAAA,EAAA,KAAA,UAAA,UAAA,OAAA,YAQV,UAAU,AAAA,EAAA,KAAA,UAAA,OAAA,OAAA,YAMV,UAAU,AAAA,EAAA,KAAA,UAAA,UAAA,OAAA,YAMV,UAAU,AAAA,EAAA,KAAA,UAAA,QAAA,OAAA,CA3CZ,KAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC;AASZ,CAAC,CAAC,AAAA,EAAA,KAAA,CAiEF,IAAA,OAAe"}
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,OAAO,UAAU,gBAAiB;AAIlC,eAAe;eAEA;WACH,sBAAsB;EAC9B,eAAe;CAChB;AACF","names":[],"sources":["../../../../src/web-components/grid/definition.ts"],"sourcesContent":["import Grid from \"./component.js\";\n\nGrid.define();\n\nexport default Grid;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-grid\": Grid;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
@@ -0,0 +1,2 @@
1
+ import Grid from"./component.js";import"@godown/element";import"lit";import"lit/decorators.js";import"sharekit";import"../../internal/global-style.js";import"../../internal/reset-style.js";import"@oxc-project/runtime/helpers/decorate";Grid.define();export{Grid as default};
2
+ //# sourceMappingURL=definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.js","sources":["../../../src/web-components/grid/definition.ts"],"sourcesContent":["import Grid from \"./component.js\";\n\nGrid.define();\n\nexport default Grid;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-grid\": Grid;\n }\n}\n"],"names":[],"mappings":"2OAEA,KAAK,QAAQ"}
@@ -0,0 +1 @@
1
+ {"mappings":"AACA,cAAc,sBAA0C,KAAM;AAG9D,OAAO,UAAU,sBAAuB;;;;;;;;;AAYxC,cAgCM,gBAAgB,KAAK;;;;CAIzB,AACA,IAAI,OAAO,OAAO,OAAO,OAAO,OAAO;;;;;;CAOvC,AACA;;;;CAKA,AACA,MAAM,SAAS;CAEf,UAAU,UAAU,eAAe;CAmBnC,UAAU,YAAY,GAAG,kBAAkB,eAAe;AA4B3D;AAED,eAAe;AACf,SAAS","names":[],"sources":["../../../../src/web-components/heading/component.ts"],"sourcesContent":["import { godown, htmlSlot, styles, tokenList } from \"@godown/element\";\nimport { type TemplateResult, css, html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport Link from \"../link/component.js\";\n\nconst protoName = \"heading\";\n\n/**\n * {@linkcode Heading} renders a heading.\n *\n * If the id is provided, the anchor will be displayed.\n *\n * @slot - Heading content.\n * @category layout\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n text-align: start;\n }\n\n [part~=\"anchor\"] {\n position: absolute;\n text-align: center;\n min-width: 1.25em;\n right: 100%;\n }\n\n [part~=\"left\"][part~=\"anchor\"] {\n right: 100%;\n }\n\n [part~=\"right\"][part~=\"anchor\"] {\n left: 100%;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n width: fit-content;\n position: relative;\n }\n`)\nclass Heading extends Link {\n /**\n * The heading level.\n */\n @property()\n as: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" = \"h1\";\n\n /**\n * The anchor prefix.\n *\n * Element must have an id to be displayed.\n */\n @property()\n anchor = \"#\";\n\n /**\n * The anchor side.\n */\n @property()\n side: \"left\" | \"right\" = \"left\";\n\n protected render(): TemplateResult<1> {\n const hrefValue = this.href || (this.id ? \"#\" + this.id : undefined);\n return html`\n <a\n part=\"root\"\n href=\"${hrefValue || nothing}\"\n >\n ${this.wrapHeading(\n htmlSlot(),\n hrefValue\n ? html`\n <i part=\"${tokenList(\"anchor\", this.side)}\">${this.anchor}</i>\n `\n : \"\",\n )}\n </a>\n `;\n }\n\n protected wrapHeading(...children: any[]): TemplateResult<1> {\n switch (this.as) {\n case \"h2\":\n return html`\n <h2>${children}</h2>\n `;\n case \"h3\":\n return html`\n <h3>${children}</h3>\n `;\n case \"h4\":\n return html`\n <h4>${children}</h4>\n `;\n case \"h5\":\n return html`\n <h5>${children}</h5>\n `;\n case \"h6\":\n return html`\n <h6>${children}</h6>\n `;\n default:\n return html`\n <h1>${children}</h1>\n `;\n }\n }\n}\n\nexport default Heading;\nexport { Heading };\n"],"version":3,"file":"component.d.ts"}
@@ -0,0 +1,3 @@
1
+ import{godown,styles,htmlSlot,tokenList}from"@godown/element";import{css,nothing,html}from"lit";import{property}from"lit/decorators.js";import Link from"../link/component.js";import _decorate from"@oxc-project/runtime/helpers/decorate";import"../router/component.js";import"sharekit";import"../../internal/global-style.js";import"../../internal/reset-style.js";const protoName=`heading`;let Heading=class e extends Link{constructor(...e){super(...e),this.as=`h1`,this.anchor=`#`,this.side=`left`}render(){let e=this.href||(this.id?`#`+this.id:void 0);return html`<a part="root" href="${e||nothing}"> ${this.wrapHeading(htmlSlot(),e?html`<i part="${tokenList(`anchor`,this.side)}">${this.anchor}</i>`:``)} </a>`}wrapHeading(...e){switch(this.as){case`h2`:return html`<h2>${e}</h2>`;case`h3`:return html`<h3>${e}</h3>`;case`h4`:return html`<h4>${e}</h4>`;case`h5`:return html`<h5>${e}</h5>`;case`h6`:return html`<h6>${e}</h6>`;default:return html`<h1>${e}</h1>`}}};_decorate([property()],Heading.prototype,`as`,void 0),_decorate([property()],Heading.prototype,`anchor`,void 0),_decorate([property()],Heading.prototype,`side`,void 0),Heading=_decorate([godown(protoName),styles(css`:host{display:block;text-align:start}[part~=anchor]{position:absolute;text-align:center;min-width:1.25em;right:100%}[part~=left][part~=anchor]{right:100%}[part~=right][part~=anchor]{left:100%}h1,h2,h3,h4,h5,h6{width:-moz-fit-content;width:fit-content;position:relative}
2
+ `)],Heading);var Heading$1=Heading;export{Heading,Heading$1 as default};
3
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sources":["../../../src/web-components/heading/component.ts"],"sourcesContent":["import { godown, htmlSlot, styles, tokenList } from \"@godown/element\";\nimport { type TemplateResult, css, html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport Link from \"../link/component.js\";\n\nconst protoName = \"heading\";\n\n/**\n * {@linkcode Heading} renders a heading.\n *\n * If the id is provided, the anchor will be displayed.\n *\n * @slot - Heading content.\n * @category layout\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n text-align: start;\n }\n\n [part~=\"anchor\"] {\n position: absolute;\n text-align: center;\n min-width: 1.25em;\n right: 100%;\n }\n\n [part~=\"left\"][part~=\"anchor\"] {\n right: 100%;\n }\n\n [part~=\"right\"][part~=\"anchor\"] {\n left: 100%;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n width: fit-content;\n position: relative;\n }\n`)\nclass Heading extends Link {\n /**\n * The heading level.\n */\n @property()\n as: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" = \"h1\";\n\n /**\n * The anchor prefix.\n *\n * Element must have an id to be displayed.\n */\n @property()\n anchor = \"#\";\n\n /**\n * The anchor side.\n */\n @property()\n side: \"left\" | \"right\" = \"left\";\n\n protected render(): TemplateResult<1> {\n const hrefValue = this.href || (this.id ? \"#\" + this.id : undefined);\n return html`\n <a\n part=\"root\"\n href=\"${hrefValue || nothing}\"\n >\n ${this.wrapHeading(\n htmlSlot(),\n hrefValue\n ? html`\n <i part=\"${tokenList(\"anchor\", this.side)}\">${this.anchor}</i>\n `\n : \"\",\n )}\n </a>\n `;\n }\n\n protected wrapHeading(...children: any[]): TemplateResult<1> {\n switch (this.as) {\n case \"h2\":\n return html`\n <h2>${children}</h2>\n `;\n case \"h3\":\n return html`\n <h3>${children}</h3>\n `;\n case \"h4\":\n return html`\n <h4>${children}</h4>\n `;\n case \"h5\":\n return html`\n <h5>${children}</h5>\n `;\n case \"h6\":\n return html`\n <h6>${children}</h6>\n `;\n default:\n return html`\n <h1>${children}</h1>\n `;\n }\n }\n}\n\nexport default Heading;\nexport { Heading };\n"],"names":["Heading","hrefValue","children"],"mappings":"yWAMA,MAAM,UAAY,UAUlB,IAAA,QAAA,MAgCMA,UAAgB,IAAK,oCAKzB,GAA8C,UAQ9C,OAAS,SAMT,KAAyB,OAEf,QAA4B,CACpC,IAAMC,EAAY,KAAK,OAAS,KAAK,GAAK,IAAM,KAAK,GAAK,QAC1D,MAAO,KAAI,CAAA,qBAGD,EAAEA,GAAa,QAAQ,GAE7B,EAAE,KAAK,YACL,UAAU,CACVA,EACI,IAAI,CAAA,SACO,EAAE,UAAU,SAAU,KAAK,KAAK,CAAC,EAAE,EAAE,KAAK,OAAO,IAC5D,CAAC,CACD,GACL,CAAA,KAEL,CAAC,AACF,CAED,YAAsB,GAAGC,EAAoC,CAC3D,OAAQ,KAAK,GAAb,CACE,IAAK,KACH,MAAO,KAAI,CAAA,IACL,EAAEA,EAAS,KACjB,CAAC,CACH,IAAK,KACH,MAAO,KAAI,CAAA,IACL,EAAEA,EAAS,KACjB,CAAC,CACH,IAAK,KACH,MAAO,KAAI,CAAA,IACL,EAAEA,EAAS,KACjB,CAAC,CACH,IAAK,KACH,MAAO,KAAI,CAAA,IACL,EAAEA,EAAS,KACjB,CAAC,CACH,IAAK,KACH,MAAO,KAAI,CAAA,IACL,EAAEA,EAAS,KACjB,CAAC,CACH,QACE,MAAO,KAAI,CAAA,IACL,EAAEA,EAAS,KACjB,CAAC,AACJ,CACF,CACF,aAhEE,UAAU,AAAA,EAAA,QAAA,UAAA,KAAA,OAAA,YAQV,UAAU,AAAA,EAAA,QAAA,UAAA,SAAA,OAAA,YAMV,UAAU,AAAA,EAAA,QAAA,UAAA,OAAA,OAAA,CAlDZ,QAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC;AA8BZ,CAAC,CAAC,AAAA,EAAA,QAAA,CAuEF,IAAA,UAAe"}
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,OAAO,aAAa,gBAAiB;AAIrC,eAAe;eAEA;WACH,sBAAsB;EAC9B,kBAAkB;CACnB;AACF","names":[],"sources":["../../../../src/web-components/heading/definition.ts"],"sourcesContent":["import Heading from \"./component.js\";\n\nHeading.define();\n\nexport default Heading;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-heading\": Heading;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
@@ -0,0 +1,2 @@
1
+ import Heading from"./component.js";import"@godown/element";import"lit";import"lit/decorators.js";import"../link/component.js";import"../router/component.js";import"sharekit";import"../../internal/global-style.js";import"../../internal/reset-style.js";import"@oxc-project/runtime/helpers/decorate";Heading.define();export{Heading as default};
2
+ //# sourceMappingURL=definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.js","sources":["../../../src/web-components/heading/definition.ts"],"sourcesContent":["import Heading from \"./component.js\";\n\nHeading.define();\n\nexport default Heading;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-heading\": Heading;\n }\n}\n"],"names":[],"mappings":"0SAEA,QAAQ,QAAQ"}
@@ -0,0 +1 @@
1
+ {"mappings":"AAEA,cAAc,sBAA0C,KAAM;AAI9D,SAAS,kBAAkB,+BAAgC;KAGtD,YACD,SACA,WACA,QACA,QACA,UACA,aACA,aACA,SACA,UACA,SACA,SACA,mBACA,WACA,UACA,UACA,SACA;;;;;;;;AAWJ,cA6CM,cAAc,WAAW;CAC7B,AACA,MAAM;CAEN;;;;CAKA,AACA,SAAS,YAAY;CAErB,UACU,QAAQ;CAElB;CAUA,UAAU,UAAU,eAAe;CA4BnC,UAAU,iBAAiB,eAAe;CAiB1C,UAAU,iBAAiBA,UAAU,KAAK;AAK3C;AAED,eAAe;AACf,SAAS","names":["t: typeof this.type"],"sources":["../../../../src/web-components/input/component.ts"],"sourcesContent":["import { attr, godown, styles, StyleController, htmlSlot } from \"@godown/element\";\nimport iconEyeSlash from \"../../internal/icons/eye-slash.js\";\nimport { type TemplateResult, css, html, nothing } from \"lit\";\nimport { property, query } from \"lit/decorators.js\";\n\nimport { cssGlobalVars } from \"../../internal/global-style.js\";\nimport { SuperInput } from \"../../internal/super-input.js\";\nimport { RingBuilder } from \"../../internal/ring.js\";\n\ntype InputType =\n | \"text\"\n | \"search\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"password\"\n | \"datetime\"\n | \"date\"\n | \"month\"\n | \"week\"\n | \"time\"\n | \"datetime-local\"\n | \"number\"\n | \"range\"\n | \"color\"\n | \"file\"\n | \"image\";\n\nconst protoName = \"input\";\n\n/**\n * {@linkcode Input} renders a input.\n *\n * @fires input - Fires when the input value changes.\n * @fires change - Fires when the input value changes.\n * @category input\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n ${cssGlobalVars.input}-icon-color: hsl(0, 0%, 50%);\n }\n\n :host(:focus-within),\n :host(:active) {\n ${cssGlobalVars.ringColor}: currentColor;\n ${cssGlobalVars.input}-icon-color: currentColor;\n }\n\n [part=\"root\"] {\n padding-inline: 0.75em;\n padding-block: 0.5em;\n display: flex;\n position: relative;\n align-items: center;\n border-radius: inherit;\n }\n\n [part=\"input\"] {\n width: 100%;\n height: 100%;\n flex-grow: 1;\n }\n\n [part=\"prefix\"],\n [part=\"suffix\"] {\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(${cssGlobalVars.input}-icon-color);\n }\n\n [part=\"suffix\"] slot svg {\n margin-inline-start: 0.25em;\n }\n\n [part=\"prefix\"] slot svg {\n margin-inline-end: 0.25em;\n }\n`)\nclass Input extends SuperInput {\n @property({ reflect: true })\n type: InputType = \"text\";\n\n value: string;\n\n /**\n * If outline, the outline is always present.\n */\n @property()\n variant: \"default\" | \"outline\" = \"default\";\n\n @query(\"[part=input]\")\n protected _input: HTMLInputElement;\n\n constructor() {\n super();\n new StyleController(\n this,\n () =>\n new RingBuilder({ type: this.ringType }).css +\n (this.variant === \"outline\" ? `:host{${cssGlobalVars.ringColor}:currentColor}` : \"\"),\n );\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <label\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${[\n this._renderPrefix(),\n html`\n <input\n part=\"input\"\n type=\"${this.type}\"\n .value=\"${this.value}\"\n ?autofocus=\"${this.autofocus}\"\n ?disabled=\"${this.disabled}\"\n autocapitalize=\"${this.autocapitalize || nothing}\"\n autocomplete=\"${this.autocomplete || nothing}\"\n placeholder=\"${this.placeholder || nothing}\"\n @input=\"${this._handleInput}\"\n @change=\"${this._handleChange}\"\n />\n `,\n this._renderSuffix(),\n ]}\n </label>\n `;\n }\n\n protected _renderSuffix(): TemplateResult<1> {\n const PASSWORD = \"password\";\n if (this.type === PASSWORD) {\n return html`\n <i\n part=\"suffix\"\n @mousedown=\"${() => this._changeInputType(\"text\")}\"\n @mouseup=\"${() => this._changeInputType(PASSWORD)}\"\n @mouseleave=\"${() => this._changeInputType(PASSWORD)}\"\n >\n ${htmlSlot(\"suffix\", iconEyeSlash())}\n </i>\n `;\n }\n return super._renderSuffix();\n }\n\n protected _changeInputType(t: typeof this.type): void {\n if (this._input) {\n this._input.type = t;\n }\n }\n}\n\nexport default Input;\nexport { Input };\n"],"version":3,"file":"component.d.ts"}
@@ -0,0 +1,2 @@
1
+ import{godown,styles,StyleController,attr,htmlSlot}from"@godown/element";import _default from"../../internal/icons/eye-slash.js";import{css,nothing,html}from"lit";import{property,query}from"lit/decorators.js";import{cssGlobalVars}from"../../internal/global-style.js";import{SuperInput}from"../../internal/super-input.js";import{RingBuilder}from"../../internal/ring.js";import _decorate from"@oxc-project/runtime/helpers/decorate";import"../../internal/reset-style.js";import"sharekit";const protoName=`input`;let Input=class e extends SuperInput{constructor(){super(),this.type=`text`,this.variant=`default`,new StyleController(this,()=>new RingBuilder({type:this.ringType}).css+(this.variant===`outline`?`:host{${cssGlobalVars.ringColor}:currentColor}`:``))}render(){return html`<label part="root" ${attr(this.observedRecord)}> ${[this._renderPrefix(),html`<input part="input" type="${this.type}" .value="${this.value}" ?autofocus="${this.autofocus}" ?disabled="${this.disabled}" autocapitalize="${this.autocapitalize||nothing}" autocomplete="${this.autocomplete||nothing}" placeholder="${this.placeholder||nothing}" @input="${this._handleInput}" @change="${this._handleChange}"/>`,this._renderSuffix()]} </label>`}_renderSuffix(){let e=`password`;return this.type===e?html`<i part="suffix" @mousedown="${()=>this._changeInputType(`text`)}" @mouseup="${()=>this._changeInputType(e)}" @mouseleave="${()=>this._changeInputType(e)}"> ${htmlSlot(`suffix`,_default())} </i>`:super._renderSuffix()}_changeInputType(e){this._input&&(this._input.type=e)}};_decorate([property({reflect:!0})],Input.prototype,`type`,void 0),_decorate([property()],Input.prototype,`variant`,void 0),_decorate([query(`[part=input]`)],Input.prototype,`_input`,void 0),Input=_decorate([godown(protoName),styles(css`:host{display:block;${cssGlobalVars.input}-icon-color:gray}:host(:focus-within),:host(:active){${cssGlobalVars.ringColor}:currentColor;${cssGlobalVars.input}-icon-color:currentColor}[part=root]{padding-inline:.75em;padding-block:.5em;display:flex;position:relative;align-items:center;border-radius:inherit}[part=input]{width:100%;height:100%;flex-grow:1}[part=prefix],[part=suffix]{height:100%;display:flex;align-items:center;justify-content:center;color:var(${cssGlobalVars.input}-icon-color)}[part=suffix] slot svg{margin-inline-start:.25em}[part=prefix] slot svg{margin-inline-end:.25em}`)],Input);var Input$1=Input;export{Input,Input$1 as default};
2
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sources":["../../../src/web-components/input/component.ts"],"sourcesContent":["import { attr, godown, styles, StyleController, htmlSlot } from \"@godown/element\";\nimport iconEyeSlash from \"../../internal/icons/eye-slash.js\";\nimport { type TemplateResult, css, html, nothing } from \"lit\";\nimport { property, query } from \"lit/decorators.js\";\n\nimport { cssGlobalVars } from \"../../internal/global-style.js\";\nimport { SuperInput } from \"../../internal/super-input.js\";\nimport { RingBuilder } from \"../../internal/ring.js\";\n\ntype InputType =\n | \"text\"\n | \"search\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"password\"\n | \"datetime\"\n | \"date\"\n | \"month\"\n | \"week\"\n | \"time\"\n | \"datetime-local\"\n | \"number\"\n | \"range\"\n | \"color\"\n | \"file\"\n | \"image\";\n\nconst protoName = \"input\";\n\n/**\n * {@linkcode Input} renders a input.\n *\n * @fires input - Fires when the input value changes.\n * @fires change - Fires when the input value changes.\n * @category input\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n ${cssGlobalVars.input}-icon-color: hsl(0, 0%, 50%);\n }\n\n :host(:focus-within),\n :host(:active) {\n ${cssGlobalVars.ringColor}: currentColor;\n ${cssGlobalVars.input}-icon-color: currentColor;\n }\n\n [part=\"root\"] {\n padding-inline: 0.75em;\n padding-block: 0.5em;\n display: flex;\n position: relative;\n align-items: center;\n border-radius: inherit;\n }\n\n [part=\"input\"] {\n width: 100%;\n height: 100%;\n flex-grow: 1;\n }\n\n [part=\"prefix\"],\n [part=\"suffix\"] {\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(${cssGlobalVars.input}-icon-color);\n }\n\n [part=\"suffix\"] slot svg {\n margin-inline-start: 0.25em;\n }\n\n [part=\"prefix\"] slot svg {\n margin-inline-end: 0.25em;\n }\n`)\nclass Input extends SuperInput {\n @property({ reflect: true })\n type: InputType = \"text\";\n\n value: string;\n\n /**\n * If outline, the outline is always present.\n */\n @property()\n variant: \"default\" | \"outline\" = \"default\";\n\n @query(\"[part=input]\")\n protected _input: HTMLInputElement;\n\n constructor() {\n super();\n new StyleController(\n this,\n () =>\n new RingBuilder({ type: this.ringType }).css +\n (this.variant === \"outline\" ? `:host{${cssGlobalVars.ringColor}:currentColor}` : \"\"),\n );\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <label\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${[\n this._renderPrefix(),\n html`\n <input\n part=\"input\"\n type=\"${this.type}\"\n .value=\"${this.value}\"\n ?autofocus=\"${this.autofocus}\"\n ?disabled=\"${this.disabled}\"\n autocapitalize=\"${this.autocapitalize || nothing}\"\n autocomplete=\"${this.autocomplete || nothing}\"\n placeholder=\"${this.placeholder || nothing}\"\n @input=\"${this._handleInput}\"\n @change=\"${this._handleChange}\"\n />\n `,\n this._renderSuffix(),\n ]}\n </label>\n `;\n }\n\n protected _renderSuffix(): TemplateResult<1> {\n const PASSWORD = \"password\";\n if (this.type === PASSWORD) {\n return html`\n <i\n part=\"suffix\"\n @mousedown=\"${() => this._changeInputType(\"text\")}\"\n @mouseup=\"${() => this._changeInputType(PASSWORD)}\"\n @mouseleave=\"${() => this._changeInputType(PASSWORD)}\"\n >\n ${htmlSlot(\"suffix\", iconEyeSlash())}\n </i>\n `;\n }\n return super._renderSuffix();\n }\n\n protected _changeInputType(t: typeof this.type): void {\n if (this._input) {\n this._input.type = t;\n }\n }\n}\n\nexport default Input;\nexport { Input };\n"],"names":["Input","PASSWORD","iconEyeSlash","t: typeof this.type","t"],"mappings":"qeA4BA,MAAM,UAAY,QASlB,IAAA,MAAA,MA6CMA,UAAc,UAAW,CAe7B,aAAc,CACZ,OAAO,MAdT,KAAkB,YAQlB,QAAiC,UAO/B,IAAI,gBACF,KACA,IACE,IAAI,YAAY,CAAE,KAAM,KAAK,QAAU,GAAE,KACxC,KAAK,UAAY,UAAY,CAAC,MAAM,EAAE,cAAc,UAAU,cAAc,CAAC,CAAG,IAEtF,CAES,QAA4B,CACpC,MAAO,KAAI,CAAA,mBAGP,EAAE,KAAK,KAAK,eAAe,CAAA,EAE3B,EAAE,CACA,KAAK,eAAe,CACpB,IAAI,CAAA,0BAGM,EAAE,KAAK,KAAK,UACV,EAAE,KAAK,MAAM,cACT,EAAE,KAAK,UAAU,aAClB,EAAE,KAAK,SAAS,kBACX,EAAE,KAAK,gBAAkB,QAAQ,gBACnC,EAAE,KAAK,cAAgB,QAAQ,eAChC,EAAE,KAAK,aAAe,QAAQ,UACnC,EAAE,KAAK,aAAa,WACnB,EAAE,KAAK,cAAc,GAElC,CAAC,CACD,KAAK,eAAA,AACN,EAAA,SAEL,CAAC,AACF,CAES,eAAmC,CAC3C,IAAMC,EAAW,WAajB,OAZI,KAAK,OAASA,EACT,IAAI,CAAA,6BAGK,EAAE,IAAM,KAAK,iBAAiB,OAAO,CAAC,YACxC,EAAE,IAAM,KAAK,iBAAiBA,EAAS,CAAC,eACrC,EAAE,IAAM,KAAK,iBAAiBA,EAAS,CAAC,GAErD,EAAE,SAAS,SAAUC,UAAc,CAAC,CAAA,KAExC,CAAC,CAEI,MAAM,eAAe,AAC7B,CAES,iBAAiBC,EAA2B,CAChD,KAAK,SACP,KAAK,OAAO,KAAOC,EAEtB,CACF,aA1EE,SAAS,CAAE,QAAS,EAAM,EAAC,AAAA,EAAA,MAAA,UAAA,OAAA,OAAA,YAQ3B,UAAU,AAAA,EAAA,MAAA,UAAA,UAAA,OAAA,CAGV,UAAA,CAAA,MAAM,eAAe,AAAA,EAAA,MAAA,UAAA,SAAA,OAAA,CAzDvB,MAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC,oBAGR,EAAE,cAAc,MAAM,qDAKtB,EAAE,cAAc,UAAU,cAC1B,EAAE,cAAc,MAAM,8SAwBX,EAAE,cAAc,MAAM,6GAUrC,CAAC,CAAC,AAAA,EAAA,MAAA,CA8EF,IAAA,QAAe"}
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,OAAO,WAAW,gBAAiB;AAInC,eAAe;eAEA;WACH,sBAAsB;EAC9B,gBAAgB;CACjB;AACF","names":[],"sources":["../../../../src/web-components/input/definition.ts"],"sourcesContent":["import Input from \"./component.js\";\n\nInput.define();\n\nexport default Input;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-input\": Input;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
@@ -0,0 +1,2 @@
1
+ import Input from"./component.js";import"@godown/element";import"../../internal/icons/eye-slash.js";import"lit";import"lit/decorators.js";import"../../internal/global-style.js";import"../../internal/reset-style.js";import"sharekit";import"../../internal/super-input.js";import"../../internal/ring.js";import"@oxc-project/runtime/helpers/decorate";Input.define();export{Input as default};
2
+ //# sourceMappingURL=definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.js","sources":["../../../src/web-components/input/definition.ts"],"sourcesContent":["import Input from \"./component.js\";\n\nInput.define();\n\nexport default Input;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-input\": Input;\n }\n}\n"],"names":[],"mappings":"2VAEA,MAAM,QAAQ"}
@@ -0,0 +1 @@
1
+ {"mappings":"AACA,cAAc,sBAAiC,KAAM;AAGrD,SAAS,mBAAmB,gCAAiC;;;;;;;;;;;;;;;AAkB7D,cAmCM,eAAe,YAAY;;;;CAI/B,AACA;CAEA,UAAU,UAAU,eAAe;AAYpC;AAED,eAAe;AACf,SAAS","names":[],"sources":["../../../../src/web-components/layout/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { GlobalStyle } from \"../../internal/global-style.js\";\n\nconst protoName = \"layout\";\n\n/**\n * {@linkcode Layout} renders main content, top header, bottom footer.\n *\n * If `sticky` is set to `true`, the header will be sticky.\n *\n * Main content will take up the remaining space.\n *\n * Element display should be `(inline-)flex` or `(inline-)grid`.\n *\n * @slot - The main content of the layout.\n * @slot header - The header of the layout.\n * @slot footer - The footer of the layout.\n * @category layout\n */\n@godown(protoName)\n@styles(css`\n :host {\n width: 100%;\n height: 100%;\n min-height: 100%;\n flex-direction: column;\n grid-template-rows: auto 1fr auto;\n }\n\n :host,\n :host([contents]) [part=\"root\"] {\n display: flex;\n }\n\n [part=\"root\"] {\n display: contents;\n }\n\n [part=\"main\"] {\n width: 100%;\n flex: 1;\n }\n\n [part=\"header\"],\n [part=\"footer\"] {\n flex-shrink: 0;\n width: 100%;\n }\n\n [sticky] header {\n position: sticky;\n top: 0;\n }\n`)\nclass Layout extends GlobalStyle {\n /**\n * If `true`, header will sticky.\n */\n @property({ type: Boolean })\n sticky = false;\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n <header part=\"header\">${htmlSlot(\"header\")}</header>\n <main part=\"main\">${htmlSlot()}</main>\n <footer part=\"footer\">${htmlSlot(\"footer\")}</footer>\n </div>\n `;\n }\n}\n\nexport default Layout;\nexport { Layout };\n"],"version":3,"file":"component.d.ts"}
@@ -0,0 +1,3 @@
1
+ import{godown,styles,attr,htmlSlot}from"@godown/element";import{css,html}from"lit";import{property}from"lit/decorators.js";import{GlobalStyle}from"../../internal/global-style.js";import _decorate from"@oxc-project/runtime/helpers/decorate";import"../../internal/reset-style.js";import"sharekit";const protoName=`layout`;let Layout=class e extends GlobalStyle{constructor(...e){super(...e),this.sticky=!1}render(){return html`<div part="root" ${attr(this.observedRecord)}> <header part="header">${htmlSlot(`header`)}</header> <main part="main">${htmlSlot()}</main> <footer part="footer">${htmlSlot(`footer`)}</footer> </div>`}};_decorate([property({type:Boolean})],Layout.prototype,`sticky`,void 0),Layout=_decorate([godown(protoName),styles(css`:host{width:100%;height:100%;min-height:100%;flex-direction:column;grid-template-rows:auto 1fr auto}:host,:host([contents]) [part=root]{display:flex}[part=root]{display:contents}[part=main]{width:100%;flex:1}[part=header],[part=footer]{flex-shrink:0;width:100%}[sticky] header{position:sticky;top:0}
2
+ `)],Layout);var Layout$1=Layout;export{Layout,Layout$1 as default};
3
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sources":["../../../src/web-components/layout/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { GlobalStyle } from \"../../internal/global-style.js\";\n\nconst protoName = \"layout\";\n\n/**\n * {@linkcode Layout} renders main content, top header, bottom footer.\n *\n * If `sticky` is set to `true`, the header will be sticky.\n *\n * Main content will take up the remaining space.\n *\n * Element display should be `(inline-)flex` or `(inline-)grid`.\n *\n * @slot - The main content of the layout.\n * @slot header - The header of the layout.\n * @slot footer - The footer of the layout.\n * @category layout\n */\n@godown(protoName)\n@styles(css`\n :host {\n width: 100%;\n height: 100%;\n min-height: 100%;\n flex-direction: column;\n grid-template-rows: auto 1fr auto;\n }\n\n :host,\n :host([contents]) [part=\"root\"] {\n display: flex;\n }\n\n [part=\"root\"] {\n display: contents;\n }\n\n [part=\"main\"] {\n width: 100%;\n flex: 1;\n }\n\n [part=\"header\"],\n [part=\"footer\"] {\n flex-shrink: 0;\n width: 100%;\n }\n\n [sticky] header {\n position: sticky;\n top: 0;\n }\n`)\nclass Layout extends GlobalStyle {\n /**\n * If `true`, header will sticky.\n */\n @property({ type: Boolean })\n sticky = false;\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n <header part=\"header\">${htmlSlot(\"header\")}</header>\n <main part=\"main\">${htmlSlot()}</main>\n <footer part=\"footer\">${htmlSlot(\"footer\")}</footer>\n </div>\n `;\n }\n}\n\nexport default Layout;\nexport { Layout };\n"],"names":["Layout"],"mappings":"uSAMA,MAAM,UAAY,SAgBlB,IAAA,OAAA,MAmCMA,UAAe,WAAY,oCAK/B,OAAS,GAEC,QAA4B,CACpC,MAAO,KAAI,CAAA,iBAGP,EAAE,KAAK,KAAK,eAAe,CAAA,wBAEL,EAAE,SAAS,SAAS,CAAC,4BACzB,EAAE,UAAU,CAAC,8BACT,EAAE,SAAS,SAAS,CAAC,gBAE/C,CAAC,AACF,CACF,aAfE,SAAS,CAAE,KAAM,OAAS,EAAC,AAAA,EAAA,OAAA,UAAA,SAAA,OAAA,CAvC7B,OAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC;AAiCZ,CAAC,CAAC,AAAA,EAAA,OAAA,CAsBF,IAAA,SAAe"}
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,OAAO,YAAY,gBAAiB;AAIpC,eAAe;eAEA;WACH,sBAAsB;EAC9B,iBAAiB;CAClB;AACF","names":[],"sources":["../../../../src/web-components/layout/definition.ts"],"sourcesContent":["import Layout from \"./component.js\";\n\nLayout.define();\n\nexport default Layout;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-layout\": Layout;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
@@ -0,0 +1,2 @@
1
+ import Layout from"./component.js";import"@godown/element";import"lit";import"lit/decorators.js";import"../../internal/global-style.js";import"../../internal/reset-style.js";import"sharekit";import"@oxc-project/runtime/helpers/decorate";Layout.define();export{Layout as default};
2
+ //# sourceMappingURL=definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.js","sources":["../../../src/web-components/layout/definition.ts"],"sourcesContent":["import Layout from \"./component.js\";\n\nLayout.define();\n\nexport default Layout;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-layout\": Layout;\n }\n}\n"],"names":[],"mappings":"6OAEA,OAAO,QAAQ"}
@@ -0,0 +1 @@
1
+ {"mappings":"AAIA,cAAkC,sBAAsB,KAAM;AAC9D,OAAO,iBAAiB,gCAAiC;AAIzD,cAAM;UACJ,MAAM;UACN,SAAS;UACT,QAAQ;UACR,MAAM;;KAGH,wBAAwB;;;;;;;;;;;;;;;;;;;;AAqB7B,cAeM,aAAa,YAAY;;;;;;;;CAQ7B,AACA,MAAM;;;;CAKN,AACA;;;;CAKA,AACA;;;;CAKA,AACA;;;;CAKA,AACA,QAAQ,WAAW,UAAU,YAAY;;;;CAKzC;CAEA,IAAI;CAIJ,UAAU,aAAaA,GAAG;CA6B1B;CAgBA,UAAU,UAAU,eAAe;AAapC;AAED,eAAe;AACf,SAAS","names":["e: MouseEvent"],"sources":["../../../../src/web-components/link/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, styles } from \"@godown/element\";\nimport { property } from \"lit/decorators.js\";\n\nimport Router from \"../router/component.js\";\nimport { css, html, nothing, type TemplateResult } from \"lit\";\nimport GlobalStyle from \"../../internal/global-style.js\";\n\nconst protoName = \"link\";\n\nconst linkTypes = {\n push: \"push\",\n replace: \"replace\",\n normal: \"normal\",\n auto: \"auto\",\n} as const;\n\ntype LinkType = keyof typeof linkTypes;\n\n/**\n * {@linkcode Link} is used for link jumping, works standalone or in {@linkcode Router}.\n *\n * Set `type` to `\"normal\"`,\n * behave like a normal anchor.\n *\n * Set `type` to `\"push\" `or `\"replace\"`,\n * update history state by `history.pushState` or `history.replaceState`,\n * update all routers whether current pathname is registered or not.\n *\n * Set `type` to `\"auto\"`,\n * only update the routers if the current pathname is registered,\n * if not registered, behave like `\"normal\"`.\n *\n * `replace` property will enforce `history.replaceState`.\n *\n * @fires navigate - Fires when the link is clicked.\n * @category navigation\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: inline-block;\n cursor: default;\n }\n\n :host([href]) {\n cursor: pointer;\n }\n\n a {\n display: contents;\n }\n`)\nclass Link extends GlobalStyle {\n /**\n * If `\"normal\"`, behave like a normal anchor.\n *\n * If `\"auto\"` or `\"push\"`, call `history.pushState` if `replace` is false,\n *\n * If `\"replace\"`, call `history.replaceState`.\n */\n @property()\n type: LinkType = linkTypes.auto;\n\n /**\n * If `true`, the {@linkcode Router} will not be updated.\n */\n @property({ type: Boolean })\n suppress = false;\n\n /**\n * Use `replaceState` instead of `pushState`.\n */\n @property({ type: Boolean })\n replace = false;\n\n /**\n * A element href.\n */\n @property()\n href: string;\n\n /**\n * A element target.\n */\n @property()\n target: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" = \"_self\";\n\n /**\n * Location state object.\n */\n state = {};\n\n get pathname(): string {\n return new URL(this.href, location.href).pathname;\n }\n\n protected _handleClick(e: MouseEvent): void {\n const { state, type, href, pathname, suppress } = this;\n if (!href) {\n return;\n }\n this.dispatchCustomEvent(\"navigate\", {\n ...this.observedRecord,\n pathname,\n state,\n });\n if (href.startsWith(\"#\") || type === linkTypes.normal) {\n return;\n }\n this.handleState();\n const routers = [...Router.routerInstances];\n if (\n // only runs when suppress is false\n !suppress &&\n (type !== linkTypes.auto ||\n // in auto mode, only update the routers if the current pathname is registered\n routers.some((i) => i.search(location.pathname)))\n ) {\n e.preventDefault();\n Router.routerInstances.forEach((i) => {\n i.handlePopstate();\n });\n }\n }\n\n handleState: () => void = () => {\n switch (this.type) {\n case linkTypes.auto:\n case linkTypes.push:\n if (!this.replace) {\n // type is auto or push and replace is false\n history.pushState(this.state, \"\", this.href);\n break;\n }\n // fallthrough to replace\n case linkTypes.replace:\n history.replaceState(this.state, \"\", this.href);\n break;\n }\n };\n\n protected render(): TemplateResult<1> {\n return html`\n <a\n part=\"root\"\n ${attr(this.observedRecord)}\n href=\"${this.href || nothing}\"\n target=\"${this.target}\"\n @click=${this._handleClick}\n >\n ${htmlSlot()}\n </a>\n `;\n }\n}\n\nexport default Link;\nexport { Link };\n"],"version":3,"file":"component.d.ts"}
@@ -0,0 +1,3 @@
1
+ import{godown,styles,attr,htmlSlot}from"@godown/element";import{property}from"lit/decorators.js";import Router from"../router/component.js";import{css,nothing,html}from"lit";import{GlobalStyle}from"../../internal/global-style.js";import _decorate from"@oxc-project/runtime/helpers/decorate";import"sharekit";import"../../internal/reset-style.js";const protoName=`link`,linkTypes={push:`push`,replace:`replace`,normal:`normal`,auto:`auto`};let Link=class e extends GlobalStyle{constructor(...e){super(...e),this.type=linkTypes.auto,this.suppress=!1,this.replace=!1,this.target=`_self`,this.state={},this.handleState=()=>{switch(this.type){case linkTypes.auto:case linkTypes.push:if(!this.replace){history.pushState(this.state,``,this.href);break}case linkTypes.replace:history.replaceState(this.state,``,this.href);break}}}get pathname(){return new URL(this.href,location.href).pathname}_handleClick(e){let{state:l,type:u,href:d,pathname:f,suppress:p}=this;if(!d||(this.dispatchCustomEvent(`navigate`,{...this.observedRecord,pathname:f,state:l}),d.startsWith(`#`)||u===linkTypes.normal))return;this.handleState();let m=[...Router.routerInstances];!p&&(u!==linkTypes.auto||m.some(e=>e.search(location.pathname)))&&(e.preventDefault(),Router.routerInstances.forEach(e=>{e.handlePopstate()}))}render(){return html`<a part="root" ${attr(this.observedRecord)} href="${this.href||nothing}" target="${this.target}" @click=${this._handleClick}> ${htmlSlot()} </a>`}};_decorate([property()],Link.prototype,`type`,void 0),_decorate([property({type:Boolean})],Link.prototype,`suppress`,void 0),_decorate([property({type:Boolean})],Link.prototype,`replace`,void 0),_decorate([property()],Link.prototype,`href`,void 0),_decorate([property()],Link.prototype,`target`,void 0),Link=_decorate([godown(protoName),styles(css`:host{display:inline-block;cursor:default}:host([href]){cursor:pointer}a{display:contents}
2
+ `)],Link);var Link$1=Link;export{Link,Link$1 as default};
3
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sources":["../../../src/web-components/link/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, styles } from \"@godown/element\";\nimport { property } from \"lit/decorators.js\";\n\nimport Router from \"../router/component.js\";\nimport { css, html, nothing, type TemplateResult } from \"lit\";\nimport GlobalStyle from \"../../internal/global-style.js\";\n\nconst protoName = \"link\";\n\nconst linkTypes = {\n push: \"push\",\n replace: \"replace\",\n normal: \"normal\",\n auto: \"auto\",\n} as const;\n\ntype LinkType = keyof typeof linkTypes;\n\n/**\n * {@linkcode Link} is used for link jumping, works standalone or in {@linkcode Router}.\n *\n * Set `type` to `\"normal\"`,\n * behave like a normal anchor.\n *\n * Set `type` to `\"push\" `or `\"replace\"`,\n * update history state by `history.pushState` or `history.replaceState`,\n * update all routers whether current pathname is registered or not.\n *\n * Set `type` to `\"auto\"`,\n * only update the routers if the current pathname is registered,\n * if not registered, behave like `\"normal\"`.\n *\n * `replace` property will enforce `history.replaceState`.\n *\n * @fires navigate - Fires when the link is clicked.\n * @category navigation\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: inline-block;\n cursor: default;\n }\n\n :host([href]) {\n cursor: pointer;\n }\n\n a {\n display: contents;\n }\n`)\nclass Link extends GlobalStyle {\n /**\n * If `\"normal\"`, behave like a normal anchor.\n *\n * If `\"auto\"` or `\"push\"`, call `history.pushState` if `replace` is false,\n *\n * If `\"replace\"`, call `history.replaceState`.\n */\n @property()\n type: LinkType = linkTypes.auto;\n\n /**\n * If `true`, the {@linkcode Router} will not be updated.\n */\n @property({ type: Boolean })\n suppress = false;\n\n /**\n * Use `replaceState` instead of `pushState`.\n */\n @property({ type: Boolean })\n replace = false;\n\n /**\n * A element href.\n */\n @property()\n href: string;\n\n /**\n * A element target.\n */\n @property()\n target: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" = \"_self\";\n\n /**\n * Location state object.\n */\n state = {};\n\n get pathname(): string {\n return new URL(this.href, location.href).pathname;\n }\n\n protected _handleClick(e: MouseEvent): void {\n const { state, type, href, pathname, suppress } = this;\n if (!href) {\n return;\n }\n this.dispatchCustomEvent(\"navigate\", {\n ...this.observedRecord,\n pathname,\n state,\n });\n if (href.startsWith(\"#\") || type === linkTypes.normal) {\n return;\n }\n this.handleState();\n const routers = [...Router.routerInstances];\n if (\n // only runs when suppress is false\n !suppress &&\n (type !== linkTypes.auto ||\n // in auto mode, only update the routers if the current pathname is registered\n routers.some((i) => i.search(location.pathname)))\n ) {\n e.preventDefault();\n Router.routerInstances.forEach((i) => {\n i.handlePopstate();\n });\n }\n }\n\n handleState: () => void = () => {\n switch (this.type) {\n case linkTypes.auto:\n case linkTypes.push:\n if (!this.replace) {\n // type is auto or push and replace is false\n history.pushState(this.state, \"\", this.href);\n break;\n }\n // fallthrough to replace\n case linkTypes.replace:\n history.replaceState(this.state, \"\", this.href);\n break;\n }\n };\n\n protected render(): TemplateResult<1> {\n return html`\n <a\n part=\"root\"\n ${attr(this.observedRecord)}\n href=\"${this.href || nothing}\"\n target=\"${this.target}\"\n @click=${this._handleClick}\n >\n ${htmlSlot()}\n </a>\n `;\n }\n}\n\nexport default Link;\nexport { Link };\n"],"names":["Link","e: MouseEvent","href","type","routers","suppress","i"],"mappings":"0VAOA,MAAM,UAAY,OAEZ,UAAY,CAChB,KAAM,OACN,QAAS,UACT,OAAQ,SACR,KAAM,MACP,EAuBD,IAAA,KAAA,MAeMA,UAAa,WAAY,+BAS7B,KAAA,KAAiB,UAAU,UAM3B,SAAW,QAMX,QAAU,QAYV,OAAkD,QAKlD,KAAA,MAAQ,CAAE,EAmCV,KAAA,YAA0B,IAAM,CAC9B,OAAQ,KAAK,KAAb,CACE,KAAK,UAAU,KACf,KAAK,UAAU,KACb,GAAI,CAAC,KAAK,QAAS,CAEjB,QAAQ,UAAU,KAAK,MAAO,GAAI,KAAK,KAAK,CAC5C,KACD,CAEH,KAAK,UAAU,QACb,QAAQ,aAAa,KAAK,MAAO,GAAI,KAAK,KAAK,CAC/C,KACH,CACF,EA/CD,IAAI,UAAmB,CACrB,OAAO,IAAI,IAAI,KAAK,KAAM,SAAS,MAAM,QAC1C,CAES,aAAaC,EAAqB,CAC1C,GAAM,CAAE,QAAO,OAAM,OAAM,WAAU,WAAU,CAAG,KASlD,GARI,CAACC,IAGL,KAAK,oBAAoB,WAAY,CACnC,GAAG,KAAK,eACR,WACA,OACD,EAAC,CACEA,EAAK,WAAW,IAAI,EAAIC,IAAS,UAAU,QAC7C,OAEF,KAAK,aAAa,CAClB,IAAMC,EAAU,CAAC,GAAG,OAAO,eAAgB,EAGzC,CAACC,IACAF,IAAS,UAAU,MAElBC,EAAQ,KAAK,AAACE,GAAMA,EAAE,OAAO,SAAS,SAAS,CAAC,IAElD,EAAE,gBAAgB,CAClB,OAAO,gBAAgB,QAAQ,AAACA,GAAM,CACpCA,EAAE,gBAAgB,AACnB,EAAC,CAEL,CAkBS,QAA4B,CACpC,MAAO,KAAI,CAAA,eAGP,EAAE,KAAK,KAAK,eAAe,CAAA,OACrB,EAAE,KAAK,MAAQ,QAAQ,UACrB,EAAE,KAAK,OAAO,SACf,EAAE,KAAK,aAAA,EAEd,EAAE,UAAU,CAAA,KAEhB,CAAC,AACF,CACF,aA9FE,UAAU,AAAA,EAAA,KAAA,UAAA,OAAA,OAAA,YAMV,SAAS,CAAE,KAAM,OAAS,EAAC,AAAA,EAAA,KAAA,UAAA,WAAA,OAAA,YAM3B,SAAS,CAAE,KAAM,OAAS,EAAC,AAAA,EAAA,KAAA,UAAA,UAAA,OAAA,YAM3B,UAAU,AAAA,EAAA,KAAA,UAAA,OAAA,OAAA,YAMV,UAAU,AAAA,EAAA,KAAA,UAAA,SAAA,OAAA,CA/CZ,KAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC;AAaZ,CAAC,CAAC,AAAA,EAAA,KAAA,CAyGF,IAAA,OAAe"}
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,OAAO,UAAU,gBAAiB;AAIlC,eAAe;eAEA;WACH,sBAAsB;EAC9B,eAAe;CAChB;AACF","names":[],"sources":["../../../../src/web-components/link/definition.ts"],"sourcesContent":["import Link from \"./component.js\";\n\nLink.define();\n\nexport default Link;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-link\": Link;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
@@ -0,0 +1,2 @@
1
+ import Link from"./component.js";import"@godown/element";import"lit/decorators.js";import"../router/component.js";import"lit";import"sharekit";import"../../internal/global-style.js";import"../../internal/reset-style.js";import"@oxc-project/runtime/helpers/decorate";Link.define();export{Link as default};
2
+ //# sourceMappingURL=definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.js","sources":["../../../src/web-components/link/definition.ts"],"sourcesContent":["import Link from \"./component.js\";\n\nLink.define();\n\nexport default Link;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-link\": Link;\n }\n}\n"],"names":[],"mappings":"0QAEA,KAAK,QAAQ"}
@@ -0,0 +1 @@
1
+ {"mappings":"AACA,OAAO,iBAAiB,gCAAiC;AACzD,cAAyB,qBAAqB,sBAAsB,KAAM;;;;;;;;;;;AAiB1E,cAsBM,gBAAgB,YAAY;CAChC;CAEA,AACA;CAEA,AACA,QAAQ,SAAS,SAAS,WAAW;CAErC,AACA,MAAM,SAAS,WAAW;;;;;CAM1B,AACA,UACI,WACA,SACA,aACA,gBACA,UACA,cACA,iBACA,QACA,aACA,cACA,WACA,gBACA,iBACA,UACA,gBACA,cACA,QACA,cACA;CAEJ,UACU,UAAU;CAEpB;CAeA,UAAU,UAAU,eAAe;CAmBnC,UAAU;CAUV;CAIA;CAIA,OAAOA;CAIP,UAAU,QAAQC,oBAAoB;CAMtC,UAAU;CAiBV;AASD;AAED,SAAS,SAAS,WAAW","names":["force?: boolean","_changedProperties: PropertyValues"],"sources":["../../../../src/web-components/popover/component.ts"],"sourcesContent":["import { property, query } from \"lit/decorators.js\";\nimport GlobalStyle from \"../../internal/global-style.js\";\nimport { css, html, type PropertyValues, type TemplateResult } from \"lit\";\nimport { godown, htmlSlot, StyleController, styles } from \"@godown/element\";\nimport { hidePopover, showPopover } from \"../../internal/popover.js\";\n\nconst POPOVER = \"popover\";\nconst protoName = POPOVER;\n\n/**\n * {@link Popover} renders a popover.\n *\n * This requires the support of the popover API and CSS position-area.\n *\n * @fires toggle - Fired when the popover is toggled.\n * @slot popover - Popover content.\n * @slot - Popover trigger.\n * @category display\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: inline-block;\n }\n\n [part=\"trigger\"] {\n display: contents;\n }\n\n [part=\"root\"] {\n display: inherit;\n }\n\n [part=\"popover\"] {\n inset: unset;\n z-index: 1;\n overflow: visible;\n position: absolute;\n position-try-fallbacks: flip-block;\n }\n`)\nclass Popover extends GlobalStyle {\n anchorName = `--${POPOVER}-${Math.random().toString(36).slice(2)}`;\n\n @property({ type: Boolean, reflect: true })\n open = false;\n\n @property()\n action: \"hide\" | \"show\" | \"toggle\" | \"none\" = \"show\";\n\n @property()\n span: \"span\" | \"spread\" | \"isolated\" = \"span\";\n\n /**\n * The position refers to the spatial location of the popover in relation to the trigger,\n * rather than the alignment property between them.\n */\n @property()\n position:\n | \"center\"\n | \"left\"\n | \"left-top\"\n | \"left-bottom\"\n | \"right\"\n | \"right-top\"\n | \"right-bottom\"\n | \"top\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"start\"\n | \"start-start\"\n | \"start-end\"\n | \"end\"\n | \"end-start\"\n | \"end-end\" = \"bottom\";\n\n @query(`[part=${POPOVER}]`, true)\n protected _popover: HTMLElement;\n\n constructor() {\n super();\n new StyleController(this, () => {\n return {\n \"[part=root],slot:not([name])::slotted(*)\": {\n \"anchor-name\": this.anchorName,\n },\n \"[part=popover]\": {\n \"position-anchor\": this.anchorName,\n \"position-area\": this.resolveArea(),\n },\n };\n });\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <div part=\"root\">\n <div\n part=\"trigger\"\n @click=${this._handleClick}\n >\n ${htmlSlot()}\n </div>\n <div\n part=\"popover\"\n popover=\"manual\"\n >\n ${htmlSlot(\"popover\")}\n </div>\n </div>\n `;\n }\n\n protected _handleClick(): void {\n const { action } = this;\n switch (action) {\n case \"show\":\n case \"hide\":\n case \"toggle\":\n this[action]();\n }\n }\n\n show(): void {\n this.toggle(true);\n }\n\n hide(): void {\n this.toggle(false);\n }\n\n toggle(force?: boolean): void {\n this.open = force ?? !this.open;\n }\n\n protected updated(_changedProperties: PropertyValues): void {\n if (_changedProperties.has(\"open\")) {\n this._openChange();\n }\n }\n\n protected _openChange(): void {\n const { open } = this;\n if (open) {\n showPopover.call(this, this._popover);\n const listener = (e) => {\n if (!this.contains(e.target)) {\n this.events.remove(document, \"click\", listener);\n this.open = false;\n }\n };\n this.events.add(document, \"click\", listener);\n } else {\n hidePopover(this._popover);\n }\n this.dispatchCustomEvent(\"toggle\", open);\n }\n\n resolveArea(): string {\n const split = this.position.split(\"-\");\n const firstValue = this.span === \"spread\" ? `span-${split[0]}` : split[0];\n if (split.length < 2) {\n return `${firstValue} center`;\n }\n const secondValue = this.span === \"isolated\" ? split[1] : `span-${split[1]}`;\n return `${firstValue} ${secondValue}`;\n }\n}\n\nexport { Popover, Popover as default };\n"],"version":3,"file":"component.d.ts"}
@@ -0,0 +1,3 @@
1
+ import{property,query}from"lit/decorators.js";import{GlobalStyle}from"../../internal/global-style.js";import{css,html}from"lit";import{godown,styles,StyleController,htmlSlot}from"@godown/element";import{showPopover,hidePopover}from"../../internal/popover.js";import _decorate from"@oxc-project/runtime/helpers/decorate";import"../../internal/reset-style.js";import"sharekit";import"../../internal/utils.js";const POPOVER=`popover`,protoName=POPOVER;let Popover=class e extends GlobalStyle{constructor(){super(),this.anchorName=`--${POPOVER}-${Math.random().toString(36).slice(2)}`,this.open=!1,this.action=`show`,this.span=`span`,this.position=`bottom`,new StyleController(this,()=>({"[part=root],slot:not([name])::slotted(*)":{"anchor-name":this.anchorName},"[part=popover]":{"position-anchor":this.anchorName,"position-area":this.resolveArea()}}))}render(){return html`<div part="root"> <div part="trigger" @click=${this._handleClick}> ${htmlSlot()} </div> <div part="popover" popover="manual"> ${htmlSlot(`popover`)} </div> </div>`}_handleClick(){let{action:e}=this;switch(e){case`show`:case`hide`:case`toggle`:this[e]()}}show(){this.toggle(!0)}hide(){this.toggle(!1)}toggle(e){this.open=e??!this.open}updated(e){e.has(`open`)&&this._openChange()}_openChange(){let{open:e}=this;if(e){showPopover.call(this,this._popover);let e=p=>{this.contains(p.target)||(this.events.remove(document,`click`,e),this.open=!1)};this.events.add(document,`click`,e)}else hidePopover(this._popover);this.dispatchCustomEvent(`toggle`,e)}resolveArea(){let e=this.position.split(`-`),p=this.span===`spread`?`span-${e[0]}`:e[0];if(e.length<2)return`${p} center`;let m=this.span===`isolated`?e[1]:`span-${e[1]}`;return`${p} ${m}`}};_decorate([property({type:Boolean,reflect:!0})],Popover.prototype,`open`,void 0),_decorate([property()],Popover.prototype,`action`,void 0),_decorate([property()],Popover.prototype,`span`,void 0),_decorate([property()],Popover.prototype,`position`,void 0),_decorate([query(`[part=${POPOVER}]`,!0)],Popover.prototype,`_popover`,void 0),Popover=_decorate([godown(protoName),styles(css`:host{display:inline-block}[part=trigger]{display:contents}[part=root]{display:inherit}[part=popover]{inset:unset;z-index:1;overflow:visible;position:absolute;position-try-fallbacks:flip-block}
2
+ `)],Popover);export{Popover,Popover as default};
3
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sources":["../../../src/web-components/popover/component.ts"],"sourcesContent":["import { property, query } from \"lit/decorators.js\";\nimport GlobalStyle from \"../../internal/global-style.js\";\nimport { css, html, type PropertyValues, type TemplateResult } from \"lit\";\nimport { godown, htmlSlot, StyleController, styles } from \"@godown/element\";\nimport { hidePopover, showPopover } from \"../../internal/popover.js\";\n\nconst POPOVER = \"popover\";\nconst protoName = POPOVER;\n\n/**\n * {@link Popover} renders a popover.\n *\n * This requires the support of the popover API and CSS position-area.\n *\n * @fires toggle - Fired when the popover is toggled.\n * @slot popover - Popover content.\n * @slot - Popover trigger.\n * @category display\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: inline-block;\n }\n\n [part=\"trigger\"] {\n display: contents;\n }\n\n [part=\"root\"] {\n display: inherit;\n }\n\n [part=\"popover\"] {\n inset: unset;\n z-index: 1;\n overflow: visible;\n position: absolute;\n position-try-fallbacks: flip-block;\n }\n`)\nclass Popover extends GlobalStyle {\n anchorName = `--${POPOVER}-${Math.random().toString(36).slice(2)}`;\n\n @property({ type: Boolean, reflect: true })\n open = false;\n\n @property()\n action: \"hide\" | \"show\" | \"toggle\" | \"none\" = \"show\";\n\n @property()\n span: \"span\" | \"spread\" | \"isolated\" = \"span\";\n\n /**\n * The position refers to the spatial location of the popover in relation to the trigger,\n * rather than the alignment property between them.\n */\n @property()\n position:\n | \"center\"\n | \"left\"\n | \"left-top\"\n | \"left-bottom\"\n | \"right\"\n | \"right-top\"\n | \"right-bottom\"\n | \"top\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"start\"\n | \"start-start\"\n | \"start-end\"\n | \"end\"\n | \"end-start\"\n | \"end-end\" = \"bottom\";\n\n @query(`[part=${POPOVER}]`, true)\n protected _popover: HTMLElement;\n\n constructor() {\n super();\n new StyleController(this, () => {\n return {\n \"[part=root],slot:not([name])::slotted(*)\": {\n \"anchor-name\": this.anchorName,\n },\n \"[part=popover]\": {\n \"position-anchor\": this.anchorName,\n \"position-area\": this.resolveArea(),\n },\n };\n });\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <div part=\"root\">\n <div\n part=\"trigger\"\n @click=${this._handleClick}\n >\n ${htmlSlot()}\n </div>\n <div\n part=\"popover\"\n popover=\"manual\"\n >\n ${htmlSlot(\"popover\")}\n </div>\n </div>\n `;\n }\n\n protected _handleClick(): void {\n const { action } = this;\n switch (action) {\n case \"show\":\n case \"hide\":\n case \"toggle\":\n this[action]();\n }\n }\n\n show(): void {\n this.toggle(true);\n }\n\n hide(): void {\n this.toggle(false);\n }\n\n toggle(force?: boolean): void {\n this.open = force ?? !this.open;\n }\n\n protected updated(_changedProperties: PropertyValues): void {\n if (_changedProperties.has(\"open\")) {\n this._openChange();\n }\n }\n\n protected _openChange(): void {\n const { open } = this;\n if (open) {\n showPopover.call(this, this._popover);\n const listener = (e) => {\n if (!this.contains(e.target)) {\n this.events.remove(document, \"click\", listener);\n this.open = false;\n }\n };\n this.events.add(document, \"click\", listener);\n } else {\n hidePopover(this._popover);\n }\n this.dispatchCustomEvent(\"toggle\", open);\n }\n\n resolveArea(): string {\n const split = this.position.split(\"-\");\n const firstValue = this.span === \"spread\" ? `span-${split[0]}` : split[0];\n if (split.length < 2) {\n return `${firstValue} center`;\n }\n const secondValue = this.span === \"isolated\" ? split[1] : `span-${split[1]}`;\n return `${firstValue} ${secondValue}`;\n }\n}\n\nexport { Popover, Popover as default };\n"],"names":["Popover","action","force?: boolean","force","_changedProperties: PropertyValues","_changedProperties","open","listener","e","split","firstValue","secondValue"],"mappings":"uZAMA,MAAM,QAAU,UACV,UAAY,QAYlB,IAAA,QAAA,MAsBMA,UAAgB,WAAY,CAyChC,aAAc,CACZ,OAAO,CAzCT,KAAA,WAAa,CAAC,EAAE,EAAE,QAAQ,CAAC,EAAE,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,MAAM,EAAE,EAAE,MAGlE,KAAO,QAGP,OAA8C,YAG9C,KAAuC,YAOvC,SAmBgB,SAOd,IAAI,gBAAgB,KAAM,KACjB,CACL,2CAA4C,CAC1C,cAAe,KAAK,UACrB,EACD,iBAAkB,CAChB,kBAAmB,KAAK,WACxB,gBAAiB,KAAK,aAAA,AACvB,CACF,GAEJ,CAES,QAA4B,CACpC,MAAO,KAAI,CAAA,6CAIE,EAAE,KAAK,aAAA,EAEd,EAAE,UAAU,CAAA,8CAMZ,EAAE,SAAS,UAAU,CAAA,cAG3B,CAAC,AACF,CAES,cAAqB,CAC7B,GAAM,CAAE,SAAQ,CAAG,KACnB,OAAQC,EAAR,CACE,IAAK,OACL,IAAK,OACL,IAAK,SACH,KAAKA,IAAS,AACjB,CACF,CAED,MAAa,CACX,KAAK,OAAO,GAAK,AAClB,CAED,MAAa,CACX,KAAK,OAAO,GAAM,AACnB,CAED,OAAOC,EAAuB,CAC5B,KAAK,KAAOC,GAAS,CAAC,KAAK,IAC5B,CAES,QAAQC,EAA0C,CACtDC,EAAmB,IAAI,OAAO,EAChC,KAAK,aAAa,AAErB,CAES,aAAoB,CAC5B,GAAM,CAAE,OAAM,CAAG,KACjB,GAAIC,EAAM,CACR,YAAY,KAAK,KAAM,KAAK,SAAS,CACrC,IAAMC,EAAW,AAACC,GAAM,CACjB,KAAK,SAASA,EAAE,OAAO,GAC1B,KAAK,OAAO,OAAO,SAAU,QAASD,EAAS,CAC/C,KAAK,KAAO,GAEf,EACD,KAAK,OAAO,IAAI,SAAU,QAASA,EAAS,AAC7C,MACC,YAAY,KAAK,SAAS,CAE5B,KAAK,oBAAoB,SAAUD,EAAK,AACzC,CAED,aAAsB,CACpB,IAAMG,EAAQ,KAAK,SAAS,MAAM,IAAI,CAChCC,EAAa,KAAK,OAAS,SAAW,CAAC,KAAK,EAAED,EAAM,IAAI,CAAGA,EAAM,GACvE,GAAIA,EAAM,OAAS,EACjB,MAAO,GAAGC,EAAW,OAAO,CAAC,CAE/B,IAAMC,EAAc,KAAK,OAAS,WAAaF,EAAM,GAAK,CAAC,KAAK,EAAEA,EAAM,IAAI,CAC5E,MAAO,GAAGC,EAAW,CAAC,EAAEC,GAAa,AACtC,CACF,aA9HE,SAAS,CAAE,KAAM,QAAS,QAAS,EAAM,EAAC,AAAA,EAAA,QAAA,UAAA,OAAA,IAAA,GAAA,YAG1C,UAAU,AAAA,EAAA,QAAA,UAAA,SAAA,OAAA,YAGV,UAAU,AAAA,EAAA,QAAA,UAAA,OAAA,OAAA,YAOV,UAAU,AAAA,EAAA,QAAA,UAAA,WAAA,OAAA,CAsBV,UAAA,CAAA,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAE,GAAK,AAAA,EAAA,QAAA,UAAA,WAAA,IAAA,GAAA,CA5DlC,QAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC;AAoBZ,CAAC,CAAC,AAAA,EAAA,QAAA"}
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,OAAO,aAAa,gBAAiB;AAIrC,eAAe;eAEA;WACH,sBAAsB;EAC9B,kBAAkB;CACnB;AACF","names":[],"sources":["../../../../src/web-components/popover/definition.ts"],"sourcesContent":["import Popover from \"./component.js\";\n\nPopover.define();\n\nexport default Popover;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-popover\": Popover;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
@@ -0,0 +1,2 @@
1
+ import{Popover as Popover$1}from"./component.js";import"lit/decorators.js";import"../../internal/global-style.js";import"@godown/element";import"lit";import"../../internal/reset-style.js";import"sharekit";import"../../internal/popover.js";import"../../internal/utils.js";import"@oxc-project/runtime/helpers/decorate";Popover$1.define();var Popover=Popover$1;export{Popover as default};
2
+ //# sourceMappingURL=definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.js","sources":["../../../src/web-components/popover/definition.ts"],"sourcesContent":["import Popover from \"./component.js\";\n\nPopover.define();\n\nexport default Popover;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-popover\": Popover;\n }\n}\n"],"names":["Popover"],"mappings":"6TAEAA,UAAQ,QAAQ,CAEhB,IAAA,QAAeA"}
@@ -0,0 +1 @@
1
+ {"mappings":"AACA,cAAc,sBAAiC,KAAM;AAIrD,SAAS,mBAAkC,gCAAiC;;;;;;AAS5E,cA+CM,iBAAiB,YAAY;CACjC,AACA;CAEA,AACA;CAEA,AACA;CAEA,UAAU,UAAU,eAAe;AAsBpC;AAED,eAAe;AACf,SAAS","names":[],"sources":["../../../../src/web-components/progress/component.ts"],"sourcesContent":["import { attr, godown, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { isNullable, Ranger } from \"sharekit\";\n\nimport { GlobalStyle, cssGlobalVars } from \"../../internal/global-style.js\";\n\nconst protoName = \"progress\";\n\n/**\n * {@linkcode Progress} similar to `<progress>`.\n *\n * @category feedback\n */\n@godown(protoName)\n@styles(css`\n :host {\n width: 100%;\n height: 0.5em;\n border-radius: 0.25em;\n background: var(${cssGlobalVars.passive});\n color: var(${cssGlobalVars.active});\n }\n\n :host,\n [part=\"root\"] {\n display: block;\n }\n\n [part=\"root\"] {\n z-index: 1;\n position: relative;\n border-radius: inherit;\n overflow: hidden;\n }\n\n [part=\"value\"] {\n position: absolute;\n z-index: 2;\n top: 0;\n left: 0;\n height: 100%;\n border-radius: inherit;\n transition: all 0.3s;\n animation: progress 1.8s ease-in-out infinite alternate;\n background: currentColor;\n }\n\n @keyframes progress {\n from {\n left: 0;\n }\n to {\n left: 80%;\n }\n }\n\n .static [part=\"value\"] {\n animation: none;\n }\n`)\nclass Progress extends GlobalStyle {\n @property({ type: Number })\n max = 1;\n\n @property({ type: Number })\n min = 0;\n\n @property({ type: Number })\n value: number;\n\n protected render(): TemplateResult<1> {\n let width = 20;\n let className: string;\n if (!isNullable(this.value)) {\n const ranger = new Ranger(this.min, this.max);\n const value = +this.value - this.min;\n width = (value / ranger.diff) * 100;\n className = \"static\";\n }\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n class=\"${className}\"\n >\n <i\n part=\"value\"\n style=\"width:${width}%;\"\n ></i>\n </div>\n `;\n }\n}\n\nexport default Progress;\nexport { Progress };\n"],"version":3,"file":"component.d.ts"}
@@ -0,0 +1,2 @@
1
+ import{godown,styles,attr}from"@godown/element";import{css,html}from"lit";import{property}from"lit/decorators.js";import{isNullable,Ranger}from"sharekit";import{cssGlobalVars,GlobalStyle}from"../../internal/global-style.js";import _decorate from"@oxc-project/runtime/helpers/decorate";import"../../internal/reset-style.js";const protoName=`progress`;let Progress=class e extends GlobalStyle{constructor(...e){super(...e),this.max=1,this.min=0}render(){let e=20,d;if(!isNullable(this.value)){let f=new Ranger(this.min,this.max),p=+this.value-this.min;e=p/f.diff*100,d=`static`}return html`<div part="root" ${attr(this.observedRecord)} class="${d}"> <i part="value" style="width:${e}%;"></i> </div>`}};_decorate([property({type:Number})],Progress.prototype,`max`,void 0),_decorate([property({type:Number})],Progress.prototype,`min`,void 0),_decorate([property({type:Number})],Progress.prototype,`value`,void 0),Progress=_decorate([godown(protoName),styles(css`:host{width:100%;height:.5em;border-radius:.25em;background:var(${cssGlobalVars.passive});color:var(${cssGlobalVars.active})}:host,[part=root]{display:block}[part=root]{z-index:1;position:relative;border-radius:inherit;overflow:hidden}[part=value]{position:absolute;z-index:2;top:0;left:0;height:100%;border-radius:inherit;transition:all .3s;animation:progress 1.8s ease-in-out infinite alternate;background:currentColor}@keyframes progress{0%{left:0}to{left:80%}}.static [part=value]{animation:none}`)],Progress);var Progress$1=Progress;export{Progress,Progress$1 as default};
2
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sources":["../../../src/web-components/progress/component.ts"],"sourcesContent":["import { attr, godown, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { isNullable, Ranger } from \"sharekit\";\n\nimport { GlobalStyle, cssGlobalVars } from \"../../internal/global-style.js\";\n\nconst protoName = \"progress\";\n\n/**\n * {@linkcode Progress} similar to `<progress>`.\n *\n * @category feedback\n */\n@godown(protoName)\n@styles(css`\n :host {\n width: 100%;\n height: 0.5em;\n border-radius: 0.25em;\n background: var(${cssGlobalVars.passive});\n color: var(${cssGlobalVars.active});\n }\n\n :host,\n [part=\"root\"] {\n display: block;\n }\n\n [part=\"root\"] {\n z-index: 1;\n position: relative;\n border-radius: inherit;\n overflow: hidden;\n }\n\n [part=\"value\"] {\n position: absolute;\n z-index: 2;\n top: 0;\n left: 0;\n height: 100%;\n border-radius: inherit;\n transition: all 0.3s;\n animation: progress 1.8s ease-in-out infinite alternate;\n background: currentColor;\n }\n\n @keyframes progress {\n from {\n left: 0;\n }\n to {\n left: 80%;\n }\n }\n\n .static [part=\"value\"] {\n animation: none;\n }\n`)\nclass Progress extends GlobalStyle {\n @property({ type: Number })\n max = 1;\n\n @property({ type: Number })\n min = 0;\n\n @property({ type: Number })\n value: number;\n\n protected render(): TemplateResult<1> {\n let width = 20;\n let className: string;\n if (!isNullable(this.value)) {\n const ranger = new Ranger(this.min, this.max);\n const value = +this.value - this.min;\n width = (value / ranger.diff) * 100;\n className = \"static\";\n }\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n class=\"${className}\"\n >\n <i\n part=\"value\"\n style=\"width:${width}%;\"\n ></i>\n </div>\n `;\n }\n}\n\nexport default Progress;\nexport { Progress };\n"],"names":["Progress","width","className: string","ranger","value","className"],"mappings":"mUAOA,MAAM,UAAY,WAOlB,IAAA,SAAA,MA+CMA,UAAiB,WAAY,oCAEjC,IAAM,OAGN,IAAM,EAKI,QAA4B,CACpC,IAAIC,EAAQ,GACRC,EACJ,GAAI,CAAC,WAAW,KAAK,MAAM,CAAE,CAC3B,IAAMC,EAAS,IAAI,OAAO,KAAK,IAAK,KAAK,KACnCC,EAAQ,CAAC,KAAK,MAAQ,KAAK,IACjCH,EAASG,EAAQD,EAAO,KAAQ,IAChCE,EAAY,QACb,CACD,MAAO,KAAI,CAAA,iBAGP,EAAE,KAAK,KAAK,eAAe,CAAA,QACpB,EAAEA,EAAU,gCAIJ,EAAEJ,EAAM,eAG3B,CAAC,AACF,CACF,aA/BE,SAAS,CAAE,KAAM,MAAQ,EAAC,AAAA,EAAA,SAAA,UAAA,MAAA,OAAA,YAG1B,SAAS,CAAE,KAAM,MAAQ,EAAC,AAAA,EAAA,SAAA,UAAA,MAAA,OAAA,YAG1B,SAAS,CAAE,KAAM,MAAQ,EAAC,AAAA,EAAA,SAAA,UAAA,QAAA,OAAA,CAtD5B,SAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC,gEAKQ,EAAE,cAAc,QAAQ,YAC7B,EAAE,cAAc,OAAO,yXAuCtC,CAAC,CAAC,AAAA,EAAA,SAAA,CAmCF,IAAA,WAAe"}
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,OAAO,cAAc,gBAAiB;AAItC,eAAe;eAEA;WACH,sBAAsB;EAC9B,mBAAmB;CACpB;AACF","names":[],"sources":["../../../../src/web-components/progress/definition.ts"],"sourcesContent":["import Progress from \"./component.js\";\n\nProgress.define();\n\nexport default Progress;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-progress\": Progress;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
@@ -0,0 +1,2 @@
1
+ import Progress from"./component.js";import"@godown/element";import"lit";import"lit/decorators.js";import"sharekit";import"../../internal/global-style.js";import"../../internal/reset-style.js";import"@oxc-project/runtime/helpers/decorate";Progress.define();export{Progress as default};
2
+ //# sourceMappingURL=definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.js","sources":["../../../src/web-components/progress/definition.ts"],"sourcesContent":["import Progress from \"./component.js\";\n\nProgress.define();\n\nexport default Progress;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-progress\": Progress;\n }\n}\n"],"names":[],"mappings":"+OAEA,SAAS,QAAQ"}
@@ -1,4 +1,4 @@
1
- import { Ranger } from "@godown/element";
1
+ import { Ranger } from "sharekit";
2
2
  import { type TemplateResult } from "lit";
3
3
  import { SuperInput } from "../../internal/super-input.js";
4
4
  type RangeValue = number | number[];
@@ -0,0 +1 @@
1
+ {"mappings":"AACA,SAA2B,cAAc,UAAW;AACpD,cAAc,sBAAiC,KAAM;AAKrD,SAAS,kBAAkB,+BAAgC;KAMtD;;;;;;;;;;;AAYL,cA0FM,MAAM,UAAU,aAAa,oBAAoB,WAAW,YAAY;;;;CAI5E,AACA;;;;CAKA,AACA;;;;CAKA,AACA;;;;CAKA,AACA;;;;;;CAOA,AACA,OAAO;;;;CAKP,AACA,SAAS;CAET,UACU,OAAO;CAEjB,UACU,UAAU,WAAW;CAE/B,AACA;CAEA,UAAU,SAAS;CACnB,QAAQ;CAER,IAAI,SAAS,mBAAmB,QAAQ;;;;CAOxC,IAAI;;;;CAOJ,SAASA,aAAa;CAStB,yBAAyBC,cAAcC,qBAAqBC;CAO5D,IAAI,kBAAkB;CAItB,UAAU,UAAU,eAAe;CA2BnC,UAAU,cAAcC,gBAAgB,eAAe;CAkBvD,QAAQ;;;;;CAMR,YAAYA;;;;CAiBZ;;;;;;CAUA,UAAU,mBAAmBA,iBACnBC,GAAG;;;;;;CAqBb,UAAU,gBAAgBD,iBAChBE,GAAG;;;;;;CAWb,UAAU,eAAeF,iBACfG;;;;;CAgBV,UAAU,cAAc,EAAE,SAAS,SAAqB,EAAV;;;;;;CAU9C,UAAU,qBAAqBD,GAAG;;;;;;CAqBlC,UAAU,wBAAwBE,oBAAoBC,yBAC5CH,GAAG;;;;;;CAkBb,UAAU,wBAAwBI,WAAWC,6BACnCL,GAAG;CASb,UAAU;CAcV;CAIA,QAAQ;CAIR,YAAY;AAMb;AAED,eAAe;AACf,SAAS","names":["len: number","name: string","_old: string | null","value: string | null","index: number","e: KeyboardEvent","e: MouseEvent","value: number","mouseMoveCallback: (arg0: number) => void","arg0: number","callback: (newValue: number) => void","newValue: number"],"sources":["../../../../src/web-components/range/component.ts"],"sourcesContent":["import { attr, tokenList, godown, loop, styles } from \"@godown/element\";\nimport { isNullable, omit, Ranger } from \"sharekit\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property, query, queryAll, state } from \"lit/decorators.js\";\nimport { styleMap } from \"lit/directives/style-map.js\";\n\nimport { cssGlobalVars, scopePrefix } from \"../../internal/global-style.js\";\nimport { SuperInput } from \"../../internal/super-input.js\";\nimport { ringTypeAttribute } from \"../../internal/ring.js\";\n\nconst protoName = \"range\";\nconst cssScope = scopePrefix(protoName);\n\ntype RangeValue = number | number[];\n\n/**\n * {@linkcode Range} is similar to `<input type=\"range\">`.\n *\n * Value accepts number, or array.\n *\n * Number has 1 handle, the array has the number of its elements.\n *\n * @fires range - Fires when the value changes.\n * @category input\n */\n@godown(protoName)\n@styles(\n css`\n :host {\n ${cssScope}--track-width: .5em;\n ${cssScope}--handle-scale: 1;\n ${cssScope}--track-background: var(${cssGlobalVars.active});\n background: var(${cssGlobalVars.passive});\n width: 100%;\n display: block;\n height: var(${cssScope}--track-width);\n }\n\n :host([contents]) [part=\"root\"] {\n width: inherit;\n }\n\n :host([vertical]) {\n height: 100%;\n width: fit-content;\n }\n\n [part=\"root\"] {\n min-height: inherit;\n position: relative;\n border-radius: inherit;\n --from: 0%;\n --to: 50%;\n }\n\n [part=\"track\"] {\n height: 100%;\n min-height: inherit;\n display: flex;\n position: absolute;\n pointer-events: none;\n border-radius: inherit;\n justify-content: space-between;\n left: min(var(--from), var(--to));\n background: var(${cssScope}--track-background);\n width: max(calc(var(--to) - var(--from)), calc(var(--from) - var(--to)));\n }\n\n [part~=\"handle\"] {\n width: 1em;\n height: 1em;\n display: flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n position: absolute;\n border-radius: 50%;\n transform-origin: 0% 25%;\n outline: 0;\n border-style: solid;\n border-width: 0.1em;\n transform: scale(var(${cssScope}--handle-scale)) translate(-50%, -25%);\n background: var(${cssGlobalVars.background});\n border-color: currentColor;\n }\n `,\n css`\n [vertical] {\n height: inherit;\n width: var(${cssScope}--track-width);\n }\n\n [vertical] i {\n transform: translate(-25%, -50%);\n }\n\n [vertical] [part=\"track\"] {\n width: 100%;\n height: max(calc(var(--to) - var(--from)), calc(var(--from) - var(--to)));\n top: min(var(--from), var(--to));\n left: 0;\n }\n `,\n css`\n [part~=\"handle\"] {\n left: var(--handle);\n top: 0;\n }\n\n [vertical] [part~=\"handle\"] {\n top: var(--handle);\n left: 0;\n }\n `,\n)\nclass Range<V extends RangeValue = RangeValue> extends SuperInput<RangeValue> {\n /**\n * Minimum value.\n */\n @property({ type: Number })\n min = 0;\n\n /**\n * Maximum value.\n */\n @property({ type: Number })\n max = 100;\n\n /**\n * Sliding step length.\n */\n @property({ type: Number })\n step: number;\n\n /**\n * Whether to display the range vertically.\n */\n @property({ type: Boolean, reflect: true })\n vertical = false;\n\n /**\n * Value, or each of values, will render a handle.\n *\n * Accepts number or array of numbers.\n */\n @property({ type: Array })\n value: V;\n\n /**\n * The default of `{@linkcode this.value}`.\n */\n @property({ type: Array })\n default: V;\n\n @query(\"[part=root]\")\n protected _root: HTMLElement;\n\n @queryAll(\"[part=handle]\")\n protected _handles: NodeListOf<HTMLElement>;\n\n @state()\n lastFocus?: number;\n\n protected _ranger: Ranger;\n private __focusStack: number[] = [];\n\n get range(): V extends number ? false : true {\n return Array.isArray(this.value) as any;\n }\n\n /**\n * Return values in the form of an array.\n */\n get rangeValue(): number[] {\n return (this.range ? this.value : [this.value]) as number[];\n }\n\n /**\n * Pad the value to the specified length.\n */\n padValue(len: number, value = 0): number[] {\n const { rangeValue } = this;\n const miss = len - rangeValue.length;\n if (miss > 0) {\n return new Array(miss).fill(value).concat(rangeValue);\n }\n return rangeValue;\n }\n\n attributeChangedCallback(name: string, _old: string | null, value: string | null): void {\n super.attributeChangedCallback(name, _old, value);\n if (name === \"max\" || name === \"min\" || name === \"step\") {\n this._ranger = new Ranger(this.min, this.max, this.step);\n }\n }\n\n get observedRecord(): Record<string, any> {\n return omit(super.observedRecord, ringTypeAttribute);\n }\n\n protected render(): TemplateResult<1> {\n const rangeValue = this.padValue(2);\n const from = Math.min(...rangeValue);\n const to = Math.max(...rangeValue);\n const gap = this._ranger.diff;\n\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n @mousedown=\"${this.disabled ? null : this._handleMousedownRoot}\"\n style=\"${styleMap(\n Object.fromEntries([\n [\"--from\", `${((from - this.min) / gap) * 100}%`],\n [\"--to\", `${((to - this.min) / gap) * 100}%`],\n ...rangeValue.map(\n (value, index) => [`--handle-${index}`, `${((value - this.min) / gap) * 100}%`] as [string, string],\n ),\n ]),\n )}\"\n >\n <div part=\"track\"></div>\n ${loop(this.rangeValue.length, (index) => this._renderHandle(index))}\n </div>\n `;\n }\n\n protected _renderHandle(index: number): TemplateResult<1> {\n const { disabled, range, rangeValue } = this;\n\n // in single-handle mod (value is a number or an array with length 1),\n const end = !range || (range && index === rangeValue.length - 1 && rangeValue.length === 1);\n return html`\n <i\n tabindex=\"0\"\n part=\"${tokenList(\"handle\", `handle-${index}`)}\"\n @mousedown=\"${disabled ? null : this.createMouseDown(index)}\"\n style=\"${styleMap({\n \"z-index\": this.__focusStack.indexOf(index) + 1,\n \"--handle\": `var(--${end ? \"to\" : `handle-${index}`})`,\n })}\"\n ></i>\n `;\n }\n\n private __keydownEvent: EventListenerOrEventListenerObject;\n\n /**\n * Focuses the handle at the given index, updates the focus stack.\n * @param index - The index of the handle to focus.\n */\n focusHandle(index: number): void {\n this.lastFocus = index;\n const indexOfFocusStack = this.__focusStack.indexOf(index);\n if (indexOfFocusStack !== -1) {\n this.__focusStack.splice(indexOfFocusStack, 1);\n }\n this.__focusStack.push(index);\n const handleItem = this._handles.item(index);\n handleItem?.focus();\n if (!this.__keydownEvent) {\n this.__keydownEvent = this.events.add(document, \"keydown\", this.createKeydownEvent(index));\n }\n }\n\n /**\n * Removes the focus from the currently focused handle.\n */\n blurHandle(): void {\n this.lastFocus = undefined;\n this.__keydownEvent = this.events.remove(document, \"keydown\", this.__keydownEvent);\n }\n\n /**\n * Creates a keydown event handler that updates the value of the range based on arrow key presses.\n * @param index - The index of the handle to update.\n * @returns A function that handles the keydown event and updates the range value.\n */\n protected createKeydownEvent(index: number) {\n return (e: KeyboardEvent): void => {\n const { rangeValue, step } = this;\n if (rangeValue.length < 2) {\n index = 0;\n }\n const old = rangeValue[index];\n if (e.key === \"ArrowLeft\" || e.key === \"ArrowDown\") {\n e.preventDefault();\n this.createSetValue(index)(old - step);\n } else if (e.key === \"ArrowRight\" || e.key === \"ArrowUp\") {\n e.preventDefault();\n this.createSetValue(index)(old + step);\n }\n };\n }\n\n /**\n * Creates a mouse down event handler that focuses the handle at the given index and sets the value of the range.\n * @param index - The index of the handle to focus.\n * @returns A function that handles the mouse down event and updates the range value.\n */\n protected createMouseDown(index: number) {\n return (e: MouseEvent): void => {\n this.focusHandle(index);\n this.createMousedownListener(this.createSetValue(index))(e);\n };\n }\n\n /**\n * Creates a function that sets the value of the range at the given index.\n * @param index - The index of the value to set.\n * @returns A function that sets the value of the range.\n */\n protected createSetValue(index: number) {\n return (value: number): void => {\n const normalizeValue = this._ranger.normalize(value);\n let newValue: RangeValue = normalizeValue;\n if (this.range) {\n newValue = [...(this.value as number[])];\n newValue[index] = normalizeValue;\n }\n this.value = newValue as V;\n this.dispatchCustomEvent(\"change\", this.value);\n };\n }\n\n /**\n * Compute value from event.\n * @returns The value closest to the event client position.\n */\n protected _computeValue({ clientX, clientY }: MouseEvent): number {\n const { top, left, height, width } = this._root.getBoundingClientRect();\n return this._ranger.present(this.vertical ? (clientY - top) / height : (clientX - left) / width);\n }\n\n /**\n * Handles the mouse down event on the root element of the range component.\n * Computes the closest value to the mouse position, sets the value, and focuses the corresponding handle.\n * @param e - The mouse down event object.\n */\n protected _handleMousedownRoot(e: MouseEvent): void {\n const value = this._computeValue(e);\n const index = this.range\n ? this.rangeValue.reduce((acc, item, index) => {\n const diff = Math.abs(value - item);\n const prevDiff = Math.abs(value - this.rangeValue[acc]);\n return diff < prevDiff ? index : acc;\n }, 0)\n : 0;\n\n const set = this.createSetValue(index);\n set(value);\n this.createMousedownListener(set)(e);\n this.focusHandle(index);\n }\n\n /**\n * Creates a mouse down event handler that focuses the handle at the given index and sets the value of the range.\n * @param index - The index of the handle to focus.\n * @returns A function that handles the mouse down event and updates the range value.\n */\n protected createMousedownListener(mouseMoveCallback: (arg0: number) => void) {\n return (e: MouseEvent): void => {\n e.preventDefault();\n e.stopPropagation();\n const move = this.createMousemoveListener(mouseMoveCallback);\n this.events.add(document, \"mousemove\", move);\n const stop = () => {\n this.events.remove(document, \"mousemove\", move);\n this.events.remove(document, \"mouseup\", stop);\n };\n this.events.add(document, \"mouseup\", stop);\n };\n }\n\n /**\n * Creates a mouse move event handler that updates the range value based on the mouse position.\n * @param callback - A function to call with the new value when the mouse is moved.\n * @returns A function that handles the mouse move event and updates the range value.\n */\n protected createMousemoveListener(callback: (newValue: number) => void) {\n return (e: MouseEvent): void => {\n const value = this._computeValue(e);\n if (value !== this._ranger.restrict(value)) {\n return;\n }\n callback?.call(this, value);\n };\n }\n\n protected _connectedInit(): void {\n this._ranger = new Ranger(this.min, this.max, this.step);\n const gap = this._ranger.diff;\n this.step ||= gap / 100;\n if (isNullable(this.value)) {\n if (!isNullable(this.default)) {\n this.value = this.default;\n } else {\n (this.value as number) = Math.round(gap / 2 / this.step) * this.step;\n }\n }\n this.default ??= this.value;\n }\n\n reset(): void {\n this.value = this.default;\n }\n\n sort(): V {\n return (this.value = this.toSorted());\n }\n\n toSorted(): V {\n if (this.range) {\n return [...(this.value as number[])].sort((a, b) => a - b) as V;\n }\n return this.value;\n }\n}\n\nexport default Range;\nexport { Range };\n"],"version":3,"file":"component.d.ts"}
@@ -0,0 +1,2 @@
1
+ import{godown,styles,attr,loop,tokenList}from"@godown/element";import{Ranger,omit,isNullable}from"sharekit";import{css,html}from"lit";import{property,query,queryAll,state}from"lit/decorators.js";import{styleMap}from"lit/directives/style-map.js";import{scopePrefix,cssGlobalVars}from"../../internal/global-style.js";import{SuperInput}from"../../internal/super-input.js";import{ringTypeAttribute}from"../../internal/ring.js";import _decorate from"@oxc-project/runtime/helpers/decorate";import"../../internal/reset-style.js";const protoName=`range`,cssScope=scopePrefix(protoName);let Range=class e extends SuperInput{constructor(...e){super(...e),this.min=0,this.max=100,this.vertical=!1,this.__focusStack=[]}get range(){return Array.isArray(this.value)}get rangeValue(){return this.range?this.value:[this.value]}padValue(e,y=0){let{rangeValue:b}=this,x=e-b.length;return x>0?Array(x).fill(y).concat(b):b}attributeChangedCallback(e,y,b){super.attributeChangedCallback(e,y,b),(e===`max`||e===`min`||e===`step`)&&(this._ranger=new Ranger(this.min,this.max,this.step))}get observedRecord(){return omit(super.observedRecord,ringTypeAttribute)}render(){let e=this.padValue(2),y=Math.min(...e),S=Math.max(...e),C=this._ranger.diff;return html`<div part="root" ${attr(this.observedRecord)} @mousedown="${this.disabled?null:this._handleMousedownRoot}" style="${styleMap(Object.fromEntries([[`--from`,`${(y-this.min)/C*100}%`],[`--to`,`${(S-this.min)/C*100}%`],...e.map((e,y)=>[`--handle-${y}`,`${(e-this.min)/C*100}%`])]))}"> <div part="track"></div> ${loop(this.rangeValue.length,e=>this._renderHandle(e))} </div>`}_renderHandle(e){let{disabled:y,range:b,rangeValue:x}=this,C=!b||b&&e===x.length-1&&x.length===1;return html`<i tabindex="0" part="${tokenList(`handle`,`handle-${e}`)}" @mousedown="${y?null:this.createMouseDown(e)}" style="${styleMap({"z-index":this.__focusStack.indexOf(e)+1,"--handle":`var(--${C?`to`:`handle-${e}`})`})}"></i>`}focusHandle(e){this.lastFocus=e;let y=this.__focusStack.indexOf(e);y!==-1&&this.__focusStack.splice(y,1),this.__focusStack.push(e);let b=this._handles.item(e);b?.focus(),this.__keydownEvent||=this.events.add(document,`keydown`,this.createKeydownEvent(e))}blurHandle(){this.lastFocus=void 0,this.__keydownEvent=this.events.remove(document,`keydown`,this.__keydownEvent)}createKeydownEvent(e){return y=>{let{rangeValue:b,step:x}=this;b.length<2&&(e=0);let S=b[e];y.key===`ArrowLeft`||y.key===`ArrowDown`?(y.preventDefault(),this.createSetValue(e)(S-x)):(y.key===`ArrowRight`||y.key===`ArrowUp`)&&(y.preventDefault(),this.createSetValue(e)(S+x))}}createMouseDown(e){return y=>{this.focusHandle(e),this.createMousedownListener(this.createSetValue(e))(y)}}createSetValue(e){return y=>{let b=this._ranger.normalize(y),x=b;this.range&&(x=[...this.value],x[e]=b),this.value=x,this.dispatchCustomEvent(`change`,this.value)}}_computeValue({clientX:e,clientY:y}){let{top:b,left:x,height:S,width:C}=this._root.getBoundingClientRect();return this._ranger.present(this.vertical?(y-b)/S:(e-x)/C)}_handleMousedownRoot(e){let y=this._computeValue(e),b=this.range?this.rangeValue.reduce((e,b,x)=>{let S=Math.abs(y-b),C=Math.abs(y-this.rangeValue[e]);return S<C?x:e},0):0,x=this.createSetValue(b);x(y),this.createMousedownListener(x)(e),this.focusHandle(b)}createMousedownListener(e){return y=>{y.preventDefault(),y.stopPropagation();let b=this.createMousemoveListener(e);this.events.add(document,`mousemove`,b);let x=()=>{this.events.remove(document,`mousemove`,b),this.events.remove(document,`mouseup`,x)};this.events.add(document,`mouseup`,x)}}createMousemoveListener(e){return y=>{let b=this._computeValue(y);b===this._ranger.restrict(b)&&e?.call(this,b)}}_connectedInit(){this._ranger=new Ranger(this.min,this.max,this.step);let e=this._ranger.diff;this.step||=e/100,isNullable(this.value)&&(isNullable(this.default)?this.value=Math.round(e/2/this.step)*this.step:this.value=this.default),this.default??=this.value}reset(){this.value=this.default}sort(){return this.value=this.toSorted()}toSorted(){return this.range?[...this.value].sort((e,y)=>e-y):this.value}};_decorate([property({type:Number})],Range.prototype,`min`,void 0),_decorate([property({type:Number})],Range.prototype,`max`,void 0),_decorate([property({type:Number})],Range.prototype,`step`,void 0),_decorate([property({type:Boolean,reflect:!0})],Range.prototype,`vertical`,void 0),_decorate([property({type:Array})],Range.prototype,`value`,void 0),_decorate([property({type:Array})],Range.prototype,`default`,void 0),_decorate([query(`[part=root]`)],Range.prototype,`_root`,void 0),_decorate([queryAll(`[part=handle]`)],Range.prototype,`_handles`,void 0),_decorate([state()],Range.prototype,`lastFocus`,void 0),Range=_decorate([godown(protoName),styles(css`:host{${cssScope}--track-width:.5em;${cssScope}--handle-scale:1;${cssScope}--track-background:var(${cssGlobalVars.active});background:var(${cssGlobalVars.passive});width:100%;display:block;height:var(${cssScope}--track-width)}:host([contents]) [part=root]{width:inherit}:host([vertical]){height:100%;width:-moz-fit-content;width:fit-content}[part=root]{min-height:inherit;position:relative;border-radius:inherit;--from:0%;--to:50%}[part=track]{height:100%;min-height:inherit;display:flex;position:absolute;pointer-events:none;border-radius:inherit;justify-content:space-between;left:min(var(--from),var(--to));background:var(${cssScope}--track-background);width:max(calc(var(--to) - var(--from)),calc(var(--from) - var(--to)))}[part~=handle]{width:1em;height:1em;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;position:absolute;border-radius:50%;transform-origin:0 25%;outline:0;border-style:solid;border-width:.1em;transform:scale(var(${cssScope}--handle-scale)) translate(-50%,-25%);background:var(${cssGlobalVars.background});border-color:currentColor}`,css`[vertical]{height:inherit;width:var(${cssScope}--track-width)}[vertical] i{transform:translate(-25%,-50%)}[vertical] [part=track]{width:100%;height:max(calc(var(--to) - var(--from)),calc(var(--from) - var(--to)));top:min(var(--from),var(--to));left:0}`,css`[part~=handle]{left:var(--handle);top:0}[vertical] [part~=handle]{top:var(--handle);left:0} `)],Range);var Range$1=Range;export{Range,Range$1 as default};
2
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sources":["../../../src/web-components/range/component.ts"],"sourcesContent":["import { attr, tokenList, godown, loop, styles } from \"@godown/element\";\nimport { isNullable, omit, Ranger } from \"sharekit\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property, query, queryAll, state } from \"lit/decorators.js\";\nimport { styleMap } from \"lit/directives/style-map.js\";\n\nimport { cssGlobalVars, scopePrefix } from \"../../internal/global-style.js\";\nimport { SuperInput } from \"../../internal/super-input.js\";\nimport { ringTypeAttribute } from \"../../internal/ring.js\";\n\nconst protoName = \"range\";\nconst cssScope = scopePrefix(protoName);\n\ntype RangeValue = number | number[];\n\n/**\n * {@linkcode Range} is similar to `<input type=\"range\">`.\n *\n * Value accepts number, or array.\n *\n * Number has 1 handle, the array has the number of its elements.\n *\n * @fires range - Fires when the value changes.\n * @category input\n */\n@godown(protoName)\n@styles(\n css`\n :host {\n ${cssScope}--track-width: .5em;\n ${cssScope}--handle-scale: 1;\n ${cssScope}--track-background: var(${cssGlobalVars.active});\n background: var(${cssGlobalVars.passive});\n width: 100%;\n display: block;\n height: var(${cssScope}--track-width);\n }\n\n :host([contents]) [part=\"root\"] {\n width: inherit;\n }\n\n :host([vertical]) {\n height: 100%;\n width: fit-content;\n }\n\n [part=\"root\"] {\n min-height: inherit;\n position: relative;\n border-radius: inherit;\n --from: 0%;\n --to: 50%;\n }\n\n [part=\"track\"] {\n height: 100%;\n min-height: inherit;\n display: flex;\n position: absolute;\n pointer-events: none;\n border-radius: inherit;\n justify-content: space-between;\n left: min(var(--from), var(--to));\n background: var(${cssScope}--track-background);\n width: max(calc(var(--to) - var(--from)), calc(var(--from) - var(--to)));\n }\n\n [part~=\"handle\"] {\n width: 1em;\n height: 1em;\n display: flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n position: absolute;\n border-radius: 50%;\n transform-origin: 0% 25%;\n outline: 0;\n border-style: solid;\n border-width: 0.1em;\n transform: scale(var(${cssScope}--handle-scale)) translate(-50%, -25%);\n background: var(${cssGlobalVars.background});\n border-color: currentColor;\n }\n `,\n css`\n [vertical] {\n height: inherit;\n width: var(${cssScope}--track-width);\n }\n\n [vertical] i {\n transform: translate(-25%, -50%);\n }\n\n [vertical] [part=\"track\"] {\n width: 100%;\n height: max(calc(var(--to) - var(--from)), calc(var(--from) - var(--to)));\n top: min(var(--from), var(--to));\n left: 0;\n }\n `,\n css`\n [part~=\"handle\"] {\n left: var(--handle);\n top: 0;\n }\n\n [vertical] [part~=\"handle\"] {\n top: var(--handle);\n left: 0;\n }\n `,\n)\nclass Range<V extends RangeValue = RangeValue> extends SuperInput<RangeValue> {\n /**\n * Minimum value.\n */\n @property({ type: Number })\n min = 0;\n\n /**\n * Maximum value.\n */\n @property({ type: Number })\n max = 100;\n\n /**\n * Sliding step length.\n */\n @property({ type: Number })\n step: number;\n\n /**\n * Whether to display the range vertically.\n */\n @property({ type: Boolean, reflect: true })\n vertical = false;\n\n /**\n * Value, or each of values, will render a handle.\n *\n * Accepts number or array of numbers.\n */\n @property({ type: Array })\n value: V;\n\n /**\n * The default of `{@linkcode this.value}`.\n */\n @property({ type: Array })\n default: V;\n\n @query(\"[part=root]\")\n protected _root: HTMLElement;\n\n @queryAll(\"[part=handle]\")\n protected _handles: NodeListOf<HTMLElement>;\n\n @state()\n lastFocus?: number;\n\n protected _ranger: Ranger;\n private __focusStack: number[] = [];\n\n get range(): V extends number ? false : true {\n return Array.isArray(this.value) as any;\n }\n\n /**\n * Return values in the form of an array.\n */\n get rangeValue(): number[] {\n return (this.range ? this.value : [this.value]) as number[];\n }\n\n /**\n * Pad the value to the specified length.\n */\n padValue(len: number, value = 0): number[] {\n const { rangeValue } = this;\n const miss = len - rangeValue.length;\n if (miss > 0) {\n return new Array(miss).fill(value).concat(rangeValue);\n }\n return rangeValue;\n }\n\n attributeChangedCallback(name: string, _old: string | null, value: string | null): void {\n super.attributeChangedCallback(name, _old, value);\n if (name === \"max\" || name === \"min\" || name === \"step\") {\n this._ranger = new Ranger(this.min, this.max, this.step);\n }\n }\n\n get observedRecord(): Record<string, any> {\n return omit(super.observedRecord, ringTypeAttribute);\n }\n\n protected render(): TemplateResult<1> {\n const rangeValue = this.padValue(2);\n const from = Math.min(...rangeValue);\n const to = Math.max(...rangeValue);\n const gap = this._ranger.diff;\n\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n @mousedown=\"${this.disabled ? null : this._handleMousedownRoot}\"\n style=\"${styleMap(\n Object.fromEntries([\n [\"--from\", `${((from - this.min) / gap) * 100}%`],\n [\"--to\", `${((to - this.min) / gap) * 100}%`],\n ...rangeValue.map(\n (value, index) => [`--handle-${index}`, `${((value - this.min) / gap) * 100}%`] as [string, string],\n ),\n ]),\n )}\"\n >\n <div part=\"track\"></div>\n ${loop(this.rangeValue.length, (index) => this._renderHandle(index))}\n </div>\n `;\n }\n\n protected _renderHandle(index: number): TemplateResult<1> {\n const { disabled, range, rangeValue } = this;\n\n // in single-handle mod (value is a number or an array with length 1),\n const end = !range || (range && index === rangeValue.length - 1 && rangeValue.length === 1);\n return html`\n <i\n tabindex=\"0\"\n part=\"${tokenList(\"handle\", `handle-${index}`)}\"\n @mousedown=\"${disabled ? null : this.createMouseDown(index)}\"\n style=\"${styleMap({\n \"z-index\": this.__focusStack.indexOf(index) + 1,\n \"--handle\": `var(--${end ? \"to\" : `handle-${index}`})`,\n })}\"\n ></i>\n `;\n }\n\n private __keydownEvent: EventListenerOrEventListenerObject;\n\n /**\n * Focuses the handle at the given index, updates the focus stack.\n * @param index - The index of the handle to focus.\n */\n focusHandle(index: number): void {\n this.lastFocus = index;\n const indexOfFocusStack = this.__focusStack.indexOf(index);\n if (indexOfFocusStack !== -1) {\n this.__focusStack.splice(indexOfFocusStack, 1);\n }\n this.__focusStack.push(index);\n const handleItem = this._handles.item(index);\n handleItem?.focus();\n if (!this.__keydownEvent) {\n this.__keydownEvent = this.events.add(document, \"keydown\", this.createKeydownEvent(index));\n }\n }\n\n /**\n * Removes the focus from the currently focused handle.\n */\n blurHandle(): void {\n this.lastFocus = undefined;\n this.__keydownEvent = this.events.remove(document, \"keydown\", this.__keydownEvent);\n }\n\n /**\n * Creates a keydown event handler that updates the value of the range based on arrow key presses.\n * @param index - The index of the handle to update.\n * @returns A function that handles the keydown event and updates the range value.\n */\n protected createKeydownEvent(index: number) {\n return (e: KeyboardEvent): void => {\n const { rangeValue, step } = this;\n if (rangeValue.length < 2) {\n index = 0;\n }\n const old = rangeValue[index];\n if (e.key === \"ArrowLeft\" || e.key === \"ArrowDown\") {\n e.preventDefault();\n this.createSetValue(index)(old - step);\n } else if (e.key === \"ArrowRight\" || e.key === \"ArrowUp\") {\n e.preventDefault();\n this.createSetValue(index)(old + step);\n }\n };\n }\n\n /**\n * Creates a mouse down event handler that focuses the handle at the given index and sets the value of the range.\n * @param index - The index of the handle to focus.\n * @returns A function that handles the mouse down event and updates the range value.\n */\n protected createMouseDown(index: number) {\n return (e: MouseEvent): void => {\n this.focusHandle(index);\n this.createMousedownListener(this.createSetValue(index))(e);\n };\n }\n\n /**\n * Creates a function that sets the value of the range at the given index.\n * @param index - The index of the value to set.\n * @returns A function that sets the value of the range.\n */\n protected createSetValue(index: number) {\n return (value: number): void => {\n const normalizeValue = this._ranger.normalize(value);\n let newValue: RangeValue = normalizeValue;\n if (this.range) {\n newValue = [...(this.value as number[])];\n newValue[index] = normalizeValue;\n }\n this.value = newValue as V;\n this.dispatchCustomEvent(\"change\", this.value);\n };\n }\n\n /**\n * Compute value from event.\n * @returns The value closest to the event client position.\n */\n protected _computeValue({ clientX, clientY }: MouseEvent): number {\n const { top, left, height, width } = this._root.getBoundingClientRect();\n return this._ranger.present(this.vertical ? (clientY - top) / height : (clientX - left) / width);\n }\n\n /**\n * Handles the mouse down event on the root element of the range component.\n * Computes the closest value to the mouse position, sets the value, and focuses the corresponding handle.\n * @param e - The mouse down event object.\n */\n protected _handleMousedownRoot(e: MouseEvent): void {\n const value = this._computeValue(e);\n const index = this.range\n ? this.rangeValue.reduce((acc, item, index) => {\n const diff = Math.abs(value - item);\n const prevDiff = Math.abs(value - this.rangeValue[acc]);\n return diff < prevDiff ? index : acc;\n }, 0)\n : 0;\n\n const set = this.createSetValue(index);\n set(value);\n this.createMousedownListener(set)(e);\n this.focusHandle(index);\n }\n\n /**\n * Creates a mouse down event handler that focuses the handle at the given index and sets the value of the range.\n * @param index - The index of the handle to focus.\n * @returns A function that handles the mouse down event and updates the range value.\n */\n protected createMousedownListener(mouseMoveCallback: (arg0: number) => void) {\n return (e: MouseEvent): void => {\n e.preventDefault();\n e.stopPropagation();\n const move = this.createMousemoveListener(mouseMoveCallback);\n this.events.add(document, \"mousemove\", move);\n const stop = () => {\n this.events.remove(document, \"mousemove\", move);\n this.events.remove(document, \"mouseup\", stop);\n };\n this.events.add(document, \"mouseup\", stop);\n };\n }\n\n /**\n * Creates a mouse move event handler that updates the range value based on the mouse position.\n * @param callback - A function to call with the new value when the mouse is moved.\n * @returns A function that handles the mouse move event and updates the range value.\n */\n protected createMousemoveListener(callback: (newValue: number) => void) {\n return (e: MouseEvent): void => {\n const value = this._computeValue(e);\n if (value !== this._ranger.restrict(value)) {\n return;\n }\n callback?.call(this, value);\n };\n }\n\n protected _connectedInit(): void {\n this._ranger = new Ranger(this.min, this.max, this.step);\n const gap = this._ranger.diff;\n this.step ||= gap / 100;\n if (isNullable(this.value)) {\n if (!isNullable(this.default)) {\n this.value = this.default;\n } else {\n (this.value as number) = Math.round(gap / 2 / this.step) * this.step;\n }\n }\n this.default ??= this.value;\n }\n\n reset(): void {\n this.value = this.default;\n }\n\n sort(): V {\n return (this.value = this.toSorted());\n }\n\n toSorted(): V {\n if (this.range) {\n return [...(this.value as number[])].sort((a, b) => a - b) as V;\n }\n return this.value;\n }\n}\n\nexport default Range;\nexport { Range };\n"],"names":["Range","len: number","value","miss","len","rangeValue","new Array(miss)","name: string","_old: string | null","value: string | null","name","_old","from","to","gap","index","index: number","end","range","disabled","indexOfFocusStack","handleItem","e: KeyboardEvent","old","e","step","e: MouseEvent","value: number","normalizeValue","newValue: RangeValue","newValue","clientY","top","height","clientX","left","width","acc","item","diff","prevDiff","set","mouseMoveCallback: (arg0: number) => void","move","mouseMoveCallback","stop","callback: (newValue: number) => void","callback","a","b"],"mappings":"0gBAUA,MAAM,UAAY,QACZ,SAAW,YAAY,UAAU,CAcvC,IAAA,MAAA,MA0FMA,UAAiD,UAAuB,oCAK5E,IAAM,OAMN,IAAM,SAYN,SAAW,GA0BH,KAAA,aAAyB,CAAE,EAEnC,IAAI,OAAyC,CAC3C,OAAO,MAAM,QAAQ,KAAK,MAAM,AACjC,CAKD,IAAI,YAAuB,CACzB,OAAQ,KAAK,MAAQ,KAAK,MAAQ,CAAC,KAAK,KAAM,CAC/C,CAKD,SAASC,EAAaC,EAAQ,EAAa,CACzC,GAAM,CAAE,aAAY,CAAG,KACjBC,EAAOC,EAAMC,EAAW,OAI9B,OAHIF,EAAO,EACFG,MAAUH,EAAA,CAAM,KAAKD,EAAM,CAAC,OAAOG,EAAW,CAEhDA,CACR,CAED,yBAAyBE,EAAcC,EAAqBC,EAA4B,CACtF,MAAM,yBAAyBC,EAAMC,EAAMT,EAAM,EAC7CQ,IAAS,OAASA,IAAS,OAASA,IAAS,UAC/C,KAAK,QAAU,IAAI,OAAO,KAAK,IAAK,KAAK,IAAK,KAAK,MAEtD,CAED,IAAI,gBAAsC,CACxC,OAAO,KAAK,MAAM,eAAgB,kBAAkB,AACrD,CAES,QAA4B,CACpC,IAAML,EAAa,KAAK,SAAS,EAAE,CAC7BO,EAAO,KAAK,IAAI,GAAGP,EAAW,CAC9BQ,EAAK,KAAK,IAAI,GAAGR,EAAW,CAC5BS,EAAM,KAAK,QAAQ,KAEzB,MAAO,KAAI,CAAA,iBAGP,EAAE,KAAK,KAAK,eAAe,CAAA,aACf,EAAE,KAAK,SAAW,KAAO,KAAK,qBAAqB,SACxD,EAAE,SACP,OAAO,YAAY,CACjB,CAAC,SAAU,IAAKF,EAAO,KAAK,KAAOE,EAAO,IAAI,CAAC,CAAC,AAAC,EACjD,CAAC,OAAQ,IAAKD,EAAK,KAAK,KAAOC,EAAO,IAAI,CAAC,CAAC,AAAC,EAC7C,GAAGT,EAAW,IACZ,CAACH,EAAOa,IAAU,CAAC,CAAC,SAAS,EAAEA,GAAO,CAAE,IAAKb,EAAQ,KAAK,KAAOY,EAAO,IAAI,CAAC,CAAC,AAAC,EAAA,AAElF,EAAC,CACH,CAAC,4BAGF,EAAE,KAAK,KAAK,WAAW,OAAQ,AAACC,GAAU,KAAK,cAAcA,EAAM,CAAC,CAAA,OAExE,CAAC,AACF,CAES,cAAcC,EAAkC,CACxD,GAAM,CAAE,WAAU,QAAO,aAAY,CAAG,KAGlCC,EAAM,CAACC,GAAUA,GAASH,IAAUV,EAAW,OAAS,GAAKA,EAAW,SAAW,EACzF,MAAO,KAAI,CAAA,sBAGD,EAAE,UAAU,SAAU,CAAC,OAAO,EAAEU,GAAO,CAAC,CAAC,cACnC,EAAEI,EAAW,KAAO,KAAK,gBAAgBJ,EAAM,CAAC,SACrD,EAAE,SAAS,CAChB,UAAW,KAAK,aAAa,QAAQA,EAAM,CAAG,EAC9C,WAAY,CAAC,MAAM,EAAEE,EAAM,KAAO,CAAC,OAAO,EAAEF,GAAO,CAAC,CAAC,CAAA,AACtD,EAAC,CAAC,MAEP,CAAC,AACF,CAQD,YAAYC,EAAqB,CAC/B,KAAK,UAAYD,EACjB,IAAMK,EAAoB,KAAK,aAAa,QAAQL,EAAM,CACtDK,IAAsB,IACxB,KAAK,aAAa,OAAOA,EAAmB,EAAE,CAEhD,KAAK,aAAa,KAAKL,EAAM,CAC7B,IAAMM,EAAa,KAAK,SAAS,KAAKN,EAAM,CAC5CM,GAAY,OAAO,CAEjB,KAAK,iBAAiB,KAAK,OAAO,IAAI,SAAU,UAAW,KAAK,mBAAmBN,EAAM,CAAC,AAE7F,CAKD,YAAmB,CACjB,KAAK,UAAY,OACjB,KAAK,eAAiB,KAAK,OAAO,OAAO,SAAU,UAAW,KAAK,eAAe,AACnF,CAOS,mBAAmBC,EAAe,CAC1C,MAAO,CAACM,GAA2B,CACjC,GAAM,CAAE,aAAY,OAAM,CAAG,KACzBjB,EAAW,OAAS,IACtBU,EAAQ,GAEV,IAAMQ,EAAMlB,EAAWU,GACnBS,EAAE,MAAQ,aAAeA,EAAE,MAAQ,aACrCA,EAAE,gBAAgB,CAClB,KAAK,eAAeT,EAAM,CAACQ,EAAME,EAAK,GAC7BD,EAAE,MAAQ,cAAgBA,EAAE,MAAQ,aAC7CA,EAAE,gBAAgB,CAClB,KAAK,eAAeT,EAAM,CAACQ,EAAME,EAAK,CAEzC,CACF,CAOS,gBAAgBT,EAAe,CACvC,MAAO,CAACU,GAAwB,CAC9B,KAAK,YAAYX,EAAM,CACvB,KAAK,wBAAwB,KAAK,eAAeA,EAAM,CAAC,CAACS,EAAE,AAC5D,CACF,CAOS,eAAeR,EAAe,CACtC,MAAO,CAACW,GAAwB,CAC9B,IAAMC,EAAiB,KAAK,QAAQ,UAAU1B,EAAM,CAChD2B,EAAuBD,EACvB,KAAK,QACPE,EAAW,CAAC,GAAI,KAAK,KAAmB,EACxCA,EAASf,GAASa,GAEpB,KAAK,MAAQE,EACb,KAAK,oBAAoB,SAAU,KAAK,MAAM,AAC/C,CACF,CAMS,cAAc,CAAE,UAAS,UAAqB,CAAU,CAChE,GAAM,CAAE,MAAK,OAAM,SAAQ,QAAO,CAAG,KAAK,MAAM,uBAAuB,CACvE,OAAO,KAAK,QAAQ,QAAQ,KAAK,UAAYC,EAAUC,GAAOC,GAAUC,EAAUC,GAAQC,EAAM,AACjG,CAOS,qBAAqBV,EAAqB,CAClD,IAAMxB,EAAQ,KAAK,cAAc,EAAE,CAC7Ba,EAAQ,KAAK,MACf,KAAK,WAAW,OAAO,CAACsB,EAAKC,EAAMvB,IAAU,CAC3C,IAAMwB,EAAO,KAAK,IAAIrC,EAAQoC,EAAK,CAC7BE,EAAW,KAAK,IAAItC,EAAQ,KAAK,WAAWmC,GAAK,CACvD,OAAOE,EAAOC,EAAWzB,EAAQsB,CAClC,EAAE,EAAE,CACL,EAEEI,EAAM,KAAK,eAAe1B,EAAM,CACtC0B,EAAIvC,EAAM,CACV,KAAK,wBAAwBuC,EAAI,CAAC,EAAE,CACpC,KAAK,YAAY1B,EAAM,AACxB,CAOS,wBAAwB2B,EAA2C,CAC3E,MAAO,CAAChB,GAAwB,CAC9BF,EAAE,gBAAgB,CAClBA,EAAE,iBAAiB,CACnB,IAAMmB,EAAO,KAAK,wBAAwBC,EAAkB,CAC5D,KAAK,OAAO,IAAI,SAAU,YAAaD,EAAK,CAC5C,IAAME,EAAO,IAAM,CACjB,KAAK,OAAO,OAAO,SAAU,YAAaF,EAAK,CAC/C,KAAK,OAAO,OAAO,SAAU,UAAWE,EAAK,AAC9C,EACD,KAAK,OAAO,IAAI,SAAU,UAAWA,EAAK,AAC3C,CACF,CAOS,wBAAwBC,EAAsC,CACtE,MAAO,CAACpB,GAAwB,CAC9B,IAAMxB,EAAQ,KAAK,cAAcsB,EAAE,CAC/BtB,IAAU,KAAK,QAAQ,SAASA,EAAM,EAG1C6C,GAAU,KAAK,KAAM7C,EAAM,AAC5B,CACF,CAES,gBAAuB,CAC/B,KAAK,QAAU,IAAI,OAAO,KAAK,IAAK,KAAK,IAAK,KAAK,MACnD,IAAMY,EAAM,KAAK,QAAQ,KACzB,KAAK,OAASA,EAAM,IAChB,WAAW,KAAK,MAAM,GACnB,WAAW,KAAK,QAAQ,CAG1B,KAAK,MAAmB,KAAK,MAAMA,EAAM,EAAI,KAAK,KAAK,CAAG,KAAK,KAFhE,KAAK,MAAQ,KAAK,SAKtB,KAAK,UAAY,KAAK,KACvB,CAED,OAAc,CACZ,KAAK,MAAQ,KAAK,OACnB,CAED,MAAU,CACR,OAAQ,KAAK,MAAQ,KAAK,UAAU,AACrC,CAED,UAAc,CAIZ,OAHI,KAAK,MACA,CAAC,GAAI,KAAK,KAAmB,EAAC,KAAK,CAACkC,EAAGC,IAAMD,EAAIC,EAAE,CAErD,KAAK,KACb,CACF,aA1SE,SAAS,CAAE,KAAM,MAAQ,EAAC,AAAA,EAAA,MAAA,UAAA,MAAA,OAAA,YAM1B,SAAS,CAAE,KAAM,MAAQ,EAAC,AAAA,EAAA,MAAA,UAAA,MAAA,OAAA,YAM1B,SAAS,CAAE,KAAM,MAAQ,EAAC,AAAA,EAAA,MAAA,UAAA,OAAA,OAAA,YAM1B,SAAS,CAAE,KAAM,QAAS,QAAS,EAAM,EAAC,AAAA,EAAA,MAAA,UAAA,WAAA,IAAA,GAAA,YAQ1C,SAAS,CAAE,KAAM,KAAO,EAAC,AAAA,EAAA,MAAA,UAAA,QAAA,OAAA,YAMzB,SAAS,CAAE,KAAM,KAAO,EAAC,AAAA,EAAA,MAAA,UAAA,UAAA,OAAA,CAGzB,UAAA,CAAA,MAAM,cAAc,AAAA,EAAA,MAAA,UAAA,QAAA,OAAA,CAGpB,UAAA,CAAA,SAAS,gBAAgB,AAAA,EAAA,MAAA,UAAA,WAAA,OAAA,YAGzB,OAAO,AAAA,EAAA,MAAA,UAAA,YAAA,OAAA,CAvIT,MAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OACC,GAAG,CAAC,MAEA,EAAE,SAAS,mBACX,EAAE,SAAS,iBACX,EAAE,SAAS,uBAAwB,EAAE,cAAc,OAAO,iBAC1C,EAAE,cAAc,QAAQ,sCAG5B,EAAE,SAAS,8ZA6BP,EAAE,SAAS,8VAiBN,EAAE,SAAS,qDAChB,EAAE,cAAc,WAAW,4BAG/C,CAAC,CACD,GAAG,CAAC,oCAGW,EAAE,SAAS,4MAa1B,CAAC,CACD,GAAG,CAAC,4FAUJ,CAAC,CACF,AAAA,EAAA,MAAA,CAiTD,IAAA,QAAe"}
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,OAAO,WAAW,gBAAiB;AAInC,eAAe;eAEA;WACH,sBAAsB;EAC9B,gBAAgB;CACjB;AACF","names":[],"sources":["../../../../src/web-components/range/definition.ts"],"sourcesContent":["import Range from \"./component.js\";\n\nRange.define();\n\nexport default Range;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-range\": Range;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
@@ -0,0 +1,2 @@
1
+ import Range from"./component.js";import"@godown/element";import"sharekit";import"lit";import"lit/decorators.js";import"lit/directives/style-map.js";import"../../internal/global-style.js";import"../../internal/reset-style.js";import"../../internal/super-input.js";import"../../internal/ring.js";import"@oxc-project/runtime/helpers/decorate";Range.define();export{Range as default};
2
+ //# sourceMappingURL=definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.js","sources":["../../../src/web-components/range/definition.ts"],"sourcesContent":["import Range from \"./component.js\";\n\nRange.define();\n\nexport default Range;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-range\": Range;\n }\n}\n"],"names":[],"mappings":"qVAEA,MAAM,QAAQ"}
@@ -0,0 +1 @@
1
+ {"mappings":"AACA,cAAc,sBAAiC,KAAM;AAErD,SAAS,mBAAgC,gCAAiC;;;;;;AAW1E,cA6BM,eAAe,YAAY;CAC/B,UACU,OAAO;CAEjB,UAAU,UAAU,eAAe;CAcnC;CAKA,UAAU,cAAcA,GAAG;;;;;;;;;;;CAgB3B,UAAU,eAAeA,GAAG,aAAa;EACvC;EACA;CACD;AAUF;AAED,eAAe;AACf,SAAS","names":["e: MouseEvent"],"sources":["../../../../src/web-components/rotate/component.ts"],"sourcesContent":["import { godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\n\nimport { GlobalStyle, scopePrefix } from \"../../internal/global-style.js\";\nimport { query } from \"lit/decorators.js\";\n\nconst protoName = \"rotate\";\nconst cssScope = scopePrefix(protoName);\n\n/**\n * {@linkcode Rotate} Make child elements rotate.\n *\n * @category wrapper\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n width: fit-content;\n transition: all 0.5s ease-in-out;\n ${cssScope}--offset: .5em;\n }\n\n div {\n position: relative;\n transition: inherit;\n transition-property: transform;\n }\n\n i {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n box-sizing: content-box;\n padding: var(${cssScope}--offset);\n margin: calc(-1 * var(${cssScope}--offset));\n }\n\n [part=\"slot\"] {\n z-index: 2;\n }\n`)\nclass Rotate extends GlobalStyle {\n @query(\"[part=root]\")\n protected _root: HTMLElement;\n\n protected render(): TemplateResult<1> {\n return html`\n <div part=\"root\">\n <div\n part=\"slot\"\n @mousemove=\"${this._handleRotate}\"\n >\n ${htmlSlot()}\n </div>\n <i @mouseleave=\"${this.reset}\"></i>\n </div>\n `;\n }\n\n reset(): void {\n this._root.style.removeProperty(\"transform\");\n this._root.style.removeProperty(\"transition\");\n }\n\n protected _handleRotate(e: MouseEvent): void {\n const { rotateX, rotateY } = this._computeOffset(e);\n this._root.style.setProperty(\"transform\", `rotateX(${rotateX}rad) rotateY(${rotateY}rad)`);\n this._root.style.setProperty(\"transition\", \"0s\");\n }\n\n /**\n * Compute offset.\n *\n * @returns rotateX, rotateY\n * @example\n * ```ts\n * const { rotateX, rotateY } = this._computeOffset(e);\n * `rotateX(${rotateX}rad) rotateY(${rotateY}rad)`;\n * ```\n */\n protected _computeOffset(e: MouseEvent): {\n rotateX: number;\n rotateY: number;\n } {\n const { left, top, width, height } = this._root.getBoundingClientRect();\n const { clientX, clientY } = e;\n const offsetX = clientX - left;\n const offsetY = clientY - top;\n\n const rotateX = -(offsetY - height / 2) / height / 2;\n const rotateY = (offsetX - width / 2) / width / 2;\n return { rotateX, rotateY };\n }\n}\n\nexport default Rotate;\nexport { Rotate };\n"],"version":3,"file":"component.d.ts"}
@@ -0,0 +1,2 @@
1
+ import{godown,styles,htmlSlot}from"@godown/element";import{css,html}from"lit";import{scopePrefix,GlobalStyle}from"../../internal/global-style.js";import{query}from"lit/decorators.js";import _decorate from"@oxc-project/runtime/helpers/decorate";import"../../internal/reset-style.js";import"sharekit";const protoName=`rotate`,cssScope=scopePrefix(protoName);let Rotate=class e extends GlobalStyle{render(){return html`<div part="root"> <div part="slot" @mousemove="${this._handleRotate}"> ${htmlSlot()} </div> <i @mouseleave="${this.reset}"></i> </div>`}reset(){this._root.style.removeProperty(`transform`),this._root.style.removeProperty(`transition`)}_handleRotate(e){let{rotateX:r,rotateY:i}=this._computeOffset(e);this._root.style.setProperty(`transform`,`rotateX(${r}rad) rotateY(${i}rad)`),this._root.style.setProperty(`transition`,`0s`)}_computeOffset(e){let{left:r,top:i,width:a,height:o}=this._root.getBoundingClientRect(),{clientX:s,clientY:c}=e,l=s-r,u=c-i,d=-(u-o/2)/o/2,f=(l-a/2)/a/2;return{rotateX:d,rotateY:f}}};_decorate([query(`[part=root]`)],Rotate.prototype,`_root`,void 0),Rotate=_decorate([godown(protoName),styles(css`:host{display:block;width:-moz-fit-content;width:fit-content;transition:all .5s ease-in-out;${cssScope}--offset:.5em}div{position:relative;transition:inherit;transition-property:transform}i{width:100%;height:100%;position:absolute;top:0;box-sizing:content-box;padding:var(${cssScope}--offset);margin:calc(-1*var(${cssScope}--offset))}[part=slot]{z-index:2}`)],Rotate);var Rotate$1=Rotate;export{Rotate,Rotate$1 as default};
2
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sources":["../../../src/web-components/rotate/component.ts"],"sourcesContent":["import { godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\n\nimport { GlobalStyle, scopePrefix } from \"../../internal/global-style.js\";\nimport { query } from \"lit/decorators.js\";\n\nconst protoName = \"rotate\";\nconst cssScope = scopePrefix(protoName);\n\n/**\n * {@linkcode Rotate} Make child elements rotate.\n *\n * @category wrapper\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n width: fit-content;\n transition: all 0.5s ease-in-out;\n ${cssScope}--offset: .5em;\n }\n\n div {\n position: relative;\n transition: inherit;\n transition-property: transform;\n }\n\n i {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n box-sizing: content-box;\n padding: var(${cssScope}--offset);\n margin: calc(-1 * var(${cssScope}--offset));\n }\n\n [part=\"slot\"] {\n z-index: 2;\n }\n`)\nclass Rotate extends GlobalStyle {\n @query(\"[part=root]\")\n protected _root: HTMLElement;\n\n protected render(): TemplateResult<1> {\n return html`\n <div part=\"root\">\n <div\n part=\"slot\"\n @mousemove=\"${this._handleRotate}\"\n >\n ${htmlSlot()}\n </div>\n <i @mouseleave=\"${this.reset}\"></i>\n </div>\n `;\n }\n\n reset(): void {\n this._root.style.removeProperty(\"transform\");\n this._root.style.removeProperty(\"transition\");\n }\n\n protected _handleRotate(e: MouseEvent): void {\n const { rotateX, rotateY } = this._computeOffset(e);\n this._root.style.setProperty(\"transform\", `rotateX(${rotateX}rad) rotateY(${rotateY}rad)`);\n this._root.style.setProperty(\"transition\", \"0s\");\n }\n\n /**\n * Compute offset.\n *\n * @returns rotateX, rotateY\n * @example\n * ```ts\n * const { rotateX, rotateY } = this._computeOffset(e);\n * `rotateX(${rotateX}rad) rotateY(${rotateY}rad)`;\n * ```\n */\n protected _computeOffset(e: MouseEvent): {\n rotateX: number;\n rotateY: number;\n } {\n const { left, top, width, height } = this._root.getBoundingClientRect();\n const { clientX, clientY } = e;\n const offsetX = clientX - left;\n const offsetY = clientY - top;\n\n const rotateX = -(offsetY - height / 2) / height / 2;\n const rotateY = (offsetX - width / 2) / width / 2;\n return { rotateX, rotateY };\n }\n}\n\nexport default Rotate;\nexport { Rotate };\n"],"names":["Rotate","e: MouseEvent","rotateX","rotateY","offsetX","clientX","left","offsetY","clientY","top","height","width"],"mappings":"2SAMA,MAAM,UAAY,SACZ,SAAW,YAAY,UAAU,CAOvC,IAAA,OAAA,MA6BMA,UAAe,WAAY,CAIrB,QAA4B,CACpC,MAAO,KAAI,CAAA,+CAIO,EAAE,KAAK,cAAc,GAEjC,EAAE,UAAU,CAAA,wBAEE,EAAE,KAAK,MAAM,aAEjC,CAAC,AACF,CAED,OAAc,CACZ,KAAK,MAAM,MAAM,eAAe,YAAY,CAC5C,KAAK,MAAM,MAAM,eAAe,aAAa,AAC9C,CAES,cAAcC,EAAqB,CAC3C,GAAM,CAAE,UAAS,UAAS,CAAG,KAAK,eAAe,EAAE,CACnD,KAAK,MAAM,MAAM,YAAY,YAAa,CAAC,QAAQ,EAAEC,EAAQ,aAAa,EAAEC,EAAQ,IAAI,CAAC,CAAC,CAC1F,KAAK,MAAM,MAAM,YAAY,aAAc,KAAK,AACjD,CAYS,eAAeF,EAGvB,CACA,GAAM,CAAE,OAAM,MAAK,QAAO,SAAQ,CAAG,KAAK,MAAM,uBAAuB,CACjE,CAAE,UAAS,UAAS,CAAG,EACvBG,EAAUC,EAAUC,EACpBC,EAAUC,EAAUC,EAEpBP,EAAU,EAAEK,EAAUG,EAAS,GAAKA,EAAS,EAC7CP,GAAWC,EAAUO,EAAQ,GAAKA,EAAQ,EAChD,MAAO,CAAE,UAAS,SAAS,CAC5B,CACF,EAnDE,UAAA,CAAA,MAAM,cAAc,AAAA,EAAA,OAAA,UAAA,QAAA,OAAA,CA9BtB,OAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC,4FAKR,EAAE,SAAS,yKAeE,EAAE,SAAS,6BACF,EAAE,SAAS,iCAMrC,CAAC,CAAC,AAAA,EAAA,OAAA,CAuDF,IAAA,SAAe"}
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,OAAO,YAAY,gBAAiB;AAIpC,eAAe;eAEA;WACH,sBAAsB;EAC9B,iBAAiB;CAClB;AACF","names":[],"sources":["../../../../src/web-components/rotate/definition.ts"],"sourcesContent":["import Rotate from \"./component.js\";\n\nRotate.define();\n\nexport default Rotate;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-rotate\": Rotate;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
@@ -0,0 +1,2 @@
1
+ import Rotate from"./component.js";import"@godown/element";import"lit";import"../../internal/global-style.js";import"../../internal/reset-style.js";import"sharekit";import"lit/decorators.js";import"@oxc-project/runtime/helpers/decorate";Rotate.define();export{Rotate as default};
2
+ //# sourceMappingURL=definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.js","sources":["../../../src/web-components/rotate/definition.ts"],"sourcesContent":["import Rotate from \"./component.js\";\n\nRotate.define();\n\nexport default Rotate;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-rotate\": Rotate;\n }\n}\n"],"names":[],"mappings":"6OAEA,OAAO,QAAQ"}
@@ -1,5 +1,5 @@
1
- import { Router as Mux } from "@godown/element";
2
1
  import { type PropertyValueMap, type TemplateResult } from "lit";
2
+ import { Router as Mux } from "sharekit";
3
3
  import { GlobalStyle } from "../../internal/global-style.js";
4
4
  interface RouteState {
5
5
  pathname: string;
@@ -56,7 +56,7 @@ declare class Router extends GlobalStyle {
56
56
  /**
57
57
  * Dynamic parameters record.
58
58
  */
59
- get params(): Record<string, string>;
59
+ params?: Record<string, string>;
60
60
  /**
61
61
  * Value of matched path in routes.
62
62
  */
@@ -0,0 +1 @@
1
+ {"mappings":"AACA,cAAc,uBAAuB,sBAA2B,KAAM;AAEtE,SAAS,UAAU,WAAiB,UAAW;AAE/C,SAAS,mBAAmB,gCAAiC;UAEnD,WAAW;CACnB;CACA,QAAQ;CACR;AACD;UAES,oBAAoB,WAAW;CACvC;AACD;UAES,UAAU;OACZ;CACN;CACA,UAAUA,QAAQ;CAClB;AACD;AAED,cAAM;UACJ,OAAO;UACP,SAAS;UACT,QAAQ;;KAGL,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;AA0B/B,cAMM,eAAe,YAAY;CAC/B,OAAO,iBAAiB,IAAI;CAE5B,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,QAAQ;;;;CAKR,AACA,qBAAqB;;;;CAKrB,SAAS;;;;CAKT,AACA;;;;CAKA,AACA;;;;CAKA,AACA,SAAS;;;;;;;;CAST,AACA,MAAM;;;;;;CAON,AACA;CAEA,IACI,OAAO,OAKG;CAAd,IAAI,UAAU;CAId;CAIA,UAAU;CAsBV;CAcA;CAKA,aAAa;CASb,UAAU,QAAQC,mBAAmB;;;;CAcrC,eAAeC;;;;CA2Bf,iBAAiBA,iBAAiB,eAAe;;;;CAwBjD;;;;CAWA,mBAAmBC,cAAc,KAAK;CAQtC,OAAO;CAMP,OAAOC,mBAAmB;CAI1B;AAGD;AAED,eAAe;AACf,SAAS","names":["state?: RouteState","changedProperties: PropertyValueMap<this>","query?: string","value: typeof this.routes","pathname: string"],"sources":["../../../../src/web-components/router/component.ts"],"sourcesContent":["import { godown, htmlSlot, styles } from \"@godown/element\";\nimport { type PropertyValueMap, type TemplateResult, css } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { Router as Mux, omit } from \"sharekit\";\n\nimport { GlobalStyle } from \"../../internal/global-style.js\";\n\ninterface RouteState {\n pathname: string;\n params: Record<string, string>;\n path: string;\n}\n\ninterface RouteResult extends RouteState {\n component: unknown;\n}\n\ninterface RouteItem {\n [key: PropertyKey]: unknown;\n path: string;\n render?: (state?: RouteState) => unknown;\n component?: unknown;\n}\n\nconst routerTypes = {\n field: \"field\",\n slotted: \"slotted\",\n united: \"united\",\n} as const;\n\ntype RouterType = keyof typeof routerTypes;\n\nconst protoName = \"router\";\n\n/**\n * {@linkcode Router} has basic routing control.\n *\n * To switch routes, use `router-link component`.\n *\n * It has two methods to collect routes.\n *\n * 1. From field `routes`, an array, each elements require \"path\".\n * 2. From child elements, which have the slot attribute for matching routes.\n *\n * If only the method 1 is used, set `type` to `\"field\"`.\n *\n * If only the method 2 is used, set `type` to `\"slotted\"`.\n *\n * `type` defaults to `\"united\"`, which will try method 1, then method 2.\n *\n * If no routes are matched, the default value (no named slot) will be rendered.\n *\n * @slot - Display slot when there is no match.\n * @slot * - Matching slot will be displayed.\n * @category navigation\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: contents;\n }\n`)\nclass Router extends GlobalStyle {\n static routerInstances: Set<Router> = new Set<Router>();\n\n private __fieldRoute: Mux = new Mux();\n private __slottedRoute: Mux = new Mux();\n private __cacheRecord = new Map<string, RouteResult>();\n private __routes: RouteItem[];\n\n /**\n * Render result.\n */\n @state()\n component: unknown | TemplateResult = null;\n\n /**\n * Dynamic parameters record.\n */\n params?: Record<string, string>;\n\n /**\n * Value of matched path in routes.\n */\n @state()\n path?: string;\n\n /**\n * Current pathname (equals to location.pathname).\n */\n @property()\n pathname: string = location.pathname;\n\n /**\n * Rendered content when there is no match.\n */\n @state()\n default: TemplateResult = htmlSlot();\n\n /**\n * The type of routing sources.\n *\n * If field, it won't collect the slot attribute of the child elements.\n *\n * This property should not be changed after the rendering is complete.\n */\n @property()\n type: RouterType = routerTypes.united;\n\n /**\n * Cache accessed records.\n *\n * Emptied at each re-collection.\n */\n @property({ type: Boolean })\n cache = false;\n\n @state()\n set routes(value) {\n this.__routes = value;\n this.collectFieldRoutes(value);\n }\n\n get routes(): RouteItem[] {\n return this.__routes;\n }\n\n clear(): void {\n this.__cacheRecord.clear();\n }\n\n protected render(): unknown {\n let cached: RouteResult | undefined;\n if (this.cache && (cached = this.__cacheRecord.get(this.pathname))) {\n this.component = cached.component;\n this.path = cached.path;\n this.pathname = cached.pathname;\n }\n if (!cached) {\n switch (this.type) {\n case routerTypes.field:\n this.component = this.fieldComponent();\n break;\n case routerTypes.slotted:\n this.component = this.slottedComponent();\n break;\n default:\n this.component = this.fieldComponent() ?? this.slottedComponent();\n }\n }\n return this.component ?? this.default;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n Router.routerInstances.add(this);\n\n if (this.type !== \"field\") {\n this.observers.add(this, MutationObserver, this.collectSlottedRoutes, {\n attributes: true,\n attributeFilter: [\"slot\"],\n subtree: true,\n });\n this.collectSlottedRoutes();\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n Router.routerInstances.delete(this);\n }\n\n useRouter(): RouteResult {\n return {\n pathname: this.pathname,\n params: this.params,\n path: this.path,\n component: this.component,\n };\n }\n\n protected updated(changedProperties: PropertyValueMap<this>): void {\n const shouldDispatch = changedProperties.has(\"pathname\") || changedProperties.has(\"path\");\n if (shouldDispatch) {\n const ur = this.useRouter();\n if (!this.__cacheRecord.has(this.pathname) && this.path) {\n this.__cacheRecord.set(this.pathname, ur);\n }\n this.dispatchCustomEvent(\"change\", ur);\n }\n }\n\n /**\n * Get component from {@linkcode routes} by query.\n */\n fieldComponent(query?: string): unknown {\n if (!query) {\n const mux = this.__fieldRoute.search(this.pathname);\n this.params = mux.params(this.pathname);\n query = mux.pattern;\n }\n this.path = query;\n\n if (!query) {\n return null;\n }\n\n const route = this.routes.find((r) => r.path === query);\n if (!route) {\n return null;\n }\n\n if (\"render\" in route) {\n return route.render?.(omit(this.useRouter(), \"component\")) || null;\n }\n\n return route.component;\n }\n\n /**\n * Get component from slotted elements by query.\n */\n slottedComponent(query?: string): TemplateResult<1> {\n const slottedPaths = this._slottedNames;\n if (!query) {\n const mux = this.__fieldRoute.search(this.pathname);\n this.params = mux.params(this.pathname);\n query = mux.pattern;\n }\n this.path = query;\n\n if (!query) {\n return null;\n }\n\n this.path = slottedPaths.find((s) => s === query);\n if (!this.path) {\n return null;\n }\n\n return htmlSlot(this.path);\n }\n\n /**\n * Reset the route tree, clear cache, collect routes from child elements.\n */\n collectSlottedRoutes(): void {\n this.__slottedRoute = new Mux();\n this.clear();\n this._slottedNames.forEach((slotName) => {\n this.__slottedRoute.insert(slotName);\n });\n }\n\n /**\n * Reset the route tree, clear cache, collect routes from value.\n */\n collectFieldRoutes(value: typeof this.routes): void {\n this.__fieldRoute = new Mux();\n this.clear();\n value.forEach(({ path }) => {\n this.__fieldRoute.insert(path);\n });\n }\n\n static updateAll(): void {\n this.routerInstances.forEach((i) => {\n i.handlePopstate();\n });\n }\n\n search(pathname: string): Mux {\n return this.__fieldRoute.search(pathname) || this.__slottedRoute.search(pathname);\n }\n\n handlePopstate: () => void = this.events.add(window, \"popstate\", () => {\n this.pathname = location.pathname;\n });\n}\n\nexport default Router;\nexport { Router };\n"],"version":3,"file":"component.d.ts"}
@@ -0,0 +1,3 @@
1
+ import{godown,styles,htmlSlot}from"@godown/element";import{css}from"lit";import{state,property}from"lit/decorators.js";import{Router as Router$2,omit}from"sharekit";import{GlobalStyle}from"../../internal/global-style.js";import _decorate from"@oxc-project/runtime/helpers/decorate";import"../../internal/reset-style.js";var _Router;const routerTypes={field:`field`,slotted:`slotted`,united:`united`},protoName=`router`;let Router=_Router=class e extends GlobalStyle{constructor(...e){super(...e),this.__fieldRoute=new Router$2,this.__slottedRoute=new Router$2,this.__cacheRecord=new Map,this.component=null,this.pathname=location.pathname,this.default=htmlSlot(),this.type=routerTypes.united,this.cache=!1,this.handlePopstate=this.events.add(window,`popstate`,()=>{this.pathname=location.pathname})}set routes(e){this.__routes=e,this.collectFieldRoutes(e)}get routes(){return this.__routes}clear(){this.__cacheRecord.clear()}render(){let e;if(this.cache&&(e=this.__cacheRecord.get(this.pathname))&&(this.component=e.component,this.path=e.path,this.pathname=e.pathname),!e)switch(this.type){case routerTypes.field:this.component=this.fieldComponent();break;case routerTypes.slotted:this.component=this.slottedComponent();break;default:this.component=this.fieldComponent()??this.slottedComponent()}return this.component??this.default}connectedCallback(){super.connectedCallback(),_Router.routerInstances.add(this),this.type!==`field`&&(this.observers.add(this,MutationObserver,this.collectSlottedRoutes,{attributes:!0,attributeFilter:[`slot`],subtree:!0}),this.collectSlottedRoutes())}disconnectedCallback(){super.disconnectedCallback(),_Router.routerInstances.delete(this)}useRouter(){return{pathname:this.pathname,params:this.params,path:this.path,component:this.component}}updated(e){let m=e.has(`pathname`)||e.has(`path`);if(m){let e=this.useRouter();!this.__cacheRecord.has(this.pathname)&&this.path&&this.__cacheRecord.set(this.pathname,e),this.dispatchCustomEvent(`change`,e)}}fieldComponent(e){if(!e){let m=this.__fieldRoute.search(this.pathname);this.params=m.params(this.pathname),e=m.pattern}if(this.path=e,!e)return null;let m=this.routes.find(m=>m.path===e);return m?`render`in m?m.render?.(omit(this.useRouter(),`component`))||null:m.component:null}slottedComponent(e){let m=this._slottedNames;if(!e){let m=this.__fieldRoute.search(this.pathname);this.params=m.params(this.pathname),e=m.pattern}return this.path=e,!e||(this.path=m.find(m=>m===e),!this.path)?null:htmlSlot(this.path)}collectSlottedRoutes(){this.__slottedRoute=new Router$2,this.clear(),this._slottedNames.forEach(e=>{this.__slottedRoute.insert(e)})}collectFieldRoutes(e){this.__fieldRoute=new Router$2,this.clear(),e.forEach(({path:e})=>{this.__fieldRoute.insert(e)})}static updateAll(){this.routerInstances.forEach(e=>{e.handlePopstate()})}search(e){return this.__fieldRoute.search(e)||this.__slottedRoute.search(e)}};_decorate([state()],Router.prototype,`component`,void 0),_decorate([state()],Router.prototype,`path`,void 0),_decorate([property()],Router.prototype,`pathname`,void 0),_decorate([state()],Router.prototype,`default`,void 0),_decorate([property()],Router.prototype,`type`,void 0),_decorate([property({type:Boolean})],Router.prototype,`cache`,void 0),_decorate([state()],Router.prototype,`routes`,null),Router=_Router=_decorate([godown(protoName),styles(css`:host{display:contents}
2
+ `)],Router),Router.routerInstances=new Set;var Router$1=Router;export{Router,Router$1 as default};
3
+ //# sourceMappingURL=component.js.map