godown 3.10.0 → 3.10.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 (53) hide show
  1. package/build/godown+lit.iife.js +2 -2
  2. package/build/godown+lit.iife.js.map +1 -1
  3. package/build/godown+lit.js +2 -2
  4. package/build/godown+lit.js.map +1 -1
  5. package/build/godown+lit.umd.js +2 -2
  6. package/build/godown+lit.umd.js.map +1 -1
  7. package/build/godown.iife.js +3 -3
  8. package/build/godown.js +2 -2
  9. package/build/godown.js.map +1 -1
  10. package/build/godown.umd.js +3 -3
  11. package/build/godown.umd.js.map +1 -1
  12. package/package.json +3 -3
  13. package/src/web-components/breath/component.ts +3 -1
  14. package/src/web-components/dialog/component.ts +3 -1
  15. package/web-components/alert/component.js +1 -1
  16. package/web-components/alert/component.js.map +1 -1
  17. package/web-components/avatar/component.js +1 -1
  18. package/web-components/avatar/component.js.map +1 -1
  19. package/web-components/breath/component.d.ts.map +1 -1
  20. package/web-components/breath/component.js +1 -1
  21. package/web-components/breath/component.js.map +1 -1
  22. package/web-components/button/component.js +1 -1
  23. package/web-components/button/component.js.map +1 -1
  24. package/web-components/carousel/component.js +1 -1
  25. package/web-components/carousel/component.js.map +1 -1
  26. package/web-components/details/component.js +1 -1
  27. package/web-components/details/component.js.map +1 -1
  28. package/web-components/dialog/component.d.ts.map +1 -1
  29. package/web-components/dialog/component.js +1 -1
  30. package/web-components/dialog/component.js.map +1 -1
  31. package/web-components/input/component.js +1 -1
  32. package/web-components/input/component.js.map +1 -1
  33. package/web-components/layout/component.js +1 -1
  34. package/web-components/layout/component.js.map +1 -1
  35. package/web-components/progress/component.js +1 -1
  36. package/web-components/progress/component.js.map +1 -1
  37. package/web-components/range/component.js +1 -1
  38. package/web-components/range/component.js.map +1 -1
  39. package/web-components/rotate/component.js +1 -1
  40. package/web-components/rotate/component.js.map +1 -1
  41. package/web-components/select/component.js +1 -1
  42. package/web-components/select/component.js.map +1 -1
  43. package/web-components/split/component.js +1 -1
  44. package/web-components/split/component.js.map +1 -1
  45. package/web-components/switch/component.js +1 -1
  46. package/web-components/switch/component.js.map +1 -1
  47. package/web-components/tabs/component.js +1 -1
  48. package/web-components/tabs/component.js.map +1 -1
  49. package/web-components/tooltip/component.js +1 -1
  50. package/web-components/tooltip/component.js.map +1 -1
  51. package/web-components/typewriter/component.js +1 -1
  52. package/web-components/typewriter/component.js.map +1 -1
  53. package/web-types.json +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "godown",
3
- "version": "3.10.0",
3
+ "version": "3.10.1",
4
4
  "description": "Web Components Library",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -21,8 +21,8 @@
21
21
  "lit": "^3.0.0",
22
22
  "tslib": "^2.7.0",
23
23
  "@godown/colors": "^1.0.0",
24
- "@godown/element": "^1.8.0",
25
- "@godown/f7-icon": "^1.0.10"
24
+ "@godown/element": "^1.8.1",
25
+ "@godown/f7-icon": "^1.0.11"
26
26
  },
