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