@rettangoli/ui 1.0.4 → 1.0.5
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/dist/rettangoli-iife-layout.min.js +198 -43
- package/dist/rettangoli-iife-ui.min.js +198 -43
- package/dist/themes/theme-catppuccin.css +1 -0
- package/dist/themes/theme-rtgl-mono.css +1 -0
- package/dist/themes/theme-rtgl-slate.css +1 -0
- package/package.json +1 -1
- package/src/entry-iife-layout.js +2 -0
- package/src/entry-iife-ui.js +2 -0
- package/src/index.js +2 -0
- package/src/primitives/tag.js +272 -0
- package/src/styles/tagSurfaceStyles.js +71 -0
- package/src/styles/textColorStylesForTarget.js +22 -0
- package/src/themes/theme-catppuccin.css +1 -0
- package/src/themes/theme-rtgl-mono.css +1 -0
- package/src/themes/theme-rtgl-slate.css +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var rettangoli=(()=>{var
|
|
1
|
+
var rettangoli=(()=>{var B=`
|
|
2
2
|
:host([href]) {
|
|
3
3
|
cursor: pointer;
|
|
4
4
|
position: relative;
|
|
@@ -12,12 +12,12 @@ var rettangoli=(()=>{var O=`
|
|
|
12
12
|
bottom: 0;
|
|
13
13
|
z-index: 1;
|
|
14
14
|
}
|
|
15
|
-
`,
|
|
15
|
+
`,O=({linkElement:i,href:t,newTab:e,rel:s})=>{i.href=t,e?i.target="_blank":i.removeAttribute("target"),s!=null?i.rel=s:e?i.rel="noopener noreferrer":i.removeAttribute("rel")},W=({shadowRoot:i,slotElement:t,linkElement:e,href:s,newTab:r,rel:n})=>{if(t.parentNode!==i&&i.appendChild(t),!s)return e&&e.parentNode===i&&i.removeChild(e),null;let o=e||document.createElement("a");return O({linkElement:o,href:s,newTab:r,rel:n}),o.parentNode!==i&&i.appendChild(o),o},H=({shadowRoot:i,childElement:t,linkElement:e,href:s,newTab:r,rel:n})=>{if(!s)return e?(t.parentNode===e&&i.appendChild(t),e.parentNode===i&&i.removeChild(e),null):(t.parentNode!==i&&i.appendChild(t),null);let o=e||document.createElement("a");return O({linkElement:o,href:s,newTab:r,rel:n}),t.parentNode!==o&&o.appendChild(t),o.parentNode!==i&&i.appendChild(o),o};var w=["default","sm","md","lg","xl"],b=()=>w.reduce((i,t)=>(i[t]={},i),{}),ut=["sm","md","lg","xl"],jt=({size:i,attr:t})=>i==="default"?t:`${i}-${t}`,Vt=({size:i,includeDefault:t=!0})=>{if(i==="default")return["default"];let e=ut.indexOf(i);if(e===-1)return t?["default"]:[];let s=ut.slice(e);return t&&s.push("default"),s},q=({element:i,size:t,attr:e,includeDefault:s=!0})=>{let r=Vt({size:t,includeDefault:s});for(let n of r){let o=jt({size:n,attr:e}),l=i.getAttribute(o);if(l!==null)return l}return null};var Pt=/^([1-9]|1[0-2])fg$/,Ht=/^([1-9]\d*)\/([1-9]\d*)fb$/,G=i=>typeof i=="string"&&Pt.test(i),ct=i=>{if(typeof i!="string")return null;let t=i.match(Ht);if(!t)return null;let e=Number(t[1]),s=Number(t[2]);return!Number.isInteger(e)||!Number.isInteger(s)||s<=0||e>s?null:{numerator:e,denominator:s}};function pt({numerator:i,denominator:t,gapVar:e}){return i===t?"100%":i===1?`calc((100% - ((${t} - 1) * ${e})) / ${t})`:`calc(((100% - ((${t} - 1) * ${e})) * ${i}) / ${t})`}var v=({styleBucket:i,axis:t,dimension:e,fillValue:s,allowFlexGrow:r=!1,flexMinDimension:n="0",lockBounds:o=!0})=>{let l=()=>{!r||t!=="width"||(i["flex-grow"]="0",i["flex-shrink"]="1",i["flex-basis"]="auto")},a=()=>{i[`min-${t}`]="unset",i[`max-${t}`]="unset"};if(e===void 0)return;if(e==="f"){l(),i[t]=s,a();return}if(r&&G(e)){i["flex-grow"]=e.slice(0,-2),i["flex-basis"]="0%",i[`min-${t}`]=n,i[`max-${t}`]="unset";return}let h=r?ct(e):null;if(h){i["flex-grow"]="0",i["flex-shrink"]="0",i["flex-basis"]=pt({...h,gapVar:"var(--rtgl-flex-gap, 0px)"}),i[`min-${t}`]=n,i[`max-${t}`]="unset";return}l(),i[t]=e,o&&(i[`min-${t}`]=e,i[`max-${t}`]=e)},R=({style:i,width:t,fillValue:e="var(--width-stretch)",allowFlexGrow:s=!0,flexMinWidth:r="0"})=>{if(t==="f"){i.width=e,i.flexGrow="",i.flexBasis="",i.minWidth="";return}if(s&&G(t)){i.width="",i.flexGrow=t.slice(0,-2),i.flexShrink="",i.flexBasis="0%",i.minWidth=r;return}let n=s?ct(t):null;if(n){i.width="",i.flexGrow="0",i.flexShrink="0",i.flexBasis=pt({...n,gapVar:"var(--rtgl-flex-gap, 0px)"}),i.minWidth=r;return}if(t!=null){i.width=t,i.flexGrow="",i.flexShrink="",i.flexBasis="",i.minWidth="";return}i.width="",i.flexGrow="",i.flexShrink="",i.flexBasis="",i.minWidth=""};function u(i,...t){let e="";return i.forEach((s,r)=>{e+=s+(t[r]||"")}),e}var qt=["sm","md","lg","xl"],mt={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 --rtgl-flex-gap",gv:"row-gap --rtgl-flex-gap",gh:"column-gap --rtgl-flex-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",cur:"cursor"},A=Object.keys(mt),_=i=>i.concat(qt.flatMap(t=>i.map(e=>`${t}-${e}`))),gt={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)"},m=(i,t={},e=null)=>{let s="";for(let[r,n]of Object.entries(gt)){r!=="default"&&(s+=`${n} {`);for(let[o,l]of Object.entries(i))for(let[a,h]of Object.entries(l)){let f=mt[o],y=h.startsWith("--")?`var(${h})`:h,S=r==="default"?o:`${r}-${o}`,F=r==="default"?`h-${o}`:`${r}-h-${o}`,C=($,z=!1)=>{let E=z?`:host([${$}="${a}"]:hover)`:`:host([${$}="${a}"])`;if(e)return e.split(",").map(P=>`${E} ${P.trim()}`).join(", ");let I=t[o];return I?`${E} ${I}`:E};if(f){let z=f.split(" ").map(E=>`${E}: ${y};`).join(" ");s+=`
|
|
16
16
|
${C(S)}{
|
|
17
|
-
${
|
|
17
|
+
${z}
|
|
18
18
|
}
|
|
19
19
|
${C(F,!0)}{
|
|
20
|
-
${
|
|
20
|
+
${z}
|
|
21
21
|
}
|
|
22
22
|
`}else s+=`
|
|
23
23
|
${C(S)}{
|
|
@@ -26,13 +26,13 @@ var rettangoli=(()=>{var O=`
|
|
|
26
26
|
${C(F,!0)}{
|
|
27
27
|
${h}
|
|
28
28
|
}
|
|
29
|
-
`}
|
|
30
|
-
`);let o="";for(let[l,a]of Object.entries(i[
|
|
29
|
+
`}r!=="default"&&(s+="}")}return s};function Gt(i){if(i===null||i.includes("/"))return!1;let t=String(i);return/[0-9]$/.test(t)}var Ut=i=>/%$/.test(i),Kt=i=>/^([1-9]|1[0-2])fg$/.test(i),c=i=>{if(i!=null)return Kt(i)||Ut(i)?i:Gt(i)?`${i}px`:Object.keys(d).includes(i)?`var(${d[i]})`:i},d={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function x(i,t=":host"){let e="",s=["default","xl","lg","md","sm"];for(let r of s){let n=gt[r];if(!i[r]||Object.keys(i[r]).length===0)continue;r!=="default"&&(e+=`${n} {
|
|
30
|
+
`);let o="";for(let[l,a]of Object.entries(i[r]))a!=null&&(o+=`${l}: ${a} !important;
|
|
31
31
|
`);e+=`${t} {
|
|
32
32
|
${o.trim()}
|
|
33
33
|
}
|
|
34
|
-
`,
|
|
35
|
-
`)}return e}var
|
|
34
|
+
`,r!=="default"&&(e+=`}
|
|
35
|
+
`)}return e}var Xt={mt:d,mr:d,mb:d,ml:d,m:d,mh:d,mv:d,s:{sm:`
|
|
36
36
|
height: 28px;
|
|
37
37
|
padding-left: 12px;
|
|
38
38
|
padding-right: 12px;
|
|
@@ -81,7 +81,7 @@ var rettangoli=(()=>{var O=`
|
|
|
81
81
|
`,lk:`
|
|
82
82
|
background-color: transparent;
|
|
83
83
|
color: var(--foreground);
|
|
84
|
-
`}},
|
|
84
|
+
`}},ft=m(Xt,{},".surface");var Yt=[{prefix:"sm",maxWidth:640},{prefix:"md",maxWidth:768},{prefix:"lg",maxWidth:1024},{prefix:"xl",maxWidth:1280}],U=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
85
85
|
:host {
|
|
86
86
|
display: inline-flex;
|
|
87
87
|
}
|
|
@@ -248,8 +248,8 @@ var rettangoli=(()=>{var O=`
|
|
|
248
248
|
color: inherit;
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
${
|
|
252
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._containerElement=null,this._surfaceElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._prefixIcon=null,this._suffixIcon=null,this._surfaceElement.className="surface",this._surfaceElement.appendChild(this._slotElement),this._onWindowResize=this._onWindowResize.bind(this)}static get observedAttributes(){return["key","href","new-tab","rel","w","pre","suf","disabled","v","s","sq","sm-s","md-s","lg-s","xl-s"]}connectedCallback(){window.addEventListener("resize",this._onWindowResize),this._updateButton()}disconnectedCallback(){window.removeEventListener("resize",this._onWindowResize)}attributeChangedCallback(t,e,s){this._updateButton()}_onWindowResize(){(this.hasAttribute("sm-s")||this.hasAttribute("md-s")||this.hasAttribute("lg-s")||this.hasAttribute("xl-s"))&&this._updateIcon()}_resolveResponsiveSizeToken(){let t=window.innerWidth;for(let{prefix:e,maxWidth:s}of
|
|
251
|
+
${ft}
|
|
252
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._containerElement=null,this._surfaceElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._prefixIcon=null,this._suffixIcon=null,this._surfaceElement.className="surface",this._surfaceElement.appendChild(this._slotElement),this._onWindowResize=this._onWindowResize.bind(this)}static get observedAttributes(){return["key","href","new-tab","rel","w","pre","suf","disabled","v","s","sq","sm-s","md-s","lg-s","xl-s"]}connectedCallback(){window.addEventListener("resize",this._onWindowResize),this._updateButton()}disconnectedCallback(){window.removeEventListener("resize",this._onWindowResize)}attributeChangedCallback(t,e,s){this._updateButton()}_onWindowResize(){(this.hasAttribute("sm-s")||this.hasAttribute("md-s")||this.hasAttribute("lg-s")||this.hasAttribute("xl-s"))&&this._updateIcon()}_resolveResponsiveSizeToken(){let t=window.innerWidth;for(let{prefix:e,maxWidth:s}of Yt){let r=`${e}-s`;if(t<=s&&this.hasAttribute(r))return this.getAttribute(r)}return this.getAttribute("s")}_updateButton(){this.shadow.innerHTML="";let t=this.hasAttribute("disabled"),e=this.getAttribute("href"),s=this.hasAttribute("new-tab"),r=this.getAttribute("rel"),n=e&&!t,o=n?"a":"button";if(this._surfaceElement.tagName.toLowerCase()!==o){let l=document.createElement(o);l.className="surface",l.appendChild(this._slotElement),this._surfaceElement=l}this._updateIcon(),this.hasAttribute("sq")?(this.style.width="",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):this._updateWidth(),n?(O({linkElement:this._surfaceElement,href:e,newTab:s,rel:r}),this._surfaceElement.removeAttribute("disabled")):(this._surfaceElement.removeAttribute("href"),this._surfaceElement.removeAttribute("target"),this._surfaceElement.removeAttribute("rel"),t?this._surfaceElement.setAttribute("disabled",""):this._surfaceElement.removeAttribute("disabled")),this.shadow.appendChild(this._surfaceElement),this._containerElement=this._surfaceElement}_updateIcon(){this._prefixIcon&&(this._prefixIcon.remove(),this._prefixIcon=null),this._suffixIcon&&(this._suffixIcon.remove(),this._suffixIcon=null);let t={sm:14,md:18,lg:22},e=this._resolveResponsiveSizeToken(),s=18;this.hasAttribute("sq")?s={sm:14,lg:22}[e]||18:s=t[e]||18;let r=this.getAttribute("pre");r&&(this._prefixIcon=document.createElement("rtgl-svg"),this._prefixIcon.setAttribute("svg",r),this._prefixIcon.setAttribute("wh",s.toString()),this._prefixIcon.style.color="inherit",this._surfaceElement.insertBefore(this._prefixIcon,this._slotElement));let n=this.getAttribute("suf");n&&(this._suffixIcon=document.createElement("rtgl-svg"),this._suffixIcon.setAttribute("svg",n),this._suffixIcon.setAttribute("wh",s.toString()),this._suffixIcon.style.color="inherit",this._surfaceElement.appendChild(this._suffixIcon))}_updateWidth(){let t=c(this.getAttribute("w"));t==="f"?(this.style.width="var(--width-stretch)",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):t!=null?(this.style.width=t,this.style.minWidth=t,this.style.maxWidth=t,this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):(this.style.width="",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth="")}getBoundingClientRect(){return this._surfaceElement?this._surfaceElement.getBoundingClientRect():super.getBoundingClientRect()}},bt=({render:i,html:t})=>U;var vt=u`
|
|
253
253
|
|
|
254
254
|
:host([d="h"]) {
|
|
255
255
|
flex-direction: row;
|
|
@@ -320,7 +320,7 @@ var rettangoli=(()=>{var O=`
|
|
|
320
320
|
justify-content: center;
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
-
`;var
|
|
323
|
+
`;var Qt={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out"}},p=m(Qt);var yt=u`
|
|
324
324
|
:host([sh]:not([sv])) {
|
|
325
325
|
overflow-x: scroll;
|
|
326
326
|
flex-wrap: nowrap;
|
|
@@ -367,7 +367,7 @@ var rettangoli=(()=>{var O=`
|
|
|
367
367
|
flex-wrap: nowrap;
|
|
368
368
|
}
|
|
369
369
|
|
|
370
|
-
`;var
|
|
370
|
+
`;var L={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},Jt={bgc:{pr:`
|
|
371
371
|
background-color: var(--primary);
|
|
372
372
|
`,se:`
|
|
373
373
|
background-color: var(--secondary);
|
|
@@ -407,7 +407,7 @@ var rettangoli=(()=>{var O=`
|
|
|
407
407
|
left: 0;
|
|
408
408
|
top: 0;
|
|
409
409
|
height: 100%;
|
|
410
|
-
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:d,pr:d,pb:d,pl:d,p:d,ph:d,pv:d,g:d,gv:d,gh:d,bw:
|
|
410
|
+
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:d,pr:d,pb:d,pl:d,p:d,ph:d,pv:d,g:d,gv:d,gh:d,bw:L,bwt:L,bwr:L,bwb:L,bwl:L,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},_t=m(Jt);var Zt={mt:d,mr:d,mb:d,ml:d,m:d,mh:d,mv:d},g=m(Zt);var j=u`
|
|
411
411
|
a, a:link, a:visited, a:hover, a:active {
|
|
412
412
|
color: inherit;
|
|
413
413
|
text-decoration: none;
|
|
@@ -433,14 +433,14 @@ var rettangoli=(()=>{var O=`
|
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
|
|
436
|
+
${yt}
|
|
436
437
|
${vt}
|
|
437
|
-
${
|
|
438
|
-
${v}
|
|
438
|
+
${g}
|
|
439
439
|
${p}
|
|
440
|
-
${
|
|
441
|
-
${
|
|
442
|
-
${
|
|
443
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",..._([...A,"op","wh","w","h","hide","show","sh","sv","z","d","ah","av","wrap","no-wrap","overflow"])]}_styles=
|
|
440
|
+
${_t}
|
|
441
|
+
${j}
|
|
442
|
+
${B}
|
|
443
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",..._([...A,"op","wh","w","h","hide","show","sh","sv","z","d","ah","av","wrap","no-wrap","overflow"])]}_styles=b();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=W({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=b(),w.forEach(e=>{let s=dt=>`${e==="default"?"":`${e}-`}${dt}`,r=this.getAttribute(s("wh")),n=c(r===null?this.getAttribute(s("w")):r),o=c(r===null?this.getAttribute(s("h")):r),l=this.getAttribute(s("op")),a=this.getAttribute(s("z"));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),v({styleBucket:this._styles[e],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),v({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="flex");let h=this.getAttribute(s("d")),f=this.getAttribute(s("ah")),y=this.getAttribute(s("av")),S=q({element:this,size:e,attr:"d"});h==="h"?this._styles[e]["flex-direction"]="row":h==="v"?this._styles[e]["flex-direction"]="column":e==="default"&&!h&&["sm","md","lg","xl"].some(Ft=>this.hasAttribute(`${Ft}-d`))&&(this._styles[e]["flex-direction"]="column");let F=S==="h",C=S==="v"||!S;F&&(f==="c"?this._styles[e]["justify-content"]="center":f==="e"?this._styles[e]["justify-content"]="flex-end":f==="s"&&(this._styles[e]["justify-content"]="flex-start"),y==="c"?(this._styles[e]["align-items"]="center",this._styles[e]["align-content"]="center"):y==="e"?(this._styles[e]["align-items"]="flex-end",this._styles[e]["align-content"]="flex-end"):y==="s"&&(this._styles[e]["align-items"]="flex-start")),C&&(f!==null||y!==null)&&(f==="c"?this._styles[e]["align-items"]="center":f==="e"?this._styles[e]["align-items"]="flex-end":f==="s"&&(this._styles[e]["align-items"]="flex-start"),y==="c"?this._styles[e]["justify-content"]="center":y==="e"?this._styles[e]["justify-content"]="flex-end":y==="s"&&(this._styles[e]["justify-content"]="flex-start"));let $=this.hasAttribute(s("wrap")),z=this.hasAttribute(s("no-wrap"));$&&(this._styles[e]["flex-wrap"]="wrap"),z&&(this._styles[e]["flex-wrap"]="nowrap");let E=this.hasAttribute(s("sh")),I=this.hasAttribute(s("sv")),P=this.getAttribute(s("overflow"));E&&I?(this._styles[e].overflow="scroll",this._styles[e]["flex-wrap"]="nowrap"):E?(this._styles[e]["overflow-x"]="scroll",this._styles[e]["flex-wrap"]="nowrap"):I&&(this._styles[e]["overflow-y"]="scroll",this._styles[e]["flex-wrap"]="nowrap"),P==="hidden"&&(this._styles[e].overflow="hidden",this._styles[e]["flex-wrap"]="nowrap")});let t=x(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,e,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}e!==s&&this.updateStyles()}},xt=({render:i,html:t})=>K;var te={ta:{s:"text-align: start;",c:"text-align: center;",e:"text-align: end;",j:"text-align: justify;"},s:{h1:`
|
|
444
444
|
font-size: var(--h1-font-size);
|
|
445
445
|
font-weight: var(--h1-font-weight);
|
|
446
446
|
line-height: var(--h1-line-height);
|
|
@@ -480,7 +480,7 @@ var rettangoli=(()=>{var O=`
|
|
|
480
480
|
font-weight: var(--xs-font-weight);
|
|
481
481
|
line-height: var(--xs-line-height);
|
|
482
482
|
letter-spacing: var(--xs-letter-spacing);
|
|
483
|
-
`}},wt=
|
|
483
|
+
`}},wt=m(te);var ee={c:{pr:"color: var(--primary);",se:"color: var(--secondary);",de:"color: var(--destructive);",fg:"color: var(--foreground);",bg:"color: var(--background);",mu:"color: var(--muted-foreground);",ac:"color: var(--accent);",bo:"color: var(--border);",tr:"color: transparent;","pr-fg":"color: var(--primary-foreground);","se-fg":"color: var(--secondary-foreground);","de-fg":"color: var(--destructive-foreground);","mu-fg":"color: var(--muted-foreground);","ac-fg":"color: var(--accent-foreground);"}},V=m(ee);var X=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
484
484
|
:host {
|
|
485
485
|
display: block;
|
|
486
486
|
font-size: var(--md-font-size);
|
|
@@ -499,12 +499,12 @@ var rettangoli=(()=>{var O=`
|
|
|
499
499
|
text-decoration: var(--anchor-text-decoration-hover);
|
|
500
500
|
color: var(--anchor-color-hover);
|
|
501
501
|
}
|
|
502
|
-
${
|
|
502
|
+
${B}
|
|
503
503
|
${wt}
|
|
504
504
|
${V}
|
|
505
|
-
${
|
|
505
|
+
${g}
|
|
506
506
|
${p}
|
|
507
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","new-tab","rel"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,e,s){t==="href"||t==="new-tab"||t==="rel"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=c(this.getAttribute("w"));this.hasAttribute("ellipsis")?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace=""),
|
|
507
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","new-tab","rel"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,e,s){t==="href"||t==="new-tab"||t==="rel"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=c(this.getAttribute("w"));this.hasAttribute("ellipsis")?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace=""),R({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=W({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}},St=({render:i,html:t})=>X;var M={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},ie={bgc:{pr:"background-color: var(--primary);",se:"background-color: var(--secondary);",de:"background-color: var(--destructive);",fg:"background-color: var(--foreground);",bg:"background-color: var(--background);",mu:"background-color: var(--muted);",ac:"background-color: var(--accent);",bo:"background-color: var(--border);"},pos:{rel:"relative",abs:"absolute",fix:"fixed"},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},bw:M,bwt:M,bwr:M,bwb:M,bwl:M,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},Et=i=>m(ie,{},i);var se={mt:d,mr:d,mb:d,ml:d,m:d,mh:d,mv:d},At=i=>m(se,{},i);var Y=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
508
508
|
:host {
|
|
509
509
|
display: contents;
|
|
510
510
|
}
|
|
@@ -531,7 +531,7 @@ var rettangoli=(()=>{var O=`
|
|
|
531
531
|
height: auto;
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
-
${
|
|
534
|
+
${j}
|
|
535
535
|
|
|
536
536
|
a {
|
|
537
537
|
display: block;
|
|
@@ -539,10 +539,165 @@ var rettangoli=(()=>{var O=`
|
|
|
539
539
|
width: 100%;
|
|
540
540
|
}
|
|
541
541
|
|
|
542
|
-
${St("img, a")}
|
|
543
542
|
${Et("img, a")}
|
|
543
|
+
${At("img, a")}
|
|
544
|
+
${p}
|
|
545
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return _([...A,"key","src","alt","href","new-tab","rel","wh","w","h","hide","show","op","z","of"])}_styles=b();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=H({shadowRoot:this.shadow,childElement:this._imgElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}connectedCallback(){this._updateImageAttributes(),this.updateStyles()}attributeChangedCallback(t,e,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}if(t==="src"||t==="alt"){this._updateImageAttributes();return}e!==s&&this.updateStyles()}updateStyles(){this._styles=b(),w.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,r=this.getAttribute(s("wh")),n=c(r===null?this.getAttribute(s("w")):r),o=c(r===null?this.getAttribute(s("h")):r),l=this.getAttribute(s("op")),a=this.getAttribute(s("z"));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),v({styleBucket:this._styles[e],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),v({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none !important"),this.hasAttribute(s("show"))&&(this._styles[e].display="block !important")});let t=x(this._styles,"img, a");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_updateImageAttributes(){let t=this.getAttribute("src"),e=this.getAttribute("alt");t!==null?this._imgElement.setAttribute("src",t):this._imgElement.removeAttribute("src"),e!==null?this._imgElement.setAttribute("alt",e):this._imgElement.removeAttribute("alt")}},kt=({render:i,html:t})=>Y;var re={s:{sm:`
|
|
546
|
+
height: 20px;
|
|
547
|
+
padding-left: 8px;
|
|
548
|
+
padding-right: 8px;
|
|
549
|
+
gap: 6px;
|
|
550
|
+
font-size: var(--xs-font-size);
|
|
551
|
+
font-weight: var(--xs-font-weight);
|
|
552
|
+
line-height: var(--xs-line-height);
|
|
553
|
+
letter-spacing: var(--xs-letter-spacing);
|
|
554
|
+
--rtgl-tag-icon-size: 10px;
|
|
555
|
+
--rtgl-tag-remove-size: 14px;
|
|
556
|
+
`,md:`
|
|
557
|
+
height: 24px;
|
|
558
|
+
padding-left: 10px;
|
|
559
|
+
padding-right: 10px;
|
|
560
|
+
gap: 6px;
|
|
561
|
+
font-size: var(--xs-font-size);
|
|
562
|
+
font-weight: var(--xs-font-weight);
|
|
563
|
+
line-height: var(--xs-line-height);
|
|
564
|
+
letter-spacing: var(--xs-letter-spacing);
|
|
565
|
+
--rtgl-tag-icon-size: 12px;
|
|
566
|
+
--rtgl-tag-remove-size: 16px;
|
|
567
|
+
`,lg:`
|
|
568
|
+
height: 28px;
|
|
569
|
+
padding-left: 12px;
|
|
570
|
+
padding-right: 12px;
|
|
571
|
+
gap: 8px;
|
|
572
|
+
font-size: var(--sm-font-size);
|
|
573
|
+
font-weight: var(--sm-font-weight);
|
|
574
|
+
line-height: var(--sm-line-height);
|
|
575
|
+
letter-spacing: var(--sm-letter-spacing);
|
|
576
|
+
--rtgl-tag-icon-size: 14px;
|
|
577
|
+
--rtgl-tag-remove-size: 18px;
|
|
578
|
+
`},v:{mu:`
|
|
579
|
+
background-color: var(--muted);
|
|
580
|
+
color: var(--muted-foreground);
|
|
581
|
+
border-color: var(--border);
|
|
582
|
+
`,pr:`
|
|
583
|
+
background-color: var(--primary);
|
|
584
|
+
color: var(--primary-foreground);
|
|
585
|
+
border-color: transparent;
|
|
586
|
+
`,se:`
|
|
587
|
+
background-color: var(--secondary);
|
|
588
|
+
color: var(--secondary-foreground);
|
|
589
|
+
border-color: transparent;
|
|
590
|
+
`,ac:`
|
|
591
|
+
background-color: var(--accent);
|
|
592
|
+
color: var(--accent-foreground);
|
|
593
|
+
border-color: transparent;
|
|
594
|
+
`,de:`
|
|
595
|
+
background-color: var(--destructive);
|
|
596
|
+
color: var(--destructive-foreground);
|
|
597
|
+
border-color: transparent;
|
|
598
|
+
`}},Ct=m(re,{},".surface");var Q=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
599
|
+
:host {
|
|
600
|
+
display: inline-flex;
|
|
601
|
+
min-width: 0;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
slot {
|
|
605
|
+
display: contents;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
.surface {
|
|
609
|
+
--rtgl-tag-icon-size: 12px;
|
|
610
|
+
--rtgl-tag-remove-size: 16px;
|
|
611
|
+
display: inline-flex;
|
|
612
|
+
align-items: center;
|
|
613
|
+
min-width: 0;
|
|
614
|
+
max-width: 100%;
|
|
615
|
+
width: 100%;
|
|
616
|
+
height: 24px;
|
|
617
|
+
padding-left: 10px;
|
|
618
|
+
padding-right: 10px;
|
|
619
|
+
gap: 6px;
|
|
620
|
+
box-sizing: border-box;
|
|
621
|
+
border: 1px solid var(--border);
|
|
622
|
+
border-radius: var(--tag-border-radius);
|
|
623
|
+
background-color: var(--muted);
|
|
624
|
+
color: var(--muted-foreground);
|
|
625
|
+
font-size: var(--xs-font-size);
|
|
626
|
+
font-weight: var(--xs-font-weight);
|
|
627
|
+
line-height: var(--xs-line-height);
|
|
628
|
+
letter-spacing: var(--xs-letter-spacing);
|
|
629
|
+
vertical-align: middle;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
.surface rtgl-svg {
|
|
633
|
+
width: var(--rtgl-tag-icon-size);
|
|
634
|
+
height: var(--rtgl-tag-icon-size);
|
|
635
|
+
color: inherit;
|
|
636
|
+
flex-shrink: 0;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
.label {
|
|
640
|
+
min-width: 0;
|
|
641
|
+
overflow: hidden;
|
|
642
|
+
text-overflow: ellipsis;
|
|
643
|
+
white-space: nowrap;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
.removeButton {
|
|
647
|
+
position: relative;
|
|
648
|
+
appearance: none;
|
|
649
|
+
display: inline-flex;
|
|
650
|
+
align-items: center;
|
|
651
|
+
justify-content: center;
|
|
652
|
+
flex-shrink: 0;
|
|
653
|
+
width: var(--rtgl-tag-remove-size);
|
|
654
|
+
height: var(--rtgl-tag-remove-size);
|
|
655
|
+
padding: 0;
|
|
656
|
+
margin: 0;
|
|
657
|
+
border: 0;
|
|
658
|
+
border-radius: var(--border-radius-f);
|
|
659
|
+
background: transparent;
|
|
660
|
+
color: inherit;
|
|
661
|
+
opacity: 0.76;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
.removeButton::before,
|
|
665
|
+
.removeButton::after {
|
|
666
|
+
content: "";
|
|
667
|
+
position: absolute;
|
|
668
|
+
width: calc(var(--rtgl-tag-icon-size) - 1px);
|
|
669
|
+
height: 1.5px;
|
|
670
|
+
border-radius: 1px;
|
|
671
|
+
background: currentColor;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
.removeButton::before {
|
|
675
|
+
transform: rotate(45deg);
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
.removeButton::after {
|
|
679
|
+
transform: rotate(-45deg);
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
.removeButton:hover {
|
|
683
|
+
cursor: pointer;
|
|
684
|
+
opacity: 1;
|
|
685
|
+
background-color: color-mix(in srgb, currentColor 12%, transparent);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
.removeButton:focus-visible {
|
|
689
|
+
outline: 2px solid color-mix(in srgb, currentColor 30%, transparent);
|
|
690
|
+
outline-offset: 1px;
|
|
691
|
+
opacity: 1;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
${Ct}
|
|
695
|
+
:host .surface {
|
|
696
|
+
border-radius: var(--tag-border-radius) !important;
|
|
697
|
+
}
|
|
698
|
+
${g}
|
|
544
699
|
${p}
|
|
545
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this.
|
|
700
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._surfaceElement=document.createElement("span"),this._surfaceElement.className="surface",this._surfaceElement.setAttribute("part","surface"),this._labelElement=document.createElement("span"),this._labelElement.className="label",this._labelElement.setAttribute("part","label"),this._slotElement=document.createElement("slot"),this._labelElement.appendChild(this._slotElement),this._surfaceElement.appendChild(this._labelElement),this.shadow.appendChild(this._surfaceElement),this._prefixIcon=null,this._suffixIcon=null,this._removeButton=null,this._onRemoveClick=this._onRemoveClick.bind(this)}static get observedAttributes(){return["key","pre","suf","removable","w"]}connectedCallback(){this._updateWidth(),this._updateStructure()}attributeChangedCallback(t,e,s){if(t==="w"){this._updateWidth();return}e!==s&&this._updateStructure()}_updateWidth(){let t=c(this.getAttribute("w"));R({style:this.style,width:t,flexMinWidth:"0"})}_createIconElement(t,e){let s=document.createElement("rtgl-svg");return s.className=t,s.setAttribute("part",e),s.setAttribute("aria-hidden","true"),s}_syncIcon({iconName:t,element:e,className:s,part:r,insertBeforeElement:n}){if(!t)return e&&e.remove(),null;let o=e||this._createIconElement(s,r);return o.setAttribute("svg",t),o.parentNode!==this._surfaceElement?this._surfaceElement.insertBefore(o,n):o.nextSibling!==n&&this._surfaceElement.insertBefore(o,n),o}_syncRemoveButton(){if(!this.hasAttribute("removable")){this._removeButton&&(this._removeButton.removeEventListener("click",this._onRemoveClick),this._removeButton.remove(),this._removeButton=null);return}this._removeButton||(this._removeButton=document.createElement("button"),this._removeButton.type="button",this._removeButton.className="removeButton",this._removeButton.setAttribute("part","remove-button"),this._removeButton.setAttribute("aria-label","Remove tag"),this._removeButton.addEventListener("click",this._onRemoveClick),this._surfaceElement.appendChild(this._removeButton))}_updateStructure(){this._prefixIcon=this._syncIcon({iconName:this.getAttribute("pre"),element:this._prefixIcon,className:"prefixIcon",part:"prefix-icon",insertBeforeElement:this._labelElement}),this._syncRemoveButton(),this._suffixIcon=this._syncIcon({iconName:this.getAttribute("suf"),element:this._suffixIcon,className:"suffixIcon",part:"suffix-icon",insertBeforeElement:this._removeButton})}_onRemoveClick(t){t.preventDefault(),t.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-click",{detail:{value:this.getAttribute("value")},bubbles:!0,composed:!0}))}},zt=({render:i,html:t})=>Q;var $t=u`
|
|
546
701
|
:host([pt="xs"]) svg {
|
|
547
702
|
padding-top: var(--spacing-xs);
|
|
548
703
|
}
|
|
@@ -658,16 +813,16 @@ var rettangoli=(()=>{var O=`
|
|
|
658
813
|
padding-top: var(--spacing-xl);
|
|
659
814
|
padding-bottom: var(--spacing-xl);
|
|
660
815
|
}
|
|
661
|
-
`;var
|
|
816
|
+
`;var J=class i extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
662
817
|
:host {
|
|
663
818
|
color: var(--foreground);
|
|
664
819
|
flex-shrink: 0;
|
|
665
820
|
}
|
|
666
821
|
${V}
|
|
667
|
-
${
|
|
668
|
-
${
|
|
822
|
+
${$t}
|
|
823
|
+
${g}
|
|
669
824
|
${p}
|
|
670
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return i._icons}static addIcon(t,e){i._icons[t]=e}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,e,s){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),e=c(t===null?this.getAttribute("w"):t),s=c(t===null?this.getAttribute("h"):t);e!=null?this.style.width=e:this.style.width="",s!=null?this.style.height=s:this.style.height=""}_render(){try{let t=this.getAttribute("svg"),e=i._icons[t]||(window.rtglIcons||{})[t];if(e){this.shadow.innerHTML=e;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},
|
|
825
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return i._icons}static addIcon(t,e){i._icons[t]=e}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,e,s){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),e=c(t===null?this.getAttribute("w"):t),s=c(t===null?this.getAttribute("h"):t);e!=null?this.style.width=e:this.style.width="",s!=null?this.style.height=s:this.style.height=""}_render(){try{let t=this.getAttribute("svg"),e=i._icons[t]||(window.rtglIcons||{})[t];if(e){this.shadow.innerHTML=e;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},It=({render:i,html:t})=>J;var ne=["mt","mr","mb","ml","m","mh","mv","cur"],Z=class i extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["type","disabled","min","max","step","s"];static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
671
826
|
:host {
|
|
672
827
|
display: contents;
|
|
673
828
|
}
|
|
@@ -729,9 +884,9 @@ var rettangoli=(()=>{var O=`
|
|
|
729
884
|
input[type="datetime-local"]::-webkit-date-and-time-value {
|
|
730
885
|
text-align: left;
|
|
731
886
|
}
|
|
732
|
-
${
|
|
887
|
+
${g}
|
|
733
888
|
${p}
|
|
734
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=
|
|
889
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=b(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","min","max","step","s",..._([...ne,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,e,s){if(e!==s){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(i.inputSpecificAttributes.includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=b(),w.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,r=this.getAttribute(s("wh")),n=c(r===null?this.getAttribute(s("w")):r),o=c(r===null?this.getAttribute(s("h")):r),l=this.getAttribute(s("op")),a=this.getAttribute(s("z"));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),v({styleBucket:this._styles[e],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),v({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="block")});let t=x(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,e){if(e==null||e==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,e)}_syncValueAttribute(){this._inputElement.value=this.getAttribute("value")??""}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("type"),s=new Set(["text","password","date","time","datetime-local"]).has(t)?t:"text",r=this.getAttribute("min"),n=this.getAttribute("max"),o=this.getAttribute("step"),l=this.hasAttribute("disabled");this._setOrRemoveInputAttribute("type",s),this._setOrRemoveInputAttribute("min",r),this._setOrRemoveInputAttribute("max",n),this._setOrRemoveInputAttribute("step",o),l?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},k=({render:i,html:t})=>Z;var oe=k({}),T="date",tt=class extends oe{connectedCallback(){this.getAttribute("type")!==T&&super.setAttribute("type",T),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,e,s){if(t==="type"&&s!==T){this.getAttribute("type")!==T&&super.setAttribute("type",T);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,e,s)}},Bt=({render:i,html:t})=>tt;var le=k({}),D="time",et=class extends le{connectedCallback(){this.getAttribute("type")!==D&&super.setAttribute("type",D),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,e,s){if(t==="type"&&s!==D){this.getAttribute("type")!==D&&super.setAttribute("type",D);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,e,s)}},Ot=({render:i,html:t})=>et;var ae=k({}),N="datetime-local",it=class extends ae{connectedCallback(){this.getAttribute("type")!==N&&super.setAttribute("type",N),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,e,s){if(t==="type"&&s!==N){this.getAttribute("type")!==N&&super.setAttribute("type",N);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,e,s)}},Wt=({render:i,html:t})=>it;var he=["mt","mr","mb","ml","m","mh","mv","cur"],st=class i extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["disabled","step","min","max","s"];static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
735
890
|
:host {
|
|
736
891
|
display: contents;
|
|
737
892
|
}
|
|
@@ -764,9 +919,9 @@ var rettangoli=(()=>{var O=`
|
|
|
764
919
|
input:disabled {
|
|
765
920
|
cursor: not-allowed;
|
|
766
921
|
}
|
|
767
|
-
${
|
|
922
|
+
${g}
|
|
768
923
|
${p}
|
|
769
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=
|
|
924
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=b(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","placeholder","disabled","value","step","min","max","s",..._([...he,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_emitValueEvent=t=>{let e=this._inputElement.value;if(e.trim()===""){this.dispatchEvent(new CustomEvent(t,{detail:{value:null},bubbles:!0}));return}let s=parseFloat(e);isNaN(s)||(s=this._clampValueToBounds(s),this._inputElement.value=s.toString(),this.dispatchEvent(new CustomEvent(t,{detail:{value:s},bubbles:!0})))};_onInput=()=>{this._emitValueEvent("value-input")};_onChange=()=>{this._emitValueEvent("value-change")};attributeChangedCallback(t,e,s){if(e!==s){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(i.inputSpecificAttributes.includes(t)){this._updateInputAttributes(),(t==="min"||t==="max")&&this._syncValueAttribute();return}this.updateStyles()}}updateStyles(){this._styles=b(),w.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,r=this.getAttribute(s("wh")),n=c(r===null?this.getAttribute(s("w")):r),o=c(r===null?this.getAttribute(s("h")):r),l=this.getAttribute(s("op")),a=this.getAttribute(s("z"));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),v({styleBucket:this._styles[e],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),v({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="block")});let t=x(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,e){if(e==null||e==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,e)}_clampValueToBounds(t){let e=t,s=this.getAttribute("min");if(s!==null){let n=parseFloat(s);isNaN(n)||(e=Math.max(e,n))}let r=this.getAttribute("max");if(r!==null){let n=parseFloat(r);isNaN(n)||(e=Math.min(e,n))}return e}_syncValueAttribute(){let t=this.getAttribute("value");if(t==null||t===""){this._inputElement.value="";return}let e=parseFloat(t);if(isNaN(e)){this._inputElement.value="";return}let s=this._clampValueToBounds(e);this._inputElement.value=s.toString()}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("step"),e=this.getAttribute("min"),s=this.getAttribute("max"),r=this.hasAttribute("disabled");this._inputElement.setAttribute("type","number"),this._setOrRemoveInputAttribute("step",t),this._setOrRemoveInputAttribute("min",e),this._setOrRemoveInputAttribute("max",s),r?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},Rt=({render:i,html:t})=>st;var rt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
770
925
|
:host {
|
|
771
926
|
display: contents;
|
|
772
927
|
}
|
|
@@ -792,9 +947,9 @@ var rettangoli=(()=>{var O=`
|
|
|
792
947
|
textarea:disabled {
|
|
793
948
|
cursor: not-allowed;
|
|
794
949
|
}
|
|
795
|
-
${
|
|
950
|
+
${g}
|
|
796
951
|
${p}
|
|
797
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._textareaElement=document.createElement("textarea"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onInput),this._textareaElement.addEventListener("change",this._onChange)}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._textareaElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._textareaElement.value},bubbles:!0}))};static get observedAttributes(){return["key","placeholder","disabled","value","cols","rows",..._([...A,"wh","w","h","hide","show","op","z"])]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}focus(){this._textareaElement&&this._textareaElement.focus()}select(){this._textareaElement&&this._textareaElement.select()}attributeChangedCallback(t,e,s){if(t==="key"){requestAnimationFrame(()=>{let
|
|
952
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._textareaElement=document.createElement("textarea"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onInput),this._textareaElement.addEventListener("change",this._onChange)}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._textareaElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._textareaElement.value},bubbles:!0}))};static get observedAttributes(){return["key","placeholder","disabled","value","cols","rows",..._([...A,"wh","w","h","hide","show","op","z"])]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}focus(){this._textareaElement&&this._textareaElement.focus()}select(){this._textareaElement&&this._textareaElement.select()}attributeChangedCallback(t,e,s){if(t==="key"){requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""});return}if(t==="value"&&requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""}),t==="placeholder"&&requestAnimationFrame(()=>{let n=this.getAttribute("placeholder");n===void 0||n==="null"?this._textareaElement.removeAttribute("placeholder"):this._textareaElement.setAttribute("placeholder",n??"")}),["cols","rows","disabled"].includes(t)){this._updateTextareaAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let o=S=>`${n==="default"?"":`${n}-`}${S}`,l=this.getAttribute(o("wh")),a=c(l===null?this.getAttribute(o("w")):l),h=c(l===null?this.getAttribute(o("h")):l),f=this.getAttribute(o("op")),y=this.getAttribute(o("z"));y!==null&&(this._styles[n]["z-index"]=y),f!==null&&(this._styles[n].opacity=f),a==="f"?this._styles[n].width="var(--width-stretch)":a!==void 0&&(this._styles[n].width=a,this._styles[n]["min-width"]=a,this._styles[n]["max-width"]=a),h==="f"?this._styles[n].height="100%":h!==void 0&&(this._styles[n].height=h,this._styles[n]["min-height"]=h,this._styles[n]["max-height"]=h),this.hasAttribute(o("hide"))&&(this._styles[n].display="none"),this.hasAttribute(o("show"))&&(this._styles[n].display="block")});let r=x(this._styles,"textarea");r!==this._lastStyleString&&(this._styleElement.textContent=r,this._lastStyleString=r)}_updateTextareaAttributes(){let t=this.getAttribute("cols"),e=this.getAttribute("rows"),s=this.hasAttribute("disabled");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),e!==null?this._textareaElement.setAttribute("rows",e):this._textareaElement.removeAttribute("rows"),s?this._textareaElement.setAttribute("disabled",""):this._textareaElement.removeAttribute("disabled")}},Lt=({render:i,html:t})=>rt;var de=["mt","mr","mb","ml","m","mh","mv","cur"],ue=/^#[0-9a-fA-F]{6}$/,nt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
798
953
|
:host {
|
|
799
954
|
display: contents;
|
|
800
955
|
}
|
|
@@ -815,9 +970,9 @@ var rettangoli=(()=>{var O=`
|
|
|
815
970
|
cursor: not-allowed;
|
|
816
971
|
opacity: 0.5;
|
|
817
972
|
}
|
|
818
|
-
${
|
|
973
|
+
${g}
|
|
819
974
|
${p}
|
|
820
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=
|
|
975
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=b(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="color",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("change",this._onChange),this._inputElement.addEventListener("input",this._onInput)}static get observedAttributes(){return["key","value","disabled",..._([...de,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,e,s){if(e!==s){if(t==="key"){this._syncValueAttribute();return}if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=b(),w.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,r=this.getAttribute(s("wh")),n=c(r===null?this.getAttribute(s("w")):r),o=c(r===null?this.getAttribute(s("h")):r),l=this.getAttribute(s("op")),a=this.getAttribute(s("z"));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),v({styleBucket:this._styles[e],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),v({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="block")});let t=x(this._styles,'input[type="color"]');t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_syncValueAttribute(){let t=this.getAttribute("value");if(t===null){this._inputElement.value="#000000";return}this._inputElement.value=ue.test(t)?t:"#000000"}_updateInputAttributes(){let t=this.hasAttribute("disabled");this._syncValueAttribute(),t?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this.updateStyles()}},Mt=({render:i,html:t})=>nt;var ot=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
821
976
|
:host {
|
|
822
977
|
display: contents;
|
|
823
978
|
}
|
|
@@ -869,9 +1024,9 @@ var rettangoli=(()=>{var O=`
|
|
|
869
1024
|
input[type="range"]:disabled::-moz-range-thumb {
|
|
870
1025
|
cursor: not-allowed;
|
|
871
1026
|
}
|
|
872
|
-
${
|
|
1027
|
+
${g}
|
|
873
1028
|
${p}
|
|
874
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",..._([...A,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};attributeChangedCallback(t,e,s){if(t==="key"&&e!==s){requestAnimationFrame(()=>{let
|
|
1029
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",..._([...A,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};attributeChangedCallback(t,e,s){if(t==="key"&&e!==s){requestAnimationFrame(()=>{let n=this.getAttribute("value"),o=this.getAttribute("min")||"0";this._inputElement.value=n??o});return}if(["value","min","max","step","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let o=S=>`${n==="default"?"":`${n}-`}${S}`,l=this.getAttribute(o("wh")),a=c(l===null?this.getAttribute(o("w")):l),h=c(l===null?this.getAttribute(o("h")):l),f=this.getAttribute(o("op")),y=this.getAttribute(o("z"));y!==null&&(this._styles[n]["z-index"]=y),f!==null&&(this._styles[n].opacity=f),a==="f"?this._styles[n].width="var(--width-stretch)":a!==void 0&&(this._styles[n].width=a,this._styles[n]["min-width"]=a,this._styles[n]["max-width"]=a),h==="f"?this._styles[n].height="100%":h!==void 0&&(this._styles[n].height=h,this._styles[n]["min-height"]=h,this._styles[n]["max-height"]=h),this.hasAttribute(o("hide"))&&(this._styles[n].display="none"),this.hasAttribute(o("show"))&&(this._styles[n].display="block")});let r=x(this._styles,'input[type="range"]');r!==this._lastStyleString&&(this._styleElement.textContent=r,this._lastStyleString=r)}_updateInputAttributes(){let t=this.getAttribute("value"),e=this.getAttribute("min"),s=this.getAttribute("max"),r=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null?this._inputElement.value=t:this._inputElement.value=e??0,e!==null?this._inputElement.min=e:this._inputElement.min="0",s!==null?this._inputElement.max=s:this._inputElement.max="100",r!==null?this._inputElement.step=r:this._inputElement.step="1",n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Tt=({render:i,html:t})=>ot;var lt=40,ce=6,at=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
875
1030
|
:host {
|
|
876
1031
|
display: contents;
|
|
877
1032
|
}
|
|
@@ -948,7 +1103,7 @@ var rettangoli=(()=>{var O=`
|
|
|
948
1103
|
animation: none;
|
|
949
1104
|
}
|
|
950
1105
|
}
|
|
951
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._adaptiveFrameId=null,this._layoutRetryCount=0,this._observedContentElement=null,this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._scheduleAdaptiveCentering()}):null,this._onSlotChange=()=>{this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0})},this._onWindowResize=()=>{this._scheduleAdaptiveCentering({resetRetries:!0})},this._mouseDownInContent=!1,this._dialogElement.addEventListener("mousedown",t=>{this._mouseDownInContent=t.target!==this._dialogElement}),this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&this._attemptClose(),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&(t.preventDefault(),this._attemptClose()),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._attemptClose()})}_attemptClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}disconnectedCallback(){this._isConnected=!1,this._stopAdaptiveObservers(),this._slotElement&&this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,e,s){t==="open"?s!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():s===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._slotElement.addEventListener("slotchange",this._onSlotChange),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0,window.addEventListener("resize",this._onWindowResize),this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0}))}_hideModal(){this._dialogElement.open&&(this._stopAdaptiveObservers(),this._dialogElement.close(),this._slotElement&&(this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.removeChild(this._slotElement),this._slotElement=null),this._dialogElement.style.height="")}_stopAdaptiveObservers(){this._adaptiveFrameId!==null&&(cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=null),this._layoutRetryCount=0,window.removeEventListener("resize",this._onWindowResize),this._resizeObserver&&this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=null}_getAssignedContentElement(){if(!this._slotElement)return null;let t=this._slotElement.assignedElements({flatten:!0});return t.length>0?t[0]:null}_observeAssignedContent(){if(!this._resizeObserver)return;let t=this._getAssignedContentElement();this._observedContentElement!==t&&(this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=t,this._observedContentElement&&this._resizeObserver.observe(this._observedContentElement))}_scheduleAdaptiveCentering({resetRetries:t=!1}={}){!this._slotElement||!this._dialogElement.open||(t&&(this._layoutRetryCount=0),this._adaptiveFrameId!==null&&cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=null,this._applyAdaptiveCentering()})}))}_applyAdaptiveCentering(){if(!this._slotElement||!this._dialogElement.open)return;this._observeAssignedContent();let t=this._getAssignedContentElement(),e=t?Math.round(t.getBoundingClientRect().height):0;if(e<=0){this._layoutRetryCount<
|
|
1106
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._adaptiveFrameId=null,this._layoutRetryCount=0,this._observedContentElement=null,this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._scheduleAdaptiveCentering()}):null,this._onSlotChange=()=>{this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0})},this._onWindowResize=()=>{this._scheduleAdaptiveCentering({resetRetries:!0})},this._mouseDownInContent=!1,this._dialogElement.addEventListener("mousedown",t=>{this._mouseDownInContent=t.target!==this._dialogElement}),this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&this._attemptClose(),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&(t.preventDefault(),this._attemptClose()),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._attemptClose()})}_attemptClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}disconnectedCallback(){this._isConnected=!1,this._stopAdaptiveObservers(),this._slotElement&&this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,e,s){t==="open"?s!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():s===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._slotElement.addEventListener("slotchange",this._onSlotChange),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0,window.addEventListener("resize",this._onWindowResize),this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0}))}_hideModal(){this._dialogElement.open&&(this._stopAdaptiveObservers(),this._dialogElement.close(),this._slotElement&&(this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.removeChild(this._slotElement),this._slotElement=null),this._dialogElement.style.height="")}_stopAdaptiveObservers(){this._adaptiveFrameId!==null&&(cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=null),this._layoutRetryCount=0,window.removeEventListener("resize",this._onWindowResize),this._resizeObserver&&this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=null}_getAssignedContentElement(){if(!this._slotElement)return null;let t=this._slotElement.assignedElements({flatten:!0});return t.length>0?t[0]:null}_observeAssignedContent(){if(!this._resizeObserver)return;let t=this._getAssignedContentElement();this._observedContentElement!==t&&(this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=t,this._observedContentElement&&this._resizeObserver.observe(this._observedContentElement))}_scheduleAdaptiveCentering({resetRetries:t=!1}={}){!this._slotElement||!this._dialogElement.open||(t&&(this._layoutRetryCount=0),this._adaptiveFrameId!==null&&cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=null,this._applyAdaptiveCentering()})}))}_applyAdaptiveCentering(){if(!this._slotElement||!this._dialogElement.open)return;this._observeAssignedContent();let t=this._getAssignedContentElement(),e=t?Math.round(t.getBoundingClientRect().height):0;if(e<=0){this._layoutRetryCount<ce&&(this._layoutRetryCount+=1,this._scheduleAdaptiveCentering());return}this._layoutRetryCount=0;let s=window.innerHeight;if(e>=s-2*lt){this._slotElement.style.marginTop=`${lt}px`,this._slotElement.style.marginBottom=`${lt}px`,this._dialogElement.style.height="100vh";return}let r=s-e,n=Math.floor(r/2);this._slotElement.style.marginTop=`${n}px`,this._slotElement.style.marginBottom=`${n}px`,this._dialogElement.style.height="auto"}get dialog(){return this._dialogElement}},Dt=({render:i,html:t})=>at;var ht=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
952
1107
|
:host {
|
|
953
1108
|
display: contents;
|
|
954
1109
|
}
|
|
@@ -1002,4 +1157,4 @@ var rettangoli=(()=>{var O=`
|
|
|
1002
1157
|
min-width: 200px;
|
|
1003
1158
|
max-width: 400px;
|
|
1004
1159
|
}
|
|
1005
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let e=t.composedPath();(e[0]===this._dialogElement||e[0].nodeName==="DIALOG"&&e[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let e=t.composedPath();(e[0]===this._dialogElement||e[0].nodeName==="DIALOG"&&e[0]===this._dialogElement)&&(t.preventDefault(),this._emitClose())}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._emitClose()}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._isOpen=!1}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y","place","no-overlay"]}connectedCallback(){this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._isOpen&&this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,e,s){t==="open"?s!==null&&!this._isOpen?this.isConnected&&this._show():s===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="place")&&this._isOpen?this._updatePosition():t==="no-overlay"&&e!==s&&this._isOpen&&(this._hide(),this._show())}_show(){this._isOpen||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._dialogElement.open||setTimeout(()=>{this._dialogElement&&!this._dialogElement.open&&(this.hasAttribute("no-overlay")?this._dialogElement.show():this._dialogElement.showModal())},0),requestAnimationFrame(()=>{this._updatePosition()}))}_hide(){this._isOpen&&(this._isOpen=!1,this._dialogElement.open&&this._dialogElement.close(),this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_updatePosition(){let t=parseFloat(this.getAttribute("x")||"0"),e=parseFloat(this.getAttribute("y")||"0"),s=this.getAttribute("place")||"bs";this.removeAttribute("positioned"),requestAnimationFrame(()=>{let
|
|
1160
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let e=t.composedPath();(e[0]===this._dialogElement||e[0].nodeName==="DIALOG"&&e[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let e=t.composedPath();(e[0]===this._dialogElement||e[0].nodeName==="DIALOG"&&e[0]===this._dialogElement)&&(t.preventDefault(),this._emitClose())}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._emitClose()}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._isOpen=!1}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y","place","no-overlay"]}connectedCallback(){this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._isOpen&&this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,e,s){t==="open"?s!==null&&!this._isOpen?this.isConnected&&this._show():s===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="place")&&this._isOpen?this._updatePosition():t==="no-overlay"&&e!==s&&this._isOpen&&(this._hide(),this._show())}_show(){this._isOpen||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._dialogElement.open||setTimeout(()=>{this._dialogElement&&!this._dialogElement.open&&(this.hasAttribute("no-overlay")?this._dialogElement.show():this._dialogElement.showModal())},0),requestAnimationFrame(()=>{this._updatePosition()}))}_hide(){this._isOpen&&(this._isOpen=!1,this._dialogElement.open&&this._dialogElement.close(),this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_updatePosition(){let t=parseFloat(this.getAttribute("x")||"0"),e=parseFloat(this.getAttribute("y")||"0"),s=this.getAttribute("place")||"bs";this.removeAttribute("positioned"),requestAnimationFrame(()=>{let r=this._popoverContainer.getBoundingClientRect(),{left:n,top:o}=this._calculatePosition(t,e,r.width,r.height,s);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${o}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,e,s,r,n){let l=t,a=e;switch(n){case"t":l=t-s/2,a=e-r-8;break;case"ts":l=t,a=e-r-8;break;case"te":l=t-s,a=e-r-8;break;case"r":l=t+8,a=e-r/2;break;case"rs":l=t+8,a=e;break;case"re":l=t+8,a=e-r;break;case"b":l=t-s/2,a=e+8;break;case"bs":l=t,a=e+8;break;case"be":l=t-s,a=e+8;break;case"l":l=t-s-8,a=e-r/2;break;case"ls":l=t-s-8,a=e;break;case"le":l=t-s-8,a=e-r;break;default:l=t,a=e+8;break}let h=8;return l=Math.max(h,Math.min(l,window.innerWidth-s-h)),a=Math.max(h,Math.min(a,window.innerHeight-r-h)),{left:l,top:a}}get popover(){return this._popoverContainer}},Nt=({render:i,html:t})=>ht;customElements.define("rtgl-button",bt({}));customElements.define("rtgl-view",xt({}));customElements.define("rtgl-text",St({}));customElements.define("rtgl-image",kt({}));customElements.define("rtgl-tag",zt({}));customElements.define("rtgl-svg",It({}));customElements.define("rtgl-input",k({}));customElements.define("rtgl-input-date",Bt({}));customElements.define("rtgl-input-time",Ot({}));customElements.define("rtgl-input-datetime",Wt({}));customElements.define("rtgl-input-number",Rt({}));customElements.define("rtgl-textarea",Lt({}));customElements.define("rtgl-color-picker",Mt({}));customElements.define("rtgl-slider",Tt({}));customElements.define("rtgl-dialog",Dt({}));customElements.define("rtgl-popover",Nt({}));})();
|