@rettangoli/ui 1.0.9 → 1.0.11
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 +254 -59
- package/dist/rettangoli-iife-ui.min.js +268 -73
- package/package.json +2 -2
- package/src/common/carousel.js +155 -0
- package/src/components/globalUi/globalUi.view.yaml +5 -5
- 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/carousel.js +978 -0
- package/src/primitives/view.js +57 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var rettangoli=(()=>{var
|
|
1
|
+
var rettangoli=(()=>{var T=`
|
|
2
2
|
:host([href]) {
|
|
3
3
|
cursor: pointer;
|
|
4
4
|
position: relative;
|
|
@@ -12,27 +12,27 @@ var rettangoli=(()=>{var B=`
|
|
|
12
12
|
bottom: 0;
|
|
13
13
|
z-index: 1;
|
|
14
14
|
}
|
|
15
|
-
`,
|
|
16
|
-
${
|
|
17
|
-
${
|
|
15
|
+
`,F=({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")},M=({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 F({linkElement:o,href:s,newTab:r,rel:n}),o.parentNode!==i&&i.appendChild(o),o},tt=({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 F({linkElement:o,href:s,newTab:r,rel:n}),t.parentNode!==o&&o.appendChild(t),o.parentNode!==i&&i.appendChild(o),o};var S=["default","sm","md","lg","xl"],f=()=>S.reduce((i,t)=>(i[t]={},i),{}),It=["sm","md","lg","xl"],ue=({size:i,attr:t})=>i==="default"?t:`${i}-${t}`,pe=({size:i,includeDefault:t=!0})=>{if(i==="default")return["default"];let e=It.indexOf(i);if(e===-1)return t?["default"]:[];let s=It.slice(e);return t&&s.push("default"),s},et=({element:i,size:t,attr:e,includeDefault:s=!0})=>{let r=pe({size:t,includeDefault:s});for(let n of r){let o=ue({size:n,attr:e}),l=i.getAttribute(o);if(l!==null)return l}return null};var me=/^([1-9]|1[0-2])fg$/,ge=/^([1-9]\d*)\/([1-9]\d*)fb$/,it=i=>typeof i=="string"&&me.test(i),G=i=>{if(typeof i!="string")return null;let t=i.match(ge);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 zt({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 b=({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&&it(e)){i["flex-grow"]=e.slice(0,-2),i["flex-basis"]="0%",i[`min-${t}`]=n,i[`max-${t}`]="unset";return}let h=r?G(e):null;if(h){i["flex-grow"]="0",i["flex-shrink"]="0",i["flex-basis"]=zt({...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)},P=({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&&it(t)){i.width="",i.flexGrow=t.slice(0,-2),i.flexShrink="",i.flexBasis="0%",i.minWidth=r;return}let n=s?G(t):null;if(n){i.width="",i.flexGrow="0",i.flexShrink="0",i.flexBasis=zt({...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=""};var fe=i=>`${i}`.trim().replace(/\s*\/\s*/g,"/"),N=i=>{if(i==null)return;let t=fe(i);if(t.length!==0)return typeof CSS<"u"&&typeof CSS.supports=="function"?CSS.supports("aspect-ratio",t)?t:void 0:t};function c(i,...t){let e="";return i.forEach((s,r)=>{e+=s+(t[r]||"")}),e}var be=["sm","md","lg","xl"],$t={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"},E=Object.keys($t),y=i=>i.concat(be.flatMap(t=>i.map(e=>`${t}-${e}`))),Bt={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)"},v=(i,t={},e=null)=>{let s="";for(let[r,n]of Object.entries(Bt)){r!=="default"&&(s+=`${n} {`);for(let[o,l]of Object.entries(i))for(let[a,h]of Object.entries(l)){let p=$t[o],_=h.startsWith("--")?`var(${h})`:h,x=r==="default"?o:`${r}-${o}`,C=r==="default"?`h-${o}`:`${r}-h-${o}`,z=(O,$=!1)=>{let k=$?`:host([${O}="${a}"]:hover)`:`:host([${O}="${a}"])`;if(e)return e.split(",").map(q=>`${k} ${q.trim()}`).join(", ");let W=t[o];return W?`${k} ${W}`:k};if(p){let $=p.split(" ").map(k=>`${k}: ${_};`).join(" ");s+=`
|
|
16
|
+
${z(x)}{
|
|
17
|
+
${$}
|
|
18
18
|
}
|
|
19
|
-
${
|
|
20
|
-
${
|
|
19
|
+
${z(C,!0)}{
|
|
20
|
+
${$}
|
|
21
21
|
}
|
|
22
22
|
`}else s+=`
|
|
23
|
-
${
|
|
23
|
+
${z(x)}{
|
|
24
24
|
${h}
|
|
25
25
|
}
|
|
26
|
-
${
|
|
26
|
+
${z(C,!0)}{
|
|
27
27
|
${h}
|
|
28
28
|
}
|
|
29
|
-
`}r!=="default"&&(s+="}")}return s};function
|
|
29
|
+
`}r!=="default"&&(s+="}")}return s};function ve(i){if(i===null||i.includes("/"))return!1;let t=String(i);return/[0-9]$/.test(t)}var _e=i=>/%$/.test(i),ye=i=>/^([1-9]|1[0-2])fg$/.test(i),d=i=>{if(i!=null)return ye(i)||_e(i)?i:ve(i)?`${i}px`:Object.keys(u).includes(i)?`var(${u[i]})`:i},u={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 r of s){let n=Bt[r];if(!i[r]||Object.keys(i[r]).length===0)continue;r!=="default"&&(e+=`${n} {
|
|
30
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
34
|
`,r!=="default"&&(e+=`}
|
|
35
|
-
`)}return e}var
|
|
35
|
+
`)}return e}var we={mt:u,mr:u,mb:u,ml:u,m:u,mh:u,mv:u,s:{sm:`
|
|
36
36
|
height: 28px;
|
|
37
37
|
padding-left: 12px;
|
|
38
38
|
padding-right: 12px;
|
|
@@ -81,7 +81,7 @@ var rettangoli=(()=>{var B=`
|
|
|
81
81
|
`,lk:`
|
|
82
82
|
background-color: transparent;
|
|
83
83
|
color: var(--foreground);
|
|
84
|
-
`}},
|
|
84
|
+
`}},Lt=v(we,{},".surface");var xe=[{prefix:"sm",maxWidth:640},{prefix:"md",maxWidth:768},{prefix:"lg",maxWidth:1024},{prefix:"xl",maxWidth:1280}],st=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
85
85
|
:host {
|
|
86
86
|
display: inline-flex;
|
|
87
87
|
}
|
|
@@ -248,8 +248,203 @@ var rettangoli=(()=>{var B=`
|
|
|
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
|
+
${Lt}
|
|
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 xe){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?(F({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=d(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()}},Tt=({render:i,html:t})=>st;var Se=({numerator:i,denominator:t,gapVar:e})=>i===t?"100%":i===1?`calc((100% - ((${t} - 1) * ${e})) / ${t})`:`calc(((100% - ((${t} - 1) * ${e})) * ${i}) / ${t})`,K=({index:i,maxIndex:t})=>!Number.isFinite(i)||!Number.isFinite(t)||t<0?0:Math.min(Math.max(Math.trunc(i),0),t),rt=({value:i,defaultValue:t=!1})=>{if(i==null)return t;let e=`${i}`.trim().toLowerCase();return e.length===0?!0:!(e==="false"||e==="0"||e==="no"||e==="off"||e==="none")},nt=i=>{if(i==null)return"x mandatory";let t=`${i}`.trim().toLowerCase();return t===""||t==="true"||t==="1"||t==="yes"?"x mandatory":t==="false"||t==="0"||t==="no"||t==="off"||t==="none"?"none":"x mandatory"},Mt=({slideLeft:i,slideWidth:t,viewportWidth:e,scrollPaddingInlineStart:s=0,scrollPaddingInlineEnd:r=0,snapAlign:n="center",maxScrollLeft:o=Number.POSITIVE_INFINITY})=>{if(!Number.isFinite(i)||!Number.isFinite(t)||!Number.isFinite(e))return 0;let l=s,a=e-r,h=Math.max(a-l,0),p;n==="start"?p=i-l:n==="end"?p=i+t-a:p=i+t/2-(l+h/2);let _=Number.isFinite(o)?Math.max(o,0):Number.POSITIVE_INFINITY;return Math.min(Math.max(p,0),_)},Ot=({slideWidthCss:i,snapAlign:t="center"})=>`${t??""}`.trim().toLowerCase()!=="center"?"0px":`max(calc((100% - (${i&&`${i}`.trim().length>0?`${i}`.trim():"100%"})) / 2), 0px)`,Rt=({slideWidth:i,gapVar:t="var(--rtgl-carousel-gap, 0px)"})=>{if(i==null||`${i}`.trim()===""||i==="f")return"100%";let e=G(`${i}`.trim());return e?Se({...e,gapVar:t}):d(`${i}`.trim())??"100%"};var Ee=["a","button","input","select","textarea","label","summary","[contenteditable]"].join(", "),ot=i=>{if(i==null)return null;let t=`${i}`.trim();return t.length>0?t:null},Ae=i=>i<.5?2*i*i:1-Math.pow(-2*i+2,2)/2,Wt=i=>{let t="http://www.w3.org/2000/svg",e=document.createElementNS(t,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("aria-hidden","true"),e.setAttribute("focusable","false");let s=document.createElementNS(t,"path");return s.setAttribute("d",i==="left"?"M15 18 9 12l6-6":"M9 18l6-6-6-6"),s.setAttribute("fill","none"),s.setAttribute("stroke","currentColor"),s.setAttribute("stroke-width","2"),s.setAttribute("stroke-linecap","round"),s.setAttribute("stroke-linejoin","round"),e.appendChild(s),e},lt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
253
|
+
:host {
|
|
254
|
+
display: block;
|
|
255
|
+
width: 100%;
|
|
256
|
+
min-width: 0;
|
|
257
|
+
box-sizing: border-box;
|
|
258
|
+
--rtgl-carousel-gap: var(--spacing-md);
|
|
259
|
+
--rtgl-carousel-slide-width: 100%;
|
|
260
|
+
--rtgl-carousel-scroll-snap-type: x mandatory;
|
|
261
|
+
--rtgl-carousel-scroll-padding-inline: 0px;
|
|
262
|
+
--rtgl-carousel-edge-padding-inline: 0px;
|
|
263
|
+
--rtgl-carousel-scroll-behavior: smooth;
|
|
264
|
+
--rtgl-carousel-snap-align: center;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
:host([dragging]) {
|
|
268
|
+
cursor: grabbing;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
#root {
|
|
272
|
+
display: grid;
|
|
273
|
+
gap: var(--spacing-md);
|
|
274
|
+
width: 100%;
|
|
275
|
+
min-width: 0;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
#viewport-shell {
|
|
279
|
+
position: relative;
|
|
280
|
+
display: grid;
|
|
281
|
+
width: 100%;
|
|
282
|
+
min-width: 0;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
#viewport {
|
|
286
|
+
display: flex;
|
|
287
|
+
gap: var(--rtgl-carousel-gap);
|
|
288
|
+
width: 100%;
|
|
289
|
+
min-width: 0;
|
|
290
|
+
box-sizing: border-box;
|
|
291
|
+
grid-area: 1 / 1;
|
|
292
|
+
padding-inline: var(--rtgl-carousel-edge-padding-inline);
|
|
293
|
+
overflow-x: auto;
|
|
294
|
+
overflow-y: hidden;
|
|
295
|
+
scroll-snap-type: var(--rtgl-carousel-scroll-snap-type);
|
|
296
|
+
scroll-behavior: var(--rtgl-carousel-scroll-behavior);
|
|
297
|
+
scroll-padding-inline: var(--rtgl-carousel-scroll-padding-inline);
|
|
298
|
+
-ms-overflow-style: none;
|
|
299
|
+
scrollbar-width: none;
|
|
300
|
+
cursor: grab;
|
|
301
|
+
touch-action: pan-x pan-y pinch-zoom;
|
|
302
|
+
overscroll-behavior-x: contain;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
:host([dragging]) #viewport {
|
|
306
|
+
cursor: grabbing;
|
|
307
|
+
user-select: none;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
#viewport::-webkit-scrollbar {
|
|
311
|
+
display: none;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
slot {
|
|
315
|
+
display: contents;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
#controls {
|
|
319
|
+
display: flex;
|
|
320
|
+
align-items: center;
|
|
321
|
+
justify-content: center;
|
|
322
|
+
gap: var(--spacing-sm);
|
|
323
|
+
width: 100%;
|
|
324
|
+
min-width: 0;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
#prev-button,
|
|
328
|
+
#next-button {
|
|
329
|
+
appearance: none;
|
|
330
|
+
border: 1px solid var(--border);
|
|
331
|
+
background: var(--background);
|
|
332
|
+
color: var(--foreground);
|
|
333
|
+
border-radius: 999px;
|
|
334
|
+
width: 44px;
|
|
335
|
+
height: 44px;
|
|
336
|
+
min-width: 44px;
|
|
337
|
+
min-height: 44px;
|
|
338
|
+
padding: 0;
|
|
339
|
+
font: inherit;
|
|
340
|
+
line-height: 1;
|
|
341
|
+
cursor: pointer;
|
|
342
|
+
display: inline-flex;
|
|
343
|
+
align-items: center;
|
|
344
|
+
justify-content: center;
|
|
345
|
+
position: absolute;
|
|
346
|
+
top: 50%;
|
|
347
|
+
z-index: 1;
|
|
348
|
+
transition:
|
|
349
|
+
transform 160ms ease,
|
|
350
|
+
background-color 160ms ease,
|
|
351
|
+
color 160ms ease,
|
|
352
|
+
border-color 160ms ease,
|
|
353
|
+
box-shadow 160ms ease,
|
|
354
|
+
opacity 160ms ease;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
#prev-button {
|
|
358
|
+
left: var(--spacing-sm);
|
|
359
|
+
transform: translateY(-50%);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
#next-button {
|
|
363
|
+
right: var(--spacing-sm);
|
|
364
|
+
transform: translateY(-50%);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
#prev-button svg,
|
|
368
|
+
#next-button svg {
|
|
369
|
+
width: 18px;
|
|
370
|
+
height: 18px;
|
|
371
|
+
pointer-events: none;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
#pager {
|
|
375
|
+
display: flex;
|
|
376
|
+
align-items: center;
|
|
377
|
+
justify-content: center;
|
|
378
|
+
gap: var(--spacing-md);
|
|
379
|
+
flex-wrap: wrap;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
#pager button {
|
|
383
|
+
appearance: none;
|
|
384
|
+
border: 1px solid color-mix(in srgb, var(--foreground) 18%, transparent);
|
|
385
|
+
background: color-mix(in srgb, var(--foreground) 22%, transparent);
|
|
386
|
+
color: var(--foreground);
|
|
387
|
+
border-radius: 999px;
|
|
388
|
+
width: 14px;
|
|
389
|
+
height: 14px;
|
|
390
|
+
min-width: 14px;
|
|
391
|
+
min-height: 14px;
|
|
392
|
+
padding: 0;
|
|
393
|
+
cursor: pointer;
|
|
394
|
+
transition:
|
|
395
|
+
transform 160ms ease,
|
|
396
|
+
background-color 160ms ease,
|
|
397
|
+
color 160ms ease,
|
|
398
|
+
border-color 160ms ease,
|
|
399
|
+
box-shadow 160ms ease,
|
|
400
|
+
opacity 160ms ease;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
#prev-button:hover:not(:disabled),
|
|
404
|
+
#next-button:hover:not(:disabled),
|
|
405
|
+
#pager button:hover:not(:disabled),
|
|
406
|
+
#prev-button:focus-visible,
|
|
407
|
+
#next-button:focus-visible,
|
|
408
|
+
#pager button:focus-visible {
|
|
409
|
+
box-shadow: var(--shadow-sm);
|
|
410
|
+
outline: none;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
#prev-button:hover:not(:disabled),
|
|
414
|
+
#next-button:hover:not(:disabled),
|
|
415
|
+
#prev-button:focus-visible,
|
|
416
|
+
#next-button:focus-visible {
|
|
417
|
+
transform: translateY(calc(-50% - 1px));
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
#pager button:hover:not(:disabled),
|
|
421
|
+
#pager button:focus-visible {
|
|
422
|
+
transform: scale(1.1);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
#prev-button:disabled,
|
|
426
|
+
#next-button:disabled,
|
|
427
|
+
#pager button:disabled {
|
|
428
|
+
opacity: 0.45;
|
|
429
|
+
cursor: default;
|
|
430
|
+
box-shadow: none;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
#prev-button:disabled,
|
|
434
|
+
#next-button:disabled {
|
|
435
|
+
transform: translateY(-50%);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
#pager button:disabled {
|
|
439
|
+
transform: none;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
#pager button.is-active {
|
|
443
|
+
background: var(--foreground);
|
|
444
|
+
border-color: var(--foreground);
|
|
445
|
+
transform: scale(1.2);
|
|
446
|
+
}
|
|
447
|
+
`))}static get observedAttributes(){return["index","sw","sna","g","spi","sbh","snap","nav","pager"]}constructor(){super(),i.initializeStyleSheet(),this._slides=[],this._pagerButtons=[],this._currentIndex=0,this._clickSuppressUntil=0,this._dragState=null,this._scrollFrame=null,this._resizeFrame=null,this._scrollAnimationFrame=null,this._isReflectingIndex=!1,this._slideStyleCache=new WeakMap,this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._rootElement=document.createElement("div"),this._rootElement.id="root",this._viewportShellElement=document.createElement("div"),this._viewportShellElement.id="viewport-shell",this._viewportShellElement.setAttribute("part","viewport-shell"),this._viewportElement=document.createElement("div"),this._viewportElement.id="viewport",this._viewportElement.tabIndex=0,this._viewportElement.setAttribute("part","viewport"),this._slotElement=document.createElement("slot"),this._viewportElement.appendChild(this._slotElement),this._controlsElement=document.createElement("div"),this._controlsElement.id="controls",this._controlsElement.setAttribute("part","controls"),this._controlsElement.hidden=!0,this._prevButton=document.createElement("button"),this._prevButton.id="prev-button",this._prevButton.type="button",this._prevButton.hidden=!0,this._prevButton.append(Wt("left")),this._prevButton.setAttribute("part","nav-button prev-button"),this._prevButton.setAttribute("aria-label","Previous slide"),this._pagerElement=document.createElement("div"),this._pagerElement.id="pager",this._pagerElement.setAttribute("part","pager"),this._pagerElement.hidden=!0,this._nextButton=document.createElement("button"),this._nextButton.id="next-button",this._nextButton.type="button",this._nextButton.hidden=!0,this._nextButton.append(Wt("right")),this._nextButton.setAttribute("part","nav-button next-button"),this._nextButton.setAttribute("aria-label","Next slide"),this._viewportShellElement.append(this._viewportElement,this._prevButton,this._nextButton),this._controlsElement.append(this._pagerElement),this._rootElement.append(this._viewportShellElement,this._controlsElement),this.shadow.append(this._rootElement),this._handleSlotChange=this._handleSlotChange.bind(this),this._handleClickPrev=this._handleClickPrev.bind(this),this._handleClickNext=this._handleClickNext.bind(this),this._handleViewportKeydown=this._handleViewportKeydown.bind(this),this._handleViewportScroll=this._handleViewportScroll.bind(this),this._handleViewportPointerDown=this._handleViewportPointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._handleViewportClickCapture=this._handleViewportClickCapture.bind(this),this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._resizeFrame!==null&&cancelAnimationFrame(this._resizeFrame),this._resizeFrame=requestAnimationFrame(()=>{this._resizeFrame=null,!(this._dragState?.dragging||!this._slides.length)&&this.goTo(this._currentIndex,{behavior:"auto"})})}):null}get index(){return this._currentIndex}set index(t){let e=Number(t);this.setAttribute("index",Number.isFinite(e)?`${e}`:"0")}get snap(){return nt(this.getAttribute("snap"))!=="none"}set snap(t){if(t===!1||`${t}`.trim().toLowerCase()==="false"){this.setAttribute("snap","false");return}this.setAttribute("snap","true")}connectedCallback(){this._slotElement.addEventListener("slotchange",this._handleSlotChange),this._prevButton.addEventListener("click",this._handleClickPrev),this._nextButton.addEventListener("click",this._handleClickNext),this._viewportElement.addEventListener("keydown",this._handleViewportKeydown),this._viewportElement.addEventListener("scroll",this._handleViewportScroll,{passive:!0}),this._viewportElement.addEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.addEventListener("click",this._handleViewportClickCapture,!0),this._resizeObserver?.observe(this._viewportElement),this._syncSlides(),this._updateLayoutStyles();let t=this.hasAttribute("index")?Number(this.getAttribute("index")):0;this.goTo(t,{behavior:"auto"})}disconnectedCallback(){this._slotElement.removeEventListener("slotchange",this._handleSlotChange),this._prevButton.removeEventListener("click",this._handleClickPrev),this._nextButton.removeEventListener("click",this._handleClickNext),this._viewportElement.removeEventListener("keydown",this._handleViewportKeydown),this._viewportElement.removeEventListener("scroll",this._handleViewportScroll),this._viewportElement.removeEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.removeEventListener("click",this._handleViewportClickCapture,!0),this._removePointerListeners(),this._resizeObserver?.disconnect(),this._scrollFrame!==null&&(cancelAnimationFrame(this._scrollFrame),this._scrollFrame=null),this._resizeFrame!==null&&(cancelAnimationFrame(this._resizeFrame),this._resizeFrame=null),this._cancelScrollAnimation(),this._setDraggingState(!1),this._slides.forEach(t=>{this._restoreSlideStyles(t),t.removeAttribute("data-rtgl-carousel-active")})}attributeChangedCallback(t,e,s){if(e!==s){if(t==="index"){if(this._isReflectingIndex){this._isReflectingIndex=!1;return}this.goTo(Number(s),{behavior:"smooth"});return}if(t==="nav"||t==="pager"){this._updateControls();return}this._updateLayoutStyles()}}next(){this.goTo(this._currentIndex+1)}prev(){this.goTo(this._currentIndex-1)}_showsNavControls(){return rt({value:this.getAttribute("nav"),defaultValue:!0})}_showsPagerControls(){return rt({value:this.getAttribute("pager"),defaultValue:!1})}goTo(t,e={}){if(!this._slides.length){this._setCurrentIndex(0,{emit:!1,reflect:!0});return}let s=K({index:Number(t),maxIndex:this._slides.length-1}),r=this._slides[s],n=e.behavior??"smooth";r&&(this._scrollViewportTo(this._getSlideTargetScrollLeft(r),{behavior:n}),this._setCurrentIndex(s))}_handleSlotChange(){this._syncSlides(),this._updateLayoutStyles(),this.goTo(this._currentIndex,{behavior:"auto"})}_handleClickPrev(){this.prev()}_handleClickNext(){this.next()}_handleViewportKeydown(t){t.key==="ArrowRight"?(t.preventDefault(),this.next()):t.key==="ArrowLeft"&&(t.preventDefault(),this.prev())}_handleViewportScroll(){this._scrollAnimationFrame===null&&(this._dragState?.dragging||this._requestSyncFromScroll())}_handleViewportPointerDown(t){t.pointerType==="mouse"&&(t.button!==0||!this._slides.length||this._eventTargetsInteractiveElement(t)||(this._cancelScrollAnimation(),this._dragState={pointerId:t.pointerId,startX:t.clientX,startScrollLeft:this._viewportElement.scrollLeft,dragging:!1},this._viewportElement.setPointerCapture(t.pointerId),this._viewportElement.addEventListener("pointermove",this._handlePointerMove),this._viewportElement.addEventListener("pointerup",this._handlePointerUp),this._viewportElement.addEventListener("pointercancel",this._handlePointerUp)))}_handlePointerMove(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let e=t.clientX-this._dragState.startX;!this._dragState.dragging&&Math.abs(e)>6&&(this._dragState.dragging=!0,this._setDraggingState(!0)),this._dragState.dragging&&(t.preventDefault(),this._viewportElement.scrollLeft=this._dragState.startScrollLeft-e)}_handlePointerUp(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let e=this._dragState.dragging,s=e?this._findNearestSlideIndex():this._currentIndex;this._viewportElement.hasPointerCapture(t.pointerId)&&this._viewportElement.releasePointerCapture(t.pointerId),this._dragState=null,this._setDraggingState(!1),this._removePointerListeners(),e&&(this._clickSuppressUntil=performance.now()+250,this.snap?this.goTo(s,{behavior:"smooth"}):this._requestSyncFromScroll())}_handleViewportClickCapture(t){performance.now()<this._clickSuppressUntil&&(t.preventDefault(),t.stopPropagation())}_removePointerListeners(){this._viewportElement.removeEventListener("pointermove",this._handlePointerMove),this._viewportElement.removeEventListener("pointerup",this._handlePointerUp),this._viewportElement.removeEventListener("pointercancel",this._handlePointerUp)}_eventTargetsInteractiveElement(t){return t.composedPath().some(e=>e instanceof Element&&e.matches(Ee))}_requestSyncFromScroll(){this._scrollFrame!==null&&cancelAnimationFrame(this._scrollFrame),this._scrollFrame=requestAnimationFrame(()=>{this._scrollFrame=null;let t=this._findNearestSlideIndex();this._setCurrentIndex(t)})}_findNearestSlideIndex(){if(!this._slides.length)return 0;let t=this._viewportElement.scrollLeft,e=this._currentIndex,s=Number.POSITIVE_INFINITY;return this._slides.forEach((r,n)=>{let o=Math.abs(this._getSlideTargetScrollLeft(r)-t);o<s&&(e=n,s=o)}),e}_syncSlides(){let t=new Set(this._slides),e=this._slotElement.assignedElements({flatten:!0}).filter(s=>!s.hasAttribute("hidden"));t.forEach(s=>{e.includes(s)||(this._restoreSlideStyles(s),s.removeAttribute("data-rtgl-carousel-active"))}),this._slides=e,this._slides.forEach(s=>{this._slideStyleCache.has(s)||this._slideStyleCache.set(s,{flex:s.style.flex,width:s.style.width,minWidth:s.style.minWidth,maxWidth:s.style.maxWidth,boxSizing:s.style.boxSizing,scrollSnapAlign:s.style.scrollSnapAlign,scrollSnapStop:s.style.scrollSnapStop})}),this._buildPager(),this._setCurrentIndex(K({index:this._currentIndex,maxIndex:this._slides.length-1}),{emit:!1,reflect:!0})}_restoreSlideStyles(t){let e=this._slideStyleCache.get(t);e&&(t.style.flex=e.flex,t.style.width=e.width,t.style.minWidth=e.minWidth,t.style.maxWidth=e.maxWidth,t.style.boxSizing=e.boxSizing,t.style.scrollSnapAlign=e.scrollSnapAlign,t.style.scrollSnapStop=e.scrollSnapStop)}_updateLayoutStyles(){let t=Rt({slideWidth:this.getAttribute("sw")}),e=ot(this.getAttribute("sna"))??"center",s=nt(this.getAttribute("snap")),r=d(this.getAttribute("g"))??"var(--spacing-md)",n=d(this.getAttribute("spi"))??"0px",o=ot(this.getAttribute("sbh"))??"smooth",l=Ot({slideWidthCss:t,snapAlign:e});this.style.setProperty("--rtgl-carousel-slide-width",t),this.style.setProperty("--rtgl-carousel-gap",r),this.style.setProperty("--rtgl-carousel-scroll-snap-type",s),this.style.setProperty("--rtgl-carousel-scroll-padding-inline",n),this.style.setProperty("--rtgl-carousel-edge-padding-inline",l),this.style.setProperty("--rtgl-carousel-scroll-behavior",o),this.style.setProperty("--rtgl-carousel-snap-align",e),this._slides.forEach(a=>{a.style.flex=`0 0 ${t}`,a.style.width=t,a.style.minWidth="0",a.style.maxWidth="unset",a.style.boxSizing="border-box",a.style.scrollSnapAlign=e,a.style.scrollSnapStop="always"})}_setDraggingState(t){if(t){this.setAttribute("dragging",""),this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this.removeAttribute("dragging"),this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior=""}_scrollViewportTo(t,e={}){let s=e.behavior??"smooth",r=Math.min(Math.max(t,0),Math.max(this._viewportElement.scrollWidth-this._viewportElement.clientWidth,0));if(s!=="smooth"||Math.abs(r-this._viewportElement.scrollLeft)<1){this._cancelScrollAnimation(),this._viewportElement.scrollLeft=r;return}this._cancelScrollAnimation();let n=this._viewportElement.scrollLeft,o=r-n,l=Math.min(720,Math.max(420,Math.abs(o)*.35)),a=performance.now();this._setAnimatingScrollState(!0);let h=p=>{let _=p-a,x=Math.min(_/l,1),C=Ae(x);if(this._viewportElement.scrollLeft=n+o*C,x<1){this._scrollAnimationFrame=requestAnimationFrame(h);return}this._viewportElement.scrollLeft=r,this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1)};this._scrollAnimationFrame=requestAnimationFrame(h)}_cancelScrollAnimation(){this._scrollAnimationFrame!==null&&(cancelAnimationFrame(this._scrollAnimationFrame),this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1))}_buildPager(){this._pagerElement.replaceChildren(),this._pagerButtons=[],this._slides.forEach((t,e)=>{let s=document.createElement("button");s.type="button",s.setAttribute("part","pager-button"),s.setAttribute("aria-label",`Go to slide ${e+1}`),s.setAttribute("title",`Go to slide ${e+1}`),s.addEventListener("click",()=>{this.goTo(e)}),this._pagerElement.appendChild(s),this._pagerButtons.push(s)}),this._updateControls()}_updateControls(){let t=this._slides.length>0,e=this._slides.length>1,s=this._currentIndex<=0,r=this._currentIndex>=this._slides.length-1,n=e&&this._showsNavControls(),o=e&&this._showsPagerControls();this._prevButton.hidden=!n,this._nextButton.hidden=!n,this._pagerElement.hidden=!o,this._controlsElement.hidden=!o,this._prevButton.disabled=!t||s,this._nextButton.disabled=!t||r,this._pagerButtons.forEach((l,a)=>{let h=a===this._currentIndex;l.classList.toggle("is-active",h),l.disabled=h,l.setAttribute("part",h?"pager-button pager-button-active":"pager-button"),h?l.setAttribute("aria-current","true"):l.removeAttribute("aria-current")})}_setCurrentIndex(t,e={}){let s=K({index:t,maxIndex:this._slides.length-1}),r=e.emit??!0,n=e.reflect??!0,o=this._currentIndex;this._currentIndex=s,this._slides.forEach((l,a)=>{a===s?l.setAttribute("data-rtgl-carousel-active","true"):l.removeAttribute("data-rtgl-carousel-active")}),this._updateControls(),n&&this.getAttribute("index")!==`${s}`&&(this._isReflectingIndex=!0,this.setAttribute("index",`${s}`)),r&&o!==s&&this.dispatchEvent(new CustomEvent("index-change",{detail:{index:s},bubbles:!0}))}_resolveScrollInlinePosition(){let t=ot(this.getAttribute("sna"))??"center";return t==="start"||t==="end"||t==="center"?t:"center"}_getSlideTargetScrollLeft(t){let e=this._viewportElement.getBoundingClientRect(),s=t.getBoundingClientRect();if(e.width<=0||s.width<=0)return this._viewportElement.scrollLeft;let r=getComputedStyle(this._viewportElement),n=this._viewportElement.scrollLeft,o=s.left-e.left+n;return Mt({slideLeft:o,slideWidth:s.width,viewportWidth:e.width,scrollPaddingInlineStart:this._parsePx(r.scrollPaddingInlineStart),scrollPaddingInlineEnd:this._parsePx(r.scrollPaddingInlineEnd),snapAlign:this._resolveScrollInlinePosition(),maxScrollLeft:this._viewportElement.scrollWidth-this._viewportElement.clientWidth})}_parsePx(t){let e=Number.parseFloat(t);return Number.isFinite(e)?e:0}_setAnimatingScrollState(t){if(t){this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this._dragState?.dragging||(this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior="")}},Ft=()=>lt;var Ce={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"}},m=v(Ce);var X=c`
|
|
253
448
|
:host([sh]:not([sv])) {
|
|
254
449
|
overflow-x: scroll;
|
|
255
450
|
flex-wrap: nowrap;
|
|
@@ -296,7 +491,7 @@ var rettangoli=(()=>{var B=`
|
|
|
296
491
|
flex-wrap: nowrap;
|
|
297
492
|
}
|
|
298
493
|
|
|
299
|
-
`;var
|
|
494
|
+
`;var V={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},ke={bgc:{pr:`
|
|
300
495
|
background-color: var(--primary);
|
|
301
496
|
`,se:`
|
|
302
497
|
background-color: var(--secondary);
|
|
@@ -336,7 +531,7 @@ var rettangoli=(()=>{var B=`
|
|
|
336
531
|
left: 0;
|
|
337
532
|
top: 0;
|
|
338
533
|
height: 100%;
|
|
339
|
-
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:
|
|
534
|
+
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:u,pr:u,pb:u,pl:u,p:u,ph:u,pv:u,g:u,gv:u,gh:u,bw:V,bwt:V,bwr:V,bwb:V,bwl:V,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"}},Y=v(ke);var Ie={mt:u,mr:u,mb:u,ml:u,m:u,mh:u,mv:u},g=v(Ie);var R=c`
|
|
340
535
|
a, a:link, a:visited, a:hover, a:active {
|
|
341
536
|
color: inherit;
|
|
342
537
|
text-decoration: none;
|
|
@@ -346,7 +541,7 @@ var rettangoli=(()=>{var B=`
|
|
|
346
541
|
margin: 0;
|
|
347
542
|
font: inherit;
|
|
348
543
|
}
|
|
349
|
-
`;var
|
|
544
|
+
`;var ze=i=>{if(i==null)return null;let t=i.trim();return t===""?null:/^[1-9]\d*$/.test(t)?`repeat(${t}, minmax(0, 1fr))`:t},at=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
350
545
|
slot {
|
|
351
546
|
display: contents;
|
|
352
547
|
}
|
|
@@ -360,13 +555,13 @@ var rettangoli=(()=>{var B=`
|
|
|
360
555
|
border-color: var(--border);
|
|
361
556
|
}
|
|
362
557
|
|
|
363
|
-
${
|
|
558
|
+
${X}
|
|
559
|
+
${g}
|
|
364
560
|
${m}
|
|
365
|
-
${
|
|
366
|
-
${H}
|
|
561
|
+
${Y}
|
|
367
562
|
${R}
|
|
368
|
-
${
|
|
369
|
-
`))}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",...y([...
|
|
563
|
+
${T}
|
|
564
|
+
`))}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",...y([...E,"cols","op","wh","w","h","hide","show","sh","sv","z","overflow"])]}_styles=f();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=M({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=f(),S.forEach(e=>{let s=C=>`${e==="default"?"":`${e}-`}${C}`,r=this.getAttribute(s("wh")),n=d(r===null?this.getAttribute(s("w")):r),o=d(r===null?this.getAttribute(s("h")):r),l=ze(this.getAttribute(s("cols"))),a=this.getAttribute(s("op")),h=this.getAttribute(s("z"));l!==null&&(this._styles[e]["grid-template-columns"]=l),h!==null&&(this._styles[e]["z-index"]=h),a!==null&&(this._styles[e].opacity=a),b({styleBucket:this._styles[e],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),b({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="grid");let p=this.hasAttribute(s("sh")),_=this.hasAttribute(s("sv")),x=this.getAttribute(s("overflow"));p&&_?this._styles[e].overflow="scroll":p?this._styles[e]["overflow-x"]="scroll":_&&(this._styles[e]["overflow-y"]="scroll"),x==="hidden"&&(this._styles[e].overflow="hidden")});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()}},Pt=({render:i,html:t})=>at;var Nt=c`
|
|
370
565
|
|
|
371
566
|
:host([d="h"]) {
|
|
372
567
|
flex-direction: row;
|
|
@@ -437,7 +632,7 @@ var rettangoli=(()=>{var B=`
|
|
|
437
632
|
justify-content: center;
|
|
438
633
|
}
|
|
439
634
|
}
|
|
440
|
-
`;var
|
|
635
|
+
`;var A=i=>{if(i==null)return null;let t=`${i}`.trim();return t.length>0?t:null},$e=i=>{let t=A(i);return t===null?null:d(t)},ht=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
441
636
|
slot {
|
|
442
637
|
display: contents;
|
|
443
638
|
}
|
|
@@ -453,14 +648,14 @@ var rettangoli=(()=>{var B=`
|
|
|
453
648
|
}
|
|
454
649
|
|
|
455
650
|
|
|
456
|
-
${
|
|
457
|
-
${
|
|
651
|
+
${X}
|
|
652
|
+
${Nt}
|
|
653
|
+
${g}
|
|
458
654
|
${m}
|
|
459
|
-
${
|
|
460
|
-
${H}
|
|
655
|
+
${Y}
|
|
461
656
|
${R}
|
|
462
|
-
${
|
|
463
|
-
`))}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",...y([...
|
|
657
|
+
${T}
|
|
658
|
+
`))}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",...y([...E,"op","wh","w","h","ar","bgi","bgs","bgp","bgr","sst","sna","sns","sbh","spi","stg","hide","show","sh","sv","z","d","ah","av","wrap","no-wrap","overflow"])]}_styles=f();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=M({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=f(),S.forEach(e=>{let s=kt=>`${e==="default"?"":`${e}-`}${kt}`,r=this.getAttribute(s("wh")),n=d(r===null?this.getAttribute(s("w")):r),o=d(r===null?this.getAttribute(s("h")):r),l=this.getAttribute(s("op")),a=this.getAttribute(s("z")),h=N(this.getAttribute(s("ar"))),p=A(this.getAttribute(s("bgi"))),_=A(this.getAttribute(s("bgs"))),x=A(this.getAttribute(s("bgp"))),C=A(this.getAttribute(s("bgr"))),z=A(this.getAttribute(s("sst"))),O=A(this.getAttribute(s("sna"))),$=A(this.getAttribute(s("sns"))),k=A(this.getAttribute(s("sbh"))),W=$e(this.getAttribute(s("spi"))),q=A(this.getAttribute(s("stg")));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),h!==void 0&&(this._styles[e]["aspect-ratio"]=h),p!==null&&(this._styles[e]["background-image"]=p),_!==null&&(this._styles[e]["background-size"]=_),x!==null&&(this._styles[e]["background-position"]=x),C!==null&&(this._styles[e]["background-repeat"]=C),z!==null&&(this._styles[e]["scroll-snap-type"]=z),O!==null&&(this._styles[e]["scroll-snap-align"]=O),$!==null&&(this._styles[e]["scroll-snap-stop"]=$),k!==null&&(this._styles[e]["scroll-behavior"]=k),W!==null&&(this._styles[e]["scroll-padding-inline"]=W),q!==null&&(this._styles[e]["scroll-target-group"]=q),b({styleBucket:this._styles[e],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),b({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 J=this.getAttribute(s("d")),B=this.getAttribute(s("ah")),L=this.getAttribute(s("av")),Z=et({element:this,size:e,attr:"d"});J==="h"?this._styles[e]["flex-direction"]="row":J==="v"?this._styles[e]["flex-direction"]="column":e==="default"&&!J&&["sm","md","lg","xl"].some(ce=>this.hasAttribute(`${ce}-d`))&&(this._styles[e]["flex-direction"]="column");let oe=Z==="h",le=Z==="v"||!Z;oe&&(B==="c"?this._styles[e]["justify-content"]="center":B==="e"?this._styles[e]["justify-content"]="flex-end":B==="s"&&(this._styles[e]["justify-content"]="flex-start"),L==="c"?(this._styles[e]["align-items"]="center",this._styles[e]["align-content"]="center"):L==="e"?(this._styles[e]["align-items"]="flex-end",this._styles[e]["align-content"]="flex-end"):L==="s"&&(this._styles[e]["align-items"]="flex-start")),le&&(B!==null||L!==null)&&(B==="c"?this._styles[e]["align-items"]="center":B==="e"?this._styles[e]["align-items"]="flex-end":B==="s"&&(this._styles[e]["align-items"]="flex-start"),L==="c"?this._styles[e]["justify-content"]="center":L==="e"?this._styles[e]["justify-content"]="flex-end":L==="s"&&(this._styles[e]["justify-content"]="flex-start"));let ae=this.hasAttribute(s("wrap")),he=this.hasAttribute(s("no-wrap"));ae&&(this._styles[e]["flex-wrap"]="wrap"),he&&(this._styles[e]["flex-wrap"]="nowrap");let At=this.hasAttribute(s("sh")),Ct=this.hasAttribute(s("sv")),de=this.getAttribute(s("overflow"));At&&Ct?(this._styles[e].overflow="scroll",this._styles[e]["flex-wrap"]="nowrap"):At?(this._styles[e]["overflow-x"]="scroll",this._styles[e]["flex-wrap"]="nowrap"):Ct&&(this._styles[e]["overflow-y"]="scroll",this._styles[e]["flex-wrap"]="nowrap"),de==="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()}},Vt=({render:i,html:t})=>ht;var Be={ta:{s:"text-align: start;",c:"text-align: center;",e:"text-align: end;",j:"text-align: justify;"},s:{h1:`
|
|
464
659
|
font-size: var(--h1-font-size);
|
|
465
660
|
font-weight: var(--h1-font-weight);
|
|
466
661
|
line-height: var(--h1-line-height);
|
|
@@ -500,7 +695,7 @@ var rettangoli=(()=>{var B=`
|
|
|
500
695
|
font-weight: var(--xs-font-weight);
|
|
501
696
|
line-height: var(--xs-line-height);
|
|
502
697
|
letter-spacing: var(--xs-letter-spacing);
|
|
503
|
-
`}}
|
|
698
|
+
`}},Dt=v(Be);var Le={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);"}},Q=v(Le);var dt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
504
699
|
:host {
|
|
505
700
|
display: block;
|
|
506
701
|
font-size: var(--md-font-size);
|
|
@@ -519,12 +714,12 @@ var rettangoli=(()=>{var B=`
|
|
|
519
714
|
text-decoration: var(--anchor-text-decoration-hover);
|
|
520
715
|
color: var(--anchor-color-hover);
|
|
521
716
|
}
|
|
522
|
-
${
|
|
523
|
-
${
|
|
524
|
-
${
|
|
717
|
+
${T}
|
|
718
|
+
${Dt}
|
|
719
|
+
${Q}
|
|
720
|
+
${g}
|
|
525
721
|
${m}
|
|
526
|
-
|
|
527
|
-
`))}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=""),L({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=O({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}},zt=({render:i,html:t})=>tt;var D={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},pe={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:D,bwt:D,bwr:D,bwb:D,bwl:D,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"}},It=i=>b(pe,{},i);var me={mt:d,mr:d,mb:d,ml:d,m:d,mh:d,mv:d},Bt=i=>b(me,{},i);var et=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
722
|
+
`))}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=d(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=""),P({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=M({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}},jt=({render:i,html:t})=>dt;var D={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},Te={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:D,bwt:D,bwr:D,bwb:D,bwl:D,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"}},Ut=i=>v(Te,{},i);var Me={mt:u,mr:u,mb:u,ml:u,m:u,mh:u,mv:u},Ht=i=>v(Me,{},i);var ct=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
528
723
|
:host {
|
|
529
724
|
display: contents;
|
|
530
725
|
}
|
|
@@ -559,10 +754,10 @@ var rettangoli=(()=>{var B=`
|
|
|
559
754
|
width: 100%;
|
|
560
755
|
}
|
|
561
756
|
|
|
562
|
-
${
|
|
563
|
-
${
|
|
564
|
-
${
|
|
565
|
-
`))}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 y([...
|
|
757
|
+
${Ut("img, a")}
|
|
758
|
+
${Ht("img, a")}
|
|
759
|
+
${m}
|
|
760
|
+
`))}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 y([...E,"key","src","alt","href","new-tab","rel","wh","w","h","ar","hide","show","op","z","of"])}_styles=f();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=tt({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=f(),S.forEach(e=>{let s=p=>`${e==="default"?"":`${e}-`}${p}`,r=this.getAttribute(s("wh")),n=d(r===null?this.getAttribute(s("w")):r),o=d(r===null?this.getAttribute(s("h")):r),l=this.getAttribute(s("op")),a=this.getAttribute(s("z")),h=N(this.getAttribute(s("ar")));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),h!==void 0&&(this._styles[e]["aspect-ratio"]=h),b({styleBucket:this._styles[e],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),b({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")}},qt=({render:i,html:t})=>ct;var Oe={s:{sm:`
|
|
566
761
|
height: 20px;
|
|
567
762
|
padding-left: 8px;
|
|
568
763
|
padding-right: 8px;
|
|
@@ -615,7 +810,7 @@ var rettangoli=(()=>{var B=`
|
|
|
615
810
|
background-color: var(--destructive);
|
|
616
811
|
color: var(--destructive-foreground);
|
|
617
812
|
border-color: transparent;
|
|
618
|
-
`}},
|
|
813
|
+
`}},Gt=v(Oe,{},".surface");var ut=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
619
814
|
:host {
|
|
620
815
|
display: inline-flex;
|
|
621
816
|
min-width: 0;
|
|
@@ -711,13 +906,13 @@ var rettangoli=(()=>{var B=`
|
|
|
711
906
|
opacity: 1;
|
|
712
907
|
}
|
|
713
908
|
|
|
714
|
-
${
|
|
909
|
+
${Gt}
|
|
715
910
|
:host .surface {
|
|
716
911
|
border-radius: var(--tag-border-radius) !important;
|
|
717
912
|
}
|
|
913
|
+
${g}
|
|
718
914
|
${m}
|
|
719
|
-
|
|
720
|
-
`))}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"));L({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}))}},Wt=({render:i,html:t})=>it;var Lt=u`
|
|
915
|
+
`))}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=d(this.getAttribute("w"));P({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}))}},Kt=({render:i,html:t})=>ut;var Xt=c`
|
|
721
916
|
:host([pt="xs"]) svg {
|
|
722
917
|
padding-top: var(--spacing-xs);
|
|
723
918
|
}
|
|
@@ -833,16 +1028,16 @@ var rettangoli=(()=>{var B=`
|
|
|
833
1028
|
padding-top: var(--spacing-xl);
|
|
834
1029
|
padding-bottom: var(--spacing-xl);
|
|
835
1030
|
}
|
|
836
|
-
`;var
|
|
1031
|
+
`;var pt=class i extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
837
1032
|
:host {
|
|
838
1033
|
color: var(--foreground);
|
|
839
1034
|
flex-shrink: 0;
|
|
840
1035
|
}
|
|
841
|
-
${
|
|
842
|
-
${
|
|
1036
|
+
${Q}
|
|
1037
|
+
${Xt}
|
|
1038
|
+
${g}
|
|
843
1039
|
${m}
|
|
844
|
-
|
|
845
|
-
`))}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=""}},Mt=({render:i,html:t})=>st;var fe=["mt","mr","mb","ml","m","mh","mv","cur"],rt=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`
|
|
1040
|
+
`))}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=d(t===null?this.getAttribute("w"):t),s=d(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=""}},Yt=({render:i,html:t})=>pt;var Re=["mt","mr","mb","ml","m","mh","mv","cur"],mt=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(c`
|
|
846
1041
|
:host {
|
|
847
1042
|
display: contents;
|
|
848
1043
|
}
|
|
@@ -904,9 +1099,9 @@ var rettangoli=(()=>{var B=`
|
|
|
904
1099
|
input[type="datetime-local"]::-webkit-date-and-time-value {
|
|
905
1100
|
text-align: left;
|
|
906
1101
|
}
|
|
1102
|
+
${g}
|
|
907
1103
|
${m}
|
|
908
|
-
|
|
909
|
-
`))}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",...y([...fe,"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(),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),f({styleBucket:this._styles[e],axis:"width",dimension:n,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=_(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()}},z=({render:i,html:t})=>rt;var be=z({}),N="date",nt=class extends be{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)}},Tt=({render:i,html:t})=>nt;var ve=z({}),V="time",ot=class extends ve{connectedCallback(){this.getAttribute("type")!==V&&super.setAttribute("type",V),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,e,s){if(t==="type"&&s!==V){this.getAttribute("type")!==V&&super.setAttribute("type",V);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,e,s)}},Dt=({render:i,html:t})=>ot;var ye=z({}),F="datetime-local",lt=class extends ye{connectedCallback(){this.getAttribute("type")!==F&&super.setAttribute("type",F),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,e,s){if(t==="type"&&s!==F){this.getAttribute("type")!==F&&super.setAttribute("type",F);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,e,s)}},Nt=({render:i,html:t})=>lt;var _e=["mt","mr","mb","ml","m","mh","mv","cur"],at=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`
|
|
1104
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=f(),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",...y([...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()}_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=f(),S.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,r=this.getAttribute(s("wh")),n=d(r===null?this.getAttribute(s("w")):r),o=d(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),b({styleBucket:this._styles[e],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),b({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",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()}},I=({render:i,html:t})=>mt;var We=I({}),j="date",gt=class extends We{connectedCallback(){this.getAttribute("type")!==j&&super.setAttribute("type",j),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,e,s){if(t==="type"&&s!==j){this.getAttribute("type")!==j&&super.setAttribute("type",j);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,e,s)}},Qt=({render:i,html:t})=>gt;var Fe=I({}),U="time",ft=class extends Fe{connectedCallback(){this.getAttribute("type")!==U&&super.setAttribute("type",U),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,e,s){if(t==="type"&&s!==U){this.getAttribute("type")!==U&&super.setAttribute("type",U);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,e,s)}},Jt=({render:i,html:t})=>ft;var Pe=I({}),H="datetime-local",bt=class extends Pe{connectedCallback(){this.getAttribute("type")!==H&&super.setAttribute("type",H),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,e,s){if(t==="type"&&s!==H){this.getAttribute("type")!==H&&super.setAttribute("type",H);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,e,s)}},Zt=({render:i,html:t})=>bt;var Ne=["mt","mr","mb","ml","m","mh","mv","cur"],vt=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(c`
|
|
910
1105
|
:host {
|
|
911
1106
|
display: contents;
|
|
912
1107
|
}
|
|
@@ -939,9 +1134,9 @@ var rettangoli=(()=>{var B=`
|
|
|
939
1134
|
input:disabled {
|
|
940
1135
|
cursor: not-allowed;
|
|
941
1136
|
}
|
|
1137
|
+
${g}
|
|
942
1138
|
${m}
|
|
943
|
-
|
|
944
|
-
`))}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",...y([..._e,"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(),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),f({styleBucket:this._styles[e],axis:"width",dimension:n,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=_(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()}},Vt=({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`
|
|
1139
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=f(),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",...y([...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()}_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=f(),S.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,r=this.getAttribute(s("wh")),n=d(r===null?this.getAttribute(s("w")):r),o=d(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),b({styleBucket:this._styles[e],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),b({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 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()}},te=({render:i,html:t})=>vt;var _t=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
945
1140
|
:host {
|
|
946
1141
|
display: contents;
|
|
947
1142
|
}
|
|
@@ -967,9 +1162,9 @@ var rettangoli=(()=>{var B=`
|
|
|
967
1162
|
textarea:disabled {
|
|
968
1163
|
cursor: not-allowed;
|
|
969
1164
|
}
|
|
1165
|
+
${g}
|
|
970
1166
|
${m}
|
|
971
|
-
|
|
972
|
-
`))}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",...y([...k,"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=E=>`${n==="default"?"":`${n}-`}${E}`,l=this.getAttribute(o("wh")),a=c(l===null?this.getAttribute(o("w")):l),h=c(l===null?this.getAttribute(o("h")):l),v=this.getAttribute(o("op")),x=this.getAttribute(o("z"));x!==null&&(this._styles[n]["z-index"]=x),v!==null&&(this._styles[n].opacity=v),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=_(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")}},Ft=({render:i,html:t})=>ht;var we=["mt","mr","mb","ml","m","mh","mv","cur"],xe=/^#[0-9a-fA-F]{6}$/,dt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
1167
|
+
`))}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",...y([...E,"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=x=>`${n==="default"?"":`${n}-`}${x}`,l=this.getAttribute(o("wh")),a=d(l===null?this.getAttribute(o("w")):l),h=d(l===null?this.getAttribute(o("h")):l),p=this.getAttribute(o("op")),_=this.getAttribute(o("z"));_!==null&&(this._styles[n]["z-index"]=_),p!==null&&(this._styles[n].opacity=p),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=w(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")}},ee=({render:i,html:t})=>_t;var Ve=["mt","mr","mb","ml","m","mh","mv","cur"],De=/^#[0-9a-fA-F]{6}$/,yt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
973
1168
|
:host {
|
|
974
1169
|
display: contents;
|
|
975
1170
|
}
|
|
@@ -990,9 +1185,9 @@ var rettangoli=(()=>{var B=`
|
|
|
990
1185
|
cursor: not-allowed;
|
|
991
1186
|
opacity: 0.5;
|
|
992
1187
|
}
|
|
1188
|
+
${g}
|
|
993
1189
|
${m}
|
|
994
|
-
|
|
995
|
-
`))}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",...y([...we,"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(),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),f({styleBucket:this._styles[e],axis:"width",dimension:n,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=_(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=xe.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()}},jt=({render:i,html:t})=>dt;var ut=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
1190
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=f(),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",...y([...Ve,"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=f(),S.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,r=this.getAttribute(s("wh")),n=d(r===null?this.getAttribute(s("w")):r),o=d(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),b({styleBucket:this._styles[e],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),b({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=De.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()}},ie=({render:i,html:t})=>yt;var wt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
996
1191
|
:host {
|
|
997
1192
|
display: contents;
|
|
998
1193
|
}
|
|
@@ -1044,9 +1239,9 @@ var rettangoli=(()=>{var B=`
|
|
|
1044
1239
|
input[type="range"]:disabled::-moz-range-thumb {
|
|
1045
1240
|
cursor: not-allowed;
|
|
1046
1241
|
}
|
|
1242
|
+
${g}
|
|
1047
1243
|
${m}
|
|
1048
|
-
|
|
1049
|
-
`))}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",...y([...k,"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=E=>`${n==="default"?"":`${n}-`}${E}`,l=this.getAttribute(o("wh")),a=c(l===null?this.getAttribute(o("w")):l),h=c(l===null?this.getAttribute(o("h")):l),v=this.getAttribute(o("op")),x=this.getAttribute(o("z"));x!==null&&(this._styles[n]["z-index"]=x),v!==null&&(this._styles[n].opacity=v),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=_(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()}},Pt=({render:i,html:t})=>ut;var ct=40,Se=6,pt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
1244
|
+
`))}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",...y([...E,"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=x=>`${n==="default"?"":`${n}-`}${x}`,l=this.getAttribute(o("wh")),a=d(l===null?this.getAttribute(o("w")):l),h=d(l===null?this.getAttribute(o("h")):l),p=this.getAttribute(o("op")),_=this.getAttribute(o("z"));_!==null&&(this._styles[n]["z-index"]=_),p!==null&&(this._styles[n].opacity=p),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=w(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()}},se=({render:i,html:t})=>wt;var xt=40,je=6,St=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
1050
1245
|
:host {
|
|
1051
1246
|
display: contents;
|
|
1052
1247
|
}
|
|
@@ -1123,7 +1318,7 @@ var rettangoli=(()=>{var B=`
|
|
|
1123
1318
|
animation: none;
|
|
1124
1319
|
}
|
|
1125
1320
|
}
|
|
1126
|
-
`))}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<
|
|
1321
|
+
`))}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<je&&(this._layoutRetryCount+=1,this._scheduleAdaptiveCentering());return}this._layoutRetryCount=0;let s=window.innerHeight;if(e>=s-2*xt){this._slotElement.style.marginTop=`${xt}px`,this._slotElement.style.marginBottom=`${xt}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}},re=({render:i,html:t})=>St;var Et=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
1127
1322
|
:host {
|
|
1128
1323
|
display: contents;
|
|
1129
1324
|
}
|
|
@@ -1177,4 +1372,4 @@ var rettangoli=(()=>{var B=`
|
|
|
1177
1372
|
min-width: 200px;
|
|
1178
1373
|
max-width: 400px;
|
|
1179
1374
|
}
|
|
1180
|
-
`))}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}},
|
|
1375
|
+
`))}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}},ne=({render:i,html:t})=>Et;customElements.define("rtgl-button",Tt({}));customElements.define("rtgl-carousel",Ft({}));customElements.define("rtgl-grid",Pt({}));customElements.define("rtgl-view",Vt({}));customElements.define("rtgl-text",jt({}));customElements.define("rtgl-image",qt({}));customElements.define("rtgl-tag",Kt({}));customElements.define("rtgl-svg",Yt({}));customElements.define("rtgl-input",I({}));customElements.define("rtgl-input-date",Qt({}));customElements.define("rtgl-input-time",Jt({}));customElements.define("rtgl-input-datetime",Zt({}));customElements.define("rtgl-input-number",te({}));customElements.define("rtgl-textarea",ee({}));customElements.define("rtgl-color-picker",ie({}));customElements.define("rtgl-slider",se({}));customElements.define("rtgl-dialog",re({}));customElements.define("rtgl-popover",ne({}));})();
|