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