rettangoli-ui 0.0.10 → 0.1.0-rc1
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/README.md +28 -599
- package/dist/rettangoli-iife-layout.min.js +252 -245
- package/dist/rettangoli-iife-ui.min.js +517 -276
- package/package.json +10 -5
- package/LICENSE +0 -21
- package/dist/rettangoli-esm.min.js +0 -645
@@ -1,24 +1,24 @@
|
|
1
|
-
var rettangoli=(()=>{var{isArray:
|
2
|
-
:host([${
|
3
|
-
${
|
1
|
+
var rettangoli=(()=>{var{isArray:Nt}=Array,{getPrototypeOf:He,getOwnPropertyDescriptor:ze}=Object,W=[],Ht=()=>document.createRange(),q=(t,e,n)=>(t.set(e,n),n),Fe=(t,e)=>e.reduceRight(je,t),je=(t,e)=>t.childNodes[e],{setPrototypeOf:Ie}=Object,F,zt=(t,e,n)=>(F||(F=Ht()),n?F.setStartAfter(t):F.setStartBefore(t),F.setEndAfter(e),F.deleteContents(),t),Rt=({firstChild:t,lastChild:e},n)=>zt(t,e,n),Ft=!1,yt=(t,e)=>Ft&&t.nodeType===11?1/e<0?e?Rt(t,!0):t.lastChild:e?t.valueOf():t.firstChild:t,Mt=t=>document.createComment(t),Ot=class extends(e=>{function n(o){return Ie(o,new.target.prototype)}return n.prototype=e.prototype,n})(DocumentFragment){#e=Mt("<>");#n=Mt("</>");#t=W;constructor(e){super(e),this.replaceChildren(this.#e,...e.childNodes,this.#n),Ft=!0}get firstChild(){return this.#e}get lastChild(){return this.#n}get parentNode(){return this.#e.parentNode}remove(){Rt(this,!1)}replaceWith(e){Rt(this,!0).replaceWith(e)}valueOf(){let{parentNode:e}=this;if(e===this)this.#t===W&&(this.#t=[...this.childNodes]);else{if(e){let{firstChild:n,lastChild:o}=this;for(this.#t=[n];n!==o;)this.#t.push(n=n.nextSibling)}this.replaceChildren(...this.#t)}return this}},jt=(t,e,n)=>t.setAttribute(e,n),st=(t,e)=>t.removeAttribute(e),ot,Ve=(t,e,n)=>{n=n.slice(1),ot||(ot=new WeakMap);let o=ot.get(t)||q(ot,t,{}),r=o[n];return r&&r[0]&&t.removeEventListener(n,...r),r=Nt(e)?e:[e,!1],o[n]=r,r[0]&&t.addEventListener(n,...r),e},X=(t,e)=>{let{t:n,n:o}=t,r=!1;switch(typeof e){case"object":if(e!==null){(o||n).replaceWith(t.n=e.valueOf());break}case"undefined":r=!0;default:n.data=r?"":e,o&&(t.n=null,o.replaceWith(n))}return e},lt=(t,e,n)=>t[n]=e,Ue=(t,e,n)=>lt(t,e,n.slice(1)),kt=(t,e,n)=>e==null?(st(t,n),e):lt(t,e,n),It=(t,e)=>(typeof e=="function"?e(t):e.current=t,e),St=(t,e,n)=>(e==null?st(t,n):jt(t,n,e),e),Ke=(t,e,n)=>(t.toggleAttribute(n.slice(1),e),e),it=(t,e,n)=>{let{length:o}=e;if(t.data=`[${o}]`,o)return((r,i,l,s,a)=>{let c=l.length,f=i.length,d=c,h=0,u=0,g=null;for(;h<f||u<d;)if(f===h){let p=d<c?u?s(l[u-1],-0).nextSibling:s(l[d],0):a;for(;u<d;)r.insertBefore(s(l[u++],1),p)}else if(d===u)for(;h<f;)g&&g.has(i[h])||r.removeChild(s(i[h],-1)),h++;else if(i[h]===l[u])h++,u++;else if(i[f-1]===l[d-1])f--,d--;else if(i[h]===l[d-1]&&l[u]===i[f-1]){let p=s(i[--f],-0).nextSibling;r.insertBefore(s(l[u++],1),s(i[h++],-0).nextSibling),r.insertBefore(s(l[--d],1),p),i[f]=l[d]}else{if(!g){g=new Map;let p=u;for(;p<d;)g.set(l[p],p++)}if(g.has(i[h])){let p=g.get(i[h]);if(u<p&&p<d){let w=h,T=1;for(;++w<f&&w<d&&g.get(i[w])===p+T;)T++;if(T>p-u){let P=s(i[h],0);for(;u<p;)r.insertBefore(s(l[u++],1),P)}else r.replaceChild(s(l[u++],1),s(i[h++],-1))}else h++}else r.removeChild(s(i[h++],-1))}return l})(t.parentNode,n,e,yt,t);switch(n.length){case 1:n[0].remove();case 0:break;default:zt(yt(n[0],0),yt(n.at(-1),-0),!1)}return W},Ye=new Map([["aria",(t,e)=>{for(let n in e){let o=e[n],r=n==="role"?n:`aria-${n}`;o==null?st(t,r):jt(t,r,o)}return e}],["class",(t,e)=>kt(t,e,e==null?"class":"className")],["data",(t,e)=>{let{dataset:n}=t;for(let o in e)e[o]==null?delete n[o]:n[o]=e[o];return e}],["ref",It],["style",(t,e)=>e==null?kt(t,e,"style"):lt(t.style,e,"cssText")]]),qe=(t,e,n)=>{switch(e[0]){case".":return Ue;case"?":return Ke;case"@":return Ve;default:return n||"ownerSVGElement"in t?e==="ref"?It:St:Ye.get(e)||(e in t?e.startsWith("on")?lt:((o,r)=>{let i;do i=ze(o,r);while(!i&&(o=He(o)));return i})(t,e)?.set?kt:St:St)}},Xe=(t,e)=>(t.textContent=e??"",e),Y=(t,e,n)=>({a:t,b:e,c:n}),j=()=>Y(null,null,W),Vt=t=>(e,n)=>{let{a:o,b:r,c:i}=t(e,n),l=document.importNode(o,!0),s=W;if(r!==W){s=[];for(let h,u,g=0;g<r.length;g++){let{a:p,b:w,c:T}=r[g],P=p===u?h:h=Fe(l,u=p);s[g]=(a=w,c=P,f=T,d=w===it?[]:w===X?j():null,{v:W,u:a,t:c,n:f,c:d})}}var a,c,f,d;return((h,u)=>({b:h,c:u}))(i?l.firstChild:new Ot(l),s)},Ge=/^(?:plaintext|script|style|textarea|title|xmp)$/i,Je=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,Qe=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,Ze=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,tn=/[\x01\x02]/g,$t,At,rt=document.createElement("template"),en=(t,e)=>{if(e)return $t||($t=document.createElementNS("http://www.w3.org/2000/svg","svg"),At=Ht(),At.selectNodeContents($t)),At.createContextualFragment(t);rt.innerHTML=t;let{content:n}=rt;return rt=rt.cloneNode(!1),n},Ct=t=>{let e=[],n;for(;n=t.parentNode;)e.push(e.indexOf.call(n.childNodes,t)),t=n;return e},Wt=()=>document.createTextNode(""),nn=(t,e,n)=>{let o=en(((a,c,f)=>{let d=0;return a.join("").trim().replace(Qe,(h,u,g,p)=>`<${u}${g.replace(Ze,"=$2$1").trimEnd()}${p?f||Je.test(u)?" /":`></${u}`:""}>`).replace(tn,h=>h===""?`<!--${c+d++}-->`:c+d++)})(t,K,n),n),{length:r}=t,i=W;if(r>1){let a=[],c=document.createTreeWalker(o,129),f=0,d=`${K}${f++}`;for(i=[];f<r;){let h=c.nextNode();if(h.nodeType===8){if(h.data===d){let u=Nt(e[f-1])?it:X;u===X&&a.push(h),i.push(Y(Ct(h),u,null)),d=`${K}${f++}`}}else{let u;for(;h.hasAttribute(d);){u||(u=Ct(h));let g=h.getAttribute(d);i.push(Y(u,qe(h,g,n),g)),st(h,d),d=`${K}${f++}`}!n&&Ge.test(h.localName)&&h.textContent.trim()===`<!--${d}-->`&&(i.push(Y(u||Ct(h),Xe,null)),d=`${K}${f++}`)}}for(f=0;f<a.length;f++)a[f].replaceWith(Wt())}let{childNodes:l}=o,{length:s}=l;return s<1?(s=1,o.appendChild(Wt())):s===1&&r!==1&&l[0].nodeType!==1&&(s=0),q(Ut,t,Y(o,i,s===1))},Ut=new WeakMap,K="is\xB5",Kt=t=>(e,n)=>Ut.get(e)||nn(e,n,t),on=Vt(Kt(!1)),rn=Vt(Kt(!0)),Et=(t,{s:e,t:n,v:o})=>{if(t.a!==n){let{b:r,c:i}=(e?rn:on)(n,o);t.a=n,t.b=r,t.c=i}for(let{c:r}=t,i=0;i<r.length;i++){let l=o[i],s=r[i];switch(s.u){case it:s.v=it(s.t,sn(s.c,l),s.v);break;case X:let a=l instanceof D?Et(s.c||(s.c=j()),l):(s.c=null,l);a!==s.v&&(s.v=X(s,a));break;default:l!==s.v&&(s.v=s.u(s.t,l,s.n,s.v))}}return t.b},sn=(t,e)=>{let n=0,{length:o}=e;for(o<t.length&&t.splice(o);n<o;n++){let r=e[n];r instanceof D?e[n]=Et(t[n]||(t[n]=j()),r):t[n]=null}return e},D=class{constructor(e,n,o){this.s=e,this.t=n,this.v=o}toDOM(e=j()){return Et(e,this)}};var Yt=t=>(e,...n)=>new D(t,e,n),y=Yt(!1),Mn=Yt(!0),Bt=new WeakMap,S=(t,e)=>((n,o)=>{let r=Bt.get(n)||q(Bt,n,j()),{b:i}=r,l=typeof o=="function"?o():o,s=l instanceof D?l.toDOM(r):l;return i!==s&&n.replaceChildren((r.b=s).valueOf()),n})(t,e),Dt=new WeakMap,qt=t=>(e,n)=>{let o=Dt.get(e)||q(Dt,e,new Map);return o.get(n)||q(o,n,function(r,...i){return new D(t,r,i).toDOM(this)}.bind(j()))},Wn=qt(!1),Bn=qt(!0);function m(t,...e){let n="";return t.forEach((o,r)=>{n+=o+(e[r]||"")}),n}var ln=["xs","sm","md","lg","xl"],Xt={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom",pt:"padding-top",pr:"padding-right",pb:"padding-bottom",pl:"padding-left",p:"padding",ph:"padding-left padding-right",pv:"padding-top padding-bottom",g:"gap",gv:"row-gap",gh:"column-gap",bw:"border-width",bwt:"border-top-width",bwr:"border-right-width",bwb:"border-bottom-width",bwl:"border-left-width",bc:"border-color",br:"border-radius",pos:"position",shadow:"box-shadow",ta:"text-align",c:"color",cur:"cursor"},Gt=Object.keys(Xt),Jt=t=>t.concat(ln.flatMap(e=>t.map(n=>`${e}-${n}`))),Qt={default:void 0,xl:"@media only screen and (max-width: 1280px)",lg:"@media only screen and (max-width: 1024px)",md:"@media only screen and (max-width: 768px)",sm:"@media only screen and (max-width: 640px)"},C=(t,e={})=>{let n="";for(let[o,r]of Object.entries(Qt)){o!=="default"&&(n+=`${r} {`);for(let[i,l]of Object.entries(t)){let s=e[i]?` ${e[i]} `:" ";for(let[a,c]of Object.entries(l)){let f=Xt[i],d=c.startsWith("--")?`var(${c})`:c,h=o==="default"?i:`${o}-${i}`,u=o==="default"?`h-${i}`:`${o}-h-${i}`;if(f){let p=f.split(" ").map(w=>`${w}: ${d};`).join(" ");n+=`
|
2
|
+
:host([${h}="${a}"])${s}{
|
3
|
+
${p}
|
4
4
|
}
|
5
|
-
:host([${u}="${
|
6
|
-
${
|
5
|
+
:host([${u}="${a}"]:hover)${s}{
|
6
|
+
${p}
|
7
7
|
}
|
8
8
|
`}else n+=`
|
9
|
-
:host([${
|
10
|
-
${
|
9
|
+
:host([${h}="${a}"])${s}{
|
10
|
+
${c}
|
11
11
|
}
|
12
|
-
:host([${u}="${
|
13
|
-
${
|
12
|
+
:host([${u}="${a}"]:hover)${s}{
|
13
|
+
${c}
|
14
14
|
}
|
15
|
-
`}}
|
16
|
-
`);let
|
17
|
-
`);
|
18
|
-
${
|
15
|
+
`}}o!=="default"&&(n+="}")}return n};function an(t){if(t===null||t.includes("/"))return!1;let e=String(t);return/[0-9]$/.test(e)}var cn=t=>/%$/.test(t),$=t=>{if(t!==void 0)return cn(t)?t:an(t)?`${t}px`:Object.keys(v).includes(t)?`var(${v[t]})`:t},v={xs:"--spacing-xs",s:"--spacing-s",m:"--spacing-m",l:"--spacing-l",xl:"--spacing-xl"};function at(t){let e="";for(let[n,o]of Object.entries(Qt)){n!=="default"&&(e+=`${o} {
|
16
|
+
`);let r="";for(let[i,l]of Object.entries(t[n]))l!=null&&(r+=`${i}: ${l};
|
17
|
+
`);e+=`:host {
|
18
|
+
${r.trim()}
|
19
19
|
}
|
20
|
-
`,
|
21
|
-
`)}return
|
20
|
+
`,n!=="default"&&(e+=`}
|
21
|
+
`)}return e}var I=m`
|
22
22
|
:host([flex="0"]) {
|
23
23
|
flex: 0;
|
24
24
|
}
|
@@ -58,7 +58,53 @@ var rettangoli=(()=>{var{isArray:at}=Array,{getPrototypeOf:Rt,getOwnPropertyDesc
|
|
58
58
|
:host([flex="12"]) {
|
59
59
|
flex: 12;
|
60
60
|
}
|
61
|
-
`;var
|
61
|
+
`;var dn={mt:v,mr:v,mb:v,ml:v,m:v,mh:v,mv:v,s:{sm:`
|
62
|
+
height: 28px;
|
63
|
+
padding-left: 12px;
|
64
|
+
padding-right: 12px;
|
65
|
+
border-radius: 4px;
|
66
|
+
font-size: var(--xs-font-size);
|
67
|
+
font-weight: var(--xs-font-weight);
|
68
|
+
line-height: var(--xs-line-height);
|
69
|
+
letter-spacing: var(--xs-letter-spacing);
|
70
|
+
`,md:`
|
71
|
+
height: 32px;
|
72
|
+
padding-left: 16px;
|
73
|
+
padding-right: 16px;
|
74
|
+
border-radius: 4px;
|
75
|
+
font-size: var(--sm-font-size);
|
76
|
+
font-weight: var(--sm-font-weight);
|
77
|
+
line-height: var(--sm-line-height);
|
78
|
+
letter-spacing: var(--sm-letter-spacing);
|
79
|
+
`,lg:`
|
80
|
+
height: 40px;
|
81
|
+
padding-left: 20px;
|
82
|
+
padding-right: 20px;
|
83
|
+
border-radius: 4px;
|
84
|
+
font-size: var(--md-font-size);
|
85
|
+
font-weight: var(--md-font-weight);
|
86
|
+
line-height: var(--md-line-height);
|
87
|
+
letter-spacing: var(--md-letter-spacing);
|
88
|
+
`},v:{pr:`
|
89
|
+
background-color: var(--primary);
|
90
|
+
color: var(--primary-foreground);
|
91
|
+
`,se:`
|
92
|
+
background-color: var(--secondary);
|
93
|
+
color: var(--secondary-foreground);
|
94
|
+
`,de:`
|
95
|
+
background-color: var(--destructive);
|
96
|
+
color: var(--primary-foreground);
|
97
|
+
`,ol:`
|
98
|
+
background-color: transparent;
|
99
|
+
color: var(--foreground);
|
100
|
+
border-width: 1px;
|
101
|
+
`,gh:`
|
102
|
+
background-color: transparent;
|
103
|
+
color: var(--foreground);
|
104
|
+
`,lk:`
|
105
|
+
background-color: transparent;
|
106
|
+
color: var(--foreground);
|
107
|
+
`}},fn={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},Zt=C(dn,fn);var te=({render:t,html:e})=>{let n=new CSSStyleSheet;return n.replaceSync(m`
|
62
108
|
:host {
|
63
109
|
display: contents;
|
64
110
|
}
|
@@ -67,160 +113,137 @@ var rettangoli=(()=>{var{isArray:at}=Array,{getPrototypeOf:Rt,getOwnPropertyDesc
|
|
67
113
|
}
|
68
114
|
|
69
115
|
button {
|
116
|
+
display: flex;
|
117
|
+
flex-direction: row;
|
118
|
+
align-items: center;
|
119
|
+
justify-content: center;
|
120
|
+
gap: var(--spacing-s);
|
121
|
+
border-width: 0px;
|
70
122
|
border-style: solid;
|
123
|
+
border-color: var(--border);
|
71
124
|
padding: 0px;
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
}
|
125
|
+
height: 32px;
|
126
|
+
padding-left: 16px;
|
127
|
+
padding-right: 16px;
|
128
|
+
border-radius: 4px;
|
77
129
|
|
78
|
-
|
79
|
-
|
80
|
-
|
130
|
+
font-size: var(--sm-font-size);
|
131
|
+
font-weight: var(--sm-font-weight);
|
132
|
+
line-height: var(--sm-line-height);
|
133
|
+
letter-spacing: var(--sm-letter-spacing);
|
81
134
|
|
82
|
-
|
83
|
-
|
84
|
-
:host([t="pl"]) button {
|
85
|
-
color: var(--color-on-primary);
|
86
|
-
border-color: var(--color-primary);
|
87
|
-
background-color: var(--color-primary);
|
135
|
+
background-color: var(--primary);
|
136
|
+
color: var(--primary-foreground);
|
88
137
|
}
|
89
138
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
:host([t="ps"]) button:active,
|
98
|
-
:host([t="p"]) button:active,
|
99
|
-
:host([t="pl"]) button:active {
|
100
|
-
border-color: var(--color-primary-active);
|
101
|
-
background-color: var(--color-primary-active);
|
139
|
+
button:hover {
|
140
|
+
cursor: pointer;
|
141
|
+
background-color: color-mix(
|
142
|
+
in srgb,
|
143
|
+
var(--primary) 85%,
|
144
|
+
white 15%
|
145
|
+
);
|
102
146
|
}
|
103
147
|
|
104
|
-
:
|
105
|
-
|
106
|
-
:host([t="sl"]) button {
|
107
|
-
color: var(--color-on-secondary);
|
108
|
-
border-color: var(--color-secondary);
|
109
|
-
background-color: var(--color-secondary);
|
148
|
+
button:disabled {
|
149
|
+
cursor: not-allowed;
|
110
150
|
}
|
111
151
|
|
112
|
-
:
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
152
|
+
button:active {
|
153
|
+
cursor: pointer;
|
154
|
+
background-color: color-mix(
|
155
|
+
in srgb,
|
156
|
+
var(--primary) 80%,
|
157
|
+
white 20%
|
158
|
+
);
|
117
159
|
}
|
118
160
|
|
119
|
-
:host([
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
161
|
+
:host([v="pr"]) button:hover {
|
162
|
+
background-color: color-mix(
|
163
|
+
in srgb,
|
164
|
+
var(--primary) 85%,
|
165
|
+
white 15%
|
166
|
+
);
|
124
167
|
}
|
125
168
|
|
126
|
-
:host([
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
169
|
+
:host([v="pr"]) button:active {
|
170
|
+
background-color: color-mix(
|
171
|
+
in srgb,
|
172
|
+
var(--primary) 80%,
|
173
|
+
white 20%
|
174
|
+
);
|
132
175
|
}
|
133
176
|
|
134
|
-
:host([
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
177
|
+
:host([v="se"]) button:hover {
|
178
|
+
background-color: color-mix(
|
179
|
+
in srgb,
|
180
|
+
var(--secondary) 85%,
|
181
|
+
white 15%
|
182
|
+
);
|
139
183
|
}
|
140
184
|
|
141
|
-
:host([
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
185
|
+
:host([v="se"]) button:active {
|
186
|
+
background-color: color-mix(
|
187
|
+
in srgb,
|
188
|
+
var(--secondary) 80%,
|
189
|
+
white 20%
|
190
|
+
);
|
146
191
|
}
|
147
192
|
|
148
|
-
:host([
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
193
|
+
:host([v="de"]) button:hover {
|
194
|
+
background-color: color-mix(
|
195
|
+
in srgb,
|
196
|
+
var(--destructive) 85%,
|
197
|
+
white 15%
|
198
|
+
);
|
154
199
|
}
|
155
200
|
|
156
|
-
:host([
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
201
|
+
:host([v="de"]) button:active {
|
202
|
+
background-color: color-mix(
|
203
|
+
in srgb,
|
204
|
+
var(--destructive) 80%,
|
205
|
+
white 20%
|
206
|
+
);
|
161
207
|
}
|
162
208
|
|
163
|
-
:host([
|
164
|
-
|
165
|
-
:host([t="nl"]) button:active {
|
166
|
-
background-color: var(--color-surface-container-high);
|
167
|
-
border-color: var(--color-surface-container-high);
|
209
|
+
:host([v="ol"]) button:hover {
|
210
|
+
background-color: var(--accent);
|
168
211
|
}
|
169
212
|
|
170
|
-
:host([
|
171
|
-
|
172
|
-
:host([t="es"]) button,
|
173
|
-
:host([t="ns"]) button {
|
174
|
-
height: var(--button-height-s);
|
175
|
-
padding-left: var(--button-padding-horizontal-s);
|
176
|
-
padding-right: var(--button-padding-horizontal-s);
|
177
|
-
border-radius: var(--button-border-radius-s);
|
213
|
+
:host([v="gh"]) button:hover {
|
214
|
+
background-color: var(--accent);
|
178
215
|
}
|
179
216
|
|
180
|
-
:host([
|
181
|
-
|
182
|
-
:host([t="e"]) button,
|
183
|
-
:host([t="n"]) button {
|
184
|
-
height: var(--button-height-m);
|
185
|
-
padding-left: var(--button-padding-horizontal-m);
|
186
|
-
padding-right: var(--button-padding-horizontal-m);
|
187
|
-
border-radius: var(--button-border-radius-m);
|
217
|
+
:host([v="lk"]) button:hover {
|
218
|
+
text-decoration: underline;
|
188
219
|
}
|
189
220
|
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
padding-left: var(--button-padding-horizontal-l);
|
196
|
-
padding-right: var(--button-padding-horizontal-l);
|
197
|
-
border-radius: var(--button-border-radius-l);
|
198
|
-
font-size: var(--typography-label-l-font-size);
|
199
|
-
font-weight: var(--typography-label-l-font-weight);
|
200
|
-
line-height: var(--typography-label-l-line-height);
|
201
|
-
letter-spacing: var(--typography-label-l-letter-spacing);
|
202
|
-
}
|
203
|
-
${yt}
|
204
|
-
${$}
|
205
|
-
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[o],e(this.shadow,this.render)}static get observedAttributes(){return["key","href","target","w","t"]}_buttonRef={};_assingRef=s=>{this._buttonRef.current=s;let i=v(this.getAttribute("w"));i==="f"?this._buttonRef.current.style.width="100%":i!=null&&(this._buttonRef.current.style.width=i)};attributeChangedCallback(s,i,a){if(!this._buttonRef.current)return;let r=v(this.getAttribute("w"));r==="f"?this._buttonRef.current.style.width="100%":r!=null&&(this._buttonRef.current.style.width=r,this._buttonRef.current.style.minWidth=r,this._buttonRef.current.style.maxWidth=r),e(this.shadow,this.render)}render=()=>this.getAttribute("href")?t`
|
221
|
+
${Zt}
|
222
|
+
${I}
|
223
|
+
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[n],t(this.shadow,this.render)}static get observedAttributes(){return["key","href","target","w","t","icon","disabled"]}_buttonRef={};_assingRef=r=>{this._buttonRef.current=r;let i=$(this.getAttribute("w"));i==="f"?this._buttonRef.current.style.width="100%":i!=null&&(this._buttonRef.current.style.width=i)};attributeChangedCallback(r,i,l){if(!this._buttonRef.current)return;let s=$(this.getAttribute("w"));s==="f"?this._buttonRef.current.style.width="var(--width-stretch)":s!=null&&(this._buttonRef.current.style.width=s,this._buttonRef.current.style.minWidth=s,this._buttonRef.current.style.maxWidth=s),t(this.shadow,this.render)}renderIcon=()=>{let r=this.getAttribute("icon"),i={pr:"pr-fg",se:"ac-fg",de:"pr-fg",ol:"ac-fg",gh:"ac-fg",lk:"ac-fg"},l={sm:14,md:18,lg:22},s=i[this.getAttribute("v")]||"pr-fg",a=l[this.getAttribute("t")]||18;return r?e`
|
224
|
+
<rtgl-svg svg="${r}" c="${s}" wh="${a}"></rtgl-svg>
|
225
|
+
`:e``};render=()=>{let r=this.hasAttribute("disabled");return this.getAttribute("href")?e`
|
206
226
|
<a
|
207
227
|
href=${this.getAttribute("href")}
|
208
228
|
target=${this.getAttribute("target")}
|
229
|
+
style="text-decoration: none; display: contents; color: inherit;"
|
209
230
|
>
|
210
|
-
<button>
|
231
|
+
<button disabled="${r}">
|
232
|
+
${this.renderIcon()}
|
211
233
|
<slot></slot>
|
212
234
|
</button>
|
213
235
|
</a>
|
214
|
-
`:
|
215
|
-
<button ref=${this._assingRef}>
|
236
|
+
`:e`
|
237
|
+
<button ref=${this._assingRef} disabled="${r}">
|
238
|
+
${this.renderIcon()}
|
216
239
|
<slot></slot>
|
217
240
|
</button>
|
218
|
-
`}};var
|
241
|
+
`}}};var ee=m`
|
219
242
|
|
220
243
|
:host([d="h"]) {
|
221
244
|
flex-direction: row;
|
222
245
|
}
|
223
|
-
:host(
|
246
|
+
:host([d="v"]) {
|
224
247
|
flex-direction: column;
|
225
248
|
}
|
226
249
|
:host([d="h"]:not([ah])) {
|
@@ -228,7 +251,6 @@ var rettangoli=(()=>{var{isArray:at}=Array,{getPrototypeOf:Rt,getOwnPropertyDesc
|
|
228
251
|
}
|
229
252
|
:host([d="h"][ah="c"]) {
|
230
253
|
justify-content: center;
|
231
|
-
/* align-content: center; */
|
232
254
|
}
|
233
255
|
:host([d="h"][ah="e"]) {
|
234
256
|
justify-content: flex-end;
|
@@ -244,26 +266,34 @@ var rettangoli=(()=>{var{isArray:at}=Array,{getPrototypeOf:Rt,getOwnPropertyDesc
|
|
244
266
|
align-items: flex-end;
|
245
267
|
align-content: flex-end;
|
246
268
|
}
|
247
|
-
|
269
|
+
|
270
|
+
/* Default/vertical direction - horizontal alignment */
|
271
|
+
:host(:not([d]):not([ah])),
|
272
|
+
:host([d="v"]:not([ah])) {
|
248
273
|
align-items: flex-start;
|
249
274
|
}
|
250
|
-
:host(:not([d])[ah="c"])
|
275
|
+
:host(:not([d])[ah="c"]),
|
276
|
+
:host([d="v"][ah="c"]) {
|
251
277
|
align-items: center;
|
252
|
-
align-content: center;
|
253
278
|
}
|
254
|
-
:host(:not([d])[ah="e"])
|
279
|
+
:host(:not([d])[ah="e"]),
|
280
|
+
:host([d="v"][ah="e"]) {
|
255
281
|
align-items: flex-end;
|
256
|
-
align-content: flex-end;
|
257
282
|
}
|
258
|
-
|
283
|
+
|
284
|
+
:host(:not([d]):not([av])),
|
285
|
+
:host([d="v"]:not([av])) {
|
259
286
|
justify-content: flex-start;
|
260
287
|
}
|
261
|
-
:host(:not([d])[av="c"])
|
288
|
+
:host(:not([d])[av="c"]),
|
289
|
+
:host([d="v"][av="c"]) {
|
262
290
|
justify-content: center;
|
263
291
|
}
|
264
|
-
:host(:not([d])[av="e"])
|
292
|
+
:host(:not([d])[av="e"]),
|
293
|
+
:host([d="v"][av="e"]) {
|
265
294
|
justify-content: flex-end;
|
266
295
|
}
|
296
|
+
|
267
297
|
@media screen and (max-width: 640px) {
|
268
298
|
:host([s-d="v"]) {
|
269
299
|
flex-direction: column;
|
@@ -279,7 +309,7 @@ var rettangoli=(()=>{var{isArray:at}=Array,{getPrototypeOf:Rt,getOwnPropertyDesc
|
|
279
309
|
justify-content: center;
|
280
310
|
}
|
281
311
|
}
|
282
|
-
`;var
|
312
|
+
`;var hn={cur:{p:"pointer",m:"move",grab:"grab",grabbing:"grabbing"}},b=C(hn);var ne=m`
|
283
313
|
:host([sh]:not([sv])) {
|
284
314
|
overflow-x: scroll;
|
285
315
|
flex-wrap: nowrap;
|
@@ -297,43 +327,20 @@ var rettangoli=(()=>{var{isArray:at}=Array,{getPrototypeOf:Rt,getOwnPropertyDesc
|
|
297
327
|
flex-wrap: nowrap;
|
298
328
|
}
|
299
329
|
|
300
|
-
`;var
|
301
|
-
background-color: var(--
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
color: var(--
|
306
|
-
`,
|
307
|
-
background-color: var(--
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
color: var(--
|
312
|
-
`,
|
313
|
-
background-color: var(--
|
314
|
-
color: var(--color-on-error);
|
315
|
-
`,ec:`
|
316
|
-
background-color: var(--color-error-container);
|
317
|
-
color: var(--color-on-error-container);
|
318
|
-
`,su:`
|
319
|
-
background-color: var(--color-surface);
|
320
|
-
color: var(--color-on-surface);
|
321
|
-
`,sucl:`
|
322
|
-
background-color: var(--color-surface-container-low);
|
323
|
-
color: var(--color-on-surface);
|
324
|
-
`,suc:`
|
325
|
-
background-color: var(--color-surface-container);
|
326
|
-
color: var(--color-on-surface);
|
327
|
-
`,such:`
|
328
|
-
background-color: var(--color-surface-container-high);
|
329
|
-
color: var(--color-on-surface);
|
330
|
-
`,isu:`
|
331
|
-
background-color: var(--color-inverse-surface);
|
332
|
-
color: var(--color-inverse-on-surface);
|
333
|
-
`,o:`
|
334
|
-
background-color: var(--color-outline);
|
335
|
-
`,ov:`
|
336
|
-
background-color: var(--color-outline-variant);
|
330
|
+
`;var G={xs:"--border-width-xs",s:"--border-width-s",m:"--border-width-m",l:"--border-width-l",xl:"--border-width-xl"},un={bgc:{pr:`
|
331
|
+
background-color: var(--primary);
|
332
|
+
`,se:`
|
333
|
+
background-color: var(--secondary);
|
334
|
+
`,de:`
|
335
|
+
background-color: var(--destructive);
|
336
|
+
`,bg:`
|
337
|
+
background-color: var(--background);
|
338
|
+
`,mu:`
|
339
|
+
background-color: var(--muted);
|
340
|
+
`,ac:`
|
341
|
+
background-color: var(--accent);
|
342
|
+
`,bo:`
|
343
|
+
background-color: var(--border);
|
337
344
|
`},pos:{rel:"relative",abs:"absolute",fix:"fixed"},cor:{full:`
|
338
345
|
top: 0;
|
339
346
|
right: 0;
|
@@ -358,86 +365,83 @@ var rettangoli=(()=>{var{isArray:at}=Array,{getPrototypeOf:Rt,getOwnPropertyDesc
|
|
358
365
|
left: 0;
|
359
366
|
top: 0;
|
360
367
|
height: 100%;
|
361
|
-
`},shadow:{s:"--shadow-s",m:"--shadow-m",l:"--shadow-l"},pt:
|
368
|
+
`},shadow:{s:"--shadow-s",m:"--shadow-m",l:"--shadow-l"},pt:v,pr:v,pb:v,pl:v,p:v,ph:v,pv:v,g:v,gv:v,gh:v,bw:G,bwt:G,bwr:G,bwb:G,bwl:G,bc:{p:"--color-primary",pc:"--color-primary-container",s:"--color-secondary",sc:"--color-secondary-container",e:"--color-error",ec:"--color-error-container",su:"--color-surface",sucl:"--color-surface-container-low",suc:"--color-surface-container",such:"--color-surface-container-high",isu:"--color-inverse-surface",o:"--color-outline",ov:"--color-outline-variant"},br:{xs:"--border-radius-xs",s:"--border-radius-s",m:"--border-radius-m",l:"--border-radius-l",xl:"--border-radius-xl",f:"--border-radius-f"}},ct=C(un);var gn={mt:v,mr:v,mb:v,ml:v,m:v,mh:v,mv:v},x=C(gn);var oe=({render:t,html:e})=>{let n=new CSSStyleSheet;return n.replaceSync(m`
|
362
369
|
slot {
|
363
370
|
display: contents;
|
364
371
|
}
|
365
372
|
:host {
|
366
373
|
display: flex;
|
374
|
+
flex-direction: column;
|
367
375
|
align-self: auto;
|
368
376
|
align-content: flex-start;
|
369
|
-
flex-wrap: wrap;
|
370
377
|
border-style: solid;
|
371
378
|
border-width: 0;
|
372
379
|
box-sizing: border-box;
|
380
|
+
border-color: var(--border);
|
373
381
|
}
|
374
|
-
|
375
|
-
|
382
|
+
|
383
|
+
:host([fw="w"]) {
|
384
|
+
flex-wrap: wrap;
|
376
385
|
}
|
377
|
-
|
378
|
-
${
|
379
|
-
|
380
|
-
${
|
386
|
+
|
387
|
+
${I}
|
388
|
+
${ne}
|
389
|
+
${ee}
|
381
390
|
${x}
|
382
|
-
${
|
383
|
-
|
391
|
+
${b}
|
392
|
+
${ct}
|
393
|
+
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[n],t(this.shadow,this.render)}static get observedAttributes(){return Jt([...Gt,"wh","w","h","hidden","sh","sv"])}_styles={default:{},sm:{},md:{},lg:{},xl:{}};attributeChangedCallback(r,i,l){["default","sm","md","lg","xl"].forEach(s=>{let a=g=>`${s==="default"?"":`${s}-`}${g}`,c=this.getAttribute(a("wh")),f=$(c===null?this.getAttribute(a("w")):c),d=$(c===null?this.getAttribute(a("h")):c),h=this.getAttribute(a("o")),u=this.getAttribute(a("z"));u!==null&&(this._styles[s]["z-index"]=u),h!==null&&(this._styles[s].opacity=h),f==="f"?this._styles[s].width="var(--width-stretch)":f!==void 0&&(this._styles[s].width=f,this._styles[s]["min-width"]=f,this._styles[s]["max-width"]=f),d==="f"?this._styles[s].height="100%":d!==void 0&&(this._styles[s].height=d,this._styles[s]["min-height"]=d,this._styles[s]["max-height"]=d),this.hasAttribute(a("hidden"))&&(this._styles[s].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[s].display="flex !important")}),t(this.shadow,this.render)}render=()=>e`
|
384
394
|
<style>
|
385
|
-
${
|
395
|
+
${at(this._styles)}
|
386
396
|
</style>
|
387
397
|
<slot></slot>
|
388
|
-
`}};var
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
font-size: var(--typography-label-l-font-size);
|
430
|
-
font-weight: var(--typography-label-l-font-weight);
|
431
|
-
line-height: var(--typography-label-l-line-height);
|
432
|
-
letter-spacing: var(--typography-label-l-letter-spacing);
|
433
|
-
`,lm:`
|
434
|
-
font-size: var(--typography-label-m-font-size);
|
435
|
-
font-weight: var(--typography-label-m-font-weight);
|
436
|
-
line-height: var(--typography-label-m-line-height);
|
437
|
-
letter-spacing: var(--typography-label-m-letter-spacing);
|
438
|
-
`}},St=y(ie,ae);var le={c:"color"},he={c:{"on-p":"--color-on-primary","on-pc":"--color-on-primary-container","on-s":"--color-on-secondary","on-sc":"--color-on-secondary-container","on-su":"--color-on-surface","on-su-v":"--color-on-surface-variant","i-on-su":"--color-inverse-on-surface","on-e":"--color-on-error","on-ec":"--color-on-error-container"}},F=y(le,he);var $t=({render:e,html:t})=>{let o=new CSSStyleSheet;o.replaceSync(m`
|
398
|
+
`}};var pn={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
|
399
|
+
font-size: var(--h1-font-size);
|
400
|
+
font-weight: var(--h1-font-weight);
|
401
|
+
line-height: var(--h1-line-height);
|
402
|
+
letter-spacing: var(--h1-letter-spacing);
|
403
|
+
`,h2:`
|
404
|
+
font-size: var(--h2-font-size);
|
405
|
+
font-weight: var(--h2-font-weight);
|
406
|
+
line-height: var(--h2-line-height);
|
407
|
+
letter-spacing: var(--h2-letter-spacing);
|
408
|
+
`,h3:`
|
409
|
+
font-size: var(--h3-font-size);
|
410
|
+
font-weight: var(--h3-font-weight);
|
411
|
+
line-height: var(--h3-line-height);
|
412
|
+
letter-spacing: var(--h3-letter-spacing);
|
413
|
+
`,h4:`
|
414
|
+
font-size: var(--h4-font-size);
|
415
|
+
font-weight: var(--h4-font-weight);
|
416
|
+
line-height: var(--h4-line-height);
|
417
|
+
letter-spacing: var(--h4-letter-spacing);
|
418
|
+
`,lg:`
|
419
|
+
font-size: var(--lg-font-size);
|
420
|
+
font-weight: var(--lg-font-weight);
|
421
|
+
line-height: var(--lg-line-height);
|
422
|
+
letter-spacing: var(--lg-letter-spacing);
|
423
|
+
`,md:`
|
424
|
+
font-size: var(--md-font-size);
|
425
|
+
font-weight: var(--md-font-weight);
|
426
|
+
line-height: var(--md-line-height);
|
427
|
+
letter-spacing: var(--md-letter-spacing);
|
428
|
+
`,sm:`
|
429
|
+
font-size: var(--sm-font-size);
|
430
|
+
font-weight: var(--sm-font-weight);
|
431
|
+
line-height: var(--sm-line-height);
|
432
|
+
letter-spacing: var(--sm-letter-spacing);
|
433
|
+
`,xs:`
|
434
|
+
font-size: var(--xs-font-size);
|
435
|
+
font-weight: var(--xs-font-weight);
|
436
|
+
line-height: var(--xs-line-height);
|
437
|
+
letter-spacing: var(--xs-letter-spacing);
|
438
|
+
`}},re=C(pn);var mn={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},dt=C(mn);var ie=({render:t,html:e})=>{let n=new CSSStyleSheet;n.replaceSync(m`
|
439
439
|
:host {
|
440
440
|
display: block;
|
441
|
+
font-size: var(--md-font-size);
|
442
|
+
font-weight: var(--md-font-weight);
|
443
|
+
line-height: var(--md-line-height);
|
444
|
+
letter-spacing: var(--md-letter-spacing);
|
441
445
|
}
|
442
446
|
slot {
|
443
447
|
display: contents;
|
@@ -450,11 +454,11 @@ var rettangoli=(()=>{var{isArray:at}=Array,{getPrototypeOf:Rt,getOwnPropertyDesc
|
|
450
454
|
text-decoration: var(--anchor-text-decoration-hover);
|
451
455
|
color: var(--anchor-color-hover);
|
452
456
|
}
|
453
|
-
${
|
454
|
-
${
|
455
|
-
${C}
|
457
|
+
${re}
|
458
|
+
${dt}
|
456
459
|
${x}
|
457
|
-
|
460
|
+
${b}
|
461
|
+
`);class o extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[n]}static get observedAttributes(){return["key","w","ellipsis"]}connectedCallback(){t(this.shadow,this.render)}attributeChangedCallback(i,l,s){let a=$(this.getAttribute("w"));this.hasAttribute("ellipsis")&&(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"),a==="f"?this.style.width="var(--width-stretch)":a!==void 0&&(this.style.width=a),t(this.shadow,this.render)}render=()=>e` <slot></slot> `}return o};var se=({render:t,html:e})=>{let n=new CSSStyleSheet;return n.replaceSync(m`
|
458
462
|
:host {
|
459
463
|
border-style: solid;
|
460
464
|
box-sizing: border-box;
|
@@ -477,19 +481,19 @@ ${x}
|
|
477
481
|
height: 100%;
|
478
482
|
width: 100%;
|
479
483
|
}
|
480
|
-
${
|
481
|
-
${
|
482
|
-
${
|
483
|
-
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[
|
484
|
+
${ct}
|
485
|
+
${x}
|
486
|
+
${b}
|
487
|
+
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[n]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};static get observedAttributes(){return["key","src","wh","w","h","hidden","height","width","s-wh","s-w","s-h"]}connectedCallback(){t(this.shadow,this.render)}attributeChangedCallback(r,i,l){["default","sm","md","lg","xl"].forEach(s=>{let a=g=>`${s==="default"?"":`${s}-`}${g}`,c=this.getAttribute(a("wh")),f=$(c===null?this.getAttribute(a("w")):c),d=$(c===null?this.getAttribute(a("h")):c),h=this.getAttribute(a("o")),u=this.getAttribute(a("z"));u!==null&&(this._styles[s].zIndex=u),h!==null&&(this._styles[s].opacity=h),f==="f"?this._styles[s].width="var(--width-stretch)":f!==void 0&&(this._styles[s].width=f,this._styles[s]["min-width"]=f,this._styles[s]["max-width"]=f),d==="f"?this._styles[s].height="100%":d!==void 0&&(this._styles[s].height=d,this._styles[s]["min-height"]=d,this._styles[s]["max-height"]=d)}),t(this.shadow,this.render)}render=()=>e`
|
484
488
|
<style>
|
485
|
-
${
|
489
|
+
${at(this._styles)}
|
486
490
|
</style>
|
487
491
|
<img
|
488
492
|
src="${this.getAttribute("src")}"
|
489
493
|
width="${this.getAttribute("width")}"
|
490
494
|
height="${this.getAttribute("height")}"
|
491
495
|
/>
|
492
|
-
`}};var
|
496
|
+
`}};var le=m`
|
493
497
|
:host([pt="xs"]) svg {
|
494
498
|
padding-top: var(--spacing-xs);
|
495
499
|
}
|
@@ -605,42 +609,279 @@ ${x}
|
|
605
609
|
padding-top: var(--spacing-xl);
|
606
610
|
padding-bottom: var(--spacing-xl);
|
607
611
|
}
|
608
|
-
`;var
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
+
`;var ae=({render:t,html:e})=>{let n=new CSSStyleSheet;return n.replaceSync(m`
|
613
|
+
:host {
|
614
|
+
color: var(--foreground);
|
615
|
+
}
|
616
|
+
${dt}
|
617
|
+
${le}
|
618
|
+
${I}
|
619
|
+
${b}
|
620
|
+
`),class ft extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[n]}static _icons={};static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return ft._icons}static addIcon(r,i){ft._icons[r]=i}connectedCallback(){this.render()}attributeChangedCallback(r,i,l){let s=this.getAttribute("wh"),a=$(s===null?this.getAttribute("w"):s),c=$(s===null?this.getAttribute("h"):s);a&&(this.style.width=a),c&&(this.style.height=c),this.render()}render=()=>{try{let r=this.getAttribute("svg"),i=ft._icons[r]||(window.rtglIcons||{})[r];if(i){this.shadow.innerHTML=i;return}}catch(r){console.log("error in rtgl-svg render",r)}this.shadow.innerHTML=""}}};var ce=({render:t,html:e})=>{let n=new CSSStyleSheet;n.replaceSync(m`
|
621
|
+
:host {
|
622
|
+
display: contents;
|
623
|
+
}
|
624
|
+
input {
|
625
|
+
background-color: var(--background);
|
626
|
+
font-size: var(--sm-font-size);
|
627
|
+
font-weight: var(--sm-font-weight);
|
628
|
+
line-height: var(--sm-line-height);
|
629
|
+
letter-spacing: var(--sm-letter-spacing);
|
630
|
+
border: 1px solid var(--ring);
|
631
|
+
border-radius: var(--border-radius-l);
|
632
|
+
padding-left: var(--spacing-m);
|
633
|
+
padding-right: var(--spacing-m);
|
634
|
+
height: 32px;
|
635
|
+
color: var(--foreground);
|
636
|
+
outline: none;
|
637
|
+
}
|
638
|
+
input:focus {
|
639
|
+
border-color: var(--foreground);
|
640
|
+
}
|
641
|
+
input:disabled {
|
642
|
+
cursor: not-allowed;
|
643
|
+
}
|
644
|
+
${x}
|
645
|
+
${b}
|
646
|
+
`);class o extends HTMLElement{_inputRef={};constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[n]}static get observedAttributes(){return["key","w","ellipsis"]}connectedCallback(){t(this.shadow,this.render)}attributeChangedCallback(i,l,s){t(this.shadow,this.render)}get value(){return console.log("gettin gvalue",this._inputRef.current),this._inputRef.current.value}_onChange=i=>{this.onChange&&this.onChange(i.target.value)};render=()=>{let i=this.getAttribute("type")||"text",l=this.hasAttribute("disabled");return e`
|
647
|
+
<input ref=${this._inputRef} @keydown=${this._onChange} placeholder="${this.getAttribute("placeholder")}" type="${i}" disabled="${l}" />
|
648
|
+
`}}return o};var de=({render:t,html:e})=>{let n=new CSSStyleSheet;n.replaceSync(m`
|
649
|
+
:host {
|
650
|
+
display: contents;
|
651
|
+
}
|
652
|
+
textarea {
|
653
|
+
font-family: inherit;
|
654
|
+
background-color: var(--background);
|
655
|
+
font-size: var(--sm-font-size);
|
656
|
+
font-weight: var(--sm-font-weight);
|
657
|
+
line-height: var(--sm-line-height);
|
658
|
+
letter-spacing: var(--sm-letter-spacing);
|
659
|
+
border: 1px solid var(--ring);
|
660
|
+
border-radius: var(--border-radius-l);
|
661
|
+
padding-top: var(--spacing-m);
|
662
|
+
padding-bottom: var(--spacing-m);
|
663
|
+
padding-left: var(--spacing-m);
|
664
|
+
padding-right: var(--spacing-m);
|
665
|
+
color: var(--foreground);
|
666
|
+
outline: none;
|
667
|
+
}
|
668
|
+
textarea:focus {
|
669
|
+
border-color: var(--foreground);
|
670
|
+
}
|
612
671
|
${x}
|
613
|
-
|
672
|
+
${b}
|
673
|
+
`);class o extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[n]}static get observedAttributes(){return["key","w","ellipsis"]}connectedCallback(){t(this.shadow,this.render)}attributeChangedCallback(i,l,s){t(this.shadow,this.render)}render=()=>e`
|
674
|
+
<textarea
|
675
|
+
cols=${this.getAttribute("cols")}
|
676
|
+
rows=${this.getAttribute("rows")}
|
677
|
+
placeholder=${this.getAttribute("placeholder")}
|
678
|
+
type="text">
|
679
|
+
</textarea>
|
680
|
+
`}return o};var _t=t=>{let e=t.map(n=>n.subscribe());return()=>{for(let n of e)n&&typeof n.unsubscribe=="function"&&n.unsubscribe()}};var R=({render:t,styleSheet:e})=>{let n;return e?n=e:(n=new CSSStyleSheet,n.replaceSync(":host { display: contents; }")),class extends vn({BaseElement:HTMLElement,render:t,skipOnMount:!1}){static get observedAttributes(){return["key"]}constructor(){super(),this.renderTarget=this.attachShadow({mode:"closed"})}connectedCallback(){this.renderTarget.adoptedStyleSheets=[n],this.baseOnMount()}disconnectedCallback(){this.baseOnUnmount()}attributeChangedCallback(){setTimeout(()=>{this.reRender()},0)}}},vn=({BaseElement:t,render:e,skipOnMount:n=!1})=>{class o extends t{_renderKey=0;_unmountCallback;disableFirstAutomatedRender=!1;get renderKey(){return String(this._renderKey)}baseOnMount=()=>{!n&&this.onMount&&(this._unmountCallback=this.onMount()),this.disableFirstAutomatedRender||this.reRender(),this.attachedObservables?Array.isArray(this.attachedObservables)?this.unsubscribe=_t(this.attachedObservables):this.unsubscribe=_t(this.attachedObservables()):this.subscriptions&&(this.unsubscribe=_t(this.subscriptions))};baseOnUnmount=()=>{this._unmountCallback&&this._unmountCallback(),this.onUnmount&&this.onUnmount(),this.unsubscribe&&this.unsubscribe()};triggerRender=()=>{this.reRender()};reRender=()=>{this._renderKey++,e(this.renderTarget,this.render())}}return o};var fe=({render:t,html:e})=>{let n=new CSSStyleSheet;n.replaceSync(m`
|
681
|
+
:host {
|
682
|
+
display: contents;
|
683
|
+
}
|
684
|
+
|
685
|
+
button {
|
686
|
+
background-color: var(--background);
|
687
|
+
font-size: var(--sm-font-size);
|
688
|
+
font-weight: var(--sm-font-weight);
|
689
|
+
line-height: var(--sm-line-height);
|
690
|
+
letter-spacing: var(--sm-letter-spacing);
|
691
|
+
border: 1px solid var(--ring);
|
692
|
+
border-radius: var(--border-radius-l);
|
693
|
+
padding-left: var(--spacing-m);
|
694
|
+
padding-right: var(--spacing-m);
|
695
|
+
height: 32px;
|
696
|
+
color: var(--foreground);
|
697
|
+
outline: none;
|
698
|
+
cursor: pointer;
|
699
|
+
}
|
700
|
+
button:focus {
|
701
|
+
border-color: var(--foreground);
|
702
|
+
}
|
703
|
+
|
704
|
+
${x}
|
705
|
+
${b}
|
706
|
+
`);class o extends R({render:t,styleSheet:n}){_popoverRef={};_buttonRef={};options=[];close=()=>{this._popoverRef.current.close()};open=()=>{this._popoverRef.current.open(this._buttonRef.current)};select=i=>{this.onSelect&&this.onSelect(i),this.close()};render=()=>e`
|
707
|
+
<!-- TODO style this button and use proper selected value -->
|
708
|
+
<button ref=${this._buttonRef} onclick=${this.open}>Placeholder</button>
|
709
|
+
|
710
|
+
<rtgl-popover ref=${this._popoverRef} placement="bottom-start">
|
711
|
+
<rtgl-view wh="300" g="xs">
|
712
|
+
${this.options.map(({value:i,label:l})=>e`
|
713
|
+
<rtgl-view
|
714
|
+
w="f"
|
715
|
+
h-bgc="mu"
|
716
|
+
ph="l"
|
717
|
+
pv="m"
|
718
|
+
cur="p"
|
719
|
+
br="m"
|
720
|
+
onclick=${()=>this.select(i)}
|
721
|
+
>
|
722
|
+
<rtgl-text>${l}</rtgl-text>
|
723
|
+
</rtgl-view>
|
724
|
+
`)}
|
725
|
+
</rtgl-view>
|
726
|
+
</rtgl-popover>
|
727
|
+
`}return o};var ht=Math.min,N=Math.max,J=Math.round;var E=t=>({x:t,y:t});function he(t,e){return typeof t=="function"?t(e):t}function ut(t){return t.split("-")[0]}function Tt(t){return t.split("-")[1]}function ue(t){return t==="x"?"y":"x"}function ge(t){return t==="y"?"height":"width"}function gt(t){return["top","bottom"].includes(ut(t))?"y":"x"}function pe(t){return ue(gt(t))}function Q(t){let{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function me(t,e,n){let{reference:o,floating:r}=t,i=gt(e),l=pe(e),s=ge(l),a=ut(e),c=i==="y",f=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,h=o[s]/2-r[s]/2,u;switch(a){case"top":u={x:f,y:o.y-r.height};break;case"bottom":u={x:f,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:d};break;case"left":u={x:o.x-r.width,y:d};break;default:u={x:o.x,y:o.y}}switch(Tt(e)){case"start":u[l]-=h*(n&&c?-1:1);break;case"end":u[l]+=h*(n&&c?-1:1);break}return u}var ve=async(t,e,n)=>{let{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(e)),c=await l.getElementRects({reference:t,floating:e,strategy:r}),{x:f,y:d}=me(c,o,a),h=o,u={},g=0;for(let p=0;p<s.length;p++){let{name:w,fn:T}=s[p],{x:P,y:nt,data:xt,reset:B}=await T({x:f,y:d,initialPlacement:o,placement:h,strategy:r,middlewareData:u,rects:c,platform:l,elements:{reference:t,floating:e}});f=P??f,d=nt??d,u={...u,[w]:{...u[w],...xt}},B&&g<=50&&(g++,typeof B=="object"&&(B.placement&&(h=B.placement),B.rects&&(c=B.rects===!0?await l.getElementRects({reference:t,floating:e,strategy:r}):B.rects),{x:f,y:d}=me(c,h,a)),p=-1)}return{x:f,y:d,placement:h,strategy:r,middlewareData:u}};async function bn(t,e){let{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),l=ut(n),s=Tt(n),a=gt(n)==="y",c=["left","top"].includes(l)?-1:1,f=i&&a?-1:1,d=he(e,t),{mainAxis:h,crossAxis:u,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof g=="number"&&(u=s==="end"?g*-1:g),a?{x:u*f,y:h*c}:{x:h*c,y:u*f}}var be=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;let{x:r,y:i,placement:l,middlewareData:s}=e,a=await bn(e,t);return l===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:i+a.y,data:{...a,placement:l}}}}};function mt(){return typeof window<"u"}function H(t){return xe(t)?(t.nodeName||"").toLowerCase():"#document"}function A(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function L(t){var e;return(e=(xe(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function xe(t){return mt()?t instanceof Node||t instanceof A(t).Node:!1}function O(t){return mt()?t instanceof Element||t instanceof A(t).Element:!1}function _(t){return mt()?t instanceof HTMLElement||t instanceof A(t).HTMLElement:!1}function we(t){return!mt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof A(t).ShadowRoot}function V(t){let{overflow:e,overflowX:n,overflowY:o,display:r}=k(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function ye(t){return["table","td","th"].includes(H(t))}function Z(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function vt(t){let e=bt(),n=O(t)?k(t):t;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Se(t){let e=M(t);for(;_(e)&&!z(e);){if(vt(e))return e;if(Z(e))return null;e=M(e)}return null}function bt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function z(t){return["html","body","#document"].includes(H(t))}function k(t){return A(t).getComputedStyle(t)}function tt(t){return O(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function M(t){if(H(t)==="html")return t;let e=t.assignedSlot||t.parentNode||we(t)&&t.host||L(t);return we(e)?e.host:e}function $e(t){let e=M(t);return z(e)?t.ownerDocument?t.ownerDocument.body:t.body:_(e)&&V(e)?e:$e(e)}function pt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);let r=$e(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),l=A(r);if(i){let s=wt(l);return e.concat(l,l.visualViewport||[],V(r)?r:[],s&&n?pt(s):[])}return e.concat(r,pt(r,[],n))}function wt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Re(t){let e=k(t),n=parseFloat(e.width)||0,o=parseFloat(e.height)||0,r=_(t),i=r?t.offsetWidth:n,l=r?t.offsetHeight:o,s=J(n)!==i||J(o)!==l;return s&&(n=i,o=l),{width:n,height:o,$:s}}function Oe(t){return O(t)?t:t.contextElement}function U(t){let e=Oe(t);if(!_(e))return E(1);let n=e.getBoundingClientRect(),{width:o,height:r,$:i}=Re(e),l=(i?J(n.width):n.width)/o,s=(i?J(n.height):n.height)/r;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}var wn=E(0);function ke(t){let e=A(t);return!bt()||!e.visualViewport?wn:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function xn(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==A(t)?!1:e}function et(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);let r=t.getBoundingClientRect(),i=Oe(t),l=E(1);e&&(o?O(o)&&(l=U(o)):l=U(t));let s=xn(i,n,o)?ke(i):E(0),a=(r.left+s.x)/l.x,c=(r.top+s.y)/l.y,f=r.width/l.x,d=r.height/l.y;if(i){let h=A(i),u=o&&O(o)?A(o):o,g=h,p=wt(g);for(;p&&o&&u!==g;){let w=U(p),T=p.getBoundingClientRect(),P=k(p),nt=T.left+(p.clientLeft+parseFloat(P.paddingLeft))*w.x,xt=T.top+(p.clientTop+parseFloat(P.paddingTop))*w.y;a*=w.x,c*=w.y,f*=w.x,d*=w.y,a+=nt,c+=xt,g=A(p),p=wt(g)}}return Q({width:f,height:d,x:a,y:c})}function Pt(t,e){let n=tt(t).scrollLeft;return e?e.left+n:et(L(t)).left+n}function Ee(t,e,n){n===void 0&&(n=!1);let o=t.getBoundingClientRect(),r=o.left+e.scrollLeft-(n?0:Pt(t,o)),i=o.top+e.scrollTop;return{x:r,y:i}}function yn(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t,i=r==="fixed",l=L(o),s=e?Z(e.floating):!1;if(o===l||s&&i)return n;let a={scrollLeft:0,scrollTop:0},c=E(1),f=E(0),d=_(o);if((d||!d&&!i)&&((H(o)!=="body"||V(l))&&(a=tt(o)),_(o))){let u=et(o);c=U(o),f.x=u.x+o.clientLeft,f.y=u.y+o.clientTop}let h=l&&!d&&!i?Ee(l,a,!0):E(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x+h.x,y:n.y*c.y-a.scrollTop*c.y+f.y+h.y}}function Sn(t){return Array.from(t.getClientRects())}function $n(t){let e=L(t),n=tt(t),o=t.ownerDocument.body,r=N(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=N(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),l=-n.scrollLeft+Pt(t),s=-n.scrollTop;return k(o).direction==="rtl"&&(l+=N(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:s}}function An(t,e){let n=A(t),o=L(t),r=n.visualViewport,i=o.clientWidth,l=o.clientHeight,s=0,a=0;if(r){i=r.width,l=r.height;let c=bt();(!c||c&&e==="fixed")&&(s=r.offsetLeft,a=r.offsetTop)}return{width:i,height:l,x:s,y:a}}function Cn(t,e){let n=et(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=_(t)?U(t):E(1),l=t.clientWidth*i.x,s=t.clientHeight*i.y,a=r*i.x,c=o*i.y;return{width:l,height:s,x:a,y:c}}function Ae(t,e,n){let o;if(e==="viewport")o=An(t,n);else if(e==="document")o=$n(L(t));else if(O(e))o=Cn(e,n);else{let r=ke(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Q(o)}function _e(t,e){let n=M(t);return n===e||!O(n)||z(n)?!1:k(n).position==="fixed"||_e(n,e)}function Rn(t,e){let n=e.get(t);if(n)return n;let o=pt(t,[],!1).filter(s=>O(s)&&H(s)!=="body"),r=null,i=k(t).position==="fixed",l=i?M(t):t;for(;O(l)&&!z(l);){let s=k(l),a=vt(l);!a&&s.position==="fixed"&&(r=null),(i?!a&&!r:!a&&s.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||V(l)&&!a&&_e(t,l))?o=o.filter(f=>f!==l):r=s,l=M(l)}return e.set(t,o),o}function On(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t,l=[...n==="clippingAncestors"?Z(e)?[]:Rn(e,this._c):[].concat(n),o],s=l[0],a=l.reduce((c,f)=>{let d=Ae(e,f,r);return c.top=N(d.top,c.top),c.right=ht(d.right,c.right),c.bottom=ht(d.bottom,c.bottom),c.left=N(d.left,c.left),c},Ae(e,s,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function kn(t){let{width:e,height:n}=Re(t);return{width:e,height:n}}function En(t,e,n){let o=_(e),r=L(e),i=n==="fixed",l=et(t,!0,i,e),s={scrollLeft:0,scrollTop:0},a=E(0);if(o||!o&&!i)if((H(e)!=="body"||V(r))&&(s=tt(e)),o){let h=et(e,!0,i,e);a.x=h.x+e.clientLeft,a.y=h.y+e.clientTop}else r&&(a.x=Pt(r));let c=r&&!o&&!i?Ee(r,s):E(0),f=l.left+s.scrollLeft-a.x-c.x,d=l.top+s.scrollTop-a.y-c.y;return{x:f,y:d,width:l.width,height:l.height}}function Lt(t){return k(t).position==="static"}function Ce(t,e){if(!_(t)||k(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return L(t)===n&&(n=n.ownerDocument.body),n}function Te(t,e){let n=A(t);if(Z(t))return n;if(!_(t)){let r=M(t);for(;r&&!z(r);){if(O(r)&&!Lt(r))return r;r=M(r)}return n}let o=Ce(t,e);for(;o&&ye(o)&&Lt(o);)o=Ce(o,e);return o&&z(o)&&Lt(o)&&!vt(o)?n:o||Se(t)||n}var _n=async function(t){let e=this.getOffsetParent||Te,n=this.getDimensions,o=await n(t.floating);return{reference:En(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Tn(t){return k(t).direction==="rtl"}var Ln={convertOffsetParentRelativeRectToViewportRelativeRect:yn,getDocumentElement:L,getClippingRect:On,getOffsetParent:Te,getElementRects:_n,getClientRects:Sn,getDimensions:kn,getScale:U,isElement:O,isRTL:Tn};var Le=be;var Pe=(t,e,n)=>{let o=new Map,r={platform:Ln,...n},i={...r.platform,_c:o};return ve(t,e,{...r,platform:i})};var Me=({render:t,html:e})=>{let n=new CSSStyleSheet;n.replaceSync(m`
|
728
|
+
:host {
|
729
|
+
display: contents;
|
730
|
+
}
|
614
731
|
slot {
|
615
732
|
display: contents;
|
616
733
|
}
|
617
|
-
|
618
|
-
|
734
|
+
|
735
|
+
${x}
|
736
|
+
${b}
|
737
|
+
|
738
|
+
@keyframes popover-in {
|
739
|
+
from {
|
740
|
+
opacity: 0;
|
741
|
+
transform: scale(0.95);
|
742
|
+
}
|
743
|
+
to {
|
744
|
+
opacity: 1;
|
745
|
+
transform: scale(1);
|
746
|
+
}
|
619
747
|
}
|
748
|
+
|
749
|
+
.popover-content {
|
750
|
+
animation: popover-in 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
751
|
+
transform-origin: top;
|
752
|
+
}
|
753
|
+
`);class o extends R({render:t,styleSheet:n}){_isOpen=!1;_refElement;_floatingElement;open=i=>{this._isOpen=!0,this._refElement=i,this.reRender(),Pe(this._refElement,this._floatingElement,{placement:this.getAttribute("placement")||"bottom",middleware:[Le(12)]}).then(({x:l,y:s})=>{Object.assign(this._floatingElement.style,{left:`${l}px`,top:`${s}px`,position:"fixed"})})};close=()=>{this._isOpen=!1,this.reRender()};render=()=>this._isOpen?e`
|
754
|
+
<rtgl-view onclick=${this.close} pos="fix" cor="full">
|
755
|
+
<rtgl-view
|
756
|
+
ref=${i=>this._floatingElement=i}
|
757
|
+
bw="xs"
|
758
|
+
p="l"
|
759
|
+
class="popover-content"
|
760
|
+
onclick=${i=>i.stopPropagation()}
|
761
|
+
>
|
762
|
+
<slot></slot>
|
763
|
+
</rtgl-view>
|
764
|
+
</rtgl-view>
|
765
|
+
`:e``}return o};function Pn(t){let e=[];for(let n of t)if(e.push({title:n.title,slug:n.slug,type:n.type}),n.items&&Array.isArray(n.items))for(let o of n.items)e.push({title:o.title,slug:o.slug,type:o.type});return e}var We=({render:t,html:e})=>class extends R({render:t}){items=[];title={label:void 0,labelHref:void 0,href:void 0,image:{src:void 0,alt:void 0,width:void 0,height:void 0,href:void 0}};onMount=()=>{let o=this.getAttribute("title");o&&(console.log("titleAttribute",o),this.title=JSON.parse(decodeURIComponent(o)),this.reRender())};getItems=()=>{let o,r=this.getAttribute("items");return r?o=JSON.parse(decodeURIComponent(r)):o=this.items,Pn(o)};static get observedAttributes(){return["items"]}render=()=>e`
|
766
|
+
<rtgl-view h="f" w="272" bwr="xs">
|
767
|
+
<rtgl-view p="l">
|
768
|
+
<a
|
769
|
+
style="text-decoration: none; display: contents; color: inherit;"
|
770
|
+
href=${this.title.href}
|
771
|
+
>
|
772
|
+
<rtgl-view d="h" av="c" g="l">
|
773
|
+
${this.title?.image?.src?e`<rtgl-image
|
774
|
+
w=${this.title?.image?.width}
|
775
|
+
h=${this.title?.image?.height}
|
776
|
+
src=${this.title?.image?.src}
|
777
|
+
alt=${this.title?.image?.alt||"Navbar"}
|
778
|
+
/>`:""}
|
779
|
+
${this.title?.label?e`<rtgl-text s="lg">${this.title?.label}</rtgl-text>`:""}
|
780
|
+
</rtgl-view>
|
781
|
+
</a>
|
782
|
+
</rtgl-view>
|
783
|
+
<rtgl-view w="f" ph="l" pb="l" g="xs">
|
784
|
+
${this.getItems().map((o,r)=>{let i=r===0;return o.type==="groupLabel"?e`
|
785
|
+
<rtgl-view mt=${i?void 0:"m"} h="32" av="c" ph="m">
|
786
|
+
<rtgl-text s="xs" c="mu-fg">${o.title}</rtgl-text>
|
787
|
+
</rtgl-view>
|
788
|
+
`:e`
|
789
|
+
<a
|
790
|
+
style="display: contents; text-decoration: none; color: inherit;"
|
791
|
+
href=${o.slug}
|
792
|
+
>
|
793
|
+
<rtgl-view
|
794
|
+
h="32"
|
795
|
+
av="c"
|
796
|
+
ph="m"
|
797
|
+
w="f"
|
798
|
+
h-bgc="mu"
|
799
|
+
br="l"
|
800
|
+
bgc="${o.active?"mu":"bg"}"
|
801
|
+
cur="p"
|
802
|
+
>
|
803
|
+
<rtgl-text s="sm">${o.title}</rtgl-text>
|
804
|
+
</rtgl-view>
|
805
|
+
</a>
|
806
|
+
`})}
|
807
|
+
</rtgl-view>
|
808
|
+
</rtgl-view>
|
809
|
+
`};var Be=({render:t,html:e})=>class extends R({render:t}){items=[];_contentContainer;_selectedSlug;onUnmount=()=>{this._contentContainer.removeEventListener("scroll",this.checkCurrentHeading),window.removeEventListener("scroll",this.checkCurrentHeading)};checkCurrentHeading=()=>{let o=this._contentContainer.querySelectorAll("rtgl-text[id]"),r=Array.from(o),i=null,l=null,s=-1/0;r.forEach(a=>{let c=a.getBoundingClientRect();c.top<=100&&c.top>s&&(s=c.top,l=a.id)}),l&&l!==i&&(i=l,this._selectedSlug=l,this.reRender())};startListening=o=>{this._contentContainer=o;let r=this._contentContainer.querySelectorAll("rtgl-text[id]"),i=Array.from(r);this.items=i.map(l=>({slug:l.id,title:l.textContent})),o&&o.addEventListener("scroll",this.checkCurrentHeading,{passive:!0}),window.addEventListener("scroll",this.checkCurrentHeading,{passive:!0}),this.checkCurrentHeading()};render=()=>e`
|
810
|
+
<rtgl-view h="f" w="272">
|
811
|
+
<rtgl-view w="f" g="s" mt="xl">
|
812
|
+
${this.items.map(o=>{let r=`${this._selectedSlug}`===o.slug?"fg":"mu-fg",i=`#${o.slug}`;return e`
|
813
|
+
<a
|
814
|
+
style="display: contents; text-decoration: none; color: inherit;"
|
815
|
+
href=${i}
|
816
|
+
>
|
817
|
+
<rtgl-text s="sm" c=${r}>${o.title}</rtgl-text>
|
818
|
+
</a>
|
819
|
+
`})}
|
820
|
+
</rtgl-view>
|
821
|
+
</rtgl-view>
|
822
|
+
`};var De=({render:t,html:e})=>{let n=new CSSStyleSheet;n.replaceSync(m`
|
620
823
|
:host {
|
621
|
-
display:
|
622
|
-
align-self: auto;
|
623
|
-
align-content: flex-start;
|
624
|
-
flex-wrap: wrap;
|
625
|
-
border-style: solid;
|
626
|
-
border-width: 0;
|
627
|
-
box-sizing: border-box;
|
824
|
+
display: contents;
|
628
825
|
}
|
629
|
-
|
630
|
-
|
826
|
+
slot {
|
827
|
+
display: contents;
|
631
828
|
}
|
632
|
-
${
|
633
|
-
${
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
829
|
+
${x}
|
830
|
+
${b}
|
831
|
+
`);class o extends R({render:t,styleSheet:n}){title={label:void 0,labelHref:void 0,href:void 0,image:{src:void 0,alt:void 0,width:void 0,height:void 0,href:void 0}};onMount=()=>{let i=this.getAttribute("title");i&&(console.log("titleAttribute",i),this.title=JSON.parse(decodeURIComponent(i)),this.reRender())};render=()=>e`
|
832
|
+
<rtgl-view d="h" h="48" av="c" w="f">
|
833
|
+
<a
|
834
|
+
style="text-decoration: none; display: contents; color: inherit;"
|
835
|
+
href=${this.title.href}
|
836
|
+
>
|
837
|
+
<rtgl-view d="h" av="c" g="l">
|
838
|
+
${this.title?.image?.src?e`<rtgl-image
|
839
|
+
w=${this.title?.image?.width}
|
840
|
+
h=${this.title?.image?.height}
|
841
|
+
src=${this.title?.image?.src}
|
842
|
+
alt=${this.title?.image?.alt||"Navbar"}
|
843
|
+
/>`:""}
|
844
|
+
${this.title?.label?e`<rtgl-text s="lg">${this.title?.label}</rtgl-text>`:""}
|
845
|
+
</rtgl-view>
|
846
|
+
</a>
|
847
|
+
<rtgl-view flex="1"></rtgl-view>
|
848
|
+
<slot name="right"> </slot>
|
849
|
+
</rtgl-view>
|
850
|
+
`}return o};var Ne=({render:t,html:e})=>{let n=new CSSStyleSheet;n.replaceSync(m`
|
851
|
+
:host {
|
852
|
+
display: contents;
|
853
|
+
}
|
854
|
+
${x}
|
855
|
+
${b}
|
856
|
+
`);class o extends R({render:t,styleSheet:n}){form={title:void 0,description:void 0,fields:[],actions:[]};values={};fieldStates={};static get observedAttributes(){return["key","w","ellipsis"]}_onChange=(i,l)=>{console.log("onChange",{name:i,value:l}),this.values[i]=l;let s=this.form?.fields?.find(a=>a.name===i)?.validations;if(s){for(let a of s)if(a.rule instanceof RegExp){let c=a.rule.test(l);this.fieldStates[i]||(this.fieldStates[i]={}),c?delete this.fieldStates[i].error:this.fieldStates[i].error=a.message}}this.reRender()};_onSubmit=i=>{this.onSubmit&&this.onSubmit({action:i,values:this.values,fieldStates:this.fieldStates})};render=()=>e`
|
857
|
+
<rtgl-view p="m" w="f">
|
858
|
+
<form style="display: contents;">
|
859
|
+
<rtgl-text s="h2">${this.form.title}</rtgl-text>
|
860
|
+
<rtgl-text c="mu-fg">${this.form.description}</rtgl-text>
|
861
|
+
<rtgl-view g="l">
|
862
|
+
${this.form.fields.map(i=>{if(i.type==="groupLabel")return e`<rtgl-text s="h4">${i.content}</rtgl-text> `;let l;i.type==="input"&&(l=e`
|
863
|
+
<rtgl-input
|
864
|
+
.onChange=${this._onChange.bind(this,i.name)}
|
865
|
+
type="text"
|
866
|
+
name="${i.name}"
|
867
|
+
/>
|
868
|
+
`);let s=this.fieldStates?.[i?.name]?.error;return e`
|
869
|
+
<rtgl-view g="m">
|
870
|
+
<rtgl-text s="sm" c=${s?"de":"fg"}>${i.label}</rtgl-text>
|
871
|
+
${l}
|
872
|
+
<rtgl-text s="sm" c="mu-fg">${i.description}</rtgl-text>
|
873
|
+
${s?e`<rtgl-text s="sm" c="de">${s}</rtgl-text>`:""}
|
874
|
+
</rtgl-view>
|
875
|
+
`})}
|
876
|
+
</rtgl-view>
|
877
|
+
<rtgl-view g="m" mt="l" w="f">
|
878
|
+
${this.form.actions.map(i=>e`<rtgl-button
|
879
|
+
w=${i.fill?"f":""}
|
880
|
+
onclick=${this._onSubmit.bind(this,i.id)}
|
881
|
+
>${i.content}</rtgl-button
|
882
|
+
> `)}
|
883
|
+
</rtgl-view>
|
884
|
+
</form>
|
885
|
+
</rtgl-view>
|
886
|
+
`}return o};customElements.define("rtgl-button",te({render:S,html:y}));customElements.define("rtgl-view",oe({render:S,html:y}));customElements.define("rtgl-text",ie({render:S,html:y}));customElements.define("rtgl-image",se({render:S,html:y}));customElements.define("rtgl-svg",ae({render:S,html:y}));customElements.define("rtgl-input",ce({render:S,html:y}));customElements.define("rtgl-textarea",de({render:S,html:y}));customElements.define("rtgl-select",fe({render:S,html:y}));customElements.define("rtgl-popover",Me({render:S,html:y}));customElements.define("rtgl-sidebar",We({render:S,html:y}));customElements.define("rtgl-page-outline",Be({render:S,html:y}));customElements.define("rtgl-navbar",De({render:S,html:y}));customElements.define("rtgl-form",Ne({render:S,html:y}));})();
|
646
887
|
/*! (c) Andrea Giammarchi - MIT */
|