godown 3.8.1 → 3.8.3

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 (40) hide show
  1. package/build/godown+lit.iife.js +5 -5
  2. package/build/godown+lit.iife.js.map +1 -1
  3. package/build/godown+lit.js +7 -7
  4. package/build/godown+lit.js.map +1 -1
  5. package/build/godown+lit.umd.js +5 -5
  6. package/build/godown+lit.umd.js.map +1 -1
  7. package/build/godown.iife.js +4 -4
  8. package/build/godown.js +4 -4
  9. package/build/godown.js.map +1 -1
  10. package/build/godown.umd.js +8 -8
  11. package/build/godown.umd.js.map +1 -1
  12. package/components/avatar.d.ts.map +1 -1
  13. package/components/avatar.js +1 -1
  14. package/components/avatar.js.map +1 -1
  15. package/components/carousel.d.ts.map +1 -1
  16. package/components/carousel.js.map +1 -1
  17. package/components/dragbox.js +1 -1
  18. package/components/dragbox.js.map +1 -1
  19. package/components/heading.js +1 -1
  20. package/components/input.js +1 -1
  21. package/components/progress.js +1 -1
  22. package/components/progress.js.map +1 -1
  23. package/components/range.d.ts.map +1 -1
  24. package/components/range.js +1 -1
  25. package/components/range.js.map +1 -1
  26. package/components/select.js +1 -1
  27. package/components/typewriter.d.ts +3 -0
  28. package/components/typewriter.d.ts.map +1 -1
  29. package/components/typewriter.js +1 -1
  30. package/components/typewriter.js.map +1 -1
  31. package/core/super-anchor.js +1 -1
  32. package/custom-elements.json +1 -1
  33. package/package.json +3 -4
  34. package/src/components/avatar.ts +1 -2
  35. package/src/components/carousel.ts +2 -1
  36. package/src/components/dragbox.ts +1 -1
  37. package/src/components/progress.ts +2 -2
  38. package/src/components/range.ts +3 -3
  39. package/src/components/typewriter.ts +8 -2
  40. package/web-types.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../src/components/avatar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAA8B,MAAM,yBAAyB,CAAC;AAKlF;;;;;;;;GAQG;AACH,cAEM,MAAO,SAAQ,WAAW;IAC9B;;;OAGG;IAEH,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAE/B;;OAEG;IAEH,IAAI,SAAM;IAEV;;OAEG;IAEH,KAAK,UAAS;IAEd,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAIrC,SAAS,CAAC,aAAa,IAAI,cAAc,CAAC,CAAC,CAAC;IAU5C,UAAU,IAAI,MAAM;IAIpB,SAAS,CAAC,YAAY,IAAI,IAAI;CAG/B;AAED,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../src/components/avatar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAiB,MAAM,yBAAyB,CAAC;AAIrE;;;;;;;;GAQG;AACH,cAEM,MAAO,SAAQ,WAAW;IAC9B;;;OAGG;IAEH,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAE/B;;OAEG;IAEH,IAAI,SAAM;IAEV;;OAEG;IAEH,KAAK,UAAS;IAEd,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAIrC,SAAS,CAAC,aAAa,IAAI,cAAc,CAAC,CAAC,CAAC;IAU5C,UAAU,IAAI,MAAM;IAIpB,SAAS,CAAC,YAAY,IAAI,IAAI;CAG/B;AAED,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -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{scopePrefix as h,cssGlobalVars as m,GlobalStyle as p}from"../core/global-style.js";const l="avatar";h(l);let c=class Avatar extends p{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()],c.prototype,"src",void 0),r([d()],c.prototype,"name",void 0),r([d({type:Boolean})],c.prototype,"round",void 0),c=r([t(l),e(s`:host{background:var(${m.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}`)],c);var v=c;export{c as Avatar,v 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"../core/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=avatar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.js","sources":["../src/components/avatar.ts"],"sourcesContent":null,"names":["protoName","scopePrefix","Avatar","GlobalStyle","constructor","this","name","round","render","html","attr","omit","observedRecord","_renderAvatar","src","_handleError","formatName","htmlSlot","undefined","__decorate","property","prototype","type","Boolean","godown","styles","css","cssGlobalVars","passive","Avatar$1"],"mappings":"qSAMA,MAAMA,EAAY,SACDC,EAAYD,GAa7B,IAAME,EAAN,MAAMA,eAAeC,EAArB,WAAAC,uBAYEC,KAAIC,KAAG,GAMPD,KAAKE,OAAG,EAEE,MAAAC,GACR,OAAOC,CAAI,oBAGLC,EAAKC,EAAKN,KAAKO,eAAgB,WAE/BP,KAAKQ,wBAKH,aAAAA,GACR,OAAIR,KAAKS,IACAL,CAAI,0BAGAJ,KAAKS,aACLT,KAAKC,iBACHD,KAAKU,iBAIhBV,KAAKC,KACAG,CAAI,qBACWJ,KAAKW,sBAGtBC,IAGT,UAAAD,GACE,OAAOX,KAAKC,KAGJ,YAAAS,GACRV,KAAKS,SAAMI,IAjDbC,EAAA,CADCC,KAC6BlB,EAAAmB,UAAA,WAAA,GAM9BF,EAAA,CADCC,KACQlB,EAAAmB,UAAA,YAAA,GAMTF,EAAA,CADCC,EAAS,CAAEE,KAAMC,WACLrB,EAAAmB,UAAA,aAAA,GAlBTnB,EAAMiB,EAAA,CAFXK,EAAOxB,GACPyB,EAAOC,CAAG,wBAAwBC,EAAcC,kXAC3C1B,GA2DN,IAAA2B,EAAe3B"}
