godown 2.7.0 → 2.7.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 (58) hide show
  1. package/lib/templates.d.ts +2 -0
  2. package/lib/templates.d.ts.map +1 -1
  3. package/lib/templates.js +4 -0
  4. package/lib/templates.js.map +1 -1
  5. package/naming.d.ts +1 -1
  6. package/naming.js +1 -1
  7. package/naming.js.map +1 -1
  8. package/package.json +1 -1
  9. package/supers/anchor.d.ts +6 -1
  10. package/supers/anchor.d.ts.map +1 -1
  11. package/supers/anchor.js +17 -2
  12. package/supers/anchor.js.map +1 -1
  13. package/web-components/button/button.d.ts +0 -4
  14. package/web-components/button/button.d.ts.map +1 -1
  15. package/web-components/button/button.js +2 -27
  16. package/web-components/button/button.js.map +1 -1
  17. package/web-components/card/card.d.ts +1 -1
  18. package/web-components/card/card.js.map +1 -1
  19. package/web-components/carousel/carousel.d.ts +1 -0
  20. package/web-components/carousel/carousel.d.ts.map +1 -1
  21. package/web-components/carousel/carousel.js.map +1 -1
  22. package/web-components/dialog/dialog.d.ts +1 -0
  23. package/web-components/dialog/dialog.d.ts.map +1 -1
  24. package/web-components/dialog/dialog.js.map +1 -1
  25. package/web-components/layout/divider.d.ts +1 -0
  26. package/web-components/layout/divider.d.ts.map +1 -1
  27. package/web-components/layout/divider.js.map +1 -1
  28. package/web-components/progress/progress.d.ts +1 -0
  29. package/web-components/progress/progress.d.ts.map +1 -1
  30. package/web-components/progress/progress.js.map +1 -1
  31. package/web-components/router/router-a.d.ts +2 -11
  32. package/web-components/router/router-a.d.ts.map +1 -1
  33. package/web-components/router/router-a.js +15 -26
  34. package/web-components/router/router-a.js.map +1 -1
  35. package/web-components/router/router.d.ts +1 -1
  36. package/web-components/router/router.d.ts.map +1 -1
  37. package/web-components/router/router.js.map +1 -1
  38. package/web-components/text/clip.d.ts +1 -0
  39. package/web-components/text/clip.d.ts.map +1 -1
  40. package/web-components/text/clip.js.map +1 -1
  41. package/web-components/text/overbreath.d.ts +2 -1
  42. package/web-components/text/overbreath.d.ts.map +1 -1
  43. package/web-components/text/overbreath.js +1 -1
  44. package/web-components/text/overbreath.js.map +1 -1
  45. package/web-components/text/time.d.ts +17 -11
  46. package/web-components/text/time.d.ts.map +1 -1
  47. package/web-components/text/time.js +35 -19
  48. package/web-components/text/time.js.map +1 -1
  49. package/web-components/text/typewriter.d.ts +2 -1
  50. package/web-components/text/typewriter.d.ts.map +1 -1
  51. package/web-components/text/typewriter.js +1 -1
  52. package/web-components/text/typewriter.js.map +1 -1
  53. package/web-components/tooltip/tooltip.d.ts +2 -1
  54. package/web-components/tooltip/tooltip.d.ts.map +1 -1
  55. package/web-components/tooltip/tooltip.js.map +1 -1
  56. package/web-components/wrapper/wrapper.d.ts +1 -0
  57. package/web-components/wrapper/wrapper.d.ts.map +1 -1
  58. package/web-components/wrapper/wrapper.js.map +1 -1
@@ -22,6 +22,7 @@ export declare const svgX: () => import("lit").TemplateResult<1>;
22
22
  export declare const svgImage: () => import("lit").TemplateResult<1>;
23
23
  export declare const svgSun: () => import("lit").TemplateResult<1>;
24
24
  export declare const svgMoon: (star?: boolean) => import("lit").TemplateResult<1>;
