lyco 1.2.9 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/basic.cjs.js +2 -0
- package/dist/basic.cjs.js.map +1 -0
- package/dist/basic.es.js +2 -0
- package/dist/basic.es.js.map +1 -0
- package/dist/core-B-U2ZJO6.mjs +5 -0
- package/dist/core-B-U2ZJO6.mjs.map +1 -0
- package/dist/core-DkUSnSgK.js +5 -0
- package/dist/core-DkUSnSgK.js.map +1 -0
- package/dist/index.cjs.js +864 -351
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +853 -340
- package/dist/index.es.js.map +1 -1
- package/dist/types/basic.d.ts +1 -0
- package/dist/types/{src/components → components}/AbsoluteBox.d.ts +1 -1
- package/dist/types/{src/components → components}/AcrylicBar.d.ts +1 -1
- package/dist/types/{src/components → components}/AspectRatio.d.ts +1 -1
- package/dist/types/{src/components → components}/AutoFitGrid.d.ts +1 -1
- package/dist/types/{src/components → components}/AvatarStack.d.ts +1 -1
- package/dist/types/{src/components → components}/Badge.d.ts +1 -1
- package/dist/types/components/Basic/mod.d.ts +10551 -0
- package/dist/types/{src/components → components}/Canvas.d.ts +1 -1
- package/dist/types/{src/components → components}/Card.d.ts +1 -1
- package/dist/types/{src/components → components}/Center.d.ts +1 -1
- package/dist/types/{src/components → components}/Column.d.ts +3 -1
- package/dist/types/{src/components → components}/ColumnSplit.d.ts +1 -1
- package/dist/types/components/Combobox.d.ts +23 -0
- package/dist/types/{src/components → components}/Container.d.ts +1 -1
- package/dist/types/components/Dialog/Dialog.d.ts +40 -0
- package/dist/types/components/Dialog/DialogActions.d.ts +10 -0
- package/dist/types/components/Dialog/DialogButton.d.ts +13 -0
- package/dist/types/components/Dialog/DialogContent.d.ts +10 -0
- package/dist/types/components/Dialog/DialogTitle.d.ts +12 -0
- package/dist/types/components/Dialog/index.d.ts +5 -0
- package/dist/types/{src/components → components}/Divider.d.ts +1 -1
- package/dist/types/{src/components → components}/Flex.d.ts +1 -1
- package/dist/types/{src/components → components}/FlowItem.d.ts +1 -1
- package/dist/types/{src/components → components}/FooterLayout.d.ts +1 -1
- package/dist/types/{src/components → components}/Grid.d.ts +1 -1
- package/dist/types/{src/components → components}/GridBreakpoint.d.ts +1 -1
- package/dist/types/{src/components → components}/GridCol.d.ts +1 -1
- package/dist/types/{src/components → components}/GridItem.d.ts +1 -1
- package/dist/types/{src/components → components}/GridRow.d.ts +1 -1
- package/dist/types/{src/components → components}/HeroSection.d.ts +1 -1
- package/dist/types/{src/components → components}/Hidden.d.ts +1 -1
- package/dist/types/{src/components → components}/LightboxContainer.d.ts +1 -1
- package/dist/types/{src/components → components}/List.d.ts +1 -1
- package/dist/types/{src/components → components}/ListGroup.d.ts +1 -1
- package/dist/types/{src/components → components}/Overlay.d.ts +1 -1
- package/dist/types/{src/components → components}/PositionContainer.d.ts +1 -1
- package/dist/types/components/Progress.d.ts +26 -0
- package/dist/types/{src/components → components}/Row.d.ts +3 -1
- package/dist/types/{src/components → components}/RowSplit.d.ts +1 -1
- package/dist/types/{src/components → components}/ScrollBar.d.ts +1 -1
- package/dist/types/{src/components → components}/SideBarContainer.d.ts +1 -1
- package/dist/types/{src/components → components}/SizedBox.d.ts +1 -1
- package/dist/types/components/SkeletonLoader.d.ts +19 -0
- package/dist/types/{src/components → components}/Spacer.d.ts +1 -1
- package/dist/types/components/Spinner.d.ts +21 -0
- package/dist/types/{src/components → components}/Sticky.d.ts +1 -1
- package/dist/types/{src/components → components}/Swiper.d.ts +1 -1
- package/dist/types/components/SwitchInput.d.ts +12 -0
- package/dist/types/{src/components → components}/Table.d.ts +1 -1
- package/dist/types/components/Tooltip.d.ts +48 -0
- package/dist/types/{src/components → components}/WaterFlow.d.ts +1 -1
- package/dist/types/{src/components → components}/Wrap.d.ts +1 -1
- package/dist/types/{src/components → components}/ZStack.d.ts +1 -1
- package/dist/types/{src/components/index.d.ts → components/mod.d.ts} +9 -0
- package/dist/types/{src/components/core.d.ts → core/index.d.ts} +19 -2
- package/dist/types/index.d.ts +1 -2
- package/dist/types/theme/md3.d.ts +35 -0
- package/package.json +22 -2
- package/dist/types/src/components/SkeletonLoader.d.ts +0 -10
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/stories/virtualizer-example.d.ts +0 -12
- package/dist/types/stories/virtualizer-example.stories.d.ts +0 -10
- /package/dist/types/{src/components → components}/ForEach.d.ts +0 -0
- /package/dist/types/{src/components → components}/Style.d.ts +0 -0
- /package/dist/types/{src/components → components}/Virtualizer.labs.d.ts +0 -0
package/dist/index.es.js
CHANGED
@@ -1,260 +1,286 @@
|
|
1
|
-
import{
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
import{LycoComponent as e,createEventBinder as t,getComponentCount as n,getRandomClassName as r,renderFn as i,renderFnOrArray as a,renderFnOrArrayOrCurry as o,renderFnOrCurry as s}from"./core-B-U2ZJO6.mjs";import{css as c,html as l,nothing as u}from"lit";import{createRef as d,ref as f}from"lit/directives/ref.js";import{styleMap as p}from"lit/directives/style-map.js";const m=typeof window>`u`,h=100;var g=class{constructor(e){this._capacity=e,this.buffer=Array(e)}set(e,t){this.buffer[e%this._capacity]=t}get(e){return this.buffer[e%this._capacity]}clear(){this.buffer.fill(void 0)}get capacity(){return this._capacity}},_=class{constructor(){this.data=new Float64Array}set(e,t){let n=e*3;this.data[n]=t.start,this.data[n+1]=t.end,this.data[n+2]=t.total}get(e){let t=e*3;return t<0||t+2>=this.data.length?{start:0,end:0,total:0}:{start:this.data[t],end:this.data[t+1],total:this.data[t+2]}}initialize(e){this.data=new Float64Array(Math.ceil(e/h)*3),this.data.fill(0)}},v=class{constructor(e,t,n){this._items=[],this._itemSize=50,this._layout=`vertical`,this._preloadCount=5,this._cacheSize=200,this._renderItem=()=>l``,this._containerRef=d(),this._firstVisible=0,this._lastVisible=0,this._positionCache=new Float64Array,this._sizeCache=new Float32Array,this._cacheInitialized=!1,this._totalContentSize=0,this._blockStore=new _,this._recycledNodes=[],this.RECYCLE_POOL_SIZE=20,this._preRenderChunkSize=5,this.CHUNK_SIZE=1e3,this._chunks=new Map,this._visibleChunkIndexes=new Set,this._loadedChunks=new Set,this._estimatedItemHeight=0,this._isLoading=!1,this._hasMore=!1,this._pageSize=50,this._fetchMoreThreshold=.8,this._getItemSize=e=>typeof this._itemSize==`function`?this._itemSize(e):this._itemSize,this._calculateMetrics=()=>{if(this._items.length===0){this._positionCache=new Float64Array,this._sizeCache=new Float32Array,this._blockStore.initialize(0),this._totalContentSize=0,this._cacheInitialized=!0,this._templateBuffer.clear();return}this._positionCache=new Float64Array(this._items.length),this._sizeCache=new Float32Array(this._items.length),this._blockStore.initialize(this._items.length);let e=0,t=0,n=0;for(let r=0;r<this._items.length;r++){let i=this._getItemSize(r);if(this._positionCache[r]=e,this._sizeCache[r]=i,n+=i,(r+1)%h===0||r===this._items.length-1){let a=Math.floor(r/h);this._blockStore.set(a,{start:t,end:e+i,total:n}),t=e+i,n=0}e+=i}this._totalContentSize=e,this._cacheInitialized=!0,this._templateBuffer.clear()},this._findItemIndexByOffset=e=>{if(!this._cacheInitialized||this._items.length===0)return 0;let t=0,n=this._items.length-1,r=0;for(;t<=n;){let i=Math.floor((t+n)/2);this._positionCache[i]<=e?(r=i,t=i+1):n=i-1}return r},this._updateVisibleRange=()=>{if(!this._containerRef.value)return;let e=this._layout===`vertical`,t=e?this._containerRef.value.scrollTop:this._containerRef.value.scrollLeft,n=e?this._containerRef.value.clientHeight:this._containerRef.value.clientWidth;this._firstVisible=Math.floor(t/this._estimatedItemHeight),this._lastVisible=Math.ceil((t+n)/this._estimatedItemHeight),this._checkAndLoadMore(),this.host.requestUpdate()},this._ticking=!1,this._lastUpdate=0,this.FRAME_BUDGET=16,this._scheduleUpdate=async()=>{if(this._ticking)return;let e=performance.now(),t=e-this._lastUpdate;t>=this.FRAME_BUDGET&&(this._ticking=!0,requestAnimationFrame(()=>{this._updateVisibleRange(),this._ticking=!1,this._lastUpdate=performance.now()}))},this.host=e,e.addController(this),this.updateConfig(t,n),this._templateBuffer=new g(this._cacheSize),this._pageSize=t.pageSize??50,this._fetchMoreThreshold=t.fetchMoreThreshold??.8,m||(this._setupObservers(),this._setupResizeObserver(),this._initializeChunks())}_initializeItems(e){this._items=[...e],this._calculateMetrics(),this._initializeChunks(),this.host.requestUpdate()}_updateMetricsForRange(e,t){if(t>this._positionCache.length){let e=new Float64Array(Math.max(t*1.5,1e3));e.set(this._positionCache),this._positionCache=e;let n=new Float32Array(Math.max(t*1.5,1e3));n.set(this._sizeCache),this._sizeCache=n}let n=e===0?0:this._positionCache[e-1]+this._sizeCache[e-1];for(let r=e;r<t;r++){let e=this._getItemSize(r);this._positionCache[r]=n,this._sizeCache[r]=e,n+=e}this._totalContentSize=n,this._updateChunkMetrics()}_setupObservers(){this._intersectionObserver=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&this._preRenderChunk()})},{rootMargin:`50%`}),this._mutationObserver=new MutationObserver(e=>{e.forEach(e=>{e.removedNodes.forEach(e=>{e instanceof HTMLElement&&this._recycledNodes.length<this.RECYCLE_POOL_SIZE&&this._recycledNodes.push(e)})})})}_setupResizeObserver(){this._resizeObserver=new ResizeObserver(e=>{for(let t of e)if(t.target instanceof HTMLElement){let e=t.contentRect.height;e>0&&(this._estimatedItemHeight=e,this._updateChunkMetrics())}})}_initializeChunks(){this._chunks.clear();let e=Math.ceil(this._items.length/this.CHUNK_SIZE);for(let t=0;t<e;t++){let e=t*this.CHUNK_SIZE,n=Math.min(e+this.CHUNK_SIZE,this._items.length);this._chunks.set(t,this._items.slice(e,n))}}_updateChunkMetrics(){if(!this._containerRef.value)return;let e=this._containerRef.value.clientHeight,t=this._items.length*this._estimatedItemHeight;this._blockStore.initialize(Math.ceil(this._items.length/this.CHUNK_SIZE));let n=0;for(let e=0;e<this._chunks.size;e++){let t=Math.min(this.CHUNK_SIZE,this._items.length-e*this.CHUNK_SIZE),r=t*this._estimatedItemHeight;this._blockStore.set(e,{start:n,end:n+r,total:r}),n+=r}this._totalContentSize=t,this._calculateVisibleChunks()}_calculateVisibleChunks(){if(!this._containerRef.value)return;let e=this._containerRef.value.scrollTop,t=this._containerRef.value.clientHeight,n=Math.floor(e/(this.CHUNK_SIZE*this._estimatedItemHeight)),r=Math.ceil((e+t)/(this.CHUNK_SIZE*this._estimatedItemHeight));this._visibleChunkIndexes.clear();for(let e=n;e<=r;e++)this._chunks.has(e)&&this._visibleChunkIndexes.add(e);this._preloadAdjacentChunks(n-1,r+1)}_preloadAdjacentChunks(e,t){for(let n=e;n<=t;n++)n>=0&&n<this._chunks.size&&!this._loadedChunks.has(n)&&requestIdleCallback(()=>{this._loadChunk(n)})}_loadChunk(e){if(this._loadedChunks.has(e))return;let t=e*this.CHUNK_SIZE,n=Math.min(t+this.CHUNK_SIZE,this._items.length),r=this._items.slice(t,n);this._chunks.set(e,r),this._loadedChunks.add(e),this._calculateMetricsForChunk(e)}_calculateMetricsForChunk(e){let t=e*this.CHUNK_SIZE,n=this._chunks.get(e)||[],r=t*this._estimatedItemHeight;for(let e=0;e<n.length;e++){let n=t+e;this._positionCache[n]=r,this._sizeCache[n]=this._estimatedItemHeight,r+=this._estimatedItemHeight}}_preRenderChunk(){this._idleCallbackId&&cancelIdleCallback(this._idleCallbackId),this._idleCallbackId=requestIdleCallback(e=>{let t=this._lastVisible+1,n=0;for(;e.timeRemaining()>0&&n<this._preRenderChunkSize&&t<this._items.length;)this._prerenderItem(t),t++,n++;t<this._items.length&&this._preRenderChunk()})}_prerenderItem(e){let t=e%this._cacheSize;if(!this._templateBuffer.get(t)){let n=this._positionCache[e],r=this._sizeCache[e];if(n!==void 0&&r!==void 0){let i=this._getItemStyle(n,r),a=this._createItemTemplate(this._items[e],e,i);this._templateBuffer.set(t,a)}}}_getItemStyle(e,t){let n=this._layout===`vertical`;return{position:`absolute`,[n?`top`:`left`]:`${e}px`,[n?`height`:`width`]:`${t}px`,width:n?`100%`:`auto`,height:n?`auto`:`100%`,willChange:`transform`,contain:`content`,backfaceVisibility:`hidden`,WebkitFontSmoothing:`subpixel-antialiased`}}_createItemTemplate(e,t,n){let r=this._recycledNodes.pop(),i=`item-${t}`;return l`
|
2
|
+
${r?l`<div
|
3
|
+
.key=${i}
|
4
|
+
style=${p(n)}
|
5
|
+
data-index=${t}
|
6
|
+
.recycled=${r}
|
7
|
+
>
|
8
|
+
${this._renderItem(e,t)}
|
9
|
+
</div>`:l`<div .key=${i} style=${p(n)} data-index=${t}>
|
10
|
+
${this._renderItem(e,t)}
|
11
|
+
</div>`}
|
12
|
+
`}hostConnected(){if(m||this.host.updateComplete.then(()=>{this._containerRef.value&&(this._containerRef.value.addEventListener(`scroll`,this._scheduleUpdate),this._calculateMetrics(),this._updateVisibleRange(),this.host.requestUpdate())}),!m&&this._containerRef.value){var e,t,n;(e=this._intersectionObserver)?.observe(this._containerRef.value),(t=this._mutationObserver)?.observe(this._containerRef.value,{childList:!0,subtree:!0,attributes:!0}),(n=this._resizeObserver)?.observe(this._containerRef.value)}}hostDisconnected(){var e,t,n;!m&&this._containerRef.value&&this._containerRef.value.removeEventListener(`scroll`,this._scheduleUpdate),(e=this._intersectionObserver)?.disconnect(),(t=this._mutationObserver)?.disconnect(),(n=this._resizeObserver)?.disconnect(),this._idleCallbackId&&cancelIdleCallback(this._idleCallbackId)}hostUpdated(){!m&&!this._cacheInitialized&&this._containerRef.value&&this._items.length>0&&(this._calculateMetrics(),this._updateVisibleRange(),this.host.requestUpdate())}async updateConfig(e,t){let n=this._itemSize,r=this._cacheSize;this._itemSize=e.itemSize??50,this._layout=e.layout??`vertical`,this._preloadCount=e.preloadCount??5,this._cacheSize=e.cacheSize??200,this._renderItem=t,this._onLoadMore=e.onLoadMore,`items`in e&&this._initializeItems(e.items),this._pageSize=e.pageSize??this._pageSize,this._fetchMoreThreshold=e.fetchMoreThreshold??this._fetchMoreThreshold,r!==this._cacheSize&&(this._templateBuffer=new g(this._cacheSize)),n!==this._itemSize&&(this._calculateMetrics(),this._initializeChunks()),m||this._updateVisibleRange(),this.host.requestUpdate()}async _checkAndLoadMore(){if(!this._onLoadMore||this._isLoading||!this._containerRef.value)return;let e=this._lastVisible,t=this._pageSize||1e3,n=(e+1)%t===0;if(n){console.log(`Reached end of page, loading more...`,{lastVisibleIndex:e,pageSize:t,totalItems:this._items.length}),this._isLoading=!0;try{await this._onLoadMore()}finally{this._isLoading=!1}}}getRenderedItems(){if(!this._renderItem)return[];let e=[],t=new Set;for(let e of this._visibleChunkIndexes){let n=this._chunks.get(e);if(!n)continue;let r=e*this.CHUNK_SIZE;n.forEach((e,n)=>{let i=r+n;i>=this._firstVisible&&i<=this._lastVisible&&t.add(i)})}return Array.from(t).sort((e,t)=>e-t).forEach(t=>{let n=this._getItemStyle(this._positionCache[t]||t*this._estimatedItemHeight,this._sizeCache[t]||this._estimatedItemHeight);e.push(this._createItemTemplate(this._items[t],t,n))}),e}getContainerRef(){return this._containerRef}getTotalContentSize(){return this._totalContentSize}getLayout(){return this._layout}};const y=new WeakMap,b=()=>{if(m)return null;try{let e=document.currentScript;if(e&&`_$litElement$`in e)return e._$litElement$;if(customElements&&window.customElements){let e=document.querySelector(`virtualizer-example`);if(e&&`_$litElement$`in e)return e._$litElement$}}catch(e){console.warn(`Failed to get Lit host:`,e)}return null};function x(e){return e!==null&&typeof e.addController==`function`}function S(e,t){let n=b();if(!x(n)){console.warn(`Virtualizer: Running in fallback mode`);let n=t||e.renderItem||(e=>l`${String(e)}`),r=e.items;return l`
|
13
|
+
<div style="overflow: auto; height: 100%; position: relative;">
|
14
|
+
<div style="position: relative;">
|
15
|
+
${r.map((e,t)=>n(e,t))}
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
`}let r=y.get(n);if(!r){let i=t||e.renderItem||(e=>l`${e}`);r=new v(n,e,i),y.set(n,r)}let i=t=>{r.updateConfig(e,t);let n={position:`relative`,overflow:m?`visible`:`auto`,[r.getLayout()===`vertical`?`height`:`width`]:`100%`,[r.getLayout()===`vertical`?`minHeight`:`minWidth`]:`1px`},i={position:`relative`,[r.getLayout()===`vertical`?`height`:`width`]:`${r.getTotalContentSize()}px`,transform:r.getLayout()===`vertical`?`translateY(0)`:`translateX(0)`};return l`
|
19
|
+
<div
|
20
|
+
${f(r.getContainerRef())}
|
21
|
+
style=${p(n)}
|
22
|
+
@scroll=${m?u:()=>r.host.requestUpdate()}
|
23
|
+
>
|
24
|
+
<div style=${p(i)}>
|
25
|
+
${r.getRenderedItems()}
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
`};return t===void 0?`renderItem`in e?i(e.renderItem):e=>i(e):i(t)}function C(e,n){if(n===void 0){let t=t=>C(e,t??l``);return t.html=(t,...n)=>C(e,l(t,...n)),t}let r=e?.fadeBg??`rgba(0,0,0,0.7)`,a=e?.zIndex??2e3,o=t(e?.on??{});return l`
|
5
29
|
<div
|
6
|
-
${
|
30
|
+
${f(e=>{e?o.bind(e):o.unbindAll()})}
|
7
31
|
style="
|
8
32
|
position: fixed;
|
9
33
|
top: 0; left: 0; right: 0; bottom: 0;
|
10
|
-
background: ${
|
11
|
-
z-index: ${
|
34
|
+
background: ${r};
|
35
|
+
z-index: ${a};
|
12
36
|
display: flex;
|
13
37
|
justify-content: center;
|
14
38
|
align-items: center;
|
15
39
|
"
|
16
40
|
>
|
17
|
-
${i(
|
41
|
+
${i(n)}
|
18
42
|
</div>
|
19
|
-
`}function
|
43
|
+
`}function w(e,n){let r=t(e?.on??{});return n===void 0?t=>w(e,t??[l``]):l`
|
20
44
|
<div
|
21
|
-
${
|
22
|
-
.class="${
|
45
|
+
${f(e=>{e?r.bind(e):r.unbindAll()})}
|
46
|
+
.class="${e?.className}"
|
23
47
|
style="
|
24
48
|
display: flex;
|
25
49
|
flex-direction: column;
|
26
|
-
|
27
|
-
${
|
50
|
+
${e?.center?`align-items: center;`:``}
|
51
|
+
${e?.space?`gap: ${e.space};`:``}
|
52
|
+
${e?.style??``}
|
28
53
|
"
|
29
54
|
>
|
30
|
-
${a(
|
55
|
+
${a(n)}
|
31
56
|
</div>
|
32
|
-
`}function
|
57
|
+
`}function T(e,n){if(n===void 0){let t=t=>T(e,t??l``);return t.html=(t,...n)=>T(e,l(t,...n)),t}let r=e?.direction??`row`,a=t(e?.on??{});return l`
|
33
58
|
<div
|
34
|
-
${
|
59
|
+
${f(e=>{e?a.bind(e):a.unbindAll()})}
|
35
60
|
style="
|
36
61
|
display: flex;
|
37
|
-
flex-direction: ${
|
38
|
-
${
|
39
|
-
${
|
40
|
-
${
|
62
|
+
flex-direction: ${r};
|
63
|
+
${e?.justify?`justify-content: ${e.justify};`:``}
|
64
|
+
${e?.align?`align-items: ${e.align};`:``}
|
65
|
+
${e?.gap?`gap: ${e.gap};`:``}
|
41
66
|
"
|
42
67
|
>
|
43
|
-
${i(
|
68
|
+
${i(n)}
|
44
69
|
</div>
|
45
|
-
`}function
|
70
|
+
`}function E(e,n){if(n===void 0){let t=t=>E(e,t??l``);return t.html=(t,...n)=>E(e,l(t,...n)),t}let r=t(e?.on??{});return l`
|
46
71
|
<div
|
47
|
-
${
|
72
|
+
${f(e=>{e?r.bind(e):r.unbindAll()})}
|
48
73
|
style="break-inside: avoid; margin-bottom: 16px;"
|
49
74
|
>
|
50
|
-
${i(
|
75
|
+
${i(n)}
|
51
76
|
</div>
|
52
|
-
`}function
|
77
|
+
`}function D(e,n){if(n===void 0)return t=>D(e,t??[l``]);let r=e?.columns??1,i=t(e?.on??{});return l`
|
53
78
|
<div
|
54
|
-
${
|
79
|
+
${f(e=>{e?i.bind(e):i.unbindAll()})}
|
55
80
|
style="
|
56
81
|
display: grid;
|
57
|
-
grid-template-columns: repeat(${
|
58
|
-
${
|
82
|
+
grid-template-columns: repeat(${r}, 1fr);
|
83
|
+
${e?.gap?`gap: ${e.gap};`:``}
|
59
84
|
"
|
60
85
|
>
|
61
|
-
${a(
|
86
|
+
${a(n)}
|
62
87
|
</div>
|
63
|
-
`}function
|
64
|
-
.${
|
88
|
+
`}function O(a,o){if(o===void 0){let e=e=>O(a,e??l``);return e.html=(e,...t)=>O(a,l(e,...t)),e}let s=n(`GridCol`),c=r(`GridCol::grid-col`)+`-lyco-now-`+s,u=a?.gap?`column-gap: ${a.gap};`:``,d=`
|
89
|
+
.${c} {
|
65
90
|
display: grid;
|
66
91
|
grid-auto-flow: column;
|
67
|
-
${
|
92
|
+
${u}
|
68
93
|
}
|
69
|
-
`,
|
94
|
+
`,p=t(a?.on??{});return e(`GridCol`,l`
|
70
95
|
<style>
|
71
|
-
${
|
96
|
+
${d}
|
72
97
|
</style>
|
73
98
|
<div
|
74
|
-
${
|
75
|
-
class="${
|
99
|
+
${f(e=>{e?p.bind(e):p.unbindAll()})}
|
100
|
+
class="${c}"
|
76
101
|
>
|
77
|
-
${i(
|
102
|
+
${i(o)}
|
78
103
|
</div>
|
79
|
-
`)}function
|
104
|
+
`)}function k(e,n){if(n===void 0){let t=t=>k(e,t??l``);return t.html=(t,...n)=>k(e,l(t,...n)),t}let r=t(e?.on??{});return l`
|
80
105
|
<div
|
81
|
-
${
|
82
|
-
style="${
|
106
|
+
${f(e=>{e?r.bind(e):r.unbindAll()})}
|
107
|
+
style="${e?.span?`grid-column: span ${e.span};`:``}"
|
83
108
|
>
|
84
|
-
${i(
|
109
|
+
${i(n)}
|
85
110
|
</div>
|
86
|
-
`}function
|
87
|
-
.${
|
111
|
+
`}function A(a,o){if(o===void 0){let e=e=>A(a,e??l``);return e.html=(e,...t)=>A(a,l(e,...t)),e}let s=n(`GridRow`),c=r(`GridRow::grid-row`)+`-lyco-now-`+s,u=a?.gap?`row-gap: ${a.gap};`:``,d=`
|
112
|
+
.${c} {
|
88
113
|
display: grid;
|
89
114
|
grid-auto-flow: row;
|
90
|
-
${
|
115
|
+
${u}
|
91
116
|
}
|
92
|
-
`,
|
117
|
+
`,p=t(a?.on??{});return e(`GridRow`,l`
|
93
118
|
<style>
|
94
|
-
${
|
119
|
+
${d}
|
95
120
|
</style>
|
96
121
|
<div
|
97
|
-
${
|
98
|
-
class="${
|
122
|
+
${f(e=>{e?p.bind(e):p.unbindAll()})}
|
123
|
+
class="${c}"
|
99
124
|
>
|
100
|
-
${i(
|
125
|
+
${i(o)}
|
101
126
|
</div>
|
102
|
-
`)}function
|
127
|
+
`)}function j(e,n){if(n===void 0)return t=>j(e,t??[l``]);let r=t(e?.on??{});return l`
|
103
128
|
<div
|
104
|
-
${
|
129
|
+
${f(e=>{e?r.bind(e):r.unbindAll()})}
|
105
130
|
style="
|
106
131
|
display: flex;
|
107
132
|
flex-direction: row;
|
108
|
-
|
133
|
+
${e?.center?`align-items: center;`:``}
|
134
|
+
${e?.space?`gap: ${e.space};`:``}
|
109
135
|
"
|
110
136
|
>
|
111
|
-
${a(
|
137
|
+
${a(n)}
|
112
138
|
</div>
|
113
|
-
`}function
|
139
|
+
`}function M(a,o){if(o===void 0){let e=e=>M(a,e??l``);return e.html=(e,...t)=>M(a,l(e,...t)),e}let s=a?.columnCount??3,c=a?.gap??`16px`,u=n(`WaterFlow`),d=r(`WaterFlow::waterflow`)+`-lyco-now-${u}`,p=`
|
114
140
|
/* 使用 CSS 类来控制多列布局 */
|
115
|
-
.${
|
116
|
-
column-count: ${
|
117
|
-
column-gap: ${typeof
|
141
|
+
.${d} {
|
142
|
+
column-count: ${s};
|
143
|
+
column-gap: ${typeof c==`number`?`${c}px`:c};
|
118
144
|
}
|
119
145
|
/* 子元素如果是块级元素,需要让它们适应多列流式布局 */
|
120
|
-
.${
|
146
|
+
.${d} > * {
|
121
147
|
display: inline-block;
|
122
148
|
width: 100%;
|
123
149
|
}
|
124
|
-
`,
|
150
|
+
`,m=t(a?.on??{});return e(`WaterFlow`,l`
|
125
151
|
<style>
|
126
|
-
${
|
152
|
+
${p}
|
127
153
|
</style>
|
128
154
|
|
129
155
|
<div
|
130
|
-
${
|
131
|
-
class="${
|
156
|
+
${f(e=>{e?m.bind(e):m.unbindAll()})}
|
157
|
+
class="${d}"
|
132
158
|
>
|
133
|
-
${i(
|
159
|
+
${i(o)}
|
134
160
|
</div>
|
135
|
-
`)}function
|
161
|
+
`)}function N(e,n){if(n===void 0){let t=t=>N(e,t??l``);return t.html=(t,...n)=>N(e,l(t,...n)),t}let r=e?.gap??`0px`,a=e?.firstHeight??`50%`,o=l``,s=l``;if(typeof n==`function`){var c;let e=(c=n.call)?.call(n,null)??[];o=e[0]??l``,s=e[1]??l``}else o=i(n);let u=t(e?.on??{});return l`
|
136
162
|
<div
|
137
|
-
${
|
163
|
+
${f(e=>{e?u.bind(e):u.unbindAll()})}
|
138
164
|
style="
|
139
165
|
display: flex;
|
140
166
|
flex-direction: column;
|
141
167
|
width: 100%;
|
142
168
|
height: 100%;
|
143
|
-
gap: ${
|
169
|
+
gap: ${r};
|
144
170
|
"
|
145
171
|
>
|
146
|
-
<div style="flex: 0 0 ${
|
147
|
-
<div style="flex: 1 1 auto; overflow: auto;">${
|
172
|
+
<div style="flex: 0 0 ${a}; overflow: auto;">${o}</div>
|
173
|
+
<div style="flex: 1 1 auto; overflow: auto;">${s}</div>
|
148
174
|
</div>
|
149
|
-
`}function
|
175
|
+
`}function P(e,n){if(n===void 0){let t=t=>P(e,t??l``);return t.html=(t,...n)=>P(e,l(t,...n)),t}let r=e?.gap??`0px`,a=e?.firstWidth??`50%`,o=l``,s=l``;if(typeof n==`function`){var c;let e=(c=n.call)?.call(n,null)??[];o=e[0]??l``,s=e[1]??l``}else o=i(n);let u=t(e?.on??{});return l`
|
150
176
|
<div
|
151
|
-
${
|
177
|
+
${f(e=>{e?u.bind(e):u.unbindAll()})}
|
152
178
|
style="
|
153
179
|
display: flex;
|
154
180
|
flex-direction: row;
|
155
181
|
width: 100%;
|
156
182
|
height: 100%;
|
157
|
-
gap: ${
|
183
|
+
gap: ${r};
|
158
184
|
"
|
159
185
|
>
|
160
|
-
<div style="flex: 0 0 ${
|
161
|
-
<div style="flex: 1 1 auto; overflow: auto;">${
|
186
|
+
<div style="flex: 0 0 ${a}; overflow: auto;">${o}</div>
|
187
|
+
<div style="flex: 1 1 auto; overflow: auto;">${s}</div>
|
162
188
|
</div>
|
163
|
-
`}function
|
164
|
-
.${
|
165
|
-
${
|
166
|
-
width: ${
|
167
|
-
height: ${
|
189
|
+
`}function F(a,o){if(o===void 0){let e=e=>F(a,e??l``);return e.html=(e,...t)=>F(a,l(e,...t)),e}let s=a?.direction??`vertical`,c=a?.height??`100%`,u=a?.width??`100%`,d=a?.customCss??``,p=n(`ScrollBar`),m=a?.className??r(`ScrollBar::scrollbar-container`)+`-lyco-now-`+p,h=s===`horizontal`?`overflow-x: auto; overflow-y: hidden`:`overflow-y: auto; overflow-x: hidden`,g=`
|
190
|
+
.${m} {
|
191
|
+
${h};
|
192
|
+
width: ${u};
|
193
|
+
height: ${c};
|
168
194
|
}
|
169
|
-
.${
|
195
|
+
.${m}::-webkit-scrollbar {
|
170
196
|
width: 8px;
|
171
197
|
height: 8px;
|
172
198
|
}
|
173
|
-
.${
|
199
|
+
.${m}::-webkit-scrollbar-thumb {
|
174
200
|
background-color: rgba(0, 0, 0, 0.2);
|
175
201
|
border-radius: 4px;
|
176
202
|
}
|
177
|
-
.${
|
203
|
+
.${m}::-webkit-scrollbar-track {
|
178
204
|
background: rgba(0, 0, 0, 0.05);
|
179
205
|
}
|
180
|
-
${
|
181
|
-
`,_=
|
206
|
+
${d}
|
207
|
+
`,_=t(a?.on??{});return e(`ScrollBar`,l`
|
182
208
|
<style>
|
183
|
-
${
|
209
|
+
${g}
|
184
210
|
</style>
|
185
211
|
<div
|
186
|
-
${
|
187
|
-
class="${
|
212
|
+
${f(e=>{e?_.bind(e):_.unbindAll()})}
|
213
|
+
class="${m}"
|
188
214
|
>
|
189
|
-
${i(
|
215
|
+
${i(o)}
|
190
216
|
</div>
|
191
|
-
`)}function
|
217
|
+
`)}function I(e,n){if(n===void 0)return t=>I(e,t??[l``]);let r=e?.sidebarWidth??`240px`,i=e?.sidebarPosition??`left`,o=e?.gap??`0px`,s=l``,c=l``;if(typeof n==`function`){var u;let e=(u=n.call)?.call(n,null)??[];s=e[0]??l``,c=e[1]??l``}else c=a(n);let d=t(e?.on??{});return l`
|
192
218
|
<div
|
193
|
-
${
|
219
|
+
${f(e=>{e?d.bind(e):d.unbindAll()})}
|
194
220
|
style="
|
195
221
|
display: flex;
|
196
|
-
flex-direction: ${
|
222
|
+
flex-direction: ${i===`left`?`row`:`row-reverse`};
|
197
223
|
width: 100%;
|
198
224
|
height: 100%;
|
199
|
-
gap: ${
|
225
|
+
gap: ${o};
|
200
226
|
"
|
201
227
|
>
|
202
|
-
<div style="flex: 0 0 ${
|
203
|
-
<div style="flex: 1 1 auto; overflow: auto;">${
|
228
|
+
<div style="flex: 0 0 ${r}; overflow: auto;">${s}</div>
|
229
|
+
<div style="flex: 1 1 auto; overflow: auto;">${c}</div>
|
204
230
|
</div>
|
205
|
-
`}function
|
206
|
-
<div class="${
|
207
|
-
${Array.from({length:
|
231
|
+
`}function ee(i={},a){if(a===void 0)return e=>ee(i,e??[l``]);let o=n(`Swiper`),{gap:s=`8px`,snapType:c=`mandatory`,height:u=`auto`,width:d=`100%`,className:p=r(`Swiper::swiper`)+`-lyco-now-${o}`,direction:m=`x`,scrollBehavior:h=`smooth`,align:g=`start`,showNavigation:_=!0,navigationPosition:v=`inside`,showPagination:y=!0,paginationType:b=`dots`,autoPlay:x=!1,interval:S=3e3,loop:C=!1,touchEnabled:w=!0,mouseWheel:T=!1,onSlideChange:E,on:D}=i,O=p,k=O+`-container`,A=O+`-slide`,j=O+`-navigation`,M=O+`-pagination`,N;N=a?typeof a==`function`?a():a:[];let P=N.length,[F,I]=(()=>{let e={value:0};return[()=>e.value,t=>{let n=Math.max(0,Math.min(t,P-1));e.value!==n&&(e.value=n,E?.(n))}]})(),L=e=>{let t=typeof document<`u`?document.querySelector(`.${k}`):null;if(!t)return;let n=t.querySelectorAll(`.${A}`);if(e<0||e>=n.length)return;let r=n[e],i=r.getBoundingClientRect(),a=t.getBoundingClientRect(),o;m===`x`?(o=r.offsetLeft-t.offsetLeft,g===`center`?o-=(a.width-i.width)/2:g===`end`&&(o-=a.width-i.width),t.scrollTo({left:o,behavior:h})):(o=r.offsetTop-t.offsetTop,g===`center`?o-=(a.height-i.height)/2:g===`end`&&(o-=a.height-i.height),t.scrollTo({top:o,behavior:h})),I(e)},R=()=>{let e=F()+1>=P?C?0:F():F()+1;L(e)},z=()=>{let e=F()-1<0?C?P-1:F():F()-1;L(e)},B=()=>{let e=typeof document<`u`?document.querySelector(`.${k}`):null;if(!e)return;let t=e.querySelectorAll(`.${A}`),n=0,r=1/0;t.forEach((t,i)=>{let a=t.getBoundingClientRect(),o=e.getBoundingClientRect(),s;if(m===`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)}),I(n)},V=e=>{if(!w)return;let t=e.touches[0],n=e.currentTarget;n.dataset.touchStartX=t.clientX.toString(),n.dataset.touchStartY=t.clientY.toString()},H=e=>{if(!w)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)||m===`x`)&&e.preventDefault()},U=e=>{if(!w)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&&(m===`x`?a>0?z():R():o>0?z():R()),delete t.dataset.touchStartX,delete t.dataset.touchStartY},W=e=>{T&&(e.preventDefault(),e.deltaY>0?R():z())},te=e=>{if(!x||!e)return;let t,n=()=>{t=setInterval(R,S)},r=()=>{clearInterval(t)};return e.addEventListener(`mouseenter`,r),e.addEventListener(`mouseleave`,n),n(),()=>{clearInterval(t),e.removeEventListener(`mouseenter`,r),e.removeEventListener(`mouseleave`,n)}},G=()=>{let e=typeof document<`u`?document.querySelector(`.${k}`):null;if(!e)return;let t=[];e.addEventListener(`scroll`,B),t.push(()=>e.removeEventListener(`scroll`,B)),w&&(e.addEventListener(`touchstart`,V),e.addEventListener(`touchmove`,H,{passive:!1}),e.addEventListener(`touchend`,U),t.push(()=>e.removeEventListener(`touchstart`,V)),t.push(()=>e.removeEventListener(`touchmove`,H)),t.push(()=>e.removeEventListener(`touchend`,U))),T&&(e.addEventListener(`wheel`,W,{passive:!1}),t.push(()=>e.removeEventListener(`wheel`,W)));let n=te(e);return n&&t.push(n),L(0),()=>t.forEach(e=>e())};typeof window<`u`&&typeof document<`u`&&setTimeout(G,0);let K=l`
|
232
|
+
<div class="${M}">
|
233
|
+
${Array.from({length:P},(e,t)=>l`
|
208
234
|
<button
|
209
|
-
class="${
|
210
|
-
@click=${()=>
|
235
|
+
class="${t===F()?`active`:``}"
|
236
|
+
@click=${()=>L(t)}
|
211
237
|
></button>
|
212
238
|
`)}
|
213
239
|
</div>
|
214
|
-
`,
|
215
|
-
<div class="${
|
216
|
-
<span class="current">${
|
240
|
+
`,q=l`
|
241
|
+
<div class="${M} fraction">
|
242
|
+
<span class="current">${F()+1}</span>
|
217
243
|
<span class="separator">/</span>
|
218
|
-
<span class="total">${
|
244
|
+
<span class="total">${P}</span>
|
219
245
|
</div>
|
220
|
-
`,
|
221
|
-
<div class="${
|
246
|
+
`,J=l`
|
247
|
+
<div class="${M} progressbar">
|
222
248
|
<div
|
223
249
|
class="progress"
|
224
|
-
style="width: ${
|
250
|
+
style="width: ${P>1?F()/(P-1)*100:0}%"
|
225
251
|
></div>
|
226
252
|
</div>
|
227
|
-
`,
|
228
|
-
<div class="${
|
229
|
-
<button class="prev" @click=${
|
230
|
-
<button class="next" @click=${
|
253
|
+
`,ne=l`
|
254
|
+
<div class="${j}">
|
255
|
+
<button class="prev" @click=${z}>◀</button>
|
256
|
+
<button class="next" @click=${R}>▶</button>
|
231
257
|
</div>
|
232
|
-
`,
|
258
|
+
`,Y=`
|
233
259
|
.${O} {
|
234
260
|
position: relative;
|
235
261
|
overflow: hidden;
|
236
|
-
width: ${
|
237
|
-
height: ${
|
262
|
+
width: ${d};
|
263
|
+
height: ${u};
|
238
264
|
}
|
239
265
|
|
240
266
|
.${k} {
|
241
267
|
width: 100%;
|
242
268
|
height: 100%;
|
243
269
|
overflow: auto;
|
244
|
-
scroll-snap-type: ${
|
270
|
+
scroll-snap-type: ${m+` `+c};
|
245
271
|
-webkit-overflow-scrolling: touch;
|
246
|
-
scroll-behavior: ${
|
247
|
-
gap: ${
|
272
|
+
scroll-behavior: ${h};
|
273
|
+
gap: ${s};
|
248
274
|
display: flex;
|
249
|
-
flex-direction: ${
|
275
|
+
flex-direction: ${m===`x`?`row`:`column`};
|
250
276
|
}
|
251
277
|
|
252
278
|
.${A} {
|
253
|
-
scroll-snap-align: ${
|
279
|
+
scroll-snap-align: ${g};
|
254
280
|
flex-shrink: 0;
|
255
281
|
}
|
256
282
|
|
257
|
-
.${
|
283
|
+
.${j} {
|
258
284
|
position: absolute;
|
259
285
|
top: 50%;
|
260
286
|
left: 0;
|
@@ -266,7 +292,7 @@ import{html as e}from"lit";import{createRef as t,ref as n}from"lit/directives/re
|
|
266
292
|
padding: ${v===`outside`?`0 1rem`:`0 0.5rem`};
|
267
293
|
}
|
268
294
|
|
269
|
-
.${
|
295
|
+
.${j} button {
|
270
296
|
width: 2.5rem;
|
271
297
|
height: 2.5rem;
|
272
298
|
border-radius: 50%;
|
@@ -281,11 +307,11 @@ import{html as e}from"lit";import{createRef as t,ref as n}from"lit/directives/re
|
|
281
307
|
transition: background-color 0.3s;
|
282
308
|
}
|
283
309
|
|
284
|
-
.${
|
310
|
+
.${j} button:hover {
|
285
311
|
background-color: rgba(0, 0, 0, 0.8);
|
286
312
|
}
|
287
313
|
|
288
|
-
.${
|
314
|
+
.${M} {
|
289
315
|
position: absolute;
|
290
316
|
bottom: 1rem;
|
291
317
|
left: 0;
|
@@ -295,7 +321,7 @@ import{html as e}from"lit";import{createRef as t,ref as n}from"lit/directives/re
|
|
295
321
|
gap: 0.5rem;
|
296
322
|
align-items: center;
|
297
323
|
}
|
298
|
-
.${
|
324
|
+
.${M} button {
|
299
325
|
width: 0.75rem;
|
300
326
|
height: 0.75rem;
|
301
327
|
border-radius: 50%;
|
@@ -304,12 +330,12 @@ import{html as e}from"lit";import{createRef as t,ref as n}from"lit/directives/re
|
|
304
330
|
cursor: pointer;
|
305
331
|
transition: background-color 0.3s, transform 0.3s;
|
306
332
|
}
|
307
|
-
.${
|
333
|
+
.${M} button.active {
|
308
334
|
background-color: white;
|
309
335
|
transform: scale(1.2);
|
310
336
|
}
|
311
337
|
|
312
|
-
.${
|
338
|
+
.${M}.fraction {
|
313
339
|
position: absolute;
|
314
340
|
bottom: 1rem;
|
315
341
|
left: 50%;
|
@@ -321,7 +347,7 @@ import{html as e}from"lit";import{createRef as t,ref as n}from"lit/directives/re
|
|
321
347
|
gap: 0.25rem;
|
322
348
|
}
|
323
349
|
|
324
|
-
.${
|
350
|
+
.${M}.progressbar {
|
325
351
|
position: absolute;
|
326
352
|
bottom: 0.5rem;
|
327
353
|
left: 0;
|
@@ -329,84 +355,158 @@ import{html as e}from"lit";import{createRef as t,ref as n}from"lit/directives/re
|
|
329
355
|
height: 0.25rem;
|
330
356
|
background-color: rgba(255, 255, 255, 0.2);
|
331
357
|
}
|
332
|
-
.${
|
358
|
+
.${M}.progressbar .progress {
|
333
359
|
height: 100%;
|
334
360
|
background-color: white;
|
335
361
|
transition: width 0.3s;
|
336
362
|
}
|
337
|
-
`,
|
363
|
+
`,X=t(D??{});return e(`Swiper`,l`
|
338
364
|
<style>
|
339
|
-
${
|
365
|
+
${Y}
|
340
366
|
</style>
|
341
367
|
|
342
368
|
<div
|
343
|
-
${
|
369
|
+
${f(e=>{e?X.bind(e):X.unbindAll()})}
|
344
370
|
class="${O}"
|
345
371
|
>
|
346
372
|
<div class="${k}">
|
347
|
-
${
|
348
|
-
<div class="${A} --slide-${
|
349
|
-
${
|
373
|
+
${N.map((e,t)=>l`
|
374
|
+
<div class="${A} --slide-${t}" key=${t}>
|
375
|
+
${e}
|
350
376
|
</div>
|
351
377
|
`)}
|
352
378
|
</div>
|
353
379
|
|
354
|
-
${_?
|
355
|
-
${y&&b===`dots`?
|
356
|
-
${y&&b===`fraction`?
|
357
|
-
${y&&b===`progressbar`?
|
380
|
+
${_?ne:null}
|
381
|
+
${y&&b===`dots`?K:null}
|
382
|
+
${y&&b===`fraction`?q:null}
|
383
|
+
${y&&b===`progressbar`?J:null}
|
358
384
|
</div>
|
359
|
-
`)}
|
385
|
+
`)}const L={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 R(i){let{checked:a=!1,disabled:o=!1,size:s=`medium`,color:c=L.colors.primary,onChange:u,className:d=``,on:p={}}=i??{},m=n(`SwitchInput`),h=r(`SwitchInput::switch`)+`-lyco-now-${m}`,g={small:{width:32,height:16,thumbSize:12},medium:{width:44,height:24,thumbSize:18},large:{width:56,height:32,thumbSize:24}},{width:_,height:v,thumbSize:y}=g[s],b=`
|
386
|
+
.${h} {
|
387
|
+
display: inline-block;
|
388
|
+
position: relative;
|
389
|
+
width: ${_}px;
|
390
|
+
height: ${v}px;
|
391
|
+
cursor: ${o?`not-allowed`:`pointer`};
|
392
|
+
}
|
393
|
+
|
394
|
+
.${h} input {
|
395
|
+
opacity: 0;
|
396
|
+
width: 0;
|
397
|
+
height: 0;
|
398
|
+
}
|
399
|
+
|
400
|
+
.${h} .slider {
|
401
|
+
position: absolute;
|
402
|
+
top: 0;
|
403
|
+
left: 0;
|
404
|
+
right: 0;
|
405
|
+
bottom: 0;
|
406
|
+
background-color: ${o?L.colors.surfaceVariant:L.colors.onSurfaceVariant};
|
407
|
+
transition: ${L.animation.standard};
|
408
|
+
border-radius: ${v}px;
|
409
|
+
opacity: ${o?.38:.5};
|
410
|
+
}
|
411
|
+
|
412
|
+
.${h} .slider:before {
|
413
|
+
position: absolute;
|
414
|
+
content: "";
|
415
|
+
height: ${y}px;
|
416
|
+
width: ${y}px;
|
417
|
+
left: ${(v-y)/2}px;
|
418
|
+
bottom: ${(v-y)/2}px;
|
419
|
+
background-color: ${L.colors.surface};
|
420
|
+
transition: ${L.animation.emphasized};
|
421
|
+
border-radius: 50%;
|
422
|
+
box-shadow: ${L.elevation.level1};
|
423
|
+
}
|
424
|
+
|
425
|
+
.${h} input:checked + .slider {
|
426
|
+
background-color: ${o?L.colors.surfaceVariant:c};
|
427
|
+
opacity: ${o?.38:1};
|
428
|
+
}
|
429
|
+
|
430
|
+
.${h} input:checked + .slider:before {
|
431
|
+
transform: translateX(${_-v}px);
|
432
|
+
background-color: ${L.colors.onPrimary};
|
433
|
+
}
|
434
|
+
|
435
|
+
.${h}:hover .slider:before {
|
436
|
+
box-shadow: ${o?L.elevation.level1:L.elevation.level2};
|
437
|
+
}
|
438
|
+
|
439
|
+
.${h}:active .slider:before {
|
440
|
+
box-shadow: ${o?L.elevation.level1:L.elevation.level3};
|
441
|
+
width: ${y*1.2}px;
|
442
|
+
}
|
443
|
+
`,x=t(p);return e(`SwitchInput`,l`
|
444
|
+
<style>
|
445
|
+
${b}
|
446
|
+
</style>
|
447
|
+
<label
|
448
|
+
class="${h} ${d}"
|
449
|
+
${f(e=>{e?x.bind(e):x.unbindAll()})}
|
450
|
+
>
|
451
|
+
<input
|
452
|
+
type="checkbox"
|
453
|
+
?checked=${a}
|
454
|
+
?disabled=${o}
|
455
|
+
@change=${e=>{!o&&u&&u(e.target.checked)}}
|
456
|
+
/>
|
457
|
+
<span class="slider"></span>
|
458
|
+
</label>
|
459
|
+
`)}function z(e,n){let r=e?.top?`top: ${e.top};`:``,a=e?.right?`right: ${e.right};`:``,o=e?.bottom?`bottom: ${e.bottom};`:``,c=e?.left?`left: ${e.left};`:``,u=e?.width?`width: ${e.width};`:``,d=e?.height?`height: ${e.height};`:``,p=typeof e?.zIndex==`number`?`z-index: ${e.zIndex};`:``,m=e?.style?e.style:``,h=e?.className?e.className:``,g=t(e?.on??{}),_=e=>l`
|
360
460
|
<div
|
361
|
-
${
|
362
|
-
class="${
|
461
|
+
${f(e=>{e?g.bind(e):g.unbindAll()})}
|
462
|
+
class="${h}"
|
363
463
|
style="
|
364
464
|
position: absolute;
|
365
|
-
${
|
465
|
+
${r} ${a} ${o} ${c}
|
366
466
|
${u} ${d}
|
367
|
-
${
|
368
|
-
${
|
467
|
+
${p}
|
468
|
+
${m}
|
369
469
|
"
|
370
470
|
>
|
371
|
-
${i(
|
471
|
+
${i(e)}
|
372
472
|
</div>
|
373
|
-
`;return s(
|
473
|
+
`;return s(n,_)}function B(e,n){let r=e?.width??`300px`,i=e?.height??`auto`,a=e?.top??`20%`,s=e?.bottom??`auto`,c=e?.left??`50%`,u=e?.right??`auto`,d=c===`auto`?``:`transform: translateX(-50%);`,p=e?.background??`rgba(255, 255, 255, 0.3)`,m=e?.blur??`10px`,h=e?.borderRadius??`12px`,g=e?.padding??`16px`,_=e?.zIndex??1e3,v=t(e?.on??{}),y=e=>l`
|
374
474
|
<div
|
375
|
-
${
|
475
|
+
${f(e=>{e?v.bind(e):v.unbindAll()})}
|
376
476
|
style="
|
377
477
|
position: fixed;
|
378
|
-
top: ${
|
478
|
+
top: ${a};
|
379
479
|
bottom: ${s};
|
380
|
-
left: ${
|
480
|
+
left: ${c};
|
381
481
|
right: ${u};
|
382
482
|
${d}
|
383
|
-
width: ${
|
384
|
-
height: ${
|
385
|
-
background: ${
|
386
|
-
backdrop-filter: blur(${
|
387
|
-
-webkit-backdrop-filter: blur(${
|
388
|
-
border-radius: ${
|
389
|
-
padding: ${
|
483
|
+
width: ${r};
|
484
|
+
height: ${i};
|
485
|
+
background: ${p};
|
486
|
+
backdrop-filter: blur(${m});
|
487
|
+
-webkit-backdrop-filter: blur(${m});
|
488
|
+
border-radius: ${h};
|
489
|
+
padding: ${g};
|
390
490
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
|
391
491
|
z-index: ${_};
|
392
492
|
display: flex;
|
393
493
|
flex-direction: column;
|
394
494
|
"
|
395
495
|
>
|
396
|
-
${
|
496
|
+
${e}
|
397
497
|
</div>
|
398
|
-
`;return
|
498
|
+
`;return o(n,void 0,y)}function V(e,n){if(n===void 0)return t=>V(e,t??[l``]);let r=`${100/e.ratio}%`,i=e.maxWidth?`max-width: ${e.maxWidth};`:``,o=e.background?`background: ${e.background};`:``,s=e.overflow??`hidden`,c=t(e.on??{});return l`
|
399
499
|
<div
|
400
|
-
${
|
500
|
+
${f(e=>{e?c.bind(e):c.unbindAll()})}
|
401
501
|
style="
|
402
502
|
position: relative;
|
403
503
|
width: 100%;
|
504
|
+
${i}
|
404
505
|
${o}
|
405
|
-
${s}
|
406
|
-
overflow: ${c};
|
506
|
+
overflow: ${s};
|
407
507
|
"
|
408
508
|
>
|
409
|
-
<div style="width: 100%; padding-top: ${
|
509
|
+
<div style="width: 100%; padding-top: ${r};"></div>
|
410
510
|
<div
|
411
511
|
style="
|
412
512
|
position: absolute;
|
@@ -416,172 +516,172 @@ import{html as e}from"lit";import{createRef as t,ref as n}from"lit/directives/re
|
|
416
516
|
height: 100%;
|
417
517
|
"
|
418
518
|
>
|
419
|
-
${a(
|
519
|
+
${a(n)}
|
420
520
|
</div>
|
421
521
|
</div>
|
422
|
-
`}function
|
423
|
-
.${
|
522
|
+
`}function H(a,o){if(o===void 0){let e=e=>H(a,e);return e.html=(e,...t)=>H(a,l(e,...t)),e}let s=n(`AutoFitGrid`),c=r(`AutoFitGrid::auto-fit-grid`)+`-lyco-now-`+s,u=a?.gap??`16px`,d=`
|
523
|
+
.${c} {
|
424
524
|
display: grid;
|
425
|
-
grid-template-columns: repeat(auto-fit, minmax(${
|
426
|
-
gap: ${
|
525
|
+
grid-template-columns: repeat(auto-fit, minmax(${a.minItemWidth}, 1fr));
|
526
|
+
gap: ${u};
|
427
527
|
}
|
428
|
-
`,
|
528
|
+
`,p=t(a.on??{});return e(`AutoFitGrid`,l`
|
429
529
|
<style>
|
430
|
-
${
|
530
|
+
${d}
|
431
531
|
</style>
|
432
532
|
<div
|
433
|
-
class="${
|
434
|
-
${
|
533
|
+
class="${c}"
|
534
|
+
${f(e=>{e?p.bind(e):p.unbindAll()})}
|
435
535
|
>
|
436
|
-
${i(
|
536
|
+
${i(o)}
|
437
537
|
</div>
|
438
|
-
`)}function
|
538
|
+
`)}function U(e,n){if(n===void 0)return t=>U(e,t??[l``]);let r=e?.size??`32px`,i=e?.overlap??`-8px`,o=t(e?.on??{}),s=(e,t)=>l`
|
439
539
|
<div
|
440
540
|
style="
|
441
|
-
width: ${
|
442
|
-
height: ${
|
541
|
+
width: ${r};
|
542
|
+
height: ${r};
|
443
543
|
border-radius: 50%;
|
444
544
|
overflow: hidden;
|
445
545
|
border: 2px solid #fff;
|
446
|
-
margin-left: ${
|
546
|
+
margin-left: ${t===0?`0`:i};
|
447
547
|
box-sizing: content-box;
|
448
548
|
"
|
449
549
|
>
|
450
|
-
${
|
550
|
+
${e}
|
451
551
|
</div>
|
452
|
-
`;return
|
552
|
+
`;return l`
|
453
553
|
<div
|
454
|
-
${
|
554
|
+
${f(e=>{e?o.bind(e):o.unbindAll()})}
|
455
555
|
style="display: flex; align-items: center;"
|
456
556
|
>
|
457
|
-
${a(
|
557
|
+
${a(n,s)}
|
458
558
|
</div>
|
459
|
-
`}function
|
559
|
+
`}function W(e,n){if(n===void 0){let t=t=>W(e,t??l``);return t.html=(t,...n)=>W(e,l(t,...n)),t}let r=e?.position??`top-right`,a=e?.size??`16px`,o=e?.background??`red`,s=e?.color??`#fff`,[c,u,d,p]=[r.includes(`top`)?`0`:`auto`,r.includes(`right`)?`0`:`auto`,r.includes(`bottom`)?`0`:`auto`,r.includes(`left`)?`0`:`auto`],m=t(e?.on??{});return l`
|
460
560
|
<div style="position: relative; display: inline-block;">
|
461
|
-
${i(
|
561
|
+
${i(n)}
|
462
562
|
<div
|
463
|
-
${
|
563
|
+
${f(e=>{e?m.bind(e):m.unbindAll()})}
|
464
564
|
style="
|
465
565
|
position: absolute;
|
466
|
-
top: ${
|
566
|
+
top: ${c};
|
467
567
|
right: ${u};
|
468
568
|
bottom: ${d};
|
469
|
-
left: ${
|
470
|
-
width: ${
|
471
|
-
height: ${
|
472
|
-
background: ${
|
473
|
-
color: ${
|
474
|
-
font-size: calc(${
|
569
|
+
left: ${p};
|
570
|
+
width: ${a};
|
571
|
+
height: ${a};
|
572
|
+
background: ${o};
|
573
|
+
color: ${s};
|
574
|
+
font-size: calc(${a} * 0.6);
|
475
575
|
border-radius: 50%;
|
476
576
|
display: flex;
|
477
577
|
justify-content: center;
|
478
578
|
align-items: center;
|
479
|
-
transform: translate(${
|
579
|
+
transform: translate(${p===`0`?`-50%`:`0`}, ${c===`0`?`-50%`:`0`});
|
480
580
|
"
|
481
581
|
>
|
482
|
-
${
|
582
|
+
${e?.content??``}
|
483
583
|
</div>
|
484
584
|
</div>
|
485
|
-
`}function
|
585
|
+
`}function te(e,t){return e?n=>{typeof e==`function`?e(n):e.current=n,typeof t==`function`?t(n):t.current=n}:t}function G(e,n){if(!n)return t=>G(e,t??d());let r=t(e?.on??{}),i=te(n,e=>{e?r.bind(e):r.unbindAll()});return l`
|
486
586
|
<canvas
|
487
|
-
${
|
488
|
-
.class=${
|
489
|
-
style=${
|
587
|
+
${f(i)}
|
588
|
+
.class=${e?.className}
|
589
|
+
style=${e?.style??``}
|
490
590
|
></canvas>
|
491
|
-
`}function
|
591
|
+
`}function K(e,n){if(n===void 0)return t=>K(e,t??[l``]);let r=e?.padding??`16px`,i=e?.borderRadius??`8px`,o=e?.shadow??`0 2px 8px rgba(0,0,0,0.1)`,s=e?.background??`#fff`,c=t(e?.on??{});return l`
|
492
592
|
<div
|
493
|
-
${
|
593
|
+
${f(e=>{e?c.bind(e):c.unbindAll()})}
|
494
594
|
style="
|
495
|
-
background: ${
|
496
|
-
border-radius: ${
|
497
|
-
box-shadow: ${
|
498
|
-
padding: ${
|
595
|
+
background: ${s};
|
596
|
+
border-radius: ${i};
|
597
|
+
box-shadow: ${o};
|
598
|
+
padding: ${r};
|
499
599
|
box-sizing: border-box;
|
500
600
|
"
|
501
601
|
>
|
502
|
-
${a(
|
602
|
+
${a(n)}
|
503
603
|
</div>
|
504
|
-
`}function
|
604
|
+
`}function q(e,n){if(n===void 0){let t=t=>q(e,t??l``);return t.html=(t,...n)=>q(e,l(t,...n)),t}let r=e?.width?`width: ${e.width};`:``,a=e?.height?`height: ${e.height};`:``,o=e?.background?`background: ${e.background};`:``,s=t(e?.on??{});return l`
|
505
605
|
<div
|
506
|
-
${
|
606
|
+
${f(e=>{e?s.bind(e):s.unbindAll()})}
|
507
607
|
style="
|
508
608
|
display: flex;
|
509
609
|
justify-content: center;
|
510
610
|
align-items: center;
|
511
|
-
${
|
611
|
+
${r} ${a} ${o}
|
512
612
|
"
|
513
613
|
>
|
514
|
-
${i(
|
614
|
+
${i(n)}
|
515
615
|
</div>
|
516
|
-
`}function
|
616
|
+
`}function J(e,n){if(n===void 0)return t=>J(e,t??[l``]);let r=e?.maxWidth??`1024px`,i=e?.padding??`0 16px`,o=e?.background?`background: ${e.background};`:``,s=e?.fullHeight?`height: 100%;`:``,c=t(e?.on??{});return l`
|
517
617
|
<div
|
518
|
-
${
|
618
|
+
${f(e=>{e?c.bind(e):c.unbindAll()})}
|
519
619
|
style="
|
520
620
|
width: 100%;
|
521
|
-
max-width: ${
|
621
|
+
max-width: ${r};
|
522
622
|
margin-left: auto;
|
523
623
|
margin-right: auto;
|
524
|
-
padding: ${
|
624
|
+
padding: ${i};
|
625
|
+
${o}
|
525
626
|
${s}
|
526
|
-
${c}
|
527
627
|
box-sizing: border-box;
|
528
628
|
"
|
529
629
|
>
|
530
|
-
${a(
|
630
|
+
${a(n)}
|
531
631
|
</div>
|
532
|
-
`}function
|
533
|
-
${
|
534
|
-
style="${
|
535
|
-
></div>`}function
|
632
|
+
`}function ne(e){let n=e?.orientation??`horizontal`,r=e?.thickness??`1px`,i=e?.color??`#e0e0e0`,a=e?.margin??(n===`horizontal`?`8px 0`:`0 8px`),o=t(e?.on??{}),s=n===`horizontal`?`width: 100%; height: ${r}; background: ${i}; margin: ${a};`:`width: ${r}; height: 100%; background: ${i}; margin: ${a};`;return l`<div
|
633
|
+
${f(e=>{e?o.bind(e):o.unbindAll()})}
|
634
|
+
style="${s}"
|
635
|
+
></div>`}function Y(e,n){if(n===void 0){let t=t=>Y(e,t??l``);return t.html=(t,...n)=>Y(e,l(t,...n)),t}let r=e?.columns??4,a=e?.gap??`24px`,o=e?.background??`#f8f8f8`,s=e?.padding??`40px 16px`,c=t(e?.on??{});return l`
|
536
636
|
<div
|
537
|
-
${
|
637
|
+
${f(e=>{e?c.bind(e):c.unbindAll()})}
|
538
638
|
style="
|
539
639
|
width: 100%;
|
540
|
-
background: ${
|
541
|
-
padding: ${
|
640
|
+
background: ${o};
|
641
|
+
padding: ${s};
|
542
642
|
box-sizing: border-box;
|
543
643
|
"
|
544
644
|
>
|
545
645
|
<div
|
546
646
|
style="
|
547
647
|
display: grid;
|
548
|
-
grid-template-columns: repeat(${
|
549
|
-
gap: ${
|
648
|
+
grid-template-columns: repeat(${r}, 1fr);
|
649
|
+
gap: ${a};
|
550
650
|
"
|
551
651
|
>
|
552
|
-
${i(
|
652
|
+
${i(n)}
|
553
653
|
</div>
|
554
654
|
<div style="text-align: center; margin-top: 24px; color: #666;">
|
555
655
|
© ${new Date().getFullYear()} Your Company. All rights reserved.
|
556
656
|
</div>
|
557
657
|
</div>
|
558
|
-
`}function
|
559
|
-
`+
|
658
|
+
`}function X(e,t){return t?e.map((e,n)=>t(e,n)):t=>e.map((e,n)=>t(e,n))}function Z(a,o){if(o===void 0){let e=e=>Z(a,e??l``);return e.html=(e,...t)=>Z(a,l(e,...t)),e}let s=a.defaultColumns??1,c=a.gap??`16px`,u=n(`GridBreakpoint`),d=a.className??r(`GridBreakpoint::grid-breakpoint`)+`-lyco-now-`+u,p=Object.entries(a.breakpoints).map(([e,t])=>`@media`+e+`{
|
659
|
+
`+d+`{ grid-template-columns: repeat(`+t+`, 1fr); }
|
560
660
|
}`).join(`
|
561
|
-
`),
|
562
|
-
.${
|
661
|
+
`),m=`
|
662
|
+
.${d} {
|
563
663
|
display: grid;
|
564
|
-
grid-template-columns: repeat(${
|
565
|
-
gap: ${
|
664
|
+
grid-template-columns: repeat(${s}, 1fr);
|
665
|
+
gap: ${c};
|
566
666
|
}
|
567
|
-
${
|
667
|
+
${p}`,h=t(a?.on??{});return e(`GridBreakpoint`,l`
|
568
668
|
<style>
|
569
|
-
${
|
669
|
+
${m}
|
570
670
|
</style>
|
571
671
|
<div
|
572
|
-
${
|
573
|
-
class="${
|
672
|
+
${f(e=>{e?h.bind(e):h.unbindAll()})}
|
673
|
+
class="${d}"
|
574
674
|
>
|
575
|
-
${i(
|
675
|
+
${i(o)}
|
576
676
|
</div>
|
577
|
-
`)}function
|
677
|
+
`)}function re(e,n){if(n===void 0)return t=>re(e,t??[l``]);let r=e?.backgroundImage?`background-image: url('${e.backgroundImage}');`:``,i=e?.height??`400px`,o=e?.overlayColor??`rgba(0, 0, 0, 0.3)`,s=t(e?.on??{});return l`
|
578
678
|
<div
|
579
|
-
${
|
679
|
+
${f(e=>{e?s.bind(e):s.unbindAll()})}
|
580
680
|
style="
|
581
681
|
position: relative;
|
582
682
|
width: 100%;
|
583
|
-
height: ${
|
584
|
-
${
|
683
|
+
height: ${i};
|
684
|
+
${r}
|
585
685
|
background-size: cover;
|
586
686
|
background-position: center;
|
587
687
|
"
|
@@ -590,7 +690,7 @@ import{html as e}from"lit";import{createRef as t,ref as n}from"lit/directives/re
|
|
590
690
|
style="
|
591
691
|
position: absolute;
|
592
692
|
top: 0; left: 0; right: 0; bottom: 0;
|
593
|
-
background: ${
|
693
|
+
background: ${o};
|
594
694
|
"
|
595
695
|
></div>
|
596
696
|
<div
|
@@ -609,194 +709,607 @@ import{html as e}from"lit";import{createRef as t,ref as n}from"lit/directives/re
|
|
609
709
|
box-sizing: border-box;
|
610
710
|
"
|
611
711
|
>
|
612
|
-
${a(
|
712
|
+
${a(n)}
|
613
713
|
</div>
|
614
714
|
</div>
|
615
|
-
`}function
|
616
|
-
@media not ${
|
617
|
-
.${
|
715
|
+
`}function Q(a,o){if(o===void 0){let e=e=>Q(a,e??l``);return e.html=(e,...t)=>Q(a,l(e,...t)),e}let s=a?.breakpoint??`(max-width: 600px)`,c=a?.mode??`hide`,u=n(`Hidden`),d=a?.className??r(`Hidden::hidden-container`)+`-lyco-now-`+u,p=c===`hide`?`@media ${s} { .${d} { display: none !important; } }`:`@media ${s} { .${d} { display: block !important; } }
|
716
|
+
@media not ${s} { .${d} { display: none !important; } }`,m=`
|
717
|
+
.${d} {
|
618
718
|
display: block;
|
619
719
|
}
|
620
|
-
${
|
720
|
+
${p}`,h=t(a?.on??{});return e(`Hidden`,l`
|
621
721
|
<style>
|
622
|
-
${
|
722
|
+
${m}
|
623
723
|
</style>
|
624
724
|
<div
|
625
|
-
${
|
626
|
-
class="${
|
725
|
+
${f(e=>{e?h.bind(e):h.unbindAll()})}
|
726
|
+
class="${d}"
|
627
727
|
>
|
628
|
-
${i(
|
728
|
+
${i(o)}
|
629
729
|
</div>
|
630
|
-
`)}function
|
631
|
-
ul.${
|
730
|
+
`)}function ie(e){return l` <li>${a(e)}</li> `}function ae(t,i){let o=t?.bordered?`border: 1px solid #ddd; border-radius: 4px`:``,s=t?.striped?`li:nth-child(even) { background: #f9f9f9; }`:``,c=t?.hover?`li:hover { background: #f1f1f1; cursor: pointer; }`:``,u=n(`List`),d=t?.className??r(`List::list`)+`-lyco-now-${u}`,f=`
|
731
|
+
ul.${d} {
|
632
732
|
list-style: none;
|
633
733
|
margin: 0;
|
634
734
|
padding: 0;
|
635
|
-
${
|
735
|
+
${o};
|
636
736
|
}
|
637
|
-
ul.${
|
737
|
+
ul.${d} li {
|
638
738
|
padding: 12px 16px;
|
639
739
|
${t?.bordered?`border-bottom: 1px solid #ddd`:``};
|
640
740
|
}
|
641
|
-
ul.${
|
741
|
+
ul.${d} li:last-child {
|
642
742
|
${t?.bordered?`border-bottom: none`:``};
|
643
743
|
}
|
644
|
-
${
|
645
|
-
${
|
646
|
-
`.toString(),
|
744
|
+
${s}
|
745
|
+
${c}
|
746
|
+
`.toString(),p=t=>e(`List`,l`
|
647
747
|
<style>
|
648
|
-
${
|
748
|
+
${f}
|
649
749
|
</style>
|
650
|
-
<ul class="${
|
750
|
+
<ul class="${d}">
|
651
751
|
${a(t)}
|
652
752
|
</ul>
|
653
|
-
`);return
|
654
|
-
ul.${
|
753
|
+
`);return i===void 0?p:p(i)}function oe(i,s){let c=i?.bordered?`border: 1px solid #ddd; border-radius: 4px`:``,u=i?.striped?`li:nth-child(even) { background: #f9f9f9; }`:``,d=i?.hover?`li:hover { background: #f1f1f1; cursor: pointer; }`:``,p=n(`ListGroup`),m=i?.className??r(`ListGroup::list-group`)+`-lyco-now-`+p,h=(e,t,n,r)=>n?l` <li>${e}</li> `:e,g=`
|
754
|
+
ul.${m} {
|
655
755
|
list-style: none;
|
656
756
|
margin: 0;
|
657
757
|
padding: 0;
|
658
|
-
${
|
758
|
+
${c};
|
659
759
|
}
|
660
|
-
ul.${
|
760
|
+
ul.${m} li {
|
661
761
|
padding: 12px 16px;
|
662
|
-
${
|
762
|
+
${i?.bordered?`border-bottom: 1px solid #ddd`:``};
|
663
763
|
}
|
664
|
-
ul.${
|
665
|
-
${
|
764
|
+
ul.${m} li:last-child {
|
765
|
+
${i?.bordered?`border-bottom: none`:``};
|
666
766
|
}
|
667
|
-
${
|
668
|
-
${
|
669
|
-
`,_=
|
767
|
+
${u}
|
768
|
+
${d}
|
769
|
+
`,_=t(i?.on??{}),v=t=>e(`ListGroup`,l`
|
670
770
|
<style>
|
671
|
-
${
|
771
|
+
${g}
|
672
772
|
</style>
|
673
773
|
<ul
|
674
|
-
${
|
675
|
-
class="${
|
774
|
+
${f(e=>{e?_.bind(e):_.unbindAll()})}
|
775
|
+
class="${m}"
|
676
776
|
>
|
677
|
-
${a(t,
|
777
|
+
${a(t,h)}
|
678
778
|
</ul>
|
679
|
-
`);return
|
779
|
+
`);return o(s,v)}function se(e,n){if(n===void 0)return t=>se(e,t??[l``]);let r=e?.background??`rgba(0, 0, 0, 0.5)`,i=e?.zIndex??1e3,o=e?.fullScreen!==!1,s=t(e?.on??{});return l`
|
680
780
|
<div
|
681
|
-
${
|
781
|
+
${f(e=>{e?s.bind(e):s.unbindAll()})}
|
682
782
|
style="
|
683
|
-
position: ${
|
783
|
+
position: ${o?`fixed`:`absolute`};
|
684
784
|
top: 0; left: 0; right: 0; bottom: 0;
|
685
|
-
background: ${
|
686
|
-
z-index: ${
|
785
|
+
background: ${r};
|
786
|
+
z-index: ${i};
|
687
787
|
display: flex;
|
688
788
|
justify-content: center;
|
689
789
|
align-items: center;
|
690
790
|
"
|
691
791
|
>
|
692
|
-
${a(
|
792
|
+
${a(n)}
|
693
793
|
</div>
|
694
|
-
`}function
|
794
|
+
`}function ce(e,n){if(n===void 0){let t=t=>ce(e,t??l``);return t.html=(t,...n)=>ce(e,l(t,...n)),t}let r=e?.width?`width: ${e.width};`:``,a=e?.height?`height: ${e.height};`:``,o=e?.background?`background: ${e.background};`:``,s=t(e?.on??{});return l`
|
695
795
|
<div
|
696
|
-
${
|
796
|
+
${f(e=>{e?s.bind(e):s.unbindAll()})}
|
697
797
|
style="
|
698
798
|
position: relative;
|
699
|
-
${
|
799
|
+
${r} ${a} ${o}
|
700
800
|
overflow: hidden;
|
701
801
|
"
|
702
802
|
>
|
703
|
-
${i(
|
803
|
+
${i(n)}
|
704
804
|
</div>
|
705
|
-
`}function
|
706
|
-
${
|
707
|
-
style="${
|
708
|
-
></div>`}function
|
805
|
+
`}function le(e){let n=e?.width?`width: ${e.width};`:``,r=e?.height?`height: ${e.height};`:``,i=t(e?.on??{});return l`<div
|
806
|
+
${f(e=>{e?i.bind(e):i.unbindAll()})}
|
807
|
+
style="${n} ${r}"
|
808
|
+
></div>`}function ue(i){let{type:a=`rect`,width:o=`100%`,height:s=`16px`,borderRadius:c=`4px`,animation:u=!0,animationType:d=`shimmer`,bgColor:p=`#eee`,highlightColor:m=`#ddd`,count:h=1,spacing:g=`8px`,direction:_=`vertical`,delay:v=0,autoHide:y=!1,duration:b=2e3,on:x={}}=i??{},S=n(`SkeletonLoader`),C=r(`SkeletonLoader::skeleton`)+`-lyco-now-`+S,w=t(x),T=a===`circle`?`border-radius:50%;width:${o};height:${o}`:`border-radius:${c};width:${o};height:${s}`,E=``,D=``;u&&(d===`shimmer`?(E=`@keyframes ${C}-shimmer { 0% { background-color: ${p}; } 50% { background-color: ${m}; } 100% { background-color: ${p}; } }`,D=`animation:${C}-shimmer 1.2s infinite ease-in-out;`):(E=`@keyframes ${C}-pulse { 0% { opacity:1; } 50% { opacity:0.4; } 100% { opacity:1; } }`,D=`animation:${C}-pulse 1.2s infinite ease-in-out;`));let O=_===`horizontal`?`display:flex;flex-direction:row;gap:${g}`:`display:flex;flex-direction:column;gap:${g}`,k=[];for(let e=0;e<h;e++)k.push(l`
|
809
|
+
<div
|
810
|
+
class="${C}"
|
811
|
+
style="${T};background-color:${p};${D};opacity:0;transition:opacity 0.3s"
|
812
|
+
${f(e=>{e&&w.bind(e)})}
|
813
|
+
></div>
|
814
|
+
`);function A(e){let t=Array.from(e.querySelectorAll(`.${C}`));setTimeout(()=>{t.forEach(e=>e.style.opacity=`1`),y&&setTimeout(()=>{t.forEach(e=>e.style.opacity=`0`)},b)},v)}return e(`SkeletonLoader`,l`
|
709
815
|
<style>
|
710
|
-
${
|
711
|
-
@keyframes ${l+`-shimmer`} {
|
712
|
-
0% { background-color: #eee; }
|
713
|
-
50% { background-color: #ddd; }
|
714
|
-
100% { background-color: #eee; }
|
715
|
-
}
|
716
|
-
`}
|
717
|
-
.${l} {
|
718
|
-
${u};
|
719
|
-
background-color: #eee;
|
720
|
-
${s?`animation: ${l+`-shimmer`} 1.2s infinite ease-in-out`:``};
|
721
|
-
}
|
816
|
+
${E}
|
722
817
|
</style>
|
723
818
|
<div
|
724
|
-
${
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
819
|
+
style="${O}"
|
820
|
+
${f(e=>e&&A(e))}
|
821
|
+
>
|
822
|
+
${k}
|
823
|
+
</div>
|
824
|
+
`)}function de(e){let n=t(e?.on??{});return l`<div
|
825
|
+
${f(e=>{e?n.bind(e):n.unbindAll()})}
|
729
826
|
style="flex: 1 1 auto;"
|
730
|
-
></div>`}function
|
827
|
+
></div>`}function fe(e,n){if(n===void 0){let t=t=>fe(e,t??l``);return t.html=(t,...n)=>fe(e,l(t,...n)),t}let r=e?.top?`top: ${e.top};`:``,a=e?.bottom?`bottom: ${e.bottom};`:``,o=typeof e?.zIndex==`number`?`z-index: ${e.zIndex};`:``,s=t(e?.on??{});return l`
|
731
828
|
<div
|
732
|
-
${
|
829
|
+
${f(e=>{e?s.bind(e):s.unbindAll()})}
|
733
830
|
style="
|
734
831
|
position: sticky;
|
735
|
-
${
|
736
|
-
${
|
832
|
+
${r} ${a}
|
833
|
+
${o}
|
737
834
|
"
|
738
835
|
>
|
739
|
-
${i(
|
836
|
+
${i(n)}
|
740
837
|
</div>
|
741
|
-
`}function
|
742
|
-
.${
|
743
|
-
|
744
|
-
|
745
|
-
`:``,
|
746
|
-
.${
|
747
|
-
|
748
|
-
|
749
|
-
|
838
|
+
`}function pe(a,o){if(o===void 0){let e=e=>pe(a,e??l``);return e.html=(e,...t)=>pe(a,l(e,...t)),e}let s=n(`Table`),c=a?.className??r(`Table::table`)+`-lyco-now-${s}`,u=a?.striped?`
|
839
|
+
.${c} tr:nth-child(even) {
|
840
|
+
background: ${L.colors.surface};
|
841
|
+
}
|
842
|
+
`:``,d=a?.hover?`
|
843
|
+
.${c} tr:hover {
|
844
|
+
background: ${L.colors.primaryContainer};
|
845
|
+
cursor: pointer;
|
846
|
+
}
|
847
|
+
`:``,p=a?.bordered?`
|
848
|
+
.${c}, .${c} th, .${c} td {
|
849
|
+
border: 1px solid ${L.colors.surfaceVariant};
|
850
|
+
}
|
851
|
+
`:``,m=`
|
852
|
+
.${c} table {
|
750
853
|
width: 100%;
|
751
|
-
border-collapse:
|
854
|
+
border-collapse: separate;
|
855
|
+
border-spacing: 0;
|
856
|
+
border-radius: ${L.borderRadius.medium};
|
857
|
+
overflow: hidden;
|
858
|
+
box-shadow: ${L.elevation.level1};
|
752
859
|
}
|
753
|
-
.${
|
754
|
-
.${
|
755
|
-
padding:
|
860
|
+
.${c} th,
|
861
|
+
.${c} td {
|
862
|
+
padding: 16px;
|
756
863
|
text-align: left;
|
864
|
+
transition: background ${L.animation.standard};
|
757
865
|
}
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
866
|
+
.${c} th {
|
867
|
+
background: ${L.colors.surfaceVariant};
|
868
|
+
color: ${L.colors.onSurfaceVariant};
|
869
|
+
font-weight: 500;
|
870
|
+
}
|
871
|
+
.${c} td {
|
872
|
+
border-bottom: 1px solid ${L.colors.surfaceVariant};
|
873
|
+
}
|
874
|
+
${u}
|
875
|
+
${d}
|
876
|
+
${p}
|
877
|
+
`,h=t(a?.on??{});return e(`Table`,l`
|
762
878
|
<style>
|
763
|
-
${
|
879
|
+
${m}
|
764
880
|
</style>
|
765
881
|
|
766
882
|
<div
|
767
|
-
${
|
768
|
-
class="${
|
883
|
+
${f(e=>{e?h.bind(e):h.unbindAll()})}
|
884
|
+
class="${c}"
|
769
885
|
>
|
770
886
|
<table>
|
771
|
-
${i(
|
887
|
+
${i(o)}
|
772
888
|
</table>
|
773
889
|
</div>
|
774
|
-
`)}function
|
890
|
+
`)}function me(e,n){let r=e?.direction??`row`,i=t(e?.on??{});return n===void 0?t=>me(e,t??l``):l`
|
775
891
|
<div
|
776
|
-
${
|
892
|
+
${f(e=>{e?i.bind(e):i.unbindAll()})}
|
777
893
|
style="
|
778
894
|
display: flex;
|
779
|
-
flex-direction: ${
|
895
|
+
flex-direction: ${r};
|
780
896
|
flex-wrap: wrap;
|
781
|
-
${
|
782
|
-
${
|
783
|
-
${
|
897
|
+
${e?.gap?`gap: ${e.gap};`:``}
|
898
|
+
${e?.align?`align-items: ${e.align};`:``}
|
899
|
+
${e?.justify?`justify-content: ${e.justify};`:``}
|
784
900
|
"
|
785
901
|
>
|
786
|
-
${a(
|
902
|
+
${a(n)}
|
787
903
|
</div>
|
788
|
-
`}function
|
904
|
+
`}function he(e,n){let r=e?.width?`width: ${e.width};`:``,i=e?.height?`height: ${e.height};`:``,o=e?.background?`background: ${e.background};`:``,s=t(e?.on??{});if(n===void 0)return t=>he(e,t??[l``]);let c=`flex-start`,u=`flex-start`;switch(e?.align){case`top-right`:c=`flex-end`,u=`flex-start`;break;case`center`:c=`center`,u=`center`;break;case`bottom-left`:c=`flex-start`,u=`flex-end`;break;case`bottom-right`:c=`flex-end`,u=`flex-end`;break;default:c=`flex-start`,u=`flex-start`}return l`
|
789
905
|
<div
|
790
|
-
${
|
906
|
+
${f(e=>{e?s.bind(e):s.unbindAll()})}
|
791
907
|
style="
|
792
908
|
position: relative;
|
793
909
|
display: flex;
|
794
|
-
justify-content: ${
|
910
|
+
justify-content: ${c};
|
795
911
|
align-items: ${u};
|
796
|
-
${
|
912
|
+
${r} ${i} ${o}
|
797
913
|
"
|
798
914
|
>
|
799
|
-
${a(
|
915
|
+
${a(n)}
|
800
916
|
</div>
|
801
|
-
`}
|
917
|
+
`}function ge(i){let{value:a=``,options:o=[],placeholder:s=``,disabled:c=!1,error:u=!1,className:d=``,style:p=``,maxHeight:m=`300px`,onChange:h,onInput:g,onFocus:_,onBlur:v,on:y={},optionRender:b}=i??{},x=n(`Combobox`),S=r(`Combobox::combobox`)+`-lyco-now-${x}`,C=!1,w=null,T=`
|
918
|
+
.${S} {
|
919
|
+
position: relative;
|
920
|
+
width: 100%;
|
921
|
+
}
|
922
|
+
|
923
|
+
.${S} input {
|
924
|
+
width: 100%;
|
925
|
+
padding: 12px 16px;
|
926
|
+
font-size: 16px;
|
927
|
+
border: 1px solid ${u?L.colors.error:L.colors.surfaceVariant};
|
928
|
+
border-radius: ${L.borderRadius.small};
|
929
|
+
color: ${L.colors.onSurface};
|
930
|
+
transition: all ${L.animation.standard};
|
931
|
+
outline: none;
|
932
|
+
box-sizing: border-box;
|
933
|
+
}
|
934
|
+
|
935
|
+
.${S} input:focus {
|
936
|
+
border-color: ${L.colors.primary};
|
937
|
+
box-shadow: 0 0 0 2px ${L.colors.primaryContainer};
|
938
|
+
}
|
939
|
+
|
940
|
+
.${S} input:disabled {
|
941
|
+
background: ${L.colors.surfaceVariant};
|
942
|
+
color: ${L.colors.onSurfaceVariant};
|
943
|
+
cursor: not-allowed;
|
944
|
+
}
|
945
|
+
|
946
|
+
.${S} .options {
|
947
|
+
position: absolute;
|
948
|
+
top: 100%;
|
949
|
+
left: 0;
|
950
|
+
right: 0;
|
951
|
+
max-height: ${m};
|
952
|
+
overflow-y: auto;
|
953
|
+
border: 1px solid ${L.colors.surfaceVariant};
|
954
|
+
border-radius: ${L.borderRadius.small};
|
955
|
+
box-shadow: ${L.elevation.level2};
|
956
|
+
z-index: 1000;
|
957
|
+
display: none;
|
958
|
+
}
|
959
|
+
|
960
|
+
.${S} .options.open {
|
961
|
+
display: block;
|
962
|
+
}
|
963
|
+
|
964
|
+
.${S} .option {
|
965
|
+
padding: 12px 16px;
|
966
|
+
cursor: pointer;
|
967
|
+
transition: background ${L.animation.standard};
|
968
|
+
}
|
969
|
+
|
970
|
+
.${S} .option:hover {
|
971
|
+
background: ${L.colors.primaryContainer};
|
972
|
+
}
|
973
|
+
|
974
|
+
.${S} .option.selected {
|
975
|
+
background: ${L.colors.primaryContainer};
|
976
|
+
color: ${L.colors.onPrimaryContainer};
|
977
|
+
}
|
978
|
+
`,E=t(y),D=null,O=()=>{C?D?.classList.remove(`open`):D?.classList.add(`open`),C=!C},k=(e,t)=>{if(w){w.value=e.value;let n=t.currentTarget;Array.from(D?.querySelectorAll(`.selected`)??[]).forEach(e=>e.classList.remove(`selected`)),!n.classList.contains(`selected`)&&n.classList.add(`selected`),h?.(e.value)}O()},A=e=>{let t=e.target;t.closest(`.${S}`)||(C=!1,D?.classList.remove(`open`))};return typeof window<`u`&&document.addEventListener(`click`,A),e(`Combobox`,l`
|
979
|
+
<style>
|
980
|
+
${T}
|
981
|
+
</style>
|
982
|
+
<div class="${S} ${d}" style="${p}">
|
983
|
+
<input
|
984
|
+
${f(e=>{e?(w=e,E.bind(e)):E.unbindAll()})}
|
985
|
+
type="text"
|
986
|
+
.value=${a}
|
987
|
+
placeholder=${s}
|
988
|
+
?disabled=${c}
|
989
|
+
@focus=${()=>{_?.(),O()}}
|
990
|
+
@input=${e=>{let t=e.target;g?.(t.value)}}
|
991
|
+
@change=${e=>{let t=e.target;h?.(t.value)}}
|
992
|
+
/>
|
993
|
+
<div
|
994
|
+
${f(e=>{e&&(D=e)})}
|
995
|
+
class="options"
|
996
|
+
>
|
997
|
+
${o.map(e=>l`
|
998
|
+
<div
|
999
|
+
class="option ${e.value===(w?.value??a)?`selected`:``}"
|
1000
|
+
@click=${t=>k(e,t)}
|
1001
|
+
>
|
1002
|
+
${b?b(e):e.label}
|
1003
|
+
</div>
|
1004
|
+
`)}
|
1005
|
+
</div>
|
1006
|
+
</div>
|
1007
|
+
`)}function _e(e){let n=Math.min(100,Math.max(0,e?.value??0)),r=Math.min(100,Math.max(0,e?.bufferValue??0)),i=e?.color??`#1976d2`,a=e?.secondaryColor??`#90caf9`,o=e?.backgroundColor??`#e0e0e0`,s=e?.height??`4px`,u=e?.radius??`4px`,d=e?.showLabel??!1,p=e?.labelPosition??`inside`,m=e?.labelColor??(n>50?`white`:i),h=e?.labelFontSize??`12px`,g=e?.striped??!1,_=e?.animated??!1,v=e?.paused??!1,y=e?.transitionDuration??`0.3s`,b=e?.className??``,x=e?.style??``,S=t(e?.on??{}),C=g?`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);
|
1008
|
+
background-size: 1rem 1rem;
|
1009
|
+
animation: progress-stripes 1s linear infinite;
|
1010
|
+
animation-play-state: ${v?`paused`:`running`};`:``;return l`
|
1011
|
+
<style>
|
1012
|
+
${c`
|
1013
|
+
@keyframes progress-stripes {
|
1014
|
+
from {
|
1015
|
+
background-position: 1rem 0;
|
1016
|
+
}
|
1017
|
+
to {
|
1018
|
+
background-position: 0 0;
|
1019
|
+
}
|
1020
|
+
}
|
1021
|
+
`.cssText}
|
1022
|
+
</style>
|
1023
|
+
|
1024
|
+
<div
|
1025
|
+
${f(e=>{e?S.bind(e):S.unbindAll()})}
|
1026
|
+
class="lyco-progress ${b}"
|
1027
|
+
role="progressbar"
|
1028
|
+
aria-valuemin="0"
|
1029
|
+
aria-valuemax="100"
|
1030
|
+
aria-valuenow="${n}"
|
1031
|
+
style="
|
1032
|
+
width: 100%;
|
1033
|
+
background: ${o};
|
1034
|
+
border-radius: ${u};
|
1035
|
+
height: ${s};
|
1036
|
+
position: relative;
|
1037
|
+
overflow: hidden;
|
1038
|
+
display: flex;
|
1039
|
+
align-items: center;
|
1040
|
+
${x}
|
1041
|
+
"
|
1042
|
+
>
|
1043
|
+
${e?.prefixIcon}
|
1044
|
+
<!-- 缓冲进度 -->
|
1045
|
+
<div
|
1046
|
+
style="
|
1047
|
+
position: absolute;
|
1048
|
+
width: ${r}%;
|
1049
|
+
height: 100%;
|
1050
|
+
background: ${a};
|
1051
|
+
transition: width ${y} ease;
|
1052
|
+
"
|
1053
|
+
></div>
|
1054
|
+
<!-- 主进度 -->
|
1055
|
+
<div
|
1056
|
+
style="
|
1057
|
+
position: absolute;
|
1058
|
+
width: ${n}%;
|
1059
|
+
height: 100%;
|
1060
|
+
background: ${i};
|
1061
|
+
border-radius: ${u};
|
1062
|
+
transition: width ${y} ease;
|
1063
|
+
${C}
|
1064
|
+
"
|
1065
|
+
></div>
|
1066
|
+
|
1067
|
+
<!-- 文本标签 -->
|
1068
|
+
${d?l`
|
1069
|
+
<div
|
1070
|
+
style="
|
1071
|
+
position: ${p===`inside`?`absolute`:`relative`};
|
1072
|
+
${p===`inside`?`right: 8px; top: 50%; transform: translateY(-50%);`:`margin-left: auto; margin-right: 4px;`}
|
1073
|
+
font-size: ${h};
|
1074
|
+
color: ${m};
|
1075
|
+
z-index: 1;
|
1076
|
+
"
|
1077
|
+
>
|
1078
|
+
${n}%
|
1079
|
+
</div>
|
1080
|
+
`:``}
|
1081
|
+
${e?.suffixIcon}
|
1082
|
+
</div>
|
1083
|
+
`}function ve(r){let{size:i=`24px`,color:a=L.colors.primary,thickness:o=`2px`,speed:s=`1.2s`,className:u=``,opacity:d=1,startAngle:p=0,easing:m=`linear`,reverse:h=!1,style:g=``,on:_={},children:v,svgMode:y=!1,strokeLinecap:b=`butt`,strokeDasharray:x=``}=r??{},S=t(_),C=n(`Spinner`),w=l`
|
1084
|
+
<div
|
1085
|
+
class="${u}"
|
1086
|
+
style="display: inline-flex; align-items: center; justify-content: center; width: ${i}; height: ${i}; ${g}"
|
1087
|
+
${f()}
|
1088
|
+
>
|
1089
|
+
<div
|
1090
|
+
style="
|
1091
|
+
width: 100%;
|
1092
|
+
height: 100%;
|
1093
|
+
border: ${o} solid ${a};
|
1094
|
+
border-right-color: transparent;
|
1095
|
+
border-radius: 50%;
|
1096
|
+
box-sizing: border-box;
|
1097
|
+
opacity: ${d};
|
1098
|
+
animation: lyco-spin-${C} ${s} ${m} infinite ${h?`reverse`:`normal`};
|
1099
|
+
"
|
1100
|
+
></div>
|
1101
|
+
</div>
|
1102
|
+
<style>
|
1103
|
+
${c`
|
1104
|
+
@keyframes lyco-spin-${C} {
|
1105
|
+
from {
|
1106
|
+
transform: rotate(${p}deg);
|
1107
|
+
}
|
1108
|
+
to {
|
1109
|
+
transform: rotate(${p+360}deg);
|
1110
|
+
}
|
1111
|
+
}
|
1112
|
+
`.cssText}
|
1113
|
+
</style>
|
1114
|
+
`,T=l`
|
1115
|
+
<div
|
1116
|
+
class="${u}"
|
1117
|
+
style="display: inline-flex; align-items: center; justify-content: center; width: ${i}; height: ${i}; ${g}"
|
1118
|
+
${f(e=>{e?S.bind(e):S.unbindAll()})}
|
1119
|
+
>
|
1120
|
+
<svg
|
1121
|
+
width="100%"
|
1122
|
+
height="100%"
|
1123
|
+
viewBox="0 0 100 100"
|
1124
|
+
style="opacity: ${d}; overflow: visible; filter: drop-shadow(${L.elevation.level1});"
|
1125
|
+
>
|
1126
|
+
<circle
|
1127
|
+
cx="50"
|
1128
|
+
cy="50"
|
1129
|
+
r="45"
|
1130
|
+
fill="none"
|
1131
|
+
stroke="${a}"
|
1132
|
+
style="
|
1133
|
+
stroke-width: ${o};
|
1134
|
+
stroke-linecap: ${b};
|
1135
|
+
stroke-dasharray: ${x};
|
1136
|
+
transform-origin: 50% 50%;
|
1137
|
+
animation: lyco-svg-spin-${C} ${s} ${m} infinite ${h?`reverse`:`normal`};
|
1138
|
+
"
|
1139
|
+
></circle>
|
1140
|
+
</svg>
|
1141
|
+
</div>
|
1142
|
+
<style>
|
1143
|
+
${c`
|
1144
|
+
@keyframes lyco-svg-spin-${C} {
|
1145
|
+
from {
|
1146
|
+
transform: rotate(${p}deg);
|
1147
|
+
}
|
1148
|
+
to {
|
1149
|
+
transform: rotate(${p+360}deg);
|
1150
|
+
}
|
1151
|
+
}
|
1152
|
+
`.cssText}
|
1153
|
+
</style>
|
1154
|
+
`;return e(`Spinner`,y?T:w)}let $=function(e){return e.Top=`top`,e.Bottom=`bottom`,e.Left=`left`,e.Right=`right`,e}({});function ye(e,n){let{content:r,placement:a=$.Top,delay:o={show:200,hide:100},offset:c=8,hideOnClick:u=!1,interactive:d=!1,maxWidth:p=`200px`,theme:m=`dark`,className:h=``,style:g=``,zIndex:_=1e3,on:v={},onShow:y,onHide:b}=e,x=t(v),S,C;function w(e){clearTimeout(C),S=window.setTimeout(()=>{E.style.visibility=`visible`,E.style.opacity=`1`,y?.()},o.show)}function T(){clearTimeout(S),C=window.setTimeout(()=>{E.style.visibility=`hidden`,E.style.opacity=`0`,b?.()},o.hide)}let E,D=e=>l`
|
1155
|
+
<div
|
1156
|
+
${f(e=>{e?(x.bind(e),E=e.querySelector(`.lyco-tooltip-content`),e.addEventListener(`mouseenter`,()=>w(e)),e.addEventListener(`mouseleave`,()=>T()),u&&e.addEventListener(`click`,()=>T())):x.unbindAll()})}
|
1157
|
+
class="lyco-tooltip lyco-tooltip--${m} ${h}"
|
1158
|
+
style="position: relative; display: inline-block; ${g}"
|
1159
|
+
>
|
1160
|
+
${i(e)}
|
1161
|
+
<div
|
1162
|
+
class="lyco-tooltip-content"
|
1163
|
+
style="
|
1164
|
+
position: absolute;
|
1165
|
+
max-width: ${p};
|
1166
|
+
${a===$.Top?`bottom: 100%; left: 50%; transform: translateX(-50%)`:``}
|
1167
|
+
${a===$.Bottom?`top: 100%; left: 50%; transform: translateX(-50%)`:``}
|
1168
|
+
${a===$.Left?`right: 100%; top: 50%; transform: translateY(-50%)`:``}
|
1169
|
+
${a===$.Right?`left: 100%; top: 50%; transform: translateY(-50%)`:``}
|
1170
|
+
padding: 4px 8px;
|
1171
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
|
1172
|
+
background: ${m===`light`?`white; color: black`:`rgba(0,0,0,0.8); color: white`};
|
1173
|
+
border-radius: 4px;
|
1174
|
+
font-size: 12px;
|
1175
|
+
white-space: normal;
|
1176
|
+
width: ${a===$.Left||a===$.Right?p:`auto`};
|
1177
|
+
visibility: hidden;
|
1178
|
+
opacity: 0;
|
1179
|
+
transition: opacity ${o.show}ms;
|
1180
|
+
z-index: ${_};
|
1181
|
+
margin: ${typeof c==`number`?a===$.Top||a===$.Bottom?`${c}px 0`:`0 ${c}px`:`${c.y}px ${c.x}px`};
|
1182
|
+
${d?`pointer-events: auto`:`pointer-events: none`};
|
1183
|
+
"
|
1184
|
+
>
|
1185
|
+
${r}
|
1186
|
+
</div>
|
1187
|
+
</div>
|
1188
|
+
`;return s(n,D)}let be=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 xe=typeof window>`u`,Se=!xe&&`HTMLDialogElement`in window,Ce=e=>`
|
1189
|
+
position: fixed;
|
1190
|
+
top: 0;
|
1191
|
+
left: 0;
|
1192
|
+
width: 100%;
|
1193
|
+
height: 100%;
|
1194
|
+
display: ${e?`flex`:`none`};
|
1195
|
+
align-items: center;
|
1196
|
+
justify-content: center;
|
1197
|
+
z-index: 1000;
|
1198
|
+
background: rgba(0,0,0,0.3);
|
1199
|
+
`;var we=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 Te(i,s){let c=i?.open??!1,u=i?.onClose,d=i?.className??``,p=i?.style??``,m=t(i?.on?i?.on:{}),h=i?.movable??!1,g=i?.placement??be.Center,_=i?.proxyRef??{value:null},v=null,y=!1,b={x:0,y:0},x=null,S=i?.mask??!0,C=n(`Dialog`),w=r(`Dialog::dialog`)+`-lyco-now-`+C;function T(e){return h?h===`self`?e:h&&`value`in h?h.value:null:null}function E(){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 D(){switch(g){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 E()}}function O(){switch(g){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 k(e,t){if(e.button!==0||(x=T(t),!x||!x.contains(e.target)))return;v=t,v.style.transform=`none`,e.preventDefault(),x.style.cursor=`grabbing`;let n=t.getBoundingClientRect(),{txp:r,typ:i}=O();b={x:e.clientX-(n.left+r/100*n.width),y:e.clientY-(n.top+i/100*n.height)},y=!0,document.addEventListener(`mousemove`,A),document.addEventListener(`mouseup`,j)}function A(e){if(!y||!x||!v)return;let t=v.getBoundingClientRect(),{txp:n,typ:r}=O(),i=e.clientX-b.x-n/100*t.width,a=e.clientY-b.y-r/100*t.height;v.style.left=`${i}px`,v.style.top=`${a}px`}function j(){y=!1,x=null,v=null,document.removeEventListener(`mousemove`,A),document.removeEventListener(`mouseup`,j)}function M(){let e=S?`rgba(0,0,0,0.5)`:`transparent`;return`
|
1200
|
+
${w}::-webkit-backdrop,
|
1201
|
+
${w}::backdrop {
|
1202
|
+
background: ${e};
|
1203
|
+
transition: opacity ${L.animation.standard};
|
1204
|
+
}
|
1205
|
+
`}function N(t){let n=null,r=null;return e(`Dialog`,l`
|
1206
|
+
<div
|
1207
|
+
${f(e=>{if(e){if(n=e,r){let e=new we(n,r);_.value=e,m.bind(n),c?e.showModal():e.close()}}else m.unbindAll()})}
|
1208
|
+
@click=${e=>{e.target===e.currentTarget&&u?.()}}
|
1209
|
+
style=${Ce(c)}
|
1210
|
+
>
|
1211
|
+
<div
|
1212
|
+
${f(e=>{if(e&&(r=e,n)){let e=new we(n,r);_.value=e}})}
|
1213
|
+
class="${w} ${d}"
|
1214
|
+
style="
|
1215
|
+
padding: 0;
|
1216
|
+
border: none;
|
1217
|
+
background: ${L.colors.surface};
|
1218
|
+
border-radius: ${L.borderRadius.large};
|
1219
|
+
min-width: 300px;
|
1220
|
+
${D()}
|
1221
|
+
${typeof h==`boolean`?``:`cursor: default;`}
|
1222
|
+
${p}
|
1223
|
+
"
|
1224
|
+
>
|
1225
|
+
${a(t)}
|
1226
|
+
</div>
|
1227
|
+
</div>
|
1228
|
+
`)}function P(t){return xe||!Se?N(t):e(`Dialog`,l`
|
1229
|
+
<dialog
|
1230
|
+
${f(e=>{if(e){_.value=e;let t=e;m.bind(t),requestAnimationFrame(()=>{try{c?t.showModal():t.close()}catch(e){console.warn(`Dialog operation failed:`,e)}})}else m.unbindAll()})}
|
1231
|
+
@close=${u}
|
1232
|
+
@mousedown=${e=>k(e,e.currentTarget)}
|
1233
|
+
style="
|
1234
|
+
padding: 0;
|
1235
|
+
border: none;
|
1236
|
+
background: ${L.colors.surface};
|
1237
|
+
border-radius: ${L.borderRadius.large};
|
1238
|
+
min-width: 300px;
|
1239
|
+
margin: 0;
|
1240
|
+
position: fixed;
|
1241
|
+
box-shadow: ${L.elevation.level3};
|
1242
|
+
transition: transform ${L.animation.emphasized};
|
1243
|
+
${D()}
|
1244
|
+
${typeof h==`boolean`?``:`cursor: default;`}
|
1245
|
+
${p}
|
1246
|
+
"
|
1247
|
+
>
|
1248
|
+
${a(t)}
|
1249
|
+
</dialog>
|
1250
|
+
<style>
|
1251
|
+
${M()}
|
1252
|
+
</style>
|
1253
|
+
`)}return o(s,P)}function Ee(e,n){let r=e?.className??``,i=e?.style??``,s=t(e?.on??{}),c=e=>l`
|
1254
|
+
<div
|
1255
|
+
${f(e=>{e?s.bind(e):s.unbindAll()})}
|
1256
|
+
class="lyco-dialog-actions ${r}"
|
1257
|
+
style="
|
1258
|
+
display: flex;
|
1259
|
+
align-items: center;
|
1260
|
+
justify-content: flex-end;
|
1261
|
+
padding: 8px 24px;
|
1262
|
+
${i}
|
1263
|
+
"
|
1264
|
+
>
|
1265
|
+
${a(e)}
|
1266
|
+
</div>
|
1267
|
+
`;return o(n,c)}function De(e,n){let r=e?.variant??`text`,a=e?.color??`default`,o=e?.className??``,c=e?.style??``,u=t({click:e?.onClick?t=>{var n;t.preventDefault(),(n=e.onClick)?.call(e,t)}:void 0,...e?.on}),d=e=>l`
|
1268
|
+
<button
|
1269
|
+
${f(e=>{e?u.bind(e):u.unbindAll()})}
|
1270
|
+
class="lyco-dialog-button ${r} ${a} ${o}"
|
1271
|
+
style="
|
1272
|
+
padding: 6px 16px;
|
1273
|
+
font-size: 14px;
|
1274
|
+
border-radius: 4px;
|
1275
|
+
cursor: pointer;
|
1276
|
+
border: none;
|
1277
|
+
outline: none;
|
1278
|
+
margin: 0 4px;
|
1279
|
+
${r===`contained`?`background: #1976d2; color: white;`:`background: transparent;`}
|
1280
|
+
${c}
|
1281
|
+
"
|
1282
|
+
>
|
1283
|
+
${i(e)}
|
1284
|
+
</button>
|
1285
|
+
`;return s(n,d)}function Oe(e,n){let r=e?.className??``,i=e?.style??``,s=t(e?.on??{}),c=e=>l`
|
1286
|
+
<div
|
1287
|
+
class="lyco-dialog-content ${r}"
|
1288
|
+
style="
|
1289
|
+
background: white;
|
1290
|
+
border-radius: 4px;
|
1291
|
+
padding: 20px;
|
1292
|
+
min-width: 300px;
|
1293
|
+
position: relative;
|
1294
|
+
${i}
|
1295
|
+
"
|
1296
|
+
>
|
1297
|
+
${a(e)}
|
1298
|
+
</div>
|
1299
|
+
`;return o(n,c)}function ke(e,n){let r=e?.className??``,a=e?.style??``,o=t(e?.on??{}),c=e?.proxyRef??{value:null},u=e=>l`
|
1300
|
+
<div
|
1301
|
+
${f(e=>{e?(c.value=e,o.bind(e)):o.unbindAll()})}
|
1302
|
+
class="lyco-dialog-title ${r}"
|
1303
|
+
style="
|
1304
|
+
padding: 16px 24px;
|
1305
|
+
font-size: 20px;
|
1306
|
+
font-weight: 500;
|
1307
|
+
line-height: 1.6;
|
1308
|
+
letter-spacing: 0.0075em;
|
1309
|
+
${a}
|
1310
|
+
"
|
1311
|
+
>
|
1312
|
+
${i(e)}
|
1313
|
+
</div>
|
1314
|
+
`;return s(n,u)}function Ae(e){return a(e)}export{Ae as $Html,z as AbsoluteBox,B as AcrylicBar,V as AspectRatio,H as AutoFitGrid,U as AvatarStack,W as Badge,G as Canvas,K as Card,q as Center,w as Column,N as ColumnSplit,ge as Combobox,J as Container,Te as Dialog,Ee as DialogActions,De as DialogButton,Oe as DialogContent,be as DialogPlacement,ke as DialogTitle,ne as Divider,T as Flex,E as FlowItem,Y as FooterLayout,X as ForEach,D as Grid,Z as GridBreakpoint,O as GridCol,k as GridItem,A as GridRow,re as HeroSection,Q as Hidden,C as LightboxContainer,ae as List,oe as ListGroup,ie as ListItem,se as Overlay,ce as PositionContainer,_e as Progress,j as Row,P as RowSplit,F as ScrollBar,I as SideBarContainer,le as SizedBox,ue as SkeletonLoader,de as Spacer,ve as Spinner,fe as Sticky,ee as Swiper,R as SwitchInput,pe as Table,S as Virtualizer,v as VirtualizerController,M as WaterFlow,ye as WithTooltip,me as Wrap,he as ZStack};
|
802
1315
|
//# sourceMappingURL=index.es.js.map
|