1
+ {"version":3,"file":"avatar.js","sources":["../src/components/avatar.ts"],"sourcesContent":null,"names":["Avatar","GlobalStyle","constructor","this","name","round","render","html","attr","omit","observedRecord","_renderAvatar","src","_handleError","formatName","htmlSlot","undefined","__decorate","property","prototype","type","Boolean","godown","styles","css","cssGlobalVars","passive","Avatar$1"],"mappings":"oRAmBA,IAAMA,EAAN,MAAMA,eAAeC,E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IAAI;IAOvF,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI;IAgBlC,IAAI,IAAI,IAAI;IASZ,IAAI,IAAI,IAAI;IASZ,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI;IAKrE,SAAS,CAAC,cAAc,IAAI,MAAM;IASlC,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;CASlC;AAED,eAAe,QAAQ,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.js","sources":["../src/components/carousel.ts"],"sourcesContent":null,"names":["getWidth","e","getBoundingClientRect","width","Carousel","GlobalStyle","constructor","this","index","autoChange","render","html","attr","observedRecord","prev","iconChevronLeft","htmlSlot","next","iconChevronRight","connectedCallback","super","children","length","__cloneFirst","remove","__cloneLast","firstElementChild","cloneNode","lastElementChild","appendChild","insertBefore","observers","add","ResizeObserver","_offset","_computeOffset","_doTranslateX","firstUpdated","updateComplete","show","attributeChangedCallback","name","_old","value","isConnected","i","n","normalizeIndex","dispatchCustomEvent","timeouts","intervalID","setInterval","childElementCount","xValue","noTransition","_moveRoot","style","transform","transition","offset","childIndex","__decorate","property","type","Number","prototype","part","godown","styles","css","Carousel$1"],"mappings":"4WAUA,SAASA,EAASC,GAChB,OAAOA,EAAEC,wBAAwBC,KACnC,CAcA,IAAMC,EAAN,MAAMA,iBAAiBC,EAAvB,WAAAC,uBAKEC,KAAKC,MAAG,EAMRD,KAAUE,WAAG,EAaH,MAAAC,GACR,OAAOC,CAAI,oBAGLC,EAAKL,KAAKM,0CAIAN,KAAKO,SAEbC,gCAEoBC,mCAGZT,KAAKU,SAEbC,gBAMV,iBAAAC,GACEC,MAAMD,oBACFZ,KAAKc,SAASC,SAChBf,KAAKgB,cAAcC,SACnBjB,KAAKkB,aAAaD,SAClBjB,KAAKkB,YA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MAAMC,UAAY,cAAcJ,KAC/C9C,KAAKgD,UAAUC,MAAME,WAAaJ,EAAe,OAAS,GAGlD,cAAAnB,GACR,IAAIwB,EAAS,EACb,IAAK,IAAIC,EAAa,EAAGA,GAAcrD,KAAKC,MAAOoD,IACjDD,GAAU3D,EAASO,KAAKc,SAASuC,IAGnC,OADAD,IAAW3D,EAASO,MAAQP,EAASO,KAAKc,SAASd,KAAKC,MAAQ,KAAO,EAChEmD,EAGT,cAAAZ,CAAeF,GACb,OAAIA,EAAI,EACC,EACEA,EAAItC,KAAKc,SAASC,OAAS,EAC7Bf,KAAKc,SAASC,OAAS,EAEzBuB,IA5HTgB,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACT5D,EAAA6D,UAAA,aAAA,GAMTJ,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACJ5D,EAAA6D,UAAA,kBAAA,GAGJJ,EAAA,CADTK,EAAK,cAC0B9D,EAAA6D,UAAA,iBAAA,GAd5B7D,EAAQyD,EAAA,CAFbM,EAhBiB,YAiBjBC,EAAOC,CAAG,qbACLjE,GAqIN,IAAAkE,EAAelE"}
1
+ {"version":3,"file":"carousel.js","sources":["../src/components/carousel.ts"],"sourcesContent":null,"names":["getWidth","e","getBoundingClientRect","width","Carousel","GlobalStyle","constructor","this","index","autoChange","render","html","attr","observedRecord","prev","iconChevronLeft","htmlSlot","next","iconChevronRight","connectedCallback","super","children","length","__cloneFirst","remove","__cloneLast","firstElementChild","cloneNode","lastElementChild","appendChild","insertBefore","observers","add","ResizeObserver","_offset","_computeOffset","_doTranslateX","firstUpdated","updateComplete","show","attributeChangedCallback","name","_old","value","isConnected","i","n","normalizeIndex","dispatchCustomEvent","timeouts","intervalID","setInterval","childElementCount","xValue","noTransition","_moveRoot","style","transform","transition","offset","childIndex","__decorate","property","type","Number","prototype","part","godown","styles","css","Carousel$1"],"mappings":"4WAUA,SAASA,EAASC,GAChB,OAAOA,EAAEC,wBAAwBC,KACnC,CAcA,IAAMC,EAAN,M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c,KAAK,GACxB7B,KAAKgC,KAAK,IAEVhC,KAAKgC,KAAKhC,KAAKC,MAAQ,GAI3B,IAAAM,GACqB,IAAfP,KAAKC,OACPD,KAAK6B,cAAc,IAAI7B,KAAK6C,kBAAoB,QAAQ,GACxD7C,KAAKgC,KAAKhC,KAAKc,SAASC,OAAS,IAEjCf,KAAKgC,KAAKhC,KAAKC,MAAQ,GAIjB,aAAA4B,CAAciB,EAAgBC,GACtC/C,KAAKgD,UAAUC,MAAMC,UAAY,cAAcJ,KAC/C9C,KAAKgD,UAAUC,MAAME,WAAaJ,EAAe,OAAS,GAGlD,cAAAnB,GACR,IAAIwB,EAAS,EACb,IAAK,IAAIC,EAAa,EAAGA,GAAcrD,KAAKC,MAAOoD,IACjDD,GAAU3D,EAASO,KAAKc,SAASuC,IAGnC,OADAD,IAAW3D,EAASO,MAAQP,EAASO,KAAKc,SAASd,KAAKC,MAAQ,KAAO,EAChEmD,EAGT,cAAAZ,CAAeF,GACb,OAAIA,EAAI,EACC,EAELA,EAAItC,KAAKc,SAASC,OAAS,EACtBf,KAAKc,SAASC,OAAS,EAEzBuB,IA7HTgB,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACT5D,EAAA6D,UAAA,aAAA,GAMTJ,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACJ5D,EAAA6D,UAAA,kBAAA,GAGJJ,EAAA,CADTK,EAAK,cAC0B9D,EAAA6D,UAAA,iBAAA,GAd5B7D,EAAQyD,EAAA,CAFbM,EAhBiB,YAiBjBC,EAAOC,CAAG,qbACLjE,GAsIN,IAAAkE,EAAelE"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{godown as e,styles as s,attr as o,htmlSlot as i}from"@godown/element";import{css as n,html as h}from"lit";import{property as d}from"lit/decorators.js";import{GlobalStyle as r}from"../core/global-style.js";let a=class Dragbox extends r{constructor(){super(...arguments),this.__drag=!1}get _offsetParent(){return this.offsetParent??document.body}render(){return h`<div part="root" ${o(this.observedRecord)} @mousedown="${this._handleDragStart}">${i()}</div>`}firstUpdated(){this.reset()}_handleDragStart(t){this.__x=t.x,this.__y=t.y;const e=this._offsetParent.getBoundingClientRect(),s=this.getBoundingClientRect();this.__t=s.top-e.top,this.__l=s.left-e.left,this.__drag=!0,this.__handleMouseMove=this.events.add(document,"mousemove",this._handleDrag.bind(this)),this.__handleMouseLeave=this.events.add(document,"mouseleave",this._handleDragEnd.bind(this)),this.__handleMouseUp=this.events.add(document,"mouseup",this._handleDragEnd.bind(this))}_handleDragEnd(){this.__drag=!1,this.events.remove(document,"mousemove",this.__handleMouseMove),this.events.remove(document,"mouseleave",this.__handleMouseLeave),this.events.remove(document,"mouseup",this.__handleMouseUp)}_handleDrag(t){if(!this.__drag)return;const{__x:e,__y:s,__l:o,__t:i,style:n}=this,{height:h,width:d}=this._offsetParent.getBoundingClientRect(),{width:r,height:a}=this.getBoundingClientRect(),_=t.x-(e-o),l=t.y-(s-i);n.left=_<0?"0":_<d-r?`${_}px`:d-r+'"px"',n.top=l<0?"0":l<h-a?`${l}px`:h-a+"px"}reset(){const{x:t,y:e,style:s,offsetWidth:o,offsetHeight:i,offsetLeft:n,offsetTop:h}=this,{height:d,width:r}=this._offsetParent.getBoundingClientRect();s.left=t||"0",s.top=e||"0",n>r-o&&(s.left=r-o+"px"),h>d-i&&(s.top=d-i+"px")}};t([d()],a.prototype,"x",void 0),t([d()],a.prototype,"y",void 0),a=t([e("dragbox"),s(n`:host{display:block;position:absolute}:host(:active){-webkit-user-select:none;user-select:none}`)],a);var _=a;export{a as Dragbox,_ as default};
1
+ import{__decorate as t}from"tslib";import{godown as e,styles as s,attr as o,htmlSlot as i}from"@godown/element";import{css as n,html as h}from"lit";import{property as d}from"lit/decorators.js";import{GlobalStyle as r}from"../core/global-style.js";let a=class Dragbox extends r{constructor(){super(...arguments),this.__drag=!1}get _offsetParent(){return this.offsetParent??document.body}render(){return h`<div part="root" ${o(this.observedRecord)} @mousedown="${this._handleDragStart}">${i()}</div>`}firstUpdated(){this.reset()}_handleDragStart(t){this.__x=t.x,this.__y=t.y;const e=this._offsetParent.getBoundingClientRect(),s=this.getBoundingClientRect();this.__t=s.top-e.top,this.__l=s.left-e.left,this.__drag=!0,this.__handleMouseMove=this.events.add(document,"mousemove",this._handleDrag.bind(this)),this.__handleMouseLeave=this.events.add(document,"mouseleave",this._handleDragEnd.bind(this)),this.__handleMouseUp=this.events.add(document,"mouseup",this._handleDragEnd.bind(this))}_handleDragEnd(){this.__drag=!1,this.events.remove(document,"mousemove",this.__handleMouseMove),this.events.remove(document,"mouseleave",this.__handleMouseLeave),this.events.remove(document,"mouseup",this.__handleMouseUp)}_handleDrag(t){if(!this.__drag)return;const{__x:e,__y:s,__l:o,__t:i,style:n}=this,{height:h,width:d}=this._offsetParent.getBoundingClientRect(),{width:r,height:a}=this.getBoundingClientRect(),_=t.x-(e-o),l=t.y-(s-i);n.left=_<0?"0":_<d-r?`${_}px`:d-r+"px",n.top=l<0?"0":l<h-a?`${l}px`:h-a+"px"}reset(){const{x:t,y:e,style:s,offsetWidth:o,offsetHeight:i,offsetLeft:n,offsetTop:h}=this,{height:d,width:r}=this._offsetParent.getBoundingClientRect();s.left=t||"0",s.top=e||"0",n>r-o&&(s.left=r-o+"px"),h>d-i&&(s.top=d-i+"px")}};t([d()],a.prototype,"x",void 0),t([d()],a.prototype,"y",void 0),a=t([e("dragbox"),s(n`:host{display:block;position:absolute}:host(:active){-webkit-user-select:none;user-select:none}`)],a);var _=a;export{a as Dragbox,_ as default};
2
2
  //# sourceMappingURL=dragbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dragbox.js","sources":["../src/components/dragbox.ts"],"sourcesContent":null,"names":["Dragbox","GlobalStyle","constructor","this","__drag","_offsetParent","offsetParent","document","body","render","html","attr","observedRecord","_handleDragStart","htmlSlot","firstUpdated","reset","e","__x","x","__y","y","parentRect","getBoundingClientRect","rect","__t","top","__l","left","__handleMouseMove","events","add","_handleDrag","bind","__handleMouseLeave","_handleDragEnd","__handleMouseUp","remove","style","height","parentHeight","width","parentWidth","l","t","offsetWidth","offsetHeight","offsetLeft","offsetTop","__decorate","property","prototype","godown","styles","css","Dragbox$1"],"mappings":"uPAgBA,IAAMA,EAAN,MAAMA,gBAAgBC,EAAtB,WAAAC,uBAQUC,KAAMC,QAAG,EAJjB,iBAAIC,GACF,OAAOF,KAAKG,cAAgBC,SAASC,KAqB7B,MAAAC,GACR,OAAOC,CAAI,oBAGLC,EAAKR,KAAKS,+BACET,KAAKU,qBAEjBC,YAKE,YAAAC,GACRZ,KAAKa,QAGG,gBAAAH,CAAiBI,GACzBd,KAAKe,IAAMD,EAAEE,EACbhB,KAAKiB,IAAMH,EAAEI,EACb,MAAMC,EAAanB,KAAKE,cAAckB,wBAChCC,EAAOrB,KAAKoB,wBAClBpB,KAAKsB,IAAMD,EAAKE,IAAMJ,EAAWI,IACjCvB,KAAKwB,IAAMH,EAAKI,KAAON,EAAWM,KAClCzB,KAAKC,QAAS,EACdD,KAAK0B,kBAAoB1B,KAAK2B,OAAOC,IAAIxB,SAAU,YAAaJ,KAAK6B,YAAYC,KAAK9B,OACtFA,KAAK+B,mBAAqB/B,KAAK2B,OAAOC,IAAIxB,SAAU,aAAcJ,KAAKgC,eAAeF,KAAK9B,OAC3FA,KAAKiC,gBAAkBjC,KAAK2B,OAAOC,IAAIxB,SAAU,UAAWJ,KAAKgC,eAAeF,KAAK9B,OAO7E,cAAAgC,GACRhC,KAAKC,QAAS,EACdD,KAAK2B,OAAOO,OAAO9B,SAAU,YAAaJ,KAAK0B,mBAC/C1B,KAAK2B,OAAOO,OAAO9B,SAAU,aAAcJ,KAAK+B,oBAChD/B,KAAK2B,OAAOO,OAAO9B,SAAU,UAAWJ,KAAKiC,iBAGrC,WAAAJ,CAAYf,GACpB,IAAKd,KAAKC,OACR,OAEF,MAAMc,IAAEA,EAAGE,IAAEA,EAAGO,IAAEA,EAAGF,IAAEA,EAAGa,MAAEA,GAAUnC,MAC9BoC,OAAQC,EAAcC,MAAOC,GAAgBvC,KAAKE,cAAckB,yBAClEkB,MAAEA,EAAKF,OAAEA,GAAWpC,KAAKoB,wBACzBoB,EAAI1B,EAAEE,GAAKD,EAAMS,GACjBiB,EAAI3B,EAAEI,GAAKD,EAAMK,GAErBa,EAAMV,KADJe,EAAI,EACO,IACJA,EAAID,EAAcD,EACd,GAAGE,MAEAD,EAAcD,EAAjB,OAGbH,EAAMZ,IADJkB,EAAI,EACM,IACHA,EAAIJ,EAAeD,EAChB,GAAGK,MAEAJ,EAAeD,EAAlB,KAIhB,KAAAvB,GACE,MAAMG,EAAEA,EAACE,EAAEA,EAACiB,MAAEA,EAAKO,YAAEA,EAAWC,aAAEA,EAAYC,WAAEA,EAAUC,UAAEA,GAAc7C,MAClEoC,OAAQC,EAAcC,MAAOC,GAAgBvC,KAAKE,cAAckB,wBAExEe,EAAMV,KAAOT,GAAK,IAClBmB,EAAMZ,IAAML,GAAK,IACb0B,EAAaL,EAAcG,IAC7BP,EAAMV,KAAUc,EAAcG,EAAjB,MAEXG,EAAYR,EAAeM,IAC7BR,EAAMZ,IAASc,EAAeM,EAAlB,QAnFhBG,EAAA,CADCC,KACQlD,EAAAmD,UAAA,SAAA,GAMTF,EAAA,CADCC,KACQlD,EAAAmD,UAAA,SAAA,GAxBLnD,EAAOiD,EAAA,CAFZG,EARiB,WASjBC,EAAOC,CAAG,oGACLtD,GA0GN,IAAAuD,EAAevD"}
1
+ {"version":3,"file":"dragbox.js","sources":["../src/components/dragbox.ts"],"sourcesContent":null,"names":["Dragbox","GlobalStyle","constructor","this","__drag","_offsetParent","offsetParent","document","body","render","html","attr","observedRecord","_handleDragStart","htmlSlot","firstUpdated","reset","e","__x","x","__y","y","parentRect","getBoundingClientRect","rect","__t","top","__l","left","__handleMouseMove","events","add","_handleDrag","bind","__handleMouseLeave","_handleDragEnd","__handleMouseUp","remove","style","height","parentHeight","width","parentWidth","l","t","offsetWidth","offsetHeight","offsetLeft","offsetTop","__decorate","property","prototype","godown","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AI1B,EAAEE,GAAKD,EAAMS,GACjBiB,EAAI3B,EAAEI,GAAKD,EAAMK,GAErBa,EAAMV,KADJe,EAAI,EACO,IACJA,EAAID,EAAcD,EACd,GAAGE,MAEAD,EAAcD,EAAjB,KAGbH,EAAMZ,IADJkB,EAAI,EACM,IACHA,EAAIJ,EAAeD,EAChB,GAAGK,MAEAJ,EAAeD,EAAlB,KAIhB,KAAAvB,GACE,MAAMG,EAAEA,EAACE,EAAEA,EAACiB,MAAEA,EAAKO,YAAEA,EAAWC,aAAEA,EAAYC,WAAEA,EAAUC,UAAEA,GAAc7C,MAClEoC,OAAQC,EAAcC,MAAOC,GAAgBvC,KAAKE,cAAckB,wBAExEe,EAAMV,KAAOT,GAAK,IAClBmB,EAAMZ,IAAML,GAAK,IACb0B,EAAaL,EAAcG,IAC7BP,EAAMV,KAAUc,EAAcG,EAAjB,MAEXG,EAAYR,EAAeM,IAC7BR,EAAMZ,IAASc,EAAeM,EAAlB,QAnFhBG,EAAA,CADCC,KACQlD,EAAAmD,UAAA,SAAA,GAMTF,EAAA,CADCC,KACQlD,EAAAmD,UAAA,SAAA,GAxBLnD,EAAOiD,EAAA,CAFZG,EARiB,WASjBC,EAAOC,CAAG,oGACLtD,GA0GN,IAAAuD,EAAevD"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{godown as r,styles as e,attr as i,htmlSlot as o}from"@godown/element";import{css as h,html as a,nothing as s}from"lit";import{property as n}from"lit/decorators.js";import{GlobalStyle as d}from"../core/global-style.js";let c=class Heading extends d{constructor(){super(...arguments),this.as="h1",this.anchor="#",this.side="left"}render(){return a`<a part="root" href="${this.id?"#"+this.id:s}" ${i(this.observedRecord)}>${this.wrapHeading(o(),this.id?a`<i part="anchor">${this.anchor}</i>`:"")}</a>`}wrapHeading(...t){switch(this.as){case"h2":return a`<h2>${t}</h2>`;case"h3":return a`<h3>${t}</h3>`;case"h4":return a`<h4>${t}</h4>`;case"h5":return a`<h5>${t}</h5>`;case"h6":return a`<h6>${t}</h6>`;default:return a`<h1>${t}</h1>`}}};t([n()],c.prototype,"as",void 0),t([n()],c.prototype,"anchor",void 0),t([n()],c.prototype,"side",void 0),c=t([r("heading"),e(h`:host{display:block;text-align:start}[part=anchor]{min-width:1.25em;position:absolute;right:100%;text-align:center}[side=left] [part=anchor]{right:100%}[side=right] [part=anchor]{left:100%}a{color:inherit}h1,h2,h3,h4,h5,h6{direction:ltr;font-size:revert;position:relative;width:-moz-fit-content;width:fit-content}`)],c);var p=c;export{c as Heading,p as default};
1
+ import{__decorate as t}from"tslib";import{godown as r,styles as e,attr as i,htmlSlot as o}from"@godown/element";import{css as h,nothing as a,html as s}from"lit";import{property as n}from"lit/decorators.js";import{GlobalStyle as d}from"../core/global-style.js";let c=class Heading extends d{constructor(){super(...arguments),this.as="h1",this.anchor="#",this.side="left"}render(){return s`<a part="root" href="${this.id?"#"+this.id:a}" ${i(this.observedRecord)}>${this.wrapHeading(o(),this.id?s`<i part="anchor">${this.anchor}</i>`:"")}</a>`}wrapHeading(...t){switch(this.as){case"h2":return s`<h2>${t}</h2>`;case"h3":return s`<h3>${t}</h3>`;case"h4":return s`<h4>${t}</h4>`;case"h5":return s`<h5>${t}</h5>`;case"h6":return s`<h6>${t}</h6>`;default:return s`<h1>${t}</h1>`}}};t([n()],c.prototype,"as",void 0),t([n()],c.prototype,"anchor",void 0),t([n()],c.prototype,"side",void 0),c=t([r("heading"),e(h`:host{display:block;text-align:start}[part=anchor]{min-width:1.25em;position:absolute;right:100%;text-align:center}[side=left] [part=anchor]{right:100%}[side=right] [part=anchor]{left:100%}a{color:inherit}h1,h2,h3,h4,h5,h6{direction:ltr;font-size:revert;position:relative;width:-moz-fit-content;width:fit-content}`)],c);var p=c;export{c as Heading,p as default};
2
2
  //# sourceMappingURL=heading.js.map
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{part as e,godown as i,styles as o,attr as r,tokenList as s,htmlSlot as a}from"@godown/element";import p from"@godown/f7-icon/icons/eye-slash-fill.js";import{css as n,html as u,nothing as h}from"lit";import{property as l}from"lit/decorators.js";import{cssGlobalVars as d}from"../core/global-style.js";import{SuperInput as c}from"../core/super-input.js";let f=class Input extends c{constructor(){super(...arguments),this.type="text",this.variant="default"}render(){return u`<div part="root" ${r(this.observedRecord)} class="${s("input-field",this.variant)}">${[this._renderPrefix(),u`<input part="input" type="${this.type}" .value="${this.value}" ?autofocus="${this.autofocus}" ?disabled="${this.disabled}" autocapitalize="${this.autocapitalize||h}" autocomplete="${this.autocomplete||h}" placeholder="${this.placeholder||h}" 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)}">${p()}</i>`:a("suffix")}</label>`}};t([l()],f.prototype,"variant",void 0),t([e("input")],f.prototype,"_input",void 0),f=t([i("input"),o(n`:host{display:block;height:var(${d.input}-height);width:var(${d.input}-width)}.outline,:host(:focus-within){${d.input}-outline-color:var(${d.active})}`)],f);var $=f;export{f as Input,$ as default};
1
+ import{__decorate as t}from"tslib";import{part as e,godown as i,styles as o,attr as r,tokenList as s,htmlSlot as a}from"@godown/element";import p from"@godown/f7-icon/icons/eye-slash-fill.js";import{css as n,nothing as u,html as h}from"lit";import{property as l}from"lit/decorators.js";import{cssGlobalVars as d}from"../core/global-style.js";import{SuperInput as c}from"../core/super-input.js";let f=class Input extends c{constructor(){super(...arguments),this.type="text",this.variant="default"}render(){return h`<div part="root" ${r(this.observedRecord)} class="${s("input-field",this.variant)}">${[this._renderPrefix(),h`<input part="input" type="${this.type}" .value="${this.value}" ?autofocus="${this.autofocus}" ?disabled="${this.disabled}" autocapitalize="${this.autocapitalize||u}" autocomplete="${this.autocomplete||u}" placeholder="${this.placeholder||u}" id="${this.makeId}" @input="${this._handleInput}" @change="${this._handleChange}">`,this._renderSuffix()]}</div>`}_renderSuffix(){const t="password";return h`<label for="${this.makeId}" part="suffix">${this.type===t?h`<i part="icon" @mousedown="${()=>this._changeInputType("text")}" @mouseup="${()=>this._changeInputType(t)}" @mouseleave="${()=>this._changeInputType(t)}">${p()}</i>`:a("suffix")}</label>`}};t([l()],f.prototype,"variant",void 0),t([e("input")],f.prototype,"_input",void 0),f=t([i("input"),o(n`:host{display:block;height:var(${d.input}-height);width:var(${d.input}-width)}.outline,:host(:focus-within){${d.input}-outline-color:var(${d.active})}`)],f);var $=f;export{f as Input,$ as default};
2
2
  //# sourceMappingURL=input.js.map
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{godown as r,styles as e,isNil 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"../core/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"../core/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=progress.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"progress.js","sources":["../src/components/progress.ts"],"sourcesContent":null,"names":["Progress","GlobalStyle","constructor","this","max","min","render","className","width","isNil","value","ranger","Ranger","restrict","diff","html","attr","observedRecord","__decorate","property","type","Number","prototype","godown","styles","css","cssGlobalVars","passive","active","Progress$1"],"mappings":"mRAeA,IAAMA,EAAN,MAAMA,iBAAiBC,EAAvB,WAAAC,uBAEEC,KAAGC,IAAG,EAGND,KAAGE,IAAG,EAKI,MAAAC,GACR,IACIC,EADAC,EAAQ,GAEZ,IAAKC,EAAMN,KAAKO,OAAQ,CACtB,MAAMC,EAAS,IAAIC,EAAOT,KAAKE,IAAKF,KAAKC,KACzCI,EAAoD,IAA5CG,EAAOE,SAASV,KAAKO,MAAQC,EAAOG,MAC5CP,EAAY,SAEd,OAAOQ,CAAI,oBAGLC,EAAKb,KAAKc,0BACHV,mCAIQC,oBAxBvBU,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACXrB,EAAAsB,UAAA,WAAA,GAGPJ,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACXrB,EAAAsB,UAAA,WAAA,GAGPJ,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACLrB,EAAAsB,UAAA,aAAA,GARTtB,EAAQkB,EAAA,CAFbK,EAPiB,YAQjBC,EAAOC,CAAG,wBAAwBC,EAAcC,0CAA0CD,EAAcE,2ZACnG5B,GAiCN,IAAA6B,EAAe7B"}
1
+ {"version":3,"file":"progress.js","sources":["../src/components/progress.ts"],"sourcesContent":null,"names":["Progress","GlobalStyle","constructor","this","max","min","render","className","width","isNullable","value","ranger","Ranger","restrict","diff","html","attr","observedRecord","__decorate","property","type","Number","prototype","godown","styles","css","cssGlobalVars","passive","active","Progress$1"],"mappings":"wRAeA,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,oBAGLC,EAAKb,KAAKc,0BACHV,mCAIQC,oBAxBvBU,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACXrB,EAAAsB,UAAA,WAAA,GAGPJ,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACXrB,EAAAsB,UAAA,WAAA,GAGPJ,EAAA,CADCC,EAAS,CAAEC,KAAMC,UACLrB,EAAAsB,UAAA,aAAA,GARTtB,EAAQkB,EAAA,CAFbK,EAPiB,YAQjBC,EAAOC,CAAG,wBAAwBC,EAAcC,0CAA0CD,EAAcE,2ZACnG5B,GAiCN,IAAA6B,EAAe7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../src/components/range.ts"],"names":[],"mappings":"A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AC,cAAc,CAAqC;IAE3D;;;OAGG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAchC;;OAEG;IACH,UAAU,IAAI,IAAI;IAKlB;;;;OAIG;IACH,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,MAAM,OAC7B,aAAa,KAAG,IAAI;IAgBjC;;;;OAIG;IACH,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,OAC1B,UAAU,KAAG,IAAI;IAM9B;;;;OAIG;IACH,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,WACrB,MAAM,KAAG,IAAI;IAY9B;;;OAGG;IACH,SAAS,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,GAAG,MAAM;IAKjE;;;;OAIG;IACH,SAAS,CAAC,oBAAoB,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAenD;;;;OAIG;IACH,SAAS,CAAC,uBAAuB,CAAC,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,OAC9D,UAAU,KAAG,IAAI;IAa9B;;;;OAIG;IACH,SAAS,CAAC,uBAAuB,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,OACzD,UAAU,KAAG,IAAI;IAS9B,SAAS,CAAC,cAAc,IAAI,IAAI;IAchC,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,CAAC;IAIT,QAAQ,IAAI,CAAC;CAMd;AAED,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -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,joinProperties as n,loop as h,tokenList as l,isNil as c}from"@godown/element";import{css as d,html as u}from"lit";import{property as v,queryAll as p,state as m}from"lit/decorators.js";import{scopePrefix as f,cssGlobalVars as g}from"../core/global-style.js";import{SuperInput as w}from"../core/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 u`<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 u`<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,c(this.value)&&(c(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(d`: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}`,d`[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%}`,d`[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,joinProperties as n,loop as h,tokenList as l,isNullable as c}from"@godown/element";import{css as d,html as u}from"lit";import{property as v,queryAll as p,state as m}from"lit/decorators.js";import{scopePrefix as f,cssGlobalVars as g}from"../core/global-style.js";import{SuperInput as w}from"../core/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 u`<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 u`<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,c(this.value)&&(c(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(d`: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}`,d`[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%}`,d`[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=range.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"range.js","sources":["../src/components/range.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","joinProperties","map","index","loop","_renderHandle","end","tokenList","lastFocus","createMouseDown","focusHandle","blurHandle","indexOf","indexOfFocusStack","splice","push","handleItem","_handles","item","focus","__keydownEvent","events","add","document","createKeydownEvent","undefined","remove","e","old","key","preventDefault","createSetValue","createMousedownListener","normalizeValue","normalize","newValue","dispatchCustomEvent","_computeValue","clientX","clientY","top","left","height","width","_root","getBoundingClientRect","present","reduce","acc","abs","set","mouseMoveCallback","stopPropagation","move","createMousemoveListener","stop","callback","restrict","call","_connectedInit","isNil","default","round","reset","sort","toSorted","a","b","__decorate","property","type","Number","prototype","Boolean","reflect","part","queryAll","state","godown","styles","css","cssGlobalVars","active","input","passive","Range$1"],"mappings":"iaAOA,MAAMA,EAAY,QACZC,EAAWC,EAAYF,GAoB7B,IAAMG,EAAN,MAAMA,cAAiDC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J,EAAA,CADTQ,EAAS,kBACiCjH,EAAA6G,UAAA,gBAAA,GAG3CJ,EAAA,CADCS,KACiBlH,EAAA6G,UAAA,iBAAA,GA9Cd7G,EAAKyG,EAAA,CANVU,EAAOtH,GACPuH,EACCC,CAAG,SAASvH,wBAA+BwH,EAAcC,WAAWzH,uBAA8BA,iBAAwBwH,EAAcE,+BAA+BF,EAAcG,oCAAoC3H,uFAA8FA,2FAAkGA,uCAA8CA,iFAAwFA,iHAAwHwH,EAAcC,0RAA0RD,EAAcC,8CAA8CD,EAAcE,0FAA0F1H,uHACnmCuH,CAAG,uCAAuCvH,gNAC1CuH,CAAG,8FAECrH,GAgTN,IAAA0H,EAAe1H"}
1
+ {"version":3,"file":"range.js","sources":["../src/components/range.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","joinProperties","map","index","loop","_renderHandle","end","tokenList","lastFocus","createMouseDown","focusHandle","blurHandle","indexOf","indexOfFocusStack","splice","push","handleItem","_handles","item","focus","__keydownEvent","events","add","document","createKeydownEvent","undefined","remove","e","old","key","preventDefault","createSetValue","createMousedownListener","normalizeValue","normalize","newValue","dispatchCustomEvent","_computeValue","clientX","clientY","top","left","height","width","_root","getBoundingClientRect","present","reduce","acc","abs","set","mouseMoveCallback","stopPropagation","move","createMousemoveListener","stop","callback","restrict","call","_connectedInit","isNullable","default","round","reset","sort","toSorted","a","b","__decorate","property","type","Number","prototype","Boolean","reflect","part","queryAll","state","godown","styles","css","cssGlobalVars","active","input","passive","Range$1"],"mappings":"saAOA,MAAMA,EAAY,QACZC,EAAWC,EAAYF,GAoB7B,IAAMG,EAAN,MAAMA,cAAiDC,EAAvD,WAAAC,uBAKEC,KAAGC,IAAG,EAMND,KAAGE,I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AA,GAG3CJ,EAAA,CADCS,KACiBlH,EAAA6G,UAAA,iBAAA,GA9Cd7G,EAAKyG,EAAA,CANVU,EAAOtH,GACPuH,EACCC,CAAG,SAASvH,wBAA+BwH,EAAcC,WAAWzH,uBAA8BA,iBAAwBwH,EAAcE,+BAA+BF,EAAcG,oCAAoC3H,uFAA8FA,2FAAkGA,uCAA8CA,iFAAwFA,iHAAwHwH,EAAcC,0RAA0RD,EAAcC,8CAA8CD,EAAcE,0FAA0F1H,uHACnmCuH,CAAG,uCAAuCvH,gNAC1CuH,CAAG,8FAECrH,GAgTN,IAAA0H,EAAe1H"}
@@ -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,html as h,nothing as a}from"lit";import{property as c,state as u}from"lit/decorators.js";import p from"./input.js";import{cssGlobalVars as d}from"../core/global-style.js";import{directionOutsetPlace as f}from"../core/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 h`<div part="root" ${s(this.observedRecord)} class="input-field">${[this._renderPrefix(),h`<input part="input" type="${this.type}" .value="${this.text}" ?autofocus="${this.autofocus}" ?disabled="${this.disabled}" autocapitalize="${this.autocapitalize||a}" autocomplete="${this.autocomplete||a}" placeholder="${this.placeholder||a}" id="${this.makeId}" @focus="${this._handleFocus}" @input="${this._handleInput}" @change="${this._handleChange}">`,h`<label for="${this.makeId}" part="suffix"><i part="icon">${n()}</i></label>`,h`<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;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.js";import{cssGlobalVars as d}from"../core/global-style.js";import{directionOutsetPlace as f}from"../core/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;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=select.js.map
@@ -1,3 +1,4 @@
1
+ import { Ranger } from "@godown/element";
1
2
  import { type PropertyValueMap, type TemplateResult } from "lit";
2
3
  import { GlobalStyle } from "../core/global-style.js";
3
4
  /**
@@ -33,11 +34,13 @@ declare class Typewriter extends GlobalStyle {
33
34
  contentInternal: string;
34
35
  protected timeoutID: number;
35
36
  protected _i: HTMLElement;
37
+ protected _ranger: Ranger;
36
38
  /**
37
39
  * {@linkcode Typewriter.content} length.
38
40
  */
39
41
  get len(): number;
40
42
  protected render(): TemplateResult<1>;
43
+ connectedCallback(): void;
41
44
  protected firstUpdated(): void;
42
45
  protected updated(changedProperties: PropertyValueMap<this>): void;
43
46
  write(at?: number): void;
@@ -1 +1 @@
1
- {"version":3,"file":"typewriter.d.ts","sourceRoot":"","sources":["../src/components/typewriter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAG5E,OAAO,EAAE,WAAW,EAAe,MAAM,yBAAyB,CAAC;AAKnE;;;;GAIG;AACH,cAEM,UAAW,SAAQ,WAAW;IAClC;;OAEG;IAEH,OAAO,SAAM;IAEb;;OAEG;IAEH,KAAK,UAAS;IAEd;;OAEG;IAEH,GAAG,SAAO;IAEV;;OAEG;IAEH,GAAG,SAAM;IAET;;OAEG;IAEH,KAAK,SAAK;IAEV;;OAEG;IAEH,KAAK,SAAK;IAGV,eAAe,SAAM;IAErB,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;IAG5B,SAAS,CAAC,EAAE,EAAE,WAAW,CAAC;IAE1B;;OAEG;IACH,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;I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C,IAAI,IAAI,IAAI;IAIZ,GAAG,IAAI,IAAI;CAGZ;AAED,eAAe,UAAU,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{godown as e,styles as i,attr as o,htmlSlot as r,random as n}from"@godown/element";import{css as s,html as d}from"lit";import{property as h,state as p,query as a}from"lit/decorators.js";import{scopePrefix as l,GlobalStyle as m}from"../core/global-style.js";const c="typewriter",y=l(c);let u=class Typewriter extends m{constructor(){super(...arguments),this.content="",this.ended=!1,this.max=100,this.min=50,this.delay=0,this.index=0,this.contentInternal=""}get len(){return this.content.length}render(){return d`<div part="root" ${o(this.observedRecord)}>${r()} ${this.contentInternal} <i part="cursor" ?hidden="${this.ended}"></i></div>`}firstUpdated(){this.content||=this._slot?.assignedNodes()[0]?.textContent.trim()||"",!this.ended&&this.len&&this.write()}updated(t){t.has("index")&&this.dispatchCustomEvent(this.index===this.len?"done":"write",this.contentInternal)}write(t=this.index){this.contentInternal=this.content.slice(0,t+1);const e=this.delay||n(this.max,this.min);this.timeoutID=this.timeouts.add(setTimeout((()=>{const e=t+1;e<=this.len&&(this.index=e,this.write())}),e))}stop(){clearTimeout(this.timeoutID)}end(){this.ended=!0}};t([h()],u.prototype,"content",void 0),t([h({type:Boolean})],u.prototype,"ended",void 0),t([h({type:Number})],u.prototype,"max",void 0),t([h({type:Number})],u.prototype,"min",void 0),t([h({type:Number})],u.prototype,"delay",void 0),t([h({type:Number})],u.prototype,"index",void 0),t([p()],u.prototype,"contentInternal",void 0),t([a("i")],u.prototype,"_i",void 0),u=t([e(c),i(s`:host{${y}--cursor-width:.05em}:host,:host([contents]) [part=root]{display:inline-block}i{animation:s 1.5s steps(1) infinite;border-right:var(${y}--cursor-width) solid;margin-left:.02em}@keyframes s{0%{border-color:currentColor}50%{border-color:transparent}}slot{display:none}`)],u);var v=u;export{u as Typewriter,v as default};
1
+ import{__decorate as t}from"tslib";import{godown as e,styles as o,attr as i,htmlSlot as n,Ranger as r}from"@godown/element";import{css as s,html as d}from"lit";import{property as h,state as a,query as p}from"lit/decorators.js";import{scopePrefix as l,GlobalStyle as c}from"../core/global-style.js";const m="typewriter",y=l(m);let u=class Typewriter extends c{constructor(){super(...arguments),this.content="",this.ended=!1,this.max=100,this.min=50,this.delay=0,this.index=0,this.contentInternal=""}get len(){return this.content.length}render(){return d`<div part="root" ${i(this.observedRecord)}>${n()} ${this.contentInternal} <i part="cursor" ?hidden="${this.ended}"></i></div>`}connectedCallback(){super.connectedCallback(),this._ranger=new r(this.min,this.max)}firstUpdated(){this.content||=this._slot?.assignedNodes()[0]?.textContent.trim()||"",!this.ended&&this.len&&this.write()}updated(t){t.has("index")&&this.dispatchCustomEvent(this.index===this.len?"done":"write",this.contentInternal)}write(t=this.index){this.contentInternal=this.content.slice(0,t+1);const e=this.delay||this._ranger.random();this.timeoutID=this.timeouts.add(setTimeout((()=>{const e=t+1;e<=this.len&&(this.index=e,this.write())}),e))}stop(){clearTimeout(this.timeoutID)}end(){this.ended=!0}};t([h()],u.prototype,"content",void 0),t([h({type:Boolean})],u.prototype,"ended",void 0),t([h({type:Number})],u.prototype,"max",void 0),t([h({type:Number})],u.prototype,"min",void 0),t([h({type:Number})],u.prototype,"delay",void 0),t([h({type:Number})],u.prototype,"index",void 0),t([a()],u.prototype,"contentInternal",void 0),t([p("i")],u.prototype,"_i",void 0),u=t([e(m),o(s`:host{${y}--cursor-width:.05em}:host,:host([contents]) [part=root]{display:inline-block}i{animation:s 1.5s steps(1) infinite;border-right:var(${y}--cursor-width) solid;margin-left:.02em}@keyframes s{0%{border-color:currentColor}50%{border-color:transparent}}slot{display:none}`)],u);var v=u;export{u as Typewriter,v as default};
2
2
  //# sourceMappingURL=typewriter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"typewriter.js","sources":["../src/components/typewriter.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Typewriter","GlobalStyle","constructor","this","content","ended","max","min","delay","index","contentInternal","len","length","render","html","attr","observedRecord","htmlSlot","firstUpdated","_slot","assignedNodes","textContent","trim","write","updated","changedProperties","has","dispatchCustomEvent","at","slice","timeout","random","timeoutID","timeouts","add","setTimeout","nx","stop","clearTimeout","end","__decorate","property","prototype","type","Boolean","Number","state","query","godown","styles","css","Typewriter$1"],"mappings":"0SAMA,MAAMA,EAAY,aACZC,EAAWC,EAAYF,GAS7B,IAAMG,EAAN,MAAMA,mBAAmBC,EAAzB,WAAAC,uBAKEC,KAAOC,QAAG,GAMVD,KAAKE,OAAG,EAMRF,KAAGG,IAAG,IAMNH,KAAGI,IAAG,GAMNJ,KAAKK,MAAG,EAMRL,KAAKM,MAAG,EAGRN,KAAeO,gBAAG,GAUlB,OAAIC,GACF,OAAOR,KAAKC,QAAQQ,OAGZ,MAAAC,GACR,OAAOC,CAAI,oBAGLC,EAAKZ,KAAKa,mBAEVC,OAAcd,KAAKO,6CAGRP,KAAKE,oBAMd,YAAAa,GACRf,KAAKC,UAAYD,KAAKgB,OAAOC,gBAAgB,IAAIC,YAAYC,QAAU,IAClEnB,KAAKE,OAASF,KAAKQ,KACtBR,KAAKoB,QAIC,OAAAC,CAAQC,GACZA,EAAkBC,IAAI,UACxBvB,KAAKwB,oBAAoBxB,KAAKM,QAAUN,KAAKQ,IAAM,OAAS,QAASR,KAAKO,iBAI9E,KAAAa,CAAMK,EAAazB,KAAKM,OACtBN,KAAKO,gBAAkBP,KAAKC,QAAQyB,MAAM,EAAGD,EAAK,GAClD,MAAME,EAAU3B,KAAKK,OAASuB,EAAO5B,KAAKG,IAAKH,KAAKI,KACpDJ,KAAK6B,UAAY7B,KAAK8B,SAASC,IAC7BC,YAAW,KACT,MAAMC,EAAKR,EAAK,EACZQ,GAAMjC,KAAKQ,MACbR,KAAKM,MAAQ2B,EACbjC,KAAKoB,WAENO,IAIP,IAAAO,GACEC,aAAanC,KAAK6B,WAGpB,GAAAO,GACEpC,KAAKE,OAAQ,IA9FfmC,EAAA,CADCC,KACWzC,EAAA0C,UAAA,eAAA,GAMZF,EAAA,CADCC,EAAS,CAAEE,KAAMC,WACL5C,EAAA0C,UAAA,aAAA,GAMbF,EAAA,CADCC,EAAS,CAAEE,KAAME,UACT7C,EAAA0C,UAAA,WAAA,GAMTF,EAAA,CADCC,EAAS,CAAEE,KAAME,UACV7C,EAAA0C,UAAA,WAAA,GAMRF,EAAA,CADCC,EAAS,CAAEE,KAAME,UACT7C,EAAA0C,UAAA,aAAA,GAMTF,EAAA,CADCC,EAAS,CAAEE,KAAME,UACT7C,EAAA0C,UAAA,aAAA,GAGTF,EAAA,CADCM,KACmB9C,EAAA0C,UAAA,uBAAA,GAKVF,EAAA,CADTO,EAAM,MACkB/C,EAAA0C,UAAA,UAAA,GA3CrB1C,EAAUwC,EAAA,CAFfQ,EAAOnD,GACPoD,EAAOC,CAAG,SAASpD,wIAA+IA,wIAC7JE,GAuGN,IAAAmD,EAAenD"}
1
+ {"version":3,"file":"typewriter.js","sources":["../src/components/typewriter.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Typewriter","GlobalStyle","constructor","this","content","ended","max","min","delay","index","contentInternal","len","length","render","html","attr","observedRecord","htmlSlot","connectedCallback","super","_ranger","Ranger","firstUpdated","_slot","assignedNodes","textContent","trim","write","updated","changedProperties","has","dispatchCustomEvent","at","slice","timeout","random","timeoutID","timeouts","add","setTimeout","nx","stop","clearTimeout","end","__decorate","property","prototype","type","Boolean","Number","state","query","godown","styles","css","Typewriter$1"],"mappings":"0SAMA,MAAMA,EAAY,aACZC,EAAWC,EAAYF,GAS7B,IAAMG,EAAN,MAAMA,mBAAmBC,EAAzB,WAAAC,uBAKEC,KAAOC,QAAG,GAMVD,KAAKE,OAAG,EAMRF,KAAGG,IAAG,IAMNH,KAAGI,IAAG,GAMNJ,KAAKK,MAAG,EAMRL,KAAKM,MAAG,EAGRN,KAAeO,gBAAG,GAWlB,OAAIC,GACF,OAAOR,KAAKC,QAAQQ,OAGZ,MAAAC,GACR,O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MACkBnD,EAAA8C,UAAA,UAAA,GA3CrB9C,EAAU4C,EAAA,CAFfQ,EAAOvD,GACPwD,EAAOC,CAAG,SAASxD,wIAA+IA,wIAC7JE,GA6GN,IAAAuD,EAAevD"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{styles as r,attr as o,htmlSlot as e}from"@godown/element";import{css as i,html as a,nothing as l}from"lit";import{property as n}from"lit/decorators.js";import{GlobalStyle as s}from"./global-style.js";let h=class SuperAnchor extends s{constructor(){super(...arguments),this.target="_self"}get pathname(){return new URL(this.href,location.href).pathname}render(){return a`<a part="root" ${o(this.observedRecord)} href="${this.href||l}" target="${this.target}" @click="${this._handleClick}">${e()}</a>`}};t([n()],h.prototype,"href",void 0),t([n()],h.prototype,"target",void 0),h=t([r(i`:host{color:currentColor;cursor:default;display:inline-block;text-decoration:none}:host([href]){cursor:pointer}[part=root]{color:inherit;display:inline-block;text-decoration:inherit}`)],h);var c=h;export{h as SuperAnchor,c as default};
1
+ import{__decorate as t}from"tslib";import{styles as r,attr as o,htmlSlot as e}from"@godown/element";import{css as i,nothing as a,html as l}from"lit";import{property as n}from"lit/decorators.js";import{GlobalStyle as s}from"./global-style.js";let h=class SuperAnchor extends s{constructor(){super(...arguments),this.target="_self"}get pathname(){return new URL(this.href,location.href).pathname}render(){return l`<a part="root" ${o(this.observedRecord)} href="${this.href||a}" target="${this.target}" @click="${this._handleClick}">${e()}</a>`}};t([n()],h.prototype,"href",void 0),t([n()],h.prototype,"target",void 0),h=t([r(i`:host{color:currentColor;cursor:default;display:inline-block;text-decoration:none}:host([href]){cursor:pointer}[part=root]{color:inherit;display:inline-block;text-decoration:inherit}`)],h);var c=h;export{h as SuperAnchor,c as default};
2
2
  //# sourceMappingURL=super-anchor.js.map