godown 3.0.0-canary.10 → 3.0.0-canary.12

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 (390) hide show
  1. package/README.md +3 -3
  2. package/alert.d.ts +1 -0
  3. package/alert.d.ts.map +1 -1
  4. package/avatar.d.ts +1 -0
  5. package/avatar.d.ts.map +1 -1
  6. package/button.d.ts +1 -0
  7. package/button.d.ts.map +1 -1
  8. package/card.d.ts +1 -0
  9. package/card.d.ts.map +1 -1
  10. package/carousel.d.ts +1 -0
  11. package/carousel.d.ts.map +1 -1
  12. package/components/alert.d.ts +2 -1
  13. package/components/alert.d.ts.map +1 -1
  14. package/components/alert.js +6 -8
  15. package/components/alert.js.map +1 -1
  16. package/components/avatar.d.ts +2 -1
  17. package/components/avatar.d.ts.map +1 -1
  18. package/components/avatar.js +8 -5
  19. package/components/avatar.js.map +1 -1
  20. package/components/breath.d.ts +3 -2
  21. package/components/breath.d.ts.map +1 -1
  22. package/components/breath.js +6 -5
  23. package/components/breath.js.map +1 -1
  24. package/components/button.d.ts +5 -3
  25. package/components/button.d.ts.map +1 -1
  26. package/components/button.js +20 -3
  27. package/components/button.js.map +1 -1
  28. package/components/card.d.ts +2 -1
  29. package/components/card.d.ts.map +1 -1
  30. package/components/card.js +5 -4
  31. package/components/card.js.map +1 -1
  32. package/components/carousel.d.ts +3 -1
  33. package/components/carousel.d.ts.map +1 -1
  34. package/components/carousel.js +17 -11
  35. package/components/carousel.js.map +1 -1
  36. package/components/details.d.ts +2 -1
  37. package/components/details.d.ts.map +1 -1
  38. package/components/details.js +3 -2
  39. package/components/details.js.map +1 -1
  40. package/components/dialog.d.ts +2 -2
  41. package/components/dialog.d.ts.map +1 -1
  42. package/components/dialog.js +5 -3
  43. package/components/dialog.js.map +1 -1
  44. package/components/divider.d.ts +2 -3
  45. package/components/divider.d.ts.map +1 -1
  46. package/components/divider.js +5 -6
  47. package/components/divider.js.map +1 -1
  48. package/components/dragbox.d.ts +2 -1
  49. package/components/dragbox.d.ts.map +1 -1
  50. package/components/dragbox.js +4 -2
  51. package/components/dragbox.js.map +1 -1
  52. package/components/flex.d.ts +2 -1
  53. package/components/flex.d.ts.map +1 -1
  54. package/components/flex.js +5 -4
  55. package/components/flex.js.map +1 -1
  56. package/components/form.d.ts +2 -1
  57. package/components/form.d.ts.map +1 -1
  58. package/components/form.js.map +1 -1
  59. package/components/grid.d.ts +2 -1
  60. package/components/grid.d.ts.map +1 -1
  61. package/components/grid.js +5 -4
  62. package/components/grid.js.map +1 -1
  63. package/components/input.d.ts +2 -1
  64. package/components/input.d.ts.map +1 -1
  65. package/components/input.js +3 -2
  66. package/components/input.js.map +1 -1
  67. package/components/layout.d.ts +2 -1
  68. package/components/layout.d.ts.map +1 -1
  69. package/components/layout.js +6 -6
  70. package/components/layout.js.map +1 -1
  71. package/components/link.d.ts +4 -0
  72. package/components/link.d.ts.map +1 -1
  73. package/components/link.js +10 -1
  74. package/components/link.js.map +1 -1
  75. package/components/progress.d.ts +2 -1
  76. package/components/progress.d.ts.map +1 -1
  77. package/components/progress.js +5 -4
  78. package/components/progress.js.map +1 -1
  79. package/components/range.d.ts +3 -2
  80. package/components/range.d.ts.map +1 -1
  81. package/components/range.js +8 -7
  82. package/components/range.js.map +1 -1
  83. package/components/rotate.d.ts +2 -1
  84. package/components/rotate.d.ts.map +1 -1
  85. package/components/rotate.js +1 -1
  86. package/components/rotate.js.map +1 -1
  87. package/components/router.d.ts +9 -9
  88. package/components/router.d.ts.map +1 -1
  89. package/components/router.js.map +1 -1
  90. package/components/select.d.ts +2 -1
  91. package/components/select.d.ts.map +1 -1
  92. package/components/select.js +11 -5
  93. package/components/select.js.map +1 -1
  94. package/components/skeleton.d.ts +2 -1
  95. package/components/skeleton.d.ts.map +1 -1
  96. package/components/skeleton.js +5 -4
  97. package/components/skeleton.js.map +1 -1
  98. package/components/split.d.ts +2 -1
  99. package/components/split.d.ts.map +1 -1
  100. package/components/split.js +4 -3
  101. package/components/split.js.map +1 -1
  102. package/components/switch.d.ts +2 -1
  103. package/components/switch.d.ts.map +1 -1
  104. package/components/switch.js +4 -3
  105. package/components/switch.js.map +1 -1
  106. package/components/text.d.ts +2 -1
  107. package/components/text.d.ts.map +1 -1
  108. package/components/text.js +9 -6
  109. package/components/text.js.map +1 -1
  110. package/components/time.d.ts +2 -2
  111. package/components/time.d.ts.map +1 -1
  112. package/components/time.js +3 -2
  113. package/components/time.js.map +1 -1
  114. package/components/tooltip.d.ts +2 -1
  115. package/components/tooltip.d.ts.map +1 -1
  116. package/components/tooltip.js +4 -3
  117. package/components/tooltip.js.map +1 -1
  118. package/components/typewriter.d.ts +2 -2
  119. package/components/typewriter.d.ts.map +1 -1
  120. package/components/typewriter.js +4 -5
  121. package/components/typewriter.js.map +1 -1
  122. package/core/global-style.d.ts.map +1 -1
  123. package/core/global-style.js +1 -1
  124. package/core/global-style.js.map +1 -1
  125. package/core/super-anchor.d.ts +2 -1
  126. package/core/super-anchor.d.ts.map +1 -1
  127. package/core/super-anchor.js +4 -3
  128. package/core/super-anchor.js.map +1 -1
  129. package/core/super-input.d.ts +3 -2
  130. package/core/super-input.d.ts.map +1 -1
  131. package/core/super-input.js +10 -4
  132. package/core/super-input.js.map +1 -1
  133. package/core/super-openable.d.ts.map +1 -1
  134. package/core/super-openable.js +1 -1
  135. package/core/super-openable.js.map +1 -1
  136. package/custom-elements.json +1 -1
  137. package/details.d.ts +1 -0
  138. package/details.d.ts.map +1 -1
  139. package/dev/alert.d.ts +1 -0
  140. package/dev/alert.d.ts.map +1 -1
  141. package/dev/alert.js +1 -0
  142. package/dev/alert.js.map +1 -1
  143. package/dev/avatar.d.ts +1 -0
  144. package/dev/avatar.d.ts.map +1 -1
  145. package/dev/avatar.js +1 -0
  146. package/dev/avatar.js.map +1 -1
  147. package/dev/button.d.ts +1 -0
  148. package/dev/button.d.ts.map +1 -1
  149. package/dev/button.js +1 -0
  150. package/dev/button.js.map +1 -1
  151. package/dev/card.d.ts +1 -0
  152. package/dev/card.d.ts.map +1 -1
  153. package/dev/card.js +1 -0
  154. package/dev/card.js.map +1 -1
  155. package/dev/carousel.d.ts +1 -0
  156. package/dev/carousel.d.ts.map +1 -1
  157. package/dev/carousel.js +1 -0
  158. package/dev/carousel.js.map +1 -1
  159. package/dev/components/alert.d.ts +2 -1
  160. package/dev/components/alert.d.ts.map +1 -1
  161. package/dev/components/alert.js +12 -10
  162. package/dev/components/alert.js.map +1 -1
  163. package/dev/components/avatar.d.ts +2 -1
  164. package/dev/components/avatar.d.ts.map +1 -1
  165. package/dev/components/avatar.js +21 -7
  166. package/dev/components/avatar.js.map +1 -1
  167. package/dev/components/breath.d.ts +3 -2
  168. package/dev/components/breath.d.ts.map +1 -1
  169. package/dev/components/breath.js +17 -5
  170. package/dev/components/breath.js.map +1 -1
  171. package/dev/components/button.d.ts +5 -3
  172. package/dev/components/button.d.ts.map +1 -1
  173. package/dev/components/button.js +23 -2
  174. package/dev/components/button.js.map +1 -1
  175. package/dev/components/card.d.ts +2 -1
  176. package/dev/components/card.d.ts.map +1 -1
  177. package/dev/components/card.js +8 -5
  178. package/dev/components/card.js.map +1 -1
  179. package/dev/components/carousel.d.ts +3 -1
  180. package/dev/components/carousel.d.ts.map +1 -1
  181. package/dev/components/carousel.js +27 -13
  182. package/dev/components/carousel.js.map +1 -1
  183. package/dev/components/details.d.ts +2 -1
  184. package/dev/components/details.d.ts.map +1 -1
  185. package/dev/components/details.js +8 -3
  186. package/dev/components/details.js.map +1 -1
  187. package/dev/components/dialog.d.ts +2 -2
  188. package/dev/components/dialog.d.ts.map +1 -1
  189. package/dev/components/dialog.js +12 -10
  190. package/dev/components/dialog.js.map +1 -1
  191. package/dev/components/divider.d.ts +2 -3
  192. package/dev/components/divider.d.ts.map +1 -1
  193. package/dev/components/divider.js +19 -7
  194. package/dev/components/divider.js.map +1 -1
  195. package/dev/components/dragbox.d.ts +2 -1
  196. package/dev/components/dragbox.d.ts.map +1 -1
  197. package/dev/components/dragbox.js +9 -1
  198. package/dev/components/dragbox.js.map +1 -1
  199. package/dev/components/flex.d.ts +2 -1
  200. package/dev/components/flex.d.ts.map +1 -1
  201. package/dev/components/flex.js +16 -4
  202. package/dev/components/flex.js.map +1 -1
  203. package/dev/components/form.d.ts +2 -1
  204. package/dev/components/form.d.ts.map +1 -1
  205. package/dev/components/form.js.map +1 -1
  206. package/dev/components/grid.d.ts +2 -1
  207. package/dev/components/grid.d.ts.map +1 -1
  208. package/dev/components/grid.js +16 -4
  209. package/dev/components/grid.js.map +1 -1
  210. package/dev/components/input.d.ts +2 -1
  211. package/dev/components/input.d.ts.map +1 -1
  212. package/dev/components/input.js +2 -1
  213. package/dev/components/input.js.map +1 -1
  214. package/dev/components/layout.d.ts +2 -1
  215. package/dev/components/layout.d.ts.map +1 -1
  216. package/dev/components/layout.js +13 -6
  217. package/dev/components/layout.js.map +1 -1
  218. package/dev/components/link.d.ts +4 -0
  219. package/dev/components/link.d.ts.map +1 -1
  220. package/dev/components/link.js +10 -1
  221. package/dev/components/link.js.map +1 -1
  222. package/dev/components/progress.d.ts +2 -1
  223. package/dev/components/progress.d.ts.map +1 -1
  224. package/dev/components/progress.js +7 -2
  225. package/dev/components/progress.js.map +1 -1
  226. package/dev/components/range.d.ts +3 -2
  227. package/dev/components/range.d.ts.map +1 -1
  228. package/dev/components/range.js +27 -22
  229. package/dev/components/range.js.map +1 -1
  230. package/dev/components/rotate.d.ts +2 -1
  231. package/dev/components/rotate.d.ts.map +1 -1
  232. package/dev/components/rotate.js +1 -1
  233. package/dev/components/rotate.js.map +1 -1
  234. package/dev/components/router.d.ts +9 -9
  235. package/dev/components/router.d.ts.map +1 -1
  236. package/dev/components/router.js.map +1 -1
  237. package/dev/components/select.d.ts +2 -1
  238. package/dev/components/select.d.ts.map +1 -1
  239. package/dev/components/select.js +18 -7
  240. package/dev/components/select.js.map +1 -1
  241. package/dev/components/skeleton.d.ts +2 -1
  242. package/dev/components/skeleton.d.ts.map +1 -1
  243. package/dev/components/skeleton.js +4 -3
  244. package/dev/components/skeleton.js.map +1 -1
  245. package/dev/components/split.d.ts +2 -1
  246. package/dev/components/split.d.ts.map +1 -1
  247. package/dev/components/split.js +15 -11
  248. package/dev/components/split.js.map +1 -1
  249. package/dev/components/switch.d.ts +2 -1
  250. package/dev/components/switch.d.ts.map +1 -1
  251. package/dev/components/switch.js +15 -14
  252. package/dev/components/switch.js.map +1 -1
  253. package/dev/components/text.d.ts +2 -1
  254. package/dev/components/text.d.ts.map +1 -1
  255. package/dev/components/text.js +8 -4
  256. package/dev/components/text.js.map +1 -1
  257. package/dev/components/time.d.ts +2 -2
  258. package/dev/components/time.d.ts.map +1 -1
  259. package/dev/components/time.js +5 -2
  260. package/dev/components/time.js.map +1 -1
  261. package/dev/components/tooltip.d.ts +2 -1
  262. package/dev/components/tooltip.d.ts.map +1 -1
  263. package/dev/components/tooltip.js +24 -12
  264. package/dev/components/tooltip.js.map +1 -1
  265. package/dev/components/typewriter.d.ts +2 -2
  266. package/dev/components/typewriter.d.ts.map +1 -1
  267. package/dev/components/typewriter.js +11 -4
  268. package/dev/components/typewriter.js.map +1 -1
  269. package/dev/core/global-style.d.ts.map +1 -1
  270. package/dev/core/global-style.js +10 -1
  271. package/dev/core/global-style.js.map +1 -1
  272. package/dev/core/super-anchor.d.ts +2 -1
  273. package/dev/core/super-anchor.d.ts.map +1 -1
  274. package/dev/core/super-anchor.js +8 -5
  275. package/dev/core/super-anchor.js.map +1 -1
  276. package/dev/core/super-input.d.ts +3 -2
  277. package/dev/core/super-input.d.ts.map +1 -1
  278. package/dev/core/super-input.js +13 -5
  279. package/dev/core/super-input.js.map +1 -1
  280. package/dev/core/super-openable.d.ts.map +1 -1
  281. package/dev/core/super-openable.js +1 -1
  282. package/dev/core/super-openable.js.map +1 -1
  283. package/dev/details.d.ts +1 -0
  284. package/dev/details.d.ts.map +1 -1
  285. package/dev/details.js +1 -0
  286. package/dev/details.js.map +1 -1
  287. package/dev/dialog.d.ts +1 -0
  288. package/dev/dialog.d.ts.map +1 -1
  289. package/dev/dialog.js +1 -0
  290. package/dev/dialog.js.map +1 -1
  291. package/dev/divider.d.ts +1 -0
  292. package/dev/divider.d.ts.map +1 -1
  293. package/dev/divider.js +1 -0
  294. package/dev/divider.js.map +1 -1
  295. package/dev/dragbox.d.ts +1 -0
  296. package/dev/dragbox.d.ts.map +1 -1
  297. package/dev/dragbox.js +1 -0
  298. package/dev/dragbox.js.map +1 -1
  299. package/dev/flex.d.ts +1 -0
  300. package/dev/flex.d.ts.map +1 -1
  301. package/dev/flex.js +1 -0
  302. package/dev/flex.js.map +1 -1
  303. package/dev/form.d.ts +1 -0
  304. package/dev/form.d.ts.map +1 -1
  305. package/dev/form.js +1 -0
  306. package/dev/form.js.map +1 -1
  307. package/dev/grid.d.ts +1 -0
  308. package/dev/grid.d.ts.map +1 -1
  309. package/dev/grid.js +1 -0
  310. package/dev/grid.js.map +1 -1
  311. package/dev/layout.d.ts.map +1 -1
  312. package/dev/progress.d.ts.map +1 -1
  313. package/dev/router.d.ts.map +1 -1
  314. package/dev/split.d.ts +1 -1
  315. package/dev/split.d.ts.map +1 -1
  316. package/dev/typewriter.d.ts +1 -0
  317. package/dev/typewriter.d.ts.map +1 -1
  318. package/dev/typewriter.js +1 -0
  319. package/dev/typewriter.js.map +1 -1
  320. package/dialog.d.ts +1 -0
  321. package/dialog.d.ts.map +1 -1
  322. package/divider.d.ts +1 -0
  323. package/divider.d.ts.map +1 -1
  324. package/dragbox.d.ts +1 -0
  325. package/dragbox.d.ts.map +1 -1
  326. package/flex.d.ts +1 -0
  327. package/flex.d.ts.map +1 -1
  328. package/form.d.ts +1 -0
  329. package/form.d.ts.map +1 -1
  330. package/grid.d.ts +1 -0
  331. package/grid.d.ts.map +1 -1
  332. package/layout.d.ts.map +1 -1
  333. package/package.json +9 -5
  334. package/progress.d.ts.map +1 -1
  335. package/router.d.ts.map +1 -1
  336. package/split.d.ts +1 -1
  337. package/split.d.ts.map +1 -1
  338. package/src/alert.ts +2 -0
  339. package/src/avatar.ts +2 -0
  340. package/src/button.ts +2 -0
  341. package/src/card.ts +2 -0
  342. package/src/carousel.ts +2 -0
  343. package/src/components/alert.ts +18 -16
  344. package/src/components/avatar.ts +25 -11
  345. package/src/components/breath.ts +22 -10
  346. package/src/components/button.ts +21 -15
  347. package/src/components/card.ts +9 -6
  348. package/src/components/carousel.ts +36 -21
  349. package/src/components/details.ts +10 -5
  350. package/src/components/dialog.ts +19 -18
  351. package/src/components/divider.ts +19 -7
  352. package/src/components/dragbox.ts +16 -9
  353. package/src/components/flex.ts +17 -5
  354. package/src/components/form.ts +4 -4
  355. package/src/components/grid.ts +17 -5
  356. package/src/components/input.ts +5 -4
  357. package/src/components/layout.ts +15 -8
  358. package/src/components/link.ts +10 -2
  359. package/src/components/progress.ts +9 -4
  360. package/src/components/range.ts +44 -45
  361. package/src/components/rotate.ts +9 -6
  362. package/src/components/router.ts +27 -19
  363. package/src/components/select.ts +31 -20
  364. package/src/components/skeleton.ts +6 -5
  365. package/src/components/split.ts +23 -19
  366. package/src/components/switch.ts +20 -19
  367. package/src/components/text.ts +7 -9
  368. package/src/components/time.ts +12 -9
  369. package/src/components/tooltip.ts +26 -14
  370. package/src/components/typewriter.ts +19 -14
  371. package/src/core/global-style.ts +23 -4
  372. package/src/core/super-anchor.ts +11 -8
  373. package/src/core/super-input.ts +23 -21
  374. package/src/core/super-openable.ts +5 -5
  375. package/src/details.ts +2 -0
  376. package/src/dialog.ts +2 -0
  377. package/src/divider.ts +2 -0
  378. package/src/dragbox.ts +2 -0
  379. package/src/flex.ts +2 -0
  380. package/src/form.ts +2 -0
  381. package/src/grid.ts +2 -0
  382. package/src/layout.ts +1 -0
  383. package/src/progress.ts +1 -0
  384. package/src/router.ts +1 -0
  385. package/src/split.ts +1 -1
  386. package/src/typewriter.ts +2 -0
  387. package/typewriter.d.ts +1 -0
  388. package/typewriter.d.ts.map +1 -1
  389. package/vscode.html-custom-data.json +1 -1
  390. package/web-types.json +1 -1
