godown 3.0.0-canary.0 → 3.0.0-canary.10

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 (431) hide show
  1. package/README.md +37 -8
  2. package/components/alert.d.ts +5 -3
  3. package/components/alert.d.ts.map +1 -1
  4. package/components/alert.js +24 -14
  5. package/components/alert.js.map +1 -1
  6. package/components/avatar.d.ts +5 -1
  7. package/components/avatar.d.ts.map +1 -1
  8. package/components/avatar.js +7 -3
  9. package/components/avatar.js.map +1 -1
  10. package/components/breath.d.ts +2 -1
  11. package/components/breath.d.ts.map +1 -1
  12. package/components/breath.js +5 -4
  13. package/components/breath.js.map +1 -1
  14. package/components/button.d.ts +16 -9
  15. package/components/button.d.ts.map +1 -1
  16. package/components/button.js +22 -20
  17. package/components/button.js.map +1 -1
  18. package/components/card.d.ts +1 -2
  19. package/components/card.d.ts.map +1 -1
  20. package/components/card.js +5 -11
  21. package/components/card.js.map +1 -1
  22. package/components/carousel.d.ts +6 -5
  23. package/components/carousel.d.ts.map +1 -1
  24. package/components/carousel.js +3 -2
  25. package/components/carousel.js.map +1 -1
  26. package/components/details.d.ts +5 -2
  27. package/components/details.d.ts.map +1 -1
  28. package/components/details.js +5 -2
  29. package/components/details.js.map +1 -1
  30. package/components/dialog.d.ts +8 -4
  31. package/components/dialog.d.ts.map +1 -1
  32. package/components/dialog.js +17 -12
  33. package/components/dialog.js.map +1 -1
  34. package/components/divider.d.ts +1 -1
  35. package/components/divider.js +1 -1
  36. package/components/divider.js.map +1 -1
  37. package/components/dragbox.d.ts +7 -7
  38. package/components/dragbox.d.ts.map +1 -1
  39. package/components/dragbox.js +1 -1
  40. package/components/dragbox.js.map +1 -1
  41. package/components/flex.d.ts +2 -1
  42. package/components/flex.d.ts.map +1 -1
  43. package/components/flex.js +8 -0
  44. package/components/flex.js.map +1 -1
  45. package/components/form.d.ts +0 -2
  46. package/components/form.d.ts.map +1 -1
  47. package/components/form.js +0 -2
  48. package/components/form.js.map +1 -1
  49. package/components/grid.d.ts +8 -3
  50. package/components/grid.d.ts.map +1 -1
  51. package/components/grid.js +1 -0
  52. package/components/grid.js.map +1 -1
  53. package/components/input.d.ts +2 -3
  54. package/components/input.d.ts.map +1 -1
  55. package/components/input.js +3 -6
  56. package/components/input.js.map +1 -1
  57. package/components/layout.d.ts +3 -6
  58. package/components/layout.d.ts.map +1 -1
  59. package/components/layout.js +21 -10
  60. package/components/layout.js.map +1 -1
  61. package/components/link.d.ts +3 -1
  62. package/components/link.d.ts.map +1 -1
  63. package/components/link.js +3 -1
  64. package/components/link.js.map +1 -1
  65. package/components/progress.d.ts +2 -11
  66. package/components/progress.d.ts.map +1 -1
  67. package/components/progress.js +6 -15
  68. package/components/progress.js.map +1 -1
  69. package/components/range.d.ts +43 -17
  70. package/components/range.d.ts.map +1 -1
  71. package/components/range.js +132 -58
  72. package/components/range.js.map +1 -1
  73. package/components/rotate.d.ts +1 -1
  74. package/components/rotate.d.ts.map +1 -1
  75. package/components/rotate.js +1 -1
  76. package/components/rotate.js.map +1 -1
  77. package/components/router.d.ts +6 -8
  78. package/components/router.d.ts.map +1 -1
  79. package/components/router.js +10 -10
  80. package/components/router.js.map +1 -1
  81. package/components/select.d.ts +4 -8
  82. package/components/select.d.ts.map +1 -1
  83. package/components/select.js +42 -41
  84. package/components/select.js.map +1 -1
  85. package/components/skeleton.d.ts.map +1 -1
  86. package/components/skeleton.js +3 -4
  87. package/components/skeleton.js.map +1 -1
  88. package/components/split.d.ts +18 -1
  89. package/components/split.d.ts.map +1 -1
  90. package/components/split.js +52 -19
  91. package/components/split.js.map +1 -1
  92. package/components/switch.d.ts +4 -4
  93. package/components/switch.d.ts.map +1 -1
  94. package/components/switch.js +6 -6
  95. package/components/switch.js.map +1 -1
  96. package/components/text.js +3 -3
  97. package/components/text.js.map +1 -1
  98. package/components/time.d.ts +4 -20
  99. package/components/time.d.ts.map +1 -1
  100. package/components/time.js +5 -66
  101. package/components/time.js.map +1 -1
  102. package/components/tooltip.d.ts +11 -1
  103. package/components/tooltip.d.ts.map +1 -1
  104. package/components/tooltip.js +23 -5
  105. package/components/tooltip.js.map +1 -1
  106. package/components/typewriter.d.ts +2 -2
  107. package/components/typewriter.d.ts.map +1 -1
  108. package/components/typewriter.js +2 -2
  109. package/components/typewriter.js.map +1 -1
  110. package/core/global-style.d.ts.map +1 -1
  111. package/core/global-style.js +8 -1
  112. package/core/global-style.js.map +1 -1
  113. package/core/super-anchor.js +1 -1
  114. package/core/super-anchor.js.map +1 -1
  115. package/core/super-input.d.ts +2 -3
  116. package/core/super-input.d.ts.map +1 -1
  117. package/core/super-input.js +3 -6
  118. package/core/super-input.js.map +1 -1
  119. package/core/super-openable.js.map +1 -1
  120. package/custom-elements.json +1 -1
  121. package/dev/alert.d.ts +8 -0
  122. package/dev/alert.d.ts.map +1 -0
  123. package/dev/alert.js +4 -0
  124. package/dev/alert.js.map +1 -0
  125. package/dev/avatar.d.ts +8 -0
  126. package/dev/avatar.d.ts.map +1 -0
  127. package/dev/avatar.js +4 -0
  128. package/dev/avatar.js.map +1 -0
  129. package/dev/breath.d.ts +9 -0
  130. package/dev/breath.d.ts.map +1 -0
  131. package/dev/breath.js +5 -0
  132. package/dev/breath.js.map +1 -0
  133. package/dev/button.d.ts +8 -0
  134. package/dev/button.d.ts.map +1 -0
  135. package/dev/button.js +4 -0
  136. package/dev/button.js.map +1 -0
  137. package/dev/card.d.ts +8 -0
  138. package/dev/card.d.ts.map +1 -0
  139. package/dev/card.js +4 -0
  140. package/dev/card.js.map +1 -0
  141. package/dev/carousel.d.ts +8 -0
  142. package/dev/carousel.d.ts.map +1 -0
  143. package/dev/carousel.js +4 -0
  144. package/dev/carousel.js.map +1 -0
  145. package/dev/components/alert.d.ts +52 -0
  146. package/dev/components/alert.d.ts.map +1 -0
  147. package/dev/components/alert.js +245 -0
  148. package/dev/components/alert.js.map +1 -0
  149. package/dev/components/avatar.d.ts +30 -0
  150. package/dev/components/avatar.d.ts.map +1 -0
  151. package/dev/components/avatar.js +92 -0
  152. package/dev/components/avatar.js.map +1 -0
  153. package/dev/components/breath.d.ts +35 -0
  154. package/dev/components/breath.d.ts.map +1 -0
  155. package/dev/components/breath.js +135 -0
  156. package/dev/components/breath.js.map +1 -0
  157. package/dev/components/button.d.ts +52 -0
  158. package/dev/components/button.d.ts.map +1 -0
  159. package/dev/components/button.js +260 -0
  160. package/dev/components/button.js.map +1 -0
  161. package/dev/components/card.d.ts +19 -0
  162. package/dev/components/card.d.ts.map +1 -0
  163. package/dev/components/card.js +81 -0
  164. package/dev/components/card.js.map +1 -0
  165. package/dev/components/carousel.d.ts +41 -0
  166. package/dev/components/carousel.d.ts.map +1 -0
  167. package/dev/components/carousel.js +157 -0
  168. package/dev/components/carousel.js.map +1 -0
  169. package/dev/components/details.d.ts +23 -0
  170. package/dev/components/details.d.ts.map +1 -0
  171. package/dev/components/details.js +118 -0
  172. package/dev/components/details.js.map +1 -0
  173. package/dev/components/dialog.d.ts +37 -0
  174. package/dev/components/dialog.d.ts.map +1 -0
  175. package/dev/components/dialog.js +159 -0
  176. package/dev/components/dialog.js.map +1 -0
  177. package/dev/components/divider.d.ts +17 -0
  178. package/dev/components/divider.d.ts.map +1 -0
  179. package/dev/components/divider.js +46 -0
  180. package/dev/components/divider.js.map +1 -0
  181. package/dev/components/dragbox.d.ts +40 -0
  182. package/dev/components/dragbox.d.ts.map +1 -0
  183. package/dev/components/dragbox.js +117 -0
  184. package/dev/components/dragbox.js.map +1 -0
  185. package/dev/components/flex.d.ts +32 -0
  186. package/dev/components/flex.d.ts.map +1 -0
  187. package/dev/components/flex.js +60 -0
  188. package/dev/components/flex.js.map +1 -0
  189. package/dev/components/form.d.ts +22 -0
  190. package/dev/components/form.d.ts.map +1 -0
  191. package/dev/components/form.js +77 -0
  192. package/dev/components/form.js.map +1 -0
  193. package/dev/components/grid.d.ts +36 -0
  194. package/dev/components/grid.d.ts.map +1 -0
  195. package/dev/components/grid.js +54 -0
  196. package/dev/components/grid.js.map +1 -0
  197. package/dev/components/input.d.ts +19 -0
  198. package/dev/components/input.d.ts.map +1 -0
  199. package/dev/components/input.js +70 -0
  200. package/dev/components/input.js.map +1 -0
  201. package/dev/components/layout.d.ts +26 -0
  202. package/dev/components/layout.d.ts.map +1 -0
  203. package/dev/components/layout.js +82 -0
  204. package/dev/components/layout.js.map +1 -0
  205. package/dev/components/link.d.ts +22 -0
  206. package/dev/components/link.d.ts.map +1 -0
  207. package/dev/components/link.js +42 -0
  208. package/dev/components/link.js.map +1 -0
  209. package/dev/components/progress.d.ts +21 -0
  210. package/dev/components/progress.d.ts.map +1 -0
  211. package/dev/components/progress.js +99 -0
  212. package/dev/components/progress.js.map +1 -0
  213. package/dev/components/range.d.ts +86 -0
  214. package/dev/components/range.d.ts.map +1 -0
  215. package/dev/components/range.js +364 -0
  216. package/dev/components/range.js.map +1 -0
  217. package/dev/components/rotate.d.ts +26 -0
  218. package/dev/components/rotate.d.ts.map +1 -0
  219. package/dev/components/rotate.js +86 -0
  220. package/dev/components/rotate.js.map +1 -0
  221. package/dev/components/router.d.ts +119 -0
  222. package/dev/components/router.d.ts.map +1 -0
  223. package/dev/components/router.js +248 -0
  224. package/dev/components/router.js.map +1 -0
  225. package/dev/components/select.d.ts +46 -0
  226. package/dev/components/select.d.ts.map +1 -0
  227. package/dev/components/select.js +245 -0
  228. package/dev/components/select.js.map +1 -0
  229. package/dev/components/skeleton.d.ts +26 -0
  230. package/dev/components/skeleton.d.ts.map +1 -0
  231. package/dev/components/skeleton.js +118 -0
  232. package/dev/components/skeleton.js.map +1 -0
  233. package/dev/components/split.d.ts +49 -0
  234. package/dev/components/split.d.ts.map +1 -0
  235. package/dev/components/split.js +206 -0
  236. package/dev/components/split.js.map +1 -0
  237. package/dev/components/switch.d.ts +39 -0
  238. package/dev/components/switch.d.ts.map +1 -0
  239. package/dev/components/switch.js +182 -0
  240. package/dev/components/switch.js.map +1 -0
  241. package/dev/components/text.d.ts +19 -0
  242. package/dev/components/text.d.ts.map +1 -0
  243. package/dev/components/text.js +93 -0
  244. package/dev/components/text.js.map +1 -0
  245. package/dev/components/time.d.ts +37 -0
  246. package/dev/components/time.d.ts.map +1 -0
  247. package/dev/components/time.js +75 -0
  248. package/dev/components/time.js.map +1 -0
  249. package/dev/components/tooltip.d.ts +48 -0
  250. package/dev/components/tooltip.d.ts.map +1 -0
  251. package/dev/components/tooltip.js +137 -0
  252. package/dev/components/tooltip.js.map +1 -0
  253. package/dev/components/typewriter.d.ts +55 -0
  254. package/dev/components/typewriter.d.ts.map +1 -0
  255. package/dev/components/typewriter.js +155 -0
  256. package/dev/components/typewriter.js.map +1 -0
  257. package/dev/core/global-style.d.ts +21 -0
  258. package/dev/core/global-style.d.ts.map +1 -0
  259. package/dev/core/global-style.js +76 -0
  260. package/dev/core/global-style.js.map +1 -0
  261. package/dev/core/super-anchor.d.ts +15 -0
  262. package/dev/core/super-anchor.d.ts.map +1 -0
  263. package/dev/core/super-anchor.js +58 -0
  264. package/dev/core/super-anchor.js.map +1 -0
  265. package/dev/core/super-input.d.ts +38 -0
  266. package/dev/core/super-input.d.ts.map +1 -0
  267. package/dev/core/super-input.js +182 -0
  268. package/dev/core/super-input.js.map +1 -0
  269. package/dev/core/super-openable.d.ts +19 -0
  270. package/dev/core/super-openable.d.ts.map +1 -0
  271. package/dev/core/super-openable.js +36 -0
  272. package/dev/core/super-openable.js.map +1 -0
  273. package/dev/details.d.ts +8 -0
  274. package/dev/details.d.ts.map +1 -0
  275. package/dev/details.js +4 -0
  276. package/dev/details.js.map +1 -0
  277. package/dev/dialog.d.ts +8 -0
  278. package/dev/dialog.d.ts.map +1 -0
  279. package/dev/dialog.js +4 -0
  280. package/dev/dialog.js.map +1 -0
  281. package/dev/divider.d.ts +8 -0
  282. package/dev/divider.d.ts.map +1 -0
  283. package/dev/divider.js +4 -0
  284. package/dev/divider.js.map +1 -0
  285. package/dev/dragbox.d.ts +8 -0
  286. package/dev/dragbox.d.ts.map +1 -0
  287. package/dev/dragbox.js +4 -0
  288. package/dev/dragbox.js.map +1 -0
  289. package/dev/flex.d.ts +8 -0
  290. package/dev/flex.d.ts.map +1 -0
  291. package/dev/flex.js +4 -0
  292. package/dev/flex.js.map +1 -0
  293. package/dev/form.d.ts +8 -0
  294. package/dev/form.d.ts.map +1 -0
  295. package/dev/form.js +4 -0
  296. package/dev/form.js.map +1 -0
  297. package/dev/grid.d.ts +8 -0
  298. package/dev/grid.d.ts.map +1 -0
  299. package/dev/grid.js +4 -0
  300. package/dev/grid.js.map +1 -0
  301. package/dev/index.d.ts +29 -0
  302. package/dev/index.d.ts.map +1 -0
  303. package/dev/index.js +29 -0
  304. package/dev/index.js.map +1 -0
  305. package/dev/input.d.ts +9 -0
  306. package/dev/input.d.ts.map +1 -0
  307. package/dev/input.js +5 -0
  308. package/dev/input.js.map +1 -0
  309. package/dev/layout.d.ts +9 -0
  310. package/dev/layout.d.ts.map +1 -0
  311. package/dev/layout.js +5 -0
  312. package/dev/layout.js.map +1 -0
  313. package/dev/link.d.ts +9 -0
  314. package/dev/link.d.ts.map +1 -0
  315. package/dev/link.js +5 -0
  316. package/dev/link.js.map +1 -0
  317. package/dev/progress.d.ts +9 -0
  318. package/dev/progress.d.ts.map +1 -0
  319. package/dev/progress.js +5 -0
  320. package/dev/progress.js.map +1 -0
  321. package/dev/range.d.ts +9 -0
  322. package/dev/range.d.ts.map +1 -0
  323. package/dev/range.js +5 -0
  324. package/dev/range.js.map +1 -0
  325. package/dev/rotate.d.ts +9 -0
  326. package/dev/rotate.d.ts.map +1 -0
  327. package/dev/rotate.js +5 -0
  328. package/dev/rotate.js.map +1 -0
  329. package/dev/router.d.ts +9 -0
  330. package/dev/router.d.ts.map +1 -0
  331. package/dev/router.js +5 -0
  332. package/dev/router.js.map +1 -0
  333. package/dev/select.d.ts +9 -0
  334. package/dev/select.d.ts.map +1 -0
  335. package/dev/select.js +5 -0
  336. package/dev/select.js.map +1 -0
  337. package/dev/skeleton.d.ts +9 -0
  338. package/dev/skeleton.d.ts.map +1 -0
  339. package/dev/skeleton.js +5 -0
  340. package/dev/skeleton.js.map +1 -0
  341. package/dev/split.d.ts +9 -0
  342. package/dev/split.d.ts.map +1 -0
  343. package/dev/split.js +5 -0
  344. package/dev/split.js.map +1 -0
  345. package/dev/switch.d.ts +9 -0
  346. package/dev/switch.d.ts.map +1 -0
  347. package/dev/switch.js +5 -0
  348. package/dev/switch.js.map +1 -0
  349. package/dev/text.d.ts +9 -0
  350. package/dev/text.d.ts.map +1 -0
  351. package/dev/text.js +5 -0
  352. package/dev/text.js.map +1 -0
  353. package/dev/time.d.ts +9 -0
  354. package/dev/time.d.ts.map +1 -0
  355. package/dev/time.js +5 -0
  356. package/dev/time.js.map +1 -0
  357. package/dev/tooltip.d.ts +9 -0
  358. package/dev/tooltip.d.ts.map +1 -0
  359. package/dev/tooltip.js +5 -0
  360. package/dev/tooltip.js.map +1 -0
  361. package/dev/typewriter.d.ts +8 -0
  362. package/dev/typewriter.d.ts.map +1 -0
  363. package/dev/typewriter.js +4 -0
  364. package/dev/typewriter.js.map +1 -0
  365. package/index.js +13 -13
  366. package/package.json +10 -8
  367. package/range.d.ts +1 -1
  368. package/range.d.ts.map +1 -1
  369. package/src/alert.ts +11 -0
  370. package/src/avatar.ts +11 -0
  371. package/src/breath.ts +13 -0
  372. package/src/button.ts +11 -0
  373. package/src/card.ts +11 -0
  374. package/src/carousel.ts +11 -0
  375. package/src/components/alert.ts +282 -0
  376. package/src/components/avatar.ts +95 -0
  377. package/src/components/breath.ts +153 -0
  378. package/src/components/button.ts +286 -0
  379. package/src/components/card.ts +80 -0
  380. package/src/components/carousel.ts +169 -0
  381. package/src/components/details.ts +116 -0
  382. package/src/components/dialog.ts +165 -0
  383. package/src/components/divider.ts +44 -0
  384. package/src/components/dragbox.ts +127 -0
  385. package/src/components/flex.ts +70 -0
  386. package/src/components/form.ts +82 -0
  387. package/src/components/grid.ts +75 -0
  388. package/src/components/input.ts +72 -0
  389. package/src/components/layout.ts +82 -0
  390. package/src/components/link.ts +38 -0
  391. package/src/components/progress.ts +95 -0
  392. package/src/components/range.ts +404 -0
  393. package/src/components/rotate.ts +92 -0
  394. package/src/components/router.ts +273 -0
  395. package/src/components/select.ts +268 -0
  396. package/src/components/skeleton.ts +118 -0
  397. package/src/components/split.ts +221 -0
  398. package/src/components/switch.ts +180 -0
  399. package/src/components/text.ts +95 -0
  400. package/src/components/time.ts +81 -0
  401. package/src/components/tooltip.ts +138 -0
  402. package/src/components/typewriter.ts +154 -0
  403. package/src/core/global-style.ts +86 -0
  404. package/src/core/super-anchor.ts +52 -0
  405. package/src/core/super-input.ts +230 -0
  406. package/src/core/super-openable.ts +51 -0
  407. package/src/details.ts +11 -0
  408. package/src/dialog.ts +11 -0
  409. package/src/divider.ts +11 -0
  410. package/src/dragbox.ts +11 -0
  411. package/src/flex.ts +11 -0
  412. package/src/form.ts +11 -0
  413. package/src/grid.ts +11 -0
  414. package/src/index.ts +28 -0
  415. package/src/input.ts +13 -0
  416. package/src/layout.ts +12 -0
  417. package/src/link.ts +13 -0
  418. package/src/progress.ts +12 -0
  419. package/src/range.ts +13 -0
  420. package/src/rotate.ts +13 -0
  421. package/src/router.ts +12 -0
  422. package/src/select.ts +13 -0
  423. package/src/skeleton.ts +13 -0
  424. package/src/split.ts +13 -0
  425. package/src/switch.ts +13 -0
  426. package/src/text.ts +13 -0
  427. package/src/time.ts +13 -0
  428. package/src/tooltip.ts +13 -0
  429. package/src/typewriter.ts +11 -0
  430. package/vscode.html-custom-data.json +1 -1
  431. package/web-types.json +1 -1
