godown 3.13.0 → 3.13.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.
- package/build/godown+lit.iife.js +2 -2
- package/build/godown+lit.iife.js.map +1 -1
- package/build/godown+lit.js +2 -2
- package/build/godown+lit.js.map +1 -1
- package/build/godown+lit.umd.js +2 -2
- package/build/godown+lit.umd.js.map +1 -1
- package/build/godown.iife.js +4 -4
- package/build/godown.iife.js.map +1 -1
- package/build/godown.js +3 -3
- package/build/godown.js.map +1 -1
- package/build/godown.umd.js +5 -5
- package/build/godown.umd.js.map +1 -1
- package/internal/global-style.js +1 -1
- package/internal/global-style.js.map +1 -1
- package/internal/popover.js +1 -1
- package/internal/popover.js.map +1 -1
- package/package.json +1 -1
- package/src/internal/global-style.ts +2 -2
- package/src/internal/popover.ts +8 -8
- package/src/web-components/alert/component.ts +5 -13
- package/src/web-components/button/component.ts +6 -12
- package/src/web-components/card/component.ts +1 -2
- package/src/web-components/input/component.ts +4 -4
- package/src/web-components/select/component.ts +1 -0
- package/src/web-components/tabs/component.ts +1 -1
- package/web-components/alert/component.d.ts.map +1 -1
- package/web-components/alert/component.js +1 -1
- package/web-components/alert/component.js.map +1 -1
- package/web-components/button/component.d.ts.map +1 -1
- package/web-components/button/component.js +1 -1
- package/web-components/button/component.js.map +1 -1
- package/web-components/card/component.d.ts.map +1 -1
- package/web-components/card/component.js +1 -1
- package/web-components/card/component.js.map +1 -1
- package/web-components/input/component.js +1 -1
- package/web-components/input/component.js.map +1 -1
- package/web-components/select/component.d.ts.map +1 -1
- package/web-components/select/component.js +1 -1
- package/web-components/select/component.js.map +1 -1
- package/web-components/tabs/component.js +1 -1
- package/web-components/tabs/component.js.map +1 -1
- package/web-types.json +1 -1
@@ -24,20 +24,15 @@ const protoName = "alert";
|
|
24
24
|
}
|
25
25
|
|
26
26
|
:host,
|
27
|
-
:where(:host([contents]) [part="root"])
|
27
|
+
:where(:host([contents]) [part="root"]),
|
28
|
+
b {
|
28
29
|
display: block;
|
29
30
|
}
|
30
31
|
|
31
32
|
[part="root"] {
|
32
|
-
padding:
|
33
|
+
padding: 1em;
|
33
34
|
display: grid;
|
34
|
-
align-items: center;
|
35
35
|
grid-template-columns: auto 1fr auto;
|
36
|
-
grid-template-rows: auto 1fr;
|
37
|
-
}
|
38
|
-
|
39
|
-
[part="content"] {
|
40
|
-
display: grid;
|
41
36
|
}
|
42
37
|
`)
|
43
38
|
class Alert extends GlobalStyle {
|
@@ -63,13 +58,10 @@ class Alert extends GlobalStyle {
|
|
63
58
|
|
64
59
|
protected render(): TemplateResult<1> {
|
65
60
|
return html`
|
66
|
-
<div
|
67
|
-
part="root"
|
68
|
-
${attr(this.observedRecord)}
|
69
|
-
>
|
61
|
+
<div part="root">
|
70
62
|
<div>${htmlSlot("prefix")}</div>
|
71
63
|
<div part="content">
|
72
|
-
<
|
64
|
+
<b part="title">${htmlSlot("title", this.title)}</b>
|
73
65
|
${htmlSlot("", this.content)}
|
74
66
|
</div>
|
75
67
|
<div>${htmlSlot("suffix")}</div>
|
@@ -43,26 +43,20 @@ const cssScope = scopePrefix(protoName);
|
|
43
43
|
${cssScope}--deg: 45deg;
|
44
44
|
color: var(${cssGlobalVars.primaryForeground});
|
45
45
|
background: var(${cssGlobalVars.primaryBackground});
|
46
|
-
|
47
|
-
border-style: none;
|
48
|
-
width: fit-content;
|
49
|
-
display: block;
|
46
|
+
display: inline-block;
|
50
47
|
overflow: hidden;
|
51
48
|
text-align: center;
|
52
49
|
cursor: pointer;
|
53
50
|
}
|
54
51
|
|
55
|
-
[part="root"]:not([contents]) {
|
56
|
-
height: 100%;
|
57
|
-
width: 100%;
|
58
|
-
}
|
59
|
-
|
60
52
|
[part="root"] {
|
61
|
-
padding: 0.25em
|
53
|
+
padding-block: 0.25em;
|
54
|
+
padding-inline: 1em;
|
62
55
|
position: relative;
|
63
56
|
user-select: none;
|
64
|
-
display:
|
65
|
-
|
57
|
+
display: inline-flex;
|
58
|
+
align-items: center;
|
59
|
+
justify-content: center;
|
66
60
|
}
|
67
61
|
|
68
62
|
i {
|
@@ -23,7 +23,6 @@ const cssScope = scopePrefix(protoName);
|
|
23
23
|
@godown(protoName)
|
24
24
|
@styles(css`
|
25
25
|
:host {
|
26
|
-
${cssScope}--padding: .75em;
|
27
26
|
background: var(${cssGlobalVars.background});
|
28
27
|
color: var(${cssGlobalVars.foreground});
|
29
28
|
display: block;
|
@@ -32,7 +31,7 @@ const cssScope = scopePrefix(protoName);
|
|
32
31
|
|
33
32
|
slot {
|
34
33
|
display: block;
|
35
|
-
padding:
|
34
|
+
padding: 1em;
|
36
35
|
}
|
37
36
|
|
38
37
|
[part="root"] {
|
@@ -39,7 +39,6 @@ const protoName = "input";
|
|
39
39
|
@styles(css`
|
40
40
|
:host {
|
41
41
|
display: block;
|
42
|
-
${cssGlobalVars.input}-space: 0.2em;
|
43
42
|
${cssGlobalVars.input}-icon-color: hsl(0, 0%, 50%);
|
44
43
|
}
|
45
44
|
|
@@ -50,7 +49,8 @@ const protoName = "input";
|
|
50
49
|
}
|
51
50
|
|
52
51
|
[part="root"] {
|
53
|
-
padding: 0.
|
52
|
+
padding-inline: 0.75em;
|
53
|
+
padding-block: 0.5em;
|
54
54
|
display: flex;
|
55
55
|
position: relative;
|
56
56
|
align-items: center;
|
@@ -73,11 +73,11 @@ const protoName = "input";
|
|
73
73
|
}
|
74
74
|
|
75
75
|
[part="suffix"] slot svg {
|
76
|
-
margin-inline-start:
|
76
|
+
margin-inline-start: 0.25em;
|
77
77
|
}
|
78
78
|
|
79
79
|
[part="prefix"] slot svg {
|
80
|
-
margin-inline-end:
|
80
|
+
margin-inline-end: 0.25em;
|
81
81
|
}
|
82
82
|
`)
|
83
83
|
class Input extends SuperInput {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/alert/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAiB,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAkC,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIvF;;;;;;;;GAQG;AACH,
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/alert/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAiB,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAkC,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIvF;;;;;;;;GAQG;AACH,cAmBM,KAAM,SAAQ,WAAW;;IAO7B,QAAQ,EAAE,QAAQ,CAAY;IAE9B;;OAEG;IAEH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IAEH,OAAO,EAAE,MAAM,CAAC;IAEhB,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAarC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK;CAM/D;AAED,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{godown as r,styles as o,StyleController as e,
|
1
|
+
import{__decorate as t}from"tslib";import{godown as r,styles as o,StyleController as e,htmlSlot as i}from"@godown/element";import{css as n,html as s}from"lit";import{property as p}from"lit/decorators.js";import{cssGlobalVars as a,GlobalStyle as d}from"../../internal/global-style.js";import{ringTypeAttribute as l,RingBuilder as c}from"../../internal/ring.js";let m=class Alert extends d{constructor(){super(),this.ringType="border",new e(this,(()=>new c({type:this.ringType}).css))}render(){return s`<div part="root"> <div>${i("prefix")}</div> <div part="content"> <b part="title">${i("title",this.title)}</b> ${i("",this.content)} </div> <div>${i("suffix")}</div> </div>`}static alert(t,r){const o=new this;return Object.assign(o,r),t.appendChild(o),o}};t([p({attribute:l})],m.prototype,"ringType",void 0),t([p()],m.prototype,"title",void 0),t([p()],m.prototype,"content",void 0),m=t([r("alert"),o(n`:host{background:var(${a.background});color:var(${a.foreground})}:host,:where(:host([contents]) [part=root]),b{display:block}[part=root]{display:grid;grid-template-columns:auto 1fr auto;padding:1em}`)],m);var v=m;export{m as Alert,v as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/alert/component.ts"],"sourcesContent":null,"names":["Alert","GlobalStyle","constructor","super","this","ringType","StyleController","RingBuilder","type","css","render","html","
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/alert/component.ts"],"sourcesContent":null,"names":["Alert","GlobalStyle","constructor","super","this","ringType","StyleController","RingBuilder","type","css","render","html","htmlSlot","title","content","root","option","Object","assign","ai","appendChild","property","attribute","ringTypeAttribute","prototype","__decorate","godown","styles","cssGlobalVars","background","foreground","Alert$1"],"mappings":"wWAqCA,IAAMA,EAAN,MAAMA,cAAcC,EAClB,WAAAC,GACEC,QAKFC,KAAQC,SAAa,SAJnB,IAAIC,EAAgBF,MAAM,IAAM,IAAIG,EAAY,CAAEC,KAAMJ,KAAKC,WAAYI,MAkBjE,MAAAC,GACR,OAAOC,CAAI,0BAAAC,EAAA,wDAAAA,EAAA,QAAAR,KAAAS,cAAAD,EAAA,GAAAR,KAAAU,wBAAAF,EAAA,sCAEQG,EAAAC,2BAEKC,OAAAC,OAAAC,EAAAH,GAChBD,EAAAK,YAAaD,SAIpB,CACHE,EAAA,CAAAC,UAAAC,KAEAvB,EAAAwB,UAAa,gBAAyC,GACpDC,EAAA,CACAJ,KACArB,EAAAwB,UAAK,aAAe,GACpBC,EAAA,CACFJ,KACDrB,EAAAwB,UAAA,eAAA,GAjCCxB,EAAAyB,EAAA,CADCC,EApCe,SAqCcC,EAAAlB,CAAA,wBAAAmB,EAAAC,yBAAAD,EAAAE,sJAM9B9B,GADC,IAAA+B,EAAU/B"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/button/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAA8B,MAAM,gCAAgC,CAAC;AAKzF;;;;;;;GAOG;AACH,
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/button/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAA8B,MAAM,gCAAgC,CAAC;AAKzF;;;;;;;GAOG;AACH,cA0DM,MAAO,SAAQ,WAAW;IAC9B;;OAEG;IAEH,KAAK,UAAS;IAEd;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,MAAM,UAAS;IAEf;;OAEG;IAEH,KAAK,UAAS;IAEd;;OAEG;IAEH,OAAO,EAAE,MAAM,CAAC;IAGhB,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC;IAElC,SAAS,CAAC,KAAK,EAAE,WAAW,CAAC;IAE7B,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAYrC,KAAK,IAAI,IAAI;IAQb,IAAI,IAAI,IAAI;IAKZ,iBAAiB,IAAI,IAAI;IAKzB,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAW3C,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;CA6B5C;AAED,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{queryPart as e,godown as o,styles as i,attr as r,htmlSlot as n}from"@godown/element";import{css as a,html as s}from"lit";import{property as
|
1
|
+
import{__decorate as t}from"tslib";import{queryPart as e,godown as o,styles as i,attr as r,htmlSlot as n}from"@godown/element";import{css as a,html as s}from"lit";import{property as l}from"lit/decorators.js";import{scopePrefix as d,cssGlobalVars as c,GlobalStyle as p}from"../../internal/global-style.js";const u="button",h=d(u);let m=class Button extends p{constructor(){super(...arguments),this.plain=!1,this.disabled=!1,this.active=!1,this.round=!1}render(){return s`<div part="root" ${r(this.observedRecord)}> ${n("",this.content)} <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)}_handelClick(t){if(this.disabled)return t.stopPropagation(),void t.preventDefault();this.plain||this._handleModal(t)}_handleModal(t){const e=document.createElement("i"),{width:o,height:i}=this.getBoundingClientRect(),{x:r,y:n}=this._root.getBoundingClientRect(),a=2*Math.sqrt(i**2+o**2)+"px";e.style.height=a,e.style.width=a,e.style.left=t.x-r+"px",e.style.top=t.y-n+"px",this._modalRoot.appendChild(e);e.animate([{transform:"scale(0) translate(-50%, -50%)",opacity:.1},{transform:"scale(1) translate(-50%, -50%)",offset:.8},{opacity:0}],{duration:800,iterations:1}),e.addEventListener("animationend",(()=>e.remove()),{once:!0})}};t([l({type:Boolean,reflect:!0})],m.prototype,"plain",void 0),t([l({type:Boolean,reflect:!0})],m.prototype,"disabled",void 0),t([l({type:Boolean,reflect:!0})],m.prototype,"active",void 0),t([l({type:Boolean,reflect:!0})],m.prototype,"round",void 0),t([l()],m.prototype,"content",void 0),t([e("modal-root")],m.prototype,"_modalRoot",void 0),t([e("root")],m.prototype,"_root",void 0),m=t([o(u),i(a`:host(:not([disabled]):active){transform:scale(var(${h}--focus-scale))}:host([round]){border-radius:calc(infinity*1px)}:host([disabled]){cursor:not-allowed;filter:brightness(.85)}:host([plain]){${h}--gradients:unset;${h}--focus-scale:unset}`,a`:host{${h}--modal-animation-duration:1.5s;${h}--focus-scale:.97;${h}--deg:45deg;background:var(${c.primaryBackground});color:var(${c.primaryForeground});cursor:pointer;display:inline-block;overflow:hidden;text-align:center}[part=root]{align-items:center;display:inline-flex;justify-content:center;padding-block:.25em;padding-inline:1em;position:relative;-webkit-user-select:none;user-select:none}i{background:currentColor;border-radius:50%;height:100%;inset:0;opacity:0;pointer-events:none;position:absolute;transform-origin:0 0;visibility:visible;width:100%}`)],m);var f=m;export{m as Button,f as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/button/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Button","GlobalStyle","constructor","this","plain","disabled","active","round","render","html","attr","observedRecord","htmlSlot","content","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","animate","opacity","transform","offset","duration","iterations","addEventListener","remove","once","property","type","Boolean","reflect","prototype","__decorate","queryPart","godown","styles","css","cssGlobalVars","primaryBackground","
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/button/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Button","GlobalStyle","constructor","this","plain","disabled","active","round","render","html","attr","observedRecord","htmlSlot","content","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","animate","opacity","transform","offset","duration","iterations","addEventListener","remove","once","property","type","Boolean","reflect","prototype","__decorate","queryPart","godown","styles","css","cssGlobalVars","primaryBackground","primaryForeground","Button$1"],"mappings":"iTAMA,MAAMA,EAAY,SACZC,EAAWC,EAAYF,GAoE7B,IAAMG,EAAN,MAAMA,eAAeC,EAArB,WAAAC,uBAKEC,KAAKC,OAAG,EAMRD,KAAQE,UAAG,EAMXF,KAAMG,QAAG,EAMTH,KAAKI,OAAG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,KADS,CACME,EAAA,eAMfvD,EAAAqD,UAAA,kBAAA,KADS,CACKE,EAAA,SAMdvD,EAAAqD,UAAA,aAAA,GADCrD,EAAAsD,EAAU,CACKE,EAAA3D,GAGN4D,EAAAC,CAAA,sDAAA5D,+IAAAA,sBAAAA,wBAAA4D,CAAA,SAAA5D,oCAAAA,sBAAAA,+BAAA6D,EAAAC,gCAAAD,EAAAE,ibAAwB,IAAAC,EAAA9D"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/card/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAA8B,MAAM,gCAAgC,CAAC;AAEzF,OAAO,EAAkC,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAKvF;;;;;;;;;;GAUG;AACH,
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/card/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAA8B,MAAM,gCAAgC,CAAC;AAEzF,OAAO,EAAkC,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAKvF;;;;;;;;;;GAUG;AACH,cA0BM,IAAK,SAAQ,WAAW;;IAO5B,QAAQ,EAAE,QAAQ,CAAY;IAE9B;;OAEG;IAEH,MAAM,UAAS;IAEf;;OAEG;IAEH,MAAM,UAAS;IAEf,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;CAUtC;AAED,eAAe,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as
|
1
|
+
import{__decorate as o}from"tslib";import{godown as r,styles as t,StyleController as e,attr as i,htmlSlot as d}from"@godown/element";import{css as a,html as s}from"lit";import{property as n}from"lit/decorators.js";import{scopePrefix as p,cssGlobalVars as l,GlobalStyle as m}from"../../internal/global-style.js";import{ringTypeAttribute as h,RingBuilder as f}from"../../internal/ring.js";const c="card";p(c);let g=class Card extends m{constructor(){super(),this.ringType="border",this.footer=!1,this.header=!1,new e(this,(()=>new f({type:this.ringType}).css))}render(){return s`<div part="root" ${i(this.observedRecord)}> ${[this.header?d("header"):"",d(),this.footer?d("footer"):""]} </div>`}};o([n({attribute:h})],g.prototype,"ringType",void 0),o([n({type:Boolean})],g.prototype,"footer",void 0),o([n({type:Boolean})],g.prototype,"header",void 0),g=o([r(c),t(a`:host{background:var(${l.background});color:var(${l.foreground});display:block;flex-shrink:0}slot{display:block;padding:1em}[part=root]{border-radius:inherit}[name=footer]{padding-top:0}[name=header]{padding-bottom:0}`)],g);var y=g;export{g as Card,y as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/card/component.ts"],"sourcesContent":null,"names":["protoName","
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/card/component.ts"],"sourcesContent":null,"names":["protoName","scopePrefix","Card","GlobalStyle","constructor","super","this","ringType","footer","header","StyleController","RingBuilder","type","css","render","html","attr","observedRecord","htmlSlot","__decorate","prototype","Boolean","property","godown","styles","cssGlobalVars","background","foreground","Card$1"],"mappings":"mYAQA,MAAMA,EAAY,OACDC,EAAYD,GAuC7B,IAAME,EAAN,MAAMA,aAAaC,EACjB,WAAAC,GACEC,QAKFC,KAAQC,SAAa,SAMrBD,KAAME,QAAG,EAMTF,KAAMG,QAAG,EAhBP,IAAIC,EAAgBJ,MAAM,IAAM,IAAIK,EAAY,CAAEC,KAAMN,KAAKC,WAAYM,MAkBjE,MAAAC,GACR,OAAOC,CAAI,oBAAAC,EAAAV,KAAAW,oBAAA,CAAAX,KAAAG,OAAAS,EAAA,UAAA,GAAAA,IAAAZ,KAAAE,OAAAU,EAAA,UAAA,eAGLC,EAAA,mBAEAjB,EAAAkB,UAAY,gBAAG,QAEpB,CAAAR,KAAAS,aACHD,UAAA,cAAA,KACD,CAxBCE,EAAA,CAAAV,KAAAS,WADCnB,EAAAkB,UAAW,cAAW,GACOlB,EAAAiB,EAAA,CAM9BI,EAAAvB,GADCwB,EAAAX,CAAW,wBAAeY,EAAAC,yBAAAD,EAAAE,yKACZzB,GAMf,IAAA0B,EAAA1B"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{queryPart as e,godown as i,styles as r,StyleController as o,attr as n,htmlSlot as s}from"@godown/element";import p from"../../internal/icons/eye-slash.js";import{css as a,nothing as l,html as u}from"lit";import{property as h}from"lit/decorators.js";import{cssGlobalVars as c}from"../../internal/global-style.js";import{SuperInput as
|
1
|
+
import{__decorate as t}from"tslib";import{queryPart as e,godown as i,styles as r,StyleController as o,attr as n,htmlSlot as s}from"@godown/element";import p from"../../internal/icons/eye-slash.js";import{css as a,nothing as l,html as u}from"lit";import{property as h}from"lit/decorators.js";import{cssGlobalVars as c}from"../../internal/global-style.js";import{SuperInput as d}from"../../internal/super-input.js";import{RingBuilder as f}from"../../internal/ring.js";let m=class Input extends d{constructor(){super(),this.type="text",this.variant="default",new o(this,(()=>new f({type:this.ringType}).css+("outline"===this.variant?`:host{${c.ringColor}:currentColor}`:"")))}render(){return u`<label part="root" ${n(this.observedRecord)}> ${[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}" @input="${this._handleInput}" @change="${this._handleChange}"/>`,this._renderSuffix()]} </label>`}_renderSuffix(){const t="password";return this.type===t?u`<i part="suffix" @mousedown="${()=>this._changeInputType("text")}" @mouseup="${()=>this._changeInputType(t)}" @mouseleave="${()=>this._changeInputType(t)}"> ${s("suffix",p())} </i>`:super._renderSuffix()}_changeInputType(t){this._input&&(this._input.type=t)}};t([h({reflect:!0})],m.prototype,"type",void 0),t([h()],m.prototype,"variant",void 0),t([e("input")],m.prototype,"_input",void 0),m=t([i("input"),r(a`:host{display:block;${c.input}-icon-color:grey}:host(:active),:host(:focus-within){${c.ringColor}:currentColor;${c.input}-icon-color:currentColor}[part=root]{align-items:center;border-radius:inherit;display:flex;padding-block:.5em;padding-inline:.75em;position:relative}[part=input]{flex-grow:1;height:100%;width:100%}[part=prefix],[part=suffix]{align-items:center;color:var(${c.input}-icon-color);display:flex;height:100%;justify-content:center}[part=suffix] slot svg{margin-inline-start:.25em}[part=prefix] slot svg{margin-inline-end:.25em}`)],m);var g=m;export{m as Input,g as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/input/component.ts"],"sourcesContent":null,"names":["Input","SuperInput","constructor","super","this","type","variant","StyleController","RingBuilder","ringType","css","cssGlobalVars","ringColor","render","html","attr","observedRecord","_renderSuffix","PASSWORD","_changeInputType","t","property","reflect","__decorate","prototype","queryPart","godown","Input$1"],"mappings":"kdAkFA,IAAMA,EAAN,MAAMA,cAAcC,EAelB,WAAAC,GACEC,QAdFC,KAAIC,KAAc,OAQlBD,KAAOE,QAA0B,UAO/B,IAAIC,EACFH,MACA,IACE,IAAII,EAAY,CAAEH,KAAMD,KAAKK,WAAYC,KACvB,YAAjBN,KAAKE,QAAwB,SAASK,EAAcC,0BAA4B,MAI7E,MAAAC,GACR,OAAOC,CAAI,sBAAAC,EAAAX,KAAAY,oBAAA,2UAGLZ,KAAKa,2BAEL,iBAEA,MAAAC,EAAI,wNAIUf,MAAAc,eACI,CACD,gBAAAE,CAAAC,kCAEOA,EAEV,MAGbC,EAAA,CAAAC,SAAA,gCAEFC,EAAA,QAEJC,UAAA,eAAA,KACH,CAEUC,EAAa,YACfD,UAAA,cAAW,GACjBxB,EAAAuB,EAAS,CACPG,EA9GY,
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/input/component.ts"],"sourcesContent":null,"names":["Input","SuperInput","constructor","super","this","type","variant","StyleController","RingBuilder","ringType","css","cssGlobalVars","ringColor","render","html","attr","observedRecord","_renderSuffix","PASSWORD","_changeInputType","t","property","reflect","__decorate","prototype","queryPart","godown","Input$1"],"mappings":"kdAkFA,IAAMA,EAAN,MAAMA,cAAcC,EAelB,WAAAC,GACEC,QAdFC,KAAIC,KAAc,OAQlBD,KAAOE,QAA0B,UAO/B,IAAIC,EACFH,MACA,IACE,IAAII,EAAY,CAAEH,KAAMD,KAAKK,WAAYC,KACvB,YAAjBN,KAAKE,QAAwB,SAASK,EAAcC,0BAA4B,MAI7E,MAAAC,GACR,OAAOC,CAAI,sBAAAC,EAAAX,KAAAY,oBAAA,2UAGLZ,KAAKa,2BAEL,iBAEA,MAAAC,EAAI,wNAIUf,MAAAc,eACI,CACD,gBAAAE,CAAAC,kCAEOA,EAEV,MAGbC,EAAA,CAAAC,SAAA,gCAEFC,EAAA,QAEJC,UAAA,eAAA,KACH,CAEUC,EAAa,YACfD,UAAA,cAAW,GACjBxB,EAAAuB,EAAS,CACPG,EA9GY,kjBAiHM,IAAAC,EAAA3B"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/select/component.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,KAAK,CAAC;AAG9D,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAmB1C;;;;;;;;GAQG;AACH,cAiCM,MAAO,SAAQ,KAAK;IAExB,IAAI,EAAE,MAAM,CAAC;IAGb,QAAQ,UAAS;IAGjB,MAAM,UAAS;IAGf,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,EAAE,CAAM;IAGT,QAAQ,EAAE,WAAW,CAAC;IAEtB,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC;I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AAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{queryPart as e,godown as i,styles as s,attr as o,htmlSlot as l}from"@godown/element";import p from"../../internal/icons/caret-down.js";import{css as r,nothing as a,html as n}from"lit";import{property as h}from"lit/decorators.js";import u from"../input/component.js";import{showPopover as c,hidePopover as d}from"../../internal/popover.js";import{memoize as v}from"../../internal/utils.js";const f=v((()=>CSS.supports("position-area:top")));function m(t,e){if(t){const i="selected";e?t.setAttribute(i,""):t.removeAttribute(i)}}let b=class Select extends u{constructor(){super(...arguments),this.multiple=!1,this.noEdit=!1,this.values=[],this.optionsVisible=!1}render(){const t=this.noEdit||this.disabled;return n`<label part="root" ${o(this.observedRecord)}> ${[this._renderPrefix(),this.noEdit?n`<input style="position: absolute;inset: 0;opacity: 0;"/>`:"",n`<input part="input" .value="${this.text}" ?autofocus="${this.autofocus}" ?disabled="${t}" autocapitalize="${this.autocapitalize||a}" autocomplete="${this.autocomplete||a}" placeholder="${this.placeholder||a}" @input="${t?null:this._handleInput}" @change="${t?null:this._handleChange}"/>`,this._renderSuffix()]} <div part="popover" popover="${f()?"manual":a}"> ${l()} </div> </label>`}_renderSuffix(){return n`<i part="suffix">${l("suffix",p())}</i>`}firstUpdated(){this.events.add(this._slot,"click",(t=>{const{target:e}=t;if("OPTION"!==e.tagName)return;const{label:i,value:s}=e,o=this.select(s,i);this.multiple||(m(this.lastChecked,0),this.hideOptions()),m(e,o),this.lastChecked=e}))}_connectedInit(){this.default=this.value??="",this.defaultText=this.text??="",this.events.add(this,"focus",this.showOptions)}reset(){this.value=this.default,this.text=this.defaultText}select(t,e){e||=t;let i=0;const s=this.values.findIndex((e=>e.value===t));return s>-1?this.values.splice(s,1):(this.values.push({value:t,label:e}),i=1),this.checkValues(),this.value=this.values.map((t=>t.value)).join(","),this.text=this.values.map((t=>t.label)).join(", "),this.dispatchCustomEvent("select",this.value),i}checkValues(){!this.multiple&&this.values.length>1&&(this.values.splice(0,this.values.length-1),this.requestUpdate())}showOptions(){if(this.optionsVisible)return;c(this._popover);const t=e=>{this.contains(e.target)||(this.hideOptions(),this.events.remove(document,"click",t))};this.events.add(document,"click",t),this.optionsVisible=!0}hideOptions(){this.optionsVisible&&(d(this._popover),this.optionsVisible=!1)}focus(t){super.focus(),this._input.focus(t),this.showOptions()}blur(){super.blur(),this._input.blur(),d(this._popover)}};t([h()],b.prototype,"text",void 0),t([h({type:Boolean})],b.prototype,"multiple",void 0),t([h({type:Boolean})],b.prototype,"noEdit",void 0),t([h({type:Array})],b.prototype,"values",void 0),t([e("popover")],b.prototype,"_popover",void 0),b=t([i("select"),s(r`[part=root]{position:relative;anchor-name:--select}label{display:contents}[part=popover]{background:none;border:0;width:100%;position-anchor:--select;position-area:bottom center;position-try-fallbacks:flip-block}[part=input]{text-overflow:ellipsis}@supports not (position-area:top){[part=popover]{display:none;left:0;position:absolute;top:100%}}`)],b);var x=b;export{b as Select,x as default};
|
1
|
+
import{__decorate as t}from"tslib";import{queryPart as e,godown as i,styles as s,attr as o,htmlSlot as l}from"@godown/element";import p from"../../internal/icons/caret-down.js";import{css as r,nothing as a,html as n}from"lit";import{property as h}from"lit/decorators.js";import u from"../input/component.js";import{showPopover as c,hidePopover as d}from"../../internal/popover.js";import{memoize as v}from"../../internal/utils.js";const f=v((()=>CSS.supports("position-area:top")));function m(t,e){if(t){const i="selected";e?t.setAttribute(i,""):t.removeAttribute(i)}}let b=class Select extends u{constructor(){super(...arguments),this.multiple=!1,this.noEdit=!1,this.values=[],this.optionsVisible=!1}render(){const t=this.noEdit||this.disabled;return n`<label part="root" ${o(this.observedRecord)}> ${[this._renderPrefix(),this.noEdit?n`<input style="position: absolute;inset: 0;opacity: 0;"/>`:"",n`<input part="input" .value="${this.text}" ?autofocus="${this.autofocus}" ?disabled="${t}" autocapitalize="${this.autocapitalize||a}" autocomplete="${this.autocomplete||a}" placeholder="${this.placeholder||a}" @input="${t?null:this._handleInput}" @change="${t?null:this._handleChange}"/>`,this._renderSuffix()]} <div part="popover" popover="${f()?"manual":a}"> ${l()} </div> </label>`}_renderSuffix(){return n`<i part="suffix">${l("suffix",p())}</i>`}firstUpdated(){this.events.add(this._slot,"click",(t=>{const{target:e}=t;if("OPTION"!==e.tagName)return;t.preventDefault();const{label:i,value:s}=e,o=this.select(s,i);this.multiple||(m(this.lastChecked,0),this.hideOptions()),m(e,o),this.lastChecked=e}))}_connectedInit(){this.default=this.value??="",this.defaultText=this.text??="",this.events.add(this,"focus",this.showOptions)}reset(){this.value=this.default,this.text=this.defaultText}select(t,e){e||=t;let i=0;const s=this.values.findIndex((e=>e.value===t));return s>-1?this.values.splice(s,1):(this.values.push({value:t,label:e}),i=1),this.checkValues(),this.value=this.values.map((t=>t.value)).join(","),this.text=this.values.map((t=>t.label)).join(", "),this.dispatchCustomEvent("select",this.value),i}checkValues(){!this.multiple&&this.values.length>1&&(this.values.splice(0,this.values.length-1),this.requestUpdate())}showOptions(){if(this.optionsVisible)return;c(this._popover);const t=e=>{this.contains(e.target)||(this.hideOptions(),this.events.remove(document,"click",t))};this.events.add(document,"click",t),this.optionsVisible=!0}hideOptions(){this.optionsVisible&&(d(this._popover),this.optionsVisible=!1)}focus(t){super.focus(),this._input.focus(t),this.showOptions()}blur(){super.blur(),this._input.blur(),d(this._popover)}};t([h()],b.prototype,"text",void 0),t([h({type:Boolean})],b.prototype,"multiple",void 0),t([h({type:Boolean})],b.prototype,"noEdit",void 0),t([h({type:Array})],b.prototype,"values",void 0),t([e("popover")],b.prototype,"_popover",void 0),b=t([i("select"),s(r`[part=root]{position:relative;anchor-name:--select}label{display:contents}[part=popover]{background:none;border:0;width:100%;position-anchor:--select;position-area:bottom center;position-try-fallbacks:flip-block}[part=input]{text-overflow:ellipsis}@supports not (position-area:top){[part=popover]{display:none;left:0;position:absolute;top:100%}}`)],b);var x=b;export{b as Select,x as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/select/component.ts"],"sourcesContent":null,"names":["supportsPositionArea","memoize","CSS","supports","updateSelected","element","operation","name","setAttribute","removeAttribute","Select","Input","constructor","this","multiple","noEdit","values","optionsVisible","render","inputNoEdit","disabled","html","attr","observedRecord","text","autofocus","autocapitalize","nothing","autocomplete","placeholder","_handleInput","_handleChange","_renderSuffix","htmlSlot","svgCaretDown","firstUpdated","target","tagName","select","value","label","lastChecked","
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/select/component.ts"],"sourcesContent":null,"names":["supportsPositionArea","memoize","CSS","supports","updateSelected","element","operation","name","setAttribute","removeAttribute","Select","Input","constructor","this","multiple","noEdit","values","optionsVisible","render","inputNoEdit","disabled","html","attr","observedRecord","text","autofocus","autocapitalize","nothing","autocomplete","placeholder","_handleInput","_handleChange","_renderSuffix","htmlSlot","svgCaretDown","firstUpdated","target","tagName","select","value","label","lastChecked","defaultText","default","i","findIndex","s","splice","push","checkValues","map","join","length","requestUpdate","showOptions","showPopover","_popover","listener","e","contains","events","remove","document","hidePopover","focus","options","super","_input","blur","property","prototype","Boolean","type","__decorate","Array","godown","styles","css"],"mappings":"+aASA,MAAMA,EAAuBC,GAAQ,IAAMC,IAAIC,SAAS,uBAExD,SAASC,EAAeC,EAA6BC,GACnD,GAAID,EAAS,CACX,MAAME,EAAO,WACTD,EACFD,EAAQG,aAAaD,EAAM,IAE3BF,EAAQI,gBAAgBF,GAG9B,CA8CA,IAAMG,EAAN,MAAMA,eAAeC,EAArB,WAAAC,uBAKEC,KAAQC,UAAG,EAGXD,KAAME,QAAG,EAGTF,KAAMG,OAGA,GAOIH,KAAcI,gBAAG,EAEjB,MAAAC,GACR,MAAMC,EAAcN,KAAKE,QAAUF,KAAKO,SACxC,OAAOC,CAAI,sBAAAC,EAAAT,KAAAU,oBAAA,kCAGAF,CAAK,8DAEVA,CAAA,+BAAAR,KAAAW,qBAAAX,KAAAY,y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AEMG,WAAQE,SAAU,QAAEL,GAC1B5C,KAAAI,gBAAA,gBAEWJ,KAAAI,iBAGX8C,EAAalD,KAAI2C,UACjB3C,KAAKI,gBAAkB,GAEvB,KAAA+C,CAAAC,GACFC,MAAAF,QAEWnD,KAAAsD,OAAAH,MAAAC,GACTpD,KAAKyC,aACH,QAEFY,MAAAE,OACFvD,KAAAsD,OAAAC,OAEWL,EAAAlD,KAAA2C,SACT,KAEA,CACAa,KACA3D,EAAA4D,UAAc,YAAO,cAEZC,uBACA,gBAAa,MAEtBF,EAAC,CAAAG,KAAAD,aACGD,UAAW,cAAS,GACxBG,EAAA,CACFJ,EAAA,CAAAG,KAAAE,WAEWJ,UAAA,cAAA,GACTG,EAAA,GACS,cACTH,UAAA,gBAAA,GACA5D,EAAA+D,EAAY,CACZE,EAzLc,UA0LhBC,EAAAC,CAAA,8VAEAnE,SACaA"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{godown as i,styles as e,StyleController as r,attr as n,tokenList as o,htmlSlot as s}from"@godown/element";import{scopePrefix as a,cssGlobalVars as d,GlobalStyle as p}from"../../internal/global-style.js";import{css as c,html as l}from"lit";import{property as h,queryAll as u}from"lit/decorators.js";import{ringTypeAttribute as m,RingBuilder as v}from"../../internal/ring.js";const g="tabs",b=a(g),x="hover";let y=class Tabs extends p{constructor(){super(),this.ringType="border",this.beginning="selected",this.indicator="background",this.index=0,new r(this,(()=>new v({type:this.ringType}).css))}render(){return l`<ul part="root" ${n(this.observedRecord)} @mouseleave="${this._handleMouseLeave}"> ${this.tabs?.map(((t,i)=>l`<li part="${o("item",this.index===i&&"selected")}" @mouseenter=${()=>{this.move(this.previousIndex,i),this.previousIndex=i}} @click=${()=>this.select(i)}> ${s(t,t)} <div part="indicator"></div> </li>`))} </ul>`}connectedCallback(){super.connectedCallback(),this.previousIndex="selected"===this.beginning?this.index:-1}_handleMouseLeave(){const t=this._items[this.previousIndex];t&&t.part.remove(x),this.previousIndex="selected"===this.beginning?this.index:-1}move(t,i){if(t===i)return;const{_items:e,_indicators:r}=this,n=e[i];if(!n)return;n.part.add(x);const o=e[t];if(!o)return;if(o.part.remove(x),"none"===this.beginning)return;const s=r[i],a=r[t];if(!s||!a)return;const{x:d,y:p,width:c}=a.getBoundingClientRect(),{x:l,y:h}=s.getBoundingClientRect(),u=d-l,m=p-h,{style:v}=s,{style:g}=a;v.transform=`translate3d(${u}px,${m}px,0)`,v.width=`${c}px`,v.transition=g.transition="none",s.getBoundingClientRect(),v.width=v.transform=v.transition=g.transition=""}select(t){const{index:i,previousIndex:e}=this;this.move(e,t),t!==i&&(this.previousIndex=t,this.index=t,this.dispatchCustomEvent("select",t))}};t([h({attribute:m})],y.prototype,"ringType",void 0),t([h()],y.prototype,"beginning",void 0),t([h()],y.prototype,"indicator",void 0),t([h({type:Array})],y.prototype,"tabs",void 0),t([h({type:Number})],y.prototype,"index",void 0),t([u("[part~=item]")],y.prototype,"_items",void 0),t([u("[part=indicator]")],y.prototype,"_indicators",void 0),y=t([i(g),e(c`:host{${b}--indicator-background:var(${d.passive});${b}--selected-background:var(${d.passive});cursor:default;display:flex;transition:.2s ease-in-out}[part=root]{border-radius:inherit;display:flex;flex-direction:inherit;gap:.25em;overflow-x:clip;padding:.25em;position:relative;transition:inherit;transition-property:width,transform,opacity;z-index:1}[part~=item]{display:block;
|
1
|
+
import{__decorate as t}from"tslib";import{godown as i,styles as e,StyleController as r,attr as n,tokenList as o,htmlSlot as s}from"@godown/element";import{scopePrefix as a,cssGlobalVars as d,GlobalStyle as p}from"../../internal/global-style.js";import{css as c,html as l}from"lit";import{property as h,queryAll as u}from"lit/decorators.js";import{ringTypeAttribute as m,RingBuilder as v}from"../../internal/ring.js";const g="tabs",b=a(g),x="hover";let y=class Tabs extends p{constructor(){super(),this.ringType="border",this.beginning="selected",this.indicator="background",this.index=0,new r(this,(()=>new v({type:this.ringType}).css))}render(){return l`<ul part="root" ${n(this.observedRecord)} @mouseleave="${this._handleMouseLeave}"> ${this.tabs?.map(((t,i)=>l`<li part="${o("item",this.index===i&&"selected")}" @mouseenter=${()=>{this.move(this.previousIndex,i),this.previousIndex=i}} @click=${()=>this.select(i)}> ${s(t,t)} <div part="indicator"></div> </li>`))} </ul>`}connectedCallback(){super.connectedCallback(),this.previousIndex="selected"===this.beginning?this.index:-1}_handleMouseLeave(){const t=this._items[this.previousIndex];t&&t.part.remove(x),this.previousIndex="selected"===this.beginning?this.index:-1}move(t,i){if(t===i)return;const{_items:e,_indicators:r}=this,n=e[i];if(!n)return;n.part.add(x);const o=e[t];if(!o)return;if(o.part.remove(x),"none"===this.beginning)return;const s=r[i],a=r[t];if(!s||!a)return;const{x:d,y:p,width:c}=a.getBoundingClientRect(),{x:l,y:h}=s.getBoundingClientRect(),u=d-l,m=p-h,{style:v}=s,{style:g}=a;v.transform=`translate3d(${u}px,${m}px,0)`,v.width=`${c}px`,v.transition=g.transition="none",s.getBoundingClientRect(),v.width=v.transform=v.transition=g.transition=""}select(t){const{index:i,previousIndex:e}=this;this.move(e,t),t!==i&&(this.previousIndex=t,this.index=t,this.dispatchCustomEvent("select",t))}};t([h({attribute:m})],y.prototype,"ringType",void 0),t([h()],y.prototype,"beginning",void 0),t([h()],y.prototype,"indicator",void 0),t([h({type:Array})],y.prototype,"tabs",void 0),t([h({type:Number})],y.prototype,"index",void 0),t([u("[part~=item]")],y.prototype,"_items",void 0),t([u("[part=indicator]")],y.prototype,"_indicators",void 0),y=t([i(g),e(c`:host{${b}--indicator-background:var(${d.passive});${b}--selected-background:var(${d.passive});cursor:default;display:flex;transition:.2s ease-in-out}[part=root]{border-radius:inherit;display:flex;flex-direction:inherit;gap:.25em;overflow-x:clip;padding:.25em;position:relative;transition:inherit;transition-property:width,transform,opacity;z-index:1}[part~=item]{display:block;position:relative;text-align:center;white-space:nowrap}[part=indicator],[part~=item],[part~=item]:after{border-radius:inherit;transition:inherit;transition-property:inherit;width:100%}[part=indicator],[part~=item]:after{background:var(${b}--indicator-background);height:100%;inset:0;position:absolute}[part=indicator]{opacity:0;z-index:-1}[part~=item]:after{z-index:-2}[indicator=underline] [part=indicator],[indicator=underline] [part~=item]:after{border-radius:.075em;height:.15em;margin-top:.15em;top:100%}[part~=selected]:after{background:var(${b}--selected-background);content:""}[part~=hover] [part=indicator]{opacity:1}`)],y);var f=y;export{y as Tabs,f as default};
|
2
2
|
//# sourceMappingURL=component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/web-components/tabs/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","hoverToken","Tabs","GlobalStyle","constructor","super","this","ringType","beginning","indicator","index","StyleController","RingBuilder","type","css","render","html","attr","observedRecord","_handleMouseLeave","tabs","map","tab","tokenList","select","htmlSlot","connectedCallback","lastItem","_items","previousIndex","part","remove","_indicators","targetElement","targetIndex","add","fromItem","sourceIndex","targetIndicator","sourceIndicator","x","sourceX","y","sourceY","width","sourceWidth","getBoundingClientRect","transformX","transformY","targetStyle","style","sourceStyle","transform","transition","selected","move","dispatchCustomEvent","__decorate","attribute","prototype","property","Array","Number","queryAll","godown","styles","cssGlobalVars","passive","Tabs$1"],"mappings":"gaAMA,MAAMA,EAAY,OACZC,EAAWC,EAAYF,GAEvBG,EAAa,QAiFnB,IAAMC,EAAN,MAAMA,aAAaC,EA4CjB,WAAAC,GACEC,QA3CFC,KAAQC,SAAa,SAUrBD,KAASE,UAAqC,WAU9CF,KAASG,UAA+B,aAYxCH,KAAKI,MAAG,EAYN,IAAIC,EAAgBL,MAAM,IAAM,IAAIM,EAAY,CAAEC,KAAMP,KAAKC,WAAYO,MAG3E,MAAAC,GACE,OAAOC,CAAI,mBAAAC,EAAAX,KAAAY,gCAAAZ,KAAAa,uBAAAb,KAAAc,MAAAC,KAAA,CAAAC,EAAAZ,IAAAM,CAAA,aAAAO,EAAA,OAAAjB,KAAAI,QAAAA,GAAA,4BAAA,qEAGK,IAAAJ,KAAAkB,OAAed,OAAAe,EAAAH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,iBArIC7D,EAAAyD,UAAA,cAAA,GADCF,EAAA,CAC6BM,EAAA,qBAU9B7D,EAAAyD,UAAA,mBAAA,GADCzD,EAAAuD,EAAU,CAC8CO,EAAAlE,GAUzDmE,EAAAnD,CAAA,SAAAf,+BAAAmE,EAAAC,YAAApE,8BAAAmE,EAAAC,
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/web-components/tabs/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","hoverToken","Tabs","GlobalStyle","constructor","super","this","ringType","beginning","indicator","index","StyleController","RingBuilder","type","css","render","html","attr","observedRecord","_handleMouseLeave","tabs","map","tab","tokenList","select","htmlSlot","connectedCallback","lastItem","_items","previousIndex","part","remove","_indicators","targetElement","targetIndex","add","fromItem","sourceIndex","targetIndicator","sourceIndicator","x","sourceX","y","sourceY","width","sourceWidth","getBoundingClientRect","transformX","transformY","targetStyle","style","sourceStyle","transform","transition","selected","move","dispatchCustomEvent","__decorate","attribute","prototype","property","Array","Number","queryAll","godown","styles","cssGlobalVars","passive","Tabs$1"],"mappings":"gaAMA,MAAMA,EAAY,OACZC,EAAWC,EAAYF,GAEvBG,EAAa,QAiFnB,IAAMC,EAAN,MAAMA,aAAaC,EA4CjB,WAAAC,GACEC,QA3CFC,KAAQC,SAAa,SAUrBD,KAASE,UAAqC,WAU9CF,KAASG,UAA+B,aAYxCH,KAAKI,MAAG,EAYN,IAAIC,EAAgBL,MAAM,IAAM,IAAIM,EAAY,CAAEC,KAAMP,KAAKC,WAAYO,MAG3E,MAAAC,GACE,OAAOC,CAAI,mBAAAC,EAAAX,KAAAY,gCAAAZ,KAAAa,uBAAAb,KAAAc,MAAAC,KAAA,CAAAC,EAAAZ,IAAAM,CAAA,aAAAO,EAAA,OAAAjB,KAAAI,QAAAA,GAAA,4BAAA,qEAGK,IAAAJ,KAAAkB,OAAed,OAAAe,EAAAH,EAAAA,iDACZ,qBAEbjB,MAAIqB,iFAIc,iBAAAP,SACRQ,EAAMrB,KAAk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