lyco 1.3.8 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core-BoB7sDMv.js.map +1 -1
- package/dist/core-bQvrG1od.mjs.map +1 -1
- package/dist/index.cjs.js +247 -247
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +247 -247
- package/dist/index.es.js.map +1 -1
- package/dist/types/components/mod.d.ts +8 -7
- package/dist/types/core/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
@@ -228,7 +228,7 @@ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
|
|
228
228
|
<div style="flex: 0 0 ${a}; overflow: auto;">${c}</div>
|
229
229
|
<div style="flex: 1 1 auto; overflow: auto;">${l}</div>
|
230
230
|
</div>
|
231
|
-
`}function D(r={},i){if(i===void 0)return e=>D(r,e??[t.html``]);let a=e.getComponentCount(`Swiper`),{gap:o=`8px`,snapType:s=`mandatory`,height:c=`auto`,width:l=`100%`,className:u=e.getRandomClassName(`Swiper::swiper`)+`-lyco-now-${a}`,direction:d=`x`,scrollBehavior:f=`smooth`,align:p=`start`,showNavigation:m=!0,navigationPosition:h=`inside`,showPagination:g=!0,paginationType:_=`dots`,autoPlay:v=!1,interval:y=3e3,loop:b=!1,touchEnabled:x=!0,mouseWheel:S=!1,onSlideChange:C,on:w}=r,T=u,E=T+`-container`,O=T+`-slide`,k=T+`-navigation`,A=T+`-pagination`,j;j=i?typeof i==`function`?i():i:[];let M=j.length,[N,P]=(()=>{let e={value:0};return[()=>e.value,t=>{let n=Math.max(0,Math.min(t,M-1));e.value!==n&&(e.value=n,C?.(n))}]})(),F=e=>{let t=typeof document<`u`?document.querySelector(`.${E}`):null;if(!t)return;let n=t.querySelectorAll(`.${O}`);if(e<0||e>=n.length)return;let r=n[e],i=r.getBoundingClientRect(),a=t.getBoundingClientRect(),o;d===`x`?(o=r.offsetLeft-t.offsetLeft,p===`center`?o-=(a.width-i.width)/2:p===`end`&&(o-=a.width-i.width),t.scrollTo({left:o,behavior:f})):(o=r.offsetTop-t.offsetTop,p===`center`?o-=(a.height-i.height)/2:p===`end`&&(o-=a.height-i.height),t.scrollTo({top:o,behavior:f})),P(e)},I=()=>{let e=N()+1>=M?b?0:N():N()+1;F(e)},L=()=>{let e=N()-1<0?b?M-1:N():N()-1;F(e)},R=()=>{let e=typeof document<`u`?document.querySelector(`.${E}`):null;if(!e)return;let t=e.querySelectorAll(`.${O}`),n=0,r=1/0;t.forEach((t,i)=>{let a=t.getBoundingClientRect(),o=e.getBoundingClientRect(),s;if(d===`x`){let e=a.left+a.width/2-(o.left+o.width/2);s=Math.abs(e)}else{let e=a.top+a.height/2-(o.top+o.height/2);s=Math.abs(e)}s<r&&(r=s,n=i)}),P(n)},z=e=>{if(!x)return;let t=e.touches[0],n=e.currentTarget;n.dataset.touchStartX=t.clientX.toString(),n.dataset.touchStartY=t.clientY.toString()},B=e=>{if(!x)return;let t=e.touches[0],n=e.currentTarget,r=parseFloat(n.dataset.touchStartX||`0`),i=parseFloat(n.dataset.touchStartY||`0`),a=t.clientX-r,o=t.clientY-i;(Math.abs(a)>Math.abs(o)||d===`x`)&&e.preventDefault()},V=e=>{if(!x)return;let t=e.currentTarget,n=parseFloat(t.dataset.touchStartX||`0`),r=parseFloat(t.dataset.touchStartY||`0`);if(!n&&!r)return;let i=e.changedTouches[0],a=i.clientX-n,o=i.clientY-r,s=Math.max(Math.abs(a),Math.abs(o))>30;s&&(d===`x`?a>0?L():I():o>0?L():I()),delete t.dataset.touchStartX,delete t.dataset.touchStartY},H=e=>{S&&(e.preventDefault(),e.deltaY>0?I():L())},
|
231
|
+
`}function D(r={},i){if(i===void 0)return e=>D(r,e??[t.html``]);let a=e.getComponentCount(`Swiper`),{gap:o=`8px`,snapType:s=`mandatory`,height:c=`auto`,width:l=`100%`,className:u=e.getRandomClassName(`Swiper::swiper`)+`-lyco-now-${a}`,direction:d=`x`,scrollBehavior:f=`smooth`,align:p=`start`,showNavigation:m=!0,navigationPosition:h=`inside`,showPagination:g=!0,paginationType:_=`dots`,autoPlay:v=!1,interval:y=3e3,loop:b=!1,touchEnabled:x=!0,mouseWheel:S=!1,onSlideChange:C,on:w}=r,T=u,E=T+`-container`,O=T+`-slide`,k=T+`-navigation`,A=T+`-pagination`,j;j=i?typeof i==`function`?i():i:[];let M=j.length,[N,P]=(()=>{let e={value:0};return[()=>e.value,t=>{let n=Math.max(0,Math.min(t,M-1));e.value!==n&&(e.value=n,C?.(n))}]})(),F=e=>{let t=typeof document<`u`?document.querySelector(`.${E}`):null;if(!t)return;let n=t.querySelectorAll(`.${O}`);if(e<0||e>=n.length)return;let r=n[e],i=r.getBoundingClientRect(),a=t.getBoundingClientRect(),o;d===`x`?(o=r.offsetLeft-t.offsetLeft,p===`center`?o-=(a.width-i.width)/2:p===`end`&&(o-=a.width-i.width),t.scrollTo({left:o,behavior:f})):(o=r.offsetTop-t.offsetTop,p===`center`?o-=(a.height-i.height)/2:p===`end`&&(o-=a.height-i.height),t.scrollTo({top:o,behavior:f})),P(e)},I=()=>{let e=N()+1>=M?b?0:N():N()+1;F(e)},L=()=>{let e=N()-1<0?b?M-1:N():N()-1;F(e)},R=()=>{let e=typeof document<`u`?document.querySelector(`.${E}`):null;if(!e)return;let t=e.querySelectorAll(`.${O}`),n=0,r=1/0;t.forEach((t,i)=>{let a=t.getBoundingClientRect(),o=e.getBoundingClientRect(),s;if(d===`x`){let e=a.left+a.width/2-(o.left+o.width/2);s=Math.abs(e)}else{let e=a.top+a.height/2-(o.top+o.height/2);s=Math.abs(e)}s<r&&(r=s,n=i)}),P(n)},z=e=>{if(!x)return;let t=e.touches[0],n=e.currentTarget;n.dataset.touchStartX=t.clientX.toString(),n.dataset.touchStartY=t.clientY.toString()},B=e=>{if(!x)return;let t=e.touches[0],n=e.currentTarget,r=parseFloat(n.dataset.touchStartX||`0`),i=parseFloat(n.dataset.touchStartY||`0`),a=t.clientX-r,o=t.clientY-i;(Math.abs(a)>Math.abs(o)||d===`x`)&&e.preventDefault()},V=e=>{if(!x)return;let t=e.currentTarget,n=parseFloat(t.dataset.touchStartX||`0`),r=parseFloat(t.dataset.touchStartY||`0`);if(!n&&!r)return;let i=e.changedTouches[0],a=i.clientX-n,o=i.clientY-r,s=Math.max(Math.abs(a),Math.abs(o))>30;s&&(d===`x`?a>0?L():I():o>0?L():I()),delete t.dataset.touchStartX,delete t.dataset.touchStartY},H=e=>{S&&(e.preventDefault(),e.deltaY>0?I():L())},ee=e=>{if(!v||!e)return;let t,n=()=>{t=setInterval(I,y)},r=()=>{clearInterval(t)};return e.addEventListener(`mouseenter`,r),e.addEventListener(`mouseleave`,n),n(),()=>{clearInterval(t),e.removeEventListener(`mouseenter`,r),e.removeEventListener(`mouseleave`,n)}},U=()=>{let e=typeof document<`u`?document.querySelector(`.${E}`):null;if(!e)return;let t=[];e.addEventListener(`scroll`,R),t.push(()=>e.removeEventListener(`scroll`,R)),x&&(e.addEventListener(`touchstart`,z),e.addEventListener(`touchmove`,B,{passive:!1}),e.addEventListener(`touchend`,V),t.push(()=>e.removeEventListener(`touchstart`,z)),t.push(()=>e.removeEventListener(`touchmove`,B)),t.push(()=>e.removeEventListener(`touchend`,V))),S&&(e.addEventListener(`wheel`,H,{passive:!1}),t.push(()=>e.removeEventListener(`wheel`,H)));let n=ee(e);return n&&t.push(n),F(0),()=>t.forEach(e=>e())};typeof window<`u`&&typeof document<`u`&&setTimeout(U,0);let W=t.html`
|
232
232
|
<div class="${A}">
|
233
233
|
${Array.from({length:M},(e,n)=>t.html`
|
234
234
|
<button
|
@@ -237,13 +237,13 @@ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
|
|
237
237
|
></button>
|
238
238
|
`)}
|
239
239
|
</div>
|
240
|
-
`,
|
240
|
+
`,G=t.html`
|
241
241
|
<div class="${A} fraction">
|
242
242
|
<span class="current">${N()+1}</span>
|
243
243
|
<span class="separator">/</span>
|
244
244
|
<span class="total">${M}</span>
|
245
245
|
</div>
|
246
|
-
`,
|
246
|
+
`,K=t.html`
|
247
247
|
<div class="${A} progressbar">
|
248
248
|
<div
|
249
249
|
class="progress"
|
@@ -255,7 +255,7 @@ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
|
|
255
255
|
<button class="prev" @click=${L}>◀</button>
|
256
256
|
<button class="next" @click=${I}>▶</button>
|
257
257
|
</div>
|
258
|
-
`,
|
258
|
+
`,te=`
|
259
259
|
.${T} {
|
260
260
|
position: relative;
|
261
261
|
overflow: hidden;
|
@@ -360,13 +360,13 @@ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
|
|
360
360
|
background-color: white;
|
361
361
|
transition: width 0.3s;
|
362
362
|
}
|
363
|
-
`,
|
363
|
+
`,J=e.createEventBinder(w??{});return e.LycoComponent(`Swiper`,t.html`
|
364
364
|
<style>
|
365
|
-
${
|
365
|
+
${te}
|
366
366
|
</style>
|
367
367
|
|
368
368
|
<div
|
369
|
-
${(0,n.ref)(e=>{e?
|
369
|
+
${(0,n.ref)(e=>{e?J.bind(e):J.unbindAll()})}
|
370
370
|
class="${T}"
|
371
371
|
>
|
372
372
|
<div class="${E}">
|
@@ -378,9 +378,9 @@ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
|
|
378
378
|
</div>
|
379
379
|
|
380
380
|
${m?q:null}
|
381
|
-
${g&&_===`dots`?
|
382
|
-
${g&&_===`fraction`?
|
383
|
-
${g&&_===`progressbar`?
|
381
|
+
${g&&_===`dots`?W:null}
|
382
|
+
${g&&_===`fraction`?G:null}
|
383
|
+
${g&&_===`progressbar`?K:null}
|
384
384
|
</div>
|
385
385
|
`)}const O={borderRadius:{small:`4px`,medium:`8px`,large:`16px`,full:`9999px`},elevation:{level1:`0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.14)`,level2:`0 3px 6px rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.12)`,level3:`0 10px 20px rgba(0,0,0,0.15), 0 3px 6px rgba(0,0,0,0.10)`,level4:`0 15px 25px rgba(0,0,0,0.15), 0 5px 10px rgba(0,0,0,0.05)`,level5:`0 20px 40px rgba(0,0,0,0.2)`},animation:{standard:`0.2s cubic-bezier(0.4, 0, 0.2, 1)`,emphasized:`0.3s cubic-bezier(0.4, 0, 0.2, 1)`,decelerated:`0.4s cubic-bezier(0, 0, 0.2, 1)`},colors:{primary:`#6750A4`,onPrimary:`#FFFFFF`,primaryContainer:`#EADDFF`,onPrimaryContainer:`#21005E`,secondary:`#625B71`,onSecondary:`#FFFFFF`,secondaryContainer:`#E8DEF8`,onSecondaryContainer:`#1E192B`,surface:`#FEF7FF`,onSurface:`#1C1B1F`,surfaceVariant:`#E7E0EB`,onSurfaceVariant:`#49454E`,error:`#B00020`}};function k(r){let{checked:i=!1,disabled:a=!1,size:o=`medium`,color:s=O.colors.primary,onChange:c,className:l=``,on:u={}}=r??{},d=e.getComponentCount(`SwitchInput`),f=e.getRandomClassName(`SwitchInput::switch`)+`-lyco-now-${d}`,p={small:{width:32,height:16,thumbSize:12},medium:{width:44,height:24,thumbSize:18},large:{width:56,height:32,thumbSize:24}},{width:m,height:h,thumbSize:g}=p[o],_=`
|
386
386
|
.${f} {
|
@@ -613,7 +613,97 @@ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
|
|
613
613
|
>
|
614
614
|
${e.renderFn(i)}
|
615
615
|
</div>
|
616
|
-
`}function z(r
|
616
|
+
`}function z(r){let{value:i=``,options:a=[],placeholder:o=``,disabled:s=!1,error:c=!1,className:l=``,style:u=``,maxHeight:d=`300px`,onChange:f,onInput:p,onFocus:m,onBlur:h,on:g={},optionRender:_}=r??{},v=e.getComponentCount(`Combobox`),y=e.getRandomClassName(`Combobox::combobox`)+`-lyco-now-${v}`,b=!1,x=null,S=`
|
617
|
+
.${y} {
|
618
|
+
position: relative;
|
619
|
+
width: 100%;
|
620
|
+
}
|
621
|
+
|
622
|
+
.${y} input {
|
623
|
+
width: 100%;
|
624
|
+
padding: 12px 16px;
|
625
|
+
font-size: 16px;
|
626
|
+
border: 1px solid ${c?O.colors.error:O.colors.surfaceVariant};
|
627
|
+
border-radius: ${O.borderRadius.small};
|
628
|
+
color: ${O.colors.onSurface};
|
629
|
+
transition: all ${O.animation.standard};
|
630
|
+
outline: none;
|
631
|
+
box-sizing: border-box;
|
632
|
+
}
|
633
|
+
|
634
|
+
.${y} input:focus {
|
635
|
+
border-color: ${O.colors.primary};
|
636
|
+
box-shadow: 0 0 0 2px ${O.colors.primaryContainer};
|
637
|
+
}
|
638
|
+
|
639
|
+
.${y} input:disabled {
|
640
|
+
background: ${O.colors.surfaceVariant};
|
641
|
+
color: ${O.colors.onSurfaceVariant};
|
642
|
+
cursor: not-allowed;
|
643
|
+
}
|
644
|
+
|
645
|
+
.${y} .options {
|
646
|
+
position: absolute;
|
647
|
+
top: 100%;
|
648
|
+
left: 0;
|
649
|
+
right: 0;
|
650
|
+
max-height: ${d};
|
651
|
+
overflow-y: auto;
|
652
|
+
border: 1px solid ${O.colors.surfaceVariant};
|
653
|
+
border-radius: ${O.borderRadius.small};
|
654
|
+
box-shadow: ${O.elevation.level2};
|
655
|
+
z-index: 1000;
|
656
|
+
display: none;
|
657
|
+
}
|
658
|
+
|
659
|
+
.${y} .options.open {
|
660
|
+
display: block;
|
661
|
+
}
|
662
|
+
|
663
|
+
.${y} .option {
|
664
|
+
padding: 12px 16px;
|
665
|
+
cursor: pointer;
|
666
|
+
transition: background ${O.animation.standard};
|
667
|
+
}
|
668
|
+
|
669
|
+
.${y} .option:hover {
|
670
|
+
background: ${O.colors.primaryContainer};
|
671
|
+
}
|
672
|
+
|
673
|
+
.${y} .option.selected {
|
674
|
+
background: ${O.colors.primaryContainer};
|
675
|
+
color: ${O.colors.onPrimaryContainer};
|
676
|
+
}
|
677
|
+
`,C=e.createEventBinder(g),w=null,T=()=>{b?w?.classList.remove(`open`):w?.classList.add(`open`),b=!b},E=(e,t)=>{if(x){x.value=e.value;let n=t.currentTarget;Array.from(w?.querySelectorAll(`.selected`)??[]).forEach(e=>e.classList.remove(`selected`)),!n.classList.contains(`selected`)&&n.classList.add(`selected`),f?.(e.value)}T()},D=e=>{let t=e.target;t.closest(`.${y}`)||(b=!1,w?.classList.remove(`open`))};return typeof window<`u`&&document.addEventListener(`click`,D),e.LycoComponent(`Combobox`,t.html`
|
678
|
+
<style>
|
679
|
+
${S}
|
680
|
+
</style>
|
681
|
+
<div class="${y} ${l}" style="${u}">
|
682
|
+
<input
|
683
|
+
${(0,n.ref)(e=>{e?(x=e,C.bind(e)):C.unbindAll()})}
|
684
|
+
type="text"
|
685
|
+
.value=${i}
|
686
|
+
placeholder=${o}
|
687
|
+
?disabled=${s}
|
688
|
+
@focus=${()=>{m?.(),T()}}
|
689
|
+
@input=${e=>{let t=e.target;p?.(t.value)}}
|
690
|
+
@change=${e=>{let t=e.target;f?.(t.value)}}
|
691
|
+
/>
|
692
|
+
<div
|
693
|
+
${(0,n.ref)(e=>{e&&(w=e)})}
|
694
|
+
class="options"
|
695
|
+
>
|
696
|
+
${a.map(e=>t.html`
|
697
|
+
<div
|
698
|
+
class="option ${e.value===(x?.value??i)?`selected`:``}"
|
699
|
+
@click=${t=>E(e,t)}
|
700
|
+
>
|
701
|
+
${_?_(e):e.label}
|
702
|
+
</div>
|
703
|
+
`)}
|
704
|
+
</div>
|
705
|
+
</div>
|
706
|
+
`)}function B(r,i){if(i===void 0)return e=>B(r,e??[t.html``]);let a=r?.maxWidth??`1024px`,o=r?.padding??`0 16px`,s=r?.background?`background: ${r.background};`:``,c=r?.fullHeight?`height: 100%;`:``,l=e.createEventBinder(r?.on??{});return t.html`
|
617
707
|
<div
|
618
708
|
${(0,n.ref)(e=>{e?l.bind(e):l.unbindAll()})}
|
619
709
|
style="
|
@@ -629,10 +719,10 @@ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
|
|
629
719
|
>
|
630
720
|
${e.renderFnOrArray(i)}
|
631
721
|
</div>
|
632
|
-
`}function
|
722
|
+
`}function V(r){let i=r?.orientation??`horizontal`,a=r?.thickness??`1px`,o=r?.color??`#e0e0e0`,s=r?.margin??(i===`horizontal`?`8px 0`:`0 8px`),c=e.createEventBinder(r?.on??{}),l=i===`horizontal`?`width: 100%; height: ${a}; background: ${o}; margin: ${s};`:`width: ${a}; height: 100%; background: ${o}; margin: ${s};`;return t.html`<div
|
633
723
|
${(0,n.ref)(e=>{e?c.bind(e):c.unbindAll()})}
|
634
724
|
style="${l}"
|
635
|
-
></div>`}function
|
725
|
+
></div>`}function H(r,i){if(i===void 0){let e=e=>H(r,e??t.html``);return e.html=(e,...n)=>H(r,(0,t.html)(e,...n)),e}let a=r?.columns??4,o=r?.gap??`24px`,s=r?.background??`#f8f8f8`,c=r?.padding??`40px 16px`,l=e.createEventBinder(r?.on??{});return t.html`
|
636
726
|
<div
|
637
727
|
${(0,n.ref)(e=>{e?l.bind(e):l.unbindAll()})}
|
638
728
|
style="
|
@@ -655,7 +745,7 @@ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
|
|
655
745
|
© ${new Date().getFullYear()} Your Company. All rights reserved.
|
656
746
|
</div>
|
657
747
|
</div>
|
658
|
-
`}function
|
748
|
+
`}function ee(e,t){return t?e.map((e,n)=>t(e,n)):t=>e.map((e,n)=>t(e,n))}function U(r,i){if(i===void 0){let e=e=>U(r,e??t.html``);return e.html=(e,...n)=>U(r,(0,t.html)(e,...n)),e}let a=r.defaultColumns??1,o=r.gap??`16px`,s=e.getComponentCount(`GridBreakpoint`),c=r.className??e.getRandomClassName(`GridBreakpoint::grid-breakpoint`)+`-lyco-now-`+s,l=Object.entries(r.breakpoints).map(([e,t])=>`@media`+e+`{
|
659
749
|
`+c+`{ grid-template-columns: repeat(`+t+`, 1fr); }
|
660
750
|
}`).join(`
|
661
751
|
`),u=`
|
@@ -727,7 +817,19 @@ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
|
|
727
817
|
>
|
728
818
|
${e.renderFn(i)}
|
729
819
|
</div>
|
730
|
-
`)}function K(
|
820
|
+
`)}function K(r,i,a=.1,o={}){let s=Array(r.length).fill(!1),c=`${a*100}vh`,l=`100vw`,u=r.map((r,a)=>t.html`
|
821
|
+
<div
|
822
|
+
${(0,n.ref)(n=>{if(n&&!s[a]){let c=new IntersectionObserver((n,c)=>{n.forEach(n=>{if(n.isIntersecting&&!s[a]){let l=n.target;s[a]=!0,(0,t.render)(i(r,a),l),e.AnimationAPI.applyAnimation(l,o);let u=l.querySelector(`[data-fallback]`);u&&u.remove(),c.unobserve(l)}})},{root:null,rootMargin:`0px`});c.observe(n)}})}
|
823
|
+
data-index="${a}"
|
824
|
+
style="transition: transform ${o.duration||`1s`} ease;"
|
825
|
+
>
|
826
|
+
<!-- 占位元素 -->
|
827
|
+
<div
|
828
|
+
data-fallback
|
829
|
+
style="height: ${c}; width: ${l};"
|
830
|
+
></div>
|
831
|
+
</div>
|
832
|
+
`);return u}function q(n){return t.html` <li>${e.renderFnOrArray(n)}</li> `}function te(n,r){let i=n?.bordered?`border: 1px solid #ddd; border-radius: 4px`:``,a=n?.striped?`li:nth-child(even) { background: #f9f9f9; }`:``,o=n?.hover?`li:hover { background: #f1f1f1; cursor: pointer; }`:``,s=e.getComponentCount(`List`),c=n?.className??e.getRandomClassName(`List::list`)+`-lyco-now-${s}`,l=`
|
731
833
|
ul.${c} {
|
732
834
|
list-style: none;
|
733
835
|
margin: 0;
|
@@ -750,7 +852,7 @@ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
|
|
750
852
|
<ul class="${c}">
|
751
853
|
${e.renderFnOrArray(n)}
|
752
854
|
</ul>
|
753
|
-
`);return r===void 0?u:u(r)}function
|
855
|
+
`);return r===void 0?u:u(r)}function J(r,i){let a=r?.bordered?`border: 1px solid #ddd; border-radius: 4px`:``,o=r?.striped?`li:nth-child(even) { background: #f9f9f9; }`:``,s=r?.hover?`li:hover { background: #f1f1f1; cursor: pointer; }`:``,c=e.getComponentCount(`ListGroup`),l=r?.className??e.getRandomClassName(`ListGroup::list-group`)+`-lyco-now-`+c,u=(e,n,r,i)=>r?t.html` <li>${e}</li> `:e,d=`
|
754
856
|
ul.${l} {
|
755
857
|
list-style: none;
|
756
858
|
margin: 0;
|
@@ -776,7 +878,7 @@ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
|
|
776
878
|
>
|
777
879
|
${e.renderFnOrArray(r,u)}
|
778
880
|
</ul>
|
779
|
-
`);return e.renderFnOrArrayOrCurry(i,p)}function
|
881
|
+
`);return e.renderFnOrArrayOrCurry(i,p)}function ne(r,i){if(i===void 0)return e=>ne(r,e??[t.html``]);let a=r?.background??`rgba(0, 0, 0, 0.5)`,o=r?.zIndex??1e3,s=r?.fullScreen!==!1,c=e.createEventBinder(r?.on??{});return t.html`
|
780
882
|
<div
|
781
883
|
${(0,n.ref)(e=>{e?c.bind(e):c.unbindAll()})}
|
782
884
|
style="
|
@@ -802,221 +904,7 @@ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
|
|
802
904
|
>
|
803
905
|
${e.renderFn(i)}
|
804
906
|
</div>
|
805
|
-
`}function
|
806
|
-
${(0,n.ref)(e=>{e?o.bind(e):o.unbindAll()})}
|
807
|
-
style="${i} ${a}"
|
808
|
-
></div>`}function ne(r){let{type:i=`rect`,width:a=`100%`,height:o=`16px`,borderRadius:s=`4px`,animation:c=!0,animationType:l=`shimmer`,bgColor:u=`#eee`,highlightColor:d=`#ddd`,count:f=1,spacing:p=`8px`,direction:m=`vertical`,delay:h=0,autoHide:g=!1,duration:_=2e3,on:v={}}=r??{},y=e.getComponentCount(`SkeletonLoader`),b=e.getRandomClassName(`SkeletonLoader::skeleton`)+`-lyco-now-`+y,x=e.createEventBinder(v),S=i===`circle`?`border-radius:50%;width:${a};height:${a}`:`border-radius:${s};width:${a};height:${o}`,C=``,w=``;c&&(l===`shimmer`?(C=`@keyframes ${b}-shimmer { 0% { background-color: ${u}; } 50% { background-color: ${d}; } 100% { background-color: ${u}; } }`,w=`animation:${b}-shimmer 1.2s infinite ease-in-out;`):(C=`@keyframes ${b}-pulse { 0% { opacity:1; } 50% { opacity:0.4; } 100% { opacity:1; } }`,w=`animation:${b}-pulse 1.2s infinite ease-in-out;`));let T=m===`horizontal`?`display:flex;flex-direction:row;gap:${p}`:`display:flex;flex-direction:column;gap:${p}`,E=[];for(let e=0;e<f;e++)E.push(t.html`
|
809
|
-
<div
|
810
|
-
class="${b}"
|
811
|
-
style="${S};background-color:${u};${w};opacity:0;transition:opacity 0.3s"
|
812
|
-
${(0,n.ref)(e=>{e&&x.bind(e)})}
|
813
|
-
></div>
|
814
|
-
`);function D(e){let t=Array.from(e.querySelectorAll(`.${b}`));setTimeout(()=>{t.forEach(e=>e.style.opacity=`1`),g&&setTimeout(()=>{t.forEach(e=>e.style.opacity=`0`)},_)},h)}return e.LycoComponent(`SkeletonLoader`,t.html`
|
815
|
-
<style>
|
816
|
-
${C}
|
817
|
-
</style>
|
818
|
-
<div
|
819
|
-
style="${T}"
|
820
|
-
${(0,n.ref)(e=>e&&D(e))}
|
821
|
-
>
|
822
|
-
${E}
|
823
|
-
</div>
|
824
|
-
`)}function re(r){let i=e.createEventBinder(r?.on??{});return t.html`<div
|
825
|
-
${(0,n.ref)(e=>{e?i.bind(e):i.unbindAll()})}
|
826
|
-
style="flex: 1 1 auto;"
|
827
|
-
></div>`}function X(r,i){if(i===void 0){let e=e=>X(r,e??t.html``);return e.html=(e,...n)=>X(r,(0,t.html)(e,...n)),e}let a=r?.top?`top: ${r.top};`:``,o=r?.bottom?`bottom: ${r.bottom};`:``,s=typeof r?.zIndex==`number`?`z-index: ${r.zIndex};`:``,c=e.createEventBinder(r?.on??{});return t.html`
|
828
|
-
<div
|
829
|
-
${(0,n.ref)(e=>{e?c.bind(e):c.unbindAll()})}
|
830
|
-
style="
|
831
|
-
position: sticky;
|
832
|
-
${a} ${o}
|
833
|
-
${s}
|
834
|
-
"
|
835
|
-
>
|
836
|
-
${e.renderFn(i)}
|
837
|
-
</div>
|
838
|
-
`}function Z(r,i){if(i===void 0){let e=e=>Z(r,e??t.html``);return e.html=(e,...n)=>Z(r,(0,t.html)(e,...n)),e}let a=e.getComponentCount(`Table`),o=r?.className??e.getRandomClassName(`Table::table`)+`-lyco-now-${a}`,s=r?.striped?`
|
839
|
-
.${o} tr:nth-child(even) {
|
840
|
-
background: ${O.colors.surface};
|
841
|
-
}
|
842
|
-
`:``,c=r?.hover?`
|
843
|
-
.${o} tr:hover {
|
844
|
-
background: ${O.colors.primaryContainer};
|
845
|
-
cursor: pointer;
|
846
|
-
}
|
847
|
-
`:``,l=r?.bordered?`
|
848
|
-
.${o}, .${o} th, .${o} td {
|
849
|
-
border: 1px solid ${O.colors.surfaceVariant};
|
850
|
-
}
|
851
|
-
`:``,u=`
|
852
|
-
.${o} table {
|
853
|
-
width: 100%;
|
854
|
-
border-collapse: separate;
|
855
|
-
border-spacing: 0;
|
856
|
-
border-radius: ${O.borderRadius.medium};
|
857
|
-
overflow: hidden;
|
858
|
-
box-shadow: ${O.elevation.level1};
|
859
|
-
}
|
860
|
-
.${o} th,
|
861
|
-
.${o} td {
|
862
|
-
padding: 16px;
|
863
|
-
text-align: left;
|
864
|
-
transition: background ${O.animation.standard};
|
865
|
-
}
|
866
|
-
.${o} th {
|
867
|
-
background: ${O.colors.surfaceVariant};
|
868
|
-
color: ${O.colors.onSurfaceVariant};
|
869
|
-
font-weight: 500;
|
870
|
-
}
|
871
|
-
.${o} td {
|
872
|
-
border-bottom: 1px solid ${O.colors.surfaceVariant};
|
873
|
-
}
|
874
|
-
${s}
|
875
|
-
${c}
|
876
|
-
${l}
|
877
|
-
`,d=e.createEventBinder(r?.on??{});return e.LycoComponent(`Table`,t.html`
|
878
|
-
<style>
|
879
|
-
${u}
|
880
|
-
</style>
|
881
|
-
|
882
|
-
<div
|
883
|
-
${(0,n.ref)(e=>{e?d.bind(e):d.unbindAll()})}
|
884
|
-
class="${o}"
|
885
|
-
>
|
886
|
-
<table>
|
887
|
-
${e.renderFn(i)}
|
888
|
-
</table>
|
889
|
-
</div>
|
890
|
-
`)}function ie(r,i){let a=r?.direction??`row`,o=e.createEventBinder(r?.on??{});return i===void 0?e=>ie(r,e??t.html``):t.html`
|
891
|
-
<div
|
892
|
-
${(0,n.ref)(e=>{e?o.bind(e):o.unbindAll()})}
|
893
|
-
style="
|
894
|
-
display: flex;
|
895
|
-
flex-direction: ${a};
|
896
|
-
flex-wrap: wrap;
|
897
|
-
${r?.gap?`gap: ${r.gap};`:``}
|
898
|
-
${r?.align?`align-items: ${r.align};`:``}
|
899
|
-
${r?.justify?`justify-content: ${r.justify};`:``}
|
900
|
-
"
|
901
|
-
>
|
902
|
-
${e.renderFnOrArray(i)}
|
903
|
-
</div>
|
904
|
-
`}function Q(r,i){let a=r?.width?`width: ${r.width};`:``,o=r?.height?`height: ${r.height};`:``,s=r?.background?`background: ${r.background};`:``,c=e.createEventBinder(r?.on??{});if(i===void 0)return e=>Q(r,e??[t.html``]);let l=`flex-start`,u=`flex-start`;switch(r?.align){case`top-right`:l=`flex-end`,u=`flex-start`;break;case`center`:l=`center`,u=`center`;break;case`bottom-left`:l=`flex-start`,u=`flex-end`;break;case`bottom-right`:l=`flex-end`,u=`flex-end`;break;default:l=`flex-start`,u=`flex-start`}return t.html`
|
905
|
-
<div
|
906
|
-
${(0,n.ref)(e=>{e?c.bind(e):c.unbindAll()})}
|
907
|
-
style="
|
908
|
-
position: relative;
|
909
|
-
display: flex;
|
910
|
-
justify-content: ${l};
|
911
|
-
align-items: ${u};
|
912
|
-
${a} ${o} ${s}
|
913
|
-
"
|
914
|
-
>
|
915
|
-
${e.renderFnOrArray(i)}
|
916
|
-
</div>
|
917
|
-
`}function ae(r,i,a=.1,o={}){let s=Array(r.length).fill(!1),c=`${a*100}vh`,l=`100vw`,u=r.map((r,a)=>t.html`
|
918
|
-
<div
|
919
|
-
${(0,n.ref)(n=>{if(n&&!s[a]){let c=new IntersectionObserver((n,c)=>{n.forEach(n=>{if(n.isIntersecting&&!s[a]){let l=n.target;s[a]=!0,(0,t.render)(i(r,a),l),e.AnimationAPI.applyAnimation(l,o);let u=l.querySelector(`[data-fallback]`);u&&u.remove(),c.unobserve(l)}})},{root:null,rootMargin:`0px`});c.observe(n)}})}
|
920
|
-
data-index="${a}"
|
921
|
-
style="transition: transform ${o.duration||`1s`} ease;"
|
922
|
-
>
|
923
|
-
<!-- 占位元素 -->
|
924
|
-
<div
|
925
|
-
data-fallback
|
926
|
-
style="height: ${c}; width: ${l};"
|
927
|
-
></div>
|
928
|
-
</div>
|
929
|
-
`);return u}function oe(r){let{value:i=``,options:a=[],placeholder:o=``,disabled:s=!1,error:c=!1,className:l=``,style:u=``,maxHeight:d=`300px`,onChange:f,onInput:p,onFocus:m,onBlur:h,on:g={},optionRender:_}=r??{},v=e.getComponentCount(`Combobox`),y=e.getRandomClassName(`Combobox::combobox`)+`-lyco-now-${v}`,b=!1,x=null,S=`
|
930
|
-
.${y} {
|
931
|
-
position: relative;
|
932
|
-
width: 100%;
|
933
|
-
}
|
934
|
-
|
935
|
-
.${y} input {
|
936
|
-
width: 100%;
|
937
|
-
padding: 12px 16px;
|
938
|
-
font-size: 16px;
|
939
|
-
border: 1px solid ${c?O.colors.error:O.colors.surfaceVariant};
|
940
|
-
border-radius: ${O.borderRadius.small};
|
941
|
-
color: ${O.colors.onSurface};
|
942
|
-
transition: all ${O.animation.standard};
|
943
|
-
outline: none;
|
944
|
-
box-sizing: border-box;
|
945
|
-
}
|
946
|
-
|
947
|
-
.${y} input:focus {
|
948
|
-
border-color: ${O.colors.primary};
|
949
|
-
box-shadow: 0 0 0 2px ${O.colors.primaryContainer};
|
950
|
-
}
|
951
|
-
|
952
|
-
.${y} input:disabled {
|
953
|
-
background: ${O.colors.surfaceVariant};
|
954
|
-
color: ${O.colors.onSurfaceVariant};
|
955
|
-
cursor: not-allowed;
|
956
|
-
}
|
957
|
-
|
958
|
-
.${y} .options {
|
959
|
-
position: absolute;
|
960
|
-
top: 100%;
|
961
|
-
left: 0;
|
962
|
-
right: 0;
|
963
|
-
max-height: ${d};
|
964
|
-
overflow-y: auto;
|
965
|
-
border: 1px solid ${O.colors.surfaceVariant};
|
966
|
-
border-radius: ${O.borderRadius.small};
|
967
|
-
box-shadow: ${O.elevation.level2};
|
968
|
-
z-index: 1000;
|
969
|
-
display: none;
|
970
|
-
}
|
971
|
-
|
972
|
-
.${y} .options.open {
|
973
|
-
display: block;
|
974
|
-
}
|
975
|
-
|
976
|
-
.${y} .option {
|
977
|
-
padding: 12px 16px;
|
978
|
-
cursor: pointer;
|
979
|
-
transition: background ${O.animation.standard};
|
980
|
-
}
|
981
|
-
|
982
|
-
.${y} .option:hover {
|
983
|
-
background: ${O.colors.primaryContainer};
|
984
|
-
}
|
985
|
-
|
986
|
-
.${y} .option.selected {
|
987
|
-
background: ${O.colors.primaryContainer};
|
988
|
-
color: ${O.colors.onPrimaryContainer};
|
989
|
-
}
|
990
|
-
`,C=e.createEventBinder(g),w=null,T=()=>{b?w?.classList.remove(`open`):w?.classList.add(`open`),b=!b},E=(e,t)=>{if(x){x.value=e.value;let n=t.currentTarget;Array.from(w?.querySelectorAll(`.selected`)??[]).forEach(e=>e.classList.remove(`selected`)),!n.classList.contains(`selected`)&&n.classList.add(`selected`),f?.(e.value)}T()},D=e=>{let t=e.target;t.closest(`.${y}`)||(b=!1,w?.classList.remove(`open`))};return typeof window<`u`&&document.addEventListener(`click`,D),e.LycoComponent(`Combobox`,t.html`
|
991
|
-
<style>
|
992
|
-
${S}
|
993
|
-
</style>
|
994
|
-
<div class="${y} ${l}" style="${u}">
|
995
|
-
<input
|
996
|
-
${(0,n.ref)(e=>{e?(x=e,C.bind(e)):C.unbindAll()})}
|
997
|
-
type="text"
|
998
|
-
.value=${i}
|
999
|
-
placeholder=${o}
|
1000
|
-
?disabled=${s}
|
1001
|
-
@focus=${()=>{m?.(),T()}}
|
1002
|
-
@input=${e=>{let t=e.target;p?.(t.value)}}
|
1003
|
-
@change=${e=>{let t=e.target;f?.(t.value)}}
|
1004
|
-
/>
|
1005
|
-
<div
|
1006
|
-
${(0,n.ref)(e=>{e&&(w=e)})}
|
1007
|
-
class="options"
|
1008
|
-
>
|
1009
|
-
${a.map(e=>t.html`
|
1010
|
-
<div
|
1011
|
-
class="option ${e.value===(x?.value??i)?`selected`:``}"
|
1012
|
-
@click=${t=>E(e,t)}
|
1013
|
-
>
|
1014
|
-
${_?_(e):e.label}
|
1015
|
-
</div>
|
1016
|
-
`)}
|
1017
|
-
</div>
|
1018
|
-
</div>
|
1019
|
-
`)}function se(r){let i=Math.min(100,Math.max(0,r?.value??0)),a=Math.min(100,Math.max(0,r?.bufferValue??0)),o=r?.color??`#1976d2`,s=r?.secondaryColor??`#90caf9`,c=r?.backgroundColor??`#e0e0e0`,l=r?.height??`4px`,u=r?.radius??`4px`,d=r?.showLabel??!1,f=r?.labelPosition??`inside`,p=r?.labelColor??(i>50?`white`:o),m=r?.labelFontSize??`12px`,h=r?.striped??!1,g=r?.animated??!1,_=r?.paused??!1,v=r?.transitionDuration??`0.3s`,y=r?.className??``,b=r?.style??``,x=e.createEventBinder(r?.on??{}),S=h?`background-image: linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);
|
907
|
+
`}function re(r){let i=Math.min(100,Math.max(0,r?.value??0)),a=Math.min(100,Math.max(0,r?.bufferValue??0)),o=r?.color??`#1976d2`,s=r?.secondaryColor??`#90caf9`,c=r?.backgroundColor??`#e0e0e0`,l=r?.height??`4px`,u=r?.radius??`4px`,d=r?.showLabel??!1,f=r?.labelPosition??`inside`,p=r?.labelColor??(i>50?`white`:o),m=r?.labelFontSize??`12px`,h=r?.striped??!1,g=r?.animated??!1,_=r?.paused??!1,v=r?.transitionDuration??`0.3s`,y=r?.className??``,b=r?.style??``,x=e.createEventBinder(r?.on??{}),S=h?`background-image: linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);
|
1020
908
|
background-size: 1rem 1rem;
|
1021
909
|
animation: progress-stripes 1s linear infinite;
|
1022
910
|
animation-play-state: ${_?`paused`:`running`};`:``;return t.html`
|
@@ -1092,7 +980,29 @@ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
|
|
1092
980
|
`:``}
|
1093
981
|
${r?.suffixIcon}
|
1094
982
|
</div>
|
1095
|
-
`}function
|
983
|
+
`}function ie(r){let i=r?.width?`width: ${r.width};`:``,a=r?.height?`height: ${r.height};`:``,o=e.createEventBinder(r?.on??{});return t.html`<div
|
984
|
+
${(0,n.ref)(e=>{e?o.bind(e):o.unbindAll()})}
|
985
|
+
style="${i} ${a}"
|
986
|
+
></div>`}function ae(r){let{type:i=`rect`,width:a=`100%`,height:o=`16px`,borderRadius:s=`4px`,animation:c=!0,animationType:l=`shimmer`,bgColor:u=`#eee`,highlightColor:d=`#ddd`,count:f=1,spacing:p=`8px`,direction:m=`vertical`,delay:h=0,autoHide:g=!1,duration:_=2e3,on:v={}}=r??{},y=e.getComponentCount(`SkeletonLoader`),b=e.getRandomClassName(`SkeletonLoader::skeleton`)+`-lyco-now-`+y,x=e.createEventBinder(v),S=i===`circle`?`border-radius:50%;width:${a};height:${a}`:`border-radius:${s};width:${a};height:${o}`,C=``,w=``;c&&(l===`shimmer`?(C=`@keyframes ${b}-shimmer { 0% { background-color: ${u}; } 50% { background-color: ${d}; } 100% { background-color: ${u}; } }`,w=`animation:${b}-shimmer 1.2s infinite ease-in-out;`):(C=`@keyframes ${b}-pulse { 0% { opacity:1; } 50% { opacity:0.4; } 100% { opacity:1; } }`,w=`animation:${b}-pulse 1.2s infinite ease-in-out;`));let T=m===`horizontal`?`display:flex;flex-direction:row;gap:${p}`:`display:flex;flex-direction:column;gap:${p}`,E=[];for(let e=0;e<f;e++)E.push(t.html`
|
987
|
+
<div
|
988
|
+
class="${b}"
|
989
|
+
style="${S};background-color:${u};${w};opacity:0;transition:opacity 0.3s"
|
990
|
+
${(0,n.ref)(e=>{e&&x.bind(e)})}
|
991
|
+
></div>
|
992
|
+
`);function D(e){let t=Array.from(e.querySelectorAll(`.${b}`));setTimeout(()=>{t.forEach(e=>e.style.opacity=`1`),g&&setTimeout(()=>{t.forEach(e=>e.style.opacity=`0`)},_)},h)}return e.LycoComponent(`SkeletonLoader`,t.html`
|
993
|
+
<style>
|
994
|
+
${C}
|
995
|
+
</style>
|
996
|
+
<div
|
997
|
+
style="${T}"
|
998
|
+
${(0,n.ref)(e=>e&&D(e))}
|
999
|
+
>
|
1000
|
+
${E}
|
1001
|
+
</div>
|
1002
|
+
`)}function oe(r){let i=e.createEventBinder(r?.on??{});return t.html`<div
|
1003
|
+
${(0,n.ref)(e=>{e?i.bind(e):i.unbindAll()})}
|
1004
|
+
style="flex: 1 1 auto;"
|
1005
|
+
></div>`}function se(r){let{size:i=`24px`,color:a=O.colors.primary,thickness:o=`2px`,speed:s=`1.2s`,className:c=``,opacity:l=1,startAngle:u=0,easing:d=`linear`,reverse:f=!1,style:p=``,on:m={},children:h,svgMode:g=!1,strokeLinecap:_=`butt`,strokeDasharray:v=``}=r??{},y=e.createEventBinder(m),b=e.getComponentCount(`Spinner`),x=t.html`
|
1096
1006
|
<div
|
1097
1007
|
class="${c}"
|
1098
1008
|
style="display: inline-flex; align-items: center; justify-content: center; width: ${i}; height: ${i}; ${p}"
|
@@ -1163,7 +1073,70 @@ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
|
|
1163
1073
|
}
|
1164
1074
|
`.cssText}
|
1165
1075
|
</style>
|
1166
|
-
`;return e.LycoComponent(`Spinner`,g?S:x)}
|
1076
|
+
`;return e.LycoComponent(`Spinner`,g?S:x)}function X(r,i){if(i===void 0){let e=e=>X(r,e??t.html``);return e.html=(e,...n)=>X(r,(0,t.html)(e,...n)),e}let a=r?.top?`top: ${r.top};`:``,o=r?.bottom?`bottom: ${r.bottom};`:``,s=typeof r?.zIndex==`number`?`z-index: ${r.zIndex};`:``,c=e.createEventBinder(r?.on??{});return t.html`
|
1077
|
+
<div
|
1078
|
+
${(0,n.ref)(e=>{e?c.bind(e):c.unbindAll()})}
|
1079
|
+
style="
|
1080
|
+
position: sticky;
|
1081
|
+
${a} ${o}
|
1082
|
+
${s}
|
1083
|
+
"
|
1084
|
+
>
|
1085
|
+
${e.renderFn(i)}
|
1086
|
+
</div>
|
1087
|
+
`}function Z(r,i){if(i===void 0){let e=e=>Z(r,e??t.html``);return e.html=(e,...n)=>Z(r,(0,t.html)(e,...n)),e}let a=e.getComponentCount(`Table`),o=r?.className??e.getRandomClassName(`Table::table`)+`-lyco-now-${a}`,s=r?.striped?`
|
1088
|
+
.${o} tr:nth-child(even) {
|
1089
|
+
background: ${O.colors.surface};
|
1090
|
+
}
|
1091
|
+
`:``,c=r?.hover?`
|
1092
|
+
.${o} tr:hover {
|
1093
|
+
background: ${O.colors.primaryContainer};
|
1094
|
+
cursor: pointer;
|
1095
|
+
}
|
1096
|
+
`:``,l=r?.bordered?`
|
1097
|
+
.${o}, .${o} th, .${o} td {
|
1098
|
+
border: 1px solid ${O.colors.surfaceVariant};
|
1099
|
+
}
|
1100
|
+
`:``,u=`
|
1101
|
+
.${o} table {
|
1102
|
+
width: 100%;
|
1103
|
+
border-collapse: separate;
|
1104
|
+
border-spacing: 0;
|
1105
|
+
border-radius: ${O.borderRadius.medium};
|
1106
|
+
overflow: hidden;
|
1107
|
+
box-shadow: ${O.elevation.level1};
|
1108
|
+
}
|
1109
|
+
.${o} th,
|
1110
|
+
.${o} td {
|
1111
|
+
padding: 16px;
|
1112
|
+
text-align: left;
|
1113
|
+
transition: background ${O.animation.standard};
|
1114
|
+
}
|
1115
|
+
.${o} th {
|
1116
|
+
background: ${O.colors.surfaceVariant};
|
1117
|
+
color: ${O.colors.onSurfaceVariant};
|
1118
|
+
font-weight: 500;
|
1119
|
+
}
|
1120
|
+
.${o} td {
|
1121
|
+
border-bottom: 1px solid ${O.colors.surfaceVariant};
|
1122
|
+
}
|
1123
|
+
${s}
|
1124
|
+
${c}
|
1125
|
+
${l}
|
1126
|
+
`,d=e.createEventBinder(r?.on??{});return e.LycoComponent(`Table`,t.html`
|
1127
|
+
<style>
|
1128
|
+
${u}
|
1129
|
+
</style>
|
1130
|
+
|
1131
|
+
<div
|
1132
|
+
${(0,n.ref)(e=>{e?d.bind(e):d.unbindAll()})}
|
1133
|
+
class="${o}"
|
1134
|
+
>
|
1135
|
+
<table>
|
1136
|
+
${e.renderFn(i)}
|
1137
|
+
</table>
|
1138
|
+
</div>
|
1139
|
+
`)}let Q=function(e){return e.Top=`top`,e.Bottom=`bottom`,e.Left=`left`,e.Right=`right`,e}({});function ce(r,i){let{content:a,placement:o=Q.Top,delay:s={show:200,hide:100},offset:c=8,hideOnClick:l=!1,interactive:u=!1,maxWidth:d=`200px`,theme:f=`dark`,className:p=``,style:m=``,zIndex:h=1e3,on:g={},onShow:_,onHide:v}=r,y=e.createEventBinder(g),b,x;function S(e){clearTimeout(x),b=window.setTimeout(()=>{w.style.visibility=`visible`,w.style.opacity=`1`,_?.()},s.show)}function C(){clearTimeout(b),x=window.setTimeout(()=>{w.style.visibility=`hidden`,w.style.opacity=`0`,v?.()},s.hide)}let w,T=r=>t.html`
|
1167
1140
|
<div
|
1168
1141
|
${(0,n.ref)(e=>{e?(y.bind(e),w=e.querySelector(`.lyco-tooltip-content`),e.addEventListener(`mouseenter`,()=>S(e)),e.addEventListener(`mouseleave`,()=>C()),l&&e.addEventListener(`click`,()=>C())):y.unbindAll()})}
|
1169
1142
|
class="lyco-tooltip lyco-tooltip--${f} ${p}"
|
@@ -1175,29 +1148,56 @@ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
|
|
1175
1148
|
style="
|
1176
1149
|
position: absolute;
|
1177
1150
|
max-width: ${d};
|
1178
|
-
${o
|
1179
|
-
${o
|
1180
|
-
${o
|
1181
|
-
${o
|
1151
|
+
${o===Q.Top?`bottom: 100%; left: 50%; transform: translateX(-50%)`:``}
|
1152
|
+
${o===Q.Bottom?`top: 100%; left: 50%; transform: translateX(-50%)`:``}
|
1153
|
+
${o===Q.Left?`right: 100%; top: 50%; transform: translateY(-50%)`:``}
|
1154
|
+
${o===Q.Right?`left: 100%; top: 50%; transform: translateY(-50%)`:``}
|
1182
1155
|
padding: 4px 8px;
|
1183
1156
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
|
1184
1157
|
background: ${f===`light`?`white; color: black`:`rgba(0,0,0,0.8); color: white`};
|
1185
1158
|
border-radius: 4px;
|
1186
1159
|
font-size: 12px;
|
1187
1160
|
white-space: normal;
|
1188
|
-
width: ${o
|
1161
|
+
width: ${o===Q.Left||o===Q.Right?d:`auto`};
|
1189
1162
|
visibility: hidden;
|
1190
1163
|
opacity: 0;
|
1191
1164
|
transition: opacity ${s.show}ms;
|
1192
1165
|
z-index: ${h};
|
1193
|
-
margin: ${typeof c==`number`?o
|
1166
|
+
margin: ${typeof c==`number`?o===Q.Top||o===Q.Bottom?`${c}px 0`:`0 ${c}px`:`${c.y}px ${c.x}px`};
|
1194
1167
|
${u?`pointer-events: auto`:`pointer-events: none`};
|
1195
1168
|
"
|
1196
1169
|
>
|
1197
1170
|
${a}
|
1198
1171
|
</div>
|
1199
1172
|
</div>
|
1200
|
-
`;return e.renderFnOrCurry(i,T)}
|
1173
|
+
`;return e.renderFnOrCurry(i,T)}function le(r,i){let a=r?.direction??`row`,o=e.createEventBinder(r?.on??{});return i===void 0?e=>le(r,e??t.html``):t.html`
|
1174
|
+
<div
|
1175
|
+
${(0,n.ref)(e=>{e?o.bind(e):o.unbindAll()})}
|
1176
|
+
style="
|
1177
|
+
display: flex;
|
1178
|
+
flex-direction: ${a};
|
1179
|
+
flex-wrap: wrap;
|
1180
|
+
${r?.gap?`gap: ${r.gap};`:``}
|
1181
|
+
${r?.align?`align-items: ${r.align};`:``}
|
1182
|
+
${r?.justify?`justify-content: ${r.justify};`:``}
|
1183
|
+
"
|
1184
|
+
>
|
1185
|
+
${e.renderFnOrArray(i)}
|
1186
|
+
</div>
|
1187
|
+
`}function ue(r,i){let a=r?.width?`width: ${r.width};`:``,o=r?.height?`height: ${r.height};`:``,s=r?.background?`background: ${r.background};`:``,c=e.createEventBinder(r?.on??{});if(i===void 0)return e=>ue(r,e??[t.html``]);let l=`flex-start`,u=`flex-start`;switch(r?.align){case`top-right`:l=`flex-end`,u=`flex-start`;break;case`center`:l=`center`,u=`center`;break;case`bottom-left`:l=`flex-start`,u=`flex-end`;break;case`bottom-right`:l=`flex-end`,u=`flex-end`;break;default:l=`flex-start`,u=`flex-start`}return t.html`
|
1188
|
+
<div
|
1189
|
+
${(0,n.ref)(e=>{e?c.bind(e):c.unbindAll()})}
|
1190
|
+
style="
|
1191
|
+
position: relative;
|
1192
|
+
display: flex;
|
1193
|
+
justify-content: ${l};
|
1194
|
+
align-items: ${u};
|
1195
|
+
${a} ${o} ${s}
|
1196
|
+
"
|
1197
|
+
>
|
1198
|
+
${e.renderFnOrArray(i)}
|
1199
|
+
</div>
|
1200
|
+
`}let de=function(e){return e.Center=`center`,e.Left=`left`,e.Right=`right`,e.Top=`top`,e.Bottom=`bottom`,e.TopStart=`top-start`,e.TopEnd=`top-end`,e.BottomStart=`bottom-start`,e.BottomEnd=`bottom-end`,e.LeftStart=`left-start`,e.LeftEnd=`left-end`,e.RightStart=`right-start`,e.RightEnd=`right-end`,e}({});const fe=typeof window>`u`,pe=!fe&&`HTMLDialogElement`in window,me=e=>`
|
1201
1201
|
position: fixed;
|
1202
1202
|
top: 0;
|
1203
1203
|
left: 0;
|
@@ -1208,7 +1208,7 @@ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
|
|
1208
1208
|
justify-content: center;
|
1209
1209
|
z-index: 1000;
|
1210
1210
|
background: rgba(0,0,0,0.3);
|
1211
|
-
`;var
|
1211
|
+
`;var $=class{constructor(e,t){this.isOpen=!1,this.returnValue=``,this.element=e,this.contentElement=t}show(){this.element.style.display=`flex`,this.isOpen=!0}showModal(){this.show()}close(){this.element.style.display=`none`,this.isOpen=!1,this.element.dispatchEvent(new Event(`close`))}get open(){return this.isOpen}getBoundingClientRect(){return this.contentElement.getBoundingClientRect()}get style(){return this.contentElement.style}};function he(r,i){let a=r?.open??!1,o=r?.onClose,s=r?.className??``,c=r?.style??``,l=e.createEventBinder(r?.on?r?.on:{}),u=r?.movable??!1,d=r?.placement??de.Center,f=r?.proxyRef??{value:null},p=null,m=!1,h={x:0,y:0},g=null,_=r?.mask??!0,v=e.getComponentCount(`Dialog`),y=e.getRandomClassName(`Dialog::dialog`)+`-lyco-now-`+v;function b(e){return u?u===`self`?e:u&&`value`in u?u.value:null:null}function x(){if(typeof window>`u`)return``;let e=300,t=150,n=(window.innerWidth-e)/2,r=(window.innerHeight-t)/2;return`left: ${n}px; top: ${r}px;`}function S(){switch(d){case`left`:return`left: 32px; top: 50%;`;case`right`:return`right: 32px; top: 50%;`;case`top`:return`top: 32px; left: 50%;`;case`bottom`:return`bottom: 32px; left: 50%;`;case`top-start`:return`top: 32px; left: 32px;`;case`top-end`:return`top: 32px; right: 32px;`;case`bottom-start`:return`bottom: 32px; left: 32px;`;case`bottom-end`:return`bottom: 32px; right: 32px;`;case`left-start`:return`left: 32px; top: 32px;`;case`left-end`:return`left: 32px; bottom: 32px;`;case`right-start`:return`right: 32px; top: 32px;`;case`right-end`:return`right: 32px; bottom: 32px;`;default:return x()}}function C(){switch(d){case`top-start`:case`top-end`:case`bottom-start`:case`bottom-end`:case`left-start`:case`left-end`:case`right-start`:case`right-end`:return{txp:0,typ:0};case`left`:return{txp:0,typ:-50};case`right`:return{txp:0,typ:-50};case`top`:return{txp:-50,typ:0};case`bottom`:return{txp:-50,typ:0};default:return{txp:-50,typ:-50}}}function w(e,t){if(e.button!==0||(g=b(t),!g||!g.contains(e.target)))return;p=t,p.style.transform=`none`,e.preventDefault(),g.style.cursor=`grabbing`;let n=t.getBoundingClientRect(),{txp:r,typ:i}=C();h={x:e.clientX-(n.left+r/100*n.width),y:e.clientY-(n.top+i/100*n.height)},m=!0,document.addEventListener(`mousemove`,T),document.addEventListener(`mouseup`,E)}function T(e){if(!m||!g||!p)return;let t=p.getBoundingClientRect(),{txp:n,typ:r}=C(),i=e.clientX-h.x-n/100*t.width,a=e.clientY-h.y-r/100*t.height;p.style.left=`${i}px`,p.style.top=`${a}px`}function E(){m=!1,g=null,p=null,document.removeEventListener(`mousemove`,T),document.removeEventListener(`mouseup`,E)}function D(){let e=_?`rgba(0,0,0,0.5)`:`transparent`;return`
|
1212
1212
|
${y}::-webkit-backdrop,
|
1213
1213
|
${y}::backdrop {
|
1214
1214
|
background: ${e};
|
@@ -1216,12 +1216,12 @@ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
|
|
1216
1216
|
}
|
1217
1217
|
`}function k(r){let i=null,d=null;return e.LycoComponent(`Dialog`,t.html`
|
1218
1218
|
<div
|
1219
|
-
${(0,n.ref)(e=>{if(e){if(i=e,d){let e=new
|
1219
|
+
${(0,n.ref)(e=>{if(e){if(i=e,d){let e=new $(i,d);f.value=e,l.bind(i),a?e.showModal():e.close()}}else l.unbindAll()})}
|
1220
1220
|
@click=${e=>{e.target===e.currentTarget&&o?.()}}
|
1221
|
-
style=${
|
1221
|
+
style=${me(a)}
|
1222
1222
|
>
|
1223
1223
|
<div
|
1224
|
-
${(0,n.ref)(e=>{if(e&&(d=e,i)){let e=new
|
1224
|
+
${(0,n.ref)(e=>{if(e&&(d=e,i)){let e=new $(i,d);f.value=e}})}
|
1225
1225
|
class="${y} ${s}"
|
1226
1226
|
style="
|
1227
1227
|
padding: 0;
|
@@ -1237,7 +1237,7 @@ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
|
|
1237
1237
|
${e.renderFnOrArray(r)}
|
1238
1238
|
</div>
|
1239
1239
|
</div>
|
1240
|
-
`)}function A(r){return
|
1240
|
+
`)}function A(r){return fe||!pe?k(r):e.LycoComponent(`Dialog`,t.html`
|
1241
1241
|
<dialog
|
1242
1242
|
${(0,n.ref)(e=>{if(e){f.value=e;let t=e;l.bind(t),requestAnimationFrame(()=>{try{a?t.showModal():t.close()}catch(e){console.warn(`Dialog operation failed:`,e)}})}else l.unbindAll()})}
|
1243
1243
|
@close=${o}
|
@@ -1323,5 +1323,5 @@ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
|
|
1323
1323
|
>
|
1324
1324
|
${e.renderFn(r)}
|
1325
1325
|
</div>
|
1326
|
-
`;return e.renderFnOrCurry(i,l)}function be(t){return e.renderFnOrArray(t)}exports.$Html=be,exports.AbsoluteBox=A,exports.AcrylicBar=j,exports.AspectRatio=M,exports.AutoFitGrid=N,exports.AvatarStack=P,exports.Badge=F,exports.Canvas=I,exports.Card=L,exports.Center=R,exports.Column=m,exports.ColumnSplit=C,exports.Combobox=
|
1326
|
+
`;return e.renderFnOrCurry(i,l)}function be(t){return e.renderFnOrArray(t)}function xe(t,n){let r=`__LYCO_ONCE_`+e.getComponentCount(`$Once`);if(t[r])return t[r];{let i=e.LycoComponent(`$Once`,n());return t[r]=i,t[r]}}exports.$Html=be,exports.$Once=xe,exports.AbsoluteBox=A,exports.AcrylicBar=j,exports.AspectRatio=M,exports.AutoFitGrid=N,exports.AvatarStack=P,exports.Badge=F,exports.Canvas=I,exports.Card=L,exports.Center=R,exports.Column=m,exports.ColumnSplit=C,exports.Combobox=z,exports.Container=B,exports.Dialog=he,exports.DialogActions=ge,exports.DialogButton=_e,exports.DialogContent=ve,exports.DialogPlacement=de,exports.DialogTitle=ye,exports.Divider=V,exports.Flex=h,exports.FlowItem=g,exports.FooterLayout=H,exports.ForEach=ee,exports.Grid=_,exports.GridBreakpoint=U,exports.GridCol=v,exports.GridItem=y,exports.GridRow=b,exports.HeroSection=W,exports.Hidden=G,exports.LazyForEach=K,exports.LightboxContainer=p,exports.List=te,exports.ListGroup=J,exports.ListItem=q,exports.Overlay=ne,exports.PositionContainer=Y,exports.Progress=re,exports.Row=x,exports.RowSplit=w,exports.ScrollBar=T,exports.SideBarContainer=E,exports.SizedBox=ie,exports.SkeletonLoader=ae,exports.Spacer=oe,exports.Spinner=se,exports.Sticky=X,exports.Swiper=D,exports.SwitchInput=k,exports.Table=Z,exports.Virtualizer=f,exports.VirtualizerController=c,exports.WaterFlow=S,exports.WithTooltip=ce,exports.Wrap=le,exports.ZStack=ue;
|
1327
1327
|
//# sourceMappingURL=index.cjs.js.map
|