godown 2.5.1 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (497) hide show
  1. package/README.md +1 -1
  2. package/alert-item.d.ts +2 -0
  3. package/alert-item.d.ts.map +1 -0
  4. package/alert-item.js +2 -0
  5. package/alert-item.js.map +1 -0
  6. package/avatar-a.d.ts +2 -0
  7. package/avatar-a.d.ts.map +1 -0
  8. package/avatar-a.js +2 -0
  9. package/avatar-a.js.map +1 -0
  10. package/avatar-group.d.ts +2 -0
  11. package/avatar-group.d.ts.map +1 -0
  12. package/avatar-group.js +2 -0
  13. package/avatar-group.js.map +1 -0
  14. package/base-button.d.ts +2 -0
  15. package/base-button.d.ts.map +1 -0
  16. package/base-button.js +2 -0
  17. package/base-button.js.map +1 -0
  18. package/base-form.d.ts +2 -0
  19. package/base-form.d.ts.map +1 -0
  20. package/base-form.js +2 -0
  21. package/base-form.js.map +1 -0
  22. package/base-input.d.ts +2 -0
  23. package/base-input.d.ts.map +1 -0
  24. package/base-input.js +2 -0
  25. package/base-input.js.map +1 -0
  26. package/card-item.d.ts +2 -0
  27. package/card-item.d.ts.map +1 -0
  28. package/card-item.js +2 -0
  29. package/card-item.js.map +1 -0
  30. package/carousel-slider.d.ts +2 -0
  31. package/carousel-slider.d.ts.map +1 -0
  32. package/carousel-slider.js +2 -0
  33. package/carousel-slider.js.map +1 -0
  34. package/clip-text.d.ts +2 -0
  35. package/clip-text.d.ts.map +1 -0
  36. package/clip-text.js +2 -0
  37. package/clip-text.js.map +1 -0
  38. package/conf.d.ts.map +1 -1
  39. package/conf.js.map +1 -1
  40. package/deps.d.ts +4 -3
  41. package/deps.d.ts.map +1 -1
  42. package/deps.js +4 -3
  43. package/deps.js.map +1 -1
  44. package/details-group.d.ts +2 -0
  45. package/details-group.d.ts.map +1 -0
  46. package/details-group.js +2 -0
  47. package/details-group.js.map +1 -0
  48. package/divider-line.d.ts +2 -0
  49. package/divider-line.d.ts.map +1 -0
  50. package/divider-line.js +2 -0
  51. package/divider-line.js.map +1 -0
  52. package/drag-box.d.ts +2 -0
  53. package/drag-box.d.ts.map +1 -0
  54. package/drag-box.js +2 -0
  55. package/drag-box.js.map +1 -0
  56. package/flex-flow.d.ts +2 -0
  57. package/flex-flow.d.ts.map +1 -0
  58. package/flex-flow.js +2 -0
  59. package/flex-flow.js.map +1 -0
  60. package/godown-element.d.ts +2 -2
  61. package/godown-element.d.ts.map +1 -1
  62. package/godown-element.js +1 -1
  63. package/godown-element.js.map +1 -1
  64. package/index.d.ts +2 -6
  65. package/index.d.ts.map +1 -1
  66. package/index.js +2 -6
  67. package/index.js.map +1 -1
  68. package/label-input.d.ts +2 -0
  69. package/label-input.d.ts.map +1 -0
  70. package/label-input.js +2 -0
  71. package/label-input.js.map +1 -0
  72. package/lib/directives.d.ts.map +1 -1
  73. package/lib/directives.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/event-collection.js.map +1 -1
  77. package/lib/route-tree.d.ts.map +1 -1
  78. package/lib/route-tree.js.map +1 -1
  79. package/lib/templates.d.ts.map +1 -1
  80. package/lib/templates.js.map +1 -1
  81. package/lib/utils.d.ts.map +1 -1
  82. package/lib/utils.js.map +1 -1
  83. package/link-a.d.ts +2 -0
  84. package/link-a.d.ts.map +1 -0
  85. package/link-a.js +2 -0
  86. package/link-a.js.map +1 -0
  87. package/loading-progress.d.ts +2 -0
  88. package/loading-progress.d.ts.map +1 -0
  89. package/loading-progress.js +2 -0
  90. package/loading-progress.js.map +1 -0
  91. package/nav-aside.d.ts +2 -0
  92. package/nav-aside.d.ts.map +1 -0
  93. package/nav-aside.js +2 -0
  94. package/nav-aside.js.map +1 -0
  95. package/nav-layout.d.ts +2 -0
  96. package/nav-layout.d.ts.map +1 -0
  97. package/nav-layout.js +2 -0
  98. package/nav-layout.js.map +1 -0
  99. package/open-details.d.ts +2 -0
  100. package/open-details.d.ts.map +1 -0
  101. package/open-details.js +2 -0
  102. package/open-details.js.map +1 -0
  103. package/open-dialog.d.ts +2 -0
  104. package/open-dialog.d.ts.map +1 -0
  105. package/open-dialog.js +2 -0
  106. package/open-dialog.js.map +1 -0
  107. package/open-list.d.ts +2 -0
  108. package/open-list.d.ts.map +1 -0
  109. package/open-list.js +2 -0
  110. package/open-list.js.map +1 -0
  111. package/open-offset.d.ts +2 -0
  112. package/open-offset.d.ts.map +1 -0
  113. package/open-offset.js +2 -0
  114. package/open-offset.js.map +1 -0
  115. package/open-tooltip.d.ts +2 -0
  116. package/open-tooltip.d.ts.map +1 -0
  117. package/open-tooltip.js +2 -0
  118. package/open-tooltip.js.map +1 -0
  119. package/overbreath-text.d.ts +2 -0
  120. package/overbreath-text.d.ts.map +1 -0
  121. package/overbreath-text.js +2 -0
  122. package/overbreath-text.js.map +1 -0
  123. package/package.json +57 -10
  124. package/react/create.d.ts.map +1 -1
  125. package/react/create.js.map +1 -1
  126. package/react/index.d.ts +37 -7
  127. package/react/index.d.ts.map +1 -1
  128. package/react/index.js +114 -7
  129. package/react/index.js.map +1 -1
  130. package/root.d.ts.map +1 -1
  131. package/root.js +3 -2
  132. package/root.js.map +1 -1
  133. package/route-view.d.ts +2 -0
  134. package/route-view.d.ts.map +1 -0
  135. package/route-view.js +2 -0
  136. package/route-view.js.map +1 -0
  137. package/scroll-x.d.ts +2 -0
  138. package/scroll-x.d.ts.map +1 -0
  139. package/scroll-x.js +2 -0
  140. package/scroll-x.js.map +1 -0
  141. package/search-input.d.ts +2 -0
  142. package/search-input.d.ts.map +1 -0
  143. package/search-input.js +2 -0
  144. package/search-input.js.map +1 -0
  145. package/select-input.d.ts +2 -0
  146. package/select-input.d.ts.map +1 -0
  147. package/select-input.js +2 -0
  148. package/select-input.js.map +1 -0
  149. package/sign-form.d.ts +2 -0
  150. package/sign-form.d.ts.map +1 -0
  151. package/sign-form.js +2 -0
  152. package/sign-form.js.map +1 -0
  153. package/skeleton-screen.d.ts +2 -0
  154. package/skeleton-screen.d.ts.map +1 -0
  155. package/skeleton-screen.js +2 -0
  156. package/skeleton-screen.js.map +1 -0
  157. package/split-input.d.ts +2 -0
  158. package/split-input.d.ts.map +1 -0
  159. package/split-input.js +2 -0
  160. package/split-input.js.map +1 -0
  161. package/super-a.d.ts +2 -0
  162. package/super-a.d.ts.map +1 -0
  163. package/super-a.js +2 -0
  164. package/super-a.js.map +1 -0
  165. package/switch-input.d.ts +2 -0
  166. package/switch-input.d.ts.map +1 -0
  167. package/switch-input.js +2 -0
  168. package/switch-input.js.map +1 -0
  169. package/tab-group.d.ts +2 -0
  170. package/tab-group.d.ts.map +1 -0
  171. package/tab-group.js +2 -0
  172. package/tab-group.js.map +1 -0
  173. package/time-bar.d.ts +2 -0
  174. package/time-bar.d.ts.map +1 -0
  175. package/time-bar.js +2 -0
  176. package/time-bar.js.map +1 -0
  177. package/typewriter-text.d.ts +2 -0
  178. package/typewriter-text.d.ts.map +1 -0
  179. package/typewriter-text.js +2 -0
  180. package/typewriter-text.js.map +1 -0
  181. package/{items → web-components/a}/avatar-a.d.ts +7 -7
  182. package/web-components/a/avatar-a.d.ts.map +1 -0
  183. package/{items → web-components/a}/avatar-a.js +57 -62
  184. package/web-components/a/avatar-a.js.map +1 -0
  185. package/{items → web-components/a}/link-a.d.ts +6 -6
  186. package/web-components/a/link-a.d.ts.map +1 -0
  187. package/{items → web-components/a}/link-a.js +16 -21
  188. package/web-components/a/link-a.js.map +1 -0
  189. package/{items → web-components/a}/super-a.d.ts +5 -5
  190. package/web-components/a/super-a.d.ts.map +1 -0
  191. package/{items → web-components/a}/super-a.js +34 -40
  192. package/web-components/a/super-a.js.map +1 -0
  193. package/{items → web-components/button}/base-button.d.ts +3 -3
  194. package/web-components/button/base-button.d.ts.map +1 -0
  195. package/{items → web-components/button}/base-button.js +99 -105
  196. package/web-components/button/base-button.js.map +1 -0
  197. package/{view/rotation-pool.d.ts → web-components/carousel/carousel-slider.d.ts} +7 -7
  198. package/web-components/carousel/carousel-slider.d.ts.map +1 -0
  199. package/{view/rotation-pool.js → web-components/carousel/carousel-slider.js} +87 -92
  200. package/web-components/carousel/carousel-slider.js.map +1 -0
  201. package/{input-form/sign-form.d.ts → web-components/form/base-form.d.ts} +9 -18
  202. package/web-components/form/base-form.d.ts.map +1 -0
  203. package/{input-form/sign-form.js → web-components/form/base-form.js} +32 -40
  204. package/web-components/form/base-form.js.map +1 -0
  205. package/web-components/form/sign-form.d.ts +19 -0
  206. package/web-components/form/sign-form.d.ts.map +1 -0
  207. package/web-components/form/sign-form.js +16 -0
  208. package/web-components/form/sign-form.js.map +1 -0
  209. package/{group → web-components/group}/avatar-group.d.ts +6 -6
  210. package/web-components/group/avatar-group.d.ts.map +1 -0
  211. package/{group → web-components/group}/avatar-group.js +24 -30
  212. package/web-components/group/avatar-group.js.map +1 -0
  213. package/{group → web-components/group}/details-group.d.ts +3 -3
  214. package/web-components/group/details-group.d.ts.map +1 -0
  215. package/{group → web-components/group}/details-group.js +12 -18
  216. package/web-components/group/details-group.js.map +1 -0
  217. package/{group → web-components/group}/tab-group.d.ts +4 -4
  218. package/web-components/group/tab-group.d.ts.map +1 -0
  219. package/{group → web-components/group}/tab-group.js +50 -56
  220. package/web-components/group/tab-group.js.map +1 -0
  221. package/web-components/index.d.ts +38 -0
  222. package/web-components/index.d.ts.map +1 -0
  223. package/web-components/index.js +39 -0
  224. package/web-components/index.js.map +1 -0
  225. package/{input-form → web-components/input}/base-input.d.ts +4 -4
  226. package/web-components/input/base-input.d.ts.map +1 -0
  227. package/{input-form → web-components/input}/base-input.js +79 -84
  228. package/web-components/input/base-input.js.map +1 -0
  229. package/{input-form/std.d.ts → web-components/input/input.d.ts} +4 -16
  230. package/web-components/input/input.d.ts.map +1 -0
  231. package/{input-form/std.js → web-components/input/input.js} +27 -54
  232. package/web-components/input/input.js.map +1 -0
  233. package/{input-form → web-components/input}/label-input.d.ts +4 -4
  234. package/web-components/input/label-input.d.ts.map +1 -0
  235. package/{input-form → web-components/input}/label-input.js +55 -60
  236. package/web-components/input/label-input.js.map +1 -0
  237. package/{input-form → web-components/input}/search-input.d.ts +4 -4
  238. package/web-components/input/search-input.d.ts.map +1 -0
  239. package/{input-form → web-components/input}/search-input.js +59 -64
  240. package/web-components/input/search-input.js.map +1 -0
  241. package/{input-form → web-components/input}/select-input.d.ts +4 -4
  242. package/web-components/input/select-input.d.ts.map +1 -0
  243. package/{input-form → web-components/input}/select-input.js +95 -100
  244. package/web-components/input/select-input.js.map +1 -0
  245. package/{input-form → web-components/input}/split-input.d.ts +4 -4
  246. package/web-components/input/split-input.d.ts.map +1 -0
  247. package/{input-form → web-components/input}/split-input.js +56 -61
  248. package/web-components/input/split-input.js.map +1 -0
  249. package/{input-form → web-components/input}/switch-input.d.ts +4 -4
  250. package/web-components/input/switch-input.d.ts.map +1 -0
  251. package/{input-form → web-components/input}/switch-input.js +42 -47
  252. package/web-components/input/switch-input.js.map +1 -0
  253. package/{items → web-components/items}/alert-item.d.ts +3 -3
  254. package/web-components/items/alert-item.d.ts.map +1 -0
  255. package/{items → web-components/items}/alert-item.js +38 -43
  256. package/web-components/items/alert-item.js.map +1 -0
  257. package/{items → web-components/items}/card-item.d.ts +4 -4
  258. package/web-components/items/card-item.d.ts.map +1 -0
  259. package/{items → web-components/items}/card-item.js +57 -63
  260. package/web-components/items/card-item.js.map +1 -0
  261. package/{layout → web-components/items}/drag-box.d.ts +3 -3
  262. package/web-components/items/drag-box.d.ts.map +1 -0
  263. package/{layout → web-components/items}/drag-box.js +13 -19
  264. package/web-components/items/drag-box.js.map +1 -0
  265. package/web-components/items/index.d.ts +5 -0
  266. package/web-components/items/index.d.ts.map +1 -0
  267. package/web-components/items/index.js +6 -0
  268. package/web-components/items/index.js.map +1 -0
  269. package/{items → web-components/items}/time-bar.d.ts +3 -3
  270. package/web-components/items/time-bar.d.ts.map +1 -0
  271. package/{items → web-components/items}/time-bar.js +12 -17
  272. package/web-components/items/time-bar.js.map +1 -0
  273. package/web-components/layout/divider-line.d.ts +20 -0
  274. package/web-components/layout/divider-line.d.ts.map +1 -0
  275. package/{layout/div-line.js → web-components/layout/divider-line.js} +24 -30
  276. package/web-components/layout/divider-line.js.map +1 -0
  277. package/{layout → web-components/layout}/flex-flow.d.ts +3 -3
  278. package/web-components/layout/flex-flow.d.ts.map +1 -0
  279. package/{layout → web-components/layout}/flex-flow.js +12 -18
  280. package/web-components/layout/flex-flow.js.map +1 -0
  281. package/web-components/layout/index.d.ts +5 -0
  282. package/web-components/layout/index.d.ts.map +1 -0
  283. package/web-components/layout/index.js +6 -0
  284. package/web-components/layout/index.js.map +1 -0
  285. package/{layout → web-components/layout}/nav-aside.d.ts +4 -4
  286. package/web-components/layout/nav-aside.d.ts.map +1 -0
  287. package/{layout → web-components/layout}/nav-aside.js +19 -25
  288. package/web-components/layout/nav-aside.js.map +1 -0
  289. package/{layout → web-components/layout}/nav-layout.d.ts +4 -4
  290. package/web-components/layout/nav-layout.d.ts.map +1 -0
  291. package/{layout → web-components/layout}/nav-layout.js +31 -37
  292. package/web-components/layout/nav-layout.js.map +1 -0
  293. package/{items/load-progress.d.ts → web-components/loading/loading-progress.d.ts} +7 -7
  294. package/web-components/loading/loading-progress.d.ts.map +1 -0
  295. package/{items/load-progress.js → web-components/loading/loading-progress.js} +41 -47
  296. package/web-components/loading/loading-progress.js.map +1 -0
  297. package/{layout → web-components/loading}/skeleton-screen.d.ts +4 -4
  298. package/web-components/loading/skeleton-screen.d.ts.map +1 -0
  299. package/{layout → web-components/loading}/skeleton-screen.js +24 -30
  300. package/web-components/loading/skeleton-screen.js.map +1 -0
  301. package/{view/details-expand.d.ts → web-components/open/open-details.d.ts} +8 -8
  302. package/web-components/open/open-details.d.ts.map +1 -0
  303. package/{view/details-expand.js → web-components/open/open-details.js} +35 -40
  304. package/web-components/open/open-details.js.map +1 -0
  305. package/{items/dialog-item.d.ts → web-components/open/open-dialog.d.ts} +8 -8
  306. package/web-components/open/open-dialog.d.ts.map +1 -0
  307. package/{items/dialog-item.js → web-components/open/open-dialog.js} +83 -89
  308. package/web-components/open/open-dialog.js.map +1 -0
  309. package/web-components/open/open-list.d.ts +20 -0
  310. package/web-components/open/open-list.d.ts.map +1 -0
  311. package/web-components/open/open-list.js +71 -0
  312. package/web-components/open/open-list.js.map +1 -0
  313. package/{view/offset-expand.d.ts → web-components/open/open-offset.d.ts} +8 -8
  314. package/web-components/open/open-offset.d.ts.map +1 -0
  315. package/{view/offset-expand.js → web-components/open/open-offset.js} +66 -71
  316. package/web-components/open/open-offset.js.map +1 -0
  317. package/web-components/open/open-tooltip.d.ts +24 -0
  318. package/web-components/open/open-tooltip.d.ts.map +1 -0
  319. package/{view/tool-tip.js → web-components/open/open-tooltip.js} +28 -33
  320. package/web-components/open/open-tooltip.js.map +1 -0
  321. package/{view/std.d.ts → web-components/open/open.d.ts} +6 -6
  322. package/web-components/open/open.d.ts.map +1 -0
  323. package/{view/std.js → web-components/open/open.js} +35 -40
  324. package/web-components/open/open.js.map +1 -0
  325. package/{effect → web-components/text}/clip-text.d.ts +4 -4
  326. package/web-components/text/clip-text.d.ts.map +1 -0
  327. package/web-components/text/clip-text.js +44 -0
  328. package/web-components/text/clip-text.js.map +1 -0
  329. package/{effect → web-components/text}/overbreath-text.d.ts +4 -4
  330. package/web-components/text/overbreath-text.d.ts.map +1 -0
  331. package/{effect → web-components/text}/overbreath-text.js +21 -27
  332. package/web-components/text/overbreath-text.js.map +1 -0
  333. package/{effect → web-components/text}/typewriter-text.d.ts +4 -4
  334. package/web-components/text/typewriter-text.d.ts.map +1 -0
  335. package/{effect → web-components/text}/typewriter-text.js +38 -44
  336. package/web-components/text/typewriter-text.js.map +1 -0
  337. package/{view → web-components/view}/route-view.d.ts +4 -4
  338. package/web-components/view/route-view.d.ts.map +1 -0
  339. package/{view → web-components/view}/route-view.js +15 -20
  340. package/web-components/view/route-view.js.map +1 -0
  341. package/{view → web-components/view}/scroll-x.d.ts +2 -2
  342. package/web-components/view/scroll-x.d.ts.map +1 -0
  343. package/{view → web-components/view}/scroll-x.js +35 -40
  344. package/web-components/view/scroll-x.js.map +1 -0
  345. package/{view/with-wrap.d.ts → web-components/view/wrap-view.d.ts} +7 -7
  346. package/web-components/view/wrap-view.d.ts.map +1 -0
  347. package/{view/with-wrap.js → web-components/view/wrap-view.js} +29 -34
  348. package/web-components/view/wrap-view.js.map +1 -0
  349. package/wrap-view.d.ts +2 -0
  350. package/wrap-view.d.ts.map +1 -0
  351. package/wrap-view.js +2 -0
  352. package/wrap-view.js.map +1 -0
  353. package/effect/clip-text.d.ts.map +0 -1
  354. package/effect/clip-text.js +0 -50
  355. package/effect/clip-text.js.map +0 -1
  356. package/effect/index.d.ts +0 -4
  357. package/effect/index.d.ts.map +0 -1
  358. package/effect/index.js +0 -4
  359. package/effect/index.js.map +0 -1
  360. package/effect/overbreath-text.d.ts.map +0 -1
  361. package/effect/overbreath-text.js.map +0 -1
  362. package/effect/std.d.ts +0 -4
  363. package/effect/std.d.ts.map +0 -1
  364. package/effect/std.js +0 -4
  365. package/effect/std.js.map +0 -1
  366. package/effect/typewriter-text.d.ts.map +0 -1
  367. package/effect/typewriter-text.js.map +0 -1
  368. package/group/avatar-group.d.ts.map +0 -1
  369. package/group/avatar-group.js.map +0 -1
  370. package/group/details-group.d.ts.map +0 -1
  371. package/group/details-group.js.map +0 -1
  372. package/group/index.d.ts +0 -4
  373. package/group/index.d.ts.map +0 -1
  374. package/group/index.js +0 -4
  375. package/group/index.js.map +0 -1
  376. package/group/std.d.ts +0 -4
  377. package/group/std.d.ts.map +0 -1
  378. package/group/std.js +0 -4
  379. package/group/std.js.map +0 -1
  380. package/group/tab-group.d.ts.map +0 -1
  381. package/group/tab-group.js.map +0 -1
  382. package/input-form/base-input.d.ts.map +0 -1
  383. package/input-form/base-input.js.map +0 -1
  384. package/input-form/index.d.ts +0 -8
  385. package/input-form/index.d.ts.map +0 -1
  386. package/input-form/index.js +0 -8
  387. package/input-form/index.js.map +0 -1
  388. package/input-form/label-input.d.ts.map +0 -1
  389. package/input-form/label-input.js.map +0 -1
  390. package/input-form/search-input.d.ts.map +0 -1
  391. package/input-form/search-input.js.map +0 -1
  392. package/input-form/select-input.d.ts.map +0 -1
  393. package/input-form/select-input.js.map +0 -1
  394. package/input-form/sign-form.d.ts.map +0 -1
  395. package/input-form/sign-form.js.map +0 -1
  396. package/input-form/split-input.d.ts.map +0 -1
  397. package/input-form/split-input.js.map +0 -1
  398. package/input-form/std.d.ts.map +0 -1
  399. package/input-form/std.js.map +0 -1
  400. package/input-form/switch-input.d.ts.map +0 -1
  401. package/input-form/switch-input.js.map +0 -1
  402. package/items/alert-item.d.ts.map +0 -1
  403. package/items/alert-item.js.map +0 -1
  404. package/items/avatar-a.d.ts.map +0 -1
  405. package/items/avatar-a.js.map +0 -1
  406. package/items/base-button.d.ts.map +0 -1
  407. package/items/base-button.js.map +0 -1
  408. package/items/card-item.d.ts.map +0 -1
  409. package/items/card-item.js.map +0 -1
  410. package/items/dialog-item.d.ts.map +0 -1
  411. package/items/dialog-item.js.map +0 -1
  412. package/items/index.d.ts +0 -10
  413. package/items/index.d.ts.map +0 -1
  414. package/items/index.js +0 -10
  415. package/items/index.js.map +0 -1
  416. package/items/link-a.d.ts.map +0 -1
  417. package/items/link-a.js.map +0 -1
  418. package/items/load-progress.d.ts.map +0 -1
  419. package/items/load-progress.js.map +0 -1
  420. package/items/std.d.ts +0 -4
  421. package/items/std.d.ts.map +0 -1
  422. package/items/std.js +0 -4
  423. package/items/std.js.map +0 -1
  424. package/items/super-a.d.ts.map +0 -1
  425. package/items/super-a.js.map +0 -1
  426. package/items/time-bar.d.ts.map +0 -1
  427. package/items/time-bar.js.map +0 -1
  428. package/layout/div-line.d.ts +0 -20
  429. package/layout/div-line.d.ts.map +0 -1
  430. package/layout/div-line.js.map +0 -1
  431. package/layout/drag-box.d.ts.map +0 -1
  432. package/layout/drag-box.js.map +0 -1
  433. package/layout/flex-flow.d.ts.map +0 -1
  434. package/layout/flex-flow.js.map +0 -1
  435. package/layout/index.d.ts +0 -7
  436. package/layout/index.d.ts.map +0 -1
  437. package/layout/index.js +0 -7
  438. package/layout/index.js.map +0 -1
  439. package/layout/nav-aside.d.ts.map +0 -1
  440. package/layout/nav-aside.js.map +0 -1
  441. package/layout/nav-layout.d.ts.map +0 -1
  442. package/layout/nav-layout.js.map +0 -1
  443. package/layout/skeleton-screen.d.ts.map +0 -1
  444. package/layout/skeleton-screen.js.map +0 -1
  445. package/layout/std.d.ts +0 -4
  446. package/layout/std.d.ts.map +0 -1
  447. package/layout/std.js +0 -4
  448. package/layout/std.js.map +0 -1
  449. package/react/effect.d.ts +0 -5
  450. package/react/effect.d.ts.map +0 -1
  451. package/react/effect.js +0 -13
  452. package/react/effect.js.map +0 -1
  453. package/react/group.d.ts +0 -5
  454. package/react/group.d.ts.map +0 -1
  455. package/react/group.js +0 -13
  456. package/react/group.js.map +0 -1
  457. package/react/input-form.d.ts +0 -28
  458. package/react/input-form.d.ts.map +0 -1
  459. package/react/input-form.js +0 -38
  460. package/react/input-form.js.map +0 -1
  461. package/react/items.d.ts +0 -11
  462. package/react/items.d.ts.map +0 -1
  463. package/react/items.js +0 -31
  464. package/react/items.js.map +0 -1
  465. package/react/layout.d.ts +0 -8
  466. package/react/layout.d.ts.map +0 -1
  467. package/react/layout.js +0 -22
  468. package/react/layout.js.map +0 -1
  469. package/react/view.d.ts +0 -10
  470. package/react/view.d.ts.map +0 -1
  471. package/react/view.js +0 -28
  472. package/react/view.js.map +0 -1
  473. package/view/details-expand.d.ts.map +0 -1
  474. package/view/details-expand.js.map +0 -1
  475. package/view/index.d.ts +0 -9
  476. package/view/index.d.ts.map +0 -1
  477. package/view/index.js +0 -9
  478. package/view/index.js.map +0 -1
  479. package/view/menu-list.d.ts +0 -20
  480. package/view/menu-list.d.ts.map +0 -1
  481. package/view/menu-list.js +0 -76
  482. package/view/menu-list.js.map +0 -1
  483. package/view/offset-expand.d.ts.map +0 -1
  484. package/view/offset-expand.js.map +0 -1
  485. package/view/rotation-pool.d.ts.map +0 -1
  486. package/view/rotation-pool.js.map +0 -1
  487. package/view/route-view.d.ts.map +0 -1
  488. package/view/route-view.js.map +0 -1
  489. package/view/scroll-x.d.ts.map +0 -1
  490. package/view/scroll-x.js.map +0 -1
  491. package/view/std.d.ts.map +0 -1
  492. package/view/std.js.map +0 -1
  493. package/view/tool-tip.d.ts +0 -24
  494. package/view/tool-tip.d.ts.map +0 -1
  495. package/view/tool-tip.js.map +0 -1
  496. package/view/with-wrap.d.ts.map +0 -1
  497. package/view/with-wrap.js.map +0 -1
