@rettangoli/ui 1.0.0-rc8 → 1.0.0
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 +74 -42
- package/dist/rettangoli-iife-ui.min.js +161 -60
- package/dist/themes/base.css +4 -4
- package/dist/themes/theme-catppuccin.css +1 -1
- package/dist/themes/theme-rtgl-mono.css +1 -1
- package/dist/themes/theme-rtgl-slate.css +1 -1
- package/package.json +11 -7
- package/src/common/dimensions.js +85 -0
- package/src/common/responsive.js +72 -0
- package/src/common.js +6 -4
- package/src/components/dropdownMenu/dropdownMenu.schema.yaml +1 -1
- package/src/components/form/form.handlers.js +328 -152
- package/src/components/form/form.methods.js +205 -0
- package/src/components/form/form.schema.yaml +16 -271
- package/src/components/form/form.store.js +542 -97
- package/src/components/form/form.view.yaml +73 -52
- package/src/components/globalUi/globalUi.handlers.js +4 -4
- package/src/components/popoverInput/popoverInput.handlers.js +64 -50
- package/src/components/popoverInput/popoverInput.schema.yaml +3 -1
- package/src/components/popoverInput/popoverInput.store.js +9 -3
- package/src/components/popoverInput/popoverInput.view.yaml +4 -4
- package/src/components/select/select.handlers.js +15 -19
- package/src/components/select/select.schema.yaml +2 -0
- package/src/components/select/select.store.js +8 -6
- package/src/components/select/select.view.yaml +4 -4
- package/src/components/sliderInput/sliderInput.handlers.js +15 -1
- package/src/components/sliderInput/sliderInput.schema.yaml +3 -0
- package/src/components/sliderInput/sliderInput.store.js +2 -1
- package/src/components/sliderInput/sliderInput.view.yaml +2 -2
- package/src/components/tooltip/tooltip.schema.yaml +1 -1
- package/src/deps/createGlobalUI.js +4 -4
- package/src/entry-iife-layout.js +6 -0
- package/src/entry-iife-ui.js +8 -0
- package/src/index.js +8 -0
- package/src/primitives/checkbox.js +295 -0
- package/src/primitives/input-date.js +31 -0
- package/src/primitives/input-datetime.js +31 -0
- package/src/primitives/input-time.js +31 -0
- package/src/primitives/input.js +43 -1
- package/src/primitives/textarea.js +3 -0
- package/src/primitives/view.js +8 -2
- package/src/themes/base.css +4 -4
- package/src/themes/theme-catppuccin.css +1 -1
- package/src/themes/theme-rtgl-mono.css +1 -1
- package/src/themes/theme-rtgl-slate.css +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var rettangoli=(()=>{var
|
|
1
|
+
var rettangoli=(()=>{var O=`
|
|
2
2
|
:host([href]) {
|
|
3
3
|
cursor: pointer;
|
|
4
4
|
position: relative;
|
|
@@ -12,27 +12,27 @@ var rettangoli=(()=>{var z=`
|
|
|
12
12
|
bottom: 0;
|
|
13
13
|
z-index: 1;
|
|
14
14
|
}
|
|
15
|
-
`,
|
|
15
|
+
`,W=({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")},L=({shadowRoot:i,slotElement:t,linkElement:e,href:s,newTab:n,rel:r})=>{if(t.parentNode!==i&&i.appendChild(t),!s)return e&&e.parentNode===i&&i.removeChild(e),null;let o=e||document.createElement("a");return W({linkElement:o,href:s,newTab:n,rel:r}),o.parentNode!==i&&i.appendChild(o),o},P=({shadowRoot:i,childElement:t,linkElement:e,href:s,newTab:n,rel:r})=>{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 W({linkElement:o,href:s,newTab:n,rel:r}),t.parentNode!==o&&o.appendChild(t),o.parentNode!==i&&i.appendChild(o),o};var x=["default","sm","md","lg","xl"],g=()=>x.reduce((i,t)=>(i[t]={},i),{}),dt=["sm","md","lg","xl"],Dt=({size:i,attr:t})=>i==="default"?t:`${i}-${t}`,Ft=({size:i,includeDefault:t=!0})=>{if(i==="default")return["default"];let e=dt.indexOf(i);if(e===-1)return t?["default"]:[];let s=dt.slice(e);return t&&s.push("default"),s},H=({element:i,size:t,attr:e,includeDefault:s=!0})=>{let n=Ft({size:t,includeDefault:s});for(let r of n){let o=Dt({size:r,attr:e}),l=i.getAttribute(o);if(l!==null)return l}return null};var Nt=/^([1-9]|1[0-2])fg$/,Vt=/^([1-9]\d*)\/([1-9]\d*)fb$/,q=i=>typeof i=="string"&&Nt.test(i),ut=i=>{if(typeof i!="string")return null;let t=i.match(Vt);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 ct({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 f=({styleBucket:i,axis:t,dimension:e,fillValue:s,allowFlexGrow:n=!1,flexMinDimension:r="0",lockBounds:o=!0})=>{let l=()=>{!n||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(n&&q(e)){i["flex-grow"]=e.slice(0,-2),i["flex-basis"]="0%",i[`min-${t}`]=r,i[`max-${t}`]="unset";return}let h=n?ut(e):null;if(h){i["flex-grow"]="0",i["flex-shrink"]="0",i["flex-basis"]=ct({...h,gapVar:"var(--rtgl-flex-gap, 0px)"}),i[`min-${t}`]=r,i[`max-${t}`]="unset";return}l(),i[t]=e,o&&(i[`min-${t}`]=e,i[`max-${t}`]=e)},G=({style:i,width:t,fillValue:e="var(--width-stretch)",allowFlexGrow:s=!0,flexMinWidth:n="0"})=>{if(t==="f"){i.width=e,i.flexGrow="",i.flexBasis="",i.minWidth="";return}if(s&&q(t)){i.width="",i.flexGrow=t.slice(0,-2),i.flexShrink="",i.flexBasis="0%",i.minWidth=n;return}let r=s?ut(t):null;if(r){i.width="",i.flexGrow="0",i.flexShrink="0",i.flexBasis=ct({...r,gapVar:"var(--rtgl-flex-gap, 0px)"}),i.minWidth=n;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,n)=>{e+=s+(t[n]||"")}),e}var jt=["sm","md","lg","xl"],pt={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(pt),_=i=>i.concat(jt.flatMap(t=>i.map(e=>`${t}-${e}`))),mt={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)"},b=(i,t={},e=null)=>{let s="";for(let[n,r]of Object.entries(mt)){n!=="default"&&(s+=`${r} {`);for(let[o,l]of Object.entries(i))for(let[a,h]of Object.entries(l)){let m=pt[o],y=h.startsWith("--")?`var(${h})`:h,S=n==="default"?o:`${n}-${o}`,F=n==="default"?`h-${o}`:`${n}-h-${o}`,C=(I,$=!1)=>{let E=$?`:host([${I}="${a}"]:hover)`:`:host([${I}="${a}"])`;if(e)return e.split(",").map(j=>`${E} ${j.trim()}`).join(", ");let z=t[o];return z?`${E} ${z}`:E};if(m){let $=m.split(" ").map(E=>`${E}: ${y};`).join(" ");s+=`
|
|
16
16
|
${C(S)}{
|
|
17
|
-
${
|
|
17
|
+
${$}
|
|
18
18
|
}
|
|
19
|
-
${C(
|
|
20
|
-
${
|
|
19
|
+
${C(F,!0)}{
|
|
20
|
+
${$}
|
|
21
21
|
}
|
|
22
22
|
`}else s+=`
|
|
23
23
|
${C(S)}{
|
|
24
24
|
${h}
|
|
25
25
|
}
|
|
26
|
-
${C(
|
|
26
|
+
${C(F,!0)}{
|
|
27
27
|
${h}
|
|
28
28
|
}
|
|
29
|
-
`}n!=="default"&&(s+="}")}return s};function
|
|
30
|
-
`);let o="";for(let[a
|
|
29
|
+
`}n!=="default"&&(s+="}")}return s};function Pt(i){if(i===null||i.includes("/"))return!1;let t=String(i);return/[0-9]$/.test(t)}var Ht=i=>/%$/.test(i),qt=i=>/^([1-9]|1[0-2])fg$/.test(i),c=i=>{if(i!=null)return qt(i)||Ht(i)?i:Pt(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 w(i,t=":host"){let e="",s=["default","xl","lg","md","sm"];for(let n of s){let r=mt[n];if(!i[n]||Object.keys(i[n]).length===0)continue;n!=="default"&&(e+=`${r} {
|
|
30
|
+
`);let o="";for(let[l,a]of Object.entries(i[n]))a!=null&&(o+=`${l}: ${a} !important;
|
|
31
31
|
`);e+=`${t} {
|
|
32
32
|
${o.trim()}
|
|
33
33
|
}
|
|
34
34
|
`,n!=="default"&&(e+=`}
|
|
35
|
-
`)}return e}var
|
|
35
|
+
`)}return e}var Gt={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 z=`
|
|
|
81
81
|
`,lk:`
|
|
82
82
|
background-color: transparent;
|
|
83
83
|
color: var(--foreground);
|
|
84
|
-
`}},
|
|
84
|
+
`}},gt=b(Gt,{},".surface");var Ut=[{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 z=`
|
|
|
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
|
+
${gt}
|
|
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 Ut){let n=`${e}-s`;if(t<=s&&this.hasAttribute(n))return this.getAttribute(n)}return this.getAttribute("s")}_updateButton(){this.shadow.innerHTML="";let t=this.hasAttribute("disabled"),e=this.getAttribute("href"),s=this.hasAttribute("new-tab"),n=this.getAttribute("rel"),r=e&&!t,o=r?"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(),r?(W({linkElement:this._surfaceElement,href:e,newTab:s,rel:n}),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 n=this.getAttribute("pre");n&&(this._prefixIcon=document.createElement("rtgl-svg"),this._prefixIcon.setAttribute("svg",n),this._prefixIcon.setAttribute("wh",s.toString()),this._prefixIcon.style.color="inherit",this._surfaceElement.insertBefore(this._prefixIcon,this._slotElement));let r=this.getAttribute("suf");r&&(this._suffixIcon=document.createElement("rtgl-svg"),this._suffixIcon.setAttribute("svg",r),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()}},ft=({render:i,html:t})=>U;var bt=u`
|
|
253
253
|
|
|
254
254
|
:host([d="h"]) {
|
|
255
255
|
flex-direction: row;
|
|
@@ -320,7 +320,7 @@ var rettangoli=(()=>{var z=`
|
|
|
320
320
|
justify-content: center;
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
-
`;var
|
|
323
|
+
`;var Kt={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=b(Kt);var vt=u`
|
|
324
324
|
:host([sh]:not([sv])) {
|
|
325
325
|
overflow-x: scroll;
|
|
326
326
|
flex-wrap: nowrap;
|
|
@@ -367,7 +367,7 @@ var rettangoli=(()=>{var z=`
|
|
|
367
367
|
flex-wrap: nowrap;
|
|
368
368
|
}
|
|
369
369
|
|
|
370
|
-
`;var
|
|
370
|
+
`;var R={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},Xt={bgc:{pr:`
|
|
371
371
|
background-color: var(--primary);
|
|
372
372
|
`,se:`
|
|
373
373
|
background-color: var(--secondary);
|
|
@@ -407,7 +407,7 @@ var rettangoli=(()=>{var z=`
|
|
|
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:R,bwt:R,bwr:R,bwb:R,bwl:R,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"}},yt=b(Xt);var Yt={mt:d,mr:d,mb:d,ml:d,m:d,mh:d,mv:d},v=b(Yt);var N=u`
|
|
411
411
|
a, a:link, a:visited, a:hover, a:active {
|
|
412
412
|
color: inherit;
|
|
413
413
|
text-decoration: none;
|
|
@@ -417,7 +417,7 @@ var rettangoli=(()=>{var z=`
|
|
|
417
417
|
margin: 0;
|
|
418
418
|
font: inherit;
|
|
419
419
|
}
|
|
420
|
-
`;var
|
|
420
|
+
`;var K=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
421
421
|
slot {
|
|
422
422
|
display: contents;
|
|
423
423
|
}
|
|
@@ -433,14 +433,14 @@ var rettangoli=(()=>{var z=`
|
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
|
|
436
|
-
${
|
|
437
|
-
${
|
|
436
|
+
${vt}
|
|
437
|
+
${bt}
|
|
438
438
|
${v}
|
|
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=g();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=
|
|
440
|
+
${yt}
|
|
441
|
+
${N}
|
|
442
|
+
${O}
|
|
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=g();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=L({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=g(),x.forEach(e=>{let s=ht=>`${e==="default"?"":`${e}-`}${ht}`,n=this.getAttribute(s("wh")),r=c(n===null?this.getAttribute(s("w")):n),o=c(n===null?this.getAttribute(s("h")):n),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),f({styleBucket:this._styles[e],axis:"width",dimension:r,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),f({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")),m=this.getAttribute(s("ah")),y=this.getAttribute(s("av")),S=H({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(Bt=>this.hasAttribute(`${Bt}-d`))&&(this._styles[e]["flex-direction"]="column");let F=S==="h",C=S==="v"||!S;F&&(m==="c"?this._styles[e]["justify-content"]="center":m==="e"?this._styles[e]["justify-content"]="flex-end":m==="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&&(m!==null||y!==null)&&(m==="c"?this._styles[e]["align-items"]="center":m==="e"?this._styles[e]["align-items"]="flex-end":m==="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 I=this.hasAttribute(s("wrap")),$=this.hasAttribute(s("no-wrap"));I&&(this._styles[e]["flex-wrap"]="wrap"),$&&(this._styles[e]["flex-wrap"]="nowrap");let E=this.hasAttribute(s("sh")),z=this.hasAttribute(s("sv")),j=this.getAttribute(s("overflow"));E&&z?(this._styles[e].overflow="scroll",this._styles[e]["flex-wrap"]="nowrap"):E?(this._styles[e]["overflow-x"]="scroll",this._styles[e]["flex-wrap"]="nowrap"):z&&(this._styles[e]["overflow-y"]="scroll",this._styles[e]["flex-wrap"]="nowrap"),j==="hidden"&&(this._styles[e].overflow="hidden",this._styles[e]["flex-wrap"]="nowrap")});let t=w(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()}},_t=({render:i,html:t})=>K;var Qt={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 z=`
|
|
|
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
|
-
`}},
|
|
483
|
+
`}},wt=b(Qt);var Jt={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=b(Jt);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 z=`
|
|
|
499
499
|
text-decoration: var(--anchor-text-decoration-hover);
|
|
500
500
|
color: var(--anchor-color-hover);
|
|
501
501
|
}
|
|
502
|
-
${
|
|
503
|
-
${
|
|
504
|
-
${
|
|
502
|
+
${O}
|
|
503
|
+
${wt}
|
|
504
|
+
${V}
|
|
505
505
|
${v}
|
|
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=""),G({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=L({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}},xt=({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"},Zt={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"}},St=i=>b(Zt,{},i);var te={mt:d,mr:d,mb:d,ml:d,m:d,mh:d,mv:d},Et=i=>b(te,{},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 z=`
|
|
|
531
531
|
height: auto;
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
-
${
|
|
534
|
+
${N}
|
|
535
535
|
|
|
536
536
|
a {
|
|
537
537
|
display: block;
|
|
@@ -539,10 +539,10 @@ var rettangoli=(()=>{var z=`
|
|
|
539
539
|
width: 100%;
|
|
540
540
|
}
|
|
541
541
|
|
|
542
|
-
${
|
|
543
|
-
${
|
|
542
|
+
${St("img, a")}
|
|
543
|
+
${Et("img, a")}
|
|
544
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=g();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=
|
|
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=g();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=P({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=g(),x.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,n=this.getAttribute(s("wh")),r=c(n===null?this.getAttribute(s("w")):n),o=c(n===null?this.getAttribute(s("h")):n),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),f({styleBucket:this._styles[e],axis:"width",dimension:r,fillValue:"var(--width-stretch)"}),f({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=w(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")}},At=({render:i,html:t})=>Y;var kt=u`
|
|
546
546
|
:host([pt="xs"]) svg {
|
|
547
547
|
padding-top: var(--spacing-xs);
|
|
548
548
|
}
|
|
@@ -658,16 +658,16 @@ var rettangoli=(()=>{var z=`
|
|
|
658
658
|
padding-top: var(--spacing-xl);
|
|
659
659
|
padding-bottom: var(--spacing-xl);
|
|
660
660
|
}
|
|
661
|
-
`;var
|
|
661
|
+
`;var Q=class i extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
662
662
|
:host {
|
|
663
663
|
color: var(--foreground);
|
|
664
664
|
flex-shrink: 0;
|
|
665
665
|
}
|
|
666
|
-
${
|
|
667
|
-
${
|
|
666
|
+
${V}
|
|
667
|
+
${kt}
|
|
668
668
|
${v}
|
|
669
669
|
${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=""}},
|
|
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=""}},Ct=({render:i,html:t})=>Q;var ee=["mt","mr","mb","ml","m","mh","mv","cur"],J=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
671
|
:host {
|
|
672
672
|
display: contents;
|
|
673
673
|
}
|
|
@@ -700,9 +700,38 @@ var rettangoli=(()=>{var z=`
|
|
|
700
700
|
input:disabled {
|
|
701
701
|
cursor: not-allowed;
|
|
702
702
|
}
|
|
703
|
+
input[type="date"],
|
|
704
|
+
input[type="time"],
|
|
705
|
+
input[type="datetime-local"] {
|
|
706
|
+
color: var(--foreground);
|
|
707
|
+
min-width: 0;
|
|
708
|
+
}
|
|
709
|
+
input[type="date"]::-webkit-calendar-picker-indicator,
|
|
710
|
+
input[type="time"]::-webkit-calendar-picker-indicator,
|
|
711
|
+
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
|
|
712
|
+
cursor: pointer;
|
|
713
|
+
border-radius: var(--border-radius-sm);
|
|
714
|
+
opacity: 1;
|
|
715
|
+
padding: 2px;
|
|
716
|
+
}
|
|
717
|
+
input[type="date"]::-webkit-datetime-edit,
|
|
718
|
+
input[type="time"]::-webkit-datetime-edit,
|
|
719
|
+
input[type="datetime-local"]::-webkit-datetime-edit {
|
|
720
|
+
color: var(--foreground);
|
|
721
|
+
}
|
|
722
|
+
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
|
|
723
|
+
input[type="time"]::-webkit-datetime-edit-fields-wrapper,
|
|
724
|
+
input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper {
|
|
725
|
+
padding: 0;
|
|
726
|
+
}
|
|
727
|
+
input[type="date"]::-webkit-date-and-time-value,
|
|
728
|
+
input[type="time"]::-webkit-date-and-time-value,
|
|
729
|
+
input[type="datetime-local"]::-webkit-date-and-time-value {
|
|
730
|
+
text-align: left;
|
|
731
|
+
}
|
|
703
732
|
${v}
|
|
704
733
|
${p}
|
|
705
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=g(),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","s",..._([...
|
|
734
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=g(),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",..._([...ee,"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=g(),x.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,n=this.getAttribute(s("wh")),r=c(n===null?this.getAttribute(s("w")):n),o=c(n===null?this.getAttribute(s("h")):n),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),f({styleBucket:this._styles[e],axis:"width",dimension:r,fillValue:"var(--width-stretch)"}),f({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=w(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",n=this.getAttribute("min"),r=this.getAttribute("max"),o=this.getAttribute("step"),l=this.hasAttribute("disabled");this._setOrRemoveInputAttribute("type",s),this._setOrRemoveInputAttribute("min",n),this._setOrRemoveInputAttribute("max",r),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})=>J;var ie=k({}),T="date",Z=class extends ie{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)}},$t=({render:i,html:t})=>Z;var se=k({}),B="time",tt=class extends se{connectedCallback(){this.getAttribute("type")!==B&&super.setAttribute("type",B),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,e,s){if(t==="type"&&s!==B){this.getAttribute("type")!==B&&super.setAttribute("type",B);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,e,s)}},It=({render:i,html:t})=>tt;var ne=k({}),D="datetime-local",et=class extends ne{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)}},zt=({render:i,html:t})=>et;var re=["mt","mr","mb","ml","m","mh","mv","cur"],it=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`
|
|
706
735
|
:host {
|
|
707
736
|
display: contents;
|
|
708
737
|
}
|
|
@@ -737,7 +766,7 @@ var rettangoli=(()=>{var z=`
|
|
|
737
766
|
}
|
|
738
767
|
${v}
|
|
739
768
|
${p}
|
|
740
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=g(),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",..._([...
|
|
769
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=g(),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",..._([...re,"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=g(),x.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,n=this.getAttribute(s("wh")),r=c(n===null?this.getAttribute(s("w")):n),o=c(n===null?this.getAttribute(s("h")):n),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),f({styleBucket:this._styles[e],axis:"width",dimension:r,fillValue:"var(--width-stretch)"}),f({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=w(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 r=parseFloat(s);isNaN(r)||(e=Math.max(e,r))}let n=this.getAttribute("max");if(n!==null){let r=parseFloat(n);isNaN(r)||(e=Math.min(e,r))}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"),n=this.hasAttribute("disabled");this._inputElement.setAttribute("type","number"),this._setOrRemoveInputAttribute("step",t),this._setOrRemoveInputAttribute("min",e),this._setOrRemoveInputAttribute("max",s),n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},Ot=({render:i,html:t})=>it;var st=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
741
770
|
:host {
|
|
742
771
|
display: contents;
|
|
743
772
|
}
|
|
@@ -760,9 +789,12 @@ var rettangoli=(()=>{var z=`
|
|
|
760
789
|
textarea:focus {
|
|
761
790
|
border-color: var(--foreground);
|
|
762
791
|
}
|
|
792
|
+
textarea:disabled {
|
|
793
|
+
cursor: not-allowed;
|
|
794
|
+
}
|
|
763
795
|
${v}
|
|
764
796
|
${p}
|
|
765
|
-
`))}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 r=this.getAttribute("value");this._textareaElement.value=r??""});return}if(t==="value"&&requestAnimationFrame(()=>{let r=this.getAttribute("value");this._textareaElement.value=r??""}),t==="placeholder"&&requestAnimationFrame(()=>{let r=this.getAttribute("placeholder");r===void 0||r==="null"?this._textareaElement.removeAttribute("placeholder"):this._textareaElement.setAttribute("placeholder",r??"")}),["cols","rows","disabled"].includes(t)){this._updateTextareaAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(r=>{let o=S=>`${r==="default"?"":`${r}-`}${S}`,
|
|
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 r=this.getAttribute("value");this._textareaElement.value=r??""});return}if(t==="value"&&requestAnimationFrame(()=>{let r=this.getAttribute("value");this._textareaElement.value=r??""}),t==="placeholder"&&requestAnimationFrame(()=>{let r=this.getAttribute("placeholder");r===void 0||r==="null"?this._textareaElement.removeAttribute("placeholder"):this._textareaElement.setAttribute("placeholder",r??"")}),["cols","rows","disabled"].includes(t)){this._updateTextareaAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(r=>{let o=S=>`${r==="default"?"":`${r}-`}${S}`,l=this.getAttribute(o("wh")),a=c(l===null?this.getAttribute(o("w")):l),h=c(l===null?this.getAttribute(o("h")):l),m=this.getAttribute(o("op")),y=this.getAttribute(o("z"));y!==null&&(this._styles[r]["z-index"]=y),m!==null&&(this._styles[r].opacity=m),a==="f"?this._styles[r].width="var(--width-stretch)":a!==void 0&&(this._styles[r].width=a,this._styles[r]["min-width"]=a,this._styles[r]["max-width"]=a),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(o("hide"))&&(this._styles[r].display="none"),this.hasAttribute(o("show"))&&(this._styles[r].display="block")});let n=w(this._styles,"textarea");n!==this._lastStyleString&&(this._styleElement.textContent=n,this._lastStyleString=n)}_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")}},Wt=({render:i,html:t})=>st;var oe=["mt","mr","mb","ml","m","mh","mv","cur"],le=/^#[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`
|
|
766
798
|
:host {
|
|
767
799
|
display: contents;
|
|
768
800
|
}
|
|
@@ -785,7 +817,7 @@ var rettangoli=(()=>{var z=`
|
|
|
785
817
|
}
|
|
786
818
|
${v}
|
|
787
819
|
${p}
|
|
788
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=g(),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",..._([...
|
|
820
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=g(),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",..._([...oe,"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=g(),x.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,n=this.getAttribute(s("wh")),r=c(n===null?this.getAttribute(s("w")):n),o=c(n===null?this.getAttribute(s("h")):n),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),f({styleBucket:this._styles[e],axis:"width",dimension:r,fillValue:"var(--width-stretch)"}),f({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=w(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=le.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()}},Lt=({render:i,html:t})=>nt;var rt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
789
821
|
:host {
|
|
790
822
|
display: contents;
|
|
791
823
|
}
|
|
@@ -839,7 +871,7 @@ var rettangoli=(()=>{var z=`
|
|
|
839
871
|
}
|
|
840
872
|
${v}
|
|
841
873
|
${p}
|
|
842
|
-
`))}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 r=this.getAttribute("value"),o=this.getAttribute("min")||"0";this._inputElement.value=r??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(r=>{let o=S=>`${r==="default"?"":`${r}-`}${S}`,
|
|
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 r=this.getAttribute("value"),o=this.getAttribute("min")||"0";this._inputElement.value=r??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(r=>{let o=S=>`${r==="default"?"":`${r}-`}${S}`,l=this.getAttribute(o("wh")),a=c(l===null?this.getAttribute(o("w")):l),h=c(l===null?this.getAttribute(o("h")):l),m=this.getAttribute(o("op")),y=this.getAttribute(o("z"));y!==null&&(this._styles[r]["z-index"]=y),m!==null&&(this._styles[r].opacity=m),a==="f"?this._styles[r].width="var(--width-stretch)":a!==void 0&&(this._styles[r].width=a,this._styles[r]["min-width"]=a,this._styles[r]["max-width"]=a),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(o("hide"))&&(this._styles[r].display="none"),this.hasAttribute(o("show"))&&(this._styles[r].display="block")});let n=w(this._styles,'input[type="range"]');n!==this._lastStyleString&&(this._styleElement.textContent=n,this._lastStyleString=n)}_updateInputAttributes(){let t=this.getAttribute("value"),e=this.getAttribute("min"),s=this.getAttribute("max"),n=this.getAttribute("step"),r=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",n!==null?this._inputElement.step=n:this._inputElement.step="1",r?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Rt=({render:i,html:t})=>rt;var ot=40,ae=6,lt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
843
875
|
:host {
|
|
844
876
|
display: contents;
|
|
845
877
|
}
|
|
@@ -916,7 +948,7 @@ var rettangoli=(()=>{var z=`
|
|
|
916
948
|
animation: none;
|
|
917
949
|
}
|
|
918
950
|
}
|
|
919
|
-
`))}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<
|
|
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<ae&&(this._layoutRetryCount+=1,this._scheduleAdaptiveCentering());return}this._layoutRetryCount=0;let s=window.innerHeight;if(e>=s-2*ot){this._slotElement.style.marginTop=`${ot}px`,this._slotElement.style.marginBottom=`${ot}px`,this._dialogElement.style.height="100vh";return}let n=s-e,r=Math.floor(n/2);this._slotElement.style.marginTop=`${r}px`,this._slotElement.style.marginBottom=`${r}px`,this._dialogElement.style.height="auto"}get dialog(){return this._dialogElement}},Mt=({render:i,html:t})=>lt;var at=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
920
952
|
:host {
|
|
921
953
|
display: contents;
|
|
922
954
|
}
|
|
@@ -970,4 +1002,4 @@ var rettangoli=(()=>{var z=`
|
|
|
970
1002
|
min-width: 200px;
|
|
971
1003
|
max-width: 400px;
|
|
972
1004
|
}
|
|
973
|
-
`))}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 n=this._popoverContainer.getBoundingClientRect(),{left:r,top:o}=this._calculatePosition(t,e,n.width,n.height,s);this._popoverContainer.style.left=`${r}px`,this._popoverContainer.style.top=`${o}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,e,s,n,r){let
|
|
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 n=this._popoverContainer.getBoundingClientRect(),{left:r,top:o}=this._calculatePosition(t,e,n.width,n.height,s);this._popoverContainer.style.left=`${r}px`,this._popoverContainer.style.top=`${o}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,e,s,n,r){let l=t,a=e;switch(r){case"t":l=t-s/2,a=e-n-8;break;case"ts":l=t,a=e-n-8;break;case"te":l=t-s,a=e-n-8;break;case"r":l=t+8,a=e-n/2;break;case"rs":l=t+8,a=e;break;case"re":l=t+8,a=e-n;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-n/2;break;case"ls":l=t-s-8,a=e;break;case"le":l=t-s-8,a=e-n;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-n-h)),{left:l,top:a}}get popover(){return this._popoverContainer}},Tt=({render:i,html:t})=>at;customElements.define("rtgl-button",ft({}));customElements.define("rtgl-view",_t({}));customElements.define("rtgl-text",xt({}));customElements.define("rtgl-image",At({}));customElements.define("rtgl-svg",Ct({}));customElements.define("rtgl-input",k({}));customElements.define("rtgl-input-date",$t({}));customElements.define("rtgl-input-time",It({}));customElements.define("rtgl-input-datetime",zt({}));customElements.define("rtgl-input-number",Ot({}));customElements.define("rtgl-textarea",Wt({}));customElements.define("rtgl-color-picker",Lt({}));customElements.define("rtgl-slider",Rt({}));customElements.define("rtgl-dialog",Mt({}));customElements.define("rtgl-popover",Tt({}));})();
|