25
+ export declare const svgLink: () => import("lit").TemplateResult<1>;
25
26
  export declare const icons: {
26
27
  delta: () => import("lit").TemplateResult<1>;
27
28
  "delta-smooth": () => import("lit").TemplateResult<1>;
@@ -34,6 +35,7 @@ export declare const icons: {
34
35
  moon: (star?: boolean) => import("lit").TemplateResult<1>;
35
36
  "moon-star": () => import("lit").TemplateResult<1>;
36
37
  sun: () => import("lit").TemplateResult<1>;
38
+ link: () => import("lit").TemplateResult<1>;
37
39
  };
38
40
  export {};
39
41
  //# sourceMappingURL=templates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"templates.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["lib/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAO,MAAM,KAAK,CAAC;AAE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AO,MAAM,IAAI,UAAU,MAAM,GAAG,IAAI,GAAG,MAAM,WAA2B,MAAM,GAAG,IAAI,GAAG,MAAM,gBAAgC,MAAM,GAAG,IAAI,GAAG,MAAM,SAG3I,MAAM,oCAGlB,CAAC;AAEF,UAAU,QAAQ;IAChB,IAAI,YAAY,CAAC;IACjB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC;IAC7B,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,GAAG,CAAC,GAAG,YAAY,CAAC;CACpE;AAED,eAAO,MAAM,QAAQ,UAQP,CAAC;AAEf,eAAO,MAAM,SAAS,QAAS,MAAM,oCAMpC,CAAC;AAIF,eAAO,MAAM,QAAQ,uCAEpB,CAAC;AAEF,eAAO,MAAM,cAAc,uCAE1B,CAAC;AAEF,eAAO,MAAM,QAAQ,UAAW,OAAO,oCAGtC,CAAC;AAEF,eAAO,MAAM,SAAS,uCAErB,CAAC;AAEF,eAAO,MAAM,MAAM,uCAElB,CAAC;AAEF,eAAO,MAAM,IAAI,uCAEhB,CAAC;AAEF,eAAO,MAAM,QAAQ,uCAEpB,CAAC;AAEF,eAAO,MAAM,MAAM,uCAElB,CAAC;AAEF,eAAO,MAAM,OAAO,UAAW,OAAO,oCAErC,CAAC;AAEF,eAAO,MAAM,OAAO,uCAEnB,CAAC;AAEF,eAAO,MAAM,KAAK;;;mBAjCc,OAAO;;;;;;kBAyBR,OAAO;;;;CAqBrC,CAAC"}
package/lib/templates.js CHANGED
@@ -56,6 +56,9 @@ export const svgSun = () => {
56
56
  export const svgMoon = (star) => {
57
57
  return html `<svg viewBox="0 0 16 16">${path(undefined, 0)("M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278zM4.858 1.311A7.269 7.269 0 0 0 1.025 7.71c0 4.02 3.279 7.276 7.319 7.276a7.316 7.316 0 0 0 5.205-2.162c-.337.042-.68.063-1.029.063-4.61 0-8.343-3.714-8.343-8.29 0-1.167.242-2.278.681-3.286z")} ${star && path(undefined, 0)("M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.734 1.734 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.734 1.734 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.734 1.734 0 0 0 1.097-1.097l.387-1.162zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z")}</svg>`;
58
58
  };
59
+ export const svgLink = () => {
60
+ return html `<svg viewBox="0 0 48 48" fill="none">${path(0)("M28 6H42V20")}${path(0)("M42 29.4737V39C42 40.6569 40.6569 42 39 42H9C7.34315 42 6 40.6569 6 39V9C6 7.34315 7.34315 6 9 6L18 6")}${path()("M25.7998 22.1999L41.0998 6.8999")}</svg>`;
61
+ };
59
62
  export const icons = {
60
63
  delta: svgDelta,
61
64
  "delta-smooth": svgDeltaSmooth,
@@ -68,5 +71,6 @@ export const icons = {
68
71
  moon: svgMoon,
69
72
  "moon-star": () => svgMoon(true),
70
73
  sun: svgSun,
74
+ link: svgLink,
71
75
  };
72
76
  //# sourceMappingURL=templates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"templates.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["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BAA4B,IAAI,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,mqBAAmqB,CAAC,QAAQ,CAAC;AAC5uB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAc,EAAE,EAAE;IACxC,OAAO,IAAI,CAAA,4BAA4B,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,ycAAyc,CAAC,IAAI,IAAI,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,ulBAAulB,CAAC,QAAQ,CAAC;AACtoC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,KAAK,EAAE,QAAQ;IACf,cAAc,EAAE,cAAc;IAC9B,KAAK,EAAE,QAAQ;IACf,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;IAClC,MAAM,EAAE,SAAS;IACjB,GAAG,EAAE,MAAM;IACX,CAAC,EAAE,IAAI;IACP,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAChC,GAAG,EAAE,MAAM;CACZ,CAAC","sourcesContent":["import { html, svg } from \"lit\";\n\nexport type HTMLTemplate = ReturnType<typeof html>;\n\n/**\n * @param fill undefined: \"currentColor\". zero value: \"none\".\n * @param stroke undefined: \"currentColor\". zero value: \"none\".\n * @returns Function returns path needs d.\n */\nexport const path = (fill: string | void | number = \"currentColor\", stroke: string | void | number = \"currentColor\", strokeWidth: string | void | number = 3) => {\n fill = fill || \"none\";\n stroke = stroke || \"none\";\n return (d: string) => {\n return svg`<path d=\"${d}\" fill=\"${fill}\" stroke=\"${stroke}\" stroke-width=\"${strokeWidth}\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>`;\n };\n};\n\ninterface HtmlSlot {\n (): HTMLTemplate;\n (name: string): HTMLTemplate;\n <T>(name: string, feedback: T, node: ParentNode): T | HTMLTemplate;\n}\n\nexport const htmlSlot = (<T>(name: string, fallback: T, node: ParentNode) => {\n if (name) {\n if (fallback && node && !node.querySelector(`[slot=${name}]`)) {\n return fallback;\n }\n return html`<slot name=\"${name}\"></slot>`;\n }\n return html`<slot></slot>`;\n}) as HtmlSlot;\n\nexport const htmlStyle = (css: string) => {\n if (css) {\n return html`<style>\n ${css}\n </style>`;\n }\n};\n\n// SVG ICONS.\n\nexport const svgDelta = () => {\n return html`<svg viewBox=\"0 0 48 48\" fill=\"none\">${path()(\"M36 19L24 31L12 19H36Z\")}</svg>`;\n};\n\nexport const svgDeltaSmooth = () => {\n return html`<svg viewBox=\"0 0 16 16\" fill=\"currentColor\">${path(undefined, 0)(\"m3.86 8.753 5.482 4.796c.646.566 1.658.106 1.658-.753V3.204a1 1 0 0 0-1.659-.753l-5.48 4.796a1 1 0 0 0 0 1.506z\")}</svg>`;\n};\n\nexport const svgArrow = (body?: boolean) => {\n const d = body ? \"M24 12L36 24L24 36\" : \"M19 12L31 24L19 36\";\n return html`<svg viewBox=\"0 0 48 48\" fill=\"none\">${body && path()(\"M36 24.0083H12\")} ${path(\"none\")(d)}</svg>`;\n};\n\nexport const svgSearch = () => {\n return html`<svg viewBox=\"0 0 1024 1024\">${path()(\"M745.429333 655.658667c1.173333 0.746667 2.325333 1.578667 3.413334 2.496l114.410666 96a32 32 0 0 1-41.152 49.024l-114.389333-96a32 32 0 0 1-6.208-6.976A297.429333 297.429333 0 0 1 512 768c-164.949333 0-298.666667-133.717333-298.666667-298.666667S347.050667 170.666667 512 170.666667s298.666667 133.717333 298.666667 298.666666a297.386667 297.386667 0 0 1-65.237334 186.325334zM512 704c129.6 0 234.666667-105.066667 234.666667-234.666667s-105.066667-234.666667-234.666667-234.666666-234.666667 105.066667-234.666667 234.666666 105.066667 234.666667 234.666667 234.666667z\")}</svg>`;\n};\n\nexport const svgEye = () => {\n return html`<svg viewBox=\"0 0 48 48\">${path(0)(\"M9.85786 18C6.23858 21 4 24 4 24C4 24 12.9543 36 24 36C25.3699 36 26.7076 35.8154 28 35.4921M20.0318 12.5C21.3144 12.1816 22.6414 12 24 12C35.0457 12 44 24 44 24C44 24 41.7614 27 38.1421 30\")} ${path(0)(\"M20.3142 20.6211C19.4981 21.5109 19 22.6972 19 23.9998C19 26.7612 21.2386 28.9998 24 28.9998C25.3627 28.9998 26.5981 28.4546 27.5 27.5705\")} ${path()(\"M42 42L6 6\")}</svg>`;\n};\n\nexport const svgX = () => {\n return html`<svg viewBox=\"0 0 48 48\" fill=\"none\">${path()(\"M14 14L34 34\")} ${path()(\"M14 34L34 14\")}</svg>`;\n};\n\nexport const svgImage = () => {\n return html`<svg viewBox=\"0 0 1098 1024\">${path(undefined, 0)(\"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z\")}</svg>`;\n};\n\nexport const svgSun = () => {\n return html`<svg viewBox=\"0 0 16 16\">${path(undefined, 0, 1)(\"M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z\")}</svg>`;\n};\n\nexport const svgMoon = (star?: boolean) => {\n return html`<svg viewBox=\"0 0 16 16\">${path(undefined, 0)(\"M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278zM4.858 1.311A7.269 7.269 0 0 0 1.025 7.71c0 4.02 3.279 7.276 7.319 7.276a7.316 7.316 0 0 0 5.205-2.162c-.337.042-.68.063-1.029.063-4.61 0-8.343-3.714-8.343-8.29 0-1.167.242-2.278.681-3.286z\")} ${star && path(undefined, 0)(\"M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.734 1.734 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.734 1.734 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.734 1.734 0 0 0 1.097-1.097l.387-1.162zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z\")}</svg>`;\n};\n\nexport const icons = {\n delta: svgDelta,\n \"delta-smooth\": svgDeltaSmooth,\n arrow: svgArrow,\n \"arrow-body\": () => svgArrow(true),\n search: svgSearch,\n eye: svgEye,\n x: svgX,\n image: svgImage,\n moon: svgMoon,\n \"moon-star\": () => svgMoon(true),\n sun: svgSun,\n};\n"]}
1
+ {"version":3,"file":"templates.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["lib/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAIhC;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,OAA+B,cAAc,EAAE,SAAiC,cAAc,EAAE,cAAsC,CAAC,EAAE,EAAE;IAC9J,IAAI,GAAG,IAAI,IAAI,MAAM,CAAC;IACtB,MAAM,GAAG,MAAM,IAAI,MAAM,CAAC;IAC1B,OAAO,CAAC,CAAS,EAAE,EAAE;QACnB,OAAO,GAAG,CAAA,YAAY,CAAC,WAAW,IAAI,aAAa,MAAM,mBAAmB,WAAW,0DAA0D,CAAC;IACpJ,CAAC,CAAC;AACJ,CAAC,CAAC;AAQF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAI,IAAY,EAAE,QAAW,EAAE,IAAgB,EAAE,EAAE;IAC1E,IAAI,IAAI,EAAE,CAAC;QACT,IAAI,QAAQ,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,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AG;IACnB,KAAK,EAAE,QAAQ;IACf,cAAc,EAAE,cAAc;IAC9B,KAAK,EAAE,QAAQ;IACf,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;IAClC,MAAM,EAAE,SAAS;IACjB,GAAG,EAAE,MAAM;IACX,CAAC,EAAE,IAAI;IACP,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAChC,GAAG,EAAE,MAAM;IACX,IAAI,EAAE,OAAO;CACd,CAAC","sourcesContent":["import { html, svg } from \"lit\";\n\nexport type HTMLTemplate = ReturnType<typeof html>;\n\n/**\n * @param fill undefined: \"currentColor\". zero value: \"none\".\n * @param stroke undefined: \"currentColor\". zero value: \"none\".\n * @returns Function returns path needs d.\n */\nexport const path = (fill: string | void | number = \"currentColor\", stroke: string | void | number = \"currentColor\", strokeWidth: string | void | number = 3) => {\n fill = fill || \"none\";\n stroke = stroke || \"none\";\n return (d: string) => {\n return svg`<path d=\"${d}\" fill=\"${fill}\" stroke=\"${stroke}\" stroke-width=\"${strokeWidth}\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>`;\n };\n};\n\ninterface HtmlSlot {\n (): HTMLTemplate;\n (name: string): HTMLTemplate;\n <T>(name: string, feedback: T, node: ParentNode): T | HTMLTemplate;\n}\n\nexport const htmlSlot = (<T>(name: string, fallback: T, node: ParentNode) => {\n if (name) {\n if (fallback && node && !node.querySelector(`[slot=${name}]`)) {\n return fallback;\n }\n return html`<slot name=\"${name}\"></slot>`;\n }\n return html`<slot></slot>`;\n}) as HtmlSlot;\n\nexport const htmlStyle = (css: string) => {\n if (css) {\n return html`<style>\n ${css}\n </style>`;\n }\n};\n\n// SVG ICONS.\n\nexport const svgDelta = () => {\n return html`<svg viewBox=\"0 0 48 48\" fill=\"none\">${path()(\"M36 19L24 31L12 19H36Z\")}</svg>`;\n};\n\nexport const svgDeltaSmooth = () => {\n return html`<svg viewBox=\"0 0 16 16\" fill=\"currentColor\">${path(undefined, 0)(\"m3.86 8.753 5.482 4.796c.646.566 1.658.106 1.658-.753V3.204a1 1 0 0 0-1.659-.753l-5.48 4.796a1 1 0 0 0 0 1.506z\")}</svg>`;\n};\n\nexport const svgArrow = (body?: boolean) => {\n const d = body ? \"M24 12L36 24L24 36\" : \"M19 12L31 24L19 36\";\n return html`<svg viewBox=\"0 0 48 48\" fill=\"none\">${body && path()(\"M36 24.0083H12\")} ${path(\"none\")(d)}</svg>`;\n};\n\nexport const svgSearch = () => {\n return html`<svg viewBox=\"0 0 1024 1024\">${path()(\"M745.429333 655.658667c1.173333 0.746667 2.325333 1.578667 3.413334 2.496l114.410666 96a32 32 0 0 1-41.152 49.024l-114.389333-96a32 32 0 0 1-6.208-6.976A297.429333 297.429333 0 0 1 512 768c-164.949333 0-298.666667-133.717333-298.666667-298.666667S347.050667 170.666667 512 170.666667s298.666667 133.717333 298.666667 298.666666a297.386667 297.386667 0 0 1-65.237334 186.325334zM512 704c129.6 0 234.666667-105.066667 234.666667-234.666667s-105.066667-234.666667-234.666667-234.666666-234.666667 105.066667-234.666667 234.666666 105.066667 234.666667 234.666667 234.666667z\")}</svg>`;\n};\n\nexport const svgEye = () => {\n return html`<svg viewBox=\"0 0 48 48\">${path(0)(\"M9.85786 18C6.23858 21 4 24 4 24C4 24 12.9543 36 24 36C25.3699 36 26.7076 35.8154 28 35.4921M20.0318 12.5C21.3144 12.1816 22.6414 12 24 12C35.0457 12 44 24 44 24C44 24 41.7614 27 38.1421 30\")} ${path(0)(\"M20.3142 20.6211C19.4981 21.5109 19 22.6972 19 23.9998C19 26.7612 21.2386 28.9998 24 28.9998C25.3627 28.9998 26.5981 28.4546 27.5 27.5705\")} ${path()(\"M42 42L6 6\")}</svg>`;\n};\n\nexport const svgX = () => {\n return html`<svg viewBox=\"0 0 48 48\" fill=\"none\">${path()(\"M14 14L34 34\")} ${path()(\"M14 34L34 14\")}</svg>`;\n};\n\nexport const svgImage = () => {\n return html`<svg viewBox=\"0 0 1098 1024\">${path(undefined, 0)(\"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z\")}</svg>`;\n};\n\nexport const svgSun = () => {\n return html`<svg viewBox=\"0 0 16 16\">${path(undefined, 0, 1)(\"M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z\")}</svg>`;\n};\n\nexport const svgMoon = (star?: boolean) => {\n return html`<svg viewBox=\"0 0 16 16\">${path(undefined, 0)(\"M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278zM4.858 1.311A7.269 7.269 0 0 0 1.025 7.71c0 4.02 3.279 7.276 7.319 7.276a7.316 7.316 0 0 0 5.205-2.162c-.337.042-.68.063-1.029.063-4.61 0-8.343-3.714-8.343-8.29 0-1.167.242-2.278.681-3.286z\")} ${star && path(undefined, 0)(\"M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.734 1.734 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.734 1.734 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.734 1.734 0 0 0 1.097-1.097l.387-1.162zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z\")}</svg>`;\n};\n\nexport const svgLink = () => {\n return html`<svg viewBox=\"0 0 48 48\" fill=\"none\">${path(0)(\"M28 6H42V20\")}${path(0)(\"M42 29.4737V39C42 40.6569 40.6569 42 39 42H9C7.34315 42 6 40.6569 6 39V9C6 7.34315 7.34315 6 9 6L18 6\")}${path()(\"M25.7998 22.1999L41.0998 6.8999\")}</svg>`;\n};\n\nexport const icons = {\n delta: svgDelta,\n \"delta-smooth\": svgDeltaSmooth,\n arrow: svgArrow,\n \"arrow-body\": () => svgArrow(true),\n search: svgSearch,\n eye: svgEye,\n x: svgX,\n image: svgImage,\n moon: svgMoon,\n \"moon-star\": () => svgMoon(true),\n sun: svgSun,\n link: svgLink,\n};\n"]}
package/naming.d.ts CHANGED
@@ -61,7 +61,6 @@ declare const namings: {
61
61
  get(key: string): any;
62
62
  };
63
63
  "legacy-2.6": {
64
- avatar: string;
65
64
  carousel: string;
66
65
  details: string;
67
66
  dialog: string;
@@ -76,6 +75,7 @@ declare const namings: {
76
75
  input: string;
77
76
  form: string;
78
77
  alert: string;
78
+ avatar: string;
79
79
  button: string;
80
80
  card: string;
81
81
  "router-a": string;
package/naming.js CHANGED
@@ -31,9 +31,9 @@ const legacy_2_5 = {
31
31
  return this[key];
32
32
  },
33
33
  };
34
+ // Declared.
34
35
  const legacy_2_6 = {
35
36
  ...legacy_2_5,
36
- avatar: "avatar-a",
37
37
  carousel: "carousel-slider",
38
38
  details: "open-details",
39
39
  dialog: "open-dialog",
package/naming.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"naming.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["naming.ts"],"names":[],"mappings":"AAGA,YAAY;AACZ,MAAM,UAAU,GAAG;IACjB,EAAE;IACF,IAAI,EAAE,WAAW;IACjB,UAAU,EAAE,iBAAiB;IAC7B,UAAU,EAAE,iBAAiB;IAC7B,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,YAAY;IACnB,IAAI,EAAE,WAAW;IACjB,EAAE;IACF,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,UAAU;IAClB,MAAM,E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// Declared.\nconst legacy_2_5 = {\n //\n clip: \"clip-text\",\n overbreath: \"overbreath-text\",\n typewriter: \"typewriter-text\",\n tabs: \"tab-group\",\n input: \"base-input\",\n form: \"base-form\",\n //\n alert: \"alert-item\",\n avatar: \"avatar-a\",\n button: \"base-button\",\n card: \"card-item\",\n dialog: \"dialog-item\",\n \"router-a\": \"link-a\",\n progress: \"load-progress\",\n a: \"super-a\",\n time: \"time-bar\",\n //\n divider: \"div-line\",\n dragbox: \"drag-box\",\n skeleton: \"skeleton-screen\",\n //\n details: \"details-expand\",\n \"open-offset\": \"offset-expand\",\n carousel: \"rotation-pool\",\n tooltip: \"tool-tip\",\n wrapper: \"with-wrap\",\n get(key: string) {\n return this[key];\n },\n};\n\nconst legacy_2_6 = {\n ...legacy_2_5,\n avatar: \"avatar-a\",\n carousel: \"carousel-slider\",\n details: \"open-details\",\n dialog: \"open-dialog\",\n divider: \"divider-line\",\n progress: \"loading-progress\",\n tooltip: \"open-tooltip\",\n wrapper: \"wrap-view\",\n};\n\n// Declared.\nconst gPrefix: GetAccessor = {\n get(key) {\n return \"g-\" + key;\n },\n};\n\nconst godownPrefix: GetAccessor = {\n get(key) {\n return \"godown-\" + key;\n },\n};\n\nconst namings = {\n latest: gPrefix,\n //\n \"g-prefix\": gPrefix,\n \"godown-prefix\": godownPrefix,\n //\n legacy: legacy_2_5,\n \"legacy-2.5\": legacy_2_5,\n \"legacy-2.6\": legacy_2_6,\n};\n\nexport default namings;\n"]}
1
+ {"version":3,"file":"naming.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["naming.ts"],"names":[],"mappings":"AAGA,YAAY;AACZ,MAAM,UAAU,GAAG;IACjB,EAAE;IACF,IAAI,EAAE,WAAW;IACjB,UAAU,EAAE,iBAAiB;IAC7B,UAAU,EAAE,iBAAiB;IAC7B,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,YAAY;IACnB,IAAI,EAAE,WAAW;IACjB,EAAE;IACF,KAAK,EAAE,YAA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import type { GetAccessor } from \"./conf\";\n\n// Declared.\nconst legacy_2_5 = {\n //\n clip: \"clip-text\",\n overbreath: \"overbreath-text\",\n typewriter: \"typewriter-text\",\n tabs: \"tab-group\",\n input: \"base-input\",\n form: \"base-form\",\n //\n alert: \"alert-item\",\n avatar: \"avatar-a\",\n button: \"base-button\",\n card: \"card-item\",\n dialog: \"dialog-item\",\n \"router-a\": \"link-a\",\n progress: \"load-progress\",\n a: \"super-a\",\n time: \"time-bar\",\n //\n divider: \"div-line\",\n dragbox: \"drag-box\",\n skeleton: \"skeleton-screen\",\n //\n details: \"details-expand\",\n \"open-offset\": \"offset-expand\",\n carousel: \"rotation-pool\",\n tooltip: \"tool-tip\",\n wrapper: \"with-wrap\",\n get(key: string) {\n return this[key];\n },\n};\n\n// Declared.\nconst legacy_2_6 = {\n ...legacy_2_5,\n carousel: \"carousel-slider\",\n details: \"open-details\",\n dialog: \"open-dialog\",\n divider: \"divider-line\",\n progress: \"loading-progress\",\n tooltip: \"open-tooltip\",\n wrapper: \"wrap-view\",\n};\n\n// Declared.\nconst gPrefix: GetAccessor = {\n get(key) {\n return \"g-\" + key;\n },\n};\n\nconst godownPrefix: GetAccessor = {\n get(key) {\n return \"godown-\" + key;\n },\n};\n\nconst namings = {\n latest: gPrefix,\n //\n \"g-prefix\": gPrefix,\n \"godown-prefix\": godownPrefix,\n //\n legacy: legacy_2_5,\n \"legacy-2.5\": legacy_2_5,\n \"legacy-2.6\": legacy_2_6,\n};\n\nexport default namings;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "godown",
3
- "version": "2.7.0",
3
+ "version": "2.7.1",
4
4
  "main": "./index.js",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1,6 +1,10 @@
1
1
  import { type HTMLTemplate } from "../lib/templates.js";
2
2
  import { GodownElement } from "./root.js";
3
3
  export declare class GodownAnchor extends GodownElement {
4
+ /**
5
+ * True when the href is in the same pathname as the location.
6
+ */
7
+ active: boolean;
4
8
  /**
5
9
  * Href for a element.
6
10
  */
@@ -12,10 +16,11 @@ export declare class GodownAnchor extends GodownElement {
12
16
  /**
13
17
  * Arrow type.
14
18
  */
15
- arrow: "" | "delta" | "arrow" | "angle";
19
+ arrow: "" | "link" | "delta" | "arrow" | "angle";
16
20
  static styles: import("lit").CSSResult[];
17
21
  protected render(): HTMLTemplate;
18
22
  private _arrowSwitcher;
23
+ useActive(): void;
19
24
  }
20
25
  export default GodownAnchor;
21
26
  //# sourceMappingURL=anchor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"anchor.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["supers/anchor.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,qBAAa,YAAa,SAAQ,aAAa;IAC7C;;OAEG;IACS,IAAI,EAAE,MAAM,CAAa;IACrC;;OAEG;IACS,MAAM,SAAW;IAC7B;;OAEG;IACS,KAAK,EAAE,EAAE,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAM;IAEzD,MAAM,CAAC,MAAM,4BA0DX;IAEF,SAAS,CAAC,MAAM,IAAI,YAAY;IAOhC,OAAO,CAAC,cAAc;CAYvB;AAED,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"anchor.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["supers/anchor.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,YAAY,EAA+B,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,qBAAa,YAAa,SAAQ,aAAa;IAC7C;;OAEG;IACyC,MAAM,UAAS;IAC3D;;OAEG;IACS,IAAI,EAAE,MAAM,CAAa;IACrC;;OAEG;IACS,MAAM,SAAW;IAC7B;;OAEG;IACS,KAAK,EAAE,EAAE,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAM;IAElE,MAAM,CAAC,MAAM,4BA0DX;IAEF,SAAS,CAAC,MAAM,IAAI,YAAY;IAOhC,OAAO,CAAC,cAAc;IAetB,SAAS;CAMV;AAED,eAAe,YAAY,CAAC"}
package/supers/anchor.js CHANGED
@@ -1,10 +1,14 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { css, html, ifDefined, property } from "../.deps.js";
3
- import { htmlSlot, svgArrow, svgDelta } from "../lib/templates.js";
3
+ import { htmlSlot, svgArrow, svgDelta, svgLink } from "../lib/templates.js";
4
4
  import { GodownElement } from "./root.js";
5
5
  export class GodownAnchor extends GodownElement {
6
6
  constructor() {
7
7
  super(...arguments);
8
+ /**
9
+ * True when the href is in the same pathname as the location.
10
+ */
11
+ this.active = false;
8
12
  /**
9
13
  * Href for a element.
10
14
  */
@@ -21,7 +25,7 @@ export class GodownAnchor extends GodownElement {
21
25
  render() {
22
26
  return html `<a href="${ifDefined(this.href)}" target="${this.target}">
23
27
  ${htmlSlot()}
24
- <i> ${this._arrowSwitcher()} </i>
28
+ <i>${this._arrowSwitcher()}</i>
25
29
  </a>`;
26
30
  }
27
31
  _arrowSwitcher() {
@@ -32,10 +36,18 @@ export class GodownAnchor extends GodownElement {
32
36
  return svgArrow(true);
33
37
  case "angle":
34
38
  return svgArrow();
39
+ case "link":
40
+ return svgLink();
35
41
  default:
36
42
  return htmlSlot("icon");
37
43
  }
38
44
  }
45
+ useActive() {
46
+ const url = new URL(this.href, location.href);
47
+ if (url.origin === location.origin) {
48
+ this.active = url.pathname === location.pathname;
49
+ }
50
+ }
39
51
  }
40
52
  GodownAnchor.styles = [
41
53
  css `
@@ -96,6 +108,9 @@ GodownAnchor.styles = [
96
108
  }
97
109
  `,
98
110
  ];
111
+ __decorate([
112
+ property({ type: Boolean, reflect: true })
113
+ ], GodownAnchor.prototype, "active", void 0);
99
114
  __decorate([
100
115
  property()
101
116
  ], GodownAnchor.prototype, "href", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"anchor.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["supers/anchor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAqB,QAAQ,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,OAAO,YAAa,SAAQ,aAAa;IAA/C;;QACE;;WAEG;QACS,SAAI,GAAW,SAAS,CAAC;QACrC;;WAEG;QACS,WAAM,GAAG,OAAO,CAAC;QAC7B;;WAEG;QACS,UAAK,GAAqC,EAAE,CAAC;IAiF3D,CAAC;IAnBW,MAAM;QACd,OAAO,IAAI,CAAA,YAAY,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,MAAM;QAC/D,QAAQ,EAAE;YACN,IAAI,CAAC,cAAc,EAAE;SACxB,CAAC;IACR,CAAC;IAEO,cAAc;QACpB,QAAQ,IAAI,CAAC,KAAK,EAAE,CAAC;YACnB,KAAK,OAAO;gBACV,OAAO,QAAQ,EAAE,CAAC;YACpB,KAAK,OAAO;gBACV,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;YACxB,KAAK,OAAO;gBACV,OAAO,QAAQ,EAAE,CAAC;YACpB;gBACE,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;;AA9EM,mBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwDF;CACF,AA1DY,CA0DX;AApEU;IAAX,QAAQ,EAAE;0CAA0B;AAIzB;IAAX,QAAQ,EAAE;4CAAkB;AAIjB;IAAX,QAAQ,EAAE;2CAA8C;AAmF3D,eAAe,YAAY,CAAC","sourcesContent":["import { css, html, ifDefined, property } from \"../.deps.js\";\nimport { htmlSlot, type HTMLTemplate, svgArrow, svgDelta } from \"../lib/templates.js\";\nimport { GodownElement } from \"./root.js\";\n\nexport class GodownAnchor extends GodownElement {\n /**\n * Href for a element.\n */\n @property() href: string = undefined;\n /**\n * Target for an element.\n */\n @property() target = \"_self\";\n /**\n * Arrow type.\n */\n @property() arrow: \"\" | \"delta\" | \"arrow\" | \"angle\" = \"\";\n\n static styles = [\n css`\n :host([arrow=\"delta\"]) svg {\n transform: rotate(-90deg);\n }\n\n :host {\n display: inline-block;\n color: currentColor;\n text-decoration: none;\n cursor: default;\n }\n\n :host([href]) {\n cursor: pointer;\n }\n\n a {\n width: 100%;\n display: flex;\n color: inherit;\n text-decoration: inherit;\n justify-content: space-between;\n align-items: center;\n }\n\n i {\n display: inline-flex;\n border-radius: 20%;\n font-style: normal;\n }\n\n i > svg {\n width: 1em;\n height: 1em;\n border-radius: inherit;\n }\n\n :host(:hover) i {\n animation: arrow 0.3s linear;\n }\n\n i:hover {\n background-color: rgb(0 0 0 / 0.075);\n }\n\n @keyframes arrow {\n from {\n transform: translateX(0);\n }\n 50% {\n transform: translateX(0.05em);\n }\n to {\n transform: translateX(0);\n }\n }\n `,\n ];\n\n protected render(): HTMLTemplate {\n return html`<a href=\"${ifDefined(this.href)}\" target=\"${this.target}\">\n ${htmlSlot()}\n <i> ${this._arrowSwitcher()} </i>\n </a>`;\n }\n\n private _arrowSwitcher(): HTMLTemplate {\n switch (this.arrow) {\n case \"delta\":\n return svgDelta();\n case \"arrow\":\n return svgArrow(true);\n case \"angle\":\n return svgArrow();\n default:\n return htmlSlot(\"icon\");\n }\n }\n}\n\nexport default GodownAnchor;\n"]}
1
+ {"version":3,"file":"anchor.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["supers/anchor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwDF;CACF,AA1DY,CA0DX;AAxE0C;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAgB;AAI/C;IAAX,QAAQ,EAAE;0CAA0B;AAIzB;IAAX,QAAQ,EAAE;4CAAkB;AAIjB;IAAX,QAAQ,EAAE;2CAAuD;AA4FpE,eAAe,YAAY,CAAC","sourcesContent":["import { css, html, ifDefined, property } from \"../.deps.js\";\nimport { htmlSlot, type HTMLTemplate, svgArrow, svgDelta, svgLink } from \"../lib/templates.js\";\nimport { GodownElement } from \"./root.js\";\n\nexport class GodownAnchor extends GodownElement {\n /**\n * True when the href is in the same pathname as the location.\n */\n @property({ type: Boolean, reflect: true }) active = false;\n /**\n * Href for a element.\n */\n @property() href: string = undefined;\n /**\n * Target for an element.\n */\n @property() target = \"_self\";\n /**\n * Arrow type.\n */\n @property() arrow: \"\" | \"link\" | \"delta\" | \"arrow\" | \"angle\" = \"\";\n\n static styles = [\n css`\n :host([arrow=\"delta\"]) svg {\n transform: rotate(-90deg);\n }\n\n :host {\n display: inline-block;\n color: currentColor;\n text-decoration: none;\n cursor: default;\n }\n\n :host([href]) {\n cursor: pointer;\n }\n\n a {\n width: 100%;\n display: flex;\n color: inherit;\n text-decoration: inherit;\n justify-content: space-between;\n align-items: center;\n }\n\n i {\n display: inline-flex;\n border-radius: 20%;\n font-style: normal;\n }\n\n i > svg {\n width: 1em;\n height: 1em;\n border-radius: inherit;\n }\n\n :host(:hover) i {\n animation: arrow 0.3s linear;\n }\n\n i:hover {\n background-color: rgb(0 0 0 / 0.075);\n }\n\n @keyframes arrow {\n from {\n transform: translateX(0);\n }\n 50% {\n transform: translateX(0.05em);\n }\n to {\n transform: translateX(0);\n }\n }\n `,\n ];\n\n protected render(): HTMLTemplate {\n return html`<a href=\"${ifDefined(this.href)}\" target=\"${this.target}\">\n ${htmlSlot()}\n <i>${this._arrowSwitcher()}</i>\n </a>`;\n }\n\n private _arrowSwitcher(): HTMLTemplate {\n switch (this.arrow) {\n case \"delta\":\n return svgDelta();\n case \"arrow\":\n return svgArrow(true);\n case \"angle\":\n return svgArrow();\n case \"link\":\n return svgLink();\n default:\n return htmlSlot(\"icon\");\n }\n }\n\n useActive() {\n const url = new URL(this.href, location.href);\n if (url.origin === location.origin) {\n this.active = url.pathname === location.pathname;\n }\n }\n}\n\nexport default GodownAnchor;\n"]}
@@ -32,10 +32,6 @@ export declare class Button extends GodownElement {
32
32
  * Enables rounded corners to appear capsule shaped.
33
33
  */
34
34
  radius: boolean;
35
- /**
36
- * Enables scale when mousedown.
37
- */
38
- scale: boolean;
39
35
  /**
40
36
  * The primary color.
41
37
  */
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/button/button.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAe,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAYlE,QAAA,MAAM,MAAM;;;;;;;;CA2CX,CAAC;AAEF,KAAK,MAAM,GAAG,MAAM,OAAO,MAAM,CAAC;AAElC;;;;GAIG;AACH,qBACa,MAAO,SAAQ,aAAa;IACvC;;OAEG;IACyC,QAAQ,UAAS;IAC7D;;OAEG;IACyC,KAAK,UAAS;IAC1D;;OAEG;IACyC,MAAM,UAAS;IAC3D;;OAEG;IACyC,MAAM,UAAS;IAC3D;;OAEG;IACyC,KAAK,UAAS;IAC1D;;OAEG;IACS,KAAK,EAAE,MAAM,GAAG,MAAM,CAAW;IAC7C;;OAEG;IACS,IAAI,SAAM;IAEV,EAAE,EAAE,WAAW,CAAC;IACd,IAAI,EAAE,iBAAiB,CAAC;IAEtC,MAAM,CAAC,MAAM,4BAuHX;IAEF,SAAS,CAAC,MAAM,IAAI,YAAY;IAShC,KAAK;IAOL,IAAI;IAIJ,SAAS,CAAC,YAAY;IAiBtB,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU;IAgBpC,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU;IAYpC;;;;;;;;;;;;;;;OAeG;IACH,SAAS,IAAI,MAAM,GAAG,MAAM;CAG7B;AAED,eAAe,MAAM,CAAC;AAEtB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;KACpB;CACF"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/button/button.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAe,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAYlE,QAAA,MAAM,MAAM;;;;;;;;CA2CX,CAAC;AAEF,KAAK,MAAM,GAAG,MAAM,OAAO,MAAM,CAAC;AAElC;;;;GAIG;AACH,qBACa,MAAO,SAAQ,aAAa;IACvC;;OAEG;IACyC,QAAQ,UAAS;IAC7D;;OAEG;IACyC,KAAK,UAAS;IAC1D;;OAEG;IACyC,MAAM,UAAS;IAC3D;;OAEG;IACyC,MAAM,UAAS;IAC3D;;OAEG;IACS,KAAK,EAAE,MAAM,GAAG,MAAM,CAAW;IAC7C;;OAEG;IACS,IAAI,SAAM;IAEV,EAAE,EAAE,WAAW,CAAC;IACd,IAAI,EAAE,iBAAiB,CAAC;IAEtC,MAAM,CAAC,MAAM,4BAmHX;IAEF,SAAS,CAAC,MAAM,IAAI,YAAY;IAShC,KAAK;IAOL,IAAI;IAIJ,SAAS,CAAC,YAAY;IAItB,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU;IAgBpC,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU;IAYpC;;;;;;;;;;;;;;;OAeG;IACH,SAAS,IAAI,MAAM,GAAG,MAAM;CAG7B;AAED,eAAe,MAAM,CAAC;AAEtB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;KACpB;CACF"}
@@ -80,10 +80,6 @@ let Button = class Button extends GodownElement {
80
80
  * Enables rounded corners to appear capsule shaped.
81
81
  */
82
82
  this.radius = false;
83
- /**
84
- * Enables scale when mousedown.
85
- */
86
- this.scale = false;
87
83
  /**
88
84
  * The primary color.
89
85
  */
@@ -111,21 +107,7 @@ let Button = class Button extends GodownElement {
111
107
  this.active = false;
112
108
  }
113
109
  firstUpdated() {
114
- if (this.scale) {
115
- this.addEvent(this, "mousedown", this.focus);
116
- this.addEvent(this, "mouseup", (e) => {
117
- if (this.disabled) {
118
- return;
119
- }
120
- this.blur();
121
- this._handleModal(e);
122
- });
123
- this.addEvent(this, "mouseleave", this.blur);
124
- return;
125
- }
126
- else {
127
- this.addEvent(document, "click", this._handelClick.bind(this));
128
- }
110
+ this.addEvent(document, "click", this._handelClick.bind(this));
129
111
  }
130
112
  _handleModal(e) {
131
113
  const a = this._div.offsetHeight + 1;
@@ -197,14 +179,10 @@ Button.styles = [
197
179
  cursor: not-allowed;
198
180
  }
199
181
 
200
- :host([active][scale]) div {
182
+ :host(:active) div {
201
183
  scale: var(${cssvarScope}--focus-scale);
202
184
  }
203
185
 
204
- slot {
205
- display: flow-root;
206
- }
207
-
208
186
  div {
209
187
  background: var(${cssvarScope}--background);
210
188
  box-shadow: var(${cssvarScope}--box-shadow);
@@ -299,9 +277,6 @@ __decorate([
299
277
  __decorate([
300
278
  property({ type: Boolean, reflect: true })
301
279
  ], Button.prototype, "radius", void 0);
302
- __decorate([
303
- property({ type: Boolean, reflect: true })
304
- ], Button.prototype, "scale", void 0);
305
280
  __decorate([
306
281
  property()
307
282
  ], Button.prototype, "color", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/button/button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAElE,MAAM,UAAU,GAAG,QAAQ,CAAC;AAC5B,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C,MAAM,OAAO,GAAG,mBAAmB,CAAC;AACpC,MAAM,OAAO,GAAG,mBAAmB,CAAC;AACpC,MAAM,cAAc,GAAG,iBAAiB,CAAC;AACzC,MAAM,GAAG,GAAG,MAAM,CAAC;AACnB,MAAM,IAAI,GAAG,MAAM,CAAC;AAEpB,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;AAClE,MAAM,MAAM,GAAG;IACb,KAAK,EAAE;QACL,GAAG,EAAE,EAAE;QACP,GAAG,cAAc,uCAAuC;QACxD,GAAG,OAAO,sBAAsB,OAAO,sBAAsB;QAC7D,eAAe;KAChB;IACD,IAAI,EAAE;QACJ,GAAG,EAAE,EAAE;QACP,GAAG,cAAc,2CAA2C;QAC5D,GAAG,OAAO,sBAAsB,OAAO,sBAAsB;QAC7D,eAAe;KAChB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,EAAE;QACR,GAAG,cAAc,6CAA6C;QAC9D,GAAG,OAAO,4BAA4B,OAAO,yBAAyB;QACtE,kBAAkB;KACnB;IACD,GAAG,EAAE;QACH,GAAG,EAAE,EAAE;QACP,GAAG,cAAc,2CAA2C;QAC5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B,WAAW;;;;;;yBAMZ,WAAW;;;;;;yBAMX,WAAW;;;KAG/B;CACF,AAvHY,CAuHX;AApJ0C;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCAAkB;AAIjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCAAe;AAId;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCAAgB;AAIf;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCAAgB;AAIf;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCAAe;AAI9C;IAAX,QAAQ,EAAE;qCAAkC;AAIjC;IAAX,QAAQ,EAAE;oCAAW;AAEV;IAAX,KAAK,CAAC,GAAG,CAAC;kCAAiB;AACd;IAAb,KAAK,CAAC,KAAK,CAAC;oCAAyB;AA/B3B,MAAM;IADlB,MAAM,CAAC,UAAU,CAAC;GACN,MAAM,CA8OlB;;AAED,eAAe,MAAM,CAAC","sourcesContent":["import { css, html, property, query, unsafeCSS } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { constructCSS } from \"../../lib/utils.js\";\nimport { createScope, GodownElement } from \"../../supers/root.js\";\n\nconst defineName = \"button\";\nconst cssvarScope = createScope(defineName);\n\nconst shadow1 = \"-2px 2px 5px -2px\";\nconst shadow2 = \"2px -2px 5px -2px\";\nconst linearGradient = \"linear-gradient\";\nconst fff = \"#fff\";\nconst _000 = \"#000\";\n\nconst vars = [\"color\", \"background\", \"box-shadow\", \"ghost-color\"];\nconst colors = {\n black: [\n fff, //\n `${linearGradient}(45deg, rgb(30 30 30), rgb(65 65 65))`,\n `${shadow1} rgb(0 0 0 / 20%), ${shadow2} rgb(99 99 99 / 20%)`,\n \"rgb(22 20 20)\",\n ],\n gary: [\n fff, //\n `${linearGradient}(45deg, rgb(65 65 65), rgb(100 100 100))`,\n `${shadow1} rgb(0 0 0 / 20%), ${shadow2} rgb(99 99 99 / 20%)`,\n \"rgb(56 56 56)\",\n ],\n white: [\n _000, //\n `${linearGradient}(45deg, rgb(225 225 225), rgb(240 240 240))`,\n `${shadow1} rgb(255 255 255 / 20%), ${shadow2} rgb(165 165 165 / 20%)`,\n \"rgb(212 212 212)\",\n ],\n red: [\n fff, //\n `${linearGradient}(45deg, rgb(215 57 68), rgb(250 141 106))`,\n `${shadow1} rgb(181 35 44 / 20%), ${shadow2} rgb(234 130 174 / 20%)`,\n \"rgb(214 11 23)\",\n ],\n green: [\n _000, //\n `${linearGradient}(45deg, rgb(21 206 71), rgb(99 253 122))`,\n `${shadow1} rgb(63 179 69 / 20%), ${shadow2} rgb(136 225 142 / 20%)`,\n \"rgb(60 214 68)\",\n ],\n blue: [\n fff, //\n `${linearGradient}(45deg, rgb(14 143 255), rgb(121 211 255))`,\n `${shadow1} rgb(92 182 255 / 20%), ${shadow2} rgb(135 232 222 / 20%)`,\n \"rgb(42 141 221)\",\n ],\n yellow: [\n _000, //\n `${linearGradient}(45deg, rgb(255 190 54), rgb(255 249 68))`,\n `${shadow1} rgb(214 203 55 / 20%), ${shadow2} rgb(202 203 137 / 20%)`,\n \"rgb(255 235 59)\",\n ],\n};\n\ntype Colors = keyof typeof colors;\n\n/**\n * {@linkcode Button}.\n *\n * Inspired by Next-ui.\n */\n@define(defineName)\nexport class Button extends GodownElement {\n /**\n * Whether to disable this element.\n */\n @property({ type: Boolean, reflect: true }) disabled = false;\n /**\n * Invert font and background color.\n */\n @property({ type: Boolean, reflect: true }) ghost = false;\n /**\n * Whether this element is active or not.\n */\n @property({ type: Boolean, reflect: true }) active = false;\n /**\n * Enables rounded corners to appear capsule shaped.\n */\n @property({ type: Boolean, reflect: true }) radius = false;\n /**\n * Enables scale when mousedown.\n */\n @property({ type: Boolean, reflect: true }) scale = false;\n /**\n * The primary color.\n */\n @property() color: \"none\" | Colors = \"black\";\n /**\n * Text inside.\n */\n @property() text = \"\";\n\n @query(\"b\") _b: HTMLElement;\n @query(\"div\") _div: HTMLButtonElement;\n\n static styles = [\n unsafeCSS(\n constructCSS(\n vars,\n colors,\n (raw) => `[color=${raw}]`,\n (k, v) => `${cssvarScope}--${k}:${v}`,\n ),\n ),\n css`\n :host {\n ${cssvarScope}--padding: .075em .25em;\n ${cssvarScope}--deg: .075em .25em;\n ${cssvarScope}--ghost-width: .09em;\n ${cssvarScope}--modal-opacity: .15;\n ${cssvarScope}--modal-opacity-end: 0;\n ${cssvarScope}--modal-animation-duration: 1s;\n ${cssvarScope}--focus-scale: .975;\n transition: 0.1s;\n display: flex;\n width: fit-content;\n border-radius: 0.25em;\n cursor: pointer;\n background: none !important;\n }\n\n :host([disabled]) {\n cursor: not-allowed;\n }\n\n :host([active][scale]) div {\n scale: var(${cssvarScope}--focus-scale);\n }\n\n slot {\n display: flow-root;\n }\n\n div {\n background: var(${cssvarScope}--background);\n box-shadow: var(${cssvarScope}--box-shadow);\n color: var(${cssvarScope}--color, inherit);\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n border-radius: inherit;\n transition-duration: inherit;\n transition-property: scale;\n pointer-events: none;\n }\n\n b {\n pointer-events: none;\n transform: translate(-50%, -50%);\n position: absolute;\n visibility: hidden;\n }\n\n p {\n padding: var(${cssvarScope}--padding);\n margin: 0;\n user-select: none;\n transition: 0;\n }\n\n :host([ghost]) p {\n background-image: var(${cssvarScope}--background);\n margin: calc(-1 * var(${cssvarScope}--ghost-width));\n background-clip: text;\n -webkit-background-clip: text;\n color: transparent;\n }\n\n :host([ghost]) div {\n background: transparent;\n border: var(${cssvarScope}--ghost-width) solid var(${cssvarScope}--ghost-color);\n }\n\n :host([radius]) {\n border-radius: calc(infinity * 1px);\n ${cssvarScope}--padding: .075em .5em;\n }\n `,\n css`\n i {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n border-radius: 50%;\n transform: translate(0, 0);\n background: currentColor;\n opacity: var(${cssvarScope}--modal-opacity-end);\n visibility: visible;\n animation-duration: min(var(${cssvarScope}--modal-animation-duration), 2s);\n }\n\n :host([ghost]) i {\n background: var(${cssvarScope}--ghost-color);\n }\n\n @keyframes i {\n 0% {\n transform: scale(0);\n opacity: var(${cssvarScope}--modal-opacity);\n }\n 80% {\n transform: scale(1);\n }\n 100% {\n opacity: var(${cssvarScope}--modal-opacity-end);\n }\n }\n `,\n ];\n\n protected render(): HTMLTemplate {\n return html`\n <div color=\"${this.nextColor()}\">\n <b></b>\n <p>${this.text || htmlSlot()}</p>\n </div>\n `;\n }\n\n focus() {\n if (this.disabled) {\n return;\n }\n this.active = true;\n }\n\n blur() {\n this.active = false;\n }\n\n protected firstUpdated() {\n if (this.scale) {\n this.addEvent(this, \"mousedown\", this.focus);\n this.addEvent(this, \"mouseup\", (e: MouseEvent) => {\n if (this.disabled) {\n return;\n }\n this.blur();\n this._handleModal(e);\n });\n this.addEvent(this, \"mouseleave\", this.blur);\n return;\n } else {\n this.addEvent(document, \"click\", this._handelClick.bind(this));\n }\n }\n\n protected _handleModal(e: MouseEvent) {\n const a = this._div.offsetHeight + 1;\n const b = this._div.offsetWidth + 1;\n const size = `${Math.sqrt(a * a + b * b) * 2}px`;\n const translate = `translate(calc(-50% + ${e.offsetX}px), calc(-50% + ${e.offsetY}px))`;\n this._b.style.width = size;\n this._b.style.height = size;\n this._b.style.transform = translate;\n const i = document.createElement(\"i\");\n i.style.animationName = \"i\";\n this._b.appendChild(i);\n setTimeout(() => {\n i.remove();\n }, 2000);\n }\n\n protected _handelClick(e: MouseEvent) {\n if (this.disabled) {\n return;\n }\n if (e.target === this) {\n this._handleModal(e);\n this.focus();\n } else {\n this.blur();\n }\n }\n\n /**\n * Get the color to render, default is this.color.\n *\n * @returns New color.\n *\n * Colors can be set for different states.\n *\n * The matching selector is `[color=COLOR]`.\n *\n * @example\n * ```ts\n * button.adoptStyles(\"[color=COLOR1]{...}\")\n * button.adoptStyles(\"[color=COLOR2]{...}\")\n * button.nextColor = () => state ? COLOR1 : COLOR2\n * ```\n */\n nextColor(): Colors | string {\n return this.color;\n }\n}\n\nexport default Button;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"base-button\": Button;\n \"g-button\": Button;\n }\n}\n"]}
1
+ {"version":3,"file":"button.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/button/button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAElE,MAAM,UAAU,GAAG,QAAQ,CAAC;AAC5B,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C,MAAM,OAAO,GAAG,mBAAmB,CAAC;AACpC,MAAM,OAAO,GAAG,mBAAmB,CAAC;AACpC,MAAM,cAAc,GAAG,iBAAiB,CAAC;AACzC,MAAM,GAAG,GAAG,MAAM,CAAC;AACnB,MAAM,IAAI,GAAG,MAAM,CAAC;AAEpB,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;AAClE,MAAM,MAAM,GAAG;IACb,KAAK,EAAE;QACL,GAAG,EAAE,EAAE;QACP,GAAG,cAAc,uCAAuC;QACxD,GAAG,OAAO,sBAAs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AE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCAAe;AAId;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCAAgB;AAIf;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCAAgB;AAI/C;IAAX,QAAQ,EAAE;qCAAkC;AAIjC;IAAX,QAAQ,EAAE;oCAAW;AAEV;IAAX,KAAK,CAAC,GAAG,CAAC;kCAAiB;AACd;IAAb,KAAK,CAAC,KAAK,CAAC;oCAAyB;AA3B3B,MAAM;IADlB,MAAM,CAAC,UAAU,CAAC;GACN,MAAM,CAyNlB;;AAED,eAAe,MAAM,CAAC","sourcesContent":["import { css, html, property, query, unsafeCSS } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { constructCSS } from \"../../lib/utils.js\";\nimport { createScope, GodownElement } from \"../../supers/root.js\";\n\nconst defineName = \"button\";\nconst cssvarScope = createScope(defineName);\n\nconst shadow1 = \"-2px 2px 5px -2px\";\nconst shadow2 = \"2px -2px 5px -2px\";\nconst linearGradient = \"linear-gradient\";\nconst fff = \"#fff\";\nconst _000 = \"#000\";\n\nconst vars = [\"color\", \"background\", \"box-shadow\", \"ghost-color\"];\nconst colors = {\n black: [\n fff, //\n `${linearGradient}(45deg, rgb(30 30 30), rgb(65 65 65))`,\n `${shadow1} rgb(0 0 0 / 20%), ${shadow2} rgb(99 99 99 / 20%)`,\n \"rgb(22 20 20)\",\n ],\n gary: [\n fff, //\n `${linearGradient}(45deg, rgb(65 65 65), rgb(100 100 100))`,\n `${shadow1} rgb(0 0 0 / 20%), ${shadow2} rgb(99 99 99 / 20%)`,\n \"rgb(56 56 56)\",\n ],\n white: [\n _000, //\n `${linearGradient}(45deg, rgb(225 225 225), rgb(240 240 240))`,\n `${shadow1} rgb(255 255 255 / 20%), ${shadow2} rgb(165 165 165 / 20%)`,\n \"rgb(212 212 212)\",\n ],\n red: [\n fff, //\n `${linearGradient}(45deg, rgb(215 57 68), rgb(250 141 106))`,\n `${shadow1} rgb(181 35 44 / 20%), ${shadow2} rgb(234 130 174 / 20%)`,\n \"rgb(214 11 23)\",\n ],\n green: [\n _000, //\n `${linearGradient}(45deg, rgb(21 206 71), rgb(99 253 122))`,\n `${shadow1} rgb(63 179 69 / 20%), ${shadow2} rgb(136 225 142 / 20%)`,\n \"rgb(60 214 68)\",\n ],\n blue: [\n fff, //\n `${linearGradient}(45deg, rgb(14 143 255), rgb(121 211 255))`,\n `${shadow1} rgb(92 182 255 / 20%), ${shadow2} rgb(135 232 222 / 20%)`,\n \"rgb(42 141 221)\",\n ],\n yellow: [\n _000, //\n `${linearGradient}(45deg, rgb(255 190 54), rgb(255 249 68))`,\n `${shadow1} rgb(214 203 55 / 20%), ${shadow2} rgb(202 203 137 / 20%)`,\n \"rgb(255 235 59)\",\n ],\n};\n\ntype Colors = keyof typeof colors;\n\n/**\n * {@linkcode Button}.\n *\n * Inspired by Next-ui.\n */\n@define(defineName)\nexport class Button extends GodownElement {\n /**\n * Whether to disable this element.\n */\n @property({ type: Boolean, reflect: true }) disabled = false;\n /**\n * Invert font and background color.\n */\n @property({ type: Boolean, reflect: true }) ghost = false;\n /**\n * Whether this element is active or not.\n */\n @property({ type: Boolean, reflect: true }) active = false;\n /**\n * Enables rounded corners to appear capsule shaped.\n */\n @property({ type: Boolean, reflect: true }) radius = false;\n /**\n * The primary color.\n */\n @property() color: \"none\" | Colors = \"black\";\n /**\n * Text inside.\n */\n @property() text = \"\";\n\n @query(\"b\") _b: HTMLElement;\n @query(\"div\") _div: HTMLButtonElement;\n\n static styles = [\n unsafeCSS(\n constructCSS(\n vars,\n colors,\n (raw) => `[color=${raw}]`,\n (k, v) => `${cssvarScope}--${k}:${v}`,\n ),\n ),\n css`\n :host {\n ${cssvarScope}--padding: .075em .25em;\n ${cssvarScope}--deg: .075em .25em;\n ${cssvarScope}--ghost-width: .09em;\n ${cssvarScope}--modal-opacity: .15;\n ${cssvarScope}--modal-opacity-end: 0;\n ${cssvarScope}--modal-animation-duration: 1s;\n ${cssvarScope}--focus-scale: .975;\n transition: 0.1s;\n display: flex;\n width: fit-content;\n border-radius: 0.25em;\n cursor: pointer;\n background: none !important;\n }\n\n :host([disabled]) {\n cursor: not-allowed;\n }\n\n :host(:active) div {\n scale: var(${cssvarScope}--focus-scale);\n }\n\n div {\n background: var(${cssvarScope}--background);\n box-shadow: var(${cssvarScope}--box-shadow);\n color: var(${cssvarScope}--color, inherit);\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n border-radius: inherit;\n transition-duration: inherit;\n transition-property: scale;\n pointer-events: none;\n }\n\n b {\n pointer-events: none;\n transform: translate(-50%, -50%);\n position: absolute;\n visibility: hidden;\n }\n\n p {\n padding: var(${cssvarScope}--padding);\n margin: 0;\n user-select: none;\n transition: 0;\n }\n\n :host([ghost]) p {\n background-image: var(${cssvarScope}--background);\n margin: calc(-1 * var(${cssvarScope}--ghost-width));\n background-clip: text;\n -webkit-background-clip: text;\n color: transparent;\n }\n\n :host([ghost]) div {\n background: transparent;\n border: var(${cssvarScope}--ghost-width) solid var(${cssvarScope}--ghost-color);\n }\n\n :host([radius]) {\n border-radius: calc(infinity * 1px);\n ${cssvarScope}--padding: .075em .5em;\n }\n `,\n css`\n i {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n border-radius: 50%;\n transform: translate(0, 0);\n background: currentColor;\n opacity: var(${cssvarScope}--modal-opacity-end);\n visibility: visible;\n animation-duration: min(var(${cssvarScope}--modal-animation-duration), 2s);\n }\n\n :host([ghost]) i {\n background: var(${cssvarScope}--ghost-color);\n }\n\n @keyframes i {\n 0% {\n transform: scale(0);\n opacity: var(${cssvarScope}--modal-opacity);\n }\n 80% {\n transform: scale(1);\n }\n 100% {\n opacity: var(${cssvarScope}--modal-opacity-end);\n }\n }\n `,\n ];\n\n protected render(): HTMLTemplate {\n return html`\n <div color=\"${this.nextColor()}\">\n <b></b>\n <p>${this.text || htmlSlot()}</p>\n </div>\n `;\n }\n\n focus() {\n if (this.disabled) {\n return;\n }\n this.active = true;\n }\n\n blur() {\n this.active = false;\n }\n\n protected firstUpdated() {\n this.addEvent(document, \"click\", this._handelClick.bind(this));\n }\n\n protected _handleModal(e: MouseEvent) {\n const a = this._div.offsetHeight + 1;\n const b = this._div.offsetWidth + 1;\n const size = `${Math.sqrt(a * a + b * b) * 2}px`;\n const translate = `translate(calc(-50% + ${e.offsetX}px), calc(-50% + ${e.offsetY}px))`;\n this._b.style.width = size;\n this._b.style.height = size;\n this._b.style.transform = translate;\n const i = document.createElement(\"i\");\n i.style.animationName = \"i\";\n this._b.appendChild(i);\n setTimeout(() => {\n i.remove();\n }, 2000);\n }\n\n protected _handelClick(e: MouseEvent) {\n if (this.disabled) {\n return;\n }\n if (e.target === this) {\n this._handleModal(e);\n this.focus();\n } else {\n this.blur();\n }\n }\n\n /**\n * Get the color to render, default is this.color.\n *\n * @returns New color.\n *\n * Colors can be set for different states.\n *\n * The matching selector is `[color=COLOR]`.\n *\n * @example\n * ```ts\n * button.adoptStyles(\"[color=COLOR1]{...}\")\n * button.adoptStyles(\"[color=COLOR2]{...}\")\n * button.nextColor = () => state ? COLOR1 : COLOR2\n * ```\n */\n nextColor(): Colors | string {\n return this.color;\n }\n}\n\nexport default Button;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"base-button\": Button;\n \"g-button\": Button;\n }\n}\n"]}
@@ -28,7 +28,7 @@ export default Card;
28
28
  declare global {
29
29
  interface HTMLElementTagNameMap {
30
30
  "card-item": Card;
31
- "g-item": Card;
31
+ "g-card": Card;
32
32
  }
33
33
  }
34
34
  //# sourceMappingURL=card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"card.js","sourceRoot":"https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;qBAIA,YAAY,CAAC,IAAI;;;;;;;;;;;uBAWf,WAAW;0BACR,WAAW;0BACX,WAAW;;;;;;;;;;;0BAWX,WAAW;;uBAEd,WAAW;gCACF,WAAW;;;;;;;;;;;;;qBAatB,WAAW;sBACV,WAAW;;;0BAGP,WAAW;;;;;uBAKd,WAAW;;KAE7B;CACgB,AApEN,CAoEO;AAzES;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oCAAgB;AAEnB;IAAxB,KAAK,CAAC,MAAM,CAAC;mCAA+B;AACnB;IAAzB,KAAK,CAAC,OAAO,CAAC;oCAAgC;AAPpC,IAAI;IADhB,MAAM,CAAC,UAAU,CAAC;GACN,IAAI,CAsIhB;;AAED,eAAe,IAAI,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, property, query } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { ifValue } from \"../../lib/directives.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { createScope, cssvarValues, GodownElement } from \"../../supers/root.js\";\n\nconst defineName = \"card\";\nconst cssvarScope = createScope(defineName);\n\n/**\n * {@linkcode Card} renders a card.\n */\n@define(defineName)\nexport class Card extends GodownElement {\n /**\n * Enable rotate.\n */\n @property({ type: Boolean }) rotate = false;\n\n @query(\"main\") protected _main!: HTMLElement;\n @query(\"aside\") protected _aside!: HTMLElement;\n\n static styles = [\n GodownElement.styles,\n css`\n :host {\n ${cssvarScope}--offset: .25em;\n ${cssvarScope}--background: var(${cssvarValues.main});\n ${cssvarScope}--wapper-background: none;\n ${cssvarScope}--outline: 0;\n ${cssvarScope}--box-shadow: 0 .05em 1.2em 0 rgb(var(${cssvarValues.textRGB}) / 12%);\n ${cssvarScope}--hr-width: 100%;\n ${cssvarScope}--hr-height: .05em;\n ${cssvarScope}--hr-background: #80808080;\n ${cssvarScope}--padding: .75em;\n margin: auto;\n display: block;\n width: fit-content;\n color: var(${cssvarValues.text});\n border-radius: 0.2em;\n }\n\n * {\n border-radius: inherit;\n min-height: inherit;\n min-width: inherit;\n }\n\n main {\n outline: var(${cssvarScope}--outline);\n box-shadow: var(${cssvarScope}--box-shadow);\n background: var(${cssvarScope}--background);\n z-index: 2;\n position: relative;\n }\n\n aside {\n box-sizing: content-box;\n z-index: 0;\n height: 100%;\n width: 100%;\n position: absolute;\n background: var(${cssvarScope}--wapper-background);\n filter: blur(1em);\n padding: var(${cssvarScope}--offset);\n margin: calc(-1 * var(${cssvarScope}--offset));\n }\n\n div {\n width: fit-content;\n position: relative;\n }\n\n i {\n position: absolute;\n }\n\n hr {\n width: var(${cssvarScope}--hr-width);\n height: var(${cssvarScope}--hr-height);\n margin: auto;\n display: block;\n background: var(${cssvarScope}--hr-background);\n }\n\n slot {\n display: block;\n padding: var(${cssvarScope}--padding);\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n const HEADER = \"header\";\n const FOOTER = \"footer\";\n return html`<div>\n <aside></aside>\n <main>\n ${ifValue(\n this.querySlot(HEADER),\n html`\n ${htmlSlot(HEADER)}\n <hr />\n `,\n )}\n ${htmlSlot()}\n ${ifValue(\n this.querySlot(FOOTER),\n html`\n <hr />\n ${htmlSlot(FOOTER)}\n `,\n )}\n </main>\n </div>`;\n }\n\n protected firstUpdated() {\n if (this.rotate) {\n this.addEvent(this._main, \"mousemove\", this._drawRotate.bind(this));\n this.addEvent(this._aside, \"mouseleave\", this.reset.bind(this));\n }\n }\n\n /**\n * Cancel the aside offset.\n */\n reset() {\n this._main.style.transition = \".5s\";\n this._main.style.transform = \"none\";\n }\n\n /**\n * Offset aside.\n * @param e Mouse move event.\n */\n protected _drawRotate(e: MouseEvent) {\n const { left, top, width, height } = this._main.getBoundingClientRect();\n const { clientX, clientY } = e;\n const offsetX = clientX - left;\n const offsetY = clientY - top;\n const rotate = 30;\n const rotateX = -(rotate * (offsetY - height / 2)) / height / 1.5;\n const rotateY = (rotate * (offsetX - width / 2)) / width / 1.5;\n this._main.style.transform = `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`;\n this._main.style.transition = \"none\";\n }\n}\n\nexport default Card;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"card-item\": Card;\n \"g-item\": Card;\n }\n}\n"]}
1
+ {"version":3,"file":"card.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/card/card.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuB,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEhF,MAAM,UAAU,GAAG,MAAM,CAAC;AAC1B,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C;;GAEG;AAEI,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,aAAa;IAAhC;;QACL;;WAEG;QAC0B,WAAM,GAAG,KAAK,CAAC;IAkI9C,CAAC;IAvDW,MAAM;QACd,MAAM,MAAM,GAAG,QAAQ,CAAC;QACxB,MAAM,MAAM,GAAG,QAAQ,CAAC;QACxB,OAAO,IAAI,CAAA;;;UAGL,OAAO,CACP,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EACtB,IAAI,CAAA;cACA,QAAQ,CAAC,MAAM,CAAC;;WAEnB,CACF;UACC,QAAQ,EAAE;UACV,OAAO,CACP,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EACtB,IAAI,CAAA;;cAEA,QAAQ,CAAC,MAAM,CAAC;WACnB,CACF;;WAEE,CAAC;IACV,CAAC;IAES,YAAY;QACpB,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IA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Aa,CAAC,MAAM;IACpB,GAAG,CAAA;;UAEG,WAAW;UACX,WAAW,qBAAqB,YAAY,CAAC,IAAI;UACjD,WAAW;UACX,WAAW;UACX,WAAW,yCAAyC,YAAY,CAAC,OAAO;UACxE,WAAW;UACX,WAAW;UACX,WAAW;UACX,WAAW;;;;qBAIA,YAAY,CAAC,IAAI;;;;;;;;;;;uBAWf,WAAW;0BACR,WAAW;0BACX,WAAW;;;;;;;;;;;0BAWX,WAAW;;uBAEd,WAAW;gCACF,WAAW;;;;;;;;;;;;;qBAatB,WAAW;sBACV,WAAW;;;0BAGP,WAAW;;;;;uBAKd,WAAW;;KAE7B;CACgB,AApEN,CAoEO;AAzES;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oCAAgB;AAEnB;IAAxB,KAAK,CAAC,MAAM,CAAC;mCAA+B;AACnB;IAAzB,KAAK,CAAC,OAAO,CAAC;oCAAgC;AAPpC,IAAI;IADhB,MAAM,CAAC,UAAU,CAAC;GACN,IAAI,CAsIhB;;AAED,eAAe,IAAI,CAAC","sourcesContent":["import { css, type CSSResultGroup, html, property, query } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { ifValue } from \"../../lib/directives.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { createScope, cssvarValues, GodownElement } from \"../../supers/root.js\";\n\nconst defineName = \"card\";\nconst cssvarScope = createScope(defineName);\n\n/**\n * {@linkcode Card} renders a card.\n */\n@define(defineName)\nexport class Card extends GodownElement {\n /**\n * Enable rotate.\n */\n @property({ type: Boolean }) rotate = false;\n\n @query(\"main\") protected _main!: HTMLElement;\n @query(\"aside\") protected _aside!: HTMLElement;\n\n static styles = [\n GodownElement.styles,\n css`\n :host {\n ${cssvarScope}--offset: .25em;\n ${cssvarScope}--background: var(${cssvarValues.main});\n ${cssvarScope}--wapper-background: none;\n ${cssvarScope}--outline: 0;\n ${cssvarScope}--box-shadow: 0 .05em 1.2em 0 rgb(var(${cssvarValues.textRGB}) / 12%);\n ${cssvarScope}--hr-width: 100%;\n ${cssvarScope}--hr-height: .05em;\n ${cssvarScope}--hr-background: #80808080;\n ${cssvarScope}--padding: .75em;\n margin: auto;\n display: block;\n width: fit-content;\n color: var(${cssvarValues.text});\n border-radius: 0.2em;\n }\n\n * {\n border-radius: inherit;\n min-height: inherit;\n min-width: inherit;\n }\n\n main {\n outline: var(${cssvarScope}--outline);\n box-shadow: var(${cssvarScope}--box-shadow);\n background: var(${cssvarScope}--background);\n z-index: 2;\n position: relative;\n }\n\n aside {\n box-sizing: content-box;\n z-index: 0;\n height: 100%;\n width: 100%;\n position: absolute;\n background: var(${cssvarScope}--wapper-background);\n filter: blur(1em);\n padding: var(${cssvarScope}--offset);\n margin: calc(-1 * var(${cssvarScope}--offset));\n }\n\n div {\n width: fit-content;\n position: relative;\n }\n\n i {\n position: absolute;\n }\n\n hr {\n width: var(${cssvarScope}--hr-width);\n height: var(${cssvarScope}--hr-height);\n margin: auto;\n display: block;\n background: var(${cssvarScope}--hr-background);\n }\n\n slot {\n display: block;\n padding: var(${cssvarScope}--padding);\n }\n `,\n ] as CSSResultGroup;\n\n protected render(): HTMLTemplate {\n const HEADER = \"header\";\n const FOOTER = \"footer\";\n return html`<div>\n <aside></aside>\n <main>\n ${ifValue(\n this.querySlot(HEADER),\n html`\n ${htmlSlot(HEADER)}\n <hr />\n `,\n )}\n ${htmlSlot()}\n ${ifValue(\n this.querySlot(FOOTER),\n html`\n <hr />\n ${htmlSlot(FOOTER)}\n `,\n )}\n </main>\n </div>`;\n }\n\n protected firstUpdated() {\n if (this.rotate) {\n this.addEvent(this._main, \"mousemove\", this._drawRotate.bind(this));\n this.addEvent(this._aside, \"mouseleave\", this.reset.bind(this));\n }\n }\n\n /**\n * Cancel the aside offset.\n */\n reset() {\n this._main.style.transition = \".5s\";\n this._main.style.transform = \"none\";\n }\n\n /**\n * Offset aside.\n * @param e Mouse move event.\n */\n protected _drawRotate(e: MouseEvent) {\n const { left, top, width, height } = this._main.getBoundingClientRect();\n const { clientX, clientY } = e;\n const offsetX = clientX - left;\n const offsetY = clientY - top;\n const rotate = 30;\n const rotateX = -(rotate * (offsetY - height / 2)) / height / 1.5;\n const rotateY = (rotate * (offsetX - width / 2)) / width / 1.5;\n this._main.style.transform = `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`;\n this._main.style.transition = \"none\";\n }\n}\n\nexport default Card;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"card-item\": Card;\n \"g-card\": Card;\n }\n}\n"]}
@@ -33,6 +33,7 @@ export default Carousel;
33
33
  declare global {
34
34
  interface HTMLElementTagNameMap {
35
35
  "carousel-slider": Carousel;
36
+ "rotation-pool": Carousel;
36
37
  "g-carousel": Carousel;
37
38
  }
38
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/carousel/carousel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,YAAY,EAAY,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAIrD;;GAEG;AACH,qBACa,QAAS,SAAQ,aAAa;IACzC;;OAEG;IACyB,KAAK,SAAK;IACtC;;OAEG;IACyB,UAAU,SAAK;IAC3C;;OAEG;IACS,KAAK,SAAM;IAEL,QAAQ,EAAE,WAAW,CAAC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,WAAW,EAAE,CAAM;IAE3B,MAAM,CAAC,MAAM,4BAqEX;IAEF,SAAS,CAAC,MAAM,IAAI,YAAY;IAUhC,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM;IAOtB,SAAS,CAAC,YAAY;IAwBtB,oBAAoB;IAIpB,IAAI,CAAC,CAAC,EAAE,MAAM;IAMd,IAAI;IAWJ,IAAI;CAUL;AAED,eAAe,QAAQ,CAAC;AAExB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,QAAQ,CAAC;QAC5B,YAAY,EAAE,QAAQ,CAAC;KACxB;CACF"}
1
+ {"version":3,"file":"carousel.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/carousel/carousel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,YAAY,EAAY,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAIrD;;GAEG;AACH,qBACa,QAAS,SAAQ,aAAa;IACzC;;OAEG;IACyB,KAAK,SAAK;IACtC;;OAEG;IACyB,UAAU,SAAK;IAC3C;;OAEG;IACS,KAAK,SAAM;IAEL,QAAQ,EAAE,WAAW,CAAC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,WAAW,EAAE,CAAM;IAE3B,MAAM,CAAC,MAAM,4BAqEX;IAEF,SAAS,CAAC,MAAM,IAAI,YAAY;IAUhC,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM;IAOtB,SAAS,CAAC,YAAY;IAwBtB,oBAAoB;IAIpB,IAAI,CAAC,CAAC,EAAE,MAAM;IAMd,IAAI;IAWJ,IAAI;CAUL;AAED,eAAe,QAAQ,CAAC;AAExB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,QAAQ,CAAC;QAC5B,eAAe,EAAE,QAAQ,CAAC;QAC1B,YAAY,EAAE,QAAQ,CAAC;KACxB;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/carousel/carousel.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,MAAM,EA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AG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmEF;CACF,AArEY,CAqEX;AAnF0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAW;AAIV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAgB;AAI/B;IAAX,QAAQ,EAAE;uCAAY;AAEL;IAAjB,KAAK,CAAC,SAAS,CAAC;0CAAuB;AAd7B,QAAQ;IADpB,MAAM,CAAC,UAAU,CAAC;GACN,QAAQ,CAwKpB;;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import { css, html, property, query } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { htmlSlot, htmlStyle, type HTMLTemplate, svgArrow } from \"../../lib/templates.js\";\nimport { GodownElement } from \"../../supers/root.js\";\n\nconst defineName = \"carousel\";\n\n/**\n * {@linkcode Carousel} rotates child elements.\n */\n@define(defineName)\nexport class Carousel extends GodownElement {\n /**\n * The index of the element is displayed for the first time.\n */\n @property({ type: Number }) index = 0;\n /**\n * If autochangee > 0, the rotation will be automated.\n */\n @property({ type: Number }) autochange = 0;\n /**\n * Width.\n */\n @property() width = \"\";\n\n @query(\"section\") _section: HTMLElement;\n intervalID: number;\n _clone: HTMLElement[] = [];\n\n static styles = [\n css`\n :host {\n display: block;\n transition: all 0.2s;\n }\n\n div {\n overflow: hidden;\n }\n\n div,\n section {\n width: 100%;\n display: flex;\n position: relative;\n transition: inherit;\n }\n\n a {\n position: absolute;\n height: 100%;\n width: fit-content;\n z-index: 1;\n display: flex;\n align-items: center;\n }\n\n .prev {\n left: 0;\n }\n\n .prev svg {\n transform: rotate(180deg);\n }\n\n .next {\n right: 0;\n }\n\n i {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: 0.3s;\n width: 2em;\n height: 100%;\n }\n\n svg {\n flex: 1;\n max-height: 100%;\n max-width: 100%;\n }\n\n a:hover i {\n background-color: #0000001a;\n width: 2.2em;\n }\n\n i svg path {\n stroke-width: 4;\n }\n\n slot::slotted(*) {\n flex-shrink: 0 !important;\n }\n `,\n ];\n\n protected render(): HTMLTemplate {\n const style = this.width && `:host{width:${this.width.split(\";\")[0]};}`;\n return html`<div>\n <a class=\"prev\" @click=\"${this.prev}\">${this.renderA(\"pre\")}</a>\n <section>${htmlSlot()}</section>\n ${htmlStyle(style)}\n <a class=\"next\" @click=\"${this.next}\">${this.renderA(\"suf\")}</a>\n </div>`;\n }\n\n private renderA(slot: string): HTMLTemplate {\n if (this.querySelector(`[slot=${slot}]`)) {\n return htmlSlot(slot);\n }\n return html`<i>${svgArrow()}</i>`;\n }\n\n remount(index?: number) {\n super.remount(undefined);\n if (index !== undefined) {\n this.show(index);\n }\n }\n\n protected firstUpdated() {\n if (this.assigned.length) {\n if (!this.width) {\n this.width = `${this.assigned[0].offsetWidth}px`;\n }\n if (this._clone.length) {\n this._clone.forEach((element) => element.remove());\n this._clone = [];\n }\n const last = this.assigned[0].cloneNode(true) as HTMLElement;\n const first = this.assigned[this.assigned.length - 1].cloneNode(true) as HTMLElement;\n first.style.marginLeft = \"-100%\";\n this._clone.push(first, last);\n this.appendChild(last);\n this.insertBefore(first, this.firstElementChild);\n this.show(this.index);\n }\n if (this.autochange) {\n this.intervalID = setInterval(() => {\n this.next();\n }, this.autochange);\n }\n }\n\n disconnectedCallback() {\n clearInterval(this.intervalID);\n }\n\n show(i: number) {\n this.index = i;\n this._section.style.transform = `translateX(-${i}00%)`;\n this._section.style.transition = \"inherit\";\n }\n\n next() {\n if (this.index === this.assigned.length - 3) {\n this._section.style.transform = `translateX(100%)`;\n this._section.style.transition = \"none\";\n this._section.getBoundingClientRect();\n this.show(0);\n } else {\n this.show(this.index + 1);\n }\n }\n\n prev() {\n if (this.index === 0) {\n this._section.style.transform = `translateX(-${this.assigned.length - 2}00%)`;\n this._section.style.transition = `none`;\n this._section.getBoundingClientRect();\n this.show(this.assigned.length - 3);\n } else {\n this.show(this.index - 1);\n }\n }\n}\n\nexport default Carousel;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"carousel-slider\": Carousel;\n \"g-carousel\": Carousel;\n }\n}\n"]}
1
+ {"version":3,"file":"carousel.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/carousel/carousel.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAqB,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,UAAU,GAAG,UAAU,CAAC;AAE9B;;GAEG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,aAAa;IAApC;;QACL;;WAEG;QACyB,UAAK,GAAG,CAAC,CAAC;QACtC;;WAEG;QACyB,eAAU,GAAG,CAAC,CAAC;QAC3C;;WAEG;QACS,UAAK,GAAG,EAAE,CAAC;QAIvB,WAAM,GAAkB,EAAE,CAAC;IAwJ7B,CAAC;IA/EW,MAAM;QACd,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,eAAe,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACxE,OAAO,IAAI,CAAA;gCACiB,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;iBAChD,QAAQ,EAAE;QACnB,SAAS,CAAC,KAAK,CAAC;gCACQ,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;WACtD,CAAC;IACV,CAAC;IAEO,OAAO,CAAC,IAAY;QAC1B,IA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AAQ,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC;YAC9E,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,GAAG,MAAM,CAAC;YACxC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,CAAC;YACtC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACtC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;;AArJM,eAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmEF;CACF,AArEY,CAqEX;AAnF0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAW;AAIV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAgB;AAI/B;IAAX,QAAQ,EAAE;uCAAY;AAEL;IAAjB,KAAK,CAAC,SAAS,CAAC;0CAAuB;AAd7B,QAAQ;IADpB,MAAM,CAAC,UAAU,CAAC;GACN,QAAQ,CAwKpB;;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import { css, html, property, query } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { htmlSlot, htmlStyle, type HTMLTemplate, svgArrow } from \"../../lib/templates.js\";\nimport { GodownElement } from \"../../supers/root.js\";\n\nconst defineName = \"carousel\";\n\n/**\n * {@linkcode Carousel} rotates child elements.\n */\n@define(defineName)\nexport class Carousel extends GodownElement {\n /**\n * The index of the element is displayed for the first time.\n */\n @property({ type: Number }) index = 0;\n /**\n * If autochangee > 0, the rotation will be automated.\n */\n @property({ type: Number }) autochange = 0;\n /**\n * Width.\n */\n @property() width = \"\";\n\n @query(\"section\") _section: HTMLElement;\n intervalID: number;\n _clone: HTMLElement[] = [];\n\n static styles = [\n css`\n :host {\n display: block;\n transition: all 0.2s;\n }\n\n div {\n overflow: hidden;\n }\n\n div,\n section {\n width: 100%;\n display: flex;\n position: relative;\n transition: inherit;\n }\n\n a {\n position: absolute;\n height: 100%;\n width: fit-content;\n z-index: 1;\n display: flex;\n align-items: center;\n }\n\n .prev {\n left: 0;\n }\n\n .prev svg {\n transform: rotate(180deg);\n }\n\n .next {\n right: 0;\n }\n\n i {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: 0.3s;\n width: 2em;\n height: 100%;\n }\n\n svg {\n flex: 1;\n max-height: 100%;\n max-width: 100%;\n }\n\n a:hover i {\n background-color: #0000001a;\n width: 2.2em;\n }\n\n i svg path {\n stroke-width: 4;\n }\n\n slot::slotted(*) {\n flex-shrink: 0 !important;\n }\n `,\n ];\n\n protected render(): HTMLTemplate {\n const style = this.width && `:host{width:${this.width.split(\";\")[0]};}`;\n return html`<div>\n <a class=\"prev\" @click=\"${this.prev}\">${this.renderA(\"pre\")}</a>\n <section>${htmlSlot()}</section>\n ${htmlStyle(style)}\n <a class=\"next\" @click=\"${this.next}\">${this.renderA(\"suf\")}</a>\n </div>`;\n }\n\n private renderA(slot: string): HTMLTemplate {\n if (this.querySelector(`[slot=${slot}]`)) {\n return htmlSlot(slot);\n }\n return html`<i>${svgArrow()}</i>`;\n }\n\n remount(index?: number) {\n super.remount(undefined);\n if (index !== undefined) {\n this.show(index);\n }\n }\n\n protected firstUpdated() {\n if (this.assigned.length) {\n if (!this.width) {\n this.width = `${this.assigned[0].offsetWidth}px`;\n }\n if (this._clone.length) {\n this._clone.forEach((element) => element.remove());\n this._clone = [];\n }\n const last = this.assigned[0].cloneNode(true) as HTMLElement;\n const first = this.assigned[this.assigned.length - 1].cloneNode(true) as HTMLElement;\n first.style.marginLeft = \"-100%\";\n this._clone.push(first, last);\n this.appendChild(last);\n this.insertBefore(first, this.firstElementChild);\n this.show(this.index);\n }\n if (this.autochange) {\n this.intervalID = setInterval(() => {\n this.next();\n }, this.autochange);\n }\n }\n\n disconnectedCallback() {\n clearInterval(this.intervalID);\n }\n\n show(i: number) {\n this.index = i;\n this._section.style.transform = `translateX(-${i}00%)`;\n this._section.style.transition = \"inherit\";\n }\n\n next() {\n if (this.index === this.assigned.length - 3) {\n this._section.style.transform = `translateX(100%)`;\n this._section.style.transition = \"none\";\n this._section.getBoundingClientRect();\n this.show(0);\n } else {\n this.show(this.index + 1);\n }\n }\n\n prev() {\n if (this.index === 0) {\n this._section.style.transform = `translateX(-${this.assigned.length - 2}00%)`;\n this._section.style.transition = `none`;\n this._section.getBoundingClientRect();\n this.show(this.assigned.length - 3);\n } else {\n this.show(this.index - 1);\n }\n }\n}\n\nexport default Carousel;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"carousel-slider\": Carousel;\n \"rotation-pool\": Carousel;\n \"g-carousel\": Carousel;\n }\n}\n"]}
@@ -35,6 +35,7 @@ export default Dialog;
35
35
  declare global {
36
36
  interface HTMLElementTagNameMap {
37
37
  "open-dialog": Dialog;
38
+ "dialog-item": Dialog;
38
39
  "g-dialog": Dialog;
39
40
  }
40
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/dialog/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAyB,MAAM,gBAAgB,CAAC;AAE5E,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,cAAc,EAAE,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAKtE;;GAEG;AACH,qBACa,MAAO,SAAQ,cAAc;IACxC,SAAS,EAAE,UAAU,CAAY;IACjC;;OAEG;IACyC,KAAK,UAAS;IAC1D;;OAEG;IAC0B,KAAK,UAAS;IAC3C;;OAEG;IACyB,GAAG,SAAO;IACtC;;OAEG;IACyB,GAAG,SAAY;IAE7B,IAAI,EAAE,cAAc,CAAC;IAEnC,MAAM,CAAC,MAAM,EAAE,cAAc,CAkG3B;IAEF,SAAS,CAAC,MAAM,IAAI,YAAY;IAIhC,iBAAiB;IAcjB,SAAS;IAKT,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,GAAG;IAU7B,SAAS,CAAC,cAAc,CAAC,CAAC,EAAE,aAAa;IAOzC,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,WAAW;CAKvC;AAED,eAAe,MAAM,CAAC;AAEtB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;KACpB;CACF"}
1
+ {"version":3,"file":"dialog.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/dialog/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAyB,MAAM,gBAAgB,CAAC;AAE5E,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,cAAc,EAAE,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAKtE;;GAEG;AACH,qBACa,MAAO,SAAQ,cAAc;IACxC,SAAS,EAAE,UAAU,CAAY;IACjC;;OAEG;IACyC,KAAK,UAAS;IAC1D;;OAEG;IAC0B,KAAK,UAAS;IAC3C;;OAEG;IACyB,GAAG,SAAO;IACtC;;OAEG;IACyB,GAAG,SAAY;IAE7B,IAAI,EAAE,cAAc,CAAC;IAEnC,MAAM,CAAC,MAAM,EAAE,cAAc,CAkG3B;IAEF,SAAS,CAAC,MAAM,IAAI,YAAY;IAIhC,iBAAiB;IAcjB,SAAS;IAKT,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,GAAG;IAU7B,SAAS,CAAC,cAAc,CAAC,CAAC,EAAE,aAAa;IAOzC,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,WAAW;CAKvC;AAED,eAAe,MAAM,CAAC;AAEtB,OAAO,CAA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AAK,CAAC,CAAC,MAA0B,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YACtD,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC;IACH,CAAC;;AAhJM,aAAM,GAAmB;IAC9B,cAAc,CAAC,MAAM;IACrB,GAAG,CAAA;;;;;;;;;KASF;IACD,GAAG,CAAA;;UAEG,MAAM,yBAAyB,YAAY,CAAC,OAAO;UACnD,MAAM,+BAA+B,YAAY,CAAC,OAAO;;;;;;;;;;;0BAWzC,MAAM;;;;;;;;;;;0BAWN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4D3B;CACF,AAlGY,CAkGX;AAlH0C;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCAAe;AAI7B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qCAAe;AAIf;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mCAAW;AAIV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mCAAgB;AAE7B;IAAb,KAAK,CAAC,KAAK,CAAC;oCAAsB;AAnBxB,MAAM;IADlB,MAAM,CAAC,UAAU,CAAC;GACN,MAAM,CAsKlB;;AAED,eAAe,MAAM,CAAC","sourcesContent":["import { css, CSSResultGroup, html, property, query } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport GodownOpenable, { Direction9 } from \"../../supers/openable.js\";\nimport { cssvar, cssvarValues } from \"../../supers/root.js\";\n\nconst defineName = \"dialog\";\n\n/**\n * {@linkcode Dialog} similar to dialog.\n */\n@define(defineName)\nexport class Dialog extends GodownOpenable {\n direction: Direction9 = \"center\";\n /**\n * Enable modal.\n */\n @property({ type: Boolean, reflect: true }) modal = false;\n /**\n * Enable scale.\n */\n @property({ type: Boolean }) scale = false;\n /**\n * Scale gap.\n */\n @property({ type: Number }) gap = 0.2;\n /**\n * Exit key, which can be multiple.\n */\n @property({ type: String }) key = \"Escape\";\n\n @query(\"div\") _div: HTMLDivElement;\n\n static styles: CSSResultGroup = [\n GodownOpenable.styles,\n css`\n :host {\n display: block;\n transition:\n all 0.3s ease-in-out,\n color 0s,\n background 0s;\n height: fit-content;\n }\n `,\n css`\n :host {\n ${cssvar}--background: rgb(var(${cssvarValues.mainRGB}) / 0%);\n ${cssvar}--background-modal: rgb(var(${cssvarValues.mainRGB}) / 15%);\n position: fixed;\n height: 100%;\n width: 100%;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n transition: all 0.3s;\n display: flex;\n visibility: hidden;\n background: var(${cssvar}--background);\n pointer-events: none;\n }\n\n :host([open]) {\n visibility: visible;\n }\n\n :host([open][modal]) {\n pointer-events: all;\n backdrop-filter: blur(0.25px);\n background: var(${cssvar}--background-modal);\n }\n\n :host([open]) slot {\n opacity: 1 !important;\n transform: translateY(0) translateX(0) !important;\n }\n\n div {\n height: 100%;\n width: 100%;\n display: flex;\n transition: inherit;\n transform: scale(var(--s));\n }\n\n slot {\n display: block;\n width: fit-content;\n height: fit-content;\n margin: auto;\n opacity: 0;\n transition: inherit;\n pointer-events: all;\n }\n\n div {\n position: relative;\n }\n\n slot {\n position: absolute;\n }\n\n [class^=\"top\"] slot {\n top: 0;\n }\n\n [class^=\"bottom\"] slot {\n bottom: 0;\n }\n\n [class$=\"right\"] slot {\n right: 0%;\n }\n\n [class$=\"left\"] slot {\n left: 0%;\n }\n\n div[class$=\"center\"],\n .top,\n .left,\n .right,\n .bottom {\n align-items: center;\n justify-content: center;\n align-items: center;\n justify-content: center;\n }\n `,\n ];\n\n protected render(): HTMLTemplate {\n return html`<div style=\"--s:1\" class=\"${this.direction}\">${htmlSlot()}</div>`;\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.addEvent(this, \"submit\", this._handelSubmit);\n if (this.scale && this.direction === \"center\") {\n this.addEvent(this, \"wheel\", this._handleWheel);\n }\n if (this.key) {\n this.addEvent(document, \"keydown\", this._handleKeydown.bind(this));\n }\n if (this.open) {\n this.show();\n }\n }\n\n showModal() {\n this.modal = true;\n this.show();\n }\n\n protected _handleWheel(e: any) {\n let scale = Number(this._div.style.getPropertyValue(\"--s\"));\n if (e.deltaY > 0) {\n scale -= this.gap;\n } else {\n scale += this.gap;\n }\n this._div.style.setProperty(\"--s\", `${scale}`);\n }\n\n protected _handleKeydown(e: KeyboardEvent) {\n const keys = this.key.split(/[^a-zA-Z0-9]/).filter((s) => s);\n if (keys.includes(e.key) || keys.includes(e.code)) {\n this.close();\n }\n }\n\n protected _handelSubmit(e: SubmitEvent) {\n if ((e.target as HTMLFormElement).method === \"dialog\") {\n this.close();\n }\n }\n}\n\nexport default Dialog;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"open-dialog\": Dialog;\n \"g-dialog\": Dialog;\n }\n}\n"]}
1
+ {"version":3,"file":"dialog.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/dialog/dialog.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAkB,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AACrE,OAAO,cAA8B,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,UAAU,GAAG,QAAQ,CAAC;AAE5B;;GAEG;AAEI,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,cAAc;IAAnC;;QACL,cAAS,GAAe,QAAQ,CAAC;QACjC;;WAEG;QACyC,UAAK,GAAG,KAAK,CAAC;QAC1D;;WAEG;QAC0B,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;AAE7B;IAAb,KAAK,CAAC,KAAK,CAAC;oCAAsB;AAnBxB,MAAM;IADlB,MAAM,CAAC,UAAU,CAAC;GACN,MAAM,CAsKlB;;AAED,eAAe,MAAM,CAAC","sourcesContent":["import { css, CSSResultGroup, html, property, query } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport GodownOpenable, { Direction9 } from \"../../supers/openable.js\";\nimport { cssvar, cssvarValues } from \"../../supers/root.js\";\n\nconst defineName = \"dialog\";\n\n/**\n * {@linkcode Dialog} similar to dialog.\n */\n@define(defineName)\nexport class Dialog extends GodownOpenable {\n direction: Direction9 = \"center\";\n /**\n * Enable modal.\n */\n @property({ type: Boolean, reflect: true }) modal = false;\n /**\n * Enable scale.\n */\n @property({ type: Boolean }) scale = false;\n /**\n * Scale gap.\n */\n @property({ type: Number }) gap = 0.2;\n /**\n * Exit key, which can be multiple.\n */\n @property({ type: String }) key = \"Escape\";\n\n @query(\"div\") _div: HTMLDivElement;\n\n static styles: CSSResultGroup = [\n GodownOpenable.styles,\n css`\n :host {\n display: block;\n transition:\n all 0.3s ease-in-out,\n color 0s,\n background 0s;\n height: fit-content;\n }\n `,\n css`\n :host {\n ${cssvar}--background: rgb(var(${cssvarValues.mainRGB}) / 0%);\n ${cssvar}--background-modal: rgb(var(${cssvarValues.mainRGB}) / 15%);\n position: fixed;\n height: 100%;\n width: 100%;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n transition: all 0.3s;\n display: flex;\n visibility: hidden;\n background: var(${cssvar}--background);\n pointer-events: none;\n }\n\n :host([open]) {\n visibility: visible;\n }\n\n :host([open][modal]) {\n pointer-events: all;\n backdrop-filter: blur(0.25px);\n background: var(${cssvar}--background-modal);\n }\n\n :host([open]) slot {\n opacity: 1 !important;\n transform: translateY(0) translateX(0) !important;\n }\n\n div {\n height: 100%;\n width: 100%;\n display: flex;\n transition: inherit;\n transform: scale(var(--s));\n }\n\n slot {\n display: block;\n width: fit-content;\n height: fit-content;\n margin: auto;\n opacity: 0;\n transition: inherit;\n pointer-events: all;\n }\n\n div {\n position: relative;\n }\n\n slot {\n position: absolute;\n }\n\n [class^=\"top\"] slot {\n top: 0;\n }\n\n [class^=\"bottom\"] slot {\n bottom: 0;\n }\n\n [class$=\"right\"] slot {\n right: 0%;\n }\n\n [class$=\"left\"] slot {\n left: 0%;\n }\n\n div[class$=\"center\"],\n .top,\n .left,\n .right,\n .bottom {\n align-items: center;\n justify-content: center;\n align-items: center;\n justify-content: center;\n }\n `,\n ];\n\n protected render(): HTMLTemplate {\n return html`<div style=\"--s:1\" class=\"${this.direction}\">${htmlSlot()}</div>`;\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.addEvent(this, \"submit\", this._handelSubmit);\n if (this.scale && this.direction === \"center\") {\n this.addEvent(this, \"wheel\", this._handleWheel);\n }\n if (this.key) {\n this.addEvent(document, \"keydown\", this._handleKeydown.bind(this));\n }\n if (this.open) {\n this.show();\n }\n }\n\n showModal() {\n this.modal = true;\n this.show();\n }\n\n protected _handleWheel(e: any) {\n let scale = Number(this._div.style.getPropertyValue(\"--s\"));\n if (e.deltaY > 0) {\n scale -= this.gap;\n } else {\n scale += this.gap;\n }\n this._div.style.setProperty(\"--s\", `${scale}`);\n }\n\n protected _handleKeydown(e: KeyboardEvent) {\n const keys = this.key.split(/[^a-zA-Z0-9]/).filter((s) => s);\n if (keys.includes(e.key) || keys.includes(e.code)) {\n this.close();\n }\n }\n\n protected _handelSubmit(e: SubmitEvent) {\n if ((e.target as HTMLFormElement).method === \"dialog\") {\n this.close();\n }\n }\n}\n\nexport default Dialog;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"open-dialog\": Dialog;\n \"dialog-item\": Dialog;\n \"g-dialog\": Dialog;\n }\n}\n"]}
@@ -15,6 +15,7 @@ export default Divider;
15
15
  declare global {
16
16
  interface HTMLElementTagNameMap {
17
17
  "divider-line": Divider;
18
+ "div-line": Divider;
18
19
  "g-divider": Divider;
19
20
  }
20
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"divider.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/layout/divider.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAe,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAKlE;;GAEG;AACH,qBACa,OAAQ,SAAQ,aAAa;IACxC;;OAEG;IAC0B,CAAC,UAAS;IAEvC,MAAM,CAAC,MAAM,4BAiDX;IAEF,SAAS,CAAC,MAAM,IAAI,YAAY;CAOjC;AAED,eAAe,OAAO,CAAC;AAEvB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,OAAO,CAAC;QACxB,WAAW,EAAE,OAAO,CAAC;KACtB;CACF"}
1
+ {"version":3,"file":"divider.d.ts","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/layout/divider.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAe,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAKlE;;GAEG;AACH,qBACa,OAAQ,SAAQ,aAAa;IACxC;;OAEG;IAC0B,CAAC,UAAS;IAEvC,MAAM,CAAC,MAAM,4BAiDX;IAEF,SAAS,CAAC,MAAM,IAAI,YAAY;CAOjC;AAED,eAAe,OAAO,CAAC;AAEvB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,OAAO,CAAC;QACxB,UAAU,EAAE,OAAO,CAAC;QACpB,WAAW,EAAE,OAAO,CAAC;KACtB;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"divider.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/layout/divider.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAElE,MAAM,UAAU,GAAG,SAAS,CAAC;AAC7B,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C;;GAEG;AAEI,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,aAAa;IAAnC;;QACL;;WAEG;QAC0B,MAAC,GAAG,KAAK,CAAC;IA4DzC,CAAC;IAPW,MAAM;QACd,OAAO,IAAI,CAAA,eAAe,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;;QAEvC,QAAQ,EAAE;;WAEP,CAAC;IACV,CAAC;;AAzDM,cAAM,GAAG;IACd,GAAG,CAAA;;UAEG,WAAW;UACX,WAAW;UACX,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBA4BC,WAAW;yBACR,WAAW;;;sBAGd,WAAW;yBACR,WAAW;;;qBAGf,WAAW;0BACN,WAAW;;;qBAGhB,WAAW;0BACN,WAAW;;KAEhC;CACF,AAjDY,CAiDX;AAnD2B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kCAAW;AAJ5B,OAAO;IADnB,MAAM,CAAC,UAAU,CAAC;GACN,OAAO,CAgEnB;;AAED,eAAe,OAAO,CAAC","sourcesContent":["import { css, html, property } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { createScope, GodownElement } from \"../../supers/root.js\";\n\nconst defineName = \"divider\";\nconst cssvarScope = createScope(defineName);\n\n/**\n * {@linkcode Divider} similar to hr.\n */\n@define(defineName)\nexport class Divider extends GodownElement {\n /**\n * Enable vertical.\n */\n @property({ type: Boolean }) v = false;\n\n static styles = [\n css`\n :host {\n ${cssvarScope}--before-length: auto;\n ${cssvarScope}--after-length: auto;\n ${cssvarScope}--breadth: .125em;\n display: block;\n color: currentColor;\n background: none;\n }\n\n div {\n display: flex;\n align-items: center;\n border-radius: inherit;\n width: 100%;\n }\n\n hr {\n border-radius: inherit;\n margin: 0;\n border: 0;\n flex: 1;\n background: currentColor;\n }\n\n .v {\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n\n .before {\n height: var(${cssvarScope}--breadth);\n max-width: var(${cssvarScope}--before-length);\n }\n .after {\n height: var(${cssvarScope}--breadth);\n max-width: var(${cssvarScope}--after-length);\n }\n .v .before {\n width: var(${cssvarScope}--breadth);\n max-height: var(${cssvarScope}--before-length);\n }\n .v .after {\n width: var(${cssvarScope}--breadth);\n max-height: var(${cssvarScope}--after-length);\n }\n `,\n ];\n\n protected render(): HTMLTemplate {\n return html`<div class=\"${this.v ? \"v\" : \"\"}\">\n <hr class=\"before\" />\n ${htmlSlot()}\n <hr class=\"after\" />\n </div>`;\n }\n}\n\nexport default Divider;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"divider-line\": Divider;\n \"g-divider\": Divider;\n }\n}\n"]}
1
+ {"version":3,"file":"divider.js","sourceRoot":"https://github.com/startracex/godown/tree/main/src/","sources":["web-components/layout/divider.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAqB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAElE,MAAM,UAAU,GAAG,SAAS,CAAC;AAC7B,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C;;GAEG;AAEI,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,aAAa;IAAnC;;QACL;;WAEG;QAC0B,MAAC,GAAG,KAAK,CAAC;IA4DzC,CAAC;IAPW,MAAM;QACd,OAAO,IAAI,CAAA,eAAe,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;;QAEvC,QAAQ,EAAE;;WAEP,CAAC;IACV,CAAC;;AAzDM,cAAM,GAAG;IACd,GAAG,CAAA;;UAEG,WAAW;UACX,WAAW;UACX,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBA4BC,WAAW;yBACR,WAAW;;;sBAGd,WAAW;yBACR,WAAW;;;qBAGf,WAAW;0BACN,WAAW;;;qBAGhB,WAAW;0BACN,WAAW;;KAEhC;CACF,AAjDY,CAiDX;AAnD2B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kCAAW;AAJ5B,OAAO;IADnB,MAAM,CAAC,UAAU,CAAC;GACN,OAAO,CAgEnB;;AAED,eAAe,OAAO,CAAC","sourcesContent":["import { css, html, property } from \"../../.deps.js\";\nimport { define } from \"../../decorators/define.js\";\nimport { htmlSlot, type HTMLTemplate } from \"../../lib/templates.js\";\nimport { createScope, GodownElement } from \"../../supers/root.js\";\n\nconst defineName = \"divider\";\nconst cssvarScope = createScope(defineName);\n\n/**\n * {@linkcode Divider} similar to hr.\n */\n@define(defineName)\nexport class Divider extends GodownElement {\n /**\n * Enable vertical.\n */\n @property({ type: Boolean }) v = false;\n\n static styles = [\n css`\n :host {\n ${cssvarScope}--before-length: auto;\n ${cssvarScope}--after-length: auto;\n ${cssvarScope}--breadth: .125em;\n display: block;\n color: currentColor;\n background: none;\n }\n\n div {\n display: flex;\n align-items: center;\n border-radius: inherit;\n width: 100%;\n }\n\n hr {\n border-radius: inherit;\n margin: 0;\n border: 0;\n flex: 1;\n background: currentColor;\n }\n\n .v {\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n\n .before {\n height: var(${cssvarScope}--breadth);\n max-width: var(${cssvarScope}--before-length);\n }\n .after {\n height: var(${cssvarScope}--breadth);\n max-width: var(${cssvarScope}--after-length);\n }\n .v .before {\n width: var(${cssvarScope}--breadth);\n max-height: var(${cssvarScope}--before-length);\n }\n .v .after {\n width: var(${cssvarScope}--breadth);\n max-height: var(${cssvarScope}--after-length);\n }\n `,\n ];\n\n protected render(): HTMLTemplate {\n return html`<div class=\"${this.v ? \"v\" : \"\"}\">\n <hr class=\"before\" />\n ${htmlSlot()}\n <hr class=\"after\" />\n </div>`;\n }\n}\n\nexport default Divider;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"divider-line\": Divider;\n \"div-line\": Divider;\n \"g-divider\": Divider;\n }\n}\n"]}