godown 3.0.0-canary.9 → 3.0.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 (510) hide show
  1. package/README.md +38 -9
  2. package/alert.d.ts +1 -0
  3. package/alert.d.ts.map +1 -1
  4. package/alert.js +1 -5
  5. package/alert.js.map +1 -1
  6. package/avatar.d.ts +1 -0
  7. package/avatar.d.ts.map +1 -1
  8. package/avatar.js +1 -5
  9. package/avatar.js.map +1 -1
  10. package/badge.d.ts +9 -0
  11. package/badge.d.ts.map +1 -0
  12. package/badge.js +2 -0
  13. package/badge.js.map +1 -0
  14. package/breath.js +1 -5
  15. package/breath.js.map +1 -1
  16. package/build/godown+lit.iife.js +59 -0
  17. package/build/godown+lit.iife.js.map +1 -0
  18. package/build/godown+lit.js +59 -0
  19. package/build/godown+lit.js.map +1 -0
  20. package/build/godown+lit.umd.js +59 -0
  21. package/build/godown+lit.umd.js.map +1 -0
  22. package/build/godown.iife.js +47 -0
  23. package/build/godown.js +48 -0
  24. package/build/godown.js.map +1 -0
  25. package/build/godown.umd.js +48 -0
  26. package/build/godown.umd.js.map +1 -0
  27. package/button.d.ts +1 -0
  28. package/button.d.ts.map +1 -1
  29. package/button.js +1 -5
  30. package/button.js.map +1 -1
  31. package/card.d.ts +1 -0
  32. package/card.d.ts.map +1 -1
  33. package/card.js +1 -5
  34. package/card.js.map +1 -1
  35. package/carousel.d.ts +1 -0
  36. package/carousel.d.ts.map +1 -1
  37. package/carousel.js +1 -5
  38. package/carousel.js.map +1 -1
  39. package/components/alert.d.ts +4 -1
  40. package/components/alert.d.ts.map +1 -1
  41. package/components/alert.js +1 -176
  42. package/components/alert.js.map +1 -1
  43. package/components/avatar.d.ts +7 -2
  44. package/components/avatar.d.ts.map +1 -1
  45. package/components/avatar.js +1 -62
  46. package/components/avatar.js.map +1 -1
  47. package/components/badge.d.ts +23 -0
  48. package/components/badge.d.ts.map +1 -0
  49. package/components/badge.js +2 -0
  50. package/components/badge.js.map +1 -0
  51. package/components/breath.d.ts +6 -4
  52. package/components/breath.d.ts.map +1 -1
  53. package/components/breath.js +1 -80
  54. package/components/breath.js.map +1 -1
  55. package/components/button.d.ts +8 -5
  56. package/components/button.d.ts.map +1 -1
  57. package/components/button.js +1 -168
  58. package/components/button.js.map +1 -1
  59. package/components/card.d.ts +3 -1
  60. package/components/card.d.ts.map +1 -1
  61. package/components/card.js +1 -48
  62. package/components/card.js.map +1 -1
  63. package/components/carousel.d.ts +5 -1
  64. package/components/carousel.d.ts.map +1 -1
  65. package/components/carousel.js +1 -113
  66. package/components/carousel.js.map +1 -1
  67. package/components/details.d.ts +4 -3
  68. package/components/details.d.ts.map +1 -1
  69. package/components/details.js +1 -52
  70. package/components/details.js.map +1 -1
  71. package/components/dialog.d.ts +4 -2
  72. package/components/dialog.d.ts.map +1 -1
  73. package/components/dialog.js +1 -96
  74. package/components/dialog.js.map +1 -1
  75. package/components/divider.d.ts +3 -3
  76. package/components/divider.d.ts.map +1 -1
  77. package/components/divider.js +1 -36
  78. package/components/divider.js.map +1 -1
  79. package/components/dragbox.d.ts +4 -2
  80. package/components/dragbox.d.ts.map +1 -1
  81. package/components/dragbox.js +1 -109
  82. package/components/dragbox.js.map +1 -1
  83. package/components/flex.d.ts +3 -1
  84. package/components/flex.d.ts.map +1 -1
  85. package/components/flex.js +1 -62
  86. package/components/flex.js.map +1 -1
  87. package/components/form.d.ts +3 -1
  88. package/components/form.d.ts.map +1 -1
  89. package/components/form.js +1 -75
  90. package/components/form.js.map +1 -1
  91. package/components/grid.d.ts +3 -1
  92. package/components/grid.d.ts.map +1 -1
  93. package/components/grid.js +1 -56
  94. package/components/grid.js.map +1 -1
  95. package/components/heading.d.ts +29 -0
  96. package/components/heading.d.ts.map +1 -0
  97. package/components/heading.js +2 -0
  98. package/components/heading.js.map +1 -0
  99. package/components/input.d.ts +5 -1
  100. package/components/input.d.ts.map +1 -1
  101. package/components/input.js +1 -50
  102. package/components/input.js.map +1 -1
  103. package/components/layout.d.ts +6 -4
  104. package/components/layout.d.ts.map +1 -1
  105. package/components/layout.js +1 -58
  106. package/components/layout.js.map +1 -1
  107. package/components/link.d.ts +5 -0
  108. package/components/link.d.ts.map +1 -1
  109. package/components/link.js +1 -44
  110. package/components/link.js.map +1 -1
  111. package/components/progress.d.ts +3 -1
  112. package/components/progress.d.ts.map +1 -1
  113. package/components/progress.js +1 -58
  114. package/components/progress.js.map +1 -1
  115. package/components/range.d.ts +10 -4
  116. package/components/range.d.ts.map +1 -1
  117. package/components/range.js +1 -266
  118. package/components/range.js.map +1 -1
  119. package/components/rotate.d.ts +3 -1
  120. package/components/rotate.d.ts.map +1 -1
  121. package/components/rotate.js +1 -56
  122. package/components/rotate.js.map +1 -1
  123. package/components/router.d.ts +14 -16
  124. package/components/router.d.ts.map +1 -1
  125. package/components/router.js +1 -250
  126. package/components/router.js.map +1 -1
  127. package/components/select.d.ts +7 -2
  128. package/components/select.d.ts.map +1 -1
  129. package/components/select.js +1 -211
  130. package/components/select.js.map +1 -1
  131. package/components/skeleton.d.ts +3 -1
  132. package/components/skeleton.d.ts.map +1 -1
  133. package/components/skeleton.js +1 -54
  134. package/components/skeleton.js.map +1 -1
  135. package/components/split.d.ts +8 -2
  136. package/components/split.d.ts.map +1 -1
  137. package/components/split.js +1 -153
  138. package/components/split.js.map +1 -1
  139. package/components/switch.d.ts +5 -2
  140. package/components/switch.d.ts.map +1 -1
  141. package/components/switch.js +1 -92
  142. package/components/switch.js.map +1 -1
  143. package/components/text.d.ts +3 -1
  144. package/components/text.d.ts.map +1 -1
  145. package/components/text.js +1 -43
  146. package/components/text.js.map +1 -1
  147. package/components/time.d.ts +4 -2
  148. package/components/time.d.ts.map +1 -1
  149. package/components/time.js +1 -77
  150. package/components/time.js.map +1 -1
  151. package/components/tooltip.d.ts +4 -2
  152. package/components/tooltip.d.ts.map +1 -1
  153. package/components/tooltip.js +1 -80
  154. package/components/tooltip.js.map +1 -1
  155. package/components/typewriter.d.ts +6 -12
  156. package/components/typewriter.d.ts.map +1 -1
  157. package/components/typewriter.js +1 -129
  158. package/components/typewriter.js.map +1 -1
  159. package/core/global-style.d.ts +2 -2
  160. package/core/global-style.d.ts.map +1 -1
  161. package/core/global-style.js +1 -52
  162. package/core/global-style.js.map +1 -1
  163. package/core/super-anchor.d.ts +2 -1
  164. package/core/super-anchor.d.ts.map +1 -1
  165. package/core/super-anchor.js +1 -38
  166. package/core/super-anchor.js.map +1 -1
  167. package/core/super-input.d.ts +4 -3
  168. package/core/super-input.d.ts.map +1 -1
  169. package/core/super-input.js +1 -111
  170. package/core/super-input.js.map +1 -1
  171. package/core/super-openable.d.ts +1 -1
  172. package/core/super-openable.d.ts.map +1 -1
  173. package/core/super-openable.js +1 -37
  174. package/core/super-openable.js.map +1 -1
  175. package/custom-elements.json +1 -1
  176. package/details.d.ts +1 -0
  177. package/details.d.ts.map +1 -1
  178. package/details.js +1 -5
  179. package/details.js.map +1 -1
  180. package/dev/alert.d.ts +1 -0
  181. package/dev/alert.d.ts.map +1 -1
  182. package/dev/alert.js +1 -0
  183. package/dev/alert.js.map +1 -1
  184. package/dev/avatar.d.ts +1 -0
  185. package/dev/avatar.d.ts.map +1 -1
  186. package/dev/avatar.js +1 -0
  187. package/dev/avatar.js.map +1 -1
  188. package/dev/badge.d.ts +9 -0
  189. package/dev/badge.d.ts.map +1 -0
  190. package/dev/badge.js +5 -0
  191. package/dev/badge.js.map +1 -0
  192. package/dev/button.d.ts +1 -0
  193. package/dev/button.d.ts.map +1 -1
  194. package/dev/button.js +1 -0
  195. package/dev/button.js.map +1 -1
  196. package/dev/card.d.ts +1 -0
  197. package/dev/card.d.ts.map +1 -1
  198. package/dev/card.js +1 -0
  199. package/dev/card.js.map +1 -1
  200. package/dev/carousel.d.ts +1 -0
  201. package/dev/carousel.d.ts.map +1 -1
  202. package/dev/carousel.js +1 -0
  203. package/dev/carousel.js.map +1 -1
  204. package/dev/components/alert.d.ts +4 -1
  205. package/dev/components/alert.d.ts.map +1 -1
  206. package/dev/components/alert.js +20 -23
  207. package/dev/components/alert.js.map +1 -1
  208. package/dev/components/avatar.d.ts +7 -2
  209. package/dev/components/avatar.d.ts.map +1 -1
  210. package/dev/components/avatar.js +22 -10
  211. package/dev/components/avatar.js.map +1 -1
  212. package/dev/components/badge.d.ts +23 -0
  213. package/dev/components/badge.d.ts.map +1 -0
  214. package/dev/components/badge.js +107 -0
  215. package/dev/components/badge.js.map +1 -0
  216. package/dev/components/breath.d.ts +6 -4
  217. package/dev/components/breath.d.ts.map +1 -1
  218. package/dev/components/breath.js +29 -26
  219. package/dev/components/breath.js.map +1 -1
  220. package/dev/components/button.d.ts +8 -5
  221. package/dev/components/button.d.ts.map +1 -1
  222. package/dev/components/button.js +31 -17
  223. package/dev/components/button.js.map +1 -1
  224. package/dev/components/card.d.ts +3 -1
  225. package/dev/components/card.d.ts.map +1 -1
  226. package/dev/components/card.js +8 -11
  227. package/dev/components/card.js.map +1 -1
  228. package/dev/components/carousel.d.ts +5 -1
  229. package/dev/components/carousel.d.ts.map +1 -1
  230. package/dev/components/carousel.js +32 -26
  231. package/dev/components/carousel.js.map +1 -1
  232. package/dev/components/details.d.ts +4 -3
  233. package/dev/components/details.d.ts.map +1 -1
  234. package/dev/components/details.js +22 -27
  235. package/dev/components/details.js.map +1 -1
  236. package/dev/components/dialog.d.ts +4 -2
  237. package/dev/components/dialog.d.ts.map +1 -1
  238. package/dev/components/dialog.js +17 -16
  239. package/dev/components/dialog.js.map +1 -1
  240. package/dev/components/divider.d.ts +3 -3
  241. package/dev/components/divider.d.ts.map +1 -1
  242. package/dev/components/divider.js +29 -17
  243. package/dev/components/divider.js.map +1 -1
  244. package/dev/components/dragbox.d.ts +4 -2
  245. package/dev/components/dragbox.d.ts.map +1 -1
  246. package/dev/components/dragbox.js +11 -4
  247. package/dev/components/dragbox.js.map +1 -1
  248. package/dev/components/flex.d.ts +3 -1
  249. package/dev/components/flex.d.ts.map +1 -1
  250. package/dev/components/flex.js +17 -9
  251. package/dev/components/flex.js.map +1 -1
  252. package/dev/components/form.d.ts +3 -1
  253. package/dev/components/form.d.ts.map +1 -1
  254. package/dev/components/form.js +2 -3
  255. package/dev/components/form.js.map +1 -1
  256. package/dev/components/grid.d.ts +3 -1
  257. package/dev/components/grid.d.ts.map +1 -1
  258. package/dev/components/grid.js +17 -10
  259. package/dev/components/grid.js.map +1 -1
  260. package/dev/components/heading.d.ts +29 -0
  261. package/dev/components/heading.d.ts.map +1 -0
  262. package/dev/components/heading.js +103 -0
  263. package/dev/components/heading.js.map +1 -0
  264. package/dev/components/input.d.ts +5 -1
  265. package/dev/components/input.d.ts.map +1 -1
  266. package/dev/components/input.js +17 -17
  267. package/dev/components/input.js.map +1 -1
  268. package/dev/components/layout.d.ts +6 -4
  269. package/dev/components/layout.d.ts.map +1 -1
  270. package/dev/components/layout.js +23 -22
  271. package/dev/components/layout.js.map +1 -1
  272. package/dev/components/link.d.ts +5 -0
  273. package/dev/components/link.d.ts.map +1 -1
  274. package/dev/components/link.js +12 -2
  275. package/dev/components/link.js.map +1 -1
  276. package/dev/components/progress.d.ts +3 -1
  277. package/dev/components/progress.d.ts.map +1 -1
  278. package/dev/components/progress.js +41 -38
  279. package/dev/components/progress.js.map +1 -1
  280. package/dev/components/range.d.ts +10 -4
  281. package/dev/components/range.d.ts.map +1 -1
  282. package/dev/components/range.js +53 -51
  283. package/dev/components/range.js.map +1 -1
  284. package/dev/components/rotate.d.ts +3 -1
  285. package/dev/components/rotate.d.ts.map +1 -1
  286. package/dev/components/rotate.js +3 -5
  287. package/dev/components/rotate.js.map +1 -1
  288. package/dev/components/router.d.ts +14 -16
  289. package/dev/components/router.d.ts.map +1 -1
  290. package/dev/components/router.js +14 -27
  291. package/dev/components/router.js.map +1 -1
  292. package/dev/components/select.d.ts +7 -2
  293. package/dev/components/select.d.ts.map +1 -1
  294. package/dev/components/select.js +44 -31
  295. package/dev/components/select.js.map +1 -1
  296. package/dev/components/skeleton.d.ts +3 -1
  297. package/dev/components/skeleton.d.ts.map +1 -1
  298. package/dev/components/skeleton.js +9 -9
  299. package/dev/components/skeleton.js.map +1 -1
  300. package/dev/components/split.d.ts +8 -2
  301. package/dev/components/split.d.ts.map +1 -1
  302. package/dev/components/split.js +32 -24
  303. package/dev/components/split.js.map +1 -1
  304. package/dev/components/switch.d.ts +5 -2
  305. package/dev/components/switch.d.ts.map +1 -1
  306. package/dev/components/switch.js +22 -25
  307. package/dev/components/switch.js.map +1 -1
  308. package/dev/components/text.d.ts +3 -1
  309. package/dev/components/text.d.ts.map +1 -1
  310. package/dev/components/text.js +12 -15
  311. package/dev/components/text.js.map +1 -1
  312. package/dev/components/time.d.ts +4 -2
  313. package/dev/components/time.d.ts.map +1 -1
  314. package/dev/components/time.js +7 -5
  315. package/dev/components/time.js.map +1 -1
  316. package/dev/components/tooltip.d.ts +4 -2
  317. package/dev/components/tooltip.d.ts.map +1 -1
  318. package/dev/components/tooltip.js +37 -27
  319. package/dev/components/tooltip.js.map +1 -1
  320. package/dev/components/typewriter.d.ts +6 -12
  321. package/dev/components/typewriter.d.ts.map +1 -1
  322. package/dev/components/typewriter.js +22 -36
  323. package/dev/components/typewriter.js.map +1 -1
  324. package/dev/core/global-style.d.ts +2 -2
  325. package/dev/core/global-style.d.ts.map +1 -1
  326. package/dev/core/global-style.js +11 -6
  327. package/dev/core/global-style.js.map +1 -1
  328. package/dev/core/super-anchor.d.ts +2 -1
  329. package/dev/core/super-anchor.d.ts.map +1 -1
  330. package/dev/core/super-anchor.js +25 -23
  331. package/dev/core/super-anchor.js.map +1 -1
  332. package/dev/core/super-input.d.ts +4 -3
  333. package/dev/core/super-input.d.ts.map +1 -1
  334. package/dev/core/super-input.js +43 -36
  335. package/dev/core/super-input.js.map +1 -1
  336. package/dev/core/super-openable.d.ts +1 -1
  337. package/dev/core/super-openable.d.ts.map +1 -1
  338. package/dev/core/super-openable.js +2 -2
  339. package/dev/core/super-openable.js.map +1 -1
  340. package/dev/details.d.ts +1 -0
  341. package/dev/details.d.ts.map +1 -1
  342. package/dev/details.js +1 -0
  343. package/dev/details.js.map +1 -1
  344. package/dev/dialog.d.ts +1 -0
  345. package/dev/dialog.d.ts.map +1 -1
  346. package/dev/dialog.js +1 -0
  347. package/dev/dialog.js.map +1 -1
  348. package/dev/divider.d.ts +1 -0
  349. package/dev/divider.d.ts.map +1 -1
  350. package/dev/divider.js +1 -0
  351. package/dev/divider.js.map +1 -1
  352. package/dev/dragbox.d.ts +1 -0
  353. package/dev/dragbox.d.ts.map +1 -1
  354. package/dev/dragbox.js +1 -0
  355. package/dev/dragbox.js.map +1 -1
  356. package/dev/flex.d.ts +1 -0
  357. package/dev/flex.d.ts.map +1 -1
  358. package/dev/flex.js +1 -0
  359. package/dev/flex.js.map +1 -1
  360. package/dev/form.d.ts +1 -0
  361. package/dev/form.d.ts.map +1 -1
  362. package/dev/form.js +1 -0
  363. package/dev/form.js.map +1 -1
  364. package/dev/grid.d.ts +1 -0
  365. package/dev/grid.d.ts.map +1 -1
  366. package/dev/grid.js +1 -0
  367. package/dev/grid.js.map +1 -1
  368. package/dev/heading.d.ts +9 -0
  369. package/dev/heading.d.ts.map +1 -0
  370. package/dev/heading.js +5 -0
  371. package/dev/heading.js.map +1 -0
  372. package/dev/index.d.ts +2 -0
  373. package/dev/index.d.ts.map +1 -1
  374. package/dev/index.js +2 -0
  375. package/dev/index.js.map +1 -1
  376. package/dev/layout.d.ts.map +1 -1
  377. package/dev/progress.d.ts.map +1 -1
  378. package/dev/router.d.ts.map +1 -1
  379. package/dev/split.d.ts +1 -1
  380. package/dev/split.d.ts.map +1 -1
  381. package/dev/typewriter.d.ts +1 -0
  382. package/dev/typewriter.d.ts.map +1 -1
  383. package/dev/typewriter.js +1 -0
  384. package/dev/typewriter.js.map +1 -1
  385. package/dialog.d.ts +1 -0
  386. package/dialog.d.ts.map +1 -1
  387. package/dialog.js +1 -5
  388. package/dialog.js.map +1 -1
  389. package/divider.d.ts +1 -0
  390. package/divider.d.ts.map +1 -1
  391. package/divider.js +1 -5
  392. package/divider.js.map +1 -1
  393. package/dragbox.d.ts +1 -0
  394. package/dragbox.d.ts.map +1 -1
  395. package/dragbox.js +1 -5
  396. package/dragbox.js.map +1 -1
  397. package/flex.d.ts +1 -0
  398. package/flex.d.ts.map +1 -1
  399. package/flex.js +1 -5
  400. package/flex.js.map +1 -1
  401. package/form.d.ts +1 -0
  402. package/form.d.ts.map +1 -1
  403. package/form.js +1 -5
  404. package/form.js.map +1 -1
  405. package/grid.d.ts +1 -0
  406. package/grid.d.ts.map +1 -1
  407. package/grid.js +1 -5
  408. package/grid.js.map +1 -1
  409. package/heading.d.ts +9 -0
  410. package/heading.d.ts.map +1 -0
  411. package/heading.js +2 -0
  412. package/heading.js.map +1 -0
  413. package/index.d.ts +2 -0
  414. package/index.d.ts.map +1 -1
  415. package/index.js +1 -56
  416. package/index.js.map +1 -1
  417. package/input.js +1 -5
  418. package/input.js.map +1 -1
  419. package/layout.d.ts.map +1 -1
  420. package/layout.js +1 -5
  421. package/layout.js.map +1 -1
  422. package/link.js +1 -5
  423. package/link.js.map +1 -1
  424. package/package.json +11 -6
  425. package/progress.d.ts.map +1 -1
  426. package/progress.js +1 -5
  427. package/progress.js.map +1 -1
  428. package/range.js +1 -5
  429. package/range.js.map +1 -1
  430. package/rotate.js +1 -5
  431. package/rotate.js.map +1 -1
  432. package/router.d.ts.map +1 -1
  433. package/router.js +1 -5
  434. package/router.js.map +1 -1
  435. package/select.js +1 -5
  436. package/select.js.map +1 -1
  437. package/skeleton.js +1 -5
  438. package/skeleton.js.map +1 -1
  439. package/split.d.ts +1 -1
  440. package/split.d.ts.map +1 -1
  441. package/split.js +1 -5
  442. package/split.js.map +1 -1
  443. package/src/alert.ts +2 -0
  444. package/src/avatar.ts +2 -0
  445. package/src/badge.ts +13 -0
  446. package/src/button.ts +2 -0
  447. package/src/card.ts +2 -0
  448. package/src/carousel.ts +2 -0
  449. package/src/components/alert.ts +26 -29
  450. package/src/components/avatar.ts +26 -14
  451. package/src/components/badge.ts +107 -0
  452. package/src/components/breath.ts +36 -31
  453. package/src/components/button.ts +31 -32
  454. package/src/components/card.ts +9 -12
  455. package/src/components/carousel.ts +41 -34
  456. package/src/components/details.ts +24 -29
  457. package/src/components/dialog.ts +24 -25
  458. package/src/components/divider.ts +29 -17
  459. package/src/components/dragbox.ts +18 -13
  460. package/src/components/flex.ts +20 -10
  461. package/src/components/form.ts +6 -7
  462. package/src/components/grid.ts +20 -11
  463. package/src/components/heading.ts +105 -0
  464. package/src/components/input.ts +20 -20
  465. package/src/components/layout.ts +20 -23
  466. package/src/components/link.ts +12 -3
  467. package/src/components/progress.ts +46 -41
  468. package/src/components/range.ts +69 -76
  469. package/src/components/rotate.ts +11 -10
  470. package/src/components/router.ts +42 -40
  471. package/src/components/select.ts +57 -45
  472. package/src/components/skeleton.ts +11 -11
  473. package/src/components/split.ts +45 -35
  474. package/src/components/switch.ts +27 -30
  475. package/src/components/text.ts +14 -21
  476. package/src/components/time.ts +14 -12
  477. package/src/components/tooltip.ts +36 -32
  478. package/src/components/typewriter.ts +32 -45
  479. package/src/core/global-style.ts +25 -11
  480. package/src/core/super-anchor.ts +30 -26
  481. package/src/core/super-input.ts +53 -53
  482. package/src/core/super-openable.ts +7 -7
  483. package/src/details.ts +2 -0
  484. package/src/dialog.ts +2 -0
  485. package/src/divider.ts +2 -0
  486. package/src/dragbox.ts +2 -0
  487. package/src/flex.ts +2 -0
  488. package/src/form.ts +2 -0
  489. package/src/grid.ts +2 -0
  490. package/src/heading.ts +13 -0
  491. package/src/index.ts +2 -0
  492. package/src/layout.ts +1 -0
  493. package/src/progress.ts +1 -0
  494. package/src/router.ts +1 -0
  495. package/src/split.ts +1 -1
  496. package/src/typewriter.ts +2 -0
  497. package/switch.js +1 -5
  498. package/switch.js.map +1 -1
  499. package/text.js +1 -5
  500. package/text.js.map +1 -1
  501. package/time.js +1 -5
  502. package/time.js.map +1 -1
  503. package/tooltip.js +1 -5
  504. package/tooltip.js.map +1 -1
  505. package/typewriter.d.ts +1 -0
  506. package/typewriter.d.ts.map +1 -1
  507. package/typewriter.js +1 -5
  508. package/typewriter.js.map +1 -1
  509. package/vscode.html-custom-data.json +1 -1
  510. package/web-types.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/components/router.ts"],"names":[],"mappings":"AAIA,OAAO,EAAO,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGtE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAItD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,cAEM,MAAM,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,WAAW;IAC3C,MAAM,CAAC,eAAe,uBAAqB;IAE3C,OAAO,CAAC,gBAAgB,CAA8B;IACtD,OAAO,CAAC,kBAAkB,CAA8B;IACxD,OAAO,CAAC,aAAa,CAAwD;IAC7E,OAAO,CAAC,QAAQ,CAMZ;IAEJ;;OAEG;IAEH,SAAS,EAAE,CAAC,GAAG,cAAc,CAAQ;IAErC;;OAEG;IAEH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;IAEpC;;OAEG;IAEH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IAEH,QAAQ,SAAM;IAEd;;OAEG;IAEH,OAAO,SAAM;IAEb;;OAEG;IAEH,OAAO,EAAE,cAAc,CAAc;IAErC;;;;;;OAMG;IAEH,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAY;IAEhD;;;;OAIG;IAEH,KAAK,UAAS;IAEd,IACI,MAAM,CAAC,KAAK;;;QAAA,EAGf;IAED,IAAI,MAAM;;;SAET;IAED,KAAK;IAIL,SAAS,CAAC,MAAM;IAsBhB,iBAAiB;IAgBjB,oBAAoB;IAKpB,SAAS;;;;;;IAST;;OAEG;IACH,mBAAmB,EAAE,CAAC,MAAM,EAAE;QAC5B,QAAQ,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,MAAM,CAAC,CAAC;QAC/B,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,OAAO,GAAG,cAAc,CAAC;KACrC,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAQ;IAElC,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAalE;;OAEG;IACH,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO;IAqBvC;;OAEG;IACH,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC;IAiBnD;;OAEG;IACH,oBAAoB,IAAI,IAAI;IAQ5B;;OAEG;IACH,kBAAkB,CAAC,KAAK,EAAE,OAAO,IAAI,CAAC,MAAM,GAAG,IAAI;IAQnD,WAAW,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,GAAE,MAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIxF,MAAM,CAAC,SAAS,IAAI,IAAI;IAMxB,cAAc,QAEF,IAAI,CAAC;CAClB;AAED,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,251 +1,2 @@
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 { RouteTree } from '@godown/element/tools/route-tree.js';
6
- import { css } from 'lit';
7
- import { state, property } from 'lit/decorators.js';
8
- import { GlobalStyle } from '../core/global-style.js';
9
-
10
- var Router_1;
11
- const protoName = "router";
12
- /**
13
- * {@linkcode Router} has basic routing control.
14
- *
15
- * To switch routes, use `router-link component`.
16
- *
17
- * It has two methods to collect routes.
18
- *
19
- * 1. From field `routes`, an array, each elements require "path" and "component".
20
- * 2. From child elements, which have the slot attribute for matching routes.
21
- *
22
- * If only the method 1 is used, set `type` to `"field"`.
23
- *
24
- * If only the method 2 is used, set `type` to `"slotted"`.
25
- *
26
- * `type` defaults to `"united"`, which will try method 1, then method 2.
27
- *
28
- * If no routes are matched, the default value (no named slot) will be rendered.
29
- *
30
- * @slot - Display slot when there is no match.
31
- * @slot * - Matching slot will be displayed.
32
- * @category navigation
33
- */
34
- let Router = Router_1 = class Router extends GlobalStyle {
35
- constructor() {
36
- super(...arguments);
37
- this.__fieldRouteTree = new RouteTree();
38
- this.__slottedRouteTree = new RouteTree();
39
- this.__cacheRecord = new Map();
40
- /**
41
- * Render result.
42
- */
43
- this.component = null;
44
- /**
45
- * Dynamic parameters record.
46
- */
47
- this.params = {};
48
- /**
49
- * Current pathname (equals to location.pathname).
50
- */
51
- this.pathname = "";
52
- /**
53
- * Path prefix.
54
- */
55
- this.baseURL = "";
56
- /**
57
- * Rendered content when there is no match.
58
- */
59
- this.default = htmlSlot();
60
- /**
61
- * The type of routing sources.
62
- *
63
- * If field, it won't collect the slot attribute of the child elements.
64
- *
65
- * This property should not be changed after the rendering is complete.
66
- */
67
- this.type = "united";
68
- /**
69
- * Cache accessed records.
70
- *
71
- * Emptied at each re-collection.
72
- */
73
- this.cache = false;
74
- /**
75
- * Callback function when the route changes.
76
- */
77
- this.routeChangeCallback = null;
78
- this.handlePopstate = this.events.add(window, "popstate", () => {
79
- this.pathname = location.pathname;
80
- });
81
- }
82
- set routes(value) {
83
- this.__routes = value;
84
- this.collectFieldRoutes(value);
85
- }
86
- get routes() {
87
- return this.__routes;
88
- }
89
- clear() {
90
- this.__cacheRecord.clear();
91
- }
92
- render() {
93
- this.params = {};
94
- if (this.cache) {
95
- const cached = this.__cacheRecord.get(this.pathname);
96
- if (cached) {
97
- Object.assign(this, cached);
98
- return this.component;
99
- }
100
- }
101
- switch (this.type) {
102
- case "field":
103
- this.component = this.fieldComponent();
104
- break;
105
- case "slotted":
106
- this.component = this.slottedComponent();
107
- break;
108
- default:
109
- this.component = this.fieldComponent() ?? this.slottedComponent();
110
- }
111
- return this.component ?? this.default ?? null;
112
- }
113
- connectedCallback() {
114
- super.connectedCallback();
115
- Router_1.routerInstances.add(this);
116
- this.pathname ??= location.pathname;
117
- if (this.type !== "field") {
118
- const mutationObserver = new MutationObserver(this.collectSlottedRoutes);
119
- mutationObserver.observe(this, {
120
- attributeFilter: ["slot"],
121
- attributes: true,
122
- subtree: true,
123
- });
124
- this.collectSlottedRoutes();
125
- }
126
- }
127
- disconnectedCallback() {
128
- super.disconnectedCallback();
129
- Router_1.routerInstances.delete(this);
130
- }
131
- useRouter() {
132
- return {
133
- pathname: this.pathname,
134
- params: this.params,
135
- path: this.path,
136
- component: this.component,
137
- };
138
- }
139
- updated(changedProperties) {
140
- const shouldDispatch = changedProperties.has("pathname") || changedProperties.has("path");
141
- if (shouldDispatch) {
142
- const ur = this.useRouter();
143
- const noRecord = !this.__cacheRecord.has(this.pathname);
144
- if (noRecord) {
145
- this.__cacheRecord.set(this.pathname, ur);
146
- }
147
- this.routeChangeCallback?.(ur, noRecord);
148
- this.dispatchEvent(new CustomEvent("change", { detail: ur }));
149
- }
150
- }
151
- /**
152
- * Get component from {@linkcode routes} by query.
153
- */
154
- fieldComponent(query) {
155
- query ||= this.useWhich(this.pathname);
156
- this.path = query;
157
- if (!query) {
158
- return null;
159
- }
160
- this.params = this.parseParams(this.path, this.pathname);
161
- const route = this.routes.find((r) => r.path === query);
162
- if (!route) {
163
- return null;
164
- }
165
- return route.component;
166
- }
167
- /**
168
- * Get component from slotted elements by query.
169
- */
170
- slottedComponent(usedRouteTemplate) {
171
- const slottedPaths = this._slottedNames;
172
- usedRouteTemplate ||= this.__slottedRouteTree.useWhich(this.pathname);
173
- this.path = usedRouteTemplate;
174
- if (!usedRouteTemplate) {
175
- return null;
176
- }
177
- this.path = slottedPaths.find((s) => s === usedRouteTemplate);
178
- if (!this.path) {
179
- return null;
180
- }
181
- this.params = this.parseParams(usedRouteTemplate, this.pathname);
182
- return htmlSlot(this.path);
183
- }
184
- /**
185
- * Reset the route tree, clear cache, collect routes from child elements.
186
- */
187
- collectSlottedRoutes() {
188
- this.__slottedRouteTree = new RouteTree();
189
- this.clear();
190
- this._slottedNames.forEach(slotName => {
191
- this.__slottedRouteTree.insert(slotName);
192
- });
193
- }
194
- /**
195
- * Reset the route tree, clear cache, collect routes from value.
196
- */
197
- collectFieldRoutes(value) {
198
- this.__fieldRouteTree = new RouteTree();
199
- this.clear();
200
- value.forEach(({ path }) => {
201
- this.__fieldRouteTree.insert(path);
202
- });
203
- }
204
- useWhich(path) {
205
- return this.__fieldRouteTree.useWhich(this.baseURL + path);
206
- }
207
- parseParams(routeTemplate, path) {
208
- return this.__fieldRouteTree.parseParams(path, routeTemplate);
209
- }
210
- static updateAll() {
211
- this.routerInstances.forEach((i) => {
212
- i.handlePopstate();
213
- });
214
- }
215
- };
216
- Router.routerInstances = new Set();
217
- __decorate([
218
- state()
219
- ], Router.prototype, "component", void 0);
220
- __decorate([
221
- state()
222
- ], Router.prototype, "params", void 0);
223
- __decorate([
224
- state()
225
- ], Router.prototype, "path", void 0);
226
- __decorate([
227
- property()
228
- ], Router.prototype, "pathname", void 0);
229
- __decorate([
230
- property()
231
- ], Router.prototype, "baseURL", void 0);
232
- __decorate([
233
- state()
234
- ], Router.prototype, "default", void 0);
235
- __decorate([
236
- property()
237
- ], Router.prototype, "type", void 0);
238
- __decorate([
239
- property({ type: Boolean })
240
- ], Router.prototype, "cache", void 0);
241
- __decorate([
242
- state()
243
- ], Router.prototype, "routes", null);
244
- Router = Router_1 = __decorate([
245
- godown(protoName),
246
- styles(css `:host{display:contents}`)
247
- ], Router);
248
- var Router$1 = Router;
249
-
250
- export { Router$1 as default };
1
+ import{__decorate as t}from"tslib";import{godown as e,styles as s,RouteTree as o,htmlSlot as a}from"@godown/element";import{css as h}from"lit";import{state as i,property as n}from"lit/decorators.js";import{GlobalStyle as r}from"../core/global-style.js";var p;let l=p=class Router extends r{constructor(){super(...arguments),this.__fieldRouteTree=new o,this.__slottedRouteTree=new o,this.__cacheRecord=new Map,this.component=null,this.params={},this.default=a(),this.type="united",this.cache=!1,this.routeChangeCallback=null,this.handlePopstate=this.events.add(window,"popstate",(()=>{this.pathname=location.pathname}))}set routes(t){this.__routes=t,this.collectFieldRoutes(t)}get routes(){return this.__routes}clear(){this.__cacheRecord.clear()}render(){if(this.params={},this.cache){const t=this.__cacheRecord.get(this.pathname);if(t)return Object.assign(this,t),this.component}switch(this.type){case"field":this.component=this.fieldComponent();break;case"slotted":this.component=this.slottedComponent();break;default:this.component=this.fieldComponent()??this.slottedComponent()}return this.component??this.default??null}connectedCallback(){if(super.connectedCallback(),p.routerInstances.add(this),this.pathname??=location.pathname,"field"!==this.type){new MutationObserver(this.collectSlottedRoutes).observe(this,{attributeFilter:["slot"],attributes:!0,subtree:!0}),this.collectSlottedRoutes()}}disconnectedCallback(){super.disconnectedCallback(),p.routerInstances.delete(this)}useRouter(){return{pathname:this.pathname,params:this.params,path:this.path,component:this.component}}updated(t){if(t.has("pathname")||t.has("path")){const t=this.useRouter(),e=!this.__cacheRecord.has(this.pathname);e&&this.__cacheRecord.set(this.pathname,t),this.routeChangeCallback?.(t,e),this.dispatchEvent(new CustomEvent("change",{detail:t}))}}fieldComponent(t){if(t||=this.__fieldRouteTree.search(this.pathname)?.pattern,this.path=t,!t)return null;this.params=this.parseParams(this.path,this.pathname);const e=this.routes.find((e=>e.path===t));return e?"render"in e?e.render?.(this.useRouter())||null:e.component:null}slottedComponent(t){const e=this._slottedNames;return t||=this.__slottedRouteTree.search(this.pathname)?.pattern,this.path=t,t?(this.path=e.find((e=>e===t)),this.path?(this.params=this.parseParams(t,this.pathname),a(this.path)):null):null}collectSlottedRoutes(){this.__slottedRouteTree=new o,this.clear(),this._slottedNames.forEach((t=>{this.__slottedRouteTree.insert(t)}))}collectFieldRoutes(t){this.__fieldRouteTree=new o,this.clear(),t.forEach((({path:t})=>{this.__fieldRouteTree.insert(t)}))}parseParams(t,e=this.pathname){return o.parseParams(e,t)}static updateAll(){this.routerInstances.forEach((t=>{t.handlePopstate()}))}};l.routerInstances=new Set,t([i()],l.prototype,"component",void 0),t([i()],l.prototype,"params",void 0),t([i()],l.prototype,"path",void 0),t([n()],l.prototype,"pathname",void 0),t([i()],l.prototype,"default",void 0),t([n()],l.prototype,"type",void 0),t([n({type:Boolean})],l.prototype,"cache",void 0),t([i()],l.prototype,"routes",null),l=p=t([e("router"),s(h`:host{display:contents}`)],l);var c=l;export{l as Router,c as default};
251
2
  //# sourceMappingURL=router.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"router.js","sources":["../src/components/router.ts"],"sourcesContent":null,"names":[],"mappings":";;;;;;;;;;AASA,MAAM,SAAS,GAAG,QAAQ;AAE1B;;;;;;;;;;;;;;;;;;;;;AAqBE;AAGF,IAAM,MAAM,GAAA,QAAA,GAAZ,MAAM,MAAoB,SAAQ,WAAW,CAAA;AAA7C,IAAA,WAAA,GAAA;;AAGU,QAAA,IAAA,CAAA,gBAAgB,GAAc,IAAI,SAAS,EAAE;AAC7C,QAAA,IAAA,CAAA,kBAAkB,GAAc,IAAI,SAAS,EAAE;AAC/C,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,GAAG,EAA6C;AAS5E;;AAEE;QAEF,IAAS,CAAA,SAAA,GAAuB,IAAI;AAEpC;;AAEE;QAEF,IAAM,CAAA,MAAA,GAA2B,EAAE;AAQnC;;AAEE;QAEF,IAAQ,CAAA,QAAA,GAAG,EAAE;AAEb;;AAEE;QAEF,IAAO,CAAA,OAAA,GAAG,EAAE;AAEZ;;AAEE;QAEF,IAAO,CAAA,OAAA,GAAmB,QAAQ,EAAE;AAEpC;;;;;;AAME;QAEF,IAAI,CAAA,IAAA,GAAmC,QAAQ;AAE/C;;;;AAIE;QAEF,IAAK,CAAA,KAAA,GAAG,KAAK;AAoEb;;AAEE;QACF,IAAmB,CAAA,mBAAA,GAKU,IAAI;AA0FjC,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,U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,KAAA,CAAA,CAAA;AAMZ,UAAA,CAAA;AADC,IAAA,QAAQ;AACI,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,UAAA,EAAA,KAAA,CAAA,CAAA;AAMb,UAAA,CAAA;AADC,IAAA,QAAQ;AACG,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA;AAMZ,UAAA,CAAA;AADC,IAAA,KAAK;AAC8B,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA;AAUpC,UAAA,CAAA;AADC,IAAA,QAAQ;AACsC,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA;AAQ/C,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE;AACd,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA;AAGb,UAAA,CAAA;AADC,IAAA,KAAK;AAIN,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;AAxEI,MAAM,GAAA,QAAA,GAAA,UAAA,CAAA;IAFX,MAAM,CAAC,SAAS,CAAA;AAChB,IAAA,MAAM,CAAC,GAAG,CAAA,CAAA,uBAAA,CAAyB;AAC9B,CAAA,EAAA,MAAM,CA2OZ;AAEA,eAAe,MAAM;;;;"}
