rettangoli-ui 0.0.10-rc2 → 0.0.10-rc4
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.
@@ -1,21 +1,21 @@
|
|
1
|
-
function d(o,...l){let s="";return o.forEach((u,
|
2
|
-
:host([${m}="${
|
1
|
+
function d(o,...l){let s="";return o.forEach((u,r)=>{s+=u+(l[r]||"")}),s}var M={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)"},f=(o,l,s={})=>{let u="";for(let[r,h]of Object.entries(M)){r!=="default"&&(u+=`${h} {`);for(let[g,t]of Object.entries(l)){let e=s[g]?` ${s[g]} `:" ";for(let[n,a]of Object.entries(t)){let c=o[g],b=a.startsWith("--")?`var(${a})`:a,m=r==="default"?g:`${r}-${g}`,v=r==="default"?`h-${g}`:`${r}-h-${g}`;if(c){let j=c.split(" ").map(z=>`${z}: ${b};`).join(" ");u+=`
|
2
|
+
:host([${m}="${n}"])${e}{
|
3
3
|
${j}
|
4
4
|
}
|
5
|
-
:host([${v}="${
|
5
|
+
:host([${v}="${n}"]:hover)${e}{
|
6
6
|
${j}
|
7
7
|
}
|
8
8
|
`}else u+=`
|
9
|
-
:host([${m}="${
|
9
|
+
:host([${m}="${n}"])${e}{
|
10
10
|
${a}
|
11
11
|
}
|
12
|
-
:host([${v}="${
|
12
|
+
:host([${v}="${n}"]:hover)${e}{
|
13
13
|
${a}
|
14
14
|
}
|
15
|
-
`}}
|
16
|
-
`);let
|
15
|
+
`}}r!=="default"&&(u+="}")}return u};function E(o){if(o===null||o.includes("/"))return!1;let l=String(o);return/[0-9]$/.test(l)}var L=o=>/%$/.test(o),p=o=>{if(o!==void 0)return L(o)?o:E(o)?`${o}px`:o},i={xs:"--spacing-xs",s:"--spacing-s",m:"--spacing-m",l:"--spacing-l",xl:"--spacing-xl"};function S(o){let l="";for(let[s,u]of Object.entries(M)){s!=="default"&&(l+=`${u} {
|
16
|
+
`);let r="";for(let[h,g]of Object.entries(o[s]))g!=null&&(r+=`${h}: ${g};
|
17
17
|
`);l+=`:host {
|
18
|
-
${
|
18
|
+
${r.trim()}
|
19
19
|
}
|
20
20
|
`,s!=="default"&&(l+=`}
|
21
21
|
`)}return l}var w=d`
|
@@ -58,7 +58,7 @@ function d(o,...l){let s="";return o.forEach((u,e)=>{s+=u+(l[e]||"")}),s}var M={
|
|
58
58
|
:host([flex="12"]) {
|
59
59
|
flex: 12;
|
60
60
|
}
|
61
|
-
`;var O={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom"},H={mt:
|
61
|
+
`;var O={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom"},H={mt:i,mr:i,mb:i,ml:i,m:i,mh:i,mv:i},I={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button"},T=f(O,H,I);var U=({render:o,html:l})=>{let s=new CSSStyleSheet;return s.replaceSync(d`
|
62
62
|
:host {
|
63
63
|
display: contents;
|
64
64
|
}
|
@@ -202,7 +202,7 @@ function d(o,...l){let s="";return o.forEach((u,e)=>{s+=u+(l[e]||"")}),s}var M={
|
|
202
202
|
}
|
203
203
|
${T}
|
204
204
|
${w}
|
205
|
-
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s],o(this.shadow,this.render)}static get observedAttributes(){return["key","href","target","w","t"]}_buttonRef={};_assingRef=
|
205
|
+
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s],o(this.shadow,this.render)}static get observedAttributes(){return["key","href","target","w","t"]}_buttonRef={};_assingRef=r=>{this._buttonRef.current=r;let h=p(this.getAttribute("w"));h==="f"?this._buttonRef.current.style.width="100%":h!=null&&(this._buttonRef.current.style.width=h)};attributeChangedCallback(r,h,g){if(!this._buttonRef.current)return;let t=p(this.getAttribute("w"));t==="f"?this._buttonRef.current.style.width="100%":t!=null&&(this._buttonRef.current.style.width=t,this._buttonRef.current.style.minWidth=t,this._buttonRef.current.style.maxWidth=t),o(this.shadow,this.render)}render=()=>this.getAttribute("href")?l`
|
206
206
|
<a
|
207
207
|
href=${this.getAttribute("href")}
|
208
208
|
target=${this.getAttribute("target")}
|
@@ -358,13 +358,10 @@ function d(o,...l){let s="";return o.forEach((u,e)=>{s+=u+(l[e]||"")}),s}var M={
|
|
358
358
|
left: 0;
|
359
359
|
top: 0;
|
360
360
|
height: 100%;
|
361
|
-
`},shadow:{s:"--shadow-s",m:"--shadow-m",l:"--shadow-l"},pt:
|
361
|
+
`},shadow:{s:"--shadow-s",m:"--shadow-m",l:"--shadow-l"},pt:i,pr:i,pb:i,pl:i,p:i,ph:i,pv:i,g:i,gv:i,gh:i,bw:_,bwt:_,bwr:_,bwb:_,bwl:_,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:"50%"}},$=f(D,Q);var F={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom"},G={mt:i,mr:i,mb:i,ml:i,m:i,mh:i,mv:i},x=f(F,G);var N=({render:o,html:l})=>{let s=new CSSStyleSheet;return s.replaceSync(d`
|
362
362
|
slot {
|
363
363
|
display: contents;
|
364
364
|
}
|
365
|
-
:host([hidden]) {
|
366
|
-
display: none;
|
367
|
-
}
|
368
365
|
:host {
|
369
366
|
display: flex;
|
370
367
|
align-self: auto;
|
@@ -383,7 +380,7 @@ function d(o,...l){let s="";return o.forEach((u,e)=>{s+=u+(l[e]||"")}),s}var M={
|
|
383
380
|
${x}
|
384
381
|
${y}
|
385
382
|
${$}
|
386
|
-
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s],o(this.shadow,this.render)}static get observedAttributes(){return["key","wh","w","h","hidden","s-w","s-h","s-d"]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};attributeChangedCallback(
|
383
|
+
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s],o(this.shadow,this.render)}static get observedAttributes(){return["key","wh","w","h","hidden","s-w","s-h","s-d"]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};attributeChangedCallback(r,h,g){["default","sm","md","lg","xl"].forEach(t=>{let e=v=>`${t==="default"?"":`${t}-`}${v}`,n=this.getAttribute(e("wh")),a=p(n===null?this.getAttribute(e("w")):n),c=p(n===null?this.getAttribute(e("h")):n),b=this.getAttribute(e("o")),m=this.getAttribute(e("z"));m!==null&&(this._styles[t]["z-index"]=m),b!==null&&(this._styles[t].opacity=b),a==="f"?this._styles[t].width="100%":a!==void 0&&(this._styles[t].width=a,this._styles[t]["min-width"]=a,this._styles[t]["max-width"]=a),c==="f"?this._styles[t].height="100%":c!==void 0&&(this._styles[t].height=c,this._styles[t]["min-height"]=c,this._styles[t]["max-height"]=c),this.hasAttribute(e("hidden"))&&(this._styles[t].display="none !important"),this.hasAttribute(e("visible"))&&(this._styles[t].display="flex !important")}),o(this.shadow,this.render)}render=()=>l`
|
387
384
|
<style>
|
388
385
|
${S(this._styles)}
|
389
386
|
</style>
|
@@ -457,7 +454,7 @@ function d(o,...l){let s="";return o.forEach((u,e)=>{s+=u+(l[e]||"")}),s}var M={
|
|
457
454
|
${A}
|
458
455
|
${x}
|
459
456
|
${y}
|
460
|
-
`);class u extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s]}static get observedAttributes(){return["key","w","ellipsis"]}connectedCallback(){o(this.shadow,this.render)}attributeChangedCallback(h,g,t){let
|
457
|
+
`);class u extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s]}static get observedAttributes(){return["key","w","ellipsis"]}connectedCallback(){o(this.shadow,this.render)}attributeChangedCallback(h,g,t){let e=p(this.getAttribute("w"));this.hasAttribute("ellipsis")&&(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"),e==="f"?this.style.width="100%":e!==void 0&&(this.style.width=e),o(this.shadow,this.render)}render=()=>l` <slot></slot> `}return u};var Z=({render:o,html:l})=>{let s=new CSSStyleSheet;return s.replaceSync(d`
|
461
458
|
:host {
|
462
459
|
border-style: solid;
|
463
460
|
box-sizing: border-box;
|
@@ -483,7 +480,7 @@ ${y}
|
|
483
480
|
${$}
|
484
481
|
${x}
|
485
482
|
${y}
|
486
|
-
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s]}_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(){o(this.shadow,this.render)}attributeChangedCallback(
|
483
|
+
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s]}_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(){o(this.shadow,this.render)}attributeChangedCallback(r,h,g){["default","sm","md","lg","xl"].forEach(t=>{let e=v=>`${t==="default"?"":`${t}-`}${v}`,n=this.getAttribute(e("wh")),a=p(n===null?this.getAttribute(e("w")):n),c=p(n===null?this.getAttribute(e("h")):n),b=this.getAttribute(e("o")),m=this.getAttribute(e("z"));m!==null&&(this._styles[t].zIndex=m),b!==null&&(this._styles[t].opacity=b),a==="f"?this._styles[t].width="100%":a!==void 0&&(this._styles[t].width=a,this._styles[t]["min-width"]=a,this._styles[t]["max-width"]=a),c==="f"?this._styles[t].height="100%":c!==void 0&&(this._styles[t].height=c,this._styles[t]["min-height"]=c,this._styles[t]["max-height"]=c)}),o(this.shadow,this.render)}render=()=>l`
|
487
484
|
<style>
|
488
485
|
${S(this._styles)}
|
489
486
|
</style>
|
@@ -613,7 +610,7 @@ ${y}
|
|
613
610
|
${V}
|
614
611
|
${w}
|
615
612
|
${y}
|
616
|
-
`),class R extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s]}static _icons={};static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return R._icons}static addIcon(
|
613
|
+
`),class R extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s]}static _icons={};static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return R._icons}static addIcon(r,h){R._icons[r]=h}connectedCallback(){this.render()}attributeChangedCallback(r,h,g){let t=this.getAttribute("wh"),e=p(t===null?this.getAttribute("w"):t),n=p(t===null?this.getAttribute("h"):t);e&&(this.style.width=e),n&&(this.style.height=n),this.render()}render=()=>{try{let r=this.getAttribute("svg"),h=R._icons[r]||(window.rtglIcons||{})[r];if(h){this.shadow.innerHTML=h;return}}catch(r){console.log("error in rtgl-svg render",r)}this.shadow.innerHTML=""}}};var ot=({render:o,html:l})=>{let s=new CSSStyleSheet;return s.replaceSync(d`
|
617
614
|
slot {
|
618
615
|
display: contents;
|
619
616
|
}
|
@@ -638,11 +635,11 @@ ${y}
|
|
638
635
|
${x}
|
639
636
|
${y}
|
640
637
|
${$}
|
641
|
-
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s]}connectedCallback(){o(this.shadow,this.render)}static get observedAttributes(){return["key","wh","w","h","hidden","s-w","s-h","s-d"]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};attributeChangedCallback(
|
638
|
+
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[s]}connectedCallback(){o(this.shadow,this.render)}static get observedAttributes(){return["key","wh","w","h","hidden","s-w","s-h","s-d"]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};attributeChangedCallback(r,h,g){["default","sm","md","lg","xl"].forEach(t=>{let e=v=>`${t==="default"?"":`${t}-`}${v}`,n=this.getAttribute(e("wh")),a=p(n===null?this.getAttribute(e("w")):n),c=p(n===null?this.getAttribute(e("h")):n),b=this.getAttribute(e("o")),m=this.getAttribute(e("z"));m!==null&&(this._styles[t]["z-index"]=m),b!==null&&(this._styles[t].opacity=b),a==="f"?this._styles[t].width="100%":a!==void 0&&(this._styles[t].width=a,this._styles[t]["min-width"]=a,this._styles[t]["max-width"]=a),c==="f"?this._styles[t].height="100%":c!==void 0&&(this._styles[t].height=c,this._styles[t]["min-height"]=c,this._styles[t]["max-height"]=c),this.hasAttribute("hidden")&&(this._styles[t].display="none")}),setTimeout(()=>{o(this.shadow,this.render)},0)}render=()=>l`
|
642
639
|
<style>
|
643
640
|
${S(this._styles)}
|
644
641
|
</style>
|
645
642
|
<slot name="top"></slot>
|
646
|
-
${this.items?.map((
|
643
|
+
${this.items?.map((r,h)=>(typeof this.itemsRenderer=="function"?this.itemsRenderer:this.itemsRenderer.maps[r[this.itemsRenderer.key]])(r,h))}
|
647
644
|
<slot name="bottom"></slot>
|
648
645
|
`}};export{U as RettangoliButton,Z as RettangoliImage,ot as RettangoliListView,tt as RettangoliSvg,Y as RettangoliText,N as RettangoliView};
|
@@ -362,9 +362,6 @@ var rettangoli=(()=>{var{isArray:nt}=Array,{getPrototypeOf:_t,getOwnPropertyDesc
|
|
362
362
|
slot {
|
363
363
|
display: contents;
|
364
364
|
}
|
365
|
-
:host([hidden]) {
|
366
|
-
display: none;
|
367
|
-
}
|
368
365
|
:host {
|
369
366
|
display: flex;
|
370
367
|
align-self: auto;
|
@@ -383,7 +380,7 @@ var rettangoli=(()=>{var{isArray:nt}=Array,{getPrototypeOf:_t,getOwnPropertyDesc
|
|
383
380
|
${R}
|
384
381
|
${S}
|
385
382
|
${I}
|
386
|
-
`),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","wh","w","h","hidden","s-w","s-h","s-d"]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};attributeChangedCallback(s,i,a){["default","sm","md","lg","xl"].forEach(r=>{let g=f=>`${r==="default"?"":`${r}-`}${f}`,p=this.getAttribute(g("wh")),h=b(p===null?this.getAttribute(g("w")):p),c=b(p===null?this.getAttribute(g("h")):p),l=this.getAttribute(g("o")),d=this.getAttribute(g("z"));d!==null&&(this._styles[r]["z-index"]=d),l!==null&&(this._styles[r].opacity=l),h==="f"?this._styles[r].width="100%":h!==void 0&&(this._styles[r].width=h,this._styles[r]["min-width"]=h,this._styles[r]["max-width"]=h),c==="f"?this._styles[r].height="100%":c!==void 0&&(this._styles[r].height=c,this._styles[r]["min-height"]=c,this._styles[r]["max-height"]=c),this.hasAttribute("hidden")&&(this._styles[r].display="none")}),e(this.shadow,this.render)}render=()=>t`
|
383
|
+
`),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","wh","w","h","hidden","s-w","s-h","s-d"]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};attributeChangedCallback(s,i,a){["default","sm","md","lg","xl"].forEach(r=>{let g=f=>`${r==="default"?"":`${r}-`}${f}`,p=this.getAttribute(g("wh")),h=b(p===null?this.getAttribute(g("w")):p),c=b(p===null?this.getAttribute(g("h")):p),l=this.getAttribute(g("o")),d=this.getAttribute(g("z"));d!==null&&(this._styles[r]["z-index"]=d),l!==null&&(this._styles[r].opacity=l),h==="f"?this._styles[r].width="100%":h!==void 0&&(this._styles[r].width=h,this._styles[r]["min-width"]=h,this._styles[r]["max-width"]=h),c==="f"?this._styles[r].height="100%":c!==void 0&&(this._styles[r].height=c,this._styles[r]["min-height"]=c,this._styles[r]["max-height"]=c),this.hasAttribute(g("hidden"))&&(this._styles[r].display="none !important"),this.hasAttribute(g("visible"))&&(this._styles[r].display="flex !important")}),e(this.shadow,this.render)}render=()=>t`
|
387
384
|
<style>
|
388
385
|
${D(this._styles)}
|
389
386
|
</style>
|
@@ -1,15 +1,15 @@
|
|
1
|
-
var rettangoli=(()=>{var{isArray:at}=Array,{getPrototypeOf:Rt,getOwnPropertyDescriptor:jt}=Object,S=[],lt=()=>document.createRange(),N=(e,t,o)=>(e.set(t,o),o),Mt=(e,t)=>t.reduceRight(Wt,e),Wt=(e,t)=>e.childNodes[t],{setPrototypeOf:Et}=Object,j,ht=(e,t,o)=>(j||(j=lt()),o?j.setStartAfter(e):j.setStartBefore(e),j.setEndAfter(t),j.deleteContents(),e),Y=({firstChild:e,lastChild:t},o)=>ht(e,t,o),ct=!1,Z=(e,t)=>ct&&e.nodeType===11?1/t<0?t?Y(e,!0):e.lastChild:t?e.valueOf():e.firstChild:e,rt=e=>document.createComment(e),tt=class extends(t=>{function o(n){return Et(n,new.target.prototype)}return o.prototype=t.prototype,o})(DocumentFragment){#e=rt("<>");#o=rt("</>");#t=S;constructor(t){super(t),this.replaceChildren(this.#e,...t.childNodes,this.#o),ct=!0}get firstChild(){return this.#e}get lastChild(){return this.#o}get parentNode(){return this.#e.parentNode}remove(){Y(this,!1)}replaceWith(t){Y(this,!0).replaceWith(t)}valueOf(){let{parentNode:t}=this;if(t===this)this.#t===S&&(this.#t=[...this.childNodes]);else{if(t){let{firstChild:o,lastChild:n}=this;for(this.#t=[o];o!==n;)this.#t.push(o=o.nextSibling)}this.replaceChildren(...this.#t)}return this}},dt=(e,t,o)=>e.setAttribute(t,o),D=(e,t)=>e.removeAttribute(t),L,Ot=(e,t,o)=>{o=o.slice(1),L||(L=new WeakMap);let n=L.get(e)||N(L,e,{}),s=n[o];return s&&s[0]&&e.removeEventListener(o,...s),s=at(t)?t:[t,!1],n[o]=s,s[0]&&e.addEventListener(o,...s),t},V=(e,t)=>{let{t:o,n}=e,s=!1;switch(typeof t){case"object":if(t!==null){(n||o).replaceWith(e.n=t.valueOf());break}case"undefined":s=!0;default:o.data=s?"":t,n&&(e.n=null,n.replaceWith(o))}return t},I=(e,t,o)=>e[o]=t,Tt=(e,t,o)=>I(e,t,o.slice(1)),et=(e,t,o)=>t==null?(D(e,o),t):I(e,t,o),gt=(e,t)=>(typeof t=="function"?t(e):t.current=e,t),q=(e,t,o)=>(t==null?D(e,o):dt(e,o,t),t),Nt=(e,t,o)=>(e.toggleAttribute(o.slice(1),t),t),B=(e,t,o)=>{let{length:n}=t;if(e.data=`[${n}]`,n)return((s,i,a,r,
|
2
|
-
:host([${
|
1
|
+
var rettangoli=(()=>{var{isArray:at}=Array,{getPrototypeOf:Rt,getOwnPropertyDescriptor:jt}=Object,S=[],lt=()=>document.createRange(),N=(e,t,o)=>(e.set(t,o),o),Mt=(e,t)=>t.reduceRight(Wt,e),Wt=(e,t)=>e.childNodes[t],{setPrototypeOf:Et}=Object,j,ht=(e,t,o)=>(j||(j=lt()),o?j.setStartAfter(e):j.setStartBefore(e),j.setEndAfter(t),j.deleteContents(),e),Y=({firstChild:e,lastChild:t},o)=>ht(e,t,o),ct=!1,Z=(e,t)=>ct&&e.nodeType===11?1/t<0?t?Y(e,!0):e.lastChild:t?e.valueOf():e.firstChild:e,rt=e=>document.createComment(e),tt=class extends(t=>{function o(n){return Et(n,new.target.prototype)}return o.prototype=t.prototype,o})(DocumentFragment){#e=rt("<>");#o=rt("</>");#t=S;constructor(t){super(t),this.replaceChildren(this.#e,...t.childNodes,this.#o),ct=!0}get firstChild(){return this.#e}get lastChild(){return this.#o}get parentNode(){return this.#e.parentNode}remove(){Y(this,!1)}replaceWith(t){Y(this,!0).replaceWith(t)}valueOf(){let{parentNode:t}=this;if(t===this)this.#t===S&&(this.#t=[...this.childNodes]);else{if(t){let{firstChild:o,lastChild:n}=this;for(this.#t=[o];o!==n;)this.#t.push(o=o.nextSibling)}this.replaceChildren(...this.#t)}return this}},dt=(e,t,o)=>e.setAttribute(t,o),D=(e,t)=>e.removeAttribute(t),L,Ot=(e,t,o)=>{o=o.slice(1),L||(L=new WeakMap);let n=L.get(e)||N(L,e,{}),s=n[o];return s&&s[0]&&e.removeEventListener(o,...s),s=at(t)?t:[t,!1],n[o]=s,s[0]&&e.addEventListener(o,...s),t},V=(e,t)=>{let{t:o,n}=e,s=!1;switch(typeof t){case"object":if(t!==null){(n||o).replaceWith(e.n=t.valueOf());break}case"undefined":s=!0;default:o.data=s?"":t,n&&(e.n=null,n.replaceWith(o))}return t},I=(e,t,o)=>e[o]=t,Tt=(e,t,o)=>I(e,t,o.slice(1)),et=(e,t,o)=>t==null?(D(e,o),t):I(e,t,o),gt=(e,t)=>(typeof t=="function"?t(e):t.current=e,t),q=(e,t,o)=>(t==null?D(e,o):dt(e,o,t),t),Nt=(e,t,o)=>(e.toggleAttribute(o.slice(1),t),t),B=(e,t,o)=>{let{length:n}=t;if(e.data=`[${n}]`,n)return((s,i,a,r,d)=>{let p=a.length,l=i.length,h=p,c=0,g=0,u=null;for(;c<l||g<h;)if(l===c){let b=h<p?g?r(a[g-1],-0).nextSibling:r(a[h],0):d;for(;g<h;)s.insertBefore(r(a[g++],1),b)}else if(h===g)for(;c<l;)u&&u.has(i[c])||s.removeChild(r(i[c],-1)),c++;else if(i[c]===a[g])c++,g++;else if(i[l-1]===a[h-1])l--,h--;else if(i[c]===a[h-1]&&a[g]===i[l-1]){let b=r(i[--l],-0).nextSibling;s.insertBefore(r(a[g++],1),r(i[c++],-0).nextSibling),s.insertBefore(r(a[--h],1),b),i[l]=a[h]}else{if(!u){u=new Map;let b=g;for(;b<h;)u.set(a[b],b++)}if(u.has(i[c])){let b=u.get(i[c]);if(g<b&&b<h){let w=c,k=1;for(;++w<l&&w<h&&u.get(i[w])===b+k;)k++;if(k>b-g){let Q=r(i[c],0);for(;g<b;)s.insertBefore(r(a[g++],1),Q)}else s.replaceChild(r(a[g++],1),r(i[c++],-1))}else c++}else s.removeChild(r(i[c++],-1))}return a})(e.parentNode,o,t,Z,e);switch(o.length){case 1:o[0].remove();case 0:break;default:ht(Z(o[0],0),Z(o.at(-1),-0),!1)}return S},Vt=new Map([["aria",(e,t)=>{for(let o in t){let n=t[o],s=o==="role"?o:`aria-${o}`;n==null?D(e,s):dt(e,s,n)}return t}],["class",(e,t)=>et(e,t,t==null?"class":"className")],["data",(e,t)=>{let{dataset:o}=e;for(let n in t)t[n]==null?delete o[n]:o[n]=t[n];return t}],["ref",gt],["style",(e,t)=>t==null?et(e,t,"style"):I(e.style,t,"cssText")]]),zt=(e,t,o)=>{switch(t[0]){case".":return Tt;case"?":return Nt;case"@":return Ot;default:return o||"ownerSVGElement"in e?t==="ref"?gt:q:Vt.get(t)||(t in e?t.startsWith("on")?I:((n,s)=>{let i;do i=jt(n,s);while(!i&&(n=Rt(n)));return i})(e,t)?.set?et:q:q)}},Lt=(e,t)=>(e.textContent=t??"",t),T=(e,t,o)=>({a:e,b:t,c:o}),M=()=>T(null,null,S),pt=e=>(t,o)=>{let{a:n,b:s,c:i}=e(t,o),a=document.importNode(n,!0),r=S;if(s!==S){r=[];for(let c,g,u=0;u<s.length;u++){let{a:b,b:w,c:k}=s[u],Q=b===g?c:c=Mt(a,g=b);r[u]=(d=w,p=Q,l=k,h=w===B?[]:w===V?M():null,{v:S,u:d,t:p,n:l,c:h})}}var d,p,l,h;return((c,g)=>({b:c,c:g}))(i?a.firstChild:new tt(a),r)},Ht=/^(?:plaintext|script|style|textarea|title|xmp)$/i,Bt=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,Dt=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,It=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,Pt=/[\x01\x02]/g,J,K,H=document.createElement("template"),Ut=(e,t)=>{if(t)return J||(J=document.createElementNS("http://www.w3.org/2000/svg","svg"),K=lt(),K.selectNodeContents(J)),K.createContextualFragment(e);H.innerHTML=e;let{content:o}=H;return H=H.cloneNode(!1),o},X=e=>{let t=[],o;for(;o=e.parentNode;)t.push(t.indexOf.call(o.childNodes,e)),e=o;return t},st=()=>document.createTextNode(""),Ft=(e,t,o)=>{let n=Ut(((d,p,l)=>{let h=0;return d.join("").trim().replace(Dt,(c,g,u,b)=>`<${g}${u.replace(It,"=$2$1").trimEnd()}${b?l||Bt.test(g)?" /":`></${g}`:""}>`).replace(Pt,c=>c===""?`<!--${p+h++}-->`:p+h++)})(e,O,o),o),{length:s}=e,i=S;if(s>1){let d=[],p=document.createTreeWalker(n,129),l=0,h=`${O}${l++}`;for(i=[];l<s;){let c=p.nextNode();if(c.nodeType===8){if(c.data===h){let g=at(t[l-1])?B:V;g===V&&d.push(c),i.push(T(X(c),g,null)),h=`${O}${l++}`}}else{let g;for(;c.hasAttribute(h);){g||(g=X(c));let u=c.getAttribute(h);i.push(T(g,zt(c,u,o),u)),D(c,h),h=`${O}${l++}`}!o&&Ht.test(c.localName)&&c.textContent.trim()===`<!--${h}-->`&&(i.push(T(g||X(c),Lt,null)),h=`${O}${l++}`)}}for(l=0;l<d.length;l++)d[l].replaceWith(st())}let{childNodes:a}=n,{length:r}=a;return r<1?(r=1,n.appendChild(st())):r===1&&s!==1&&a[0].nodeType!==1&&(r=0),N(ut,e,T(n,i,r===1))},ut=new WeakMap,O="is\xB5",ft=e=>(t,o)=>ut.get(t)||Ft(t,o,e),Gt=pt(ft(!1)),Qt=pt(ft(!0)),ot=(e,{s:t,t:o,v:n})=>{if(e.a!==o){let{b:s,c:i}=(t?Qt:Gt)(o,n);e.a=o,e.b=s,e.c=i}for(let{c:s}=e,i=0;i<s.length;i++){let a=n[i],r=s[i];switch(r.u){case B:r.v=B(r.t,Zt(r.c,a),r.v);break;case V:let d=a instanceof _?ot(r.c||(r.c=M()),a):(r.c=null,a);d!==r.v&&(r.v=V(r,d));break;default:a!==r.v&&(r.v=r.u(r.t,a,r.n,r.v))}}return e.b},Zt=(e,t)=>{let o=0,{length:n}=t;for(n<e.length&&e.splice(n);o<n;o++){let s=t[o];s instanceof _?t[o]=ot(e[o]||(e[o]=M()),s):e[o]=null}return t},_=class{constructor(t,o,n){this.s=t,this.t=o,this.v=n}toDOM(t=M()){return ot(t,this)}};var mt=e=>(t,...o)=>new _(e,t,o),A=mt(!1),ce=mt(!0),nt=new WeakMap,R=(e,t)=>((o,n)=>{let s=nt.get(o)||N(nt,o,M()),{b:i}=s,a=typeof n=="function"?n():n,r=a instanceof _?a.toDOM(s):a;return i!==r&&o.replaceChildren((s.b=r).valueOf()),o})(e,t),it=new WeakMap,bt=e=>(t,o)=>{let n=it.get(t)||N(it,t,new Map);return n.get(o)||N(n,o,function(s,...i){return new _(e,s,i).toDOM(this)}.bind(M()))},de=bt(!1),ge=bt(!0);function m(e,...t){let o="";return e.forEach((n,s)=>{o+=n+(t[s]||"")}),o}var vt={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)"},y=(e,t,o={})=>{let n="";for(let[s,i]of Object.entries(vt)){s!=="default"&&(n+=`${i} {`);for(let[a,r]of Object.entries(t)){let d=o[a]?` ${o[a]} `:" ";for(let[p,l]of Object.entries(r)){let h=e[a],c=l.startsWith("--")?`var(${l})`:l,g=s==="default"?a:`${s}-${a}`,u=s==="default"?`h-${a}`:`${s}-h-${a}`;if(h){let w=h.split(" ").map(k=>`${k}: ${c};`).join(" ");n+=`
|
2
|
+
:host([${g}="${p}"])${d}{
|
3
3
|
${w}
|
4
4
|
}
|
5
|
-
:host([${u}="${p}"]:hover)${
|
5
|
+
:host([${u}="${p}"]:hover)${d}{
|
6
6
|
${w}
|
7
7
|
}
|
8
8
|
`}else n+=`
|
9
|
-
:host([${
|
9
|
+
:host([${g}="${p}"])${d}{
|
10
10
|
${l}
|
11
11
|
}
|
12
|
-
:host([${u}="${p}"]:hover)${
|
12
|
+
:host([${u}="${p}"]:hover)${d}{
|
13
13
|
${l}
|
14
14
|
}
|
15
15
|
`}}s!=="default"&&(n+="}")}return n};function qt(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var Jt=e=>/%$/.test(e),v=e=>{if(e!==void 0)return Jt(e)?e:qt(e)?`${e}px`:e},f={xs:"--spacing-xs",s:"--spacing-s",m:"--spacing-m",l:"--spacing-l",xl:"--spacing-xl"};function W(e){let t="";for(let[o,n]of Object.entries(vt)){o!=="default"&&(t+=`${n} {
|
@@ -362,9 +362,6 @@ var rettangoli=(()=>{var{isArray:at}=Array,{getPrototypeOf:Rt,getOwnPropertyDesc
|
|
362
362
|
slot {
|
363
363
|
display: contents;
|
364
364
|
}
|
365
|
-
:host([hidden]) {
|
366
|
-
display: none;
|
367
|
-
}
|
368
365
|
:host {
|
369
366
|
display: flex;
|
370
367
|
align-self: auto;
|
@@ -383,7 +380,7 @@ var rettangoli=(()=>{var{isArray:at}=Array,{getPrototypeOf:Rt,getOwnPropertyDesc
|
|
383
380
|
${C}
|
384
381
|
${x}
|
385
382
|
${E}
|
386
|
-
`),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","wh","w","h","hidden","s-w","s-h","s-d"]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};attributeChangedCallback(s,i,a){["default","sm","md","lg","xl"].forEach(r=>{let
|
383
|
+
`),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","wh","w","h","hidden","s-w","s-h","s-d"]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};attributeChangedCallback(s,i,a){["default","sm","md","lg","xl"].forEach(r=>{let d=u=>`${r==="default"?"":`${r}-`}${u}`,p=this.getAttribute(d("wh")),l=v(p===null?this.getAttribute(d("w")):p),h=v(p===null?this.getAttribute(d("h")):p),c=this.getAttribute(d("o")),g=this.getAttribute(d("z"));g!==null&&(this._styles[r]["z-index"]=g),c!==null&&(this._styles[r].opacity=c),l==="f"?this._styles[r].width="100%":l!==void 0&&(this._styles[r].width=l,this._styles[r]["min-width"]=l,this._styles[r]["max-width"]=l),h==="f"?this._styles[r].height="100%":h!==void 0&&(this._styles[r].height=h,this._styles[r]["min-height"]=h,this._styles[r]["max-height"]=h),this.hasAttribute(d("hidden"))&&(this._styles[r].display="none !important"),this.hasAttribute(d("visible"))&&(this._styles[r].display="flex !important")}),e(this.shadow,this.render)}render=()=>t`
|
387
384
|
<style>
|
388
385
|
${W(this._styles)}
|
389
386
|
</style>
|
@@ -457,7 +454,7 @@ var rettangoli=(()=>{var{isArray:at}=Array,{getPrototypeOf:Rt,getOwnPropertyDesc
|
|
457
454
|
${F}
|
458
455
|
${C}
|
459
456
|
${x}
|
460
|
-
`);class n extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[o]}static get observedAttributes(){return["key","w","ellipsis"]}connectedCallback(){e(this.shadow,this.render)}attributeChangedCallback(i,a,r){let
|
457
|
+
`);class n extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[o]}static get observedAttributes(){return["key","w","ellipsis"]}connectedCallback(){e(this.shadow,this.render)}attributeChangedCallback(i,a,r){let d=v(this.getAttribute("w"));this.hasAttribute("ellipsis")&&(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"),d==="f"?this.style.width="100%":d!==void 0&&(this.style.width=d),e(this.shadow,this.render)}render=()=>t` <slot></slot> `}return n};var Ct=({render:e,html:t})=>{let o=new CSSStyleSheet;return o.replaceSync(m`
|
461
458
|
:host {
|
462
459
|
border-style: solid;
|
463
460
|
box-sizing: border-box;
|
@@ -483,7 +480,7 @@ ${x}
|
|
483
480
|
${E}
|
484
481
|
${C}
|
485
482
|
${x}
|
486
|
-
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[o]}_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(){e(this.shadow,this.render)}attributeChangedCallback(s,i,a){["default","sm","md","lg","xl"].forEach(r=>{let
|
483
|
+
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[o]}_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(){e(this.shadow,this.render)}attributeChangedCallback(s,i,a){["default","sm","md","lg","xl"].forEach(r=>{let d=u=>`${r==="default"?"":`${r}-`}${u}`,p=this.getAttribute(d("wh")),l=v(p===null?this.getAttribute(d("w")):p),h=v(p===null?this.getAttribute(d("h")):p),c=this.getAttribute(d("o")),g=this.getAttribute(d("z"));g!==null&&(this._styles[r].zIndex=g),c!==null&&(this._styles[r].opacity=c),l==="f"?this._styles[r].width="100%":l!==void 0&&(this._styles[r].width=l,this._styles[r]["min-width"]=l,this._styles[r]["max-width"]=l),h==="f"?this._styles[r].height="100%":h!==void 0&&(this._styles[r].height=h,this._styles[r]["min-height"]=h,this._styles[r]["max-height"]=h)}),e(this.shadow,this.render)}render=()=>t`
|
487
484
|
<style>
|
488
485
|
${W(this._styles)}
|
489
486
|
</style>
|
@@ -613,7 +610,7 @@ ${x}
|
|
613
610
|
${kt}
|
614
611
|
${$}
|
615
612
|
${x}
|
616
|
-
`),class G extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[o]}static _icons={};static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return G._icons}static addIcon(s,i){G._icons[s]=i}connectedCallback(){this.render()}attributeChangedCallback(s,i,a){let r=this.getAttribute("wh"),
|
613
|
+
`),class G extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[o]}static _icons={};static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return G._icons}static addIcon(s,i){G._icons[s]=i}connectedCallback(){this.render()}attributeChangedCallback(s,i,a){let r=this.getAttribute("wh"),d=v(r===null?this.getAttribute("w"):r),p=v(r===null?this.getAttribute("h"):r);d&&(this.style.width=d),p&&(this.style.height=p),this.render()}render=()=>{try{let s=this.getAttribute("svg"),i=G._icons[s]||(window.rtglIcons||{})[s];if(i){this.shadow.innerHTML=i;return}}catch(s){console.log("error in rtgl-svg render",s)}this.shadow.innerHTML=""}}};var At=({render:e,html:t})=>{let o=new CSSStyleSheet;return o.replaceSync(m`
|
617
614
|
slot {
|
618
615
|
display: contents;
|
619
616
|
}
|
@@ -638,7 +635,7 @@ ${x}
|
|
638
635
|
${C}
|
639
636
|
${x}
|
640
637
|
${E}
|
641
|
-
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[o]}connectedCallback(){e(this.shadow,this.render)}static get observedAttributes(){return["key","wh","w","h","hidden","s-w","s-h","s-d"]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};attributeChangedCallback(s,i,a){["default","sm","md","lg","xl"].forEach(r=>{let
|
638
|
+
`),class extends HTMLElement{constructor(){super(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[o]}connectedCallback(){e(this.shadow,this.render)}static get observedAttributes(){return["key","wh","w","h","hidden","s-w","s-h","s-d"]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};attributeChangedCallback(s,i,a){["default","sm","md","lg","xl"].forEach(r=>{let d=u=>`${r==="default"?"":`${r}-`}${u}`,p=this.getAttribute(d("wh")),l=v(p===null?this.getAttribute(d("w")):p),h=v(p===null?this.getAttribute(d("h")):p),c=this.getAttribute(d("o")),g=this.getAttribute(d("z"));g!==null&&(this._styles[r]["z-index"]=g),c!==null&&(this._styles[r].opacity=c),l==="f"?this._styles[r].width="100%":l!==void 0&&(this._styles[r].width=l,this._styles[r]["min-width"]=l,this._styles[r]["max-width"]=l),h==="f"?this._styles[r].height="100%":h!==void 0&&(this._styles[r].height=h,this._styles[r]["min-height"]=h,this._styles[r]["max-height"]=h),this.hasAttribute("hidden")&&(this._styles[r].display="none")}),setTimeout(()=>{e(this.shadow,this.render)},0)}render=()=>t`
|
642
639
|
<style>
|
643
640
|
${W(this._styles)}
|
644
641
|
</style>
|
package/package.json
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"name": "rettangoli-ui",
|
3
|
-
"version": "0.0.10-
|
3
|
+
"version": "0.0.10-rc4",
|
4
4
|
"description": "A UI component library for building web interfaces.",
|
5
|
-
"main": "
|
5
|
+
"main": "dist/rettangoli-esm.min.js",
|
6
6
|
"type": "module",
|
7
7
|
"files": [
|
8
8
|
"dist"
|