27
27
  "publishConfig": {
28
28
  "access": "public"
@@ -7,6 +7,8 @@ import { GlobalStyle, cssGlobalVars, scopePrefix } from "../../internal/global-s
7
7
  const defineName = "breath";
8
8
  const cssScope = scopePrefix(defineName);
9
9
 
10
+ const splitTextRegexp = /[\s,]+/;
11
+
10
12
  /**
11
13
  * {@linkcode Breath} render the text with a breathing effect.
12
14
  *
@@ -130,7 +132,7 @@ class Breath extends GlobalStyle {
130
132
  protected getTexts(): string[] {
131
133
  return Array.isArray(this.content)
132
134
  ? this.content
133
- : (this.content || this.textContent).split(/\s+/).filter((x) => x);
135
+ : (this.content || this.textContent).split(splitTextRegexp).filter((x) => x);
134
136
  }
135
137
 
136
138
  protected _computeStyle(len: number): string {
@@ -8,6 +8,8 @@ import { SuperOpenable } from "../../internal/super-openable.js";
8
8
  const protoName = "dialog";
9
9
  const cssScope = scopePrefix(protoName);
10
10
 
11
+ const splitKeysRegexp = /[\s,]+/;
12
+
11
13
  /**
12
14
  * {@linkcode Dialog} similar to `<dialog>`.
13
15
  *
@@ -128,7 +130,7 @@ class Dialog extends SuperOpenable {
128
130
  }
129
131
 
130
132
  protected _handleKeydown(e: KeyboardEvent): void {
131
- const keys = this.key.split(/[\s,]/);
133
+ const keys = this.key.split(splitKeysRegexp);
132
134
  if (keys.includes(e.key) || keys.includes(e.code)) {
133
135
  e.preventDefault();
134
136
  this.close();
@@ -1,2 +1,2 @@
1
- import{__decorate as o}from"tslib";import{godown as r,styles as t,StyleController as e,joinRules as i,htmlSlot as c,attr as l}from"@godown/element";import s from"@godown/f7-icon/icons/checkmark-alt-circle.js";import n from"@godown/f7-icon/icons/exclamationmark-circle.js";import a from"@godown/f7-icon/icons/info-circle.js";import d from"@godown/f7-icon/icons/lightbulb.js";import p from"@godown/f7-icon/icons/question-circle.js";import g from"@godown/f7-icon/icons/slash-circle.js";import h from"@godown/f7-icon/icons/xmark-circle.js";import m from"@godown/f7-icon/icons/xmark.js";import{css as u,html as b}from"lit";import{property as v}from"lit/decorators.js";import{scopePrefix as f,cssGlobalVars as k,GlobalStyle as w}from"../../internal/global-style.js";const y="alert",$=f(y),j=o=>[k._colors[o][5],k._colors[o][9]],_={green:j("green"),blue:j("blue"),orange:j("orange"),red:j("red"),yellow:j("yellow"),purple:j("purple"),teal:j("teal"),pink:j("pink"),gray:[k._colors.lightgray[5],k._colors.darkgray[5]],white:[k._colors.lightgray[2],k._colors.darkgray[7]],black:[k._colors.darkgray[8],k._colors.lightgray[5]]},C={tip:{color:"teal",icon:d},success:{color:"green",icon:s},info:{color:"blue",icon:a},warning:{color:"orange",icon:n},danger:{color:"red",icon:h},error:{color:"red",icon:h},help:{color:"purple",icon:p},deprecated:{color:"gray",icon:g}};let q=class Alert extends w{constructor(){super(...arguments),this.__colorSC=new e(this,(()=>{const o=C[this.call]?.color||this.color;if(o in _){const[r,t]=_[o];return i({":host":[[`${$}--color`,`var(${r})`],[`${$}--background`,`var(${t})`]]})}return null})),this.color="blue",this.autoclose=0,this.hideClose=!1,this.variant="dark"}render(){const o=this.call?C[this.call].icon():c("icon");return b`<div part="root" ${l(this.observedRecord)}><div part="icon" class="start" > ${o} </div><div part="content"><strong part="title">${this.title||c("title")}</strong> ${this.content||c()} </div> ${this.hideClose||"blockquote"===this.variant?"":b`<div part="icon close" class="end" tabindex="0" @click="${this.close}"> ${m()} </div>`} </div>`}close(){this.remove(),this.dispatchCustomEvent("close",void 0,{bubbles:!0})}firstUpdated(){this.autoclose&&this.timeouts.add(setTimeout((()=>this.close()),this.autoclose))}static alert(o,r){const t=new this;return Object.assign(t,r),o.appendChild(t),t}};o([v()],q.prototype,"call",void 0),o([v()],q.prototype,"color",void 0),o([v({type:Number})],q.prototype,"autoclose",void 0),o([v()],q.prototype,"title",void 0),o([v()],q.prototype,"content",void 0),o([v({type:Boolean})],q.prototype,"hideClose",void 0),o([v()],q.prototype,"variant",void 0),q=o([r(y),t(u`:host{${$}--border-width:.075em;${$}--blockquote-width:.2em;${$}--blockquote-background:transparent;${$}--gap:.5em}:host,:where(:host([contents]) [part=root]){display:block}[part=root]{align-items:center;background:var(${$}--background);border-color:currentColor;border-radius:inherit;border-style:solid;border-width:var(${$}--border-width);color:var(${$}--color,currentColor);display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:auto 1fr;padding:var(${$}--gap)}[variant=blockquote]{background:var(${$}--blockquote-background);border-radius:0;border-width:0;border-left-width:var(${$}--blockquote-width)}[part~=icon]{align-items:center;display:grid;height:2em}.start svg{margin-inline-end:var(${$}--gap)}.end svg{margin-inline-start:var(${$}--gap)}svg{height:1.25em;width:1.25em}[part=content]{grid-row:span 2/span 2}`)],q);var x=q;export{q as Alert,x as default};
1
+ import{__decorate as o}from"tslib";import{godown as r,styles as t,StyleController as e,joinRules as i,htmlSlot as c,attr as l}from"@godown/element";import s from"@godown/f7-icon/icons/checkmark-alt-circle.js";import n from"@godown/f7-icon/icons/exclamationmark-circle.js";import a from"@godown/f7-icon/icons/info-circle.js";import d from"@godown/f7-icon/icons/lightbulb.js";import p from"@godown/f7-icon/icons/question-circle.js";import g from"@godown/f7-icon/icons/slash-circle.js";import h from"@godown/f7-icon/icons/xmark-circle.js";import m from"@godown/f7-icon/icons/xmark.js";import{css as u,html as b}from"lit";import{property as v}from"lit/decorators.js";import{scopePrefix as f,cssGlobalVars as k,GlobalStyle as w}from"../../internal/global-style.js";const y="alert",$=f(y),j=o=>[k._colors[o][5],k._colors[o][9]],_={green:j("green"),blue:j("blue"),orange:j("orange"),red:j("red"),yellow:j("yellow"),purple:j("purple"),teal:j("teal"),pink:j("pink"),gray:[k._colors.lightgray[5],k._colors.darkgray[5]],white:[k._colors.lightgray[2],k._colors.darkgray[7]],black:[k._colors.darkgray[8],k._colors.lightgray[5]]},C={tip:{color:"teal",icon:d},success:{color:"green",icon:s},info:{color:"blue",icon:a},warning:{color:"orange",icon:n},danger:{color:"red",icon:h},error:{color:"red",icon:h},help:{color:"purple",icon:p},deprecated:{color:"gray",icon:g}};let q=class Alert extends w{constructor(){super(...arguments),this.__colorSC=new e(this,(()=>{const o=C[this.call]?.color||this.color;if(o in _){const[r,t]=_[o];return i({":host":[[`${$}--color`,`var(${r})`],[`${$}--background`,`var(${t})`]]})}return null})),this.color="blue",this.autoclose=0,this.hideClose=!1,this.variant="dark"}render(){const o=this.call?C[this.call].icon():c("icon");return b`<div part="root" ${l(this.observedRecord)}> <div part="icon" class="start"> ${o} </div> <div part="content"> <strong part="title">${this.title||c("title")}</strong> ${this.content||c()} </div> ${this.hideClose||"blockquote"===this.variant?"":b`<div part="icon close" class="end" tabindex="0" @click="${this.close}"> ${m()} </div>`} </div>`}close(){this.remove(),this.dispatchCustomEvent("close",void 0,{bubbles:!0})}firstUpdated(){this.autoclose&&this.timeouts.add(setTimeout((()=>this.close()),this.autoclose))}static alert(o,r){const t=new this;return Object.assign(t,r),o.appendChild(t),t}};o([v()],q.prototype,"call",void 0),o([v()],q.prototype,"color",void 0),o([v({type:Number})],q.prototype,"autoclose",void 0),o([v()],q.prototype,"title",void 0),o([v()],q.prototype,"content",void 0),o([v({type:Boolean})],q.prototype,"hideClose",void 0),o([v()],q.prototype,"variant",void 0),q=o([r(y),t(u`:host{${$}--border-width:.075em;${$}--blockquote-width:.2em;${$}--blockquote-background:transparent;${$}--gap:.5em}:host,:where(:host([contents]) [part=root]){display:block}[part=root]{align-items:center;background:var(${$}--background);border-color:currentColor;border-radius:inherit;border-style:solid;border-width:var(${$}--border-width);color:var(${$}--color,currentColor);display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:auto 1fr;padding:var(${$}--gap)}[variant=blockquote]{background:var(${$}--blockquote-background);border-radius:0;border-width:0;border-left-width:var(${$}--blockquote-width)}[part~=icon]{align-items:center;display:grid;height:2em}.start svg{margin-inline-end:var(${$}--gap)}.end svg{margin-inline-start:var(${$}--gap)}svg{height:1.25em;width:1.25em}[part=content]{grid-row:span 2/span 2}`)],q);var x=q;export{q as Alert,x as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/src/web-components/alert/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","genDark","key","cssGlobalVars","_colors","colorDetails","green","blue","orange","red","yellow","purple","teal","pink","gray","lightgray","darkgray","white","black","calls","tip","color","icon","iconLightbulb","success","iconCheckAltCircle","info","iconInfoCircle","warning","iconExclamationCircle","danger","iconXmarkCircle","error","help","iconQuestionCircle","deprecated","iconSlashCircle","Alert","GlobalStyle","constructor","this","__colorSC","StyleController","call","fg","bg","joinRules","autoclose","hideClose","variant","render","htmlSlot","html","attr","observedRecord","title","content","alert","root","option","Object","assign","ai","appendChild","prototype","property","__decorate","type","godown","styles","css"],"mappings":"wvBAcA,MAAMA,EAAY,QACZC,EAAWC,EAAYF,GAEvBG,EAAWC,GACR,CAACC,EAAcC,QAAQF,GAAK,GAAIC,EAAcC,QAAQF,GAAK,IAG9DG,EAAe,CACnBC,MAAOL,EAAQ,SACfM,KAAMN,EAAQ,Q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AAAe,OAAAJ,EAAA,qBAAAX,KAAAgB,SAAAL,cAAAX,KAAAQ,WAAA,eAAAR,KAAAS,4GAGL,4FAMET,KAAIO,2EAGiB,CACrB,YAAAU,CAAKC,EAAAC,2BAEPC,OAAKC,OAASC,EAAAH,GACdD,EAACK,YAAGD,eAMYzB,EAAA2B,UAAA,YAAA,MAERC,iCAELC,EAAA,qBAERF,UAAA,iBAAA,KACH,CAEAC,OACMD,UAAO,aAAE,GACbE,EAAA,CACFD,OAEsBD,UAAA,eAAA,GACpBE,EAAA,GACM,CAAAC,kBACNH,UAAA,iBAAA,KACF,CAEAC,KACE5B,EAAA2B,UAAe,eAAM,GACrB3B,EAAA6B,EAAa,CACbE,EAAAtE,GACAuE,EAAAC,CAAO,SAAEvE,0BAAAA,4BAAAA,wCAAAA,uHAAAA,sGAAAA,8BAAAA,mHAAAA,+CAAAA,kFAAAA,iHAAAA,4CAAAA,2FAEZsC"}
1
+ {"version":3,"file":"component.js","sources":["../../src/src/web-components/alert/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","genDark","key","cssGlobalVars","_colors","colorDetails","green","blue","orange","red","yellow","purple","teal","pink","gray","lightgray","darkgray","white","black","calls","tip","color","icon","iconLightbulb","success","iconCheckAltCircle","info","iconInfoCircle","warning","iconExclamationCircle","danger","iconXmarkCircle","error","help","iconQuestionCircle","deprecated","iconSlashCircle","Alert","GlobalStyle","constructor","this","__colorSC","StyleController","call","fg","bg","joinRules","autoclose","hideClose","variant","render","htmlSlot","html","attr","observedRecord","title","content","alert","root","option","Object","assign","ai","appendChild","prototype","property","__decorate","type","godown","styles","css"],"mappings":"wvBAcA,MAAMA,EAAY,QACZC,EAAWC,EAAYF,GAEvBG,EAAWC,GACR,CAACC,EAAcC,QAAQF,GAAK,GAAIC,EAAcC,QAAQF,GAAK,IAG9DG,EAAe,CACnBC,MAAOL,EAAQ,SACfM,KAAMN,EAAQ,QACdO,OAAQP,EAAQ,UAChBQ,IAAKR,EAAQ,O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,cAAAX,KAAAQ,WAAA,eAAAR,KAAAS,4GAGL,4FAMET,KAAIO,2EAGiB,CACrB,YAAAU,CAAKC,EAAAC,2BAEPC,OAAKC,OAASC,EAAAH,GACdD,EAACK,YAAGD,eAMYzB,EAAA2B,UAAA,YAAA,MAERC,iCAELC,EAAA,qBAERF,UAAA,iBAAA,KACH,CAEAC,OACMD,UAAO,aAAE,GACbE,EAAA,CACFD,OAEsBD,UAAA,eAAA,GACpBE,EAAA,GACM,CAAAC,kBACNH,UAAA,iBAAA,KACF,CAEAC,KACE5B,EAAA2B,UAAe,eAAM,GACrB3B,EAAA6B,EAAa,CACbE,EAAAtE,GACAuE,EAAAC,CAAO,SAAEvE,0BAAAA,4BAAAA,wCAAAA,uHAAAA,sGAAAA,8BAAAA,mHAAAA,+CAAAA,kFAAAA,iHAAAA,4CAAAA,2FAEZsC"}
@@ -1,2 +1,2 @@
1
- import{__decorate as r}from"tslib";import{godown as t,styles as e,attr as o,omit as i,htmlSlot as a}from"@godown/element";import{css as s,html as n}from"lit";import{property as d}from"lit/decorators.js";import{cssGlobalVars as h,GlobalStyle as m}from"../../internal/global-style.js";let p=class Avatar extends m{constructor(){super(...arguments),this.name="",this.round=!1}render(){return n`<div part="root" ${o(i(this.observedRecord,"src"))}> ${this._renderAvatar()} </div>`}_renderAvatar(){return this.src?n`<img part="image" src="${this.src}" alt="${this.name}" @error=${this._handleError}>`:this.name?n`<span part="name">${this.formatName()}</span>`:a()}formatName(){return this.name}_handleError(){this.src=void 0}};r([d()],p.prototype,"src",void 0),r([d()],p.prototype,"name",void 0),r([d({type:Boolean})],p.prototype,"round",void 0),p=r([t("avatar"),e(s`:host{background:var(${h.passive});height:2em;overflow:hidden;vertical-align:bottom;width:2em}:host,[part=root]{display:inline-flex}:host([contents]) [part=root]{display:inline-flex;height:inherit;width:inherit}:host([round]){border-radius:50%}[part=image]{height:100%;object-fit:cover;width:100%}[part=root]{align-items:center;border-radius:inherit;justify-content:center;position:relative}`)],p);var l=p;export{p as Avatar,l as default};
1
+ import{__decorate as r}from"tslib";import{godown as t,styles as e,attr as o,omit as i,htmlSlot as a}from"@godown/element";import{css as s,html as n}from"lit";import{property as d}from"lit/decorators.js";import{cssGlobalVars as h,GlobalStyle as m}from"../../internal/global-style.js";let p=class Avatar extends m{constructor(){super(...arguments),this.name="",this.round=!1}render(){return n`<div part="root" ${o(i(this.observedRecord,"src"))}> ${this._renderAvatar()} </div>`}_renderAvatar(){return this.src?n`<img part="image" src="${this.src}" alt="${this.name}" @error=${this._handleError}/>`:this.name?n`<span part="name">${this.formatName()}</span>`:a()}formatName(){return this.name}_handleError(){this.src=void 0}};r([d()],p.prototype,"src",void 0),r([d()],p.prototype,"name",void 0),r([d({type:Boolean})],p.prototype,"round",void 0),p=r([t("avatar"),e(s`:host{background:var(${h.passive});height:2em;overflow:hidden;vertical-align:bottom;width:2em}:host,[part=root]{display:inline-flex}:host([contents]) [part=root]{display:inline-flex;height:inherit;width:inherit}:host([round]){border-radius:50%}[part=image]{height:100%;object-fit:cover;width:100%}[part=root]{align-items:center;border-radius:inherit;justify-content:center;position:relative}`)],p);var l=p;export{p as Avatar,l as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/src/web-components/avatar/component.ts"],"sourcesContent":null,"names":["Avatar","GlobalStyle","constructor","this","name","round","render","html","attr","omit","observedRecord","_renderAvatar","formatName","htmlSlot","_handleError","src","undefined","prototype","__decorate","type","Boolean","styles","css","cssGlobalVars","passive","Avatar$1"],"mappings":"2RAuDA,IAAMA,EAAN,MAAMA,eAAeC,EAArB,WAAAC,uBAYEC,KAAIC,KAAG,GAMPD,KAAKE,OAAG,EAEE,MAAAC,GACR,OAAOC,CAAI,oBAAAC,EAAAC,EAAAN,KAAAO,eAAA,YAAAP,KAAAQ,gDAGDR,0GAITI,CAAA,qBAAAJ,KAAAS,sBAGoBC,GACrB,CACE,UAAAD,oBAGW,YAAAE,GACAX,KAAAY,SAAAC,CACE,KAEZ,MAEHhB,EAAAiB,UAAa,WAAE,GACbC,EAAA,QAECD,UAAA,YAAA,KACH,GACO,CAAAE,KAAAC,aACTH,UAAA,aAAA,KAEUC,EAAA,GAnGM,UAqGhBG,EAAAC,CAAA,wBAAAC,EAAAC,qXAGE,IAAAC,EAAKzB"}
1
+ {"version":3,"file":"component.js","sources":["../../src/src/web-components/avatar/component.ts"],"sourcesContent":null,"names":["Avatar","GlobalStyle","constructor","this","name","round","render","html","attr","omit","observedRecord","_renderAvatar","formatName","htmlSlot","_handleError","src","undefined","prototype","__decorate","type","Boolean","styles","css","cssGlobalVars","passive","Avatar$1"],"mappings":"2RAuDA,IAAMA,EAAN,MAAMA,eAAeC,EAArB,WAAAC,uBAYEC,KAAIC,KAAG,GAMPD,KAAKE,OAAG,EAEE,MAAAC,GACR,OAAOC,CAAI,oBAAAC,EAAAC,EAAAN,KAAAO,eAAA,YAAAP,KAAAQ,gDAGDR,2GAITI,CAAA,qBAAAJ,KAAAS,sBAGoBC,GACrB,CACE,UAAAD,oBAGW,YAAAE,GACAX,KAAAY,SAAAC,CACE,KAEZ,MAEHhB,EAAAiB,UAAa,WAAE,GACbC,EAAA,QAECD,UAAA,YAAA,KACH,GACO,CAAAE,KAAAC,aACTH,UAAA,aAAA,KAEUC,EAAA,GAnGM,UAqGhBG,EAAAC,CAAA,wBAAAC,EAAAC,qXAGE,IAAAC,EAAKzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/web-components/breath/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAA8B,MAAM,gCAAgC,CAAC;AAKzF;;;;;;;;;;;;;;GAcG;AACH,cAqEM,MAAO,SAAQ,WAAW;IAC9B;;;;OAIG;IAEH,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE3B;;OAEG;IAEH,QAAQ,EAAE,MAAM,CAAC;IAEjB,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAYrC,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC;IAStD,SAAS,CAAC,QAAQ,IAAI,MAAM,EAAE;IAM9B,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;CAa7C;AAED,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/web-components/breath/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAA8B,MAAM,gCAAgC,CAAC;AAOzF;;;;;;;;;;;;;;GAcG;AACH,cAqEM,MAAO,SAAQ,WAAW;IAC9B;;;;OAIG;IAEH,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE3B;;OAEG;IAEH,QAAQ,EAAE,MAAM,CAAC;IAEjB,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAYrC,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC;IAStD,SAAS,CAAC,QAAQ,IAAI,MAAM,EAAE;IAM9B,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;CAa7C;AAED,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{godown as o,styles as r,attr as e,htmlStyle as n}from"@godown/element";import{css as i,html as a}from"lit";import{property as l}from"lit/decorators.js";import{scopePrefix as s,cssGlobalVars as c,GlobalStyle as p}from"../../internal/global-style.js";const d="breath",$=s(d);let m=class Breath extends p{render(){const t=this.getTexts();return a`<div part="root" ${e(this.observedRecord)}> ${[t.map(this._renderText),n(this._computeStyle(t.length))]} </div>`}_renderText(t){return a`<span class="rel"><span class="nocolor">${t}</span><span class="colorful">${t}</span></span>`}getTexts(){return Array.isArray(this.content)?this.content:(this.content||this.textContent).split(/\s+/).filter((t=>t))}_computeStyle(t){const o=50/t,r=this.duration||1e3*(2*t+2);let e="";for(let o=1;o<=t;o++){e+=`.rel:nth-child(${o}) .colorful{animation-delay:${-r/t*(t-o+1)}ms;background:var(${$}--${o},var(${$}--${(o-1)%3+1}));}`}return`.colorful{animation-duration:${r}ms;}@keyframes colorfulN{0%,${3*o}%{opacity:0;}${o}%,${2*o}%{opacity:1;}}${e}`}};t([l()],m.prototype,"content",void 0),t([l({type:Number})],m.prototype,"duration",void 0),m=t([o(d),r(i`:host{${$}--deg:60deg;${$}--1-1:var(${c._colors.red[5]});${$}--1-2:var(${c._colors.yellow[5]});${$}--2-1:var(${c._colors.green[5]});${$}--2-2:var(${c._colors.purple[5]});${$}--3-1:var(${c._colors.blue[5]});${$}--3-2:var(${c._colors.pink[5]});${$}--1:linear-gradient(var(${$}--deg),var(${$}--1-1),var(${$}--1-2));${$}--2:linear-gradient(var(${$}--deg),var(${$}--2-1),var(${$}--2-2));${$}--3:linear-gradient(var(${$}--deg),var(${$}--3-1),var(${$}--3-2))}`,i`:host{align-items:center;direction:ltr;font-size:2em;margin:auto;width:-moz-fit-content;width:fit-content}:host,:host([contents]) [part=root]{display:flex}[part=root]{display:contents}::selection{background:none}.rel{font-size:inherit;font-weight:800;letter-spacing:-.05em;position:relative}`,i`.colorful,.nocolor{animation-iteration-count:infinite;-webkit-background-clip:text!important;background-clip:text!important;box-sizing:border-box;color:transparent;display:inline-block;padding:0 .05em}.colorful{animation-name:colorfulN;opacity:0}.nocolor{background:var(${c.clipBackground});position:absolute;top:0}`)],m);var u=m;export{m as Breath,u as default};
1
+ import{__decorate as t}from"tslib";import{godown as o,styles as r,attr as e,htmlStyle as n}from"@godown/element";import{css as i,html as a}from"lit";import{property as l}from"lit/decorators.js";import{scopePrefix as s,cssGlobalVars as c,GlobalStyle as p}from"../../internal/global-style.js";const d="breath",$=s(d),m=/[\s,]+/;let u=class Breath extends p{render(){const t=this.getTexts();return a`<div part="root" ${e(this.observedRecord)}> ${[t.map(this._renderText),n(this._computeStyle(t.length))]} </div>`}_renderText(t){return a`<span class="rel"> <span class="nocolor">${t}</span> <span class="colorful">${t}</span> </span>`}getTexts(){return Array.isArray(this.content)?this.content:(this.content||this.textContent).split(m).filter((t=>t))}_computeStyle(t){const o=50/t,r=this.duration||1e3*(2*t+2);let e="";for(let o=1;o<=t;o++){e+=`.rel:nth-child(${o}) .colorful{animation-delay:${-r/t*(t-o+1)}ms;background:var(${$}--${o},var(${$}--${(o-1)%3+1}));}`}return`.colorful{animation-duration:${r}ms;}@keyframes colorfulN{0%,${3*o}%{opacity:0;}${o}%,${2*o}%{opacity:1;}}${e}`}};t([l()],u.prototype,"content",void 0),t([l({type:Number})],u.prototype,"duration",void 0),u=t([o(d),r(i`:host{${$}--deg:60deg;${$}--1-1:var(${c._colors.red[5]});${$}--1-2:var(${c._colors.yellow[5]});${$}--2-1:var(${c._colors.green[5]});${$}--2-2:var(${c._colors.purple[5]});${$}--3-1:var(${c._colors.blue[5]});${$}--3-2:var(${c._colors.pink[5]});${$}--1:linear-gradient(var(${$}--deg),var(${$}--1-1),var(${$}--1-2));${$}--2:linear-gradient(var(${$}--deg),var(${$}--2-1),var(${$}--2-2));${$}--3:linear-gradient(var(${$}--deg),var(${$}--3-1),var(${$}--3-2))}`,i`:host{align-items:center;direction:ltr;font-size:2em;margin:auto;width:-moz-fit-content;width:fit-content}:host,:host([contents]) [part=root]{display:flex}[part=root]{display:contents}::selection{background:none}.rel{font-size:inherit;font-weight:800;letter-spacing:-.05em;position:relative}`,i`.colorful,.nocolor{animation-iteration-count:infinite;-webkit-background-clip:text!important;background-clip:text!important;box-sizing:border-box;color:transparent;display:inline-block;padding:0 .05em}.colorful{animation-name:colorfulN;opacity:0}.nocolor{background:var(${c.clipBackground});position:absolute;top:0}`)],u);var g=u;export{u as Breath,g as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/src/web-components/breath/component.ts"],"sourcesContent":null,"names":["defineName","cssScope","scopePrefix","Breath","GlobalStyle","render","texts","this","getTexts","html","attr","observedRecord","map","_renderText","htmlStyle","_computeStyle","length","text","content","textContent","split","filter","x","len","style1","number","duration","gap","__decorate","property","prototype","type","Number","godown","css","cssGlobalVars","_colors","red","yellow","green","purple","blue","pink","clipBackground"],"mappings":"mSAMA,MAAMA,EAAa,SACbC,EAAWC,EAAYF,GAsF7B,IAAMG,EAAN,MAAMA,eAAeC,EAeT,MAAAC,GACR,MAAMC,EAAQC,KAAKC,WACnB,OAAOC,CAAI,oBAAAC,EAAAH,KAAAI,oBAAA,CAAAL,EAAAM,IAAAL,KAAAM,aAAAC,EAAAP,KAAAQ,cAAAT,EAAAU,kCAGL,OAAKP,CAAK,2CAAeQ,kCAAAA,gEAI9BV,KAAAW,SACHX,KAAAW,SAAAX,KAAAY,aAAAC,MAAA,OAAAC,QAAAC,GAAAA,GAEU,CACR,aAAAP,kCAEgC,KAAA,EAAAQ,EAAA,kCAMhBC,GAAA,kBAAAC,iCAHfC,EAAAH,GAAAA,EAAAE,EAAA,uBAGexB,MAAAwB,SAAAxB,OAFlBwB,EAAA,GAAA,EAAA,OAGE,OACQ,gCAAQC,gCAAA,EAAAC,iBAAAA,MAAA,EAAAA,kBAAAH,MAIRI,EAAA,CACRC,KACA1B,EAAA2B,UAAc,oBACV,CACJD,EAAK,CAAIE,KAAAC,UACP7B,EAAA2B,0BAAgB,GAChB3B,EAAAyB,EAAmB,CACnBK,EAAAjC,KACFkC,CAAA,SAAAjC,gBAAAA,cAAAkC,EAAAC,QAAAC,IAAA,OAAApC,cAAAkC,EAAAC,QAAAE,OAAA,OAAArC,cAAAkC,EAAAC,QAAAG,MAAA,OAAAtC,cAAAkC,EAAAC,QAAAI,OAAA,OAAAvC,cAAAkC,EAAAC,QAAAK,KAAA,OAAAxC,cAAAkC,EAAAC,QAAAM,KAAA,OAAAzC,4BAAAA,eAAAA,eAAAA,YAAAA,4BAAAA,eAAAA,eAAAA,YAAAA,4BAAAA,eAAAA,eAAAA,YAAAiC,CAAA,sSAAAA,CAAA,iRAAAC,EAAAQ,6CACAxC,SAGFA"}
1
+ {"version":3,"file":"component.js","sources":["../../src/src/web-components/breath/component.ts"],"sourcesContent":null,"names":["defineName","cssScope","scopePrefix","splitTextRegexp","Breath","GlobalStyle","render","texts","this","getTexts","html","attr","observedRecord","map","_renderText","htmlStyle","_computeStyle","length","text","content","textContent","split","filter","x","len","style1","number","duration","gap","__decorate","property","prototype","type","Number","godown","css","cssGlobalVars","_colors","red","yellow","green","purple","blue","pink","clipBackground"],"mappings":"mSAMA,MAAMA,EAAa,SACbC,EAAWC,EAAYF,GAEvBG,EAAkB,SAsFxB,IAAMC,EAAN,MAAMA,eAAeC,EAeT,MAAAC,GACR,MAAMC,EAAQC,KAAKC,WACnB,OAAOC,CAAI,oBAAAC,EAAAH,KAAAI,oBAAA,CAAAL,EAAAM,IAAAL,KAAAM,aAAAC,EAAAP,KAAAQ,cAAAT,EAAAU,kCAGL,OAAKP,CAAK,4CAAeQ,mCAAAA,iEAI9BV,KAAAW,SACHX,KAAAW,SAAAX,KAAAY,aAAAC,MAAAlB,GAAAmB,QAAAC,GAAAA,GAEU,CACR,aAAAP,kCAEgC,KAAA,EAAAQ,EAAA,kCAMhBC,GAAA,kBAAAC,iCAHfC,EAAAH,GAAAA,EAAAE,EAAA,uBAGezB,MAAAyB,SAAAzB,OAFlByB,EAAA,GAAA,EAAA,OAGE,OACQ,gCAAQC,gCAAA,EAAAC,iBAAAA,MAAA,EAAAA,kBAAAH,MAIRI,EAAA,CACRC,KACA1B,EAAA2B,UAAc,oBACV,CACJD,EAAK,CAAIE,KAAAC,UACP7B,EAAA2B,0BAAgB,GAChB3B,EAAAyB,EAAmB,CACnBK,EAAAlC,KACFmC,CAAA,SAAAlC,gBAAAA,cAAAmC,EAAAC,QAAAC,IAAA,OAAArC,cAAAmC,EAAAC,QAAAE,OAAA,OAAAtC,cAAAmC,EAAAC,QAAAG,MAAA,OAAAvC,cAAAmC,EAAAC,QAAAI,OAAA,OAAAxC,cAAAmC,EAAAC,QAAAK,KAAA,OAAAzC,cAAAmC,EAAAC,QAAAM,KAAA,OAAA1C,4BAAAA,eAAAA,eAAAA,YAAAA,4BAAAA,eAAAA,eAAAA,YAAAA,4BAAAA,eAAAA,eAAAA,YAAAkC,CAAA,sSAAAA,CAAA,iRAAAC,EAAAQ,6CACAxC,SAGFA"}
@@ -1,2 +1,2 @@
1
- import{__decorate as o}from"tslib";import{part as t,godown as r,styles as e,StyleController as a,joinRules as i,attr as n,htmlSlot as l}from"@godown/element";import{css as s,html as d}from"lit";import{property as c}from"lit/decorators.js";import{scopePrefix as p,cssGlobalVars as h,GlobalStyle as g}from"../../internal/global-style.js";const u="button",v=p(u),y=h.white,b=h.black,m={black:[y,h._colors.darkgray[7],h._colors.darkgray[5]],gray:[y,h._colors.darkgray[1],h._colors.lightgray[8]],white:[b,h._colors.lightgray[3],h._colors.lightgray[0]],blue:[y,h._colors.blue[6],h._colors.blue[4]],green:[y,h._colors.green[6],h._colors.green[4]],red:[y,h._colors.red[6],h._colors.red[4]],orange:[y,h._colors.orange[6],h._colors.orange[4]],pink:[y,h._colors.pink[6],h._colors.pink[4]],purple:[y,h._colors.purple[6],h._colors.purple[4]],yellow:[b,h._colors.yellow[6],h._colors.yellow[4]],teal:[y,h._colors.teal[6],h._colors.teal[4]]};let $=class Button extends g{constructor(){super(...arguments),this.__colorSC=new a(this,(()=>{const o=this.nextColor();if(o in m){const[t,r,e]=m[o];return i({":host":[[`${v}--color`,`var(${t})`],[`${v}--background`,`var(${r})`],[`${v}--gradients`,`var(${e})`]]})}return null})),this.plain=!1,this.disabled=!1,this.ghost=!1,this.active=!1,this.round=!1,this.color="black"}render(){return d`<div part="root" ${n(this.observedRecord)}> ${this.content||l()} <span part="modal-root"></span></div>`}focus(){this.disabled||(this.active=!0,super.focus())}blur(){this.active=!1,super.blur()}connectedCallback(){super.connectedCallback(),this.events.add(this,"click",this._handelClick,!0)}_handelClick(o){if(this.disabled)return o.stopPropagation(),void o.preventDefault();this.plain||this._handleModal(o)}_handleModal(o){const t=document.createElement("i"),{width:r,height:e}=this.getBoundingClientRect(),{x:a,y:i}=this._root.getBoundingClientRect(),n=2*Math.sqrt(e**2+r**2)+"px";t.style.height=n,t.style.width=n,t.style.left=o.x-a+"px",t.style.top=o.y-i+"px",t.style.animationName="kf",this._modalRoot.appendChild(t),t.addEventListener("animationend",(()=>t.remove()),{once:!0})}nextColor(){return this.color}};o([c({type:Boolean,reflect:!0})],$.prototype,"plain",void 0),o([c({type:Boolean,reflect:!0})],$.prototype,"disabled",void 0),o([c({type:Boolean,reflect:!0})],$.prototype,"ghost",void 0),o([c({type:Boolean,reflect:!0})],$.prototype,"active",void 0),o([c({type:Boolean,reflect:!0})],$.prototype,"round",void 0),o([c({reflect:!0})],$.prototype,"color",void 0),o([c()],$.prototype,"content",void 0),o([t("modal-root")],$.prototype,"_modalRoot",void 0),o([t("root")],$.prototype,"_root",void 0),$=o([r(u),e(s`:host(:not([disabled]):active){transform:scale(var(${v}--focus-scale))}:host([round]){border-radius:calc(infinity*1px)}:host([disabled]){cursor:not-allowed;filter:brightness(.85)}:host([ghost]){${v}--modal-background:var(${v}--ghost-color);background:transparent;box-shadow:inset 0 0 0 var(${v}--ghost-width) var(${v}--ghost-color);color:var(${v}--ghost-color)}:host([plain]){${v}--gradients:unset;${v}--focus-scale:unset}`,s`:host{${v}--padding-x:.8em;${v}--padding-y:calc(var(${v}--padding-x)/4);${v}--padding:var(${v}--padding-y) var(${v}--padding-x);${v}--modal-animation-duration:1s;${v}--ghost-width:.08em;${v}--focus-scale:.97;${v}--deg:45deg;${v}--ghost-color:var(${v}--background);background:linear-gradient(var(${v}--deg),var(${v}--background),var(${v}--gradients,var(${v}--background)));color:var(${v}--color,inherit);cursor:pointer;display:block;overflow:hidden;padding:var(${v}--padding);text-align:center;width:-moz-fit-content;width:fit-content}[part=root]:not([contents]){height:100%;width:100%}[part=root]{border-radius:inherit;position:relative;transition:none;transition-duration:inherit;-webkit-user-select:none;user-select:none}i{animation-duration:var(${v}--modal-animation-duration);background:var(${v}--modal-background,currentColor);border-radius:50%;height:100%;inset:0;opacity:0;pointer-events:none;position:absolute;transform-origin:0 0;visibility:visible;width:100%}@keyframes kf{0%{opacity:var(${v}--modal-opacity,.1);transform:scale(0) translate(-50%,-50%)}80%{transform:scale(1) translate(-50%,-50%)}to{opacity:0}}`)],$);var f=$;export{$ as Button,f as default};
1
+ import{__decorate as o}from"tslib";import{part as t,godown as r,styles as e,StyleController as a,joinRules as i,attr as n,htmlSlot as l}from"@godown/element";import{css as s,html as d}from"lit";import{property as c}from"lit/decorators.js";import{scopePrefix as p,cssGlobalVars as h,GlobalStyle as g}from"../../internal/global-style.js";const u="button",v=p(u),y=h.white,b=h.black,m={black:[y,h._colors.darkgray[7],h._colors.darkgray[5]],gray:[y,h._colors.darkgray[1],h._colors.lightgray[8]],white:[b,h._colors.lightgray[3],h._colors.lightgray[0]],blue:[y,h._colors.blue[6],h._colors.blue[4]],green:[y,h._colors.green[6],h._colors.green[4]],red:[y,h._colors.red[6],h._colors.red[4]],orange:[y,h._colors.orange[6],h._colors.orange[4]],pink:[y,h._colors.pink[6],h._colors.pink[4]],purple:[y,h._colors.purple[6],h._colors.purple[4]],yellow:[b,h._colors.yellow[6],h._colors.yellow[4]],teal:[y,h._colors.teal[6],h._colors.teal[4]]};let $=class Button extends g{constructor(){super(...arguments),this.__colorSC=new a(this,(()=>{const o=this.nextColor();if(o in m){const[t,r,e]=m[o];return i({":host":[[`${v}--color`,`var(${t})`],[`${v}--background`,`var(${r})`],[`${v}--gradients`,`var(${e})`]]})}return null})),this.plain=!1,this.disabled=!1,this.ghost=!1,this.active=!1,this.round=!1,this.color="black"}render(){return d`<div part="root" ${n(this.observedRecord)}> ${this.content||l()} <span part="modal-root"></span> </div>`}focus(){this.disabled||(this.active=!0,super.focus())}blur(){this.active=!1,super.blur()}connectedCallback(){super.connectedCallback(),this.events.add(this,"click",this._handelClick,!0)}_handelClick(o){if(this.disabled)return o.stopPropagation(),void o.preventDefault();this.plain||this._handleModal(o)}_handleModal(o){const t=document.createElement("i"),{width:r,height:e}=this.getBoundingClientRect(),{x:a,y:i}=this._root.getBoundingClientRect(),n=2*Math.sqrt(e**2+r**2)+"px";t.style.height=n,t.style.width=n,t.style.left=o.x-a+"px",t.style.top=o.y-i+"px",t.style.animationName="kf",this._modalRoot.appendChild(t),t.addEventListener("animationend",(()=>t.remove()),{once:!0})}nextColor(){return this.color}};o([c({type:Boolean,reflect:!0})],$.prototype,"plain",void 0),o([c({type:Boolean,reflect:!0})],$.prototype,"disabled",void 0),o([c({type:Boolean,reflect:!0})],$.prototype,"ghost",void 0),o([c({type:Boolean,reflect:!0})],$.prototype,"active",void 0),o([c({type:Boolean,reflect:!0})],$.prototype,"round",void 0),o([c({reflect:!0})],$.prototype,"color",void 0),o([c()],$.prototype,"content",void 0),o([t("modal-root")],$.prototype,"_modalRoot",void 0),o([t("root")],$.prototype,"_root",void 0),$=o([r(u),e(s`:host(:not([disabled]):active){transform:scale(var(${v}--focus-scale))}:host([round]){border-radius:calc(infinity*1px)}:host([disabled]){cursor:not-allowed;filter:brightness(.85)}:host([ghost]){${v}--modal-background:var(${v}--ghost-color);background:transparent;box-shadow:inset 0 0 0 var(${v}--ghost-width) var(${v}--ghost-color);color:var(${v}--ghost-color)}:host([plain]){${v}--gradients:unset;${v}--focus-scale:unset}`,s`:host{${v}--padding-x:.8em;${v}--padding-y:calc(var(${v}--padding-x)/4);${v}--padding:var(${v}--padding-y) var(${v}--padding-x);${v}--modal-animation-duration:1s;${v}--ghost-width:.08em;${v}--focus-scale:.97;${v}--deg:45deg;${v}--ghost-color:var(${v}--background);background:linear-gradient(var(${v}--deg),var(${v}--background),var(${v}--gradients,var(${v}--background)));color:var(${v}--color,inherit);cursor:pointer;display:block;overflow:hidden;padding:var(${v}--padding);text-align:center;width:-moz-fit-content;width:fit-content}[part=root]:not([contents]){height:100%;width:100%}[part=root]{border-radius:inherit;position:relative;transition:none;transition-duration:inherit;-webkit-user-select:none;user-select:none}i{animation-duration:var(${v}--modal-animation-duration);background:var(${v}--modal-background,currentColor);border-radius:50%;height:100%;inset:0;opacity:0;pointer-events:none;position:absolute;transform-origin:0 0;visibility:visible;width:100%}@keyframes kf{0%{opacity:var(${v}--modal-opacity,.1);transform:scale(0) translate(-50%,-50%)}80%{transform:scale(1) translate(-50%,-50%)}to{opacity:0}}`)],$);var f=$;export{$ as Button,f as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/src/web-components/button/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","whiteFont","cssGlobalVars","white","blackFont","black","colorDetails","_colors","darkgray","gray","lightgray","blue","green","red","orange","pink","purple","yellow","teal","Button","GlobalStyle","constructor","this","__colorSC","StyleController","color","nextColor","fg","bg","gd","joinRules","plain","disabled","ghost","active","round","render","html","attr","observedRecord","content","htmlSlot","blur","super","connectedCallback","events","add","_handelClick","e","stopPropagation","preventDefault","_handleModal","modal","document","createElement","width","height","getBoundingClientRect","x","y","_root","size","sqrt","style","left","top","_modalRoot","appendChild","addEventListener","remove","once","__decorate","property","type","Boolean","prototype","reflect","part","godown","styles","css","Button$1"],"mappings":"gVAMA,MAAMA,EAAY,SACZC,EAAWC,EAAYF,GAEvBG,EAAYC,EAAcC,MAC1BC,EAAYF,EAAcG,MAgB1BC,EAAe,CACnBD,MAAO,CACLJ,EACAC,EAAcK,QAAQC,SAAS,GAC/BN,EAAcK,QAAQC,SAAS,IAEjCC,KAAM,CACJR,EACAC,EAAcK,QAAQC,SAAS,GAC/BN,EAAcK,QAAQG,UAAU,IAElCP,MAAO,C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CACKE,EAAA,eAMd1D,EAAAwD,UAAA,kBAAA,GADCJ,EAAA,CACuBM,EAAA,SAMxB1D,EAAAwD,UAAA,aAAA,GADCxD,EAAAoD,EAAU,CACKO,EAAAhF,GAGNiF,EAAAC,CAAA,sDAAAjF,+IAAAA,2BAAAA,qEAAAA,uBAAAA,6BAAAA,kCAAAA,sBAAAA,wBAAAiF,CAAA,SAAAjF,qBAAAA,yBAAAA,oBAAAA,kBAAAA,qBAAAA,iBAAAA,kCAAAA,wBAAAA,sBAAAA,gBAAAA,sBAAAA,iDAAAA,eAAAA,sBAAAA,oBAAAA,8BAAAA,8EAAAA,gSAAAA,+CAAAA,2MAAAA,+HAAwB,IAAAkF,EAAA9D"}
1
+ {"version":3,"file":"component.js","sources":["../../src/src/web-components/button/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","whiteFont","cssGlobalVars","white","blackFont","black","colorDetails","_colors","darkgray","gray","lightgray","blue","green","red","orange","pink","purple","yellow","teal","Button","GlobalStyle","constructor","this","__colorSC","StyleController","color","nextColor","fg","bg","gd","joinRules","plain","disabled","ghost","active","round","render","html","attr","observedRecord","content","htmlSlot","blur","super","connectedCallback","events","add","_handelClick","e","stopPropagation","preventDefault","_handleModal","modal","document","createElement","width","height","getBoundingClientRect","x","y","_root","size","sqrt","style","left","top","_modalRoot","appendChild","addEventListener","remove","once","__decorate","property","type","Boolean","prototype","reflect","part","godown","styles","css","Button$1"],"mappings":"gVAMA,MAAMA,EAAY,SACZC,EAAWC,EAAYF,GAEvBG,EAAYC,EAAcC,MAC1BC,EAAYF,EAAcG,MAgB1BC,EAAe,CACnBD,MAAO,CACLJ,EACAC,EAAcK,QAAQC,SAAS,GAC/BN,EAAcK,QAAQC,SAAS,IAEjCC,KAAM,CACJR,EACAC,EAAcK,QAAQC,SAAS,GAC/BN,EAAcK,QAAQG,UAAU,IAElCP,MAAO,CACLC,EACAF,EAAcK,QAAQG,UAAU,GAChCR,EAAcK,QAAQG,UAAU,IAElC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AAA,SAMxB1D,EAAAwD,UAAA,aAAA,GADCxD,EAAAoD,EAAU,CACKO,EAAAhF,GAGNiF,EAAAC,CAAA,sDAAAjF,+IAAAA,2BAAAA,qEAAAA,uBAAAA,6BAAAA,kCAAAA,sBAAAA,wBAAAiF,CAAA,SAAAjF,qBAAAA,yBAAAA,oBAAAA,kBAAAA,qBAAAA,iBAAAA,kCAAAA,wBAAAA,sBAAAA,gBAAAA,sBAAAA,iDAAAA,eAAAA,sBAAAA,oBAAAA,8BAAAA,8EAAAA,gSAAAA,+CAAAA,2MAAAA,+HAAwB,IAAAkF,EAAA9D"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{part as e,godown as i,styles as s,attr as o,htmlSlot as n}from"@godown/element";import r from"@godown/f7-icon/icons/chevron-left.js";import h from"@godown/f7-icon/icons/chevron-right.js";import{css as l,html as a}from"lit";import{property as d}from"lit/decorators.js";import{GlobalStyle as c}from"../../internal/global-style.js";function p(t){return t.getBoundingClientRect().width}let m=class Carousel extends c{constructor(){super(...arguments),this.index=0,this.autoChange=0}render(){return a`<div part="root" ${o(this.observedRecord)}><i part="prev" @click="${this.prev}"> ${r()} </i><div part="move-root">${n()}</div><i part="next" @click="${this.next}"> ${h()} </i></div>`}connectedCallback(){super.connectedCallback(),this.children.length&&(this.__cloneFirst?.remove(),this.__cloneLast?.remove(),this.__cloneLast=this.firstElementChild.cloneNode(!0),this.__cloneFirst=this.lastElementChild.cloneNode(!0),this.appendChild(this.__cloneLast),this.insertBefore(this.__cloneFirst,this.firstElementChild)),this.observers.add(this,ResizeObserver,(()=>{this._offset=this._computeOffset(),this._doTranslateX(`${this._offset}px`,!0)}))}async firstUpdated(){await this.updateComplete,this.show(this.index,!0)}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),"index"===t&&this.isConnected&&this.show(this.index)}show(t,e){t=this.normalizeIndex(t),this.index=t,this._offset=this._computeOffset(),this._doTranslateX(`${this._offset}px`,e),this.dispatchCustomEvent("change",t),this.timeouts.remove(this.intervalID),this.autoChange>0&&(this.intervalID=this.timeouts.add(setInterval((()=>{this.next()}),this.autoChange)))}next(){this.index===this.childElementCount-3?(this._doTranslateX("0",!0),this.show(0)):this.show(this.index+1)}prev(){0===this.index?(this._doTranslateX(`-${this.childElementCount-1}00%`,!0),this.show(this.children.length-3)):this.show(this.index-1)}_doTranslateX(t,e){this._moveRoot.style.transform=`translateX(${t})`,this._moveRoot.style.transition=e?"none":""}_computeOffset(){let t=0;for(let e=0;e<=this.index;e++)t-=p(this.children[e]);return t+=(p(this)-p(this.children[this.index+1]))/2,t}normalizeIndex(t){return t<0?0:t>this.children.length-3?this.children.length-3:t}};t([d({type:Number})],m.prototype,"index",void 0),t([d({type:Number})],m.prototype,"autoChange",void 0),t([e("move-root")],m.prototype,"_moveRoot",void 0),m=t([i("carousel"),s(l`:host{display:block;transition:.3s}[part=root]{direction:ltr;overflow:hidden}[part=move-root],[part=root]{display:flex;height:100%;position:relative;transition:inherit;width:100%}[part=next],[part=prev]{align-items:center;display:flex;height:100%;justify-content:center;position:absolute;-webkit-user-select:none;user-select:none;width:1.5em;z-index:1}[part=prev]{left:0}[part=next]{right:0}slot::slotted(*){flex-shrink:0!important}`)],m);var f=m;export{m as Carousel,f as default};
1
+ import{__decorate as t}from"tslib";import{part as e,godown as i,styles as s,attr as o,htmlSlot as n}from"@godown/element";import r from"@godown/f7-icon/icons/chevron-left.js";import h from"@godown/f7-icon/icons/chevron-right.js";import{css as l,html as a}from"lit";import{property as d}from"lit/decorators.js";import{GlobalStyle as c}from"../../internal/global-style.js";function p(t){return t.getBoundingClientRect().width}let m=class Carousel extends c{constructor(){super(...arguments),this.index=0,this.autoChange=0}render(){return a`<div part="root" ${o(this.observedRecord)}> <i part="prev" @click="${this.prev}"> ${r()} </i> <div part="move-root">${n()}</div> <i part="next" @click="${this.next}"> ${h()} </i> </div>`}connectedCallback(){super.connectedCallback(),this.children.length&&(this.__cloneFirst?.remove(),this.__cloneLast?.remove(),this.__cloneLast=this.firstElementChild.cloneNode(!0),this.__cloneFirst=this.lastElementChild.cloneNode(!0),this.appendChild(this.__cloneLast),this.insertBefore(this.__cloneFirst,this.firstElementChild)),this.observers.add(this,ResizeObserver,(()=>{this._offset=this._computeOffset(),this._doTranslateX(`${this._offset}px`,!0)}))}async firstUpdated(){await this.updateComplete,this.show(this.index,!0)}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),"index"===t&&this.isConnected&&this.show(this.index)}show(t,e){t=this.normalizeIndex(t),this.index=t,this._offset=this._computeOffset(),this._doTranslateX(`${this._offset}px`,e),this.dispatchCustomEvent("change",t),this.timeouts.remove(this.intervalID),this.autoChange>0&&(this.intervalID=this.timeouts.add(setInterval((()=>{this.next()}),this.autoChange)))}next(){this.index===this.childElementCount-3?(this._doTranslateX("0",!0),this.show(0)):this.show(this.index+1)}prev(){0===this.index?(this._doTranslateX(`-${this.childElementCount-1}00%`,!0),this.show(this.children.length-3)):this.show(this.index-1)}_doTranslateX(t,e){this._moveRoot.style.transform=`translateX(${t})`,this._moveRoot.style.transition=e?"none":""}_computeOffset(){let t=0;for(let e=0;e<=this.index;e++)t-=p(this.children[e]);return t+=(p(this)-p(this.children[this.index+1]))/2,t}normalizeIndex(t){return t<0?0:t>this.children.length-3?this.children.length-3:t}};t([d({type:Number})],m.prototype,"index",void 0),t([d({type:Number})],m.prototype,"autoChange",void 0),t([e("move-root")],m.prototype,"_moveRoot",void 0),m=t([i("carousel"),s(l`:host{display:block;transition:.3s}[part=root]{direction:ltr;overflow:hidden}[part=move-root],[part=root]{display:flex;height:100%;position:relative;transition:inherit;width:100%}[part=next],[part=prev]{align-items:center;display:flex;height:100%;justify-content:center;position:absolute;-webkit-user-select:none;user-select:none;width:1.5em;z-index:1}[part=prev]{left:0}[part=next]{right:0}slot::slotted(*){flex-shrink:0!important}`)],m);var f=m;export{m as Carousel,f as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/src/web-components/carousel/component.ts"],"sourcesContent":null,"names":["getWidth","e","getBoundingClientRect","width","Carousel","GlobalStyle","constructor","this","index","autoChange","render","html","attr","observedRecord","prev","iconChevronLeft","htmlSlot","next","iconChevronRight","super","connectedCallback","__cloneLast","firstElementChild","cloneNode","appendChild","_doTranslateX","_offset","show","attributeChangedCallback","name","_old","value","isConnected","n","i","normalizeIndex","_computeOffset","dispatchCustomEvent","timeouts","remove","intervalID","add","setInterval","children","length","xValue","noTransition","_moveRoot","style","transform","transition","offset","childIndex","property","type","Number","prototype","__decorate","part","godown","styles","css"],"mappings":"mXAUA,SAASA,EAASC,GAChB,OAAOA,EAAEC,wBAAwBC,KACnC,CAyDA,IAAMC,EAAN,MAAMA,iBAAiBC,EAAvB,WAAAC,uBAKEC,KAAKC,MAAG,EAMRD,KAAUE,WAAG,EAaH,MAAAC,GACR,OAAOC,CAAI,oBAAAC,EAAAL,KAAAM,0CAAAN,KAAAO,UAAAC,iCAAAC,mCAAAT,KAAAU,UAAAC,qCAGLC,MAAIC,kGAIMb,KAAAc,YAASd,KAAAe,kBAAAC,WAAA,yDAEjBhB,KAAAiB,YAAiBjB,KAAAc,0JAKTd,KAAAkB,cAAS,GAAAlB,KAAAmB,aAAA,EAAA,GAEjB,gDAGPnB,KAAAoB,KAAApB,KAAAC,OAAA,GAGH,wBAAAoB,CAAiBC,EAAAC,EAAAC,GACfZ,MAAMS,yBAAmBC,EAAAC,EAAAC,GAChB,UAALF,GAAoBtB,KAAEyB,aACxBzB,KAAKoB,KAAApB,KAAAC,cAGLyB,GACAC,EAAA3B,KAAK4B,uBACD3B,MAAa0B,EACnB3B,KAAAmB,QAAAnB,KAAA6B,iBACA7B,KAAKkB,cAAc,QAAMC,YAAgBO,GACvC1B,KAAA8B,oBAAoB,SAAAH,QAChBI,SAAcC,OAAAhC,KAAIiC,YACtBjC,KAAAE,WAAA,IACJF,KAAAiC,WAAAjC,KAAA+B,SAAAG,IAAAC,aAAA,KAE4BnC,KAAAU,MAAA,GACpBV,KAAKE,cAIb,IAAAQ,GACOV,oCAA2C,GAC5CA,mBAAgB,KAAQ,GAC1BA,KAAKoB,KAAK,IAIEpB,KAAWoB,KAAApB,KAAAC,MAAA,EAEzB,CACA,IAAAM,GACmB,IAAfP,KAAcC,OACdD,KAAoBkB,cAAA,2BAAa,QAAA,GACjClB,UAAUA,KAAAoC,SAAsBC,OAAC,SAI3BjB,KAAKpB,KAAEC,MAAA,GAInB,aAAAiB,CAAAoB,EAAAC,GAEIvC,KAAAwC,UAAAC,MAAAC,UAAA,cAAAJ,KACFtC,KAAIwC,UAAeC,MAAAE,WAAsBJ,EAAM,OAAA,EAC7C,CACA,cAAAV,GACF,IAAAe,EAAA,MAAO,IAAAC,EAAA,EAAAA,GAAA7C,KAAAC,MAAA4C,IACLD,GAAUnD,EAAUO,KAAIoC,SAACS,IAIzB,OAFJD,IAAAnD,EAAAO,MAAAP,EAAAO,KAAAoC,SAAApC,KAAAC,MAAA,KAAA,EAEI2C,CACF,CACE,cAAAhB,CAAKD,UACLA,EAAI,EACN,EACEA,EAAI3B,KAAKoC,SAAWC,OAAK,EAC3BrC,KAAAoC,SAAAC,OAAA,EAGqBV,MAGvB,CAEUmB,EAAc,CAAAC,KAAAC,YAClBC,UAAU,aAAA,GACdC,EAAA,GACQ,CAAAH,KAAAC,YACRC,UAAA,kBAAA,KACM,CACNE,EAAA,gBACFF,UAAA,iBAAA,GAEApD,EAAAqD,EAAwB,CACtBE,EAzLc,YA0LZC,EAAAC,CAAA,8bAEMzD"}
1
+ {"version":3,"file":"component.js","sources":["../../src/src/web-components/carousel/component.ts"],"sourcesContent":null,"names":["getWidth","e","getBoundingClientRect","width","Carousel","GlobalStyle","constructor","this","index","autoChange","render","html","attr","observedRecord","prev","iconChevronLeft","htmlSlot","next","iconChevronRight","super","connectedCallback","__cloneLast","firstElementChild","cloneNode","appendChild","_doTranslateX","_offset","show","attributeChangedCallback","name","_old","value","isConnected","n","i","normalizeIndex","_computeOffset","dispatchCustomEvent","timeouts","remove","intervalID","add","setInterval","children","length","xValue","noTransition","_moveRoot","style","transform","transition","offset","childIndex","property","type","Number","prototype","__decorate","part","godown","styles","css"],"mappings":"mXAUA,SAASA,EAASC,GAChB,OAAOA,EAAEC,wBAAwBC,KACnC,CAyDA,IAAMC,EAAN,MAAMA,iBAAiBC,EAAvB,WAAAC,uBAKEC,KAAKC,MAAG,EAMRD,KAAUE,WAAG,EAaH,MAAAC,GACR,OAAOC,CAAI,oBAAAC,EAAAL,KAAAM,2CAAAN,KAAAO,UAAAC,kCAAAC,oCAAAT,KAAAU,UAAAC,sCAGLC,MAAIC,kGAIMb,KAAAc,YAASd,KAAAe,kBAAAC,WAAA,yDAEjBhB,KAAAiB,YAAiBjB,KAAAc,0JAKTd,KAAAkB,cAAS,GAAAlB,KAAAmB,aAAA,EAAA,GAEjB,gDAGPnB,KAAAoB,KAAApB,KAAAC,OAAA,GAGH,wBAAAoB,CAAiBC,EAAAC,EAAAC,GACfZ,MAAMS,yBAAmBC,EAAAC,EAAAC,GAChB,UAALF,GAAoBtB,KAAEyB,aACxBzB,KAAKoB,KAAApB,KAAAC,cAGLyB,GACAC,EAAA3B,KAAK4B,uBACD3B,MAAa0B,EACnB3B,KAAAmB,QAAAnB,KAAA6B,iBACA7B,KAAKkB,cAAc,QAAMC,YAAgBO,GACvC1B,KAAA8B,oBAAoB,SAAAH,QAChBI,SAAcC,OAAAhC,KAAIiC,YACtBjC,KAAAE,WAAA,IACJF,KAAAiC,WAAAjC,KAAA+B,SAAAG,IAAAC,aAAA,KAE4BnC,KAAAU,MAAA,GACpBV,KAAKE,cAIb,IAAAQ,GACOV,oCAA2C,GAC5CA,mBAAgB,KAAQ,GAC1BA,KAAKoB,KAAK,IAIEpB,KAAWoB,KAAApB,KAAAC,MAAA,EAEzB,CACA,IAAAM,GACmB,IAAfP,KAAcC,OACdD,KAAoBkB,cAAA,2BAAa,QAAA,GACjClB,UAAUA,KAAAoC,SAAsBC,OAAC,SAI3BjB,KAAKpB,KAAEC,MAAA,GAInB,aAAAiB,CAAAoB,EAAAC,GAEIvC,KAAAwC,UAAAC,MAAAC,UAAA,cAAAJ,KACFtC,KAAIwC,UAAeC,MAAAE,WAAsBJ,EAAM,OAAA,EAC7C,CACA,cAAAV,GACF,IAAAe,EAAA,MAAO,IAAAC,EAAA,EAAAA,GAAA7C,KAAAC,MAAA4C,IACLD,GAAUnD,EAAUO,KAAIoC,SAACS,IAIzB,OAFJD,IAAAnD,EAAAO,MAAAP,EAAAO,KAAAoC,SAAApC,KAAAC,MAAA,KAAA,EAEI2C,CACF,CACE,cAAAhB,CAAKD,UACLA,EAAI,EACN,EACEA,EAAI3B,KAAKoC,SAAWC,OAAK,EAC3BrC,KAAAoC,SAAAC,OAAA,EAGqBV,MAGvB,CAEUmB,EAAc,CAAAC,KAAAC,YAClBC,UAAU,aAAA,GACdC,EAAA,GACQ,CAAAH,KAAAC,YACRC,UAAA,kBAAA,KACM,CACNE,EAAA,gBACFF,UAAA,iBAAA,GAEApD,EAAAqD,EAAwB,CACtBE,EAzLc,YA0LZC,EAAAC,CAAA,8bAEMzD"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{godown as o,styles as i,attr as e,htmlSlot as r}from"@godown/element";import a from"@godown/f7-icon/icons/chevron-down.js";import{css as s,html as l}from"lit";import{property as n}from"lit/decorators.js";import{scopePrefix as p}from"../../internal/global-style.js";import d from"../../internal/super-openable.js";const m="details",c=p(m);let f=class Details extends d{constructor(){super(...arguments),this.float=!1,this.fill=!1,this.summary=""}render(){return l`<dl part="root" ${e(this.observedRecord)}><dt part="title" @click="${()=>this.toggle()}"><span part="summary">${this.summary||r("summary")}</span><span part="icon">${a()}</span></dt><dd part="details" @click=${this.fill?()=>this.toggle():null}><div style="min-height: 0;">${r()}</div></dd></dl>`}};t([n({type:Boolean})],f.prototype,"float",void 0),t([n({type:Boolean})],f.prototype,"fill",void 0),t([n()],f.prototype,"summary",void 0),f=t([o(m),i(s`:host{${c}--icon-deg-open:0deg;${c}--icon-deg-close:90deg;display:block;padding:.2em;transition:.3s}[part=root]{position:relative}[part=title]{align-items:center;direction:ltr;grid-template-columns:auto auto;height:100%;justify-content:space-between}[part=details],[part=title]{display:grid;overflow:hidden;transition:inherit}[part=details]{grid-template-rows:0fr}:host([open]) [part=details]{grid-template-rows:1fr}[float] [part=details]{position:absolute;top:100%;width:100%}[part]{transition:inherit;transition-property:transform,grid-template-rows}[part=icon]{-webkit-backface-visibility:hidden;backface-visibility:hidden;display:flex;transform:rotate(var(${c}--icon-deg-close))}:host([open]) [part=icon]{transform:rotate(var(${c}--icon-deg-open))}`)],f);var g=f;export{f as Details,g as default};
1
+ import{__decorate as t}from"tslib";import{godown as o,styles as i,attr as e,htmlSlot as r}from"@godown/element";import a from"@godown/f7-icon/icons/chevron-down.js";import{css as s,html as l}from"lit";import{property as n}from"lit/decorators.js";import{scopePrefix as p}from"../../internal/global-style.js";import d from"../../internal/super-openable.js";const m="details",c=p(m);let f=class Details extends d{constructor(){super(...arguments),this.float=!1,this.fill=!1,this.summary=""}render(){return l`<dl part="root" ${e(this.observedRecord)}> <dt part="title" @click="${()=>this.toggle()}"> <span part="summary">${this.summary||r("summary")}</span> <span part="icon">${a()}</span> </dt> <dd part="details" @click=${this.fill?()=>this.toggle():null}> <div style="min-height: 0;">${r()}</div> </dd> </dl>`}};t([n({type:Boolean})],f.prototype,"float",void 0),t([n({type:Boolean})],f.prototype,"fill",void 0),t([n()],f.prototype,"summary",void 0),f=t([o(m),i(s`:host{${c}--icon-deg-open:0deg;${c}--icon-deg-close:90deg;display:block;padding:.2em;transition:.3s}[part=root]{position:relative}[part=title]{align-items:center;direction:ltr;grid-template-columns:auto auto;height:100%;justify-content:space-between}[part=details],[part=title]{display:grid;overflow:hidden;transition:inherit}[part=details]{grid-template-rows:0fr}:host([open]) [part=details]{grid-template-rows:1fr}[float] [part=details]{position:absolute;top:100%;width:100%}[part]{transition:inherit;transition-property:transform,grid-template-rows}[part=icon]{-webkit-backface-visibility:hidden;backface-visibility:hidden;display:flex;transform:rotate(var(${c}--icon-deg-close))}:host([open]) [part=icon]{transform:rotate(var(${c}--icon-deg-open))}`)],f);var g=f;export{f as Details,g as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/src/web-components/details/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Details","SuperOpenable","constructor","this","float","fill","summary","render","html","attr","observedRecord","toggle","htmlSlot","svgCaretDown","__decorate","property","type","Boolean","styles","css","Details$1"],"mappings":"mWAQA,MAAMA,EAAY,UAEZC,EAAWC,EAAYF,GAmE7B,IAAMG,EAAN,MAAMA,gBAAgBC,EAAtB,WAAAC,uBAKEC,KAAKC,OAAG,EAMRD,KAAIE,MAAG,EAMPF,KAAOG,QAAG,GAEA,MAAAC,GACR,OAAOC,CAAI,mBAAAC,EAAAN,KAAAO,4CAAA,IAAAP,KAAAQ,kCAAAR,KAAAG,SAAAM,EAAA,sCAAAC,4CAAAV,KAAAE,KAAA,IAAAF,KAAAQ,SAAA,oCAAAC,wBAGLE,EAAA,mDAIUC,EAAA,CAAAC,KAAAC,sCAEaH,EAAA,CACHC,6CAIXG,EAAAC,CAAA,SAAKrB,yBAAiCA,qnBAAAA,sEAAAA,2BAEjB,IAAAsB,EAAApB"}
1
+ {"version":3,"file":"component.js","sources":["../../src/src/web-components/details/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Details","SuperOpenable","constructor","this","float","fill","summary","render","html","attr","observedRecord","toggle","htmlSlot","svgCaretDown","__decorate","property","type","Boolean","styles","css","Details$1"],"mappings":"mWAQA,MAAMA,EAAY,UAEZC,EAAWC,EAAYF,GAmE7B,IAAMG,EAAN,MAAMA,gBAAgBC,EAAtB,WAAAC,uBAKEC,KAAKC,OAAG,EAMRD,KAAIE,MAAG,EAMPF,KAAOG,QAAG,GAEA,MAAAC,GACR,OAAOC,CAAI,mBAAA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"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{godown as o,styles as e,attr as i,htmlSlot as s}from"@godown/element";import{css as n,html as a}from"lit";import{property as d,query as l}from"lit/decorators.js";import{scopePrefix as r}from"../../internal/global-style.js";import h from"../../internal/super-openable.js";const m="dialog",p=r(m);let c=class Dialog extends h{constructor(){super(...arguments),this.key="Escape",this.__modalInvoke=!1}set modal(t){this.contents=t}get modal(){return this.contents}render(){return a`<dialog part="root" ${i(this.observedRecord)}> ${s()} </dialog>`}showModal(){this.modal=!0,this.__modalInvoke=!0,this.show()}attributeChangedCallback(t,o,e){super.attributeChangedCallback(t,o,e),"open"===t&&(this.open?this.modal?this._dialog.showModal():this._dialog.show():this._dialog.close())}updated(t){t.has("open")&&(this.open?(this.__submitEvent=this.events.add(this,"submit",this._handelSubmit),this.key&&(this.__keydownEvent=this.events.add(document,"keydown",this._handleKeydown.bind(this)))):(this.events.remove(this,"submit",this.__submitEvent),this.events.remove(document,"keydown",this.__keydownEvent)))}_handleKeydown(t){const o=this.key.split(/[\s,]/);(o.includes(t.key)||o.includes(t.code))&&(t.preventDefault(),this.close())}_handelSubmit(t){"dialog"===t.target.method&&(t.preventDefault(),this.close())}close(){this.__modalInvoke&&(this.modal=!1,this.__modalInvoke=!1),this.open=!1}};t([d({type:Boolean,reflect:!0})],c.prototype,"modal",null),t([d()],c.prototype,"key",void 0),t([l("dialog")],c.prototype,"_dialog",void 0),c=t([o(m),e(n`:host{${p}--background-modal:#000;${p}--opacity-modal:0.2;background:none;display:block;left:50%;margin:auto;position:fixed;top:50%;transform:translate(-50%,-50%);width:-moz-fit-content;width:fit-content}:host(:not([open])){visibility:hidden}:host([contents]) dialog{position:fixed}dialog{background:inherit;position:relative}::backdrop{background:var(${p}--background-modal);opacity:var(${p}--opacity-modal)}`)],c);var u=c;export{c as Dialog,u as default};
1
+ import{__decorate as t}from"tslib";import{godown as o,styles as e,attr as i,htmlSlot as s}from"@godown/element";import{css as n,html as a}from"lit";import{property as d,query as l}from"lit/decorators.js";import{scopePrefix as r}from"../../internal/global-style.js";import h from"../../internal/super-openable.js";const m="dialog",p=r(m),c=/[\s,]+/;let u=class Dialog extends h{constructor(){super(...arguments),this.key="Escape",this.__modalInvoke=!1}set modal(t){this.contents=t}get modal(){return this.contents}render(){return a`<dialog part="root" ${i(this.observedRecord)}> ${s()} </dialog>`}showModal(){this.modal=!0,this.__modalInvoke=!0,this.show()}attributeChangedCallback(t,o,e){super.attributeChangedCallback(t,o,e),"open"===t&&(this.open?this.modal?this._dialog.showModal():this._dialog.show():this._dialog.close())}updated(t){t.has("open")&&(this.open?(this.__submitEvent=this.events.add(this,"submit",this._handelSubmit),this.key&&(this.__keydownEvent=this.events.add(document,"keydown",this._handleKeydown.bind(this)))):(this.events.remove(this,"submit",this.__submitEvent),this.events.remove(document,"keydown",this.__keydownEvent)))}_handleKeydown(t){const o=this.key.split(c);(o.includes(t.key)||o.includes(t.code))&&(t.preventDefault(),this.close())}_handelSubmit(t){"dialog"===t.target.method&&(t.preventDefault(),this.close())}close(){this.__modalInvoke&&(this.modal=!1,this.__modalInvoke=!1),this.open=!1}};t([d({type:Boolean,reflect:!0})],u.prototype,"modal",null),t([d()],u.prototype,"key",void 0),t([l("dialog")],u.prototype,"_dialog",void 0),u=t([o(m),e(n`:host{${p}--background-modal:#000;${p}--opacity-modal:0.2;background:none;display:block;left:50%;margin:auto;position:fixed;top:50%;transform:translate(-50%,-50%);width:-moz-fit-content;width:fit-content}:host(:not([open])){visibility:hidden}:host([contents]) dialog{position:fixed}dialog{background:inherit;position:relative}::backdrop{background:var(${p}--background-modal);opacity:var(${p}--opacity-modal)}`)],u);var g=u;export{u as Dialog,g as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/src/web-components/dialog/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Dialog","SuperOpenable","constructor","this","key","__modalInvoke","modal","value","contents","render","html","attr","observedRecord","htmlSlot","show","name","_old","super","attributeChangedCallback","open","_dialog","showModal","close","changedProperties","has","__submitEvent","events","add","_handelSubmit","__keydownEvent","document","_handleKeydown","bind","remove","e","split","keys","includes","code","preventDefault","target","method","__decorate","property","type","Boolean","reflect","prototype","query","godown","styles","css","Dialog$1"],"mappings":"yTAOA,MAAMA,EAAY,SACZC,EAAWC,EAAYF,GA6C7B,IAAMG,EAAN,MAAMA,eAAeC,EAArB,WAAAC,uBAiBEC,KAAGC,IAAG,SAKED,KAAaE,eAAG,EAjBxB,SAAIC,CAAMC,GACRJ,KAAKK,SAAWD,EAGlB,SAAID,GACF,OAAOH,KAAKK,SAiBJ,MAAAC,GACR,OAAOC,CAAI,uBAAAC,EAAAR,KAAAS,oBAAAC,4BAGLV,KAAAG,OAAU,wBAEVH,KAAAW,gCAELC,EAAAC,EAAAT,GACHU,MAAAC,yBAAAH,EAAAC,EAAAT,GAES,SAAAQ,IACFZ,KAAQgB,KACRhB,KAAAG,MACMH,KAAAiB,QAAAC,gCAQLlB,KAAAiB,QAAKE,QAEL,YAEJC,EAAAC,IAAA,eAAOL,MACLhB,KAAKsB,cAAetB,KAAAuB,OAAAC,IAAAxB,KAAA,SAAAA,KAAAyB,eACtBzB,KAAAC,MACFD,KAAA0B,eAAA1B,KAAAuB,OAAAC,IAAAG,SAAA,UAAA3B,KAAA4B,eAAAC,KAAA7B,UAQMA,KAAKuB,OAAMO,OAAA9B,KAAA,SAAAA,KAAAsB,eACbtB,KAAKuB,OAAaO,OAAAH,mBAAmB3B,KAAc0B,iCAIrDK,WAAO/B,KAAAC,IAAA+B,MAAA,UACLC,EAAAC,SAAKH,EAAO9B,MAAOgC,EAAMC,SAAUH,EAAAI,SACnCJ,EAAAK,iBACFpC,KAAAmB,SAIM,aAAAM,CAAcM,GACK,WAArBA,EAAAM,OAAOC,SACTP,mBACF/B,KAAgBmB,SAGpB,KAAAA,GAEUnB,KAAaE,gBACjBF,KAAQG,SACVH,KAAgBE,eAAE,GAEpBF,KAAAgB,MAAA,IAIAuB,EAAA,CACEC,EAAA,CAAAC,KAAKC,QAAaC,SAAA,KAClB9C,EAAA+C,UAAK,QAAa,QACpB,CACAJ,OACFI,UAAA,WAAA,KACD,CA7FCC,EAAA,aADSD,UAAS,eAAgB,GAGjC/C,EAAA0C,EAAA,CAUDO,EAAApD,GADCqD,EAAAC,CAAU,SAAArD,4BAAAA,8TAAAA,oCAAAA,uBACIE,GAQL,IAAAoD,EAAApD"}
1
+ {"version":3,"file":"component.js","sources":["../../src/src/web-components/dialog/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","splitKeysRegexp","Dialog","SuperOpenable","constructor","this","key","__modalInvoke","modal","value","contents","render","html","attr","observedRecord","htmlSlot","show","name","_old","super","attributeChangedCallback","open","_dialog","showModal","close","changedProperties","has","__submitEvent","events","add","_handelSubmit","__keydownEvent","document","_handleKeydown","bind","remove","e","split","keys","includes","code","preventDefault","target","method","__decorate","property","type","Boolean","reflect","prototype","query","godown","styles","css","Dialog$1"],"mappings":"yTAOA,MAAMA,EAAY,SACZC,EAAWC,EAAYF,GAEvBG,EAAkB,SA6CxB,IAAMC,EAAN,MAAMA,eAAeC,EAArB,WAAAC,uBAiBEC,KAAGC,IAAG,SAKED,KAAaE,eAAG,EAjBxB,SAAIC,CAAMC,GACRJ,KAAKK,SAAWD,EAGlB,SAAID,GACF,OAAOH,KAAKK,SAiBJ,MAAAC,GACR,OAAOC,CAAI,uBAAAC,EAAAR,KAAAS,oBAAAC,4BAGLV,KAAAG,OAAU,wBAEVH,KAAAW,gCAELC,EAAAC,EAAAT,GACHU,MAAAC,yBAAAH,EAAAC,EAAAT,GAES,SAAAQ,IACFZ,KAAQgB,KACRhB,KAAAG,MACMH,KAAAiB,QAAAC,gCAQLlB,KAAAiB,QAAKE,QAEL,YAEJC,EAAAC,IAAA,eAAOL,MACLhB,KAAKsB,cAAetB,KAAAuB,OAAAC,IAAAxB,KAAA,SAAAA,KAAAyB,eACtBzB,KAAAC,MACFD,KAAA0B,eAAA1B,KAAAuB,OAAAC,IAAAG,SAAA,UAAA3B,KAAA4B,eAAAC,KAAA7B,UAQMA,KAAKuB,OAAMO,OAAA9B,KAAA,SAAAA,KAAAsB,eACbtB,KAAKuB,OAAaO,OAAAH,mBAAmB3B,KAAc0B,iCAIrDK,WAAO/B,KAAAC,IAAA+B,MAAApC,IACLqC,EAAAC,SAAKH,EAAO9B,MAAOgC,EAAMC,SAAUH,EAAAI,SACnCJ,EAAAK,iBACFpC,KAAAmB,SAIM,aAAAM,CAAcM,GACK,WAArBA,EAAAM,OAAOC,SACTP,mBACF/B,KAAgBmB,SAGpB,KAAAA,GAEUnB,KAAaE,gBACjBF,KAAQG,SACVH,KAAgBE,eAAE,GAEpBF,KAAAgB,MAAA,IAIAuB,EAAA,CACEC,EAAA,CAAAC,KAAKC,QAAaC,SAAA,KAClB9C,EAAA+C,UAAK,QAAa,QACpB,CACAJ,OACFI,UAAA,WAAA,KACD,CA7FCC,EAAA,aADSD,UAAS,eAAgB,GAGjC/C,EAAA0C,EAAA,CAUDO,EAAArD,GADCsD,EAAAC,CAAU,SAAAtD,4BAAAA,8TAAAA,oCAAAA,uBACIG,GAQL,IAAAoD,EAAApD"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{part as i,godown as e,styles as o,StyleController as s,attr as r,htmlSlot as a}from"@godown/element";import n from"@godown/f7-icon/icons/eye-slash-fill.js";import{css as p,nothing as l,html as u}from"lit";import{property as h}from"lit/decorators.js";import{cssGlobalVars as d}from"../../internal/global-style.js";import{SuperInput as c}from"../../internal/super-input.js";import{OutlineBuilder as f}from"../../internal/outline.js";let m=class Input extends c{constructor(){super(...arguments),this.type="text",this.variant="default",this.__outlineSC=new s(this,(()=>new f({outlineType:this.outlineType}).css+("outline"===this.variant?`:host{${d.outlineColor}: var(${d.active})}`:"")))}render(){return u`<div part="root" ${r(this.observedRecord)} class="input-field"> ${[this._renderPrefix(),u`<input part="input" type="${this.type}" .value="${this.value}" ?autofocus="${this.autofocus}" ?disabled="${this.disabled}" autocapitalize="${this.autocapitalize||l}" autocomplete="${this.autocomplete||l}" placeholder="${this.placeholder||l}" id="${this.makeId}" @input="${this._handleInput}" @change="${this._handleChange}">`,this._renderSuffix()]} </div>`}_renderSuffix(){const t="password";return u`<label for=${this.makeId} part="suffix"> ${this.type===t?u`<i part="icon" @mousedown="${()=>this._changeInputType("text")}" @mouseup="${()=>this._changeInputType(t)}" @mouseleave="${()=>this._changeInputType(t)}"> ${n()} </i>`:a("suffix")} </label>`}};t([h()],m.prototype,"variant",void 0),t([i("input")],m.prototype,"_input",void 0),m=t([e("input"),o(p`:host{display:block;height:var(${d.input}-height);width:var(${d.input}-width)}:host(:focus-within){${d.outlineColor}:var(${d.active})}`)],m);var $=m;export{m as Input,$ as default};
1
+ import{__decorate as t}from"tslib";import{part as i,godown as e,styles as o,StyleController as s,attr as r,htmlSlot as a}from"@godown/element";import n from"@godown/f7-icon/icons/eye-slash-fill.js";import{css as p,nothing as l,html as u}from"lit";import{property as h}from"lit/decorators.js";import{cssGlobalVars as d}from"../../internal/global-style.js";import{SuperInput as c}from"../../internal/super-input.js";import{OutlineBuilder as f}from"../../internal/outline.js";let m=class Input extends c{constructor(){super(...arguments),this.type="text",this.variant="default",this.__outlineSC=new s(this,(()=>new f({outlineType:this.outlineType}).css+("outline"===this.variant?`:host{${d.outlineColor}: var(${d.active})}`:"")))}render(){return u`<div part="root" ${r(this.observedRecord)} class="input-field"> ${[this._renderPrefix(),u`<input part="input" type="${this.type}" .value="${this.value}" ?autofocus="${this.autofocus}" ?disabled="${this.disabled}" autocapitalize="${this.autocapitalize||l}" autocomplete="${this.autocomplete||l}" placeholder="${this.placeholder||l}" id="${this.makeId}" @input="${this._handleInput}" @change="${this._handleChange}"/>`,this._renderSuffix()]} </div>`}_renderSuffix(){const t="password";return u`<label for=${this.makeId} part="suffix"> ${this.type===t?u`<i part="icon" @mousedown="${()=>this._changeInputType("text")}" @mouseup="${()=>this._changeInputType(t)}" @mouseleave="${()=>this._changeInputType(t)}"> ${n()} </i>`:a("suffix")} </label>`}};t([h()],m.prototype,"variant",void 0),t([i("input")],m.prototype,"_input",void 0),m=t([e("input"),o(p`:host{display:block;height:var(${d.input}-height);width:var(${d.input}-width)}:host(:focus-within){${d.outlineColor}:var(${d.active})}`)],m);var $=m;export{m as Input,$ as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/src/web-components/input/component.ts"],"sourcesContent":null,"names":["Input","SuperInput","constructor","this","type","variant","__outlineSC","StyleController","OutlineBuilder","outlineType","css","cssGlobalVars","outlineColor","active","render","html","attr","observedRecord","_renderSuffix","PASSWORD","makeId","__decorate","property","prototype","godown"],"mappings":"ydA8BA,IAAMA,EAAN,MAAMA,cAAcC,EAApB,WAAAC,uBACEC,KAAIC,KAA6D,OAQjED,KAAOE,QAA0B,UAKzBF,KAAWG,YAAG,IAAIC,EACxBJ,MACA,IACE,IAAIK,EAAe,CAAEC,YAAaN,KAAKM,cAAeC,KACpC,YAAjBP,KAAKE,QAAwB,SAASM,EAAcC,qBAAqBD,EAAcE,WAAa,MAG/F,MAAAC,GACR,OAAOC,CAAI,oBAAAC,EAAAb,KAAAc,wCAAA,8VAGLd,KAAKe,0BAGL,aAAAA,SACIC,aACJ,OAAAJ,CAAI,cAAAZ,KAAAiB,yBAAAjB,KAAAC,OAAAe,kMAGQ,GAEME,EAAA,CACDC,kDAIPtB,EAAAuB,UAAA,cAAW,GACPvB,EAAAqB,EAAA,CACCG,EA/DP,uJAiEPxB,SACGA"}
1
+ {"version":3,"file":"component.js","sources":["../../src/src/web-components/input/component.ts"],"sourcesContent":null,"names":["Input","SuperInput","constructor","this","type","variant","__outlineSC","StyleController","OutlineBuilder","outlineType","css","cssGlobalVars","outlineColor","active","render","html","attr","observedRecord","_renderSuffix","PASSWORD","makeId","__decorate","property","prototype","godown"],"mappings":"ydA8BA,IAAMA,EAAN,MAAMA,cAAcC,EAApB,WAAAC,uBACEC,KAAIC,KAA6D,OAQjED,KAAOE,QAA0B,UAKzBF,KAAWG,YAAG,IAAIC,EACxBJ,MACA,IACE,IAAIK,EAAe,CAAEC,YAAaN,KAAKM,cAAeC,KACpC,YAAjBP,KAAKE,QAAwB,SAASM,EAAcC,qBAAqBD,EAAcE,WAAa,MAG/F,MAAAC,GACR,OAAOC,CAAI,oBAAAC,EAAAb,KAAAc,wCAAA,+VAGLd,KAAKe,0BAGL,aAAAA,SACIC,aACJ,OAAAJ,CAAI,cAAAZ,KAAAiB,yBAAAjB,KAAAC,OAAAe,kMAGQ,GAEME,EAAA,CACDC,kDAIPtB,EAAAuB,UAAA,cAAW,GACPvB,EAAAqB,EAAA,CACCG,EA/DP,uJAiEPxB,SACGA"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{godown as o,styles as r,attr as e,htmlSlot as i}from"@godown/element";import{css as a,html as s}from"lit";import{property as p}from"lit/decorators.js";import{GlobalStyle as d}from"../../internal/global-style.js";let n=class Layout extends d{constructor(){super(...arguments),this.sticky=!1}render(){return s`<div part="root" ${e(this.observedRecord)}><header part="header">${i("header")}</header><main part="main">${i()}</main><footer part="footer">${i("footer")}</footer></div>`}};t([p({type:Boolean})],n.prototype,"sticky",void 0),n=t([o("layout"),r(a`:host{flex-direction:column;grid-template-rows:auto 1fr auto;min-height:100%;width:100%}:host,:host([contents]) [part=root]{display:flex}[part=root]{display:contents}[part=main]{flex:1;width:100%}[part=footer],[part=header]{flex-shrink:0;width:100%}[sticky] header{position:sticky;top:0}`)],n);var l=n;export{n as Layout,l as default};
1
+ import{__decorate as t}from"tslib";import{godown as o,styles as r,attr as e,htmlSlot as i}from"@godown/element";import{css as a,html as s}from"lit";import{property as p}from"lit/decorators.js";import{GlobalStyle as d}from"../../internal/global-style.js";let n=class Layout extends d{constructor(){super(...arguments),this.sticky=!1}render(){return s`<div part="root" ${e(this.observedRecord)}> <header part="header">${i("header")}</header> <main part="main">${i()}</main> <footer part="footer">${i("footer")}</footer> </div>`}};t([p({type:Boolean})],n.prototype,"sticky",void 0),n=t([o("layout"),r(a`:host{flex-direction:column;grid-template-rows:auto 1fr auto;min-height:100%;width:100%}:host,:host([contents]) [part=root]{display:flex}[part=root]{display:contents}[part=main]{flex:1;width:100%}[part=footer],[part=header]{flex-shrink:0;width:100%}[sticky] header{position:sticky;top:0}`)],n);var l=n;export{n as Layout,l as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/src/web-components/layout/component.ts"],"sourcesContent":null,"names":["Layout","GlobalStyle","constructor","this","sticky","render","html","attr","observedRecord","htmlSlot","__decorate"],"mappings":"8PAwDA,IAAMA,EAAN,MAAMA,eAAeC,EAArB,WAAAC,uBAKEC,KAAMC,QAAG,EAEC,MAAAC,GACR,OAAOC,CAAI,oBAAAC,EAAAJ,KAAAK,yCAAAC,EAAA,uCAAAA,mCAAAA,EAAA,6BAGLC,EAAA,iDAGkBV,EAAAU,EAAA,GAhEV,0TAoEhBV"}
1
+ {"version":3,"file":"component.js","sources":["../../src/src/web-components/layout/component.ts"],"sourcesContent":null,"names":["Layout","GlobalStyle","constructor","this","sticky","render","html","attr","observedRecord","htmlSlot","__decorate"],"mappings":"8PAwDA,IAAMA,EAAN,MAAMA,eAAeC,EAArB,WAAAC,uBAKEC,KAAMC,QAAG,EAEC,MAAAC,GACR,OAAOC,CAAI,oBAAAC,EAAAJ,KAAAK,0CAAAC,EAAA,wCAAAA,oCAAAA,EAAA,8BAGLC,EAAA,iDAGkBV,EAAAU,EAAA,GAhEV,0TAoEhBV"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{godown as r,styles as e,isNullable as o,Ranger as i,attr as s}from"@godown/element";import{css as a,html as n}from"lit";import{property as l}from"lit/decorators.js";import{cssGlobalVars as p,GlobalStyle as d}from"../../internal/global-style.js";let m=class Progress extends d{constructor(){super(...arguments),this.max=1,this.min=0}render(){let t,r=20;if(!o(this.value)){const e=new i(this.min,this.max);r=100*e.restrict(this.value/e.diff),t="static"}return n`<div part="root" ${s(this.observedRecord)} class="${t}"><i part="value" style="width:${r}%;"></i></div>`}};t([l({type:Number})],m.prototype,"max",void 0),t([l({type:Number})],m.prototype,"min",void 0),t([l({type:Number})],m.prototype,"value",void 0),m=t([r("progress"),e(a`:host{background:var(${p.passive});border-radius:.25em;color:var(${p.active});height:.5em;width:100%}:host,[part=root]{display:block}[part=root]{border-radius:inherit;overflow:hidden;position:relative;z-index:1}[part=value]{animation:progress 1.8s ease-in-out infinite alternate;background:currentColor;border-radius:inherit;height:100%;left:0;position:absolute;top:0;transition:all .3s;z-index:2}@keyframes progress{0%{left:0}to{left:80%}}.static [part=value]{animation:none}`)],m);var u=m;export{m as Progress,u as default};
1
+ import{__decorate as t}from"tslib";import{godown as r,styles as e,isNullable as o,Ranger as i,attr as s}from"@godown/element";import{css as a,html as n}from"lit";import{property as l}from"lit/decorators.js";import{cssGlobalVars as p,GlobalStyle as d}from"../../internal/global-style.js";let m=class Progress extends d{constructor(){super(...arguments),this.max=1,this.min=0}render(){let t,r=20;if(!o(this.value)){const e=new i(this.min,this.max);r=100*e.restrict(this.value/e.diff),t="static"}return n`<div part="root" ${s(this.observedRecord)} class="${t}"> <i part="value" style="width:${r}%;"></i> </div>`}};t([l({type:Number})],m.prototype,"max",void 0),t([l({type:Number})],m.prototype,"min",void 0),t([l({type:Number})],m.prototype,"value",void 0),m=t([r("progress"),e(a`:host{background:var(${p.passive});border-radius:.25em;color:var(${p.active});height:.5em;width:100%}:host,[part=root]{display:block}[part=root]{border-radius:inherit;overflow:hidden;position:relative;z-index:1}[part=value]{animation:progress 1.8s ease-in-out infinite alternate;background:currentColor;border-radius:inherit;height:100%;left:0;position:absolute;top:0;transition:all .3s;z-index:2}@keyframes progress{0%{left:0}to{left:80%}}.static [part=value]{animation:none}`)],m);var u=m;export{m as Progress,u as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/src/web-components/progress/component.ts"],"sourcesContent":null,"names":["Progress","GlobalStyle","constructor","this","max","min","render","className","width","isNullable","value","ranger","Ranger","restrict","diff","html","attr","observedRecord","__decorate","Number","prototype","godown","styles","css","cssGlobalVars","passive","active","Progress$1"],"mappings":"+RA4DA,IAAMA,EAAN,MAAMA,iBAAiBC,EAAvB,WAAAC,uBAEEC,KAAGC,IAAG,EAGND,KAAGE,IAAG,EAKI,MAAAC,GACR,IACIC,EADAC,EAAQ,GAEZ,IAAKC,EAAWN,KAAKO,OAAQ,CAC3B,MAAMC,EAAS,IAAIC,EAAOT,KAAKE,IAAKF,KAAKC,KACzCI,EAAoD,IAA5CG,EAAOE,SAASV,KAAKO,MAAQC,EAAOG,MAC5CP,EAAY,SAEd,OAAOQ,CAAI,oBAAAC,EAAAb,KAAAc,0BAAAV,mCAAAC,oBAGLU,EAAA,SACgBC,gFAII,0BAGzBC,UAAA,aAAA,KACHF,EAAA,CACDG,EArFiB,YAwDhBC,EAAAC,CAAA,wBAAAC,EAAAC,0CAAAD,EAAAE,2ZADC1B,GACO,IAAA2B,EAAA3B"}
1
+ {"version":3,"file":"component.js","sources":["../../src/src/web-components/progress/component.ts"],"sourcesContent":null,"names":["Progress","GlobalStyle","constructor","this","max","min","render","className","width","isNullable","value","ranger","Ranger","restrict","diff","html","attr","observedRecord","__decorate","Number","prototype","godown","styles","css","cssGlobalVars","passive","active","Progress$1"],"mappings":"+RA4DA,IAAMA,EAAN,MAAMA,iBAAiBC,EAAvB,WAAAC,uBAEEC,KAAGC,IAAG,EAGND,KAAGE,IAAG,EAKI,MAAAC,GACR,IACIC,EADAC,EAAQ,GAEZ,IAAKC,EAAWN,KAAKO,OAAQ,CAC3B,MAAMC,EAAS,IAAIC,EAAOT,KAAKE,IAAKF,KAAKC,KACzCI,EAAoD,IAA5CG,EAAOE,SAASV,KAAKO,MAAQC,EAAOG,MAC5CP,EAAY,SAEd,OAAOQ,CAAI,oBAAAC,EAAAb,KAAAc,0BAAAV,oCAAAC,qBAGLU,EAAA,SACgBC,gFAII,0BAGzBC,UAAA,aAAA,KACHF,EAAA,CACDG,EArFiB,YAwDhBC,EAAAC,CAAA,wBAAAC,EAAAC,0CAAAD,EAAAE,2ZADC1B,GACO,IAAA2B,EAAA3B"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{part as e,godown as r,styles as a,Ranger as s,omit as o,attr as i,joinDeclarations as n,loop as h,tokenList as l,isNullable as d}from"@godown/element";import{css as u,html as c}from"lit";import{property as v,queryAll as p,state as m}from"lit/decorators.js";import{scopePrefix as f,cssGlobalVars as g}from"../../internal/global-style.js";import{SuperInput as w}from"../../internal/super-input.js";const y="range",_=f(y);let b=class Range extends w{constructor(){super(...arguments),this.min=0,this.max=100,this.vertical=!1,this.__focusStack=[]}get range(){return Array.isArray(this.value)}get rangeValue(){return this.range?this.value:[this.value]}padValue(t,e=0){const{rangeValue:r}=this,a=t-r.length;return a>0?new Array(a).fill(e).concat(r):r}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),"max"!==t&&"min"!==t&&"step"!==t||(this._ranger=new s(this.min,this.max,this.step))}get observedRecord(){return o(super.observedRecord,"outline-type")}render(){const t=this.padValue(2),e=Math.min(...t),r=Math.max(...t),a=this._ranger.diff;return c`<div part="root" ${i(this.observedRecord)} @mousedown="${this.disabled?null:this._handleMousedownRoot}" style="${n([["--from",(e-this.min)/a*100+"%"],["--to",(r-this.min)/a*100+"%"],...t.map(((t,e)=>[`--handle-${e}`,(t-this.min)/a*100+"%"]))])}"><div part="track"></div> ${h(this.rangeValue.length,(t=>this._renderHandle(t)))} </div>`}_renderHandle(t){const{disabled:e,range:r,rangeValue:a}=this,s=!r||r&&t===a.length-1&&1===a.length;return c`<i tabindex="0" part="handle" class="${l({"last-focus":this.lastFocus===t})}" @mousedown="${e?null:this.createMouseDown(t)}" @focus="${e?null:()=>this.focusHandle(t)}" @blur="${e?null:this.blurHandle}" style="${n({"z-index":this.__focusStack.indexOf(t)+1,"--handle":`var(--${s?"to":`handle-${t}`})`})}"></i>`}focusHandle(t){this.lastFocus=t;const e=this.__focusStack.indexOf(t);-1!==e&&this.__focusStack.splice(e,1),this.__focusStack.push(t);const r=this._handles.item(t);r?.focus(),this.__keydownEvent||(this.__keydownEvent=this.events.add(document,"keydown",this.createKeydownEvent(t)))}blurHandle(){this.lastFocus=void 0,this.__keydownEvent=this.events.remove(document,"keydown",this.__keydownEvent)}createKeydownEvent(t){return e=>{const{rangeValue:r,step:a}=this;r.length<2&&(t=0);const s=r[t];"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),this.createSetValue(t)(s-a)):"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),this.createSetValue(t)(s+a))}}createMouseDown(t){return e=>{this.focusHandle(t),this.createMousedownListener(this.createSetValue(t))(e)}}createSetValue(t){return e=>{const r=this._ranger.normalize(e);let a=r;this.range&&(a=[...this.value],a[t]=r),this.value=a,this.dispatchCustomEvent("change",this.value)}}_computeValue({clientX:t,clientY:e}){const{top:r,left:a,height:s,width:o}=this._root.getBoundingClientRect();return this._ranger.present(this.vertical?(e-r)/s:(t-a)/o)}_handleMousedownRoot(t){const e=this._computeValue(t),r=this.range?this.rangeValue.reduce(((t,r,a)=>Math.abs(e-r)<Math.abs(e-this.rangeValue[t])?a:t),0):0,a=this.createSetValue(r);a(e),this.createMousedownListener(a)(t),this.focusHandle(r)}createMousedownListener(t){return e=>{e.preventDefault(),e.stopPropagation();const r=this.createMousemoveListener(t);this.events.add(document,"mousemove",r);const a=()=>{this.events.remove(document,"mousemove",r),this.events.remove(document,"mouseup",a)};this.events.add(document,"mouseup",a)}}createMousemoveListener(t){return e=>{const r=this._computeValue(e);r===this._ranger.restrict(r)&&t?.call(this,r)}}_connectedInit(){this._ranger=new s(this.min,this.max,this.step);const t=this._ranger.diff;this.step||=t/100,d(this.value)&&(d(this.default)?this.value=Math.round(t/2/this.step)*this.step:this.value=this.default),this.default??=this.value}reset(){this.value=this.default}sort(){return this.value=this.toSorted()}toSorted(){return this.range?[...this.value].sort(((t,e)=>t-e)):this.value}};t([v({type:Number})],b.prototype,"min",void 0),t([v({type:Number})],b.prototype,"max",void 0),t([v({type:Number})],b.prototype,"step",void 0),t([v({type:Boolean,reflect:!0})],b.prototype,"vertical",void 0),t([v({type:Array})],b.prototype,"value",void 0),t([v({type:Array})],b.prototype,"default",void 0),t([e("root")],b.prototype,"_root",void 0),t([p("[part=handle]")],b.prototype,"_handles",void 0),t([m()],b.prototype,"lastFocus",void 0),b=t([r(y),a(u`:host{${_}--handle-active:var(${g.active});${_}--track-width:.5em;${_}--length:var(${g.input}-width);background:var(${g.passive});display:block;width:var(${_}--length)}:host([contents]) [part=root]{width:inherit}:host([vertical]){height:var(${_}--length);width:-moz-fit-content;width:fit-content}:host(:not([disabled])) .last-focus{${_}--handle-scale:1.05;background:var(${_}--handle-active)}[part=root]{position:relative;--from:0%;--to:50%;height:var(${_}--track-width)}[part=root],[part=track]{border-radius:inherit;min-height:inherit}[part=track]{background:var(${g.active});height:100%;justify-content:space-between;left:min(var(--from),var(--to));pointer-events:none;width:max(calc(var(--to) - var(--from)),calc(var(--from) - var(--to)))}[part=handle],[part=track]{display:flex;position:absolute}[part=handle]{align-items:center;background:var(${g.active});border:.1em solid;border-color:var(${g.input}-control);border-radius:50%;height:1em;justify-content:center;transform:scale(var(${_}--handle-scale,1)) translate(-50%,-25%);transform-origin:0 25%;-webkit-user-select:none;user-select:none;width:1em}`,u`[vertical]{height:inherit;width:var(${_}--track-width)}[vertical] i{transform:translate(-25%,-50%)}[vertical] [part=track]{height:max(calc(var(--to) - var(--from)),calc(var(--from) - var(--to)));left:0;top:min(var(--from),var(--to));width:100%}`,u`[part=handle]{left:var(--handle);top:0}[vertical] [part=handle]{left:0;top:var(--handle)}`)],b);var k=b;export{b as Range,k as default};
1
+ import{__decorate as t}from"tslib";import{part as e,godown as r,styles as a,Ranger as s,omit as o,attr as i,joinDeclarations as n,loop as h,tokenList as l,isNullable as d}from"@godown/element";import{css as u,html as c}from"lit";import{property as v,queryAll as p,state as m}from"lit/decorators.js";import{scopePrefix as f,cssGlobalVars as g}from"../../internal/global-style.js";import{SuperInput as w}from"../../internal/super-input.js";const y="range",_=f(y);let b=class Range extends w{constructor(){super(...arguments),this.min=0,this.max=100,this.vertical=!1,this.__focusStack=[]}get range(){return Array.isArray(this.value)}get rangeValue(){return this.range?this.value:[this.value]}padValue(t,e=0){const{rangeValue:r}=this,a=t-r.length;return a>0?new Array(a).fill(e).concat(r):r}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),"max"!==t&&"min"!==t&&"step"!==t||(this._ranger=new s(this.min,this.max,this.step))}get observedRecord(){return o(super.observedRecord,"outline-type")}render(){const t=this.padValue(2),e=Math.min(...t),r=Math.max(...t),a=this._ranger.diff;return c`<div part="root" ${i(this.observedRecord)} @mousedown="${this.disabled?null:this._handleMousedownRoot}" style="${n([["--from",(e-this.min)/a*100+"%"],["--to",(r-this.min)/a*100+"%"],...t.map(((t,e)=>[`--handle-${e}`,(t-this.min)/a*100+"%"]))])}"> <div part="track"></div> ${h(this.rangeValue.length,(t=>this._renderHandle(t)))} </div>`}_renderHandle(t){const{disabled:e,range:r,rangeValue:a}=this,s=!r||r&&t===a.length-1&&1===a.length;return c`<i tabindex="0" part="handle" class="${l({"last-focus":this.lastFocus===t})}" @mousedown="${e?null:this.createMouseDown(t)}" @focus="${e?null:()=>this.focusHandle(t)}" @blur="${e?null:this.blurHandle}" style="${n({"z-index":this.__focusStack.indexOf(t)+1,"--handle":`var(--${s?"to":`handle-${t}`})`})}"></i>`}focusHandle(t){this.lastFocus=t;const e=this.__focusStack.indexOf(t);-1!==e&&this.__focusStack.splice(e,1),this.__focusStack.push(t);const r=this._handles.item(t);r?.focus(),this.__keydownEvent||(this.__keydownEvent=this.events.add(document,"keydown",this.createKeydownEvent(t)))}blurHandle(){this.lastFocus=void 0,this.__keydownEvent=this.events.remove(document,"keydown",this.__keydownEvent)}createKeydownEvent(t){return e=>{const{rangeValue:r,step:a}=this;r.length<2&&(t=0);const s=r[t];"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),this.createSetValue(t)(s-a)):"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),this.createSetValue(t)(s+a))}}createMouseDown(t){return e=>{this.focusHandle(t),this.createMousedownListener(this.createSetValue(t))(e)}}createSetValue(t){return e=>{const r=this._ranger.normalize(e);let a=r;this.range&&(a=[...this.value],a[t]=r),this.value=a,this.dispatchCustomEvent("change",this.value)}}_computeValue({clientX:t,clientY:e}){const{top:r,left:a,height:s,width:o}=this._root.getBoundingClientRect();return this._ranger.present(this.vertical?(e-r)/s:(t-a)/o)}_handleMousedownRoot(t){const e=this._computeValue(t),r=this.range?this.rangeValue.reduce(((t,r,a)=>Math.abs(e-r)<Math.abs(e-this.rangeValue[t])?a:t),0):0,a=this.createSetValue(r);a(e),this.createMousedownListener(a)(t),this.focusHandle(r)}createMousedownListener(t){return e=>{e.preventDefault(),e.stopPropagation();const r=this.createMousemoveListener(t);this.events.add(document,"mousemove",r);const a=()=>{this.events.remove(document,"mousemove",r),this.events.remove(document,"mouseup",a)};this.events.add(document,"mouseup",a)}}createMousemoveListener(t){return e=>{const r=this._computeValue(e);r===this._ranger.restrict(r)&&t?.call(this,r)}}_connectedInit(){this._ranger=new s(this.min,this.max,this.step);const t=this._ranger.diff;this.step||=t/100,d(this.value)&&(d(this.default)?this.value=Math.round(t/2/this.step)*this.step:this.value=this.default),this.default??=this.value}reset(){this.value=this.default}sort(){return this.value=this.toSorted()}toSorted(){return this.range?[...this.value].sort(((t,e)=>t-e)):this.value}};t([v({type:Number})],b.prototype,"min",void 0),t([v({type:Number})],b.prototype,"max",void 0),t([v({type:Number})],b.prototype,"step",void 0),t([v({type:Boolean,reflect:!0})],b.prototype,"vertical",void 0),t([v({type:Array})],b.prototype,"value",void 0),t([v({type:Array})],b.prototype,"default",void 0),t([e("root")],b.prototype,"_root",void 0),t([p("[part=handle]")],b.prototype,"_handles",void 0),t([m()],b.prototype,"lastFocus",void 0),b=t([r(y),a(u`:host{${_}--handle-active:var(${g.active});${_}--track-width:.5em;${_}--length:var(${g.input}-width);background:var(${g.passive});display:block;width:var(${_}--length)}:host([contents]) [part=root]{width:inherit}:host([vertical]){height:var(${_}--length);width:-moz-fit-content;width:fit-content}:host(:not([disabled])) .last-focus{${_}--handle-scale:1.05;background:var(${_}--handle-active)}[part=root]{position:relative;--from:0%;--to:50%;height:var(${_}--track-width)}[part=root],[part=track]{border-radius:inherit;min-height:inherit}[part=track]{background:var(${g.active});height:100%;justify-content:space-between;left:min(var(--from),var(--to));pointer-events:none;width:max(calc(var(--to) - var(--from)),calc(var(--from) - var(--to)))}[part=handle],[part=track]{display:flex;position:absolute}[part=handle]{align-items:center;background:var(${g.active});border:.1em solid;border-color:var(${g.input}-control);border-radius:50%;height:1em;justify-content:center;transform:scale(var(${_}--handle-scale,1)) translate(-50%,-25%);transform-origin:0 25%;-webkit-user-select:none;user-select:none;width:1em}`,u`[vertical]{height:inherit;width:var(${_}--track-width)}[vertical] i{transform:translate(-25%,-50%)}[vertical] [part=track]{height:max(calc(var(--to) - var(--from)),calc(var(--from) - var(--to)));left:0;top:min(var(--from),var(--to));width:100%}`,u`[part=handle]{left:var(--handle);top:0}[vertical] [part=handle]{left:0;top:var(--handle)}`)],b);var k=b;export{b as Range,k as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/src/web-components/range/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Range","SuperInput","constructor","this","min","max","vertical","__focusStack","range","Array","isArray","value","rangeValue","padValue","len","miss","length","fill","concat","attributeChangedCallback","name","_old","super","_ranger","Ranger","step","observedRecord","omit","render","from","Math","to","gap","diff","html","attr","disabled","_handleMousedownRoot","joinDeclarations","map","index","loop","_renderHandle","end","lastFocus","push","handleItem","_handles","item","focus","__keydownEvent","events","document","createKeydownEvent","blurHandle","e","old","key","preventDefault","createSetValue","createMouseDown","focusHandle","createMousedownListener","normalizeValue","normalize","newValue","dispatchCustomEvent","_computeValue","reduce","acc","abs","set","mouseMoveCallback","stopPropagation","move","createMousemoveListener","add","stop","remove","restrict","callback","call","isNullable","default","sort","toSorted","a","b","Number","prototype","type","property","Boolean","reflect","part","__decorate","queryAll","state","godown","styles","css","cssGlobalVars","active","input","passive","Range$1"],"mappings":"sbAkBA,MAAMA,EAAY,QACZC,EAAWC,EAAYF,GA2G7B,IAAMG,EAAN,MAAMA,cAAiDC,EAAvD,WAAAC,uBAKEC,KAAGC,IAAG,EAMND,KAAGE,IAAG,IAYNF,KAAQG,UAAG,EA0BHH,KAAYI,aAAa,GAEjC,SAAIC,GACF,OAAOC,MAAMC,QAAQP,KAAKQ,OAM5B,cAAIC,GACF,OAAQT,KAAKK,MAAQL,KAAKQ,MAAQ,CAACR,KAAKQ,OAM1C,QAAAE,CAASC,EAAaH,EAAQ,GAC5B,MAAMC,WAAEA,GAAeT,KACjBY,EAAOD,EAAMF,EAAWI,OAC9B,OAAID,EAAO,EACF,IAAIN,MAAMM,GAAME,KAAKN,GAAOO,OAAON,GAErCA,EAGT,wBAAAO,CAAyBC,EAAcC,EAAqBV,GAC1DW,MAAMH,yBAAyBC,EAAMC,EAAMV,GAC9B,QAATS,GAA2B,QAATA,GAA2B,SAATA,IACtCjB,KAAKoB,QAAU,IAAIC,EAAOrB,KAAKC,IAAKD,KAAKE,IAAKF,KAAKsB,OAIvD,kBAAIC,GACF,OAAOC,EAAKL,MAAMI,eAAgB,gBAG1B,MAAAE,GACR,MAAMhB,EAAaT,KAAKU,SAAS,GAC3BgB,EAAOC,KAAK1B,OAAOQ,GACnBmB,EAAKD,KAAKzB,OAAOO,GACjBoB,EAAM7B,KAAKoB,QAAQU,KAEzB,OAAOC,CAAI,oBAAAC,EAAAhC,KAAAuB,+BAAAvB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KAAAE,QAAAC,SAAA,OACKJ,UAAK,qBACd,CAEAE,EAAQ,CAAAD,KAAAjF,SACNT,EAAAyF,UAAc,aAAE,QAEhB,CAAAC,KAAAjF,WACOgF,UAAK,eAAK,KACnB,CACDK,EAAA,SAzSC9F,EAAAyF,UAAA,aAAA,GADCM,EAAA,CACOC,EAAA,kBAMRhG,EAAAyF,UAAA,gBAAA,GADCM,EAAA,CACSE,KAMVjG,EAAAyF,UAAA,iBAAA,GADCzF,EAAA+F,EAAe,CACHG,EAAArG,GAMbsG,EAAAC,CAAA,SAAAtG,wBAAAuG,EAAAC,WAAAxG,uBAAAA,iBAAAuG,EAAAE,+BAAAF,EAAAG,oCAAA1G,uFAAAA,2FAAAA,uCAAAA,iFAAAA,iHAAAuG,EAAAC,0RAAAD,EAAAC,8CAAAD,EAAAE,0FAAAzG,uHAAAsG,CAAA,uCAAAtG,gNAAAsG,CAAA,iGAAiB,IAAAK,EAAAzG"}
1
+ {"version":3,"file":"component.js","sources":["../../src/src/web-components/range/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Range","SuperInput","constructor","this","min","max","vertical","__focusStack","range","Array","isArray","value","rangeValue","padValue","len","miss","length","fill","concat","attributeChangedCallback","name","_old","super","_ranger","Ranger","step","observedRecord","omit","render","from","Math","to","gap","diff","html","attr","disabled","_handleMousedownRoot","joinDeclarations","map","index","loop","_renderHandle","end","lastFocus","push","handleItem","_handles","item","focus","__keydownEvent","events","document","createKeydownEvent","blurHandle","e","old","key","preventDefault","createSetValue","createMouseDown","focusHandle","createMousedownListener","normalizeValue","normalize","newValue","dispatchCustomEvent","_computeValue","reduce","acc","abs","set","mouseMoveCallback","stopPropagation","move","createMousemoveListener","add","stop","remove","restrict","callback","call","isNullable","default","sort","toSorted","a","b","Number","prototype","type","property","Boolean","reflect","part","__decorate","queryAll","state","godown","styles","css","cssGlobalVars","active","input","passive","Range$1"],"mappings":"sbAkBA,MAAMA,EAAY,QACZC,EAAWC,EAAYF,GA2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WAAAxG,uBAAAA,iBAAAuG,EAAAE,+BAAAF,EAAAG,oCAAA1G,uFAAAA,2FAAAA,uCAAAA,iFAAAA,iHAAAuG,EAAAC,0RAAAD,EAAAC,8CAAAD,EAAAE,0FAAAzG,uHAAAsG,CAAA,uCAAAtG,gNAAAsG,CAAA,iGAAiB,IAAAK,EAAAzG"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{part as o,godown as e,styles as r,htmlSlot as i}from"@godown/element";import{css as s,html as n}from"lit";import{scopePrefix as a,GlobalStyle as l}from"../../internal/global-style.js";const d="rotate",p=a(d);let m=class Rotate extends l{render(){return n`<div part="root"><div part="slot" @mousemove="${this._handleRotate}"> ${i()} </div><i @mouseleave="${this.reset}"></i></div>`}reset(){this._root.style.removeProperty("transform"),this._root.style.removeProperty("transition")}_handleRotate(t){const{rotateX:o,rotateY:e}=this._computeOffset(t);this._root.style.setProperty("transform",`rotateX(${o}rad) rotateY(${e}rad)`),this._root.style.setProperty("transition","0s")}_computeOffset(t){const{left:o,top:e,width:r,height:i}=this._root.getBoundingClientRect(),{clientX:s,clientY:n}=t;return{rotateX:-(n-e-i/2)/i/2,rotateY:(s-o-r/2)/r/2}}};t([o("root")],m.prototype,"_root",void 0),m=t([e(d),r(s`:host{display:block;transition:all .5s ease-in-out;width:-moz-fit-content;width:fit-content;${p}--padding:.75em;${p}--offset:.5em}div{position:relative;transition:inherit;transition-property:transform}i{box-sizing:content-box;height:100%;margin:calc(var(${p}--offset)*-1);padding:var(${p}--offset);position:absolute;top:0;width:100%}[part=slot]{z-index:2}`)],m);var f=m;export{m as Rotate,f as default};
1
+ import{__decorate as t}from"tslib";import{part as o,godown as e,styles as r,htmlSlot as i}from"@godown/element";import{css as s,html as n}from"lit";import{scopePrefix as a,GlobalStyle as l}from"../../internal/global-style.js";const d="rotate",p=a(d);let m=class Rotate extends l{render(){return n`<div part="root"> <div part="slot" @mousemove="${this._handleRotate}"> ${i()} </div> <i @mouseleave="${this.reset}"></i> </div>`}reset(){this._root.style.removeProperty("transform"),this._root.style.removeProperty("transition")}_handleRotate(t){const{rotateX:o,rotateY:e}=this._computeOffset(t);this._root.style.setProperty("transform",`rotateX(${o}rad) rotateY(${e}rad)`),this._root.style.setProperty("transition","0s")}_computeOffset(t){const{left:o,top:e,width:r,height:i}=this._root.getBoundingClientRect(),{clientX:s,clientY:n}=t;return{rotateX:-(n-e-i/2)/i/2,rotateY:(s-o-r/2)/r/2}}};t([o("root")],m.prototype,"_root",void 0),m=t([e(d),r(s`:host{display:block;transition:all .5s ease-in-out;width:-moz-fit-content;width:fit-content;${p}--padding:.75em;${p}--offset:.5em}div{position:relative;transition:inherit;transition-property:transform}i{box-sizing:content-box;height:100%;margin:calc(var(${p}--offset)*-1);padding:var(${p}--offset);position:absolute;top:0;width:100%}[part=slot]{z-index:2}`)],m);var f=m;export{m as Rotate,f as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/src/web-components/rotate/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Rotate","GlobalStyle","render","html","this","_handleRotate","htmlSlot","reset","_root","style","removeProperty","e","setProperty","rotateX","rotateY","_computeOffset","__decorate","part","prototype","godown","styles","css","Rotate$1"],"mappings":"kOAKA,MAAMA,EAAY,SACZC,EAAWC,EAAYF,GAsC7B,IAAMG,EAAN,MAAMA,eAAeC,EAIT,MAAAC,GACR,OAAOC,CAAI,iDAAAC,KAAAC,mBAAAC,6BAAAF,KAAAG,yEAISH,KAAAI,MAAAC,MAAAC,eAAkB,cAE9B,aAAAL,CAAAM,qDAEcP,KAAAI,MAAAC,MAAAG,YAAU,YAAA,WAAAC,iBAAAC,yDAgBlC,cAAAC,CAAAJ,0JAUUK,EAAA,CAIRC,EAAA,SACAjB,EAAAkB,UAAe,gBACflB,EAAAgB,EAAa,CACbG,EAAAtB,GAEAuB,EAAAC,CAAa,+FAAuCvB,oBAAAA,8IAAAA,8BAAAA,yEACpDE,GACA,IAAAsB,EAAOtB"}
1
+ {"version":3,"file":"component.js","sources":["../../src/src/web-components/rotate/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Rotate","GlobalStyle","render","html","this","_handleRotate","htmlSlot","reset","_root","style","removeProperty","e","setProperty","rotateX","rotateY","_computeOffset","__decorate","part","prototype","godown","styles","css","Rotate$1"],"mappings":"kOAKA,MAAMA,EAAY,SACZC,EAAWC,EAAYF,GAsC7B,IAAMG,EAAN,MAAMA,eAAeC,EAIT,MAAAC,GACR,OAAOC,CAAI,kDAAAC,KAAAC,mBAAAC,8BAAAF,KAAAG,0EAISH,KAAAI,MAAAC,MAAAC,eAAkB,cAE9B,aAAAL,CAAAM,qDAEcP,KAAAI,MAAAC,MAAAG,YAAU,YAAA,WAAAC,iBAAAC,yDAgBlC,cAAAC,CAAAJ,0JAUUK,EAAA,CAIRC,EAAA,SACAjB,EAAAkB,UAAe,gBACflB,EAAAgB,EAAa,CACbG,EAAAtB,GAEAuB,EAAAC,CAAa,+FAAuCvB,oBAAAA,8IAAAA,8BAAAA,yEACpDE,GACA,IAAAsB,EAAOtB"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{part as e,godown as i,styles as o,attr as s,htmlSlot as l}from"@godown/element";import n from"@godown/f7-icon/icons/chevron-down.js";import{css as r,nothing as h,html as a}from"lit";import{property as c,state as u}from"lit/decorators.js";import p from"../input/component.js";import{cssGlobalVars as d}from"../../internal/global-style.js";import{directionOutsetPlace as f}from"../../internal/direction.js";function v(t,e){return t&&e&&t.toLowerCase().includes(e.toLowerCase())}function m(t,e){if(t){const i="checked";e?t.setAttribute(i,""):t.removeAttribute(i)}}let b=class Select extends p{constructor(){super(...arguments),this.multiple=!1,this.visible=!1,this.autoDirection="bottom",this.__store=[]}get observedRecord(){return{...super.observedRecord,direction:this.direction||this.autoDirection}}render(){return a`<div part="root" ${s(this.observedRecord)} class="input-field"> ${[this._renderPrefix(),a`<input part="input" type="${this.type}" .value="${this.text}" ?autofocus="${this.autofocus}" ?disabled="${this.disabled}" autocapitalize="${this.autocapitalize||h}" autocomplete="${this.autocomplete||h}" placeholder="${this.placeholder||h}" id="${this.makeId}" @focus="${this._handleFocus}" @input="${this._handleInput}" @change="${this._handleChange}">`,a`<label for="${this.makeId}" part="suffix"><i part="icon">${n()}</i></label>`,a`<label for="${this.makeId}" part="content" direction-outset-place> ${l()} </label>`]} </div>`}_handleFocus(){if(!this.direction){const{top:t,bottom:e}=this.getBoundingClientRect();window.innerHeight-e<this._content.clientHeight&&t>this._content.clientHeight?this.autoDirection="top":this.autoDirection="bottom"}this.visible=!0}firstUpdated(){this.events.add(this._content,"click",(t=>{t.preventDefault(),t.stopPropagation();const{target:e}=t,i=this.optionValue(e);if(i){const t=this.select(i,e.textContent);this.multiple||m(this.lastChecked,0),m(e,t),this.lastChecked=e}this._input.focus()})),this.events.add(document,"click",(t=>{t.stopPropagation();const e=t.composedPath()[0];e&&!this.shadowRoot.contains(e)&&this.blur()}))}_connectedInit(){if(!this.value){const t=[...this.querySelectorAll("[checked]")];(this.multiple?t:t.length?[this.lastChecked=t[0]]:[]).forEach((t=>{m(t,this.select(this.optionValue(t),t.textContent))})),this.default=this.value,this.defaultText=this.text,this.defaultChecked=t}this.text||(this.text="")}reset(){this.value=this.default,this.text=this.defaultText,this.querySelectorAll("[checked]").forEach((t=>m(t,0))),this.defaultChecked.forEach((t=>m(t,1)))}select(t,e){e||=t,e=e.trim();let i=0;if(this.multiple){const o=this.__store.findIndex((e=>e.value===t));o>-1?this.__store.splice(o,1):(this.__store.push({value:t,text:e}),i=1),this.value=this.__store.map((t=>t.value)),this.text=this.__store.map((t=>t.text)).join(", ")}else this.value===t?(this.value="",this.text=""):(this.value=t,this.text=e,i=1);return this.dispatchCustomEvent("select",this.value),this.filter(),i}filter(t){t=t?.trim(),[...this.children].forEach((e=>{this.filterCallback(e,!t||v(this.optionValue(e),t)||v(e.textContent,t),t)}))}filterCallback(t,e,i){t.style.display=e?"":"none"}_handleInput(t){if(t.stopPropagation(),this.compositing)return;const e=this._input.value;this.filter(this.multiple?function(t,e,i){const o=e.slice(0,t).lastIndexOf(i)+1||0,s=e.indexOf(i,t)||e.length;return e.slice(o,s)}(this._input.selectionStart,e,","):e),this.dispatchCustomEvent("input",this.value,{bubbles:!0})}focus(t){this._input.focus(t),this.visible=!0}blur(){this._input.blur(),this.visible=!1,super.blur()}optionValue(t){return t.value||t.getAttribute("value")||""}};t([c()],b.prototype,"text",void 0),t([e("content")],b.prototype,"_content",void 0),t([c()],b.prototype,"direction",void 0),t([c({type:Boolean})],b.prototype,"multiple",void 0),t([c({type:Boolean})],b.prototype,"visible",void 0),t([u()],b.prototype,"autoDirection",void 0),b=t([i("select"),o(f,r`.outline,:host(:focus-within){${d.input}-outline-color:var(${d.active})}[part=input]{text-overflow:ellipsis}[part=content]{position:absolute;visibility:hidden;width:100%}[visible] [part=content]{visibility:visible}`)],b);var _=b;export{b as Select,_ as default};
1
+ import{__decorate as t}from"tslib";import{part as e,godown as i,styles as o,attr as s,htmlSlot as l}from"@godown/element";import n from"@godown/f7-icon/icons/chevron-down.js";import{css as r,nothing as h,html as a}from"lit";import{property as c,state as u}from"lit/decorators.js";import p from"../input/component.js";import{cssGlobalVars as d}from"../../internal/global-style.js";import{directionOutsetPlace as f}from"../../internal/direction.js";function v(t,e){return t&&e&&t.toLowerCase().includes(e.toLowerCase())}function m(t,e){if(t){const i="checked";e?t.setAttribute(i,""):t.removeAttribute(i)}}let b=class Select extends p{constructor(){super(...arguments),this.multiple=!1,this.visible=!1,this.autoDirection="bottom",this.__store=[]}get observedRecord(){return{...super.observedRecord,direction:this.direction||this.autoDirection}}render(){return a`<div part="root" ${s(this.observedRecord)} class="input-field"> ${[this._renderPrefix(),a`<input part="input" type="${this.type}" .value="${this.text}" ?autofocus="${this.autofocus}" ?disabled="${this.disabled}" autocapitalize="${this.autocapitalize||h}" autocomplete="${this.autocomplete||h}" placeholder="${this.placeholder||h}" id="${this.makeId}" @focus="${this._handleFocus}" @input="${this._handleInput}" @change="${this._handleChange}"/>`,a`<label for="${this.makeId}" part="suffix"> <i part="icon">${n()}</i> </label>`,a`<label for="${this.makeId}" part="content" direction-outset-place> ${l()} </label>`]} </div>`}_handleFocus(){if(!this.direction){const{top:t,bottom:e}=this.getBoundingClientRect();window.innerHeight-e<this._content.clientHeight&&t>this._content.clientHeight?this.autoDirection="top":this.autoDirection="bottom"}this.visible=!0}firstUpdated(){this.events.add(this._content,"click",(t=>{t.preventDefault(),t.stopPropagation();const{target:e}=t,i=this.optionValue(e);if(i){const t=this.select(i,e.textContent);this.multiple||m(this.lastChecked,0),m(e,t),this.lastChecked=e}this._input.focus()})),this.events.add(document,"click",(t=>{t.stopPropagation();const e=t.composedPath()[0];e&&!this.shadowRoot.contains(e)&&this.blur()}))}_connectedInit(){if(!this.value){const t=[...this.querySelectorAll("[checked]")];(this.multiple?t:t.length?[this.lastChecked=t[0]]:[]).forEach((t=>{m(t,this.select(this.optionValue(t),t.textContent))})),this.default=this.value,this.defaultText=this.text,this.defaultChecked=t}this.text||(this.text="")}reset(){this.value=this.default,this.text=this.defaultText,this.querySelectorAll("[checked]").forEach((t=>m(t,0))),this.defaultChecked.forEach((t=>m(t,1)))}select(t,e){e||=t,e=e.trim();let i=0;if(this.multiple){const o=this.__store.findIndex((e=>e.value===t));o>-1?this.__store.splice(o,1):(this.__store.push({value:t,text:e}),i=1),this.value=this.__store.map((t=>t.value)),this.text=this.__store.map((t=>t.text)).join(", ")}else this.value===t?(this.value="",this.text=""):(this.value=t,this.text=e,i=1);return this.dispatchCustomEvent("select",this.value),this.filter(),i}filter(t){t=t?.trim(),[...this.children].forEach((e=>{this.filterCallback(e,!t||v(this.optionValue(e),t)||v(e.textContent,t),t)}))}filterCallback(t,e,i){t.style.display=e?"":"none"}_handleInput(t){if(t.stopPropagation(),this.compositing)return;const e=this._input.value;this.filter(this.multiple?function(t,e,i){const o=e.slice(0,t).lastIndexOf(i)+1||0,s=e.indexOf(i,t)||e.length;return e.slice(o,s)}(this._input.selectionStart,e,","):e),this.dispatchCustomEvent("input",this.value,{bubbles:!0})}focus(t){this._input.focus(t),this.visible=!0}blur(){this._input.blur(),this.visible=!1,super.blur()}optionValue(t){return t.value||t.getAttribute("value")||""}};t([c()],b.prototype,"text",void 0),t([e("content")],b.prototype,"_content",void 0),t([c()],b.prototype,"direction",void 0),t([c({type:Boolean})],b.prototype,"multiple",void 0),t([c({type:Boolean})],b.prototype,"visible",void 0),t([u()],b.prototype,"autoDirection",void 0),b=t([i("select"),o(f,r`.outline,:host(:focus-within){${d.input}-outline-color:var(${d.active})}[part=input]{text-overflow:ellipsis}[part=content]{position:absolute;visibility:hidden;width:100%}[visible] [part=content]{visibility:visible}`)],b);var _=b;export{b as Select,_ as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/src/web-components/select/component.ts"],"sourcesContent":null,"names":["contain","a","b","toLowerCase","includes","updateChecked","element","operation","name","setAttribute","removeAttribute","Select","Input","constructor","this","multiple","visible","autoDirection","__store","observedRecord","super","direction","render","html","attr","makeId","svgCaretDown","firstUpdated","events","add","_content","e","preventDefault","target","value","optionValue","select","textContent","lastChecked","composed1","composedPath","blur","_connectedInit","checked","querySelectorAll","length","forEach","default","defaultText","text","defaultChecked","trim","i","findIndex","s","splice","map","join","dispatchCustomEvent","filter","query","children","filterCallback","match","style","display","_handleInput","stopPropagation","compositing","c","start","slice","lastIndexOf","end","indexOf","betweenAt","_input","selectionStart","bubbles","focus","options","option","getAttribute","prototype","property","type","Boolean","state","__decorate","directionOutsetPlace","css","cssGlobalVars","input","active"],"mappings":"+bASA,SAASA,EAAQC,EAAWC,GAC1B,OAAOD,GAAKC,GAAKD,EAAEE,cAAcC,SAASF,EAAEC,cAC9C,CAQA,SAASE,EAAcC,EAA6BC,GAClD,GAAID,EAAS,CACX,MAAME,EAAO,UACTD,EACFD,EAAQG,aAAaD,EAAM,IAE3B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C,KAAAoB,MAAA,CAAA4C,SAAA,kBAGPF,OAAAG,MAAAC,GACAlE,KAAAE,SAAU,cAEL4D,OAAAnC,OACL3B,KAAAE,SAAS,EACPI,MAAAqB,MACA,aACFwC,YAAO/C,OAAA+C,EAAAC,aAAA,UAAA,EACL,aAIJC,UAAA,YAAA,KACI,GACA,YACJxE,EAAAwE,0BAAgB,KAClB,CAEAC,KACEzE,EAAAwE,UAAa,iBAAQ,KACpB,CACCC,EAAA,CAAAC,KAAKC,WAKP3E,EAAEwE,UAAA,gBAAA,KACJ,CAEAC,EAAA,CAAAC,KAAeC,WACb3E,EAAAwE,UAAa,eAAW,KAC1B,CAEUI,OACNJ,UAAe,qBAAE,GACnBxE,EAAA6E,EAAoB,GA5ON,YA8OdC,EAAAC,CAAA,iCAAAC,EAAAC,2BAAAD,EAAAE,2JACAlF,SACWA"}
1
+ {"version":3,"file":"component.js","sources":["../../src/src/web-components/select/component.ts"],"sourcesContent":null,"names":["contain","a","b","toLowerCase","includes","updateChecked","element","operation","name","setAttribute","removeAttribute","Select","Input","constructor","this","multiple","visible","autoDirection","__store","observedRecord","super","direction","render","html","attr","makeId","svgCaretDown","firstUpdated","events","add","_content","e","preventDefault","target","value","optionValue","select","textContent","lastChecked","composed1","composedPath","blur","_connectedInit","checked","querySelectorAll","length","forEach","default","defaultText","text","defaultChecked","trim","i","findIndex","s","splice","map","join","dispatchCustomEvent","filter","query","children","filterCallback","match","style","display","_handleInput","stopPropagation","compositing","c","start","slice","lastIndexOf","end","indexOf","betweenAt","_input","selectionStart","bubbles","focus","options","option","getAttribute","prototype","property","type","Boolean","state","__decorate","directionOutsetPlace","css","cssGlobalVars","input","active"],"mappings":"+bASA,SAASA,EAAQC,EAAWC,GAC1B,OAAOD,GAAKC,GAAKD,EAAEE,cAAcC,SAASF,EAAEC,cAC9C,CAQA,SAASE,EAAcC,EAA6BC,GAClD,GAAID,EAAS,CACX,MAAME,EAAO,UACTD,EACFD,EAAQG,aAAaD,EAAM,IA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AAxC,KAAAoB,MAAA,CAAA4C,SAAA,kBAGPF,OAAAG,MAAAC,GACAlE,KAAAE,SAAU,cAEL4D,OAAAnC,OACL3B,KAAAE,SAAS,EACPI,MAAAqB,MACA,aACFwC,YAAO/C,OAAA+C,EAAAC,aAAA,UAAA,EACL,aAIJC,UAAA,YAAA,KACI,GACA,YACJxE,EAAAwE,0BAAgB,KAClB,CAEAC,KACEzE,EAAAwE,UAAa,iBAAQ,KACpB,CACCC,EAAA,CAAAC,KAAKC,WAKP3E,EAAEwE,UAAA,gBAAA,KACJ,CAEAC,EAAA,CAAAC,KAAeC,WACb3E,EAAAwE,UAAa,eAAW,KAC1B,CAEUI,OACNJ,UAAe,qBAAE,GACnBxE,EAAA6E,EAAoB,GA5ON,YA8OdC,EAAAC,CAAA,iCAAAC,EAAAC,2BAAAD,EAAAE,2JACAlF,SACWA"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{godown as e,styles as i,StyleController as r,omit as n,attr as s,loop as u,tokenList as l}from"@godown/element";import{css as o,html as a}from"lit";import{property as h,state as c}from"lit/decorators.js";import{scopePrefix as p,cssGlobalVars as d}from"../../internal/global-style.js";import{SuperInput as f}from"../../internal/super-input.js";import{OutlineBuilder as b}from"../../internal/outline.js";const v="split",m=p(v);let y=class Split extends f{constructor(){super(...arguments),this.len=6,this.index=-1,this.current=-1,this.currentValue=[],this.__outlineSC=new r(this,(()=>new b({selector:"[part=input-box]",outlineType:this.outlineType}).css))}get observedRecord(){return n(super.observedRecord,"outline-type")}render(){return a`<div part="root" ${s(this.observedRecord)}> ${u(this.len,(t=>a`<span part="input-box" outline-type="${this.outlineType}" class="${l({focus:this.current===t})}" @click="${this.disabled?null:()=>this.focusAt(t)}"> ${this.currentValue[t]} </span>`))} <input part="input" id="${this.makeId}" @blur=${this.blur} @input="${this._handleInput}" @change="${this._handleChange}" .value="${this.value.padStart(this.len," ")}"></div>`}connectedCallback(){super.connectedCallback(),this.reset()}_handleInput(t){t.stopPropagation(),this.compositing||(this.fillInput(t.data),this.value=this.currentValue.join(""),this.dispatchCustomEvent("input",this.value,{bubbles:!0}))}fillInput(t){if(null===t){if(null!==this.currentValue[this.current])this.currentValue[this.current]=null;else{this.currentValue[this.current-1]=null;const t=this.currentValue.findLastIndex((t=>null!==t));this.current=this.current-1<0?t<0?0:t:this.current-1}return}const e=t.length>1;if(this.currentValue[this.current]=t[0],this.current+1>=this.len?(this.current=this.currentValue.indexOf(null),-1===this.current&&this.blur()):this.current+=1,e){const e=t.slice(1);e&&this.fillInput(e)}}focus(){this.focusAt(this.current),super.focus()}focusAt(t){this.current=t,this._input.focus()}blur(){this._input.blur(),this.current=-1,super.blur()}reset(){this.current=-1,this.value=this.default,this.currentValue=this.value.split("").concat(Array(this.len-this.value.length).fill(null)),this.index>-1&&(this.current=this.index)}};t([h({type:Number})],y.prototype,"len",void 0),t([h({type:Number})],y.prototype,"index",void 0),t([c()],y.prototype,"current",void 0),t([c()],y.prototype,"currentValue",void 0),y=t([e(v),i(o`:host{border-radius:.1em;display:block;width:-moz-fit-content;width:fit-content;${m}--size:1.45em;${m}--gap:.25em}[part=root]{display:flex;gap:var(${m}--gap);justify-content:space-between;position:relative}[part=input-box],[part=root]{border-radius:inherit;vertical-align:top}[part=input-box]{align-items:center;display:inline-flex;height:var(${m}--size);justify-content:center;width:var(${m}--size)}[part=input]{background:none;height:100%;opacity:0;position:absolute;width:100%;z-index:-1}.focus,[part=input-box]:active{${d.outlineColor}:var(${d.active})}`)],y);var $=y;export{y as Split,$ as default};
1
+ import{__decorate as t}from"tslib";import{godown as e,styles as i,StyleController as r,omit as n,attr as s,loop as u,tokenList as l}from"@godown/element";import{css as o,html as a}from"lit";import{property as h,state as c}from"lit/decorators.js";import{scopePrefix as p,cssGlobalVars as d}from"../../internal/global-style.js";import{SuperInput as f}from"../../internal/super-input.js";import{OutlineBuilder as b}from"../../internal/outline.js";const v="split",m=p(v);let y=class Split extends f{constructor(){super(...arguments),this.len=6,this.index=-1,this.current=-1,this.currentValue=[],this.__outlineSC=new r(this,(()=>new b({selector:"[part=input-box]",outlineType:this.outlineType}).css))}get observedRecord(){return n(super.observedRecord,"outline-type")}render(){return a`<div part="root" ${s(this.observedRecord)}> ${u(this.len,(t=>a`<span part="input-box" outline-type="${this.outlineType}" class="${l({focus:this.current===t})}" @click="${this.disabled?null:()=>this.focusAt(t)}"> ${this.currentValue[t]} </span>`))} <input part="input" id="${this.makeId}" @blur=${this.blur} @input="${this._handleInput}" @change="${this._handleChange}" .value="${this.value.padStart(this.len," ")}"/> </div>`}connectedCallback(){super.connectedCallback(),this.reset()}_handleInput(t){t.stopPropagation(),this.compositing||(this.fillInput(t.data),this.value=this.currentValue.join(""),this.dispatchCustomEvent("input",this.value,{bubbles:!0}))}fillInput(t){if(null===t){if(null!==this.currentValue[this.current])this.currentValue[this.current]=null;else{this.currentValue[this.current-1]=null;const t=this.currentValue.findLastIndex((t=>null!==t));this.current=this.current-1<0?t<0?0:t:this.current-1}return}const e=t.length>1;if(this.currentValue[this.current]=t[0],this.current+1>=this.len?(this.current=this.currentValue.indexOf(null),-1===this.current&&this.blur()):this.current+=1,e){const e=t.slice(1);e&&this.fillInput(e)}}focus(){this.focusAt(this.current),super.focus()}focusAt(t){this.current=t,this._input.focus()}blur(){this._input.blur(),this.current=-1,super.blur()}reset(){this.current=-1,this.value=this.default,this.currentValue=this.value.split("").concat(Array(this.len-this.value.length).fill(null)),this.index>-1&&(this.current=this.index)}};t([h({type:Number})],y.prototype,"len",void 0),t([h({type:Number})],y.prototype,"index",void 0),t([c()],y.prototype,"current",void 0),t([c()],y.prototype,"currentValue",void 0),y=t([e(v),i(o`:host{border-radius:.1em;display:block;width:-moz-fit-content;width:fit-content;${m}--size:1.45em;${m}--gap:.25em}[part=root]{display:flex;gap:var(${m}--gap);justify-content:space-between;position:relative}[part=input-box],[part=root]{border-radius:inherit;vertical-align:top}[part=input-box]{align-items:center;display:inline-flex;height:var(${m}--size);justify-content:center;width:var(${m}--size)}[part=input]{background:none;height:100%;opacity:0;position:absolute;width:100%;z-index:-1}.focus,[part=input-box]:active{${d.outlineColor}:var(${d.active})}`)],y);var $=y;export{y as Split,$ as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/src/web-components/split/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Split","SuperInput","constructor","this","len","index","current","currentValue","__outlineSC","StyleController","OutlineBuilder","selector","outlineType","css","observedRecord","omit","super","render","html","attr","loop","tokenList","focus","disabled","focusAt","makeId","blur","_handleInput","_handleChange","value","padStart","connectedCallback","compositing","join","fillInput","data","lastNotNull","findLastIndex","a","multiple","after","slice","i","_input","default","split","concat","Array","length","fill","__decorate","type","Number","prototype","property","state","godown","styles","cssGlobalVars","outlineColor","active"],"mappings":"4bAQA,MAAMA,EAAY,QACZC,EAAWC,EAAYF,GA0D7B,IAAMG,EAAN,MAAMA,cAAcC,EAApB,WAAAC,uBAKEC,KAAGC,IAAG,EAMND,KAAKE,OAAK,EAGVF,KAAOG,SAAK,EAGZH,KAAYI,aAAsB,GAE1BJ,KAAWK,YAAG,IAAIC,EACxBN,MACA,IACE,IAAIO,EAAe,CACjBC,SAAU,mBACVC,YAAaT,KAAKS,cACjBC,MAGP,kBAAIC,GACF,OAAOC,EAAKC,MAAMF,eAAgB,gBAG1B,MAAAG,GACR,OAAOC,CAAI,oBAAAC,EAAAhB,KAAAW,oBAAAM,EAAAjB,KAAAC,KAAAC,GAAAa,CAAA,wCAAAf,KAAAS,uBAAAS,EAAA,CAAAC,MAAAnB,KAAAG,UAAAD,gBAAAF,KAAAoB,SAAA,KAAA,IAAApB,KAAAqB,QAAAnB,QAAAF,KAAAI,aAAAF,0CAAAF,KAAAsB,iBAAAtB,KAAAuB,gBAAAvB,KAAAwB,0BAAAxB,KAAAyB,0BAAAzB,KAAA0B,MAAAC,SAAA3B,KAAAC,IAAA,mCAGLY,MAAIe,qEAOgB5B,KAAA6B,qCAId7B,KAAA0B,MAAK1B,KAAAI,aAAkB0B,KAAC,+DAsBtC,SAAAC,CAAAC,GAEU,GAA0D,OAA1DA,EAA0D,CAE9D,GAAkB,OAAdhC,KAAYI,aAAEJ,KAAAG,SAEtBH,KAAAI,aAAAJ,KAAAG,SAAA,SAGU,CAGZH,KAAAI,aAAAJ,KAAAG,QAAA,GAAA,KAEA,MAAA8B,EAAAjC,KAAAI,aAAA8B,eAAAC,GAAA,OAAAA,kOAiBMnC,KAAIG,SAAW,EAGjBiC,EAAS,OACcC,EAAAL,EAAAM,MAAA,GAErBD,GACFrC,KAAA+B,UAAAM,IAIE,KAAAlB,GACAnB,KAAAqB,QAAKrB,KAAAG,eACPgB,gBAEFoB,GAEAvC,KAAAG,QAAiBoC,EAEjBvC,KAAQwC,OAAArB,OACR,aAEmBqB,OAAAjB,YAEbpB,SAAQ,EACZU,MAAAU,eAGFvB,KAAAG,SAAA,OAAOuB,MAAA1B,KAAAyC,aACSrC,aAAAJ,KAAA0B,MAAAgB,MAAA,IAAAC,OAAAC,MAAA5C,KAAAC,IAAAD,KAAA0B,MAAAmB,QAAAC,KAAA,OAEd9C,KAAKE,WACPF,KAAAG,QAAAH,KAAAE,SAKI6C,EAAA,GACF,CAAAC,KAAAC,YACFC,UAAA,WAAA,KACF,CAEAC,EAAK,CAAAH,KAAAC,UACHpD,EAAAqD,UAAY,aAAM,KACb,CACPE,KAEAvD,EAAAqD,UAAiB,eAAA,GACfH,EAAA,CACAK,OACFF,UAAA,oBAAA,KAEIH,EAAA,CACFM,EAAA3D,GACA4D,EAAA5C,CAAK,mFAAYf,kBAAAA,iDAAAA,oMAAAA,6CAAAA,sIAAA4D,EAAAC,oBAAAD,EAAAE,sBAEnB5D"}
1
+ {"version":3,"file":"component.js","sources":["../../src/src/web-components/split/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Split","SuperInput","constructor","this","len","index","current","currentValue","__outlineSC","StyleController","OutlineBuilder","selector","outlineType","css","observedRecord","omit","super","render","html","attr","loop","tokenList","focus","disabled","focusAt","makeId","blur","_handleInput","_handleChange","value","padStart","connectedCallback","compositing","join","fillInput","data","lastNotNull","findLastIndex","a","multiple","after","slice","i","_input","default","split","concat","Array","length","fill","__decorate","type","Number","prototype","property","state","godown","styles","cssGlobalVars","outlineColor","active"],"mappings":"4bAQA,MAAMA,EAAY,QACZC,EAAWC,EAAYF,GA0D7B,IAAMG,EAAN,MAAMA,cAAcC,EAApB,WAAAC,uBAKEC,KAAGC,IAAG,EAMND,KAAKE,OAAK,EAGVF,KAAOG,SAAK,EAGZH,KAAYI,aAAsB,GAE1BJ,KAAWK,YAAG,IAAIC,EACxBN,MACA,IACE,IAAIO,EAAe,CACjBC,SAAU,mBACVC,YAAaT,KAAKS,cACjBC,MAGP,kBAAIC,GACF,OAAOC,EAAKC,MAAMF,eAAgB,gBAG1B,MAAAG,GACR,OAAOC,CAAI,oBAAAC,EAAAhB,KAAAW,oBAAAM,EAAAjB,KAAAC,KAAAC,GAAAa,CAAA,wCAAAf,KAAAS,uBAAAS,EAAA,CAAAC,MAAAnB,KAAAG,UAAAD,gBAAAF,KAAAoB,SAAA,KAAA,IAAApB,KAAAqB,QAAAnB,QAAAF,KAAAI,aAAAF,0CAAAF,KAAAsB,iBAAAtB,KAAAuB,gBAAAvB,KAAAwB,0BAAAxB,KAAAyB,0BAAAzB,KAAA0B,MAAAC,SAAA3B,KAAAC,IAAA,qCAGLY,MAAIe,qEAOgB5B,KAAA6B,qCAId7B,KAAA0B,MAAK1B,KAAAI,aAAkB0B,KAAC,+DAsBtC,SAAAC,CAAAC,GAEU,GAA0D,OAA1DA,EAA0D,CAE9D,GAAkB,OAAdhC,KAAYI,aAAEJ,KAAAG,SAEtBH,KAAAI,aAAAJ,KAAAG,SAAA,SAGU,CAGZH,KAAAI,aAAAJ,KAAAG,QAAA,GAAA,KAEA,MAAA8B,EAAAjC,KAAAI,aAAA8B,eAAAC,GAAA,OAAAA,kOAiBMnC,KAAIG,SAAW,EAGjBiC,EAAS,OACcC,EAAAL,EAAAM,MAAA,GAErBD,GACFrC,KAAA+B,UAAAM,IAIE,KAAAlB,GACAnB,KAAAqB,QAAKrB,KAAAG,eACPgB,gBAEFoB,GAEAvC,KAAAG,QAAiBoC,EAEjBvC,KAAQwC,OAAArB,OACR,aAEmBqB,OAAAjB,YAEbpB,SAAQ,EACZU,MAAAU,eAGFvB,KAAAG,SAAA,OAAOuB,MAAA1B,KAAAyC,aACSrC,aAAAJ,KAAA0B,MAAAgB,MAAA,IAAAC,OAAAC,MAAA5C,KAAAC,IAAAD,KAAA0B,MAAAmB,QAAAC,KAAA,OAEd9C,KAAKE,WACPF,KAAAG,QAAAH,KAAAE,SAKI6C,EAAA,GACF,CAAAC,KAAAC,YACFC,UAAA,WAAA,KACF,CAEAC,EAAK,CAAAH,KAAAC,UACHpD,EAAAqD,UAAY,aAAM,KACb,CACPE,KAEAvD,EAAAqD,UAAiB,eAAA,GACfH,EAAA,CACAK,OACFF,UAAA,oBAAA,KAEIH,EAAA,CACFM,EAAA3D,GACA4D,EAAA5C,CAAK,mFAAYf,kBAAAA,iDAAAA,oMAAAA,6CAAAA,sIAAA4D,EAAAC,oBAAAD,EAAAE,sBAEnB5D"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{godown as e,styles as a,omit as i,attr as r}from"@godown/element";import{css as s,html as o}from"lit";import{property as n}from"lit/decorators.js";import{scopePrefix as h,cssGlobalVars as l}from"../../internal/global-style.js";import{SuperInput as d}from"../../internal/super-input.js";const c="switch",p=h(c);let u=class Switch extends d{constructor(){super(...arguments),this.default=!1,this.value=!1}set checked(t){this.value=t}get checked(){return this.value}get observedRecord(){return i(super.observedRecord,"outline-type")}render(){return o`<div part="root" ${r(this.observedRecord)} class="round"><input part="input" type="checkbox" ?disabled="${this.disabled}" ?checked="${this.value}" id="${this.makeId}" @change="${this._handleChange}"><span part="handle"></span></div>`}reset(){this.value=this.default,this._input.checked=this.value}_connectedInit(){this.default?this.value=!0:this.value&&(this.value=!0,this.default=!0)}_handleChange(){const{checked:t}=this._input;this.value=t,this.dispatchCustomEvent("change",this.value)}};t([n({type:Boolean})],u.prototype,"default",void 0),t([n({type:Boolean,attribute:"checked",reflect:!0})],u.prototype,"value",void 0),u=t([e(c),a(s`:host,:host([contents]) [part=root]{display:inline-block}:host{${p}-width:3em;${p}-height:calc(var(${p}-width)/2);${p}-handle-size:1.25em;${p}-handle-space:calc(var(${p}-width)/4 - var(${p}-handle-size)/2);${p}-transition:.2s ease-in-out;background:var(${l.passive});border-radius:calc(var(${p}-height)/2);height:var(${p}-height);transition:.2s ease-in-out;transition-property:background,left;vertical-align:bottom;width:var(${p}-width)}:host([checked]){background:var(${l.active})}[part=root]{position:relative}[part=handle],[part=root]{align-items:center;display:flex;transition:inherit}[part=handle]{background:currentColor;border-radius:100%;justify-content:center;left:0;pointer-events:none;position:absolute;top:50%;--size:var(${p}-handle-size);height:var(--size);transform:translateY(-50%) translateX(var(${p}-handle-space));width:var(--size)}:host([checked]) [part=handle]{left:50%}[part=input]{height:100%;opacity:0;width:100%}`)],u);var v=u;export{u as Switch,v as default};
1
+ import{__decorate as t}from"tslib";import{godown as e,styles as a,omit as i,attr as r}from"@godown/element";import{css as s,html as o}from"lit";import{property as n}from"lit/decorators.js";import{scopePrefix as h,cssGlobalVars as l}from"../../internal/global-style.js";import{SuperInput as d}from"../../internal/super-input.js";const c="switch",p=h(c);let u=class Switch extends d{constructor(){super(...arguments),this.default=!1,this.value=!1}set checked(t){this.value=t}get checked(){return this.value}get observedRecord(){return i(super.observedRecord,"outline-type")}render(){return o`<div part="root" ${r(this.observedRecord)} class="round"> <input part="input" type="checkbox" ?disabled="${this.disabled}" ?checked="${this.value}" id="${this.makeId}" @change="${this._handleChange}"/> <span part="handle"></span> </div>`}reset(){this.value=this.default,this._input.checked=this.value}_connectedInit(){this.default?this.value=!0:this.value&&(this.value=!0,this.default=!0)}_handleChange(){const{checked:t}=this._input;this.value=t,this.dispatchCustomEvent("change",this.value)}};t([n({type:Boolean})],u.prototype,"default",void 0),t([n({type:Boolean,attribute:"checked",reflect:!0})],u.prototype,"value",void 0),u=t([e(c),a(s`:host,:host([contents]) [part=root]{display:inline-block}:host{${p}-width:3em;${p}-height:calc(var(${p}-width)/2);${p}-handle-size:1.25em;${p}-handle-space:calc(var(${p}-width)/4 - var(${p}-handle-size)/2);${p}-transition:.2s ease-in-out;background:var(${l.passive});border-radius:calc(var(${p}-height)/2);height:var(${p}-height);transition:.2s ease-in-out;transition-property:background,left;vertical-align:bottom;width:var(${p}-width)}:host([checked]){background:var(${l.active})}[part=root]{position:relative}[part=handle],[part=root]{align-items:center;display:flex;transition:inherit}[part=handle]{background:currentColor;border-radius:100%;justify-content:center;left:0;pointer-events:none;position:absolute;top:50%;--size:var(${p}-handle-size);height:var(--size);transform:translateY(-50%) translateX(var(${p}-handle-space));width:var(--size)}:host([checked]) [part=handle]{left:50%}[part=input]{height:100%;opacity:0;width:100%}`)],u);var v=u;export{u as Switch,v as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/src/web-components/switch/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Switch","SuperInput","constructor","this","default","value","checked","v","observedRecord","omit","super","render","html","attr","disabled","makeId","_handleChange","_input","dispatchCustomEvent","__decorate","property","type","Boolean","prototype","attribute","reflect","css","cssGlobalVars","passive","active"],"mappings":"wUAOA,MAAMA,EAAY,SACZC,EAAWC,EAAYF,GAoE7B,IAAMG,EAAN,MAAMA,eAAeC,EAArB,WAAAC,uBAaEC,KAAOC,SAAG,EAMVD,KAAKE,OAAG,EAlBR,WAAIC,CAAQC,GACVJ,KAAKE,MAAQE,EAGf,WAAID,GACF,OAAOH,KAAKE,MAed,kBAAIG,GACF,OAAOC,EAAKC,MAAMF,eAAgB,gBAG1B,MAAAG,GACR,OAAOC,CAAI,oBAAAC,EAAAV,KAAAK,gFAAAL,KAAAW,uBAAAX,KAAAE,cAAAF,KAAAY,oBAAAZ,KAAAa,2DAGLb,KAAAE,MAAUF,KAAAC,mFAQJD,KAAKE,QACAF,KAAAE,OAAkB,mBAKrC,aAAAW,GAEK,MAAAV,QAAAA,GAAAH,KAAAc,OACHd,KAAKE,MAAQC,EACbH,KAAKe,oBAAqB,SAAMf,KAAAE,SAIhCc,EAAA,CACEC,EAAA,CAAAC,KAAKC,aACPC,UAAA,eAAA,MACEH,EAAA,CAAAC,KAASC,QAAOE,UAAA,UAAAC,SAAA,KACdzB,EAAAuB,UAAK,aAAQ,GACbvB,EAAAmB,EAAI,QAERO,CAAA,kEAAA5B,eAAAA,qBAAAA,eAAAA,wBAAAA,2BAAAA,oBAAAA,qBAAAA,+CAAA6B,EAAAC,mCAAA9B,2BAAAA,4GAAAA,4CAAA6B,EAAAE,sQAAA/B,+EAAAA,uIAGqBE"}
1
+ {"version":3,"file":"component.js","sources":["../../src/src/web-components/switch/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Switch","SuperInput","constructor","this","default","value","checked","v","observedRecord","omit","super","render","html","attr","disabled","makeId","_handleChange","_input","dispatchCustomEvent","__decorate","property","type","Boolean","prototype","attribute","reflect","css","cssGlobalVars","passive","active"],"mappings":"wUAOA,MAAMA,EAAY,SACZC,EAAWC,EAAYF,GAoE7B,IAAMG,EAAN,MAAMA,eAAeC,EAArB,WAAAC,uBAaEC,KAAOC,SAAG,EAMVD,KAAKE,OAAG,EAlBR,WAAIC,CAAQC,GACVJ,KAAKE,MAAQE,EAGf,WAAID,GACF,OAAOH,KAAKE,MAed,kBAAIG,GACF,OAAOC,EAAKC,MAAMF,eAAgB,gBAG1B,MAAAG,GACR,OAAOC,CAAI,oBAAAC,EAAAV,KAAAK,iFAAAL,KAAAW,uBAAAX,KAAAE,cAAAF,KAAAY,oBAAAZ,KAAAa,8DAGLb,KAAAE,MAAUF,KAAAC,mFAQJD,KAAKE,QACAF,KAAAE,OAAkB,mBAKrC,aAAAW,GAEK,MAAAV,QAAAA,GAAAH,KAAAc,OACHd,KAAKE,MAAQC,EACbH,KAAKe,oBAAqB,SAAMf,KAAAE,SAIhCc,EAAA,CACEC,EAAA,CAAAC,KAAKC,aACPC,UAAA,eAAA,MACEH,EAAA,CAAAC,KAASC,QAAOE,UAAA,UAAAC,SAAA,KACdzB,EAAAuB,UAAK,aAAQ,GACbvB,EAAAmB,EAAI,QAERO,CAAA,kEAAA5B,eAAAA,qBAAAA,eAAAA,wBAAAA,2BAAAA,oBAAAA,qBAAAA,+CAAA6B,EAAAC,mCAAA9B,2BAAAA,4GAAAA,4CAAA6B,EAAAE,sQAAA/B,+EAAAA,uIAGqBE"}