godown 3.14.0 → 3.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/build/alert.js +1 -1
  2. package/build/avatar.js +1 -1
  3. package/build/badge.js +1 -1
  4. package/build/breath.js +1 -1
  5. package/build/button.js +1 -1
  6. package/build/card.js +1 -1
  7. package/build/carousel.js +1 -1
  8. package/build/chip.js +1 -1
  9. package/build/details.js +1 -1
  10. package/build/dialog.js +1 -1
  11. package/build/divider.js +1 -1
  12. package/build/dragbox.js +1 -1
  13. package/build/flex.js +1 -1
  14. package/build/form.js +1 -1
  15. package/build/godown.iife.js +16 -16
  16. package/build/godown.iife.js.map +1 -1
  17. package/build/godown.umd.js +16 -16
  18. package/build/godown.umd.js.map +1 -1
  19. package/build/grid.js +1 -1
  20. package/build/heading.js +1 -1
  21. package/build/index.d.ts +1 -1
  22. package/build/index.d.ts.map +1 -1
  23. package/build/index.js +1 -1
  24. package/build/input.js +1 -1
  25. package/build/internal/global-style.d.ts.map +1 -1
  26. package/build/internal/global-style.js +1 -1
  27. package/build/internal/global-style.js.map +1 -1
  28. package/build/internal/icons/caret-down.d.ts.map +1 -1
  29. package/build/internal/icons/caret-down.js +1 -1
  30. package/build/internal/icons/caret-down.js.map +1 -1
  31. package/build/internal/icons/caret-left.d.ts.map +1 -1
  32. package/build/internal/icons/caret-left.js +1 -1
  33. package/build/internal/icons/caret-left.js.map +1 -1
  34. package/build/internal/icons/caret-right.d.ts.map +1 -1
  35. package/build/internal/icons/caret-right.js +1 -1
  36. package/build/internal/icons/caret-right.js.map +1 -1
  37. package/build/internal/icons/eye-slash.d.ts.map +1 -1
  38. package/build/internal/icons/eye-slash.js +1 -1
  39. package/build/internal/icons/eye-slash.js.map +1 -1
  40. package/build/internal/popover.d.ts +1 -1
  41. package/build/internal/popover.d.ts.map +1 -1
  42. package/build/internal/popover.js +1 -1
  43. package/build/internal/popover.js.map +1 -1
  44. package/build/internal/reset-style.d.ts.map +1 -1
  45. package/build/internal/reset-style.js +2 -2
  46. package/build/internal/reset-style.js.map +1 -1
  47. package/build/internal/ring.d.ts.map +1 -1
  48. package/build/internal/ring.js +1 -1
  49. package/build/internal/ring.js.map +1 -1
  50. package/build/internal/super-input.d.ts.map +1 -1
  51. package/build/internal/super-input.js +2 -2
  52. package/build/internal/super-input.js.map +1 -1
  53. package/build/internal/utils.d.ts.map +1 -1
  54. package/build/internal/utils.js +1 -1
  55. package/build/internal/utils.js.map +1 -1
  56. package/build/layout.js +1 -1
  57. package/build/link.js +1 -1
  58. package/build/popover.js +1 -1
  59. package/build/progress.js +1 -1
  60. package/build/range.js +1 -1
  61. package/build/rotate.js +1 -1
  62. package/build/router.js +1 -1
  63. package/build/select.js +1 -1
  64. package/build/skeleton.js +1 -1
  65. package/build/split.js +1 -1
  66. package/build/switch.js +1 -1
  67. package/build/tabs.js +1 -1
  68. package/build/text.js +1 -1
  69. package/build/time.js +1 -1
  70. package/build/tooltip.js +1 -1
  71. package/build/typewriter.js +1 -1
  72. package/build/web-components/alert/component.d.ts.map +1 -1
  73. package/build/web-components/alert/component.js +1 -1
  74. package/build/web-components/alert/component.js.map +1 -1
  75. package/build/web-components/alert/definition.d.ts.map +1 -1
  76. package/build/web-components/alert/definition.js +1 -1
  77. package/build/web-components/alert/definition.js.map +1 -1
  78. package/build/web-components/avatar/component.d.ts.map +1 -1
  79. package/build/web-components/avatar/component.js +1 -1
  80. package/build/web-components/avatar/component.js.map +1 -1
  81. package/build/web-components/avatar/definition.d.ts.map +1 -1
  82. package/build/web-components/avatar/definition.js +1 -1
  83. package/build/web-components/avatar/definition.js.map +1 -1
  84. package/build/web-components/badge/component.d.ts.map +1 -1
  85. package/build/web-components/badge/component.js +2 -2
  86. package/build/web-components/badge/component.js.map +1 -1
  87. package/build/web-components/badge/definition.d.ts.map +1 -1
  88. package/build/web-components/badge/definition.js +1 -1
  89. package/build/web-components/badge/definition.js.map +1 -1
  90. package/build/web-components/breath/component.d.ts.map +1 -1
  91. package/build/web-components/breath/component.js +1 -1
  92. package/build/web-components/breath/component.js.map +1 -1
  93. package/build/web-components/breath/definition.d.ts.map +1 -1
  94. package/build/web-components/breath/definition.js +1 -1
  95. package/build/web-components/breath/definition.js.map +1 -1
  96. package/build/web-components/button/component.d.ts.map +1 -1
  97. package/build/web-components/button/component.js +1 -1
  98. package/build/web-components/button/component.js.map +1 -1
  99. package/build/web-components/button/definition.d.ts.map +1 -1
  100. package/build/web-components/button/definition.js +1 -1
  101. package/build/web-components/button/definition.js.map +1 -1
  102. package/build/web-components/card/component.d.ts.map +1 -1
  103. package/build/web-components/card/component.js +1 -1
  104. package/build/web-components/card/component.js.map +1 -1
  105. package/build/web-components/card/definition.d.ts.map +1 -1
  106. package/build/web-components/card/definition.js +1 -1
  107. package/build/web-components/card/definition.js.map +1 -1
  108. package/build/web-components/carousel/component.d.ts.map +1 -1
  109. package/build/web-components/carousel/component.js +2 -2
  110. package/build/web-components/carousel/component.js.map +1 -1
  111. package/build/web-components/carousel/definition.d.ts.map +1 -1
  112. package/build/web-components/carousel/definition.js +1 -1
  113. package/build/web-components/carousel/definition.js.map +1 -1
  114. package/build/web-components/chip/component.d.ts.map +1 -1
  115. package/build/web-components/chip/component.js +1 -1
  116. package/build/web-components/chip/component.js.map +1 -1
  117. package/build/web-components/chip/definition.d.ts.map +1 -1
  118. package/build/web-components/chip/definition.js +1 -1
  119. package/build/web-components/chip/definition.js.map +1 -1
  120. package/build/web-components/details/component.d.ts.map +1 -1
  121. package/build/web-components/details/component.js +1 -1
  122. package/build/web-components/details/component.js.map +1 -1
  123. package/build/web-components/details/definition.d.ts.map +1 -1
  124. package/build/web-components/details/definition.js +1 -1
  125. package/build/web-components/details/definition.js.map +1 -1
  126. package/build/web-components/dialog/component.d.ts.map +1 -1
  127. package/build/web-components/dialog/component.js +1 -1
  128. package/build/web-components/dialog/component.js.map +1 -1
  129. package/build/web-components/dialog/definition.d.ts.map +1 -1
  130. package/build/web-components/dialog/definition.js +1 -1
  131. package/build/web-components/dialog/definition.js.map +1 -1
  132. package/build/web-components/divider/component.d.ts.map +1 -1
  133. package/build/web-components/divider/component.js +1 -1
  134. package/build/web-components/divider/component.js.map +1 -1
  135. package/build/web-components/divider/definition.d.ts.map +1 -1
  136. package/build/web-components/divider/definition.js +1 -1
  137. package/build/web-components/divider/definition.js.map +1 -1
  138. package/build/web-components/dragbox/component.d.ts.map +1 -1
  139. package/build/web-components/dragbox/component.js +2 -2
  140. package/build/web-components/dragbox/component.js.map +1 -1
  141. package/build/web-components/dragbox/definition.d.ts.map +1 -1
  142. package/build/web-components/dragbox/definition.js +1 -1
  143. package/build/web-components/dragbox/definition.js.map +1 -1
  144. package/build/web-components/flex/component.d.ts.map +1 -1
  145. package/build/web-components/flex/component.js +2 -2
  146. package/build/web-components/flex/component.js.map +1 -1
  147. package/build/web-components/flex/definition.d.ts.map +1 -1
  148. package/build/web-components/flex/definition.js +1 -1
  149. package/build/web-components/flex/definition.js.map +1 -1
  150. package/build/web-components/form/component.d.ts.map +1 -1
  151. package/build/web-components/form/component.js +2 -2
  152. package/build/web-components/form/component.js.map +1 -1
  153. package/build/web-components/form/definition.d.ts.map +1 -1
  154. package/build/web-components/form/definition.js +1 -1
  155. package/build/web-components/form/definition.js.map +1 -1
  156. package/build/web-components/grid/component.d.ts.map +1 -1
  157. package/build/web-components/grid/component.js +2 -2
  158. package/build/web-components/grid/component.js.map +1 -1
  159. package/build/web-components/grid/definition.d.ts.map +1 -1
  160. package/build/web-components/grid/definition.js +1 -1
  161. package/build/web-components/grid/definition.js.map +1 -1
  162. package/build/web-components/heading/component.d.ts.map +1 -1
  163. package/build/web-components/heading/component.js +2 -2
  164. package/build/web-components/heading/component.js.map +1 -1
  165. package/build/web-components/heading/definition.d.ts.map +1 -1
  166. package/build/web-components/heading/definition.js +1 -1
  167. package/build/web-components/heading/definition.js.map +1 -1
  168. package/build/web-components/input/component.d.ts.map +1 -1
  169. package/build/web-components/input/component.js +1 -1
  170. package/build/web-components/input/component.js.map +1 -1
  171. package/build/web-components/input/definition.d.ts.map +1 -1
  172. package/build/web-components/input/definition.js +1 -1
  173. package/build/web-components/input/definition.js.map +1 -1
  174. package/build/web-components/layout/component.d.ts.map +1 -1
  175. package/build/web-components/layout/component.js +2 -2
  176. package/build/web-components/layout/component.js.map +1 -1
  177. package/build/web-components/layout/definition.d.ts.map +1 -1
  178. package/build/web-components/layout/definition.js +1 -1
  179. package/build/web-components/layout/definition.js.map +1 -1
  180. package/build/web-components/link/component.d.ts.map +1 -1
  181. package/build/web-components/link/component.js +2 -2
  182. package/build/web-components/link/component.js.map +1 -1
  183. package/build/web-components/link/definition.d.ts.map +1 -1
  184. package/build/web-components/link/definition.js +1 -1
  185. package/build/web-components/link/definition.js.map +1 -1
  186. package/build/web-components/popover/component.d.ts.map +1 -1
  187. package/build/web-components/popover/component.js +2 -2
  188. package/build/web-components/popover/component.js.map +1 -1
  189. package/build/web-components/popover/definition.d.ts.map +1 -1
  190. package/build/web-components/popover/definition.js +1 -1
  191. package/build/web-components/popover/definition.js.map +1 -1
  192. package/build/web-components/progress/component.d.ts.map +1 -1
  193. package/build/web-components/progress/component.js +1 -1
  194. package/build/web-components/progress/component.js.map +1 -1
  195. package/build/web-components/progress/definition.d.ts.map +1 -1
  196. package/build/web-components/progress/definition.js +1 -1
  197. package/build/web-components/progress/definition.js.map +1 -1
  198. package/build/web-components/range/component.d.ts.map +1 -1
  199. package/build/web-components/range/component.js +1 -1
  200. package/build/web-components/range/component.js.map +1 -1
  201. package/build/web-components/range/definition.d.ts.map +1 -1
  202. package/build/web-components/range/definition.js +1 -1
  203. package/build/web-components/range/definition.js.map +1 -1
  204. package/build/web-components/rotate/component.d.ts.map +1 -1
  205. package/build/web-components/rotate/component.js +1 -1
  206. package/build/web-components/rotate/component.js.map +1 -1
  207. package/build/web-components/rotate/definition.d.ts.map +1 -1
  208. package/build/web-components/rotate/definition.js +1 -1
  209. package/build/web-components/rotate/definition.js.map +1 -1
  210. package/build/web-components/router/component.d.ts.map +1 -1
  211. package/build/web-components/router/component.js +2 -2
  212. package/build/web-components/router/component.js.map +1 -1
  213. package/build/web-components/router/definition.d.ts.map +1 -1
  214. package/build/web-components/router/definition.js +1 -1
  215. package/build/web-components/router/definition.js.map +1 -1
  216. package/build/web-components/select/component.d.ts.map +1 -1
  217. package/build/web-components/select/component.js +2 -2
  218. package/build/web-components/select/component.js.map +1 -1
  219. package/build/web-components/select/definition.d.ts.map +1 -1
  220. package/build/web-components/select/definition.js +1 -1
  221. package/build/web-components/select/definition.js.map +1 -1
  222. package/build/web-components/skeleton/component.d.ts.map +1 -1
  223. package/build/web-components/skeleton/component.js +1 -1
  224. package/build/web-components/skeleton/component.js.map +1 -1
  225. package/build/web-components/skeleton/definition.d.ts.map +1 -1
  226. package/build/web-components/skeleton/definition.js +1 -1
  227. package/build/web-components/skeleton/definition.js.map +1 -1
  228. package/build/web-components/split/component.d.ts.map +1 -1
  229. package/build/web-components/split/component.js +1 -1
  230. package/build/web-components/split/component.js.map +1 -1
  231. package/build/web-components/split/definition.d.ts.map +1 -1
  232. package/build/web-components/split/definition.js +1 -1
  233. package/build/web-components/split/definition.js.map +1 -1
  234. package/build/web-components/switch/component.d.ts.map +1 -1
  235. package/build/web-components/switch/component.js +1 -1
  236. package/build/web-components/switch/component.js.map +1 -1
  237. package/build/web-components/switch/definition.d.ts.map +1 -1
  238. package/build/web-components/switch/definition.js +1 -1
  239. package/build/web-components/switch/definition.js.map +1 -1
  240. package/build/web-components/tabs/component.d.ts +1 -1
  241. package/build/web-components/tabs/component.d.ts.map +1 -1
  242. package/build/web-components/tabs/component.js +1 -1
  243. package/build/web-components/tabs/component.js.map +1 -1
  244. package/build/web-components/tabs/definition.d.ts.map +1 -1
  245. package/build/web-components/tabs/definition.js +1 -1
  246. package/build/web-components/tabs/definition.js.map +1 -1
  247. package/build/web-components/text/component.d.ts.map +1 -1
  248. package/build/web-components/text/component.js +1 -1
  249. package/build/web-components/text/component.js.map +1 -1
  250. package/build/web-components/text/definition.d.ts.map +1 -1
  251. package/build/web-components/text/definition.js +1 -1
  252. package/build/web-components/text/definition.js.map +1 -1
  253. package/build/web-components/time/component.d.ts.map +1 -1
  254. package/build/web-components/time/component.js +1 -1
  255. package/build/web-components/time/component.js.map +1 -1
  256. package/build/web-components/time/definition.d.ts.map +1 -1
  257. package/build/web-components/time/definition.js +1 -1
  258. package/build/web-components/time/definition.js.map +1 -1
  259. package/build/web-components/tooltip/component.d.ts.map +1 -1
  260. package/build/web-components/tooltip/component.js +1 -1
  261. package/build/web-components/tooltip/component.js.map +1 -1
  262. package/build/web-components/tooltip/definition.d.ts.map +1 -1
  263. package/build/web-components/tooltip/definition.js +1 -1
  264. package/build/web-components/tooltip/definition.js.map +1 -1
  265. package/build/web-components/typewriter/component.d.ts.map +1 -1
  266. package/build/web-components/typewriter/component.js +1 -1
  267. package/build/web-components/typewriter/component.js.map +1 -1
  268. package/build/web-components/typewriter/definition.d.ts.map +1 -1
  269. package/build/web-components/typewriter/definition.js +1 -1
  270. package/build/web-components/typewriter/definition.js.map +1 -1
  271. package/custom-elements.json +1 -1
  272. package/package.json +2 -2
  273. package/src/index.ts +1 -1
  274. package/src/internal/popover.ts +8 -12
  275. package/src/internal/ring.ts +3 -1
  276. package/src/web-components/breath/component.ts +3 -1
  277. package/src/web-components/tabs/component.ts +1 -1
  278. package/web-types.json +1 -1