@@ -0,0 +1,117 @@
1
+ import { __decorate } from "tslib";
2
+ import { godown } from "@godown/element/decorators/godown.js";
3
+ import { styles } from "@godown/element/decorators/styles.js";
4
+ import { htmlSlot } from "@godown/element/directives/html-slot.js";
5
+ import { css, html } from "lit";
6
+ import { property } from "lit/decorators.js";
7
+ import { GlobalStyle } from "../core/global-style.js";
8
+ const protoName = "dragbox";
9
+ /**
10
+ * {@linkcode Dragbox} does not extend beyond the range of {@linkcode Dragbox.offsetsWidth} and {@linkcode Dragbox.offsetsHeight}.
11
+ *
12
+ * @category wrapper
13
+ */
14
+ let Dragbox = class Dragbox extends GlobalStyle {
15
+ constructor() {
16
+ super(...arguments);
17
+ /**
18
+ * Position x.
19
+ */
20
+ this.x = "auto";
21
+ /**
22
+ * Position y.
23
+ */
24
+ this.y = "auto";
25
+ }
26
+ /**
27
+ * Width of (`this.offsetParent` or `document.body`).
28
+ */
29
+ get offsetsWidth() {
30
+ return this.offsetParent?.clientWidth ?? document.body.offsetWidth;
31
+ }
32
+ /**
33
+ * Height of (`this.offsetParent` or `document.body`).
34
+ */
35
+ get offsetsHeight() {
36
+ return this.offsetParent?.clientHeight ?? document.body.offsetHeight;
37
+ }
38
+ render() {
39
+ return html `<div @mousedown="${this._handleDragStart}" @mouseup="${this._handleDragEnd}">${htmlSlot()}</div>`;
40
+ }
41
+ firstUpdated() {
42
+ this.reset();
43
+ }
44
+ _handleDragStart(e) {
45
+ this.cx = e.clientX;
46
+ this.cy = e.clientY;
47
+ this.t = this.offsetTop;
48
+ this.l = this.offsetLeft;
49
+ this.drag = true;
50
+ this._handleMouseMove = this.events.add(document, "mousemove", this._handleDrag.bind(this));
51
+ this._handleMouseLeave = this.events.add(document, "mouseleave", this._handleDragEnd.bind(this));
52
+ }
53
+ _handleDragEnd() {
54
+ this.drag = false;
55
+ this.events.remove(document, "mousemove", this._handleMouseMove);
56
+ this.events.remove(document, "mouseleave", this._handleMouseLeave);
57
+ }
58
+ _handleDrag(e) {
59
+ if (!this.drag) {
60
+ return;
61
+ }
62
+ const nl = e.clientX - (this.cx - this.l);
63
+ const nt = e.clientY - (this.cy - this.t);
64
+ const { style, offsetsWidth, offsetsHeight, offsetWidth, offsetHeight } = this;
65
+ if (nl < 0) {
66
+ style.left = "0";
67
+ }
68
+ else if (nl < offsetsWidth - offsetWidth) {
69
+ style.left = `${nl}px`;
70
+ }
71
+ else {
72
+ style.left = `${offsetsWidth - offsetWidth}"px"`;
73
+ }
74
+ if (nt < 0) {
75
+ style.top = "0";
76
+ }
77
+ else if (nt < offsetsHeight - offsetHeight) {
78
+ style.top = `${nt}px`;
79
+ }
80
+ else {
81
+ style.top = `${offsetsHeight - offsetHeight}px`;
82
+ }
83
+ }
84
+ reset() {
85
+ const { x, y, style, offsetsWidth, offsetsHeight, offsetWidth, offsetHeight, offsetLeft, offsetTop } = this;
86
+ style.left = x || "0";
87
+ style.top = y || "0";
88
+ if (offsetLeft > offsetsWidth - offsetWidth) {
89
+ style.left = `${offsetsWidth - offsetWidth}px`;
90
+ }
91
+ if (offsetTop > offsetsHeight - offsetHeight) {
92
+ style.top = `${offsetsHeight - offsetHeight}px`;
93
+ }
94
+ }
95
+ };
96
+ __decorate([
97
+ property()
98
+ ], Dragbox.prototype, "x", void 0);
99
+ __decorate([
100
+ property()
101
+ ], Dragbox.prototype, "y", void 0);
102
+ Dragbox = __decorate([
103
+ godown(protoName),
104
+ styles(css `
105
+ :host {
106
+ position: absolute;
107
+ display: block;
108
+ }
109
+
110
+ :host(:active) {
111
+ -webkit-user-select: none;
112
+ user-select: none;
113
+ }
114
+ `)
115
+ ], Dragbox);
116
+ export default Dragbox;
117
+ //# sourceMappingURL=dragbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dragbox.js","sourceRoot":"","sources":["../../src/components/dragbox.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AAEnE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,SAAS,GAAG,SAAS,CAAC;AAE5B;;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,GAAG,YAAY,IAAI,CAAC;QAClD,CAAC;IACH,CAAC;IAED,KAAK;QACH,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QAC5G,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC;QACtB,KAAK,CAAC,GAAG,GAAG,CAAC,IAAI,GAAG,CAAC;QACrB,IAAI,UAAU,GAAG,YAAY,GAAG,WAAW,EAAE,CAAC;YAC5C,KAAK,CAAC,IAAI,GAAG,GAAG,YAAY,GAAG,WAAW,IAAI,CAAC;QACjD,CAAC;QACD,IAAI,SAAS,GAAG,aAAa,GAAG,YAAY,EAAE,CAAC;YAC7C,KAAK,CAAC,GAAG,GAAG,GAAG,aAAa,GAAG,YAAY,IAAI,CAAC;QAClD,CAAC;IACH,CAAC;CACF,CAAA;AArEC;IADC,QAAQ,EAAE;kCACA;AAMX;IADC,QAAQ,EAAE;kCACA;AA/BP,OAAO;IAdZ,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CACL,GAAG,CAAA;;;;;;;;;;GAUF,CACF;GACK,OAAO,CA8FZ;AAED,eAAe,OAAO,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { GlobalStyle } from "../core/global-style.js";
2
+ /**
3
+ * {@linkcode Flex} provides flex layout.
4
+ *
5
+ * @slot - Flex items.
6
+ * @category layout
7
+ */
8
+ declare class Flex extends GlobalStyle {
9
+ /**
10
+ * CSS property `flex-flow` (`flex-direction flex-wrap`).
11
+ */
12
+ flexFlow: string;
13
+ /**
14
+ * CSS property `gap`.
15
+ */
16
+ gap: string;
17
+ /**
18
+ * CSS property `justify-content`.
19
+ */
20
+ content: string;
21
+ /**
22
+ * CSS property `align-items`.
23
+ */
24
+ items: string;
25
+ /**
26
+ * If true, set flex-direction to "column".
27
+ */
28
+ vertical: boolean;
29
+ protected render(): (symbol | import("lit").TemplateResult<1>)[];
30
+ }
31
+ export default Flex;
32
+ //# sourceMappingURL=flex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flex.d.ts","sourceRoot":"","sources":["../../src/components/flex.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAItD;;;;;GAKG;AACH,cAEM,IAAK,SAAQ,WAAW;IAC5B;;OAEG;IAEH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IAEH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IAEH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IAEH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IAEH,QAAQ,UAAS;IAEjB,SAAS,CAAC,MAAM;CAgBjB;AAED,eAAe,IAAI,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { __decorate } from "tslib";
2
+ import { godown } from "@godown/element/decorators/godown.js";
3
+ import { styles } from "@godown/element/decorators/styles.js";
4
+ import { htmlSlot } from "@godown/element/directives/html-slot.js";
5
+ import { htmlStyle } from "@godown/element/directives/html-style.js";
6
+ import { joinRules } from "@godown/element/tools/css.js";
7
+ import { css } from "lit";
8
+ import { property } from "lit/decorators.js";
9
+ import { GlobalStyle } from "../core/global-style.js";
10
+ const protoName = "flex";
11
+ /**
12
+ * {@linkcode Flex} provides flex layout.
13
+ *
14
+ * @slot - Flex items.
15
+ * @category layout
16
+ */
17
+ let Flex = class Flex extends GlobalStyle {
18
+ constructor() {
19
+ super(...arguments);
20
+ /**
21
+ * If true, set flex-direction to "column".
22
+ */
23
+ this.vertical = false;
24
+ }
25
+ render() {
26
+ return [
27
+ htmlSlot(),
28
+ htmlStyle(joinRules({
29
+ ":host": {
30
+ gap: this.gap,
31
+ "flex-flow": this.flexFlow,
32
+ "flex-direction": this.vertical && "column",
33
+ "align-items": this.items,
34
+ "justify-content": this.content,
35
+ },
36
+ })),
37
+ ];
38
+ }
39
+ };
40
+ __decorate([
41
+ property({ attribute: "flex-flow" })
42
+ ], Flex.prototype, "flexFlow", void 0);
43
+ __decorate([
44
+ property()
45
+ ], Flex.prototype, "gap", void 0);
46
+ __decorate([
47
+ property()
48
+ ], Flex.prototype, "content", void 0);
49
+ __decorate([
50
+ property()
51
+ ], Flex.prototype, "items", void 0);
52
+ __decorate([
53
+ property({ type: Boolean })
54
+ ], Flex.prototype, "vertical", void 0);
55
+ Flex = __decorate([
56
+ godown(protoName),
57
+ styles(css `:host {display:flex;}`)
58
+ ], Flex);
59
+ export default Flex;
60
+ //# sourceMappingURL=flex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flex.js","sourceRoot":"","sources":["../../src/components/flex.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,SAAS,GAAG,MAAM,CAAC;AAEzB;;;;;GAKG;AAGH,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,WAAW;IAA9B;;QAyBE;;WAEG;QAEH,aAAQ,GAAG,KAAK,CAAC;IAkBnB,CAAC;IAhBW,MAAM;QACd,OAAO;YACL,QAAQ,EAAE;YACV,SAAS,CACP,SAAS,CAAC;gBACR,OAAO,EAAE;oBACP,GAAG,EAAE,IAAI,CAAC,GAAG;oBACb,WAAW,EAAE,IAAI,CAAC,QAAQ;oBAC1B,gBAAgB,EAAE,IAAI,CAAC,QAAQ,IAAI,QAAQ;oBAC3C,aAAa,EAAE,IAAI,CAAC,KAAK;oBACzB,iBAAiB,EAAE,IAAI,CAAC,OAAO;iBAChC;aACF,CAAC,CACH;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AA1CC;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;sCACpB;AAMjB;IADC,QAAQ,EAAE;iCACC;AAMZ;IADC,QAAQ,EAAE;qCACK;AAMhB;IADC,QAAQ,EAAE;mCACG;AAMd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;sCACX;AA7Bb,IAAI;IAFT,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CAAC,GAAG,CAAA,uBAAuB,CAAC;GAC7B,IAAI,CA+CT;AAED,eAAe,IAAI,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { GlobalStyle } from "../core/global-style.js";
2
+ /**
3
+ * {@linkcode Form} Gets child element key-value object,
4
+ * which will be nested if the child element is the same as this element.
5
+ *
6
+ * @category form
7
+ */
8
+ declare class Form<T = object> extends GlobalStyle {
9
+ name: string;
10
+ get value(): T;
11
+ nameValue: () => [string, T];
12
+ protected render(): import("lit").TemplateResult<1>;
13
+ reset(): void;
14
+ namevalue(): [string, T];
15
+ static buildValue(elements: (Element & {
16
+ name?: string;
17
+ value?: unknown;
18
+ namevalue?: () => [string, unknown];
19
+ })[]): Record<string, any>;
20
+ }
21
+ export default Form;
22
+ //# sourceMappingURL=form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/components/form.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAItD;;;;;GAKG;AACH,cAQM,IAAI,CAAC,CAAC,GAAG,MAAM,CAAE,SAAQ,WAAW;IAExC,IAAI,SAAM;IAEV,IAAI,KAAK,IAAI,CAAC,CAEb;IAED,SAAS,QAiBI,CAAC,MAAM,EAAE,CAAC,CAAC,CAjBG;IAE3B,SAAS,CAAC,MAAM;IAIhB,KAAK;IAWL,SAAS,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAIxB,MAAM,CAAC,UAAU,CACf,QAAQ,EAAE,CAAC,OAAO,GAAG;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACrC,CAAC,EAAE,GACH,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAoBvB;AAED,eAAe,IAAI,CAAC"}
@@ -0,0 +1,77 @@
1
+ var Form_1;
2
+ import { __decorate } from "tslib";
3
+ import { godown } from "@godown/element/decorators/godown.js";
4
+ import { styles } from "@godown/element/decorators/styles.js";
5
+ import { htmlSlot } from "@godown/element/directives/html-slot.js";
6
+ import { css } from "lit";
7
+ import { property } from "lit/decorators.js";
8
+ import { GlobalStyle } from "../core/global-style.js";
9
+ const protoName = "form";
10
+ /**
11
+ * {@linkcode Form} Gets child element key-value object,
12
+ * which will be nested if the child element is the same as this element.
13
+ *
14
+ * @category form
15
+ */
16
+ let Form = Form_1 = class Form extends GlobalStyle {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.name = "";
20
+ this.nameValue = this.namevalue;
21
+ }
22
+ get value() {
23
+ return Form_1.buildValue(this._slot.assignedElements());
24
+ }
25
+ render() {
26
+ return htmlSlot();
27
+ }
28
+ reset() {
29
+ this.deepQuerySelectorAll("*").forEach((el) => {
30
+ if (el.tagName === this.tagName) {
31
+ return;
32
+ }
33
+ if (el.reset) {
34
+ el.reset();
35
+ }
36
+ });
37
+ }
38
+ namevalue() {
39
+ return [this.name, this.value];
40
+ }
41
+ static buildValue(elements) {
42
+ const result = {};
43
+ for (const el of elements) {
44
+ if (el.tagName === "FORM") {
45
+ Object.assign(result, Object.fromEntries(new FormData(el).entries()));
46
+ }
47
+ else if (el.namevalue) {
48
+ const [name, value] = el.namevalue();
49
+ if (name) {
50
+ result[name] = value;
51
+ }
52
+ }
53
+ else if (el.name && el.value !== undefined) {
54
+ result[el.name] = el.value;
55
+ }
56
+ else if (el.shadowRoot) {
57
+ for (const slot of el.shadowRoot.querySelectorAll("slot")) {
58
+ Object.assign(result, this.buildValue(slot.assignedElements()));
59
+ }
60
+ }
61
+ }
62
+ return result;
63
+ }
64
+ };
65
+ __decorate([
66
+ property()
67
+ ], Form.prototype, "name", void 0);
68
+ Form = Form_1 = __decorate([
69
+ godown(protoName),
70
+ styles(css `
71
+ :host {
72
+ display: block;
73
+ }
74
+ `)
75
+ ], Form);
76
+ export default Form;
77
+ //# sourceMappingURL=form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.js","sourceRoot":"","sources":["../../src/components/form.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AACnE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,SAAS,GAAG,MAAM,CAAC;AAEzB;;;;;GAKG;AASH,IAAM,IAAI,YAAV,MAAM,IAAiB,SAAQ,WAAW;IAA1C;;QAEE,SAAI,GAAG,EAAE,CAAC;QAMV,cAAS,GAAG,IAAI,CAAC,SAAS,CAAC;IA+C7B,CAAC;IAnDC,IAAI,KAAK;QACP,OAAO,MAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAM,CAAC;IAC7D,CAAC;IAIS,MAAM;QACd,OAAO,QAAQ,EAAE,CAAC;IACpB,CAAC;IAED,KAAK;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AC,EAAE,CAAC;oBAC1D,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;gBAClE,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAA;AArDC;IADC,QAAQ,EAAE;kCACD;AAFN,IAAI;IART,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CACL,GAAG,CAAA;;;;GAIF,CACF;GACK,IAAI,CAuDT;AAED,eAAe,IAAI,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { GlobalStyle } from "../core/global-style.js";
2
+ /**
3
+ * {@linkcode Grid} provides gird layout.
4
+ *
5
+ * @slot - Grid items.
6
+ * @category layout
7
+ */
8
+ declare class Grid extends GlobalStyle {
9
+ /**
10
+ * CSS property `gap`.
11
+ */
12
+ gap: string;
13
+ /**
14
+ * CSS property `grid-template-columns`.
15
+ *
16
+ * If columns is numerical, divide columns equally.
17
+ */
18
+ columns: string | number;
19
+ /**
20
+ * CSS property `grid-template-rows`.
21
+ *
22
+ * If rows is numerical, divide rows equally.
23
+ */
24
+ rows: string | number;
25
+ /**
26
+ * CSS property `place-content` (`align-content justify-content`).
27
+ */
28
+ content: string;
29
+ /**
30
+ * CSS property `place-items` (`align-items justify-items`).
31
+ */
32
+ items: string;
33
+ protected render(): (symbol | import("lit").TemplateResult<1>)[];
34
+ }
35
+ export default Grid;
36
+ //# sourceMappingURL=grid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../src/components/grid.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAItD;;;;;GAKG;AACH,cAEM,IAAK,SAAQ,WAAW;IAC5B;;OAEG;IAEH,GAAG,EAAE,MAAM,CAAC;IAEZ;;;;OAIG;IAEH,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzB;;;;OAIG;IAEH,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAEtB;;OAEG;IAEH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IAEH,KAAK,EAAE,MAAM,CAAC;IAEd,SAAS,CAAC,MAAM;CAgBjB;AAED,eAAe,IAAI,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { __decorate } from "tslib";
2
+ import { godown } from "@godown/element/decorators/godown.js";
3
+ import { styles } from "@godown/element/decorators/styles.js";
4
+ import { htmlSlot } from "@godown/element/directives/html-slot.js";
5
+ import { htmlStyle } from "@godown/element/directives/html-style.js";
6
+ import { joinRules } from "@godown/element/tools/css.js";
7
+ import { isNumerical } from "@godown/element/tools/lib.js";
8
+ import { css } from "lit";
9
+ import { property } from "lit/decorators.js";
10
+ import { GlobalStyle } from "../core/global-style.js";
11
+ const protoName = "grid";
12
+ /**
13
+ * {@linkcode Grid} provides gird layout.
14
+ *
15
+ * @slot - Grid items.
16
+ * @category layout
17
+ */
18
+ let Grid = class Grid extends GlobalStyle {
19
+ render() {
20
+ return [
21
+ htmlSlot(),
22
+ htmlStyle(joinRules({
23
+ ":host": {
24
+ gap: this.gap,
25
+ "grid-template-columns": isNumerical(this.columns) ? `repeat(${this.columns},1fr)` : this.columns,
26
+ "grid-template-rows": isNumerical(this.rows) ? `repeat(${this.rows},1fr)` : this.rows,
27
+ "place-content": this.content,
28
+ "place-items": this.items,
29
+ },
30
+ })),
31
+ ];
32
+ }
33
+ };
34
+ __decorate([
35
+ property()
36
+ ], Grid.prototype, "gap", void 0);
37
+ __decorate([
38
+ property()
39
+ ], Grid.prototype, "columns", void 0);
40
+ __decorate([
41
+ property()
42
+ ], Grid.prototype, "rows", void 0);
43
+ __decorate([
44
+ property()
45
+ ], Grid.prototype, "content", void 0);
46
+ __decorate([
47
+ property()
48
+ ], Grid.prototype, "items", void 0);
49
+ Grid = __decorate([
50
+ godown(protoName),
51
+ styles(css `:host{display:grid;}`)
52
+ ], Grid);
53
+ export default Grid;
54
+ //# sourceMappingURL=grid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid.js","sourceRoot":"","sources":["../../src/components/grid.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,SAAS,GAAG,MAAM,CAAC;AAEzB;;;;;GAKG;AAGH,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,WAAW;IAmClB,MAAM;QACd,OAAO;YACL,QAAQ,EAAE;YACV,SAAS,CACP,SAAS,CAAC;gBACR,OAAO,EAAE;oBACP,GAAG,EAAE,IAAI,CAAC,GAAG;oBACb,uBAAuB,EAAE,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO;oBACjG,oBAAoB,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI;oBACrF,eAAe,EAAE,IAAI,CAAC,OAAO;oBAC7B,aAAa,EAAE,IAAI,CAAC,KAAK;iBAC1B;aACF,CAAC,CACH;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AA9CC;IADC,QAAQ,EAAE;iCACC;AAQZ;IADC,QAAQ,EAAE;qCACc;AAQzB;IADC,QAAQ,EAAE;kCACW;AAMtB;IADC,QAAQ,EAAE;qCACK;AAMhB;IADC,QAAQ,EAAE;mCACG;AAjCV,IAAI;IAFT,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CAAC,GAAG,CAAA,sBAAsB,CAAC;GAC5B,IAAI,CAmDT;AAED,eAAe,IAAI,CAAC"}
@@ -0,0 +1,19 @@
1
+ import SuperInput from "../core/super-input.js";
2
+ /**
3
+ * {@linkcode Input} renders a text input.
4
+ *
5
+ * @category input
6
+ */
7
+ declare class Input extends SuperInput {
8
+ type: "text" | "search" | "tel" | "url" | "email" | "password";
9
+ value: string;
10
+ /**
11
+ * If outline, the outline is always present.
12
+ */
13
+ variant: "default" | "outline";
14
+ protected _input: HTMLInputElement;
15
+ protected render(): import("lit").TemplateResult<1>;
16
+ reset(): void;
17
+ }
18
+ export default Input;
19
+ //# sourceMappingURL=input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/components/input.ts"],"names":[],"mappings":"AAQA,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAIhD;;;;GAIG;AACH,cAaM,KAAM,SAAQ,UAAU;IAC5B,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,UAAU,CAAU;IAExE,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IAEH,OAAO,EAAE,SAAS,GAAG,SAAS,CAAa;IAG3C,SAAS,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAEnC,SAAS,CAAC,MAAM;IAqBhB,KAAK;CAIN;AAED,eAAe,KAAK,CAAC"}
@@ -0,0 +1,70 @@
1
+ import { __decorate } from "tslib";
2
+ import { godown } from "@godown/element/decorators/godown.js";
3
+ import { part } from "@godown/element/decorators/part.js";
4
+ import { styles } from "@godown/element/decorators/styles.js";
5
+ import { classList } from "@godown/element/directives/class-list.js";
6
+ import { css, html, nothing } from "lit";
7
+ import { property } from "lit/decorators.js";
8
+ import { cssGlobalVars } from "../core/global-style.js";
9
+ import SuperInput from "../core/super-input.js";
10
+ const protoName = "input";
11
+ /**
12
+ * {@linkcode Input} renders a text input.
13
+ *
14
+ * @category input
15
+ */
16
+ let Input = class Input extends SuperInput {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.type = "text";
20
+ /**
21
+ * If outline, the outline is always present.
22
+ */
23
+ this.variant = "default";
24
+ }
25
+ render() {
26
+ return html `<div part="root" class="${classList("input-field", this.variant)}">
27
+ ${[
28
+ this._renderPrefix(),
29
+ html `<input
30
+ part="input"
31
+ type="${this.type}"
32
+ id="${this.makeId}"
33
+ .value="${this.value}"
34
+ placeholder="${this.placeholder || nothing}"
35
+ ?autofocus="${this.autofocus}"
36
+ autocapitalize="${this.autocapitalize || nothing}"
37
+ autocomplete="${this.autocomplete || nothing}"
38
+ ?disabled="${this.disabled}"
39
+ @input="${this._handleInput}"
40
+ >`,
41
+ this._renderSuffix(),
42
+ ]}
43
+ </div>`;
44
+ }
45
+ reset() {
46
+ this._input.value = this.default;
47
+ this.value = this.default;
48
+ }
49
+ };
50
+ __decorate([
51
+ property()
52
+ ], Input.prototype, "variant", void 0);
53
+ __decorate([
54
+ part("input")
55
+ ], Input.prototype, "_input", void 0);
56
+ Input = __decorate([
57
+ godown(protoName),
58
+ styles(css `
59
+ :host {
60
+ width: var(${cssGlobalVars.input}-width);
61
+ height: var(${cssGlobalVars.input}-height);
62
+ color: var(${cssGlobalVars.foreground});
63
+ background: var(${cssGlobalVars.input}-background);
64
+ border-radius: var(${cssGlobalVars.input}-radius);
65
+ display: block;
66
+ }
67
+ `)
68
+ ], Input);
69
+ export default Input;
70
+ //# sourceMappingURL=input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/components/input.ts"],"names":[],"mappings":";AAAA,OAAO,EAA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;AA9BC;IADC,QAAQ,EAAE;sCACgC;AAGjC;IADT,IAAI,CAAC,OAAO,CAAC;qCACqB;AAZ/B,KAAK;IAbV,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CACL,GAAG,CAAA;;mBAEc,aAAa,CAAC,KAAK;oBAClB,aAAa,CAAC,KAAK;mBACpB,aAAa,CAAC,UAAU;wBACnB,aAAa,CAAC,KAAK;2BAChB,aAAa,CAAC,KAAK;;;GAG3C,CACF;GACK,KAAK,CAuCV;AAED,eAAe,KAAK,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { GlobalStyle } from "../core/global-style.js";
2
+ /**
3
+ * {@linkcode NavLayout} renders slot and optional top header, bottom footer.
4
+ *
5
+ * @slot - The main content of the layout.
6
+ * @slot header - The header of the layout.
7
+ * @slot footer - The footer of the layout.
8
+ * @category layout
9
+ */
10
+ declare class NavLayout extends GlobalStyle {
11
+ /**
12
+ * If true, remove the header slot.
13
+ */
14
+ noHeader: boolean;
15
+ /**
16
+ * If true, remove the footer slot.
17
+ */
18
+ noFooter: boolean;
19
+ /**
20
+ * If true, header will sticky.
21
+ */
22
+ sticky: boolean;
23
+ protected render(): import("lit").TemplateResult<1>;
24
+ }
25
+ export default NavLayout;
26
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/components/layout.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAItD;;;;;;;GAOG;AACH,cA4BM,SAAU,SAAQ,WAAW;IACjC;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,MAAM,UAAS;IAEf,SAAS,CAAC,MAAM;CAajB;AAED,eAAe,SAAS,CAAC"}
@@ -0,0 +1,82 @@
1
+ import { __decorate } from "tslib";
2
+ import { godown } from "@godown/element/decorators/godown.js";
3
+ import { styles } from "@godown/element/decorators/styles.js";
4
+ import { classList } from "@godown/element/directives/class-list.js";
5
+ import { htmlSlot } from "@godown/element/directives/html-slot.js";
6
+ import { css, html } from "lit";
7
+ import { property } from "lit/decorators.js";
8
+ import { GlobalStyle } from "../core/global-style.js";
9
+ const protoName = "layout";
10
+ /**
11
+ * {@linkcode NavLayout} renders slot and optional top header, bottom footer.
12
+ *
13
+ * @slot - The main content of the layout.
14
+ * @slot header - The header of the layout.
15
+ * @slot footer - The footer of the layout.
16
+ * @category layout
17
+ */
18
+ let NavLayout = class NavLayout extends GlobalStyle {
19
+ constructor() {
20
+ super(...arguments);
21
+ /**
22
+ * If true, remove the header slot.
23
+ */
24
+ this.noHeader = false;
25
+ /**
26
+ * If true, remove the footer slot.
27
+ */
28
+ this.noFooter = false;
29
+ /**
30
+ * If true, header will sticky.
31
+ */
32
+ this.sticky = false;
33
+ }
34
+ render() {
35
+ return html `${!this.noHeader
36
+ ? html `<header part="header" class="${classList({ sticky: this.sticky })}">${htmlSlot("header")}</header>`
37
+ : ""}
38
+ <main part="main">${htmlSlot()}</main>
39
+ ${!this.noFooter
40
+ ? html `<footer part="footer">${htmlSlot("footer")}</footer>`
41
+ : ""}`;
42
+ }
43
+ };
44
+ __decorate([
45
+ property({ type: Boolean })
46
+ ], NavLayout.prototype, "noHeader", void 0);
47
+ __decorate([
48
+ property({ type: Boolean })
49
+ ], NavLayout.prototype, "noFooter", void 0);
50
+ __decorate([
51
+ property({ type: Boolean })
52
+ ], NavLayout.prototype, "sticky", void 0);
53
+ NavLayout = __decorate([
54
+ godown(protoName),
55
+ styles(css `
56
+ :host {
57
+ min-height: 100%;
58
+ display: flex;
59
+ flex-direction: column;
60
+ }
61
+
62
+ .sticky {
63
+ position: sticky;
64
+ top: 0;
65
+ z-index: 1;
66
+ }
67
+
68
+ [part=main] {
69
+ position: relative;
70
+ flex: 1;
71
+ width: 100%;
72
+ }
73
+
74
+ header,
75
+ main,
76
+ footer {
77
+ width: 100%;
78
+ }
79
+ `)
80
+ ], NavLayout);
81
+ export default NavLayout;
82
+ //# sourceMappingURL=layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/components/layout.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AACnE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,SAAS,GAAG,QAAQ,CAAC;AAE3B;;;;;;;GAOG;AA6BH,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,WAAW;IAAnC;;QACE;;WAEG;QAEH,aAAQ,GAAG,KAAK,CAAC;QAEjB;;WAEG;QAEH,aAAQ,GAAG,KAAK,CAAC;QAEjB;;WAEG;QAEH,WAAM,GAAG,KAAK,CAAC;IAejB,CAAC;IAbW,MAAM;QACd,OAAO,IAAI,CAAA,GACT,CAAC,IAAI,CAAC,QAAQ;YACZ,CAAC,CAAC,IAAI,CAAA,gCAAgC,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,QAAQ,CAAC,QAAQ,CAAC,WAAW;YAC1G,CAAC,CAAC,EACN;wBACoB,QAAQ,EAAE;MAE5B,CAAC,IAAI,CAAC,QAAQ;YACZ,CAAC,CAAC,IAAI,CAAA,yBAAyB,QAAQ,CAAC,QAAQ,CAAC,WAAW;YAC5D,CAAC,CAAC,EACN,EAAE,CAAC;IACL,CAAC;CACF,CAAA;AA3BC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EA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