lyco 1.2.2 → 1.2.3
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 +78 -75
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +110 -107
- package/dist/index.es.js.map +1 -1
- package/dist/types/components/core.d.ts +59 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``}function n(n,r){let i=r??(e=>e);if(n===void 0)return e``;if(Array.isArray(n))return n.map((e,n)=>i(t(e),n,!0,!1));if(typeof n!=`function`)return i(t(n),void 0,!1,!1);let a=n();return Array.isArray(a)?a.map((e,n)=>i(t(e),n,!0,!1)):i(t(a),void 0,!1,!0)}function r(e){let t=Math.random().toString(36).substring(2,15);return e?`lyco-${e}-${t}`:`lyco-${t}`}function i(e,n){let r=n??(e=>e),i=e=>r(t(e));return e?i(e):i}function a(e,t,r){let i=t??(e=>e),a=e=>i(n(e,r));return e?a(e):a}
|
1
|
+
import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``}function n(n,r){let i=r??(e=>e);if(n===void 0)return e``;if(Array.isArray(n))return n.map((e,n)=>i(t(e),n,!0,!1));if(typeof n!=`function`)return i(t(n),void 0,!1,!1);let a=n();return Array.isArray(a)?a.map((e,n)=>i(t(e),n,!0,!1)):i(t(a),void 0,!1,!0)}function r(e){let t=Math.random().toString(36).substring(2,15);return e?`lyco-${e}-${t}`:`lyco-${t}`}function i(e,n){let r=n??(e=>e),i=e=>r(t(e));return e?i(e):i}function a(e,t,r){let i=t??(e=>e),a=e=>i(n(e,r));return e?a(e):a}const o=e=>({init:!1,prefix:e,className:`___LYCO_NULL___`}),s={"GridBreakpoint::grid-breakpoint":o(`grid-breakpoint`),"Hidden::hidden-container":o(`hidden-container`),"ListGroup::list-group":o(`list-group`),"ScrollBar::scrollbar-container":o(`scrollbar-container`),"SkeletonLoader::skeleton-shimmer":o(`skeleton-shimmer`),"Swiper::swiper":o(`swiper`),"Table::table":o(`table`),"WaterFlow::waterflow":o(`waterflow`),"AutoFitGrid::auto-fit-grid":o(`auto-fit-grid`),"GridCol::grid-col":o(`grid-col`),"GridRow::grid-row":o(`grid-row`)};function c(e){let t=s[e];return t.init||(s[e].init=!0,s[e].className=r(t.prefix)),s[e].className===`___LYCO_NULL___`?r(t.prefix):s[e].className}function l(n,r){if(r===void 0){let t=t=>l(n,t??e``);return t.html=(t,...r)=>l(n,e(t,...r)),t}let i=n?.fadeBg??`rgba(0,0,0,0.7)`,a=n?.zIndex??2e3;return e`
|
2
2
|
<div
|
3
3
|
style="
|
4
4
|
position: fixed;
|
@@ -12,7 +12,7 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
12
12
|
>
|
13
13
|
${t(r)}
|
14
14
|
</div>
|
15
|
-
`}function
|
15
|
+
`}function u(t,r){return r===void 0?n=>u(t,n??[e``]):e`
|
16
16
|
<div
|
17
17
|
style="
|
18
18
|
display: flex;
|
@@ -22,7 +22,7 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
22
22
|
>
|
23
23
|
${n(r)}
|
24
24
|
</div>
|
25
|
-
`}function
|
25
|
+
`}function d(n,r){if(r===void 0){let t=t=>d(n,t??e``);return t.html=(t,...r)=>d(n,e(t,...r)),t}let i=n?.direction??`row`;return e`
|
26
26
|
<div
|
27
27
|
style="
|
28
28
|
display: flex;
|
@@ -34,11 +34,11 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
34
34
|
>
|
35
35
|
${t(r)}
|
36
36
|
</div>
|
37
|
-
`}function
|
37
|
+
`}function f(n){return e`
|
38
38
|
<div style="break-inside: avoid; margin-bottom: 16px;">
|
39
39
|
${t(n)}
|
40
40
|
</div>
|
41
|
-
`}function
|
41
|
+
`}function p(t,r){if(r===void 0)return n=>p(t,n??[e``]);let i=t?.columns??1;return e`
|
42
42
|
<div
|
43
43
|
style="
|
44
44
|
display: grid;
|
@@ -48,31 +48,33 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
48
48
|
>
|
49
49
|
${n(r)}
|
50
50
|
</div>
|
51
|
-
`}function
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
>
|
59
|
-
${
|
60
|
-
</
|
61
|
-
|
51
|
+
`}function m(n,r){if(r===void 0){let t=t=>m(n,t??e``);return t.html=(t,...r)=>m(n,e(t,...r)),t}let i=c(`GridCol::grid-col`),a=n?.gap?`column-gap: ${n.gap};`:``,o=`
|
52
|
+
.${i} {
|
53
|
+
display: grid;
|
54
|
+
grid-auto-flow: column;
|
55
|
+
${a}
|
56
|
+
}
|
57
|
+
`;return e`
|
58
|
+
<style>
|
59
|
+
${o}
|
60
|
+
</style>
|
61
|
+
<div class="${i}">${t(r)}</div>
|
62
|
+
`}function h(n,r){if(r===void 0){let t=t=>h(n,t??e``);return t.html=(t,...r)=>h(n,e(t,...r)),t}return e`
|
62
63
|
<div style="${n?.span?`grid-column: span ${n.span};`:``}">
|
63
64
|
${t(r)}
|
64
65
|
</div>
|
65
|
-
`}function
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
>
|
73
|
-
${
|
74
|
-
</
|
75
|
-
|
66
|
+
`}function g(n,r){if(r===void 0){let t=t=>g(n,t??e``);return t.html=(t,...r)=>g(n,e(t,...r)),t}let i=c(`GridRow::grid-row`),a=n?.gap?`row-gap: ${n.gap};`:``,o=`
|
67
|
+
.${i} {
|
68
|
+
display: grid;
|
69
|
+
grid-auto-flow: row;
|
70
|
+
${a}
|
71
|
+
}
|
72
|
+
`;return e`
|
73
|
+
<style>
|
74
|
+
${o}
|
75
|
+
</style>
|
76
|
+
<div class="${i}">${t(r)}</div>
|
77
|
+
`}function _(t,r){return r===void 0?n=>_(t,n??[e``]):e`
|
76
78
|
<div
|
77
79
|
style="
|
78
80
|
display: flex;
|
@@ -82,22 +84,22 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
82
84
|
>
|
83
85
|
${n(r)}
|
84
86
|
</div>
|
85
|
-
`}function
|
87
|
+
`}function v(n,r){if(r===void 0){let t=t=>v(n,t??e``);return t.html=(t,...r)=>v(n,e(t,...r)),t}let i=n?.columnCount??3,a=n?.gap??`16px`,o=c(`WaterFlow::waterflow`);return e`
|
86
88
|
<style>
|
87
89
|
/* 使用 CSS 类来控制多列布局 */
|
88
|
-
.${
|
89
|
-
column-count: ${
|
90
|
-
column-gap: ${typeof
|
90
|
+
.${o} {
|
91
|
+
column-count: ${i};
|
92
|
+
column-gap: ${typeof a==`number`?`${a}px`:a};
|
91
93
|
}
|
92
94
|
/* 子元素如果是块级元素,需要让它们适应多列流式布局 */
|
93
|
-
.${
|
95
|
+
.${o} > * {
|
94
96
|
display: inline-block;
|
95
97
|
width: 100%;
|
96
98
|
}
|
97
99
|
</style>
|
98
100
|
|
99
|
-
<div class="${
|
100
|
-
`}
|
101
|
+
<div class="${o}">${t(r)}</div>
|
102
|
+
`}v().html`
|
101
103
|
<div>
|
102
104
|
<div>1</div>
|
103
105
|
<div>2</div>
|
@@ -110,7 +112,7 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
110
112
|
<div>9</div>
|
111
113
|
<div>10</div>
|
112
114
|
</div>
|
113
|
-
`;function
|
115
|
+
`;function y(n,r){if(r===void 0){let t=t=>y(n,t??e``);return t.html=(t,...r)=>y(n,e(t,...r)),t}let i=n?.gap??`0px`,a=n?.firstHeight??`50%`,o=e``,s=e``;if(typeof r==`function`){var c;let t=(c=r.call)?.call(r,null)??[];o=t[0]??e``,s=t[1]??e``}else o=t(r);return e`
|
114
116
|
<div
|
115
117
|
style="
|
116
118
|
display: flex;
|
@@ -123,7 +125,7 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
123
125
|
<div style="flex: 0 0 ${a}; overflow: auto;">${o}</div>
|
124
126
|
<div style="flex: 1 1 auto; overflow: auto;">${s}</div>
|
125
127
|
</div>
|
126
|
-
`}function
|
128
|
+
`}function b(n,r){if(r===void 0){let t=t=>b(n,t??e``);return t.html=(t,...r)=>b(n,e(t,...r)),t}let i=n?.gap??`0px`,a=n?.firstWidth??`50%`,o=e``,s=e``;if(typeof r==`function`){var c;let t=(c=r.call)?.call(r,null)??[];o=t[0]??e``,s=t[1]??e``}else o=t(r);return e`
|
127
129
|
<div
|
128
130
|
style="
|
129
131
|
display: flex;
|
@@ -136,12 +138,12 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
136
138
|
<div style="flex: 0 0 ${a}; overflow: auto;">${o}</div>
|
137
139
|
<div style="flex: 1 1 auto; overflow: auto;">${s}</div>
|
138
140
|
</div>
|
139
|
-
`}function
|
141
|
+
`}function x(n,r){if(r===void 0){let t=t=>x(n,t??e``);return t.html=(t,...r)=>x(n,e(t,...r)),t}let i=n?.direction??`vertical`,a=n?.height??`100%`,o=n?.width??`100%`,s=n?.customCss??``,l=n?.className??c(`ScrollBar::scrollbar-container`),u=i===`horizontal`?`overflow-x: auto; overflow-y: hidden`:`overflow-y: auto; overflow-x: hidden`;return e`
|
140
142
|
<style>
|
141
143
|
.${l} {
|
142
144
|
${u};
|
143
|
-
width: ${
|
144
|
-
height: ${
|
145
|
+
width: ${o};
|
146
|
+
height: ${a};
|
145
147
|
}
|
146
148
|
.${l}::-webkit-scrollbar {
|
147
149
|
width: 8px;
|
@@ -154,10 +156,10 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
154
156
|
.${l}::-webkit-scrollbar-track {
|
155
157
|
background: rgba(0, 0, 0, 0.05);
|
156
158
|
}
|
157
|
-
${
|
159
|
+
${s}
|
158
160
|
</style>
|
159
|
-
<div class="${l}">${t(
|
160
|
-
`}function
|
161
|
+
<div class="${l}">${t(r)}</div>
|
162
|
+
`}function S(t,r){if(r===void 0)return n=>S(t,n??[e``]);let i=t?.sidebarWidth??`240px`,a=t?.sidebarPosition??`left`,o=t?.gap??`0px`,s=e``,c=e``;if(typeof r==`function`){var l;let t=(l=r.call)?.call(r,null)??[];s=t[0]??e``,c=t[1]??e``}else c=n(r);return e`
|
161
163
|
<div
|
162
164
|
style="
|
163
165
|
display: flex;
|
@@ -170,7 +172,7 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
170
172
|
<div style="flex: 0 0 ${i}; overflow: auto;">${s}</div>
|
171
173
|
<div style="flex: 1 1 auto; overflow: auto;">${c}</div>
|
172
174
|
</div>
|
173
|
-
`}function
|
175
|
+
`}function C(t={},n){if(n===void 0)return n=>C(t,n??[e``]);let{gap:r=`8px`,snapType:i=`mandatory`,height:a=`auto`,width:o=`100%`,className:s=c(`Swiper::swiper`),direction:l=`x`,scrollBehavior:u=`smooth`,align:d=`start`,showNavigation:f=!0,navigationPosition:p=`inside`,showPagination:m=!0,paginationType:h=`dots`,autoPlay:g=!1,interval:_=3e3,loop:v=!1,touchEnabled:y=!0,mouseWheel:b=!1,onSlideChange:x}=t,S=s,w=S+`-container`,T=S+`-slide`,E=S+`-navigation`,D=S+`-pagination`,O;O=n?typeof n==`function`?n():n:[];let k=O.length,[A,j]=(()=>{let e={value:0};return[()=>e.value,t=>{let n=Math.max(0,Math.min(t,k-1));e.value!==n&&(e.value=n,x?.(n))}]})(),M=e=>{let t=typeof document<`u`?document.querySelector(`.${w}`):null;if(!t)return;let n=t.querySelectorAll(`.${T}`);if(e<0||e>=n.length)return;let r=n[e],i=r.getBoundingClientRect(),a=t.getBoundingClientRect(),o;l===`x`?(o=r.offsetLeft-t.offsetLeft,d===`center`?o-=(a.width-i.width)/2:d===`end`&&(o-=a.width-i.width),t.scrollTo({left:o,behavior:u})):(o=r.offsetTop-t.offsetTop,d===`center`?o-=(a.height-i.height)/2:d===`end`&&(o-=a.height-i.height),t.scrollTo({top:o,behavior:u})),j(e)},N=()=>{let e=A()+1>=k?v?0:A():A()+1;M(e)},P=()=>{let e=A()-1<0?v?k-1:A():A()-1;M(e)},F=()=>{let e=typeof document<`u`?document.querySelector(`.${w}`):null;if(!e)return;let t=e.querySelectorAll(`.${T}`),n=0,r=1/0;t.forEach((t,i)=>{let a=t.getBoundingClientRect(),o=e.getBoundingClientRect(),s;if(l===`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)}),j(n)},I=e=>{if(!y)return;let t=e.touches[0],n=e.currentTarget;n.dataset.touchStartX=t.clientX.toString(),n.dataset.touchStartY=t.clientY.toString()},L=e=>{if(!y)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)||l===`x`)&&e.preventDefault()},R=e=>{if(!y)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&&(l===`x`?a>0?P():N():o>0?P():N()),delete t.dataset.touchStartX,delete t.dataset.touchStartY},z=e=>{b&&(e.preventDefault(),e.deltaY>0?N():P())},B=e=>{if(!g||!e)return;let t,n=()=>{t=setInterval(N,_)},r=()=>{clearInterval(t)};return e.addEventListener(`mouseenter`,r),e.addEventListener(`mouseleave`,n),n(),()=>{clearInterval(t),e.removeEventListener(`mouseenter`,r),e.removeEventListener(`mouseleave`,n)}},V=()=>{let e=typeof document<`u`?document.querySelector(`.${w}`):null;if(!e)return;let t=[];e.addEventListener(`scroll`,F),t.push(()=>e.removeEventListener(`scroll`,F)),y&&(e.addEventListener(`touchstart`,I),e.addEventListener(`touchmove`,L,{passive:!1}),e.addEventListener(`touchend`,R),t.push(()=>e.removeEventListener(`touchstart`,I)),t.push(()=>e.removeEventListener(`touchmove`,L)),t.push(()=>e.removeEventListener(`touchend`,R))),b&&(e.addEventListener(`wheel`,z,{passive:!1}),t.push(()=>e.removeEventListener(`wheel`,z)));let n=B(e);return n&&t.push(n),M(0),()=>t.forEach(e=>e())};typeof window<`u`&&typeof document<`u`&&setTimeout(V,0);let H=e`
|
174
176
|
<div class="${D}">
|
175
177
|
${Array.from({length:k},(t,n)=>e`
|
176
178
|
<button
|
@@ -199,21 +201,21 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
199
201
|
</div>
|
200
202
|
`;return e`
|
201
203
|
<style>
|
202
|
-
.${
|
204
|
+
.${S} {
|
203
205
|
position: relative;
|
204
206
|
overflow: hidden;
|
205
|
-
width: ${
|
206
|
-
height: ${
|
207
|
+
width: ${o};
|
208
|
+
height: ${a};
|
207
209
|
}
|
208
210
|
|
209
211
|
.${w} {
|
210
212
|
width: 100%;
|
211
213
|
height: 100%;
|
212
214
|
overflow: auto;
|
213
|
-
scroll-snap-type: ${l+` `+
|
215
|
+
scroll-snap-type: ${l+` `+i};
|
214
216
|
-webkit-overflow-scrolling: touch;
|
215
217
|
scroll-behavior: ${u};
|
216
|
-
gap: ${
|
218
|
+
gap: ${r};
|
217
219
|
display: flex;
|
218
220
|
flex-direction: ${l===`x`?`row`:`column`};
|
219
221
|
}
|
@@ -305,7 +307,7 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
305
307
|
}
|
306
308
|
</style>
|
307
309
|
|
308
|
-
<div class="${
|
310
|
+
<div class="${S}">
|
309
311
|
<div class="${w}">
|
310
312
|
${O.map((t,n)=>e`
|
311
313
|
<div class="${T} --slide-${n}" key=${n}>
|
@@ -319,7 +321,7 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
319
321
|
${m&&h===`fraction`?U:null}
|
320
322
|
${m&&h===`progressbar`?W:null}
|
321
323
|
</div>
|
322
|
-
`}function
|
324
|
+
`}function w(n,r){let a=n?.top?`top: ${n.top};`:``,o=n?.right?`right: ${n.right};`:``,s=n?.bottom?`bottom: ${n.bottom};`:``,c=n?.left?`left: ${n.left};`:``,l=n?.width?`width: ${n.width};`:``,u=n?.height?`height: ${n.height};`:``,d=typeof n?.zIndex==`number`?`z-index: ${n.zIndex};`:``,f=n?.style?n.style:``,p=n?.className?n.className:``,m=n=>e`
|
323
325
|
<div
|
324
326
|
class="${p}"
|
325
327
|
style="
|
@@ -332,7 +334,7 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
332
334
|
>
|
333
335
|
${t(n)}
|
334
336
|
</div>
|
335
|
-
`;return i(r,m)}function
|
337
|
+
`;return i(r,m)}function T(t,n){let r=t?.width??`300px`,i=t?.height??`auto`,o=t?.top??`20%`,s=t?.bottom??`auto`,c=t?.left??`50%`,l=t?.right??`auto`,u=c===`auto`?``:`transform: translateX(-50%);`,d=t?.background??`rgba(255, 255, 255, 0.3)`,f=t?.blur??`10px`,p=t?.borderRadius??`12px`,m=t?.padding??`16px`,h=t?.zIndex??1e3,g=t=>e`
|
336
338
|
<div
|
337
339
|
style="
|
338
340
|
position: fixed;
|
@@ -356,7 +358,7 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
356
358
|
>
|
357
359
|
${t}
|
358
360
|
</div>
|
359
|
-
`;return a(n,void 0,g)}function
|
361
|
+
`;return a(n,void 0,g)}function E(t,r){if(r===void 0)return n=>E(t,n??[e``]);let i=`${100/t.ratio}%`,a=t.maxWidth?`max-width: ${t.maxWidth};`:``,o=t.background?`background: ${t.background};`:``,s=t.overflow??`hidden`;return e`
|
360
362
|
<div
|
361
363
|
style="
|
362
364
|
position: relative;
|
@@ -379,17 +381,18 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
379
381
|
${n(r)}
|
380
382
|
</div>
|
381
383
|
</div>
|
382
|
-
`}function
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
>
|
390
|
-
${
|
391
|
-
</
|
392
|
-
|
384
|
+
`}function D(n,r){if(r===void 0){let t=e=>D(n,e);return t.html=(t,...r)=>D(n,e(t,...r)),t}let i=c(`AutoFitGrid::auto-fit-grid`),a=n?.gap??`16px`,o=`
|
385
|
+
.${i} {
|
386
|
+
display: grid;
|
387
|
+
grid-template-columns: repeat(auto-fit, minmax(${n.minItemWidth}, 1fr));
|
388
|
+
gap: ${a};
|
389
|
+
}
|
390
|
+
`;return e`
|
391
|
+
<style>
|
392
|
+
${o}
|
393
|
+
</style>
|
394
|
+
<div class="${i}">${t(r)}</div>
|
395
|
+
`}function O(t,r){if(r===void 0)return n=>O(t,n??[e``]);let i=t?.size??`32px`,a=t?.overlap??`-8px`,o=(t,n)=>e`
|
393
396
|
<div
|
394
397
|
style="
|
395
398
|
width: ${i};
|
@@ -407,7 +410,7 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
407
410
|
<div style="display: flex; align-items: center;">
|
408
411
|
${n(r,o)}
|
409
412
|
</div>
|
410
|
-
`}function
|
413
|
+
`}function k(n,r){if(r===void 0){let t=t=>k(n,t??e``);return t.html=(t,...r)=>k(n,e(t,...r)),t}let i=n?.position??`top-right`,a=n?.size??`16px`,o=n?.background??`red`,s=n?.color??`#fff`,[c,l,u,d]=[i.includes(`top`)?`0`:`auto`,i.includes(`right`)?`0`:`auto`,i.includes(`bottom`)?`0`:`auto`,i.includes(`left`)?`0`:`auto`];return e`
|
411
414
|
<div style="position: relative; display: inline-block;">
|
412
415
|
${t(r)}
|
413
416
|
<div
|
@@ -432,7 +435,7 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
432
435
|
${n?.content??``}
|
433
436
|
</div>
|
434
437
|
</div>
|
435
|
-
`}function
|
438
|
+
`}function A(t,r){if(r===void 0)return n=>A(t,n??[e``]);let i=t?.padding??`16px`,a=t?.borderRadius??`8px`,o=t?.shadow??`0 2px 8px rgba(0,0,0,0.1)`,s=t?.background??`#fff`;return e`
|
436
439
|
<div
|
437
440
|
style="
|
438
441
|
background: ${s};
|
@@ -444,7 +447,7 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
444
447
|
>
|
445
448
|
${n(r)}
|
446
449
|
</div>
|
447
|
-
`}function
|
450
|
+
`}function j(n,r){if(r===void 0){let t=t=>j(n,t??e``);return t.html=(t,...r)=>j(n,e(t,...r)),t}let i=n?.width?`width: ${n.width};`:``,a=n?.height?`height: ${n.height};`:``,o=n?.background?`background: ${n.background};`:``;return e`
|
448
451
|
<div
|
449
452
|
style="
|
450
453
|
display: flex;
|
@@ -455,7 +458,7 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
455
458
|
>
|
456
459
|
${t(r)}
|
457
460
|
</div>
|
458
|
-
`}function
|
461
|
+
`}function M(t,r){if(r===void 0)return n=>M(t,n??[e``]);let i=t?.maxWidth??`1024px`,a=t?.padding??`0 16px`,o=t?.background?`background: ${t.background};`:``,s=t?.fullHeight?`height: 100%;`:``;return e`
|
459
462
|
<div
|
460
463
|
style="
|
461
464
|
width: 100%;
|
@@ -470,7 +473,7 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
470
473
|
>
|
471
474
|
${n(r)}
|
472
475
|
</div>
|
473
|
-
`}function
|
476
|
+
`}function N(t){let n=t?.orientation??`horizontal`,r=t?.thickness??`1px`,i=t?.color??`#e0e0e0`,a=t?.margin??(n===`horizontal`?`8px 0`:`0 8px`),o=n===`horizontal`?`width: 100%; height: ${r}; background: ${i}; margin: ${a};`:`width: ${r}; height: 100%; background: ${i}; margin: ${a};`;return e`<div style="${o}"></div>`}function P(n,r){if(r===void 0){let t=t=>P(n,t??e``);return t.html=(t,...r)=>P(n,e(t,...r)),t}let i=n?.columns??4,a=n?.gap??`24px`,o=n?.background??`#f8f8f8`,s=n?.padding??`40px 16px`;return e`
|
474
477
|
<div
|
475
478
|
style="
|
476
479
|
width: 100%;
|
@@ -492,22 +495,22 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
492
495
|
© ${new Date().getFullYear()} Your Company. All rights reserved.
|
493
496
|
</div>
|
494
497
|
</div>
|
495
|
-
`}function
|
498
|
+
`}function F(n,r){if(r===void 0){let t=t=>F(n,t??e``);return t.html=(t,...r)=>F(n,e(t,...r)),t}let i=n.defaultColumns??1,a=n.gap??`16px`,o=n.className??c(`GridBreakpoint::grid-breakpoint`),s=Object.entries(n.breakpoints).map(([e,t])=>`
|
496
499
|
@media ${e} {
|
497
|
-
.${
|
500
|
+
.${o} { grid-template-columns: repeat(${t}, 1fr); }
|
498
501
|
}
|
499
502
|
`).join(`
|
500
503
|
`);return e`
|
501
504
|
<style>
|
502
|
-
.${
|
505
|
+
.${o} {
|
503
506
|
display: grid;
|
504
|
-
grid-template-columns: repeat(${
|
505
|
-
gap: ${
|
507
|
+
grid-template-columns: repeat(${i}, 1fr);
|
508
|
+
gap: ${a};
|
506
509
|
}
|
507
|
-
${
|
510
|
+
${s}
|
508
511
|
</style>
|
509
|
-
<div class="${
|
510
|
-
`}function
|
512
|
+
<div class="${o}">${t(r)}</div>
|
513
|
+
`}function I(t,r){if(r===void 0)return n=>I(t,n??[e``]);let i=t?.backgroundImage?`background-image: url('${t.backgroundImage}');`:``,a=t?.height??`400px`,o=t?.overlayColor??`rgba(0, 0, 0, 0.3)`;return e`
|
511
514
|
<div
|
512
515
|
style="
|
513
516
|
position: relative;
|
@@ -544,22 +547,22 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
544
547
|
${n(r)}
|
545
548
|
</div>
|
546
549
|
</div>
|
547
|
-
`}function
|
548
|
-
@media not ${
|
550
|
+
`}function L(n,r){if(r===void 0){let t=t=>L(n,t??e``);return t.html=(t,...r)=>L(n,e(t,...r)),t}let i=n?.breakpoint??`(max-width: 600px)`,a=n?.mode??`hide`,o=n?.className??c(`Hidden::hidden-container`),s=a===`hide`?`@media ${i} { .${o} { display: none !important; } }`:`@media ${i} { .${o} { display: block !important; } }
|
551
|
+
@media not ${i} { .${o} { display: none !important; } }`;return e`
|
549
552
|
<style>
|
550
|
-
.${
|
553
|
+
.${o} {
|
551
554
|
display: block;
|
552
555
|
}
|
553
|
-
${
|
556
|
+
${s}
|
554
557
|
</style>
|
555
|
-
<div class="${
|
556
|
-
`}function
|
558
|
+
<div class="${o}">${t(r)}</div>
|
559
|
+
`}function R(t,r){let i=t?.bordered?`border: 1px solid #ddd; border-radius: 4px`:``,o=t?.striped?`li:nth-child(even) { background: #f9f9f9; }`:``,s=t?.hover?`li:hover { background: #f1f1f1; cursor: pointer; }`:``,l=t?.className??c(`ListGroup::list-group`),u=(t,n,r,i)=>r?e` <li>${t}</li> `:t,d=r=>e`
|
557
560
|
<style>
|
558
561
|
ul.${l} {
|
559
562
|
list-style: none;
|
560
563
|
margin: 0;
|
561
564
|
padding: 0;
|
562
|
-
${
|
565
|
+
${i};
|
563
566
|
}
|
564
567
|
ul.${l} li {
|
565
568
|
padding: 12px 16px;
|
@@ -568,13 +571,13 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
568
571
|
ul.${l} li:last-child {
|
569
572
|
${t?.bordered?`border-bottom: none`:``};
|
570
573
|
}
|
574
|
+
${o}
|
571
575
|
${s}
|
572
|
-
${c}
|
573
576
|
</style>
|
574
577
|
<ul class="${l}">
|
575
578
|
${n(r,u)}
|
576
579
|
</ul>
|
577
|
-
`;return a(
|
580
|
+
`;return a(r,d)}function z(t,r){if(r===void 0)return n=>z(t,n??[e``]);let i=t?.background??`rgba(0, 0, 0, 0.5)`,a=t?.zIndex??1e3,o=t?.fullScreen!==!1;return e`
|
578
581
|
<div
|
579
582
|
style="
|
580
583
|
position: ${o?`fixed`:`absolute`};
|
@@ -588,7 +591,7 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
588
591
|
>
|
589
592
|
${n(r)}
|
590
593
|
</div>
|
591
|
-
`}function
|
594
|
+
`}function B(n,r){if(r===void 0){let t=t=>B(n,t??e``);return t.html=(t,...r)=>B(n,e(t,...r)),t}let i=n?.width?`width: ${n.width};`:``,a=n?.height?`height: ${n.height};`:``,o=n?.background?`background: ${n.background};`:``;return e`
|
592
595
|
<div
|
593
596
|
style="
|
594
597
|
position: relative;
|
@@ -598,23 +601,23 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
598
601
|
>
|
599
602
|
${t(r)}
|
600
603
|
</div>
|
601
|
-
`}function
|
604
|
+
`}function V(t){let n=t?.width?`width: ${t.width};`:``,r=t?.height?`height: ${t.height};`:``;return e` <div style="${n} ${r}"></div> `}function H(t){let n=t?.type??`rect`,r=t?.width??`100%`,i=t?.height??`16px`,a=t?.borderRadius??`4px`,o=t?.animation!==!1,s=t?.className??c(`SkeletonLoader::skeleton-shimmer`),l=n===`circle`?`border-radius: 50%; width: ${r}; height: ${r}`:`border-radius: ${a}; width: ${r}; height: ${i}`;return e`
|
602
605
|
<style>
|
603
606
|
${`
|
604
|
-
@keyframes ${
|
607
|
+
@keyframes ${s+`-shimmer`} {
|
605
608
|
0% { background-color: #eee; }
|
606
609
|
50% { background-color: #ddd; }
|
607
610
|
100% { background-color: #eee; }
|
608
611
|
}
|
609
612
|
`}
|
610
|
-
.${
|
613
|
+
.${s} {
|
611
614
|
${l};
|
612
615
|
background-color: #eee;
|
613
|
-
${
|
616
|
+
${o?`animation: ${s+`-shimmer`} 1.2s infinite ease-in-out`:``};
|
614
617
|
}
|
615
618
|
</style>
|
616
|
-
<div class="${
|
617
|
-
`}function
|
619
|
+
<div class="${s}"></div>
|
620
|
+
`}function U(){return e`<div style="flex: 1 1 auto;"></div>`}function W(n,r){if(r===void 0){let t=t=>W(n,t??e``);return t.html=(t,...r)=>W(n,e(t,...r)),t}let i=n?.top?`top: ${n.top};`:``,a=n?.bottom?`bottom: ${n.bottom};`:``,o=typeof n?.zIndex==`number`?`z-index: ${n.zIndex};`:``;return e`
|
618
621
|
<div
|
619
622
|
style="
|
620
623
|
position: sticky;
|
@@ -624,35 +627,35 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
624
627
|
>
|
625
628
|
${t(r)}
|
626
629
|
</div>
|
627
|
-
`}function
|
628
|
-
.${
|
629
|
-
`:``,
|
630
|
-
.${
|
631
|
-
`:``,
|
632
|
-
.${
|
630
|
+
`}function G(n,r){if(r===void 0){let t=t=>G(n,t??e``);return t.html=(t,...r)=>G(n,e(t,...r)),t}let i=n?.className??c(`Table::table`),a=n?.striped?`
|
631
|
+
.${i} tr:nth-child(even) { background: #f9f9f9; }
|
632
|
+
`:``,o=n?.hover?`
|
633
|
+
.${i} tr:hover { background: #f1f1f1; }
|
634
|
+
`:``,s=n?.bordered?`
|
635
|
+
.${i}, .${i} th, .${i} td { border: 1px solid #ddd; }
|
633
636
|
`:``;return e`
|
634
637
|
<style>
|
635
638
|
/* 将表格包裹在带有 _className 的 div 里,使后续 CSS 作用于该 div 下的 table */
|
636
|
-
.${
|
639
|
+
.${i} table {
|
637
640
|
width: 100%;
|
638
641
|
border-collapse: collapse;
|
639
642
|
}
|
640
|
-
.${
|
641
|
-
.${
|
643
|
+
.${i} th,
|
644
|
+
.${i} td {
|
642
645
|
padding: 8px 12px;
|
643
646
|
text-align: left;
|
644
647
|
}
|
648
|
+
${a}
|
645
649
|
${o}
|
646
650
|
${s}
|
647
|
-
${c}
|
648
651
|
</style>
|
649
652
|
|
650
|
-
<div class="${
|
653
|
+
<div class="${i}">
|
651
654
|
<table>
|
652
|
-
${t(
|
655
|
+
${t(r)}
|
653
656
|
</table>
|
654
657
|
</div>
|
655
|
-
`}function
|
658
|
+
`}function K(t,r){let i=t?.direction??`row`;return r===void 0?n=>K(t,n??e``):e`
|
656
659
|
<div
|
657
660
|
style="
|
658
661
|
display: flex;
|
@@ -665,7 +668,7 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
665
668
|
>
|
666
669
|
${n(r)}
|
667
670
|
</div>
|
668
|
-
`}function
|
671
|
+
`}function q(t,r){let i=t?.width?`width: ${t.width};`:``,a=t?.height?`height: ${t.height};`:``,o=t?.background?`background: ${t.background};`:``;if(r===void 0)return n=>q(t,n??[e``]);let s=`flex-start`,c=`flex-start`;switch(t?.align){case`top-right`:s=`flex-end`,c=`flex-start`;break;case`center`:s=`center`,c=`center`;break;case`bottom-left`:s=`flex-start`,c=`flex-end`;break;case`bottom-right`:s=`flex-end`,c=`flex-end`;break;default:s=`flex-start`,c=`flex-start`}return e`
|
669
672
|
<div
|
670
673
|
style="
|
671
674
|
position: relative;
|
@@ -677,5 +680,5 @@ import{html as e}from"lit";function t(t){return t?typeof t==`function`?t():t:e``
|
|
677
680
|
>
|
678
681
|
${n(r)}
|
679
682
|
</div>
|
680
|
-
`}export{
|
683
|
+
`}export{w as AbsoluteBox,T as AcrylicBar,E as AspectRatio,D as AutoFitGrid,O as AvatarStack,k as Badge,A as Card,j as Center,u as Column,y as ColumnSplit,M as Container,N as Divider,d as Flex,f as FlowItem,P as FooterLayout,p as Grid,F as GridBreakpoint,m as GridCol,h as GridItem,g as GridRow,I as HeroSection,L as Hidden,l as LightboxContainer,R as ListGroup,z as Overlay,B as PositionContainer,_ as Row,b as RowSplit,x as ScrollBar,S as SideBarContainer,V as SizedBox,H as SkeletonLoader,U as Spacer,W as Sticky,C as Swiper,G as Table,v as WaterFlow,K as Wrap,q as ZStack};
|
681
684
|
//# sourceMappingURL=index.es.js.map
|