@@ -1,3 +1,3 @@
1
- import{godown,styles,htmlSlot}from"@godown/element";import{css}from"lit";import{property}from"lit/decorators.js";import{GlobalStyle}from"../../internal/global-style.js";import _decorate from"@oxc-project/runtime/helpers/decorate";import"../../internal/reset-style.js";import"sharekit";var _Form;const protoName=`form`;let Form=_Form=class e extends GlobalStyle{constructor(...e){super(...e),this.name=``,this.nameValue=this.namevalue}get value(){return _Form.buildValue(this._slot.assignedElements())}render(){return htmlSlot()}reset(){this.deepQuerySelectorAll(`*`).forEach(e=>{e.tagName!==this.tagName&&e.reset&&e.reset()})}namevalue(){return[this.name,this.value]}static buildValue(e){let c={};for(let l of e)if(l.tagName===`FORM`)Object.assign(c,Object.fromEntries(new FormData(l).entries()));else if(l.namevalue){let[e,u]=l.namevalue();e&&(c[e]=u)}else if(l.name&&l.value!==void 0)c[l.name]=l.value;else if(l.shadowRoot)for(let e of l.shadowRoot.querySelectorAll(`slot`))Object.assign(c,this.buildValue(e.assignedElements()));return c}};_decorate([property()],Form.prototype,`name`,void 0),Form=_Form=_decorate([godown(protoName),styles(css`:host{display:block}
2
- `)],Form);var Form$1=Form;export{Form,Form$1 as default};
1
+ import{godown as e,styles as t,htmlSlot as n}from"@godown/element";import{css as r}from"lit";import{property as i}from"lit/decorators.js";import{GlobalStyle as a}from"../../internal/global-style.js";import o from"@oxc-project/runtime/helpers/decorate";var s;const c=`form`;let l=s=class e extends a{constructor(...e){super(...e),this.name=``,this.nameValue=this.namevalue}get value(){return s.buildValue(this._slot.assignedElements())}render(){return n()}reset(){this.deepQuerySelectorAll(`*`).forEach(e=>{e.tagName!==this.tagName&&e.reset&&e.reset()})}namevalue(){return[this.name,this.value]}static buildValue(e){let t={};for(let n of e)if(n.tagName===`FORM`)Object.assign(t,Object.fromEntries(new FormData(n).entries()));else if(n.namevalue){let[e,r]=n.namevalue();e&&(t[e]=r)}else if(n.name&&n.value!==void 0)t[n.name]=n.value;else if(n.shadowRoot)for(let e of n.shadowRoot.querySelectorAll(`slot`))Object.assign(t,this.buildValue(e.assignedElements()));return t}};o([i()],l.prototype,`name`,void 0),l=s=o([e(`form`),t(r`:host{display:block}
2
+ `)],l);var u=l;export{l as Form,u as default};
3
3
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/web-components/form/component.ts"],"sourcesContent":["import { godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { GlobalStyle } from \"../../internal/global-style.js\";\n\nconst protoName = \"form\";\n\n/**\n * {@linkcode Form} Gets child element key-value object,\n * which will be nested if the child element is the same as this element.\n *\n * @category form\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n }\n`)\nclass Form<T = object> extends GlobalStyle {\n @property()\n name = \"\";\n\n get value(): T {\n return Form.buildValue(this._slot.assignedElements()) as T;\n }\n\n nameValue: () => [string, T] = this.namevalue;\n\n protected render(): TemplateResult<1> {\n return htmlSlot();\n }\n\n reset(): void {\n this.deepQuerySelectorAll<HTMLElement & { reset?: () => void }>(\"*\").forEach((el) => {\n if (el.tagName === this.tagName) {\n return;\n }\n if (el.reset) {\n el.reset();\n }\n });\n }\n\n namevalue(): [string, T] {\n return [this.name, this.value];\n }\n\n static buildValue(\n elements: (Element & {\n name?: string;\n value?: unknown;\n namevalue?: () => [string, unknown];\n })[],\n ): Record<string, any> {\n const result = {};\n for (const el of elements) {\n if (el.tagName === \"FORM\") {\n Object.assign(result, Object.fromEntries(new FormData(el as HTMLFormElement).entries()));\n } else if (el.namevalue) {\n const [name, value] = el.namevalue();\n if (name) {\n result[name] = value;\n }\n } else if (el.name && el.value !== undefined) {\n result[el.name] = el.value;\n } else if (el.shadowRoot) {\n for (const slot of el.shadowRoot.querySelectorAll(\"slot\")) {\n Object.assign(result, this.buildValue(slot.assignedElements()));\n }\n }\n }\n return result;\n }\n}\n\nexport default Form;\nexport { Form };\n"],"names":["Form","el","elements: (Element & {\n name?: string;\n value?: unknown;\n namevalue?: () => [string, unknown];\n })[]","result","elements","name","value","slot"],"mappings":"uSAMA,MAAM,UAAY,OAQlB,IAAA,KAAA,MAAA,MAMMA,UAAyB,WAAY,oCAEzC,KAAO,GAMP,KAAA,UAA+B,KAAK,UAJpC,IAAI,OAAW,CACb,OAAA,MAAY,WAAW,KAAK,MAAM,kBAAkB,CAAC,AACtD,CAIS,QAA4B,CACpC,OAAO,UAAU,AAClB,CAED,OAAc,CACZ,KAAK,qBAA2D,IAAI,CAAC,QAAQ,AAACC,GAAO,CAC/EA,EAAG,UAAY,KAAK,SAGpBA,EAAG,OACLA,EAAG,OAAO,AAEb,EAAC,AACH,CAED,WAAyB,CACvB,MAAO,CAAC,KAAK,KAAM,KAAK,KAAM,CAC/B,CAED,OAAO,WACLC,EAKqB,CACrB,IAAMC,EAAS,CAAE,EACjB,IAAK,IAAMF,KAAMG,EACf,GAAIH,EAAG,UAAY,OACjB,OAAO,OAAOE,EAAQ,OAAO,YAAY,IAAI,SAASF,GAAuB,SAAS,CAAC,CAAC,SAC/EA,EAAG,UAAW,CACvB,GAAM,CAACI,EAAMC,EAAM,CAAGL,EAAG,WAAW,CAChCI,IACFF,EAAOE,GAAQC,EAElB,SAAUL,EAAG,MAAQA,EAAG,QAAU,OACjCE,EAAOF,EAAG,MAAQA,EAAG,cACZA,EAAG,WACZ,IAAK,IAAMM,KAAQN,EAAG,WAAW,iBAAiB,OAAO,CACvD,OAAO,OAAOE,EAAQ,KAAK,WAAWI,EAAK,kBAAkB,CAAC,CAAC,CAIrE,OAAOJ,CACR,CACF,aAtDE,UAAU,AAAA,EAAA,KAAA,UAAA,OAAA,OAAA,CAPZ,KAAA,MAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC;AAIZ,CAAC,CAAC,AAAA,EAAA,KAAA,CA0DF,IAAA,OAAe"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/web-components/form/component.ts"],"sourcesContent":["import { godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { GlobalStyle } from \"../../internal/global-style.js\";\n\nconst protoName = \"form\";\n\n/**\n * {@linkcode Form} Gets child element key-value object,\n * which will be nested if the child element is the same as this element.\n *\n * @category form\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n }\n`)\nclass Form<T = object> extends GlobalStyle {\n @property()\n name = \"\";\n\n get value(): T {\n return Form.buildValue(this._slot.assignedElements()) as T;\n }\n\n nameValue: () => [string, T] = this.namevalue;\n\n protected render(): TemplateResult<1> {\n return htmlSlot();\n }\n\n reset(): void {\n this.deepQuerySelectorAll<HTMLElement & { reset?: () => void }>(\"*\").forEach((el) => {\n if (el.tagName === this.tagName) {\n return;\n }\n if (el.reset) {\n el.reset();\n }\n });\n }\n\n namevalue(): [string, T] {\n return [this.name, this.value];\n }\n\n static buildValue(\n elements: (Element & {\n name?: string;\n value?: unknown;\n namevalue?: () => [string, unknown];\n })[],\n ): Record<string, any> {\n const result = {};\n for (const el of elements) {\n if (el.tagName === \"FORM\") {\n Object.assign(result, Object.fromEntries(new FormData(el as HTMLFormElement).entries()));\n } else if (el.namevalue) {\n const [name, value] = el.namevalue();\n if (name) {\n result[name] = value;\n }\n } else if (el.name && el.value !== undefined) {\n result[el.name] = el.value;\n } else if (el.shadowRoot) {\n for (const slot of el.shadowRoot.querySelectorAll(\"slot\")) {\n Object.assign(result, this.buildValue(slot.assignedElements()));\n }\n }\n }\n return result;\n }\n}\n\nexport default Form;\nexport { Form };\n"],"names":["protoName","Form","GlobalStyle","_Form","htmlSlot","el","result","elements","name","value","slot","_decorate","property","godown","styles","Form$1"],"mappings":"kQAMA,MAAMA,EAAY,OAQlB,IAAAC,EAAA,EAAA,MAMMA,UAAyBC,CAAY,oCAEzC,KAAO,GAMP,KAAA,UAA+B,KAAK,UAJpC,IAAI,OAAW,CACb,OAAAC,EAAY,WAAW,KAAK,MAAM,oBAK1B,QAA4B,CACpC,OAAOC,IAGT,OAAc,CACZ,KAAK,qBAA2D,KAAK,QAAS,GAAO,CAC/EC,EAAG,UAAY,KAAK,SAGpBA,EAAG,OACLA,EAAG,UAKT,WAAyB,CACvB,MAAO,CAAC,KAAK,KAAM,KAAK,OAG1B,OAAO,WACL,EAKqB,CACrB,IAAMC,EAAS,GACf,IAAK,IAAMD,KAAME,EACf,GAAIF,EAAG,UAAY,OACjB,OAAO,OAAOC,EAAQ,OAAO,YAAY,IAAI,SAASD,GAAuB,oBACpEA,EAAG,UAAW,CACvB,GAAM,CAACG,EAAMC,GAASJ,EAAG,YACrBG,IACF,EAAOA,GAAQC,WAERJ,EAAG,MAAQA,EAAG,QAAU,OACjC,EAAOA,EAAG,MAAQA,EAAG,cACZA,EAAG,WACZ,IAAK,IAAMK,KAAQL,EAAG,WAAW,iBAAiB,QAChD,OAAO,OAAOC,EAAQ,KAAK,WAAWI,EAAK,qBAIjD,OAAOJ,IApDRK,EAAA,CAAAC,KAAAX,EAAA,UAAA,OAAA,eAPFY,EAAO,QACPC,EAAO,CAAG;OA8DX,IAAAC,EAAed"}
@@ -1 +1 @@
1
- {"mappings":"AAAA,OAAO,UAAU,gBAAiB;AAIlC,eAAe;eAEA;WACH,sBAAsB;EAC9B,eAAe;CAChB;AACF","names":[],"sources":["../../../../src/web-components/form/definition.ts"],"sourcesContent":["import Form from \"./component.js\";\n\nForm.define();\n\nexport default Form;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-form\": Form;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
1
+ {"mappings":"AAAA,OAAO,UAAU;AAIjB,eAAe;eAEA;WACH,sBAAsB;EAC9B,eAAe","names":[],"sources":["../../../../src/web-components/form/definition.ts"],"sourcesContent":["import Form from \"./component.js\";\n\nForm.define();\n\nexport default Form;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-form\": Form;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
@@ -1,2 +1,2 @@
1
- import Form from"./component.js";import"@godown/element";import"lit";import"lit/decorators.js";import"../../internal/global-style.js";import"../../internal/reset-style.js";import"sharekit";import"@oxc-project/runtime/helpers/decorate";Form.define();export{Form as default};
1
+ import e from"./component.js";e.define();export{e as default};
2
2
  //# sourceMappingURL=definition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definition.js","sources":["../../../src/web-components/form/definition.ts"],"sourcesContent":["import Form from \"./component.js\";\n\nForm.define();\n\nexport default Form;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-form\": Form;\n }\n}\n"],"names":[],"mappings":"2OAEA,KAAK,QAAQ"}
1
+ {"version":3,"file":"definition.js","sources":["../../../src/web-components/form/definition.ts"],"sourcesContent":["import Form from \"./component.js\";\n\nForm.define();\n\nexport default Form;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-form\": Form;\n }\n}\n"],"names":["Form"],"mappings":"8BAEAA,EAAK"}
@@ -1 +1 @@
1
- {"mappings":"AACA,cAAc,sBAAiC,KAAM;AAIrD,SAAS,mBAAmB,gCAAiC;;;;;;;AAY7D,cAWM,aAAa,YAAY;;;;CAI7B,AACA;;;;;;CAOA,AACA;;;;;;CAOA,AACA;;;;CAKA,AACA;;;;CAKA,AACA;CAEA;CAiBA,UAAU,UAAU,eAAe;AAUpC;AAED,eAAe;AACf,SAAS","names":[],"sources":["../../../../src/web-components/grid/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, StyleController, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { isNumerical } from \"sharekit\";\n\nimport { GlobalStyle } from \"../../internal/global-style.js\";\n\nconst toTemplate = (s: number | string) => (isNumerical(s) ? `repeat(${s},1fr)` : s);\n\nconst protoName = \"grid\";\n\n/**\n * {@linkcode Grid} provides gird layout.\n *\n * @slot - Grid items.\n * @category layout\n */\n@godown(protoName)\n@styles(css`\n :host,\n :host([contents]) [part=\"root\"] {\n display: grid;\n }\n\n [part=\"root\"] {\n display: contents;\n }\n`)\nclass Grid extends GlobalStyle {\n /**\n * CSS property `gap`.\n */\n @property()\n gap: string;\n\n /**\n * CSS property `grid-template-columns`.\n *\n * If columns is numerical, divide columns equally.\n */\n @property()\n columns: string | number;\n\n /**\n * CSS property `grid-template-rows`.\n *\n * If rows is numerical, divide rows equally.\n */\n @property()\n rows: string | number;\n\n /**\n * CSS property `place-content` (`align-content justify-content`).\n */\n @property()\n content: string;\n\n /**\n * CSS property `place-items` (`align-items justify-items`).\n */\n @property()\n items: string;\n\n constructor() {\n super();\n new StyleController(\n this,\n () => ({\n \":host\": {\n gap: this.gap,\n \"grid-template-columns\": toTemplate(this.columns),\n \"grid-template-rows\": toTemplate(this.rows),\n \"place-content\": this.content,\n \"place-items\": this.items,\n },\n }),\n () => [this.gap, this.columns, this.rows, this.content, this.items],\n );\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${htmlSlot()}\n </div>\n `;\n }\n}\n\nexport default Grid;\nexport { Grid };\n"],"version":3,"file":"component.d.ts"}
1
+ {"mappings":"AACA,cAAc,sBAAiC;AAI/C,SAAS,mBAAmB;;;;;;;AAY5B,cAWM,aAAa,YAAY;;;;CAI7B,AACA;;;;;;CAOA,AACA;;;;;;CAOA,AACA;;;;CAKA,AACA;;;;CAKA,AACA;CAEA;CAiBA,UAAU,UAAU,eAAe;;AAYrC,eAAe;AACf,SAAS","names":[],"sources":["../../../../src/web-components/grid/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, StyleController, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { isNumerical } from \"sharekit\";\n\nimport { GlobalStyle } from \"../../internal/global-style.js\";\n\nconst toTemplate = (s: number | string) => (isNumerical(s) ? `repeat(${s},1fr)` : s);\n\nconst protoName = \"grid\";\n\n/**\n * {@linkcode Grid} provides gird layout.\n *\n * @slot - Grid items.\n * @category layout\n */\n@godown(protoName)\n@styles(css`\n :host,\n :host([contents]) [part=\"root\"] {\n display: grid;\n }\n\n [part=\"root\"] {\n display: contents;\n }\n`)\nclass Grid extends GlobalStyle {\n /**\n * CSS property `gap`.\n */\n @property()\n gap: string;\n\n /**\n * CSS property `grid-template-columns`.\n *\n * If columns is numerical, divide columns equally.\n */\n @property()\n columns: string | number;\n\n /**\n * CSS property `grid-template-rows`.\n *\n * If rows is numerical, divide rows equally.\n */\n @property()\n rows: string | number;\n\n /**\n * CSS property `place-content` (`align-content justify-content`).\n */\n @property()\n content: string;\n\n /**\n * CSS property `place-items` (`align-items justify-items`).\n */\n @property()\n items: string;\n\n constructor() {\n super();\n new StyleController(\n this,\n () => ({\n \":host\": {\n gap: this.gap,\n \"grid-template-columns\": toTemplate(this.columns),\n \"grid-template-rows\": toTemplate(this.rows),\n \"place-content\": this.content,\n \"place-items\": this.items,\n },\n }),\n () => [this.gap, this.columns, this.rows, this.content, this.items],\n );\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${htmlSlot()}\n </div>\n `;\n }\n}\n\nexport default Grid;\nexport { Grid };\n"],"version":3,"file":"component.d.ts"}
@@ -1,3 +1,3 @@
1
- import{godown,styles,StyleController,attr,htmlSlot}from"@godown/element";import{css,html}from"lit";import{property}from"lit/decorators.js";import{isNumerical}from"sharekit";import{GlobalStyle}from"../../internal/global-style.js";import _decorate from"@oxc-project/runtime/helpers/decorate";import"../../internal/reset-style.js";const toTemplate=e=>isNumerical(e)?`repeat(${e},1fr)`:e,protoName=`grid`;let Grid=class e extends GlobalStyle{constructor(){super(),new StyleController(this,()=>({":host":{gap:this.gap,"grid-template-columns":toTemplate(this.columns),"grid-template-rows":toTemplate(this.rows),"place-content":this.content,"place-items":this.items}}),()=>[this.gap,this.columns,this.rows,this.content,this.items])}render(){return html`<div part="root" ${attr(this.observedRecord)}> ${htmlSlot()} </div>`}};_decorate([property()],Grid.prototype,`gap`,void 0),_decorate([property()],Grid.prototype,`columns`,void 0),_decorate([property()],Grid.prototype,`rows`,void 0),_decorate([property()],Grid.prototype,`content`,void 0),_decorate([property()],Grid.prototype,`items`,void 0),Grid=_decorate([godown(protoName),styles(css`:host,:host([contents]) [part=root]{display:grid}[part=root]{display:contents}
2
- `)],Grid);var Grid$1=Grid;export{Grid,Grid$1 as default};
1
+ import{godown as e,styles as t,StyleController as n,attr as r,htmlSlot as i}from"@godown/element";import{css as a,html as o}from"lit";import{property as s}from"lit/decorators.js";import{isNumerical as c}from"sharekit";import{GlobalStyle as l}from"../../internal/global-style.js";import u from"@oxc-project/runtime/helpers/decorate";const d=e=>c(e)?`repeat(${e},1fr)`:e,f=`grid`;let p=class e extends l{constructor(){super(),new n(this,()=>({":host":{gap:this.gap,"grid-template-columns":d(this.columns),"grid-template-rows":d(this.rows),"place-content":this.content,"place-items":this.items}}),()=>[this.gap,this.columns,this.rows,this.content,this.items])}render(){return o`<div part="root" ${r(this.observedRecord)}> ${i()} </div>`}};u([s()],p.prototype,`gap`,void 0),u([s()],p.prototype,`columns`,void 0),u([s()],p.prototype,`rows`,void 0),u([s()],p.prototype,`content`,void 0),u([s()],p.prototype,`items`,void 0),p=u([e(`grid`),t(a`:host,:host([contents]) [part=root]{display:grid}[part=root]{display:contents}
2
+ `)],p);var m=p;export{p as Grid,m as default};
3
3
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/web-components/grid/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, StyleController, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { isNumerical } from \"sharekit\";\n\nimport { GlobalStyle } from \"../../internal/global-style.js\";\n\nconst toTemplate = (s: number | string) => (isNumerical(s) ? `repeat(${s},1fr)` : s);\n\nconst protoName = \"grid\";\n\n/**\n * {@linkcode Grid} provides gird layout.\n *\n * @slot - Grid items.\n * @category layout\n */\n@godown(protoName)\n@styles(css`\n :host,\n :host([contents]) [part=\"root\"] {\n display: grid;\n }\n\n [part=\"root\"] {\n display: contents;\n }\n`)\nclass Grid extends GlobalStyle {\n /**\n * CSS property `gap`.\n */\n @property()\n gap: string;\n\n /**\n * CSS property `grid-template-columns`.\n *\n * If columns is numerical, divide columns equally.\n */\n @property()\n columns: string | number;\n\n /**\n * CSS property `grid-template-rows`.\n *\n * If rows is numerical, divide rows equally.\n */\n @property()\n rows: string | number;\n\n /**\n * CSS property `place-content` (`align-content justify-content`).\n */\n @property()\n content: string;\n\n /**\n * CSS property `place-items` (`align-items justify-items`).\n */\n @property()\n items: string;\n\n constructor() {\n super();\n new StyleController(\n this,\n () => ({\n \":host\": {\n gap: this.gap,\n \"grid-template-columns\": toTemplate(this.columns),\n \"grid-template-rows\": toTemplate(this.rows),\n \"place-content\": this.content,\n \"place-items\": this.items,\n },\n }),\n () => [this.gap, this.columns, this.rows, this.content, this.items],\n );\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${htmlSlot()}\n </div>\n `;\n }\n}\n\nexport default Grid;\nexport { Grid };\n"],"names":["s: number | string","s","Grid"],"mappings":"wUAOA,MAAM,WAAa,AAACA,GAAwB,YAAYC,EAAE,CAAG,CAAC,OAAO,EAAEA,EAAE,KAAK,CAAC,CAAGA,EAE5E,UAAY,OAQlB,IAAA,KAAA,MAWMC,UAAa,WAAY,CAmC7B,aAAc,CACZ,OAAO,CACP,IAAI,gBACF,KACA,KAAO,CACL,QAAS,CACP,IAAK,KAAK,IACV,wBAAyB,WAAW,KAAK,QAAQ,CACjD,qBAAsB,WAAW,KAAK,KAAK,CAC3C,gBAAiB,KAAK,QACtB,cAAe,KAAK,KACrB,IAEH,IAAM,CAAC,KAAK,IAAK,KAAK,QAAS,KAAK,KAAM,KAAK,QAAS,KAAK,KAAM,EAEtE,CAES,QAA4B,CACpC,MAAO,KAAI,CAAA,iBAGP,EAAE,KAAK,KAAK,eAAe,CAAA,EAE3B,EAAE,UAAU,CAAA,OAEhB,CAAC,AACF,CACF,aA1DE,UAAU,AAAA,EAAA,KAAA,UAAA,MAAA,OAAA,YAQV,UAAU,AAAA,EAAA,KAAA,UAAA,UAAA,OAAA,YAQV,UAAU,AAAA,EAAA,KAAA,UAAA,OAAA,OAAA,YAMV,UAAU,AAAA,EAAA,KAAA,UAAA,UAAA,OAAA,YAMV,UAAU,AAAA,EAAA,KAAA,UAAA,QAAA,OAAA,CA3CZ,KAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC;AASZ,CAAC,CAAC,AAAA,EAAA,KAAA,CAiEF,IAAA,OAAe"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/web-components/grid/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, StyleController, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { isNumerical } from \"sharekit\";\n\nimport { GlobalStyle } from \"../../internal/global-style.js\";\n\nconst toTemplate = (s: number | string) => (isNumerical(s) ? `repeat(${s},1fr)` : s);\n\nconst protoName = \"grid\";\n\n/**\n * {@linkcode Grid} provides gird layout.\n *\n * @slot - Grid items.\n * @category layout\n */\n@godown(protoName)\n@styles(css`\n :host,\n :host([contents]) [part=\"root\"] {\n display: grid;\n }\n\n [part=\"root\"] {\n display: contents;\n }\n`)\nclass Grid extends GlobalStyle {\n /**\n * CSS property `gap`.\n */\n @property()\n gap: string;\n\n /**\n * CSS property `grid-template-columns`.\n *\n * If columns is numerical, divide columns equally.\n */\n @property()\n columns: string | number;\n\n /**\n * CSS property `grid-template-rows`.\n *\n * If rows is numerical, divide rows equally.\n */\n @property()\n rows: string | number;\n\n /**\n * CSS property `place-content` (`align-content justify-content`).\n */\n @property()\n content: string;\n\n /**\n * CSS property `place-items` (`align-items justify-items`).\n */\n @property()\n items: string;\n\n constructor() {\n super();\n new StyleController(\n this,\n () => ({\n \":host\": {\n gap: this.gap,\n \"grid-template-columns\": toTemplate(this.columns),\n \"grid-template-rows\": toTemplate(this.rows),\n \"place-content\": this.content,\n \"place-items\": this.items,\n },\n }),\n () => [this.gap, this.columns, this.rows, this.content, this.items],\n );\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${htmlSlot()}\n </div>\n `;\n }\n}\n\nexport default Grid;\nexport { Grid };\n"],"names":["toTemplate","isNumerical","s","protoName","Grid","GlobalStyle","StyleController","attr","htmlSlot","_decorate","property","godown","styles","Grid$1"],"mappings":"4UAOA,MAAMA,EAAc,GAAwBC,EAAYC,GAAK,UAAUA,EAAE,OAASA,EAE5EC,EAAY,OAQlB,IAAAC,EAAA,MAWMA,UAAaC,CAAY,CAmC7B,aAAc,CACZ,QACA,IAAIC,EACF,UACO,CACL,QAAS,CACP,IAAK,KAAK,IACV,wBAAyBN,EAAW,KAAK,SACzC,qBAAsBA,EAAW,KAAK,MACtC,gBAAiB,KAAK,QACtB,cAAe,KAAK,aAGlB,CAAC,KAAK,IAAK,KAAK,QAAS,KAAK,KAAM,KAAK,QAAS,KAAK,QAIvD,QAA4B,CACpC,MAAO,EAAI,oBAGLO,EAAK,KAAK,gBAAA,IAEVC,IAAA,WAtDPC,EAAA,CAAAC,KAAAN,EAAA,UAAA,MAAA,QAQAK,EAAA,CAAAC,KAAAN,EAAA,UAAA,UAAA,QAQAK,EAAA,CAAAC,KAAAN,EAAA,UAAA,OAAA,QAMAK,EAAA,CAAAC,KAAAN,EAAA,UAAA,UAAA,QAMAK,EAAA,CAAAC,KAAAN,EAAA,UAAA,QAAA,aA3CFO,EAAO,QACPC,EAAO,CAAG;OA0EX,IAAAC,EAAeT"}
@@ -1 +1 @@
1
- {"mappings":"AAAA,OAAO,UAAU,gBAAiB;AAIlC,eAAe;eAEA;WACH,sBAAsB;EAC9B,eAAe;CAChB;AACF","names":[],"sources":["../../../../src/web-components/grid/definition.ts"],"sourcesContent":["import Grid from \"./component.js\";\n\nGrid.define();\n\nexport default Grid;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-grid\": Grid;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
1
+ {"mappings":"AAAA,OAAO,UAAU;AAIjB,eAAe;eAEA;WACH,sBAAsB;EAC9B,eAAe","names":[],"sources":["../../../../src/web-components/grid/definition.ts"],"sourcesContent":["import Grid from \"./component.js\";\n\nGrid.define();\n\nexport default Grid;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-grid\": Grid;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
@@ -1,2 +1,2 @@
1
- import Grid from"./component.js";import"@godown/element";import"lit";import"lit/decorators.js";import"sharekit";import"../../internal/global-style.js";import"../../internal/reset-style.js";import"@oxc-project/runtime/helpers/decorate";Grid.define();export{Grid as default};
1
+ import e from"./component.js";e.define();export{e as default};
2
2
  //# sourceMappingURL=definition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definition.js","sources":["../../../src/web-components/grid/definition.ts"],"sourcesContent":["import Grid from \"./component.js\";\n\nGrid.define();\n\nexport default Grid;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-grid\": Grid;\n }\n}\n"],"names":[],"mappings":"2OAEA,KAAK,QAAQ"}
1
+ {"version":3,"file":"definition.js","sources":["../../../src/web-components/grid/definition.ts"],"sourcesContent":["import Grid from \"./component.js\";\n\nGrid.define();\n\nexport default Grid;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-grid\": Grid;\n }\n}\n"],"names":["Grid"],"mappings":"8BAEAA,EAAK"}
@@ -1 +1 @@
1
- {"mappings":"AACA,cAAc,sBAA0C,KAAM;AAG9D,OAAO,UAAU,sBAAuB;;;;;;;;;AAYxC,cAgCM,gBAAgB,KAAK;;;;CAIzB,AACA,IAAI,OAAO,OAAO,OAAO,OAAO,OAAO;;;;;;CAOvC,AACA;;;;CAKA,AACA,MAAM,SAAS;CAEf,UAAU,UAAU,eAAe;CAmBnC,UAAU,YAAY,GAAG,kBAAkB,eAAe;AA4B3D;AAED,eAAe;AACf,SAAS","names":[],"sources":["../../../../src/web-components/heading/component.ts"],"sourcesContent":["import { godown, htmlSlot, styles, tokenList } from \"@godown/element\";\nimport { type TemplateResult, css, html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport Link from \"../link/component.js\";\n\nconst protoName = \"heading\";\n\n/**\n * {@linkcode Heading} renders a heading.\n *\n * If the id is provided, the anchor will be displayed.\n *\n * @slot - Heading content.\n * @category layout\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n text-align: start;\n }\n\n [part~=\"anchor\"] {\n position: absolute;\n text-align: center;\n min-width: 1.25em;\n right: 100%;\n }\n\n [part~=\"left\"][part~=\"anchor\"] {\n right: 100%;\n }\n\n [part~=\"right\"][part~=\"anchor\"] {\n left: 100%;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n width: fit-content;\n position: relative;\n }\n`)\nclass Heading extends Link {\n /**\n * The heading level.\n */\n @property()\n as: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" = \"h1\";\n\n /**\n * The anchor prefix.\n *\n * Element must have an id to be displayed.\n */\n @property()\n anchor = \"#\";\n\n /**\n * The anchor side.\n */\n @property()\n side: \"left\" | \"right\" = \"left\";\n\n protected render(): TemplateResult<1> {\n const hrefValue = this.href || (this.id ? \"#\" + this.id : undefined);\n return html`\n <a\n part=\"root\"\n href=\"${hrefValue || nothing}\"\n >\n ${this.wrapHeading(\n htmlSlot(),\n hrefValue\n ? html`\n <i part=\"${tokenList(\"anchor\", this.side)}\">${this.anchor}</i>\n `\n : \"\",\n )}\n </a>\n `;\n }\n\n protected wrapHeading(...children: any[]): TemplateResult<1> {\n switch (this.as) {\n case \"h2\":\n return html`\n <h2>${children}</h2>\n `;\n case \"h3\":\n return html`\n <h3>${children}</h3>\n `;\n case \"h4\":\n return html`\n <h4>${children}</h4>\n `;\n case \"h5\":\n return html`\n <h5>${children}</h5>\n `;\n case \"h6\":\n return html`\n <h6>${children}</h6>\n `;\n default:\n return html`\n <h1>${children}</h1>\n `;\n }\n }\n}\n\nexport default Heading;\nexport { Heading };\n"],"version":3,"file":"component.d.ts"}
1
+ {"mappings":"AACA,cAAc,sBAA0C;AAGxD,OAAO,UAAU;;;;;;;;;AAYjB,cAgCM,gBAAgB,KAAK;;;;CAIzB,AACA,IAAI,OAAO,OAAO,OAAO,OAAO,OAAO;;;;;;CAOvC,AACA;;;;CAKA,AACA,MAAM,SAAS;CAEf,UAAU,UAAU,eAAe;CAmBnC,UAAU,YAAY,GAAG,kBAAkB,eAAe;;AA8B5D,eAAe;AACf,SAAS","names":[],"sources":["../../../../src/web-components/heading/component.ts"],"sourcesContent":["import { godown, htmlSlot, styles, tokenList } from \"@godown/element\";\nimport { type TemplateResult, css, html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport Link from \"../link/component.js\";\n\nconst protoName = \"heading\";\n\n/**\n * {@linkcode Heading} renders a heading.\n *\n * If the id is provided, the anchor will be displayed.\n *\n * @slot - Heading content.\n * @category layout\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n text-align: start;\n }\n\n [part~=\"anchor\"] {\n position: absolute;\n text-align: center;\n min-width: 1.25em;\n right: 100%;\n }\n\n [part~=\"left\"][part~=\"anchor\"] {\n right: 100%;\n }\n\n [part~=\"right\"][part~=\"anchor\"] {\n left: 100%;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n width: fit-content;\n position: relative;\n }\n`)\nclass Heading extends Link {\n /**\n * The heading level.\n */\n @property()\n as: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" = \"h1\";\n\n /**\n * The anchor prefix.\n *\n * Element must have an id to be displayed.\n */\n @property()\n anchor = \"#\";\n\n /**\n * The anchor side.\n */\n @property()\n side: \"left\" | \"right\" = \"left\";\n\n protected render(): TemplateResult<1> {\n const hrefValue = this.href || (this.id ? \"#\" + this.id : undefined);\n return html`\n <a\n part=\"root\"\n href=\"${hrefValue || nothing}\"\n >\n ${this.wrapHeading(\n htmlSlot(),\n hrefValue\n ? html`\n <i part=\"${tokenList(\"anchor\", this.side)}\">${this.anchor}</i>\n `\n : \"\",\n )}\n </a>\n `;\n }\n\n protected wrapHeading(...children: any[]): TemplateResult<1> {\n switch (this.as) {\n case \"h2\":\n return html`\n <h2>${children}</h2>\n `;\n case \"h3\":\n return html`\n <h3>${children}</h3>\n `;\n case \"h4\":\n return html`\n <h4>${children}</h4>\n `;\n case \"h5\":\n return html`\n <h5>${children}</h5>\n `;\n case \"h6\":\n return html`\n <h6>${children}</h6>\n `;\n default:\n return html`\n <h1>${children}</h1>\n `;\n }\n }\n}\n\nexport default Heading;\nexport { Heading };\n"],"version":3,"file":"component.d.ts"}
@@ -1,3 +1,3 @@
1
- import{godown,styles,htmlSlot,tokenList}from"@godown/element";import{css,nothing,html}from"lit";import{property}from"lit/decorators.js";import Link from"../link/component.js";import _decorate from"@oxc-project/runtime/helpers/decorate";import"../router/component.js";import"sharekit";import"../../internal/global-style.js";import"../../internal/reset-style.js";const protoName=`heading`;let Heading=class e extends Link{constructor(...e){super(...e),this.as=`h1`,this.anchor=`#`,this.side=`left`}render(){let e=this.href||(this.id?`#`+this.id:void 0);return html`<a part="root" href="${e||nothing}"> ${this.wrapHeading(htmlSlot(),e?html`<i part="${tokenList(`anchor`,this.side)}">${this.anchor}</i>`:``)} </a>`}wrapHeading(...e){switch(this.as){case`h2`:return html`<h2>${e}</h2>`;case`h3`:return html`<h3>${e}</h3>`;case`h4`:return html`<h4>${e}</h4>`;case`h5`:return html`<h5>${e}</h5>`;case`h6`:return html`<h6>${e}</h6>`;default:return html`<h1>${e}</h1>`}}};_decorate([property()],Heading.prototype,`as`,void 0),_decorate([property()],Heading.prototype,`anchor`,void 0),_decorate([property()],Heading.prototype,`side`,void 0),Heading=_decorate([godown(protoName),styles(css`:host{display:block;text-align:start}[part~=anchor]{position:absolute;text-align:center;min-width:1.25em;right:100%}[part~=left][part~=anchor]{right:100%}[part~=right][part~=anchor]{left:100%}h1,h2,h3,h4,h5,h6{width:-moz-fit-content;width:fit-content;position:relative}
2
- `)],Heading);var Heading$1=Heading;export{Heading,Heading$1 as default};
1
+ import{godown as e,styles as t,htmlSlot as n,tokenList as r}from"@godown/element";import{css as i,nothing as a,html as o}from"lit";import{property as s}from"lit/decorators.js";import c from"../link/component.js";import l from"@oxc-project/runtime/helpers/decorate";const u=`heading`;let d=class e extends c{constructor(...e){super(...e),this.as=`h1`,this.anchor=`#`,this.side=`left`}render(){let e=this.href||(this.id?`#`+this.id:void 0);return o`<a part="root" href="${e||a}"> ${this.wrapHeading(n(),e?o`<i part="${r(`anchor`,this.side)}">${this.anchor}</i>`:``)} </a>`}wrapHeading(...e){switch(this.as){case`h2`:return o`<h2>${e}</h2>`;case`h3`:return o`<h3>${e}</h3>`;case`h4`:return o`<h4>${e}</h4>`;case`h5`:return o`<h5>${e}</h5>`;case`h6`:return o`<h6>${e}</h6>`;default:return o`<h1>${e}</h1>`}}};l([s()],d.prototype,`as`,void 0),l([s()],d.prototype,`anchor`,void 0),l([s()],d.prototype,`side`,void 0),d=l([e(`heading`),t(i`:host{display:block;text-align:start}[part~=anchor]{position:absolute;text-align:center;min-width:1.25em;right:100%}[part~=left][part~=anchor]{right:100%}[part~=right][part~=anchor]{left:100%}h1,h2,h3,h4,h5,h6{width:-moz-fit-content;width:fit-content;position:relative}
2
+ `)],d);var f=d;export{d as Heading,f as default};
3
3
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/web-components/heading/component.ts"],"sourcesContent":["import { godown, htmlSlot, styles, tokenList } from \"@godown/element\";\nimport { type TemplateResult, css, html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport Link from \"../link/component.js\";\n\nconst protoName = \"heading\";\n\n/**\n * {@linkcode Heading} renders a heading.\n *\n * If the id is provided, the anchor will be displayed.\n *\n * @slot - Heading content.\n * @category layout\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n text-align: start;\n }\n\n [part~=\"anchor\"] {\n position: absolute;\n text-align: center;\n min-width: 1.25em;\n right: 100%;\n }\n\n [part~=\"left\"][part~=\"anchor\"] {\n right: 100%;\n }\n\n [part~=\"right\"][part~=\"anchor\"] {\n left: 100%;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n width: fit-content;\n position: relative;\n }\n`)\nclass Heading extends Link {\n /**\n * The heading level.\n */\n @property()\n as: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" = \"h1\";\n\n /**\n * The anchor prefix.\n *\n * Element must have an id to be displayed.\n */\n @property()\n anchor = \"#\";\n\n /**\n * The anchor side.\n */\n @property()\n side: \"left\" | \"right\" = \"left\";\n\n protected render(): TemplateResult<1> {\n const hrefValue = this.href || (this.id ? \"#\" + this.id : undefined);\n return html`\n <a\n part=\"root\"\n href=\"${hrefValue || nothing}\"\n >\n ${this.wrapHeading(\n htmlSlot(),\n hrefValue\n ? html`\n <i part=\"${tokenList(\"anchor\", this.side)}\">${this.anchor}</i>\n `\n : \"\",\n )}\n </a>\n `;\n }\n\n protected wrapHeading(...children: any[]): TemplateResult<1> {\n switch (this.as) {\n case \"h2\":\n return html`\n <h2>${children}</h2>\n `;\n case \"h3\":\n return html`\n <h3>${children}</h3>\n `;\n case \"h4\":\n return html`\n <h4>${children}</h4>\n `;\n case \"h5\":\n return html`\n <h5>${children}</h5>\n `;\n case \"h6\":\n return html`\n <h6>${children}</h6>\n `;\n default:\n return html`\n <h1>${children}</h1>\n `;\n }\n }\n}\n\nexport default Heading;\nexport { Heading };\n"],"names":["Heading","hrefValue","children"],"mappings":"yWAMA,MAAM,UAAY,UAUlB,IAAA,QAAA,MAgCMA,UAAgB,IAAK,oCAKzB,GAA8C,UAQ9C,OAAS,SAMT,KAAyB,OAEf,QAA4B,CACpC,IAAMC,EAAY,KAAK,OAAS,KAAK,GAAK,IAAM,KAAK,GAAK,QAC1D,MAAO,KAAI,CAAA,qBAGD,EAAEA,GAAa,QAAQ,GAE7B,EAAE,KAAK,YACL,UAAU,CACVA,EACI,IAAI,CAAA,SACO,EAAE,UAAU,SAAU,KAAK,KAAK,CAAC,EAAE,EAAE,KAAK,OAAO,IAC5D,CAAC,CACD,GACL,CAAA,KAEL,CAAC,AACF,CAED,YAAsB,GAAGC,EAAoC,CAC3D,OAAQ,KAAK,GAAb,CACE,IAAK,KACH,MAAO,KAAI,CAAA,IACL,EAAEA,EAAS,KACjB,CAAC,CACH,IAAK,KACH,MAAO,KAAI,CAAA,IACL,EAAEA,EAAS,KACjB,CAAC,CACH,IAAK,KACH,MAAO,KAAI,CAAA,IACL,EAAEA,EAAS,KACjB,CAAC,CACH,IAAK,KACH,MAAO,KAAI,CAAA,IACL,EAAEA,EAAS,KACjB,CAAC,CACH,IAAK,KACH,MAAO,KAAI,CAAA,IACL,EAAEA,EAAS,KACjB,CAAC,CACH,QACE,MAAO,KAAI,CAAA,IACL,EAAEA,EAAS,KACjB,CAAC,AACJ,CACF,CACF,aAhEE,UAAU,AAAA,EAAA,QAAA,UAAA,KAAA,OAAA,YAQV,UAAU,AAAA,EAAA,QAAA,UAAA,SAAA,OAAA,YAMV,UAAU,AAAA,EAAA,QAAA,UAAA,OAAA,OAAA,CAlDZ,QAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC;AA8BZ,CAAC,CAAC,AAAA,EAAA,QAAA,CAuEF,IAAA,UAAe"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/web-components/heading/component.ts"],"sourcesContent":["import { godown, htmlSlot, styles, tokenList } from \"@godown/element\";\nimport { type TemplateResult, css, html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport Link from \"../link/component.js\";\n\nconst protoName = \"heading\";\n\n/**\n * {@linkcode Heading} renders a heading.\n *\n * If the id is provided, the anchor will be displayed.\n *\n * @slot - Heading content.\n * @category layout\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n text-align: start;\n }\n\n [part~=\"anchor\"] {\n position: absolute;\n text-align: center;\n min-width: 1.25em;\n right: 100%;\n }\n\n [part~=\"left\"][part~=\"anchor\"] {\n right: 100%;\n }\n\n [part~=\"right\"][part~=\"anchor\"] {\n left: 100%;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n width: fit-content;\n position: relative;\n }\n`)\nclass Heading extends Link {\n /**\n * The heading level.\n */\n @property()\n as: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" = \"h1\";\n\n /**\n * The anchor prefix.\n *\n * Element must have an id to be displayed.\n */\n @property()\n anchor = \"#\";\n\n /**\n * The anchor side.\n */\n @property()\n side: \"left\" | \"right\" = \"left\";\n\n protected render(): TemplateResult<1> {\n const hrefValue = this.href || (this.id ? \"#\" + this.id : undefined);\n return html`\n <a\n part=\"root\"\n href=\"${hrefValue || nothing}\"\n >\n ${this.wrapHeading(\n htmlSlot(),\n hrefValue\n ? html`\n <i part=\"${tokenList(\"anchor\", this.side)}\">${this.anchor}</i>\n `\n : \"\",\n )}\n </a>\n `;\n }\n\n protected wrapHeading(...children: any[]): TemplateResult<1> {\n switch (this.as) {\n case \"h2\":\n return html`\n <h2>${children}</h2>\n `;\n case \"h3\":\n return html`\n <h3>${children}</h3>\n `;\n case \"h4\":\n return html`\n <h4>${children}</h4>\n `;\n case \"h5\":\n return html`\n <h5>${children}</h5>\n `;\n case \"h6\":\n return html`\n <h6>${children}</h6>\n `;\n default:\n return html`\n <h1>${children}</h1>\n `;\n }\n }\n}\n\nexport default Heading;\nexport { Heading };\n"],"names":["protoName","Heading","Link","hrefValue","nothing","htmlSlot","tokenList","children","_decorate","property","godown","styles","Heading$1"],"mappings":"yQAMA,MAAMA,EAAY,UAUlB,IAAAC,EAAA,MAgCMA,UAAgBC,CAAK,oCAKzB,GAA8C,UAQ9C,OAAS,SAMT,KAAyB,OAEf,QAA4B,CACpC,IAAMC,EAAY,KAAK,OAAS,KAAK,GAAK,IAAM,KAAK,GAAK,QAC1D,MAAO,EAAI,wBAGCA,GAAaC,EAAQ,KAE3B,KAAK,YACLC,IACAF,EACI,CAAI,YACSG,EAAU,SAAU,KAAK,MAAM,IAAI,KAAK,OAAO,MAE5D,IAAA,OAMZ,YAAsB,GAAGC,EAAoC,CAC3D,OAAQ,KAAK,GAAb,CACE,IAAK,WACI,EAAI,OACHA,EAAS,OAEnB,IAAK,WACI,EAAI,OACHA,EAAS,OAEnB,IAAK,WACI,EAAI,OACHA,EAAS,OAEnB,IAAK,WACI,EAAI,OACHA,EAAS,OAEnB,IAAK,WACI,EAAI,OACHA,EAAS,OAEnB,cACS,EAAI,OACHA,EAAS,UA5DtBC,EAAA,CAAAC,KAAAR,EAAA,UAAA,KAAA,QAQAO,EAAA,CAAAC,KAAAR,EAAA,UAAA,SAAA,QAMAO,EAAA,CAAAC,KAAAR,EAAA,UAAA,OAAA,aAlDFS,EAAO,WACPC,EAAO,CAAG;OAqGX,IAAAC,EAAeX"}
@@ -1 +1 @@
1
- {"mappings":"AAAA,OAAO,aAAa,gBAAiB;AAIrC,eAAe;eAEA;WACH,sBAAsB;EAC9B,kBAAkB;CACnB;AACF","names":[],"sources":["../../../../src/web-components/heading/definition.ts"],"sourcesContent":["import Heading from \"./component.js\";\n\nHeading.define();\n\nexport default Heading;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-heading\": Heading;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
1
+ {"mappings":"AAAA,OAAO,aAAa;AAIpB,eAAe;eAEA;WACH,sBAAsB;EAC9B,kBAAkB","names":[],"sources":["../../../../src/web-components/heading/definition.ts"],"sourcesContent":["import Heading from \"./component.js\";\n\nHeading.define();\n\nexport default Heading;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-heading\": Heading;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
@@ -1,2 +1,2 @@
1
- import Heading from"./component.js";import"@godown/element";import"lit";import"lit/decorators.js";import"../link/component.js";import"../router/component.js";import"sharekit";import"../../internal/global-style.js";import"../../internal/reset-style.js";import"@oxc-project/runtime/helpers/decorate";Heading.define();export{Heading as default};
1
+ import e from"./component.js";e.define();export{e as default};
2
2
  //# sourceMappingURL=definition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definition.js","sources":["../../../src/web-components/heading/definition.ts"],"sourcesContent":["import Heading from \"./component.js\";\n\nHeading.define();\n\nexport default Heading;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-heading\": Heading;\n }\n}\n"],"names":[],"mappings":"0SAEA,QAAQ,QAAQ"}
1
+ {"version":3,"file":"definition.js","sources":["../../../src/web-components/heading/definition.ts"],"sourcesContent":["import Heading from \"./component.js\";\n\nHeading.define();\n\nexport default Heading;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-heading\": Heading;\n }\n}\n"],"names":["Heading"],"mappings":"8BAEAA,EAAQ"}
@@ -1 +1 @@
1
- {"mappings":"AAEA,cAAc,sBAA0C,KAAM;AAI9D,SAAS,kBAAkB,+BAAgC;KAGtD,YACD,SACA,WACA,QACA,QACA,UACA,aACA,aACA,SACA,UACA,SACA,SACA,mBACA,WACA,UACA,UACA,SACA;;;;;;;;AAWJ,cA6CM,cAAc,WAAW;CAC7B,AACA,MAAM;CAEN;;;;CAKA,AACA,SAAS,YAAY;CAErB,UACU,QAAQ;CAElB;CAUA,UAAU,UAAU,eAAe;CA4BnC,UAAU,iBAAiB,eAAe;CAiB1C,UAAU,iBAAiBA,UAAU,KAAK;AAK3C;AAED,eAAe;AACf,SAAS","names":["t: typeof this.type"],"sources":["../../../../src/web-components/input/component.ts"],"sourcesContent":["import { attr, godown, styles, StyleController, htmlSlot } from \"@godown/element\";\nimport iconEyeSlash from \"../../internal/icons/eye-slash.js\";\nimport { type TemplateResult, css, html, nothing } from \"lit\";\nimport { property, query } from \"lit/decorators.js\";\n\nimport { cssGlobalVars } from \"../../internal/global-style.js\";\nimport { SuperInput } from \"../../internal/super-input.js\";\nimport { RingBuilder } from \"../../internal/ring.js\";\n\ntype InputType =\n | \"text\"\n | \"search\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"password\"\n | \"datetime\"\n | \"date\"\n | \"month\"\n | \"week\"\n | \"time\"\n | \"datetime-local\"\n | \"number\"\n | \"range\"\n | \"color\"\n | \"file\"\n | \"image\";\n\nconst protoName = \"input\";\n\n/**\n * {@linkcode Input} renders a input.\n *\n * @fires input - Fires when the input value changes.\n * @fires change - Fires when the input value changes.\n * @category input\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n ${cssGlobalVars.input}-icon-color: hsl(0, 0%, 50%);\n }\n\n :host(:focus-within),\n :host(:active) {\n ${cssGlobalVars.ringColor}: currentColor;\n ${cssGlobalVars.input}-icon-color: currentColor;\n }\n\n [part=\"root\"] {\n padding-inline: 0.75em;\n padding-block: 0.5em;\n display: flex;\n position: relative;\n align-items: center;\n border-radius: inherit;\n }\n\n [part=\"input\"] {\n width: 100%;\n height: 100%;\n flex-grow: 1;\n }\n\n [part=\"prefix\"],\n [part=\"suffix\"] {\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(${cssGlobalVars.input}-icon-color);\n }\n\n [part=\"suffix\"] slot svg {\n margin-inline-start: 0.25em;\n }\n\n [part=\"prefix\"] slot svg {\n margin-inline-end: 0.25em;\n }\n`)\nclass Input extends SuperInput {\n @property({ reflect: true })\n type: InputType = \"text\";\n\n value: string;\n\n /**\n * If outline, the outline is always present.\n */\n @property()\n variant: \"default\" | \"outline\" = \"default\";\n\n @query(\"[part=input]\")\n protected _input: HTMLInputElement;\n\n constructor() {\n super();\n new StyleController(\n this,\n () =>\n new RingBuilder({ type: this.ringType }).css +\n (this.variant === \"outline\" ? `:host{${cssGlobalVars.ringColor}:currentColor}` : \"\"),\n );\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <label\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${[\n this._renderPrefix(),\n html`\n <input\n part=\"input\"\n type=\"${this.type}\"\n .value=\"${this.value}\"\n ?autofocus=\"${this.autofocus}\"\n ?disabled=\"${this.disabled}\"\n autocapitalize=\"${this.autocapitalize || nothing}\"\n autocomplete=\"${this.autocomplete || nothing}\"\n placeholder=\"${this.placeholder || nothing}\"\n @input=\"${this._handleInput}\"\n @change=\"${this._handleChange}\"\n />\n `,\n this._renderSuffix(),\n ]}\n </label>\n `;\n }\n\n protected _renderSuffix(): TemplateResult<1> {\n const PASSWORD = \"password\";\n if (this.type === PASSWORD) {\n return html`\n <i\n part=\"suffix\"\n @mousedown=\"${() => this._changeInputType(\"text\")}\"\n @mouseup=\"${() => this._changeInputType(PASSWORD)}\"\n @mouseleave=\"${() => this._changeInputType(PASSWORD)}\"\n >\n ${htmlSlot(\"suffix\", iconEyeSlash())}\n </i>\n `;\n }\n return super._renderSuffix();\n }\n\n protected _changeInputType(t: typeof this.type): void {\n if (this._input) {\n this._input.type = t;\n }\n }\n}\n\nexport default Input;\nexport { Input };\n"],"version":3,"file":"component.d.ts"}
1
+ {"mappings":"AAEA,cAAc,sBAA0C;AAIxD,SAAS,kBAAkB;KAGtB,YACD,SACA,WACA,QACA,QACA,UACA,aACA,aACA,SACA,UACA,SACA,SACA,mBACA,WACA,UACA,UACA,SACA;;;;;;;;AAWJ,cA6CM,cAAc,WAAW;CAC7B,AACA,MAAM;CAEN;;;;CAKA,AACA,SAAS,YAAY;CAErB,UACU,QAAQ;CAElB;CAUA,UAAU,UAAU,eAAe;CA4BnC,UAAU,iBAAiB,eAAe;CAiB1C,UAAU,iBAAiB,UAAU,KAAK;;AAO5C,eAAe;AACf,SAAS","names":[],"sources":["../../../../src/web-components/input/component.ts"],"sourcesContent":["import { attr, godown, styles, StyleController, htmlSlot } from \"@godown/element\";\nimport iconEyeSlash from \"../../internal/icons/eye-slash.js\";\nimport { type TemplateResult, css, html, nothing } from \"lit\";\nimport { property, query } from \"lit/decorators.js\";\n\nimport { cssGlobalVars } from \"../../internal/global-style.js\";\nimport { SuperInput } from \"../../internal/super-input.js\";\nimport { RingBuilder } from \"../../internal/ring.js\";\n\ntype InputType =\n | \"text\"\n | \"search\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"password\"\n | \"datetime\"\n | \"date\"\n | \"month\"\n | \"week\"\n | \"time\"\n | \"datetime-local\"\n | \"number\"\n | \"range\"\n | \"color\"\n | \"file\"\n | \"image\";\n\nconst protoName = \"input\";\n\n/**\n * {@linkcode Input} renders a input.\n *\n * @fires input - Fires when the input value changes.\n * @fires change - Fires when the input value changes.\n * @category input\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n ${cssGlobalVars.input}-icon-color: hsl(0, 0%, 50%);\n }\n\n :host(:focus-within),\n :host(:active) {\n ${cssGlobalVars.ringColor}: currentColor;\n ${cssGlobalVars.input}-icon-color: currentColor;\n }\n\n [part=\"root\"] {\n padding-inline: 0.75em;\n padding-block: 0.5em;\n display: flex;\n position: relative;\n align-items: center;\n border-radius: inherit;\n }\n\n [part=\"input\"] {\n width: 100%;\n height: 100%;\n flex-grow: 1;\n }\n\n [part=\"prefix\"],\n [part=\"suffix\"] {\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(${cssGlobalVars.input}-icon-color);\n }\n\n [part=\"suffix\"] slot svg {\n margin-inline-start: 0.25em;\n }\n\n [part=\"prefix\"] slot svg {\n margin-inline-end: 0.25em;\n }\n`)\nclass Input extends SuperInput {\n @property({ reflect: true })\n type: InputType = \"text\";\n\n value: string;\n\n /**\n * If outline, the outline is always present.\n */\n @property()\n variant: \"default\" | \"outline\" = \"default\";\n\n @query(\"[part=input]\")\n protected _input: HTMLInputElement;\n\n constructor() {\n super();\n new StyleController(\n this,\n () =>\n new RingBuilder({ type: this.ringType }).css +\n (this.variant === \"outline\" ? `:host{${cssGlobalVars.ringColor}:currentColor}` : \"\"),\n );\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <label\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${[\n this._renderPrefix(),\n html`\n <input\n part=\"input\"\n type=\"${this.type}\"\n .value=\"${this.value}\"\n ?autofocus=\"${this.autofocus}\"\n ?disabled=\"${this.disabled}\"\n autocapitalize=\"${this.autocapitalize || nothing}\"\n autocomplete=\"${this.autocomplete || nothing}\"\n placeholder=\"${this.placeholder || nothing}\"\n @input=\"${this._handleInput}\"\n @change=\"${this._handleChange}\"\n />\n `,\n this._renderSuffix(),\n ]}\n </label>\n `;\n }\n\n protected _renderSuffix(): TemplateResult<1> {\n const PASSWORD = \"password\";\n if (this.type === PASSWORD) {\n return html`\n <i\n part=\"suffix\"\n @mousedown=\"${() => this._changeInputType(\"text\")}\"\n @mouseup=\"${() => this._changeInputType(PASSWORD)}\"\n @mouseleave=\"${() => this._changeInputType(PASSWORD)}\"\n >\n ${htmlSlot(\"suffix\", iconEyeSlash())}\n </i>\n `;\n }\n return super._renderSuffix();\n }\n\n protected _changeInputType(t: typeof this.type): void {\n if (this._input) {\n this._input.type = t;\n }\n }\n}\n\nexport default Input;\nexport { Input };\n"],"version":3,"file":"component.d.ts"}
@@ -1,2 +1,2 @@
1
- import{godown,styles,StyleController,attr,htmlSlot}from"@godown/element";import _default from"../../internal/icons/eye-slash.js";import{css,nothing,html}from"lit";import{property,query}from"lit/decorators.js";import{cssGlobalVars}from"../../internal/global-style.js";import{SuperInput}from"../../internal/super-input.js";import{RingBuilder}from"../../internal/ring.js";import _decorate from"@oxc-project/runtime/helpers/decorate";import"../../internal/reset-style.js";import"sharekit";const protoName=`input`;let Input=class e extends SuperInput{constructor(){super(),this.type=`text`,this.variant=`default`,new StyleController(this,()=>new RingBuilder({type:this.ringType}).css+(this.variant===`outline`?`:host{${cssGlobalVars.ringColor}:currentColor}`:``))}render(){return html`<label part="root" ${attr(this.observedRecord)}> ${[this._renderPrefix(),html`<input part="input" type="${this.type}" .value="${this.value}" ?autofocus="${this.autofocus}" ?disabled="${this.disabled}" autocapitalize="${this.autocapitalize||nothing}" autocomplete="${this.autocomplete||nothing}" placeholder="${this.placeholder||nothing}" @input="${this._handleInput}" @change="${this._handleChange}"/>`,this._renderSuffix()]} </label>`}_renderSuffix(){let e=`password`;return this.type===e?html`<i part="suffix" @mousedown="${()=>this._changeInputType(`text`)}" @mouseup="${()=>this._changeInputType(e)}" @mouseleave="${()=>this._changeInputType(e)}"> ${htmlSlot(`suffix`,_default())} </i>`:super._renderSuffix()}_changeInputType(e){this._input&&(this._input.type=e)}};_decorate([property({reflect:!0})],Input.prototype,`type`,void 0),_decorate([property()],Input.prototype,`variant`,void 0),_decorate([query(`[part=input]`)],Input.prototype,`_input`,void 0),Input=_decorate([godown(protoName),styles(css`:host{display:block;${cssGlobalVars.input}-icon-color:gray}:host(:focus-within),:host(:active){${cssGlobalVars.ringColor}:currentColor;${cssGlobalVars.input}-icon-color:currentColor}[part=root]{padding-inline:.75em;padding-block:.5em;display:flex;position:relative;align-items:center;border-radius:inherit}[part=input]{width:100%;height:100%;flex-grow:1}[part=prefix],[part=suffix]{height:100%;display:flex;align-items:center;justify-content:center;color:var(${cssGlobalVars.input}-icon-color)}[part=suffix] slot svg{margin-inline-start:.25em}[part=prefix] slot svg{margin-inline-end:.25em}`)],Input);var Input$1=Input;export{Input,Input$1 as default};
1
+ import{godown as e,styles as t,StyleController as n,attr as r,htmlSlot as i}from"@godown/element";import a from"../../internal/icons/eye-slash.js";import{css as o,nothing as s,html as c}from"lit";import{property as l,query as u}from"lit/decorators.js";import{cssGlobalVars as d}from"../../internal/global-style.js";import{SuperInput as f}from"../../internal/super-input.js";import{RingBuilder as p}from"../../internal/ring.js";import m from"@oxc-project/runtime/helpers/decorate";const h=`input`;let g=class e extends f{constructor(){super(),this.type=`text`,this.variant=`default`,new n(this,()=>new p({type:this.ringType}).css+(this.variant===`outline`?`:host{${d.ringColor}:currentColor}`:``))}render(){return c`<label part="root" ${r(this.observedRecord)}> ${[this._renderPrefix(),c`<input part="input" type="${this.type}" .value="${this.value}" ?autofocus="${this.autofocus}" ?disabled="${this.disabled}" autocapitalize="${this.autocapitalize||s}" autocomplete="${this.autocomplete||s}" placeholder="${this.placeholder||s}" @input="${this._handleInput}" @change="${this._handleChange}"/>`,this._renderSuffix()]} </label>`}_renderSuffix(){let e=`password`;return this.type===e?c`<i part="suffix" @mousedown="${()=>this._changeInputType(`text`)}" @mouseup="${()=>this._changeInputType(e)}" @mouseleave="${()=>this._changeInputType(e)}"> ${i(`suffix`,a())} </i>`:super._renderSuffix()}_changeInputType(e){this._input&&(this._input.type=e)}};m([l({reflect:!0})],g.prototype,`type`,void 0),m([l()],g.prototype,`variant`,void 0),m([u(`[part=input]`)],g.prototype,`_input`,void 0),g=m([e(`input`),t(o`:host{display:block;${d.input}-icon-color:gray}:host(:focus-within),:host(:active){${d.ringColor}:currentColor;${d.input}-icon-color:currentColor}[part=root]{padding-inline:.75em;padding-block:.5em;display:flex;position:relative;align-items:center;border-radius:inherit}[part=input]{width:100%;height:100%;flex-grow:1}[part=prefix],[part=suffix]{height:100%;display:flex;align-items:center;justify-content:center;color:var(${d.input}-icon-color)}[part=suffix] slot svg{margin-inline-start:.25em}[part=prefix] slot svg{margin-inline-end:.25em}`)],g);var _=g;export{g as Input,_ as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/web-components/input/component.ts"],"sourcesContent":["import { attr, godown, styles, StyleController, htmlSlot } from \"@godown/element\";\nimport iconEyeSlash from \"../../internal/icons/eye-slash.js\";\nimport { type TemplateResult, css, html, nothing } from \"lit\";\nimport { property, query } from \"lit/decorators.js\";\n\nimport { cssGlobalVars } from \"../../internal/global-style.js\";\nimport { SuperInput } from \"../../internal/super-input.js\";\nimport { RingBuilder } from \"../../internal/ring.js\";\n\ntype InputType =\n | \"text\"\n | \"search\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"password\"\n | \"datetime\"\n | \"date\"\n | \"month\"\n | \"week\"\n | \"time\"\n | \"datetime-local\"\n | \"number\"\n | \"range\"\n | \"color\"\n | \"file\"\n | \"image\";\n\nconst protoName = \"input\";\n\n/**\n * {@linkcode Input} renders a input.\n *\n * @fires input - Fires when the input value changes.\n * @fires change - Fires when the input value changes.\n * @category input\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n ${cssGlobalVars.input}-icon-color: hsl(0, 0%, 50%);\n }\n\n :host(:focus-within),\n :host(:active) {\n ${cssGlobalVars.ringColor}: currentColor;\n ${cssGlobalVars.input}-icon-color: currentColor;\n }\n\n [part=\"root\"] {\n padding-inline: 0.75em;\n padding-block: 0.5em;\n display: flex;\n position: relative;\n align-items: center;\n border-radius: inherit;\n }\n\n [part=\"input\"] {\n width: 100%;\n height: 100%;\n flex-grow: 1;\n }\n\n [part=\"prefix\"],\n [part=\"suffix\"] {\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(${cssGlobalVars.input}-icon-color);\n }\n\n [part=\"suffix\"] slot svg {\n margin-inline-start: 0.25em;\n }\n\n [part=\"prefix\"] slot svg {\n margin-inline-end: 0.25em;\n }\n`)\nclass Input extends SuperInput {\n @property({ reflect: true })\n type: InputType = \"text\";\n\n value: string;\n\n /**\n * If outline, the outline is always present.\n */\n @property()\n variant: \"default\" | \"outline\" = \"default\";\n\n @query(\"[part=input]\")\n protected _input: HTMLInputElement;\n\n constructor() {\n super();\n new StyleController(\n this,\n () =>\n new RingBuilder({ type: this.ringType }).css +\n (this.variant === \"outline\" ? `:host{${cssGlobalVars.ringColor}:currentColor}` : \"\"),\n );\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <label\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${[\n this._renderPrefix(),\n html`\n <input\n part=\"input\"\n type=\"${this.type}\"\n .value=\"${this.value}\"\n ?autofocus=\"${this.autofocus}\"\n ?disabled=\"${this.disabled}\"\n autocapitalize=\"${this.autocapitalize || nothing}\"\n autocomplete=\"${this.autocomplete || nothing}\"\n placeholder=\"${this.placeholder || nothing}\"\n @input=\"${this._handleInput}\"\n @change=\"${this._handleChange}\"\n />\n `,\n this._renderSuffix(),\n ]}\n </label>\n `;\n }\n\n protected _renderSuffix(): TemplateResult<1> {\n const PASSWORD = \"password\";\n if (this.type === PASSWORD) {\n return html`\n <i\n part=\"suffix\"\n @mousedown=\"${() => this._changeInputType(\"text\")}\"\n @mouseup=\"${() => this._changeInputType(PASSWORD)}\"\n @mouseleave=\"${() => this._changeInputType(PASSWORD)}\"\n >\n ${htmlSlot(\"suffix\", iconEyeSlash())}\n </i>\n `;\n }\n return super._renderSuffix();\n }\n\n protected _changeInputType(t: typeof this.type): void {\n if (this._input) {\n this._input.type = t;\n }\n }\n}\n\nexport default Input;\nexport { Input };\n"],"names":["Input","PASSWORD","iconEyeSlash","t: typeof this.type","t"],"mappings":"qeA4BA,MAAM,UAAY,QASlB,IAAA,MAAA,MA6CMA,UAAc,UAAW,CAe7B,aAAc,CACZ,OAAO,MAdT,KAAkB,YAQlB,QAAiC,UAO/B,IAAI,gBACF,KACA,IACE,IAAI,YAAY,CAAE,KAAM,KAAK,QAAU,GAAE,KACxC,KAAK,UAAY,UAAY,CAAC,MAAM,EAAE,cAAc,UAAU,cAAc,CAAC,CAAG,IAEtF,CAES,QAA4B,CACpC,MAAO,KAAI,CAAA,mBAGP,EAAE,KAAK,KAAK,eAAe,CAAA,EAE3B,EAAE,CACA,KAAK,eAAe,CACpB,IAAI,CAAA,0BAGM,EAAE,KAAK,KAAK,UACV,EAAE,KAAK,MAAM,cACT,EAAE,KAAK,UAAU,aAClB,EAAE,KAAK,SAAS,kBACX,EAAE,KAAK,gBAAkB,QAAQ,gBACnC,EAAE,KAAK,cAAgB,QAAQ,eAChC,EAAE,KAAK,aAAe,QAAQ,UACnC,EAAE,KAAK,aAAa,WACnB,EAAE,KAAK,cAAc,GAElC,CAAC,CACD,KAAK,eAAA,AACN,EAAA,SAEL,CAAC,AACF,CAES,eAAmC,CAC3C,IAAMC,EAAW,WAajB,OAZI,KAAK,OAASA,EACT,IAAI,CAAA,6BAGK,EAAE,IAAM,KAAK,iBAAiB,OAAO,CAAC,YACxC,EAAE,IAAM,KAAK,iBAAiBA,EAAS,CAAC,eACrC,EAAE,IAAM,KAAK,iBAAiBA,EAAS,CAAC,GAErD,EAAE,SAAS,SAAUC,UAAc,CAAC,CAAA,KAExC,CAAC,CAEI,MAAM,eAAe,AAC7B,CAES,iBAAiBC,EAA2B,CAChD,KAAK,SACP,KAAK,OAAO,KAAOC,EAEtB,CACF,aA1EE,SAAS,CAAE,QAAS,EAAM,EAAC,AAAA,EAAA,MAAA,UAAA,OAAA,OAAA,YAQ3B,UAAU,AAAA,EAAA,MAAA,UAAA,UAAA,OAAA,CAGV,UAAA,CAAA,MAAM,eAAe,AAAA,EAAA,MAAA,UAAA,SAAA,OAAA,CAzDvB,MAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC,oBAGR,EAAE,cAAc,MAAM,qDAKtB,EAAE,cAAc,UAAU,cAC1B,EAAE,cAAc,MAAM,8SAwBX,EAAE,cAAc,MAAM,6GAUrC,CAAC,CAAC,AAAA,EAAA,MAAA,CA8EF,IAAA,QAAe"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/web-components/input/component.ts"],"sourcesContent":["import { attr, godown, styles, StyleController, htmlSlot } from \"@godown/element\";\nimport iconEyeSlash from \"../../internal/icons/eye-slash.js\";\nimport { type TemplateResult, css, html, nothing } from \"lit\";\nimport { property, query } from \"lit/decorators.js\";\n\nimport { cssGlobalVars } from \"../../internal/global-style.js\";\nimport { SuperInput } from \"../../internal/super-input.js\";\nimport { RingBuilder } from \"../../internal/ring.js\";\n\ntype InputType =\n | \"text\"\n | \"search\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"password\"\n | \"datetime\"\n | \"date\"\n | \"month\"\n | \"week\"\n | \"time\"\n | \"datetime-local\"\n | \"number\"\n | \"range\"\n | \"color\"\n | \"file\"\n | \"image\";\n\nconst protoName = \"input\";\n\n/**\n * {@linkcode Input} renders a input.\n *\n * @fires input - Fires when the input value changes.\n * @fires change - Fires when the input value changes.\n * @category input\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: block;\n ${cssGlobalVars.input}-icon-color: hsl(0, 0%, 50%);\n }\n\n :host(:focus-within),\n :host(:active) {\n ${cssGlobalVars.ringColor}: currentColor;\n ${cssGlobalVars.input}-icon-color: currentColor;\n }\n\n [part=\"root\"] {\n padding-inline: 0.75em;\n padding-block: 0.5em;\n display: flex;\n position: relative;\n align-items: center;\n border-radius: inherit;\n }\n\n [part=\"input\"] {\n width: 100%;\n height: 100%;\n flex-grow: 1;\n }\n\n [part=\"prefix\"],\n [part=\"suffix\"] {\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(${cssGlobalVars.input}-icon-color);\n }\n\n [part=\"suffix\"] slot svg {\n margin-inline-start: 0.25em;\n }\n\n [part=\"prefix\"] slot svg {\n margin-inline-end: 0.25em;\n }\n`)\nclass Input extends SuperInput {\n @property({ reflect: true })\n type: InputType = \"text\";\n\n value: string;\n\n /**\n * If outline, the outline is always present.\n */\n @property()\n variant: \"default\" | \"outline\" = \"default\";\n\n @query(\"[part=input]\")\n protected _input: HTMLInputElement;\n\n constructor() {\n super();\n new StyleController(\n this,\n () =>\n new RingBuilder({ type: this.ringType }).css +\n (this.variant === \"outline\" ? `:host{${cssGlobalVars.ringColor}:currentColor}` : \"\"),\n );\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <label\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n ${[\n this._renderPrefix(),\n html`\n <input\n part=\"input\"\n type=\"${this.type}\"\n .value=\"${this.value}\"\n ?autofocus=\"${this.autofocus}\"\n ?disabled=\"${this.disabled}\"\n autocapitalize=\"${this.autocapitalize || nothing}\"\n autocomplete=\"${this.autocomplete || nothing}\"\n placeholder=\"${this.placeholder || nothing}\"\n @input=\"${this._handleInput}\"\n @change=\"${this._handleChange}\"\n />\n `,\n this._renderSuffix(),\n ]}\n </label>\n `;\n }\n\n protected _renderSuffix(): TemplateResult<1> {\n const PASSWORD = \"password\";\n if (this.type === PASSWORD) {\n return html`\n <i\n part=\"suffix\"\n @mousedown=\"${() => this._changeInputType(\"text\")}\"\n @mouseup=\"${() => this._changeInputType(PASSWORD)}\"\n @mouseleave=\"${() => this._changeInputType(PASSWORD)}\"\n >\n ${htmlSlot(\"suffix\", iconEyeSlash())}\n </i>\n `;\n }\n return super._renderSuffix();\n }\n\n protected _changeInputType(t: typeof this.type): void {\n if (this._input) {\n this._input.type = t;\n }\n }\n}\n\nexport default Input;\nexport { Input };\n"],"names":["protoName","Input","SuperInput","StyleController","RingBuilder","cssGlobalVars","attr","nothing","PASSWORD","htmlSlot","iconEyeSlash","t","_decorate","property","query","godown","styles","Input$1"],"mappings":"geA4BA,MAAMA,EAAY,QASlB,IAAAC,EAAA,MA6CMA,UAAcC,CAAW,CAe7B,aAAc,CACZ,aAdF,KAAkB,YAQlB,QAAiC,UAO/B,IAAIC,EACF,SAEE,IAAIC,EAAY,CAAE,KAAM,KAAK,WAAY,KACxC,KAAK,UAAY,UAAY,SAASC,EAAc,UAAU,gBAAkB,KAI7E,QAA4B,CACpC,MAAO,EAAI,sBAGLC,EAAK,KAAK,gBAAA,IAEV,CACA,KAAK,gBACL,CAAI,6BAGQ,KAAK,KAAK,YACR,KAAK,MAAM,gBACP,KAAK,UAAU,eAChB,KAAK,SAAS,oBACT,KAAK,gBAAkBC,EAAQ,kBACjC,KAAK,cAAgBA,EAAQ,iBAC9B,KAAK,aAAeA,EAAQ,YACjC,KAAK,aAAa,aACjB,KAAK,cAAc,KAGlC,KAAK,iBACL,WAKE,eAAmC,CAC3C,IAAMC,EAAW,WAajB,OAZI,KAAK,OAASA,EACT,CAAI,oCAGa,KAAK,iBAAiB,QAAQ,kBAChC,KAAK,iBAAiBA,GAAU,qBAC7B,KAAK,iBAAiBA,GAAU,KAEnDC,EAAS,SAAUC,KAAA,OAIpB,MAAM,gBAGL,iBAAiB,EAA2B,CAChD,KAAK,SACP,KAAK,OAAO,KAAOC,KAvEtBC,EAAA,CAAAC,EAAS,CAAE,QAAS,MAAAZ,EAAA,UAAA,OAAA,QAQpBW,EAAA,CAAAC,KAAAZ,EAAA,UAAA,UAAA,WAGAa,EAAM,iBAAAb,EAAA,UAAA,SAAA,aAzDRc,EAAO,SACPC,EAAO,CAAG,uBAGLX,EAAc,MAAM,uDAKpBA,EAAc,UAAU,gBACxBA,EAAc,MAAM,gTAwBTA,EAAc,MAAM,oHAwFrC,IAAAY,EAAehB"}
@@ -1 +1 @@
1
- {"mappings":"AAAA,OAAO,WAAW,gBAAiB;AAInC,eAAe;eAEA;WACH,sBAAsB;EAC9B,gBAAgB;CACjB;AACF","names":[],"sources":["../../../../src/web-components/input/definition.ts"],"sourcesContent":["import Input from \"./component.js\";\n\nInput.define();\n\nexport default Input;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-input\": Input;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
1
+ {"mappings":"AAAA,OAAO,WAAW;AAIlB,eAAe;eAEA;WACH,sBAAsB;EAC9B,gBAAgB","names":[],"sources":["../../../../src/web-components/input/definition.ts"],"sourcesContent":["import Input from \"./component.js\";\n\nInput.define();\n\nexport default Input;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-input\": Input;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
@@ -1,2 +1,2 @@
1
- import Input from"./component.js";import"@godown/element";import"../../internal/icons/eye-slash.js";import"lit";import"lit/decorators.js";import"../../internal/global-style.js";import"../../internal/reset-style.js";import"sharekit";import"../../internal/super-input.js";import"../../internal/ring.js";import"@oxc-project/runtime/helpers/decorate";Input.define();export{Input as default};
1
+ import e from"./component.js";e.define();export{e as default};
2
2
  //# sourceMappingURL=definition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definition.js","sources":["../../../src/web-components/input/definition.ts"],"sourcesContent":["import Input from \"./component.js\";\n\nInput.define();\n\nexport default Input;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-input\": Input;\n }\n}\n"],"names":[],"mappings":"2VAEA,MAAM,QAAQ"}
1
+ {"version":3,"file":"definition.js","sources":["../../../src/web-components/input/definition.ts"],"sourcesContent":["import Input from \"./component.js\";\n\nInput.define();\n\nexport default Input;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-input\": Input;\n }\n}\n"],"names":["Input"],"mappings":"8BAEAA,EAAM"}
@@ -1 +1 @@
1
- {"mappings":"AACA,cAAc,sBAAiC,KAAM;AAGrD,SAAS,mBAAmB,gCAAiC;;;;;;;;;;;;;;;AAkB7D,cAmCM,eAAe,YAAY;;;;CAI/B,AACA;CAEA,UAAU,UAAU,eAAe;AAYpC;AAED,eAAe;AACf,SAAS","names":[],"sources":["../../../../src/web-components/layout/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { GlobalStyle } from \"../../internal/global-style.js\";\n\nconst protoName = \"layout\";\n\n/**\n * {@linkcode Layout} renders main content, top header, bottom footer.\n *\n * If `sticky` is set to `true`, the header will be sticky.\n *\n * Main content will take up the remaining space.\n *\n * Element display should be `(inline-)flex` or `(inline-)grid`.\n *\n * @slot - The main content of the layout.\n * @slot header - The header of the layout.\n * @slot footer - The footer of the layout.\n * @category layout\n */\n@godown(protoName)\n@styles(css`\n :host {\n width: 100%;\n height: 100%;\n min-height: 100%;\n flex-direction: column;\n grid-template-rows: auto 1fr auto;\n }\n\n :host,\n :host([contents]) [part=\"root\"] {\n display: flex;\n }\n\n [part=\"root\"] {\n display: contents;\n }\n\n [part=\"main\"] {\n width: 100%;\n flex: 1;\n }\n\n [part=\"header\"],\n [part=\"footer\"] {\n flex-shrink: 0;\n width: 100%;\n }\n\n [sticky] header {\n position: sticky;\n top: 0;\n }\n`)\nclass Layout extends GlobalStyle {\n /**\n * If `true`, header will sticky.\n */\n @property({ type: Boolean })\n sticky = false;\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n <header part=\"header\">${htmlSlot(\"header\")}</header>\n <main part=\"main\">${htmlSlot()}</main>\n <footer part=\"footer\">${htmlSlot(\"footer\")}</footer>\n </div>\n `;\n }\n}\n\nexport default Layout;\nexport { Layout };\n"],"version":3,"file":"component.d.ts"}
1
+ {"mappings":"AACA,cAAc,sBAAiC;AAG/C,SAAS,mBAAmB;;;;;;;;;;;;;;;AAkB5B,cAmCM,eAAe,YAAY;;;;CAI/B,AACA;CAEA,UAAU,UAAU,eAAe;;AAcrC,eAAe;AACf,SAAS","names":[],"sources":["../../../../src/web-components/layout/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { GlobalStyle } from \"../../internal/global-style.js\";\n\nconst protoName = \"layout\";\n\n/**\n * {@linkcode Layout} renders main content, top header, bottom footer.\n *\n * If `sticky` is set to `true`, the header will be sticky.\n *\n * Main content will take up the remaining space.\n *\n * Element display should be `(inline-)flex` or `(inline-)grid`.\n *\n * @slot - The main content of the layout.\n * @slot header - The header of the layout.\n * @slot footer - The footer of the layout.\n * @category layout\n */\n@godown(protoName)\n@styles(css`\n :host {\n width: 100%;\n height: 100%;\n min-height: 100%;\n flex-direction: column;\n grid-template-rows: auto 1fr auto;\n }\n\n :host,\n :host([contents]) [part=\"root\"] {\n display: flex;\n }\n\n [part=\"root\"] {\n display: contents;\n }\n\n [part=\"main\"] {\n width: 100%;\n flex: 1;\n }\n\n [part=\"header\"],\n [part=\"footer\"] {\n flex-shrink: 0;\n width: 100%;\n }\n\n [sticky] header {\n position: sticky;\n top: 0;\n }\n`)\nclass Layout extends GlobalStyle {\n /**\n * If `true`, header will sticky.\n */\n @property({ type: Boolean })\n sticky = false;\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n <header part=\"header\">${htmlSlot(\"header\")}</header>\n <main part=\"main\">${htmlSlot()}</main>\n <footer part=\"footer\">${htmlSlot(\"footer\")}</footer>\n </div>\n `;\n }\n}\n\nexport default Layout;\nexport { Layout };\n"],"version":3,"file":"component.d.ts"}
@@ -1,3 +1,3 @@
1
- import{godown,styles,attr,htmlSlot}from"@godown/element";import{css,html}from"lit";import{property}from"lit/decorators.js";import{GlobalStyle}from"../../internal/global-style.js";import _decorate from"@oxc-project/runtime/helpers/decorate";import"../../internal/reset-style.js";import"sharekit";const protoName=`layout`;let Layout=class e extends GlobalStyle{constructor(...e){super(...e),this.sticky=!1}render(){return html`<div part="root" ${attr(this.observedRecord)}> <header part="header">${htmlSlot(`header`)}</header> <main part="main">${htmlSlot()}</main> <footer part="footer">${htmlSlot(`footer`)}</footer> </div>`}};_decorate([property({type:Boolean})],Layout.prototype,`sticky`,void 0),Layout=_decorate([godown(protoName),styles(css`:host{width:100%;height:100%;min-height:100%;flex-direction:column;grid-template-rows:auto 1fr auto}:host,:host([contents]) [part=root]{display:flex}[part=root]{display:contents}[part=main]{width:100%;flex:1}[part=header],[part=footer]{flex-shrink:0;width:100%}[sticky] header{position:sticky;top:0}
2
- `)],Layout);var Layout$1=Layout;export{Layout,Layout$1 as default};
1
+ import{godown as e,styles as t,attr as n,htmlSlot as r}from"@godown/element";import{css as i,html as a}from"lit";import{property as o}from"lit/decorators.js";import{GlobalStyle as s}from"../../internal/global-style.js";import c from"@oxc-project/runtime/helpers/decorate";const l=`layout`;let u=class e extends s{constructor(...e){super(...e),this.sticky=!1}render(){return a`<div part="root" ${n(this.observedRecord)}> <header part="header">${r(`header`)}</header> <main part="main">${r()}</main> <footer part="footer">${r(`footer`)}</footer> </div>`}};c([o({type:Boolean})],u.prototype,`sticky`,void 0),u=c([e(`layout`),t(i`:host{width:100%;height:100%;min-height:100%;flex-direction:column;grid-template-rows:auto 1fr auto}:host,:host([contents]) [part=root]{display:flex}[part=root]{display:contents}[part=main]{width:100%;flex:1}[part=header],[part=footer]{flex-shrink:0;width:100%}[sticky] header{position:sticky;top:0}
2
+ `)],u);var d=u;export{u as Layout,d as default};
3
3
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/web-components/layout/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { GlobalStyle } from \"../../internal/global-style.js\";\n\nconst protoName = \"layout\";\n\n/**\n * {@linkcode Layout} renders main content, top header, bottom footer.\n *\n * If `sticky` is set to `true`, the header will be sticky.\n *\n * Main content will take up the remaining space.\n *\n * Element display should be `(inline-)flex` or `(inline-)grid`.\n *\n * @slot - The main content of the layout.\n * @slot header - The header of the layout.\n * @slot footer - The footer of the layout.\n * @category layout\n */\n@godown(protoName)\n@styles(css`\n :host {\n width: 100%;\n height: 100%;\n min-height: 100%;\n flex-direction: column;\n grid-template-rows: auto 1fr auto;\n }\n\n :host,\n :host([contents]) [part=\"root\"] {\n display: flex;\n }\n\n [part=\"root\"] {\n display: contents;\n }\n\n [part=\"main\"] {\n width: 100%;\n flex: 1;\n }\n\n [part=\"header\"],\n [part=\"footer\"] {\n flex-shrink: 0;\n width: 100%;\n }\n\n [sticky] header {\n position: sticky;\n top: 0;\n }\n`)\nclass Layout extends GlobalStyle {\n /**\n * If `true`, header will sticky.\n */\n @property({ type: Boolean })\n sticky = false;\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n <header part=\"header\">${htmlSlot(\"header\")}</header>\n <main part=\"main\">${htmlSlot()}</main>\n <footer part=\"footer\">${htmlSlot(\"footer\")}</footer>\n </div>\n `;\n }\n}\n\nexport default Layout;\nexport { Layout };\n"],"names":["Layout"],"mappings":"uSAMA,MAAM,UAAY,SAgBlB,IAAA,OAAA,MAmCMA,UAAe,WAAY,oCAK/B,OAAS,GAEC,QAA4B,CACpC,MAAO,KAAI,CAAA,iBAGP,EAAE,KAAK,KAAK,eAAe,CAAA,wBAEL,EAAE,SAAS,SAAS,CAAC,4BACzB,EAAE,UAAU,CAAC,8BACT,EAAE,SAAS,SAAS,CAAC,gBAE/C,CAAC,AACF,CACF,aAfE,SAAS,CAAE,KAAM,OAAS,EAAC,AAAA,EAAA,OAAA,UAAA,SAAA,OAAA,CAvC7B,OAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC;AAiCZ,CAAC,CAAC,AAAA,EAAA,OAAA,CAsBF,IAAA,SAAe"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/web-components/layout/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, styles } from \"@godown/element\";\nimport { type TemplateResult, css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nimport { GlobalStyle } from \"../../internal/global-style.js\";\n\nconst protoName = \"layout\";\n\n/**\n * {@linkcode Layout} renders main content, top header, bottom footer.\n *\n * If `sticky` is set to `true`, the header will be sticky.\n *\n * Main content will take up the remaining space.\n *\n * Element display should be `(inline-)flex` or `(inline-)grid`.\n *\n * @slot - The main content of the layout.\n * @slot header - The header of the layout.\n * @slot footer - The footer of the layout.\n * @category layout\n */\n@godown(protoName)\n@styles(css`\n :host {\n width: 100%;\n height: 100%;\n min-height: 100%;\n flex-direction: column;\n grid-template-rows: auto 1fr auto;\n }\n\n :host,\n :host([contents]) [part=\"root\"] {\n display: flex;\n }\n\n [part=\"root\"] {\n display: contents;\n }\n\n [part=\"main\"] {\n width: 100%;\n flex: 1;\n }\n\n [part=\"header\"],\n [part=\"footer\"] {\n flex-shrink: 0;\n width: 100%;\n }\n\n [sticky] header {\n position: sticky;\n top: 0;\n }\n`)\nclass Layout extends GlobalStyle {\n /**\n * If `true`, header will sticky.\n */\n @property({ type: Boolean })\n sticky = false;\n\n protected render(): TemplateResult<1> {\n return html`\n <div\n part=\"root\"\n ${attr(this.observedRecord)}\n >\n <header part=\"header\">${htmlSlot(\"header\")}</header>\n <main part=\"main\">${htmlSlot()}</main>\n <footer part=\"footer\">${htmlSlot(\"footer\")}</footer>\n </div>\n `;\n }\n}\n\nexport default Layout;\nexport { Layout };\n"],"names":["protoName","Layout","GlobalStyle","attr","htmlSlot","_decorate","property","godown","styles","Layout$1"],"mappings":"gRAMA,MAAMA,EAAY,SAgBlB,IAAAC,EAAA,MAmCMA,UAAeC,CAAY,oCAK/B,OAAS,GAEC,QAA4B,CACpC,MAAO,EAAI,oBAGLC,EAAK,KAAK,gBAAA,0BAEYC,EAAS,UAAU,8BACvBA,IAAW,gCACPA,EAAS,UAAU,oBAXhDC,EAAA,CAAAC,EAAS,CAAE,KAAM,WAAAL,EAAA,UAAA,SAAA,aAvCnBM,EAAO,UACPC,EAAO,CAAG;OAuDX,IAAAC,EAAeR"}
@@ -1 +1 @@
1
- {"mappings":"AAAA,OAAO,YAAY,gBAAiB;AAIpC,eAAe;eAEA;WACH,sBAAsB;EAC9B,iBAAiB;CAClB;AACF","names":[],"sources":["../../../../src/web-components/layout/definition.ts"],"sourcesContent":["import Layout from \"./component.js\";\n\nLayout.define();\n\nexport default Layout;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-layout\": Layout;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
1
+ {"mappings":"AAAA,OAAO,YAAY;AAInB,eAAe;eAEA;WACH,sBAAsB;EAC9B,iBAAiB","names":[],"sources":["../../../../src/web-components/layout/definition.ts"],"sourcesContent":["import Layout from \"./component.js\";\n\nLayout.define();\n\nexport default Layout;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-layout\": Layout;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
@@ -1,2 +1,2 @@
1
- import Layout from"./component.js";import"@godown/element";import"lit";import"lit/decorators.js";import"../../internal/global-style.js";import"../../internal/reset-style.js";import"sharekit";import"@oxc-project/runtime/helpers/decorate";Layout.define();export{Layout as default};
1
+ import e from"./component.js";e.define();export{e as default};
2
2
  //# sourceMappingURL=definition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definition.js","sources":["../../../src/web-components/layout/definition.ts"],"sourcesContent":["import Layout from \"./component.js\";\n\nLayout.define();\n\nexport default Layout;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-layout\": Layout;\n }\n}\n"],"names":[],"mappings":"6OAEA,OAAO,QAAQ"}
1
+ {"version":3,"file":"definition.js","sources":["../../../src/web-components/layout/definition.ts"],"sourcesContent":["import Layout from \"./component.js\";\n\nLayout.define();\n\nexport default Layout;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-layout\": Layout;\n }\n}\n"],"names":["Layout"],"mappings":"8BAEAA,EAAO"}
@@ -1 +1 @@
1
- {"mappings":"AAIA,cAAkC,sBAAsB,KAAM;AAC9D,OAAO,iBAAiB,gCAAiC;AAIzD,cAAM;UACJ,MAAM;UACN,SAAS;UACT,QAAQ;UACR,MAAM;;KAGH,wBAAwB;;;;;;;;;;;;;;;;;;;;AAqB7B,cAeM,aAAa,YAAY;;;;;;;;CAQ7B,AACA,MAAM;;;;CAKN,AACA;;;;CAKA,AACA;;;;CAKA,AACA;;;;CAKA,AACA,QAAQ,WAAW,UAAU,YAAY;;;;CAKzC;CAEA,IAAI;CAIJ,UAAU,aAAaA,GAAG;CA6B1B;CAgBA,UAAU,UAAU,eAAe;AAapC;AAED,eAAe;AACf,SAAS","names":["e: MouseEvent"],"sources":["../../../../src/web-components/link/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, styles } from \"@godown/element\";\nimport { property } from \"lit/decorators.js\";\n\nimport Router from \"../router/component.js\";\nimport { css, html, nothing, type TemplateResult } from \"lit\";\nimport GlobalStyle from \"../../internal/global-style.js\";\n\nconst protoName = \"link\";\n\nconst linkTypes = {\n push: \"push\",\n replace: \"replace\",\n normal: \"normal\",\n auto: \"auto\",\n} as const;\n\ntype LinkType = keyof typeof linkTypes;\n\n/**\n * {@linkcode Link} is used for link jumping, works standalone or in {@linkcode Router}.\n *\n * Set `type` to `\"normal\"`,\n * behave like a normal anchor.\n *\n * Set `type` to `\"push\" `or `\"replace\"`,\n * update history state by `history.pushState` or `history.replaceState`,\n * update all routers whether current pathname is registered or not.\n *\n * Set `type` to `\"auto\"`,\n * only update the routers if the current pathname is registered,\n * if not registered, behave like `\"normal\"`.\n *\n * `replace` property will enforce `history.replaceState`.\n *\n * @fires navigate - Fires when the link is clicked.\n * @category navigation\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: inline-block;\n cursor: default;\n }\n\n :host([href]) {\n cursor: pointer;\n }\n\n a {\n display: contents;\n }\n`)\nclass Link extends GlobalStyle {\n /**\n * If `\"normal\"`, behave like a normal anchor.\n *\n * If `\"auto\"` or `\"push\"`, call `history.pushState` if `replace` is false,\n *\n * If `\"replace\"`, call `history.replaceState`.\n */\n @property()\n type: LinkType = linkTypes.auto;\n\n /**\n * If `true`, the {@linkcode Router} will not be updated.\n */\n @property({ type: Boolean })\n suppress = false;\n\n /**\n * Use `replaceState` instead of `pushState`.\n */\n @property({ type: Boolean })\n replace = false;\n\n /**\n * A element href.\n */\n @property()\n href: string;\n\n /**\n * A element target.\n */\n @property()\n target: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" = \"_self\";\n\n /**\n * Location state object.\n */\n state = {};\n\n get pathname(): string {\n return new URL(this.href, location.href).pathname;\n }\n\n protected _handleClick(e: MouseEvent): void {\n const { state, type, href, pathname, suppress } = this;\n if (!href) {\n return;\n }\n this.dispatchCustomEvent(\"navigate\", {\n ...this.observedRecord,\n pathname,\n state,\n });\n if (href.startsWith(\"#\") || type === linkTypes.normal) {\n return;\n }\n this.handleState();\n const routers = [...Router.routerInstances];\n if (\n // only runs when suppress is false\n !suppress &&\n (type !== linkTypes.auto ||\n // in auto mode, only update the routers if the current pathname is registered\n routers.some((i) => i.search(location.pathname)))\n ) {\n e.preventDefault();\n Router.routerInstances.forEach((i) => {\n i.handlePopstate();\n });\n }\n }\n\n handleState: () => void = () => {\n switch (this.type) {\n case linkTypes.auto:\n case linkTypes.push:\n if (!this.replace) {\n // type is auto or push and replace is false\n history.pushState(this.state, \"\", this.href);\n break;\n }\n // fallthrough to replace\n case linkTypes.replace:\n history.replaceState(this.state, \"\", this.href);\n break;\n }\n };\n\n protected render(): TemplateResult<1> {\n return html`\n <a\n part=\"root\"\n ${attr(this.observedRecord)}\n href=\"${this.href || nothing}\"\n target=\"${this.target}\"\n @click=${this._handleClick}\n >\n ${htmlSlot()}\n </a>\n `;\n }\n}\n\nexport default Link;\nexport { Link };\n"],"version":3,"file":"component.d.ts"}
1
+ {"mappings":"AAIA,cAAkC,sBAAsB;AACxD,OAAO,iBAAiB;AAIxB,cAAM;UACJ,MAAM;UACN,SAAS;UACT,QAAQ;UACR,MAAM;;KAGH,wBAAwB;;;;;;;;;;;;;;;;;;;;AAqB7B,cAeM,aAAa,YAAY;;;;;;;;CAQ7B,AACA,MAAM;;;;CAKN,AACA;;;;CAKA,AACA;;;;CAKA,AACA;;;;CAKA,AACA,QAAQ,WAAW,UAAU,YAAY;;;;CAKzC;CAEA,IAAI;CAIJ,UAAU,aAAa,GAAG;CA6B1B;CAgBA,UAAU,UAAU,eAAe;;AAerC,eAAe;AACf,SAAS","names":[],"sources":["../../../../src/web-components/link/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, styles } from \"@godown/element\";\nimport { property } from \"lit/decorators.js\";\n\nimport Router from \"../router/component.js\";\nimport { css, html, nothing, type TemplateResult } from \"lit\";\nimport GlobalStyle from \"../../internal/global-style.js\";\n\nconst protoName = \"link\";\n\nconst linkTypes = {\n push: \"push\",\n replace: \"replace\",\n normal: \"normal\",\n auto: \"auto\",\n} as const;\n\ntype LinkType = keyof typeof linkTypes;\n\n/**\n * {@linkcode Link} is used for link jumping, works standalone or in {@linkcode Router}.\n *\n * Set `type` to `\"normal\"`,\n * behave like a normal anchor.\n *\n * Set `type` to `\"push\" `or `\"replace\"`,\n * update history state by `history.pushState` or `history.replaceState`,\n * update all routers whether current pathname is registered or not.\n *\n * Set `type` to `\"auto\"`,\n * only update the routers if the current pathname is registered,\n * if not registered, behave like `\"normal\"`.\n *\n * `replace` property will enforce `history.replaceState`.\n *\n * @fires navigate - Fires when the link is clicked.\n * @category navigation\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: inline-block;\n cursor: default;\n }\n\n :host([href]) {\n cursor: pointer;\n }\n\n a {\n display: contents;\n }\n`)\nclass Link extends GlobalStyle {\n /**\n * If `\"normal\"`, behave like a normal anchor.\n *\n * If `\"auto\"` or `\"push\"`, call `history.pushState` if `replace` is false,\n *\n * If `\"replace\"`, call `history.replaceState`.\n */\n @property()\n type: LinkType = linkTypes.auto;\n\n /**\n * If `true`, the {@linkcode Router} will not be updated.\n */\n @property({ type: Boolean })\n suppress = false;\n\n /**\n * Use `replaceState` instead of `pushState`.\n */\n @property({ type: Boolean })\n replace = false;\n\n /**\n * A element href.\n */\n @property()\n href: string;\n\n /**\n * A element target.\n */\n @property()\n target: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" = \"_self\";\n\n /**\n * Location state object.\n */\n state = {};\n\n get pathname(): string {\n return new URL(this.href, location.href).pathname;\n }\n\n protected _handleClick(e: MouseEvent): void {\n const { state, type, href, pathname, suppress } = this;\n if (!href) {\n return;\n }\n this.dispatchCustomEvent(\"navigate\", {\n ...this.observedRecord,\n pathname,\n state,\n });\n if (href.startsWith(\"#\") || type === linkTypes.normal) {\n return;\n }\n this.handleState();\n const routers = [...Router.routerInstances];\n if (\n // only runs when suppress is false\n !suppress &&\n (type !== linkTypes.auto ||\n // in auto mode, only update the routers if the current pathname is registered\n routers.some((i) => i.search(location.pathname)))\n ) {\n e.preventDefault();\n Router.routerInstances.forEach((i) => {\n i.handlePopstate();\n });\n }\n }\n\n handleState: () => void = () => {\n switch (this.type) {\n case linkTypes.auto:\n case linkTypes.push:\n if (!this.replace) {\n // type is auto or push and replace is false\n history.pushState(this.state, \"\", this.href);\n break;\n }\n // fallthrough to replace\n case linkTypes.replace:\n history.replaceState(this.state, \"\", this.href);\n break;\n }\n };\n\n protected render(): TemplateResult<1> {\n return html`\n <a\n part=\"root\"\n ${attr(this.observedRecord)}\n href=\"${this.href || nothing}\"\n target=\"${this.target}\"\n @click=${this._handleClick}\n >\n ${htmlSlot()}\n </a>\n `;\n }\n}\n\nexport default Link;\nexport { Link };\n"],"version":3,"file":"component.d.ts"}
@@ -1,3 +1,3 @@
1
- import{godown,styles,attr,htmlSlot}from"@godown/element";import{property}from"lit/decorators.js";import Router from"../router/component.js";import{css,nothing,html}from"lit";import{GlobalStyle}from"../../internal/global-style.js";import _decorate from"@oxc-project/runtime/helpers/decorate";import"sharekit";import"../../internal/reset-style.js";const protoName=`link`,linkTypes={push:`push`,replace:`replace`,normal:`normal`,auto:`auto`};let Link=class e extends GlobalStyle{constructor(...e){super(...e),this.type=linkTypes.auto,this.suppress=!1,this.replace=!1,this.target=`_self`,this.state={},this.handleState=()=>{switch(this.type){case linkTypes.auto:case linkTypes.push:if(!this.replace){history.pushState(this.state,``,this.href);break}case linkTypes.replace:history.replaceState(this.state,``,this.href);break}}}get pathname(){return new URL(this.href,location.href).pathname}_handleClick(e){let{state:l,type:u,href:d,pathname:f,suppress:p}=this;if(!d||(this.dispatchCustomEvent(`navigate`,{...this.observedRecord,pathname:f,state:l}),d.startsWith(`#`)||u===linkTypes.normal))return;this.handleState();let m=[...Router.routerInstances];!p&&(u!==linkTypes.auto||m.some(e=>e.search(location.pathname)))&&(e.preventDefault(),Router.routerInstances.forEach(e=>{e.handlePopstate()}))}render(){return html`<a part="root" ${attr(this.observedRecord)} href="${this.href||nothing}" target="${this.target}" @click=${this._handleClick}> ${htmlSlot()} </a>`}};_decorate([property()],Link.prototype,`type`,void 0),_decorate([property({type:Boolean})],Link.prototype,`suppress`,void 0),_decorate([property({type:Boolean})],Link.prototype,`replace`,void 0),_decorate([property()],Link.prototype,`href`,void 0),_decorate([property()],Link.prototype,`target`,void 0),Link=_decorate([godown(protoName),styles(css`:host{display:inline-block;cursor:default}:host([href]){cursor:pointer}a{display:contents}
2
- `)],Link);var Link$1=Link;export{Link,Link$1 as default};
1
+ import{godown as e,styles as t,attr as n,htmlSlot as r}from"@godown/element";import{property as i}from"lit/decorators.js";import a from"../router/component.js";import{css as o,nothing as s,html as c}from"lit";import{GlobalStyle as l}from"../../internal/global-style.js";import u from"@oxc-project/runtime/helpers/decorate";const d=`link`,f={push:`push`,replace:`replace`,normal:`normal`,auto:`auto`};let p=class e extends l{constructor(...e){super(...e),this.type=f.auto,this.suppress=!1,this.replace=!1,this.target=`_self`,this.state={},this.handleState=()=>{switch(this.type){case f.auto:case f.push:if(!this.replace){history.pushState(this.state,``,this.href);break}case f.replace:history.replaceState(this.state,``,this.href);break}}}get pathname(){return new URL(this.href,location.href).pathname}_handleClick(e){let{state:t,type:n,href:r,pathname:i,suppress:o}=this;if(!r||(this.dispatchCustomEvent(`navigate`,{...this.observedRecord,pathname:i,state:t}),r.startsWith(`#`)||n===f.normal))return;this.handleState();let s=[...a.routerInstances];!o&&(n!==f.auto||s.some(e=>e.search(location.pathname)))&&(e.preventDefault(),a.routerInstances.forEach(e=>{e.handlePopstate()}))}render(){return c`<a part="root" ${n(this.observedRecord)} href="${this.href||s}" target="${this.target}" @click=${this._handleClick}> ${r()} </a>`}};u([i()],p.prototype,`type`,void 0),u([i({type:Boolean})],p.prototype,`suppress`,void 0),u([i({type:Boolean})],p.prototype,`replace`,void 0),u([i()],p.prototype,`href`,void 0),u([i()],p.prototype,`target`,void 0),p=u([e(`link`),t(o`:host{display:inline-block;cursor:default}:host([href]){cursor:pointer}a{display:contents}
2
+ `)],p);var m=p;export{p as Link,m as default};
3
3
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/web-components/link/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, styles } from \"@godown/element\";\nimport { property } from \"lit/decorators.js\";\n\nimport Router from \"../router/component.js\";\nimport { css, html, nothing, type TemplateResult } from \"lit\";\nimport GlobalStyle from \"../../internal/global-style.js\";\n\nconst protoName = \"link\";\n\nconst linkTypes = {\n push: \"push\",\n replace: \"replace\",\n normal: \"normal\",\n auto: \"auto\",\n} as const;\n\ntype LinkType = keyof typeof linkTypes;\n\n/**\n * {@linkcode Link} is used for link jumping, works standalone or in {@linkcode Router}.\n *\n * Set `type` to `\"normal\"`,\n * behave like a normal anchor.\n *\n * Set `type` to `\"push\" `or `\"replace\"`,\n * update history state by `history.pushState` or `history.replaceState`,\n * update all routers whether current pathname is registered or not.\n *\n * Set `type` to `\"auto\"`,\n * only update the routers if the current pathname is registered,\n * if not registered, behave like `\"normal\"`.\n *\n * `replace` property will enforce `history.replaceState`.\n *\n * @fires navigate - Fires when the link is clicked.\n * @category navigation\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: inline-block;\n cursor: default;\n }\n\n :host([href]) {\n cursor: pointer;\n }\n\n a {\n display: contents;\n }\n`)\nclass Link extends GlobalStyle {\n /**\n * If `\"normal\"`, behave like a normal anchor.\n *\n * If `\"auto\"` or `\"push\"`, call `history.pushState` if `replace` is false,\n *\n * If `\"replace\"`, call `history.replaceState`.\n */\n @property()\n type: LinkType = linkTypes.auto;\n\n /**\n * If `true`, the {@linkcode Router} will not be updated.\n */\n @property({ type: Boolean })\n suppress = false;\n\n /**\n * Use `replaceState` instead of `pushState`.\n */\n @property({ type: Boolean })\n replace = false;\n\n /**\n * A element href.\n */\n @property()\n href: string;\n\n /**\n * A element target.\n */\n @property()\n target: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" = \"_self\";\n\n /**\n * Location state object.\n */\n state = {};\n\n get pathname(): string {\n return new URL(this.href, location.href).pathname;\n }\n\n protected _handleClick(e: MouseEvent): void {\n const { state, type, href, pathname, suppress } = this;\n if (!href) {\n return;\n }\n this.dispatchCustomEvent(\"navigate\", {\n ...this.observedRecord,\n pathname,\n state,\n });\n if (href.startsWith(\"#\") || type === linkTypes.normal) {\n return;\n }\n this.handleState();\n const routers = [...Router.routerInstances];\n if (\n // only runs when suppress is false\n !suppress &&\n (type !== linkTypes.auto ||\n // in auto mode, only update the routers if the current pathname is registered\n routers.some((i) => i.search(location.pathname)))\n ) {\n e.preventDefault();\n Router.routerInstances.forEach((i) => {\n i.handlePopstate();\n });\n }\n }\n\n handleState: () => void = () => {\n switch (this.type) {\n case linkTypes.auto:\n case linkTypes.push:\n if (!this.replace) {\n // type is auto or push and replace is false\n history.pushState(this.state, \"\", this.href);\n break;\n }\n // fallthrough to replace\n case linkTypes.replace:\n history.replaceState(this.state, \"\", this.href);\n break;\n }\n };\n\n protected render(): TemplateResult<1> {\n return html`\n <a\n part=\"root\"\n ${attr(this.observedRecord)}\n href=\"${this.href || nothing}\"\n target=\"${this.target}\"\n @click=${this._handleClick}\n >\n ${htmlSlot()}\n </a>\n `;\n }\n}\n\nexport default Link;\nexport { Link };\n"],"names":["Link","e: MouseEvent","href","type","routers","suppress","i"],"mappings":"0VAOA,MAAM,UAAY,OAEZ,UAAY,CAChB,KAAM,OACN,QAAS,UACT,OAAQ,SACR,KAAM,MACP,EAuBD,IAAA,KAAA,MAeMA,UAAa,WAAY,+BAS7B,KAAA,KAAiB,UAAU,UAM3B,SAAW,QAMX,QAAU,QAYV,OAAkD,QAKlD,KAAA,MAAQ,CAAE,EAmCV,KAAA,YAA0B,IAAM,CAC9B,OAAQ,KAAK,KAAb,CACE,KAAK,UAAU,KACf,KAAK,UAAU,KACb,GAAI,CAAC,KAAK,QAAS,CAEjB,QAAQ,UAAU,KAAK,MAAO,GAAI,KAAK,KAAK,CAC5C,KACD,CAEH,KAAK,UAAU,QACb,QAAQ,aAAa,KAAK,MAAO,GAAI,KAAK,KAAK,CAC/C,KACH,CACF,EA/CD,IAAI,UAAmB,CACrB,OAAO,IAAI,IAAI,KAAK,KAAM,SAAS,MAAM,QAC1C,CAES,aAAaC,EAAqB,CAC1C,GAAM,CAAE,QAAO,OAAM,OAAM,WAAU,WAAU,CAAG,KASlD,GARI,CAACC,IAGL,KAAK,oBAAoB,WAAY,CACnC,GAAG,KAAK,eACR,WACA,OACD,EAAC,CACEA,EAAK,WAAW,IAAI,EAAIC,IAAS,UAAU,QAC7C,OAEF,KAAK,aAAa,CAClB,IAAMC,EAAU,CAAC,GAAG,OAAO,eAAgB,EAGzC,CAACC,IACAF,IAAS,UAAU,MAElBC,EAAQ,KAAK,AAACE,GAAMA,EAAE,OAAO,SAAS,SAAS,CAAC,IAElD,EAAE,gBAAgB,CAClB,OAAO,gBAAgB,QAAQ,AAACA,GAAM,CACpCA,EAAE,gBAAgB,AACnB,EAAC,CAEL,CAkBS,QAA4B,CACpC,MAAO,KAAI,CAAA,eAGP,EAAE,KAAK,KAAK,eAAe,CAAA,OACrB,EAAE,KAAK,MAAQ,QAAQ,UACrB,EAAE,KAAK,OAAO,SACf,EAAE,KAAK,aAAA,EAEd,EAAE,UAAU,CAAA,KAEhB,CAAC,AACF,CACF,aA9FE,UAAU,AAAA,EAAA,KAAA,UAAA,OAAA,OAAA,YAMV,SAAS,CAAE,KAAM,OAAS,EAAC,AAAA,EAAA,KAAA,UAAA,WAAA,OAAA,YAM3B,SAAS,CAAE,KAAM,OAAS,EAAC,AAAA,EAAA,KAAA,UAAA,UAAA,OAAA,YAM3B,UAAU,AAAA,EAAA,KAAA,UAAA,OAAA,OAAA,YAMV,UAAU,AAAA,EAAA,KAAA,UAAA,SAAA,OAAA,CA/CZ,KAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC;AAaZ,CAAC,CAAC,AAAA,EAAA,KAAA,CAyGF,IAAA,OAAe"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/web-components/link/component.ts"],"sourcesContent":["import { attr, godown, htmlSlot, styles } from \"@godown/element\";\nimport { property } from \"lit/decorators.js\";\n\nimport Router from \"../router/component.js\";\nimport { css, html, nothing, type TemplateResult } from \"lit\";\nimport GlobalStyle from \"../../internal/global-style.js\";\n\nconst protoName = \"link\";\n\nconst linkTypes = {\n push: \"push\",\n replace: \"replace\",\n normal: \"normal\",\n auto: \"auto\",\n} as const;\n\ntype LinkType = keyof typeof linkTypes;\n\n/**\n * {@linkcode Link} is used for link jumping, works standalone or in {@linkcode Router}.\n *\n * Set `type` to `\"normal\"`,\n * behave like a normal anchor.\n *\n * Set `type` to `\"push\" `or `\"replace\"`,\n * update history state by `history.pushState` or `history.replaceState`,\n * update all routers whether current pathname is registered or not.\n *\n * Set `type` to `\"auto\"`,\n * only update the routers if the current pathname is registered,\n * if not registered, behave like `\"normal\"`.\n *\n * `replace` property will enforce `history.replaceState`.\n *\n * @fires navigate - Fires when the link is clicked.\n * @category navigation\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: inline-block;\n cursor: default;\n }\n\n :host([href]) {\n cursor: pointer;\n }\n\n a {\n display: contents;\n }\n`)\nclass Link extends GlobalStyle {\n /**\n * If `\"normal\"`, behave like a normal anchor.\n *\n * If `\"auto\"` or `\"push\"`, call `history.pushState` if `replace` is false,\n *\n * If `\"replace\"`, call `history.replaceState`.\n */\n @property()\n type: LinkType = linkTypes.auto;\n\n /**\n * If `true`, the {@linkcode Router} will not be updated.\n */\n @property({ type: Boolean })\n suppress = false;\n\n /**\n * Use `replaceState` instead of `pushState`.\n */\n @property({ type: Boolean })\n replace = false;\n\n /**\n * A element href.\n */\n @property()\n href: string;\n\n /**\n * A element target.\n */\n @property()\n target: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" = \"_self\";\n\n /**\n * Location state object.\n */\n state = {};\n\n get pathname(): string {\n return new URL(this.href, location.href).pathname;\n }\n\n protected _handleClick(e: MouseEvent): void {\n const { state, type, href, pathname, suppress } = this;\n if (!href) {\n return;\n }\n this.dispatchCustomEvent(\"navigate\", {\n ...this.observedRecord,\n pathname,\n state,\n });\n if (href.startsWith(\"#\") || type === linkTypes.normal) {\n return;\n }\n this.handleState();\n const routers = [...Router.routerInstances];\n if (\n // only runs when suppress is false\n !suppress &&\n (type !== linkTypes.auto ||\n // in auto mode, only update the routers if the current pathname is registered\n routers.some((i) => i.search(location.pathname)))\n ) {\n e.preventDefault();\n Router.routerInstances.forEach((i) => {\n i.handlePopstate();\n });\n }\n }\n\n handleState: () => void = () => {\n switch (this.type) {\n case linkTypes.auto:\n case linkTypes.push:\n if (!this.replace) {\n // type is auto or push and replace is false\n history.pushState(this.state, \"\", this.href);\n break;\n }\n // fallthrough to replace\n case linkTypes.replace:\n history.replaceState(this.state, \"\", this.href);\n break;\n }\n };\n\n protected render(): TemplateResult<1> {\n return html`\n <a\n part=\"root\"\n ${attr(this.observedRecord)}\n href=\"${this.href || nothing}\"\n target=\"${this.target}\"\n @click=${this._handleClick}\n >\n ${htmlSlot()}\n </a>\n `;\n }\n}\n\nexport default Link;\nexport { Link };\n"],"names":["protoName","linkTypes","Link","GlobalStyle","href","type","routers","Router","suppress","i","attr","nothing","htmlSlot","_decorate","property","godown","styles","Link$1"],"mappings":"mUAOA,MAAMA,EAAY,OAEZC,EAAY,CAChB,KAAM,OACN,QAAS,UACT,OAAQ,SACR,KAAM,QAwBR,IAAAC,EAAA,MAeMA,UAAaC,CAAY,+BAS7B,KAAA,KAAiBF,EAAU,UAM3B,SAAW,QAMX,QAAU,QAYV,OAAkD,aAKlD,MAAQ,QAmCR,gBAAgC,CAC9B,OAAQ,KAAK,KAAb,CACE,KAAKA,EAAU,KACf,KAAKA,EAAU,KACb,GAAI,CAAC,KAAK,QAAS,CAEjB,QAAQ,UAAU,KAAK,MAAO,GAAI,KAAK,MACvC,MAGJ,KAAKA,EAAU,QACb,QAAQ,aAAa,KAAK,MAAO,GAAI,KAAK,MAC1C,QA7CN,IAAI,UAAmB,CACrB,OAAO,IAAI,IAAI,KAAK,KAAM,SAAS,MAAM,SAGjC,aAAa,EAAqB,CAC1C,GAAM,CAAE,QAAO,OAAM,OAAM,WAAU,YAAa,KASlD,GARI,CAACG,IAGL,KAAK,oBAAoB,WAAY,CACnC,GAAG,KAAK,eACR,WACA,UAEEA,EAAK,WAAW,MAAQC,IAASJ,EAAU,QAC7C,OAEF,KAAK,cACL,IAAMK,EAAU,CAAC,GAAGC,EAAO,iBAGzB,CAACC,IACAH,IAASJ,EAAU,MAElBK,EAAQ,KAAM,GAAMG,EAAE,OAAO,SAAS,cAExC,EAAE,iBACFF,EAAO,gBAAgB,QAAS,GAAM,CACpCE,EAAE,oBAqBE,QAA4B,CACpC,MAAO,EAAI,kBAGLC,EAAK,KAAK,gBAAA,SACJ,KAAK,MAAQC,EAAQ,YACnB,KAAK,OAAO,WACb,KAAK,aAAA,IAEZC,IAAA,SA1FPC,EAAA,CAAAC,KAAAZ,EAAA,UAAA,OAAA,QAMAW,EAAA,CAAAC,EAAS,CAAE,KAAM,WAAAZ,EAAA,UAAA,WAAA,QAMjBW,EAAA,CAAAC,EAAS,CAAE,KAAM,WAAAZ,EAAA,UAAA,UAAA,QAMjBW,EAAA,CAAAC,KAAAZ,EAAA,UAAA,OAAA,QAMAW,EAAA,CAAAC,KAAAZ,EAAA,UAAA,SAAA,aA/CFa,EAAO,QACPC,EAAO,CAAG;OAsHX,IAAAC,EAAef"}
@@ -1 +1 @@
1
- {"mappings":"AAAA,OAAO,UAAU,gBAAiB;AAIlC,eAAe;eAEA;WACH,sBAAsB;EAC9B,eAAe;CAChB;AACF","names":[],"sources":["../../../../src/web-components/link/definition.ts"],"sourcesContent":["import Link from \"./component.js\";\n\nLink.define();\n\nexport default Link;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-link\": Link;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
1
+ {"mappings":"AAAA,OAAO,UAAU;AAIjB,eAAe;eAEA;WACH,sBAAsB;EAC9B,eAAe","names":[],"sources":["../../../../src/web-components/link/definition.ts"],"sourcesContent":["import Link from \"./component.js\";\n\nLink.define();\n\nexport default Link;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-link\": Link;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
@@ -1,2 +1,2 @@
1
- import Link from"./component.js";import"@godown/element";import"lit/decorators.js";import"../router/component.js";import"lit";import"sharekit";import"../../internal/global-style.js";import"../../internal/reset-style.js";import"@oxc-project/runtime/helpers/decorate";Link.define();export{Link as default};
1
+ import e from"./component.js";e.define();export{e as default};
2
2
  //# sourceMappingURL=definition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definition.js","sources":["../../../src/web-components/link/definition.ts"],"sourcesContent":["import Link from \"./component.js\";\n\nLink.define();\n\nexport default Link;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-link\": Link;\n }\n}\n"],"names":[],"mappings":"0QAEA,KAAK,QAAQ"}
1
+ {"version":3,"file":"definition.js","sources":["../../../src/web-components/link/definition.ts"],"sourcesContent":["import Link from \"./component.js\";\n\nLink.define();\n\nexport default Link;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-link\": Link;\n }\n}\n"],"names":["Link"],"mappings":"8BAEAA,EAAK"}
@@ -1 +1 @@
1
- {"mappings":"AACA,OAAO,iBAAiB,gCAAiC;AACzD,cAAyB,qBAAqB,sBAAsB,KAAM;;;;;;;;;;;AAiB1E,cAsBM,gBAAgB,YAAY;CAChC;CAEA,AACA;CAEA,AACA,QAAQ,SAAS,SAAS,WAAW;CAErC,AACA,MAAM,SAAS,WAAW;;;;;CAM1B,AACA,UACI,WACA,SACA,aACA,gBACA,UACA,cACA,iBACA,QACA,aACA,cACA,WACA,gBACA,iBACA,UACA,gBACA,cACA,QACA,cACA;CAEJ,UACU,UAAU;CAEpB;CAeA,UAAU,UAAU,eAAe;CAmBnC,UAAU;CAUV;CAIA;CAIA,OAAOA;CAIP,UAAU,QAAQC,oBAAoB;CAMtC,UAAU;CAiBV;AASD;AAED,SAAS,SAAS,WAAW","names":["force?: boolean","_changedProperties: PropertyValues"],"sources":["../../../../src/web-components/popover/component.ts"],"sourcesContent":["import { property, query } from \"lit/decorators.js\";\nimport GlobalStyle from \"../../internal/global-style.js\";\nimport { css, html, type PropertyValues, type TemplateResult } from \"lit\";\nimport { godown, htmlSlot, StyleController, styles } from \"@godown/element\";\nimport { hidePopover, showPopover } from \"../../internal/popover.js\";\n\nconst POPOVER = \"popover\";\nconst protoName = POPOVER;\n\n/**\n * {@link Popover} renders a popover.\n *\n * This requires the support of the popover API and CSS position-area.\n *\n * @fires toggle - Fired when the popover is toggled.\n * @slot popover - Popover content.\n * @slot - Popover trigger.\n * @category display\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: inline-block;\n }\n\n [part=\"trigger\"] {\n display: contents;\n }\n\n [part=\"root\"] {\n display: inherit;\n }\n\n [part=\"popover\"] {\n inset: unset;\n z-index: 1;\n overflow: visible;\n position: absolute;\n position-try-fallbacks: flip-block;\n }\n`)\nclass Popover extends GlobalStyle {\n anchorName = `--${POPOVER}-${Math.random().toString(36).slice(2)}`;\n\n @property({ type: Boolean, reflect: true })\n open = false;\n\n @property()\n action: \"hide\" | \"show\" | \"toggle\" | \"none\" = \"show\";\n\n @property()\n span: \"span\" | \"spread\" | \"isolated\" = \"span\";\n\n /**\n * The position refers to the spatial location of the popover in relation to the trigger,\n * rather than the alignment property between them.\n */\n @property()\n position:\n | \"center\"\n | \"left\"\n | \"left-top\"\n | \"left-bottom\"\n | \"right\"\n | \"right-top\"\n | \"right-bottom\"\n | \"top\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"start\"\n | \"start-start\"\n | \"start-end\"\n | \"end\"\n | \"end-start\"\n | \"end-end\" = \"bottom\";\n\n @query(`[part=${POPOVER}]`, true)\n protected _popover: HTMLElement;\n\n constructor() {\n super();\n new StyleController(this, () => {\n return {\n \"[part=root],slot:not([name])::slotted(*)\": {\n \"anchor-name\": this.anchorName,\n },\n \"[part=popover]\": {\n \"position-anchor\": this.anchorName,\n \"position-area\": this.resolveArea(),\n },\n };\n });\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <div part=\"root\">\n <div\n part=\"trigger\"\n @click=${this._handleClick}\n >\n ${htmlSlot()}\n </div>\n <div\n part=\"popover\"\n popover=\"manual\"\n >\n ${htmlSlot(\"popover\")}\n </div>\n </div>\n `;\n }\n\n protected _handleClick(): void {\n const { action } = this;\n switch (action) {\n case \"show\":\n case \"hide\":\n case \"toggle\":\n this[action]();\n }\n }\n\n show(): void {\n this.toggle(true);\n }\n\n hide(): void {\n this.toggle(false);\n }\n\n toggle(force?: boolean): void {\n this.open = force ?? !this.open;\n }\n\n protected updated(_changedProperties: PropertyValues): void {\n if (_changedProperties.has(\"open\")) {\n this._openChange();\n }\n }\n\n protected _openChange(): void {\n const { open } = this;\n if (open) {\n showPopover.call(this, this._popover);\n const listener = (e) => {\n if (!this.contains(e.target)) {\n this.events.remove(document, \"click\", listener);\n this.open = false;\n }\n };\n this.events.add(document, \"click\", listener);\n } else {\n hidePopover(this._popover);\n }\n this.dispatchCustomEvent(\"toggle\", open);\n }\n\n resolveArea(): string {\n const split = this.position.split(\"-\");\n const firstValue = this.span === \"spread\" ? `span-${split[0]}` : split[0];\n if (split.length < 2) {\n return `${firstValue} center`;\n }\n const secondValue = this.span === \"isolated\" ? split[1] : `span-${split[1]}`;\n return `${firstValue} ${secondValue}`;\n }\n}\n\nexport { Popover, Popover as default };\n"],"version":3,"file":"component.d.ts"}
1
+ {"mappings":"AACA,OAAO,iBAAiB;AACxB,cAAyB,qBAAqB,sBAAsB;;;;;;;;;;;AAiBpE,cAsBM,gBAAgB,YAAY;CAChC;CAEA,AACA;CAEA,AACA,QAAQ,SAAS,SAAS,WAAW;CAErC,AACA,MAAM,SAAS,WAAW;;;;;CAM1B,AACA,UACI,WACA,SACA,aACA,gBACA,UACA,cACA,iBACA,QACA,aACA,cACA,WACA,gBACA,iBACA,UACA,gBACA,cACA,QACA,cACA;CAEJ,UACU,UAAU;CAEpB;CAeA,UAAU,UAAU,eAAe;CAmBnC,UAAU;CAUV;CAIA;CAIA,OAAO;CAIP,UAAU,QAAQ,oBAAoB;CAMtC,UAAU;CAiBV;;AAWF,SAAS,SAAS,WAAW","names":[],"sources":["../../../../src/web-components/popover/component.ts"],"sourcesContent":["import { property, query } from \"lit/decorators.js\";\nimport GlobalStyle from \"../../internal/global-style.js\";\nimport { css, html, type PropertyValues, type TemplateResult } from \"lit\";\nimport { godown, htmlSlot, StyleController, styles } from \"@godown/element\";\nimport { hidePopover, showPopover } from \"../../internal/popover.js\";\n\nconst POPOVER = \"popover\";\nconst protoName = POPOVER;\n\n/**\n * {@link Popover} renders a popover.\n *\n * This requires the support of the popover API and CSS position-area.\n *\n * @fires toggle - Fired when the popover is toggled.\n * @slot popover - Popover content.\n * @slot - Popover trigger.\n * @category display\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: inline-block;\n }\n\n [part=\"trigger\"] {\n display: contents;\n }\n\n [part=\"root\"] {\n display: inherit;\n }\n\n [part=\"popover\"] {\n inset: unset;\n z-index: 1;\n overflow: visible;\n position: absolute;\n position-try-fallbacks: flip-block;\n }\n`)\nclass Popover extends GlobalStyle {\n anchorName = `--${POPOVER}-${Math.random().toString(36).slice(2)}`;\n\n @property({ type: Boolean, reflect: true })\n open = false;\n\n @property()\n action: \"hide\" | \"show\" | \"toggle\" | \"none\" = \"show\";\n\n @property()\n span: \"span\" | \"spread\" | \"isolated\" = \"span\";\n\n /**\n * The position refers to the spatial location of the popover in relation to the trigger,\n * rather than the alignment property between them.\n */\n @property()\n position:\n | \"center\"\n | \"left\"\n | \"left-top\"\n | \"left-bottom\"\n | \"right\"\n | \"right-top\"\n | \"right-bottom\"\n | \"top\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"start\"\n | \"start-start\"\n | \"start-end\"\n | \"end\"\n | \"end-start\"\n | \"end-end\" = \"bottom\";\n\n @query(`[part=${POPOVER}]`, true)\n protected _popover: HTMLElement;\n\n constructor() {\n super();\n new StyleController(this, () => {\n return {\n \"[part=root],slot:not([name])::slotted(*)\": {\n \"anchor-name\": this.anchorName,\n },\n \"[part=popover]\": {\n \"position-anchor\": this.anchorName,\n \"position-area\": this.resolveArea(),\n },\n };\n });\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <div part=\"root\">\n <div\n part=\"trigger\"\n @click=${this._handleClick}\n >\n ${htmlSlot()}\n </div>\n <div\n part=\"popover\"\n popover=\"manual\"\n >\n ${htmlSlot(\"popover\")}\n </div>\n </div>\n `;\n }\n\n protected _handleClick(): void {\n const { action } = this;\n switch (action) {\n case \"show\":\n case \"hide\":\n case \"toggle\":\n this[action]();\n }\n }\n\n show(): void {\n this.toggle(true);\n }\n\n hide(): void {\n this.toggle(false);\n }\n\n toggle(force?: boolean): void {\n this.open = force ?? !this.open;\n }\n\n protected updated(_changedProperties: PropertyValues): void {\n if (_changedProperties.has(\"open\")) {\n this._openChange();\n }\n }\n\n protected _openChange(): void {\n const { open } = this;\n if (open) {\n showPopover.call(this, this._popover);\n const listener = (e) => {\n if (!this.contains(e.target)) {\n this.events.remove(document, \"click\", listener);\n this.open = false;\n }\n };\n this.events.add(document, \"click\", listener);\n } else {\n hidePopover(this._popover);\n }\n this.dispatchCustomEvent(\"toggle\", open);\n }\n\n resolveArea(): string {\n const split = this.position.split(\"-\");\n const firstValue = this.span === \"spread\" ? `span-${split[0]}` : split[0];\n if (split.length < 2) {\n return `${firstValue} center`;\n }\n const secondValue = this.span === \"isolated\" ? split[1] : `span-${split[1]}`;\n return `${firstValue} ${secondValue}`;\n }\n}\n\nexport { Popover, Popover as default };\n"],"version":3,"file":"component.d.ts"}
@@ -1,3 +1,3 @@
1
- import{property,query}from"lit/decorators.js";import{GlobalStyle}from"../../internal/global-style.js";import{css,html}from"lit";import{godown,styles,StyleController,htmlSlot}from"@godown/element";import{showPopover,hidePopover}from"../../internal/popover.js";import _decorate from"@oxc-project/runtime/helpers/decorate";import"../../internal/reset-style.js";import"sharekit";import"../../internal/utils.js";const POPOVER=`popover`,protoName=POPOVER;let Popover=class e extends GlobalStyle{constructor(){super(),this.anchorName=`--${POPOVER}-${Math.random().toString(36).slice(2)}`,this.open=!1,this.action=`show`,this.span=`span`,this.position=`bottom`,new StyleController(this,()=>({"[part=root],slot:not([name])::slotted(*)":{"anchor-name":this.anchorName},"[part=popover]":{"position-anchor":this.anchorName,"position-area":this.resolveArea()}}))}render(){return html`<div part="root"> <div part="trigger" @click=${this._handleClick}> ${htmlSlot()} </div> <div part="popover" popover="manual"> ${htmlSlot(`popover`)} </div> </div>`}_handleClick(){let{action:e}=this;switch(e){case`show`:case`hide`:case`toggle`:this[e]()}}show(){this.toggle(!0)}hide(){this.toggle(!1)}toggle(e){this.open=e??!this.open}updated(e){e.has(`open`)&&this._openChange()}_openChange(){let{open:e}=this;if(e){showPopover.call(this,this._popover);let e=p=>{this.contains(p.target)||(this.events.remove(document,`click`,e),this.open=!1)};this.events.add(document,`click`,e)}else hidePopover(this._popover);this.dispatchCustomEvent(`toggle`,e)}resolveArea(){let e=this.position.split(`-`),p=this.span===`spread`?`span-${e[0]}`:e[0];if(e.length<2)return`${p} center`;let m=this.span===`isolated`?e[1]:`span-${e[1]}`;return`${p} ${m}`}};_decorate([property({type:Boolean,reflect:!0})],Popover.prototype,`open`,void 0),_decorate([property()],Popover.prototype,`action`,void 0),_decorate([property()],Popover.prototype,`span`,void 0),_decorate([property()],Popover.prototype,`position`,void 0),_decorate([query(`[part=${POPOVER}]`,!0)],Popover.prototype,`_popover`,void 0),Popover=_decorate([godown(protoName),styles(css`:host{display:inline-block}[part=trigger]{display:contents}[part=root]{display:inherit}[part=popover]{inset:unset;z-index:1;overflow:visible;position:absolute;position-try-fallbacks:flip-block}
2
- `)],Popover);export{Popover,Popover as default};
1
+ import{property as e,query as t}from"lit/decorators.js";import{GlobalStyle as n}from"../../internal/global-style.js";import{css as r,html as i}from"lit";import{godown as a,styles as o,StyleController as s,htmlSlot as c}from"@godown/element";import{showPopover as l,hidePopover as u}from"../../internal/popover.js";import d from"@oxc-project/runtime/helpers/decorate";const f=`popover`,p=f;let m=class e extends n{constructor(){super(),this.anchorName=`--${f}-${Math.random().toString(36).slice(2)}`,this.open=!1,this.action=`show`,this.span=`span`,this.position=`bottom`,new s(this,()=>({"[part=root],slot:not([name])::slotted(*)":{"anchor-name":this.anchorName},"[part=popover]":{"position-anchor":this.anchorName,"position-area":this.resolveArea()}}))}render(){return i`<div part="root"> <div part="trigger" @click=${this._handleClick}> ${c()} </div> <div part="popover" popover="manual"> ${c(`popover`)} </div> </div>`}_handleClick(){let{action:e}=this;switch(e){case`show`:case`hide`:case`toggle`:this[e]()}}show(){this.toggle(!0)}hide(){this.toggle(!1)}toggle(e){this.open=e??!this.open}updated(e){e.has(`open`)&&this._openChange()}_openChange(){let{open:e}=this;if(e){l.call(this,this._popover);let e=t=>{this.contains(t.target)||(this.events.remove(document,`click`,e),this.open=!1)};this.events.add(document,`click`,e)}else u(this._popover);this.dispatchCustomEvent(`toggle`,e)}resolveArea(){let e=this.position.split(`-`),t=this.span===`spread`?`span-${e[0]}`:e[0];if(e.length<2)return`${t} center`;let n=this.span===`isolated`?e[1]:`span-${e[1]}`;return`${t} ${n}`}};d([e({type:Boolean,reflect:!0})],m.prototype,`open`,void 0),d([e()],m.prototype,`action`,void 0),d([e()],m.prototype,`span`,void 0),d([e()],m.prototype,`position`,void 0),d([t(`[part=${f}]`,!0)],m.prototype,`_popover`,void 0),m=d([a(`popover`),o(r`:host{display:inline-block}[part=trigger]{display:contents}[part=root]{display:inherit}[part=popover]{inset:unset;z-index:1;overflow:visible;position:absolute;position-try-fallbacks:flip-block}
2
+ `)],m);export{m as Popover,m as default};
3
3
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/web-components/popover/component.ts"],"sourcesContent":["import { property, query } from \"lit/decorators.js\";\nimport GlobalStyle from \"../../internal/global-style.js\";\nimport { css, html, type PropertyValues, type TemplateResult } from \"lit\";\nimport { godown, htmlSlot, StyleController, styles } from \"@godown/element\";\nimport { hidePopover, showPopover } from \"../../internal/popover.js\";\n\nconst POPOVER = \"popover\";\nconst protoName = POPOVER;\n\n/**\n * {@link Popover} renders a popover.\n *\n * This requires the support of the popover API and CSS position-area.\n *\n * @fires toggle - Fired when the popover is toggled.\n * @slot popover - Popover content.\n * @slot - Popover trigger.\n * @category display\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: inline-block;\n }\n\n [part=\"trigger\"] {\n display: contents;\n }\n\n [part=\"root\"] {\n display: inherit;\n }\n\n [part=\"popover\"] {\n inset: unset;\n z-index: 1;\n overflow: visible;\n position: absolute;\n position-try-fallbacks: flip-block;\n }\n`)\nclass Popover extends GlobalStyle {\n anchorName = `--${POPOVER}-${Math.random().toString(36).slice(2)}`;\n\n @property({ type: Boolean, reflect: true })\n open = false;\n\n @property()\n action: \"hide\" | \"show\" | \"toggle\" | \"none\" = \"show\";\n\n @property()\n span: \"span\" | \"spread\" | \"isolated\" = \"span\";\n\n /**\n * The position refers to the spatial location of the popover in relation to the trigger,\n * rather than the alignment property between them.\n */\n @property()\n position:\n | \"center\"\n | \"left\"\n | \"left-top\"\n | \"left-bottom\"\n | \"right\"\n | \"right-top\"\n | \"right-bottom\"\n | \"top\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"start\"\n | \"start-start\"\n | \"start-end\"\n | \"end\"\n | \"end-start\"\n | \"end-end\" = \"bottom\";\n\n @query(`[part=${POPOVER}]`, true)\n protected _popover: HTMLElement;\n\n constructor() {\n super();\n new StyleController(this, () => {\n return {\n \"[part=root],slot:not([name])::slotted(*)\": {\n \"anchor-name\": this.anchorName,\n },\n \"[part=popover]\": {\n \"position-anchor\": this.anchorName,\n \"position-area\": this.resolveArea(),\n },\n };\n });\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <div part=\"root\">\n <div\n part=\"trigger\"\n @click=${this._handleClick}\n >\n ${htmlSlot()}\n </div>\n <div\n part=\"popover\"\n popover=\"manual\"\n >\n ${htmlSlot(\"popover\")}\n </div>\n </div>\n `;\n }\n\n protected _handleClick(): void {\n const { action } = this;\n switch (action) {\n case \"show\":\n case \"hide\":\n case \"toggle\":\n this[action]();\n }\n }\n\n show(): void {\n this.toggle(true);\n }\n\n hide(): void {\n this.toggle(false);\n }\n\n toggle(force?: boolean): void {\n this.open = force ?? !this.open;\n }\n\n protected updated(_changedProperties: PropertyValues): void {\n if (_changedProperties.has(\"open\")) {\n this._openChange();\n }\n }\n\n protected _openChange(): void {\n const { open } = this;\n if (open) {\n showPopover.call(this, this._popover);\n const listener = (e) => {\n if (!this.contains(e.target)) {\n this.events.remove(document, \"click\", listener);\n this.open = false;\n }\n };\n this.events.add(document, \"click\", listener);\n } else {\n hidePopover(this._popover);\n }\n this.dispatchCustomEvent(\"toggle\", open);\n }\n\n resolveArea(): string {\n const split = this.position.split(\"-\");\n const firstValue = this.span === \"spread\" ? `span-${split[0]}` : split[0];\n if (split.length < 2) {\n return `${firstValue} center`;\n }\n const secondValue = this.span === \"isolated\" ? split[1] : `span-${split[1]}`;\n return `${firstValue} ${secondValue}`;\n }\n}\n\nexport { Popover, Popover as default };\n"],"names":["Popover","action","force?: boolean","force","_changedProperties: PropertyValues","_changedProperties","open","listener","e","split","firstValue","secondValue"],"mappings":"uZAMA,MAAM,QAAU,UACV,UAAY,QAYlB,IAAA,QAAA,MAsBMA,UAAgB,WAAY,CAyChC,aAAc,CACZ,OAAO,CAzCT,KAAA,WAAa,CAAC,EAAE,EAAE,QAAQ,CAAC,EAAE,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,MAAM,EAAE,EAAE,MAGlE,KAAO,QAGP,OAA8C,YAG9C,KAAuC,YAOvC,SAmBgB,SAOd,IAAI,gBAAgB,KAAM,KACjB,CACL,2CAA4C,CAC1C,cAAe,KAAK,UACrB,EACD,iBAAkB,CAChB,kBAAmB,KAAK,WACxB,gBAAiB,KAAK,aAAA,AACvB,CACF,GAEJ,CAES,QAA4B,CACpC,MAAO,KAAI,CAAA,6CAIE,EAAE,KAAK,aAAA,EAEd,EAAE,UAAU,CAAA,8CAMZ,EAAE,SAAS,UAAU,CAAA,cAG3B,CAAC,AACF,CAES,cAAqB,CAC7B,GAAM,CAAE,SAAQ,CAAG,KACnB,OAAQC,EAAR,CACE,IAAK,OACL,IAAK,OACL,IAAK,SACH,KAAKA,IAAS,AACjB,CACF,CAED,MAAa,CACX,KAAK,OAAO,GAAK,AAClB,CAED,MAAa,CACX,KAAK,OAAO,GAAM,AACnB,CAED,OAAOC,EAAuB,CAC5B,KAAK,KAAOC,GAAS,CAAC,KAAK,IAC5B,CAES,QAAQC,EAA0C,CACtDC,EAAmB,IAAI,OAAO,EAChC,KAAK,aAAa,AAErB,CAES,aAAoB,CAC5B,GAAM,CAAE,OAAM,CAAG,KACjB,GAAIC,EAAM,CACR,YAAY,KAAK,KAAM,KAAK,SAAS,CACrC,IAAMC,EAAW,AAACC,GAAM,CACjB,KAAK,SAASA,EAAE,OAAO,GAC1B,KAAK,OAAO,OAAO,SAAU,QAASD,EAAS,CAC/C,KAAK,KAAO,GAEf,EACD,KAAK,OAAO,IAAI,SAAU,QAASA,EAAS,AAC7C,MACC,YAAY,KAAK,SAAS,CAE5B,KAAK,oBAAoB,SAAUD,EAAK,AACzC,CAED,aAAsB,CACpB,IAAMG,EAAQ,KAAK,SAAS,MAAM,IAAI,CAChCC,EAAa,KAAK,OAAS,SAAW,CAAC,KAAK,EAAED,EAAM,IAAI,CAAGA,EAAM,GACvE,GAAIA,EAAM,OAAS,EACjB,MAAO,GAAGC,EAAW,OAAO,CAAC,CAE/B,IAAMC,EAAc,KAAK,OAAS,WAAaF,EAAM,GAAK,CAAC,KAAK,EAAEA,EAAM,IAAI,CAC5E,MAAO,GAAGC,EAAW,CAAC,EAAEC,GAAa,AACtC,CACF,aA9HE,SAAS,CAAE,KAAM,QAAS,QAAS,EAAM,EAAC,AAAA,EAAA,QAAA,UAAA,OAAA,IAAA,GAAA,YAG1C,UAAU,AAAA,EAAA,QAAA,UAAA,SAAA,OAAA,YAGV,UAAU,AAAA,EAAA,QAAA,UAAA,OAAA,OAAA,YAOV,UAAU,AAAA,EAAA,QAAA,UAAA,WAAA,OAAA,CAsBV,UAAA,CAAA,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAE,GAAK,AAAA,EAAA,QAAA,UAAA,WAAA,IAAA,GAAA,CA5DlC,QAAA,UAAA,CAAA,OAAO,UAAU,CACjB,OAAO,GAAG,CAAC;AAoBZ,CAAC,CAAC,AAAA,EAAA,QAAA"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/web-components/popover/component.ts"],"sourcesContent":["import { property, query } from \"lit/decorators.js\";\nimport GlobalStyle from \"../../internal/global-style.js\";\nimport { css, html, type PropertyValues, type TemplateResult } from \"lit\";\nimport { godown, htmlSlot, StyleController, styles } from \"@godown/element\";\nimport { hidePopover, showPopover } from \"../../internal/popover.js\";\n\nconst POPOVER = \"popover\";\nconst protoName = POPOVER;\n\n/**\n * {@link Popover} renders a popover.\n *\n * This requires the support of the popover API and CSS position-area.\n *\n * @fires toggle - Fired when the popover is toggled.\n * @slot popover - Popover content.\n * @slot - Popover trigger.\n * @category display\n */\n@godown(protoName)\n@styles(css`\n :host {\n display: inline-block;\n }\n\n [part=\"trigger\"] {\n display: contents;\n }\n\n [part=\"root\"] {\n display: inherit;\n }\n\n [part=\"popover\"] {\n inset: unset;\n z-index: 1;\n overflow: visible;\n position: absolute;\n position-try-fallbacks: flip-block;\n }\n`)\nclass Popover extends GlobalStyle {\n anchorName = `--${POPOVER}-${Math.random().toString(36).slice(2)}`;\n\n @property({ type: Boolean, reflect: true })\n open = false;\n\n @property()\n action: \"hide\" | \"show\" | \"toggle\" | \"none\" = \"show\";\n\n @property()\n span: \"span\" | \"spread\" | \"isolated\" = \"span\";\n\n /**\n * The position refers to the spatial location of the popover in relation to the trigger,\n * rather than the alignment property between them.\n */\n @property()\n position:\n | \"center\"\n | \"left\"\n | \"left-top\"\n | \"left-bottom\"\n | \"right\"\n | \"right-top\"\n | \"right-bottom\"\n | \"top\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"start\"\n | \"start-start\"\n | \"start-end\"\n | \"end\"\n | \"end-start\"\n | \"end-end\" = \"bottom\";\n\n @query(`[part=${POPOVER}]`, true)\n protected _popover: HTMLElement;\n\n constructor() {\n super();\n new StyleController(this, () => {\n return {\n \"[part=root],slot:not([name])::slotted(*)\": {\n \"anchor-name\": this.anchorName,\n },\n \"[part=popover]\": {\n \"position-anchor\": this.anchorName,\n \"position-area\": this.resolveArea(),\n },\n };\n });\n }\n\n protected render(): TemplateResult<1> {\n return html`\n <div part=\"root\">\n <div\n part=\"trigger\"\n @click=${this._handleClick}\n >\n ${htmlSlot()}\n </div>\n <div\n part=\"popover\"\n popover=\"manual\"\n >\n ${htmlSlot(\"popover\")}\n </div>\n </div>\n `;\n }\n\n protected _handleClick(): void {\n const { action } = this;\n switch (action) {\n case \"show\":\n case \"hide\":\n case \"toggle\":\n this[action]();\n }\n }\n\n show(): void {\n this.toggle(true);\n }\n\n hide(): void {\n this.toggle(false);\n }\n\n toggle(force?: boolean): void {\n this.open = force ?? !this.open;\n }\n\n protected updated(_changedProperties: PropertyValues): void {\n if (_changedProperties.has(\"open\")) {\n this._openChange();\n }\n }\n\n protected _openChange(): void {\n const { open } = this;\n if (open) {\n showPopover.call(this, this._popover);\n const listener = (e) => {\n if (!this.contains(e.target)) {\n this.events.remove(document, \"click\", listener);\n this.open = false;\n }\n };\n this.events.add(document, \"click\", listener);\n } else {\n hidePopover(this._popover);\n }\n this.dispatchCustomEvent(\"toggle\", open);\n }\n\n resolveArea(): string {\n const split = this.position.split(\"-\");\n const firstValue = this.span === \"spread\" ? `span-${split[0]}` : split[0];\n if (split.length < 2) {\n return `${firstValue} center`;\n }\n const secondValue = this.span === \"isolated\" ? split[1] : `span-${split[1]}`;\n return `${firstValue} ${secondValue}`;\n }\n}\n\nexport { Popover, Popover as default };\n"],"names":["POPOVER","protoName","Popover","GlobalStyle","StyleController","htmlSlot","action","force","_changedProperties","open","showPopover","listener","e","hidePopover","split","firstValue","secondValue","property","_decorate","query","godown","styles"],"mappings":"+WAMA,MAAMA,EAAU,UACVC,EAAYD,EAYlB,IAAAE,EAAA,MAsBMA,UAAgBC,CAAY,CAyChC,aAAc,CACZ,QAzCF,KAAA,WAAa,KAAKH,EAAQ,GAAG,KAAK,SAAS,SAAS,IAAI,MAAM,UAG9D,KAAO,QAGP,OAA8C,YAG9C,KAAuC,YAOvC,SAmBgB,SAOd,IAAII,EAAgB,UACX,CACL,2CAA4C,CAC1C,cAAe,KAAK,YAEtB,iBAAkB,CAChB,kBAAmB,KAAK,WACxB,gBAAiB,KAAK,kBAMpB,QAA4B,CACpC,MAAO,EAAI,gDAII,KAAK,aAAA,IAEZC,IAAA,gDAMAA,EAAS,WAAA,gBAMT,cAAqB,CAC7B,GAAM,CAAE,UAAW,KACnB,OAAQC,EAAR,CACE,IAAK,OACL,IAAK,OACL,IAAK,SACH,KAAKA,MAIX,MAAa,CACX,KAAK,OAAO,IAGd,MAAa,CACX,KAAK,OAAO,IAGd,OAAO,EAAuB,CAC5B,KAAK,KAAOC,GAAS,CAAC,KAAK,KAGnB,QAAQ,EAA0C,CACtDC,EAAmB,IAAI,SACzB,KAAK,cAIC,aAAoB,CAC5B,GAAM,CAAE,QAAS,KACjB,GAAIC,EAAM,CACRC,EAAY,KAAK,KAAM,KAAK,UAC5B,IAAMC,EAAY,GAAM,CACjB,KAAK,SAASC,EAAE,UACnB,KAAK,OAAO,OAAO,SAAU,QAASD,GACtC,KAAK,KAAO,KAGhB,KAAK,OAAO,IAAI,SAAU,QAASA,QAEnCE,EAAY,KAAK,UAEnB,KAAK,oBAAoB,SAAUJ,GAGrC,aAAsB,CACpB,IAAMK,EAAQ,KAAK,SAAS,MAAM,KAC5BC,EAAa,KAAK,OAAS,SAAW,QAAQD,EAAM,KAAOA,EAAM,GACvE,GAAIA,EAAM,OAAS,EACjB,MAAO,GAAGC,EAAW,SAEvB,IAAMC,EAAc,KAAK,OAAS,WAAaF,EAAM,GAAK,QAAQA,EAAM,KACxE,MAAO,GAAGC,EAAW,GAAGC,SA5HzBC,EAAS,CAAE,KAAM,QAAS,QAAS,iCAGnCC,EAAA,CAAAD,KAAAf,EAAA,UAAA,SAAA,QAGAgB,EAAA,CAAAD,KAAAf,EAAA,UAAA,OAAA,QAOAgB,EAAA,CAAAD,KAAAf,EAAA,UAAA,WAAA,WAsBAiB,EAAM,SAASnB,EAAQ,GAAI,KAAAE,EAAA,UAAA,WAAA,IAAA,SA5D7BkB,EAAO,WACPC,EAAO,CAAG;"}
@@ -1 +1 @@
1
- {"mappings":"AAAA,OAAO,aAAa,gBAAiB;AAIrC,eAAe;eAEA;WACH,sBAAsB;EAC9B,kBAAkB;CACnB;AACF","names":[],"sources":["../../../../src/web-components/popover/definition.ts"],"sourcesContent":["import Popover from \"./component.js\";\n\nPopover.define();\n\nexport default Popover;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-popover\": Popover;\n }\n}\n"],"version":3,"file":"definition.d.ts"}
1
+ {"mappings":"AAAA,OAAO,aAAa;AAIpB,eAAe;eAEA;WACH,sBAAsB;EAC9B,kBAAkB","names":[],"sources":["../../../../src/web-components/popover/definition.ts"],"sourcesContent":["import Popover from \"./component.js\";\n\nPopover.define();\n\nexport default Popover;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"godown-popover\": Popover;\n }\n}\n"],"version":3,"file":"definition.d.ts"}