1
+ {"version":3,"file":"router.js","sources":["../src/components/router.ts"],"sourcesContent":null,"names":["Router","Router_1","GlobalStyle","constructor","this","__fieldRouteTree","RouteTree","__slottedRouteTree","__cacheRecord","Map","component","params","default","htmlSlot","type","cache","routeChangeCallback","handlePopstate","events","add","window","pathname","location","routes","value","__routes","collectFieldRoutes","clear","render","cached","get","Object","assign","fieldComponent","slottedComponent","connectedCallback","super","routerInstances","MutationObserver","collectSlottedRoutes","observe","attributeFilter","attributes","subtree","disconnectedCallback","delete","useRouter","path","updated","changedProperties","has","ur","noRecord","set","dispatchEvent","CustomEvent","detail","query","search","pattern","parseParams","route","find","r","slottedPaths","_slottedNames","s","forEach","slotName","insert","routeTemplate","updateAll","i","Set","__decorate","state","prototype","property","Boolean","godown","styles","css","Router$1"],"mappings":"mQAgCA,IAAMA,EAAMC,EAAZ,MAAMD,eAAeE,EAArB,WAAAC,uBAGUC,KAAAC,iBAA8B,IAAIC,EAClCF,KAAAG,mBAAgC,IAAID,EACpCF,KAAAI,cAAgB,IAAIC,IAa5BL,KAASM,UAA6B,KAMtCN,KAAMO,OAA2B,CAAE,EAkBnCP,KAAOQ,QAAmBC,IAU1BT,KAAIU,KAAmC,SAQvCV,KAAKW,OAAG,EAgFRX,KAAmBY,oBAKU,KA2F7BZ,KAAAa,eAAiBb,KAAKc,OAAOC,IAAIC,OAAQ,YAAY,KACnDhB,KAAKiB,SAAWC,SAASD,QAAQ,IA9KnC,UAAIE,CAAOC,GACTpB,KAAKqB,SAAWD,EAChBpB,KAAKsB,mBAAmBF,GAG1B,UAAID,GAKF,OAAOnB,KAAKqB,SAGd,KAAAE,GACEvB,KAAKI,cAAcmB,QAGX,MAAAC,GAER,GADAxB,KAAKO,OAAS,CAAE,EACZP,KAAKW,MAAO,CACd,MAAMc,EAASzB,KAAKI,cAAcsB,IAAI1B,KAAKiB,UAC3C,GAAIQ,EAEF,OADAE,OAAOC,OAAO5B,KAAMyB,GACbzB,KAAKM,UAGhB,OAAQN,KAAKU,MACX,IAAK,QACHV,KAAKM,UAAYN,KAAK6B,iBACtB,MACF,IAAK,UACH7B,KAAKM,UAAYN,KAAK8B,mBACtB,MACF,QACE9B,KAAKM,UAAYN,KAAK6B,kBAAoB7B,KAAK8B,mBAEnD,OAAO9B,KAAKM,WAAaN,KAAKQ,SAAW,KAG3C,iBAAAuB,GAKE,GAJAC,MAAMD,oBACNlC,EAAOoC,gBAAgBlB,IAAIf,MAC3BA,KAAKiB,WAAaC,SAASD,SAET,UAAdjB,KAAKU,KAAkB,CACA,IAAIwB,iBA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AK2C,OAHZ,MALA,KAcX,oBAAAR,GACEnC,KAAKG,mBAAqB,IAAID,EAC9BF,KAAKuB,QACLvB,KAAK6D,cAAcE,SAAQC,IACzBhE,KAAKG,mBAAmB8D,OAAOD,EAAS,IAO5C,kBAAA1C,CAAmBF,GACjBpB,KAAKC,iBAAmB,IAAIC,EAC5BF,KAAKuB,QACLH,EAAM2C,SAAQ,EAAGpB,WACf3C,KAAKC,iBAAiBgE,OAAOtB,EAAK,IAItC,WAAAa,CAAYU,EAAuBvB,EAAe3C,KAAKiB,UACrD,OAAOf,EAAUsD,YAAYb,EAAMuB,GAGrC,gBAAOC,GACLnE,KAAKiC,gBAAgB8B,SAASK,IAC5BA,EAAEvD,gBAAgB,MAvOfjB,EAAAqC,gBAA+B,IAAIoC,IAiB1CC,EAAA,CADCC,KACyC3E,EAAA4E,UAAA,iBAAA,GAM1CF,EAAA,CADCC,KACkC3E,EAAA4E,UAAA,cAAA,GAMnCF,EAAA,CADCC,KACW3E,EAAA4E,UAAA,YAAA,GAMZF,EAAA,CADCG,KACe7E,EAAA4E,UAAA,gBAAA,GAMhBF,EAAA,CADCC,KACmC3E,EAAA4E,UAAA,eAAA,GAUpCF,EAAA,CADCG,KAC8C7E,EAAA4E,UAAA,YAAA,GAQ/CF,EAAA,CADCG,EAAS,CAAE/D,KAAMgE,WACL9E,EAAA4E,UAAA,aAAA,GAGbF,EAAA,CADCC,KAID3E,EAAA4E,UAAA,SAAA,MAlEI5E,EAAMC,EAAAyE,EAAA,CAFXK,EAxBiB,UAyBjBC,EAAOC,CAAG,4BACLjF,GAiPN,IAAAkF,EAAelF"}
@@ -1,4 +1,5 @@
1
- import { HandlerEvent } from "@godown/element";
1
+ import { type HandlerEvent } from "@godown/element";
2
+ import { type TemplateResult } from "lit";
2
3
  import Input from "./input.js";
