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