godown 2.6.2 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (453) hide show
  1. package/{deps.d.ts → .deps.d.ts} +1 -1
  2. package/.deps.d.ts.map +1 -0
  3. package/{deps.js → .deps.js} +1 -1
  4. package/.deps.js.map +1 -0
  5. package/README.md +166 -43
  6. package/a.d.ts +2 -0
  7. package/a.d.ts.map +1 -0
  8. package/a.js +2 -0
  9. package/a.js.map +1 -0
  10. package/alert.d.ts +2 -0
  11. package/alert.d.ts.map +1 -0
  12. package/alert.js +2 -0
  13. package/alert.js.map +1 -0
  14. package/avatar-group.js.map +1 -1
  15. package/avatar.d.ts +2 -0
  16. package/avatar.d.ts.map +1 -0
  17. package/avatar.js +2 -0
  18. package/avatar.js.map +1 -0
  19. package/button.d.ts +2 -0
  20. package/button.d.ts.map +1 -0
  21. package/button.js +2 -0
  22. package/button.js.map +1 -0
  23. package/card.d.ts +2 -0
  24. package/card.d.ts.map +1 -0
  25. package/card.js +2 -0
  26. package/card.js.map +1 -0
  27. package/carousel.d.ts +2 -0
  28. package/carousel.d.ts.map +1 -0
  29. package/carousel.js +2 -0
  30. package/carousel.js.map +1 -0
  31. package/clip.d.ts +2 -0
  32. package/clip.d.ts.map +1 -0
  33. package/clip.js +2 -0
  34. package/clip.js.map +1 -0
  35. package/conf.d.ts +23 -3
  36. package/conf.d.ts.map +1 -1
  37. package/conf.js +19 -16
  38. package/conf.js.map +1 -1
  39. package/decorators/define.d.ts +7 -0
  40. package/decorators/define.d.ts.map +1 -0
  41. package/decorators/define.js +11 -0
  42. package/decorators/define.js.map +1 -0
  43. package/details-group.js.map +1 -1
  44. package/details.d.ts +2 -0
  45. package/details.d.ts.map +1 -0
  46. package/details.js +2 -0
  47. package/details.js.map +1 -0
  48. package/dialog.d.ts +2 -0
  49. package/dialog.d.ts.map +1 -0
  50. package/dialog.js +2 -0
  51. package/dialog.js.map +1 -0
  52. package/divider.d.ts +2 -0
  53. package/divider.d.ts.map +1 -0
  54. package/divider.js +2 -0
  55. package/divider.js.map +1 -0
  56. package/dragbox.d.ts +2 -0
  57. package/dragbox.d.ts.map +1 -0
  58. package/dragbox.js +2 -0
  59. package/dragbox.js.map +1 -0
  60. package/flex-flow.js.map +1 -1
  61. package/form.d.ts +2 -0
  62. package/form.d.ts.map +1 -0
  63. package/form.js +2 -0
  64. package/form.js.map +1 -0
  65. package/godown-element.d.ts +1 -1
  66. package/godown-element.d.ts.map +1 -1
  67. package/godown-element.js +12 -4
  68. package/godown-element.js.map +1 -1
  69. package/input.d.ts +2 -0
  70. package/input.d.ts.map +1 -0
  71. package/input.js +2 -0
  72. package/input.js.map +1 -0
  73. package/label-input.js.map +1 -1
  74. package/lib/event-collection.d.ts +1 -1
  75. package/lib/event-collection.d.ts.map +1 -1
  76. package/lib/utils.d.ts +0 -1
  77. package/lib/utils.d.ts.map +1 -1
  78. package/lib/utils.js +0 -7
  79. package/lib/utils.js.map +1 -1
  80. package/naming.d.ts +91 -0
  81. package/naming.d.ts.map +1 -0
  82. package/naming.js +67 -0
  83. package/naming.js.map +1 -0
  84. package/nav-layout.js.map +1 -1
  85. package/open-offset.d.ts +1 -1
  86. package/open-offset.d.ts.map +1 -1
  87. package/open-offset.js +1 -1
  88. package/open-offset.js.map +1 -1
  89. package/overbreath.d.ts +2 -0
  90. package/overbreath.d.ts.map +1 -0
  91. package/overbreath.js +2 -0
  92. package/overbreath.js.map +1 -0
  93. package/package.json +29 -33
  94. package/progress.d.ts +2 -0
  95. package/progress.d.ts.map +1 -0
  96. package/progress.js +2 -0
  97. package/progress.js.map +1 -0
  98. package/react/index.d.ts +24 -25
  99. package/react/index.d.ts.map +1 -1
  100. package/react/index.js +52 -56
  101. package/react/index.js.map +1 -1
  102. package/router-a.d.ts +2 -0
  103. package/router-a.d.ts.map +1 -0
  104. package/router-a.js +2 -0
  105. package/router-a.js.map +1 -0
  106. package/router.d.ts +2 -0
  107. package/router.d.ts.map +1 -0
  108. package/router.js +2 -0
  109. package/router.js.map +1 -0
  110. package/search-input.js.map +1 -1
  111. package/select-input.js.map +1 -1
  112. package/skeleton.d.ts +2 -0
  113. package/skeleton.d.ts.map +1 -0
  114. package/skeleton.js +2 -0
  115. package/skeleton.js.map +1 -0
  116. package/split-input.js.map +1 -1
  117. package/supers/anchor.d.ts +21 -0
  118. package/supers/anchor.d.ts.map +1 -0
  119. package/{web-components/a/super-a.js → supers/anchor.js} +11 -21
  120. package/supers/anchor.js.map +1 -0
  121. package/supers/input.d.ts +28 -0
  122. package/supers/input.d.ts.map +1 -0
  123. package/supers/input.js +117 -0
  124. package/supers/input.js.map +1 -0
  125. package/{web-components/open/open.d.ts → supers/openable.d.ts} +6 -6
  126. package/supers/openable.d.ts.map +1 -0
  127. package/{web-components/open/open.js → supers/openable.js} +11 -11
  128. package/supers/openable.js.map +1 -0
  129. package/supers/root.d.ts +18 -0
  130. package/supers/root.d.ts.map +1 -0
  131. package/{root.js → supers/root.js} +3 -11
  132. package/supers/root.js.map +1 -0
  133. package/switch-input.js.map +1 -1
  134. package/tabs.d.ts +2 -0
  135. package/tabs.d.ts.map +1 -0
  136. package/tabs.js +2 -0
  137. package/tabs.js.map +1 -0
  138. package/time.d.ts +2 -0
  139. package/time.d.ts.map +1 -0
  140. package/time.js +2 -0
  141. package/time.js.map +1 -0
  142. package/tooltip.d.ts +2 -0
  143. package/tooltip.d.ts.map +1 -0
  144. package/tooltip.js +2 -0
  145. package/tooltip.js.map +1 -0
  146. package/typewriter.d.ts +2 -0
  147. package/typewriter.d.ts.map +1 -0
  148. package/typewriter.js +2 -0
  149. package/typewriter.js.map +1 -0
  150. package/web-components/a/a.d.ts +16 -0
  151. package/web-components/a/a.d.ts.map +1 -0
  152. package/web-components/a/a.js +17 -0
  153. package/web-components/a/a.js.map +1 -0
  154. package/web-components/{items/alert-item.d.ts → alert/alert.d.ts} +8 -7
  155. package/web-components/alert/alert.d.ts.map +1 -0
  156. package/web-components/{items/alert-item.js → alert/alert.js} +18 -17
  157. package/web-components/alert/alert.js.map +1 -0
  158. package/web-components/{a/avatar-a.d.ts → avatar/avatar.d.ts} +9 -8
  159. package/web-components/avatar/avatar.d.ts.map +1 -0
  160. package/web-components/{a/avatar-a.js → avatar/avatar.js} +20 -19
  161. package/web-components/avatar/avatar.js.map +1 -0
  162. package/web-components/button/{base-button.d.ts → button.d.ts} +7 -6
  163. package/web-components/button/button.d.ts.map +1 -0
  164. package/web-components/button/{base-button.js → button.js} +21 -20
  165. package/web-components/button/button.js.map +1 -0
  166. package/web-components/{items/card-item.d.ts → card/card.d.ts} +8 -7
  167. package/web-components/card/card.d.ts.map +1 -0
  168. package/web-components/{items/card-item.js → card/card.js} +15 -14
  169. package/web-components/card/card.js.map +1 -0
  170. package/web-components/carousel/{carousel-slider.d.ts → carousel.d.ts} +7 -6
  171. package/web-components/carousel/carousel.d.ts.map +1 -0
  172. package/web-components/carousel/{carousel-slider.js → carousel.js} +16 -16
  173. package/web-components/carousel/carousel.js.map +1 -0
  174. package/web-components/{open/open-details.d.ts → details/details.d.ts} +8 -7
  175. package/web-components/details/details.d.ts.map +1 -0
  176. package/web-components/{open/open-details.js → details/details.js} +17 -16
  177. package/web-components/details/details.js.map +1 -0
  178. package/web-components/{open/open-dialog.d.ts → dialog/dialog.d.ts} +8 -7
  179. package/web-components/dialog/dialog.d.ts.map +1 -0
  180. package/web-components/{open/open-dialog.js → dialog/dialog.js} +19 -18
  181. package/web-components/dialog/dialog.js.map +1 -0
  182. package/web-components/form/{base-form.d.ts → form.d.ts} +8 -7
  183. package/web-components/form/form.d.ts.map +1 -0
  184. package/web-components/form/{base-form.js → form.js} +16 -15
  185. package/web-components/form/form.js.map +1 -0
  186. package/web-components/group/avatar-group.d.ts +6 -5
  187. package/web-components/group/avatar-group.d.ts.map +1 -1
  188. package/web-components/group/avatar-group.js +8 -7
  189. package/web-components/group/avatar-group.js.map +1 -1
  190. package/web-components/group/details-group.d.ts +3 -2
  191. package/web-components/group/details-group.d.ts.map +1 -1
  192. package/web-components/group/details-group.js +4 -3
  193. package/web-components/group/details-group.js.map +1 -1
  194. package/web-components/index.d.ts +24 -25
  195. package/web-components/index.d.ts.map +1 -1
  196. package/web-components/index.js +24 -26
  197. package/web-components/index.js.map +1 -1
  198. package/web-components/input/input.d.ts +44 -22
  199. package/web-components/input/input.d.ts.map +1 -1
  200. package/web-components/input/input.js +210 -80
  201. package/web-components/input/input.js.map +1 -1
  202. package/web-components/input/label-input.d.ts +5 -4
  203. package/web-components/input/label-input.d.ts.map +1 -1
  204. package/web-components/input/label-input.js +7 -6
  205. package/web-components/input/label-input.js.map +1 -1
  206. package/web-components/input/search-input.d.ts +5 -4
  207. package/web-components/input/search-input.d.ts.map +1 -1
  208. package/web-components/input/search-input.js +7 -6
  209. package/web-components/input/search-input.js.map +1 -1
  210. package/web-components/input/select-input.d.ts +5 -4
  211. package/web-components/input/select-input.d.ts.map +1 -1
  212. package/web-components/input/select-input.js +7 -6
  213. package/web-components/input/select-input.js.map +1 -1
  214. package/web-components/input/split-input.d.ts +5 -4
  215. package/web-components/input/split-input.d.ts.map +1 -1
  216. package/web-components/input/split-input.js +7 -6
  217. package/web-components/input/split-input.js.map +1 -1
  218. package/web-components/input/switch-input.d.ts +5 -4
  219. package/web-components/input/switch-input.d.ts.map +1 -1
  220. package/web-components/input/switch-input.js +7 -6
  221. package/web-components/input/switch-input.js.map +1 -1
  222. package/web-components/layout/{divider-line.d.ts → divider.d.ts} +7 -6
  223. package/web-components/layout/divider.d.ts.map +1 -0
  224. package/web-components/layout/{divider-line.js → divider.js} +13 -12
  225. package/web-components/layout/divider.js.map +1 -0
  226. package/web-components/layout/flex-flow.d.ts +3 -2
  227. package/web-components/layout/flex-flow.d.ts.map +1 -1
  228. package/web-components/layout/flex-flow.js +4 -3
  229. package/web-components/layout/flex-flow.js.map +1 -1
  230. package/web-components/layout/nav-layout.d.ts +4 -3
  231. package/web-components/layout/nav-layout.d.ts.map +1 -1
  232. package/web-components/layout/nav-layout.js +4 -3
  233. package/web-components/layout/nav-layout.js.map +1 -1
  234. package/web-components/{open → offset}/open-offset.d.ts +5 -4
  235. package/web-components/offset/open-offset.d.ts.map +1 -0
  236. package/web-components/{open → offset}/open-offset.js +5 -5
  237. package/web-components/offset/open-offset.js.map +1 -0
  238. package/web-components/{loading/loading-progress.d.ts → progress/progress.d.ts} +8 -7
  239. package/web-components/progress/progress.d.ts.map +1 -0
  240. package/web-components/{loading/loading-progress.js → progress/progress.js} +15 -14
  241. package/web-components/progress/progress.js.map +1 -0
  242. package/web-components/{a/link-a.d.ts → router/router-a.d.ts} +9 -8
  243. package/web-components/router/router-a.d.ts.map +1 -0
  244. package/web-components/{a/link-a.js → router/router-a.js} +21 -21
  245. package/web-components/router/router-a.js.map +1 -0
  246. package/web-components/{view/route-view.d.ts → router/router.d.ts} +10 -9
  247. package/web-components/router/router.d.ts.map +1 -0
  248. package/web-components/{view/route-view.js → router/router.js} +21 -21
  249. package/web-components/router/router.js.map +1 -0
  250. package/web-components/{loading/skeleton-screen.d.ts → skeleton/skeleton.d.ts} +8 -7
  251. package/web-components/skeleton/skeleton.d.ts.map +1 -0
  252. package/web-components/{loading/skeleton-screen.js → skeleton/skeleton.js} +15 -14
  253. package/web-components/skeleton/skeleton.js.map +1 -0
  254. package/web-components/{group/tab-group.d.ts → tabs/tabs.d.ts} +9 -8
  255. package/web-components/tabs/tabs.d.ts.map +1 -0
  256. package/web-components/{group/tab-group.js → tabs/tabs.js} +17 -16
  257. package/web-components/tabs/tabs.js.map +1 -0
  258. package/web-components/text/clip.d.ts +21 -0
  259. package/web-components/text/clip.d.ts.map +1 -0
  260. package/web-components/text/{clip-text.js → clip.js} +13 -12
  261. package/web-components/text/clip.js.map +1 -0
  262. package/web-components/text/{overbreath-text.d.ts → overbreath.d.ts} +6 -6
  263. package/web-components/text/overbreath.d.ts.map +1 -0
  264. package/web-components/text/{overbreath-text.js → overbreath.js} +14 -13
  265. package/web-components/text/overbreath.js.map +1 -0
  266. package/web-components/{items/time-bar.d.ts → text/time.d.ts} +7 -7
  267. package/web-components/text/time.d.ts.map +1 -0
  268. package/web-components/{items/time-bar.js → text/time.js} +19 -18
  269. package/web-components/text/time.js.map +1 -0
  270. package/web-components/text/{typewriter-text.d.ts → typewriter.d.ts} +8 -8
  271. package/web-components/text/typewriter.d.ts.map +1 -0
  272. package/web-components/text/{typewriter-text.js → typewriter.js} +22 -21
  273. package/web-components/text/typewriter.js.map +1 -0
  274. package/web-components/tooltip/tooltip.d.ts +25 -0
  275. package/web-components/tooltip/tooltip.d.ts.map +1 -0
  276. package/web-components/{open/open-tooltip.js → tooltip/tooltip.js} +15 -14
  277. package/web-components/tooltip/tooltip.js.map +1 -0
  278. package/web-components/{items/drag-box.d.ts → wrapper/dragbox.d.ts} +7 -6
  279. package/web-components/wrapper/dragbox.d.ts.map +1 -0
  280. package/web-components/{items/drag-box.js → wrapper/dragbox.js} +14 -13
  281. package/web-components/wrapper/dragbox.js.map +1 -0
  282. package/web-components/{view/wrap-view.d.ts → wrapper/wrapper.d.ts} +6 -5
  283. package/web-components/wrapper/wrapper.d.ts.map +1 -0
  284. package/web-components/{view/wrap-view.js → wrapper/wrapper.js} +13 -12
  285. package/web-components/wrapper/wrapper.js.map +1 -0
  286. package/wrapper.d.ts +2 -0
  287. package/wrapper.d.ts.map +1 -0
  288. package/wrapper.js +2 -0
  289. package/wrapper.js.map +1 -0
  290. package/alert-item.d.ts +0 -2
  291. package/alert-item.d.ts.map +0 -1
  292. package/alert-item.js +0 -2
  293. package/alert-item.js.map +0 -1
  294. package/avatar-a.d.ts +0 -2
  295. package/avatar-a.d.ts.map +0 -1
  296. package/avatar-a.js +0 -2
  297. package/avatar-a.js.map +0 -1
  298. package/base-button.d.ts +0 -2
  299. package/base-button.d.ts.map +0 -1
  300. package/base-button.js +0 -2
  301. package/base-button.js.map +0 -1
  302. package/base-form.d.ts +0 -2
  303. package/base-form.d.ts.map +0 -1
  304. package/base-form.js +0 -2
  305. package/base-form.js.map +0 -1
  306. package/base-input.d.ts +0 -2
  307. package/base-input.d.ts.map +0 -1
  308. package/base-input.js +0 -2
  309. package/base-input.js.map +0 -1
  310. package/card-item.d.ts +0 -2
  311. package/card-item.d.ts.map +0 -1
  312. package/card-item.js +0 -2
  313. package/card-item.js.map +0 -1
  314. package/carousel-slider.d.ts +0 -2
  315. package/carousel-slider.d.ts.map +0 -1
  316. package/carousel-slider.js +0 -2
  317. package/carousel-slider.js.map +0 -1
  318. package/clip-text.d.ts +0 -2
  319. package/clip-text.d.ts.map +0 -1
  320. package/clip-text.js +0 -2
  321. package/clip-text.js.map +0 -1
  322. package/deps.d.ts.map +0 -1
  323. package/deps.js.map +0 -1
  324. package/divider-line.d.ts +0 -2
  325. package/divider-line.d.ts.map +0 -1
  326. package/divider-line.js +0 -2
  327. package/divider-line.js.map +0 -1
  328. package/drag-box.d.ts +0 -2
  329. package/drag-box.d.ts.map +0 -1
  330. package/drag-box.js +0 -2
  331. package/drag-box.js.map +0 -1
  332. package/link-a.d.ts +0 -2
  333. package/link-a.d.ts.map +0 -1
  334. package/link-a.js +0 -2
  335. package/link-a.js.map +0 -1
  336. package/loading-progress.d.ts +0 -2
  337. package/loading-progress.d.ts.map +0 -1
  338. package/loading-progress.js +0 -2
  339. package/loading-progress.js.map +0 -1
  340. package/open-details.d.ts +0 -2
  341. package/open-details.d.ts.map +0 -1
  342. package/open-details.js +0 -2
  343. package/open-details.js.map +0 -1
  344. package/open-dialog.d.ts +0 -2
  345. package/open-dialog.d.ts.map +0 -1
  346. package/open-dialog.js +0 -2
  347. package/open-dialog.js.map +0 -1
  348. package/open-tooltip.d.ts +0 -2
  349. package/open-tooltip.d.ts.map +0 -1
  350. package/open-tooltip.js +0 -2
  351. package/open-tooltip.js.map +0 -1
  352. package/overbreath-text.d.ts +0 -2
  353. package/overbreath-text.d.ts.map +0 -1
  354. package/overbreath-text.js +0 -2
  355. package/overbreath-text.js.map +0 -1
  356. package/root.d.ts +0 -23
  357. package/root.d.ts.map +0 -1
  358. package/root.js.map +0 -1
  359. package/route-view.d.ts +0 -2
  360. package/route-view.d.ts.map +0 -1
  361. package/route-view.js +0 -2
  362. package/route-view.js.map +0 -1
  363. package/sign-form.d.ts +0 -2
  364. package/sign-form.d.ts.map +0 -1
  365. package/sign-form.js +0 -2
  366. package/sign-form.js.map +0 -1
  367. package/skeleton-screen.d.ts +0 -2
  368. package/skeleton-screen.d.ts.map +0 -1
  369. package/skeleton-screen.js +0 -2
  370. package/skeleton-screen.js.map +0 -1
  371. package/super-a.d.ts +0 -2
  372. package/super-a.d.ts.map +0 -1
  373. package/super-a.js +0 -2
  374. package/super-a.js.map +0 -1
  375. package/tab-group.d.ts +0 -2
  376. package/tab-group.d.ts.map +0 -1
  377. package/tab-group.js +0 -2
  378. package/tab-group.js.map +0 -1
  379. package/time-bar.d.ts +0 -2
  380. package/time-bar.d.ts.map +0 -1
  381. package/time-bar.js +0 -2
  382. package/time-bar.js.map +0 -1
  383. package/typewriter-text.d.ts +0 -2
  384. package/typewriter-text.d.ts.map +0 -1
  385. package/typewriter-text.js +0 -2
  386. package/typewriter-text.js.map +0 -1
  387. package/web-components/a/avatar-a.d.ts.map +0 -1
  388. package/web-components/a/avatar-a.js.map +0 -1
  389. package/web-components/a/link-a.d.ts.map +0 -1
  390. package/web-components/a/link-a.js.map +0 -1
  391. package/web-components/a/super-a.d.ts +0 -31
  392. package/web-components/a/super-a.d.ts.map +0 -1
  393. package/web-components/a/super-a.js.map +0 -1
  394. package/web-components/button/base-button.d.ts.map +0 -1
  395. package/web-components/button/base-button.js.map +0 -1
  396. package/web-components/carousel/carousel-slider.d.ts.map +0 -1
  397. package/web-components/carousel/carousel-slider.js.map +0 -1
  398. package/web-components/form/base-form.d.ts.map +0 -1
  399. package/web-components/form/base-form.js.map +0 -1
  400. package/web-components/form/sign-form.d.ts +0 -19
  401. package/web-components/form/sign-form.d.ts.map +0 -1
  402. package/web-components/form/sign-form.js +0 -16
  403. package/web-components/form/sign-form.js.map +0 -1
  404. package/web-components/group/tab-group.d.ts.map +0 -1
  405. package/web-components/group/tab-group.js.map +0 -1
  406. package/web-components/input/base-input.d.ts +0 -49
  407. package/web-components/input/base-input.d.ts.map +0 -1
  408. package/web-components/input/base-input.js +0 -246
  409. package/web-components/input/base-input.js.map +0 -1
  410. package/web-components/items/alert-item.d.ts.map +0 -1
  411. package/web-components/items/alert-item.js.map +0 -1
  412. package/web-components/items/card-item.d.ts.map +0 -1
  413. package/web-components/items/card-item.js.map +0 -1
  414. package/web-components/items/drag-box.d.ts.map +0 -1
  415. package/web-components/items/drag-box.js.map +0 -1
  416. package/web-components/items/index.d.ts +0 -5
  417. package/web-components/items/index.d.ts.map +0 -1
  418. package/web-components/items/index.js +0 -6
  419. package/web-components/items/index.js.map +0 -1
  420. package/web-components/items/time-bar.d.ts.map +0 -1
  421. package/web-components/items/time-bar.js.map +0 -1
  422. package/web-components/layout/divider-line.d.ts.map +0 -1
  423. package/web-components/layout/divider-line.js.map +0 -1
  424. package/web-components/loading/loading-progress.d.ts.map +0 -1
  425. package/web-components/loading/loading-progress.js.map +0 -1
  426. package/web-components/loading/skeleton-screen.d.ts.map +0 -1
  427. package/web-components/loading/skeleton-screen.js.map +0 -1
  428. package/web-components/open/open-details.d.ts.map +0 -1
  429. package/web-components/open/open-details.js.map +0 -1
  430. package/web-components/open/open-dialog.d.ts.map +0 -1
  431. package/web-components/open/open-dialog.js.map +0 -1
  432. package/web-components/open/open-offset.d.ts.map +0 -1
  433. package/web-components/open/open-offset.js.map +0 -1
  434. package/web-components/open/open-tooltip.d.ts +0 -24
  435. package/web-components/open/open-tooltip.d.ts.map +0 -1
  436. package/web-components/open/open-tooltip.js.map +0 -1
  437. package/web-components/open/open.d.ts.map +0 -1
  438. package/web-components/open/open.js.map +0 -1
  439. package/web-components/text/clip-text.d.ts +0 -21
  440. package/web-components/text/clip-text.d.ts.map +0 -1
  441. package/web-components/text/clip-text.js.map +0 -1
  442. package/web-components/text/overbreath-text.d.ts.map +0 -1
  443. package/web-components/text/overbreath-text.js.map +0 -1
  444. package/web-components/text/typewriter-text.d.ts.map +0 -1
  445. package/web-components/text/typewriter-text.js.map +0 -1
  446. package/web-components/view/route-view.d.ts.map +0 -1
  447. package/web-components/view/route-view.js.map +0 -1
  448. package/web-components/view/wrap-view.d.ts.map +0 -1
  449. package/web-components/view/wrap-view.js.map +0 -1
  450. package/wrap-view.d.ts +0 -2
  451. package/wrap-view.d.ts.map +0 -1
  452. package/wrap-view.js +0 -2
  453. package/wrap-view.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-offset.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/offset/open-offset.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuB,IAAI,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAmB,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE3E,MAAM,UAAU,GAAG,aAAa,CAAC;AAEjC;;;;GAIG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,cAAc;IAwDlC,MAAM;QACd,OAAO,IAAI,CAAA,gBAAgB,IAAI,CAAC,SAAS,IAAI,QAAQ;cAC3C,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC,SAAS,CAAC;eAClC,QAAQ,EAAE;YACb,CAAC;IACX,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IAChF,C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AI,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;gBAC5B,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC;gBACxD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,cAAc,eAAe,KAAK,CAAC;YACtE,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;gBAC1B,MAAM,cAAc,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;gBAC3D,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,cAAc,cAAc,KAAK,CAAC;YACrE,CAAC;iBAAM,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC;gBACpB,MAAM,aAAa,GAAG,CAAC,IAAI,CAAC;gBAC5B,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,cAAc,aAAa,KAAK,CAAC;YACpE,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,EAAE,CAAC;YACtC,CAAC;QACH,CAAC;IACH,CAAC;;AA5GM,iBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiCF;IACD,GAAG,CAAA;;;;;;;;;;;;;KAaF;CACgB,AAjDN,CAiDO;AAnDI;IAAvB,KAAK,CAAC,OAAO,CAAC;6CAAgC;AAHpC,UAAU;IADtB,MAAM,CAAC,UAAU,CAAC;GACN,UAAU,CAkHtB;;AAED,eAAe,UAAU,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, query } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { debounce } from \"../../lib/utils.js\";\nimport { type Direction4, GodownOpenable } from \"../../supers/openable.js\";\n\nconst defineName = \"open-offset\";\n\n/**\n * {@linkcode OpenOffset} will calculate a lateral offset to try to keep the content within the allowable range.\n *\n * Content can be opened in 4 directions.\n */\n@define(defineName)\nexport class OpenOffset extends GodownOpenable {\n direction: Direction4;\n\n @query(\"aside\") private _balancer: HTMLElement;\n\n static styles = [\n css`\n :host {\n display: block;\n height: fit-content;\n width: fit-content;\n }\n\n span {\n user-select: none;\n }\n\n main {\n height: inherit;\n width: inherit;\n display: flex;\n position: relative;\n align-items: center;\n }\n\n aside {\n background-color: inherit;\n visibility: hidden;\n top: 100%;\n z-index: 1;\n }\n\n :host([open]) aside {\n visibility: visible;\n }\n\n :host([float]) aside {\n position: absolute;\n }\n `,\n css`\n .left {\n flex-direction: row-reverse;\n }\n .right {\n flex-direction: row;\n }\n .top {\n flex-direction: column-reverse;\n }\n .bottom {\n flex-direction: column;\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n return html`<main class=\"${this.direction || \"bottom\"}\">\n <span>${this.summary || htmlSlot(\"summary\")}</span>\n <aside>${htmlSlot()}</aside>\n </main>`;\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.addEvent(window, \"resize\", debounce(this._handelResize.bind(this), 500));\n }\n\n protected async firstUpdated() {\n await this.updateComplete;\n this.addEvent(document, \"click\", this._handelClick.bind(this));\n this.resize();\n }\n\n protected _handelClick(e: MouseEvent) {\n if (e.target === this) {\n this.show();\n } else if (!this.contains(e.target as HTMLElement)) {\n this.close();\n }\n }\n\n protected _handelResize() {\n this._balancer.style.transform = \"none\";\n this.resize();\n }\n\n resize() {\n if (!this._balancer) {\n return;\n }\n const offsets = this.offsetParent?.getBoundingClientRect() || document.body.getBoundingClientRect();\n const { left, right, top, bottom, height } = this._balancer.getBoundingClientRect();\n if (this.direction === \"left\" || this.direction === \"right\") {\n if (top < offsets.y) {\n const topTranslate = -top;\n this._balancer.style.transform = `translateY(${topTranslate}px)`;\n }\n if (bottom > offsets.bottom) {\n const bottomTranslate = offsets.height - (top + height);\n this._balancer.style.transform = `translateY(${bottomTranslate}px)`;\n }\n } else {\n if (right > offsets.right) {\n const rightTranslate = offsets.width - (right - offsets.x);\n this._balancer.style.transform = `translateX(${rightTranslate}px)`;\n } else if (left < 0) {\n const leftTranslate = -left;\n this._balancer.style.transform = `translateX(${leftTranslate}px)`;\n } else {\n this._balancer.style.transform = \"\";\n }\n }\n }\n}\n\nexport default OpenOffset;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"open-offset\": OpenOffset;\n \"g-open-offset\": OpenOffset;\n }\n}\n"]}