3
4
  /**
4
5
  * {@linkcode Select} is similar to `<select>`.
@@ -11,6 +12,9 @@ import Input from "./input.js";
11
12
  *
12
13
  * Input will filter the element.
13
14
  *
15
+ * @fires input - Fires when the input value changes.
16
+ * @fires change - Fires when the input value changes.
17
+ * @fires select - Fires when select an option.
14
18
  * @slot - Options.
15
19
  * @category input
16
20
  */
@@ -29,7 +33,7 @@ declare class Select extends Input {
29
33
  protected defaultText: string;
30
34
  protected defaultChecked: HTMLElement[];
31
35
  private _store;
32
- protected render(): import("lit").TemplateResult<1>;
36
+ protected render(): TemplateResult<1>;
33
37
  protected _handleFocus(): void;
34
38
  protected firstUpdated(): void;
35
39
  protected _connectedInit(): void;
@@ -43,4 +47,5 @@ declare class Select extends Input {
43
47
  optionValue(option: HTMLElement): string;
44
48
  }
45
49
  export default Select;
50
+ export { Select };
46
51
  //# sourceMappingURL=select.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../src/components/select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAU/C,OAAO,KAAK,MAAM,YAAY,CAAC;AAyB/B;;;;;;;;;;;;;GAaG;AACH,cAIM,MAAO,SAAQ,KAAK;IAExB,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAEzB;;OAEG;IAEH,IAAI,EAAE,MAAM,CAAC;IAGb,SAAS,CAAC,QAAQ,EAAE,WAAW,CAAC;IAGhC,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;IAGxC,QAAQ,EAAE,OAAO,CAAC;IAGlB,OAAO,EAAE,OAAO,CAAC;IAGjB,SAAS,CAAC,aAAa,EAAE,KAAK,GAAG,QAAQ,CAAY;IAErD,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC;IACnC,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,cAAc,EAAE,WAAW,EAAE,CAAC;IACxC,OAAO,CAAC,MAAM,CAA0C;IAExD,SAAS,CAAC,MAAM;IAShB,SAAS,CAAC,YAAY;IAYtB,SAAS,CAAC,YAAY;IA0BtB,SAAS,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C;IAcrC,SAAS,CAAC,YAAY,IAAI,IAAI;IAY9B,SAAS,CAAC,YAAY,IAAI,IAAI;IA0B9B,SAAS,CAAC,cAAc,IAAI,IAAI;IAsBhC,KAAK,IAAI,IAAI;IAOb,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,CAAC,GAAG,CAAC;IA4B3C,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAc5B,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAIzE,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,GAAG,IAAI;IAW/D,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI;IAKnC,IAAI,IAAI,IAAI;IAMZ,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM;CAGzC;AAED,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,212 +1,2 @@
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 { htmlSlot } from '@godown/element/directives/html-slot.js';
6
- import svgCaretDown from '@godown/f7-icon/icons/chevron-down.js';
7
- import { html, nothing, css } from 'lit';
8
- import { property, state } from 'lit/decorators.js';
9
- import { ifDefined } from 'lit/directives/if-defined.js';
10
- import Input from './input.js';
11
-
12
- function contain(a, b) {
13
- return a && b && a.toLowerCase().includes(b.toLowerCase());
14
- }
15
- function betweenAt(i, s, c) {
16
- const start = s.slice(0, i).lastIndexOf(c) + 1 || 0;
17
- const end = s.indexOf(c, i) || s.length;
18
- return s.slice(start, end);
19
- }
20
- function updateChecked(element, operation) {
21
- if (element) {
22
- const name = "checked";
23
- if (operation) {
24
- element.setAttribute(name, "");
25
- }
26
- else {
27
- element.removeAttribute(name);
28
- }
29
- }
30
- }
31
- const protoName = "select";
32
- /**
33
- * {@linkcode Select} is similar to `<select>`.
34
- *
35
- * Elements with the value attribute/property can be used as options.
36
- *
37
- * The checked attribute will be added to the selected element.
38
- *
39
- * Multi-selected state looks the same as single-selected.
40
- *
41
- * Input will filter the element.
42
- *
43
- * @slot - Options.
44
- * @category input
45
- */
46
- let Select = class Select extends Input {
47
- constructor() {
48
- super(...arguments);
49
- this.autoDirection = "bottom";
50
- this._store = [];
51
- }
52
- render() {
53
- return html `<div part="root" class="input-field">${[
54
- this._renderPrefix(),
55
- html `<input part="input" dir="${ifDefined(this.dir)}" id="${this.makeId}" .value="${this.text}" type="${this.type}" placeholder="${this.placeholder || nothing}" ?autofocus="${this.autofocus}" autocapitalize="${this.autocapitalize || nothing}" autocomplete="${this.autocomplete || nothing}" ?disabled="${this.disabled}" @focus="${this._handleFocus}" @input="${this._handleInput}">`,
56
- html `<label for="${this.makeId}" part="suffix"><i part="space"></i><i part="icon">${svgCaretDown()}</i><i part="space"></i></label>`,
57
- html `<label for="${this.makeId}" part="content" style="visibility:${this.visible ? "visible" : "hidden"}" direction="${this.direction || this.autoDirection}">${htmlSlot()}</label>`,
58
- ]}</div>`;
59
- }
60
- _handleFocus() {
61
- if (!this.direction) {
62
- const { top, bottom } = this.getBoundingClientRect();
63
- if (window.innerHeight - bottom < this._content.clientHeight && top > this._content.clientHeight) {
64
- this.autoDirection = "top";
65
- }
66
- else {
67
- this.autoDirection = "bottom";
68
- }
69
- }
70
- this.visible = true;
71
- }
72
- firstUpdated() {
73
- this.events.add(this._content, "click", (e) => {
74
- e.preventDefault();
75
- e.stopPropagation();
76
- const { target } = e;
77
- const value = this.optionValue(target);
78
- if (value) {
79
- const operation = this.select(value, target.textContent);
80
- if (!this.multiple) {
81
- updateChecked(this.lastChecked, 0);
82
- }
83
- updateChecked(target, operation);
84
- this.lastChecked = target;
85
- }
86
- this._input.focus();
87
- });
88
- this.events.add(document, "click", (e) => {
89
- // e.preventDefault();
90
- e.stopPropagation();
91
- const composed1 = e.composedPath()[0];
92
- if (composed1 && !this.shadowRoot.contains(composed1)) {
93
- this.blur();
94
- }
95
- });
96
- }
97
- _connectedInit() {
98
- if (!this.value) {
99
- const checked = [...this.querySelectorAll("[checked]")];
100
- const list = this.multiple
101
- ? checked
102
- : checked.length
103
- ? [this.lastChecked = checked[0]]
104
- : [];
105
- list.forEach((element) => {
106
- const operation = this.select(this.optionValue(element), element.textContent);
107
- updateChecked(element, operation);
108
- });
109
- this.default = this.value;
110
- this.defaultText = this.text;
111
- this.defaultChecked = checked;
112
- }
113
- if (!this.text) {
114
- this.text = "";
115
- }
116
- }
117
- reset() {
118
- this.value = this.default;
119
- this.text = this.defaultText;
120
- this.querySelectorAll("[checked]").forEach(element => updateChecked(element, 0));
121
- this.defaultChecked.forEach(element => updateChecked(element, 1));
122
- }
123
- select(value, text) {
124
- text ||= value;
125
- let operation = 0;
126
- if (this.multiple) {
127
- const i = this._store.findIndex(s => s.value === value);
128
- if (i > -1) {
129
- this._store.splice(i, 1);
130
- }
131
- else {
132
- this._store.push({ value, text });
133
- operation = 1;
134
- }
135
- this.value = this._store.map(s => s.value);
136
- this.text = this._store.map(s => s.text).join(", ");
137
- }
138
- else {
139
- if (this.value === value) {
140
- this.value = "";
141
- this.text = "";
142
- }
143
- else {
144
- this.value = value;
145
- this.text = text;
146
- operation = 1;
147
- }
148
- }
149
- this.dispatchEvent(new CustomEvent("change", { detail: this.namevalue() }));
150
- this.filter();
151
- return operation;
152
- }
153
- filter(query) {
154
- query = query?.trim();
155
- [...this.children].forEach((element) => {
156
- this.filterCallback(element, !query
157
- || contain(this.optionValue(element), query)
158
- || contain(element.textContent, query), query);
159
- });
160
- }
161
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
162
- filterCallback(element, match, query) {
163
- element.style.display = match ? "" : "none";
164
- }
165
- _handleInput(e) {
166
- e.stopPropagation();
167
- if (this.compositing) {
168
- return;
169
- }
170
- const s = this._input.value;
171
- this.filter(this.multiple ? betweenAt(this._input.selectionStart, s, ",") : s);
172
- this.dispatchEvent(new CustomEvent("input", { detail: this.namevalue() }));
173
- }
174
- focus(options) {
175
- this._input.focus(options);
176
- this.visible = true;
177
- }
178
- blur() {
179
- this._input.blur();
180
- this.visible = false;
181
- super.blur();
182
- }
183
- optionValue(option) {
184
- return option.value || option.getAttribute("value") || "";
185
- }
186
- };
187
- __decorate([
188
- property()
189
- ], Select.prototype, "text", void 0);
190
- __decorate([
191
- part("content")
192
- ], Select.prototype, "_content", void 0);
193
- __decorate([
194
- property()
195
- ], Select.prototype, "direction", void 0);
196
- __decorate([
197
- property({ type: Boolean })
198
- ], Select.prototype, "multiple", void 0);
199
- __decorate([
200
- property({ type: Boolean })
201
- ], Select.prototype, "visible", void 0);
202
- __decorate([
203
- state()
204
- ], Select.prototype, "autoDirection", void 0);
205
- Select = __decorate([
206
- godown(protoName),
207
- styles(css `[part=input]{text-overflow:ellipsis}[part=content]{position:absolute;width:100%}[direction=bottom]{top:100%}[direction=top]{bottom:100%}`)
208
- ], Select);
209
- var Select$1 = Select;
210
-
211
- export { Select$1 as default };
1
+ import{__decorate as t}from"tslib";import{part as e,godown as i,styles as o,attr as s,htmlSlot as n}from"@godown/element";import l from"@godown/f7-icon/icons/chevron-down.js";import{css as h,html as a,nothing as r}from"lit";import{property as c,state as u}from"lit/decorators.js";import p from"./input.js";function d(t,e){return t&&e&&t.toLowerCase().includes(e.toLowerCase())}function f(t,e){if(t){const i="checked";e?t.setAttribute(i,""):t.removeAttribute(i)}}let v=class Select extends p{constructor(){super(...arguments),this.multiple=!1,this.visible=!1,this.autoDirection="bottom",this._store=[]}render(){return a`<div part="root" ${s({...this.observedRecord,direction:this.direction||this.autoDirection})} class="input-field">${[this._renderPrefix(),a`<input part="input" dir="${this.dir||r}" id="${this.makeId}" .value="${this.text}" type="${this.type}" placeholder="${this.placeholder||r}" ?autofocus="${this.autofocus}" autocapitalize="${this.autocapitalize||r}" autocomplete="${this.autocomplete||r}" ?disabled="${this.disabled}" @focus="${this._handleFocus}" @input="${this._handleInput}">`,a`<label for="${this.makeId}" part="suffix"><i part="icon">${l()}</i></label>`,a`<label for="${this.makeId}" part="content">${n()}</label>`]}</div>`}_handleFocus(){if(!this.direction){const{top:t,bottom:e}=this.getBoundingClientRect();window.innerHeight-e<this._content.clientHeight&&t>this._content.clientHeight?this.autoDirection="top":this.autoDirection="bottom"}this.visible=!0}firstUpdated(){this.events.add(this._content,"click",(t=>{t.preventDefault(),t.stopPropagation();const{target:e}=t,i=this.optionValue(e);if(i){const t=this.select(i,e.textContent);this.multiple||f(this.lastChecked,0),f(e,t),this.lastChecked=e}this._input.focus()})),this.events.add(document,"click",(t=>{t.stopPropagation();const e=t.composedPath()[0];e&&!this.shadowRoot.contains(e)&&this.blur()}))}_connectedInit(){if(!this.value){const t=[...this.querySelectorAll("[checked]")];(this.multiple?t:t.length?[this.lastChecked=t[0]]:[]).forEach((t=>{f(t,this.select(this.optionValue(t),t.textContent))})),this.default=this.value,this.defaultText=this.text,this.defaultChecked=t}this.text||(this.text="")}reset(){this.value=this.default,this.text=this.defaultText,this.querySelectorAll("[checked]").forEach((t=>f(t,0))),this.defaultChecked.forEach((t=>f(t,1)))}select(t,e){e||=t;let i=0;if(this.multiple){const o=this._store.findIndex((e=>e.value===t));o>-1?this._store.splice(o,1):(this._store.push({value:t,text:e}),i=1),this.value=this._store.map((t=>t.value)),this.text=this._store.map((t=>t.text)).join(", ")}else this.value===t?(this.value="",this.text=""):(this.value=t,this.text=e,i=1);return this.dispatchEvent(new CustomEvent("select",{detail:this.value,composed:!0})),this.filter(),i}filter(t){t=t?.trim(),[...this.children].forEach((e=>{this.filterCallback(e,!t||d(this.optionValue(e),t)||d(e.textContent,t),t)}))}filterCallback(t,e,i){t.style.display=e?"":"none"}_handleInput(t){if(t.stopPropagation(),this.compositing)return;const e=this._input.value;this.filter(this.multiple?function(t,e,i){const o=e.slice(0,t).lastIndexOf(i)+1||0,s=e.indexOf(i,t)||e.length;return e.slice(o,s)}(this._input.selectionStart,e,","):e),this.dispatchEvent(new CustomEvent("input",{detail:this.value,composed:!0,bubbles:!0})),this.dispatchEvent(new CustomEvent("change",{detail:this.value,composed:!0}))}focus(t){this._input.focus(t),this.visible=!0}blur(){this._input.blur(),this.visible=!1,super.blur()}optionValue(t){return t.value||t.getAttribute("value")||""}};t([c()],v.prototype,"text",void 0),t([e("content")],v.prototype,"_content",void 0),t([c()],v.prototype,"direction",void 0),t([c({type:Boolean})],v.prototype,"multiple",void 0),t([c({type:Boolean})],v.prototype,"visible",void 0),t([u()],v.prototype,"autoDirection",void 0),v=t([i("select"),o(h`[part=input]{text-overflow:ellipsis}[part=content]{position:absolute;width:100%;visibility:hidden}[direction=bottom] [part=content]{top:100%}[direction=top] [part=content]{bottom:100%}[visible] [part=content]{visibility:visible}`)],v);var m=v;export{v as Select,m as default};
212
2
  //# sourceMappingURL=select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sources":["../src/components/select.ts"],"sourcesContent":null,"names":[],"mappings":";;;;;;;;;;;AAYA,SAAS,OAAO,CAAC,CAAS,EAAE,CAAS,EAAA;AACnC,IAAA,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAC5D;AAEA,SAAS,SAAS,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAA;AAChD,IAAA,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;AACnD,IAAA,MAAM,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM;IACvC,OAAO,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;AAC5B;AAEA,SAA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AM,CAmMZ;AAEA,eAAe,MAAM;;;;"}
1
+ {"version":3,"file":"select.js","sources":["../src/components/select.ts"],"sourcesContent":null,"names":["contain","a","b","toLowerCase","includes","updateChecked","element","operation","name","setAttribute","removeAttribute","Select","Input","constructor","this","multiple","visible","autoDirection","_store","render","html","attr","observedRecord","direction","_renderPrefix","dir","nothing","makeId","text","type","placeholder","autofocus","autocapitalize","autocomplete","disabled","_handleFocus","_handleInput","svgCaretDown","htmlSlot","top","bottom","getBoundingClientRect","window","innerHeight","_content","clientHeight","firstUpdated","events","add","e","preventDefault","stopPropagation","target","value","optionValue","select","textContent","lastChecked","_input","focus","document","composed1","composedPath","shadowRoot","contains","blur","_connectedInit","checked","querySelectorAll","length","forEach","default","defaultText","defaultChecked","reset","i","findIndex","s","splice","push","map","join","dispatchEvent","CustomEvent","detail","composed","filter","query","trim","children","filterCallback","match","style","display","compositing","c","start","slice","lastIndexOf","end","indexOf","betweenAt","selectionStart","bubbles","options","super","option","getAttribute","__decorate","property","prototype","part","Boolean","state","godown","styles","css","Select$1"],"mappings":"kTAOA,SAASA,EAAQC,EAAWC,GAC1B,OAAOD,GAAKC,GAAKD,EAAEE,cAAcC,SAASF,EAAEC,cAC9C,CAQA,SAASE,EAAcC,EAA6BC,GAClD,GAAID,EAAS,CACX,MAAME,EAAO,UACTD,EACFD,EAAQG,aAAaD,EAAM,IAE3BF,EAAQI,gBAAgBF,GAG9B,CAyBA,IAAMG,EAAN,MAAMA,eAAeC,EAArB,WAAAC,uBAiBEC,KAAQC,UAAG,EAGXD,KAAOE,SAAG,EAGAF,KAAaG,cAAqB,SAKpCH,KAAMI,OAAuC,GAE3C,MAAAC,GACR,OAAOC,CAAI,oBAGTC,EAAK,IACAP,KAAKQ,eACRC,UAAWT,KAAKS,WAAaT,KAAKG,uCAKlC,CACFH,KAAKU,gBACLJ,CAAI,4BAEON,KAAKW,KAAOC,UACbZ,KAAKa,mBACDb,KAAKc,eACPd,KAAKe,sBACEf,KAAKgB,aAA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