godown 2.6.2 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (461) 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/templates.d.ts +2 -0
  77. package/lib/templates.d.ts.map +1 -1
  78. package/lib/templates.js +4 -0
  79. package/lib/templates.js.map +1 -1
  80. package/lib/utils.d.ts +0 -1
  81. package/lib/utils.d.ts.map +1 -1
  82. package/lib/utils.js +0 -7
  83. package/lib/utils.js.map +1 -1
  84. package/naming.d.ts +91 -0
  85. package/naming.d.ts.map +1 -0
  86. package/naming.js +67 -0
  87. package/naming.js.map +1 -0
  88. package/nav-layout.js.map +1 -1
  89. package/open-offset.d.ts +1 -1
  90. package/open-offset.d.ts.map +1 -1
  91. package/open-offset.js +1 -1
  92. package/open-offset.js.map +1 -1
  93. package/overbreath.d.ts +2 -0
  94. package/overbreath.d.ts.map +1 -0
  95. package/overbreath.js +2 -0
  96. package/overbreath.js.map +1 -0
  97. package/package.json +29 -33
  98. package/progress.d.ts +2 -0
  99. package/progress.d.ts.map +1 -0
  100. package/progress.js +2 -0
  101. package/progress.js.map +1 -0
  102. package/react/index.d.ts +24 -25
  103. package/react/index.d.ts.map +1 -1
  104. package/react/index.js +52 -56
  105. package/react/index.js.map +1 -1
  106. package/router-a.d.ts +2 -0
  107. package/router-a.d.ts.map +1 -0
  108. package/router-a.js +2 -0
  109. package/router-a.js.map +1 -0
  110. package/router.d.ts +2 -0
  111. package/router.d.ts.map +1 -0
  112. package/router.js +2 -0
  113. package/router.js.map +1 -0
  114. package/search-input.js.map +1 -1
  115. package/select-input.js.map +1 -1
  116. package/skeleton.d.ts +2 -0
  117. package/skeleton.d.ts.map +1 -0
  118. package/skeleton.js +2 -0
  119. package/skeleton.js.map +1 -0
  120. package/split-input.js.map +1 -1
  121. package/supers/anchor.d.ts +26 -0
  122. package/supers/anchor.d.ts.map +1 -0
  123. package/{web-components/a/super-a.js → supers/anchor.js} +27 -22
  124. package/supers/anchor.js.map +1 -0
  125. package/supers/input.d.ts +28 -0
  126. package/supers/input.d.ts.map +1 -0
  127. package/supers/input.js +117 -0
  128. package/supers/input.js.map +1 -0
  129. package/{web-components/open/open.d.ts → supers/openable.d.ts} +6 -6
  130. package/supers/openable.d.ts.map +1 -0
  131. package/{web-components/open/open.js → supers/openable.js} +11 -11
  132. package/supers/openable.js.map +1 -0
  133. package/supers/root.d.ts +18 -0
  134. package/supers/root.d.ts.map +1 -0
  135. package/{root.js → supers/root.js} +3 -11
  136. package/supers/root.js.map +1 -0
  137. package/switch-input.js.map +1 -1
  138. package/tabs.d.ts +2 -0
  139. package/tabs.d.ts.map +1 -0
  140. package/tabs.js +2 -0
  141. package/tabs.js.map +1 -0
  142. package/time.d.ts +2 -0
  143. package/time.d.ts.map +1 -0
  144. package/time.js +2 -0
  145. package/time.js.map +1 -0
  146. package/tooltip.d.ts +2 -0
  147. package/tooltip.d.ts.map +1 -0
  148. package/tooltip.js +2 -0
  149. package/tooltip.js.map +1 -0
  150. package/typewriter.d.ts +2 -0
  151. package/typewriter.d.ts.map +1 -0
  152. package/typewriter.js +2 -0
  153. package/typewriter.js.map +1 -0
  154. package/web-components/a/a.d.ts +16 -0
  155. package/web-components/a/a.d.ts.map +1 -0
  156. package/web-components/a/a.js +17 -0
  157. package/web-components/a/a.js.map +1 -0
  158. package/web-components/{items/alert-item.d.ts → alert/alert.d.ts} +8 -7
  159. package/web-components/alert/alert.d.ts.map +1 -0
  160. package/web-components/{items/alert-item.js → alert/alert.js} +18 -17
  161. package/web-components/alert/alert.js.map +1 -0
  162. package/web-components/{a/avatar-a.d.ts → avatar/avatar.d.ts} +9 -8
  163. package/web-components/avatar/avatar.d.ts.map +1 -0
  164. package/web-components/{a/avatar-a.js → avatar/avatar.js} +20 -19
  165. package/web-components/avatar/avatar.js.map +1 -0
  166. package/web-components/button/{base-button.d.ts → button.d.ts} +7 -10
  167. package/web-components/button/button.d.ts.map +1 -0
  168. package/web-components/button/{base-button.js → button.js} +22 -46
  169. package/web-components/button/button.js.map +1 -0
  170. package/web-components/{items/card-item.d.ts → card/card.d.ts} +8 -7
  171. package/web-components/card/card.d.ts.map +1 -0
  172. package/web-components/{items/card-item.js → card/card.js} +15 -14
  173. package/web-components/card/card.js.map +1 -0
  174. package/web-components/carousel/{carousel-slider.d.ts → carousel.d.ts} +8 -6
  175. package/web-components/carousel/carousel.d.ts.map +1 -0
  176. package/web-components/carousel/{carousel-slider.js → carousel.js} +16 -16
  177. package/web-components/carousel/carousel.js.map +1 -0
  178. package/web-components/{open/open-details.d.ts → details/details.d.ts} +8 -7
  179. package/web-components/details/details.d.ts.map +1 -0
  180. package/web-components/{open/open-details.js → details/details.js} +17 -16
  181. package/web-components/details/details.js.map +1 -0
  182. package/web-components/{open/open-dialog.d.ts → dialog/dialog.d.ts} +9 -7
  183. package/web-components/dialog/dialog.d.ts.map +1 -0
  184. package/web-components/{open/open-dialog.js → dialog/dialog.js} +19 -18
  185. package/web-components/dialog/dialog.js.map +1 -0
  186. package/web-components/form/{base-form.d.ts → form.d.ts} +8 -7
  187. package/web-components/form/form.d.ts.map +1 -0
  188. package/web-components/form/{base-form.js → form.js} +16 -15
  189. package/web-components/form/form.js.map +1 -0
  190. package/web-components/group/avatar-group.d.ts +6 -5
  191. package/web-components/group/avatar-group.d.ts.map +1 -1
  192. package/web-components/group/avatar-group.js +8 -7
  193. package/web-components/group/avatar-group.js.map +1 -1
  194. package/web-components/group/details-group.d.ts +3 -2
  195. package/web-components/group/details-group.d.ts.map +1 -1
  196. package/web-components/group/details-group.js +4 -3
  197. package/web-components/group/details-group.js.map +1 -1
  198. package/web-components/index.d.ts +24 -25
  199. package/web-components/index.d.ts.map +1 -1
  200. package/web-components/index.js +24 -26
  201. package/web-components/index.js.map +1 -1
  202. package/web-components/input/input.d.ts +44 -22
  203. package/web-components/input/input.d.ts.map +1 -1
  204. package/web-components/input/input.js +210 -80
  205. package/web-components/input/input.js.map +1 -1
  206. package/web-components/input/label-input.d.ts +5 -4
  207. package/web-components/input/label-input.d.ts.map +1 -1
  208. package/web-components/input/label-input.js +7 -6
  209. package/web-components/input/label-input.js.map +1 -1
  210. package/web-components/input/search-input.d.ts +5 -4
  211. package/web-components/input/search-input.d.ts.map +1 -1
  212. package/web-components/input/search-input.js +7 -6
  213. package/web-components/input/search-input.js.map +1 -1
  214. package/web-components/input/select-input.d.ts +5 -4
  215. package/web-components/input/select-input.d.ts.map +1 -1
  216. package/web-components/input/select-input.js +7 -6
  217. package/web-components/input/select-input.js.map +1 -1
  218. package/web-components/input/split-input.d.ts +5 -4
  219. package/web-components/input/split-input.d.ts.map +1 -1
  220. package/web-components/input/split-input.js +7 -6
  221. package/web-components/input/split-input.js.map +1 -1
  222. package/web-components/input/switch-input.d.ts +5 -4
  223. package/web-components/input/switch-input.d.ts.map +1 -1
  224. package/web-components/input/switch-input.js +7 -6
  225. package/web-components/input/switch-input.js.map +1 -1
  226. package/web-components/layout/divider.d.ts +22 -0
  227. package/web-components/layout/divider.d.ts.map +1 -0
  228. package/web-components/layout/{divider-line.js → divider.js} +13 -12
  229. package/web-components/layout/divider.js.map +1 -0
  230. package/web-components/layout/flex-flow.d.ts +3 -2
  231. package/web-components/layout/flex-flow.d.ts.map +1 -1
  232. package/web-components/layout/flex-flow.js +4 -3
  233. package/web-components/layout/flex-flow.js.map +1 -1
  234. package/web-components/layout/nav-layout.d.ts +4 -3
  235. package/web-components/layout/nav-layout.d.ts.map +1 -1
  236. package/web-components/layout/nav-layout.js +4 -3
  237. package/web-components/layout/nav-layout.js.map +1 -1
  238. package/web-components/{open → offset}/open-offset.d.ts +5 -4
  239. package/web-components/offset/open-offset.d.ts.map +1 -0
  240. package/web-components/{open → offset}/open-offset.js +5 -5
  241. package/web-components/offset/open-offset.js.map +1 -0
  242. package/web-components/{loading/loading-progress.d.ts → progress/progress.d.ts} +9 -7
  243. package/web-components/progress/progress.d.ts.map +1 -0
  244. package/web-components/{loading/loading-progress.js → progress/progress.js} +15 -14
  245. package/web-components/progress/progress.js.map +1 -0
  246. package/web-components/router/router-a.d.ts +25 -0
  247. package/web-components/router/router-a.d.ts.map +1 -0
  248. package/web-components/router/router-a.js +70 -0
  249. package/web-components/router/router-a.js.map +1 -0
  250. package/web-components/{view/route-view.d.ts → router/router.d.ts} +10 -9
  251. package/web-components/router/router.d.ts.map +1 -0
  252. package/web-components/{view/route-view.js → router/router.js} +21 -21
  253. package/web-components/router/router.js.map +1 -0
  254. package/web-components/{loading/skeleton-screen.d.ts → skeleton/skeleton.d.ts} +8 -7
  255. package/web-components/skeleton/skeleton.d.ts.map +1 -0
  256. package/web-components/{loading/skeleton-screen.js → skeleton/skeleton.js} +15 -14
  257. package/web-components/skeleton/skeleton.js.map +1 -0
  258. package/web-components/{group/tab-group.d.ts → tabs/tabs.d.ts} +9 -8
  259. package/web-components/tabs/tabs.d.ts.map +1 -0
  260. package/web-components/{group/tab-group.js → tabs/tabs.js} +17 -16
  261. package/web-components/tabs/tabs.js.map +1 -0
  262. package/web-components/text/clip.d.ts +22 -0
  263. package/web-components/text/clip.d.ts.map +1 -0
  264. package/web-components/text/{clip-text.js → clip.js} +13 -12
  265. package/web-components/text/clip.js.map +1 -0
  266. package/web-components/text/{overbreath-text.d.ts → overbreath.d.ts} +8 -7
  267. package/web-components/text/overbreath.d.ts.map +1 -0
  268. package/web-components/text/{overbreath-text.js → overbreath.js} +15 -14
  269. package/web-components/text/overbreath.js.map +1 -0
  270. package/web-components/text/time.d.ts +60 -0
  271. package/web-components/text/time.d.ts.map +1 -0
  272. package/web-components/{items/time-bar.js → text/time.js} +53 -36
  273. package/web-components/text/time.js.map +1 -0
  274. package/web-components/text/{typewriter-text.d.ts → typewriter.d.ts} +10 -9
  275. package/web-components/text/typewriter.d.ts.map +1 -0
  276. package/web-components/text/{typewriter-text.js → typewriter.js} +23 -22
  277. package/web-components/text/typewriter.js.map +1 -0
  278. package/web-components/tooltip/tooltip.d.ts +26 -0
  279. package/web-components/tooltip/tooltip.d.ts.map +1 -0
  280. package/web-components/{open/open-tooltip.js → tooltip/tooltip.js} +15 -14
  281. package/web-components/tooltip/tooltip.js.map +1 -0
  282. package/web-components/{items/drag-box.d.ts → wrapper/dragbox.d.ts} +7 -6
  283. package/web-components/wrapper/dragbox.d.ts.map +1 -0
  284. package/web-components/{items/drag-box.js → wrapper/dragbox.js} +14 -13
  285. package/web-components/wrapper/dragbox.js.map +1 -0
  286. package/web-components/{view/wrap-view.d.ts → wrapper/wrapper.d.ts} +7 -5
  287. package/web-components/wrapper/wrapper.d.ts.map +1 -0
  288. package/web-components/{view/wrap-view.js → wrapper/wrapper.js} +13 -12
  289. package/web-components/wrapper/wrapper.js.map +1 -0
  290. package/wrapper.d.ts +2 -0
  291. package/wrapper.d.ts.map +1 -0
  292. package/wrapper.js +2 -0
  293. package/wrapper.js.map +1 -0
  294. package/alert-item.d.ts +0 -2
  295. package/alert-item.d.ts.map +0 -1
  296. package/alert-item.js +0 -2
  297. package/alert-item.js.map +0 -1
  298. package/avatar-a.d.ts +0 -2
  299. package/avatar-a.d.ts.map +0 -1
  300. package/avatar-a.js +0 -2
  301. package/avatar-a.js.map +0 -1
  302. package/base-button.d.ts +0 -2
  303. package/base-button.d.ts.map +0 -1
  304. package/base-button.js +0 -2
  305. package/base-button.js.map +0 -1
  306. package/base-form.d.ts +0 -2
  307. package/base-form.d.ts.map +0 -1
  308. package/base-form.js +0 -2
  309. package/base-form.js.map +0 -1
  310. package/base-input.d.ts +0 -2
  311. package/base-input.d.ts.map +0 -1
  312. package/base-input.js +0 -2
  313. package/base-input.js.map +0 -1
  314. package/card-item.d.ts +0 -2
  315. package/card-item.d.ts.map +0 -1
  316. package/card-item.js +0 -2
  317. package/card-item.js.map +0 -1
  318. package/carousel-slider.d.ts +0 -2
  319. package/carousel-slider.d.ts.map +0 -1
  320. package/carousel-slider.js +0 -2
  321. package/carousel-slider.js.map +0 -1
  322. package/clip-text.d.ts +0 -2
  323. package/clip-text.d.ts.map +0 -1
  324. package/clip-text.js +0 -2
  325. package/clip-text.js.map +0 -1
  326. package/deps.d.ts.map +0 -1
  327. package/deps.js.map +0 -1
  328. package/divider-line.d.ts +0 -2
  329. package/divider-line.d.ts.map +0 -1
  330. package/divider-line.js +0 -2
  331. package/divider-line.js.map +0 -1
  332. package/drag-box.d.ts +0 -2
  333. package/drag-box.d.ts.map +0 -1
  334. package/drag-box.js +0 -2
  335. package/drag-box.js.map +0 -1
  336. package/link-a.d.ts +0 -2
  337. package/link-a.d.ts.map +0 -1
  338. package/link-a.js +0 -2
  339. package/link-a.js.map +0 -1
  340. package/loading-progress.d.ts +0 -2
  341. package/loading-progress.d.ts.map +0 -1
  342. package/loading-progress.js +0 -2
  343. package/loading-progress.js.map +0 -1
  344. package/open-details.d.ts +0 -2
  345. package/open-details.d.ts.map +0 -1
  346. package/open-details.js +0 -2
  347. package/open-details.js.map +0 -1
  348. package/open-dialog.d.ts +0 -2
  349. package/open-dialog.d.ts.map +0 -1
  350. package/open-dialog.js +0 -2
  351. package/open-dialog.js.map +0 -1
  352. package/open-tooltip.d.ts +0 -2
  353. package/open-tooltip.d.ts.map +0 -1
  354. package/open-tooltip.js +0 -2
  355. package/open-tooltip.js.map +0 -1
  356. package/overbreath-text.d.ts +0 -2
  357. package/overbreath-text.d.ts.map +0 -1
  358. package/overbreath-text.js +0 -2
  359. package/overbreath-text.js.map +0 -1
  360. package/root.d.ts +0 -23
  361. package/root.d.ts.map +0 -1
  362. package/root.js.map +0 -1
  363. package/route-view.d.ts +0 -2
  364. package/route-view.d.ts.map +0 -1
  365. package/route-view.js +0 -2
  366. package/route-view.js.map +0 -1
  367. package/sign-form.d.ts +0 -2
  368. package/sign-form.d.ts.map +0 -1
  369. package/sign-form.js +0 -2
  370. package/sign-form.js.map +0 -1
  371. package/skeleton-screen.d.ts +0 -2
  372. package/skeleton-screen.d.ts.map +0 -1
  373. package/skeleton-screen.js +0 -2
  374. package/skeleton-screen.js.map +0 -1
  375. package/super-a.d.ts +0 -2
  376. package/super-a.d.ts.map +0 -1
  377. package/super-a.js +0 -2
  378. package/super-a.js.map +0 -1
  379. package/tab-group.d.ts +0 -2
  380. package/tab-group.d.ts.map +0 -1
  381. package/tab-group.js +0 -2
  382. package/tab-group.js.map +0 -1
  383. package/time-bar.d.ts +0 -2
  384. package/time-bar.d.ts.map +0 -1
  385. package/time-bar.js +0 -2
  386. package/time-bar.js.map +0 -1
  387. package/typewriter-text.d.ts +0 -2
  388. package/typewriter-text.d.ts.map +0 -1
  389. package/typewriter-text.js +0 -2
  390. package/typewriter-text.js.map +0 -1
  391. package/web-components/a/avatar-a.d.ts.map +0 -1
  392. package/web-components/a/avatar-a.js.map +0 -1
  393. package/web-components/a/link-a.d.ts +0 -33
  394. package/web-components/a/link-a.d.ts.map +0 -1
  395. package/web-components/a/link-a.js +0 -81
  396. package/web-components/a/link-a.js.map +0 -1
  397. package/web-components/a/super-a.d.ts +0 -31
  398. package/web-components/a/super-a.d.ts.map +0 -1
  399. package/web-components/a/super-a.js.map +0 -1
  400. package/web-components/button/base-button.d.ts.map +0 -1
  401. package/web-components/button/base-button.js.map +0 -1
  402. package/web-components/carousel/carousel-slider.d.ts.map +0 -1
  403. package/web-components/carousel/carousel-slider.js.map +0 -1
  404. package/web-components/form/base-form.d.ts.map +0 -1
  405. package/web-components/form/base-form.js.map +0 -1
  406. package/web-components/form/sign-form.d.ts +0 -19
  407. package/web-components/form/sign-form.d.ts.map +0 -1
  408. package/web-components/form/sign-form.js +0 -16
  409. package/web-components/form/sign-form.js.map +0 -1
  410. package/web-components/group/tab-group.d.ts.map +0 -1
  411. package/web-components/group/tab-group.js.map +0 -1
  412. package/web-components/input/base-input.d.ts +0 -49
  413. package/web-components/input/base-input.d.ts.map +0 -1
  414. package/web-components/input/base-input.js +0 -246
  415. package/web-components/input/base-input.js.map +0 -1
  416. package/web-components/items/alert-item.d.ts.map +0 -1
  417. package/web-components/items/alert-item.js.map +0 -1
  418. package/web-components/items/card-item.d.ts.map +0 -1
  419. package/web-components/items/card-item.js.map +0 -1
  420. package/web-components/items/drag-box.d.ts.map +0 -1
  421. package/web-components/items/drag-box.js.map +0 -1
  422. package/web-components/items/index.d.ts +0 -5
  423. package/web-components/items/index.d.ts.map +0 -1
  424. package/web-components/items/index.js +0 -6
  425. package/web-components/items/index.js.map +0 -1
  426. package/web-components/items/time-bar.d.ts +0 -54
  427. package/web-components/items/time-bar.d.ts.map +0 -1
  428. package/web-components/items/time-bar.js.map +0 -1
  429. package/web-components/layout/divider-line.d.ts +0 -20
  430. package/web-components/layout/divider-line.d.ts.map +0 -1
  431. package/web-components/layout/divider-line.js.map +0 -1
  432. package/web-components/loading/loading-progress.d.ts.map +0 -1
  433. package/web-components/loading/loading-progress.js.map +0 -1
  434. package/web-components/loading/skeleton-screen.d.ts.map +0 -1
  435. package/web-components/loading/skeleton-screen.js.map +0 -1
  436. package/web-components/open/open-details.d.ts.map +0 -1
  437. package/web-components/open/open-details.js.map +0 -1
  438. package/web-components/open/open-dialog.d.ts.map +0 -1
  439. package/web-components/open/open-dialog.js.map +0 -1
  440. package/web-components/open/open-offset.d.ts.map +0 -1
  441. package/web-components/open/open-offset.js.map +0 -1
  442. package/web-components/open/open-tooltip.d.ts +0 -24
  443. package/web-components/open/open-tooltip.d.ts.map +0 -1
  444. package/web-components/open/open-tooltip.js.map +0 -1
  445. package/web-components/open/open.d.ts.map +0 -1
  446. package/web-components/open/open.js.map +0 -1
  447. package/web-components/text/clip-text.d.ts +0 -21
  448. package/web-components/text/clip-text.d.ts.map +0 -1
  449. package/web-components/text/clip-text.js.map +0 -1
  450. package/web-components/text/overbreath-text.d.ts.map +0 -1
  451. package/web-components/text/overbreath-text.js.map +0 -1
  452. package/web-components/text/typewriter-text.d.ts.map +0 -1
  453. package/web-components/text/typewriter-text.js.map +0 -1
  454. package/web-components/view/route-view.d.ts.map +0 -1
  455. package/web-components/view/route-view.js.map +0 -1
  456. package/web-components/view/wrap-view.d.ts.map +0 -1
  457. package/web-components/view/wrap-view.js.map +0 -1
  458. package/wrap-view.d.ts +0 -2
  459. package/wrap-view.d.ts.map +0 -1
  460. package/wrap-view.js +0 -2
  461. package/wrap-view.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"search-input.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/search-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuB,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAqB,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,UAAU,GAAG,cAAc,CAAC;AAElC,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAEzC;;GAEG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,YAAY;IAAtC;;QACL;;WAEG;QACS,UAAK,GAAG,EAAE,CAAC;QACvB;;WAEG;QACS,WAAM,GAAG,EAAE,CAAC;QACxB;;WAEG;QAC0B,UAAK,GAAG,KAAK,CAAC;QAC3C;;WAEG;QACyC,UAAK,GAAG,KAAK,CAAC;QAC1D;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AAY,CAAC,KAAK;;;;;;;;;;;;0BAYf,YAAY,CAAC,KAAK;;;;;;;;;;;;uBAYrB,YAAY,CAAC,KAAK;;;;;;;;;;;;;;;;;;;;;;;KAuBpC;CACgB,AAtFN,CAsFO;AAlHR;IAAX,QAAQ,EAAE;0CAAY;AAIX;IAAX,QAAQ,EAAE;2CAAa;AAIK;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CAAe;AAIC;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CAAe;AAI9C;IAAX,QAAQ,EAAE;2CAAa;AAIZ;IAAX,QAAQ,EAAE;2CAAgC;AAI/B;IAAX,QAAQ,EAAE;yCAAY;AAEP;IAAf,KAAK,CAAC,OAAO,CAAC;2CAA2B;AA9B/B,WAAW;IADvB,MAAM,CAAC,UAAU,CAAC;GACN,WAAW,CA2KvB;;AAED,eAAe,WAAW,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, property, query } from \"../../deps.js\";\nimport { htmlSlot, type HTMLTemplate, svgSearch } from \"../../lib/templates.js\";\nimport { createScope, cssvarValues, define } from \"../../root.js\";\nimport { InputElement } from \"./input.js\";\n\nconst defineName = \"search-input\";\n\nconst cssScope = createScope(defineName);\n\n/**\n * SearchInput used for search behavior.\n */\n@define(defineName)\nexport class SearchInput extends InputElement {\n /**\n * Query selectors.\n */\n @property() query = \"\";\n /**\n * Target selectors.\n */\n @property() target = \"\";\n /**\n * Enable infer.\n */\n @property({ type: Boolean }) infer = false;\n /**\n * Float result.\n */\n @property({ type: Boolean, reflect: true }) float = false;\n /**\n * Form action.\n */\n @property() action = \"\";\n /**\n * Form method.\n */\n @property() method: \"get\" | \"post\" = \"get\";\n /**\n * Form name.\n */\n @property() name = \"q\";\n\n @query(\"input\") _input!: HTMLInputElement;\n\n static styles = [\n InputElement.styles,\n css`\n :host {\n ${cssScope}--width:var(${cssvarValues.input}--width);\n ${cssScope}--input-padding: 0 0 0 .35em;\n width: var(${cssvarValues.input}--width);\n margin: var(${cssvarValues.input}-outline-width);\n border-radius: var(${cssvarValues.input}--radius);\n background: var(${cssvarValues.input}--background);\n }\n\n div {\n padding: var(${cssScope}--input-padding);\n height: var(${cssvarValues.input}--height);\n flex: 1;\n display: flex;\n z-index: 2;\n }\n\n form {\n min-height: 100%;\n outline: 0.145em solid transparent;\n display: flex;\n flex-direction: column;\n border-radius: inherit;\n padding: 0;\n width: 100%;\n margin: 0;\n position: relative;\n overflow: hidden;\n }\n\n :host([float]) form {\n overflow: visible;\n }\n\n :host(:focus) form {\n outline: var(${cssvarValues.input}--outline);\n }\n\n ul {\n list-style: none;\n width: 100%;\n pointer-events: none;\n border-radius: inherit;\n z-index: 2;\n }\n\n :host([float]) ul {\n background: var(${cssvarValues.input}--background);\n padding-top: 1.5em;\n position: absolute;\n z-index: 1;\n top: 0;\n }\n\n :host([float]:focus) form {\n outline: none;\n }\n\n :host([float]:focus) ul {\n outline: var(${cssvarValues.input}--outline);\n }\n\n button,\n input {\n background: none;\n }\n\n button {\n width: 1.8em;\n height: inherit;\n }\n\n input {\n flex: 1;\n min-width: 0;\n box-sizing: border-box;\n }\n\n svg {\n height: 100%;\n padding: 1px;\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n return html`<form action=\"${this.action}\" method=\"${this.method}\">\n <div>\n <input .value=\"${this.value}\" ?autofocus=\"${this.autofocus}\" name=\"${this.name}\" @focus=\"${this._handleInput}\" @input=\"${this._handleInput}\" title=\"\" placeholder=\"${this.pla}\" />\n <button @click=\"${this._handleSubmit}\">${htmlSlot(\"search\", svgSearch(), this)}</button>\n </div>\n <ul>\n ${htmlSlot()}\n </ul>\n </form>`;\n }\n\n protected _handleSubmit(e: Event) {\n if (!this.action) {\n e.preventDefault();\n }\n this.dispatchEvent(new CustomEvent(\"submit\", { detail: this.value }));\n }\n\n protected _handleInput(e: Event) {\n e.stopPropagation();\n const value: string = this.targetValue(e);\n if (value === this.value) {\n return;\n }\n this.value = value;\n if (this.compositing) {\n return;\n }\n if (this.target && this.query) {\n this.searchElements(this.value);\n }\n this.dispatchEvent(new CustomEvent(\"input\", { detail: this.value, bubbles: true, composed: true }));\n this.dispatchEvent(new CustomEvent(\"change\", { detail: this.value, composed: true }));\n }\n\n searchElements(s: string) {\n const targetElement = document.body.querySelector(this.target);\n const queryElementsCollection = document.body.querySelectorAll(this.query);\n if (!targetElement) {\n return;\n }\n targetElement.replaceChildren();\n if (s && queryElementsCollection.length) {\n for (const e of queryElementsCollection) {\n if (e.textContent.includes(this.value)) {\n targetElement.appendChild(e.cloneNode(true));\n }\n }\n }\n }\n}\n\nexport default SearchInput;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"search-input\": SearchInput;\n }\n}\n"]}