@@ -1,10 +1,10 @@
1
- import { type CSSResultGroup } from "../../deps.js";
1
+ import { type CSSResultGroup } from "../../.deps.js";
2
2
  import { type HTMLTemplate } from "../../lib/templates.js";
3
- import { GodownElement } from "../../root.js";
3
+ import { GodownElement } from "../../supers/root.js";
4
4
  /**
5
- * LoadProgress similar to progress.
5
+ * {@linkcode Progress} similar to progress.
6
6
  */
7
- export declare class LoadingProgress extends GodownElement {
7
+ export declare class Progress extends GodownElement {
8
8
  /**
9
9
  * Maximum.
10
10
  */
@@ -27,10 +27,11 @@ export declare class LoadingProgress extends GodownElement {
27
27
  */
28
28
  parsePercent(s?: string | number): number;
29
29
  }
30
- export default LoadingProgress;
30
+ export default Progress;
31
31
  declare global {
32
32
  interface HTMLElementTagNameMap {
33
- "loading-progress": LoadingProgress;
33
+ "loading-progress": Progress;
34
+ "g-progress": Progress;
34
35
  }
35
36
  }
36
- //# sourceMappingURL=loading-progress.d.ts.map
37
+ //# sourceMappingURL=progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/progress/progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAkB,MAAM,gBAAgB,CAAC;AAE1E,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAgB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAInE;;GAEG;AACH,qBACa,QAAS,SAAQ,aAAa;IACzC;;OAEG;IACyB,GAAG,SAAK;IACpC;;OAEG;IACyB,GAAG,SAAK;IACpC;;OAEG;IACwC,KAAK,MAAQ;IAExD,MAAM,CAAC,MAAM,iBAuCO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY;IAYhC;;;;;OAKG;IACH,YAAY,CAAC,CAAC,GAAE,MAAM,GAAG,MAAY,GAAG,MAAM;CAM/C;AAED,eAAe,QAAQ,CAAC;AAExB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,QAAQ,CAAC;QAC7B,YAAY,EAAE,QAAQ,CAAC;KACxB;CACF"}
@@ -1,11 +1,12 @@
1
1
  import { __decorate } from "tslib";
2
- import { css, html, property } from "../../deps.js";
3
- import { cssvarValues, define, GodownElement } from "../../root.js";
4
- const defineName = "loading-progress";
2
+ import { css, html, property } from "../../.deps.js";
3
+ import { define } from "../../decorators/define.js";
4
+ import { cssvarValues, GodownElement } from "../../supers/root.js";
5
+ const defineName = "progress";
5
6
  /**
6
- * LoadProgress similar to progress.
7
+ * {@linkcode Progress} similar to progress.
7
8
  */
8
- let LoadingProgress = class LoadingProgress extends GodownElement {
9
+ let Progress = class Progress extends GodownElement {
9
10
  constructor() {
10
11
  super(...arguments);
11
12
  /**
@@ -45,7 +46,7 @@ let LoadingProgress = class LoadingProgress extends GodownElement {
45
46
  return (parseFloat(String(s)) / (this.max - this.min)) * 100;
46
47
  }
47
48
  };
48
- LoadingProgress.styles = [
49
+ Progress.styles = [
49
50
  GodownElement.styles,
50
51
  css `
51
52
  :host,
@@ -87,16 +88,16 @@ LoadingProgress.styles = [
87
88
  ];
88
89
  __decorate([
89
90
  property({ type: Number })
90
- ], LoadingProgress.prototype, "max", void 0);
91
+ ], Progress.prototype, "max", void 0);
91
92
  __decorate([
92
93
  property({ type: Number })
93
- ], LoadingProgress.prototype, "min", void 0);
94
+ ], Progress.prototype, "min", void 0);
94
95
  __decorate([
95
96
  property({ type: Number, reflect: true })
96
- ], LoadingProgress.prototype, "value", void 0);
97
- LoadingProgress = __decorate([
97
+ ], Progress.prototype, "value", void 0);
98
+ Progress = __decorate([
98
99
  define(defineName)
99
- ], LoadingProgress);
100
- export { LoadingProgress };
101
- export default LoadingProgress;
102
- //# sourceMappingURL=loading-progress.js.map
100
+ ], Progress);
101
+ export { Progress };
102
+ export default Progress;
103
+ //# sourceMappingURL=progress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/progress/progress.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuB,IAAI,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEnE,MAAM,UAAU,GAAG,UAAU,CAAC;AAE9B;;GAEG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,aAAa;IAApC;;QACL;;WAEG;QACyB,QAAG,GAAG,CAAC,CAAC;QACpC;;WAEG;QACyB,QAAG,GAAG,CAAC,CAAC;QACpC;;WAEG;QACwC,UAAK,GAAG,IAAI,CAAC;IAmE1D,CAAC;IAxBW,MAAM;QACd,IAAI,KAAK,GAAG,EAAE,CAAC;QACf,IAAI,SAAiB,CAAC;QACtB,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACxB,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACtC,SAAS,GAAG,GAAG,CAAC;QAClB,CAAC;QACD,OAAO,IAAI,CAAA,eAAe,SAAS;wBACf,KAAK;WAClB,CAAC;IACV,CAAC;IAED;;;;;OAKG;IACH,YAAY,CAAC,IAAqB,GAAG;QACnC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5B,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/B,CAAC;QACD,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;IAC/D,CAAC;;AAhEM,eAAM,GAAG;IACd,aAAa,CAAC,MAAM;IACpB,GAAG,CAAA;;;;;;;;0BAQmB,YAAY,CAAC,KAAK;;;;;;;;;;0BAUlB,YAAY,CAAC,MAAM;;;;;;;;;;;;;;;;;;KAkBxC;CACgB,AAvCN,CAuCO;AAjDQ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCAAS;AAIR;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCAAS;AAIO;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCAAc;AAZ7C,QAAQ;IADpB,MAAM,CAAC,UAAU,CAAC;GACN,QAAQ,CA+EpB;;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, property } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { type HTMLTemplate } from \"../../lib/templates.js\";\nimport { cssvarValues, GodownElement } from \"../../supers/root.js\";\n\nconst defineName = \"progress\";\n\n/**\n * {@linkcode Progress} similar to progress.\n */\n@define(defineName)\nexport class Progress extends GodownElement {\n /**\n * Maximum.\n */\n @property({ type: Number }) max = 1;\n /**\n * Minimum.\n */\n @property({ type: Number }) min = 0;\n /**\n * Input value.\n */\n @property({ type: Number, reflect: true }) value = null;\n\n static styles = [\n GodownElement.styles,\n css`\n :host,\n div {\n display: inline-flex;\n position: relative;\n width: 10em;\n height: 0.5em;\n border-radius: 0.25em;\n background: var(${cssvarValues.input}--false);\n z-index: 1;\n }\n\n div i {\n position: absolute;\n border-radius: inherit;\n top: 0;\n left: 0;\n height: 100%;\n background: var(${cssvarValues.cssvar}--accept);\n z-index: 2;\n transition: all 0.3s;\n animation: progress 1.5s ease-in-out infinite alternate;\n }\n\n @keyframes progress {\n from {\n left: 0;\n }\n to {\n left: 80%;\n }\n }\n\n div.v i {\n animation: none;\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n let width = 20;\n let className: string;\n if (this.value !== null) {\n width = this.parsePercent(this.value);\n className = \"v\";\n }\n return html`<div class=\"${className}\">\n <i style=\"width:${width}%;\"></i>\n </div>`;\n }\n\n /**\n * Convert s to a percentage without a percent sign.\n *\n * @param s String or number to convert.\n * @returns Percentage without a percent sign.\n */\n parsePercent(s: string | number = \"0\"): number {\n if (String(s).includes(\"%\")) {\n return parseFloat(String(s));\n }\n return (parseFloat(String(s)) / (this.max - this.min)) * 100;\n }\n}\n\nexport default Progress;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"loading-progress\": Progress;\n \"g-progress\": Progress;\n }\n}\n"]}
@@ -1,10 +1,10 @@
1
- import { SuperA } from "./super-a.js";
1
+ import GodownAnchor from "../../supers/anchor.js";
2
2
  /**
3
- * LinkAnchor works with {@linkcode RouteView}.
3
+ * {@linkcode RouterA} works with {@linkcode Router}.
4
4
  *
5
- * @extends SuperA
5
+ * @extends A
6
6
  */
7
- export declare class LinkA extends SuperA {
7
+ export declare class RouterA extends GodownAnchor {
8
8
  /**
9
9
  * True when the href is in the same pathname as the location.
10
10
  */
@@ -15,7 +15,7 @@ export declare class LinkA extends SuperA {
15
15
  replace: boolean;
16
16
  connectedCallback(): void;
17
17
  /**
18
- * Set active to true when the {@linkcode LinkA.href} is in the same pathname as the location.
18
+ * Set active to true when the {@linkcode RouterA.href} is in the same pathname as the location.
19
19
  */
20
20
  useActive(): void;
21
21
  protected _handleClick(e: MouseEvent): void;
@@ -24,10 +24,11 @@ export declare class LinkA extends SuperA {
24
24
  static pushState(data: any, unused: string, url?: string): void;
25
25
  static replaceState(data: any, unused: string, url?: string): void;
26
26
  }
27
- export default LinkA;
27
+ export default RouterA;
28
28
  declare global {
29
29
  interface HTMLElementTagNameMap {
30
- "link-a": LinkA;
30
+ "link-a": RouterA;
31
+ "router-a": RouterA;
31
32
  }
32
33
  }
33
- //# sourceMappingURL=link-a.d.ts.map
34
+ //# sourceMappingURL=router-a.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router-a.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/router/router-a.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAKlD;;;;GAIG;AACH,qBACa,OAAQ,SAAQ,YAAY;IACvC;;OAEG;IACyC,MAAM,UAAS;IAC3D;;OAEG;IAC0B,OAAO,UAAS;IAE7C,iBAAiB;IAOjB;;OAEG;IACH,SAAS;IAOT,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU;IAapC,SAAS,CAAC,GAAG,SAAY,EAAE,IAAI,MAAO;IAKtC,YAAY,CAAC,GAAG,SAAY,EAAE,IAAI,MAAO;IAKzC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;IAKxD,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;CAI5D;AAED,eAAe,OAAO,CAAC;AAEvB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,QAAQ,EAAE,OAAO,CAAC;QAClB,UAAU,EAAE,OAAO,CAAC;KACrB;CACF"}
@@ -1,16 +1,16 @@
1
- var LinkA_1;
1
+ var RouterA_1;
2
2
  import { __decorate } from "tslib";
3
- import { property } from "../../deps.js";
4
- import { define } from "../../root.js";
5
- import { RouteView } from "../view/route-view.js";
6
- import { SuperA } from "./super-a.js";
7
- const defineName = "link-a";
3
+ import { property } from "../../.deps.js";
4
+ import { define } from "../../decorators/define.js";
5
+ import GodownAnchor from "../../supers/anchor.js";
6
+ import { Router } from "./router.js";
7
+ const defineName = "router-a";
8
8
  /**
9
- * LinkAnchor works with {@linkcode RouteView}.
9
+ * {@linkcode RouterA} works with {@linkcode Router}.
10
10
  *
11
- * @extends SuperA
11
+ * @extends A
12
12
  */
13
- let LinkA = LinkA_1 = class LinkA extends SuperA {
13
+ let RouterA = RouterA_1 = class RouterA extends GodownAnchor {
14
14
  constructor() {
15
15
  super(...arguments);
16
16
  /**
@@ -29,7 +29,7 @@ let LinkA = LinkA_1 = class LinkA extends SuperA {
29
29
  this.useActive();
30
30
  }
31
31
  /**
32
- * Set active to true when the {@linkcode LinkA.href} is in the same pathname as the location.
32
+ * Set active to true when the {@linkcode RouterA.href} is in the same pathname as the location.
33
33
  */
34
34
  useActive() {
35
35
  const url = new URL(this.href, location.href);
@@ -51,31 +51,31 @@ let LinkA = LinkA_1 = class LinkA extends SuperA {
51
51
  }
52
52
  }
53
53
  pushState(url = this.href, data = null) {
54
- LinkA_1.pushState(data, "", url);
54
+ RouterA_1.pushState(data, "", url);
55
55
  this.useActive();
56
56
  }
57
57
  replaceState(url = this.href, data = null) {
58
- LinkA_1.replaceState(data, "", url);
58
+ RouterA_1.replaceState(data, "", url);
59
59
  this.useActive();
60
60
  }
61
61
  static pushState(data, unused, url) {
62
62
  history.pushState(data, unused, url);
63
- RouteView.updateAll();
63
+ Router.updateAll();
64
64
  }
65
65
  static replaceState(data, unused, url) {
66
66
  history.replaceState(data, unused, url);
67
- RouteView.updateAll();
67
+ Router.updateAll();
68
68
  }
69
69
  };
70
70
  __decorate([
71
71
  property({ type: Boolean, reflect: true })
72
- ], LinkA.prototype, "active", void 0);
72
+ ], RouterA.prototype, "active", void 0);
73
73
  __decorate([
74
74
  property({ type: Boolean })
75
- ], LinkA.prototype, "replace", void 0);
76
- LinkA = LinkA_1 = __decorate([
75
+ ], RouterA.prototype, "replace", void 0);
76
+ RouterA = RouterA_1 = __decorate([
77
77
  define(defineName)
78
- ], LinkA);
79
- export { LinkA };
80
- export default LinkA;
81
- //# sourceMappingURL=link-a.js.map
78
+ ], RouterA);
79
+ export { RouterA };
80
+ export default RouterA;
81
+ //# sourceMappingURL=router-a.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router-a.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/router/router-a.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,UAAU,GAAG,UAAU,CAAC;AAE9B;;;;GAIG;AAEI,IAAM,OAAO,eAAb,MAAM,OAAQ,SAAQ,YAAY;IAAlC;;QACL;;WAEG;QACyC,WAAM,GAAG,KAAK,CAAC;QAC3D;;WAEG;QAC0B,YAAO,GAAG,KAAK,CAAC;IAmD/C,CAAC;IAjDC,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAChD,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7D,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,SAAS;QACP,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,GAAG,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CAAC;IACrB,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,IAAS,EAAE,MAAc,EAAE,GAAY;QACzD,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QACxC,MAAM,CAAC,SAAS,EAAE,CAAC;IACrB,CAAC;CACF,CAAA;AAvD6C;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCAAgB;AAI9B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCAAiB;AARlC,OAAO;IADnB,MAAM,CAAC,UAAU,CAAC;GACN,OAAO,CA2DnB;;AAED,eAAe,OAAO,CAAC","sourcesContent":["import { property } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport GodownAnchor from \"../../supers/anchor.js\";\nimport { Router } from \"./router.js\";\n\nconst defineName = \"router-a\";\n\n/**\n * {@linkcode RouterA} works with {@linkcode Router}.\n *\n * @extends A\n */\n@define(defineName)\nexport class RouterA extends GodownAnchor {\n /**\n * True when the href is in the same pathname as the location.\n */\n @property({ type: Boolean, reflect: true }) active = false;\n /**\n * If true, replaceState, or pushState.\n */\n @property({ type: Boolean }) replace = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.addEvent(this, \"click\", this._handleClick);\n this.addEvent(window, \"popstate\", this.useActive.bind(this));\n this.useActive();\n }\n\n /**\n * Set active to true when the {@linkcode RouterA.href} is in the same pathname as the location.\n */\n useActive() {\n const url = new URL(this.href, location.href);\n if (url.origin === location.origin) {\n this.active = url.pathname === location.pathname;\n }\n }\n\n protected _handleClick(e: MouseEvent) {\n const href = this.href ?? this.querySelector(\"[href]\")?.getAttribute(\"href\");\n const url = new URL(href, location.href);\n if (url.origin === location.origin) {\n e.preventDefault();\n if (this.replace) {\n this.replaceState(href);\n } else {\n this.pushState(href);\n }\n }\n }\n\n pushState(url = this.href, data = null) {\n RouterA.pushState(data, \"\", url);\n this.useActive();\n }\n\n replaceState(url = this.href, data = null) {\n RouterA.replaceState(data, \"\", url);\n this.useActive();\n }\n\n static pushState(data: any, unused: string, url?: string) {\n history.pushState(data, unused, url);\n Router.updateAll();\n }\n\n static replaceState(data: any, unused: string, url?: string) {\n history.replaceState(data, unused, url);\n Router.updateAll();\n }\n}\n\nexport default RouterA;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"link-a\": RouterA;\n \"router-a\": RouterA;\n }\n}\n"]}
@@ -1,11 +1,11 @@
1
- import { type PropertyValueMap } from "../../deps.js";
1
+ import { type PropertyValueMap } from "../../.deps.js";
2
2
  import RouteTree from "../../lib/route-tree.js";
3
3
  import { type HTMLTemplate } from "../../lib/templates.js";
4
- import { GodownElement } from "../../root.js";
4
+ import { GodownElement } from "../../supers/root.js";
5
5
  /**
6
- * RouteView has basic routing control.
6
+ * {@linkcode Router} has basic routing control.
7
7
  */
8
- export declare class RouteView<T = unknown> extends GodownElement {
8
+ export declare class Router<T = unknown> extends GodownElement {
9
9
  private _routes;
10
10
  private _routeTree;
11
11
  /**
@@ -51,7 +51,7 @@ export declare class RouteView<T = unknown> extends GodownElement {
51
51
  pathname: string;
52
52
  params: Record<string, string>;
53
53
  path: string;
54
- component: import("lit").TemplateResult<1> | T;
54
+ component: T | import("lit").TemplateResult<1>;
55
55
  }>;
56
56
  set routes(v: (Record<string, any> & Record<"path", string> & {
57
57
  component?: T;
@@ -66,7 +66,7 @@ export declare class RouteView<T = unknown> extends GodownElement {
66
66
  pathname: string;
67
67
  params: Record<string, string>;
68
68
  path: string;
69
- component: import("lit").TemplateResult<1> | T;
69
+ component: T | import("lit").TemplateResult<1>;
70
70
  };
71
71
  connectedCallback(): void;
72
72
  /**
@@ -82,10 +82,11 @@ export declare class RouteView<T = unknown> extends GodownElement {
82
82
  parseRouterParams(routeTemplate: string, originpath: string, appl?: RouteTree): Record<string, string>;
83
83
  static updateAll(): void;
84
84
  }
85
- export default RouteView;
85
+ export default Router;
86
86
  declare global {
87
87
  interface HTMLElementTagNameMap {
88
- "route-view": RouteView;
88
+ "route-view": Router;
89
+ router: Router;
89
90
  }
90
91
  }
91
- //# sourceMappingURL=route-view.d.ts.map
92
+ //# sourceMappingURL=router.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/router/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,gBAAgB,EAAS,MAAM,gBAAgB,CAAC;AAG7E,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAMrD;;GAEG;AACH,qBACa,MAAM,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,aAAa;IACpD,OAAO,CAAC,OAAO,CAAkD;IACjE,OAAO,CAAC,UAAU,CAA8B;IAEhD;;OAEG;IACM,SAAS,EAAE,CAAC,GAAG,YAAY,CAAQ;IAC5C;;OAEG;IACM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;IAC7C;;OAEG;IACM,IAAI,EAAE,MAAM,CAAQ;IAC7B;;OAEG;IACS,QAAQ,SAAM;IAC1B;;OAEG;IACS,OAAO,SAAM;IACzB;;OAEG;IACM,GAAG,kCAAc;IAC1B;;OAEG;IACS,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAY;IACtE;;OAEG;IACM,QAAQ,UAAQ;IACzB;;OAEG;IAC0B,KAAK,UAAS;IAE3C;;OAEG;IACH,MAAM;;;;;OAAwD;IAE9D,IAAI,MAAM,CAAC,CAAC;;QAAA,EAUX;IAED,IAAI,MAAM;;SAET;IAED,MAAM,CAAC,MAAM,4BAMX;IAEF,KAAK;IAKL,SAAS,CAAC,MAAM,IAAI,CAAC,GAAG,YAAY;IAwBpC,SAAS;;;;;;IAST,iBAAiB;IAsBjB;;;;OAIG;IACH,mBAAmB,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAQ;IAE5F,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAa3D,cAAc,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,CAAC;IAgBpD,gBAAgB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,YAAY;IA6BjE,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,SAAe,EAAE,IAAI,GAAE,SAA2B,GAAG,MAAM,GAAG,IAAI;IAIrG,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,GAAE,SAA2B,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIvH,MAAM,CAAC,SAAS;CAYjB;AAED,eAAe,MAAM,CAAC;AAEtB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,MAAM,CAAC;QACrB,MAAM,EAAE,MAAM,CAAC;KAChB;CACF"}
@@ -1,16 +1,16 @@
1
1
  import { __decorate } from "tslib";
2
+ import { css, property, state } from "../../.deps.js";
2
3
  import { conf } from "../../conf.js";
3
- import { css, property, state } from "../../deps.js";
4
+ import { define } from "../../decorators/define.js";
4
5
  import RouteTree from "../../lib/route-tree.js";
5
6
  import { htmlSlot } from "../../lib/templates.js";
6
7
  import { deepQuerySelectorAll } from "../../lib/utils.js";
7
- import { define } from "../../root.js";
8
- import { GodownElement } from "../../root.js";
9
- const defineName = "route-view";
8
+ import { GodownElement } from "../../supers/root.js";
9
+ const defineName = "router";
10
10
  /**
11
- * RouteView has basic routing control.
11
+ * {@linkcode Router} has basic routing control.
12
12
  */
13
- let RouteView = class RouteView extends GodownElement {
13
+ let Router = class Router extends GodownElement {
14
14
  constructor() {
15
15
  super(...arguments);
16
16
  this._routes = [];
@@ -206,7 +206,7 @@ let RouteView = class RouteView extends GodownElement {
206
206
  });
207
207
  }
208
208
  };
209
- RouteView.styles = [
209
+ Router.styles = [
210
210
  css `
211
211
  :host {
212
212
  display: contents;
@@ -215,34 +215,34 @@ RouteView.styles = [
215
215
  ];
216
216
  __decorate([
217
217
  state()
218
- ], RouteView.prototype, "component", void 0);
218
+ ], Router.prototype, "component", void 0);
219
219
  __decorate([
220
220
  state()
221
- ], RouteView.prototype, "params", void 0);
221
+ ], Router.prototype, "params", void 0);
222
222
  __decorate([
223
223
  state()
224
- ], RouteView.prototype, "path", void 0);
224
+ ], Router.prototype, "path", void 0);
225
225
  __decorate([
226
226
  property()
227
- ], RouteView.prototype, "pathname", void 0);
227
+ ], Router.prototype, "pathname", void 0);
228
228
  __decorate([
229
229
  property()
230
- ], RouteView.prototype, "baseURL", void 0);
230
+ ], Router.prototype, "baseURL", void 0);
231
231
  __decorate([
232
232
  state()
233
- ], RouteView.prototype, "def", void 0);
233
+ ], Router.prototype, "def", void 0);
234
234
  __decorate([
235
235
  property()
236
- ], RouteView.prototype, "type", void 0);
236
+ ], Router.prototype, "type", void 0);
237
237
  __decorate([
238
238
  state()
239
- ], RouteView.prototype, "override", void 0);
239
+ ], Router.prototype, "override", void 0);
240
240
  __decorate([
241
241
  property({ type: Boolean })
242
- ], RouteView.prototype, "cache", void 0);
243
- RouteView = __decorate([
242
+ ], Router.prototype, "cache", void 0);
243
+ Router = __decorate([
244
244
  define(defineName)
245
- ], RouteView);
246
- export { RouteView };
247
- export default RouteView;
248
- //# sourceMappingURL=route-view.js.map
245
+ ], Router);
246
+ export { Router };
247
+ export default Router;
248
+ //# sourceMappingURL=router.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/router/router.ts"],"names":[],"mappings":";AAAA,OA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,CAAC,aAAqB,EAAE,UAAkB,EAAE,OAAkB,IAAI,CAAC,UAAU;QAC5F,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,CAAC,SAAS;QACd,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACxD,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,OAAO;QACT,CAAC;QACD,MAAM,cAAc,GAAG,oBAAoB,CAAS,gBAAgB,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QACrF,cAAc,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;YACnC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;gBACxB,SAAS,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAChD,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;;AAxJM,aAAM,GAAG;IACd,GAAG,CAAA;;;;KAIF;CACF,AANY,CAMX;AA7DO;IAAR,KAAK,EAAE;yCAAoC;AAInC;IAAR,KAAK,EAAE;sCAAqC;AAIpC;IAAR,KAAK,EAAE;oCAAqB;AAIjB;IAAX,QAAQ,EAAE;wCAAe;AAId;IAAX,QAAQ,EAAE;uCAAc;AAIhB;IAAR,KAAK,EAAE;mCAAkB;AAId;IAAX,QAAQ,EAAE;oCAA2D;AAI7D;IAAR,KAAK,EAAE;wCAAiB;AAII;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qCAAe;AAvChC,MAAM;IADlB,MAAM,CAAC,UAAU,CAAC;GACN,MAAM,CAuNlB;;AAED,eAAe,MAAM,CAAC","sourcesContent":["import { css, property, type PropertyValueMap, state } from \"../../.deps.js\";\nimport { conf } from \"../../conf.js\";\nimport { define } from \"../../decorators/define.js\";\nimport RouteTree from \"../../lib/route-tree.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { deepQuerySelectorAll } from \"../../lib/utils.js\";\nimport { GodownElement } from \"../../supers/root.js\";\n\ntype WithRecord<T extends string> = Record<string, any> & Record<T, string>;\n\nconst defineName = \"router\";\n\n/**\n * {@linkcode Router} has basic routing control.\n */\n@define(defineName)\nexport class Router<T = unknown> extends GodownElement {\n private _routes: (WithRecord<\"path\"> & { component?: T })[] = [];\n private _routeTree: RouteTree = new RouteTree();\n\n /**\n * Component will render.\n */\n @state() component: T | HTMLTemplate = null;\n /**\n * Dynamic parameters record.\n */\n @state() params: Record<string, string> = {};\n /**\n * Value of matched path in routes, or null.\n */\n @state() path: string = null;\n /**\n * Current pathname (location.pathname).\n */\n @property() pathname = \"\";\n /**\n * Path prefix.\n */\n @property() baseURL = \"\";\n /**\n * Rendered content when there is no match.\n */\n @state() def = htmlSlot();\n /**\n * The type of routing query.\n */\n @property() type: \"united\" | \"child\" | \"slotted\" | \"field\" = \"united\";\n /**\n * Rewrite history.\n */\n @state() override = true;\n /**\n * Cache accessed.\n */\n @property({ type: Boolean }) cache = false;\n\n /**\n * Cache record.\n */\n record = new Map<string, ReturnType<typeof this.useRouter>>();\n\n set routes(v) {\n if (Object.prototype.toString.call(v) !== \"[object Array]\") {\n return;\n }\n this._routes = v;\n this.reset();\n for (const route of v) {\n this._routeTree.insert(route.path);\n }\n this.requestUpdate();\n }\n\n get routes() {\n return this._routes;\n }\n\n static styles = [\n css`\n :host {\n display: contents;\n }\n `,\n ];\n\n reset() {\n this._routeTree = new RouteTree();\n this.record.clear();\n }\n\n protected render(): T | HTMLTemplate {\n if (this.cache) {\n const cached = this.record.get(this.pathname);\n if (cached) {\n Object.assign(this, cached);\n return this.component;\n }\n }\n this.params = {};\n switch (this.type) {\n case \"field\":\n this.component = this.fieldComponent();\n break;\n case \"child\":\n case \"slotted\":\n this.component = this.slottedComponent();\n break;\n case \"united\":\n this.component = this.fieldComponent() ?? this.slottedComponent();\n break;\n }\n return this.component ?? this.def;\n }\n\n useRouter() {\n return {\n pathname: this.pathname,\n params: this.params,\n path: this.path,\n component: this.component,\n };\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.pathname = window.location.pathname;\n if (!this.override) {\n return;\n }\n this.addEvent(window, \"popstate\", () => {\n this.pathname = window.location.pathname;\n });\n const self = this;\n const pushHistory = history.pushState;\n history.pushState = function () {\n pushHistory.apply(this, arguments);\n self.pathname = window.location.pathname;\n };\n const replaceHistory = history.replaceState;\n history.replaceState = function () {\n replaceHistory.apply(this, arguments);\n self.pathname = window.location.pathname;\n };\n }\n\n /**\n *\n * @param ur value of useRouter()\n * @param first whether this path is loaded for the first time\n */\n routeChangeCallback: (ur: ReturnType<typeof this.useRouter>, first: boolean) => void = null;\n\n protected updated(changedProperties: PropertyValueMap<this>) {\n const shouldDispatch = changedProperties.has(\"pathname\") || changedProperties.has(\"path\");\n if (shouldDispatch) {\n const ur = this.useRouter();\n const noRecord = !this.record.has(this.pathname);\n if (noRecord) {\n this.record.set(this.pathname, ur);\n }\n this.routeChangeCallback?.(ur, noRecord);\n this.dispatchEvent(new CustomEvent(\"change\", { detail: ur }));\n }\n }\n\n fieldComponent(usedRouteTemplate?: string): null | T {\n if (!usedRouteTemplate) {\n usedRouteTemplate = this.useWhichRoute(this.pathname);\n }\n this.path = usedRouteTemplate;\n if (!usedRouteTemplate) {\n return null;\n }\n this.params = this.parseRouterParams(this.path, this.pathname);\n const route = this.routes.find((r) => r.path === usedRouteTemplate);\n if (!route) {\n return null;\n }\n return route.component;\n }\n\n slottedComponent(usedRouteTemplate?: string): null | HTMLTemplate {\n const childNodes = this.querySelectorAll(\":scope > *[slot]\");\n if (!childNodes.length) {\n return null;\n }\n const slottedPaths = Array.from(childNodes).map((node) => {\n const slotname = node.getAttribute(\"slot\");\n return {\n path: slotname,\n };\n });\n const tempRouteTree = new RouteTree();\n for (const withPath of slottedPaths) {\n tempRouteTree.insert(withPath.path);\n }\n if (!usedRouteTemplate) {\n usedRouteTemplate = this.useWhichRoute(this.pathname, undefined, tempRouteTree);\n if (!usedRouteTemplate) {\n return null;\n }\n }\n const slotElement = slottedPaths.find((s) => s.path === usedRouteTemplate);\n if (!slotElement) {\n return null;\n }\n this.params = this.parseRouterParams(usedRouteTemplate, this.pathname);\n return htmlSlot(slotElement.path);\n }\n\n useWhichRoute(path: string, baseURL = this.baseURL, appl: RouteTree = this._routeTree): string | null {\n return appl.useWhich(baseURL + path);\n }\n\n parseRouterParams(routeTemplate: string, originpath: string, appl: RouteTree = this._routeTree): Record<string, string> {\n return appl.parseParams(originpath, routeTemplate);\n }\n\n static updateAll() {\n const routeViewTagName = conf.nameMap.get(\"route-view\");\n if (!routeViewTagName) {\n return;\n }\n const routeViewArray = deepQuerySelectorAll<Router>(routeViewTagName, document.body);\n routeViewArray.forEach((ArrayItem) => {\n if (!ArrayItem.override) {\n ArrayItem.pathname = window.location.pathname;\n }\n });\n }\n}\n\nexport default Router;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"route-view\": Router;\n router: Router;\n }\n}\n"]}
@@ -1,12 +1,12 @@
1
- import { type CSSResultGroup } from "../../deps.js";
1
+ import { type CSSResultGroup } from "../../.deps.js";
2
2
  import { type HTMLTemplate } from "../../lib/templates.js";
3
- import { GodownElement } from "../../root.js";
3
+ import { GodownElement } from "../../supers/root.js";
4
4
  /**
5
- * SkeletonScreen renders a skeleton screen.
5
+ * {@linkcode Skeleton} renders a skeleton screen.
6
6
  *
7
7
  * Inspired by Ant-design.
8
8
  */
9
- export declare class SkeletonScreen extends GodownElement {
9
+ export declare class Skeleton extends GodownElement {
10
10
  /**
11
11
  * Skeleton type.
12
12
  */
@@ -23,10 +23,11 @@ export declare class SkeletonScreen extends GodownElement {
23
23
  protected render(): HTMLTemplate;
24
24
  private renderIcon;
25
25
  }
26
- export default SkeletonScreen;
26
+ export default Skeleton;
27
27
  declare global {
28
28
  interface HTMLElementTagNameMap {
29
- "skeleton-screen": SkeletonScreen;
29
+ "skeleton-screen": Skeleton;
30
+ "g-skeleton": Skeleton;
30
31
  }
31
32
  }
32
- //# sourceMappingURL=skeleton-screen.d.ts.map
33
+ //# sourceMappingURL=skeleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skeleton.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/skeleton/skeleton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAyB,MAAM,gBAAgB,CAAC;AAEjF,OAAO,EAAY,KAAK,YAAY,EAAY,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAA6B,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAKhF;;;;GAIG;AACH,qBACa,QAAS,SAAQ,aAAa;IACzC;;OAEG;IACS,IAAI,EAAE,MAAM,GAAG,OAAO,CAAU;IAC5C;;OAEG;IACS,SAAS,EAAE,UAAU,GAAG,SAAS,CAAc;IAC3D;;OAEG;IACM,OAAO,UAAQ;IAExB,MAAM,CAAC,MAAM,iBA+EO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY;IAOhC,OAAO,CAAC,UAAU;CAQnB;AAED,eAAe,QAAQ,CAAC;AAExB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,QAAQ,CAAC;QAC5B,YAAY,EAAE,QAAQ,CAAC;KACxB;CACF"}
@@ -1,15 +1,16 @@
1
1
  import { __decorate } from "tslib";
2
- import { css, html, property, state } from "../../deps.js";
2
+ import { css, html, property, state } from "../../.deps.js";
3
+ import { define } from "../../decorators/define.js";
3
4
  import { htmlSlot, svgImage } from "../../lib/templates.js";
4
- import { createScope, cssvarValues, define, GodownElement } from "../../root.js";
5
- const defineName = "skeleton-screen";
5
+ import { createScope, cssvarValues, GodownElement } from "../../supers/root.js";
6
+ const defineName = "skeleton";
6
7
  const cssvarScope = createScope(defineName);
7
8
  /**
8
- * SkeletonScreen renders a skeleton screen.
9
+ * {@linkcode Skeleton} renders a skeleton screen.
9
10
  *
10
11
  * Inspired by Ant-design.
11
12
  */
12
- let SkeletonScreen = class SkeletonScreen extends GodownElement {
13
+ let Skeleton = class Skeleton extends GodownElement {
13
14
  constructor() {
14
15
  super(...arguments);
15
16
  /**
@@ -40,7 +41,7 @@ let SkeletonScreen = class SkeletonScreen extends GodownElement {
40
41
  }
41
42
  }
42
43
  };
43
- SkeletonScreen.styles = [
44
+ Skeleton.styles = [
44
45
  GodownElement.styles,
45
46
  css `
46
47
  :host {
@@ -122,16 +123,16 @@ SkeletonScreen.styles = [
122
123
  ];
123
124
  __decorate([
124
125
  property()
125
- ], SkeletonScreen.prototype, "type", void 0);
126
+ ], Skeleton.prototype, "type", void 0);
126
127
  __decorate([
127
128
  property()
128
- ], SkeletonScreen.prototype, "animation", void 0);
129
+ ], Skeleton.prototype, "animation", void 0);
129
130
  __decorate([
130
131
  state()
131
- ], SkeletonScreen.prototype, "loading", void 0);
132
- SkeletonScreen = __decorate([
132
+ ], Skeleton.prototype, "loading", void 0);
133
+ Skeleton = __decorate([
133
134
  define(defineName)
134
- ], SkeletonScreen);
135
- export { SkeletonScreen };
136
- export default SkeletonScreen;
137
- //# sourceMappingURL=skeleton-screen.js.map
135
+ ], Skeleton);
136
+ export { Skeleton };
137
+ export default Skeleton;
138
+ //# sourceMappingURL=skeleton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skeleton.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/skeleton/skeleton.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuB,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAqB,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEhF,MAAM,UAAU,GAAG,U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C;AAIhC;IAAX,QAAQ,EAAE;2CAAgD;AAIlD;IAAR,KAAK,EAAE;yCAAgB;AAZb,QAAQ;IADpB,MAAM,CAAC,UAAU,CAAC;GACN,QAAQ,CA8GpB;;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, property, state } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { htmlSlot, type HTMLTemplate, svgImage } from \"../../lib/templates.js\";\nimport { createScope, cssvarValues, GodownElement } from \"../../supers/root.js\";\n\nconst defineName = \"skeleton\";\nconst cssvarScope = createScope(defineName);\n\n/**\n * {@linkcode Skeleton} renders a skeleton screen.\n *\n * Inspired by Ant-design.\n */\n@define(defineName)\nexport class Skeleton extends GodownElement {\n /**\n * Skeleton type.\n */\n @property() type: \"text\" | \"image\" = \"text\";\n /**\n * Animation type.\n */\n @property() animation: \"position\" | \"opacity\" = \"position\";\n /**\n * If false, hidden.\n */\n @state() loading = true;\n\n static styles = [\n GodownElement.styles,\n css`\n :host {\n display: block;\n min-height: 1.5em;\n width: 100%;\n overflow: hidden;\n ${cssvarScope}--from: rgb(var(${cssvarValues.textRGB}) / 7.5%);\n ${cssvarScope}--to: rgb(var(${cssvarValues.textRGB}) / 20%);\n ${cssvarScope}--deg: 94deg;\n ${cssvarScope}--color: rgb(var(${cssvarValues.textRGB}) / 50%);\n ${cssvarScope}--background: var(${cssvarValues.main});\n ${cssvarScope}--duration: 1.5s;\n ${cssvarScope}--icon-width: 5em;\n ${cssvarScope}--icon-height: 5em;\n ${cssvarScope}--icon-margin: .75em;\n color: var(${cssvarScope}--color);\n background: var(${cssvarScope}--background);\n }\n\n p {\n height: 100%;\n min-height: inherit;\n animation: var(${cssvarScope}--duration) ease-in-out 0s infinite none running;\n }\n\n p.position {\n background-image: linear-gradient(var(${cssvarScope}--deg), var(${cssvarScope}--from) 36%, var(${cssvarScope}--to) 50%, var(${cssvarScope}--from) 64%);\n background-color: transparent;\n background-size: 200% 100%;\n animation-name: po;\n }\n\n @keyframes po {\n from {\n background-position: 150% center;\n }\n to {\n background-position: -50% center;\n }\n }\n\n p.opacity {\n background: var(${cssvarScope}--from);\n animation-name: op;\n animation-direction: alternate;\n }\n\n @keyframes op {\n 50% {\n opacity: 0.2;\n }\n to {\n opacity: 1;\n }\n }\n\n path {\n fill: var(${cssvarScope}--color);\n }\n\n svg,\n slot {\n width: var(${cssvarScope}--icon-width);\n height: var(${cssvarScope}--icon-height);\n }\n\n svg {\n margin: var(${cssvarScope}--icon-margin);\n }\n\n p,\n svg {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n if (this.loading) {\n return html`<p class=\"${this.animation}\">${this.renderIcon()}</p>`;\n }\n return htmlSlot();\n }\n\n private renderIcon(): HTMLTemplate {\n switch (this.type) {\n case \"text\":\n return htmlSlot(\"icon\");\n case \"image\":\n return svgImage();\n }\n }\n}\n\nexport default Skeleton;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"skeleton-screen\": Skeleton;\n \"g-skeleton\": Skeleton;\n }\n}\n"]}
@@ -1,12 +1,12 @@
1
- import { type CSSResultGroup, type PropertyValueMap } from "../../deps.js";
1
+ import { type CSSResultGroup, type PropertyValueMap } from "../../.deps.js";
2
2
  import { type HTMLTemplate } from "../../lib/templates.js";
3
- import { GodownElement } from "../../root.js";
3
+ import { GodownElement } from "../../supers/root.js";
4
4
  /**
5
- * TabGroup used to support multiple tabs.
5
+ * {@linkcode GodownTab} used to support multiple tab.
6
6
  *
7
7
  * Inspired by Next-ui.
8
8
  */
9
- export declare class TabGroup extends GodownElement {
9
+ export declare class Tabs extends GodownElement {
10
10
  /**
11
11
  * Active slot name.
12
12
  */
@@ -20,7 +20,7 @@ export declare class TabGroup extends GodownElement {
20
20
  */
21
21
  align: string;
22
22
  /**
23
- * Header texts or slot names, if headers is a zero value, it is taken from the {@linkcode TabGroup.contents}.
23
+ * Header texts or slot names, if headers is a zero value, it is taken from the {@linkcode Tabs.contents}.
24
24
  */
25
25
  headers: string[] | void;
26
26
  /**
@@ -42,10 +42,11 @@ export declare class TabGroup extends GodownElement {
42
42
  */
43
43
  getTabs(): void;
44
44
  }
45
- export default TabGroup;
45
+ export default Tabs;
46
46
  declare global {
47
47
  interface HTMLElementTagNameMap {
48
- "tab-group": TabGroup;
48
+ "tab-group": Tabs;
49
+ "g-tabs": Tabs;
49
50
  }
50
51
  }
51
- //# sourceMappingURL=tab-group.d.ts.map
52
+ //# sourceMappingURL=tabs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tabs.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/tabs/tabs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAkB,KAAK,gBAAgB,EAAS,MAAM,gBAAgB,CAAC;AAGxG,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAA6B,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAMhF;;;;GAIG;AACH,qBACa,IAAK,SAAQ,aAAa;IACrC;;OAEG;IACS,KAAK,SAAM;IACvB;;OAEG;IACS,GAAG,SAAM;IACrB;;OAEG;IACS,KAAK,SAAW;IAC5B;;OAEG;IACM,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAClC;;OAEG;IACM,QAAQ,EAAE,MAAM,EAAE,CAAC;IAE5B,MAAM,CAAC,MAAM,iBA0CO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY;IAoBhC,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAkB3D;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,UAAQ;IAalC,iBAAiB;IAWjB;;OAEG;IACH,OAAO;CAGR;AAED,eAAe,IAAI,CAAC;AAEpB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,IAAI,CAAC;QAClB,QAAQ,EAAE,IAAI,CAAC;KAChB;CACF"}