@rettangoli/ui 1.0.5 → 1.0.8
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 +145 -125
- package/dist/rettangoli-iife-ui.min.js +159 -139
- package/package.json +6 -10
- package/src/common/aspectRatio.js +22 -0
- package/src/common.js +2 -0
- package/src/components/card/card.schema.yaml +15 -0
- package/src/components/card/card.store.js +87 -0
- package/src/components/card/card.view.yaml +18 -0
- 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/grid.js +220 -0
- package/src/primitives/image.js +9 -0
- package/src/primitives/view.js +9 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var rettangoli=(()=>{var
|
|
1
|
+
var rettangoli=(()=>{var $=`
|
|
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
|
+
`,L=({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")},z=({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 L({linkElement:o,href:s,newTab:r,rel:n}),o.parentNode!==i&&i.appendChild(o),o},U=({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 L({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"],g=()=>S.reduce((i,t)=>(i[t]={},i),{}),gt=["sm","md","lg","xl"],qt=({size:i,attr:t})=>i==="default"?t:`${i}-${t}`,Gt=({size:i,includeDefault:t=!0})=>{if(i==="default")return["default"];let e=gt.indexOf(i);if(e===-1)return t?["default"]:[];let s=gt.slice(e);return t&&s.push("default"),s},K=({element:i,size:t,attr:e,includeDefault:s=!0})=>{let r=Gt({size:t,includeDefault:s});for(let n of r){let o=qt({size:n,attr:e}),l=i.getAttribute(o);if(l!==null)return l}return null};var Ut=/^([1-9]|1[0-2])fg$/,Kt=/^([1-9]\d*)\/([1-9]\d*)fb$/,X=i=>typeof i=="string"&&Ut.test(i),ft=i=>{if(typeof i!="string")return null;let t=i.match(Kt);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 bt({numerator:i,denominator:t,gapVar:e}){return i===t?"100%":i===1?`calc((100% - ((${t} - 1) * ${e})) / ${t})`:`calc(((100% - ((${t} - 1) * ${e})) * ${i}) / ${t})`}var f=({styleBucket:i,axis:t,dimension:e,fillValue:s,allowFlexGrow: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&&X(e)){i["flex-grow"]=e.slice(0,-2),i["flex-basis"]="0%",i[`min-${t}`]=n,i[`max-${t}`]="unset";return}let h=r?ft(e):null;if(h){i["flex-grow"]="0",i["flex-shrink"]="0",i["flex-basis"]=bt({...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)},M=({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&&X(t)){i.width="",i.flexGrow=t.slice(0,-2),i.flexShrink="",i.flexBasis="0%",i.minWidth=r;return}let n=s?ft(t):null;if(n){i.width="",i.flexGrow="0",i.flexShrink="0",i.flexBasis=bt({...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 Xt=i=>`${i}`.trim().replace(/\s*\/\s*/g,"/"),T=i=>{if(i==null)return;let t=Xt(i);if(t.length!==0)return typeof CSS<"u"&&typeof CSS.supports=="function"?CSS.supports("aspect-ratio",t)?t:void 0:t};function u(i,...t){let e="";return i.forEach((s,r)=>{e+=s+(t[r]||"")}),e}var Yt=["sm","md","lg","xl"],vt={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(vt),w=i=>i.concat(Yt.flatMap(t=>i.map(e=>`${t}-${e}`))),yt={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(yt)){r!=="default"&&(s+=`${n} {`);for(let[o,l]of Object.entries(i))for(let[a,h]of Object.entries(l)){let y=vt[o],b=h.startsWith("--")?`var(${h})`:h,_=r==="default"?o:`${r}-${o}`,A=r==="default"?`h-${o}`:`${r}-h-${o}`,I=(R,B=!1)=>{let C=B?`:host([${R}="${a}"]:hover)`:`:host([${R}="${a}"])`;if(e)return e.split(",").map(P=>`${C} ${P.trim()}`).join(", ");let W=t[o];return W?`${C} ${W}`:C};if(y){let B=y.split(" ").map(C=>`${C}: ${b};`).join(" ");s+=`
|
|
16
|
+
${I(_)}{
|
|
17
|
+
${B}
|
|
18
18
|
}
|
|
19
|
-
${
|
|
20
|
-
${
|
|
19
|
+
${I(A,!0)}{
|
|
20
|
+
${B}
|
|
21
21
|
}
|
|
22
22
|
`}else s+=`
|
|
23
|
-
${
|
|
23
|
+
${I(_)}{
|
|
24
24
|
${h}
|
|
25
25
|
}
|
|
26
|
-
${
|
|
26
|
+
${I(A,!0)}{
|
|
27
27
|
${h}
|
|
28
28
|
}
|
|
29
|
-
`}r!=="default"&&(s+="}")}return s};function
|
|
29
|
+
`}r!=="default"&&(s+="}")}return s};function Qt(i){if(i===null||i.includes("/"))return!1;let t=String(i);return/[0-9]$/.test(t)}var Jt=i=>/%$/.test(i),Zt=i=>/^([1-9]|1[0-2])fg$/.test(i),c=i=>{if(i!=null)return Zt(i)||Jt(i)?i:Qt(i)?`${i}px`:Object.keys(d).includes(i)?`var(${d[i]})`:i},d={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function x(i,t=":host"){let e="",s=["default","xl","lg","md","sm"];for(let r of s){let n=yt[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 te={mt:d,mr:d,mb:d,ml:d,m:d,mh:d,mv:d,s:{sm:`
|
|
36
36
|
height: 28px;
|
|
37
37
|
padding-left: 12px;
|
|
38
38
|
padding-right: 12px;
|
|
@@ -81,7 +81,7 @@ var rettangoli=(()=>{var B=`
|
|
|
81
81
|
`,lk:`
|
|
82
82
|
background-color: transparent;
|
|
83
83
|
color: var(--foreground);
|
|
84
|
-
`}},
|
|
84
|
+
`}},_t=v(te,{},".surface");var ee=[{prefix:"sm",maxWidth:640},{prefix:"md",maxWidth:768},{prefix:"lg",maxWidth:1024},{prefix:"xl",maxWidth:1280}],Y=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
85
85
|
:host {
|
|
86
86
|
display: inline-flex;
|
|
87
87
|
}
|
|
@@ -248,79 +248,8 @@ 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
|
|
253
|
-
|
|
254
|
-
:host([d="h"]) {
|
|
255
|
-
flex-direction: row;
|
|
256
|
-
}
|
|
257
|
-
:host([d="v"]) {
|
|
258
|
-
flex-direction: column;
|
|
259
|
-
}
|
|
260
|
-
:host([d="h"]:not([ah])) {
|
|
261
|
-
justify-content: flex-start;
|
|
262
|
-
}
|
|
263
|
-
:host([d="h"][ah="c"]) {
|
|
264
|
-
justify-content: center;
|
|
265
|
-
}
|
|
266
|
-
:host([d="h"][ah="e"]) {
|
|
267
|
-
justify-content: flex-end;
|
|
268
|
-
}
|
|
269
|
-
:host([d="h"]:not([av])) {
|
|
270
|
-
align-items: flex-start;
|
|
271
|
-
}
|
|
272
|
-
:host([d="h"][av="c"]) {
|
|
273
|
-
align-items: center;
|
|
274
|
-
align-content: center;
|
|
275
|
-
}
|
|
276
|
-
:host([d="h"][av="e"]) {
|
|
277
|
-
align-items: flex-end;
|
|
278
|
-
align-content: flex-end;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
/* Default/vertical direction - horizontal alignment */
|
|
282
|
-
:host(:not([d]):not([ah])),
|
|
283
|
-
:host([d="v"]:not([ah])) {
|
|
284
|
-
align-items: flex-start;
|
|
285
|
-
}
|
|
286
|
-
:host(:not([d])[ah="c"]),
|
|
287
|
-
:host([d="v"][ah="c"]) {
|
|
288
|
-
align-items: center;
|
|
289
|
-
}
|
|
290
|
-
:host(:not([d])[ah="e"]),
|
|
291
|
-
:host([d="v"][ah="e"]) {
|
|
292
|
-
align-items: flex-end;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
:host(:not([d]):not([av])),
|
|
296
|
-
:host([d="v"]:not([av])) {
|
|
297
|
-
justify-content: flex-start;
|
|
298
|
-
}
|
|
299
|
-
:host(:not([d])[av="c"]),
|
|
300
|
-
:host([d="v"][av="c"]) {
|
|
301
|
-
justify-content: center;
|
|
302
|
-
}
|
|
303
|
-
:host(:not([d])[av="e"]),
|
|
304
|
-
:host([d="v"][av="e"]) {
|
|
305
|
-
justify-content: flex-end;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
@media screen and (max-width: 640px) {
|
|
309
|
-
:host([sm-d="v"]) {
|
|
310
|
-
flex-direction: column;
|
|
311
|
-
}
|
|
312
|
-
:host([sm-d="h"]) {
|
|
313
|
-
flex-direction: row;
|
|
314
|
-
}
|
|
315
|
-
:host([sm-d="h"][sm-av="c"]) {
|
|
316
|
-
align-items: center;
|
|
317
|
-
align-content: center;
|
|
318
|
-
}
|
|
319
|
-
:host([sm-d="v"][sm-av="c"]) {
|
|
320
|
-
justify-content: center;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
`;var Qt={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out"}},p=m(Qt);var yt=u`
|
|
251
|
+
${_t}
|
|
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 ee){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?(L({linkElement:this._surfaceElement,href:e,newTab:s,rel:r}),this._surfaceElement.removeAttribute("disabled")):(this._surfaceElement.removeAttribute("href"),this._surfaceElement.removeAttribute("target"),this._surfaceElement.removeAttribute("rel"),t?this._surfaceElement.setAttribute("disabled",""):this._surfaceElement.removeAttribute("disabled")),this.shadow.appendChild(this._surfaceElement),this._containerElement=this._surfaceElement}_updateIcon(){this._prefixIcon&&(this._prefixIcon.remove(),this._prefixIcon=null),this._suffixIcon&&(this._suffixIcon.remove(),this._suffixIcon=null);let t={sm:14,md:18,lg:22},e=this._resolveResponsiveSizeToken(),s=18;this.hasAttribute("sq")?s={sm:14,lg:22}[e]||18:s=t[e]||18;let r=this.getAttribute("pre");r&&(this._prefixIcon=document.createElement("rtgl-svg"),this._prefixIcon.setAttribute("svg",r),this._prefixIcon.setAttribute("wh",s.toString()),this._prefixIcon.style.color="inherit",this._surfaceElement.insertBefore(this._prefixIcon,this._slotElement));let n=this.getAttribute("suf");n&&(this._suffixIcon=document.createElement("rtgl-svg"),this._suffixIcon.setAttribute("svg",n),this._suffixIcon.setAttribute("wh",s.toString()),this._suffixIcon.style.color="inherit",this._surfaceElement.appendChild(this._suffixIcon))}_updateWidth(){let t=c(this.getAttribute("w"));t==="f"?(this.style.width="var(--width-stretch)",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):t!=null?(this.style.width=t,this.style.minWidth=t,this.style.maxWidth=t,this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):(this.style.width="",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth="")}getBoundingClientRect(){return this._surfaceElement?this._surfaceElement.getBoundingClientRect():super.getBoundingClientRect()}},wt=({render:i,html:t})=>Y;var ie={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out"}},p=v(ie);var H=u`
|
|
324
253
|
:host([sh]:not([sv])) {
|
|
325
254
|
overflow-x: scroll;
|
|
326
255
|
flex-wrap: nowrap;
|
|
@@ -367,7 +296,7 @@ var rettangoli=(()=>{var B=`
|
|
|
367
296
|
flex-wrap: nowrap;
|
|
368
297
|
}
|
|
369
298
|
|
|
370
|
-
`;var
|
|
299
|
+
`;var D={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},se={bgc:{pr:`
|
|
371
300
|
background-color: var(--primary);
|
|
372
301
|
`,se:`
|
|
373
302
|
background-color: var(--secondary);
|
|
@@ -407,7 +336,7 @@ var rettangoli=(()=>{var B=`
|
|
|
407
336
|
left: 0;
|
|
408
337
|
top: 0;
|
|
409
338
|
height: 100%;
|
|
410
|
-
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:d,pr:d,pb:d,pl:d,p:d,ph:d,pv:d,g:d,gv:d,gh:d,bw:
|
|
339
|
+
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:d,pr:d,pb:d,pl:d,p:d,ph:d,pv:d,g:d,gv:d,gh:d,bw: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"}},q=v(se);var re={mt:d,mr:d,mb:d,ml:d,m:d,mh:d,mv:d},m=v(re);var O=u`
|
|
411
340
|
a, a:link, a:visited, a:hover, a:active {
|
|
412
341
|
color: inherit;
|
|
413
342
|
text-decoration: none;
|
|
@@ -417,7 +346,98 @@ var rettangoli=(()=>{var B=`
|
|
|
417
346
|
margin: 0;
|
|
418
347
|
font: inherit;
|
|
419
348
|
}
|
|
420
|
-
`;var
|
|
349
|
+
`;var ne=i=>{if(i==null)return null;let t=i.trim();return t===""?null:/^[1-9]\d*$/.test(t)?`repeat(${t}, minmax(0, 1fr))`:t},Q=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
350
|
+
slot {
|
|
351
|
+
display: contents;
|
|
352
|
+
}
|
|
353
|
+
:host {
|
|
354
|
+
display: grid;
|
|
355
|
+
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
356
|
+
align-self: auto;
|
|
357
|
+
border-style: solid;
|
|
358
|
+
border-width: 0;
|
|
359
|
+
box-sizing: border-box;
|
|
360
|
+
border-color: var(--border);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
${H}
|
|
364
|
+
${m}
|
|
365
|
+
${p}
|
|
366
|
+
${q}
|
|
367
|
+
${O}
|
|
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",...w([...E,"cols","op","wh","w","h","hide","show","sh","sv","z","overflow"])]}_styles=g();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=z({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=g(),S.forEach(e=>{let s=A=>`${e==="default"?"":`${e}-`}${A}`,r=this.getAttribute(s("wh")),n=c(r===null?this.getAttribute(s("w")):r),o=c(r===null?this.getAttribute(s("h")):r),l=ne(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),f({styleBucket:this._styles[e],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),f({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="grid");let y=this.hasAttribute(s("sh")),b=this.hasAttribute(s("sv")),_=this.getAttribute(s("overflow"));y&&b?this._styles[e].overflow="scroll":y?this._styles[e]["overflow-x"]="scroll":b&&(this._styles[e]["overflow-y"]="scroll"),_==="hidden"&&(this._styles[e].overflow="hidden")});let t=x(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,e,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}e!==s&&this.updateStyles()}},xt=({render:i,html:t})=>Q;var St=u`
|
|
370
|
+
|
|
371
|
+
:host([d="h"]) {
|
|
372
|
+
flex-direction: row;
|
|
373
|
+
}
|
|
374
|
+
:host([d="v"]) {
|
|
375
|
+
flex-direction: column;
|
|
376
|
+
}
|
|
377
|
+
:host([d="h"]:not([ah])) {
|
|
378
|
+
justify-content: flex-start;
|
|
379
|
+
}
|
|
380
|
+
:host([d="h"][ah="c"]) {
|
|
381
|
+
justify-content: center;
|
|
382
|
+
}
|
|
383
|
+
:host([d="h"][ah="e"]) {
|
|
384
|
+
justify-content: flex-end;
|
|
385
|
+
}
|
|
386
|
+
:host([d="h"]:not([av])) {
|
|
387
|
+
align-items: flex-start;
|
|
388
|
+
}
|
|
389
|
+
:host([d="h"][av="c"]) {
|
|
390
|
+
align-items: center;
|
|
391
|
+
align-content: center;
|
|
392
|
+
}
|
|
393
|
+
:host([d="h"][av="e"]) {
|
|
394
|
+
align-items: flex-end;
|
|
395
|
+
align-content: flex-end;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/* Default/vertical direction - horizontal alignment */
|
|
399
|
+
:host(:not([d]):not([ah])),
|
|
400
|
+
:host([d="v"]:not([ah])) {
|
|
401
|
+
align-items: flex-start;
|
|
402
|
+
}
|
|
403
|
+
:host(:not([d])[ah="c"]),
|
|
404
|
+
:host([d="v"][ah="c"]) {
|
|
405
|
+
align-items: center;
|
|
406
|
+
}
|
|
407
|
+
:host(:not([d])[ah="e"]),
|
|
408
|
+
:host([d="v"][ah="e"]) {
|
|
409
|
+
align-items: flex-end;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
:host(:not([d]):not([av])),
|
|
413
|
+
:host([d="v"]:not([av])) {
|
|
414
|
+
justify-content: flex-start;
|
|
415
|
+
}
|
|
416
|
+
:host(:not([d])[av="c"]),
|
|
417
|
+
:host([d="v"][av="c"]) {
|
|
418
|
+
justify-content: center;
|
|
419
|
+
}
|
|
420
|
+
:host(:not([d])[av="e"]),
|
|
421
|
+
:host([d="v"][av="e"]) {
|
|
422
|
+
justify-content: flex-end;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
@media screen and (max-width: 640px) {
|
|
426
|
+
:host([sm-d="v"]) {
|
|
427
|
+
flex-direction: column;
|
|
428
|
+
}
|
|
429
|
+
:host([sm-d="h"]) {
|
|
430
|
+
flex-direction: row;
|
|
431
|
+
}
|
|
432
|
+
:host([sm-d="h"][sm-av="c"]) {
|
|
433
|
+
align-items: center;
|
|
434
|
+
align-content: center;
|
|
435
|
+
}
|
|
436
|
+
:host([sm-d="v"][sm-av="c"]) {
|
|
437
|
+
justify-content: center;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
`;var J=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
421
441
|
slot {
|
|
422
442
|
display: contents;
|
|
423
443
|
}
|
|
@@ -433,14 +453,14 @@ var rettangoli=(()=>{var B=`
|
|
|
433
453
|
}
|
|
434
454
|
|
|
435
455
|
|
|
436
|
-
${
|
|
437
|
-
${
|
|
438
|
-
${
|
|
456
|
+
${H}
|
|
457
|
+
${St}
|
|
458
|
+
${m}
|
|
439
459
|
${p}
|
|
440
|
-
${
|
|
441
|
-
${
|
|
442
|
-
${
|
|
443
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...
|
|
460
|
+
${q}
|
|
461
|
+
${O}
|
|
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",...w([...E,"op","wh","w","h","ar","hide","show","sh","sv","z","d","ah","av","wrap","no-wrap","overflow"])]}_styles=g();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=z({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=g(),S.forEach(e=>{let s=mt=>`${e==="default"?"":`${e}-`}${mt}`,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")),h=T(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),f({styleBucket:this._styles[e],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),f({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="flex");let y=this.getAttribute(s("d")),b=this.getAttribute(s("ah")),_=this.getAttribute(s("av")),A=K({element:this,size:e,attr:"d"});y==="h"?this._styles[e]["flex-direction"]="row":y==="v"?this._styles[e]["flex-direction"]="column":e==="default"&&!y&&["sm","md","lg","xl"].some(Ht=>this.hasAttribute(`${Ht}-d`))&&(this._styles[e]["flex-direction"]="column");let I=A==="h",R=A==="v"||!A;I&&(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"),_==="c"?(this._styles[e]["align-items"]="center",this._styles[e]["align-content"]="center"):_==="e"?(this._styles[e]["align-items"]="flex-end",this._styles[e]["align-content"]="flex-end"):_==="s"&&(this._styles[e]["align-items"]="flex-start")),R&&(b!==null||_!==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"),_==="c"?this._styles[e]["justify-content"]="center":_==="e"?this._styles[e]["justify-content"]="flex-end":_==="s"&&(this._styles[e]["justify-content"]="flex-start"));let B=this.hasAttribute(s("wrap")),C=this.hasAttribute(s("no-wrap"));B&&(this._styles[e]["flex-wrap"]="wrap"),C&&(this._styles[e]["flex-wrap"]="nowrap");let W=this.hasAttribute(s("sh")),P=this.hasAttribute(s("sv")),Pt=this.getAttribute(s("overflow"));W&&P?(this._styles[e].overflow="scroll",this._styles[e]["flex-wrap"]="nowrap"):W?(this._styles[e]["overflow-x"]="scroll",this._styles[e]["flex-wrap"]="nowrap"):P&&(this._styles[e]["overflow-y"]="scroll",this._styles[e]["flex-wrap"]="nowrap"),Pt==="hidden"&&(this._styles[e].overflow="hidden",this._styles[e]["flex-wrap"]="nowrap")});let t=x(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,e,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}e!==s&&this.updateStyles()}},Et=({render:i,html:t})=>J;var oe={ta:{s:"text-align: start;",c:"text-align: center;",e:"text-align: end;",j:"text-align: justify;"},s:{h1:`
|
|
444
464
|
font-size: var(--h1-font-size);
|
|
445
465
|
font-weight: var(--h1-font-weight);
|
|
446
466
|
line-height: var(--h1-line-height);
|
|
@@ -480,7 +500,7 @@ var rettangoli=(()=>{var B=`
|
|
|
480
500
|
font-weight: var(--xs-font-weight);
|
|
481
501
|
line-height: var(--xs-line-height);
|
|
482
502
|
letter-spacing: var(--xs-letter-spacing);
|
|
483
|
-
`}},
|
|
503
|
+
`}},At=v(oe);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);"}},G=v(le);var Z=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
484
504
|
:host {
|
|
485
505
|
display: block;
|
|
486
506
|
font-size: var(--md-font-size);
|
|
@@ -499,12 +519,12 @@ var rettangoli=(()=>{var B=`
|
|
|
499
519
|
text-decoration: var(--anchor-text-decoration-hover);
|
|
500
520
|
color: var(--anchor-color-hover);
|
|
501
521
|
}
|
|
502
|
-
${
|
|
503
|
-
${
|
|
504
|
-
${
|
|
505
|
-
${
|
|
522
|
+
${$}
|
|
523
|
+
${At}
|
|
524
|
+
${G}
|
|
525
|
+
${m}
|
|
506
526
|
${p}
|
|
507
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","new-tab","rel"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,e,s){t==="href"||t==="new-tab"||t==="rel"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=c(this.getAttribute("w"));this.hasAttribute("ellipsis")?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace=""),
|
|
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=""),M({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=z({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}},kt=({render:i,html:t})=>Z;var N={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},ae={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:N,bwt:N,bwr:N,bwb:N,bwl:N,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"}},Ct=i=>v(ae,{},i);var he={mt:d,mr:d,mb:d,ml:d,m:d,mh:d,mv:d},$t=i=>v(he,{},i);var tt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
508
528
|
:host {
|
|
509
529
|
display: contents;
|
|
510
530
|
}
|
|
@@ -531,7 +551,7 @@ var rettangoli=(()=>{var B=`
|
|
|
531
551
|
height: auto;
|
|
532
552
|
}
|
|
533
553
|
|
|
534
|
-
${
|
|
554
|
+
${O}
|
|
535
555
|
|
|
536
556
|
a {
|
|
537
557
|
display: block;
|
|
@@ -539,10 +559,10 @@ var rettangoli=(()=>{var B=`
|
|
|
539
559
|
width: 100%;
|
|
540
560
|
}
|
|
541
561
|
|
|
542
|
-
${
|
|
543
|
-
${
|
|
562
|
+
${Ct("img, a")}
|
|
563
|
+
${$t("img, a")}
|
|
544
564
|
${p}
|
|
545
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return
|
|
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 w([...E,"key","src","alt","href","new-tab","rel","wh","w","h","ar","hide","show","op","z","of"])}_styles=g();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=U({shadowRoot:this.shadow,childElement:this._imgElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}connectedCallback(){this._updateImageAttributes(),this.updateStyles()}attributeChangedCallback(t,e,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}if(t==="src"||t==="alt"){this._updateImageAttributes();return}e!==s&&this.updateStyles()}updateStyles(){this._styles=g(),S.forEach(e=>{let s=y=>`${e==="default"?"":`${e}-`}${y}`,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")),h=T(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),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 !important"),this.hasAttribute(s("show"))&&(this._styles[e].display="block !important")});let t=x(this._styles,"img, a");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_updateImageAttributes(){let t=this.getAttribute("src"),e=this.getAttribute("alt");t!==null?this._imgElement.setAttribute("src",t):this._imgElement.removeAttribute("src"),e!==null?this._imgElement.setAttribute("alt",e):this._imgElement.removeAttribute("alt")}},zt=({render:i,html:t})=>tt;var de={s:{sm:`
|
|
546
566
|
height: 20px;
|
|
547
567
|
padding-left: 8px;
|
|
548
568
|
padding-right: 8px;
|
|
@@ -595,7 +615,7 @@ var rettangoli=(()=>{var B=`
|
|
|
595
615
|
background-color: var(--destructive);
|
|
596
616
|
color: var(--destructive-foreground);
|
|
597
617
|
border-color: transparent;
|
|
598
|
-
`}},
|
|
618
|
+
`}},It=v(de,{},".surface");var et=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
599
619
|
:host {
|
|
600
620
|
display: inline-flex;
|
|
601
621
|
min-width: 0;
|
|
@@ -691,13 +711,13 @@ var rettangoli=(()=>{var B=`
|
|
|
691
711
|
opacity: 1;
|
|
692
712
|
}
|
|
693
713
|
|
|
694
|
-
${
|
|
714
|
+
${It}
|
|
695
715
|
:host .surface {
|
|
696
716
|
border-radius: var(--tag-border-radius) !important;
|
|
697
717
|
}
|
|
698
|
-
${
|
|
718
|
+
${m}
|
|
699
719
|
${p}
|
|
700
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._surfaceElement=document.createElement("span"),this._surfaceElement.className="surface",this._surfaceElement.setAttribute("part","surface"),this._labelElement=document.createElement("span"),this._labelElement.className="label",this._labelElement.setAttribute("part","label"),this._slotElement=document.createElement("slot"),this._labelElement.appendChild(this._slotElement),this._surfaceElement.appendChild(this._labelElement),this.shadow.appendChild(this._surfaceElement),this._prefixIcon=null,this._suffixIcon=null,this._removeButton=null,this._onRemoveClick=this._onRemoveClick.bind(this)}static get observedAttributes(){return["key","pre","suf","removable","w"]}connectedCallback(){this._updateWidth(),this._updateStructure()}attributeChangedCallback(t,e,s){if(t==="w"){this._updateWidth();return}e!==s&&this._updateStructure()}_updateWidth(){let t=c(this.getAttribute("w"));
|
|
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"));M({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}))}},Bt=({render:i,html:t})=>et;var Ot=u`
|
|
701
721
|
:host([pt="xs"]) svg {
|
|
702
722
|
padding-top: var(--spacing-xs);
|
|
703
723
|
}
|
|
@@ -813,16 +833,16 @@ var rettangoli=(()=>{var B=`
|
|
|
813
833
|
padding-top: var(--spacing-xl);
|
|
814
834
|
padding-bottom: var(--spacing-xl);
|
|
815
835
|
}
|
|
816
|
-
`;var
|
|
836
|
+
`;var it=class i extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
817
837
|
:host {
|
|
818
838
|
color: var(--foreground);
|
|
819
839
|
flex-shrink: 0;
|
|
820
840
|
}
|
|
821
|
-
${
|
|
822
|
-
${
|
|
823
|
-
${
|
|
841
|
+
${G}
|
|
842
|
+
${Ot}
|
|
843
|
+
${m}
|
|
824
844
|
${p}
|
|
825
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return i._icons}static addIcon(t,e){i._icons[t]=e}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,e,s){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),e=c(t===null?this.getAttribute("w"):t),s=c(t===null?this.getAttribute("h"):t);e!=null?this.style.width=e:this.style.width="",s!=null?this.style.height=s:this.style.height=""}_render(){try{let t=this.getAttribute("svg"),e=i._icons[t]||(window.rtglIcons||{})[t];if(e){this.shadow.innerHTML=e;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},
|
|
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=""}},Rt=({render:i,html:t})=>it;var ue=["mt","mr","mb","ml","m","mh","mv","cur"],st=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`
|
|
826
846
|
:host {
|
|
827
847
|
display: contents;
|
|
828
848
|
}
|
|
@@ -884,9 +904,9 @@ var rettangoli=(()=>{var B=`
|
|
|
884
904
|
input[type="datetime-local"]::-webkit-date-and-time-value {
|
|
885
905
|
text-align: left;
|
|
886
906
|
}
|
|
887
|
-
${
|
|
907
|
+
${m}
|
|
888
908
|
${p}
|
|
889
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=
|
|
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",...w([...ue,"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(),S.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=x(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,e){if(e==null||e==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,e)}_syncValueAttribute(){this._inputElement.value=this.getAttribute("value")??""}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("type"),s=new Set(["text","password","date","time","datetime-local"]).has(t)?t:"text",r=this.getAttribute("min"),n=this.getAttribute("max"),o=this.getAttribute("step"),l=this.hasAttribute("disabled");this._setOrRemoveInputAttribute("type",s),this._setOrRemoveInputAttribute("min",r),this._setOrRemoveInputAttribute("max",n),this._setOrRemoveInputAttribute("step",o),l?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},k=({render:i,html:t})=>st;var ce=k({}),V="date",rt=class extends ce{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)}},Wt=({render:i,html:t})=>rt;var pe=k({}),F="time",nt=class extends pe{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)}},Lt=({render:i,html:t})=>nt;var me=k({}),j="datetime-local",ot=class extends me{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)}},Mt=({render:i,html:t})=>ot;var ge=["mt","mr","mb","ml","m","mh","mv","cur"],lt=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`
|
|
890
910
|
:host {
|
|
891
911
|
display: contents;
|
|
892
912
|
}
|
|
@@ -919,9 +939,9 @@ var rettangoli=(()=>{var B=`
|
|
|
919
939
|
input:disabled {
|
|
920
940
|
cursor: not-allowed;
|
|
921
941
|
}
|
|
922
|
-
${
|
|
942
|
+
${m}
|
|
923
943
|
${p}
|
|
924
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=
|
|
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",...w([...ge,"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(),S.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=x(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,e){if(e==null||e==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,e)}_clampValueToBounds(t){let e=t,s=this.getAttribute("min");if(s!==null){let n=parseFloat(s);isNaN(n)||(e=Math.max(e,n))}let r=this.getAttribute("max");if(r!==null){let n=parseFloat(r);isNaN(n)||(e=Math.min(e,n))}return e}_syncValueAttribute(){let t=this.getAttribute("value");if(t==null||t===""){this._inputElement.value="";return}let e=parseFloat(t);if(isNaN(e)){this._inputElement.value="";return}let s=this._clampValueToBounds(e);this._inputElement.value=s.toString()}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("step"),e=this.getAttribute("min"),s=this.getAttribute("max"),r=this.hasAttribute("disabled");this._inputElement.setAttribute("type","number"),this._setOrRemoveInputAttribute("step",t),this._setOrRemoveInputAttribute("min",e),this._setOrRemoveInputAttribute("max",s),r?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},Tt=({render:i,html:t})=>lt;var at=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
925
945
|
:host {
|
|
926
946
|
display: contents;
|
|
927
947
|
}
|
|
@@ -947,9 +967,9 @@ var rettangoli=(()=>{var B=`
|
|
|
947
967
|
textarea:disabled {
|
|
948
968
|
cursor: not-allowed;
|
|
949
969
|
}
|
|
950
|
-
${
|
|
970
|
+
${m}
|
|
951
971
|
${p}
|
|
952
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._textareaElement=document.createElement("textarea"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onInput),this._textareaElement.addEventListener("change",this._onChange)}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._textareaElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._textareaElement.value},bubbles:!0}))};static get observedAttributes(){return["key","placeholder","disabled","value","cols","rows",...
|
|
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",...w([...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=_=>`${n==="default"?"":`${n}-`}${_}`,l=this.getAttribute(o("wh")),a=c(l===null?this.getAttribute(o("w")):l),h=c(l===null?this.getAttribute(o("h")):l),y=this.getAttribute(o("op")),b=this.getAttribute(o("z"));b!==null&&(this._styles[n]["z-index"]=b),y!==null&&(this._styles[n].opacity=y),a==="f"?this._styles[n].width="var(--width-stretch)":a!==void 0&&(this._styles[n].width=a,this._styles[n]["min-width"]=a,this._styles[n]["max-width"]=a),h==="f"?this._styles[n].height="100%":h!==void 0&&(this._styles[n].height=h,this._styles[n]["min-height"]=h,this._styles[n]["max-height"]=h),this.hasAttribute(o("hide"))&&(this._styles[n].display="none"),this.hasAttribute(o("show"))&&(this._styles[n].display="block")});let r=x(this._styles,"textarea");r!==this._lastStyleString&&(this._styleElement.textContent=r,this._lastStyleString=r)}_updateTextareaAttributes(){let t=this.getAttribute("cols"),e=this.getAttribute("rows"),s=this.hasAttribute("disabled");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),e!==null?this._textareaElement.setAttribute("rows",e):this._textareaElement.removeAttribute("rows"),s?this._textareaElement.setAttribute("disabled",""):this._textareaElement.removeAttribute("disabled")}},Dt=({render:i,html:t})=>at;var fe=["mt","mr","mb","ml","m","mh","mv","cur"],be=/^#[0-9a-fA-F]{6}$/,ht=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
953
973
|
:host {
|
|
954
974
|
display: contents;
|
|
955
975
|
}
|
|
@@ -970,9 +990,9 @@ var rettangoli=(()=>{var B=`
|
|
|
970
990
|
cursor: not-allowed;
|
|
971
991
|
opacity: 0.5;
|
|
972
992
|
}
|
|
973
|
-
${
|
|
993
|
+
${m}
|
|
974
994
|
${p}
|
|
975
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=
|
|
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",...w([...fe,"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(),S.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=x(this._styles,'input[type="color"]');t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_syncValueAttribute(){let t=this.getAttribute("value");if(t===null){this._inputElement.value="#000000";return}this._inputElement.value=be.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()}},Nt=({render:i,html:t})=>ht;var dt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
976
996
|
:host {
|
|
977
997
|
display: contents;
|
|
978
998
|
}
|
|
@@ -1024,9 +1044,9 @@ var rettangoli=(()=>{var B=`
|
|
|
1024
1044
|
input[type="range"]:disabled::-moz-range-thumb {
|
|
1025
1045
|
cursor: not-allowed;
|
|
1026
1046
|
}
|
|
1027
|
-
${
|
|
1047
|
+
${m}
|
|
1028
1048
|
${p}
|
|
1029
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",...
|
|
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",...w([...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=_=>`${n==="default"?"":`${n}-`}${_}`,l=this.getAttribute(o("wh")),a=c(l===null?this.getAttribute(o("w")):l),h=c(l===null?this.getAttribute(o("h")):l),y=this.getAttribute(o("op")),b=this.getAttribute(o("z"));b!==null&&(this._styles[n]["z-index"]=b),y!==null&&(this._styles[n].opacity=y),a==="f"?this._styles[n].width="var(--width-stretch)":a!==void 0&&(this._styles[n].width=a,this._styles[n]["min-width"]=a,this._styles[n]["max-width"]=a),h==="f"?this._styles[n].height="100%":h!==void 0&&(this._styles[n].height=h,this._styles[n]["min-height"]=h,this._styles[n]["max-height"]=h),this.hasAttribute(o("hide"))&&(this._styles[n].display="none"),this.hasAttribute(o("show"))&&(this._styles[n].display="block")});let r=x(this._styles,'input[type="range"]');r!==this._lastStyleString&&(this._styleElement.textContent=r,this._lastStyleString=r)}_updateInputAttributes(){let t=this.getAttribute("value"),e=this.getAttribute("min"),s=this.getAttribute("max"),r=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null?this._inputElement.value=t:this._inputElement.value=e??0,e!==null?this._inputElement.min=e:this._inputElement.min="0",s!==null?this._inputElement.max=s:this._inputElement.max="100",r!==null?this._inputElement.step=r:this._inputElement.step="1",n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Vt=({render:i,html:t})=>dt;var ut=40,ve=6,ct=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
1030
1050
|
:host {
|
|
1031
1051
|
display: contents;
|
|
1032
1052
|
}
|
|
@@ -1103,7 +1123,7 @@ var rettangoli=(()=>{var B=`
|
|
|
1103
1123
|
animation: none;
|
|
1104
1124
|
}
|
|
1105
1125
|
}
|
|
1106
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._adaptiveFrameId=null,this._layoutRetryCount=0,this._observedContentElement=null,this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._scheduleAdaptiveCentering()}):null,this._onSlotChange=()=>{this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0})},this._onWindowResize=()=>{this._scheduleAdaptiveCentering({resetRetries:!0})},this._mouseDownInContent=!1,this._dialogElement.addEventListener("mousedown",t=>{this._mouseDownInContent=t.target!==this._dialogElement}),this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&this._attemptClose(),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&(t.preventDefault(),this._attemptClose()),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._attemptClose()})}_attemptClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}disconnectedCallback(){this._isConnected=!1,this._stopAdaptiveObservers(),this._slotElement&&this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,e,s){t==="open"?s!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():s===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._slotElement.addEventListener("slotchange",this._onSlotChange),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0,window.addEventListener("resize",this._onWindowResize),this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0}))}_hideModal(){this._dialogElement.open&&(this._stopAdaptiveObservers(),this._dialogElement.close(),this._slotElement&&(this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.removeChild(this._slotElement),this._slotElement=null),this._dialogElement.style.height="")}_stopAdaptiveObservers(){this._adaptiveFrameId!==null&&(cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=null),this._layoutRetryCount=0,window.removeEventListener("resize",this._onWindowResize),this._resizeObserver&&this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=null}_getAssignedContentElement(){if(!this._slotElement)return null;let t=this._slotElement.assignedElements({flatten:!0});return t.length>0?t[0]:null}_observeAssignedContent(){if(!this._resizeObserver)return;let t=this._getAssignedContentElement();this._observedContentElement!==t&&(this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=t,this._observedContentElement&&this._resizeObserver.observe(this._observedContentElement))}_scheduleAdaptiveCentering({resetRetries:t=!1}={}){!this._slotElement||!this._dialogElement.open||(t&&(this._layoutRetryCount=0),this._adaptiveFrameId!==null&&cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=null,this._applyAdaptiveCentering()})}))}_applyAdaptiveCentering(){if(!this._slotElement||!this._dialogElement.open)return;this._observeAssignedContent();let t=this._getAssignedContentElement(),e=t?Math.round(t.getBoundingClientRect().height):0;if(e<=0){this._layoutRetryCount<
|
|
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<ve&&(this._layoutRetryCount+=1,this._scheduleAdaptiveCentering());return}this._layoutRetryCount=0;let s=window.innerHeight;if(e>=s-2*ut){this._slotElement.style.marginTop=`${ut}px`,this._slotElement.style.marginBottom=`${ut}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}},Ft=({render:i,html:t})=>ct;var pt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
|
|
1107
1127
|
:host {
|
|
1108
1128
|
display: contents;
|
|
1109
1129
|
}
|
|
@@ -1157,4 +1177,4 @@ var rettangoli=(()=>{var B=`
|
|
|
1157
1177
|
min-width: 200px;
|
|
1158
1178
|
max-width: 400px;
|
|
1159
1179
|
}
|
|
1160
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let e=t.composedPath();(e[0]===this._dialogElement||e[0].nodeName==="DIALOG"&&e[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let e=t.composedPath();(e[0]===this._dialogElement||e[0].nodeName==="DIALOG"&&e[0]===this._dialogElement)&&(t.preventDefault(),this._emitClose())}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._emitClose()}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._isOpen=!1}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y","place","no-overlay"]}connectedCallback(){this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._isOpen&&this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,e,s){t==="open"?s!==null&&!this._isOpen?this.isConnected&&this._show():s===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="place")&&this._isOpen?this._updatePosition():t==="no-overlay"&&e!==s&&this._isOpen&&(this._hide(),this._show())}_show(){this._isOpen||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._dialogElement.open||setTimeout(()=>{this._dialogElement&&!this._dialogElement.open&&(this.hasAttribute("no-overlay")?this._dialogElement.show():this._dialogElement.showModal())},0),requestAnimationFrame(()=>{this._updatePosition()}))}_hide(){this._isOpen&&(this._isOpen=!1,this._dialogElement.open&&this._dialogElement.close(),this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_updatePosition(){let t=parseFloat(this.getAttribute("x")||"0"),e=parseFloat(this.getAttribute("y")||"0"),s=this.getAttribute("place")||"bs";this.removeAttribute("positioned"),requestAnimationFrame(()=>{let r=this._popoverContainer.getBoundingClientRect(),{left:n,top:o}=this._calculatePosition(t,e,r.width,r.height,s);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${o}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,e,s,r,n){let l=t,a=e;switch(n){case"t":l=t-s/2,a=e-r-8;break;case"ts":l=t,a=e-r-8;break;case"te":l=t-s,a=e-r-8;break;case"r":l=t+8,a=e-r/2;break;case"rs":l=t+8,a=e;break;case"re":l=t+8,a=e-r;break;case"b":l=t-s/2,a=e+8;break;case"bs":l=t,a=e+8;break;case"be":l=t-s,a=e+8;break;case"l":l=t-s-8,a=e-r/2;break;case"ls":l=t-s-8,a=e;break;case"le":l=t-s-8,a=e-r;break;default:l=t,a=e+8;break}let h=8;return l=Math.max(h,Math.min(l,window.innerWidth-s-h)),a=Math.max(h,Math.min(a,window.innerHeight-r-h)),{left:l,top:a}}get popover(){return this._popoverContainer}},
|
|
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}},jt=({render:i,html:t})=>pt;customElements.define("rtgl-button",wt({}));customElements.define("rtgl-grid",xt({}));customElements.define("rtgl-view",Et({}));customElements.define("rtgl-text",kt({}));customElements.define("rtgl-image",zt({}));customElements.define("rtgl-tag",Bt({}));customElements.define("rtgl-svg",Rt({}));customElements.define("rtgl-input",k({}));customElements.define("rtgl-input-date",Wt({}));customElements.define("rtgl-input-time",Lt({}));customElements.define("rtgl-input-datetime",Mt({}));customElements.define("rtgl-input-number",Tt({}));customElements.define("rtgl-textarea",Dt({}));customElements.define("rtgl-color-picker",Nt({}));customElements.define("rtgl-slider",Vt({}));customElements.define("rtgl-dialog",Ft({}));customElements.define("rtgl-popover",jt({}));})();
|