@@ -1,19 +1,14 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { createScope, cssvarValues, define } from "../root.js";
8
- import { css, html, property, query, queryAll } from "../deps.js";
9
- import { InputSTD } from "./std.js";
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";
10
5
  const FOCUS = "focus";
11
6
  const defineName = "split-input";
12
7
  const cssScope = createScope(defineName);
13
8
  /**
14
9
  * SplitInput renders multiple inputs.
15
10
  */
16
- let SplitInput = class SplitInput extends InputSTD {
11
+ let SplitInput = class SplitInput extends InputElement {
17
12
  constructor() {
18
13
  super(...arguments);
19
14
  /**
@@ -27,6 +22,57 @@ let SplitInput = class SplitInput extends InputSTD {
27
22
  this.current = 0;
28
23
  this.currentValue = [];
29
24
  }
25
+ static { this.styles = [
26
+ InputElement.styles,
27
+ css `
28
+ :host {
29
+ ${cssScope}--outline: .15em solid var( ${cssvarValues.input}--outline-color);
30
+ margin: var(${cssvarValues.input}--outline-width);
31
+ width: fit-content;
32
+ border-radius: 1px;
33
+ }
34
+
35
+ * {
36
+ font-size: 1em;
37
+ border-radius: inherit;
38
+ }
39
+
40
+ div {
41
+ vertical-align: top;
42
+ position: relative;
43
+ display: inline-flex;
44
+ gap: 0.25em;
45
+ }
46
+
47
+ span {
48
+ box-sizing: content-box;
49
+ vertical-align: top;
50
+ display: inline-flex;
51
+ width: 1.45em;
52
+ height: 1.45em;
53
+ pointer-events: all;
54
+ }
55
+
56
+ i {
57
+ height: inherit;
58
+ width: 100%;
59
+ z-index: 1;
60
+ background-color: var(${cssvarValues.input}--false);
61
+ text-align: center;
62
+ }
63
+
64
+ input {
65
+ position: absolute;
66
+ opacity: 0;
67
+ left: 0;
68
+ top: 0;
69
+ }
70
+
71
+ .focus i {
72
+ outline: var(${cssScope}--outline);
73
+ }
74
+ `,
75
+ ]; }
30
76
  render() {
31
77
  return html `
32
78
  <div>
@@ -107,57 +153,6 @@ let SplitInput = class SplitInput extends InputSTD {
107
153
  this.dispatchEvent(new CustomEvent("change", { detail: this.value }));
108
154
  }
109
155
  };
110
- SplitInput.styles = [
111
- InputSTD.styles,
112
- css `
113
- :host {
114
- ${cssScope}--outline: .15em solid var( ${cssvarValues.input}--outline-color);
115
- margin: var(${cssvarValues.input}--outline-width);
116
- width: fit-content;
117
- border-radius: 1px;
118
- }
119
-
120
- * {
121
- font-size: 1em;
122
- border-radius: inherit;
123
- }
124
-
125
- div {
126
- vertical-align: top;
127
- position: relative;
128
- display: inline-flex;
129
- gap: 0.25em;
130
- }
131
-
132
- span {
133
- box-sizing: content-box;
134
- vertical-align: top;
135
- display: inline-flex;
136
- width: 1.45em;
137
- height: 1.45em;
138
- pointer-events: all;
139
- }
140
-
141
- i {
142
- height: inherit;
143
- width: 100%;
144
- z-index: 1;
145
- background-color: var(${cssvarValues.input}--false);
146
- text-align: center;
147
- }
148
-
149
- input {
150
- position: absolute;
151
- opacity: 0;
152
- left: 0;
153
- top: 0;
154
- }
155
-
156
- .focus i {
157
- outline: var(${cssScope}--outline);
158
- }
159
- `,
160
- ];
161
156
  __decorate([
162
157
  property({ type: Number })
163
158
  ], SplitInput.prototype, "max", void 0);
@@ -0,0 +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,GAAG,CAAC,CAAC,CAAC;QAIvC,YAAO,GAAG,CAAC,CAAC;QACZ,iBAAY,GAAsB,EAAE,CAAC;IAwIvC,CAAC;aAtIQ,WAAM,GAAG;QACd,YAAY,CAAC,MAAM;QACnB,GAAG,CAAA;;UAEG,QAAQ,+BAA+B,YAAY,CAAC,KAAK;sBAC7C,YAAY,CAAC,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA8BR,YAAY,CAAC,KAAK;;;;;;;;;;;;uBAY3B,QAAQ;;KAE1B;KACgB,AAlDN,CAkDO;IAEV,MAAM;QACd,OAAO,IAAI,CAAA;;UAEL,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;aACd,IAAI,CA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AC;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;;AAhJ2B;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,12 +1,12 @@
1
- import { type CSSResultGroup } from "../deps.js";
2
- import { type HTMLTemplate } from "../lib/templates.js";
3
- import { InputSTD } from "./std.js";
1
+ import { type CSSResultGroup } from "../../deps.js";
2
+ import { type HTMLTemplate } from "../../lib/templates.js";
3
+ import { InputElement } from "./input.js";
4
4
  /**
5
5
  * Switch renders a switch.
6
6
  *
7
7
  * Inspired by Steam.
8
8
  */
9
- export declare class SwitchInput extends InputSTD {
9
+ export declare class SwitchInput extends InputElement {
10
10
  /**
11
11
  * Border style.
12
12
  */
@@ -0,0 +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,13 +1,8 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { createScope, cssvarValues, define } from "../root.js";
8
- import { css, html, property, query } from "../deps.js";
9
- import { htmlSlot } from "../lib/templates.js";
10
- import { InputSTD } from "./std.js";
1
+ import { __decorate } from "tslib";
2
+ import { css, html, property, query } from "../../deps.js";
3
+ import { htmlSlot } from "../../lib/templates.js";
4
+ import { createScope, cssvarValues, define } from "../../root.js";
5
+ import { InputElement } from "./input.js";
11
6
  const defineName = "switch-input";
12
7
  const cssScope = createScope(defineName);
13
8
  /**
@@ -15,7 +10,7 @@ const cssScope = createScope(defineName);
15
10
  *
16
11
  * Inspired by Steam.
17
12
  */
18
- let SwitchInput = class SwitchInput extends InputSTD {
13
+ let SwitchInput = class SwitchInput extends InputElement {
19
14
  constructor() {
20
15
  super(...arguments);
21
16
  /**
@@ -43,41 +38,9 @@ let SwitchInput = class SwitchInput extends InputSTD {
43
38
  */
44
39
  this.value = "on";
45
40
  }
46
- render() {
47
- return html `<span class="${this.base}">
48
- <input @change="${this._handleChange}" ?disabled="${this.disabled}" ?checked="${this.checked}" name="${this.name}" type="checkbox" />
49
- <aside>
50
- <div class="false"><slot name="false"></slot></div>
51
- <div class="always">${htmlSlot()}<slot name="always"></slot></div>
52
- <div class="true"><slot name="true"></slot></div>
53
- </aside>
54
- </span>`;
55
- }
56
- reset() {
57
- this.checked = this.def === "true";
58
- this._input.checked = this.checked;
59
- }
60
- connectedCallback() {
61
- super.connectedCallback();
62
- if (this.checked) {
63
- this.def = "true";
64
- }
65
- else if (this.def === "true") {
66
- this.checked = true;
67
- }
68
- }
69
- _handleChange() {
70
- this.checked = this._input.checked;
71
- this.dispatchEvent(new CustomEvent("input", { detail: this.checked, bubbles: true, composed: true }));
72
- this.dispatchEvent(new CustomEvent("change", { detail: this.checked, composed: true }));
73
- }
74
- namevalue() {
75
- return [this.name, this.checked];
76
- }
77
- };
78
- SwitchInput.styles = [
79
- InputSTD.styles,
80
- css `
41
+ static { this.styles = [
42
+ InputElement.styles,
43
+ css `
81
44
  :host {
82
45
  ${cssScope}--width: 3em;
83
46
  ${cssScope}--height: calc(var(${cssScope}--width) / 2);
@@ -199,7 +162,39 @@ SwitchInput.styles = [
199
162
  display: none;
200
163
  }
201
164
  `,
202
- ];
165
+ ]; }
166
+ render() {
167
+ return html `<span class="${this.base}">
168
+ <input @change="${this._handleChange}" ?disabled="${this.disabled}" ?checked="${this.checked}" name="${this.name}" type="checkbox" />
169
+ <aside>
170
+ <div class="false"><slot name="false"></slot></div>
171
+ <div class="always">${htmlSlot()}<slot name="always"></slot></div>
172
+ <div class="true"><slot name="true"></slot></div>
173
+ </aside>
174
+ </span>`;
175
+ }
176
+ reset() {
177
+ this.checked = this.def === "true";
178
+ this._input.checked = this.checked;
179
+ }
180
+ connectedCallback() {
181
+ super.connectedCallback();
182
+ if (this.checked) {
183
+ this.def = "true";
184
+ }
185
+ else if (this.def === "true") {
186
+ this.checked = true;
187
+ }
188
+ }
189
+ _handleChange() {
190
+ this.checked = this._input.checked;
191
+ this.dispatchEvent(new CustomEvent("input", { detail: this.checked, bubbles: true, composed: true }));
192
+ this.dispatchEvent(new CustomEvent("change", { detail: this.checked, composed: true }));
193
+ }
194
+ namevalue() {
195
+ return [this.name, this.checked];
196
+ }
197
+ };
203
198
  __decorate([
204
199
  property()
205
200
  ], SwitchInput.prototype, "base", void 0);
@@ -0,0 +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;aAhKQ,WAAM,GAAG;QACd,YAAY,CAAC,MAAM;QACnB,GAAG,CAAA;;UAEG,QAAQ;UACR,QAAQ,sBAAsB,QAAQ;qBAC3B,QAAQ;sBACP,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;0BA2BJ,YAAY,CAAC,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;g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QACP,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;;AAvLW;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,5 +1,5 @@
1
- import { type HTMLTemplate } from "../lib/templates.js";
2
- import ItemsSTD from "./std.js";
1
+ import { type HTMLTemplate } from "../../lib/templates.js";
2
+ import { GodownElement } from "../../root.js";
3
3
  declare const colors: {
4
4
  success: string[];
5
5
  info: string[];
@@ -12,7 +12,7 @@ declare const colors: {
12
12
  *
13
13
  * Inspired by Ant-design.
14
14
  */
15
- export declare class AlertItem extends ItemsSTD {
15
+ export declare class AlertItem extends GodownElement {
16
16
  /**
17
17
  * Type of performance.
18
18
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alert-item.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/items/alert-item.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,YAAY,EAAQ,MAAM,wBAAwB,CAAC;AAE3E,OAAO,EAAuB,aAAa,EAAE,MAAM,eAAe,CAAC;AAQnE,QAAA,MAAM,MAAM;;;;;;CAMX,CAAC;AAEF;;;;GAIG;AACH,qBACa,SAAU,SAAQ,aAAa;IAC1C;;OAEG;IACS,IAAI,EAAE,MAAM,OAAO,MAAM,GAAG,MAAM,CAAU;IACxD;;OAEG;IACyB,SAAS,SAAQ;IAC7C;;OAEG;IACS,KAAK,SAAM;IACvB;;OAEG;IACS,OAAO,SAAM;IAEzB,MAAM,CAAC,MAAM,4BA0EX;IAEF,SAAS,CAAC,MAAM,IAAI,YAAY;IAahC,KAAK;IAOL,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS;CAMvE;AAED,eAAe,SAAS,CAAC;AACzB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
@@ -1,15 +1,9 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
1
  var AlertItem_1;
8
- import { createScope, define } from "../root.js";
9
- import { css, html, property, unsafeCSS } from "../deps.js";
10
- import { htmlSlot, svgX } from "../lib/templates.js";
11
- import { constructCSS } from "../lib/utils.js";
12
- import ItemsSTD from "./std.js";
2
+ import { __decorate } from "tslib";
3
+ import { css, html, property, unsafeCSS } from "../../deps.js";
4
+ import { htmlSlot, svgX } from "../../lib/templates.js";
5
+ import { constructCSS } from "../../lib/utils.js";
6
+ import { createScope, define, GodownElement } from "../../root.js";
13
7
  const defineName = "alert-item";
14
8
  const cssvarScope = createScope(defineName);
15
9
  const currentColor = "currentColor";
@@ -26,7 +20,7 @@ const colors = {
26
20
  *
27
21
  * Inspired by Ant-design.
28
22
  */
29
- let AlertItem = AlertItem_1 = class AlertItem extends ItemsSTD {
23
+ let AlertItem = class AlertItem extends GodownElement {
30
24
  constructor() {
31
25
  super(...arguments);
32
26
  /**
@@ -46,36 +40,12 @@ let AlertItem = AlertItem_1 = class AlertItem extends ItemsSTD {
46
40
  */
47
41
  this.content = "";
48
42
  }
49
- render() {
50
- if (this.autoclose) {
51
- setTimeout(() => this.close(), this.autoclose);
52
- }
53
- return html `<main class="${this.call} alert">
54
- <div>
55
- <strong> ${this.title || htmlSlot("title")}</strong>
56
- ${this.content || htmlSlot()}
57
- </div>
58
- <aside class="close" @click="${this.close}">${htmlSlot("close", svgX(), this)}</aside>
59
- </main>`;
60
- }
61
- close() {
62
- this.shadowRoot.querySelector(".alert").classList.add("hide");
63
- setTimeout(() => {
64
- this.remove();
65
- }, 250);
66
- }
67
- static alert(root, option) {
68
- const ai = new AlertItem_1();
69
- Object.assign(ai, option);
70
- root.appendChild(ai);
71
- return ai;
72
- }
73
- };
74
- AlertItem.styles = [
75
- unsafeCSS(constructCSS(vars, colors, (raw) => {
76
- return `.${raw}`;
77
- })),
78
- css `
43
+ static { AlertItem_1 = this; }
44
+ static { this.styles = [
45
+ unsafeCSS(constructCSS(vars, colors, (raw) => {
46
+ return `.${raw}`;
47
+ })),
48
+ css `
79
49
  :host {
80
50
  ${cssvarScope}--padding: .05em .25em .05em .35em;
81
51
  ${cssvarScope}--border-width: 0.15em;
@@ -143,7 +113,32 @@ AlertItem.styles = [
143
113
  stroke: var(${cssvarScope}--color);
144
114
  }
145
115
  `,
146
- ];
116
+ ]; }
117
+ render() {
118
+ if (this.autoclose) {
119
+ setTimeout(() => this.close(), this.autoclose);
120
+ }
121
+ return html `<main class="${this.call} alert">
122
+ <div>
123
+ <strong> ${this.title || htmlSlot("title")}</strong>
124
+ ${this.content || htmlSlot()}
125
+ </div>
126
+ <aside class="close" @click="${this.close}">${htmlSlot("close", svgX(), this)}</aside>
127
+ </main>`;
128
+ }
129
+ close() {
130
+ this.shadowRoot.querySelector(".alert").classList.add("hide");
131
+ setTimeout(() => {
132
+ this.remove();
133
+ }, 250);
134
+ }
135
+ static alert(root, option) {
136
+ const ai = new AlertItem_1();
137
+ Object.assign(ai, option);
138
+ root.appendChild(ai);
139
+ return ai;
140
+ }
141
+ };
147
142
  __decorate([
148
143
  property()
149
144
  ], AlertItem.prototype, "call", void 0);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alert-item.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/items/alert-item.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAqB,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnE,MAAM,UAAU,GAAG,YAAY,CAAC;AAChC,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C,MAAM,YAAY,GAAG,cAAc,CAAC;AAEpC,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,WAAW,KAAK,CAAC,EAAE,CAAC,CAAC;AAC3F,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;IACrD,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;IAClD,OAAO,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;IACrD,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;IACpD,OAAO,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,CAAC;CAC/D,CAAC;AAEF;;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,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,CAAC,EAAE,GAAG,CAAC,CAAC;IACV,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,IAAiB,EAAE,MAA0B;QACxD,MAAM,EAAE,GAAG,IAAI,WAAS,EAAE,CAAC;QAC3B,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAC1B,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QACrB,OAAO,EAAE,CAAC;IACZ,CAAC;;AAnHW;IAAX,QAAQ,EAAE;uCAA6C;AAI5B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAkB;AAIjC;IAAX,QAAQ,EAAE;wCAAY;AAIX;IAAX,QAAQ,EAAE;0CAAc;AAhBd,SAAS;IADrB,MAAM,CAAC,UAAU,CAAC;GACN,SAAS,CAwHrB;;AAED,eAAe,SAAS,CAAC","sourcesContent":["import { css, html, property, unsafeCSS } from \"../../deps.js\";\nimport { htmlSlot, type HTMLTemplate, svgX } from \"../../lib/templates.js\";\nimport { constructCSS } from \"../../lib/utils.js\";\nimport { createScope, define, GodownElement } from \"../../root.js\";\n\nconst defineName = \"alert-item\";\nconst cssvarScope = createScope(defineName);\n\nconst currentColor = \"currentColor\";\n\nconst vars = [\"color\", \"background\", \"border\", \"super\"].map((v) => `${cssvarScope}--${v}`);\nconst colors = {\n success: [\"#3c763d\", \"#dff0d8\", \"#d6e9c6\", \"#2b542c\"],\n info: [\"#31708f\", \"#d9edf7\", \"#bce8f1\", \"#245269\"],\n warning: [\"#8a6d3b\", \"#fcf8e3\", \"#faebcc\", \"#66512c\"],\n danger: [\"#a94442\", \"#f2dede\", \"#ebccd1\", \"#843534\"],\n inherit: [currentColor, \"inherit\", currentColor, currentColor],\n};\n\n/**\n * AlertItem renders a alert.\n *\n * Inspired by Ant-design.\n */\n@define(defineName)\nexport class AlertItem extends GodownElement {\n /**\n * Type of performance.\n */\n @property() call: keyof typeof colors | \"hide\" = \"info\";\n /**\n * Close delay.\n */\n @property({ type: Number }) autoclose = 3000;\n /**\n * Alert title.\n */\n @property() title = \"\";\n /**\n * Alert content.\n */\n @property() content = \"\";\n\n static styles = [\n unsafeCSS(\n constructCSS(vars, colors, (raw) => {\n return `.${raw}`;\n }),\n ),\n css`\n :host {\n ${cssvarScope}--padding: .05em .25em .05em .35em;\n ${cssvarScope}--border-width: 0.15em;\n ${cssvarScope}--border-radius: 0.4em;\n border-radius: var(${cssvarScope}--border-radius);\n margin: 0 auto;\n display: block;\n }\n\n .hide {\n opacity: 0;\n transform: translateY(-100%);\n }\n\n .alert {\n transition: 0.25s;\n display: flex;\n justify-content: space-between;\n padding: var(${cssvarScope}--padding);\n border-radius: inherit;\n border: var(${cssvarScope}--border-width) solid var(${cssvarScope}--border);\n color: var(${cssvarScope}--color);\n background: var(${cssvarScope}--background);\n animation: alert 0.25s ease-in-out;\n }\n\n @keyframes alert {\n 0% {\n opacity: 0;\n transform: translateY(-50%);\n }\n 100% {\n opacity: 1;\n transform: none;\n }\n }\n\n div {\n min-height: 1.5em;\n line-height: 1.5em;\n }\n\n .close {\n height: fit-content;\n width: fit-content;\n border-radius: 50%;\n transition: inherit;\n }\n\n .close:hover {\n backdrop-filter: contrast(115%);\n }\n\n svg {\n display: block;\n height: 1.6em;\n width: 1.6em;\n }\n\n .close:hover path {\n stroke: var(${cssvarScope}--super);\n }\n\n path {\n stroke: var(${cssvarScope}--color);\n }\n `,\n ];\n\n protected render(): HTMLTemplate {\n if (this.autoclose) {\n setTimeout(() => this.close(), this.autoclose);\n }\n return html`<main class=\"${this.call} alert\">\n <div>\n <strong> ${this.title || htmlSlot(\"title\")}</strong>\n ${this.content || htmlSlot()}\n </div>\n <aside class=\"close\" @click=\"${this.close}\">${htmlSlot(\"close\", svgX(), this)}</aside>\n </main>`;\n }\n\n close() {\n this.shadowRoot.querySelector(\".alert\").classList.add(\"hide\");\n setTimeout(() => {\n this.remove();\n }, 250);\n }\n\n static alert(root: HTMLElement, option: Partial<AlertItem>): AlertItem {\n const ai = new AlertItem();\n Object.assign(ai, option);\n root.appendChild(ai);\n return ai;\n }\n}\n\nexport default AlertItem;\ndeclare global {\n interface HTMLElementTagNameMap {\n \"alert-item\": AlertItem;\n }\n}\n"]}
@@ -1,10 +1,10 @@
1
- import { type CSSResultGroup } from "../deps.js";
2
- import { type HTMLTemplate } from "../lib/templates.js";
3
- import ItemsSTD from "./std.js";
1
+ import { type CSSResultGroup } from "../../deps.js";
2
+ import { type HTMLTemplate } from "../../lib/templates.js";
3
+ import { GodownElement } from "../../root.js";
4
4
  /**
5
5
  * CardItem renders a card.
6
6
  */
7
- export declare class CardItem extends ItemsSTD {
7
+ export declare class CardItem extends GodownElement {
8
8
  /**
9
9
  * Enable rotate.
10
10
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card-item.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/items/card-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,cAAc,EAAyB,MAAM,eAAe,CAAC;AAEhF,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAqC,aAAa,EAAE,MAAM,eAAe,CAAC;AAKjF;;GAEG;AACH,qBACa,QAAS,SAAQ,aAAa;IACzC;;OAEG;IAC0B,MAAM,UAAS;IAE7B,SAAS,CAAC,KAAK,EAAG,WAAW,CAAC;IAC7B,SAAS,CAAC,MAAM,EAAG,WAAW,CAAC;IAE/C,MAAM,CAAC,MAAM,iBAoEO;IAEpB,SAAS,CAAC,MAAM,IAAI,YAAY;IAyBhC,SAAS,CAAC,YAAY;IAOtB;;OAEG;IACH,KAAK;IAKL;;;OAGG;IACH,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,UAAU;CAWpC;AAED,eAAe,QAAQ,CAAC;AAExB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
@@ -1,20 +1,14 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { createScope, cssvarValues, define } from "../root.js";
8
- import { css, html, property, query } from "../deps.js";
9
- import { htmlSlot } from "../lib/templates.js";
10
- import { ifValue } from "../lib/directives.js";
11
- import ItemsSTD from "./std.js";
1
+ import { __decorate } from "tslib";
2
+ import { css, html, property, query } from "../../deps.js";
3
+ import { ifValue } from "../../lib/directives.js";
4
+ import { htmlSlot } from "../../lib/templates.js";
5
+ import { createScope, cssvarValues, define, GodownElement } from "../../root.js";
12
6
  const defineName = "card-item";
13
7
  const cssvarScope = createScope(defineName);
14
8
  /**
15
9
  * CardItem renders a card.
16
10
  */
17
- let CardItem = class CardItem extends ItemsSTD {
11
+ let CardItem = class CardItem extends GodownElement {
18
12
  constructor() {
19
13
  super(...arguments);
20
14
  /**
@@ -22,56 +16,9 @@ let CardItem = class CardItem extends ItemsSTD {
22
16
  */
23
17
  this.rotate = false;
24
18
  }
25
- render() {
26
- const HEADER = "header";
27
- const FOOTER = "footer";
28
- return html `<div>
29
- <aside></aside>
30
- <main>
31
- ${ifValue(this.querySlot(HEADER), html `
32
- ${htmlSlot(HEADER)}
33
- <hr />
34
- `)}
35
- ${htmlSlot()}
36
- ${ifValue(this.querySlot(FOOTER), html `
37
- <hr />
38
- ${htmlSlot(FOOTER)}
39
- `)}
40
- </main>
41
- </div>`;
42
- }
43
- firstUpdated() {
44
- if (this.rotate) {
45
- this.addEvent(this._main, "mousemove", this._drawRotate.bind(this));
46
- this.addEvent(this._aside, "mouseleave", this.reset.bind(this));
47
- }
48
- }
49
- /**
50
- * Cancel the aside offset.
51
- */
52
- reset() {
53
- this._main.style.transition = ".5s";
54
- this._main.style.transform = "none";
55
- }
56
- /**
57
- * Offset aside.
58
- * @param e Mouse move event.
59
- */
60
- _drawRotate(e) {
61
- const { left, top, width, height } = this._main.getBoundingClientRect();
62
- const { clientX, clientY } = e;
63
- const offsetX = clientX - left;
64
- const offsetY = clientY - top;
65
- const rotate = 30;
66
- const rotateX = -(rotate * (offsetY - height / 2)) / height / 1.5;
67
- const rotateY = (rotate * (offsetX - width / 2)) / width / 1.5;
68
- this._main.style.transform = `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`;
69
- this._main.style.transition = "none";
70
- }
71
- };
72
- CardItem.styles = [
73
- ItemsSTD.styles,
74
- css `
19
+ static { this.styles = [
20
+ GodownElement.styles,
21
+ css `
75
22
  :host {
76
23
  ${cssvarScope}--offset: .25em;
77
24
  ${cssvarScope}--background: var(${cssvarValues.main});
@@ -137,7 +84,54 @@ CardItem.styles = [
137
84
  padding: var(${cssvarScope}--padding);
138
85
  }
139
86
  `,
140
- ];
87
+ ]; }
88
+ render() {
89
+ const HEADER = "header";
90
+ const FOOTER = "footer";
91
+ return html `<div>
92
+ <aside></aside>
93
+ <main>
94
+ ${ifValue(this.querySlot(HEADER), html `
95
+ ${htmlSlot(HEADER)}
96
+ <hr />
97
+ `)}
98
+ ${htmlSlot()}
99
+ ${ifValue(this.querySlot(FOOTER), html `
100
+ <hr />
101
+ ${htmlSlot(FOOTER)}
102
+ `)}
103
+ </main>
104
+ </div>`;
105
+ }
106
+ firstUpdated() {
107
+ if (this.rotate) {
108
+ this.addEvent(this._main, "mousemove", this._drawRotate.bind(this));
109
+ this.addEvent(this._aside, "mouseleave", this.reset.bind(this));
110
+ }
111
+ }
112
+ /**
113
+ * Cancel the aside offset.
114
+ */
115
+ reset() {
116
+ this._main.style.transition = ".5s";
117
+ this._main.style.transform = "none";
118
+ }
119
+ /**
120
+ * Offset aside.
121
+ * @param e Mouse move event.
122
+ */
123
+ _drawRotate(e) {
124
+ const { left, top, width, height } = this._main.getBoundingClientRect();
125
+ const { clientX, clientY } = e;
126
+ const offsetX = clientX - left;
127
+ const offsetY = clientY - top;
128
+ const rotate = 30;
129
+ const rotateX = -(rotate * (offsetY - height / 2)) / height / 1.5;
130
+ const rotateY = (rotate * (offsetX - width / 2)) / width / 1.5;
131
+ this._main.style.transform = `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`;
132
+ this._main.style.transition = "none";
133
+ }
134
+ };
141
135
  __decorate([
142
136
  property({ type: Boolean })
143
137
  ], CardItem.prototype, "rotate", void 0);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card-item.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/items/card-item.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,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEjF,MAAM,UAAU,GAAG,WAAW,CAAC;AAC/B,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C;;GAEG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,aAAa;IAApC;;QACL;;WAEG;QAC0B,WAAM,GAAG,KAAK,CAAC;IAkI9C,CAAC;aA7HQ,WAAM,GAAG;QACd,aAAa,CAAC,MAAM;QACpB,GAAG,CAAA;;UAEG,WAAW;UACX,WAAW,qBAAqB,YAAY,CAAC,IAAI;UACjD,WAAW;UACX,WAAW;UACX,WAAW,wCAAwC,YAAY,CAAC,OAAO;UACvE,WAAW;UAC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AI,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC;QACxE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAC/B,MAAM,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC;QAC/B,MAAM,OAAO,GAAG,OAAO,GAAG,GAAG,CAAC;QAC9B,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,OAAO,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC;QAClE,MAAM,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC;QAC/D,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,GAAG,WAAW,OAAO,gBAAgB,OAAO,MAAM,CAAC;QAC7E,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,GAAG,MAAM,CAAC;IACvC,CAAC;;AAjI4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCAAgB;AAEnB;IAAxB,KAAK,CAAC,MAAM,CAAC;uCAA+B;AACnB;IAAzB,KAAK,CAAC,OAAO,CAAC;wCAAgC;AAPpC,QAAQ;IADpB,MAAM,CAAC,UAAU,CAAC;GACN,QAAQ,CAsIpB;;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, property, query } from \"../../deps.js\";\nimport { ifValue } from \"../../lib/directives.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { createScope, cssvarValues, define, GodownElement } from \"../../root.js\";\n\nconst defineName = \"card-item\";\nconst cssvarScope = createScope(defineName);\n\n/**\n * CardItem renders a card.\n */\n@define(defineName)\nexport class CardItem extends GodownElement {\n /**\n * Enable rotate.\n */\n @property({ type: Boolean }) rotate = false;\n\n @query(\"main\") protected _main!: HTMLElement;\n @query(\"aside\") protected _aside!: HTMLElement;\n\n static styles = [\n GodownElement.styles,\n css`\n :host {\n ${cssvarScope}--offset: .25em;\n ${cssvarScope}--background: var(${cssvarValues.main});\n ${cssvarScope}--wapper-background: none;\n ${cssvarScope}--outline: 0;\n ${cssvarScope}--box-shadow: 0 .05em .4em 0 rgb(var(${cssvarValues.mainRGB}) / 60%);\n ${cssvarScope}--hr-width: 100%;\n ${cssvarScope}--hr-height: .05em;\n ${cssvarScope}--padding: .75em;\n margin: auto;\n display: block;\n width: fit-content;\n color: var(${cssvarValues.text});\n border-radius: 0.2em;\n }\n\n * {\n border-radius: inherit;\n min-height: inherit;\n min-width: inherit;\n }\n\n main {\n outline: var(${cssvarScope}--outline);\n box-shadow: var(${cssvarScope}--box-shadow);\n background: var(${cssvarScope}--background);\n z-index: 2;\n position: relative;\n }\n\n aside {\n box-sizing: content-box;\n z-index: 0;\n height: 100%;\n width: 100%;\n position: absolute;\n background: var(${cssvarScope}--wapper-background);\n filter: blur(1em);\n padding: var(${cssvarScope}--offset);\n margin: calc(-1 * var(${cssvarScope}--offset));\n }\n\n div {\n width: fit-content;\n position: relative;\n }\n\n i {\n position: absolute;\n }\n\n hr {\n width: var(${cssvarScope}--hr-width);\n height: var(${cssvarScope}--hr-height);\n margin: auto;\n display: block;\n background: currentColor;\n opacity: 0.5;\n }\n\n slot {\n display: block;\n padding: var(${cssvarScope}--padding);\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n const HEADER = \"header\";\n const FOOTER = \"footer\";\n return html`<div>\n <aside></aside>\n <main>\n ${ifValue(\n this.querySlot(HEADER) as unknown as boolean,\n html`\n ${htmlSlot(HEADER)}\n <hr />\n `,\n )}\n ${htmlSlot()}\n ${ifValue(\n this.querySlot(FOOTER) as unknown as boolean,\n html`\n <hr />\n ${htmlSlot(FOOTER)}\n `,\n )}\n </main>\n </div>`;\n }\n\n protected firstUpdated() {\n if (this.rotate) {\n this.addEvent(this._main, \"mousemove\", this._drawRotate.bind(this));\n this.addEvent(this._aside, \"mouseleave\", this.reset.bind(this));\n }\n }\n\n /**\n * Cancel the aside offset.\n */\n reset() {\n this._main.style.transition = \".5s\";\n this._main.style.transform = \"none\";\n }\n\n /**\n * Offset aside.\n * @param e Mouse move event.\n */\n protected _drawRotate(e: MouseEvent) {\n const { left, top, width, height } = this._main.getBoundingClientRect();\n const { clientX, clientY } = e;\n const offsetX = clientX - left;\n const offsetY = clientY - top;\n const rotate = 30;\n const rotateX = -(rotate * (offsetY - height / 2)) / height / 1.5;\n const rotateY = (rotate * (offsetX - width / 2)) / width / 1.5;\n this._main.style.transform = `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`;\n this._main.style.transition = \"none\";\n }\n}\n\nexport default CardItem;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"card-item\": CardItem;\n }\n}\n"]}