@@ -1,7 +1,8 @@
1
1
  import { godown } from "@godown/element/decorators/godown.js";
2
2
  import { styles } from "@godown/element/decorators/styles.js";
3
+ import { attr } from "@godown/element/directives/attr.js";
3
4
  import { htmlSlot } from "@godown/element/directives/html-slot.js";
4
- import { css } from "lit";
5
+ import { css, html, type TemplateResult } from "lit";
5
6
  import { property } from "lit/decorators.js";
6
7
 
7
8
  import { cssGlobalVars, GlobalStyle, scopePrefix } from "../core/global-style.js";
@@ -52,11 +53,11 @@ const cssScope = scopePrefix(protoName);
52
53
  border-style: solid;
53
54
  }
54
55
 
55
- [name=footer]{
56
+ [name=footer] {
56
57
  border-top-width: var(${cssScope}--border-width);
57
58
  }
58
59
 
59
- [name=header]{
60
+ [name=header] {
60
61
  border-bottom-width: var(${cssScope}--border-width);
61
62
  }
62
63
  `,
@@ -68,12 +69,14 @@ class Card extends GlobalStyle {
68
69
  @property({ type: Boolean })
69
70
  header = false;
70
71
 
71
- protected render() {
72
- return [
72
+ protected render(): TemplateResult<1> {
73
+ return html`<div part="root" ${attr(this.observedRecord)}>
74
+ ${[
73
75
  this.header ? htmlSlot("header") : "",
74
76
  htmlSlot(),
75
77
  this.footer ? htmlSlot("footer") : "",
76
- ];
78
+ ]}
79
+ </div>`;
77
80
  }
78
81
  }
79
82
 
@@ -1,11 +1,12 @@
1
1
  import { godown } from "@godown/element/decorators/godown.js";
2
2
  import { part } from "@godown/element/decorators/part.js";
3
3
  import { styles } from "@godown/element/decorators/styles.js";
4
+ import { attr } from "@godown/element/directives/attr.js";
4
5
  import { htmlSlot } from "@godown/element/directives/html-slot.js";
5
6
  import { htmlStyle } from "@godown/element/directives/html-style.js";
6
7
  import iconChevronLeft from "@godown/f7-icon/icons/chevron-left.js";
7
8
  import iconChevronRight from "@godown/f7-icon/icons/chevron-right.js";
8
- import { css, html } from "lit";
9
+ import { css, html, type TemplateResult } from "lit";
9
10
  import { property } from "lit/decorators.js";
10
11
 
11
12
  import { GlobalStyle } from "../core/global-style.js";
@@ -34,6 +35,7 @@ const protoName = "carousel";
34
35
  }
35
36
 
36
37
  [part=root] {
38
+ direction: ltr;
37
39
  overflow: hidden;
38
40
  }
39
41
 
@@ -99,18 +101,22 @@ class Carousel extends GlobalStyle {
99
101
 
100
102
  private _cloneLast: HTMLElement | undefined;
101
103
 
102
- protected render() {
103
- return [
104
- html`<div part="root">
105
- <i part="prev" @click="${this.prev}">${iconChevronLeft()}</i>
106
- <div part="move-root" style="transform:${`translateX(-${this.index + 1}00%)`}">${htmlSlot()}</div>
107
- <i part="next" @click="${this.next}">${iconChevronRight()}</i>
108
- </div>`,
109
- htmlStyle(`:host{width:${this.width};}`),
110
- ];
104
+ protected render(): TemplateResult<1> {
105
+ return html`<div part="root" ${attr(this.observedRecord)}>
106
+ <i part="prev" @click="${this.prev}">
107
+ ${iconChevronLeft()}
108
+ </i>
109
+ <div part="move-root" style="transform:${`translateX(-${this.index + 1}00%)`}">
110
+ ${htmlSlot()}
111
+ </div>
112
+ <i part="next" @click="${this.next}">
113
+ ${iconChevronRight()}
114
+ </i>
115
+ ${htmlStyle(`:host,:host([contents]) [part=root]{width:${this.width};}`)}
116
+ </div>`;
111
117
  }
112
118
 
113
- protected async firstUpdated() {
119
+ protected async firstUpdated(): Promise<void> {
114
120
  await this.updateComplete;
115
121
 
116
122
  if (this.children.length) {
@@ -124,46 +130,55 @@ class Carousel extends GlobalStyle {
124
130
  this.insertBefore(this._cloneFirst, this.firstElementChild);
125
131
  this.show(this.index);
126
132
  }
127
- if (this.autoChange) {
128
- this.intervalID = window.setInterval(() => {
129
- this.next();
130
- }, this.autoChange);
131
- }
133
+ this.checkInterval();
132
134
  }
133
135
 
134
- disconnectedCallback() {
136
+ disconnectedCallback(): void {
135
137
  clearInterval(this.intervalID);
136
138
  }
137
139
 
138
- show(i: number) {
140
+ show(i: number): void {
139
141
  this.index = i;
140
142
  }
141
143
 
142
- next() {
144
+ next(): void {
143
145
  if (this.index === this.childElementCount - 3) {
144
146
  this._doTranslateX("0", true);
145
147
  this.show(0);
146
148
  } else {
147
149
  this.show(this.index + 1);
148
150
  }
151
+ this.checkInterval();
149
152
  }
150
153
 
151
- prev() {
154
+ prev(): void {
152
155
  if (this.index === 0) {
153
156
  this._doTranslateX(`-${this.childElementCount - 1}00%`, true);
154
157
  this.show(this.children.length - 3);
155
158
  } else {
156
159
  this.show(this.index - 1);
157
160
  }
161
+ this.checkInterval();
158
162
  }
159
163
 
160
- protected _doTranslateX(xValue: string, noTransition?: boolean) {
164
+ protected _doTranslateX(xValue: string, noTransition?: boolean): void {
161
165
  this._moveRoot.style.transform = `translateX(${xValue})`;
162
166
  if (noTransition) {
163
167
  this._moveRoot.style.transition = `none`;
164
168
  }
165
169
  this._moveRoot.getBoundingClientRect();
166
170
  }
171
+
172
+ checkInterval(): void {
173
+ if (this.autoChange) {
174
+ if (this.intervalID) {
175
+ clearInterval(this.intervalID);
176
+ }
177
+ this.intervalID = window.setInterval(() => {
178
+ this.next();
179
+ }, this.autoChange);
180
+ }
181
+ }
167
182
  }
168
183
 
169
184
  export default Carousel;
@@ -1,8 +1,9 @@
1
1
  import { godown } from "@godown/element/decorators/godown.js";
2
2
  import { styles } from "@godown/element/decorators/styles.js";
3
+ import { attr } from "@godown/element/directives/attr.js";
3
4
  import { htmlSlot } from "@godown/element/directives/html-slot.js";
4
5
  import svgCaretDown from "@godown/f7-icon/icons/chevron-down.js";
5
- import { css, html } from "lit";
6
+ import { css, html, type TemplateResult } from "lit";
6
7
  import { property, query } from "lit/decorators.js";
7
8
 
8
9
  import { scopePrefix } from "../core/global-style.js";
@@ -100,11 +101,15 @@ class Details extends SuperOpenable {
100
101
  @query("dd")
101
102
  protected _dd: HTMLDataListElement;
102
103
 
103
- protected render() {
104
- return html`<dl part="root">
104
+ protected render(): TemplateResult<1> {
105
+ return html`<dl part="root" ${attr(this.observedRecord)}>
105
106
  <dt part="title" @click="${this._handelClick}">
106
- <span part="summary">${this.summary || htmlSlot("summary")} </span>
107
- <span><i part="icon">${svgCaretDown()}</i></span>
107
+ <span part="summary">
108
+ ${this.summary || htmlSlot("summary")}
109
+ </span>
110
+ <span>
111
+ <i part="icon">${svgCaretDown()}</i>
112
+ </span>
108
113
  </dt>
109
114
  <dd part="details" @click=${this.fill ? () => this.toggle() : null}>
110
115
  <div style="min-height: 0;">${htmlSlot()}</div>
@@ -1,8 +1,9 @@
1
1
  import { type HandlerEvent } from "@godown/element";
2
2
  import { godown } from "@godown/element/decorators/godown.js";
3
3
  import { styles } from "@godown/element/decorators/styles.js";
4
+ import { attr } from "@godown/element/directives/attr.js";
4
5
  import { htmlSlot } from "@godown/element/directives/html-slot.js";
5
- import { css, html, type PropertyValues } from "lit";
6
+ import { css, html, type PropertyValues, type TemplateResult } from "lit";
6
7
  import { property } from "lit/decorators.js";
7
8
 
8
9
  import { cssGlobalVars, scopePrefix } from "../core/global-style.js";
@@ -32,7 +33,7 @@ const cssScope = scopePrefix(protoName);
32
33
  visibility: hidden;
33
34
  position: fixed;
34
35
  z-index: 1;
35
- inset:0;
36
+ inset: 0;
36
37
  }
37
38
 
38
39
  :host([open]) {
@@ -64,25 +65,25 @@ const cssScope = scopePrefix(protoName);
64
65
  justify-content: center;
65
66
  }
66
67
 
67
- [direction] {
68
+ [part=container] {
68
69
  pointer-events: all;
69
70
  position: absolute;
70
71
  }
71
72
 
72
- [direction^=top] {
73
+ [direction^=top] [part=container] {
73
74
  top: 0;
74
75
  }
75
76
 
76
- [direction^=bottom] {
77
+ [direction^=bottom] [part=container] {
77
78
  bottom: 0;
78
79
  }
79
80
 
80
- [direction$=right] {
81
- right: 0%;
81
+ [direction$=right] [part=container] {
82
+ right: 0;
82
83
  }
83
84
 
84
- [direction$=left] {
85
- left: 0%;
85
+ [direction$=left] [part=container] {
86
+ left: 0;
86
87
  }
87
88
  `,
88
89
  )
@@ -105,16 +106,16 @@ class Dialog extends SuperOpenable {
105
106
  @property()
106
107
  key = "Escape";
107
108
 
108
- private _modalInvoke: boolean;
109
+ private _modalInvoke = false;
109
110
 
110
- protected render() {
111
- return html`<div part="root">
111
+ protected render(): TemplateResult<1> {
112
+ return html`<div part="root" ${attr(this.observedRecord)}>
112
113
  <div part="modal"></div>
113
- <div part="container" direction="${this.direction}">${htmlSlot()}</div>
114
+ <div part="container">${htmlSlot()}</div>
114
115
  </div>`;
115
116
  }
116
117
 
117
- showModal() {
118
+ showModal(): void {
118
119
  if (!this.modal) {
119
120
  this.modal = true;
120
121
  this._modalInvoke = true;
@@ -125,7 +126,7 @@ class Dialog extends SuperOpenable {
125
126
  private _submitEvent: EventListenerOrEventListenerObject;
126
127
  private _keydownEvent: EventListenerOrEventListenerObject;
127
128
 
128
- protected updated(changedProperties: PropertyValues) {
129
+ protected updated(changedProperties: PropertyValues): void {
129
130
  if (changedProperties.has("open")) {
130
131
  if (this.open) {
131
132
  this._submitEvent = this.events.add(this, "submit", this._handelSubmit);
@@ -139,7 +140,7 @@ class Dialog extends SuperOpenable {
139
140
  }
140
141
  }
141
142
 
142
- protected _handleKeydown(e: KeyboardEvent) {
143
+ protected _handleKeydown(e: KeyboardEvent): void {
143
144
  e.preventDefault();
144
145
  const keys = this.key.split(/[\s,]/);
145
146
  if (keys.includes(e.key) || keys.includes(e.code)) {
@@ -147,13 +148,13 @@ class Dialog extends SuperOpenable {
147
148
  }
148
149
  }
149
150
 
150
- protected _handelSubmit(e: HandlerEvent<HTMLFormElement>) {
151
+ protected _handelSubmit(e: HandlerEvent<HTMLFormElement>): void {
151
152
  if (e.target.method === "dialog") {
152
153
  this.close();
153
154
  }
154
155
  }
155
156
 
156
- close() {
157
+ close(): void {
157
158
  if (this._modalInvoke) {
158
159
  this.modal = false;
159
160
  this._modalInvoke = false;
@@ -1,5 +1,6 @@
1
1
  import { godown, styles } from "@godown/element/decorators/index.js";
2
- import { css } from "lit";
2
+ import { attr } from "@godown/element/directives/attr.js";
3
+ import { css, html, type TemplateResult } from "lit";
3
4
  import { property } from "lit/decorators.js";
4
5
 
5
6
  import { GlobalStyle } from "../core/global-style.js";
@@ -9,25 +10,36 @@ const protoName = "divider";
9
10
  /**
10
11
  * {@linkcode Divider} similar to `<hr>`.
11
12
  *
12
- * This component does not render content.
13
- *
14
13
  * @category layout
15
14
  */
16
15
  @godown(protoName)
17
16
  @styles(
18
17
  css`
19
- :host{
18
+ :host {
20
19
  width: 100%;
21
20
  height: .05em;
22
21
  margin: auto;
23
22
  display: block;
24
23
  background: currentColor;
25
24
  }
25
+
26
26
  :host([vertical]) {
27
27
  width: .05em;
28
28
  height: max(1em, 100%);
29
29
  }
30
- `,
30
+
31
+ :host([contents]) [part=root] {
32
+ width: 100%;
33
+ height: .05em;
34
+ margin: auto;
35
+ display: block;
36
+ background: currentColor;
37
+ }
38
+
39
+ [part=root] {
40
+ display: contents;
41
+ }
42
+ `,
31
43
  )
32
44
  class Divider extends GlobalStyle {
33
45
  /**
@@ -36,8 +48,8 @@ class Divider extends GlobalStyle {
36
48
  @property({ type: Boolean, reflect: true })
37
49
  vertical = false;
38
50
 
39
- connectedCallback() {
40
- this.createRenderRoot();
51
+ protected render(): TemplateResult<1> {
52
+ return html`<div part="root" ${attr(this.observedRecord)}></div>`;
41
53
  }
42
54
  }
43
55
 
@@ -1,8 +1,9 @@
1
1
  import { godown } from "@godown/element/decorators/godown.js";
2
2
  import { styles } from "@godown/element/decorators/styles.js";
3
+ import { attr } from "@godown/element/directives/attr.js";
3
4
  import { htmlSlot } from "@godown/element/directives/html-slot.js";
4
5
  import { EventListenerFunc } from "@godown/element/tools/events.js";
5
- import { css, html } from "lit";
6
+ import { css, html, type TemplateResult } from "lit";
6
7
  import { property } from "lit/decorators.js";
7
8
 
8
9
  import { GlobalStyle } from "../core/global-style.js";
@@ -43,7 +44,7 @@ class Dragbox extends GlobalStyle {
43
44
  return this.offsetParent?.clientHeight ?? document.body.offsetHeight;
44
45
  }
45
46
 
46
- private drag: boolean;
47
+ private drag = false;
47
48
  private t: number;
48
49
  private l: number;
49
50
  private cx: number;
@@ -61,15 +62,21 @@ class Dragbox extends GlobalStyle {
61
62
  @property()
62
63
  y = "auto";
63
64
 
64
- protected render() {
65
- return html`<div @mousedown="${this._handleDragStart}" @mouseup="${this._handleDragEnd}">${htmlSlot()}</div>`;
65
+ protected render(): TemplateResult<1> {
66
+ return html`<div
67
+ part="root"
68
+ ${attr(this.observedRecord)}
69
+ @mousedown="${this._handleDragStart}"
70
+ @mouseup="${this._handleDragEnd}">
71
+ ${htmlSlot()}
72
+ </div>`;
66
73
  }
67
74
 
68
- protected firstUpdated() {
75
+ protected firstUpdated(): void {
69
76
  this.reset();
70
77
  }
71
78
 
72
- protected _handleDragStart(e: MouseEvent) {
79
+ protected _handleDragStart(e: MouseEvent): void {
73
80
  this.cx = e.clientX;
74
81
  this.cy = e.clientY;
75
82
  this.t = this.offsetTop;
@@ -82,13 +89,13 @@ class Dragbox extends GlobalStyle {
82
89
  protected _handleMouseMove: EventListenerFunc;
83
90
  protected _handleMouseLeave: EventListenerFunc;
84
91
 
85
- protected _handleDragEnd() {
92
+ protected _handleDragEnd(): void {
86
93
  this.drag = false;
87
94
  this.events.remove(document, "mousemove", this._handleMouseMove);
88
95
  this.events.remove(document, "mouseleave", this._handleMouseLeave);
89
96
  }
90
97
 
91
- protected _handleDrag(e: MouseEvent) {
98
+ protected _handleDrag(e: MouseEvent): void {
92
99
  if (!this.drag) {
93
100
  return;
94
101
  }
@@ -111,7 +118,7 @@ class Dragbox extends GlobalStyle {
111
118
  }
112
119
  }
113
120
 
114
- reset() {
121
+ reset(): void {
115
122
  const { x, y, style, offsetsWidth, offsetsHeight, offsetWidth, offsetHeight, offsetLeft, offsetTop } = this;
116
123
  style.left = x || "0";
117
124
  style.top = y || "0";
@@ -1,9 +1,10 @@
1
1
  import { godown } from "@godown/element/decorators/godown.js";
2
2
  import { styles } from "@godown/element/decorators/styles.js";
3
+ import { attr } from "@godown/element/directives/attr.js";
3
4
  import { htmlSlot } from "@godown/element/directives/html-slot.js";
4
5
  import { htmlStyle } from "@godown/element/directives/html-style.js";
5
6
  import { joinRules } from "@godown/element/tools/css.js";
6
- import { css } from "lit";
7
+ import { css, html, type TemplateResult } from "lit";
7
8
  import { property } from "lit/decorators.js";
8
9
 
9
10
  import { GlobalStyle } from "../core/global-style.js";
@@ -17,7 +18,16 @@ const protoName = "flex";
17
18
  * @category layout
18
19
  */
19
20
  @godown(protoName)
20
- @styles(css`:host {display:flex;}`)
21
+ @styles(css`
22
+ :host,
23
+ :host([contents]) [part=root] {
24
+ display: flex;
25
+ }
26
+
27
+ [part=root] {
28
+ display: contents;
29
+ }
30
+ `)
21
31
  class Flex extends GlobalStyle {
22
32
  /**
23
33
  * CSS property `flex-flow` (`flex-direction flex-wrap`).
@@ -49,8 +59,9 @@ class Flex extends GlobalStyle {
49
59
  @property({ type: Boolean })
50
60
  vertical = false;
51
61
 
52
- protected render() {
53
- return [
62
+ protected render(): TemplateResult<1> {
63
+ return html`<div part="root" ${attr(this.observedRecord)}>
64
+ ${[
54
65
  htmlSlot(),
55
66
  htmlStyle(
56
67
  joinRules({
@@ -63,7 +74,8 @@ class Flex extends GlobalStyle {
63
74
  },
64
75
  }),
65
76
  ),
66
- ];
77
+ ]}
78
+ </div>`;
67
79
  }
68
80
  }
69
81
 
@@ -1,7 +1,7 @@
1
1
  import { godown } from "@godown/element/decorators/godown.js";
2
2
  import { styles } from "@godown/element/decorators/styles.js";
3
3
  import { htmlSlot } from "@godown/element/directives/html-slot.js";
4
- import { css } from "lit";
4
+ import { css, type TemplateResult } from "lit";
5
5
  import { property } from "lit/decorators.js";
6
6
 
7
7
  import { GlobalStyle } from "../core/global-style.js";
@@ -30,13 +30,13 @@ class Form<T = object> extends GlobalStyle {
30
30
  return Form.buildValue(this._slot.assignedElements()) as T;
31
31
  }
32
32
 
33
- nameValue = this.namevalue;
33
+ nameValue: () => [string, T] = this.namevalue;
34
34
 
35
- protected render() {
35
+ protected render(): TemplateResult<1> {
36
36
  return htmlSlot();
37
37
  }
38
38
 
39
- reset() {
39
+ reset(): void {
40
40
  this.deepQuerySelectorAll<HTMLElement & { reset?: () => void; }>("*").forEach((el) => {
41
41
  if (el.tagName === this.tagName) {
42
42
  return;
@@ -1,10 +1,11 @@
1
1
  import { godown } from "@godown/element/decorators/godown.js";
2
2
  import { styles } from "@godown/element/decorators/styles.js";
3
+ import { attr } from "@godown/element/directives/attr.js";
3
4
  import { htmlSlot } from "@godown/element/directives/html-slot.js";
4
5
  import { htmlStyle } from "@godown/element/directives/html-style.js";
5
6
  import { joinRules } from "@godown/element/tools/css.js";
6
7
  import { isNumerical } from "@godown/element/tools/lib.js";
7
- import { css } from "lit";
8
+ import { css, html, type TemplateResult } from "lit";
8
9
  import { property } from "lit/decorators.js";
9
10
 
10
11
  import { GlobalStyle } from "../core/global-style.js";
@@ -18,7 +19,16 @@ const protoName = "grid";
18
19
  * @category layout
19
20
  */
20
21
  @godown(protoName)
21
- @styles(css`:host{display:grid;}`)
22
+ @styles(css`
23
+ :host,
24
+ :host([contents]) [part=root] {
25
+ display: grid;
26
+ }
27
+
28
+ [part=root] {
29
+ display: contents;
30
+ }
31
+ `)
22
32
  class Grid extends GlobalStyle {
23
33
  /**
24
34
  * CSS property `gap`.
@@ -54,8 +64,9 @@ class Grid extends GlobalStyle {
54
64
  @property()
55
65
  items: string;
56
66
 
57
- protected render() {
58
- return [
67
+ protected render(): TemplateResult<1> {
68
+ return html`<div part="root" ${attr(this.observedRecord)}>
69
+ ${[
59
70
  htmlSlot(),
60
71
  htmlStyle(
61
72
  joinRules({
@@ -68,7 +79,8 @@ class Grid extends GlobalStyle {
68
79
  },
69
80
  }),
70
81
  ),
71
- ];
82
+ ]}
83
+ </div>`;
72
84
  }
73
85
  }
74
86
 
@@ -1,8 +1,9 @@
1
1
  import { godown } from "@godown/element/decorators/godown.js";
2
2
  import { part } from "@godown/element/decorators/part.js";
3
3
  import { styles } from "@godown/element/decorators/styles.js";
4
+ import { attr } from "@godown/element/directives/attr.js";
4
5
  import { classList } from "@godown/element/directives/class-list.js";
5
- import { css, html, nothing } from "lit";
6
+ import { css, html, nothing, type TemplateResult } from "lit";
6
7
  import { property } from "lit/decorators.js";
7
8
 
8
9
  import { cssGlobalVars } from "../core/global-style.js";
@@ -42,8 +43,8 @@ class Input extends SuperInput {
42
43
  @part("input")
43
44
  protected _input: HTMLInputElement;
44
45
 
45
- protected render() {
46
- return html`<div part="root" class="${classList("input-field", this.variant)}">
46
+ protected render(): TemplateResult<1> {
47
+ return html`<div part="root" ${attr(this.observedRecord)} class="${classList("input-field", this.variant)}">
47
48
  ${[
48
49
  this._renderPrefix(),
49
50
  html`<input
@@ -63,7 +64,7 @@ class Input extends SuperInput {
63
64
  </div>`;
64
65
  }
65
66
 
66
- reset() {
67
+ reset(): void {
67
68
  this._input.value = this.default;
68
69
  this.value = this.default;
69
70
  }
@@ -1,8 +1,8 @@
1
1
  import { godown } from "@godown/element/decorators/godown.js";
2
2
  import { styles } from "@godown/element/decorators/styles.js";
3
- import { classList } from "@godown/element/directives/class-list.js";
3
+ import { attr } from "@godown/element/directives/attr.js";
4
4
  import { htmlSlot } from "@godown/element/directives/html-slot.js";
5
- import { css, html } from "lit";
5
+ import { css, html, type TemplateResult } from "lit";
6
6
  import { property } from "lit/decorators.js";
7
7
 
8
8
  import { GlobalStyle } from "../core/global-style.js";
@@ -20,13 +20,18 @@ const protoName = "layout";
20
20
  @godown(protoName)
21
21
  @styles(
22
22
  css`
23
- :host {
23
+ :host,
24
+ :host([contents]) [part=root] {
24
25
  min-height: 100%;
25
26
  display: flex;
26
27
  flex-direction: column;
27
28
  }
28
29
 
29
- .sticky {
30
+ [part=root] {
31
+ display: contents;
32
+ }
33
+
34
+ [sticky] header {
30
35
  position: sticky;
31
36
  top: 0;
32
37
  z-index: 1;
@@ -64,10 +69,11 @@ class NavLayout extends GlobalStyle {
64
69
  @property({ type: Boolean })
65
70
  sticky = false;
66
71
 
67
- protected render() {
68
- return html`${
72
+ protected render(): TemplateResult<1> {
73
+ return html`<div part="root" ${attr(this.observedRecord)}>
74
+ ${
69
75
  !this.noHeader
70
- ? html`<header part="header" class="${classList({ sticky: this.sticky })}">${htmlSlot("header")}</header>`
76
+ ? html`<header part="header">${htmlSlot("header")}</header>`
71
77
  : ""
72
78
  }
73
79
  <main part="main">${htmlSlot()}</main>
@@ -75,7 +81,8 @@ class NavLayout extends GlobalStyle {
75
81
  !this.noFooter
76
82
  ? html`<footer part="footer">${htmlSlot("footer")}</footer>`
77
83
  : ""
78
- }`;
84
+ }
85
+ </div>`;
79
86
  }
80
87
  }
81
88
 
@@ -26,11 +26,19 @@ class Link extends SuperAnchor {
26
26
  @property()
27
27
  type: "push" | "replace" | "normal" = "normal";
28
28
 
29
- protected _handleClick(e: MouseEvent) {
29
+ /**
30
+ * Suppress the update of the {@linkcode Router}.
31
+ */
32
+ @property({ type: Boolean })
33
+ suppress = false;
34
+
35
+ protected _handleClick(e: MouseEvent): void {
30
36
  if (this.type === "push" || this.type === "replace") {
31
37
  e.preventDefault();
32
38
  (history[`${this.type}State`])(null, "", this.href);
33
- Router.updateAll();
39
+ if (!this.suppress) {
40
+ Router.updateAll();
41
+ }
34
42
  }
35
43
  }
36
44
  }