1
+ {"version":3,"file":"search-input.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/search-input.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,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEjE,MAAM,UAAU,GAAG,cAAc,CAAC;AAElC,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAEzC;;GAEG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,WAAW;IAArC;;QACL;;WAEG;QACS,UAAK,GAAG,EAAE,CAAC;QACvB;;WAEG;QACS,WAAM,GAAG,EAAE,CAAC;QACxB;;WAEG;QAC0B,UAAK,GAAG,KAAK,CAAC;QAC3C;;WAEG;QACyC,U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;;;;;;;;;;;;;;;;uBAwBjB,YAAY,CAAC,KAAK;;;;;;;;;;;;0BAYf,YAAY,CAAC,KAAK;;;;;;;;;;;;uBAYrB,YAAY,CAAC,KAAK;;;;;;;;;;;;;;;;;;;;;;;KAuBpC;CACgB,AAtFN,CAsFO;AAlHR;IAAX,QAAQ,EAAE;0CAAY;AAIX;IAAX,QAAQ,EAAE;2CAAa;AAIK;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CAAe;AAIC;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CAAe;AAI9C;IAAX,QAAQ,EAAE;2CAAa;AAIZ;IAAX,QAAQ,EAAE;2CAAgC;AAI/B;IAAX,QAAQ,EAAE;yCAAY;AAEP;IAAf,KAAK,CAAC,OAAO,CAAC;2CAA2B;AA9B/B,WAAW;IADvB,MAAM,CAAC,UAAU,CAAC;GACN,WAAW,CA2KvB;;AAED,eAAe,WAAW,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, property, query } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { htmlSlot, type HTMLTemplate, svgSearch } from \"../../lib/templates.js\";\nimport { GodownInput } from \"../../supers/input.js\";\nimport { createScope, cssvarValues } from \"../../supers/root.js\";\n\nconst defineName = \"search-input\";\n\nconst cssScope = createScope(defineName);\n\n/**\n * {@linkcode SearchInput} used for search behavior.\n */\n@define(defineName)\nexport class SearchInput extends GodownInput {\n /**\n * Query selectors.\n */\n @property() query = \"\";\n /**\n * Target selectors.\n */\n @property() target = \"\";\n /**\n * Enable infer.\n */\n @property({ type: Boolean }) infer = false;\n /**\n * Float result.\n */\n @property({ type: Boolean, reflect: true }) float = false;\n /**\n * Form action.\n */\n @property() action = \"\";\n /**\n * Form method.\n */\n @property() method: \"get\" | \"post\" = \"get\";\n /**\n * Form name.\n */\n @property() name = \"q\";\n\n @query(\"input\") _input!: HTMLInputElement;\n\n static styles = [\n GodownInput.styles,\n css`\n :host {\n ${cssScope}--width:var(${cssvarValues.input}--width);\n ${cssScope}--input-padding: 0 0 0 .35em;\n width: var(${cssvarValues.input}--width);\n margin: var(${cssvarValues.input}-outline-width);\n border-radius: var(${cssvarValues.input}--radius);\n background: var(${cssvarValues.input}--background);\n }\n\n div {\n padding: var(${cssScope}--input-padding);\n height: var(${cssvarValues.input}--height);\n flex: 1;\n display: flex;\n z-index: 2;\n }\n\n form {\n min-height: 100%;\n outline: 0.145em solid transparent;\n display: flex;\n flex-direction: column;\n border-radius: inherit;\n padding: 0;\n width: 100%;\n margin: 0;\n position: relative;\n overflow: hidden;\n }\n\n :host([float]) form {\n overflow: visible;\n }\n\n :host(:focus) form {\n outline: var(${cssvarValues.input}--outline);\n }\n\n ul {\n list-style: none;\n width: 100%;\n pointer-events: none;\n border-radius: inherit;\n z-index: 2;\n }\n\n :host([float]) ul {\n background: var(${cssvarValues.input}--background);\n padding-top: 1.5em;\n position: absolute;\n z-index: 1;\n top: 0;\n }\n\n :host([float]:focus) form {\n outline: none;\n }\n\n :host([float]:focus) ul {\n outline: var(${cssvarValues.input}--outline);\n }\n\n button,\n input {\n background: none;\n }\n\n button {\n width: 1.8em;\n height: inherit;\n }\n\n input {\n flex: 1;\n min-width: 0;\n box-sizing: border-box;\n }\n\n svg {\n height: 100%;\n padding: 1px;\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n return html`<form action=\"${this.action}\" method=\"${this.method}\">\n <div>\n <input .value=\"${this.value}\" ?autofocus=\"${this.autofocus}\" name=\"${this.name}\" @focus=\"${this._handleInput}\" @input=\"${this._handleInput}\" title=\"\" placeholder=\"${this.pla}\" />\n <button @click=\"${this._handleSubmit}\">${htmlSlot(\"search\", svgSearch(), this)}</button>\n </div>\n <ul>\n ${htmlSlot()}\n </ul>\n </form>`;\n }\n\n protected _handleSubmit(e: Event) {\n if (!this.action) {\n e.preventDefault();\n }\n this.dispatchEvent(new CustomEvent(\"submit\", { detail: this.value }));\n }\n\n protected _handleInput(e: Event) {\n e.stopPropagation();\n const value: string = this.targetValue(e);\n if (value === this.value) {\n return;\n }\n this.value = value;\n if (this.compositing) {\n return;\n }\n if (this.target && this.query) {\n this.searchElements(this.value);\n }\n this.dispatchEvent(new CustomEvent(\"input\", { detail: this.value, bubbles: true, composed: true }));\n this.dispatchEvent(new CustomEvent(\"change\", { detail: this.value, composed: true }));\n }\n\n searchElements(s: string) {\n const targetElement = document.body.querySelector(this.target);\n const queryElementsCollection = document.body.querySelectorAll(this.query);\n if (!targetElement) {\n return;\n }\n targetElement.replaceChildren();\n if (s && queryElementsCollection.length) {\n for (const e of queryElementsCollection) {\n if (e.textContent.includes(this.value)) {\n targetElement.appendChild(e.cloneNode(true));\n }\n }\n }\n }\n}\n\nexport default SearchInput;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"search-input\": SearchInput;\n \"g-search-input\": SearchInput;\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 { InputElement } from "./input.js";
3
+ import { GodownInput } from "../../supers/input.js";
4
4
  /**
5
- * SelectInput select matched elements.
5
+ * {@linkcode SelectInput} select matched elements.
6
6
  */
7
- export declare class SelectInput extends InputElement {
7
+ export declare class SelectInput extends GodownInput {
8
8
  /**
9
9
  * Open content.
10
10
  */
@@ -45,6 +45,7 @@ export default SelectInput;
45
45
  declare global {
46
46
  interface HTMLElementTagNameMap {
47
47
  "select-input": SelectInput;
48
+ "g-select-input": SelectInput;
48
49
  }
49
50
  }
50
51
  //# sourceMappingURL=select-input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"select-input.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/select-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAyB,MAAM,eAAe,CAAC;AAEhF,OAAO,EAAY,KAAK,YAAY,EAAkB,MAAM,wBAAwB,CAAC;AAErF,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI1C;;GAEG;AACH,qBACa,WAAY,SAAQ,YAAY;IAC3C;;OAEG;IACyC,IAAI,UAAS;IACzD;;OAEG;IACyC,IAAI,UAAS;IACzD;;OAEG;IACwB,KAAK,QAAM;IACtC;;OAEG;IACS,IAAI,SAAY;IAC5B;;OAEG;IACwB,IAAI,EAAE,MAAM,EAAE,CAAM;IAE/C,MAAM,CAAC,MAAM,iBAuFO;IAEpB,IAAI,QAAQ,QAEX;IAEe,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,gBAAgB,CAAC;IAEzC,SAAS,CAAC,MAAM,IAAI,YAAY;IAiBhC,OAAO,CAAC,UAAU;IAqBlB,SAAS,CAAC,WAAW;IAOrB,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY;IAK5B,iBAAiB;IAIjB,cAAc,CAAC,MAAM,EAAE,OAAO;IAI9B,SAAS,CAAC,YAAY;IAgCtB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;IA4CnC,SAAS,CAAC,YAAY;IAuCtB,SAAS,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC;IAI5C,KAAK;CAcN;AAED,eAAe,WAAW,CAAC;AAM3B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
1
+ {"version":3,"file":"select-input.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/select-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAyB,MAAM,gBAAgB,CAAC;AAGjF,OAAO,EAAY,KAAK,YAAY,EAAkB,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKpD;;GAEG;AACH,qBACa,WAAY,SAAQ,WAAW;IAC1C;;OAEG;IACyC,IAAI,UAAS;IACzD;;OAEG;IACyC,IAAI,UAAS;IACzD;;OAEG;IACwB,KAAK,QAAM;IACtC;;OAEG;IACS,IAAI,SAAY;IAC5B;;OAEG;IACwB,IAAI,EAAE,MAAM,EAAE,CAAM;IAE/C,MAAM,CAAC,MAAM,iBAuFO;IAEpB,IAAI,QAAQ,QAEX;IAEe,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,gBAAgB,CAAC;IAEzC,SAAS,CAAC,MAAM,IAAI,YAAY;IAiBhC,OAAO,CAAC,UAAU;IAqBlB,SAAS,CAAC,WAAW;IAOrB,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY;IAK5B,iBAAiB;IAIjB,cAAc,CAAC,MAAM,EAAE,OAAO;IAI9B,SAAS,CAAC,YAAY;IAgCtB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;IA4CnC,SAAS,CAAC,YAAY;IAuCtB,SAAS,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC;IAI5C,KAAK;CAcN;AAED,eAAe,WAAW,CAAC;AAM3B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;QAC5B,gBAAgB,EAAE,WAAW,CAAC;KAC/B;CACF"}
@@ -1,14 +1,15 @@
1
1
  import { __decorate } from "tslib";
2
- import { css, html, property, query } from "../../deps.js";
2
+ import { css, html, property, query } from "../../.deps.js";
3
+ import { define } from "../../decorators/define.js";
3
4
  import { ifValue } from "../../lib/directives.js";
4
5
  import { htmlSlot, svgDelta, svgX } from "../../lib/templates.js";
5
- import { cssvarValues, define, GodownElement } from "../../root.js";
6
- import { InputElement } from "./input.js";
6
+ import { GodownInput } from "../../supers/input.js";
7
+ import { cssvarValues, GodownElement } from "../../supers/root.js";
7
8
  const defineName = "select-input";
8
9
  /**
9
- * SelectInput select matched elements.
10
+ * {@linkcode SelectInput} select matched elements.
10
11
  */
11
- let SelectInput = class SelectInput extends InputElement {
12
+ let SelectInput = class SelectInput extends GodownInput {
12
13
  constructor() {
13
14
  super(...arguments);
14
15
  /**
@@ -222,7 +223,7 @@ let SelectInput = class SelectInput extends InputElement {
222
223
  }
223
224
  };
224
225
  SelectInput.styles = [
225
- InputElement.styles,
226
+ GodownInput.styles,
226
227
  css `
227
228
  :host {
228
229
  background: var(${cssvarValues.input}--background);
@@ -1 +1 @@
1
- {"version":3,"file":"select-input.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/select-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuB,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAqB,QAAQ,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,UAAU,GAAG,cAAc,CAAC;AAElC;;GAEG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,YAAY;IAAtC;;QACL;;WAEG;QACyC,SAAI,GAAG,KAAK,CAAC;QACzD;;WAEG;QACyC,SAAI,GAAG,KAAK,CAAC;QACzD;;WAEG;QACwB,UAAK,GAAG,EAAE,CAAC;QACtC;;WAEG;QACS,SAAI,GAAG,QAAQ,CAAC;QAC5B;;WAEG;QACwB,SAAI,GAAa,EAAE,CAAC;IAiSjD,CAAC;IAtMC,IAAI,QAAQ;QACV,OAAO,KAAK,CAAC,QAAe,CAAC;IAC/B,C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AC,OAAO,CAAC;2CAA0B;AACzB;IAAf,KAAK,CAAC,OAAO,CAAC;2CAA0B;AApH9B,WAAW;IADvB,MAAM,CAAC,UAAU,CAAC;GACN,WAAW,CAqTvB;;AAED,eAAe,WAAW,CAAC;AAE3B,SAAS,kBAAkB,CAAC,CAAS,EAAE,CAAS;IAC9C,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, property, query } from \"../../deps.js\";\nimport { ifValue } from \"../../lib/directives.js\";\nimport { htmlSlot, type HTMLTemplate, svgDelta, svgX } from \"../../lib/templates.js\";\nimport { cssvarValues, define, GodownElement } from \"../../root.js\";\nimport { InputElement } from \"./input.js\";\n\nconst defineName = \"select-input\";\n\n/**\n * SelectInput select matched elements.\n */\n@define(defineName)\nexport class SelectInput extends InputElement {\n /**\n * Open content.\n */\n @property({ type: Boolean, reflect: true }) open = false;\n /**\n * Only a single option is allowed.\n */\n @property({ type: Boolean, reflect: true }) only = false;\n /**\n * Selected values.\n */\n @property({ type: Array }) value = [];\n /**\n * Input name.\n */\n @property() name = \"select\";\n /**\n * Selected texts.\n */\n @property({ type: Array }) text: string[] = [];\n\n static styles = [\n InputElement.styles,\n css`\n :host {\n background: var(${cssvarValues.input}--background);\n margin: var(${cssvarValues.input}--outline-width);\n outline: var(${cssvarValues.input}--outline-width) solid transparent;\n height: var(${cssvarValues.input}--height);\n width: var(${cssvarValues.input}--width);\n border-radius: var(${cssvarValues.input}--radius);\n }\n\n :host([open]) {\n outline-color: var(${cssvarValues.input}--outline-color);\n }\n\n input {\n padding: 0 0 0 0.25em;\n background: none;\n cursor: inherit;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n border: inherit;\n outline: none;\n border-radius: inherit;\n flex: 1;\n }\n\n div {\n display: inline-flex;\n position: relative;\n width: 100%;\n border-radius: inherit;\n z-index: inherit;\n }\n\n label svg {\n height: 100%;\n }\n\n aside {\n margin-top: 1px;\n position: absolute;\n top: 100%;\n width: 100%;\n visibility: hidden;\n z-index: 1;\n border-radius: inherit;\n }\n\n section {\n max-width: calc(100% - 1.2em);\n height: 100%;\n overflow: hidden;\n pointer-events: none;\n border-radius: inherit;\n z-index: inherit;\n }\n\n i.selected-item {\n background: var(${cssvarValues.input}--true);\n border-radius: inherit;\n height: 100%;\n float: left;\n display: inline-flex;\n font-style: normal;\n align-items: center;\n padding-left: 0.1em;\n margin-left: 0.065em;\n }\n\n i:first-child {\n margin-left: 0;\n }\n\n i.selected-item svg {\n width: 1em;\n padding: 0 0.12em;\n height: 0.8em;\n pointer-events: all;\n }\n\n aside[open] {\n visibility: visible;\n }\n `,\n ] as CSSResultGroup;\n\n get assigned() {\n return super.assigned as any;\n }\n\n @query(\"input\") _input: HTMLInputElement;\n @query(\"aside\") _aside: HTMLInputElement;\n\n protected render(): HTMLTemplate {\n return html` <div>\n <section>${this.renderList()}</section>\n <input\n ?autofocus=\"${this.autofocus}\"\n id=\"input\"\n @focus=\"${() => {\n this.open = true;\n }}\"\n @input=\"${this._handleInput}\"\n placeholder=\"${this.pla}\"\n />\n <label for=\"input\"> ${ifValue(this.children.length > 0, svgDelta())}</label>\n <aside ?open=\"${this.open}\">${htmlSlot()}</aside>\n </div>`;\n }\n\n private renderList(): HTMLTemplate[] {\n const itemTemplates = [];\n if (this.value.length) {\n for (const i in this.value) {\n itemTemplates.push(\n html`<i class=\"selected-item\">\n ${this.text[i] || this.value[i]}\n <div\n @click=\"${() => {\n this.select(this.value[i]);\n }}\"\n >\n ${svgX()}\n </div>\n </i>`,\n );\n }\n }\n return itemTemplates;\n }\n\n protected _focusCheck() {\n if (this.autofocus) {\n this._input?.focus();\n this.open = true;\n }\n }\n\n focus(options?: FocusOptions) {\n this._input?.focus(options);\n this.open = true;\n }\n\n connectedCallback() {\n GodownElement.prototype.connectedCallback.call(this);\n }\n\n getOptionValue(option: Element) {\n return (option as HTMLOptionElement).value || option.getAttribute(\"value\");\n }\n\n protected firstUpdated() {\n const defs = this.def.split(\";\");\n defs\n .filter((i) => i.trim())\n .forEach((i) => {\n this.select(i);\n });\n this._focusCheck();\n const CLICK = \"click\";\n (this.assigned as HTMLElement[]).forEach((option: HTMLElement) => {\n if (this.getOptionValue(option)) {\n this.addEvent(option, CLICK, () => {\n this.select(this.getOptionValue(option), option.textContent);\n });\n } else if (option.children) {\n [...option.children].forEach((option: HTMLElement) => {\n this.addEvent(option, CLICK, () => {\n this.select(this.getOptionValue(option), option.textContent);\n });\n });\n }\n });\n this.addEvent(this, \"change\", () => {\n this.open = !this.only;\n });\n this.addEvent(document, CLICK, (e) => {\n if (!this.contains(e.target as Node)) {\n this.open = false;\n }\n });\n }\n\n select(value: string, text?: string) {\n if (text === undefined || text === null) {\n this.assigned.some((option: HTMLElement) => {\n const optionValue = this.getOptionValue(option);\n if (optionValue) {\n if (optionValue === value) {\n text = option.textContent;\n return true;\n }\n } else if (option.children) {\n return [...option.children].some((subOption) => {\n const subOptionValue = this.getOptionValue(subOption);\n if (subOptionValue === value) {\n text = subOption.textContent;\n return true;\n }\n return false;\n });\n }\n return false;\n });\n }\n if (this.value.includes(value)) {\n if (!this.only) {\n this.value = this.value.filter((v) => v !== value);\n this.text = this.text.filter((v) => v !== text);\n } else {\n this.value = [];\n this.text = [];\n }\n } else {\n if (!this.only) {\n this.value.push(value);\n this.text.push(text);\n } else {\n this.value = [value];\n this.text = [text];\n }\n }\n this._input.value = \"\";\n this.dispatchEvent(new CustomEvent(\"change\", { detail: this.namevalue() }));\n this.requestUpdate();\n }\n\n protected _handleInput() {\n const BLOCK = \"block\";\n const NONE = \"none\";\n let value = this._input.value.trim();\n if (!this.only && value.includes(\";\")) {\n value = value.split(\";\").pop().trim();\n }\n this.assigned.forEach((option) => {\n if (this.getOptionValue(option)) {\n option.style.display = BLOCK;\n }\n if (option.children) {\n option.style.display = BLOCK;\n [...option.children].forEach((subOption) => {\n subOption.style.display = BLOCK;\n });\n }\n });\n if (value) {\n this.assigned.forEach((option) => {\n const optionValue = this.getOptionValue(option);\n if (optionValue) {\n const isMatch = includesIgnoreCase(optionValue, value) || includesIgnoreCase(option.innerText, value);\n option.style.display = isMatch ? BLOCK : NONE;\n } else if (option.children) {\n [...option.children].forEach((subOption) => {\n const subOptionValue = this.getOptionValue(subOption);\n const isSubMatch = includesIgnoreCase(subOptionValue, value) || includesIgnoreCase(subOption.innerText, value);\n subOption.style.display = isSubMatch ? BLOCK : NONE;\n });\n if ([...option.children].filter((option) => option.style.display === BLOCK).length === 0) {\n option.style.display = NONE;\n }\n }\n });\n }\n this.dispatchEvent(new CustomEvent(\"input\", { detail: this.namevalue() }));\n }\n\n namevalue(): [string, any[]] | [string, any] {\n return [this.name, this.only ? this.value[0] : this.value];\n }\n\n reset() {\n this.value = [];\n this.text = [];\n this._input.value = \"\";\n if (this.def) {\n const defs = this.def.split(\";\");\n const defToSelect = this.only ? [defs[0]] : defs;\n defToSelect\n .filter((def) => def.trim())\n .forEach((def) => {\n this.select(def.trim(), null);\n });\n }\n }\n}\n\nexport default SelectInput;\n\nfunction includesIgnoreCase(a: string, b: string): boolean {\n return a.toLowerCase().includes(b.toLowerCase());\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"select-input\": SelectInput;\n }\n}\n"]}
1
+ {"version":3,"file":"select-input.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/select-input.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,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAqB,QAAQ,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD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Y,CAAC,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;KAyBvC;CACgB,AAvFN,CAuFO;AAzGwB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAAc;AAIb;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAAc;AAI9B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;0CAAY;AAI1B;IAAX,QAAQ,EAAE;yCAAiB;AAID;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;yCAAqB;AA+F/B;IAAf,KAAK,CAAC,OAAO,CAAC;2CAA0B;AACzB;IAAf,KAAK,CAAC,OAAO,CAAC;2CAA0B;AApH9B,WAAW;IADvB,MAAM,CAAC,UAAU,CAAC;GACN,WAAW,CAqTvB;;AAED,eAAe,WAAW,CAAC;AAE3B,SAAS,kBAAkB,CAAC,CAAS,EAAE,CAAS;IAC9C,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, property, query } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { ifValue } from \"../../lib/directives.js\";\nimport { htmlSlot, type HTMLTemplate, svgDelta, svgX } from \"../../lib/templates.js\";\nimport { GodownInput } from \"../../supers/input.js\";\nimport { cssvarValues, GodownElement } from \"../../supers/root.js\";\n\nconst defineName = \"select-input\";\n\n/**\n * {@linkcode SelectInput} select matched elements.\n */\n@define(defineName)\nexport class SelectInput extends GodownInput {\n /**\n * Open content.\n */\n @property({ type: Boolean, reflect: true }) open = false;\n /**\n * Only a single option is allowed.\n */\n @property({ type: Boolean, reflect: true }) only = false;\n /**\n * Selected values.\n */\n @property({ type: Array }) value = [];\n /**\n * Input name.\n */\n @property() name = \"select\";\n /**\n * Selected texts.\n */\n @property({ type: Array }) text: string[] = [];\n\n static styles = [\n GodownInput.styles,\n css`\n :host {\n background: var(${cssvarValues.input}--background);\n margin: var(${cssvarValues.input}--outline-width);\n outline: var(${cssvarValues.input}--outline-width) solid transparent;\n height: var(${cssvarValues.input}--height);\n width: var(${cssvarValues.input}--width);\n border-radius: var(${cssvarValues.input}--radius);\n }\n\n :host([open]) {\n outline-color: var(${cssvarValues.input}--outline-color);\n }\n\n input {\n padding: 0 0 0 0.25em;\n background: none;\n cursor: inherit;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n border: inherit;\n outline: none;\n border-radius: inherit;\n flex: 1;\n }\n\n div {\n display: inline-flex;\n position: relative;\n width: 100%;\n border-radius: inherit;\n z-index: inherit;\n }\n\n label svg {\n height: 100%;\n }\n\n aside {\n margin-top: 1px;\n position: absolute;\n top: 100%;\n width: 100%;\n visibility: hidden;\n z-index: 1;\n border-radius: inherit;\n }\n\n section {\n max-width: calc(100% - 1.2em);\n height: 100%;\n overflow: hidden;\n pointer-events: none;\n border-radius: inherit;\n z-index: inherit;\n }\n\n i.selected-item {\n background: var(${cssvarValues.input}--true);\n border-radius: inherit;\n height: 100%;\n float: left;\n display: inline-flex;\n font-style: normal;\n align-items: center;\n padding-left: 0.1em;\n margin-left: 0.065em;\n }\n\n i:first-child {\n margin-left: 0;\n }\n\n i.selected-item svg {\n width: 1em;\n padding: 0 0.12em;\n height: 0.8em;\n pointer-events: all;\n }\n\n aside[open] {\n visibility: visible;\n }\n `,\n ] as CSSResultGroup;\n\n get assigned() {\n return super.assigned as any;\n }\n\n @query(\"input\") _input: HTMLInputElement;\n @query(\"aside\") _aside: HTMLInputElement;\n\n protected render(): HTMLTemplate {\n return html` <div>\n <section>${this.renderList()}</section>\n <input\n ?autofocus=\"${this.autofocus}\"\n id=\"input\"\n @focus=\"${() => {\n this.open = true;\n }}\"\n @input=\"${this._handleInput}\"\n placeholder=\"${this.pla}\"\n />\n <label for=\"input\"> ${ifValue(this.children.length > 0, svgDelta())}</label>\n <aside ?open=\"${this.open}\">${htmlSlot()}</aside>\n </div>`;\n }\n\n private renderList(): HTMLTemplate[] {\n const itemTemplates = [];\n if (this.value.length) {\n for (const i in this.value) {\n itemTemplates.push(\n html`<i class=\"selected-item\">\n ${this.text[i] || this.value[i]}\n <div\n @click=\"${() => {\n this.select(this.value[i]);\n }}\"\n >\n ${svgX()}\n </div>\n </i>`,\n );\n }\n }\n return itemTemplates;\n }\n\n protected _focusCheck() {\n if (this.autofocus) {\n this._input?.focus();\n this.open = true;\n }\n }\n\n focus(options?: FocusOptions) {\n this._input?.focus(options);\n this.open = true;\n }\n\n connectedCallback() {\n GodownElement.prototype.connectedCallback.call(this);\n }\n\n getOptionValue(option: Element) {\n return (option as HTMLOptionElement).value || option.getAttribute(\"value\");\n }\n\n protected firstUpdated() {\n const defs = this.def.split(\";\");\n defs\n .filter((i) => i.trim())\n .forEach((i) => {\n this.select(i);\n });\n this._focusCheck();\n const CLICK = \"click\";\n (this.assigned as HTMLElement[]).forEach((option: HTMLElement) => {\n if (this.getOptionValue(option)) {\n this.addEvent(option, CLICK, () => {\n this.select(this.getOptionValue(option), option.textContent);\n });\n } else if (option.children) {\n [...option.children].forEach((option: HTMLElement) => {\n this.addEvent(option, CLICK, () => {\n this.select(this.getOptionValue(option), option.textContent);\n });\n });\n }\n });\n this.addEvent(this, \"change\", () => {\n this.open = !this.only;\n });\n this.addEvent(document, CLICK, (e) => {\n if (!this.contains(e.target as Node)) {\n this.open = false;\n }\n });\n }\n\n select(value: string, text?: string) {\n if (text === undefined || text === null) {\n this.assigned.some((option: HTMLElement) => {\n const optionValue = this.getOptionValue(option);\n if (optionValue) {\n if (optionValue === value) {\n text = option.textContent;\n return true;\n }\n } else if (option.children) {\n return [...option.children].some((subOption) => {\n const subOptionValue = this.getOptionValue(subOption);\n if (subOptionValue === value) {\n text = subOption.textContent;\n return true;\n }\n return false;\n });\n }\n return false;\n });\n }\n if (this.value.includes(value)) {\n if (!this.only) {\n this.value = this.value.filter((v) => v !== value);\n this.text = this.text.filter((v) => v !== text);\n } else {\n this.value = [];\n this.text = [];\n }\n } else {\n if (!this.only) {\n this.value.push(value);\n this.text.push(text);\n } else {\n this.value = [value];\n this.text = [text];\n }\n }\n this._input.value = \"\";\n this.dispatchEvent(new CustomEvent(\"change\", { detail: this.namevalue() }));\n this.requestUpdate();\n }\n\n protected _handleInput() {\n const BLOCK = \"block\";\n const NONE = \"none\";\n let value = this._input.value.trim();\n if (!this.only && value.includes(\";\")) {\n value = value.split(\";\").pop().trim();\n }\n this.assigned.forEach((option) => {\n if (this.getOptionValue(option)) {\n option.style.display = BLOCK;\n }\n if (option.children) {\n option.style.display = BLOCK;\n [...option.children].forEach((subOption) => {\n subOption.style.display = BLOCK;\n });\n }\n });\n if (value) {\n this.assigned.forEach((option) => {\n const optionValue = this.getOptionValue(option);\n if (optionValue) {\n const isMatch = includesIgnoreCase(optionValue, value) || includesIgnoreCase(option.innerText, value);\n option.style.display = isMatch ? BLOCK : NONE;\n } else if (option.children) {\n [...option.children].forEach((subOption) => {\n const subOptionValue = this.getOptionValue(subOption);\n const isSubMatch = includesIgnoreCase(subOptionValue, value) || includesIgnoreCase(subOption.innerText, value);\n subOption.style.display = isSubMatch ? BLOCK : NONE;\n });\n if ([...option.children].filter((option) => option.style.display === BLOCK).length === 0) {\n option.style.display = NONE;\n }\n }\n });\n }\n this.dispatchEvent(new CustomEvent(\"input\", { detail: this.namevalue() }));\n }\n\n namevalue(): [string, any[]] | [string, any] {\n return [this.name, this.only ? this.value[0] : this.value];\n }\n\n reset() {\n this.value = [];\n this.text = [];\n this._input.value = \"\";\n if (this.def) {\n const defs = this.def.split(\";\");\n const defToSelect = this.only ? [defs[0]] : defs;\n defToSelect\n .filter((def) => def.trim())\n .forEach((def) => {\n this.select(def.trim(), null);\n });\n }\n }\n}\n\nexport default SelectInput;\n\nfunction includesIgnoreCase(a: string, b: string): boolean {\n return a.toLowerCase().includes(b.toLowerCase());\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"select-input\": SelectInput;\n \"g-select-input\": SelectInput;\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 { InputElement } from "./input.js";
3
+ import { GodownInput } from "../../supers/input.js";
4
4
  /**
5
- * SplitInput renders multiple inputs.
5
+ * {@linkcode SplitInput } renders multiple inputs.
6
6
  */
7
- export declare class SplitInput extends InputElement {
7
+ export declare class SplitInput extends GodownInput {
8
8
  /**
9
9
  * The number of simulated input boxes.
10
10
  */
@@ -30,6 +30,7 @@ export default SplitInput;
30
30
  declare global {
31
31
  interface HTMLElementTagNameMap {
32
32
  "split-input": SplitInput;
33
+ "g-split-input": SplitInput;
33
34
  }
34
35
  }
35
36
  //# sourceMappingURL=split-input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"split-input.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/split-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAmC,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAQ1C;;GAEG;AACH,qBACa,UAAW,SAAQ,YAAY;IAC1C;;OAEG;IACyB,GAAG,SAAK;IACpC;;OAEG;IACyB,KAAK,SAAM;IAEvB,MAAM,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;IACtD,OAAO,SAAK;IACZ,YAAY,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAM;IAErC,MAAM,CAAC,MAAM,iBAkDO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY;IAWhC,SAAS,CAAC,YAAY;IAiBtB,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU;IA4BpC,KAAK;IAIL,OAAO,CAAC,CAAC,SAAe;IAQxB,IAAI,CAAC,CAAC,SAAe;IAKrB,KAAK;CASN;AAED,eAAe,UAAU,CAAC;AAE1B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
1
+ {"version":3,"file":"split-input.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/split-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAmC,MAAM,gBAAgB,CAAC;AAE3F,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AASpD;;GAEG;AACH,qBACa,UAAW,SAAQ,WAAW;IACzC;;OAEG;IACyB,GAAG,SAAK;IACpC;;OAEG;IACyB,KAAK,SAAM;IAEvB,MAAM,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;IACtD,OAAO,SAAK;IACZ,YAAY,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAM;IAErC,MAAM,CAAC,MAAM,iBAkDO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY;IAWhC,SAAS,CAAC,YAAY;IAiBtB,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU;IA4BpC,KAAK;IAIL,OAAO,CAAC,CAAC,SAAe;IAQxB,IAAI,CAAC,CAAC,SAAe;IAKrB,KAAK;CASN;AAED,eAAe,UAAU,CAAC;AAE1B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;QAC1B,eAAe,EAAE,UAAU,CAAC;KAC7B;CACF"}
@@ -1,14 +1,15 @@
1
1
  import { __decorate } from "tslib";
2
- import { css, html, property, query, queryAll } from "../../deps.js";
3
- import { createScope, cssvarValues, define } from "../../root.js";
4
- import { InputElement } from "./input.js";
2
+ import { css, html, property, query, queryAll } from "../../.deps.js";
3
+ import { define } from "../../decorators/define.js";
4
+ import { GodownInput } from "../../supers/input.js";
5
+ import { createScope, cssvarValues } from "../../supers/root.js";
5
6
  const FOCUS = "focus";
6
7
  const defineName = "split-input";
7
8
  const cssScope = createScope(defineName);
8
9
  /**
9
- * SplitInput renders multiple inputs.
10
+ * {@linkcode SplitInput } renders multiple inputs.
10
11
  */
11
- let SplitInput = class SplitInput extends InputElement {
12
+ let SplitInput = class SplitInput extends GodownInput {
12
13
  constructor() {
13
14
  super(...arguments);
14
15
  /**
@@ -103,7 +104,7 @@ let SplitInput = class SplitInput extends InputElement {
103
104
  }
104
105
  };
105
106
  SplitInput.styles = [
106
- InputElement.styles,
107
+ GodownInput.styles,
107
108
  css `
108
109
  :host {
109
110
  ${cssScope}--outline: .15em solid var( ${cssvarValues.input}--outline-color);
@@ -1 +1 @@
1
- {"version":3,"file":"split-input.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/split-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuB,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE1F,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,KAAK,GAAG,OAAO,CAAC;AAEtB,MAAM,UAAU,GAAG,aAAa,CAAC;AAEjC,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAEzC;;GAEG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,YAAY;IAArC;;QACL;;WAEG;QACyB,QAAG,GAAG,CAAC,CAAC;QACpC;;WAEG;QACyB,UAAK,GAA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,CAAC,OAAO,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAC3B,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC;;AArIM,iBAAM,GAAG;IACd,YAAY,CAAC,MAAM;IACnB,GAAG,CAAA;;UAEG,QAAQ,+BAA+B,YAAY,CAAC,KAAK;sBAC7C,YAAY,CAAC,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA8BR,YAAY,CAAC,KAAK;;;;;;;;;;;;uBAY3B,QAAQ;;KAE1B;CACgB,AAlDN,CAkDO;AA7DQ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAS;AAIR;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAY;AAEvB;IAAf,KAAK,CAAC,OAAO,CAAC;0CAA0B;AACvB;IAAjB,QAAQ,CAAC,MAAM,CAAC;0CAAqC;AAX3C,UAAU;IADtB,MAAM,CAAC,UAAU,CAAC;GACN,UAAU,CAqJtB;;AAED,eAAe,UAAU,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, property, query, queryAll } from \"../../deps.js\";\nimport { type HTMLTemplate } from \"../../lib/templates.js\";\nimport { createScope, cssvarValues, define } from \"../../root.js\";\nimport { InputElement } from \"./input.js\";\n\nconst FOCUS = \"focus\";\n\nconst defineName = \"split-input\";\n\nconst cssScope = createScope(defineName);\n\n/**\n * SplitInput renders multiple inputs.\n */\n@define(defineName)\nexport class SplitInput extends InputElement {\n /**\n * The number of simulated input boxes.\n */\n @property({ type: Number }) max = 6;\n /**\n * Active index.\n */\n @property({ type: Number }) index = -1;\n\n @query(\"input\") _input: HTMLInputElement;\n @queryAll(\"span\") _spans: NodeListOf<HTMLSpanElement>;\n current = 0;\n currentValue: (string | null)[] = [];\n\n static styles = [\n InputElement.styles,\n css`\n :host {\n ${cssScope}--outline: .15em solid var( ${cssvarValues.input}--outline-color);\n margin: var(${cssvarValues.input}--outline-width);\n width: fit-content;\n border-radius: 1px;\n }\n\n * {\n font-size: 1em;\n border-radius: inherit;\n }\n\n div {\n vertical-align: top;\n position: relative;\n display: inline-flex;\n gap: 0.25em;\n }\n\n span {\n box-sizing: content-box;\n vertical-align: top;\n display: inline-flex;\n width: 1.45em;\n height: 1.45em;\n pointer-events: all;\n }\n\n i {\n height: inherit;\n width: 100%;\n z-index: 1;\n background-color: var(${cssvarValues.input}--false);\n text-align: center;\n }\n\n input {\n position: absolute;\n opacity: 0;\n left: 0;\n top: 0;\n }\n\n .focus i {\n outline: var(${cssScope}--outline);\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n return html`\n <div>\n ${Array(this.max)\n .fill(0)\n .map(() => html`<span><i></i></span>`)}\n <input @input=\"${this._handleInput}\" />\n </div>\n `;\n }\n\n protected firstUpdated() {\n this.currentValue = this.value.split(\"\").concat(Array(this.max - this.value.length).fill(null));\n this.current = this.index < 0 || this.index > this.max ? this.currentValue.indexOf(null) : this.index;\n this._spans.forEach((span, index) => {\n this.addEvent(span, \"click\", () => {\n this.current = index;\n this.focusAt();\n this._input.focus();\n });\n });\n this.addEvent(document, \"click\", (e) => {\n if (!this.contains(e.target as Node)) {\n this.blur();\n }\n });\n }\n\n protected _handleInput(e: InputEvent) {\n if (e.data === null) {\n if (this.currentValue[this.current] !== null) {\n this.currentValue[this.current] = null;\n } else {\n this.currentValue[this.current - 1] = null;\n this.current = this.current - 1 < 0 ? 0 : this.current - 1;\n }\n } else {\n this.currentValue[this.current] = e.data;\n if (this.current + 1 >= this.max) {\n this.current = this.currentValue.indexOf(null);\n if (this.current === -1) {\n this.blur();\n }\n } else {\n this.current += 1;\n }\n }\n this.focus();\n this._spans.forEach((span, index) => {\n span.querySelector(\"i\").innerText = this.currentValue[index] || \"\";\n });\n this.value = this.currentValue.join(\"\");\n this.dispatchEvent(new CustomEvent(\"input\", { detail: this.value, bubbles: true, composed: true }));\n this.dispatchEvent(new CustomEvent(\"change\", { detail: this.value, composed: true }));\n }\n\n focus() {\n this.focusAt();\n }\n\n focusAt(i = this.current) {\n this._spans.forEach((span) => {\n span.classList.remove(FOCUS);\n });\n this._spans[i]?.classList.add(FOCUS);\n this._input.value = \"\";\n }\n\n blur(i = this.current) {\n this._spans[i]?.classList.remove(FOCUS);\n this._input.blur();\n }\n\n reset() {\n this.currentValue = Array(this.max).fill(null);\n this.current = 0;\n this._spans.forEach((span) => {\n span.querySelector(\"i\").innerText = \"\";\n });\n this.value = \"\";\n this.dispatchEvent(new CustomEvent(\"change\", { detail: this.value }));\n }\n}\n\nexport default SplitInput;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"split-input\": SplitInput;\n }\n}\n"]}
1
+ {"version":3,"file":"split-input.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/split-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuB,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEjE,MAAM,KAAK,GAAG,OAAO,CAAC;AAEtB,MAAM,UAAU,GAAG,aAAa,CAAC;AAEjC,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAEzC;;GAEG;AAEI,IAAM,UAAU,GAA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AAI,CAAC,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAC3B,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC;;AArIM,iBAAM,GAAG;IACd,WAAW,CAAC,MAAM;IAClB,GAAG,CAAA;;UAEG,QAAQ,+BAA+B,YAAY,CAAC,KAAK;sBAC7C,YAAY,CAAC,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA8BR,YAAY,CAAC,KAAK;;;;;;;;;;;;uBAY3B,QAAQ;;KAE1B;CACgB,AAlDN,CAkDO;AA7DQ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAS;AAIR;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAY;AAEvB;IAAf,KAAK,CAAC,OAAO,CAAC;0CAA0B;AACvB;IAAjB,QAAQ,CAAC,MAAM,CAAC;0CAAqC;AAX3C,UAAU;IADtB,MAAM,CAAC,UAAU,CAAC;GACN,UAAU,CAqJtB;;AAED,eAAe,UAAU,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, property, query, queryAll } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { type HTMLTemplate } from \"../../lib/templates.js\";\nimport { GodownInput } from \"../../supers/input.js\";\nimport { createScope, cssvarValues } from \"../../supers/root.js\";\n\nconst FOCUS = \"focus\";\n\nconst defineName = \"split-input\";\n\nconst cssScope = createScope(defineName);\n\n/**\n * {@linkcode SplitInput } renders multiple inputs.\n */\n@define(defineName)\nexport class SplitInput extends GodownInput {\n /**\n * The number of simulated input boxes.\n */\n @property({ type: Number }) max = 6;\n /**\n * Active index.\n */\n @property({ type: Number }) index = -1;\n\n @query(\"input\") _input: HTMLInputElement;\n @queryAll(\"span\") _spans: NodeListOf<HTMLSpanElement>;\n current = 0;\n currentValue: (string | null)[] = [];\n\n static styles = [\n GodownInput.styles,\n css`\n :host {\n ${cssScope}--outline: .15em solid var( ${cssvarValues.input}--outline-color);\n margin: var(${cssvarValues.input}--outline-width);\n width: fit-content;\n border-radius: 1px;\n }\n\n * {\n font-size: 1em;\n border-radius: inherit;\n }\n\n div {\n vertical-align: top;\n position: relative;\n display: inline-flex;\n gap: 0.25em;\n }\n\n span {\n box-sizing: content-box;\n vertical-align: top;\n display: inline-flex;\n width: 1.45em;\n height: 1.45em;\n pointer-events: all;\n }\n\n i {\n height: inherit;\n width: 100%;\n z-index: 1;\n background-color: var(${cssvarValues.input}--false);\n text-align: center;\n }\n\n input {\n position: absolute;\n opacity: 0;\n left: 0;\n top: 0;\n }\n\n .focus i {\n outline: var(${cssScope}--outline);\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n return html`\n <div>\n ${Array(this.max)\n .fill(0)\n .map(() => html`<span><i></i></span>`)}\n <input @input=\"${this._handleInput}\" />\n </div>\n `;\n }\n\n protected firstUpdated() {\n this.currentValue = this.value.split(\"\").concat(Array(this.max - this.value.length).fill(null));\n this.current = this.index < 0 || this.index > this.max ? this.currentValue.indexOf(null) : this.index;\n this._spans.forEach((span, index) => {\n this.addEvent(span, \"click\", () => {\n this.current = index;\n this.focusAt();\n this._input.focus();\n });\n });\n this.addEvent(document, \"click\", (e) => {\n if (!this.contains(e.target as Node)) {\n this.blur();\n }\n });\n }\n\n protected _handleInput(e: InputEvent) {\n if (e.data === null) {\n if (this.currentValue[this.current] !== null) {\n this.currentValue[this.current] = null;\n } else {\n this.currentValue[this.current - 1] = null;\n this.current = this.current - 1 < 0 ? 0 : this.current - 1;\n }\n } else {\n this.currentValue[this.current] = e.data;\n if (this.current + 1 >= this.max) {\n this.current = this.currentValue.indexOf(null);\n if (this.current === -1) {\n this.blur();\n }\n } else {\n this.current += 1;\n }\n }\n this.focus();\n this._spans.forEach((span, index) => {\n span.querySelector(\"i\").innerText = this.currentValue[index] || \"\";\n });\n this.value = this.currentValue.join(\"\");\n this.dispatchEvent(new CustomEvent(\"input\", { detail: this.value, bubbles: true, composed: true }));\n this.dispatchEvent(new CustomEvent(\"change\", { detail: this.value, composed: true }));\n }\n\n focus() {\n this.focusAt();\n }\n\n focusAt(i = this.current) {\n this._spans.forEach((span) => {\n span.classList.remove(FOCUS);\n });\n this._spans[i]?.classList.add(FOCUS);\n this._input.value = \"\";\n }\n\n blur(i = this.current) {\n this._spans[i]?.classList.remove(FOCUS);\n this._input.blur();\n }\n\n reset() {\n this.currentValue = Array(this.max).fill(null);\n this.current = 0;\n this._spans.forEach((span) => {\n span.querySelector(\"i\").innerText = \"\";\n });\n this.value = \"\";\n this.dispatchEvent(new CustomEvent(\"change\", { detail: this.value }));\n }\n}\n\nexport default SplitInput;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"split-input\": SplitInput;\n \"g-split-input\": SplitInput;\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 { InputElement } from "./input.js";
3
+ import { GodownInput } from "../../supers/input.js";
4
4
  /**
5
- * Switch renders a switch.
5
+ * {@linkcode SwitchInput } renders a switch.
6
6
  *
7
7
  * Inspired by Steam.
8
8
  */
9
- export declare class SwitchInput extends InputElement {
9
+ export declare class SwitchInput extends GodownInput {
10
10
  /**
11
11
  * Border style.
12
12
  */
@@ -43,6 +43,7 @@ export default SwitchInput;
43
43
  declare global {
44
44
  interface HTMLElementTagNameMap {
45
45
  "switch-input": SwitchInput;
46
+ "g-switch-input": SwitchInput;
46
47
  }
47
48
  }
48
49
  //# sourceMappingURL=switch-input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"switch-input.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/switch-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAyB,MAAM,eAAe,CAAC;AAChF,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAM1C;;;;GAIG;AACH,qBACa,WAAY,SAAQ,YAAY;IAC3C;;OAEG;IACS,IAAI,EAAE,KAAK,GAAG,MAAM,CAAU;IAC1C;;OAEG;IAC0B,OAAO,UAAS;IAC7C;;OAEG;IAC0B,QAAQ,UAAS;IAC9C;;OAEG;IACS,GAAG,SAAW;IAC1B;;OAEG;IACS,IAAI,SAAc;IAC9B;;OAEG;IACS,KAAK,SAAQ;IAET,MAAM,EAAE,gBAAgB,CAAC;IAEzC,MAAM,CAAC,MAAM,iBA4HO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY;IAWhC,KAAK;IAKL,iBAAiB;IASjB,SAAS,CAAC,aAAa;IAMvB,SAAS,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC;CAG/B;AAED,eAAe,WAAW,CAAC;AAE3B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
1
+ {"version":3,"file":"switch-input.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/switch-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAyB,MAAM,gBAAgB,CAAC;AAEjF,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAOpD;;;;GAIG;AACH,qBACa,WAAY,SAAQ,WAAW;IAC1C;;OAEG;IACS,IAAI,EAAE,KAAK,GAAG,MAAM,CAAU;IAC1C;;OAEG;IAC0B,OAAO,UAAS;IAC7C;;OAEG;IAC0B,QAAQ,UAAS;IAC9C;;OAEG;IACS,GAAG,SAAW;IAC1B;;OAEG;IACS,IAAI,SAAc;IAC9B;;OAEG;IACS,KAAK,SAAQ;IAET,MAAM,EAAE,gBAAgB,CAAC;IAEzC,MAAM,CAAC,MAAM,iBA4HO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY;IAWhC,KAAK;IAKL,iBAAiB;IASjB,SAAS,CAAC,aAAa;IAMvB,SAAS,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC;CAG/B;AAED,eAAe,WAAW,CAAC;AAE3B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;QAC5B,gBAAgB,EAAE,WAAW,CAAC;KAC/B;CACF"}
@@ -1,16 +1,17 @@
1
1
  import { __decorate } from "tslib";
2
- import { css, html, property, query } from "../../deps.js";
2
+ import { css, html, property, query } from "../../.deps.js";
3
+ import { define } from "../../decorators/define.js";
3
4
  import { htmlSlot } from "../../lib/templates.js";
4
- import { createScope, cssvarValues, define } from "../../root.js";
5
- import { InputElement } from "./input.js";
5
+ import { GodownInput } from "../../supers/input.js";
6
+ import { createScope, cssvarValues } from "../../supers/root.js";
6
7
  const defineName = "switch-input";
7
8
  const cssScope = createScope(defineName);
8
9
  /**
9
- * Switch renders a switch.
10
+ * {@linkcode SwitchInput } renders a switch.
10
11
  *
11
12
  * Inspired by Steam.
12
13
  */
13
- let SwitchInput = class SwitchInput extends InputElement {
14
+ let SwitchInput = class SwitchInput extends GodownInput {
14
15
  constructor() {
15
16
  super(...arguments);
16
17
  /**
@@ -71,7 +72,7 @@ let SwitchInput = class SwitchInput extends InputElement {
71
72
  }
72
73
  };
73
74
  SwitchInput.styles = [
74
- InputElement.styles,
75
+ GodownInput.styles,
75
76
  css `
76
77
  :host {
77
78
  ${cssScope}--width: 3em;
@@ -1 +1 @@
1
- {"version":3,"file":"switch-input.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/switch-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuB,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,UAAU,GAAG,cAAc,CAAC;AAElC,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAEzC;;;;GAIG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,YAAY;IAAtC;;QACL;;WAEG;QACS,SAAI,GAAmB,MAAM,CAAC;QAC1C;;WAEG;QAC0B,YAAO,GAAG,KAAK,CAAC;QAC7C;;WAEG;QAC0B,aAAQ,GAAG,KAAK,CAAC;QAC9C;;WAEG;QACS,QAAG,GAAG,OAAO,CAAC;QAC1B;;WAEG;QACS,SAAI,GAAG,UAAU,CAAC;QAC9B;;WAEG;QACS,UAAK,GAAG,IAAI,CAAC;IAoK3B,CAAC;IAlCW,MAAM;QACd,OAAO,IAAI,CAAA,gBAAgB,IAAI,CAAC,IAAI;wBAChB,IAAI,CAAC,aAAa,gBAAgB,IAAI,CAAC,QAAQ,eAAe,IAAI,CAAC,OAAO,WAAW,IAAI,CAAC,IAAI;;;8BAGxF,QAAQ,EAAE;;;YAG5B,CAAC;IACX,CAAC;IAED,KAAK;QACH,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,KAAK,MAAM,C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;;;;;;;;;;;;;;;;;KAiBvC;CACgB,AA5HN,CA4HO;AApJR;IAAX,QAAQ,EAAE;yCAA+B;AAIb;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CAAiB;AAIhB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAkB;AAIlC;IAAX,QAAQ,EAAE;wCAAe;AAId;IAAX,QAAQ,EAAE;yCAAmB;AAIlB;IAAX,QAAQ,EAAE;0CAAc;AAET;IAAf,KAAK,CAAC,OAAO,CAAC;2CAA0B;AA1B9B,WAAW;IADvB,MAAM,CAAC,UAAU,CAAC;GACN,WAAW,CA4LvB;;AAED,eAAe,WAAW,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, property, query } from \"../../deps.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { createScope, cssvarValues, define } from \"../../root.js\";\nimport { InputElement } from \"./input.js\";\n\nconst defineName = \"switch-input\";\n\nconst cssScope = createScope(defineName);\n\n/**\n * Switch renders a switch.\n *\n * Inspired by Steam.\n */\n@define(defineName)\nexport class SwitchInput extends InputElement {\n /**\n * Border style.\n */\n @property() base: \"fat\" | \"rect\" = \"rect\";\n /**\n * Whether this element is selected or not.\n */\n @property({ type: Boolean }) checked = false;\n /**\n * Whether this element is disabled or not.\n */\n @property({ type: Boolean }) disabled = false;\n /**\n * Parsed by JSON.parse to checked.\n */\n @property() def = \"false\";\n /**\n * Input name.\n */\n @property() name = \"checkbox\";\n /**\n * Input value.\n */\n @property() value = \"on\";\n\n @query(\"input\") _input: HTMLInputElement;\n\n static styles = [\n InputElement.styles,\n css`\n :host {\n ${cssScope}--width: 3em;\n ${cssScope}--height: calc(var(${cssScope}--width) / 2);\n width: var(${cssScope}--width);\n height: var(${cssScope}--height);\n }\n\n :host,\n span {\n display: inline-flex;\n font-size: inherit;\n position: relative;\n align-items: center;\n border-radius: inherit;\n }\n\n span {\n width: inherit;\n height: inherit;\n }\n\n input {\n width: inherit;\n height: inherit;\n margin: 0;\n outline: none;\n appearance: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n position: relative;\n font-size: inherit;\n background: var(${cssvarValues.input}--false);\n border-radius: inherit;\n transition: all 0.3s;\n }\n\n aside {\n pointer-events: none;\n transition: 0.3s;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n font-size: inherit;\n overflow: hidden;\n border-radius: inherit;\n }\n\n aside div {\n height: 100%;\n }\n\n input[disabled] ~ aside {\n filter: brightness(0.87);\n }\n\n .rect div.always {\n display: none;\n }\n\n .always {\n position: absolute;\n }\n\n .rect aside {\n height: 100%;\n width: 100%;\n left: 0;\n }\n\n .rect .true,\n .rect .false {\n width: 50%;\n text-align: center;\n transition: all 0.3s;\n }\n\n .rect input:checked ~ aside div.true,\n .rect .false {\n background-color: var(${cssvarValues.input}--true);\n }\n\n .rect input:checked ~ aside div.false,\n .rect .true {\n background: var(${cssvarValues.input}--false);\n }\n\n .fat aside {\n width: 1.2em;\n height: 1.2em;\n border-radius: 50%;\n background: var(${cssvarValues.input}--control);\n transition: 0.3s;\n left: 0.15em;\n top: 0.15em;\n bottom: 0.15em;\n }\n\n .fat {\n border-radius: 0.75em;\n }\n\n .fat input:checked {\n background: var(${cssvarValues.input}--true);\n }\n\n .fat input:checked ~ aside {\n left: calc(100% - 0.15em - 1.2em);\n right: 0.15em;\n }\n\n .fat input:checked ~ aside div.true,\n .fat div.false {\n display: block;\n }\n\n .fat input:checked ~ aside div.false,\n .fat div.true {\n display: none;\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n return html`<span class=\"${this.base}\">\n <input @change=\"${this._handleChange}\" ?disabled=\"${this.disabled}\" ?checked=\"${this.checked}\" name=\"${this.name}\" type=\"checkbox\" />\n <aside>\n <div class=\"false\"><slot name=\"false\"></slot></div>\n <div class=\"always\">${htmlSlot()}<slot name=\"always\"></slot></div>\n <div class=\"true\"><slot name=\"true\"></slot></div>\n </aside>\n </span>`;\n }\n\n reset() {\n this.checked = this.def === \"true\";\n this._input.checked = this.checked;\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (this.checked) {\n this.def = \"true\";\n } else if (this.def === \"true\") {\n this.checked = true;\n }\n }\n\n protected _handleChange() {\n this.checked = this._input.checked;\n this.dispatchEvent(new CustomEvent(\"input\", { detail: this.checked, bubbles: true, composed: true }));\n this.dispatchEvent(new CustomEvent(\"change\", { detail: this.checked, composed: true }));\n }\n\n namevalue(): [string, boolean] {\n return [this.name, this.checked];\n }\n}\n\nexport default SwitchInput;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"switch-input\": SwitchInput;\n }\n}\n"]}
1
+ {"version":3,"file":"switch-input.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/input/switch-input.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,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEjE,MAAM,UAAU,GAAG,cAAc,CAAC;AAElC,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAEzC;;;;GAIG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,WAAW;IAArC;;QACL;;WAEG;QACS,SAAI,GAAmB,MAAM,CAAC;QAC1C;;WAEG;QAC0B,YAAO,GAAG,KAAK,CAAC;QAC7C;;WAEG;QAC0B,aAAQ,GAAG,KAAK,CAAC;QAC9C;;WAEG;QACS,QAAG,GAAG,OAAO,CAAC;QAC1B;;WAEG;QACS,SAAI,GAAG,UAAU,CAAC;QAC9B;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IAClB,GAAG,CAAA;;UAEG,QAAQ;UACR,QAAQ,sBAAsB,QAAQ;qBAC3B,QAAQ;sBACP,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;0BA2BJ,YAAY,CAAC,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAgDZ,YAAY,CAAC,KAAK;;;;;0BAKxB,YAAY,CAAC,KAAK;;;;;;;0BAOlB,YAAY,CAAC,KAAK;;;;;;;;;;;;0BAYlB,YAAY,CAAC,KAAK;;;;;;;;;;;;;;;;;KAiBvC;CACgB,AA5HN,CA4HO;AApJR;IAAX,QAAQ,EAAE;yCAA+B;AAIb;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CAAiB;AAIhB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CAAkB;AAIlC;IAAX,QAAQ,EAAE;wCAAe;AAId;IAAX,QAAQ,EAAE;yCAAmB;AAIlB;IAAX,QAAQ,EAAE;0CAAc;AAET;IAAf,KAAK,CAAC,OAAO,CAAC;2CAA0B;AA1B9B,WAAW;IADvB,MAAM,CAAC,UAAU,CAAC;GACN,WAAW,CA4LvB;;AAED,eAAe,WAAW,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, property, query } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { GodownInput } from \"../../supers/input.js\";\nimport { createScope, cssvarValues } from \"../../supers/root.js\";\n\nconst defineName = \"switch-input\";\n\nconst cssScope = createScope(defineName);\n\n/**\n * {@linkcode SwitchInput } renders a switch.\n *\n * Inspired by Steam.\n */\n@define(defineName)\nexport class SwitchInput extends GodownInput {\n /**\n * Border style.\n */\n @property() base: \"fat\" | \"rect\" = \"rect\";\n /**\n * Whether this element is selected or not.\n */\n @property({ type: Boolean }) checked = false;\n /**\n * Whether this element is disabled or not.\n */\n @property({ type: Boolean }) disabled = false;\n /**\n * Parsed by JSON.parse to checked.\n */\n @property() def = \"false\";\n /**\n * Input name.\n */\n @property() name = \"checkbox\";\n /**\n * Input value.\n */\n @property() value = \"on\";\n\n @query(\"input\") _input: HTMLInputElement;\n\n static styles = [\n GodownInput.styles,\n css`\n :host {\n ${cssScope}--width: 3em;\n ${cssScope}--height: calc(var(${cssScope}--width) / 2);\n width: var(${cssScope}--width);\n height: var(${cssScope}--height);\n }\n\n :host,\n span {\n display: inline-flex;\n font-size: inherit;\n position: relative;\n align-items: center;\n border-radius: inherit;\n }\n\n span {\n width: inherit;\n height: inherit;\n }\n\n input {\n width: inherit;\n height: inherit;\n margin: 0;\n outline: none;\n appearance: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n position: relative;\n font-size: inherit;\n background: var(${cssvarValues.input}--false);\n border-radius: inherit;\n transition: all 0.3s;\n }\n\n aside {\n pointer-events: none;\n transition: 0.3s;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n font-size: inherit;\n overflow: hidden;\n border-radius: inherit;\n }\n\n aside div {\n height: 100%;\n }\n\n input[disabled] ~ aside {\n filter: brightness(0.87);\n }\n\n .rect div.always {\n display: none;\n }\n\n .always {\n position: absolute;\n }\n\n .rect aside {\n height: 100%;\n width: 100%;\n left: 0;\n }\n\n .rect .true,\n .rect .false {\n width: 50%;\n text-align: center;\n transition: all 0.3s;\n }\n\n .rect input:checked ~ aside div.true,\n .rect .false {\n background-color: var(${cssvarValues.input}--true);\n }\n\n .rect input:checked ~ aside div.false,\n .rect .true {\n background: var(${cssvarValues.input}--false);\n }\n\n .fat aside {\n width: 1.2em;\n height: 1.2em;\n border-radius: 50%;\n background: var(${cssvarValues.input}--control);\n transition: 0.3s;\n left: 0.15em;\n top: 0.15em;\n bottom: 0.15em;\n }\n\n .fat {\n border-radius: 0.75em;\n }\n\n .fat input:checked {\n background: var(${cssvarValues.input}--true);\n }\n\n .fat input:checked ~ aside {\n left: calc(100% - 0.15em - 1.2em);\n right: 0.15em;\n }\n\n .fat input:checked ~ aside div.true,\n .fat div.false {\n display: block;\n }\n\n .fat input:checked ~ aside div.false,\n .fat div.true {\n display: none;\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n return html`<span class=\"${this.base}\">\n <input @change=\"${this._handleChange}\" ?disabled=\"${this.disabled}\" ?checked=\"${this.checked}\" name=\"${this.name}\" type=\"checkbox\" />\n <aside>\n <div class=\"false\"><slot name=\"false\"></slot></div>\n <div class=\"always\">${htmlSlot()}<slot name=\"always\"></slot></div>\n <div class=\"true\"><slot name=\"true\"></slot></div>\n </aside>\n </span>`;\n }\n\n reset() {\n this.checked = this.def === \"true\";\n this._input.checked = this.checked;\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (this.checked) {\n this.def = \"true\";\n } else if (this.def === \"true\") {\n this.checked = true;\n }\n }\n\n protected _handleChange() {\n this.checked = this._input.checked;\n this.dispatchEvent(new CustomEvent(\"input\", { detail: this.checked, bubbles: true, composed: true }));\n this.dispatchEvent(new CustomEvent(\"change\", { detail: this.checked, composed: true }));\n }\n\n namevalue(): [string, boolean] {\n return [this.name, this.checked];\n }\n}\n\nexport default SwitchInput;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"switch-input\": SwitchInput;\n \"g-switch-input\": SwitchInput;\n }\n}\n"]}
@@ -0,0 +1,22 @@
1
+ import { type HTMLTemplate } from "../../lib/templates.js";
2
+ import { GodownElement } from "../../supers/root.js";
3
+ /**
4
+ * {@linkcode Divider} similar to hr.
5
+ */
6
+ export declare class Divider extends GodownElement {
7
+ /**
8
+ * Enable vertical.
9
+ */
10
+ v: boolean;
11
+ static styles: import("lit").CSSResult[];
12
+ protected render(): HTMLTemplate;
13
+ }
14
+ export default Divider;
15
+ declare global {
16
+ interface HTMLElementTagNameMap {
17
+ "divider-line": Divider;
18
+ "div-line": Divider;
19
+ "g-divider": Divider;
20
+ }
21
+ }
22
+ //# sourceMappingURL=divider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"divider.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/layout/divider.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAe,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAKlE;;GAEG;AACH,qBACa,OAAQ,SAAQ,aAAa;IACxC;;OAEG;IAC0B,CAAC,UAAS;IAEvC,MAAM,CAAC,MAAM,4BAiDX;IAEF,SAAS,CAAC,MAAM,IAAI,YAAY;CAOjC;AAED,eAAe,OAAO,CAAC;AAEvB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,OAAO,CAAC;QACxB,UAAU,EAAE,OAAO,CAAC;QACpB,WAAW,EAAE,OAAO,CAAC;KACtB;CACF"}
@@ -1,13 +1,14 @@
1
1
  import { __decorate } from "tslib";
2
- import { css, html, property } from "../../deps.js";
2
+ import { css, html, property } from "../../.deps.js";
3
+ import { define } from "../../decorators/define.js";
3
4
  import { htmlSlot } from "../../lib/templates.js";
4
- import { createScope, define, GodownElement } from "../../root.js";
5
- const defineName = "divider-line";
5
+ import { createScope, GodownElement } from "../../supers/root.js";
6
+ const defineName = "divider";
6
7
  const cssvarScope = createScope(defineName);
7
8
  /**
8
- * DividerLine similar to hr.
9
+ * {@linkcode Divider} similar to hr.
9
10
  */
10
- let DividerLine = class DividerLine extends GodownElement {
11
+ let Divider = class Divider extends GodownElement {
11
12
  constructor() {
12
13
  super(...arguments);
13
14
  /**
@@ -23,7 +24,7 @@ let DividerLine = class DividerLine extends GodownElement {
23
24
  </div>`;
24
25
  }
25
26
  };
26
- DividerLine.styles = [
27
+ Divider.styles = [
27
28
  css `
28
29
  :host {
29
30
  ${cssvarScope}--before-length: auto;
@@ -75,10 +76,10 @@ DividerLine.styles = [
75
76
  ];
76
77
  __decorate([
77
78
  property({ type: Boolean })
78
- ], DividerLine.prototype, "v", void 0);
79
- DividerLine = __decorate([
79
+ ], Divider.prototype, "v", void 0);
80
+ Divider = __decorate([
80
81
  define(defineName)
81
- ], DividerLine);
82
- export { DividerLine };
83
- export default DividerLine;
84
- //# sourceMappingURL=divider-line.js.map
82
+ ], Divider);
83
+ export { Divider };
84
+ export default Divider;
85
+ //# sourceMappingURL=divider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"divider.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/layout/divider.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAElE,MAAM,UAAU,GAAG,SAAS,CAAC;AAC7B,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C;;GAEG;AAEI,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,aAAa;IAAnC;;QACL;;WAEG;QAC0B,MAAC,GAAG,KAAK,CAAC;IA4DzC,CAAC;IAPW,MAAM;QACd,OAAO,IAAI,CAAA,eAAe,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;;QAEvC,QAAQ,EAAE;;WAEP,CAAC;IACV,CAAC;;AAzDM,cAAM,GAAG;IACd,GAAG,CAAA;;UAEG,WAAW;UACX,WAAW;UACX,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBA4BC,WAAW;yBACR,WAAW;;;sBAGd,WAAW;yBACR,WAAW;;;qBAGf,WAAW;0BACN,WAAW;;;qBAGhB,WAAW;0BACN,WAAW;;KAEhC;CACF,AAjDY,CAiDX;AAnD2B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kCAAW;AAJ5B,OAAO;IADnB,MAAM,CAAC,UAAU,CAAC;GACN,OAAO,CAgEnB;;AAED,eAAe,OAAO,CAAC","sourcesContent":["import { css, html, property } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { createScope, GodownElement } from \"../../supers/root.js\";\n\nconst defineName = \"divider\";\nconst cssvarScope = createScope(defineName);\n\n/**\n * {@linkcode Divider} similar to hr.\n */\n@define(defineName)\nexport class Divider extends GodownElement {\n /**\n * Enable vertical.\n */\n @property({ type: Boolean }) v = false;\n\n static styles = [\n css`\n :host {\n ${cssvarScope}--before-length: auto;\n ${cssvarScope}--after-length: auto;\n ${cssvarScope}--breadth: .125em;\n display: block;\n color: currentColor;\n background: none;\n }\n\n div {\n display: flex;\n align-items: center;\n border-radius: inherit;\n width: 100%;\n }\n\n hr {\n border-radius: inherit;\n margin: 0;\n border: 0;\n flex: 1;\n background: currentColor;\n }\n\n .v {\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n\n .before {\n height: var(${cssvarScope}--breadth);\n max-width: var(${cssvarScope}--before-length);\n }\n .after {\n height: var(${cssvarScope}--breadth);\n max-width: var(${cssvarScope}--after-length);\n }\n .v .before {\n width: var(${cssvarScope}--breadth);\n max-height: var(${cssvarScope}--before-length);\n }\n .v .after {\n width: var(${cssvarScope}--breadth);\n max-height: var(${cssvarScope}--after-length);\n }\n `,\n ];\n\n protected render(): HTMLTemplate {\n return html`<div class=\"${this.v ? \"v\" : \"\"}\">\n <hr class=\"before\" />\n ${htmlSlot()}\n <hr class=\"after\" />\n </div>`;\n }\n}\n\nexport default Divider;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"divider-line\": Divider;\n \"div-line\": Divider;\n \"g-divider\": Divider;\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import { type HTMLTemplate } from "../../lib/templates.js";
2
- import { GodownElement } from "../../root.js";
2
+ import { GodownElement } from "../../supers/root.js";
3
3
  /**
4
- * FlexFlow controls the flex layout based on the width of the screen.
4
+ * {@linkcode FlexFlow} controls the flex layout based on the width of the screen.
5
5
  */
6
6
  export declare class FlexFlow extends GodownElement {
7
7
  /**
@@ -19,6 +19,7 @@ export default FlexFlow;
19
19
  declare global {
20
20
  interface HTMLElementTagNameMap {
21
21
  "flex-flow": FlexFlow;
22
+ "g-flex-flow": FlexFlow;
22
23
  }
23
24
  }
24
25
  //# sourceMappingURL=flex-flow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"flex-flow.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/layout/flex-flow.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAU,aAAa,EAAE,MAAM,eAAe,CAAC;AAItD;;GAEG;AACH,qBACa,QAAS,SAAQ,aAAa;IACzC;;OAEG;IACS,QAAQ,SAA8B;IAClD;;OAEG;IACS,MAAM,SAAW;IAE7B,MAAM,CAAC,MAAM,4BAMX;IAEF,SAAS,CAAC,MAAM,IAAI,YAAY;CAUjC;AAED,eAAe,QAAQ,CAAC;AACxB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
1
+ {"version":3,"file":"flex-flow.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/layout/flex-flow.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAIrD;;GAEG;AACH,qBACa,QAAS,SAAQ,aAAa;IACzC;;OAEG;IACS,QAAQ,SAA8B;IAClD;;OAEG;IACS,MAAM,SAAW;IAE7B,MAAM,CAAC,MAAM,4BAMX;IAEF,SAAS,CAAC,MAAM,IAAI,YAAY;CAUjC;AAED,eAAe,QAAQ,CAAC;AACxB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;QACtB,aAAa,EAAE,QAAQ,CAAC;KACzB;CACF"}
@@ -1,10 +1,11 @@
1
1
  import { __decorate } from "tslib";
2
- import { css, html, property } from "../../deps.js";
2
+ import { css, html, property } from "../../.deps.js";
3
+ import { define } from "../../decorators/define.js";
3
4
  import { htmlSlot, htmlStyle } from "../../lib/templates.js";
4
- import { define, GodownElement } from "../../root.js";
5
+ import { GodownElement } from "../../supers/root.js";
5
6
  const defineName = "flex-flow";
6
7
  /**
7
- * FlexFlow controls the flex layout based on the width of the screen.
8
+ * {@linkcode FlexFlow} controls the flex layout based on the width of the screen.
8
9
  */
9
10
  let FlexFlow = class FlexFlow extends GodownElement {
10
11
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"flex-flow.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/layout/flex-flow.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAqB,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,UAAU,GAAG,WAAW,CAAC;AAE/B;;GAEG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,aAAa;IAApC;;QACL;;WAEG;QACS,aAAQ,GAAG,0BAA0B,CAAC;QAClD;;WAEG;QACS,WAAM,GAAG,OAAO,CAAC;IAoB/B,CAAC;IAVW,MAAM;QACd,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC5C,MAAM,aAAa,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC;QAC3C,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC;QACzC,MAAM,cAAc,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,aAAa,IAAI,QAAQ,CAAC;QAChE,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,IAAI,QAAQ,CAAC;QACtD,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC;QACjC,MAAM,KAAK,GAAG,wBAAwB,aAAa,cAAc,QAAQ,uBAAuB,CAAC,0BAA0B,cAAc,cAAc,SAAS,GAAG,CAAC;QACpK,OAAO,IAAI,CAAA,GAAG,QAAQ,EAAE,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;IACjD,CAAC;;AAjBM,eAAM,GAAG;IACd,GAAG,CAAA;;;;KAIF;CACF,AANY,CAMX;AAZU;IAAX,QAAQ,EAAE;0CAAuC;AAItC;IAAX,QAAQ,EAAE;wCAAkB;AARlB,QAAQ;IADpB,MAAM,CAAC,UAAU,CAAC;GACN,QAAQ,CA4BpB;;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import { css, html, property } from \"../../deps.js\";\nimport { htmlSlot, htmlStyle, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { define, GodownElement } from \"../../root.js\";\n\nconst defineName = \"flex-flow\";\n\n/**\n * FlexFlow controls the flex layout based on the width of the screen.\n */\n@define(defineName)\nexport class FlexFlow extends GodownElement {\n /**\n * The flex-flow behavior.\n */\n @property() flexflow = \"row nowrap column nowrap\";\n /**\n * The width of the screen for the position change.\n */\n @property() mobile = \"720px\";\n\n static styles = [\n css`\n :host {\n display: flex !important;\n }\n `,\n ];\n\n protected render(): HTMLTemplate {\n const flexflow = this.flexflow.split(/\\s+/);\n const flexDirection = flexflow[0] || \"row\";\n const flexWrap = flexflow[1] || \"nowrap\";\n const flexDirectionM = flexflow[2] || flexDirection || \"column\";\n const flexWrapM = flexflow[3] || flexWrap || \"nowrap\";\n const m = this.mobile || \"720px\";\n const style = `:host{flex-direction:${flexDirection};flex-wrap:${flexWrap};}@media(max-width: ${m}){:host{flex-direction:${flexDirectionM};flex-wrap:${flexWrapM}}`;\n return html`${htmlSlot()} ${htmlStyle(style)}`;\n }\n}\n\nexport default FlexFlow;\ndeclare global {\n interface HTMLElementTagNameMap {\n \"flex-flow\": FlexFlow;\n }\n}\n"]}
1
+ {"version":3,"file":"flex-flow.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/layout/flex-flow.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAqB,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,UAAU,GAAG,WAAW,CAAC;AAE/B;;GAEG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,aAAa;IAApC;;QACL;;WAEG;QACS,aAAQ,GAAG,0BAA0B,CAAC;QAClD;;WAEG;QACS,WAAM,GAAG,OAAO,CAAC;IAoB/B,CAAC;IAVW,MAAM;QACd,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC5C,MAAM,aAAa,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC;QAC3C,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC;QACzC,MAAM,cAAc,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,aAAa,IAAI,QAAQ,CAAC;QAChE,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,IAAI,QAAQ,CAAC;QACtD,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC;QACjC,MAAM,KAAK,GAAG,wBAAwB,aAAa,cAAc,QAAQ,uBAAuB,CAAC,0BAA0B,cAAc,cAAc,SAAS,GAAG,CAAC;QACpK,OAAO,IAAI,CAAA,GAAG,QAAQ,EAAE,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;IACjD,CAAC;;AAjBM,eAAM,GAAG;IACd,GAAG,CAAA;;;;KAIF;CACF,AANY,CAMX;AAZU;IAAX,QAAQ,EAAE;0CAAuC;AAItC;IAAX,QAAQ,EAAE;wCAAkB;AARlB,QAAQ;IADpB,MAAM,CAAC,UAAU,CAAC;GACN,QAAQ,CA4BpB;;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import { css, html, property } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { htmlSlot, htmlStyle, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { GodownElement } from \"../../supers/root.js\";\n\nconst defineName = \"flex-flow\";\n\n/**\n * {@linkcode FlexFlow} controls the flex layout based on the width of the screen.\n */\n@define(defineName)\nexport class FlexFlow extends GodownElement {\n /**\n * The flex-flow behavior.\n */\n @property() flexflow = \"row nowrap column nowrap\";\n /**\n * The width of the screen for the position change.\n */\n @property() mobile = \"720px\";\n\n static styles = [\n css`\n :host {\n display: flex !important;\n }\n `,\n ];\n\n protected render(): HTMLTemplate {\n const flexflow = this.flexflow.split(/\\s+/);\n const flexDirection = flexflow[0] || \"row\";\n const flexWrap = flexflow[1] || \"nowrap\";\n const flexDirectionM = flexflow[2] || flexDirection || \"column\";\n const flexWrapM = flexflow[3] || flexWrap || \"nowrap\";\n const m = this.mobile || \"720px\";\n const style = `:host{flex-direction:${flexDirection};flex-wrap:${flexWrap};}@media(max-width: ${m}){:host{flex-direction:${flexDirectionM};flex-wrap:${flexWrapM}}`;\n return html`${htmlSlot()} ${htmlStyle(style)}`;\n }\n}\n\nexport default FlexFlow;\ndeclare global {\n interface HTMLElementTagNameMap {\n \"flex-flow\": FlexFlow;\n \"g-flex-flow\": FlexFlow;\n }\n}\n"]}
@@ -1,8 +1,8 @@
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
- * NavLayout renders a navigation, an optional top header, an optional bottom footer.
5
+ * {@linkcode NavLayout} renders a navigation, an optional top header, an optional bottom footer.
6
6
  *
7
7
  * @slot - The main content of the layout.
8
8
  *
@@ -32,6 +32,7 @@ export default NavLayout;
32
32
  declare global {
33
33
  interface HTMLElementTagNameMap {
34
34
  "nav-layout": NavLayout;
35
+ "g-nav-layout": NavLayout;
35
36
  }
36
37
  }
37
38
  //# sourceMappingURL=nav-layout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nav-layout.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/layout/nav-layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAQ,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAqC,aAAa,EAAE,MAAM,eAAe,CAAC;AAKjF;;;;;;;;;;GAUG;AACH,qBACa,SAAU,SAAQ,aAAa;IAC1C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAEf,MAAM,CAAC,MAAM,iBAoCO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY;CAMjC;AAED,eAAe,SAAS,CAAC;AAEzB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
1
+ {"version":3,"file":"nav-layout.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/layout/nav-layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAQ,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAA6B,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAKhF;;;;;;;;;;GAUG;AACH,qBACa,SAAU,SAAQ,aAAa;IAC1C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAEf,MAAM,CAAC,MAAM,iBAoCO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY;CAMjC;AAED,eAAe,SAAS,CAAC;AAEzB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;QACxB,cAAc,EAAE,SAAS,CAAC;KAC3B;CACF"}
@@ -1,11 +1,12 @@
1
1
  import { __decorate } from "tslib";
2
- import { css, html } from "../../deps.js";
2
+ import { css, html } from "../../.deps.js";
3
+ import { define } from "../../decorators/define.js";
3
4
  import { htmlSlot } from "../../lib/templates.js";
4
- import { createScope, cssvarValues, define, GodownElement } from "../../root.js";
5
+ import { createScope, cssvarValues, GodownElement } from "../../supers/root.js";
5
6
  const defineName = "nav-layout";
6
7
  const cssvarScope = createScope(defineName);
7
8
  /**
8
- * NavLayout renders a navigation, an optional top header, an optional bottom footer.
9
+ * {@linkcode NavLayout} renders a navigation, an optional top header, an optional bottom footer.
9
10
  *
10
11
  * @slot - The main content of the layout.
11
12
  *