diff --git a/dev/404.html b/dev/404.html index b71fada6a1..46c2050cb0 100644 --- a/dev/404.html +++ b/dev/404.html @@ -11,14 +11,14 @@ - - + +
Skip to content

404

PAGE NOT FOUND

But if you don't change your direction, and if you keep looking, you may end up where you are heading.

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/assets/guide_start_index.md.DgpaxMDG.js b/dev/assets/guide_start_index.md.YZXDyR2H.js similarity index 95% rename from dev/assets/guide_start_index.md.DgpaxMDG.js rename to dev/assets/guide_start_index.md.YZXDyR2H.js index 40a6afea0c..8f625b5514 100644 --- a/dev/assets/guide_start_index.md.DgpaxMDG.js +++ b/dev/assets/guide_start_index.md.YZXDyR2H.js @@ -14,7 +14,7 @@ import{c as d,k as s,m as r,a as i,t as l,I as h,w as n,R as a,D as p,o as g,f a <a class="btn" href="/">访问 ZUI 网站</a> <script src="./zui/zui.js"></script> </body> -</html>

使用 CDN

使用 CDN 可以快速使用 ZUI,与下载使用基本一样,只需要将相关资源文件替换为 CDN 上的地址即可:

`,6),m={class:"vp-code-group vp-adaptive-theme"},B=a('
',1),b={class:"blocks"},v={class:"language-html vp-adaptive-theme active"},S=s("button",{title:"Copy Code",class:"copy"},null,-1),I=s("span",{class:"lang"},"html",-1),q={class:"shiki shiki-themes github-light github-dark vp-code"},P=a('<!doctype html>',1),z=a('<html lang="zh-CN">',1),V=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"head"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),N=a(' <meta charset="utf-8">',1),f=a(' <meta name="viewport" content="width=device-width, initial-scale=1">',1),w=a(' <title>ZUI</title>',1),R={class:"line highlighted"},U=a(' <link rel="stylesheet" href=',7),j={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},x=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">",-1),Z=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),M=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"body"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),H=a(' <h1>ZUI is awesome!</h1>',1),J=a(' <a class="btn" href="/">访问 ZUI 网站</a>',1),K={class:"line highlighted"},$=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <",-1),L=s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"script",-1),O=s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," src",-1),X=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"=",-1),Y={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},G=a(' crossorigin="anonymous"></script>',6),Q=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),W=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"")],-1),ss={class:"language-html vp-adaptive-theme"},is=s("button",{title:"Copy Code",class:"copy"},null,-1),as=s("span",{class:"lang"},"html",-1),ts={class:"shiki shiki-themes github-light github-dark vp-code"},hs=a('<!doctype html>',1),ns=a('<html lang="zh-CN">',1),ls=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"head"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),ks=a(' <meta charset="utf-8">',1),ps=a(' <meta name="viewport" content="width=device-width, initial-scale=1">',1),es=a(' <title>ZUI</title>',1),Es={class:"line highlighted"},ds=a(' <link rel="stylesheet" href=',7),rs={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},gs=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">",-1),_s=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),os=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"body"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),ys=a(' <h1>ZUI is awesome!</h1>',1),cs=a(' <a class="btn" href="/">访问 ZUI 网站</a>',1),Fs={class:"line highlighted"},us=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <",-1),Cs=s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"script",-1),As=s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," src",-1),Ts=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"=",-1),Ds={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},ms=a(' crossorigin="anonymous"></script>',6),Bs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),bs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"")],-1),vs={class:"language-html vp-adaptive-theme"},Ss=s("button",{title:"Copy Code",class:"copy"},null,-1),Is=s("span",{class:"lang"},"html",-1),qs={class:"shiki shiki-themes github-light github-dark vp-code"},Ps=a('<!doctype html>',1),zs=a('<html lang="zh-CN">',1),Vs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"head"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),Ns=a(' <meta charset="utf-8">',1),fs=a(' <meta name="viewport" content="width=device-width, initial-scale=1">',1),ws=a(' <title>ZUI</title>',1),Rs={class:"line highlighted"},Us=a(' <link rel="stylesheet" href=',7),js={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},xs=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">",-1),Zs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),Ms=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"body"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),Hs=a(' <h1>ZUI is awesome!</h1>',1),Js=a(' <a class="btn" href="/">访问 ZUI 网站</a>',1),Ks={class:"line highlighted"},$s=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <",-1),Ls=s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"script",-1),Os=s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," src",-1),Xs=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"=",-1),Ys={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},Gs=a(' crossorigin="anonymous"></script>',6),Qs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),Ws=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"")],-1),si=a(`

使用 JS 组件

无论是下载还是使用 CDN,导入 zui.js 之后,你就可以使用 ZUI 中的 JS 组件了,ZUI 提供的所有 JS 辅助方法和组件类都在全局对象 zui 上进行访问,例如:

html
<nav id="myNav"></nav>
+</html>

使用 CDN

使用 CDN 可以快速使用 ZUI,与下载使用基本一样,只需要将相关资源文件替换为 CDN 上的地址即可:

`,6),m={class:"vp-code-group vp-adaptive-theme"},B=a('
',1),b={class:"blocks"},v={class:"language-html vp-adaptive-theme active"},S=s("button",{title:"Copy Code",class:"copy"},null,-1),I=s("span",{class:"lang"},"html",-1),P={class:"shiki shiki-themes github-light github-dark vp-code"},q=a('<!doctype html>',1),z=a('<html lang="zh-CN">',1),V=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"head"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),N=a(' <meta charset="utf-8">',1),f=a(' <meta name="viewport" content="width=device-width, initial-scale=1">',1),w=a(' <title>ZUI</title>',1),R={class:"line highlighted"},U=a(' <link rel="stylesheet" href=',7),j={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},x=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">",-1),Z=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),M=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"body"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),J=a(' <h1>ZUI is awesome!</h1>',1),G=a(' <a class="btn" href="/">访问 ZUI 网站</a>',1),H={class:"line highlighted"},L=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <",-1),$=s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"script",-1),K=s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," src",-1),O=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"=",-1),Y={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},Q=a(' crossorigin="anonymous"></script>',6),W=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),X=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"")],-1),ss={class:"language-html vp-adaptive-theme"},is=s("button",{title:"Copy Code",class:"copy"},null,-1),as=s("span",{class:"lang"},"html",-1),ts={class:"shiki shiki-themes github-light github-dark vp-code"},hs=a('<!doctype html>',1),ns=a('<html lang="zh-CN">',1),ls=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"head"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),ks=a(' <meta charset="utf-8">',1),ps=a(' <meta name="viewport" content="width=device-width, initial-scale=1">',1),es=a(' <title>ZUI</title>',1),Es={class:"line highlighted"},ds=a(' <link rel="stylesheet" href=',7),rs={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},gs=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">",-1),_s=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),os=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"body"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),ys=a(' <h1>ZUI is awesome!</h1>',1),cs=a(' <a class="btn" href="/">访问 ZUI 网站</a>',1),Fs={class:"line highlighted"},us=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <",-1),Cs=s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"script",-1),As=s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," src",-1),Ts=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"=",-1),Ds={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},ms=a(' crossorigin="anonymous"></script>',6),Bs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),bs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"")],-1),vs={class:"language-html vp-adaptive-theme"},Ss=s("button",{title:"Copy Code",class:"copy"},null,-1),Is=s("span",{class:"lang"},"html",-1),Ps={class:"shiki shiki-themes github-light github-dark vp-code"},qs=a('<!doctype html>',1),zs=a('<html lang="zh-CN">',1),Vs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"head"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),Ns=a(' <meta charset="utf-8">',1),fs=a(' <meta name="viewport" content="width=device-width, initial-scale=1">',1),ws=a(' <title>ZUI</title>',1),Rs={class:"line highlighted"},Us=a(' <link rel="stylesheet" href=',7),js={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},xs=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">",-1),Zs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),Ms=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"body"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),Js=a(' <h1>ZUI is awesome!</h1>',1),Gs=a(' <a class="btn" href="/">访问 ZUI 网站</a>',1),Hs={class:"line highlighted"},Ls=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <",-1),$s=s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"script",-1),Ks=s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," src",-1),Os=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"=",-1),Ys={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},Qs=a(' crossorigin="anonymous"></script>',6),Ws=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),Xs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"")],-1),si=a(`

使用 JS 组件

无论是下载还是使用 CDN,导入 zui.js 之后,你就可以使用 ZUI 中的 JS 组件了,ZUI 提供的所有 JS 辅助方法和组件类都在全局对象 zui 上进行访问,例如:

html
<nav id="myNav"></nav>
 
 <script>
 const {Nav, Messager} = zui;
@@ -51,7 +51,7 @@ import{c as d,k as s,m as r,a as i,t as l,I as h,w as n,R as a,D as p,o as g,f a
 zui.Messager.show('Hello!');

如果你仅仅需要 ZUI 中的单个组件,例如 数据表格,你可以这样导入:

js
import {DTable} from 'zui/lib/dtable';
 import 'zui/lib/dtable/css';
 
-const myTable = new DTable('#myTable', {...});
`,8),di=JSON.parse('{"title":"快速上手","description":"","frontmatter":{},"headers":[],"relativePath":"guide/start/index.md","filePath":"guide/start/index.md","lastUpdated":null}'),ki={name:"guide/start/index.md"},ri=Object.assign(ki,{setup(pi){return(t,ei)=>{const e=p("Example"),k=p("PluginTabsTab"),E=p("PluginTabs");return g(),d("div",null,[o,y,c,s("div",F,[s("a",{class:"rounded-full btn primary size-lg",href:r(_)(`/zui-${t.zui.version}.zip`),download:""},[C,i(" 点击下载")],8,u),s("a",{class:"rounded-full btn outline size-lg",href:`https://github.com/easysoft/zui/releases/tag/v${t.zui.version}`,target:"_blank"},[T,i(" 从 GitHub 下载")],8,A)]),D,s("div",m,[B,s("div",b,[s("div",v,[S,I,s("pre",q,[s("code",null,[P,i(` +const myTable = new DTable('#myTable', {...});`,8),di=JSON.parse('{"title":"快速上手","description":"","frontmatter":{},"headers":[],"relativePath":"guide/start/index.md","filePath":"guide/start/index.md","lastUpdated":null}'),ki={name:"guide/start/index.md"},ri=Object.assign(ki,{setup(pi){return(t,ei)=>{const e=p("Example"),k=p("PluginTabsTab"),E=p("PluginTabs");return g(),d("div",null,[o,y,c,s("div",F,[s("a",{class:"rounded-full btn primary size-lg",href:r(_)(`/zui-${t.zui.version}.zip`),download:""},[C,i(" 点击下载")],8,u),s("a",{class:"rounded-full btn outline size-lg",href:`https://github.com/easysoft/zui/releases/tag/v${t.zui.version}`,target:"_blank"},[T,i(" 从 GitHub 下载")],8,A)]),D,s("div",m,[B,s("div",b,[s("div",v,[S,I,s("pre",P,[s("code",null,[q,i(` `),z,i(` `),V,i(` `),N,i(` @@ -60,11 +60,11 @@ import{c as d,k as s,m as r,a as i,t as l,I as h,w as n,R as a,D as p,o as g,f a `),s("span",R,[U,s("span",j,'"///cdn.jsdelivr.net/npm/zui/dist/'+l(t.zui.version)+'/zui.css"',1),x]),i(` `),Z,i(` `),M,i(` -`),H,i(` `),J,i(` -`),s("span",K,[$,L,O,X,s("span",Y,'"///cdn.jsdelivr.net/npm/zui/dist/'+l(t.zui.version)+'/zui.js"',1),G]),i(` -`),Q,i(` -`),W])])]),s("div",ss,[is,as,s("pre",ts,[s("code",null,[hs,i(` +`),G,i(` +`),s("span",H,[L,$,K,O,s("span",Y,'"///cdn.jsdelivr.net/npm/zui/dist/'+l(t.zui.version)+'/zui.js"',1),Q]),i(` +`),W,i(` +`),X])])]),s("div",ss,[is,as,s("pre",ts,[s("code",null,[hs,i(` `),ns,i(` `),ls,i(` `),ks,i(` @@ -77,7 +77,7 @@ import{c as d,k as s,m as r,a as i,t as l,I as h,w as n,R as a,D as p,o as g,f a `),cs,i(` `),s("span",Fs,[us,Cs,As,Ts,s("span",Ds,'"///cdn.bootcdn.net/ajax/libs/zui/'+l(t.zui.version)+'/zui.js"',1),ms]),i(` `),Bs,i(` -`),bs])])]),s("div",vs,[Ss,Is,s("pre",qs,[s("code",null,[Ps,i(` +`),bs])])]),s("div",vs,[Ss,Is,s("pre",Ps,[s("code",null,[qs,i(` `),zs,i(` `),Vs,i(` `),Ns,i(` @@ -86,8 +86,8 @@ import{c as d,k as s,m as r,a as i,t as l,I as h,w as n,R as a,D as p,o as g,f a `),s("span",Rs,[Us,s("span",js,'"///unpkg.com/zui@'+l(t.zui.version)+'/zui.css"',1),xs]),i(` `),Zs,i(` `),Ms,i(` -`),Hs,i(` `),Js,i(` -`),s("span",Ks,[$s,Ls,Os,Xs,s("span",Ys,'"///unpkg.com/zui@'+l(t.zui.version)+'/zui.js"',1),Gs]),i(` -`),Qs,i(` -`),Ws])])])])]),si,h(E,null,{default:n(()=>[h(k,{label:"示例"},{default:n(()=>[h(e,null,{default:n(()=>[ii]),_:1})]),_:1}),h(k,{label:"HTML"},{default:n(()=>[ai]),_:1})]),_:1}),ti,h(E,null,{default:n(()=>[h(k,{label:"示例"},{default:n(()=>[h(e,null,{default:n(()=>[hi]),_:1})]),_:1}),h(k,{label:"HTML"},{default:n(()=>[ni]),_:1})]),_:1}),li])}}});export{di as __pageData,ri as default}; +`),Gs,i(` +`),s("span",Hs,[Ls,$s,Ks,Os,s("span",Ys,'"///unpkg.com/zui@'+l(t.zui.version)+'/zui.js"',1),Qs]),i(` +`),Ws,i(` +`),Xs])])])])]),si,h(E,null,{default:n(()=>[h(k,{label:"示例"},{default:n(()=>[h(e,null,{default:n(()=>[ii]),_:1})]),_:1}),h(k,{label:"HTML"},{default:n(()=>[ai]),_:1})]),_:1}),ti,h(E,null,{default:n(()=>[h(k,{label:"示例"},{default:n(()=>[h(e,null,{default:n(()=>[hi]),_:1})]),_:1}),h(k,{label:"HTML"},{default:n(()=>[ni]),_:1})]),_:1}),li])}}});export{di as __pageData,ri as default}; diff --git a/dev/assets/guide_start_index.md.DgpaxMDG.lean.js b/dev/assets/guide_start_index.md.YZXDyR2H.lean.js similarity index 86% rename from dev/assets/guide_start_index.md.DgpaxMDG.lean.js rename to dev/assets/guide_start_index.md.YZXDyR2H.lean.js index 3a9577e65f..18f7cf2567 100644 --- a/dev/assets/guide_start_index.md.DgpaxMDG.lean.js +++ b/dev/assets/guide_start_index.md.YZXDyR2H.lean.js @@ -1,9 +1,9 @@ -import{c as d,k as s,m as r,a as i,t as l,I as h,w as n,R as a,D as p,o as g,f as _}from"./chunks/framework.DeE3OwZJ.js";const o=s("h1",{id:"快速上手",tabindex:"-1"},[i("快速上手 "),s("a",{class:"header-anchor",href:"#快速上手","aria-label":'Permalink to "快速上手"'},"​")],-1),y=s("h2",{id:"下载使用",tabindex:"-1"},[i("下载使用 "),s("a",{class:"header-anchor",href:"#下载使用","aria-label":'Permalink to "下载使用"'},"​")],-1),c=s("p",null,"你可以从如下地址下载 ZUI 的最新版本:",-1),F={class:"gap-4 vp-raw row"},u=["href"],C=s("i",{class:"icon icon-download-alt icon-lg"},null,-1),A=["href"],T=s("i",{class:"icon icon-github icon-lg"},null,-1),D=a("",6),m={class:"vp-code-group vp-adaptive-theme"},B=a("",1),b={class:"blocks"},v={class:"language-html vp-adaptive-theme active"},S=s("button",{title:"Copy Code",class:"copy"},null,-1),I=s("span",{class:"lang"},"html",-1),q={class:"shiki shiki-themes github-light github-dark vp-code"},P=a("",1),z=a("",1),V=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"head"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),N=a("",1),f=a("",1),w=a("",1),R={class:"line highlighted"},U=a("",7),j={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},x=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">",-1),Z=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),M=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"body"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),H=a("",1),J=a("",1),K={class:"line highlighted"},$=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <",-1),L=s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"script",-1),O=s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," src",-1),X=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"=",-1),Y={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},G=a("",6),Q=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),W=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"")],-1),ss={class:"language-html vp-adaptive-theme"},is=s("button",{title:"Copy Code",class:"copy"},null,-1),as=s("span",{class:"lang"},"html",-1),ts={class:"shiki shiki-themes github-light github-dark vp-code"},hs=a("",1),ns=a("",1),ls=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"head"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),ks=a("",1),ps=a("",1),es=a("",1),Es={class:"line highlighted"},ds=a("",7),rs={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},gs=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">",-1),_s=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),os=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"body"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),ys=a("",1),cs=a("",1),Fs={class:"line highlighted"},us=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <",-1),Cs=s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"script",-1),As=s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," src",-1),Ts=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"=",-1),Ds={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},ms=a("",6),Bs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),bs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"")],-1),vs={class:"language-html vp-adaptive-theme"},Ss=s("button",{title:"Copy Code",class:"copy"},null,-1),Is=s("span",{class:"lang"},"html",-1),qs={class:"shiki shiki-themes github-light github-dark vp-code"},Ps=a("",1),zs=a("",1),Vs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"head"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),Ns=a("",1),fs=a("",1),ws=a("",1),Rs={class:"line highlighted"},Us=a("",7),js={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},xs=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">",-1),Zs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),Ms=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"body"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),Hs=a("",1),Js=a("",1),Ks={class:"line highlighted"},$s=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <",-1),Ls=s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"script",-1),Os=s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," src",-1),Xs=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"=",-1),Ys={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},Gs=a("",6),Qs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),Ws=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"")],-1),si=a("",8),ii=s("div",{"zui-create":"datePicker"},null,-1),ai=s("div",{class:"language-html vp-adaptive-theme"},[s("button",{title:"Copy Code",class:"copy"}),s("span",{class:"lang"},"html"),s("pre",{class:"shiki shiki-themes github-light github-dark vp-code"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"<"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"div"),s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," zui-create"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"="),s("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"datePicker"'),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")])])])],-1),ti=s("p",null,[i("使用 "),s("code",null,"zui-create-"),i(" 来定义组件选项,例如:")],-1),hi=s("div",{"zui-create":"","zui-create-list":"{items: [{text: 'item1'}, {text: 'item2'}], onClickItem: (e) => console.log('You clicked', e)}"},null,-1),ni=s("div",{class:"language-html vp-adaptive-theme"},[s("button",{title:"Copy Code",class:"copy"}),s("span",{class:"lang"},"html"),s("pre",{class:"shiki shiki-themes github-light github-dark vp-code"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"<"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"div"),s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," zui-create"),s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," zui-create-list"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"="),s("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"')]),i(` +import{c as d,k as s,m as r,a as i,t as l,I as h,w as n,R as a,D as p,o as g,f as _}from"./chunks/framework.DeE3OwZJ.js";const o=s("h1",{id:"快速上手",tabindex:"-1"},[i("快速上手 "),s("a",{class:"header-anchor",href:"#快速上手","aria-label":'Permalink to "快速上手"'},"​")],-1),y=s("h2",{id:"下载使用",tabindex:"-1"},[i("下载使用 "),s("a",{class:"header-anchor",href:"#下载使用","aria-label":'Permalink to "下载使用"'},"​")],-1),c=s("p",null,"你可以从如下地址下载 ZUI 的最新版本:",-1),F={class:"gap-4 vp-raw row"},u=["href"],C=s("i",{class:"icon icon-download-alt icon-lg"},null,-1),A=["href"],T=s("i",{class:"icon icon-github icon-lg"},null,-1),D=a("",6),m={class:"vp-code-group vp-adaptive-theme"},B=a("",1),b={class:"blocks"},v={class:"language-html vp-adaptive-theme active"},S=s("button",{title:"Copy Code",class:"copy"},null,-1),I=s("span",{class:"lang"},"html",-1),P={class:"shiki shiki-themes github-light github-dark vp-code"},q=a("",1),z=a("",1),V=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"head"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),N=a("",1),f=a("",1),w=a("",1),R={class:"line highlighted"},U=a("",7),j={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},x=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">",-1),Z=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),M=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"body"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),J=a("",1),G=a("",1),H={class:"line highlighted"},L=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <",-1),$=s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"script",-1),K=s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," src",-1),O=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"=",-1),Y={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},Q=a("",6),W=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),X=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"")],-1),ss={class:"language-html vp-adaptive-theme"},is=s("button",{title:"Copy Code",class:"copy"},null,-1),as=s("span",{class:"lang"},"html",-1),ts={class:"shiki shiki-themes github-light github-dark vp-code"},hs=a("",1),ns=a("",1),ls=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"head"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),ks=a("",1),ps=a("",1),es=a("",1),Es={class:"line highlighted"},ds=a("",7),rs={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},gs=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">",-1),_s=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),os=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"body"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),ys=a("",1),cs=a("",1),Fs={class:"line highlighted"},us=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <",-1),Cs=s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"script",-1),As=s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," src",-1),Ts=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"=",-1),Ds={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},ms=a("",6),Bs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),bs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"")],-1),vs={class:"language-html vp-adaptive-theme"},Ss=s("button",{title:"Copy Code",class:"copy"},null,-1),Is=s("span",{class:"lang"},"html",-1),Ps={class:"shiki shiki-themes github-light github-dark vp-code"},qs=a("",1),zs=a("",1),Vs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"head"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),Ns=a("",1),fs=a("",1),ws=a("",1),Rs={class:"line highlighted"},Us=a("",7),js={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},xs=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">",-1),Zs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),Ms=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"body"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")],-1),Js=a("",1),Gs=a("",1),Hs={class:"line highlighted"},Ls=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <",-1),$s=s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"script",-1),Ks=s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," src",-1),Os=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"=",-1),Ys={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},Qs=a("",6),Ws=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," ")],-1),Xs=s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"")],-1),si=a("",8),ii=s("div",{"zui-create":"datePicker"},null,-1),ai=s("div",{class:"language-html vp-adaptive-theme"},[s("button",{title:"Copy Code",class:"copy"}),s("span",{class:"lang"},"html"),s("pre",{class:"shiki shiki-themes github-light github-dark vp-code"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"<"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"div"),s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," zui-create"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"="),s("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"datePicker"'),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")])])])],-1),ti=s("p",null,[i("使用 "),s("code",null,"zui-create-"),i(" 来定义组件选项,例如:")],-1),hi=s("div",{"zui-create":"","zui-create-list":"{items: [{text: 'item1'}, {text: 'item2'}], onClickItem: (e) => console.log('You clicked', e)}"},null,-1),ni=s("div",{class:"language-html vp-adaptive-theme"},[s("button",{title:"Copy Code",class:"copy"}),s("span",{class:"lang"},"html"),s("pre",{class:"shiki shiki-themes github-light github-dark vp-code"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"<"),s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"div"),s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," zui-create"),s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," zui-create-list"),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"="),s("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"')]),i(` `),s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," {")]),i(` `),s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," items: [{text: 'item1'}, {text: 'item2'}],")]),i(` `),s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," onClickItem: (e) => console.log('You clicked', e)")]),i(` `),s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}}," }")]),i(` -`),s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"'),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")])])])],-1),li=a("",8),di=JSON.parse('{"title":"快速上手","description":"","frontmatter":{},"headers":[],"relativePath":"guide/start/index.md","filePath":"guide/start/index.md","lastUpdated":null}'),ki={name:"guide/start/index.md"},ri=Object.assign(ki,{setup(pi){return(t,ei)=>{const e=p("Example"),k=p("PluginTabsTab"),E=p("PluginTabs");return g(),d("div",null,[o,y,c,s("div",F,[s("a",{class:"rounded-full btn primary size-lg",href:r(_)(`/zui-${t.zui.version}.zip`),download:""},[C,i(" 点击下载")],8,u),s("a",{class:"rounded-full btn outline size-lg",href:`https://github.com/easysoft/zui/releases/tag/v${t.zui.version}`,target:"_blank"},[T,i(" 从 GitHub 下载")],8,A)]),D,s("div",m,[B,s("div",b,[s("div",v,[S,I,s("pre",q,[s("code",null,[P,i(` +`),s("span",{class:"line"},[s("span",{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},'"'),s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},">")])])])],-1),li=a("",8),di=JSON.parse('{"title":"快速上手","description":"","frontmatter":{},"headers":[],"relativePath":"guide/start/index.md","filePath":"guide/start/index.md","lastUpdated":null}'),ki={name:"guide/start/index.md"},ri=Object.assign(ki,{setup(pi){return(t,ei)=>{const e=p("Example"),k=p("PluginTabsTab"),E=p("PluginTabs");return g(),d("div",null,[o,y,c,s("div",F,[s("a",{class:"rounded-full btn primary size-lg",href:r(_)(`/zui-${t.zui.version}.zip`),download:""},[C,i(" 点击下载")],8,u),s("a",{class:"rounded-full btn outline size-lg",href:`https://github.com/easysoft/zui/releases/tag/v${t.zui.version}`,target:"_blank"},[T,i(" 从 GitHub 下载")],8,A)]),D,s("div",m,[B,s("div",b,[s("div",v,[S,I,s("pre",P,[s("code",null,[q,i(` `),z,i(` `),V,i(` `),N,i(` @@ -12,11 +12,11 @@ import{c as d,k as s,m as r,a as i,t as l,I as h,w as n,R as a,D as p,o as g,f a `),s("span",R,[U,s("span",j,'"///cdn.jsdelivr.net/npm/zui/dist/'+l(t.zui.version)+'/zui.css"',1),x]),i(` `),Z,i(` `),M,i(` -`),H,i(` `),J,i(` -`),s("span",K,[$,L,O,X,s("span",Y,'"///cdn.jsdelivr.net/npm/zui/dist/'+l(t.zui.version)+'/zui.js"',1),G]),i(` -`),Q,i(` -`),W])])]),s("div",ss,[is,as,s("pre",ts,[s("code",null,[hs,i(` +`),G,i(` +`),s("span",H,[L,$,K,O,s("span",Y,'"///cdn.jsdelivr.net/npm/zui/dist/'+l(t.zui.version)+'/zui.js"',1),Q]),i(` +`),W,i(` +`),X])])]),s("div",ss,[is,as,s("pre",ts,[s("code",null,[hs,i(` `),ns,i(` `),ls,i(` `),ks,i(` @@ -29,7 +29,7 @@ import{c as d,k as s,m as r,a as i,t as l,I as h,w as n,R as a,D as p,o as g,f a `),cs,i(` `),s("span",Fs,[us,Cs,As,Ts,s("span",Ds,'"///cdn.bootcdn.net/ajax/libs/zui/'+l(t.zui.version)+'/zui.js"',1),ms]),i(` `),Bs,i(` -`),bs])])]),s("div",vs,[Ss,Is,s("pre",qs,[s("code",null,[Ps,i(` +`),bs])])]),s("div",vs,[Ss,Is,s("pre",Ps,[s("code",null,[qs,i(` `),zs,i(` `),Vs,i(` `),Ns,i(` @@ -38,8 +38,8 @@ import{c as d,k as s,m as r,a as i,t as l,I as h,w as n,R as a,D as p,o as g,f a `),s("span",Rs,[Us,s("span",js,'"///unpkg.com/zui@'+l(t.zui.version)+'/zui.css"',1),xs]),i(` `),Zs,i(` `),Ms,i(` -`),Hs,i(` `),Js,i(` -`),s("span",Ks,[$s,Ls,Os,Xs,s("span",Ys,'"///unpkg.com/zui@'+l(t.zui.version)+'/zui.js"',1),Gs]),i(` -`),Qs,i(` -`),Ws])])])])]),si,h(E,null,{default:n(()=>[h(k,{label:"示例"},{default:n(()=>[h(e,null,{default:n(()=>[ii]),_:1})]),_:1}),h(k,{label:"HTML"},{default:n(()=>[ai]),_:1})]),_:1}),ti,h(E,null,{default:n(()=>[h(k,{label:"示例"},{default:n(()=>[h(e,null,{default:n(()=>[hi]),_:1})]),_:1}),h(k,{label:"HTML"},{default:n(()=>[ni]),_:1})]),_:1}),li])}}});export{di as __pageData,ri as default}; +`),Gs,i(` +`),s("span",Hs,[Ls,$s,Ks,Os,s("span",Ys,'"///unpkg.com/zui@'+l(t.zui.version)+'/zui.js"',1),Qs]),i(` +`),Ws,i(` +`),Xs])])])])]),si,h(E,null,{default:n(()=>[h(k,{label:"示例"},{default:n(()=>[h(e,null,{default:n(()=>[ii]),_:1})]),_:1}),h(k,{label:"HTML"},{default:n(()=>[ai]),_:1})]),_:1}),ti,h(E,null,{default:n(()=>[h(k,{label:"示例"},{default:n(()=>[h(e,null,{default:n(()=>[hi]),_:1})]),_:1}),h(k,{label:"HTML"},{default:n(()=>[ni]),_:1})]),_:1}),li])}}});export{di as __pageData,ri as default}; diff --git a/dev/guide/config/base/color.html b/dev/guide/config/base/color.html index 39d5e72a93..9e8fe521a9 100644 --- a/dev/guide/config/base/color.html +++ b/dev/guide/config/base/color.html @@ -14,8 +14,8 @@ - - + + @@ -49,7 +49,7 @@ --color-primary-900-rgb: 88, 34, 133; --color-primary-950-rgb: 59, 14, 99; }

提示

在定义 CSS 变量覆盖调色板时,除了定义 50~950 的十六进制颜色外,还需要定义对应的 RGB 颜色,这是为了在一些特殊场景下通过改变透明度来实现颜色的变化。

注意

如果你需要自定义配色,建议只通过修改调色板来实现,不建议修改界面颜色,除非主题需要实现对比度更明显的风格,任何时候都不应该修改特殊颜色的定义。

更多关于主题的内容参考 主题 文档。

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/guide/config/base/font.html b/dev/guide/config/base/font.html index 4a81a1e42f..8f578e303c 100644 --- a/dev/guide/config/base/font.html +++ b/dev/guide/config/base/font.html @@ -14,8 +14,8 @@ - - + + @@ -44,7 +44,7 @@ 月光如流水一般,静静地泻在这一片叶子和花上。薄薄的青雾浮起在荷塘里。叶子和花仿佛在牛乳中洗过一样;又像笼着轻纱的梦。
leading-relaxed
.leading-relaxed
宽松
line-height: line-height
So I started to walk into the water. I won't lie to you boys, I was terrified. But I pressed on, and as I made my way past the breakers a strange calm came over me. I don't know if it was divine intervention or the kinship of all living things but I tell you Jerry at that moment, I was a marine biologist.
 月光如流水一般,静静地泻在这一片叶子和花上。薄薄的青雾浮起在荷塘里。叶子和花仿佛在牛乳中洗过一样;又像笼着轻纱的梦。
leading-loose
.leading-loose
松散
line-height: line-height
So I started to walk into the water. I won't lie to you boys, I was terrified. But I pressed on, and as I made my way past the breakers a strange calm came over me. I don't know if it was divine intervention or the kinship of all living things but I tell you Jerry at that moment, I was a marine biologist.
 月光如流水一般,静静地泻在这一片叶子和花上。薄薄的青雾浮起在荷塘里。叶子和花仿佛在牛乳中洗过一样;又像笼着轻纱的梦。

在 ZUI 中可以通过 CSS 工具类来设置行高,详细用法参加 CSS 工具类 / 排版 / 行高 文档。

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/guide/config/base/rounded.html b/dev/guide/config/base/rounded.html index c1875bb212..b646b6a28d 100644 --- a/dev/guide/config/base/rounded.html +++ b/dev/guide/config/base/rounded.html @@ -14,8 +14,8 @@ - - + + @@ -31,7 +31,7 @@ --radius-3xl: 1.5rem; --radius-full: 9999px; }

自定义主题

可以通过定制主题来修改圆角设置,具体参见 主题 文档。

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/guide/config/base/screens.html b/dev/guide/config/base/screens.html index 916540f86e..c23061ce78 100644 --- a/dev/guide/config/base/screens.html +++ b/dev/guide/config/base/screens.html @@ -14,8 +14,8 @@ - - + + @@ -54,7 +54,7 @@ --screen-xl: 1280px; --screen-2xl: 1536px; }

自定义主题

可以通过定制主题来修改屏幕断点设置,具体参见 主题 文档。

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/guide/config/base/shadow.html b/dev/guide/config/base/shadow.html index fabc8a4f26..f2f3f8fcc0 100644 --- a/dev/guide/config/base/shadow.html +++ b/dev/guide/config/base/shadow.html @@ -14,8 +14,8 @@ - - + + @@ -30,7 +30,7 @@ --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05); --shadow-none: none; }

自定义主题

可以通过定制主题来修改阴影设置,具体参见 主题 文档。

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/guide/config/base/spacing.html b/dev/guide/config/base/spacing.html index d679037770..1f13294671 100644 --- a/dev/guide/config/base/spacing.html +++ b/dev/guide/config/base/spacing.html @@ -14,14 +14,14 @@ - - + +
Skip to content

间距

间距配置

为了方便实现风格一致的交互界面,ZUI 预置了间距设置。下面为默认的间距配置:

名称
实际值
预览
0
width
px
width
0.5
width
1
width
1.5
width
2
width
2.5
width
3
width
3.5
width
4
width
5
width
6
width
7
width
8
width
9
width
10
width
11
width
12
width
14
width
16
width
20
width
24
width
28
width
32
width
36
width
40
width
44
width
48
width
52
width
56
width
60
width
64
width
72
width
80
width
96
width

4px 约定

通过上表可以看到,除了 0px 比较特殊的设置,其他间距实际值都是 4px 的倍数,这是有意设计,无论是设计还是开发都应该将间距为 4px 的倍数作为约定,这样更有利于实现风格一致的交互界面。

当以上间距无法满足要求时,如果需要引入新的间距值也应当遵从 4px 约定。

间距会影响所有相关 CSS 属性配置,包括 paddingmarginwidthheightmaxHeightgapinset 等。

使用间距

在 ZUI 中提供了大量 CSS 工具类,可以非常方便的来应用间距配置,包括:

如需了解,请参考对应的文档。

自定义间距

可以通过定制主题来修改间距设置,具体参见 主题 文档。

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/guide/customize/build.html b/dev/guide/customize/build.html index bff3c64247..d82167a4a3 100644 --- a/dev/guide/customize/build.html +++ b/dev/guide/customize/build.html @@ -14,14 +14,14 @@ - - + +
Skip to content

打包

打包组件库

执行如下命令进行打包操作:

sh
pnpm build

该命令提供了一些参数用户个性化打包,例如打包命令后可以直接指定需要打包的组件库,通过 --name 来指定打包生成的文件名:

sh
pnpm build -- utilities dtable --name=zui-table

打包文档

执行如下命令进行打包文档网站:

sh
pnpm docs:build

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/guide/customize/dev.html b/dev/guide/customize/dev.html index 15ba271a70..ca9fea0b9a 100644 --- a/dev/guide/customize/dev.html +++ b/dev/guide/customize/dev.html @@ -14,14 +14,14 @@ - - + +
Skip to content

开发

开发服务

执行如下命令启动开发服务:

shell
$ pnpm dev

开发服务器启动后,默认情况下可以通过网址:http://localhost:5173/ 来访问开发服务页面。通过页面上的组件导航,可以访问对应的组件开发页面。也可以将组件名附加到网址后面,直接访问对应的组件页面,例如 http://localhost:5173/button/

在开发服务页面上支持热更新,当开发文件变更后会自动反馈到开发服务页面上。

对组件进行开发调试

组件开发目录

ZUI3 每个组件在一个独立的目录内,拥有自己的 package.json 文件,使得组件可以独立作为 npm 包来使用,也可以单独作为子项目进行开发维护。

提示

通常组件通过在 package.json 文件中设置属性 private: true 来让包仅在 zui3 工作空间内可用,但组件仍然拥有作为公开的包发布到 npm 上进行独立使用。

文档开发服务

启动 ZUI 文档网站开发服务执行如下命令:

shell
$ pnpm docs:dev

此命令会先打包 ZUI 并启动文档开发服务器,默认情况下可以通过网址:http://localhost:5174/ 来访问文档开发服务页面。在文档开发服务启动时,修改文档源文件,会自动更新文档页面。

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/guide/customize/exts-lib.html b/dev/guide/customize/exts-lib.html index 385a4674e8..a0e09ec4ab 100644 --- a/dev/guide/customize/exts-lib.html +++ b/dev/guide/customize/exts-lib.html @@ -14,8 +14,8 @@ - - + + @@ -23,7 +23,7 @@
Skip to content

组件库扩展

ZUI3 组件库内置了大量组件,并支持集中开发、调试和打包,其中打包还支持只选择指定的组件进行个性化定制,同步输出组件库文档。但当需求扩展到组件库之外时,就需要用到扩展组件库了。ZUI3 支持扩展组件库模式,可以从其他位置引入一个或多个组件库目录,享受集中开发、调试和打包。下面介绍扩展组件库的使用方法。

定义扩展库

扩展组件库可以来自本地系统的任意位置,只需要提供一个路径,例如:

txt
/Users/TaiJi/Projects/zui3_exts/lib/

扩展组件库的目录结构与 ZUI3 /lib/ 下的目录结构一致,下面的每个子目录为一个独立的组件,详细定义参考 开发文档

添加扩展库

zui3 项目根目录执行:

shell
$ pnpm extend-lib -- <ext_lib_path> <lib_name>

其中参数 ext_lib_path 为扩展组件库路径,<lib_name> 为扩展组件库名称。例如:

shell
$ pnpm extend-lib -- /Users/TaiJi/Projects/zui3_exts/lib/ zentao

执行上述命令之后,会将组件库目录文件拷贝到 zui3/lib_name 目录下,同时会在 zui3/exts/libs.json 文件中记录此扩展库的名称和路径。

json
{
     "zentao": "/Users/TaiJi/Projects/zui3_exts/lib/*"
 }

实际上,你也可以通过自己编辑这个文件来添加扩展库。

启动开发服务

要在开发模式中包含对扩展组件库的开发调试,只需要执行如下命令代替 pnpm dev 命令即可:

shell
$ pnpm dev:exts

当添加了多个扩展库时,上述命令会包含所有扩展库,有时只需要包含特定的扩展库,只需要自定义 --lib 参数即可:

shell
$ pnpm dev:exts --lib=zui,zentao

启动文档服务器

要在文档网站服务模式中包含对扩展组件库的文档支持,只需要如下命令代替 pnpm docs:dev 命令即可:

shell
$ pnpm docs:dev:exts

打包

打包时如果需要将扩展库中的组件也进行打包,则需要添加 --exts 参数,然后就可以在需要打包的组件清单中指定扩展库中的组件名称:

shell
$ pnpm build -- label @zentao/status-label --exts

如果不指定名称,则默认打包仍然只打包内置组件库的组件,例如下面的命令仍然相当于 pnpm build

shell
$ pnpm build -- --exts

如果需要将所有内置组件库和扩展库中的所有组件一并打包,可以使用如下命令:

shell
$ pnpm build -- zui+exts --exts --name=zentao

当添加了多个扩展库时,上述命令会包含所有扩展库,有时只需要包含特定的扩展库,只需要自定义 --exts 参数即可:

shell
$ pnpm build -- zui+exts --exts=zui,zentao

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/guide/index.html b/dev/guide/index.html index a5cd81ed16..049bbc7cf9 100644 --- a/dev/guide/index.html +++ b/dev/guide/index.html @@ -14,14 +14,14 @@ - - + +
Skip to content

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/guide/start/compatibility.html b/dev/guide/start/compatibility.html index 6053015725..8de40d7828 100644 --- a/dev/guide/start/compatibility.html +++ b/dev/guide/start/compatibility.html @@ -14,14 +14,14 @@ - - + +
Skip to content

兼容性

支持的浏览器

  • Chrome:84+
  • Firefox:63+
  • Safari:14.1+
  • Edge:84+
  • Chrome for Android:126+
  • iOS Safari:14.5+

用到的第三方库

在 ZUI 3 中使用了一些精心挑选的第三方库,这些库通常足够小巧但实用:

  • preact - 基于 Preact 实现了大部分 JS 组件,通过封装支持原生调用
  • cash-dom - 提供了大量辅助方法方便操作 DOM,同时提供了对 jQuery 的兼容实用方式
  • floating UI - 实现浮动交互定位,例如下拉菜单、工具提示等
  • tinykeys - 实现快捷键功能

技术栈

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/guide/start/index.html b/dev/guide/start/index.html index 60448d6adb..ed962845b5 100644 --- a/dev/guide/start/index.html +++ b/dev/guide/start/index.html @@ -12,10 +12,10 @@ - + - - + + @@ -36,7 +36,7 @@ <a class="btn" href="/">访问 ZUI 网站</a> <script src="./zui/zui.js"></script> </body> -</html>

使用 CDN

使用 CDN 可以快速使用 ZUI,与下载使用基本一样,只需要将相关资源文件替换为 CDN 上的地址即可:

html
<!doctype html>
+</html>

使用 CDN

使用 CDN 可以快速使用 ZUI,与下载使用基本一样,只需要将相关资源文件替换为 CDN 上的地址即可:

html
<!doctype html>
 <html lang="zh-CN">
   <head>
     <meta charset="utf-8">
@@ -108,7 +108,7 @@
 import 'zui/lib/dtable/css';
 
 const myTable = new DTable('#myTable', {...});

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/guide/start/intro.html b/dev/guide/start/intro.html index 3714b4fec2..9c5dc19f3e 100644 --- a/dev/guide/start/intro.html +++ b/dev/guide/start/intro.html @@ -14,14 +14,14 @@ - - + +
Skip to content

介绍

ZUI 3 是一个的开源 UI 组件库,提供了大量实用组件,支持最大限度的定制,不依赖任何其他 JS 框架,可以在任何 Web 应用中通过原生的方式使用。

功能特性

  • 📡 统一的 UI 配置:基于 CSS 变量实现的全局 UI 配置,为组件提供了统一的风格基础,支持深色模式,方便定制主题;
  • 👔 丰富的 CSS 工具类:基于 Tailwind CSS 提供了丰富的 CSS 工具类,包括特别的语义化外观工具类,轻松实现常见布局、文字排版、动画、外观定义;
  • ⭐️ 实用的 CSS 组件:提供了大量实用的 CSS 组件,无需借助 JS 即可实现界面基本功能,例如按钮、表单、导航、卡片、表格等;
  • 💎 强大的 JS 组件:通过 JS 实现很多功能强大的组件,包括下拉菜单、工具提示、对话框、数据表格、文件上传等;
  • 📦 使用灵活:不依赖具体的框架,所有 CSS 工具类开箱即用,所有 JS 组件支持原生调用,丰富的引入方式,支持通过 ESM 导入,或者直接在浏览器中引用整个 JS 和 CSS,支持打包定制自己的组合版本。

与 ZUI1 的区别

相比较 ZUI 1,ZUI 3 是一个全新的更加现代的 UI 组件库,主要有如下区别:

区别ZUI 1ZUI 3
外部依赖jQuery
内部依赖Bootstrap 3
网格布局实现floatFlex
工具类部分样式、布局、排版工具类丰富的样式、布局、排版、交互效果工具类
主题定制CSS 覆盖CSS 变量
CSS 组件大部分由 Bootstrap 提供全新的 CSS 组件,更方便定制外观
JS 组件基于 jQuery 实现基于 Preact 实现,功能更强大

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/guide/start/tutorial.html b/dev/guide/start/tutorial.html index 22b5ee973f..1c41b4bcd3 100644 --- a/dev/guide/start/tutorial.html +++ b/dev/guide/start/tutorial.html @@ -14,8 +14,8 @@ - - + + @@ -238,7 +238,7 @@ /* Extend StepsEditor to zui object. */ $.extend(zui, {StepsEditor});

开发定制入门

参考打包开发扩展文档。

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/hashmap.json b/dev/hashmap.json index 4fabcf01ac..94fc76b768 100644 --- a/dev/hashmap.json +++ b/dev/hashmap.json @@ -1 +1 @@ -{"guide_config_base_spacing.md":"B653NiFv","guide_customize_dev.md":"BHKWgm2m","guide_customize_exts-lib.md":"BKuxQGR7","guide_config_base_shadow.md":"BNzZgBvC","guide_index.md":"t3LZT4QY","lib_components_menu_js.md":"CtCBsfaZ","guide_start_compatibility.md":"CltyrLny","lib_basic_core_cash.md":"Bzo_CH3I","lib_components_alert_index.md":"Bep50ZBz","lib_components_dropdown_index.md":"DbbvFq7u","lib_components_file-selector_index.md":"DvywDJ4t","lib_components_nav_index.md":"LeXRijcV","lib_components_kanban_index.md":"BFBze8B1","lib_components_nav_js.md":"OePgMXXa","lib_components_dtable_plugins.md":"CrBZnIMk","lib_basic_core_css-component.md":"BwdGvlia","guide_config_base_color.md":"B_i0YNBV","lib_components_label_index.md":"q76w0qb_","lib_components_menu_index.md":"GncmWrZR","lib_components_dashboard_index.md":"DRaM25zK","lib_basic_core_zui-toggle.md":"D_sPxQQs","guide_start_index.md":"DgpaxMDG","lib_components_contextmenu_index.md":"DmEkUwKC","guide_start_intro.md":"DEIJsFre","lib_components_avatar_index.md":"7j-ew9BZ","lib_basic_core_zui-create.md":"DLe7A4Hj","lib_basic_core_zui-on.md":"IjDbHIdO","lib_components_avatar-group_index.md":"BqwB9RZP","lib_components_messager_index.md":"BW-SbOyW","utilities_flex_utilities_shrink.md":"CangfHwT","utilities_flex_utilities_gap.md":"DArM8pom","lib_components_dtable_index.md":"BffsFMb4","utilities_flex_utilities_order.md":"CfeTP7tL","utilities_index.md":"CTpyUmIw","utilities_interactivity_utilities_cursor.md":"DvV2lotG","lib_components_modal_index.md":"CgbVseyc","utilities_interactivity_utilities_disabled.md":"CEB7Waub","utilities_flex_utilities_wrap.md":"DZ1moX26","utilities_interactivity_utilities_pointer-events.md":"EHN_kBvp","guide_config_base_rounded.md":"-jZtXV-b","utilities_interactivity_utilities_scroll.md":"-0JODEPX","lib_components_scrollbar_index.md":"BjI3vUqu","utilities_interactivity_utilities_loading.md":"Da_3FM-1","lib_components_pager_index.md":"D-bROEeS","lib_components_table_index.md":"Ck9c8Ek4","lib_components_toolbar_js.md":"ih1Bb-Rr","lib_components_toolbar_index.md":"DvojQFd3","lib_components_tooltip_index.md":"Co1ECN3g","lib_components_tabs_index.md":"D-2YSS_0","lib_components_tree_index.md":"Dn03SufJ","lib_components_upload-imgs_index.md":"erXa6IN9","lib_forms_checkbox_switch.md":"QH8sYaT3","lib_components_upload_index.md":"CzVklHlh","lib_forms_datetime-picker_datetime.md":"CPkUUpoa","lib_forms_datetime-picker_date.md":"D59eL2rp","lib_forms_checkbox_index.md":"D_VspyHI","lib_helpers_store_index.md":"Bb0Q5VMq","lib_forms_input-control_index.md":"Cv0HAFHI","lib_forms_picker_index.md":"DRGaAh8C","lib_forms_input-group_index.md":"BMbSYMAL","lib_forms_datetime-picker_time.md":"BTTIPCd8","lib_index.md":"Ci-MFpvh","lib_forms_form-control_index.md":"BiHmr69s","themes_index.md":"BufleTaf","utilities_backgrounds_utilities_index.md":"83vrBdjK","utilities_borders_utilities_divider.md":"khTQtOjv","lib_helpers_helpers_date-helper.md":"8AhG85Op","utilities_effects_utilities_filter.md":"BECjG4KT","lib_helpers_helpers_string-helper.md":"me2jtoF5","utilities_effects_utilities_shadow.md":"CaSFSOMl","public_zui_icons_fontawesome-license.md":"gfk3cURr","utilities_effects_utilities_transform.md":"DOI7WnD2","utilities_borders_utilities_ring-color.md":"s0nb0vey","utilities_flex_utilities_align-content.md":"BXGtlw9g","utilities_borders_utilities_border-radius.md":"Dh1Nfe3A","utilities_borders_utilities_border-color.md":"YFsIdVzo","lib_components_progress-circle_index.md":"B0UUIqGM","utilities_borders_utilities_border-width.md":"DVKauZHZ","utilities_flex_utilities_align-self.md":"FvSQ-0Fm","utilities_interactivity_utilities_state.md":"0ZTXUBo7","utilities_borders_utilities_ring-width.md":"DzwqJDAb","utilities_borders_utilities_ring-offset.md":"DVb4azgP","utilities_spacing_utilities_margin.md":"C9jBOzP9","lib_components_modal_trigger.md":"BMBZZybJ","utilities_flex_utilities_align-items.md":"CoFxBC8U","utilities_layout_utilities_container.md":"Bb3Lxa_7","lib_forms_form_index.md":"sRq2u4jF","utilities_effects_utilities_opacity.md":"BcIL05hy","utilities_effects_utilities_animation.md":"B91izYvM","utilities_flex_utilities_direction.md":"ByjEgbMo","utilities_effects_utilities_transition.md":"SqXrre1m","utilities_layout_utilities_top-right-bottom-left.md":"C3lYdIa5","utilities_layout_utilities_visibility.md":"CKuADuoh","utilities_sizing_utilities_width.md":"DNXQWQFd","utilities_layout_utilities_z-index.md":"DKY1uWyd","utilities_layout_utilities_display.md":"DcXW9WtS","utilities_layout_utilities_object-fit.md":"D4YmLxEC","utilities_typography_utilities_text-color.md":"D1fjRsa-","utilities_skin_utilities_pale.md":"D1L1NRKs","utilities_skin_utilities_outline.md":"bsC71Qhi","utilities_typography_utilities_text-align.md":"CtJ4rtrI","guide_config_base_font.md":"Ba4TxUmX","utilities_typography_utilities_list-style.md":"LuK8VgZf","utilities_layout_utilities_overflow.md":"DVHk2FQA","lib_basic_core_react.md":"BTwYD_hf","guide_customize_build.md":"BnMDMPqz","utilities_interactivity_utilities_user-select.md":"BrNPbIfK","lib_components_color-picker_index.md":"TddEDwtA","utilities_typography_utilities_leading.md":"DOlxRw-6","utilities_typography_utilities_font-weight.md":"CV3nf15_","utilities_flex_utilities_basis.md":"CD8bfBkC","utilities_skin_utilities_ghost.md":"DIt2ElJv","index.md":"0I4m7CHi","guide_config_base_screens.md":"CXV8MRfe","lib_components_btn-group_index.md":"5V7X7r4P","lib_components_pager_js.md":"DDMQ9lXw","utilities_layout_utilities_aspect-ratio.md":"_oWsoIYV","guide_start_tutorial.md":"CmfMgriO","lib_components_panel_index.md":"CoS14bNk","utilities_typography_utilities_text-decoration.md":"BvY6hqYi","utilities_layout_utilities_position.md":"rEqgc51a","utilities_typography_utilities_font-family.md":"BHWBVXg4","lib_basic_core_component.md":"uPNn0zXQ","utilities_flex_utilities_justify-content.md":"D4BVZfVC","utilities_typography_utilities_line-clamp.md":"CvO9OG4z","utilities_typography_utilities_word-break.md":"BxSlEVBy","lib_components_button_index.md":"B_1XMQuI","utilities_typography_utilities_vertical-align.md":"DiLQT3Ni","utilities_skin_utilities_solid.md":"Cst9ctTO","utilities_flex_utilities_grow.md":"Cn0nOehN","lib_components_progress_index.md":"CEtektTK","utilities_spacing_utilities_space.md":"xgZHI4vS","utilities_spacing_utilities_padding.md":"DuVwhAAe","utilities_skin_utilities_surface.md":"CN20jMqq","utilities_sizing_utilities_height.md":"CdF7aUuw","lib_components_breadcrumb_index.md":"9pymY2C8","utilities_flex_utilities_flex.md":"BlvjgLjv","utilities_typography_utilities_text-overflow.md":"CCaD8PoB","lib_components_search-box_index.md":"C6d4tMjv","utilities_typography_utilities_text-transform.md":"CM7k043G","utilities_typography_utilities_whitespace.md":"BFKZWjDW","utilities_typography_utilities_font-size.md":"B3W8gyR3","utilities_layout_utilities_floats.md":"pUvtfQiw"} +{"guide_config_base_color.md":"B_i0YNBV","lib_basic_core_react.md":"BTwYD_hf","lib_basic_core_zui-on.md":"IjDbHIdO","guide_index.md":"t3LZT4QY","guide_start_compatibility.md":"CltyrLny","lib_basic_core_zui-create.md":"DLe7A4Hj","guide_config_base_font.md":"Ba4TxUmX","guide_config_base_screens.md":"CXV8MRfe","guide_customize_dev.md":"BHKWgm2m","lib_components_avatar-group_index.md":"BqwB9RZP","lib_basic_core_css-component.md":"BwdGvlia","lib_components_alert_index.md":"Bep50ZBz","lib_components_tabs_index.md":"D-2YSS_0","guide_start_index.md":"YZXDyR2H","lib_basic_core_zui-toggle.md":"D_sPxQQs","lib_components_nav_js.md":"OePgMXXa","guide_customize_build.md":"BnMDMPqz","lib_components_pager_js.md":"DDMQ9lXw","guide_config_base_rounded.md":"-jZtXV-b","guide_customize_exts-lib.md":"BKuxQGR7","index.md":"0I4m7CHi","lib_components_progress_index.md":"CEtektTK","lib_components_dtable_plugins.md":"CrBZnIMk","lib_components_progress-circle_index.md":"B0UUIqGM","lib_components_scrollbar_index.md":"BjI3vUqu","lib_components_nav_index.md":"LeXRijcV","lib_components_pager_index.md":"D-bROEeS","lib_components_avatar_index.md":"7j-ew9BZ","guide_config_base_spacing.md":"B653NiFv","guide_start_intro.md":"DEIJsFre","lib_components_search-box_index.md":"C6d4tMjv","lib_components_breadcrumb_index.md":"9pymY2C8","lib_components_menu_index.md":"GncmWrZR","lib_components_kanban_index.md":"BFBze8B1","lib_components_modal_trigger.md":"BMBZZybJ","lib_components_label_index.md":"q76w0qb_","lib_components_modal_index.md":"CgbVseyc","utilities_interactivity_utilities_scroll.md":"-0JODEPX","utilities_interactivity_utilities_state.md":"0ZTXUBo7","utilities_interactivity_utilities_user-select.md":"BrNPbIfK","utilities_layout_utilities_aspect-ratio.md":"_oWsoIYV","utilities_layout_utilities_container.md":"Bb3Lxa_7","utilities_layout_utilities_display.md":"DcXW9WtS","utilities_spacing_utilities_padding.md":"DuVwhAAe","lib_components_file-selector_index.md":"DvywDJ4t","utilities_layout_utilities_floats.md":"pUvtfQiw","utilities_spacing_utilities_space.md":"xgZHI4vS","utilities_spacing_utilities_margin.md":"C9jBOzP9","utilities_typography_utilities_font-family.md":"BHWBVXg4","utilities_typography_utilities_font-size.md":"B3W8gyR3","utilities_typography_utilities_vertical-align.md":"DiLQT3Ni","utilities_typography_utilities_font-weight.md":"CV3nf15_","utilities_typography_utilities_line-clamp.md":"CvO9OG4z","utilities_typography_utilities_leading.md":"DOlxRw-6","utilities_typography_utilities_list-style.md":"LuK8VgZf","utilities_typography_utilities_text-color.md":"D1fjRsa-","utilities_typography_utilities_text-decoration.md":"BvY6hqYi","utilities_typography_utilities_text-overflow.md":"CCaD8PoB","utilities_typography_utilities_text-transform.md":"CM7k043G","utilities_typography_utilities_text-align.md":"CtJ4rtrI","utilities_typography_utilities_word-break.md":"BxSlEVBy","utilities_interactivity_utilities_disabled.md":"CEB7Waub","utilities_interactivity_utilities_loading.md":"Da_3FM-1","lib_components_tooltip_index.md":"Co1ECN3g","lib_components_dashboard_index.md":"DRaM25zK","lib_components_upload-imgs_index.md":"erXa6IN9","lib_components_upload_index.md":"CzVklHlh","lib_basic_core_cash.md":"Bzo_CH3I","utilities_flex_utilities_flex.md":"BlvjgLjv","utilities_flex_utilities_gap.md":"DArM8pom","utilities_flex_utilities_grow.md":"Cn0nOehN","utilities_flex_utilities_justify-content.md":"D4BVZfVC","utilities_borders_utilities_ring-width.md":"DzwqJDAb","utilities_effects_utilities_animation.md":"B91izYvM","utilities_effects_utilities_filter.md":"BECjG4KT","utilities_effects_utilities_opacity.md":"BcIL05hy","utilities_effects_utilities_shadow.md":"CaSFSOMl","utilities_effects_utilities_transform.md":"DOI7WnD2","utilities_effects_utilities_transition.md":"SqXrre1m","utilities_flex_utilities_align-content.md":"BXGtlw9g","utilities_flex_utilities_align-self.md":"FvSQ-0Fm","utilities_flex_utilities_align-items.md":"CoFxBC8U","utilities_typography_utilities_whitespace.md":"BFKZWjDW","utilities_interactivity_utilities_cursor.md":"DvV2lotG","utilities_index.md":"CTpyUmIw","lib_forms_checkbox_switch.md":"QH8sYaT3","utilities_flex_utilities_shrink.md":"CangfHwT","lib_forms_datetime-picker_time.md":"BTTIPCd8","lib_basic_core_component.md":"uPNn0zXQ","lib_forms_form-control_index.md":"BiHmr69s","lib_components_panel_index.md":"CoS14bNk","lib_components_messager_index.md":"BW-SbOyW","lib_helpers_helpers_string-helper.md":"me2jtoF5","guide_config_base_shadow.md":"BNzZgBvC","lib_components_button_index.md":"B_1XMQuI","lib_components_dtable_index.md":"BffsFMb4","utilities_flex_utilities_basis.md":"CD8bfBkC","lib_forms_input-control_index.md":"Cv0HAFHI","lib_forms_input-group_index.md":"BMbSYMAL","lib_components_color-picker_index.md":"TddEDwtA","lib_components_tree_index.md":"Dn03SufJ","utilities_flex_utilities_direction.md":"ByjEgbMo","utilities_flex_utilities_order.md":"CfeTP7tL","utilities_flex_utilities_wrap.md":"DZ1moX26","lib_components_toolbar_js.md":"ih1Bb-Rr","lib_forms_checkbox_index.md":"D_VspyHI","lib_components_table_index.md":"Ck9c8Ek4","lib_forms_picker_index.md":"DRGaAh8C","lib_helpers_helpers_date-helper.md":"8AhG85Op","lib_components_contextmenu_index.md":"DmEkUwKC","themes_index.md":"BufleTaf","utilities_sizing_utilities_height.md":"CdF7aUuw","utilities_layout_utilities_position.md":"rEqgc51a","guide_start_tutorial.md":"CmfMgriO","utilities_skin_utilities_ghost.md":"DIt2ElJv","lib_index.md":"Ci-MFpvh","utilities_borders_utilities_ring-offset.md":"DVb4azgP","utilities_borders_utilities_ring-color.md":"s0nb0vey","utilities_backgrounds_utilities_index.md":"83vrBdjK","utilities_borders_utilities_border-width.md":"DVKauZHZ","lib_forms_datetime-picker_datetime.md":"CPkUUpoa","utilities_borders_utilities_divider.md":"khTQtOjv","utilities_layout_utilities_z-index.md":"DKY1uWyd","public_zui_icons_fontawesome-license.md":"gfk3cURr","utilities_layout_utilities_visibility.md":"CKuADuoh","utilities_borders_utilities_border-radius.md":"Dh1Nfe3A","lib_forms_datetime-picker_date.md":"D59eL2rp","utilities_sizing_utilities_width.md":"DNXQWQFd","utilities_interactivity_utilities_pointer-events.md":"EHN_kBvp","utilities_skin_utilities_outline.md":"bsC71Qhi","utilities_skin_utilities_solid.md":"Cst9ctTO","utilities_skin_utilities_pale.md":"D1L1NRKs","lib_components_toolbar_index.md":"DvojQFd3","utilities_skin_utilities_surface.md":"CN20jMqq","lib_forms_form_index.md":"sRq2u4jF","lib_components_menu_js.md":"CtCBsfaZ","lib_components_btn-group_index.md":"5V7X7r4P","utilities_layout_utilities_overflow.md":"DVHk2FQA","lib_helpers_store_index.md":"Bb0Q5VMq","utilities_layout_utilities_object-fit.md":"D4YmLxEC","utilities_layout_utilities_top-right-bottom-left.md":"C3lYdIa5","lib_components_dropdown_index.md":"DbbvFq7u","utilities_borders_utilities_border-color.md":"YFsIdVzo"} diff --git a/dev/index.html b/dev/index.html index fd1029af6c..4039ca0077 100644 --- a/dev/index.html +++ b/dev/index.html @@ -14,14 +14,14 @@ - - + +
Skip to content

ZUI 3

开箱即用的组合式前端 UI 框架

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/lib/basic/core/cash.html b/dev/lib/basic/core/cash.html index 6b6f76aaaf..0327dc83b3 100644 --- a/dev/lib/basic/core/cash.html +++ b/dev/lib/basic/core/cash.html @@ -14,8 +14,8 @@ - - + + @@ -82,7 +82,7 @@ /* 销毁。 */ datePicker.destroy();

辅助方法

$.fn.resize() 监听元素尺寸变化

定义:

ts
$.fn.resize(callback: ResizeObserverCallback): ResizeObserver;

参数

  • callback:回调函数,定义为 (entries: ResizeObserverEntry[], observer: ResizeObserver): void;

返回值ResizeObserverResizeObserver 对象。

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/lib/basic/core/component.html b/dev/lib/basic/core/component.html index 9f040710e2..9a9532f4ce 100644 --- a/dev/lib/basic/core/component.html +++ b/dev/lib/basic/core/component.html @@ -14,8 +14,8 @@ - - + + @@ -117,7 +117,7 @@ const nav = zui.Nav.get('#myNav'); </script>

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/lib/basic/core/css-component.html b/dev/lib/basic/core/css-component.html index 74785da294..d924e88fd8 100644 --- a/dev/lib/basic/core/css-component.html +++ b/dev/lib/basic/core/css-component.html @@ -14,14 +14,14 @@ - - + + -
Skip to content

CSS 组件

基本使用

CSS 组件通常提供了界面所需的基本功能,例如按钮、表单、导航、卡片、表格等,这些组件通常不需要 JS 的支持,只需要在 HTML 中使用对应的组件类名即可,例如按钮:

提示

一些 JS 组件也提供了纯 CSS 使用的方式,也就是说 CSS 组件也可能是一个 JS 组件。

组件样式

通用样式修饰

CSS 组件通常提供了多种样式修饰,例如按钮的颜色、大小、形状、状态等,大部分通用样式的修饰都可以通过 CSS 工具类来实现,例如:

专用样式修饰

部分组件提供了专用样式修饰类,这些类名通常为组件类加后缀实现,例如按钮组件的 btn-link

CSS 变量

CSS 组件通常提供了一些 CSS 变量用于自定义组件的样式,例如按钮组件提供了 --btn-bg 用于自定义按钮的颜色:

MIT License (MIT)

- +
Skip to content

CSS 组件

基本使用

CSS 组件通常提供了界面所需的基本功能,例如按钮、表单、导航、卡片、表格等,这些组件通常不需要 JS 的支持,只需要在 HTML 中使用对应的组件类名即可,例如按钮:

提示

一些 JS 组件也提供了纯 CSS 使用的方式,也就是说 CSS 组件也可能是一个 JS 组件。

组件样式

通用样式修饰

CSS 组件通常提供了多种样式修饰,例如按钮的颜色、大小、形状、状态等,大部分通用样式的修饰都可以通过 CSS 工具类来实现,例如:

专用样式修饰

部分组件提供了专用样式修饰类,这些类名通常为组件类加后缀实现,例如按钮组件的 btn-link

CSS 变量

CSS 组件通常提供了一些 CSS 变量用于自定义组件的样式,例如按钮组件提供了 --btn-bg 用于自定义按钮的颜色:

MIT License (MIT)

+ \ No newline at end of file diff --git a/dev/lib/basic/core/react.html b/dev/lib/basic/core/react.html index 65742cf7fa..ee69720c58 100644 --- a/dev/lib/basic/core/react.html +++ b/dev/lib/basic/core/react.html @@ -14,8 +14,8 @@ - - + + @@ -33,7 +33,7 @@ */ static renderHTML(options: object): string; }

React 组件相比较普通的组件有如下特点:

React 组件实例上的 $ 属性是组件的 React 实例,可以通过这个属性来访问组件的属性和方法。

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/lib/basic/core/zui-create.html b/dev/lib/basic/core/zui-create.html index 3d5c1d04ac..184eb63e05 100644 --- a/dev/lib/basic/core/zui-create.html +++ b/dev/lib/basic/core/zui-create.html @@ -14,14 +14,14 @@ - - + + -
Skip to content

便捷组件声明

在 ZUI 中,所有 JS 组件支持通过声明 zui-create 属性来自动创建,例如:

使用 zui-create-<component> 来定义组件选项,例如:

注意

通过 zui-create 创建的组件,只会在页面加载完成后自动扫描一次,如果需要在动态添加的元素上利用 zui-create 创建组件,需要手动执行 $(element).zuiInit() 初始化。

MIT License (MIT)

- +
Skip to content

便捷组件声明

在 ZUI 中,所有 JS 组件支持通过声明 zui-create 属性来自动创建,例如:

使用 zui-create-<component> 来定义组件选项,例如:

注意

通过 zui-create 创建的组件,只会在页面加载完成后自动扫描一次,如果需要在动态添加的元素上利用 zui-create 创建组件,需要手动执行 $(element).zuiInit() 初始化。

MIT License (MIT)

+ \ No newline at end of file diff --git a/dev/lib/basic/core/zui-on.html b/dev/lib/basic/core/zui-on.html index f7042d4845..a51bdea9c9 100644 --- a/dev/lib/basic/core/zui-on.html +++ b/dev/lib/basic/core/zui-on.html @@ -14,14 +14,14 @@ - - + +
Skip to content

便捷事件绑定

介绍

便捷事件机制允许通过 HTML 元素属性 [zui-on-*] 来绑定事件。下面为一个例子:

上例中,通过 [zui-on-click] 属性绑定点击事件,通过属性指定需要执行的 JS 代码,从而实现当点击按钮时,将会弹出一个对话框。

提示

编辑事件机制实际原理为在 document 元素上绑定了一个事件监听器,当事件触发时,会检查事件源元素是否存在 [data-on-*] 属性,如果存在,则会根据 [data-on-*] 属性的值来执行 JS 代码。根据此原理,需要被监听的元素上的事件能够被冒泡到 document 上。

事件类型

在 ZUI3 中默认支持的便捷绑定事件类型包括:

  • click:点击事件;
  • inited:组件初始化事件;
  • change:变更事件。

自定义选项

除了可以直接指定要执行的 JS 代码,还可以通过一个对象来指定事件绑定选项,例如:

所有可用的选项包括:

选项说明
on事件类型,必须,目前支持点击('click')和变更('change')事件
selector事件是否仅能触发在符合指定选择器的内部元素上,相当于事件委托
do要执行的 JS 代码,可选
call要执行的回调函数,可选
params需要传递给 JS 代码的参数,多个参数使用 , 分隔,也可以通过 JSON 数组的形式指定
if在执行 JS 代码和回调函数之前进行判断,如果结果为 false 则不会执行
once是否只执行一次,默认 false
stop是否阻止事件冒泡,相当于调用 stopPropagation,默认 false
prevent是否阻止默认行为,相当于调用 preventDefault,默认 false
self是否尽在点击自身时触发。

内置参数

在指定执行代码和回调函数参数时有一些内置参数可以直接通过约定名称引用,包括:

  • event:事件对象;
  • options:事件绑定选项;
  • $element:事件源元素(Cash 类型)。

例如:

内置参数还可以直接用于 do 代码中和 call 回调函数定义中,例如:

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/lib/basic/core/zui-toggle.html b/dev/lib/basic/core/zui-toggle.html index 30c718725a..f5290dd134 100644 --- a/dev/lib/basic/core/zui-toggle.html +++ b/dev/lib/basic/core/zui-toggle.html @@ -14,14 +14,14 @@ - - + +
Skip to content

全局触发调用

使用

全局触发调用允许在元素上通过 zui-toggle 属性来声明组件调用,在某个事件(通常为点击)触发时,自动使用选项进行初始化,并执行操作。例如下拉菜单按钮,在点击时声明下拉菜单组件,并打开下拉菜单。下面为一个下拉菜单的例子:

兼容模式

在兼容模式下,可以通过 data-toggle 属性生命组件,使用其他 data-* 属性声明组件初始化选项。

支持的组件

支持全局触发调用的组件包括:

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/lib/components/alert/index.html b/dev/lib/components/alert/index.html index bd1f474618..d94d94628a 100644 --- a/dev/lib/components/alert/index.html +++ b/dev/lib/components/alert/index.html @@ -14,14 +14,14 @@ - - + +
Skip to content

消息框

消息框能够轻松展示一些需要引起用户注意的内容。

基本使用

为元素添加 alert 类来获得消息框的外观。

嘿!这是一则提示。

包含链接

使用 .alert-link 类来为消息框内的链接添加样式。

Hi! 这条消息可能需要你注意。了解更多

包含关闭按钮

使用 .alert-close 类来为消息框内的关闭按钮添加样式。絮语注意到是当需要在消息框中包含更多内容时,需要将消息文本放置在 .alert-text 中。

嘿!这是一则提示。了解更多

包含操作按钮

像添加关闭按钮一样,还可以添加其他操作按钮:

嘿!这是一则提示。了解更多

可以将多个按钮放在工具栏中:

嘿!这是一则提示。了解更多

外观类型

配合丰富的 CSS 工具类 来实现不同消息框的外观。

嘿!这是一则提示。
嘿!这是一则提示。
嘿!这是一则提示。
嘿!这是一则提示。
嘿!这是一则提示。
嘿!这是一则提示。
嘿!这是一则提示。

CSS 类

消息框提供了如下 CSS 类:

类型作用
alert实体类元素作为消息框组件
alert-icon实体类元素作为消息框内左侧图标
alert-close实体类元素作为消息框关闭按钮
alert-text实体类元素作为消息框文本内容

CSS 变量

消息框提供了如下 CSS 变量:

变量名称变量含义
--alert-bg消息框默认背景色

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/lib/components/avatar-group/index.html b/dev/lib/components/avatar-group/index.html index 292150527d..6d44b40d08 100644 --- a/dev/lib/components/avatar-group/index.html +++ b/dev/lib/components/avatar-group/index.html @@ -14,14 +14,14 @@ - - + + -
Skip to content

头像组

头像组用于将多个头像堆叠显示。

基本使用

将多个头像放置在 <div class="avatar-group"> 内即可创建一个头像组。

+10

尺寸

当使用不同大小的头像时,可以通过为 .avatar-group 添加同样等级的 size-* 辅助类已获得统一的堆叠间距。

堆叠间距

使用工具类 gap-* 来调整堆叠间距。默认间距等同于 gap-2.5,小于 2.5 将使得间距比默认间距更小,反之则更大。

0
1
2
2.5
3
3.5

CSS 类

头像组提供了如下 CSS 类:

类型作用
avatar-group实体类元素作为头像组组件
size-xs工具类头像组使用超小号尺寸
size-sm工具类头像组使用小号尺寸
size-lg工具类头像组使用大号尺寸
size-xl工具类头像组使用超大号尺寸

参考

MIT License (MIT)

- +
Skip to content

头像组

头像组用于将多个头像堆叠显示。

基本使用

将多个头像放置在 <div class="avatar-group"> 内即可创建一个头像组。

+10

尺寸

当使用不同大小的头像时,可以通过为 .avatar-group 添加同样等级的 size-* 辅助类已获得统一的堆叠间距。

堆叠间距

使用工具类 gap-* 来调整堆叠间距。默认间距等同于 gap-2.5,小于 2.5 将使得间距比默认间距更小,反之则更大。

0
1
2
2.5
3
3.5

CSS 类

头像组提供了如下 CSS 类:

类型作用
avatar-group实体类元素作为头像组组件
size-xs工具类头像组使用超小号尺寸
size-sm工具类头像组使用小号尺寸
size-lg工具类头像组使用大号尺寸
size-xl工具类头像组使用超大号尺寸

参考

MIT License (MIT)

+ \ No newline at end of file diff --git a/dev/lib/components/avatar/index.html b/dev/lib/components/avatar/index.html index 2060e3050c..6e19c58781 100644 --- a/dev/lib/components/avatar/index.html +++ b/dev/lib/components/avatar/index.html @@ -14,14 +14,14 @@ - - + + -
Skip to content

头像

头像是用图片、图标或者文字的形式展示用户及具有特殊标识的其他对象。

基本使用

为元素并添加类 .avatar,然后将作为图像的图片、文字或图标放置在此元素内。

Z

提示

当使用文字作为头像时,建议文字数目不要超过 2 个,如果需要显示更多文字进行个性化排版,推荐使用 JavaScript 增强的头像插件。

头像形状

搭配 CSS 工具类 rounded-* 为头像应用不同的圆角样式。

外观类型

当使用文字或图标作为头像时,配合使用CSS 工具类来实现不同头像的外观。下面展示各种工具类的外观效果。

Z
Z
Z
Z

尺寸

除了默认大小,还提供了额外的 4 种预设尺寸,通过 size-* 来为头像设置尺寸。

X
S
Z
LG
XL

CSS 类

头像提供了如下 CSS 类:

类型作用
avatar实体类元素作为头像组件
size-xs工具类头像使用超小号尺寸
size-sm工具类头像使用小号尺寸
size-lg工具类头像使用大号尺寸
size-xl工具类头像使用超大号尺寸

CSS 变量

头像提供了如下 CSS 变量,可进行全局修改:

CSS 变量名作用
--avatar-radius头像默认圆角大小
--avatar-bg头像默认背景颜色

参考

MIT License (MIT)

- +
Skip to content

头像

头像是用图片、图标或者文字的形式展示用户及具有特殊标识的其他对象。

基本使用

为元素并添加类 .avatar,然后将作为图像的图片、文字或图标放置在此元素内。

Z

提示

当使用文字作为头像时,建议文字数目不要超过 2 个,如果需要显示更多文字进行个性化排版,推荐使用 JavaScript 增强的头像插件。

头像形状

搭配 CSS 工具类 rounded-* 为头像应用不同的圆角样式。

外观类型

当使用文字或图标作为头像时,配合使用CSS 工具类来实现不同头像的外观。下面展示各种工具类的外观效果。

Z
Z
Z
Z

尺寸

除了默认大小,还提供了额外的 4 种预设尺寸,通过 size-* 来为头像设置尺寸。

X
S
Z
LG
XL

CSS 类

头像提供了如下 CSS 类:

类型作用
avatar实体类元素作为头像组件
size-xs工具类头像使用超小号尺寸
size-sm工具类头像使用小号尺寸
size-lg工具类头像使用大号尺寸
size-xl工具类头像使用超大号尺寸

CSS 变量

头像提供了如下 CSS 变量,可进行全局修改:

CSS 变量名作用
--avatar-radius头像默认圆角大小
--avatar-bg头像默认背景颜色

参考

MIT License (MIT)

+ \ No newline at end of file diff --git a/dev/lib/components/breadcrumb/index.html b/dev/lib/components/breadcrumb/index.html index cdcf408131..24cc0f40fc 100644 --- a/dev/lib/components/breadcrumb/index.html +++ b/dev/lib/components/breadcrumb/index.html @@ -14,14 +14,14 @@ - - + +
Skip to content

面包屑

基本使用

使用类 .breadcrumb 来实现面包屑,通常搭配 <ol><li> 元素使用。

CSS 类

面包屑提供了如下 CSS 类

类型作用
breadcrumb实体类元素作为面包屑组件

CSS 变量

变量名称变量含义
--breadcrumb-divider面包屑分割元素标签类型
--breadcrumb-divider-color面包屑分割元素颜色
--breadcrumb-color-active面包屑选中态元素颜色

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/lib/components/btn-group/index.html b/dev/lib/components/btn-group/index.html index f366f1f7b4..f5ade285cf 100644 --- a/dev/lib/components/btn-group/index.html +++ b/dev/lib/components/btn-group/index.html @@ -14,14 +14,14 @@ - - + +
Skip to content

按钮组

按钮组可以将多个按钮成组展示。

使用方法

将多个 按钮 放置在 <div class="btn-group"> 内即可创建一个按钮组。

多组按钮

使用 CSS 工具类 .row 搭配 .gap-* 实现多组按钮效果。

尺寸

.btn-group 上配合使用工具类 size-* 来获得不同大小的按钮组。

外观

在按钮上加 CSS 工具类,以获得不同的按钮外观显示。

使用下拉菜单

可以在按钮组中使用下拉菜单,只需要将启用下拉菜单的按钮放置于按钮组中即可。

CSS 类

按钮提供了如下 CSS 类:

类型作用
btn-group实体类元素作为按钮组组件
size-xs工具类按钮组使用超小号尺寸
size-sm工具类按钮组使用小号尺寸
size-lg工具类按钮组使用大号尺寸
size-xl工具类按钮组使用超大号尺寸

参考

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/lib/components/button/index.html b/dev/lib/components/button/index.html index ba4e5e8f1e..440359356b 100644 --- a/dev/lib/components/button/index.html +++ b/dev/lib/components/button/index.html @@ -14,14 +14,14 @@ - - + + -
Skip to content

按钮

按钮是用来触发一些动作。通常用在表单、对话框、菜单上面。好的按钮设计能够引导用户高效的达到目的。

使用方法

使用 .btn 类来获得按钮的外观和交互体验,通常用在元素 <button><a> 上。

配合丰富的CSS 工具类来实现不同按钮的外观。

图标按钮

按钮配合图标组件一起使用时,自动呈现为图标按钮。

外观

外观类型

配合使用CSS 工具类来实现不同按钮的外观。下面展示各种工具类的外观效果。

链接按钮

使用 .btn-link 类来获得链接按钮的外观。

按钮圆角

搭配 CSS 工具类 rounded-* 为按钮应用不同的圆角样式。

按钮阴影效果

搭配 CSS 工具类 shadow-* 为按钮应用不同的阴影样式。

尺寸

除了默认大小,按钮还提供了额外的 4 种预设尺寸。

形状

正方形按钮

通过工具类 square 可以让按钮获得正方形外观,通常作为图标按钮使用。

圆形按钮

当与工具类 circlesquare 一起使用时则获得圆形按钮。

状态

禁用状态

为按钮提供 disabled="disabled" 属性或 disabled 工具类来禁用按钮。被禁用的按钮将无法响应点击事件。

激活状态

为按钮添加 active 类启用激活状态。

加载中状态

为按钮提供动画图标实现加载中状态。

CSS 类

按钮提供了如下 CSS 类:

类型作用
btn实体类元素作为按钮组件
btn-link修饰类使用链接按钮外观
square工具类按钮使用正方形外观
size-xs工具类按钮使用超小号尺寸
size-sm工具类按钮使用小号尺寸
size-lg工具类按钮使用大号尺寸
size-xl工具类按钮使用超大号尺寸

CSS 变量

变量名称变量含义
--btn-radius按钮圆角
--btn-bg按钮背景颜色
--btn-border-color按钮边框颜色
--btn-height按钮高度

MIT License (MIT)

- +
Skip to content

按钮

按钮是用来触发一些动作。通常用在表单、对话框、菜单上面。好的按钮设计能够引导用户高效的达到目的。

使用方法

使用 .btn 类来获得按钮的外观和交互体验,通常用在元素 <button><a> 上。

配合丰富的CSS 工具类来实现不同按钮的外观。

图标按钮

按钮配合图标组件一起使用时,自动呈现为图标按钮。

外观

外观类型

配合使用CSS 工具类来实现不同按钮的外观。下面展示各种工具类的外观效果。

链接按钮

使用 .btn-link 类来获得链接按钮的外观。

按钮圆角

搭配 CSS 工具类 rounded-* 为按钮应用不同的圆角样式。

按钮阴影效果

搭配 CSS 工具类 shadow-* 为按钮应用不同的阴影样式。

尺寸

除了默认大小,按钮还提供了额外的 4 种预设尺寸。

形状

正方形按钮

通过工具类 square 可以让按钮获得正方形外观,通常作为图标按钮使用。

圆形按钮

当与工具类 circlesquare 一起使用时则获得圆形按钮。

状态

禁用状态

为按钮提供 disabled="disabled" 属性或 disabled 工具类来禁用按钮。被禁用的按钮将无法响应点击事件。

激活状态

为按钮添加 active 类启用激活状态。

加载中状态

为按钮提供动画图标实现加载中状态。

CSS 类

按钮提供了如下 CSS 类:

类型作用
btn实体类元素作为按钮组件
btn-link修饰类使用链接按钮外观
square工具类按钮使用正方形外观
size-xs工具类按钮使用超小号尺寸
size-sm工具类按钮使用小号尺寸
size-lg工具类按钮使用大号尺寸
size-xl工具类按钮使用超大号尺寸

CSS 变量

变量名称变量含义
--btn-radius按钮圆角
--btn-bg按钮背景颜色
--btn-border-color按钮边框颜色
--btn-height按钮高度

MIT License (MIT)

+ \ No newline at end of file diff --git a/dev/lib/components/color-picker/index.html b/dev/lib/components/color-picker/index.html index c8ab04316a..8cdea7206c 100644 --- a/dev/lib/components/color-picker/index.html +++ b/dev/lib/components/color-picker/index.html @@ -14,14 +14,14 @@ - - + + -
Skip to content

颜色选择器

基于下拉选择器实现的颜色选择器。

基本使用

在选定元素上调用初始化函数即可使用颜色选择器。

自定义颜色

通过设置 colors 属性自定义颜色列表,可以指定一个表示颜色的字符串数组,也可以通过英文逗号拼接多个颜色一起指定。

自定义图标

通过设置 icon 属性自定义颜色显示图标。

同步颜色

通过为 syncValuesyncColorsyncBackgroundsyncBorder 设置选择器可实现将当前选中的颜色信息同步到相应元素。

颜色值:
文字颜色
背景色
边框色

配合使用

作为按钮

在输入组中使用

在输入框中使用

选项

名称类型默认值说明
headingstringnull颜色面板标题。 colors?: string | string[]; // 颜色选项列表。 icon?: string; // 显示为图标的名称。 closeBtn?: boolean = true; // 颜色面板是否使用关闭按钮。 syncValue?: string; // 颜色值容器选择器。 syncColor?: string; // 文本色同步容器选择器。 syncBackground?: string; // 背景色同步容器选择器。 syncBorder?: string; // 边框色同步容器选择器。

MIT License (MIT)

- +
Skip to content

颜色选择器

基于下拉选择器实现的颜色选择器。

基本使用

在选定元素上调用初始化函数即可使用颜色选择器。

自定义颜色

通过设置 colors 属性自定义颜色列表,可以指定一个表示颜色的字符串数组,也可以通过英文逗号拼接多个颜色一起指定。

自定义图标

通过设置 icon 属性自定义颜色显示图标。

同步颜色

通过为 syncValuesyncColorsyncBackgroundsyncBorder 设置选择器可实现将当前选中的颜色信息同步到相应元素。

颜色值:
文字颜色
背景色
边框色

配合使用

作为按钮

在输入组中使用

在输入框中使用

选项

名称类型默认值说明
headingstringnull颜色面板标题。 colors?: string | string[]; // 颜色选项列表。 icon?: string; // 显示为图标的名称。 closeBtn?: boolean = true; // 颜色面板是否使用关闭按钮。 syncValue?: string; // 颜色值容器选择器。 syncColor?: string; // 文本色同步容器选择器。 syncBackground?: string; // 背景色同步容器选择器。 syncBorder?: string; // 边框色同步容器选择器。

MIT License (MIT)

+ \ No newline at end of file diff --git a/dev/lib/components/contextmenu/index.html b/dev/lib/components/contextmenu/index.html index 45889076fb..fcacc01232 100644 --- a/dev/lib/components/contextmenu/index.html +++ b/dev/lib/components/contextmenu/index.html @@ -14,8 +14,8 @@ - - + + @@ -115,7 +115,7 @@ }); }); </script>

API

items 的单个对象属性

text

名称。

icon

左侧图标。

trailingIcon

右侧图标。

className

类名。

style

样式。

url

跳转链接地址。

target

在何处打开链接地址。

disabled

是否禁用。

active

是否是激活状态。

type

单项类型。

rootClass

menu-item 同级类名。

items

子级操作数据。

onClick

点击操作菜单项的回调事件。

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/lib/components/dashboard/index.html b/dev/lib/components/dashboard/index.html index c3286fb6b2..52ac864cc1 100644 --- a/dev/lib/components/dashboard/index.html +++ b/dev/lib/components/dashboard/index.html @@ -14,8 +14,8 @@ - - + + @@ -82,7 +82,7 @@ blockMenu?: ContextMenuOptions; onLayoutChange?: (blocks: BlockSetting[]) => void; };

MIT License (MIT)

- + \ No newline at end of file diff --git a/dev/lib/components/dropdown/index.html b/dev/lib/components/dropdown/index.html index fbcf4e022d..27a7f207df 100644 --- a/dev/lib/components/dropdown/index.html +++ b/dev/lib/components/dropdown/index.html @@ -14,14 +14,14 @@ - - + +
Skip to content

下拉菜单

将动作或菜单折叠到下拉菜单中。

使用方法

为触发按钮添加属性 data-toggle="dropdown",然后在触发按钮之后添加一个 .dropdown-menu 用于定义菜单列表。

关联菜单元素

你还可以在触发按钮上通过 data-target 属性来指定要打开的菜单列表元素,这样不用要求触发按钮和菜单列表元素之间必须按顺序紧邻。

手动初始化

你可以通过 new zui.Dropdown() 方法在触发按钮上动态初始化下拉菜单组件,这样无需为触发按钮添加属性 data-toggle="dropdown",以及预先创建下拉菜单列表元素 .dropdown-menu

显示箭头

通过给下拉菜单菜单按钮添加 data-arrow="true" 来使下拉菜单展示箭头。

改变箭头大小

通过给下拉菜单按钮添加 data-arrow={size} 来控制下拉菜单的箭头的大小。

data-arrow = 4
data-arrow = 8
data-arrow = 12

鼠标悬停展开菜单

为触发按钮添加属性 data-trigger="hover" 实现鼠标悬停展开菜单。

浮动方向

通过 data-placement=* 属性控制弹出方向。

data-placement = top-start
data-placement = top
data-placement = top-end
data-placement = bottom-start
data-placement = bottom
data-placement = bottom-end
data-placement = left-start
data-placement = left
data-placement = left-end
data-placement = right-start
data-placement = right
data-placement = right-end

多级子菜单

多级子菜单仅支持通过手动初始化的方式创建。

自定义菜单

通常情况下下拉菜单列表使用 <menu> 元素,你也可以替换为其他元素或内容

51015202530354045505560

禁用的菜单项

为菜单项 <li> 添加 .disabled 类即可获得禁用外观。

标题和分割线

.dropdown-menuli 标签使用 .dropdown-header类 来显示标题,使用 .divider 来创建分割线。

  • CSS 类

    按钮提供了如下 CSS 类:

    类型作用
    dropdown实体类元素作为下拉菜单组件
    dropdown-menu实体类元素作为下拉菜单列表
    dropdown-header实体类元素作为下拉菜单中的标题
    caret实体类元素作为下拉菜单icon图标
    divider实体类元素作为下拉菜单分割线
    dropup工具类下拉框浮动方向为上方

    CSS 变量

    变量名称变量含义
    --dropmenu-radius下拉菜单圆角
    --dropmenu-border-color下拉菜单边框颜色
    --dropmenu-bg下拉菜单背景颜色
    --dropmenu-active-color下拉菜单条目激活状态文字颜色
    --dropmenu-active-bg下拉菜单条目激活状态背景颜色

    API

    操作菜单定义对象。

    trigger

    触发方式

    • 类型:click | hover | manual
    • 必选:否。

    arrow

    箭头大小 为 true 则为默认12

    • 类型:boolean | number
    • 必选:否。

    offset

    偏移量

    • 类型:number
    • 必选:否。

    菜单对象 详细配置可参考 菜单

    • 类型:object
    • 必选:否。

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/components/dtable/index.html b/dev/lib/components/dtable/index.html index e08446ac40..c75df27afb 100644 --- a/dev/lib/components/dtable/index.html +++ b/dev/lib/components/dtable/index.html @@ -14,8 +14,8 @@ - - + + @@ -360,7 +360,7 @@ render(): void; }

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/components/dtable/plugins.html b/dev/lib/components/dtable/plugins.html index c06db2d93d..099632312b 100644 --- a/dev/lib/components/dtable/plugins.html +++ b/dev/lib/components/dtable/plugins.html @@ -14,8 +14,8 @@ - - + + @@ -750,7 +750,7 @@ /* 表头分组名称。 */ headerGroup?: string; }

    更多插件开发中

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/components/file-selector/index.html b/dev/lib/components/file-selector/index.html index b2ac1aa367..95ca19b9d8 100644 --- a/dev/lib/components/file-selector/index.html +++ b/dev/lib/components/file-selector/index.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    文件选择

    界面模式

    文件选择器支持多种界面模式,包括按钮模式、方框模式和网格模式,另外还提供了单独的图片选择器用于选择图片文件。

    按钮模式

    默认模式为按钮模式,点击按钮选择文件,所选择的文件会显示在按钮上方。

    方框模式

    通过设置 mode 属性为 'box' 可以切换为方框模式,所选择的文件会显示在方框下方。方框模式提供了更大的拖放文件放置区域。

    网格模式

    通过设置 mode 属性为 'grid' 可以切换为网格模式,所选择的文件会显示在网格中。网格模式提供了更大的文件预览区域。

    图片选择

    图片选择是基于网格模式的一种预设模式,通过 ImageSelector 可以快速创建一个图片选择器。

    文件限制

    限制文件类型

    通过 accept 来限制文件类型,可以使用 MIME 类型、文件扩展名或通配符,定义与 HTML 的 accept 属性相同。

    限制文件大小

    通过 maxFileSize 来限制单个文件大小,通过 totalFileSize 来限制总文件大小。

    限制文件数目

    通过 maxFileCount 来限制文件数目,如果设置为非大于 0 的数则不限制。

    预设文件

    通过设置 defaultFiles 属性可以预设文件列表,预设文件不会触发 onAdd 回调函数和 onSelect 回调函数。

    禁用

    通过设置 disabled 属性为 true 可以禁用文件选择器。

    个性化配置

    提示信息

    通过 tip 属性可以设置提示信息,在提示信息中可以使用如下占位文本:

    • {size}:文件总大小;
    • {count}:文件数目;
    • {maxFileSize}:最大文件大小;
    • {maxFileCount}:最大文件数目。

    文件图标

    通过设置 fileIcons 属性可以为不同类型的文件(根据扩展名)显示不同的图标。

    显示缩略图

    默认会为图片文件显示缩略图,通过设置 thumbnail 属性为 false 可以关闭缩略图显示。

    文件拖放

    默认情况下用户可以拖放文件到文件选择器中,通过设置 draggable 属性为 false 可以禁用拖放。

    一次选择一个文件

    默认情况下用户可以在操作系统文件选择对话框中一次选择多个文件,通过设置 multiple 属性为 false 可以限制一次只能选择一个文件。

    网格模式配置

    网格模式下可以通过设置 gridWidthgridHeightgridGap 来调整网格的宽度、高度和间距。

    自定义文件上传按钮

    通过设置 uploadBtn 属性可以自定义文件上传按钮。

    文件操作

    文件重命名

    默认情况下支持对文件进行重命名,通过设置 renameBtn 属性为 false 可以禁用重命名按钮,通过为 renameBtn 属性设置字符串可以自定义重命名按钮的文字,通过为 renameBtn 属性设置对象可以自定义重命名按钮。

    文件移除

    默认情况下支持对文件进行移除,通过设置 removeBtn 属性为 false 可以禁用移除按钮,通过为 removeBtn 属性设置字符串可以自定义移除按钮的文字,通过为 removeBtn 属性设置对象可以自定义移除按钮。

    自定义操作提示信息

    通过设置 removeConfirmduplicatedTipexceededSizeTipexceededTotalSizeTipexceededCountTip 属性可以自定义操作提示信息。

    在提示信息中可以使用如下占位文本:

    • {name}:当前文件名;
    • {size}:当前文件大小;
    • {count}:当前已选择文件数目;
    • {maxFileSize}:最大文件大小;
    • {maxFileCount}:最大文件数目;
    • {totalFileSize}:最大文件数目,仅适用于 exceededTotalSizeTip 提示;
    • {exceededCount}:超出数量,仅适用于 exceededCountTip 提示。

    操作拦截

    通过设置 onRenameonRemoveonAddonRemove 选项设置回调函数可以拦截文件操作,通常在回调函数中返回 false 可以阻止继续操作,相关回调函数定义参加选项和 API。

    文件限制拦截

    通过设置 onDuplicatedonExceededSizeonExceededTotalSizeonExceededCount 选项可以在触发文件限制时拦截文件操作,通过在回调函数中返回 true 来忽略文件限制,相关回调函数定义参加选项和 API。

    选项

    FileSelectorProps

    名称类型默认值说明
    namestringnull作为表单字段的名称。 accept?: string; // 限制文件类型。 disabled?: boolean; // 是否禁用。 mode?: 'button' | 'box' | 'grid' = "button"; // 界面模式。 tip?: string; // 提示信息。 thumbnail?: boolean=true; // 是否显示缩略图。 gridWidth?: string | number; // 网格模式的宽度。 gridHeight?: string | number; // 网格模式的高度。 gridGap?: string | number; // 网格模式的间距。 defaultFiles?: DefaltFileInfo[]; // 默认显示的文件列表。 multiple?: boolean = true; // 是否允许在文件选择对话框中一次性选择多个文件(需要操作系统支持)。 itemProps?: ButtonProps | FileButtonGenerator; // 文件项的属性。 draggable?: boolean = true; // 是否允许拖拽。 fileIcons?: IconType | Record = "file"; // 文件图标。 uploadBtn?: string | ButtonProps; // 上传按钮。 renameBtn?: boolean | string | ButtonProps | FileButtonGenerator = true; // 重命名按钮。 removeBtn?: boolean | string | ButtonProps | FileButtonGenerator = true; // 删除按钮。 removeConfirm?: string | ModalConfirmOptions; // 删除确认提示。 maxFileSize?: FileSize = "100MB"; // 限制文件大小。 maxFileCount?: number = 0; // 限制文件数目,如果设置为非大于 0 的数则不限制。 totalFileSize?: FileSize; // 限制总文件大小,如果设置为非大于 0 的数则不限制。 allowSameName?: boolean; // 是否允许同名文件。 duplicatedTip?: string | ModalAlertOptions; // 重名提示。 exceededSizeTip?: string | ModalAlertOptions; // 超出大小提示。 exceededTotalSizeTip?: string | ModalAlertOptions; // 超出总大小提示。 exceededCountTip?: string | ModalAlertOptions; // 超出数量提示。 onSelect?: FileSelectCallback; // 选择文件时的回调。 onAdd?: FileAddCallback; // 添加文件时的回调。 onRemove?: RemoveFileCallback; // 删除文件时的回调。 onRename?: RenameFileCallback; // 重命名文件时的回调,返回 false 取消重命名。 onDuplicated?: DuplicatedCallback; // 重名时的回调,返回 true 保留重复文件。 onExceededSize?: ExceededLimitCallback; // 超出大小时的回调,返回 true 保留超出大小文件。 onExceededTotalSize?: ExceededLimitCallback; // 超出总大小时的回调,返回 true 保留超出总大小文件。 onExceededCount?: ExceededLimitCallback; // 超出数量时的回调,返回 true 保留超出数量文件。

    API

    FileInfo

    文件信息对象。

    名称类型默认值说明
    namestring文件名。 size: number; // 文件大小。 id: string; // 文件唯一标识。 type: string; // 文件类型。 ext: string; // 文件扩展名。 url?: string; // 文件地址。 file?: File; // 文件对象。

    StaticFileInfo

    预设文件信息对象。

    名称类型默认值说明
    namestring文件名。 size: FileSize; // 文件大小。 type?: string; // 文件类型。 id?: string; // 文件唯一标识。 url?: string; // 文件地址。

    FileSize

    文件大小,字节数或带单位的大小,例如 1024'1KB'

    ts
    type FileSize = number | `${number}${'B' | 'KB' | 'MB' | 'GB' | 'TB'}`;

    DefaltFileInfo

    默认文件信息对象。

    ts
    type DefaltFileInfo = File | FileInfo | StaticFileInfo;

    FileButtonGenerator

    文件操作按钮属性生成器,返回 false 不显示按钮,返回 true 使用默认按钮,返回字符串使用默认按钮并设置文字,返回对象使用自定义按钮。

    ts
    type FileButtonGenerator = ((file: FileInfo) => (boolean | string | ButtonProps));

    FileAddCallback

    添加文件时的回调函数,返回 false 取消添加文件。

    ts
    type FileAddCallback = (file: FileInfo) => void | false;

    FileSelectCallback

    选择文件时的回调函数。

    ts
    type FileSelectCallback = (files: File[] | FileList) => void | false;

    RemoveFileCallback

    删除文件时的回调函数。

    ts
    (file: FileInfo) => void | false | Promise<void | false>;

    RenameFileCallback

    重命名文件时的回调函数,返回 false 取消重命名。

    ts
    type RenameFileCallback = (newName: string, oldName: string, file: FileInfo) => void | false | Promise<void | false>;

    DuplicatedCallback

    重名时的回调,返回 true 保留重复文件。

    ts
    type DuplicatedCallback = (name: string, currentFile: FileInfo, existFile: FileInfo) => void | true;

    ExceededLimitCallback

    超出限制时的回调函数,返回 true 忽略限制,否则取消添加文件。

    ts
    type ExceededLimitCallback = (limit: number, file: FileInfo) => void | true;

    MIT License (MIT)

    - +
    Skip to content

    文件选择

    界面模式

    文件选择器支持多种界面模式,包括按钮模式、方框模式和网格模式,另外还提供了单独的图片选择器用于选择图片文件。

    按钮模式

    默认模式为按钮模式,点击按钮选择文件,所选择的文件会显示在按钮上方。

    方框模式

    通过设置 mode 属性为 'box' 可以切换为方框模式,所选择的文件会显示在方框下方。方框模式提供了更大的拖放文件放置区域。

    网格模式

    通过设置 mode 属性为 'grid' 可以切换为网格模式,所选择的文件会显示在网格中。网格模式提供了更大的文件预览区域。

    图片选择

    图片选择是基于网格模式的一种预设模式,通过 ImageSelector 可以快速创建一个图片选择器。

    文件限制

    限制文件类型

    通过 accept 来限制文件类型,可以使用 MIME 类型、文件扩展名或通配符,定义与 HTML 的 accept 属性相同。

    限制文件大小

    通过 maxFileSize 来限制单个文件大小,通过 totalFileSize 来限制总文件大小。

    限制文件数目

    通过 maxFileCount 来限制文件数目,如果设置为非大于 0 的数则不限制。

    预设文件

    通过设置 defaultFiles 属性可以预设文件列表,预设文件不会触发 onAdd 回调函数和 onSelect 回调函数。

    禁用

    通过设置 disabled 属性为 true 可以禁用文件选择器。

    个性化配置

    提示信息

    通过 tip 属性可以设置提示信息,在提示信息中可以使用如下占位文本:

    • {size}:文件总大小;
    • {count}:文件数目;
    • {maxFileSize}:最大文件大小;
    • {maxFileCount}:最大文件数目。

    文件图标

    通过设置 fileIcons 属性可以为不同类型的文件(根据扩展名)显示不同的图标。

    显示缩略图

    默认会为图片文件显示缩略图,通过设置 thumbnail 属性为 false 可以关闭缩略图显示。

    文件拖放

    默认情况下用户可以拖放文件到文件选择器中,通过设置 draggable 属性为 false 可以禁用拖放。

    一次选择一个文件

    默认情况下用户可以在操作系统文件选择对话框中一次选择多个文件,通过设置 multiple 属性为 false 可以限制一次只能选择一个文件。

    网格模式配置

    网格模式下可以通过设置 gridWidthgridHeightgridGap 来调整网格的宽度、高度和间距。

    自定义文件上传按钮

    通过设置 uploadBtn 属性可以自定义文件上传按钮。

    文件操作

    文件重命名

    默认情况下支持对文件进行重命名,通过设置 renameBtn 属性为 false 可以禁用重命名按钮,通过为 renameBtn 属性设置字符串可以自定义重命名按钮的文字,通过为 renameBtn 属性设置对象可以自定义重命名按钮。

    文件移除

    默认情况下支持对文件进行移除,通过设置 removeBtn 属性为 false 可以禁用移除按钮,通过为 removeBtn 属性设置字符串可以自定义移除按钮的文字,通过为 removeBtn 属性设置对象可以自定义移除按钮。

    自定义操作提示信息

    通过设置 removeConfirmduplicatedTipexceededSizeTipexceededTotalSizeTipexceededCountTip 属性可以自定义操作提示信息。

    在提示信息中可以使用如下占位文本:

    • {name}:当前文件名;
    • {size}:当前文件大小;
    • {count}:当前已选择文件数目;
    • {maxFileSize}:最大文件大小;
    • {maxFileCount}:最大文件数目;
    • {totalFileSize}:最大文件数目,仅适用于 exceededTotalSizeTip 提示;
    • {exceededCount}:超出数量,仅适用于 exceededCountTip 提示。

    操作拦截

    通过设置 onRenameonRemoveonAddonRemove 选项设置回调函数可以拦截文件操作,通常在回调函数中返回 false 可以阻止继续操作,相关回调函数定义参加选项和 API。

    文件限制拦截

    通过设置 onDuplicatedonExceededSizeonExceededTotalSizeonExceededCount 选项可以在触发文件限制时拦截文件操作,通过在回调函数中返回 true 来忽略文件限制,相关回调函数定义参加选项和 API。

    选项

    FileSelectorProps

    名称类型默认值说明
    namestringnull作为表单字段的名称。 accept?: string; // 限制文件类型。 disabled?: boolean; // 是否禁用。 mode?: 'button' | 'box' | 'grid' = "button"; // 界面模式。 tip?: string; // 提示信息。 thumbnail?: boolean=true; // 是否显示缩略图。 gridWidth?: string | number; // 网格模式的宽度。 gridHeight?: string | number; // 网格模式的高度。 gridGap?: string | number; // 网格模式的间距。 defaultFiles?: DefaltFileInfo[]; // 默认显示的文件列表。 multiple?: boolean = true; // 是否允许在文件选择对话框中一次性选择多个文件(需要操作系统支持)。 itemProps?: ButtonProps | FileButtonGenerator; // 文件项的属性。 draggable?: boolean = true; // 是否允许拖拽。 fileIcons?: IconType | Record = "file"; // 文件图标。 uploadBtn?: string | ButtonProps; // 上传按钮。 renameBtn?: boolean | string | ButtonProps | FileButtonGenerator = true; // 重命名按钮。 removeBtn?: boolean | string | ButtonProps | FileButtonGenerator = true; // 删除按钮。 removeConfirm?: string | ModalConfirmOptions; // 删除确认提示。 maxFileSize?: FileSize = "100MB"; // 限制文件大小。 maxFileCount?: number = 0; // 限制文件数目,如果设置为非大于 0 的数则不限制。 totalFileSize?: FileSize; // 限制总文件大小,如果设置为非大于 0 的数则不限制。 allowSameName?: boolean; // 是否允许同名文件。 duplicatedTip?: string | ModalAlertOptions; // 重名提示。 exceededSizeTip?: string | ModalAlertOptions; // 超出大小提示。 exceededTotalSizeTip?: string | ModalAlertOptions; // 超出总大小提示。 exceededCountTip?: string | ModalAlertOptions; // 超出数量提示。 onSelect?: FileSelectCallback; // 选择文件时的回调。 onAdd?: FileAddCallback; // 添加文件时的回调。 onRemove?: RemoveFileCallback; // 删除文件时的回调。 onRename?: RenameFileCallback; // 重命名文件时的回调,返回 false 取消重命名。 onDuplicated?: DuplicatedCallback; // 重名时的回调,返回 true 保留重复文件。 onExceededSize?: ExceededLimitCallback; // 超出大小时的回调,返回 true 保留超出大小文件。 onExceededTotalSize?: ExceededLimitCallback; // 超出总大小时的回调,返回 true 保留超出总大小文件。 onExceededCount?: ExceededLimitCallback; // 超出数量时的回调,返回 true 保留超出数量文件。

    API

    FileInfo

    文件信息对象。

    名称类型默认值说明
    namestring文件名。 size: number; // 文件大小。 id: string; // 文件唯一标识。 type: string; // 文件类型。 ext: string; // 文件扩展名。 url?: string; // 文件地址。 file?: File; // 文件对象。

    StaticFileInfo

    预设文件信息对象。

    名称类型默认值说明
    namestring文件名。 size: FileSize; // 文件大小。 type?: string; // 文件类型。 id?: string; // 文件唯一标识。 url?: string; // 文件地址。

    FileSize

    文件大小,字节数或带单位的大小,例如 1024'1KB'

    ts
    type FileSize = number | `${number}${'B' | 'KB' | 'MB' | 'GB' | 'TB'}`;

    DefaltFileInfo

    默认文件信息对象。

    ts
    type DefaltFileInfo = File | FileInfo | StaticFileInfo;

    FileButtonGenerator

    文件操作按钮属性生成器,返回 false 不显示按钮,返回 true 使用默认按钮,返回字符串使用默认按钮并设置文字,返回对象使用自定义按钮。

    ts
    type FileButtonGenerator = ((file: FileInfo) => (boolean | string | ButtonProps));

    FileAddCallback

    添加文件时的回调函数,返回 false 取消添加文件。

    ts
    type FileAddCallback = (file: FileInfo) => void | false;

    FileSelectCallback

    选择文件时的回调函数。

    ts
    type FileSelectCallback = (files: File[] | FileList) => void | false;

    RemoveFileCallback

    删除文件时的回调函数。

    ts
    (file: FileInfo) => void | false | Promise<void | false>;

    RenameFileCallback

    重命名文件时的回调函数,返回 false 取消重命名。

    ts
    type RenameFileCallback = (newName: string, oldName: string, file: FileInfo) => void | false | Promise<void | false>;

    DuplicatedCallback

    重名时的回调,返回 true 保留重复文件。

    ts
    type DuplicatedCallback = (name: string, currentFile: FileInfo, existFile: FileInfo) => void | true;

    ExceededLimitCallback

    超出限制时的回调函数,返回 true 忽略限制,否则取消添加文件。

    ts
    type ExceededLimitCallback = (limit: number, file: FileInfo) => void | true;

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/lib/components/kanban/index.html b/dev/lib/components/kanban/index.html index 6175ae1ce1..5a6bf66633 100644 --- a/dev/lib/components/kanban/index.html +++ b/dev/lib/components/kanban/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/lib/components/label/index.html b/dev/lib/components/label/index.html index 68eb2c4b9d..8489e1e8a4 100644 --- a/dev/lib/components/label/index.html +++ b/dev/lib/components/label/index.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    标签

    标签通常用于对内容进行标记。

    使用方法

    使用 .label 类来获得标签的外观和交互体验,通常用在元素 <span> 上。

    标签

    外观类型

    配合丰富的CSS 工具类来实现不同标签的外观。

    主要标签黑色标签描边浅色

    尺寸

    除了默认大小,标签还提供了额外的 2 种预设尺寸。

    小标签普通大小大标签

    圆角

    通过工具类 rounded-* 来应用不同的圆角样式。

    无圆角小圆角普通圆角中等圆角大圆角超大圆角完整圆角

    圆点标签

    当与工具类 label-dot 一起使用时则获得圆点标签。

    与按钮组合使用

    CSS 类

    标签提供了如下 CSS 类:

    类型作用
    label实体类元素作为标签组件
    label-dot工具类标签使用圆形外观
    size-sm工具类标签使用小号尺寸
    size-lg工具类标签使用大号尺寸

    CSS 变量

    变量名称变量含义
    --label-bg标签背景色
    --label-color标签文字颜色
    --label-border-color标签边框颜色
    --label-radius标签圆角

    MIT License (MIT)

    - +
    Skip to content

    标签

    标签通常用于对内容进行标记。

    使用方法

    使用 .label 类来获得标签的外观和交互体验,通常用在元素 <span> 上。

    标签

    外观类型

    配合丰富的CSS 工具类来实现不同标签的外观。

    主要标签黑色标签描边浅色

    尺寸

    除了默认大小,标签还提供了额外的 2 种预设尺寸。

    小标签普通大小大标签

    圆角

    通过工具类 rounded-* 来应用不同的圆角样式。

    无圆角小圆角普通圆角中等圆角大圆角超大圆角完整圆角

    圆点标签

    当与工具类 label-dot 一起使用时则获得圆点标签。

    与按钮组合使用

    CSS 类

    标签提供了如下 CSS 类:

    类型作用
    label实体类元素作为标签组件
    label-dot工具类标签使用圆形外观
    size-sm工具类标签使用小号尺寸
    size-lg工具类标签使用大号尺寸

    CSS 变量

    变量名称变量含义
    --label-bg标签背景色
    --label-color标签文字颜色
    --label-border-color标签边框颜色
    --label-radius标签圆角

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/lib/components/menu/index.html b/dev/lib/components/menu/index.html index 20652b3662..6a975a2784 100644 --- a/dev/lib/components/menu/index.html +++ b/dev/lib/components/menu/index.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    菜单

    菜单用于展示一个操作列表,也可以用于构建更复杂的组件,例如右键菜单、下拉菜单等。如果需要通过 JS 动态创建菜单,可以使用菜单生成器

    使用方法

    使用类 .menu.menu-item 按照如下结构来构建一个静态菜单:

    标题

    使用类 .menu-heading 来创建一个标题:

    分割线

    使用类 .divider 来添加一个分割线:

    包含图标

    可以在菜单项内添加图标,但如果是部分菜单项拥有图标,可以通过为 .menu 添加工具类 .has-icons 来让图标以及文本进行对齐:

    禁用的菜单项

    .menu-item 添加工具类 .disabled 来将菜单项禁用:

    标记激活项

    .menu-item 内的 <a> 元素添加工具类 .active 来将菜单项标记为激活状态:

    标记选中项

    .menu-item 内的 <a> 元素添加工具类 .active 来将菜单项标记为选中项状态:

    尾部图标

    直接将图标 .icon 元素添加到菜单项 .menu-item 内尾部,图标将自动靠右侧对齐:

    自定义菜单项

    .menu 内可以放置其他内容来自定义菜单项:

    CSS 类

    头像提供了如下 CSS 类:

    类型作用
    menu实体类元素作为菜单
    menu-item实体类元素作为菜单项
    menu-heading实体类元素作为菜单标题
    divider实体类元素作为分割线
    has-icons工具类menu 一起使用,标记菜单内包含图标
    active工具类标记菜单项为激活状态
    selected工具类标记菜单项为选中状态
    disabled工具类标记菜单项为禁用状态

    CSS 变量

    头像提供了如下 CSS 变量,可进行全局修改:

    CSS 变量名作用默认值
    --menu-radius菜单圆角var(--radius)
    --menu-bg菜单背景颜色var(--color-canvas)
    --menu-border菜单边框1px solid var(--color-border)
    --menu-shadow菜单阴影var(--shadow-lg)
    --menu-hover-bg菜单项鼠标悬停背景色var(--color-primary-500)
    --menu-hover-color菜单项鼠标悬停文字颜色var(--color-canvas)
    --menu-active-bg菜单项激活状态背景色var(--color-primary-50)
    --menu-active-color菜单项激活状态文字颜色var(--color-primary-500)
    --menu-icon-opacity菜单项图标透明度.5
    --menu-heading-color菜单标题文字颜色var(--color-gray-500)

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/components/menu/js.html b/dev/lib/components/menu/js.html index 70a687b79a..10aed3b010 100644 --- a/dev/lib/components/menu/js.html +++ b/dev/lib/components/menu/js.html @@ -14,8 +14,8 @@ - - + + @@ -150,7 +150,7 @@ key?: string | number, items?: MenuListItem[], };

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/components/messager/index.html b/dev/lib/components/messager/index.html index 7d1b7234ef..d65d993795 100644 --- a/dev/lib/components/messager/index.html +++ b/dev/lib/components/messager/index.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    浮动消息

    通过 JS 动态创建一个浮动消息。

    基本用法

    通过构造一个 messager 实例,页面上创建一个浮动消息。

    显示位置

    提供 9 个预设的显示位置,通过 placement 选项进行指定。

    颜色主题

    提供多种预设颜色主题,通过 type 选项指定外观工具类即可。

    禁用关闭按钮

    默认会在右侧显示关闭按钮,如果需要禁用关闭按钮,将 close 选项设置为 false

    自定义操作按钮

    通过 actions 数组来自定义一组操作。详细配置可参考 工具栏

    禁用自动隐藏

    默认超过 5000ms 自动隐藏,通过设置 time0 取消自动隐藏。

    禁用动画效果

    设置 animationfalse 禁用动画效果。

    选项

    名称类型默认值说明
    typestringnull消息类型 placement?: string; // 浮动消息定位方式,支持 'top' | 'center' | 'bottom' | 'left-top' | 'left' | 'left-bottom' | 'right' | 'right-top' | 'right-bottom' time?: number; // 浮动消息持续时间 content?: string; // 浮动消息内容 icon?: string; // 图标名称 actions?: object[]; // 操作按钮定义列表 margin?: number; // 外边距

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/components/modal/index.html b/dev/lib/components/modal/index.html index 08031ec64c..77dcfbc52b 100644 --- a/dev/lib/components/modal/index.html +++ b/dev/lib/components/modal/index.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    对话框

    在保留当前页面状态的情况下,直接使用触发按钮即可展现对话框,告知用户展示相关操作。

    使用方法

    使用 .modal.modal-dialog 类获得对话框的外观展示,通常用在元素 <div> 上。使用 [data-toggle="modal"] 指定对话框触发按钮,在触发按钮上通过 data-target 属性指定要打开的对话框。

    点击 a 标签按钮打开

    自定义位置

    使用 data-position 自定义设置对话框位置。可设置 fitcenter 或其具体像素值。

    尺寸

    除了默认大小,还提供了额外的 3 种预设尺寸。

    信息提示

    展示各种类型的信息提示,只提供一个按钮用于关闭。

    控制遮罩层

    通过 data-backdrop="false" 移除遮罩层,设置后可以操作模态框之外的交互。

    CSS 类

    对话框提供了如下 CSS 类:

    类型作用
    modal实体类元素作为对话框遮罩组件
    modal-dialog实体类元素作为对话框组件
    size-sm工具类对话框使用小号尺寸
    size-lg工具类对话框使用大号尺寸
    size-xl工具类对话框使用超大号尺寸

    CSS 变量

    对话框提供了如下 CSS 变量,可进行全局修改。

    CSS 变量名作用
    --modal-radius对话框默认圆角大小
    --modal-bg对话框遮挡层颜色
    --modal-sm对话框小号尺寸宽度
    --modal-base对话框默认宽度
    --modal-lg对话框大号尺寸宽度
    --modal-xl对话框超大号尺寸宽度

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/components/modal/trigger.html b/dev/lib/components/modal/trigger.html index 7f07495bb6..4462da9ced 100644 --- a/dev/lib/components/modal/trigger.html +++ b/dev/lib/components/modal/trigger.html @@ -14,8 +14,8 @@ - - + + @@ -55,7 +55,7 @@ /* 当用户点击确认或取消时的回调函数 */ onResult?: (confirmed: boolean, modal: Modal) => void; }

    该方法会通过 Promise 异步返回用户点击的按钮名称。

    下面为一个示例:

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/components/nav/index.html b/dev/lib/components/nav/index.html index 819b104bd1..3bbd8eff85 100644 --- a/dev/lib/components/nav/index.html +++ b/dev/lib/components/nav/index.html @@ -14,8 +14,8 @@ - - + + @@ -24,7 +24,7 @@ <li class="nav-heading">导航标题</li> ... </menu>

    导航样式

    除了默认样式,还可以通过修饰类为导航应用不同的样式。

    主要导航 .nav-primary

    次要导航 .nav-secondary

    圆点导航 .nav-pills

    标签导航 .nav-tabs

    步骤条 .nav-steps

    垂直排列

    使用修饰类 nav-stacked 使导航获得垂直排列样式,可搭配其他各种样式的导航使用。

    .nav-primary
    .nav-secondary
    .nav-pills
    .nav-tabs

    自适应宽度的导航

    使用修饰类 nav-justified 使导航获得自适应宽度样式,可搭配其他各种样式的导航使用。

    提示

    自适应宽度修饰类不能和垂直排列修饰类混用。

    CSS 类

    导航提供了如下 CSS 类

    类型作用
    nav实体类元素导航组件
    nav-item实体类元素导航条目组件
    nav-heading实体类导航标题组件
    nav-divider实体类导航分割线组件
    active修饰类为导航元素启用选中态样式
    nav-simple修饰类为导航元素启用简单样式
    nav-primary修饰类为导航元素启用主要导航样式
    nav-secondary修饰类为导航元素启用次要导航样式
    nav-tabs修饰类为导航元素启用标签风格导航样式
    nav-pills修饰类为导航元素启用标签风格导航样式
    nav-stacked修饰类为导航元素启用垂直排列导航样式
    nav-justified修饰类为导航元素启用自适应宽度导航样式

    CSS 变量

    变量名称变量含义
    --nav-heading-color导航标题字体颜色

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/components/nav/js.html b/dev/lib/components/nav/js.html index 42cb1c8385..3b8e795285 100644 --- a/dev/lib/components/nav/js.html +++ b/dev/lib/components/nav/js.html @@ -14,8 +14,8 @@ - - + + @@ -62,7 +62,7 @@ afterRender?: (info: {nav: nav, firstRender: boolean}) => void; beforeDestroy?: (info: {nav: nav}) => void; }

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/components/pager/index.html b/dev/lib/components/pager/index.html index 966b1e0fba..210131235f 100644 --- a/dev/lib/components/pager/index.html +++ b/dev/lib/components/pager/index.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    分页

    使用方法

    将多个按钮放置在 <div class="pager"> 内即可创建一个分页组件。

    简洁样式

    简单的翻页。

    状态

    为分页按钮添加 active 类标记选中,添加 disabled 类来禁用页码,被禁用的页码将无法响应点击事件。

    外观

    分页按钮间距

    使用 gap-* CSS 工具类 可获得宽松的分页组件。

    两边对齐

    结合使用 justify-between CSS 工具类 可获得页面两端对齐的分页组件。

    尺寸

    除了默认大小,还提供了额外的 2 种预设尺寸。可以通过为 pager 添加 size-* 类来获取其他尺寸外观。

    调整每页显示数

    结合使用 dropdown 下拉菜单组件 可展示调整每页显示数的分页组件。

    前往页码

    结合使用 input-group 输入组组件 可展示快速跳转到某一页的分页组件。

    CSS 类

    分页提供了如下 CSS 类:

    类型作用
    pager实体类元素作为分页组件
    pager-goto实体类元素作为分页的跳转组件
    pager-size-menu实体类元素作为分页的每页条数的下拉组件

    MIT License (MIT)

    - +
    Skip to content

    分页

    使用方法

    将多个按钮放置在 <div class="pager"> 内即可创建一个分页组件。

    简洁样式

    简单的翻页。

    状态

    为分页按钮添加 active 类标记选中,添加 disabled 类来禁用页码,被禁用的页码将无法响应点击事件。

    外观

    分页按钮间距

    使用 gap-* CSS 工具类 可获得宽松的分页组件。

    两边对齐

    结合使用 justify-between CSS 工具类 可获得页面两端对齐的分页组件。

    尺寸

    除了默认大小,还提供了额外的 2 种预设尺寸。可以通过为 pager 添加 size-* 类来获取其他尺寸外观。

    调整每页显示数

    结合使用 dropdown 下拉菜单组件 可展示调整每页显示数的分页组件。

    前往页码

    结合使用 input-group 输入组组件 可展示快速跳转到某一页的分页组件。

    CSS 类

    分页提供了如下 CSS 类:

    类型作用
    pager实体类元素作为分页组件
    pager-goto实体类元素作为分页的跳转组件
    pager-size-menu实体类元素作为分页的每页条数的下拉组件

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/lib/components/pager/js.html b/dev/lib/components/pager/js.html index d121602ab5..4dd991058e 100644 --- a/dev/lib/components/pager/js.html +++ b/dev/lib/components/pager/js.html @@ -14,8 +14,8 @@ - - + + @@ -167,7 +167,7 @@ render(element, <Pager {...options} />);

    使用Jquery 扩展

    js
    $(element).pager(options);
     
     const pager = $(element).data('zui.pager');

    选项

    linkCreator

    导航链接生成器,点击页码时进行页面地址更换。

    page

    初始状态的当前页码。

    recTotal

    总记录数目。

    recPerPage

    每页记录数。

    pageTotal

    总页数。

    items

    定义分页项的列表,可以通过一个函数动态返回分页组件。

    基于 工具栏 选项 和 自定义 PagerItemOptions 选项。

    onClickItem

    指定分页按钮的点击回调事件。

    API

    PagerInfo

    参数:

    page

    recTotal

    recPerPage

    pageTotal

    PagerItemOptions

    参数:

    type

    page

    text

    count

    format

    items

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/components/panel/index.html b/dev/lib/components/panel/index.html index d7a9803811..c2481c1543 100644 --- a/dev/lib/components/panel/index.html +++ b/dev/lib/components/panel/index.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    面板

    基本使用

    一个面板通常包含标题,内容,底部三部分。标题,底部可按需选择使用。

    面板标题

    面板内容

    不同主题

    除默认主题外,另外提供6种主题样式。

    面板标题
    面板内容
    面板标题
    面板内容
    面板标题
    面板内容
    面板标题
    面板内容
    面板标题
    面板内容
    面板标题
    面板内容

    面板组

    搭配CSS工具类 space-* 可实现面板组效果。

    面板标题
    面板内容
    面板标题
    面板内容
    面板标题
    面板内容

    与表格组合使用

    包含表格
    项目名称负责人计划开始计划完成
    ZUI1研发今天今天
    ZUI2研发明天明天
    ZUI3研发后天后天

    CSS 类

    面板提供了如下 CSS 类:

    类型作用
    panel实体类元素作为面板组件
    panel-heading实体类元素作为面板头部组件
    panel-title实体类元素作为面板头部标题组件
    panel-body实体类元素作为面板主体组件
    panel-footer实体类元素作为面板尾部组件

    CSS 变量

    面板提供了如下 CSS 变量:

    变量名称变量含义
    --panel-heading-bg标题背景色
    --panel-footer-bg底部背景色

    MIT License (MIT)

    - +
    Skip to content

    面板

    基本使用

    一个面板通常包含标题,内容,底部三部分。标题,底部可按需选择使用。

    面板标题

    面板内容

    不同主题

    除默认主题外,另外提供6种主题样式。

    面板标题
    面板内容
    面板标题
    面板内容
    面板标题
    面板内容
    面板标题
    面板内容
    面板标题
    面板内容
    面板标题
    面板内容

    面板组

    搭配CSS工具类 space-* 可实现面板组效果。

    面板标题
    面板内容
    面板标题
    面板内容
    面板标题
    面板内容

    与表格组合使用

    包含表格
    项目名称负责人计划开始计划完成
    ZUI1研发今天今天
    ZUI2研发明天明天
    ZUI3研发后天后天

    CSS 类

    面板提供了如下 CSS 类:

    类型作用
    panel实体类元素作为面板组件
    panel-heading实体类元素作为面板头部组件
    panel-title实体类元素作为面板头部标题组件
    panel-body实体类元素作为面板主体组件
    panel-footer实体类元素作为面板尾部组件

    CSS 变量

    面板提供了如下 CSS 变量:

    变量名称变量含义
    --panel-heading-bg标题背景色
    --panel-footer-bg底部背景色

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/lib/components/progress-circle/index.html b/dev/lib/components/progress-circle/index.html index 52b42beb50..c5c6234e4a 100644 --- a/dev/lib/components/progress-circle/index.html +++ b/dev/lib/components/progress-circle/index.html @@ -14,14 +14,14 @@ - - + + - - + + \ No newline at end of file diff --git a/dev/lib/components/progress/index.html b/dev/lib/components/progress/index.html index 3f3cd2514c..3a3bb1b5ee 100644 --- a/dev/lib/components/progress/index.html +++ b/dev/lib/components/progress/index.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    进度条

    使用方法

    使用 CSS 类 .progress.progress-bar 来创建进度条,通过为 .progress-bar 设置 CSS width 来展示进度。

    颜色主题

    .progress-bar 元素添加 .* 等颜色CSS工具类,得到各种颜色的进度条。

    圆角大小

    .progress 元素添加 .rounded-* CSS工具类,给进度条添加不同大小的圆角。

    特殊效果

    条纹效果

    .progress 元素添加 .progress-striped 工具类,给进度条添加条纹效果。

    动画效果

    给使用了 progress-striped 工具类的元素添加 .active 工具类,给条纹进度条添加向左滑动的动画。

    堆叠效果

    .progress 元素添加多个 progress-bar 元素,使多个进度条堆叠展示。

    CSS 类

    进度条提供了如下 CSS 类:

    类型作用
    progress实体类元素作为进度条容器组件
    progress-bar实体类元素作为进度条组件
    progress-striped工具类为进度条组件启用条纹样式
    active工具类为条纹样式进度条组件启用动画效果

    CSS 变量

    变量名称变量含义
    --progress-bg进度条组件背景颜色
    --progress-bar-color进度条组件颜色
    --progress-radius进度条组件圆角大小
    --progress-striped-size进度条组件条纹大小

    MIT License (MIT)

    - +
    Skip to content

    进度条

    使用方法

    使用 CSS 类 .progress.progress-bar 来创建进度条,通过为 .progress-bar 设置 CSS width 来展示进度。

    颜色主题

    .progress-bar 元素添加 .* 等颜色CSS工具类,得到各种颜色的进度条。

    圆角大小

    .progress 元素添加 .rounded-* CSS工具类,给进度条添加不同大小的圆角。

    特殊效果

    条纹效果

    .progress 元素添加 .progress-striped 工具类,给进度条添加条纹效果。

    动画效果

    给使用了 progress-striped 工具类的元素添加 .active 工具类,给条纹进度条添加向左滑动的动画。

    堆叠效果

    .progress 元素添加多个 progress-bar 元素,使多个进度条堆叠展示。

    CSS 类

    进度条提供了如下 CSS 类:

    类型作用
    progress实体类元素作为进度条容器组件
    progress-bar实体类元素作为进度条组件
    progress-striped工具类为进度条组件启用条纹样式
    active工具类为条纹样式进度条组件启用动画效果

    CSS 变量

    变量名称变量含义
    --progress-bg进度条组件背景颜色
    --progress-bar-color进度条组件颜色
    --progress-radius进度条组件圆角大小
    --progress-striped-size进度条组件条纹大小

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/lib/components/scrollbar/index.html b/dev/lib/components/scrollbar/index.html index 2caf73e0af..6eb5f89a43 100644 --- a/dev/lib/components/scrollbar/index.html +++ b/dev/lib/components/scrollbar/index.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    滚动条

    滚动条样式

    Lorem ipsum dolor sit amet consectetur adipisicing elit. Veniam, accusamus.Molestiae saepe deleniti voluptas excepturi nostrum. Consequatur eius non voluptates!Commodi omnis minus quo totam, ab aspernatur sequi vero cum?

    Explicabo asperiores recusandae qui? Aliquam similique eaque animi nemo? Fugiat.Cupiditate eaque, doloribus magnam velit ipsum maiores voluptatum eveniet rem!

    Pariatur sapiente laboriosam cumque itaque, id saepe commodi accusantium neque?

    Cupiditate eaque, doloribus magnam velit ipsum maiores voluptatum eveniet rem!

    Quidem eum, reiciendis iusto rem perspiciatis neque optio! Quae, sint!

    Maxime animi iure enim sint aperiam tempora non voluptatibus dolore.

    Suscipit cumque minus veritatis labore dolor corporis molestias. Rem, pariatur.

    Commodi omnis minus quo totam, ab aspernatur sequi vero cum?

    Repellendus rerum tempora eos praesentium at placeat, quas quibusdam sunt?

    Molestiae saepe deleniti voluptas excepturi nostrum. Consequatur eius non voluptates!

    窄滚动条样式

    Lorem ipsum dolor sit amet consectetur adipisicing elit. Veniam, accusamus.Molestiae saepe deleniti voluptas excepturi nostrum. Consequatur eius non voluptates!Commodi omnis minus quo totam, ab aspernatur sequi vero cum?

    Explicabo asperiores recusandae qui? Aliquam similique eaque animi nemo? Fugiat.Cupiditate eaque, doloribus magnam velit ipsum maiores voluptatum eveniet rem!

    Pariatur sapiente laboriosam cumque itaque, id saepe commodi accusantium neque?

    Cupiditate eaque, doloribus magnam velit ipsum maiores voluptatum eveniet rem!

    Quidem eum, reiciendis iusto rem perspiciatis neque optio! Quae, sint!

    Maxime animi iure enim sint aperiam tempora non voluptatibus dolore.

    Suscipit cumque minus veritatis labore dolor corporis molestias. Rem, pariatur.

    Commodi omnis minus quo totam, ab aspernatur sequi vero cum?

    Repellendus rerum tempora eos praesentium at placeat, quas quibusdam sunt?

    Molestiae saepe deleniti voluptas excepturi nostrum. Consequatur eius non voluptates!

    仅鼠标悬停时显示

    Lorem ipsum dolor sit amet consectetur adipisicing elit. Veniam, accusamus.Molestiae saepe deleniti voluptas excepturi nostrum. Consequatur eius non voluptates!Commodi omnis minus quo totam, ab aspernatur sequi vero cum?

    Explicabo asperiores recusandae qui? Aliquam similique eaque animi nemo? Fugiat.Cupiditate eaque, doloribus magnam velit ipsum maiores voluptatum eveniet rem!

    Pariatur sapiente laboriosam cumque itaque, id saepe commodi accusantium neque?

    Cupiditate eaque, doloribus magnam velit ipsum maiores voluptatum eveniet rem!

    Quidem eum, reiciendis iusto rem perspiciatis neque optio! Quae, sint!

    Maxime animi iure enim sint aperiam tempora non voluptatibus dolore.

    Suscipit cumque minus veritatis labore dolor corporis molestias. Rem, pariatur.

    Commodi omnis minus quo totam, ab aspernatur sequi vero cum?

    Repellendus rerum tempora eos praesentium at placeat, quas quibusdam sunt?

    Molestiae saepe deleniti voluptas excepturi nostrum. Consequatur eius non voluptates!

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/components/search-box/index.html b/dev/lib/components/search-box/index.html index 0f6b5645e1..e8a4f78d28 100644 --- a/dev/lib/components/search-box/index.html +++ b/dev/lib/components/search-box/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/lib/components/table/index.html b/dev/lib/components/table/index.html index a23750ccc5..194b9019c3 100644 --- a/dev/lib/components/table/index.html +++ b/dev/lib/components/table/index.html @@ -14,8 +14,8 @@ - - + + @@ -23,7 +23,7 @@
    Skip to content

    表格

    表格用于展示二维数据。

    使用方法

    <table> 元素添加 CSS 类 .table 来使用表格。

    组成部分元素标签说明
    表头<thead>表头通常作为表格第一行,用于展示所有数据的各个属性名称。
    主体<tbody>一个或多个行组成表格的主体,每行用于展示一个数据。
    表尾<tfoot>表尾通常用于展示一些数据的汇总信息。
    总计3 个部分

    斑马纹表格

    <table class="table"> 上使用工具类 .table-striped 斑马纹表格外观(隔行变色)效果。

    :: tabs

    == 示例

    版本发布时间主要特性
    1.02021-03-01第一个版本发布!
    1.12021-04-12修复了大量已知问题。
    1.22021-05-18新的编辑器,让创意更容易展现。
    2.02021-06-05这次版本带来全新的界面外观
    2.12021-07-31新的预览功能,更方便的提前查看最终效果!

    == HTML

    html
    <table class="table table-striped">
       ...
     </table>

    :::

    鼠标悬停变色

    <table class="table"> 上使用工具类 .table-hover,当鼠标悬停在行上时显示不一样的背景。

    版本发布时间主要特性
    1.02021-03-01第一个版本发布!
    1.12021-04-12修复了大量已知问题。
    1.22021-05-18新的编辑器,让创意更容易展现。
    2.02021-06-05这次版本带来全新的界面外观
    2.12021-07-31新的预览功能,更方便的提前查看最终效果!

    完整边框

    <table class="table"> 上使用工具类 .bordered,为表格添加所有边框。

    版本发布时间主要特性
    1.02021-03-01第一个版本发布!
    1.12021-04-12修复了大量已知问题。
    1.22021-05-18新的编辑器,让创意更容易展现。
    2.02021-06-05这次版本带来全新的界面外观
    2.12021-07-31新的预览功能,更方便的提前查看最终效果!

    无边框

    <table class="table"> 上使用工具类 .borderless,为表格移除所有边框。

    版本发布时间主要特性
    1.02021-03-01第一个版本发布!
    1.12021-04-12修复了大量已知问题。
    1.22021-05-18新的编辑器,让创意更容易展现。
    2.02021-06-05这次版本带来全新的界面外观
    2.12021-07-31新的预览功能,更方便的提前查看最终效果!

    紧凑的表格

    <table class="table"> 上使用工具类 .condensed 来获得更紧凑的表格。表格中的单元格拥有更小的间距,整体行高减少。

    版本发布时间主要特性
    1.02021-03-01第一个版本发布!
    1.12021-04-12修复了大量已知问题。
    1.22021-05-18新的编辑器,让创意更容易展现。
    2.02021-06-05这次版本带来全新的界面外观
    2.12021-07-31新的预览功能,更方便的提前查看最终效果!

    固定布局的表格

    <table class="table"> 上使用工具类 .table-fixed 来将表格布局方式设置为 fixed

    版本发布时间主要特性
    1.02021-03-01第一个版本发布!
    1.12021-04-12修复了大量已知问题。
    1.22021-05-18新的编辑器,让创意更容易展现。
    2.02021-06-05这次版本带来全新的界面外观。
    3.02021-07-31这一次说说关于表格的固定布局,当启用固定布局时,后续行中的单元格内容将不会对表格布局产生影响,当单元格内的文本过长时会被截断隐藏。

    关于表格的固定布局

    表格和列的宽度通过表格的宽度来设置,某一列的宽度仅由该列首行的单元格决定。在当前列中,该单元格所在行之后的行并不会影响整个列宽。

    使用“fixed”布局方式时,整个表格可以在其首行被下载后就被解析和渲染。这样对于“automatic”自动布局方式来说可以加速渲染,但是其后的单元格内容并不会自适应当前列宽。任何一个包含溢出内容的单元格可以使用 overflow 属性控制是否允许内容溢出。

    参考:https://developer.mozilla.org/zh-CN/docs/Web/CSS/table-layout

    自动宽度

    通常表格宽度为 100%,与表格所属的父级元素宽度保持一致,但有时希望表格的宽度能够按照实际内容宽度展示。此时可以通过配合使用 CSS 工具类 w-auto 来设置表格宽度为自动,同时推荐使用工具类 max-w-full 来限制表格最大宽度不超过父级元素宽度(100%)。

    版本发布时间主要特性
    1.02021-03-01第一个版本发布!
    1.12021-04-12修复了大量已知问题。
    1.22021-05-18新的编辑器,让创意更容易展现。
    2.02021-06-05这次版本带来全新的界面外观
    2.12021-07-31新的预览功能,更方便的提前查看最终效果!

    特殊外观

    为行元素 <tr> 或单元格 <td><th> 应用 CSS 工具类 来获得特殊外观。

    版本发布时间主要特性
    1.02021-03-01第一个版本发布!
    1.12021-04-12修复了大量已知问题。
    1.22021-05-18新的编辑器,让创意更容易展现。
    2.02021-06-05这次版本带来全新的界面外观
    2.12021-07-31新的预览功能,更方便的提前查看最终效果!

    CSS 类

    按钮提供了如下 CSS 类:

    类型作用
    table实体类元素作为表格组件
    table-striped工具类为表格启用斑马纹效果
    table-hover工具类为表格启用行悬停变色效果
    table-fixed工具类为表格启用固定布局
    borderless工具类移除表格所有边框
    bordered工具类为表格添加完整边框
    condensed工具类为表格启用紧凑布局

    CSS 变量

    变量名称变量含义
    --table-head-bg表头背景色
    --table-striped-color表格斑马纹行背景色
    --table-hover-color表格行响应鼠标悬停变化背景颜色
    --table-border-color表格边框颜色

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/components/tabs/index.html b/dev/lib/components/tabs/index.html index 0af0129663..560c1eb293 100644 --- a/dev/lib/components/tabs/index.html +++ b/dev/lib/components/tabs/index.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    标签页

    使用方法

    标签页一般配合导航使用,通过 .nav 来定义切换的触发器,通过 .tab-content 来定义切换的内容。标签页内容使用 .tab-pane 作为容器元素,所有供切换显示的 .tab-pane 放置在 .tab-content 容器元素内。

    提示

    为确保在页面显示的时候标签页能够指示正确的标签和显示正确的内容,在初始状态需要为当前选中的导航项目 li.nav-item > a 元素添加 .active 类,并且为当前显示的标签页内容元素 .tab-pane 添加 .active 类。

    为导航上每个用于切换标签内容的链接添加 hrefdata-target 属性指向当前标签页内容 .tab-paneid ,并添加 data-toggle="tab" 属性。

    我是标签1。

    我是标签2。

    我是标签3。

    动画效果

    为每个 .tab-pane 添加 .fade,可以使得标签内容在显示时获得渐变动画效果。在初始状态要显示的标签页内容 .tab-pane 不仅需要添加 .active 类,还需要添加 .in 类。

    我是标签1。

    我是标签2。

    我是标签3。

    垂直标签页

    使用 .nav-tabs.nav-stacked 获得垂直排列的标签导航,使用 flex 布局来使得导航和标签页内容水平排列。

    我是标签1。

    我是标签2。

    我是标签3。

    事件

    当显示一个新的标签页时,这些事件会被触发:

    • show: 当前标签页在显示时触发;
    • shown: 当前标签页在显示后(动画执行完毕)触发。

    通过为 [data-toggle="tab"] 链接添加 data-name 属性,这样事件触发时会传递该属性值作为参数,如果不指定则使用 [data-target] 的值作为参数。

    我是标签1。

    我是标签2。

    我是标签3。

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/components/toolbar/index.html b/dev/lib/components/toolbar/index.html index ad4edc5904..5f584c06a2 100644 --- a/dev/lib/components/toolbar/index.html +++ b/dev/lib/components/toolbar/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/lib/components/toolbar/js.html b/dev/lib/components/toolbar/js.html index 27b580f0a1..0150d042bd 100644 --- a/dev/lib/components/toolbar/js.html +++ b/dev/lib/components/toolbar/js.html @@ -14,8 +14,8 @@ - - + + @@ -152,7 +152,7 @@ render(element, <Toolbar {...options} />);

    使用 jQuery 扩展

    js
    $(element).toolbar(options);
     
     const toolbar = $(element).data('zui.toolbar');

    选项

    操作菜单 选项基础上添加新的参数选项。

    wrap

    限制工具栏按钮过多超出时是否换行。

    gap

    自定义工具栏按钮的间距,与 .toolbar 同级生成 .gap-* 的工具类控制按钮间距。

    items

    继承了 操作菜单 选项和按钮选项,同时添加了其他选项。

    btnProps

    继承按钮组件的属性, 统一处理工具栏按钮属性外观等。

    itemRender

    指定一个回调函数用于对组件渲染进行自定义。

    参数items 选项的单个配置;

    返回值items 选项的单个配置。

    beforeRender

    指定一个回调函数在渲染之前调用,可重新配置组件选项。

    参数:用户为按钮组组件件设置的 options

    返回值:组件选项数据。

    afterRender

    指定一个回调函数在渲染之后调用。

    参数:

    beforeDestroy

    指定一个回调函数在组件销毁之前调用,无参数。

    API

    ToolbarItemOptions

    ts
    type ToolbarItemOptions = ToolbarItemProps | ToolbarDropdownProps | ToolbarBtnGroupProps | ToolbarDividerProps | ToolbarSpaceProps;

    ToolbarItemProps

    选项:

    继承了操作菜单的 ActionItemProps 选项和按钮的 ButtonProps ,同时添加了其他选项 btnType,用来设置按钮外观类型。

    btnType

    设置工具栏单个按钮的外观类型。

    ToolbarDropdownProps

    选项:

    在原有属性基础上固定 type 属性,并继承了下拉菜单的 DropdownButtonOptions 选项,同时添加了其他选项。

    type
    children

    ToolbarBtnGroupProps

    选项:

    在原有属性基础上固定 type 属性,并继承了操作菜单的 ActionBasicProps 选项和按钮组的 BtnGroupOptions选项,同时添加了其他选项。

    type

    ToolbarDividerProps

    选项:

    继承了工具栏的 ActionDividerProps 选项。

    ToolbarSpaceProps

    选项:

    继承了工具栏的 ActionSpaceProps 选项。

    type
    space
    flex

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/components/tooltip/index.html b/dev/lib/components/tooltip/index.html index db825ec72f..006521e31e 100644 --- a/dev/lib/components/tooltip/index.html +++ b/dev/lib/components/tooltip/index.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    提示消息

    提示消息又称“工具提示”,在鼠标悬停在元素上时及时显示额外的内容。

    使用方法

    组件提供多种不同方向的展示方式,可以根据需求选择你要的效果。

    触发方式

    除了默认的鼠标悬浮展示信息外,组件也提供了点击触发的方式。

    外观

    指定 type 选项来更改外观类型。

    选项

    名称类型默认值说明
    titlestringnull提示消息内容 placement?: string; // 弹出方向,可选值包括:'top-start' | 'top' | 'top-end' | 'bottom-start' | 'bottom' | 'bottom-end' | 'left-start' | 'left' | 'left-end' | 'right-start' | 'right' | 'right-end' trigger?: string; // 触发方式,可选值包括:'click' | 'hover' className?: string; // 类名 type?: string; // 外观类型,可选值包括:'primary' | 'secondary' | 'warning' | 'success' | 'danger' | 'important' | 'gray' animation?: boolean; // 是否应用淡入淡出动画 arrow?: number | number; // 箭头大小 delay?: boolean | number; // 延迟显示,可选值包括:true | false | number hideOthers?: boolean; // 显示时隐藏其他已经显示的提示消息

    MIT License (MIT)

    - +
    Skip to content

    提示消息

    提示消息又称“工具提示”,在鼠标悬停在元素上时及时显示额外的内容。

    使用方法

    组件提供多种不同方向的展示方式,可以根据需求选择你要的效果。

    触发方式

    除了默认的鼠标悬浮展示信息外,组件也提供了点击触发的方式。

    外观

    指定 type 选项来更改外观类型。

    选项

    名称类型默认值说明
    titlestringnull提示消息内容 placement?: string; // 弹出方向,可选值包括:'top-start' | 'top' | 'top-end' | 'bottom-start' | 'bottom' | 'bottom-end' | 'left-start' | 'left' | 'left-end' | 'right-start' | 'right' | 'right-end' trigger?: string; // 触发方式,可选值包括:'click' | 'hover' className?: string; // 类名 type?: string; // 外观类型,可选值包括:'primary' | 'secondary' | 'warning' | 'success' | 'danger' | 'important' | 'gray' animation?: boolean; // 是否应用淡入淡出动画 arrow?: number | number; // 箭头大小 delay?: boolean | number; // 延迟显示,可选值包括:true | false | number hideOthers?: boolean; // 显示时隐藏其他已经显示的提示消息

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/lib/components/tree/index.html b/dev/lib/components/tree/index.html index b61cbb0642..ce265fdd3d 100644 --- a/dev/lib/components/tree/index.html +++ b/dev/lib/components/tree/index.html @@ -14,8 +14,8 @@ - - + + @@ -181,7 +181,7 @@ /** 工具栏定义。 */ actions?: ToolbarOptions | ToolbarItemOptions[]; };

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/components/upload-imgs/index.html b/dev/lib/components/upload-imgs/index.html index 7ab798d439..dd1b91e996 100644 --- a/dev/lib/components/upload-imgs/index.html +++ b/dev/lib/components/upload-imgs/index.html @@ -14,8 +14,8 @@ - - + + @@ -40,7 +40,7 @@ tip: '可点击添加或拖拽上传,图片格式支持jpg、jpeg', accept: 'image/jpg, image/jpeg' });

    选项

    name

    表单字段名。

    showSize

    是否显示文件大小。

    multiple

    是否开启多文件上传。

    uploadText

    上传按钮文本。

    uploadIcon

    上传按钮图标。

    renameBtn

    是否启用重命名按钮。

    renameIcon

    重命名按钮图标。

    renameText

    重命名按钮文本。

    renameClass

    重命名按钮类。

    deleteBtn

    是否启用删除按钮。

    deleteIcon

    删除按钮图标。

    deleteText

    删除按钮文本。

    deleteClass

    删除按钮类。

    tip

    文件上传提示。

    btnClass

    上传按钮类。

    onAdd

    文件变更回调。

    onDelete

    删除文件回调。

    onRename

    重命名文件回调。

    onSizeChange

    文件大小变更回调。

    limitCount

    上传文件最大数量限制。

    accept

    上传文件类型。

    defaultFileList

    默认文件列表。

    limitSize

    上传文件最大大小限制。

    duplicatedHint

    重复文件提示。

    onDuplicated

    文件重复回调。

    exceededSizeHint

    超出大小限制提示。

    onExceededSize

    超出大小限制回调。

    exceededCountHint

    超过数量限制提示。

    onExceededCount

    超过数量限制回调

    totalCountText

    文件数量提示。

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/components/upload/index.html b/dev/lib/components/upload/index.html index ecfc3da920..52b433b813 100644 --- a/dev/lib/components/upload/index.html +++ b/dev/lib/components/upload/index.html @@ -14,8 +14,8 @@ - - + + @@ -56,7 +56,7 @@ name: 'files8', defaultFileList: [file1, file2] });

    选项

    name

    表单字段名。

    icon

    文件图标。

    showIcon

    是否显示文件图标。

    showSize

    是否显示文件大小。

    multiple

    是否开启多文件上传。

    listPosition

    文件列表位置。

    uploadText

    上传按钮文本。

    uploadIcon

    上传按钮图标。

    renameBtn

    是否启用重命名按钮。

    renameIcon

    重命名按钮图标。

    renameText

    重命名按钮文本。

    renameClass

    重命名按钮类。

    deleteBtn

    是否启用删除按钮。

    deleteIcon

    删除按钮图标。

    deleteText

    删除按钮文本。

    deleteClass

    删除按钮类。

    confirmText

    确认重命名按钮文本。

    cancelText

    取消重命名按钮文本。

    useIconBtn

    是否使用图标按钮。

    tip

    文件上传提示。

    btnClass

    上传按钮类。

    onAdd

    文件变更回调。

    onDelete

    删除文件回调。

    onRename

    重命名文件回调。

    onSizeChange

    文件大小变更回调。

    draggable

    是否启用拖拽功能。

    limitCount

    上传文件最大数量限制。

    accept

    上传文件类型。

    defaultFileList

    默认文件列表。

    limitSize

    上传文件最大大小限制。

    duplicatedHint

    重复文件提示。

    onDuplicated

    文件重复回调。

    exceededSizeHint

    超出大小限制提示。

    onExceededSize

    超出大小限制回调。

    exceededCountHint

    超过数量限制提示。

    onExceededCount

    超过数量限制回调

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/forms/checkbox/index.html b/dev/lib/forms/checkbox/index.html index 649da29572..69d06a0d37 100644 --- a/dev/lib/forms/checkbox/index.html +++ b/dev/lib/forms/checkbox/index.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    复选框和单选框

    复选框(checkbox)允许用户选择多个选项,不同于 <select>,这些选项是直接展示的。为 <input type="checkbox"> 设置 disabled 属性来应用禁用样式,如果为 .checkbox 添加 disabled 类,则整个复选框包括文字部分都会应用禁用样式。将多个复选框堆叠形成一个复选框组。

    基本使用

    复选框

    单选框列表

    单选框通常多个一起使用组成列表,将多个单选框放在 .check-list 中即可。

    复选框列表

    复选框也支持多个一起使用组成列表,将多个复选框放在 .check-list 中即可。

    不包含文字样式

    复选框

    单选框

    内联形式

    为让多个复选框或单选框内联显示,可以将他们放置在一个 .check-list-inline 中。

    内联多选框

    内联单选框

    内联间距

    可以通过工具类 gap-* 来设置内联的复选框和单选框间的间距。

    高级外观

    高级外观的多选框和单选框使用自定义的外观代替原生外观,在所有浏览器都具有一致的体验。

    高级外观的复选框

    高级外观的单选框

    <input> 选择框

    高级外观还可以不使用 <input> 元素,在此种情况下,为 .checkbox-primary.radio-primary 添加 .checked 类标记为选中状态,通过 focus 类来标记激活状态,用户无法通过点击来切换选中状态,但可以通过程序手动添加或移除 .checked 来更改选中状态。

    设置高级外观颜色

    通过设置 CSS 变量 --checkbox-color 可以设置高级外观颜色。

    CSS 类

    单选框和复选框提供了如下 CSS 类:

    类型作用
    checkbox实体类复选框组件
    radio实体类单选框组件
    check-list实体类复选框或单选框列表组件
    check-list-inline实体类复选框或单选框内联列表组件
    checkbox-primary实体类高级外观的复选框组件
    radio-primary实体类高级外观的单选框组件
    checked修饰类强制使用选中外观
    focus修饰类强制使用激活外观
    disabled修饰类强制使用禁用外观
    indeterminate修饰类强制使用 Indeterminate 外观

    CSS 变量

    单选框和复选框提供了如下 CSS 变量:

    CSS 变量名作用
    --checkbox-size复选框或单选框大小,仅当使用高级外观时有效
    --checkbox-color复选框或单选框颜色,仅当使用高级外观时有效

    MIT License (MIT)

    - +
    Skip to content

    复选框和单选框

    复选框(checkbox)允许用户选择多个选项,不同于 <select>,这些选项是直接展示的。为 <input type="checkbox"> 设置 disabled 属性来应用禁用样式,如果为 .checkbox 添加 disabled 类,则整个复选框包括文字部分都会应用禁用样式。将多个复选框堆叠形成一个复选框组。

    基本使用

    复选框

    单选框列表

    单选框通常多个一起使用组成列表,将多个单选框放在 .check-list 中即可。

    复选框列表

    复选框也支持多个一起使用组成列表,将多个复选框放在 .check-list 中即可。

    不包含文字样式

    复选框

    单选框

    内联形式

    为让多个复选框或单选框内联显示,可以将他们放置在一个 .check-list-inline 中。

    内联多选框

    内联单选框

    内联间距

    可以通过工具类 gap-* 来设置内联的复选框和单选框间的间距。

    高级外观

    高级外观的多选框和单选框使用自定义的外观代替原生外观,在所有浏览器都具有一致的体验。

    高级外观的复选框

    高级外观的单选框

    <input> 选择框

    高级外观还可以不使用 <input> 元素,在此种情况下,为 .checkbox-primary.radio-primary 添加 .checked 类标记为选中状态,通过 focus 类来标记激活状态,用户无法通过点击来切换选中状态,但可以通过程序手动添加或移除 .checked 来更改选中状态。

    设置高级外观颜色

    通过设置 CSS 变量 --checkbox-color 可以设置高级外观颜色。

    CSS 类

    单选框和复选框提供了如下 CSS 类:

    类型作用
    checkbox实体类复选框组件
    radio实体类单选框组件
    check-list实体类复选框或单选框列表组件
    check-list-inline实体类复选框或单选框内联列表组件
    checkbox-primary实体类高级外观的复选框组件
    radio-primary实体类高级外观的单选框组件
    checked修饰类强制使用选中外观
    focus修饰类强制使用激活外观
    disabled修饰类强制使用禁用外观
    indeterminate修饰类强制使用 Indeterminate 外观

    CSS 变量

    单选框和复选框提供了如下 CSS 变量:

    CSS 变量名作用
    --checkbox-size复选框或单选框大小,仅当使用高级外观时有效
    --checkbox-color复选框或单选框颜色,仅当使用高级外观时有效

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/lib/forms/checkbox/switch.html b/dev/lib/forms/checkbox/switch.html index e802d2a5c9..b34c8855db 100644 --- a/dev/lib/forms/checkbox/switch.html +++ b/dev/lib/forms/checkbox/switch.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    开关

    基本使用

    与单选框和复选框的高级外观一样,通过 .switch 类来启用开关外观。

    开关颜色

    通过设置 CSS 变量 --checkbox-color 可以设置高级外观颜色。

    开关列表

    垂直列表

    通过将多个开关放置在 .check-list 中,可以实现一个开关列表:

    内联列表

    通过将多个开关放置在 .check-list 中,可以实现一个开关内联列表:

    列表联动

    通过开关内部使用的 input[type="checkbox"] 更换为 input[type="radio"],并指定为相同的 name 属性,即可实现多个开关单选联动:

    CSS 类

    开关提供了如下 CSS 类:

    类型作用
    switch实体类开关组件
    check-list实体类开关列表组件
    check-list-inline实体类开关内联列表组件
    checked修饰类强制使用选中外观
    focus修饰类强制使用激活外观
    disabled修饰类强制使用禁用外观

    CSS 变量

    单选框和复选框提供了如下 CSS 变量:

    CSS 变量名作用
    --checkbox-color开关颜色,仅当使用高级外观时有效

    MIT License (MIT)

    - +
    Skip to content

    开关

    基本使用

    与单选框和复选框的高级外观一样,通过 .switch 类来启用开关外观。

    开关颜色

    通过设置 CSS 变量 --checkbox-color 可以设置高级外观颜色。

    开关列表

    垂直列表

    通过将多个开关放置在 .check-list 中,可以实现一个开关列表:

    内联列表

    通过将多个开关放置在 .check-list 中,可以实现一个开关内联列表:

    列表联动

    通过开关内部使用的 input[type="checkbox"] 更换为 input[type="radio"],并指定为相同的 name 属性,即可实现多个开关单选联动:

    CSS 类

    开关提供了如下 CSS 类:

    类型作用
    switch实体类开关组件
    check-list实体类开关列表组件
    check-list-inline实体类开关内联列表组件
    checked修饰类强制使用选中外观
    focus修饰类强制使用激活外观
    disabled修饰类强制使用禁用外观

    CSS 变量

    单选框和复选框提供了如下 CSS 变量:

    CSS 变量名作用
    --checkbox-color开关颜色,仅当使用高级外观时有效

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/lib/forms/datetime-picker/date.html b/dev/lib/forms/datetime-picker/date.html index 48ffed1571..f23bc520f9 100644 --- a/dev/lib/forms/datetime-picker/date.html +++ b/dev/lib/forms/datetime-picker/date.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    日期选择器

    用法

    设置默认值

    通过 defaultValue 选项设置默认值,设置为 'today' 可以将默认值设置为当天。

    格式化

    通过 format 选项设置日期格式化形式,支持日期辅助方法 formatDate 中的所有格式。

    限制日期范围

    通过 minDatemaxDate 来限制可选的日期范围。

    自定义菜单

    通过 menu 选项可以在弹出面板侧面显示一个自定义菜单,通过 actions 可以自定义底部工具栏上的按钮。在菜单项和按钮上通过 [data-set-date] 属性指定点击按钮时要设定的日期。

    自定义侧边菜单

    通过 menu 选项可以在弹出面板左侧显示一个自定义菜单,在菜单项配置上通过 [data-set-date] 属性指定点击菜单项时要设定的日期。

    自定义底部按钮

    通过 actions 可以自定义底部工具栏上的按钮,在菜单项和按钮上通过 [data-set-date] 属性指定点击按钮时要设定的日期。

    选项

    名称类型默认值说明
    classNameanynull组件根元素的类名。 style?: object; // 组件根元素的样式。 tagName?: string; // 组件根元素的标签名。 attrs?: object; // 附加到组件根元素上的属性。 clickType?: 'toggle' | 'open'; // 点击类型,toggle 表示点击按钮时切换显示隐藏,open 表示点击按钮时只打开。 name?: string; // 作为表单项的名称。 defaultValue?: 'today' | string; // 默认值。 onChange?: function; // 值变更时的回调函数。 disabled?: boolean; // 是否禁用。 readonly?: boolean; // 是否只读,不允许手动修改。 required?: boolean; // 是否必须提供值(不能清除和选择空值)。 placeholder?: string; // 输入框上占位文本。 format?: string; // 日期格式,默认 yyyy-MM-dd。 icon?: string | object; // 在输入框右侧显示的图标。 weekNames?: string[]; // 星期名称,索引为 0 表示周日。 monthNames?: string[]; // 月份名称,索引为 0 表示一月份。 yearText?: string; // 用于显示年份的格式化文本。 todayText?: string; // 用于显示“今天”的文本。 clearText?: string; // 用于显示“清除”的文本。 weekStart?: number; // 一周从星期几开始,默认 1。 minDate?: DateLike; // 最小可选的日期。 maxDate?: DateLike; // 最大可选的日期。 menu?: object[] | object; // 左侧显示的菜单设置。 actions?: object[] | object; // 底部工具栏设置。 onInvalid?: function; // 日期值无效时的回调函数。

    MIT License (MIT)

    - +
    Skip to content

    日期选择器

    用法

    设置默认值

    通过 defaultValue 选项设置默认值,设置为 'today' 可以将默认值设置为当天。

    格式化

    通过 format 选项设置日期格式化形式,支持日期辅助方法 formatDate 中的所有格式。

    限制日期范围

    通过 minDatemaxDate 来限制可选的日期范围。

    自定义菜单

    通过 menu 选项可以在弹出面板侧面显示一个自定义菜单,通过 actions 可以自定义底部工具栏上的按钮。在菜单项和按钮上通过 [data-set-date] 属性指定点击按钮时要设定的日期。

    自定义侧边菜单

    通过 menu 选项可以在弹出面板左侧显示一个自定义菜单,在菜单项配置上通过 [data-set-date] 属性指定点击菜单项时要设定的日期。

    自定义底部按钮

    通过 actions 可以自定义底部工具栏上的按钮,在菜单项和按钮上通过 [data-set-date] 属性指定点击按钮时要设定的日期。

    选项

    名称类型默认值说明
    classNameanynull组件根元素的类名。 style?: object; // 组件根元素的样式。 tagName?: string; // 组件根元素的标签名。 attrs?: object; // 附加到组件根元素上的属性。 clickType?: 'toggle' | 'open'; // 点击类型,toggle 表示点击按钮时切换显示隐藏,open 表示点击按钮时只打开。 name?: string; // 作为表单项的名称。 defaultValue?: 'today' | string; // 默认值。 onChange?: function; // 值变更时的回调函数。 disabled?: boolean; // 是否禁用。 readonly?: boolean; // 是否只读,不允许手动修改。 required?: boolean; // 是否必须提供值(不能清除和选择空值)。 placeholder?: string; // 输入框上占位文本。 format?: string; // 日期格式,默认 yyyy-MM-dd。 icon?: string | object; // 在输入框右侧显示的图标。 weekNames?: string[]; // 星期名称,索引为 0 表示周日。 monthNames?: string[]; // 月份名称,索引为 0 表示一月份。 yearText?: string; // 用于显示年份的格式化文本。 todayText?: string; // 用于显示“今天”的文本。 clearText?: string; // 用于显示“清除”的文本。 weekStart?: number; // 一周从星期几开始,默认 1。 minDate?: DateLike; // 最小可选的日期。 maxDate?: DateLike; // 最大可选的日期。 menu?: object[] | object; // 左侧显示的菜单设置。 actions?: object[] | object; // 底部工具栏设置。 onInvalid?: function; // 日期值无效时的回调函数。

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/lib/forms/datetime-picker/datetime.html b/dev/lib/forms/datetime-picker/datetime.html index 8e9093803b..298384545b 100644 --- a/dev/lib/forms/datetime-picker/datetime.html +++ b/dev/lib/forms/datetime-picker/datetime.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    日期时间选择器

    日期时间选择器允许用户通过下拉面板同时选择日期和时间。

    用法

    设置默认值

    通过 defaultValue 选项设置默认值,设置为 'today' 可以将默认值设置为现在时间。

    格式化

    通过 format 选项设置日期和时间的格式化形式。

    限制日期范围

    通过 minDatemaxDate 来限制可选的日期范围。

    自定义菜单

    通过 menu 选项可以在弹出面板左侧显示一个自定义菜单,通过 actions 可以自定义底部工具栏上的按钮。在菜单项和按钮上通过 [data-set-date] 属性指定点击按钮时要设定的日期。

    自定义左侧菜单

    通过 menu 选项可以在弹出面板左侧显示一个自定义菜单,在菜单项配置上通过 [data-set-date] 属性指定点击菜单项时要设定的日期。

    自定义底部按钮

    通过 actions 可以自定义底部工具栏上的按钮,在菜单项和按钮上通过 [data-set-date] 属性指定点击按钮时要设定的日期。

    选项

    名称类型默认值说明
    classNameanynull组件根元素的类名。 style?: object; // 组件根元素的样式。 tagName?: string; // 组件根元素的标签名。 attrs?: object; // 附加到组件根元素上的属性。 clickType?: 'toggle' | 'open'; // 点击类型,toggle 表示点击按钮时切换显示隐藏,open 表示点击按钮时只打开。 name?: string; // 作为表单项的名称。 defaultValue?: 'today' | string; // 默认值。 onChange?: function; // 值变更时的回调函数。 disabled?: boolean; // 是否禁用。 readonly?: boolean; // 是否只读,不允许手动修改。 required?: boolean; // 是否必须提供值(不能清除和选择空值)。 placeholder?: string; // 输入框上占位文本。 format?: string; // 日期格式,默认 yyyy-MM-dd。 icon?: string | object; // 在输入框右侧显示的图标。 weekNames?: string[]; // 星期名称,索引为 0 表示周日。 monthNames?: string[]; // 月份名称,索引为 0 表示一月份。 yearText?: string; // 用于显示年份的格式化文本。 todayText?: string; // 用于显示“今天”的文本。 clearText?: string; // 用于显示“清除”的文本。 weekStart?: number; // 一周从星期几开始,默认 1。 minDate?: DateLike; // 最小可选的日期。 maxDate?: DateLike; // 最大可选的日期。 menu?: object[] | object; // 左侧显示的菜单设置。 actions?: object[] | object; // 底部工具栏设置。 onInvalid?: function; // 日期值无效时的回调函数。 minuteStep?: number; // 分钟选择间隔,默认 5(分钟)。

    MIT License (MIT)

    - +
    Skip to content

    日期时间选择器

    日期时间选择器允许用户通过下拉面板同时选择日期和时间。

    用法

    设置默认值

    通过 defaultValue 选项设置默认值,设置为 'today' 可以将默认值设置为现在时间。

    格式化

    通过 format 选项设置日期和时间的格式化形式。

    限制日期范围

    通过 minDatemaxDate 来限制可选的日期范围。

    自定义菜单

    通过 menu 选项可以在弹出面板左侧显示一个自定义菜单,通过 actions 可以自定义底部工具栏上的按钮。在菜单项和按钮上通过 [data-set-date] 属性指定点击按钮时要设定的日期。

    自定义左侧菜单

    通过 menu 选项可以在弹出面板左侧显示一个自定义菜单,在菜单项配置上通过 [data-set-date] 属性指定点击菜单项时要设定的日期。

    自定义底部按钮

    通过 actions 可以自定义底部工具栏上的按钮,在菜单项和按钮上通过 [data-set-date] 属性指定点击按钮时要设定的日期。

    选项

    名称类型默认值说明
    classNameanynull组件根元素的类名。 style?: object; // 组件根元素的样式。 tagName?: string; // 组件根元素的标签名。 attrs?: object; // 附加到组件根元素上的属性。 clickType?: 'toggle' | 'open'; // 点击类型,toggle 表示点击按钮时切换显示隐藏,open 表示点击按钮时只打开。 name?: string; // 作为表单项的名称。 defaultValue?: 'today' | string; // 默认值。 onChange?: function; // 值变更时的回调函数。 disabled?: boolean; // 是否禁用。 readonly?: boolean; // 是否只读,不允许手动修改。 required?: boolean; // 是否必须提供值(不能清除和选择空值)。 placeholder?: string; // 输入框上占位文本。 format?: string; // 日期格式,默认 yyyy-MM-dd。 icon?: string | object; // 在输入框右侧显示的图标。 weekNames?: string[]; // 星期名称,索引为 0 表示周日。 monthNames?: string[]; // 月份名称,索引为 0 表示一月份。 yearText?: string; // 用于显示年份的格式化文本。 todayText?: string; // 用于显示“今天”的文本。 clearText?: string; // 用于显示“清除”的文本。 weekStart?: number; // 一周从星期几开始,默认 1。 minDate?: DateLike; // 最小可选的日期。 maxDate?: DateLike; // 最大可选的日期。 menu?: object[] | object; // 左侧显示的菜单设置。 actions?: object[] | object; // 底部工具栏设置。 onInvalid?: function; // 日期值无效时的回调函数。 minuteStep?: number; // 分钟选择间隔,默认 5(分钟)。

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/lib/forms/datetime-picker/time.html b/dev/lib/forms/datetime-picker/time.html index 3140ba9302..aee1cd95a3 100644 --- a/dev/lib/forms/datetime-picker/time.html +++ b/dev/lib/forms/datetime-picker/time.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    时间选择器

    用法

    设置默认值

    通过 defaultValue 选项设置默认值,设置为 'now' 可以将默认值设置为页面显示的时刻。

    格式化

    通过 format 选项设置日期格式化形式,支持日期辅助方法 formatDate 中的所有格式。

    选项

    名称类型默认值说明

    MIT License (MIT)

    - +
    Skip to content

    时间选择器

    用法

    设置默认值

    通过 defaultValue 选项设置默认值,设置为 'now' 可以将默认值设置为页面显示的时刻。

    格式化

    通过 format 选项设置日期格式化形式,支持日期辅助方法 formatDate 中的所有格式。

    选项

    名称类型默认值说明

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/lib/forms/form-control/index.html b/dev/lib/forms/form-control/index.html index 2fbae9d9d0..57dc4a81bc 100644 --- a/dev/lib/forms/form-control/index.html +++ b/dev/lib/forms/form-control/index.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    表单控件

    输入框

    输入框通过为 <input> 元素添加类 form-control 实现,支持通过 type 属性设置输入框类型。

    选择框

    通过为 <select> 元素添加 form-control 类来使用选择框,包括单选和多选模式。

    单选框

    多选框

    TIP

    使用多选框时通常需要指定多选框高度。

    多行文本框

    通过为 <textarea> 元素添加 form-control 类来使用多行文本框。

    特殊表单控件

    在浏览器支持的情况下,还可以为 type 设置一些特殊类型。

    日期

    设置 <input type="date">

    时间

    设置 <input type="time">

    日期时间

    设置 <input type="datetime-local">

    月份

    设置 <input type="month">

    周数

    设置 <input type="week">

    范围

    设置 <input type="range">

    颜色

    设置 <input type="color">

    文件

    设置 <input type="file">

    尺寸

    通过为表单控件添加 size-* 工具类来设置尺寸。

    禁用

    通过为表单控件添加 disabled 属性来禁用表单控件。

    只读

    通过为表单控件添加 readonly 属性来表单控件只读。

    特殊状态

    通过为表单控件或者其直接父级元素添加工具类 has-errorhas-warninghas-error 来让其拥有特殊语义的状态。

    CSS 类

    表单控件提供了如下 CSS 类:

    类型作用
    form-control实体类元素作为表单控件组件
    size-sm工具类表单控件使用小号尺寸
    size-lg工具类表单控件使用大号尺寸

    CSS 变量

    表单控件提供了如下 CSS 变量,可进行全局修改。

    CSS 变量名作用
    --form-control-radius圆角
    --form-control-border边框颜色
    --form-control-focus激活颜色
    --form-control-disabled禁用颜色
    --form-control-readonly只读颜色

    MIT License (MIT)

    - +
    Skip to content

    表单控件

    输入框

    输入框通过为 <input> 元素添加类 form-control 实现,支持通过 type 属性设置输入框类型。

    选择框

    通过为 <select> 元素添加 form-control 类来使用选择框,包括单选和多选模式。

    单选框

    多选框

    TIP

    使用多选框时通常需要指定多选框高度。

    多行文本框

    通过为 <textarea> 元素添加 form-control 类来使用多行文本框。

    特殊表单控件

    在浏览器支持的情况下,还可以为 type 设置一些特殊类型。

    日期

    设置 <input type="date">

    时间

    设置 <input type="time">

    日期时间

    设置 <input type="datetime-local">

    月份

    设置 <input type="month">

    周数

    设置 <input type="week">

    范围

    设置 <input type="range">

    颜色

    设置 <input type="color">

    文件

    设置 <input type="file">

    尺寸

    通过为表单控件添加 size-* 工具类来设置尺寸。

    禁用

    通过为表单控件添加 disabled 属性来禁用表单控件。

    只读

    通过为表单控件添加 readonly 属性来表单控件只读。

    特殊状态

    通过为表单控件或者其直接父级元素添加工具类 has-errorhas-warninghas-error 来让其拥有特殊语义的状态。

    CSS 类

    表单控件提供了如下 CSS 类:

    类型作用
    form-control实体类元素作为表单控件组件
    size-sm工具类表单控件使用小号尺寸
    size-lg工具类表单控件使用大号尺寸

    CSS 变量

    表单控件提供了如下 CSS 变量,可进行全局修改。

    CSS 变量名作用
    --form-control-radius圆角
    --form-control-border边框颜色
    --form-control-focus激活颜色
    --form-control-disabled禁用颜色
    --form-control-readonly只读颜色

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/lib/forms/form/index.html b/dev/lib/forms/form/index.html index 39fcf7cb4b..0d1376a9bb 100644 --- a/dev/lib/forms/form/index.html +++ b/dev/lib/forms/form/index.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    表单

    基本用法

    <form> 元素使用类 .form 类来获得表单外观,将表单控件放置在表单控件组 .form-group 内,将表单操作按钮放置在表单操作栏 .form-actions 中。

    水平布局的表单

    <form> 元素使用类 .form-horz 类来让表单实现水平布局。

    在水平布局表单中,如果需要在一行包含多个表单控件,可以使用 .form-row 类,下面是一个更复杂的例子:

    可以放在同一行的字段满足:可连着填写,字段意义上有相似性
    此表单项为必填
    强关联字段,有灰色底色进行连接,3个以上框的自适应宽度

    网格布局

    <form> 元素使用类 .form-grid 类来让表单实现网格布局。

    .form-group 添加 w-* 辅助类来设置宽度
    项目类型
    -

    帮助性文本

    使用 form-tip 来显示帮助性的文本并添加到表单控件组中。

    校验状态

    通过为表单控件组添加 has-warninghas-errorhas-success 类即可应用相应的效验状态样式。这些样式会影响到表单控件组内的 label.form-control.form-tip 元素。

    表单分组

    使用fieldset 将多个表单控件放置在一起进行分组。在<fieldset> 内使用 <legend> 来定义分组标题。

    账号信息
    额外内容

    标记必填项

    标记必填项的一种通用方法是在标签上添加星标 * , 在表单控件组中只需要为表单组标签 .form-label 添加 required 类。

    水平布局的表单中也可以使用:

    CSS 类

    表单提供了如下 CSS 类

    类型作用
    form-group实体类元素作为表单组件
    form-label实体类元素作为表单组标签
    form-control实体类元素作为表单控件组件
    form-tip实体类元素作为表单控件的提示性文本
    form-actions实体类元素作为表单按钮容器
    form-grid修饰类为表单启用水平排列样式
    required修饰类为表单控件启用必填标记样式
    has-error修饰类为表单控件启用报错样式
    has-warning修饰类为表单控件启用警告样式
    has-success修饰类为表单控件启用成功样式

    CSS 变量

    变量名称变量含义
    --form-label-color表单组标签颜色
    --form-tip-color帮助性文本默认颜色
    --form-grid-label-width水平布局时表单表单组标签宽度

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/forms/input-control/index.html b/dev/lib/forms/input-control/index.html index 4e2a9d714d..fc076e5503 100644 --- a/dev/lib/forms/input-control/index.html +++ b/dev/lib/forms/input-control/index.html @@ -14,19 +14,19 @@ - - + + -
    Skip to content

    输入框

    通过鼠标或键盘输入内容,可以在输入框前后位置包含额外的文本或图标,通常用在表单、对话框上面。

    基本使用

    使用 input-control 类来获得输入框的外观和交互体验。

    用户名
    用户名验证失败

    包含图标和按钮

    前缀和后缀

    通过结合类 has-prefix has-suffix 在输入框上添加前缀或后缀图标或字符。

    除了预设的前 / 后缀宽度,还预设了其他两种尺寸,结合 has-prefix-*has-suffix-* 类进行不同宽度展示。

    用户名
    有效身份证号码

    尺寸

    除了默认大小,输入框还提供了额外的 2 种预设尺寸。

    小号尺寸

    用户名
    有效身份证号码

    默认尺寸

    用户名
    有效身份证号码

    大号尺寸

    用户名
    有效身份证号码

    外观类型

    配合使用CSS 工具类来实现不同输入框的外观。下面展示各种工具类的外观效果。

    html
    <div class="input-control">
    +    
    Skip to content

    输入框

    通过鼠标或键盘输入内容,可以在输入框前后位置包含额外的文本或图标,通常用在表单、对话框上面。

    基本使用

    使用 input-control 类来获得输入框的外观和交互体验。

    用户名
    用户名验证失败

    包含图标和按钮

    前缀和后缀

    通过结合类 has-prefix has-suffix 在输入框上添加前缀或后缀图标或字符。

    除了预设的前 / 后缀宽度,还预设了其他两种尺寸,结合 has-prefix-*has-suffix-* 类进行不同宽度展示。

    用户名
    有效身份证号码

    尺寸

    除了默认大小,输入框还提供了额外的 2 种预设尺寸。

    小号尺寸

    用户名
    有效身份证号码

    默认尺寸

    用户名
    有效身份证号码

    大号尺寸

    用户名
    有效身份证号码

    外观类型

    配合使用CSS 工具类来实现不同输入框的外观。下面展示各种工具类的外观效果。

    html
    <div class="input-control">
       <input type="text" class="form-control circle" placeholder="请填写" />
     </div>
     <div class="input-control">
       <input type="text" class="form-control shadow" placeholder="请填写" />
     </div>

    CSS 类

    输入框提供了如下 CSS 类:

    类型作用
    input-control实体类元素作为输入框组件
    input-control-prefix工具类输入框前缀元素样式
    input-control-suffix工具类输入框后缀元素样式
    has-prefix工具类标记输入框拥有前缀元素
    has-suffix工具类标记输入框拥有后缀元素
    has-prefix-icon工具类标记输入框拥有前缀图标
    has-suffix-icon工具类标记输入框拥有后缀图标
    size-sm工具类输入框使用小号尺寸
    size-lg工具类输入框使用大号尺寸

    CSS 变量

    输入框提供了如下 CSS 变量,可进行全局修改。

    CSS 变量名作用
    --input-fix-width输入框前/后缀的默认宽度
    --input-fix-width-sm输入框前/后缀的小号宽度
    --input-fix-width-lg输入框前/后缀的大号宽度

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/forms/input-group/index.html b/dev/lib/forms/input-group/index.html index a3b29e3a0c..52ffd71525 100644 --- a/dev/lib/forms/input-group/index.html +++ b/dev/lib/forms/input-group/index.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    输入组

    通过在文本输入框 <input> 前面、后面或是两边加上文字、图标或按钮,可以实现对表单控件的扩展。

    使用方法

    在元素使用工具类 .input-group 作为输入组容器,然后在内部添加表单控件、按钮或附加文本(.input-group-addon)。

    账号
    密码

    组合方式

    在输入组内部可以将不同的内容按需组合使用,包括附加文本(.input-group-addon)、表单控件(.form-control)、按钮(.btn)。

    登录

    尺寸

    除了默认大小,输入组还提供了额外的 2 种预设尺寸,通过修饰类 .size-* 来应用尺寸。

    登录
    登录
    登录

    CSS 类

    输入组提供了如下 CSS 类:

    类型作用
    input-group实体类元素作为输入组组件
    input-group-addon实体类元素作为输入组内部额外元素
    size-sm工具类输入组使用小号尺寸
    size-lg工具类输入组使用大号尺寸

    CSS 变量

    变量名称变量含义
    --input-group-addon-bg输入组附加部分背景颜色

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/forms/picker/index.html b/dev/lib/forms/picker/index.html index 97c5e35634..1dacffff7c 100644 --- a/dev/lib/forms/picker/index.html +++ b/dev/lib/forms/picker/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/lib/helpers/helpers/date-helper.html b/dev/lib/helpers/helpers/date-helper.html index 79b3eaac3c..ea3aeb69a9 100644 --- a/dev/lib/helpers/helpers/date-helper.html +++ b/dev/lib/helpers/helpers/date-helper.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    日期辅助方法

    createDate

    创建日期时间对象。

    定义:

    ts
    function createDate(dateLike: string | number | Date): Date;

    参数

    • dateLike:日期时间对象或者日期时间字符串或者时间戳。

    返回值Date:日期时间对象。

    addDate

    在一个日期时间对象上增加指定的时间。

    定义:

    ts
    function addDate(dateLike: string | number | Date, value: number, unit: string): Date;

    参数:

    • dateLike:日期时间对象或者日期时间字符串或者时间戳;
    • value:增加的时间值;
    • unit:增加的时间单位,可选值为:yearmonthdayhourminutesecond

    返回值: Date:日期时间对象。

    formatDate

    格式化日期时间对象。

    定义:

    ts
    function formatDate(dateLike: string | number | Date, format = 'yyyy-MM-dd hh:mm', invalidDateValue = ''): string;

    参数:

    • dateLike:日期时间对象或者日期时间字符串或者时间戳;
    • format:格式化字符串,可选值为:yyyyMMddhhmmssSSS
    • invalidDateValue:无效日期时间对象时的返回值。

    返回值: string:格式化后的日期时间字符串。

    所有支持的格式化占位符包括:

      • yyyy,例如:2018,表示四位数字表示的年份
      • yy,例如:18,表示两位数字表示的年份
      • MM,例如:07,表示两位数字表示的月份,不足两位在起始用 0 填充
      • M,例如:10,表示一位或两位数字表示的月份
      • dd,例如:05,表示两位数字表示的日期,不足两位在起始用 0 填充
      • d,例如:5,表示一位或两位数字表示的日期
      • hh,例如:08,表示两位数字表示的小时,不足两位在起始用 0 填充
      • h,例如:8,表示一位或两位数字表示的小时
      • mm,例如:03,表示两位数字表示的分钟,不足两位在起始用 0 填充
      • m,例如:3,表示一位或两位数字表示的分钟
      • ss,例如:05,表示两位数字表示的秒数,不足两位在起始用 0 填充
      • s,例如:5,表示一位或两位数字表示的秒数
      • S,例如:236,表示毫秒数
      • SSS,例如:036,表示毫秒数,不足3位在起始用 0 填充

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/helpers/helpers/string-helper.html b/dev/lib/helpers/helpers/string-helper.html index 22869cf6ed..6d760a258c 100644 --- a/dev/lib/helpers/helpers/string-helper.html +++ b/dev/lib/helpers/helpers/string-helper.html @@ -14,8 +14,8 @@ - - + + @@ -25,7 +25,7 @@ /** 通过映射对象的形式格式化字符串。 */ function formatString(str: string, map: Record<string, unknown>): string;

    参数

    • str:字符串;
    • args:格式化参数;
    • map:格式化参数映射对象。

    返回值string:格式化后的字符串。

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/helpers/store/index.html b/dev/lib/helpers/store/index.html index b794c9141a..52515a062e 100644 --- a/dev/lib/helpers/store/index.html +++ b/dev/lib/helpers/store/index.html @@ -14,8 +14,8 @@ - - + + @@ -41,7 +41,7 @@ store.get('mySecretCode'); // 返回 1 myStore.get('mySecretCode'); // 返回 2 mySessionStore.get('mySecretCode'); // 返回 3

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/lib/index.html b/dev/lib/index.html index 2f470af45d..701c9dca1b 100644 --- a/dev/lib/index.html +++ b/dev/lib/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/public/zui/icons/fontawesome-license.html b/dev/public/zui/icons/fontawesome-license.html index 17f9e93e78..4631f52da4 100644 --- a/dev/public/zui/icons/fontawesome-license.html +++ b/dev/public/zui/icons/fontawesome-license.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    License

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/themes/index.html b/dev/themes/index.html index ee9f43b6d3..60958fd7e3 100644 --- a/dev/themes/index.html +++ b/dev/themes/index.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/backgrounds/utilities/index.html b/dev/utilities/backgrounds/utilities/index.html index 23605236f9..3b15cbb467 100644 --- a/dev/utilities/backgrounds/utilities/index.html +++ b/dev/utilities/backgrounds/utilities/index.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    背景色

    效果

    使用工具类 bg-* 给元素添加背景色。

    语义化
    bg-primary
    bg-secondary
    bg-success
    bg-warning
    bg-danger
    bg-important
    bg-special
    主色系列
    bg-primary-50
    bg-primary-100
    bg-primary-200
    bg-primary-300
    bg-primary-400
    bg-primary-500
    bg-primary-600
    bg-primary-700
    bg-primary-800
    bg-primary-900
    bg-primary-950
    次要系列
    bg-secondary-50
    bg-secondary-100
    bg-secondary-200
    bg-secondary-300
    bg-secondary-400
    bg-secondary-500
    bg-secondary-600
    bg-secondary-700
    bg-secondary-800
    bg-secondary-900
    bg-secondary-950
    灰度
    bg-gray-50
    bg-gray-100
    bg-gray-200
    bg-gray-300
    bg-gray-400
    gray
    bg-gray-500 别名: bg-gray
    bg-gray-600
    bg-gray-700
    bg-gray-800
    bg-gray-900
    bg-gray-950
    界面
    bg-white
    纯白
    bg-black
    纯黑
    bg-transparent
    透明
    bg-canvas
    画布
    bg-inverse
    反色
    bg-surface-light
    加重的控件
    bg-surface
    控件
    bg-surface-strong
    轻量的控件
    bg-fore
    前景色作为背景
    bg-focus
    焦点色作为背景
    特殊
    bg-current
    CSS 值 currentColor
    bg-inherit
    CSS 值 inherit
    bg-none
    无背景

    背景色透明度

    使用工具类 bg-opacity-* 给元素设置背景色透明度。

    bg-opacity-0
    透明度:0%
    bg-opacity-5
    透明度:5%
    bg-opacity-10
    透明度:10%
    bg-opacity-20
    透明度:20%
    bg-opacity-25
    透明度:25%
    bg-opacity-30
    透明度:30%
    bg-opacity-40
    透明度:40%
    bg-opacity-50
    透明度:60%
    bg-opacity-60
    透明度:60%
    bg-opacity-70
    透明度:70%
    bg-opacity-75
    透明度:75%
    bg-opacity-80
    透明度:80%
    bg-opacity-90
    透明度:90%
    bg-opacity-95
    透明度:95%
    bg-opacity-100
    透明度:0%

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/borders/utilities/border-color.html b/dev/utilities/borders/utilities/border-color.html index 2acfb8b8d6..441ae2e88a 100644 --- a/dev/utilities/borders/utilities/border-color.html +++ b/dev/utilities/borders/utilities/border-color.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    边框颜色

    效果

    使用工具类 border-* 给元素添加边框颜色。

    默认
    border-light
    border
    border-strong
    语义化
    border-primary
    border-secondary
    border-success
    border-warning
    border-danger
    border-important
    border-special
    灰度
    border-gray-50
    border-gray-100
    border-gray-200
    border-gray-300
    border-gray-400
    gray
    border-gray-500 别名: border-gray
    border-gray-600
    border-gray-700
    border-gray-800
    border-gray-900
    border-gray-950
    界面
    border-white
    纯白
    border-black
    纯黑
    border-transparent
    透明
    border-canvas
    画布
    border-inverse
    反色
    border-surface-light
    加重的控件
    border-surface
    控件
    border-surface-strong
    轻量的控件
    border-fore
    前景色作为边框颜
    border-focus
    焦点色作为边框颜
    特殊
    border-current
    CSS 值 currentColor
    border-inherit
    CSS 值 inherit

    提示

    border 外,其他工具类只设置边框颜色,如果需要启用边框,需要将 border-*border 类一起使用,例如 border border-primary

    边框颜色透明度

    使用工具类 border-opacity-* 给元素添加边框颜色透明度。

    border-opacity-0
    透明度:0%
    border-opacity-5
    透明度:5%
    border-opacity-10
    透明度:10%
    border-opacity-20
    透明度:20%
    border-opacity-25
    透明度:25%
    border-opacity-30
    透明度:30%
    border-opacity-40
    透明度:40%
    border-opacity-50
    透明度:60%
    border-opacity-60
    透明度:60%
    border-opacity-70
    透明度:70%
    border-opacity-75
    透明度:75%
    border-opacity-80
    透明度:80%
    border-opacity-90
    透明度:90%
    border-opacity-95
    透明度:95%
    border-opacity-100
    透明度:0%

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/borders/utilities/border-radius.html b/dev/utilities/borders/utilities/border-radius.html index 9727eb57f3..cc865800b0 100644 --- a/dev/utilities/borders/utilities/border-radius.html +++ b/dev/utilities/borders/utilities/border-radius.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    边框圆角

    效果

    使用 'rounded-* 设置元素边框圆角大小。

    所有边
    rounded-none
    rounded-sm
    rounded
    rounded-lg
    rounded-xl
    rounded-2xl
    rounded-3xl
    rounded-full
    禁用特定边
    rounded-t-none
    rounded-r-none
    rounded-b-none
    rounded-l-none
    rounded-br-none
    rounded-bl-none
    rounded-tr-none
    rounded-tl-none

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/borders/utilities/border-width.html b/dev/utilities/borders/utilities/border-width.html index 9f527ce91d..d9e1fe4981 100644 --- a/dev/utilities/borders/utilities/border-width.html +++ b/dev/utilities/borders/utilities/border-width.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    边框大小

    效果

    使用 'rounded-* 设置元素边框大小。

    所有边
    border-0
    border
    border-2
    border-4
    上边框
    border-t-0
    border-t
    border-t-2
    border-t-4
    右边框
    border-r-0
    border-r
    border-r-2
    border-r-4
    下边框
    border-b-0
    border-b
    border-b-2
    border-b-4
    左边框
    border-l-0
    border-l
    border-l-2
    border-l-4

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/borders/utilities/divider.html b/dev/utilities/borders/utilities/divider.html index 200481a280..abf6efcd57 100644 --- a/dev/utilities/borders/utilities/divider.html +++ b/dev/utilities/borders/utilities/divider.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/utilities/borders/utilities/ring-color.html b/dev/utilities/borders/utilities/ring-color.html index b597dc8b3d..e58fcb6ca4 100644 --- a/dev/utilities/borders/utilities/ring-color.html +++ b/dev/utilities/borders/utilities/ring-color.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    环颜色

    效果

    通过 ring-* 来为元素添加通过 box-shadow 实现的环边框颜色。

    作为边框
    ring-border-light
    ring-border
    ring-border-strong
    透明度反色
    ring-light
    ring-gray
    ring-dark
    ring-darker
    ring-darkest
    语义化
    ring-primary
    ring-secondary
    ring-success
    ring-warning
    ring-danger
    ring-important
    ring-special
    灰度
    ring-gray-50
    ring-gray-100
    ring-gray-200
    ring-gray-300
    ring-gray-400
    ring-gray-500
    ring-gray-600
    ring-gray-700
    ring-gray-800
    ring-gray-900
    ring-gray-950
    界面
    ring-white
    纯白
    ring-black
    纯黑
    ring-canvas
    画布
    ring-inverse
    反色
    ring-surface
    控件
    ring-fore
    前景色
    ring-focus
    焦点色
    特殊
    ring-current
    CSS 值 currentColor
    ring-inherit
    CSS 值 inherit

    环颜色透明度

    使用工具类 ring-opacity-* 给元素添加背景色透明度。

    ring-opacity-0
    透明度:0%
    ring-opacity-5
    透明度:5%
    ring-opacity-10
    透明度:10%
    ring-opacity-20
    透明度:20%
    ring-opacity-25
    透明度:25%
    ring-opacity-30
    透明度:30%
    ring-opacity-40
    透明度:40%
    ring-opacity-50
    透明度:60%
    ring-opacity-60
    透明度:60%
    ring-opacity-70
    透明度:70%
    ring-opacity-75
    透明度:75%
    ring-opacity-80
    透明度:80%
    ring-opacity-90
    透明度:90%
    ring-opacity-95
    透明度:95%
    ring-opacity-100
    透明度:0%

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/borders/utilities/ring-offset.html b/dev/utilities/borders/utilities/ring-offset.html index 1d8e2ec322..50f0a190d1 100644 --- a/dev/utilities/borders/utilities/ring-offset.html +++ b/dev/utilities/borders/utilities/ring-offset.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/utilities/borders/utilities/ring-width.html b/dev/utilities/borders/utilities/ring-width.html index f13bdd8e3b..35df627130 100644 --- a/dev/utilities/borders/utilities/ring-width.html +++ b/dev/utilities/borders/utilities/ring-width.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/utilities/effects/utilities/animation.html b/dev/utilities/effects/utilities/animation.html index bc981b4663..836bca85a8 100644 --- a/dev/utilities/effects/utilities/animation.html +++ b/dev/utilities/effects/utilities/animation.html @@ -14,8 +14,8 @@ - - + + @@ -35,7 +35,7 @@ </div>

    弹跳

    使用 animate-bounce 给元素添加弹跳动画。

    html
    <button type="button" class="btn primary">
       <i class="bounce icon icon-arrow-down"></i> 下载
     </button>

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/effects/utilities/filter.html b/dev/utilities/effects/utilities/filter.html index 5b9f848884..2c4e69aa25 100644 --- a/dev/utilities/effects/utilities/filter.html +++ b/dev/utilities/effects/utilities/filter.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    CSS 滤镜

    高斯模糊

    通过 blur-* 给图片添加高斯模糊样式。

    原始
    blur-none
    blur-sm
    blur
    blur-md
    blur-lg
    blur-xl

    灰度和反色

    通过 grayscale 将图像转为灰度图像;通过 invert 将图像设置为反色。

    原始
    grayscale
    invert

    形状阴影

    通过 drop-shadow-* 给元素设置形状阴影效果,通常用在图片上。

    原始
    drop-shadow-none
    drop-shadow-sm
    drop-shadow
    drop-shadow-md
    drop-shadow-lg
    drop-shadow-xl
    drop-shadow-2xl

    背景模糊

    通过 backdrop-blur-* 添加覆盖区域模糊样式。

    原始
    backdrop-blur-none
    backdrop-blur-sm
    backdrop-blur
    backdrop-blur-md
    backdrop-blur-lg
    backdrop-blur-xl
    backdrop-blur-2xl
    backdrop-blur-3xl

    禁用滤镜

    通过 filter-none 来禁用之前添加的滤镜效果。

    filter-none

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/effects/utilities/opacity.html b/dev/utilities/effects/utilities/opacity.html index 79688a7c76..7e05788ce0 100644 --- a/dev/utilities/effects/utilities/opacity.html +++ b/dev/utilities/effects/utilities/opacity.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/utilities/effects/utilities/shadow.html b/dev/utilities/effects/utilities/shadow.html index a6d794b4f0..516647ccf4 100644 --- a/dev/utilities/effects/utilities/shadow.html +++ b/dev/utilities/effects/utilities/shadow.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/utilities/effects/utilities/transform.html b/dev/utilities/effects/utilities/transform.html index f55c18ea51..a46c62eb9e 100644 --- a/dev/utilities/effects/utilities/transform.html +++ b/dev/utilities/effects/utilities/transform.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    变换

    使用 CSS transform 对元素应用变换效果。

    缩放

    通过 scale-* 为元素应用缩放效果。

    原始
    scale-0
    scale-50
    scale-75
    scale-90
    scale-95
    scale-100
    scale-105
    scale-110
    scale-125
    scale-150

    旋转

    通过 rotate-* 为元素应用旋转效果。

    原始
    rotate-0
    rotate-1
    rotate-2
    rotate-3
    rotate-6
    rotate-12
    rotate-45
    rotate-90
    rotate-135
    rotate-180
    rotate-270

    翻转

    添加 flip-* 给元素添加翻转效果。

    原始
    flip-x
    flip-y

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/effects/utilities/transition.html b/dev/utilities/effects/utilities/transition.html index d6b8cb5821..971776b0c0 100644 --- a/dev/utilities/effects/utilities/transition.html +++ b/dev/utilities/effects/utilities/transition.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    过渡动画

    过渡属性

    通过 transition-* 为元素应用过渡动画,并制定过渡目标属性。

    transition
    transition
    all
    transition-all
    colors
    transition-colors
    opacity
    transition-opacity
    shadow
    transition-shadow
    transform
    transition-transform

    过渡时间

    通过 duration-* 为元素应用过渡动画时间。

    75ms
    duration-75
    100ms
    duration-100
    200ms
    duration-200
    300ms
    duration-300
    500ms
    duration-500
    1000ms
    duration-1000

    渐隐渐显

    通过 fade-* 来为元素设置渐隐渐显动画效果,默认元素不显示,通过控制添加 in 类让元素渐显。

    默认
    默认
    fade
    从中心显示
    从中心显示
    fade-from-center
    从下方显示
    从下方显示
    fade-from-bottom
    从上方显示
    从上方显示
    fade-from-top
    从左侧显示
    从左侧显示
    fade-from-left
    从右侧显示
    从右侧显示
    fade-from-right

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/flex/utilities/align-content.html b/dev/utilities/flex/utilities/align-content.html index fcc0109c88..f213e92d39 100644 --- a/dev/utilities/flex/utilities/align-content.html +++ b/dev/utilities/flex/utilities/align-content.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    align-content

    使用 content-* 应用CSS align-content 属性设置 Flex 容器中多行子元素沿交叉轴的对齐方式。

    效果展示

    content-center

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    content-start

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    content-end

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    content-between

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    content-around

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    content-evenly

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/flex/utilities/align-items.html b/dev/utilities/flex/utilities/align-items.html index c35b14f0d5..dab9f4041e 100644 --- a/dev/utilities/flex/utilities/align-items.html +++ b/dev/utilities/flex/utilities/align-items.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/utilities/flex/utilities/align-self.html b/dev/utilities/flex/utilities/align-self.html index 087d4be954..dffffca5ae 100644 --- a/dev/utilities/flex/utilities/align-self.html +++ b/dev/utilities/flex/utilities/align-self.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    align-self

    使用 self-* 应用 CSS align-self 属性设置当前元素在 Grid 或 Flex 容器中的交叉轴方向上的对齐方式。

    self-auto

    self-auto
    default
    default
    default
    default

    self-start

    self-start
    default
    default
    default
    default

    self-end

    self-end
    default
    default
    default
    default

    self-center

    self-center
    default
    default
    default
    default

    self-stretch

    self-stretch
    default
    default
    default
    default

    self-baseline

    self-baseline
    default
    default
    default
    default

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/flex/utilities/basis.html b/dev/utilities/flex/utilities/basis.html index 81735b912b..b59121911c 100644 --- a/dev/utilities/flex/utilities/basis.html +++ b/dev/utilities/flex/utilities/basis.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/utilities/flex/utilities/direction.html b/dev/utilities/flex/utilities/direction.html index e50d86f128..8fd040fc3c 100644 --- a/dev/utilities/flex/utilities/direction.html +++ b/dev/utilities/flex/utilities/direction.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/utilities/flex/utilities/flex.html b/dev/utilities/flex/utilities/flex.html index 622c677d65..89bd65da52 100644 --- a/dev/utilities/flex/utilities/flex.html +++ b/dev/utilities/flex/utilities/flex.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    flex

    效果

    使用 flex-* 应用CSS flex 属性设置当前元素在 Grid 或 Flex 容器中的伸缩方式。

    flex-auto

    24 × 8
    24 × 8
    24 × 8

    flex-1

    24 × 8
    24 × 8
    24 × 8

    flex-initial

    24 × 8
    24 × 8
    24 × 8

    flex-none

    24 × 8
    24 × 8
    24 × 8

    混合使用

    flex-auto
    flex-1
    flex-initial
    flex-none

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/flex/utilities/gap.html b/dev/utilities/flex/utilities/gap.html index 9e567bb9ba..73a15bf22a 100644 --- a/dev/utilities/flex/utilities/gap.html +++ b/dev/utilities/flex/utilities/gap.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    gap

    效果

    使用 gap-* 应用CSS属性 gap 设置 Flex 容器中元素间距。

    gap-0

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-x-0

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-y-0

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-1

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-x-1

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-y-1

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-2

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-x-2

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-y-2

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-3

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-x-3

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-y-3

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-4

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-x-4

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-y-4

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-5

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-x-5

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-y-5

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-6

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-x-6

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-y-6

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-7

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-x-7

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-y-7

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-8

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-x-8

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    gap-y-8

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/flex/utilities/grow.html b/dev/utilities/flex/utilities/grow.html index 652b6223a6..6698aaeeb7 100644 --- a/dev/utilities/flex/utilities/grow.html +++ b/dev/utilities/flex/utilities/grow.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/utilities/flex/utilities/justify-content.html b/dev/utilities/flex/utilities/justify-content.html index ccc7b8c106..736e03768e 100644 --- a/dev/utilities/flex/utilities/justify-content.html +++ b/dev/utilities/flex/utilities/justify-content.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/utilities/flex/utilities/order.html b/dev/utilities/flex/utilities/order.html index ca28360fc1..69be485def 100644 --- a/dev/utilities/flex/utilities/order.html +++ b/dev/utilities/flex/utilities/order.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    order

    效果

    使用 order-* 应用CSS属性 order 设置当前元素在 Flex 容器中的排列顺序。

    1
    order-12
    2
    order-11
    3
    order-10
    4
    order-9
    5
    order-8
    6
    order-7
    7
    order-6
    8
    order-5
    9
    order-4
    10
    order-3
    11
    order-2
    12
    order-1

    使用 order-firstorder-lastorder-none 也可以改变 Flex 子元素排列顺序。

    0
    order-last
    1
    order-first
    2
    order-none

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/flex/utilities/shrink.html b/dev/utilities/flex/utilities/shrink.html index d4961e2a83..f36d897b97 100644 --- a/dev/utilities/flex/utilities/shrink.html +++ b/dev/utilities/flex/utilities/shrink.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/utilities/flex/utilities/wrap.html b/dev/utilities/flex/utilities/wrap.html index b5a810964e..6bf1f73d14 100644 --- a/dev/utilities/flex/utilities/wrap.html +++ b/dev/utilities/flex/utilities/wrap.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/utilities/index.html b/dev/utilities/index.html index 1a516dcbb0..d5536ec072 100644 --- a/dev/utilities/index.html +++ b/dev/utilities/index.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/utilities/interactivity/utilities/cursor.html b/dev/utilities/interactivity/utilities/cursor.html index 9101572519..72ca65e7dc 100644 --- a/dev/utilities/interactivity/utilities/cursor.html +++ b/dev/utilities/interactivity/utilities/cursor.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    光标

    效果

    通过 cursor-* 类可以改变光标的样式。

    cursor-auto
    cursor-auto
    cursor-default
    cursor-default
    cursor-pointer
    cursor-pointer
    cursor-wait
    cursor-wait
    cursor-text
    cursor-text
    cursor-move
    cursor-move
    cursor-help
    cursor-help
    cursor-not-allowed
    cursor-not-allowed

    MIT License (MIT)

    - +
    Skip to content

    光标

    效果

    通过 cursor-* 类可以改变光标的样式。

    cursor-auto
    cursor-auto
    cursor-default
    cursor-default
    cursor-pointer
    cursor-pointer
    cursor-wait
    cursor-wait
    cursor-text
    cursor-text
    cursor-move
    cursor-move
    cursor-help
    cursor-help
    cursor-not-allowed
    cursor-not-allowed

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/utilities/interactivity/utilities/disabled.html b/dev/utilities/interactivity/utilities/disabled.html index cc7d673e9c..8be02b5fa7 100644 --- a/dev/utilities/interactivity/utilities/disabled.html +++ b/dev/utilities/interactivity/utilities/disabled.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    禁用

    效果

    使用 disabled 类设置元素为禁用,禁用的元素会以半透明的形式显示,并强制使用灰度显示。

    注意

    禁用元素仍然响应鼠标事件,如果需要完全禁用鼠标事件,需要添加 pointer-events-none,如果是表单元素或按钮则可以添加 disabled="disabled" 属性实现完全禁用。

    MIT License (MIT)

    - +
    Skip to content

    禁用

    效果

    使用 disabled 类设置元素为禁用,禁用的元素会以半透明的形式显示,并强制使用灰度显示。

    注意

    禁用元素仍然响应鼠标事件,如果需要完全禁用鼠标事件,需要添加 pointer-events-none,如果是表单元素或按钮则可以添加 disabled="disabled" 属性实现完全禁用。

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/utilities/interactivity/utilities/loading.html b/dev/utilities/interactivity/utilities/loading.html index 44bdccb42b..9d10ddd428 100644 --- a/dev/utilities/interactivity/utilities/loading.html +++ b/dev/utilities/interactivity/utilities/loading.html @@ -14,14 +14,14 @@ - - + + - - + + \ No newline at end of file diff --git a/dev/utilities/interactivity/utilities/pointer-events.html b/dev/utilities/interactivity/utilities/pointer-events.html index dc95a5f892..1485d2963f 100644 --- a/dev/utilities/interactivity/utilities/pointer-events.html +++ b/dev/utilities/interactivity/utilities/pointer-events.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/utilities/interactivity/utilities/scroll.html b/dev/utilities/interactivity/utilities/scroll.html index 9f86d9924f..bc42c895d0 100644 --- a/dev/utilities/interactivity/utilities/scroll.html +++ b/dev/utilities/interactivity/utilities/scroll.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    滚动

    平滑滚动

    使用 scroll-smooth 工具类来为元素应用 scroll-behavior: smooth 属性,指定其进行平滑滚动。

    1
    2
    3
    4
    滚动到:

    立即滚动

    使用 scroll-auto 工具类来为元素应用 scroll-behavior: auto 属性,指定其进行立即滚动。

    1
    2
    3
    4
    滚动到:

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/interactivity/utilities/state.html b/dev/utilities/interactivity/utilities/state.html index 3fe52cbe2a..23ec307871 100644 --- a/dev/utilities/interactivity/utilities/state.html +++ b/dev/utilities/interactivity/utilities/state.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    状态响应

    效果

    通过为元素添加工具类 state 让按钮响应用户的鼠标交互,包括鼠标悬停、鼠标按下、获得焦点时拥有不同的样式。

    提示

    在按钮(.btn)和导航中的链接(.item > a )已经默认应用了 state 工具类,无需再次添加。

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/interactivity/utilities/user-select.html b/dev/utilities/interactivity/utilities/user-select.html index 2593528fae..7e307fb578 100644 --- a/dev/utilities/interactivity/utilities/user-select.html +++ b/dev/utilities/interactivity/utilities/user-select.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    文本选择

    用于控制用户能否选中文本的工具类。

    效果

    通过工具类 select-* 来控制用户能否选中元素中的文本。

    禁止选择文本
    select-none
    允许选择文本
    select-text
    点击自动选择所有文本
    select-all
    浏览器默认行为
    select-auto

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/layout/utilities/aspect-ratio.html b/dev/utilities/layout/utilities/aspect-ratio.html index 81e6047f61..10090852d3 100644 --- a/dev/utilities/layout/utilities/aspect-ratio.html +++ b/dev/utilities/layout/utilities/aspect-ratio.html @@ -14,14 +14,14 @@ - - + + - + \ No newline at end of file diff --git a/dev/utilities/layout/utilities/container.html b/dev/utilities/layout/utilities/container.html index 972822944a..a3f3f8ba86 100644 --- a/dev/utilities/layout/utilities/container.html +++ b/dev/utilities/layout/utilities/container.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    容器

    定义

    使用 container 类将元素宽度限制为当前屏幕断点,具体规则如下:

    屏幕断点CSS 属性
    默认width: 100%;
    @media (min-width: --screen-sm)max-width: --screen-sm;
    @media (min-width: --screen-md)max-width: --screen-md;
    @media (min-width: --screen-lg)max-width: --screen-lg;
    @media (min-width: --screen-xl)max-width: --screen-xl;
    @media (min-width: --screen-2xl)max-width: --screen-2xl;

    提示

    .container 还会为元素添加 margin-left: auto; margin-right: auto;,使得元素默认居中显示。

    用法

    .container

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/layout/utilities/display.html b/dev/utilities/layout/utilities/display.html index d547974360..1f5b5fb52b 100644 --- a/dev/utilities/layout/utilities/display.html +++ b/dev/utilities/layout/utilities/display.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    显示类型

    定义

    在 ZUI 中提供了各种工具类来设置 CSS display 属性,主要包括:

    工具类属性
    blockdisplay: block;
    inline-blockdisplay: inline-block;
    inlinedisplay: inline;
    flexdisplay: flex;
    inline-flexdisplay: inline-flex;
    tabledisplay: table;
    table-celldisplay: table-cell;
    table-rowdisplay: table-row;
    list-itemdisplay: list-item;
    hiddendisplay: hidden;

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/layout/utilities/floats.html b/dev/utilities/layout/utilities/floats.html index 3a3f8a319f..140c285857 100644 --- a/dev/utilities/layout/utilities/floats.html +++ b/dev/utilities/layout/utilities/floats.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    浮动

    定义

    用于设置元素浮动或清除浮动影响的工具类。

    工具类属性
    pull-rightfloat: right;
    pull-leftfloat: left;
    clearfix.clearfix::after {content: ""; display: block; clear: both;}

    提示

    浮动应当仅适用于实现文字环绕效果,布局请使用 Flex 工具类

    效果展示

    向右浮动

    使用工具类 pull-right 将一个元素浮动到其容器的右边。

    So I started to walk into the water. I won't lie to you boys, I was terrified. But I pressed on, and as I made my way past the breakers a strange calm came over me. I don't know if it was divine intervention or the kinship of all living things but I tell you Jerry at that moment, I was a marine biologist.

    月光如流水一般,静静地泻在这一片叶子和花上。薄薄的青雾浮起在荷塘里。叶子和花仿佛在牛乳中洗过一样;又像笼着轻纱的梦。

    向左浮动

    使用工具类 pull-left 将一个元素浮动到其容器的左边。

    So I started to walk into the water. I won't lie to you boys, I was terrified. But I pressed on, and as I made my way past the breakers a strange calm came over me. I don't know if it was divine intervention or the kinship of all living things but I tell you Jerry at that moment, I was a marine biologist.

    月光如流水一般,静静地泻在这一片叶子和花上。薄薄的青雾浮起在荷塘里。叶子和花仿佛在牛乳中洗过一样;又像笼着轻纱的梦。

    MIT License (MIT)

    - +
    Skip to content

    浮动

    定义

    用于设置元素浮动或清除浮动影响的工具类。

    工具类属性
    pull-rightfloat: right;
    pull-leftfloat: left;
    clearfix.clearfix::after {content: ""; display: block; clear: both;}

    提示

    浮动应当仅适用于实现文字环绕效果,布局请使用 Flex 工具类

    效果展示

    向右浮动

    使用工具类 pull-right 将一个元素浮动到其容器的右边。

    So I started to walk into the water. I won't lie to you boys, I was terrified. But I pressed on, and as I made my way past the breakers a strange calm came over me. I don't know if it was divine intervention or the kinship of all living things but I tell you Jerry at that moment, I was a marine biologist.

    月光如流水一般,静静地泻在这一片叶子和花上。薄薄的青雾浮起在荷塘里。叶子和花仿佛在牛乳中洗过一样;又像笼着轻纱的梦。

    向左浮动

    使用工具类 pull-left 将一个元素浮动到其容器的左边。

    So I started to walk into the water. I won't lie to you boys, I was terrified. But I pressed on, and as I made my way past the breakers a strange calm came over me. I don't know if it was divine intervention or the kinship of all living things but I tell you Jerry at that moment, I was a marine biologist.

    月光如流水一般,静静地泻在这一片叶子和花上。薄薄的青雾浮起在荷塘里。叶子和花仿佛在牛乳中洗过一样;又像笼着轻纱的梦。

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/utilities/layout/utilities/object-fit.html b/dev/utilities/layout/utilities/object-fit.html index f4b3ade917..d1ebf0f600 100644 --- a/dev/utilities/layout/utilities/object-fit.html +++ b/dev/utilities/layout/utilities/object-fit.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    内容适配

    定义

    元素的内容应该如何去适应指定容器的高度与宽度。

    工具类属性
    object-containobject-fit: contain;
    object-coverobject-fit: cover;
    object-fillobject-fit: fill;
    object-noneobject-fit: none;
    object-scale-downobject-fit: scale-down;

    效果展示

    包含

    使用工具类 object-contain 调整元素内容的大小,使其保持在容器内。

    覆盖

    使用工具类 object-cover 调整元素内容的大小以覆盖其容器。

    充满

    使用工具类 object-fill 拉伸元素的内容以适应其容器。

    使用工具类 object-none 以原始大小显示元素的内容,忽略容器大小。

    缩小

    以原始大小显示元素的内容,但必要时使用 object-scale-down 将其缩小以适应其容器。

    MIT License (MIT)

    - +
    Skip to content

    内容适配

    定义

    元素的内容应该如何去适应指定容器的高度与宽度。

    工具类属性
    object-containobject-fit: contain;
    object-coverobject-fit: cover;
    object-fillobject-fit: fill;
    object-noneobject-fit: none;
    object-scale-downobject-fit: scale-down;

    效果展示

    包含

    使用工具类 object-contain 调整元素内容的大小,使其保持在容器内。

    覆盖

    使用工具类 object-cover 调整元素内容的大小以覆盖其容器。

    充满

    使用工具类 object-fill 拉伸元素的内容以适应其容器。

    使用工具类 object-none 以原始大小显示元素的内容,忽略容器大小。

    缩小

    以原始大小显示元素的内容,但必要时使用 object-scale-down 将其缩小以适应其容器。

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/utilities/layout/utilities/overflow.html b/dev/utilities/layout/utilities/overflow.html index 1030722aa0..3df5ca5d5e 100644 --- a/dev/utilities/layout/utilities/overflow.html +++ b/dev/utilities/layout/utilities/overflow.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    溢出

    定义

    用于控制元素如何处理超出容器的内容的工具类。

    工具类属性
    overflow-autooverflow: auto;
    overflow-hiddenoverflow: hidden;
    overflow-cliptext-overflow: clip;
    overflow-visibleoverflow: visible;
    overflow-scrolloverflow: scroll;
    overflow-x-autooverflow-x: auto;
    overflow-y-autooverflow-y: auto;
    overflow-x-hiddenoverflow-x: hidden;
    overflow-y-hiddenoverflow-y: hidden;
    overflow-x-visibleoverflow-x: visible;
    overflow-y-visibleoverflow-y: visible;
    overflow-x-scrolloverflow-x: scroll;
    overflow-y-scrolloverflow-y: scroll;

    效果展示

    自动

    使用工具类 overflow-auto 在一个元素的内容溢出该元素的边界时为其添加滚动条。不像 overflow-scroll 总是显示滚动条,这个工具类只在需要滚动时才会显示。

    虞美人·春花秋月何时了

    五代·李煜

    春花秋月何时了?往事知多少。
    小楼昨夜又东风,故国不堪回首月明中。
    雕栏玉砌应犹在,只是朱颜改。
    问君能有几多愁?恰似一江春水向东流

    隐藏

    使用工具类 overflow-hidden 来剪切元素中任何溢出该元素边界的内容。

    虞美人·春花秋月何时了

    五代·李煜

    春花秋月何时了?往事知多少。
    小楼昨夜又东风,故国不堪回首月明中。
    雕栏玉砌应犹在,只是朱颜改。
    问君能有几多愁?恰似一江春水向东流

    可见

    使用工具类 overflow-visible 来防止元素内的内容被剪切。请注意,任何溢出元素边界的内容都将是可见的。

    虞美人·春花秋月何时了

    五代·李煜

    春花秋月何时了?往事知多少。
    小楼昨夜又东风,故国不堪回首月明中。
    雕栏玉砌应犹在,只是朱颜改。
    问君能有几多愁?恰似一江春水向东流

    需要时水平滚动

    如果需要,使用工具类 overflow-x-auto 来允许水平滚动。

    虞美人·春花秋月何时了

    五代·李煜

    春花秋月何时了?往事知多少。小楼昨夜又东风,故国不堪回首月明中。雕栏玉砌应犹在,只是朱颜改。问君能有几多愁?恰似一江春水向东流

    需要时垂直滚动

    如果需要,使用工具类 overflow-y-auto 来允许垂直滚动。

    虞美人·春花秋月何时了

    五代·李煜

    春花秋月何时了?往事知多少。小楼昨夜又东风,故国不堪回首月明中。雕栏玉砌应犹在,只是朱颜改。问君能有几多愁?恰似一江春水向东流

    始终水平滚动

    如果需要,使用工具类 overflow-x-scroll 来允许水平滚动。

    虞美人·春花秋月何时了

    五代·李煜

    春花秋月何时了?往事知多少。小楼昨夜又东风,故国不堪回首月明中。雕栏玉砌应犹在,只是朱颜改。问君能有几多愁?恰似一江春水向东流

    始终垂直滚动

    如果需要,使用工具类 overflow-y-scroll 来允许水平滚动。

    虞美人·春花秋月何时了

    五代·李煜

    春花秋月何时了?往事知多少。小楼昨夜又东风,故国不堪回首月明中。雕栏玉砌应犹在,只是朱颜改。问君能有几多愁?恰似一江春水向东流

    在所有方向上滚动

    如果需要,使用工具类 overflow-scroll 来允许水平滚动。

    虞美人·春花秋月何时了

    五代·李煜

    春花秋月何时了?往事知多少。小楼昨夜又东风,故国不堪回首月明中。雕栏玉砌应犹在,只是朱颜改。问君能有几多愁?恰似一江春水向东流

    虞美人·春花秋月何时了

    五代·李煜

    春花秋月何时了?往事知多少。小楼昨夜又东风,故国不堪回首月明中。雕栏玉砌应犹在,只是朱颜改。问君能有几多愁?恰似一江春水向东流

    虞美人·春花秋月何时了

    五代·李煜

    春花秋月何时了?往事知多少。小楼昨夜又东风,故国不堪回首月明中。雕栏玉砌应犹在,只是朱颜改。问君能有几多愁?恰似一江春水向东流

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/layout/utilities/position.html b/dev/utilities/layout/utilities/position.html index ffa9975bc4..093ca56321 100644 --- a/dev/utilities/layout/utilities/position.html +++ b/dev/utilities/layout/utilities/position.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    定位

    定义

    用于控制元素在DOM中的位置的工具类。

    工具类属性
    staticposition: static;
    fixedposition: fixed;
    absoluteposition: absolute;
    relativeposition: relative;
    stickyposition: sticky;

    使用方法

    staticabsolute

    使用 static 根据常规的文档流来定位元素,浏览器默认 position 取值就是 static。任何偏移都将被忽略,而且该元素不会作为绝对定位的子元素的位置参考。

    Static 父元素

    Absolute 子元素

    relativeabsolute

    使用 relative 根据常规的文档流来定位元素。偏移量是相对于元素的正常位置计算的,并且该元素将作为绝对定位的子元素的位置参考。

    使用 absolute 将一个元素定位在文档常规流之外,使相邻元素的行为就像该元素不存在一样。偏移量是相对于最近的位置不是 static 的父元素计算的,而且该元素将作为其他绝对定位的子元素的位置参考。

    Relative 父元素

    Absolute 子元素

    sticky

    sticky 元素根据正常文档流进行定位,然后相对它的最近滚动祖先和 containing block,包括 table-related 元素,基于 top、right、bottom 和 left 的值进行偏移。偏移值不会影响任何其他元素的位置。

    黄鹤楼送孟浩然之广陵

    故人西辞黄鹤楼,

    烟花三月下扬州。

    孤帆远影碧空尽,

    唯见长江天际流。

    闻王昌龄左迁龙标遥有此寄

    杨花落尽子规啼,

    闻道龙标过五溪。

    我寄愁心与明月,

    随君直到夜郎西。

    宣州谢朓楼饯别校书叔云

    弃我去者,昨日之日不可留;

    乱我心者,今日之日多烦忧。

    长风万里送秋雁,对此可以酣高楼。

    蓬莱文章建安骨,中间小谢又清发。

    俱怀逸兴壮思飞,欲上青天揽明月。

    抽刀断水水更流,举杯消愁愁更愁。

    人生在世不称意,明朝散发弄扁舟。

    fixed

    使用 fixed 来定位一个元素相对于浏览器窗视口的位置。偏移量是相对于视口计算的,且该元素将作为绝对定位的子元素的位置参考。

    MIT License (MIT)

    - +
    Skip to content

    定位

    定义

    用于控制元素在DOM中的位置的工具类。

    工具类属性
    staticposition: static;
    fixedposition: fixed;
    absoluteposition: absolute;
    relativeposition: relative;
    stickyposition: sticky;

    使用方法

    staticabsolute

    使用 static 根据常规的文档流来定位元素,浏览器默认 position 取值就是 static。任何偏移都将被忽略,而且该元素不会作为绝对定位的子元素的位置参考。

    Static 父元素

    Absolute 子元素

    relativeabsolute

    使用 relative 根据常规的文档流来定位元素。偏移量是相对于元素的正常位置计算的,并且该元素将作为绝对定位的子元素的位置参考。

    使用 absolute 将一个元素定位在文档常规流之外,使相邻元素的行为就像该元素不存在一样。偏移量是相对于最近的位置不是 static 的父元素计算的,而且该元素将作为其他绝对定位的子元素的位置参考。

    Relative 父元素

    Absolute 子元素

    sticky

    sticky 元素根据正常文档流进行定位,然后相对它的最近滚动祖先和 containing block,包括 table-related 元素,基于 top、right、bottom 和 left 的值进行偏移。偏移值不会影响任何其他元素的位置。

    黄鹤楼送孟浩然之广陵

    故人西辞黄鹤楼,

    烟花三月下扬州。

    孤帆远影碧空尽,

    唯见长江天际流。

    闻王昌龄左迁龙标遥有此寄

    杨花落尽子规啼,

    闻道龙标过五溪。

    我寄愁心与明月,

    随君直到夜郎西。

    宣州谢朓楼饯别校书叔云

    弃我去者,昨日之日不可留;

    乱我心者,今日之日多烦忧。

    长风万里送秋雁,对此可以酣高楼。

    蓬莱文章建安骨,中间小谢又清发。

    俱怀逸兴壮思飞,欲上青天揽明月。

    抽刀断水水更流,举杯消愁愁更愁。

    人生在世不称意,明朝散发弄扁舟。

    fixed

    使用 fixed 来定位一个元素相对于浏览器窗视口的位置。偏移量是相对于视口计算的,且该元素将作为绝对定位的子元素的位置参考。

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/utilities/layout/utilities/top-right-bottom-left.html b/dev/utilities/layout/utilities/top-right-bottom-left.html index fac4fc67f2..dfa55938fb 100644 --- a/dev/utilities/layout/utilities/top-right-bottom-left.html +++ b/dev/utilities/layout/utilities/top-right-bottom-left.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    上下左右

    定义

    用于控制定位元素的位置的工具类。

    工具类属性
    inset-0top: 0px; right: 0px; bottom: 0px; left: 0px;
    inset-autotop: auto; right: auto; bottom: auto; left: auto;
    inset-x-0left: 0px; right: 0px;
    inset-y-0top: 0px; bottom: 0px;
    top-0top: 0px;
    right-0right: 0px;
    bottom-0bottom: 0px;
    left-0left: 0px;
    top-pxtop: 1px;
    right-pxright: 1px;
    bottom-pxbottom: 1px;
    left-pxleft: 1px;
    top-0.5top: 2px;
    right-0.5right: 2px;
    bottom-0.5bottom: 2px;
    left-0.5left: 2px;
    top-1top: 4px;
    right-1right: 4px;
    bottom-1bottom: 4px;
    left-1left: 4px;
    top-1.5top: 6px;
    right-1.5right: 6px;
    bottom-1.5bottom: 6px;
    left-1.5left: 6px;
    top-2top: 8px;
    right-2right: 8px;
    bottom-2bottom: 8px;
    left-2left: 8px;
    top-fulltop: 100%;
    right-fullright: 100%;
    bottom-fullbottom: 100%;
    left-fullleft: 100%;
    top-autotop: auto;
    right-autoright: auto;
    bottom-autobottom: auto;
    left-autoleft: auto;

    效果展示

    1
    2
    3
    4
    5
    6
    7
    8

    MIT License (MIT)

    - +
    Skip to content

    上下左右

    定义

    用于控制定位元素的位置的工具类。

    工具类属性
    inset-0top: 0px; right: 0px; bottom: 0px; left: 0px;
    inset-autotop: auto; right: auto; bottom: auto; left: auto;
    inset-x-0left: 0px; right: 0px;
    inset-y-0top: 0px; bottom: 0px;
    top-0top: 0px;
    right-0right: 0px;
    bottom-0bottom: 0px;
    left-0left: 0px;
    top-pxtop: 1px;
    right-pxright: 1px;
    bottom-pxbottom: 1px;
    left-pxleft: 1px;
    top-0.5top: 2px;
    right-0.5right: 2px;
    bottom-0.5bottom: 2px;
    left-0.5left: 2px;
    top-1top: 4px;
    right-1right: 4px;
    bottom-1bottom: 4px;
    left-1left: 4px;
    top-1.5top: 6px;
    right-1.5right: 6px;
    bottom-1.5bottom: 6px;
    left-1.5left: 6px;
    top-2top: 8px;
    right-2right: 8px;
    bottom-2bottom: 8px;
    left-2left: 8px;
    top-fulltop: 100%;
    right-fullright: 100%;
    bottom-fullbottom: 100%;
    left-fullleft: 100%;
    top-autotop: auto;
    right-autoright: auto;
    bottom-autobottom: auto;
    left-autoleft: auto;

    效果展示

    1
    2
    3
    4
    5
    6
    7
    8

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/utilities/layout/utilities/visibility.html b/dev/utilities/layout/utilities/visibility.html index 4984a17240..6b3cad7704 100644 --- a/dev/utilities/layout/utilities/visibility.html +++ b/dev/utilities/layout/utilities/visibility.html @@ -14,14 +14,14 @@ - - + + - - + + \ No newline at end of file diff --git a/dev/utilities/layout/utilities/z-index.html b/dev/utilities/layout/utilities/z-index.html index bcfcf2e630..8e86383e31 100644 --- a/dev/utilities/layout/utilities/z-index.html +++ b/dev/utilities/layout/utilities/z-index.html @@ -14,14 +14,14 @@ - - + + - - + + \ No newline at end of file diff --git a/dev/utilities/sizing/utilities/height.html b/dev/utilities/sizing/utilities/height.html index 5b581f0672..b82d7c26e1 100644 --- a/dev/utilities/sizing/utilities/height.html +++ b/dev/utilities/sizing/utilities/height.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    高度

    固定值

    通过工具类 h-* 设置高度为固定值,包含如下工具类:

    工具类CSS 属性
    h-0height: 0px;
    h-pxheight: 1px;
    h-0.5height: 2px;
    h-1height: 4px;
    h-1.5height: 6px;
    h-2height: 8px;
    h-2.5height: 10px;
    h-3height: 12px;
    h-3.5height: 14px;
    h-4height: 16px;
    h-5height: 20px;
    h-6height: 24px;
    h-7height: 28px;
    h-8height: 32px;
    h-9height: 36px;
    h-10height: 40px;
    h-11height: 44px;
    h-12height: 48px;
    h-14height: 56px;
    h-16height: 64px;
    h-20height: 80px;
    h-24height: 96px;
    h-28height: 112px;
    h-32height: 128px;
    h-36height: 144px;
    h-40height: 160px;
    h-44height: 176px;
    h-48height: 192px;
    h-52height: 208px;
    h-56height: 224px;
    h-60height: 240px;
    h-64height: 256px;
    h-72height: 288px;
    h-80height: 320px;
    h-96height: 384px;

    百分比

    通过工具类 h-* 设置高度为百分比,包含如下工具类:

    工具类CSS 属性
    h-1/2height: 50%;
    h-1/3height: 33.3333333%;
    h-2/3height: 66.6666667%;
    h-1/4height: 25%;
    h-2/4height: 50%;
    h-3/4height: 75%;
    h-1/5height: 20%;
    h-2/5height: 40%;
    h-3/5height: 60%;
    h-4/5height: 80%;
    h-1/6height: 16.6666667%;
    h-2/6height: 33.3333333%;
    h-3/6height: 50%;
    h-4/6height: 66.6666667%;
    h-5/6height: 83.3333333%;
    h-fullheight: 100%;

    特殊值

    通过工具类 h-* 设置高度为特殊值,包含如下工具类:

    工具类CSS 属性
    h-autoheight: auto;
    h-screenheight: 100vh;
    h-fitheight: fit-content;
    h-minheight: min-content;
    h-maxheight: max-content;

    限制最大高度

    通过工具类 max-h-* 设置限制元素最大高度,包含如下工具类:

    工具类CSS 属性
    max-h-0max-height: 0px;
    max-h-fullmax-height: 100%;
    max-h-screenmax-height: 100vh;
    max-h-nonemax-height: none;
    max-h-minmax-height: min-content;
    max-h-maxmax-height: max-content;
    max-h-fitmax-height: fit-content;

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/sizing/utilities/width.html b/dev/utilities/sizing/utilities/width.html index e705b7559c..31651fe116 100644 --- a/dev/utilities/sizing/utilities/width.html +++ b/dev/utilities/sizing/utilities/width.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    宽度

    固定值

    通过工具类 w-* 设置宽度为固定值,包含如下工具类:

    工具类CSS 属性
    w-0width: 0px;
    w-pxwidth: 1px;
    w-0.5width: 2px;
    w-1width: 4px;
    w-1.5width: 6px;
    w-2width: 8px;
    w-2.5width: 10px;
    w-3width: 12px;
    w-3.5width: 14px;
    w-4width: 16px;
    w-5width: 20px;
    w-6width: 24px;
    w-7width: 28px;
    w-8width: 32px;
    w-9width: 36px;
    w-10width: 40px;
    w-11width: 44px;
    w-12width: 48px;
    w-14width: 56px;
    w-16width: 64px;
    w-20width: 80px;
    w-24width: 96px;
    w-28width: 112px;
    w-32width: 128px;
    w-36width: 144px;
    w-40width: 160px;
    w-44width: 176px;
    w-48width: 192px;
    w-52width: 208px;
    w-56width: 224px;
    w-60width: 240px;
    w-64width: 256px;
    w-72width: 288px;
    w-80width: 320px;
    w-96width: 384px;

    百分比

    通过工具类 w-* 设置宽度为百分比,包含如下工具类:

    工具类CSS 属性
    w-1/2width: 50%;
    w-1/3width: 33.3333333%;
    w-2/3width: 66.6666667%;
    w-1/4width: 25%;
    w-2/4width: 50%;
    w-3/4width: 75%;
    w-1/5width: 20%;
    w-2/5width: 40%;
    w-3/5width: 60%;
    w-4/5width: 80%;
    w-1/6width: 16.6666667%;
    w-2/6width: 33.3333333%;
    w-3/6width: 50%;
    w-4/6width: 66.6666667%;
    w-5/6width: 83.3333333%;
    w-fullwidth: 100%;

    特殊值

    通过工具类 w-* 设置宽度为特殊值,包含如下工具类:

    工具类CSS 属性
    w-autowidth: auto;
    w-screenwidth: 100vw;
    w-fitwidth: fit-content;
    w-minwidth: min-content;
    w-maxwidth: max-content;

    限制最大宽度

    通过工具类 max-w-* 设置限制元素最大宽度,包含如下工具类:

    工具类CSS 属性
    max-w-0max-width: 0px;
    max-w-fullmax-width: 100%;
    max-w-screenmax-width: 100vw;
    max-w-nonemax-width: none;
    max-w-minmax-width: min-content;
    max-w-maxmax-width: max-content;
    max-w-fitmax-width: fit-content;

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/skin/utilities/ghost.html b/dev/utilities/skin/utilities/ghost.html index 52b08f4d31..e0c20d4048 100644 --- a/dev/utilities/skin/utilities/ghost.html +++ b/dev/utilities/skin/utilities/ghost.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    透明

    用于快速为元素或组件实现特定文字颜色带透明背景外观。

    效果

    默认
    ghost
    语义化
    primary-ghost
    secondary-ghost
    success-ghost
    warning-ghost
    danger-ghost
    important-ghost
    special-ghost

    示例

    Ghost Element

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/skin/utilities/outline.html b/dev/utilities/skin/utilities/outline.html index d862f2e150..aed4bf215b 100644 --- a/dev/utilities/skin/utilities/outline.html +++ b/dev/utilities/skin/utilities/outline.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    轮廓

    用于快速为元素或组件实现特定颜色的轮廓描边外观。

    效果

    默认
    outline
    语义化
    primary-outline
    secondary-outline
    success-outline
    warning-outline
    danger-outline
    important-outline
    special-outline
    灰度
    gray-outline

    提示

    轮廓的描边效果使用 box-shadow 实现。

    示例

    Success Label
    Gray Element

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/skin/utilities/pale.html b/dev/utilities/skin/utilities/pale.html index bcd143b699..459438291b 100644 --- a/dev/utilities/skin/utilities/pale.html +++ b/dev/utilities/skin/utilities/pale.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    浅色

    用于快速为元素或组件实现特定颜色的浅色填充外观,包含语义化和灰度工具类。

    效果

    语义化
    primary-pale
    secondary-pale
    success-pale
    warning-pale
    danger-pale
    important-pale
    special-pale
    灰度
    gray-50-pale
    gray-100-pale
    gray-200-pale
    gray-300-pale
    gray-400-pale
    gray-pale
    gray-500-pale 别名: gray-pale
    gray-600-pale
    gray-700-pale
    gray-800-pale
    gray-900-pale
    gray-950-pale

    示例

    Success Label
    Gray Element

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/skin/utilities/solid.html b/dev/utilities/skin/utilities/solid.html index 090be36ed0..71d5eb5b2c 100644 --- a/dev/utilities/skin/utilities/solid.html +++ b/dev/utilities/skin/utilities/solid.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    实心

    用于快速为元素或组件实现特定颜色的实心填充外观,包含语义化和灰度工具类。

    效果

    语义化
    primary
    secondary
    success
    warning
    danger
    important
    special
    灰度
    gray-50
    gray-100
    gray-200
    gray-300
    gray-400
    gray
    gray-500 别名: gray
    gray-600
    gray-700
    gray-800
    gray-900
    gray-950

    示例

    Success Label
    Gray Element

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/skin/utilities/surface.html b/dev/utilities/skin/utilities/surface.html index 5cb70563ca..7b34e8c2fd 100644 --- a/dev/utilities/skin/utilities/surface.html +++ b/dev/utilities/skin/utilities/surface.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    界面

    用于快速为元素或组件实现特定功能界面颜色外观。

    效果

    white
    纯白
    black
    纯黑
    transparent
    透明
    canvas
    画布
    inverse
    反色
    surface-light
    加重的控件
    surface
    控件
    surface-strong
    轻量的控件

    示例

    Surface Element

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/spacing/utilities/margin.html b/dev/utilities/spacing/utilities/margin.html index 4135e39e59..1e16932644 100644 --- a/dev/utilities/spacing/utilities/margin.html +++ b/dev/utilities/spacing/utilities/margin.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    外边距

    定义

    通过 m-* 工具类设置外边距,可用的工具类包括:

    工具类CSS 属性
    m-automargin: auto;
    mx-automargin-left: auto; margin-right: auto;
    my-automargin-top: auto; margin-bottom: auto;
    mt-automargin-top: auto;
    mr-automargin-right: auto;
    mb-automargin-bottom: auto;
    ml-automargin-left: auto;
    m-0margin: 0px;
    m-pxmargin: 1px;
    m-0.5margin: 2px;
    m-1margin: 4px;
    m-1.5margin: 6px;
    m-2margin: 8px;
    m-2.5margin: 10px;
    m-3margin: 12px;
    m-3.5margin: 14px;
    m-4margin: 16px;
    m-5margin: 20px;
    m-6margin: 24px;
    m-7margin: 28px;
    m-8margin: 32px;
    m-9margin: 36px;
    m-10margin: 40px;
    mx-0margin-left: 0px; margin-right: 0px;
    my-0margin-top: 0px; margin-bottom: 0px;
    mt-0margin-top: 0px;
    mr-0margin-right: 0px;
    mb-0margin-bottom: 0px;
    ml-0margin-left: 0px;
    mx-pxmargin-left: 1px; margin-right: 1px;
    my-pxmargin-top: 1px; margin-bottom: 1px;
    mt-pxmargin-top: 1px;
    mr-pxmargin-right: 1px;
    mb-pxmargin-bottom: 1px;
    ml-pxmargin-left: 1px;
    mx-0.5margin-left: 2px; margin-right: 2px;
    my-0.5margin-top: 2px; margin-bottom: 2px;
    mt-0.5margin-top: 2px;
    mr-0.5margin-right: 2px;
    mb-0.5margin-bottom: 2px;
    ml-0.5margin-left: 2px;
    mx-1margin-left: 4px; margin-right: 4px;
    my-1margin-top: 4px; margin-bottom: 4px;
    mt-1margin-top: 4px;
    mr-1margin-right: 4px;
    mb-1margin-bottom: 4px;
    ml-1margin-left: 4px;
    mx-1.5margin-left: 6px; margin-right: 6px;
    my-1.5margin-top: 6px; margin-bottom: 6px;
    mt-1.5margin-top: 6px;
    mr-1.5margin-right: 6px;
    mb-1.5margin-bottom: 6px;
    ml-1.5margin-left: 6px;
    mx-2margin-left: 8px; margin-right: 8px;
    my-2margin-top: 8px; margin-bottom: 8px;
    mt-2margin-top: 8px;
    mr-2margin-right: 8px;
    mb-2margin-bottom: 8px;
    ml-2margin-left: 8px;
    mx-2.5margin-left: 10px; margin-right: 10px;
    my-2.5margin-top: 10px; margin-bottom: 10px;
    mt-2.5margin-top: 10px;
    mr-2.5margin-right: 10px;
    mb-2.5margin-bottom: 10px;
    ml-2.5margin-left: 10px;
    mx-3margin-left: 12px; margin-right: 12px;
    my-3margin-top: 12px; margin-bottom: 12px;
    mt-3margin-top: 12px;
    mr-3margin-right: 12px;
    mb-3margin-bottom: 12px;
    ml-3margin-left: 12px;
    mx-3.5margin-left: 14px; margin-right: 14px;
    my-3.5margin-top: 14px; margin-bottom: 14px;
    mt-3.5margin-top: 14px;
    mr-3.5margin-right: 14px;
    mb-3.5margin-bottom: 14px;
    ml-3.5margin-left: 14px;
    mx-4margin-left: 16px; margin-right: 16px;
    my-4margin-top: 16px; margin-bottom: 16px;
    mt-4margin-top: 16px;
    mr-4margin-right: 16px;
    mb-4margin-bottom: 16px;
    ml-4margin-left: 16px;
    mx-5margin-left: 20px; margin-right: 20px;
    my-5margin-top: 20px; margin-bottom: 20px;
    mt-5margin-top: 20px;
    mr-5margin-right: 20px;
    mb-5margin-bottom: 20px;
    ml-5margin-left: 20px;
    mx-6margin-left: 24px; margin-right: 24px;
    my-6margin-top: 24px; margin-bottom: 24px;
    mt-6margin-top: 24px;
    mr-6margin-right: 24px;
    mb-6margin-bottom: 24px;
    ml-6margin-left: 24px;
    mx-7margin-left: 28px; margin-right: 28px;
    my-7margin-top: 28px; margin-bottom: 28px;
    mt-7margin-top: 28px;
    mr-7margin-right: 28px;
    mb-7margin-bottom: 28px;
    ml-7margin-left: 28px;
    mx-8margin-left: 32px; margin-right: 32px;
    my-8margin-top: 32px; margin-bottom: 32px;
    mt-8margin-top: 32px;
    mr-8margin-right: 32px;
    mb-8margin-bottom: 32px;
    ml-8margin-left: 32px;
    mx-9margin-left: 36px; margin-right: 36px;
    my-9margin-top: 36px; margin-bottom: 36px;
    mt-9margin-top: 36px;
    mr-9margin-right: 36px;
    mb-9margin-bottom: 36px;
    ml-9margin-left: 36px;
    mx-10margin-left: 40px; margin-right: 40px;
    my-10margin-top: 40px; margin-bottom: 40px;
    mt-10margin-top: 40px;
    mr-10margin-right: 40px;
    mb-10margin-bottom: 40px;
    ml-10margin-left: 40px;

    示例

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/spacing/utilities/padding.html b/dev/utilities/spacing/utilities/padding.html index 2d64715e56..5d4e19faf1 100644 --- a/dev/utilities/spacing/utilities/padding.html +++ b/dev/utilities/spacing/utilities/padding.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    内边距

    定义

    通过 p-* 工具类设置内边距,可用的工具类包括:

    工具类CSS 属性
    p-autopadding: auto;
    px-autopadding-left: auto; padding-right: auto;
    py-autopadding-top: auto; padding-bottom: auto;
    pt-autopadding-top: auto;
    pr-autopadding-right: auto;
    pb-autopadding-bottom: auto;
    pl-autopadding-left: auto;
    p-0padding: 0px;
    p-pxpadding: 1px;
    p-0.5padding: 2px;
    p-1padding: 4px;
    p-1.5padding: 6px;
    p-2padding: 8px;
    p-2.5padding: 10px;
    p-3padding: 12px;
    p-3.5padding: 14px;
    p-4padding: 16px;
    p-5padding: 20px;
    p-6padding: 24px;
    p-7padding: 28px;
    p-8padding: 32px;
    p-9padding: 36px;
    p-10padding: 40px;
    px-0padding-left: 0px; padding-right: 0px;
    py-0padding-top: 0px; padding-bottom: 0px;
    pt-0padding-top: 0px;
    pr-0padding-right: 0px;
    pb-0padding-bottom: 0px;
    pl-0padding-left: 0px;
    px-pxpadding-left: 1px; padding-right: 1px;
    py-pxpadding-top: 1px; padding-bottom: 1px;
    pt-pxpadding-top: 1px;
    pr-pxpadding-right: 1px;
    pb-pxpadding-bottom: 1px;
    pl-pxpadding-left: 1px;
    px-0.5padding-left: 2px; padding-right: 2px;
    py-0.5padding-top: 2px; padding-bottom: 2px;
    pt-0.5padding-top: 2px;
    pr-0.5padding-right: 2px;
    pb-0.5padding-bottom: 2px;
    pl-0.5padding-left: 2px;
    px-1padding-left: 4px; padding-right: 4px;
    py-1padding-top: 4px; padding-bottom: 4px;
    pt-1padding-top: 4px;
    pr-1padding-right: 4px;
    pb-1padding-bottom: 4px;
    pl-1padding-left: 4px;
    px-1.5padding-left: 6px; padding-right: 6px;
    py-1.5padding-top: 6px; padding-bottom: 6px;
    pt-1.5padding-top: 6px;
    pr-1.5padding-right: 6px;
    pb-1.5padding-bottom: 6px;
    pl-1.5padding-left: 6px;
    px-2padding-left: 8px; padding-right: 8px;
    py-2padding-top: 8px; padding-bottom: 8px;
    pt-2padding-top: 8px;
    pr-2padding-right: 8px;
    pb-2padding-bottom: 8px;
    pl-2padding-left: 8px;
    px-2.5padding-left: 10px; padding-right: 10px;
    py-2.5padding-top: 10px; padding-bottom: 10px;
    pt-2.5padding-top: 10px;
    pr-2.5padding-right: 10px;
    pb-2.5padding-bottom: 10px;
    pl-2.5padding-left: 10px;
    px-3padding-left: 12px; padding-right: 12px;
    py-3padding-top: 12px; padding-bottom: 12px;
    pt-3padding-top: 12px;
    pr-3padding-right: 12px;
    pb-3padding-bottom: 12px;
    pl-3padding-left: 12px;
    px-3.5padding-left: 14px; padding-right: 14px;
    py-3.5padding-top: 14px; padding-bottom: 14px;
    pt-3.5padding-top: 14px;
    pr-3.5padding-right: 14px;
    pb-3.5padding-bottom: 14px;
    pl-3.5padding-left: 14px;
    px-4padding-left: 16px; padding-right: 16px;
    py-4padding-top: 16px; padding-bottom: 16px;
    pt-4padding-top: 16px;
    pr-4padding-right: 16px;
    pb-4padding-bottom: 16px;
    pl-4padding-left: 16px;
    px-5padding-left: 20px; padding-right: 20px;
    py-5padding-top: 20px; padding-bottom: 20px;
    pt-5padding-top: 20px;
    pr-5padding-right: 20px;
    pb-5padding-bottom: 20px;
    pl-5padding-left: 20px;
    px-6padding-left: 24px; padding-right: 24px;
    py-6padding-top: 24px; padding-bottom: 24px;
    pt-6padding-top: 24px;
    pr-6padding-right: 24px;
    pb-6padding-bottom: 24px;
    pl-6padding-left: 24px;
    px-7padding-left: 28px; padding-right: 28px;
    py-7padding-top: 28px; padding-bottom: 28px;
    pt-7padding-top: 28px;
    pr-7padding-right: 28px;
    pb-7padding-bottom: 28px;
    pl-7padding-left: 28px;
    px-8padding-left: 32px; padding-right: 32px;
    py-8padding-top: 32px; padding-bottom: 32px;
    pt-8padding-top: 32px;
    pr-8padding-right: 32px;
    pb-8padding-bottom: 32px;
    pl-8padding-left: 32px;
    px-9padding-left: 36px; padding-right: 36px;
    py-9padding-top: 36px; padding-bottom: 36px;
    pt-9padding-top: 36px;
    pr-9padding-right: 36px;
    pb-9padding-bottom: 36px;
    pl-9padding-left: 36px;
    px-10padding-left: 40px; padding-right: 40px;
    py-10padding-top: 40px; padding-bottom: 40px;
    pt-10padding-top: 40px;
    pr-10padding-right: 40px;
    pb-10padding-bottom: 40px;
    pl-10padding-left: 40px;

    示例

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/spacing/utilities/space.html b/dev/utilities/spacing/utilities/space.html index 284f4abbc7..1320c62797 100644 --- a/dev/utilities/spacing/utilities/space.html +++ b/dev/utilities/spacing/utilities/space.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    子元素间距

    定义

    通过工具类 space-x-* 来为元素内的所有子元素之间设置水平间距;通过工具类 space-y-* 来为元素内的所有子元素之间设置水平间距,所有可用的工具类定义如下:

    工具类CSS 属性
    space-x-0 > * + *margin-left: 0px;
    space-y-0 > * + *margin-top: 0px;
    space-x-0.5 > * + *margin-left: 2px;
    space-y-0.5 > * + *margin-top: 2px;
    space-x-1 > * + *margin-left: 4px;
    space-y-1 > * + *margin-top: 4px;
    space-x-1.5 > * + *margin-left: 6px;
    space-y-1.5 > * + *margin-top: 6px;
    space-x-2 > * + *margin-left: 8px;
    space-y-2 > * + *margin-top: 8px;
    space-x-2.5 > * + *margin-left: 10px;
    space-y-2.5 > * + *margin-top: 10px;
    space-x-3 > * + *margin-left: 12px;
    space-y-3 > * + *margin-top: 12px;
    space-x-3.5 > * + *margin-left: 14px;
    space-y-3.5 > * + *margin-top: 14px;
    space-x-4 > * + *margin-left: 16px;
    space-y-4 > * + *margin-top: 16px;
    space-x-5 > * + *margin-left: 20px;
    space-y-5 > * + *margin-top: 20px;
    space-x-6 > * + *margin-left: 24px;
    space-y-6 > * + *margin-top: 24px;
    space-x-7 > * + *margin-left: 28px;
    space-y-7 > * + *margin-top: 28px;
    space-x-8 > * + *margin-left: 32px;
    space-y-8 > * + *margin-top: 32px;
    space-x-9 > * + *margin-left: 36px;
    space-y-9 > * + *margin-top: 36px;
    space-x-10 > * + *margin-left: 40px;
    space-y-10 > * + *margin-top: 40px;
    space-x-px > * + *margin-left: 1px;
    space-y-px > * + *margin-top: 1px;

    示例

    水平间距

    1
    2
    3

    垂直间距

    1
    2
    3

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/typography/utilities/font-family.html b/dev/utilities/typography/utilities/font-family.html index 50d6aa0a1b..ce81ba5337 100644 --- a/dev/utilities/typography/utilities/font-family.html +++ b/dev/utilities/typography/utilities/font-family.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    字体风格

    定义

    在 ZUI 中提供了一些 CSS 工具类方便为元素设置不同风格的字体,包括:

    工具类CSS 属性
    font-sansfont-family
    font-seriffont-family
    font-monofont-family

    无衬线字体 font-sans

    The quick brown fox jumps over the lazy dog.

    白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    衬线字体 font-serif

    The quick brown fox jumps over the lazy dog.

    白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    等宽字体 font-mono

    The quick brown fox jumps over the lazy dog.

    白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    参考

    MIT License (MIT)

    - +
    Skip to content

    字体风格

    定义

    在 ZUI 中提供了一些 CSS 工具类方便为元素设置不同风格的字体,包括:

    工具类CSS 属性
    font-sansfont-family
    font-seriffont-family
    font-monofont-family

    无衬线字体 font-sans

    The quick brown fox jumps over the lazy dog.

    白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    衬线字体 font-serif

    The quick brown fox jumps over the lazy dog.

    白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    等宽字体 font-mono

    The quick brown fox jumps over the lazy dog.

    白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    参考

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/utilities/typography/utilities/font-size.html b/dev/utilities/typography/utilities/font-size.html index 0e7e6b880e..9d1086190b 100644 --- a/dev/utilities/typography/utilities/font-size.html +++ b/dev/utilities/typography/utilities/font-size.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    字体大小

    定义

    使用 text-* 工具类控制元素的字体大小。

    工具类CSS 属性
    text-rootfont-size
    text-smfont-size
    text-basefont-size
    text-mdfont-size
    text-lgfont-size
    text-xlfont-size
    text-2xlfont-size
    text-3xlfont-size
    text-4xlfont-size

    示例

    text-root 字体大小
    text-xs 字体大小
    text-sm 字体大小
    text-base 字体大小
    text-md 字体大小
    text-lg 字体大小
    text-xl 字体大小
    text-2xl 字体大小
    text-3xl 字体大小
    text-4xl 字体大小

    MIT License (MIT)

    - +
    Skip to content

    字体大小

    定义

    使用 text-* 工具类控制元素的字体大小。

    工具类CSS 属性
    text-rootfont-size
    text-smfont-size
    text-basefont-size
    text-mdfont-size
    text-lgfont-size
    text-xlfont-size
    text-2xlfont-size
    text-3xlfont-size
    text-4xlfont-size

    示例

    text-root 字体大小
    text-xs 字体大小
    text-sm 字体大小
    text-base 字体大小
    text-md 字体大小
    text-lg 字体大小
    text-xl 字体大小
    text-2xl 字体大小
    text-3xl 字体大小
    text-4xl 字体大小

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/utilities/typography/utilities/font-weight.html b/dev/utilities/typography/utilities/font-weight.html index 4faee98e38..1af931db48 100644 --- a/dev/utilities/typography/utilities/font-weight.html +++ b/dev/utilities/typography/utilities/font-weight.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    字体粗细

    定义

    使用 font-* 工具类来控制元素字体粗细。

    工具类CSS 属性
    font-thinfont-weight
    font-lightfont-weight
    font-mediumfont-weight
    font-semiboldfont-weight
    font-boldfont-weight
    font-blackfont-weight

    示例

    font-thin 字体粗细
    font-light 字体粗细
    font-medium 字体粗细
    font-semibold 字体粗细
    font-bold 字体粗细
    font-black 字体粗细

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/typography/utilities/leading.html b/dev/utilities/typography/utilities/leading.html index 4b66e215dc..792d8b1f07 100644 --- a/dev/utilities/typography/utilities/leading.html +++ b/dev/utilities/typography/utilities/leading.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    行高

    定义

    使用 leading-* 工具类来控制元素文字行高。

    工具类CSS 属性
    leading-3line-height: .75rem;
    leading-4line-height: 1rem;
    leading-5line-height: 1.25rem;
    leading-6line-height: 1.5rem;
    leading-7line-height: 1.75rem;
    leading-8line-height: 2rem;
    leading-9line-height: 2.25rem;
    leading-10line-height: 2.5rem;
    leading-noneline-height: 1;
    leading-tightline-height: 1.25;
    leading-snugline-height: 1.375;
    leading-normalline-height: 1.5;
    leading-relaxedline-height: 1.625;
    leading-looseline-height: 2;

    固定行高

    使用 leading-* 工具类给一个元素一个固定的行高。

    leading-3 行高展示
    leading-4 行高展示
    leading-5 行高展示
    leading-6 行高展示
    leading-7 行高展示
    leading-8 行高展示
    leading-9 行高展示
    leading-10 行高展示

    相对行高

    使用 leading-noneleading-tightleading-snugleading-normalleading-relaxedleading-loose 等工具类,根据元素当前的字体大小,给它一个相对的行高。

    leading-none 行高展示
    leading-none 行高展示
    leading-none 行高展示
    leading-tight 行高展示
    leading-tight 行高展示
    leading-tight 行高展示
    leading-snug 行高展示
    leading-snug 行高展示
    leading-snug 行高展示
    leading-normal 行高展示
    leading-normal 行高展示
    leading-normal 行高展示
    leading-relaxed 行高展示
    leading-relaxed 行高展示
    leading-relaxed 行高展示
    leading-loose 行高展示
    leading-loose 行高展示
    leading-loose 行高展示

    MIT License (MIT)

    - +
    Skip to content

    行高

    定义

    使用 leading-* 工具类来控制元素文字行高。

    工具类CSS 属性
    leading-3line-height: .75rem;
    leading-4line-height: 1rem;
    leading-5line-height: 1.25rem;
    leading-6line-height: 1.5rem;
    leading-7line-height: 1.75rem;
    leading-8line-height: 2rem;
    leading-9line-height: 2.25rem;
    leading-10line-height: 2.5rem;
    leading-noneline-height: 1;
    leading-tightline-height: 1.25;
    leading-snugline-height: 1.375;
    leading-normalline-height: 1.5;
    leading-relaxedline-height: 1.625;
    leading-looseline-height: 2;

    固定行高

    使用 leading-* 工具类给一个元素一个固定的行高。

    leading-3 行高展示
    leading-4 行高展示
    leading-5 行高展示
    leading-6 行高展示
    leading-7 行高展示
    leading-8 行高展示
    leading-9 行高展示
    leading-10 行高展示

    相对行高

    使用 leading-noneleading-tightleading-snugleading-normalleading-relaxedleading-loose 等工具类,根据元素当前的字体大小,给它一个相对的行高。

    leading-none 行高展示
    leading-none 行高展示
    leading-none 行高展示
    leading-tight 行高展示
    leading-tight 行高展示
    leading-tight 行高展示
    leading-snug 行高展示
    leading-snug 行高展示
    leading-snug 行高展示
    leading-normal 行高展示
    leading-normal 行高展示
    leading-normal 行高展示
    leading-relaxed 行高展示
    leading-relaxed 行高展示
    leading-relaxed 行高展示
    leading-loose 行高展示
    leading-loose 行高展示
    leading-loose 行高展示

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/utilities/typography/utilities/line-clamp.html b/dev/utilities/typography/utilities/line-clamp.html index a8c7e0082f..df5fe90acf 100644 --- a/dev/utilities/typography/utilities/line-clamp.html +++ b/dev/utilities/typography/utilities/line-clamp.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    行数限制

    定义

    使用 line-clamp-* 工具类限制显示多少行文本,在文本超出时进行截断:

    工具类属性
    line-clamp-1overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1;
    line-clamp-2overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    line-clamp-3overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
    line-clamp-4overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4;
    line-clamp-5overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5;
    line-clamp-6overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6;

    示例

    至多显示 clamp-1 行

    The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    至多显示 clamp-2 行

    The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    至多显示 clamp-3 行

    The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    至多显示 clamp-4 行

    The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    至多显示 clamp-5 行

    The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    至多显示 clamp-6 行

    The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    MIT License (MIT)

    - +
    Skip to content

    行数限制

    定义

    使用 line-clamp-* 工具类限制显示多少行文本,在文本超出时进行截断:

    工具类属性
    line-clamp-1overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1;
    line-clamp-2overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    line-clamp-3overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
    line-clamp-4overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4;
    line-clamp-5overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5;
    line-clamp-6overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6;

    示例

    至多显示 clamp-1 行

    The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    至多显示 clamp-2 行

    The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    至多显示 clamp-3 行

    The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    至多显示 clamp-4 行

    The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    至多显示 clamp-5 行

    The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    至多显示 clamp-6 行

    The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/utilities/typography/utilities/list-style.html b/dev/utilities/typography/utilities/list-style.html index 57ededad9a..c774abc950 100644 --- a/dev/utilities/typography/utilities/list-style.html +++ b/dev/utilities/typography/utilities/list-style.html @@ -14,14 +14,14 @@ - - + + -
    Skip to content

    列表样式

    定义

    使用工具类 list-* 为元素(通常是 <ul><ol>)设置 CSS 属性 list-style

    工具类属性
    list-unstyledlist-style-type: none; padding-left: 0;
    list-nonelist-style-type: none;
    list-disclist-style-type: disc;
    list-decimallist-style-type: decimal;

    示例

    无样式 list-unstyled

    • 这是一个列表
    • 含四个列表项
    • 作为示例
    • 最后一个列表有嵌套的子列表
      • 子列表项 1
      • 子列表项 2
      • 子列表项 3

    空白样式 list-none

    • 这是一个列表
    • 含四个列表项
    • 作为示例
    • 最后一个列表有嵌套的子列表
      • 子列表项 1
      • 子列表项 2
      • 子列表项 3

    圆点样式 list-disc

    • 这是一个列表
    • 含四个列表项
    • 作为示例
    • 最后一个列表有嵌套的子列表
      • 子列表项 1
      • 子列表项 2
      • 子列表项 3

    序号样式 list-decimal

    • 这是一个列表
    • 含四个列表项
    • 作为示例
    • 最后一个列表有嵌套的子列表
      • 子列表项 1
      • 子列表项 2
      • 子列表项 3

    MIT License (MIT)

    - +
    Skip to content

    列表样式

    定义

    使用工具类 list-* 为元素(通常是 <ul><ol>)设置 CSS 属性 list-style

    工具类属性
    list-unstyledlist-style-type: none; padding-left: 0;
    list-nonelist-style-type: none;
    list-disclist-style-type: disc;
    list-decimallist-style-type: decimal;

    示例

    无样式 list-unstyled

    • 这是一个列表
    • 含四个列表项
    • 作为示例
    • 最后一个列表有嵌套的子列表
      • 子列表项 1
      • 子列表项 2
      • 子列表项 3

    空白样式 list-none

    • 这是一个列表
    • 含四个列表项
    • 作为示例
    • 最后一个列表有嵌套的子列表
      • 子列表项 1
      • 子列表项 2
      • 子列表项 3

    圆点样式 list-disc

    • 这是一个列表
    • 含四个列表项
    • 作为示例
    • 最后一个列表有嵌套的子列表
      • 子列表项 1
      • 子列表项 2
      • 子列表项 3

    序号样式 list-decimal

    • 这是一个列表
    • 含四个列表项
    • 作为示例
    • 最后一个列表有嵌套的子列表
      • 子列表项 1
      • 子列表项 2
      • 子列表项 3

    MIT License (MIT)

    + \ No newline at end of file diff --git a/dev/utilities/typography/utilities/text-align.html b/dev/utilities/typography/utilities/text-align.html index 4eff690db2..e5e5bc6077 100644 --- a/dev/utilities/typography/utilities/text-align.html +++ b/dev/utilities/typography/utilities/text-align.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    文本对齐

    定义

    使用 text-* 工具类来控制元素的文本对齐方式。

    工具类属性
    text-lefttext-align: left;
    text-centertext-align: center;
    text-righttext-align: right;
    text-justifytext-align: justify;

    示例

    文本左对齐

    文本居中对齐

    文本右对齐

    The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/typography/utilities/text-color.html b/dev/utilities/typography/utilities/text-color.html index ff2331c6c8..99d467bd32 100644 --- a/dev/utilities/typography/utilities/text-color.html +++ b/dev/utilities/typography/utilities/text-color.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    文本颜色

    效果

    使用工具类 text-* 给元素添加文本颜色。

    语义化
    Text 文本
    text-primary
    Text 文本
    text-secondary
    Text 文本
    text-success
    Text 文本
    text-warning
    Text 文本
    text-danger
    Text 文本
    text-important
    Text 文本
    text-special
    主色系列
    Text 文本
    text-primary-50
    Text 文本
    text-primary-100
    Text 文本
    text-primary-200
    Text 文本
    text-primary-300
    Text 文本
    text-primary-400
    Text 文本
    text-primary-500
    Text 文本
    text-primary-600
    Text 文本
    text-primary-700
    Text 文本
    text-primary-800
    Text 文本
    text-primary-900
    Text 文本
    text-primary-950
    次要系列
    Text 文本
    text-secondary-50
    Text 文本
    text-secondary-100
    Text 文本
    text-secondary-200
    Text 文本
    text-secondary-300
    Text 文本
    text-secondary-400
    Text 文本
    text-secondary-500
    Text 文本
    text-secondary-600
    Text 文本
    text-secondary-700
    Text 文本
    text-secondary-800
    Text 文本
    text-secondary-900
    Text 文本
    text-secondary-950
    灰度
    Text 文本
    text-gray-50
    Text 文本
    text-gray-100
    Text 文本
    text-gray-200
    Text 文本
    text-gray-300
    Text 文本
    text-gray-400
    Text 文本
    gray
    text-gray-500 别名: text-gray
    Text 文本
    text-gray-600
    Text 文本
    text-gray-700
    Text 文本
    text-gray-800
    Text 文本
    text-gray-900
    Text 文本
    text-gray-950
    界面
    Text 文本
    text-white
    纯白
    Text 文本
    text-black
    纯黑
    Text 文本
    text-transparent
    透明
    Text 文本
    text-canvas
    画布
    Text 文本
    text-inverse
    反色
    Text 文本
    text-surface-light
    加重的控件
    Text 文本
    text-surface
    控件
    Text 文本
    text-surface-strong
    轻量的控件
    Text 文本
    text-fore
    前景色作为背景
    Text 文本
    text-focus
    焦点色作为背景
    特殊
    Text 文本
    text-current
    CSS 值 currentColor
    Text 文本
    text-inherit
    CSS 值 inherit

    文本颜色透明度

    使用工具类 text-opacity-* 给元素设置文本颜色透明度。

    Text 文本
    text-opacity-0
    透明度:0%
    Text 文本
    text-opacity-5
    透明度:5%
    Text 文本
    text-opacity-10
    透明度:10%
    Text 文本
    text-opacity-20
    透明度:20%
    Text 文本
    text-opacity-25
    透明度:25%
    Text 文本
    text-opacity-30
    透明度:30%
    Text 文本
    text-opacity-40
    透明度:40%
    Text 文本
    text-opacity-50
    透明度:60%
    Text 文本
    text-opacity-60
    透明度:60%
    Text 文本
    text-opacity-70
    透明度:70%
    Text 文本
    text-opacity-75
    透明度:75%
    Text 文本
    text-opacity-80
    透明度:80%
    Text 文本
    text-opacity-90
    透明度:90%
    Text 文本
    text-opacity-95
    透明度:95%
    Text 文本
    text-opacity-100
    透明度:0%

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/typography/utilities/text-decoration.html b/dev/utilities/typography/utilities/text-decoration.html index 06f1ed27f8..c70560f7b4 100644 --- a/dev/utilities/typography/utilities/text-decoration.html +++ b/dev/utilities/typography/utilities/text-decoration.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    文本装饰

    定义

    在 ZUI 中,你可以通过如下工具类来设置文本装饰样式:

    工具类属性
    underlinetext-decoration-line: underline;
    overlinetext-decoration-line: overline;
    line-throughtext-decoration-line: line-through;
    no-underlinetext-decoration-line: none;

    示例

    下划线 underline

    The quick brown fox jumps over the lazy dog. 白日依山尽,黄河入海流。

    上划线 overline

    The quick brown fox jumps over the lazy dog. 白日依山尽,黄河入海流。

    中间划线 line-through

    The quick brown fox jumps over the lazy dog. 白日依山尽,黄河入海流。

    无划线 no-underline

    The quick brown fox jumps over the lazy dog. 白日依山尽,黄河入海流。

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/typography/utilities/text-overflow.html b/dev/utilities/typography/utilities/text-overflow.html index 4c479ec873..aafb503a6c 100644 --- a/dev/utilities/typography/utilities/text-overflow.html +++ b/dev/utilities/typography/utilities/text-overflow.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    文本溢出

    定义

    文字溢出包括两种方式,分布为省略和裁剪,在 ZUI 中可以通过如下工具类实现:

    工具类属性
    text-ellipsisoverflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    text-clipoverflow: hidden; text-overflow: clip; white-space: nowrap;

    文字省略 text-ellipsis

    使用 text-ellipsis 用省略号(…)来截断溢出的文本。

    The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    文字裁剪 text-clip

    使用 text-clip 在内容区域的极限处截断文本。

    The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。The quick brown fox jumps over the lazy dog.白日依山尽,黄河入海流。欲穷千里目,更上一层楼。

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/typography/utilities/text-transform.html b/dev/utilities/typography/utilities/text-transform.html index ae764519b9..eb5563f0a7 100644 --- a/dev/utilities/typography/utilities/text-transform.html +++ b/dev/utilities/typography/utilities/text-transform.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    文本大小写

    定义

    在 ZUI 中,你可以通过如下工具类来设置文本大小写显示规则:

    工具类属性
    uppercasetext-transform: uppercase;
    lowercasetext-transform: lowercase;
    capitalizetext-transform: capitalize;
    normal-casetext-transform: none;

    示例

    显示为大写 uppercase

    The quick brown fox jumps over the lazy dog.

    显示为小写 lowercase

    The quick brown fox jumps over the lazy dog.

    显示为单词首字母大写 capitalize

    The quick brown fox jumps over the lazy dog.

    默认大小写 normal-case

    The quick brown fox jumps over the lazy dog.

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/typography/utilities/vertical-align.html b/dev/utilities/typography/utilities/vertical-align.html index ffcc6b51bf..e822d39caf 100644 --- a/dev/utilities/typography/utilities/vertical-align.html +++ b/dev/utilities/typography/utilities/vertical-align.html @@ -14,14 +14,14 @@ - - + +
    Skip to content

    垂直对齐

    定义

    用于控制内联或表格单元格的垂直对齐的工具类。

    工具类属性
    align-middlevertical-align: middle;
    align-topvertical-align: top;
    align-bottomvertical-align: bottom;
    align-subvertical-align: sub;
    align-supervertical-align: super;

    示例

    参照文本中部对齐

    参照文本顶端对齐

    参照文本底部对齐

    参照文本文本下标对齐

    参照文本文本上标对齐

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/typography/utilities/whitespace.html b/dev/utilities/typography/utilities/whitespace.html index 044908663f..bb3414fb89 100644 --- a/dev/utilities/typography/utilities/whitespace.html +++ b/dev/utilities/typography/utilities/whitespace.html @@ -14,8 +14,8 @@ - - + + @@ -29,7 +29,7 @@ 欲穷千里目,更上一层楼。

    保留空格自动换行

    使用 whitespace-pre-wrap 来保留元素中的换行和空格。文本将被正常包装。

    The quick brown fox jumps over the lazy dog. 白日依山尽,黄河入海流。 欲穷千里目,更上一层楼。

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/utilities/typography/utilities/word-break.html b/dev/utilities/typography/utilities/word-break.html index 7974d23d1c..27b563e505 100644 --- a/dev/utilities/typography/utilities/word-break.html +++ b/dev/utilities/typography/utilities/word-break.html @@ -14,8 +14,8 @@ - - + + @@ -27,7 +27,7 @@ 欲穷千里目,更上一层楼。

    任意字内断开

    使用 break-all 在必要的时候添加换行符,而不是试图保留整个单词。

    The quick brown fox jumps over the lazy dog. 白日依山尽,黄河入海流。 欲穷千里目,更上一层楼。

    MIT License (MIT)

    - + \ No newline at end of file diff --git a/dev/zui-3.0.0.zip b/dev/zui-3.0.0.zip index 3906bafbe1..7f69355ece 100644 Binary files a/dev/zui-3.0.0.zip and b/dev/zui-3.0.0.zip differ diff --git a/dev/zui/zui.esm.js b/dev/zui/zui.esm.js index f9afdd36c7..8772037ebe 100644 --- a/dev/zui/zui.esm.js +++ b/dev/zui/zui.esm.js @@ -1,190 +1,190 @@ -var an = (n, t, e) => { - if (!t.has(n)) +var wn = (s, t, e) => { + if (!t.has(s)) throw TypeError("Cannot " + e); }; -var it = (n, t, e) => (an(n, t, "read from private field"), e ? e.call(n) : t.get(n)), ot = (n, t, e) => { - if (t.has(n)) +var at = (s, t, e) => (wn(s, t, "read from private field"), e ? e.call(s) : t.get(s)), ct = (s, t, e) => { + if (t.has(s)) throw TypeError("Cannot add the same private member more than once"); - t instanceof WeakSet ? t.add(n) : t.set(n, e); -}, pt = (n, t, e, s) => (an(n, t, "write to private field"), s ? s.call(n, e) : t.set(n, e), e); -var ln = (n, t, e) => (an(n, t, "access private method"), e); -const wu = "3.0.0", bu = 1725265099881, Dt = document, _s = window, Er = Dt.documentElement, ae = Dt.createElement.bind(Dt), $r = ae("div"), cn = ae("table"), za = ae("tbody"), Gi = ae("tr"), { isArray: Fs, prototype: Ar } = Array, { concat: Oa, filter: Kn, indexOf: Mr, map: Pr, push: Fa, slice: Ir, some: qn, splice: Ha } = Ar, Wa = /^#(?:[\w-]|\\.|[^\x00-\xa0])*$/, ja = /^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/, Ba = /<.+>/, Va = /^\w+$/; -function Gn(n, t) { - const e = Ua(t); - return !n || !e && !ne(t) && !Z(t) ? [] : !e && ja.test(n) ? t.getElementsByClassName(n.slice(1).replace(/\\/g, "")) : !e && Va.test(n) ? t.getElementsByTagName(n) : t.querySelectorAll(n); -} -class Hs { + t instanceof WeakSet ? t.add(s) : t.set(s, e); +}, vt = (s, t, e, n) => (wn(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e); +var bn = (s, t, e) => (wn(s, t, "access private method"), e); +const gd = "3.0.0", md = 1725344393734, Ht = document, Ts = window, io = Ht.documentElement, de = Ht.createElement.bind(Ht), ro = de("div"), Cn = de("table"), bl = de("tbody"), gr = de("tr"), { isArray: Zs, prototype: oo } = Array, { concat: Cl, filter: hi, indexOf: ao, map: lo, push: Sl, slice: co, some: ui, splice: xl } = oo, kl = /^#(?:[\w-]|\\.|[^\x00-\xa0])*$/, Tl = /^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/, Nl = /<.+>/, $l = /^\w+$/; +function di(s, t) { + const e = El(t); + return !s || !e && !le(t) && !tt(t) ? [] : !e && Tl.test(s) ? t.getElementsByClassName(s.slice(1).replace(/\\/g, "")) : !e && $l.test(s) ? t.getElementsByTagName(s) : t.querySelectorAll(s); +} +class Xs { constructor(t, e) { if (!t) return; - if (Cn(t)) + if (zn(t)) return t; - let s = t; - if (et(t)) { - const i = e || Dt; - if (s = Wa.test(t) && ne(i) ? i.getElementById(t.slice(1).replace(/\\/g, "")) : Ba.test(t) ? Lr(t) : Cn(i) ? i.find(t) : et(i) ? f(i).find(t) : Gn(t, i), !s) + let n = t; + if (it(t)) { + const i = e || Ht; + if (n = kl.test(t) && le(i) ? i.getElementById(t.slice(1).replace(/\\/g, "")) : Nl.test(t) ? fo(t) : zn(i) ? i.find(t) : it(i) ? f(i).find(t) : di(t, i), !n) return; - } else if (le(t)) + } else if (fe(t)) return this.ready(t); - (s.nodeType || s === _s) && (s = [s]), this.length = s.length; + (n.nodeType || n === Ts) && (n = [n]), this.length = n.length; for (let i = 0, r = this.length; i < r; i++) - this[i] = s[i]; + this[i] = n[i]; } init(t, e) { - return new Hs(t, e); + return new Xs(t, e); } } -const x = Hs.prototype, f = x.init; +const x = Xs.prototype, f = x.init; f.fn = f.prototype = x; x.length = 0; -x.splice = Ha; -typeof Symbol == "function" && (x[Symbol.iterator] = Ar[Symbol.iterator]); -function Cn(n) { - return n instanceof Hs; +x.splice = xl; +typeof Symbol == "function" && (x[Symbol.iterator] = oo[Symbol.iterator]); +function zn(s) { + return s instanceof Xs; } -function ye(n) { - return !!n && n === n.window; +function Se(s) { + return !!s && s === s.window; } -function ne(n) { - return !!n && n.nodeType === 9; +function le(s) { + return !!s && s.nodeType === 9; } -function Ua(n) { - return !!n && n.nodeType === 11; +function El(s) { + return !!s && s.nodeType === 11; } -function Z(n) { - return !!n && n.nodeType === 1; +function tt(s) { + return !!s && s.nodeType === 1; } -function Ka(n) { - return !!n && n.nodeType === 3; +function Al(s) { + return !!s && s.nodeType === 3; } -function qa(n) { - return typeof n == "boolean"; +function Ml(s) { + return typeof s == "boolean"; } -function le(n) { - return typeof n == "function"; +function fe(s) { + return typeof s == "function"; } -function et(n) { - return typeof n == "string"; +function it(s) { + return typeof s == "string"; } -function ut(n) { - return n === void 0; +function mt(s) { + return s === void 0; } -function Fe(n) { - return n === null; +function qe(s) { + return s === null; } -function Rr(n) { - return !isNaN(parseFloat(n)) && isFinite(n); +function ho(s) { + return !isNaN(parseFloat(s)) && isFinite(s); } -function Yn(n) { - if (typeof n != "object" || n === null) +function fi(s) { + if (typeof s != "object" || s === null) return !1; - const t = Object.getPrototypeOf(n); + const t = Object.getPrototypeOf(s); return t === null || t === Object.prototype; } -f.isWindow = ye; -f.isFunction = le; -f.isArray = Fs; -f.isNumeric = Rr; -f.isPlainObject = Yn; -function X(n, t, e) { +f.isWindow = Se; +f.isFunction = fe; +f.isArray = Zs; +f.isNumeric = ho; +f.isPlainObject = fi; +function et(s, t, e) { if (e) { - let s = n.length; - for (; s--; ) - if (t.call(n[s], s, n[s]) === !1) - return n; - } else if (Yn(n)) { - const s = Object.keys(n); - for (let i = 0, r = s.length; i < r; i++) { - const o = s[i]; - if (t.call(n[o], o, n[o]) === !1) - return n; + let n = s.length; + for (; n--; ) + if (t.call(s[n], n, s[n]) === !1) + return s; + } else if (fi(s)) { + const n = Object.keys(s); + for (let i = 0, r = n.length; i < r; i++) { + const o = n[i]; + if (t.call(s[o], o, s[o]) === !1) + return s; } } else - for (let s = 0, i = n.length; s < i; s++) - if (t.call(n[s], s, n[s]) === !1) - return n; - return n; + for (let n = 0, i = s.length; n < i; n++) + if (t.call(s[n], n, s[n]) === !1) + return s; + return s; } -f.each = X; -x.each = function(n) { - return X(this, n); +f.each = et; +x.each = function(s) { + return et(this, s); }; x.empty = function() { - return this.each((n, t) => { + return this.each((s, t) => { for (; t.firstChild; ) t.removeChild(t.firstChild); }); }; -function ys(...n) { - const t = qa(n[0]) ? n.shift() : !1, e = n.shift(), s = n.length; +function Ns(...s) { + const t = Ml(s[0]) ? s.shift() : !1, e = s.shift(), n = s.length; if (!e) return {}; - if (!s) - return ys(t, f, e); - for (let i = 0; i < s; i++) { - const r = n[i]; + if (!n) + return Ns(t, f, e); + for (let i = 0; i < n; i++) { + const r = s[i]; for (const o in r) - t && (Fs(r[o]) || Yn(r[o])) ? ((!e[o] || e[o].constructor !== r[o].constructor) && (e[o] = new r[o].constructor()), ys(t, e[o], r[o])) : e[o] = r[o]; + t && (Zs(r[o]) || fi(r[o])) ? ((!e[o] || e[o].constructor !== r[o].constructor) && (e[o] = new r[o].constructor()), Ns(t, e[o], r[o])) : e[o] = r[o]; } return e; } -f.extend = ys; -x.extend = function(n) { - return ys(x, n); +f.extend = Ns; +x.extend = function(s) { + return Ns(x, s); }; -const Ga = /\S+/g; -function Ws(n) { - return et(n) ? n.match(Ga) || [] : []; +const Pl = /\S+/g; +function Qs(s) { + return it(s) ? s.match(Pl) || [] : []; } -x.toggleClass = function(n, t) { - const e = Ws(n), s = !ut(t); +x.toggleClass = function(s, t) { + const e = Qs(s), n = !mt(t); return this.each((i, r) => { - Z(r) && X(e, (o, a) => { - s ? t ? r.classList.add(a) : r.classList.remove(a) : r.classList.toggle(a); + tt(r) && et(e, (o, a) => { + n ? t ? r.classList.add(a) : r.classList.remove(a) : r.classList.toggle(a); }); }); }; -x.addClass = function(n) { - return this.toggleClass(n, !0); +x.addClass = function(s) { + return this.toggleClass(s, !0); }; -x.removeAttr = function(n) { - const t = Ws(n); - return this.each((e, s) => { - Z(s) && X(t, (i, r) => { - s.removeAttribute(r); +x.removeAttr = function(s) { + const t = Qs(s); + return this.each((e, n) => { + tt(n) && et(t, (i, r) => { + n.removeAttribute(r); }); }); }; -function Ya(n, t) { - if (n) { - if (et(n)) { +function Il(s, t) { + if (s) { + if (it(s)) { if (arguments.length < 2) { - if (!this[0] || !Z(this[0])) + if (!this[0] || !tt(this[0])) return; - const e = this[0].getAttribute(n); - return Fe(e) ? void 0 : e; + const e = this[0].getAttribute(s); + return qe(e) ? void 0 : e; } - return ut(t) ? this : Fe(t) ? this.removeAttr(n) : this.each((e, s) => { - Z(s) && s.setAttribute(n, t); + return mt(t) ? this : qe(t) ? this.removeAttr(s) : this.each((e, n) => { + tt(n) && n.setAttribute(s, t); }); } - for (const e in n) - this.attr(e, n[e]); + for (const e in s) + this.attr(e, s[e]); return this; } } -x.attr = Ya; -x.removeClass = function(n) { - return arguments.length ? this.toggleClass(n, !1) : this.attr("class", ""); +x.attr = Il; +x.removeClass = function(s) { + return arguments.length ? this.toggleClass(s, !1) : this.attr("class", ""); }; -x.hasClass = function(n) { - return !!n && qn.call(this, (t) => Z(t) && t.classList.contains(n)); +x.hasClass = function(s) { + return !!s && ui.call(this, (t) => tt(t) && t.classList.contains(s)); }; -x.get = function(n) { - return ut(n) ? Ir.call(this) : (n = Number(n), this[n < 0 ? n + this.length : n]); +x.get = function(s) { + return mt(s) ? co.call(this) : (s = Number(s), this[s < 0 ? s + this.length : s]); }; -x.eq = function(n) { - return f(this.get(n)); +x.eq = function(s) { + return f(this.get(s)); }; x.first = function() { return this.eq(0); @@ -192,277 +192,277 @@ x.first = function() { x.last = function() { return this.eq(-1); }; -function Ja(n) { - return ut(n) ? this.get().map((t) => Z(t) || Ka(t) ? t.textContent : "").join("") : this.each((t, e) => { - Z(e) && (e.textContent = n); +function Rl(s) { + return mt(s) ? this.get().map((t) => tt(t) || Al(t) ? t.textContent : "").join("") : this.each((t, e) => { + tt(e) && (e.textContent = s); }); } -x.text = Ja; -function Lt(n, t, e) { - if (!Z(n)) +x.text = Rl; +function Ft(s, t, e) { + if (!tt(s)) return; - const s = _s.getComputedStyle(n, null); - return e ? s.getPropertyValue(t) || void 0 : s[t] || n.style[t]; + const n = Ts.getComputedStyle(s, null); + return e ? n.getPropertyValue(t) || void 0 : n[t] || s.style[t]; } -function Tt(n, t) { - return parseInt(Lt(n, t), 10) || 0; +function At(s, t) { + return parseInt(Ft(s, t), 10) || 0; } -function Yi(n, t) { - return Tt(n, `border${t ? "Left" : "Top"}Width`) + Tt(n, `padding${t ? "Left" : "Top"}`) + Tt(n, `padding${t ? "Right" : "Bottom"}`) + Tt(n, `border${t ? "Right" : "Bottom"}Width`); +function mr(s, t) { + return At(s, `border${t ? "Left" : "Top"}Width`) + At(s, `padding${t ? "Left" : "Top"}`) + At(s, `padding${t ? "Right" : "Bottom"}`) + At(s, `border${t ? "Right" : "Bottom"}Width`); } -const hn = {}; -function Za(n) { - if (hn[n]) - return hn[n]; - const t = ae(n); - Dt.body.insertBefore(t, null); - const e = Lt(t, "display"); - return Dt.body.removeChild(t), hn[n] = e !== "none" ? e : "block"; +const Sn = {}; +function Dl(s) { + if (Sn[s]) + return Sn[s]; + const t = de(s); + Ht.body.insertBefore(t, null); + const e = Ft(t, "display"); + return Ht.body.removeChild(t), Sn[s] = e !== "none" ? e : "block"; } -function Ji(n) { - return Lt(n, "display") === "none"; +function _r(s) { + return Ft(s, "display") === "none"; } -function Dr(n, t) { - const e = n && (n.matches || n.webkitMatchesSelector || n.msMatchesSelector); - return !!e && !!t && e.call(n, t); +function uo(s, t) { + const e = s && (s.matches || s.webkitMatchesSelector || s.msMatchesSelector); + return !!e && !!t && e.call(s, t); } -function js(n) { - return et(n) ? (t, e) => Dr(e, n) : le(n) ? n : Cn(n) ? (t, e) => n.is(e) : n ? (t, e) => e === n : () => !1; +function tn(s) { + return it(s) ? (t, e) => uo(e, s) : fe(s) ? s : zn(s) ? (t, e) => s.is(e) : s ? (t, e) => e === s : () => !1; } -x.filter = function(n) { - const t = js(n); - return f(Kn.call(this, (e, s) => t.call(e, s, e))); +x.filter = function(s) { + const t = tn(s); + return f(hi.call(this, (e, n) => t.call(e, n, e))); }; -function Yt(n, t) { - return t ? n.filter(t) : n; +function te(s, t) { + return t ? s.filter(t) : s; } -x.detach = function(n) { - return Yt(this, n).each((t, e) => { +x.detach = function(s) { + return te(this, s).each((t, e) => { e.parentNode && e.parentNode.removeChild(e); }), this; }; -const Xa = /^\s*<(\w+)[^>]*>/, Qa = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, Zi = { - "*": $r, - tr: za, - td: Gi, - th: Gi, - thead: cn, - tbody: cn, - tfoot: cn -}; -function Lr(n) { - if (!et(n)) +const Ll = /^\s*<(\w+)[^>]*>/, zl = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, yr = { + "*": ro, + tr: bl, + td: gr, + th: gr, + thead: Cn, + tbody: Cn, + tfoot: Cn +}; +function fo(s) { + if (!it(s)) return []; - if (Qa.test(n)) - return [ae(RegExp.$1)]; - const t = Xa.test(n) && RegExp.$1, e = Zi[t] || Zi["*"]; - return e.innerHTML = n, f(e.childNodes).detach().get(); -} -f.parseHTML = Lr; -x.has = function(n) { - const t = et(n) ? (e, s) => Gn(n, s).length : (e, s) => s.contains(n); + if (zl.test(s)) + return [de(RegExp.$1)]; + const t = Ll.test(s) && RegExp.$1, e = yr[t] || yr["*"]; + return e.innerHTML = s, f(e.childNodes).detach().get(); +} +f.parseHTML = fo; +x.has = function(s) { + const t = it(s) ? (e, n) => di(s, n).length : (e, n) => n.contains(s); return this.filter(t); }; -x.not = function(n) { - const t = js(n); - return this.filter((e, s) => (!et(n) || Z(s)) && !t.call(s, e, s)); +x.not = function(s) { + const t = tn(s); + return this.filter((e, n) => (!it(s) || tt(n)) && !t.call(n, e, n)); }; -function Ot(n, t, e, s) { - const i = [], r = le(t), o = s && js(s); - for (let a = 0, l = n.length; a < l; a++) +function jt(s, t, e, n) { + const i = [], r = fe(t), o = n && tn(n); + for (let a = 0, l = s.length; a < l; a++) if (r) { - const c = t(n[a]); - c.length && Fa.apply(i, c); + const c = t(s[a]); + c.length && Sl.apply(i, c); } else { - let c = n[a][t]; - for (; c != null && !(s && o(-1, c)); ) + let c = s[a][t]; + for (; c != null && !(n && o(-1, c)); ) i.push(c), c = e ? c[t] : null; } return i; } -function zr(n) { - return n.multiple && n.options ? Ot(Kn.call(n.options, (t) => t.selected && !t.disabled && !t.parentNode.disabled), "value") : n.value || ""; +function po(s) { + return s.multiple && s.options ? jt(hi.call(s.options, (t) => t.selected && !t.disabled && !t.parentNode.disabled), "value") : s.value || ""; } -function tl(n) { +function Ol(s) { return arguments.length ? this.each((t, e) => { - const s = e.multiple && e.options; - if (s || Ur.test(e.type)) { - const i = Fs(n) ? Pr.call(n, String) : Fe(n) ? [] : [String(n)]; - s ? X(e.options, (r, o) => { + const n = e.multiple && e.options; + if (n || Co.test(e.type)) { + const i = Zs(s) ? lo.call(s, String) : qe(s) ? [] : [String(s)]; + n ? et(e.options, (r, o) => { o.selected = i.indexOf(o.value) >= 0; }, !0) : e.checked = i.indexOf(e.value) >= 0; } else - e.value = ut(n) || Fe(n) ? "" : n; - }) : this[0] && zr(this[0]); + e.value = mt(s) || qe(s) ? "" : s; + }) : this[0] && po(this[0]); } -x.val = tl; -x.is = function(n) { - const t = js(n); - return qn.call(this, (e, s) => t.call(e, s, e)); +x.val = Ol; +x.is = function(s) { + const t = tn(s); + return ui.call(this, (e, n) => t.call(e, n, e)); }; f.guid = 1; -function At(n) { - return n.length > 1 ? Kn.call(n, (t, e, s) => Mr.call(s, t) === e) : n; +function Rt(s) { + return s.length > 1 ? hi.call(s, (t, e, n) => ao.call(n, t) === e) : s; } -f.unique = At; -x.add = function(n, t) { - return f(At(this.get().concat(f(n, t).get()))); +f.unique = Rt; +x.add = function(s, t) { + return f(Rt(this.get().concat(f(s, t).get()))); }; -x.children = function(n) { - return Yt(f(At(Ot(this, (t) => t.children))), n); +x.children = function(s) { + return te(f(Rt(jt(this, (t) => t.children))), s); }; -x.parent = function(n) { - return Yt(f(At(Ot(this, "parentNode"))), n); +x.parent = function(s) { + return te(f(Rt(jt(this, "parentNode"))), s); }; -x.index = function(n) { - const t = n ? f(n)[0] : this[0], e = n ? this : f(t).parent().children(); - return Mr.call(e, t); +x.index = function(s) { + const t = s ? f(s)[0] : this[0], e = s ? this : f(t).parent().children(); + return ao.call(e, t); }; -x.closest = function(n) { - const t = this.filter(n); +x.closest = function(s) { + const t = this.filter(s); if (t.length) return t; const e = this.parent(); - return e.length ? e.closest(n) : t; + return e.length ? e.closest(s) : t; }; -x.siblings = function(n) { - return Yt(f(At(Ot(this, (t) => f(t).parent().children().not(t)))), n); +x.siblings = function(s) { + return te(f(Rt(jt(this, (t) => f(t).parent().children().not(t)))), s); }; -x.find = function(n) { - return f(At(Ot(this, (t) => Gn(n, t)))); +x.find = function(s) { + return f(Rt(jt(this, (t) => di(s, t)))); }; -const el = /^\s*\s*$/g, sl = /^$|^module$|\/(java|ecma)script/i, nl = ["type", "src", "nonce", "noModule"]; -function il(n, t) { - const e = f(n); - e.filter("script").add(e.find("script")).each((s, i) => { - if (sl.test(i.type) && Er.contains(i)) { - const r = ae("script"); - r.text = i.textContent.replace(el, ""), X(nl, (o, a) => { +const Hl = /^\s*\s*$/g, Fl = /^$|^module$|\/(java|ecma)script/i, Wl = ["type", "src", "nonce", "noModule"]; +function jl(s, t) { + const e = f(s); + e.filter("script").add(e.find("script")).each((n, i) => { + if (Fl.test(i.type) && io.contains(i)) { + const r = de("script"); + r.text = i.textContent.replace(Hl, ""), et(Wl, (o, a) => { i[a] && (r[a] = i[a]); }), t.head.insertBefore(r, null), t.head.removeChild(r); } }); } -function rl(n, t, e, s, i) { - s ? n.insertBefore(t, e ? n.firstChild : null) : n.nodeName === "HTML" ? n.parentNode.replaceChild(t, n) : n.parentNode.insertBefore(t, e ? n : n.nextSibling), i && il(t, n.ownerDocument); +function Bl(s, t, e, n, i) { + n ? s.insertBefore(t, e ? s.firstChild : null) : s.nodeName === "HTML" ? s.parentNode.replaceChild(t, s) : s.parentNode.insertBefore(t, e ? s : s.nextSibling), i && jl(t, s.ownerDocument); } -function Jt(n, t, e, s, i, r, o, a) { - return X(n, (l, c) => { - X(f(c), (u, h) => { - X(f(t), (p, d) => { +function ee(s, t, e, n, i, r, o, a) { + return et(s, (l, c) => { + et(f(c), (u, h) => { + et(f(t), (p, d) => { const m = e ? h : d, _ = e ? d : h, v = e ? u : p; - rl(m, v ? _.cloneNode(!0) : _, s, i, !v); + Bl(m, v ? _.cloneNode(!0) : _, n, i, !v); }, a); }, o); }, r), t; } x.after = function() { - return Jt(arguments, this, !1, !1, !1, !0, !0); + return ee(arguments, this, !1, !1, !1, !0, !0); }; x.append = function() { - return Jt(arguments, this, !1, !1, !0); + return ee(arguments, this, !1, !1, !0); }; -function ol(n) { +function Vl(s) { if (!arguments.length) return this[0] && this[0].innerHTML; - if (ut(n)) + if (mt(s)) return this; - const t = /]/.test(n); - return this.each((e, s) => { - Z(s) && (t ? f(s).empty().append(n) : s.innerHTML = n); + const t = /]/.test(s); + return this.each((e, n) => { + tt(n) && (t ? f(n).empty().append(s) : n.innerHTML = s); }); } -x.html = ol; -x.appendTo = function(n) { - return Jt(arguments, this, !0, !1, !0); +x.html = Vl; +x.appendTo = function(s) { + return ee(arguments, this, !0, !1, !0); }; -x.wrapInner = function(n) { +x.wrapInner = function(s) { return this.each((t, e) => { - const s = f(e), i = s.contents(); - i.length ? i.wrapAll(n) : s.append(n); + const n = f(e), i = n.contents(); + i.length ? i.wrapAll(s) : n.append(s); }); }; x.before = function() { - return Jt(arguments, this, !1, !0); + return ee(arguments, this, !1, !0); }; -x.wrapAll = function(n) { - let t = f(n), e = t[0]; +x.wrapAll = function(s) { + let t = f(s), e = t[0]; for (; e.children.length; ) e = e.firstElementChild; return this.first().before(t), this.appendTo(e); }; -x.wrap = function(n) { +x.wrap = function(s) { return this.each((t, e) => { - const s = f(n)[0]; - f(e).wrapAll(t ? s.cloneNode(!0) : s); + const n = f(s)[0]; + f(e).wrapAll(t ? n.cloneNode(!0) : n); }); }; -x.insertAfter = function(n) { - return Jt(arguments, this, !0, !1, !1, !1, !1, !0); +x.insertAfter = function(s) { + return ee(arguments, this, !0, !1, !1, !1, !1, !0); }; -x.insertBefore = function(n) { - return Jt(arguments, this, !0, !0); +x.insertBefore = function(s) { + return ee(arguments, this, !0, !0); }; x.prepend = function() { - return Jt(arguments, this, !1, !0, !0, !0, !0); + return ee(arguments, this, !1, !0, !0, !0, !0); }; -x.prependTo = function(n) { - return Jt(arguments, this, !0, !0, !0, !1, !1, !0); +x.prependTo = function(s) { + return ee(arguments, this, !0, !0, !0, !1, !1, !0); }; x.contents = function() { - return f(At(Ot(this, (n) => n.tagName === "IFRAME" ? [n.contentDocument] : n.tagName === "TEMPLATE" ? n.content.childNodes : n.childNodes))); + return f(Rt(jt(this, (s) => s.tagName === "IFRAME" ? [s.contentDocument] : s.tagName === "TEMPLATE" ? s.content.childNodes : s.childNodes))); }; -x.next = function(n, t, e) { - return Yt(f(At(Ot(this, "nextElementSibling", t, e))), n); +x.next = function(s, t, e) { + return te(f(Rt(jt(this, "nextElementSibling", t, e))), s); }; -x.nextAll = function(n) { - return this.next(n, !0); +x.nextAll = function(s) { + return this.next(s, !0); }; -x.nextUntil = function(n, t) { - return this.next(t, !0, n); +x.nextUntil = function(s, t) { + return this.next(t, !0, s); }; -x.parents = function(n, t) { - return Yt(f(At(Ot(this, "parentElement", !0, t))), n); +x.parents = function(s, t) { + return te(f(Rt(jt(this, "parentElement", !0, t))), s); }; -x.parentsUntil = function(n, t) { - return this.parents(t, n); +x.parentsUntil = function(s, t) { + return this.parents(t, s); }; -x.prev = function(n, t, e) { - return Yt(f(At(Ot(this, "previousElementSibling", t, e))), n); +x.prev = function(s, t, e) { + return te(f(Rt(jt(this, "previousElementSibling", t, e))), s); }; -x.prevAll = function(n) { - return this.prev(n, !0); +x.prevAll = function(s) { + return this.prev(s, !0); }; -x.prevUntil = function(n, t) { - return this.prev(t, !0, n); +x.prevUntil = function(s, t) { + return this.prev(t, !0, s); }; -x.map = function(n) { - return f(Oa.apply([], Pr.call(this, (t, e) => n.call(t, e, t)))); +x.map = function(s) { + return f(Cl.apply([], lo.call(this, (t, e) => s.call(t, e, t)))); }; x.clone = function() { - return this.map((n, t) => t.cloneNode(!0)); + return this.map((s, t) => t.cloneNode(!0)); }; x.offsetParent = function() { - return this.map((n, t) => { + return this.map((s, t) => { let e = t.offsetParent; - for (; e && Lt(e, "position") === "static"; ) + for (; e && Ft(e, "position") === "static"; ) e = e.offsetParent; - return e || Er; + return e || io; }); }; -x.slice = function(n, t) { - return f(Ir.call(this, n, t)); +x.slice = function(s, t) { + return f(co.call(this, s, t)); }; -const al = /-([a-z])/g; -function Jn(n) { - return n.replace(al, (t, e) => e.toUpperCase()); +const Ul = /-([a-z])/g; +function pi(s) { + return s.replace(Ul, (t, e) => e.toUpperCase()); } -x.ready = function(n) { - const t = () => setTimeout(n, 0, f); - return Dt.readyState !== "loading" ? t() : Dt.addEventListener("DOMContentLoaded", t), this; +x.ready = function(s) { + const t = () => setTimeout(s, 0, f); + return Ht.readyState !== "loading" ? t() : Ht.addEventListener("DOMContentLoaded", t), this; }; x.unwrap = function() { - return this.parent().each((n, t) => { + return this.parent().each((s, t) => { if (t.tagName === "BODY") return; const e = f(t); @@ -470,36 +470,36 @@ x.unwrap = function() { }), this; }; x.offset = function() { - const n = this[0]; - if (!n) + const s = this[0]; + if (!s) return; - const t = n.getBoundingClientRect(); + const t = s.getBoundingClientRect(); return { - top: t.top + _s.pageYOffset, - left: t.left + _s.pageXOffset + top: t.top + Ts.pageYOffset, + left: t.left + Ts.pageXOffset }; }; x.position = function() { - const n = this[0]; - if (!n) + const s = this[0]; + if (!s) return; - const t = Lt(n, "position") === "fixed", e = t ? n.getBoundingClientRect() : this.offset(); + const t = Ft(s, "position") === "fixed", e = t ? s.getBoundingClientRect() : this.offset(); if (!t) { - const s = n.ownerDocument; - let i = n.offsetParent || s.documentElement; - for (; (i === s.body || i === s.documentElement) && Lt(i, "position") === "static"; ) + const n = s.ownerDocument; + let i = s.offsetParent || n.documentElement; + for (; (i === n.body || i === n.documentElement) && Ft(i, "position") === "static"; ) i = i.parentNode; - if (i !== n && Z(i)) { + if (i !== s && tt(i)) { const r = f(i).offset(); - e.top -= r.top + Tt(i, "borderTopWidth"), e.left -= r.left + Tt(i, "borderLeftWidth"); + e.top -= r.top + At(i, "borderTopWidth"), e.left -= r.left + At(i, "borderLeftWidth"); } } return { - top: e.top - Tt(n, "marginTop"), - left: e.left - Tt(n, "marginLeft") + top: e.top - At(s, "marginTop"), + left: e.left - At(s, "marginLeft") }; }; -const Or = { +const go = { /* GENERAL */ class: "className", contenteditable: "contentEditable", @@ -515,40 +515,40 @@ const Or = { /* IMAGE */ usemap: "useMap" }; -x.prop = function(n, t) { - if (n) { - if (et(n)) - return n = Or[n] || n, arguments.length < 2 ? this[0] && this[0][n] : this.each((e, s) => { - s[n] = t; +x.prop = function(s, t) { + if (s) { + if (it(s)) + return s = go[s] || s, arguments.length < 2 ? this[0] && this[0][s] : this.each((e, n) => { + n[s] = t; }); - for (const e in n) - this.prop(e, n[e]); + for (const e in s) + this.prop(e, s[e]); return this; } }; -x.removeProp = function(n) { +x.removeProp = function(s) { return this.each((t, e) => { - delete e[Or[n] || n]; + delete e[go[s] || s]; }); }; -const ll = /^--/; -function Zn(n) { - return ll.test(n); +const Kl = /^--/; +function gi(s) { + return Kl.test(s); } -const un = {}, { style: cl } = $r, hl = ["webkit", "moz", "ms"]; -function ul(n, t = Zn(n)) { +const xn = {}, { style: ql } = ro, Gl = ["webkit", "moz", "ms"]; +function Yl(s, t = gi(s)) { if (t) - return n; - if (!un[n]) { - const e = Jn(n), s = `${e[0].toUpperCase()}${e.slice(1)}`, i = `${e} ${hl.join(`${s} `)}${s}`.split(" "); - X(i, (r, o) => { - if (o in cl) - return un[n] = o, !1; + return s; + if (!xn[s]) { + const e = pi(s), n = `${e[0].toUpperCase()}${e.slice(1)}`, i = `${e} ${Gl.join(`${n} `)}${n}`.split(" "); + et(i, (r, o) => { + if (o in ql) + return xn[s] = o, !1; }); } - return un[n]; + return xn[s]; } -const dl = { +const Jl = { animationIterationCount: !0, columnCount: !0, flexGrow: !0, @@ -568,90 +568,90 @@ const dl = { widows: !0, zIndex: !0 }; -function Fr(n, t, e = Zn(n)) { - return !e && !dl[n] && Rr(t) ? `${t}px` : t; +function mo(s, t, e = gi(s)) { + return !e && !Jl[s] && ho(t) ? `${t}px` : t; } -function fl(n, t) { - if (et(n)) { - const e = Zn(n); - return n = ul(n, e), arguments.length < 2 ? this[0] && Lt(this[0], n, e) : n ? (t = Fr(n, t, e), this.each((s, i) => { - Z(i) && (e ? i.style.setProperty(n, t) : i.style[n] = t); +function Zl(s, t) { + if (it(s)) { + const e = gi(s); + return s = Yl(s, e), arguments.length < 2 ? this[0] && Ft(this[0], s, e) : s ? (t = mo(s, t, e), this.each((n, i) => { + tt(i) && (e ? i.style.setProperty(s, t) : i.style[s] = t); })) : this; } - for (const e in n) - this.css(e, n[e]); + for (const e in s) + this.css(e, s[e]); return this; } -x.css = fl; -function Hr(n, t) { +x.css = Zl; +function _o(s, t) { try { - return n(t); + return s(t); } catch { return t; } } -const pl = /^\s+|\s+$/; -function Xi(n, t) { - const e = n.dataset[t] || n.dataset[Jn(t)]; - return pl.test(e) ? e : Hr(JSON.parse, e); +const Xl = /^\s+|\s+$/; +function vr(s, t) { + const e = s.dataset[t] || s.dataset[pi(t)]; + return Xl.test(e) ? e : _o(JSON.parse, e); } -function gl(n, t, e) { - e = Hr(JSON.stringify, e), n.dataset[Jn(t)] = e; +function Ql(s, t, e) { + e = _o(JSON.stringify, e), s.dataset[pi(t)] = e; } -function ml(n, t) { - if (!n) { +function tc(s, t) { + if (!s) { if (!this[0]) return; const e = {}; - for (const s in this[0].dataset) - e[s] = Xi(this[0], s); + for (const n in this[0].dataset) + e[n] = vr(this[0], n); return e; } - if (et(n)) - return arguments.length < 2 ? this[0] && Xi(this[0], n) : ut(t) ? this : this.each((e, s) => { - gl(s, n, t); + if (it(s)) + return arguments.length < 2 ? this[0] && vr(this[0], s) : mt(t) ? this : this.each((e, n) => { + Ql(n, s, t); }); - for (const e in n) - this.data(e, n[e]); + for (const e in s) + this.data(e, s[e]); return this; } -x.data = ml; -function Wr(n, t) { - const e = n.documentElement; - return Math.max(n.body[`scroll${t}`], e[`scroll${t}`], n.body[`offset${t}`], e[`offset${t}`], e[`client${t}`]); +x.data = tc; +function yo(s, t) { + const e = s.documentElement; + return Math.max(s.body[`scroll${t}`], e[`scroll${t}`], s.body[`offset${t}`], e[`offset${t}`], e[`client${t}`]); } -X([!0, !1], (n, t) => { - X(["Width", "Height"], (e, s) => { - const i = `${t ? "outer" : "inner"}${s}`; +et([!0, !1], (s, t) => { + et(["Width", "Height"], (e, n) => { + const i = `${t ? "outer" : "inner"}${n}`; x[i] = function(r) { if (this[0]) - return ye(this[0]) ? t ? this[0][`inner${s}`] : this[0].document.documentElement[`client${s}`] : ne(this[0]) ? Wr(this[0], s) : this[0][`${t ? "offset" : "client"}${s}`] + (r && t ? Tt(this[0], `margin${e ? "Top" : "Left"}`) + Tt(this[0], `margin${e ? "Bottom" : "Right"}`) : 0); + return Se(this[0]) ? t ? this[0][`inner${n}`] : this[0].document.documentElement[`client${n}`] : le(this[0]) ? yo(this[0], n) : this[0][`${t ? "offset" : "client"}${n}`] + (r && t ? At(this[0], `margin${e ? "Top" : "Left"}`) + At(this[0], `margin${e ? "Bottom" : "Right"}`) : 0); }; }); }); -X(["Width", "Height"], (n, t) => { +et(["Width", "Height"], (s, t) => { const e = t.toLowerCase(); - x[e] = function(s) { + x[e] = function(n) { if (!this[0]) - return ut(s) ? void 0 : this; + return mt(n) ? void 0 : this; if (!arguments.length) - return ye(this[0]) ? this[0].document.documentElement[`client${t}`] : ne(this[0]) ? Wr(this[0], t) : this[0].getBoundingClientRect()[e] - Yi(this[0], !n); - const i = parseInt(s, 10); + return Se(this[0]) ? this[0].document.documentElement[`client${t}`] : le(this[0]) ? yo(this[0], t) : this[0].getBoundingClientRect()[e] - mr(this[0], !s); + const i = parseInt(n, 10); return this.each((r, o) => { - if (!Z(o)) + if (!tt(o)) return; - const a = Lt(o, "boxSizing"); - o.style[e] = Fr(e, i + (a === "border-box" ? Yi(o, !n) : 0)); + const a = Ft(o, "boxSizing"); + o.style[e] = mo(e, i + (a === "border-box" ? mr(o, !s) : 0)); }); }; }); -const Qi = "___cd"; -x.toggle = function(n) { +const wr = "___cd"; +x.toggle = function(s) { return this.each((t, e) => { - if (!Z(e)) + if (!tt(e)) return; - const s = Ji(e); - (ut(n) ? s : n) ? (e.style.display = e[Qi] || "", Ji(e) && (e.style.display = Za(e.tagName))) : s || (e[Qi] = Lt(e, "display"), e.style.display = "none"); + const n = _r(e); + (mt(s) ? n : s) ? (e.style.display = e[wr] || "", _r(e) && (e.style.display = Dl(e.tagName))) : n || (e[wr] = Ft(e, "display"), e.style.display = "none"); }); }; x.hide = function() { @@ -660,96 +660,96 @@ x.hide = function() { x.show = function() { return this.toggle(!0); }; -const tr = "___ce", Xn = ".", Qn = { focus: "focusin", blur: "focusout" }, jr = { mouseenter: "mouseover", mouseleave: "mouseout" }, _l = /^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i; -function ti(n) { - return jr[n] || Qn[n] || n; +const br = "___ce", mi = ".", _i = { focus: "focusin", blur: "focusout" }, vo = { mouseenter: "mouseover", mouseleave: "mouseout" }, ec = /^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i; +function yi(s) { + return vo[s] || _i[s] || s; } -function ei(n) { - const t = n.split(Xn); +function vi(s) { + const t = s.split(mi); return [t[0], t.slice(1).sort()]; } -x.trigger = function(n, t) { - if (et(n)) { - const [s, i] = ei(n), r = ti(s); +x.trigger = function(s, t) { + if (it(s)) { + const [n, i] = vi(s), r = yi(n); if (!r) return this; - const o = _l.test(r) ? "MouseEvents" : "HTMLEvents"; - n = Dt.createEvent(o), n.initEvent(r, !0, !0), n.namespace = i.join(Xn), n.___ot = s; + const o = ec.test(r) ? "MouseEvents" : "HTMLEvents"; + s = Ht.createEvent(o), s.initEvent(r, !0, !0), s.namespace = i.join(mi), s.___ot = n; } - n.___td = t; - const e = n.___ot in Qn; - return this.each((s, i) => { - e && le(i[n.___ot]) && (i[`___i${n.type}`] = !0, i[n.___ot](), i[`___i${n.type}`] = !1), i.dispatchEvent(n); + s.___td = t; + const e = s.___ot in _i; + return this.each((n, i) => { + e && fe(i[s.___ot]) && (i[`___i${s.type}`] = !0, i[s.___ot](), i[`___i${s.type}`] = !1), i.dispatchEvent(s); }); }; -function Br(n) { - return n[tr] = n[tr] || {}; +function wo(s) { + return s[br] = s[br] || {}; } -function yl(n, t, e, s, i) { - const r = Br(n); - r[t] = r[t] || [], r[t].push([e, s, i]), n.addEventListener(t, i); +function sc(s, t, e, n, i) { + const r = wo(s); + r[t] = r[t] || [], r[t].push([e, n, i]), s.addEventListener(t, i); } -function Vr(n, t) { - return !t || !qn.call(t, (e) => n.indexOf(e) < 0); +function bo(s, t) { + return !t || !ui.call(t, (e) => s.indexOf(e) < 0); } -function vs(n, t, e, s, i) { - const r = Br(n); +function $s(s, t, e, n, i) { + const r = wo(s); if (t) r[t] && (r[t] = r[t].filter(([o, a, l]) => { - if (i && l.guid !== i.guid || !Vr(o, e) || s && s !== a) + if (i && l.guid !== i.guid || !bo(o, e) || n && n !== a) return !0; - n.removeEventListener(t, l); + s.removeEventListener(t, l); })); else for (t in r) - vs(n, t, e, s, i); + $s(s, t, e, n, i); } -x.off = function(n, t, e) { - if (ut(n)) - this.each((s, i) => { - !Z(i) && !ne(i) && !ye(i) || vs(i); +x.off = function(s, t, e) { + if (mt(s)) + this.each((n, i) => { + !tt(i) && !le(i) && !Se(i) || $s(i); }); - else if (et(n)) - le(t) && (e = t, t = ""), X(Ws(n), (s, i) => { - const [r, o] = ei(i), a = ti(r); + else if (it(s)) + fe(t) && (e = t, t = ""), et(Qs(s), (n, i) => { + const [r, o] = vi(i), a = yi(r); this.each((l, c) => { - !Z(c) && !ne(c) && !ye(c) || vs(c, a, o, t, e); + !tt(c) && !le(c) && !Se(c) || $s(c, a, o, t, e); }); }); else - for (const s in n) - this.off(s, n[s]); + for (const n in s) + this.off(n, s[n]); return this; }; -x.remove = function(n) { - return Yt(this, n).detach().off(), this; +x.remove = function(s) { + return te(this, s).detach().off(), this; }; -x.replaceWith = function(n) { - return this.before(n).remove(); +x.replaceWith = function(s) { + return this.before(s).remove(); }; -x.replaceAll = function(n) { - return f(n).replaceWith(this), this; +x.replaceAll = function(s) { + return f(s).replaceWith(this), this; }; -function vl(n, t, e, s, i) { - if (!et(n)) { - for (const r in n) - this.on(r, t, e, n[r], i); +function nc(s, t, e, n, i) { + if (!it(s)) { + for (const r in s) + this.on(r, t, e, s[r], i); return this; } - return et(t) || (ut(t) || Fe(t) ? t = "" : ut(e) ? (e = t, t = "") : (s = e, e = t, t = "")), le(s) || (s = e, e = void 0), s ? (X(Ws(n), (r, o) => { - const [a, l] = ei(o), c = ti(a), u = a in jr, h = a in Qn; + return it(t) || (mt(t) || qe(t) ? t = "" : mt(e) ? (e = t, t = "") : (n = e, e = t, t = "")), fe(n) || (n = e, e = void 0), n ? (et(Qs(s), (r, o) => { + const [a, l] = vi(o), c = yi(a), u = a in vo, h = a in _i; c && this.each((p, d) => { - if (!Z(d) && !ne(d) && !ye(d)) + if (!tt(d) && !le(d) && !Se(d)) return; const m = function(_) { if (_.target[`___i${_.type}`]) return _.stopImmediatePropagation(); - if (_.namespace && !Vr(l, _.namespace.split(Xn)) || !t && (h && (_.target !== d || _.___ot === c) || u && _.relatedTarget && d.contains(_.relatedTarget))) + if (_.namespace && !bo(l, _.namespace.split(mi)) || !t && (h && (_.target !== d || _.___ot === c) || u && _.relatedTarget && d.contains(_.relatedTarget))) return; let v = d; if (t) { let w = _.target; - for (; !Dr(w, t); ) + for (; !uo(w, t); ) if (w === d || (w = w.parentNode, !w)) return; v = w; @@ -770,54 +770,54 @@ function vl(n, t, e, s, i) { return e; } }); - const y = s.call(v, _, _.___td); - i && vs(d, c, l, t, m), y === !1 && (_.preventDefault(), _.stopPropagation()); + const y = n.call(v, _, _.___td); + i && $s(d, c, l, t, m), y === !1 && (_.preventDefault(), _.stopPropagation()); }; - m.guid = s.guid = s.guid || f.guid++, yl(d, c, l, t, m); + m.guid = n.guid = n.guid || f.guid++, sc(d, c, l, t, m); }); }), this) : this; } -x.on = vl; -function wl(n, t, e, s) { - return this.on(n, t, e, s, !0); +x.on = nc; +function ic(s, t, e, n) { + return this.on(s, t, e, n, !0); } -x.one = wl; -const bl = /\r?\n/g; -function Cl(n, t) { - return `&${encodeURIComponent(n)}=${encodeURIComponent(t.replace(bl, `\r +x.one = ic; +const rc = /\r?\n/g; +function oc(s, t) { + return `&${encodeURIComponent(s)}=${encodeURIComponent(t.replace(rc, `\r `))}`; } -const Sl = /file|reset|submit|button|image/i, Ur = /radio|checkbox/i; +const ac = /file|reset|submit|button|image/i, Co = /radio|checkbox/i; x.serialize = function() { - let n = ""; + let s = ""; return this.each((t, e) => { - X(e.elements || [e], (s, i) => { - if (i.disabled || !i.name || i.tagName === "FIELDSET" || Sl.test(i.type) || Ur.test(i.type) && !i.checked) + et(e.elements || [e], (n, i) => { + if (i.disabled || !i.name || i.tagName === "FIELDSET" || ac.test(i.type) || Co.test(i.type) && !i.checked) return; - const r = zr(i); - if (!ut(r)) { - const o = Fs(r) ? r : [r]; - X(o, (a, l) => { - n += Cl(i.name, l); + const r = po(i); + if (!mt(r)) { + const o = Zs(r) ? r : [r]; + et(o, (a, l) => { + s += oc(i.name, l); }); } }); - }), n.slice(1); + }), s.slice(1); }; window.$ = f; -function xl(n, t) { - if (n == null) - return [n, void 0]; +function lc(s, t) { + if (s == null) + return [s, void 0]; typeof t == "string" && (t = t.split(".")); const e = t.join("."); - let s = n; - const i = [s]; - for (; typeof s == "object" && s !== null && t.length; ) { + let n = s; + const i = [n]; + for (; typeof n == "object" && n !== null && t.length; ) { let r = t.shift(), o; const a = r.indexOf("["); - if (a > 0 && a < r.length - 1 && r.endsWith("]") && (o = r.substring(a + 1, r.length - 1), r = r.substring(0, a)), s = s[r], i.push(s), o !== void 0) - if (typeof s == "object" && s !== null) - s instanceof Map ? s = s.get(o) : s = s[o], i.push(s); + if (a > 0 && a < r.length - 1 && r.endsWith("]") && (o = r.substring(a + 1, r.length - 1), r = r.substring(0, a)), n = n[r], i.push(n), o !== void 0) + if (typeof n == "object" && n !== null) + n instanceof Map ? n = n.get(o) : n = n[o], i.push(n); else throw new Error(`Cannot access property "${r}[${o}]", the full path is "${e}".`); } @@ -825,78 +825,78 @@ function xl(n, t) { throw new Error(`Cannot access property with rest path "${t.join(".")}", the full path is "${e}".`); return i; } -function Kr(n, t, e) { +function So(s, t, e) { try { - const s = xl(n, t), i = s[s.length - 1]; + const n = lc(s, t), i = n[n.length - 1]; return i === void 0 ? e : i; } catch { return e; } } -function W(n, ...t) { +function B(s, ...t) { if (t.length === 0) - return n; + return s; if (t.length === 1 && typeof t[0] == "object" && t[0]) { const e = t[0]; - return Object.keys(e).forEach((s) => { - const i = e[s] ?? ""; - n = n.replace(new RegExp(`\\{${s}\\}`, "g"), `${i}`); - }), n; + return Object.keys(e).forEach((n) => { + const i = e[n] ?? ""; + s = s.replace(new RegExp(`\\{${n}\\}`, "g"), `${i}`); + }), s; } for (let e = 0; e < t.length; e++) { - const s = t[e] ?? ""; - n = n.replace(new RegExp(`\\{${e}\\}`, "g"), `${s}`); + const n = t[e] ?? ""; + s = s.replace(new RegExp(`\\{${e}\\}`, "g"), `${n}`); } - return n; + return s; } -var si = /* @__PURE__ */ ((n) => (n[n.B = 1] = "B", n[n.KB = 1024] = "KB", n[n.MB = 1048576] = "MB", n[n.GB = 1073741824] = "GB", n[n.TB = 1099511627776] = "TB", n))(si || {}); -function Mt(n, t = 2, e) { - return Number.isNaN(n) ? "?KB" : (e || (n < 1024 ? e = "B" : n < 1048576 ? e = "KB" : n < 1073741824 ? e = "MB" : n < 1099511627776 ? e = "GB" : e = "TB"), (n / si[e]).toFixed(t) + e); +var wi = /* @__PURE__ */ ((s) => (s[s.B = 1] = "B", s[s.KB = 1024] = "KB", s[s.MB = 1048576] = "MB", s[s.GB = 1073741824] = "GB", s[s.TB = 1099511627776] = "TB", s))(wi || {}); +function Dt(s, t = 2, e) { + return Number.isNaN(s) ? "?KB" : (e || (s < 1024 ? e = "B" : s < 1048576 ? e = "KB" : s < 1073741824 ? e = "MB" : s < 1099511627776 ? e = "GB" : e = "TB"), (s / wi[e]).toFixed(t) + e); } -const os = (n) => { +const ps = (s) => { const t = /^[0-9]*(B|KB|MB|GB|TB)$/; - n = n.toUpperCase(); - const e = n.match(t); + s = s.toUpperCase(); + const e = s.match(t); if (!e) return 0; - const s = e[1]; - return n = n.replace(s, ""), Number.parseInt(n, 10) * si[s]; + const n = e[1]; + return s = s.replace(n, ""), Number.parseInt(s, 10) * wi[n]; }; -let ni = (document.documentElement.getAttribute("lang") || "zh_cn").toLowerCase().replace("-", "_"), Rt; -function kl() { - return ni; +let bi = (document.documentElement.getAttribute("lang") || "zh_cn").toLowerCase().replace("-", "_"), Ot; +function cc() { + return bi; } -function Tl(n) { - ni = n.toLowerCase().replace("-", "_"); +function hc(s) { + bi = s.toLowerCase().replace("-", "_"); } -function qr(n, t) { - Rt || (Rt = {}), typeof n == "string" && (n = { [n]: t ?? {} }), f.extend(!0, Rt, n); +function xo(s, t) { + Ot || (Ot = {}), typeof s == "string" && (s = { [s]: t ?? {} }), f.extend(!0, Ot, s); } -function O(n, t, e, s, i, r) { - Array.isArray(n) ? Rt && n.unshift(Rt) : n = Rt ? [Rt, n] : [n], typeof e == "string" && (r = i, i = s, s = e, e = void 0); - const o = i || ni; +function F(s, t, e, n, i, r) { + Array.isArray(s) ? Ot && s.unshift(Ot) : s = Ot ? [Ot, s] : [s], typeof e == "string" && (r = i, i = n, n = e, e = void 0); + const o = i || bi; let a; - for (const l of n) { + for (const l of s) { if (!l) continue; const c = l[o] || l.default; if (!c) continue; - const u = r && l === Rt ? `${r}.${t}` : t; - if (a = Kr(c, u), a !== void 0) + const u = r && l === Ot ? `${r}.${t}` : t; + if (a = So(c, u), a !== void 0) break; } - return a === void 0 ? s : e ? W(a, ...Array.isArray(e) ? e : [e]) : a; + return a === void 0 ? n : e ? B(a, ...Array.isArray(e) ? e : [e]) : a; } -function Nl(n, t, e, s) { - return O(void 0, n, t, e, s); +function uc(s, t, e, n) { + return F(void 0, s, t, e, n); } -O.addLang = qr; -O.getLang = Nl; -O.getCode = kl; -O.setCode = Tl; -O.map = Rt; -qr({ +F.addLang = xo; +F.getLang = uc; +F.getCode = cc; +F.setCode = hc; +F.map = Ot; +xo({ zh_cn: { confirm: "确定", save: "保存", @@ -928,41 +928,41 @@ qr({ close: "Close" } }); -function er(n, t, e) { - n instanceof Headers ? n.set(t, e) : Array.isArray(n) ? n.push([t, e]) : n[t] = e; +function Cr(s, t, e) { + s instanceof Headers ? s.set(t, e) : Array.isArray(s) ? s.push([t, e]) : s[t] = e; } -function pe(n, t, e) { - e != null && (Array.isArray(e) ? e.forEach((s) => pe(n, t, s)) : !(e instanceof Blob) && f.isPlainObject(e) ? Object.entries(e).forEach(([s, i]) => { - pe(n, `${t}[${s}]`, i); - }) : n.append(t, e instanceof Blob ? e : String(e))); +function ve(s, t, e) { + e != null && (Array.isArray(e) ? e.forEach((n) => ve(s, t, n)) : !(e instanceof Blob) && f.isPlainObject(e) ? Object.entries(e).forEach(([n, i]) => { + ve(s, `${t}[${n}]`, i); + }) : s.append(t, e instanceof Blob ? e : String(e))); } -function El(n, t) { - if (n) { +function dc(s, t) { + if (s) { const e = { text: "text/plain", html: "text/html", json: "application/json", ...t }; - for (const [s, i] of Object.entries(e)) - if (i.split(",").map((r) => r.trim()).includes(n)) - return s; + for (const [n, i] of Object.entries(e)) + if (i.split(",").map((r) => r.trim()).includes(s)) + return n; } return "text"; } -function $l(n, t) { +function fc(s, t) { const e = t || new FormData(); - return n && (typeof n == "string" && (n = new URLSearchParams(n)), n instanceof URLSearchParams ? n.forEach((s, i) => { - pe(e, i, s); - }) : Array.isArray(n) ? n.forEach(([s, i]) => { - pe(e, s, i); - }) : n instanceof FormData ? n.forEach((s, i) => { - pe(e, i, s); - }) : f.isPlainObject(n) && Object.entries(n).forEach(([s, i]) => { - pe(e, s, i); + return s && (typeof s == "string" && (s = new URLSearchParams(s)), s instanceof URLSearchParams ? s.forEach((n, i) => { + ve(e, i, n); + }) : Array.isArray(s) ? s.forEach(([n, i]) => { + ve(e, n, i); + }) : s instanceof FormData ? s.forEach((n, i) => { + ve(e, i, n); + }) : f.isPlainObject(s) && Object.entries(s).forEach(([n, i]) => { + ve(e, n, i); })), e; } -class Gr { +class ko { get completed() { return this.data !== void 0 || this.error !== void 0; } @@ -991,7 +991,7 @@ class Gr { return this.complete(t); } then(t, e) { - return this.completed ? e && this.error ? e(this.error) : t(this.data) : (this.success((s) => t(s)), e && this.fail(e)), this; + return this.completed ? e && this.error ? e(this.error) : t(this.data) : (this.success((n) => t(n)), e && this.fail(e)), this; } catch(t) { return this.error ? (t(this.error), this) : this.on("error", (e) => t(e)); @@ -1012,7 +1012,7 @@ class Gr { const { url: t, type: e, - data: s, + data: n, processData: i = !0, contentType: r, crossDomain: o, @@ -1029,16 +1029,16 @@ class Gr { if ((h == null ? void 0 : h(_)) === !1) return; e && (_.method = e); - let v = s; - v && (i && (v = $l(v)), _.body = v), o && (_.mode = "cors"); + let v = n; + v && (i && (v = fc(v)), _.body = v), o && (_.mode = "cors"); const y = _.headers || {}; - er(y, "X-Requested-With", "XMLHttpRequest"), r && er(y, "Content-Type", r), _.headers = y, _.signal && _.signal.addEventListener("abort", () => { + Cr(y, "X-Requested-With", "XMLHttpRequest"), r && Cr(y, "Content-Type", r), _.headers = y, _.signal && _.signal.addEventListener("abort", () => { this.abort(); }), p && this.success(p), d && this.fail(d), m && this.complete(m), _.signal = this._controller.signal, this.url = t, this.request = _; } _emit(t, ...e) { - this._callbacks[t].forEach((s) => { - s.call(this, ...e); + this._callbacks[t].forEach((n) => { + n.call(this, ...e); }); } async send() { @@ -1046,7 +1046,7 @@ class Gr { if (this.completed) return []; this._init(); - const { timeout: t, dataType: e, accepts: s, dataFilter: i, throws: r, jsonParser: o } = this.setting; + const { timeout: t, dataType: e, accepts: n, dataFilter: i, throws: r, jsonParser: o } = this.setting; t && (this._timeoutID = window.setTimeout(() => { this.abort(new Error("timeout")); }, t)); @@ -1055,7 +1055,7 @@ class Gr { a = await fetch(this.url, this.request), this.response = a; const { statusText: h } = a; if (a.ok) { - const p = (u = a.headers.get("Content-Disposition")) == null ? void 0 : u.startsWith("attachment"), d = p ? "blob" : e || El(a.headers.get("Content-Type"), s); + const p = (u = a.headers.get("Content-Disposition")) == null ? void 0 : u.startsWith("attachment"), d = p ? "blob" : e || dc(a.headers.get("Content-Type"), n); p || d === "blob" || d === "file" ? c = await a.blob() : d === "json" ? typeof o == "function" ? (c = await a.text(), c = o(c)) : c = await a.json() : c = await a.text(), this.data = c; const m = (i == null ? void 0 : i(c, d)) ?? c; this._emit("success", m, h, a); @@ -1071,91 +1071,91 @@ class Gr { return [c, l, a]; } } -f.ajax = (n, t) => { - t = t || {}, typeof n == "string" ? t.url = n : f.extend(t, n); - const e = new Gr(t); +f.ajax = (s, t) => { + t = t || {}, typeof s == "string" ? t.url = s : f.extend(t, s); + const e = new ko(t); return e.send(), e; }; -f.getJSON = (n, t, e) => (typeof t == "function" && (e = t, t = void 0), f.ajax({ - url: n, +f.getJSON = (s, t, e) => (typeof t == "function" && (e = t, t = void 0), f.ajax({ + url: s, data: t, success: e, dataType: "json" })); -f.get = (n, t, e, s, i = "GET") => { +f.get = (s, t, e, n, i = "GET") => { let r, o; - return typeof t == "function" ? (r = t, o = void 0) : o = t, typeof e == "function" ? (r = e, s = void 0) : s = e, f.ajax({ + return typeof t == "function" ? (r = t, o = void 0) : o = t, typeof e == "function" ? (r = e, n = void 0) : n = e, f.ajax({ method: i, - url: n, + url: s, data: o, success: r, - dataType: s + dataType: n }); }; -f.post = (n, t, e, s) => f.get(n, t, e, s, "POST"); -f.fn.load = function(n, t, e) { +f.post = (s, t, e, n) => f.get(s, t, e, n, "POST"); +f.fn.load = function(s, t, e) { typeof t == "function" && (e = t, t = void 0); - const [s, i] = n.split(" "); - return f.get(s, t, (r, o, a) => { + const [n, i] = s.split(" "); + return f.get(n, t, (r, o, a) => { i && (r = f(r).find(i).html()), f(this).html(r).zuiInit(), e == null || e.call(this, r, o, a); }, "html"), this; }; -async function ii(n, t = [], e, s, i) { +async function Ci(s, t = [], e, n, i) { const r = { throws: !0, dataType: "json" }; - if (typeof n == "string") - r.url = W(n, ...t); - else if (typeof n == "object") - f.extend(r, n); - else if (typeof n == "function") { - const l = n.call(s, ...t); + if (typeof s == "string") + r.url = B(s, ...t); + else if (typeof s == "object") + f.extend(r, s); + else if (typeof s == "function") { + const l = s.call(n, ...t); return l instanceof Promise ? await l : l; } e && f.extend(r, typeof e == "function" ? e(r) : e); - const o = new Gr(r); + const o = new ko(r); i == null || i(o); const [a] = await o.send(); return a; } -function Cu(n) { - return !!(n && (typeof n == "string" || typeof n == "object" && n.url || typeof n == "function")); +function _d(s) { + return !!(s && (typeof s == "string" || typeof s == "object" && s.url || typeof s == "function")); } -f.fetch = ii; -function ct() { +f.fetch = Ci; +function pt() { return f.guid++; } -function Sn(n, t) { - if (n === t) +function On(s, t) { + if (s === t) return !1; - if (n && t) { - const e = typeof n, s = typeof t; - if (e !== s) + if (s && t) { + const e = typeof s, n = typeof t; + if (e !== n) return !0; - if (e === "object" && s === "object") { - const i = Array.isArray(n), r = Array.isArray(t); + if (e === "object" && n === "object") { + const i = Array.isArray(s), r = Array.isArray(t); if (i !== r) return !0; if (i && r) { - if (n.length !== t.length) + if (s.length !== t.length) return !0; - for (let l = 0; l < n.length; l++) - if (Sn(n[l], t[l])) + for (let l = 0; l < s.length; l++) + if (On(s[l], t[l])) return !0; return !1; } - const o = Object.keys(n), a = Object.keys(t); + const o = Object.keys(s), a = Object.keys(t); if (o.length !== a.length) return !0; for (const l of o) - if (Sn(n[l], t[l])) + if (On(s[l], t[l])) return !0; return !1; } - if (e === "function" && s === "function") - return n.toString() !== t.toString(); + if (e === "function" && n === "function") + return s.toString() !== t.toString(); } - return !0; + return s !== t; } -class He { +class Es { /** * Creates a new Computed instance. * @param compute The function that computes the value. @@ -1201,67 +1201,64 @@ class He { compute(t) { t !== void 0 && (this._dependencies = t), t = this._dependencies, typeof t == "function" && (t = t()); const e = this._lastDependencies; - return (!e || t.some((s, i) => s instanceof He ? s.value !== e[i] : Sn(s, e[i]))) && (this._value = this._compute(), this._lastDependencies = t.map((s) => s instanceof He ? s.cache : s)), this._value; + return (!e || t.some((n, i) => n instanceof Es ? n.value !== e[i] : On(n, e[i]))) && (this._value = this._compute(), this._lastDependencies = t.map((n) => n instanceof Es ? n.cache : n)), this._value; } } -function Su(n, t) { - return new He(n, t || []); -} -function Yr(...n) { - const t = [], e = /* @__PURE__ */ new Map(), s = (i, r) => { +function To(...s) { + const t = [], e = /* @__PURE__ */ new Map(), n = (i, r) => { if (Array.isArray(i) && (r = i[1], i = i[0]), !i.length) return; const o = e.get(i); typeof o == "number" ? t[o][1] = !!r : (e.set(i, t.length), t.push([i, !!r])); }; - return n.forEach((i) => { - typeof i == "function" && (i = i()), Array.isArray(i) ? Yr(...i).forEach(s) : i && typeof i == "object" ? Object.entries(i).forEach(s) : typeof i == "string" && i.split(" ").forEach((r) => s(r, !0)); + return s.forEach((i) => { + typeof i == "function" && (i = i()), Array.isArray(i) ? To(...i).forEach(n) : i && typeof i == "object" ? Object.entries(i).forEach(n) : typeof i == "string" && i.split(" ").forEach((r) => n(r, !0)); }), t.sort((i, r) => (e.get(i[0]) || 0) - (e.get(r[0]) || 0)); } -const k = (...n) => Yr(...n).reduce((t, [e, s]) => (s && t.push(e), t), []).join(" "); +const k = (...s) => To(...s).reduce((t, [e, n]) => (n && t.push(e), t), []).join(" "); f.classes = k; -f.fn.setClass = function(n, ...t) { - return this.each((e, s) => { - const i = f(s); - n === !0 ? i.attr("class", k(i.attr("class"), ...t)) : i.addClass(k(n, ...t)); +f.fn.setClass = function(s, ...t) { + return this.each((e, n) => { + const i = f(n); + s === !0 ? i.attr("class", k(i.attr("class"), ...t)) : i.addClass(k(s, ...t)); }); }; -const ge = /* @__PURE__ */ new WeakMap(); -function ri(n, t, e) { - const s = ge.has(n), i = s ? ge.get(n) : {}; +const we = /* @__PURE__ */ new WeakMap(); +function Si(s, t, e) { + const n = we.has(s), i = n ? we.get(s) : {}; typeof t == "string" ? i[t] = e : t === null ? Object.keys(i).forEach((r) => { delete i[r]; }) : Object.assign(i, t), Object.keys(i).forEach((r) => { i[r] === void 0 && delete i[r]; - }), Object.keys(i).length ? (!s && n instanceof Element && Object.assign(i, f(n).dataset(), i), ge.set(n, i)) : ge.delete(n); + }), Object.keys(i).length ? (!n && s instanceof Element && Object.assign(i, f(s).dataset(), i), we.set(s, i)) : we.delete(s); } -function oi(n, t, e) { - let s = ge.get(n) || {}; - return e && n instanceof Element && (s = Object.assign({}, f(n).dataset(), s)), t === void 0 ? s : s[t]; +function xi(s, t, e) { + let n = we.get(s) || {}; + return e && s instanceof Element && (n = Object.assign({}, f(s).dataset(), n)), t === void 0 ? n : n[t]; } -function xu(n) { - ge.delete(n); +function yd(s) { + we.delete(s); } f.fn.dataset = f.fn.data; -f.fn.data = function(...n) { - const [t, e] = n; - return !n.length || n.length === 1 && typeof t == "string" ? this.length ? oi(this[0], t, !0) : void 0 : this.each((s, i) => ri(i, t, e)); +f.fn.data = function(...s) { + const [t, e] = s; + return !s.length || s.length === 1 && typeof t == "string" ? this.length ? xi(this[0], t, !0) : void 0 : this.each((n, i) => Si(i, t, e)); }; -f.fn.removeData = function(n = null) { - return this.each((t, e) => ri(e, n)); +f.fn.removeData = function(s = null) { + return this.each((t, e) => Si(e, s)); }; -function ve(n, ...t) { - return n.includes("RAWJS") && (n = n.split('"RAWJS<').join("").split('>RAWJS"').join("").split("").join('"').split("").join(` -`)), new Function(`return ${n}`)(...t); +function xe(s, ...t) { + return s.includes("RAWJS") && (s = s.split('"RAWJS<').join("").split('>RAWJS"').join("").split("").join('"').split("").join(` +`)), new Function(`return ${s}`)(...t); } -function ku(n, ...t) { - return n.includes("RAWJS") ? ve(n, ...t) : JSON.parse(n); +function vd(s, ...t) { + return s.includes("RAWJS") ? xe(s, ...t) : JSON.parse(s); } -function We(n, t) { - const e = f(n)[0]; +function Ge(s, t) { + const e = f(s)[0]; if (!e) return; - const { prefix: s, getter: i, evalValue: r, json: o = !0, evalArgs: a = [] } = { + const { prefix: n, getter: i, evalValue: r, json: o = !0, evalArgs: a = [] } = { prefix: "z-", ...typeof t == "string" ? { prefix: t } : t }, l = Array.isArray(r) ? new Set(r) : void 0; @@ -1269,12 +1266,12 @@ function We(n, t) { let { name: h } = u; const { value: p } = u; let d = p; - if (h.startsWith(s)) { - if (h = h.slice(s.length).replace(/-([a-z])/g, (m) => m[1].toUpperCase()), i) + if (h.startsWith(n)) { + if (h = h.slice(n.length).replace(/-([a-z])/g, (m) => m[1].toUpperCase()), i) d = i(h, p); else try { - r && (!l || l.has(h)) || r === void 0 && p.includes("RAWJS") ? d = ve(p, ...a) : o && (d = JSON.parse(p)); + r && (!l || l.has(h)) || r === void 0 && p.includes("RAWJS") ? d = xe(p, ...a) : o && (d = JSON.parse(p)); } catch { } c[h] = d; @@ -1282,144 +1279,144 @@ function We(n, t) { return c; }, {}); } -function sr(n, t, e = "z-") { - const s = f(n); +function Sr(s, t, e = "z-") { + const n = f(s); Object.keys(t).forEach((i) => { let r = t[i]; - typeof r == "function" && (r = `RAWJS<${r}>RAWJS`), typeof r != "string" && (r = JSON.stringify(r)), i = i.replace(/[A-Z]/g, (o) => `-${o.toLowerCase()}`), s.attr(`${e}${i}`, r); + typeof r == "function" && (r = `RAWJS<${r}>RAWJS`), typeof r != "string" && (r = JSON.stringify(r)), i = i.replace(/[A-Z]/g, (o) => `-${o.toLowerCase()}`), n.attr(`${e}${i}`, r); }); } -function Al(...n) { +function pc(...s) { var e; - const t = n.length; + const t = s.length; if (!t) - return We(this); + return Ge(this); if (t === 1) { - const [s] = n; - return typeof s == "string" ? (e = We(this)) == null ? void 0 : e[s] : (f.isPlainObject(s) && sr(this, s), this); + const [n] = s; + return typeof n == "string" ? (e = Ge(this)) == null ? void 0 : e[n] : (f.isPlainObject(n) && Sr(this, n), this); } - return sr(this, { [n[0]]: n[1] }), this; + return Sr(this, { [s[0]]: s[1] }), this; } -f.fn.z = Al; +f.fn.z = pc; f.fn._attr = f.fn.attr; f.fn.extend({ - attr(...n) { - const [t, e] = n; - return !n.length || n.length === 1 && typeof t == "string" ? this._attr.apply(this, n) : typeof t == "object" ? (t && Object.keys(t).forEach((s) => { - const i = t[s]; - i === null ? this.removeAttr(s) : this._attr(s, i); + attr(...s) { + const [t, e] = s; + return !s.length || s.length === 1 && typeof t == "string" ? this._attr.apply(this, s) : typeof t == "object" ? (t && Object.keys(t).forEach((n) => { + const i = t[n]; + i === null ? this.removeAttr(n) : this._attr(n, i); }), this) : e === null ? this.removeAttr(t) : this._attr(t, e); } }); -f.Event || (f.Event = (n, t) => { - const [e, ...s] = n.split("."), i = new Event(e, { +f.Event || (f.Event = (s, t) => { + const [e, ...n] = s.split("."), i = new Event(e, { bubbles: !0, cancelable: !0 }); - return i.namespace = s.join("."), i.___ot = e, i.___td = t, i; + return i.namespace = n.join("."), i.___ot = e, i.___td = t, i; }); -const ws = (n, t) => new Promise((e) => { - const s = window.setTimeout(e, n); - t && t(s); -}), Ml = {}; -f.share = Ml; -var Bs, F, Jr, gt, te, nr, Zr, xn, ai, kn, Tn, je = {}, Xr = [], Pl = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Vs = Array.isArray; -function Bt(n, t) { +const As = (s, t) => new Promise((e) => { + const n = window.setTimeout(e, s); + t && t(n); +}), gc = {}; +f.share = gc; +var en, O, No, ft, re, xr, $o, Hn, ki, Fn, Wn, Ye = {}, Eo = [], mc = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, sn = Array.isArray; +function qt(s, t) { for (var e in t) - n[e] = t[e]; - return n; + s[e] = t[e]; + return s; } -function Qr(n) { - var t = n.parentNode; - t && t.removeChild(n); +function Ao(s) { + var t = s.parentNode; + t && t.removeChild(s); } -function mt(n, t, e) { - var s, i, r, o = {}; +function wt(s, t, e) { + var n, i, r, o = {}; for (r in t) - r == "key" ? s = t[r] : r == "ref" ? i = t[r] : o[r] = t[r]; - if (arguments.length > 2 && (o.children = arguments.length > 3 ? Bs.call(arguments, 2) : e), typeof n == "function" && n.defaultProps != null) - for (r in n.defaultProps) - o[r] === void 0 && (o[r] = n.defaultProps[r]); - return ds(n, o, s, i, null); + r == "key" ? n = t[r] : r == "ref" ? i = t[r] : o[r] = t[r]; + if (arguments.length > 2 && (o.children = arguments.length > 3 ? en.call(arguments, 2) : e), typeof s == "function" && s.defaultProps != null) + for (r in s.defaultProps) + o[r] === void 0 && (o[r] = s.defaultProps[r]); + return ws(s, o, n, i, null); } -function ds(n, t, e, s, i) { - var r = { type: n, props: t, key: e, ref: s, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: i ?? ++Jr, __i: -1, __u: 0 }; - return i == null && F.vnode != null && F.vnode(r), r; +function ws(s, t, e, n, i) { + var r = { type: s, props: t, key: e, ref: n, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: i ?? ++No, __i: -1, __u: 0 }; + return i == null && O.vnode != null && O.vnode(r), r; } -function q() { +function G() { return { current: null }; } -function Se(n) { - return n.children; +function $e(s) { + return s.children; } -function j(n, t) { - this.props = n, this.context = t; +function W(s, t) { + this.props = s, this.context = t; } -function ie(n, t) { +function ce(s, t) { if (t == null) - return n.__ ? ie(n.__, n.__i + 1) : null; - for (var e; t < n.__k.length; t++) - if ((e = n.__k[t]) != null && e.__e != null) + return s.__ ? ce(s.__, s.__i + 1) : null; + for (var e; t < s.__k.length; t++) + if ((e = s.__k[t]) != null && e.__e != null) return e.__e; - return typeof n.type == "function" ? ie(n) : null; + return typeof s.type == "function" ? ce(s) : null; } -function to(n) { +function Mo(s) { var t, e; - if ((n = n.__) != null && n.__c != null) { - for (n.__e = n.__c.base = null, t = 0; t < n.__k.length; t++) - if ((e = n.__k[t]) != null && e.__e != null) { - n.__e = n.__c.base = e.__e; + if ((s = s.__) != null && s.__c != null) { + for (s.__e = s.__c.base = null, t = 0; t < s.__k.length; t++) + if ((e = s.__k[t]) != null && e.__e != null) { + s.__e = s.__c.base = e.__e; break; } - return to(n); + return Mo(s); } } -function ir(n) { - (!n.__d && (n.__d = !0) && te.push(n) && !bs.__r++ || nr !== F.debounceRendering) && ((nr = F.debounceRendering) || Zr)(bs); +function kr(s) { + (!s.__d && (s.__d = !0) && re.push(s) && !Ms.__r++ || xr !== O.debounceRendering) && ((xr = O.debounceRendering) || $o)(Ms); } -function bs() { - var n, t, e, s, i, r, o, a; - for (te.sort(xn); n = te.shift(); ) - n.__d && (t = te.length, s = void 0, r = (i = (e = n).__v).__e, o = [], a = [], e.__P && ((s = Bt({}, i)).__v = i.__v + 1, F.vnode && F.vnode(s), li(e.__P, s, i, e.__n, e.__P.namespaceURI, 32 & i.__u ? [r] : null, o, r ?? ie(i), !!(32 & i.__u), a), s.__v = i.__v, s.__.__k[s.__i] = s, no(o, s, a), s.__e != r && to(s)), te.length > t && te.sort(xn)); - bs.__r = 0; +function Ms() { + var s, t, e, n, i, r, o, a; + for (re.sort(Hn); s = re.shift(); ) + s.__d && (t = re.length, n = void 0, r = (i = (e = s).__v).__e, o = [], a = [], e.__P && ((n = qt({}, i)).__v = i.__v + 1, O.vnode && O.vnode(n), Ti(e.__P, n, i, e.__n, e.__P.namespaceURI, 32 & i.__u ? [r] : null, o, r ?? ce(i), !!(32 & i.__u), a), n.__v = i.__v, n.__.__k[n.__i] = n, Ro(o, n, a), n.__e != r && Mo(n)), re.length > t && re.sort(Hn)); + Ms.__r = 0; } -function eo(n, t, e, s, i, r, o, a, l, c, u) { - var h, p, d, m, _, v = s && s.__k || Xr, y = t.length; - for (e.__d = l, Il(e, t, v), l = e.__d, h = 0; h < y; h++) - (d = e.__k[h]) != null && typeof d != "boolean" && typeof d != "function" && (p = d.__i === -1 ? je : v[d.__i] || je, d.__i = h, li(n, d, p, i, r, o, a, l, c, u), m = d.__e, d.ref && p.ref != d.ref && (p.ref && ci(p.ref, null, d), u.push(d.ref, d.__c || m, d)), _ == null && m != null && (_ = m), 65536 & d.__u || p.__k === d.__k ? (l && typeof d.type == "string" && !n.contains(l) && (l = ie(p)), l = so(d, l, n)) : typeof d.type == "function" && d.__d !== void 0 ? l = d.__d : m && (l = m.nextSibling), d.__d = void 0, d.__u &= -196609); +function Po(s, t, e, n, i, r, o, a, l, c, u) { + var h, p, d, m, _, v = n && n.__k || Eo, y = t.length; + for (e.__d = l, _c(e, t, v), l = e.__d, h = 0; h < y; h++) + (d = e.__k[h]) != null && typeof d != "boolean" && typeof d != "function" && (p = d.__i === -1 ? Ye : v[d.__i] || Ye, d.__i = h, Ti(s, d, p, i, r, o, a, l, c, u), m = d.__e, d.ref && p.ref != d.ref && (p.ref && Ni(p.ref, null, d), u.push(d.ref, d.__c || m, d)), _ == null && m != null && (_ = m), 65536 & d.__u || p.__k === d.__k ? l = Io(d, l, s) : typeof d.type == "function" && d.__d !== void 0 ? l = d.__d : m && (l = m.nextSibling), d.__d = void 0, d.__u &= -196609); e.__d = l, e.__e = _; } -function Il(n, t, e) { - var s, i, r, o, a, l = t.length, c = e.length, u = c, h = 0; - for (n.__k = [], s = 0; s < l; s++) - o = s + h, (i = n.__k[s] = (i = t[s]) == null || typeof i == "boolean" || typeof i == "function" ? null : typeof i == "string" || typeof i == "number" || typeof i == "bigint" || i.constructor == String ? ds(null, i, null, null, null) : Vs(i) ? ds(Se, { children: i }, null, null, null) : i.constructor === void 0 && i.__b > 0 ? ds(i.type, i.props, i.key, i.ref ? i.ref : null, i.__v) : i) != null ? (i.__ = n, i.__b = n.__b + 1, a = Rl(i, e, o, u), i.__i = a, r = null, a !== -1 && (u--, (r = e[a]) && (r.__u |= 131072)), r == null || r.__v === null ? (a == -1 && h--, typeof i.type != "function" && (i.__u |= 65536)) : a !== o && (a == o - 1 ? h = a - o : a == o + 1 ? h++ : a > o ? u > l - o ? h += a - o : h-- : a < o && h++, a !== s + h && (i.__u |= 65536))) : (r = e[o]) && r.key == null && r.__e && !(131072 & r.__u) && (r.__e == n.__d && (n.__d = ie(r)), Nn(r, r, !1), e[o] = null, u--); +function _c(s, t, e) { + var n, i, r, o, a, l = t.length, c = e.length, u = c, h = 0; + for (s.__k = [], n = 0; n < l; n++) + o = n + h, (i = s.__k[n] = (i = t[n]) == null || typeof i == "boolean" || typeof i == "function" ? null : typeof i == "string" || typeof i == "number" || typeof i == "bigint" || i.constructor == String ? ws(null, i, null, null, null) : sn(i) ? ws($e, { children: i }, null, null, null) : i.constructor === void 0 && i.__b > 0 ? ws(i.type, i.props, i.key, i.ref ? i.ref : null, i.__v) : i) != null ? (i.__ = s, i.__b = s.__b + 1, a = yc(i, e, o, u), i.__i = a, r = null, a !== -1 && (u--, (r = e[a]) && (r.__u |= 131072)), r == null || r.__v === null ? (a == -1 && h--, typeof i.type != "function" && (i.__u |= 65536)) : a !== o && (a == o - 1 ? h-- : a == o + 1 ? h++ : a > o ? u > l - o ? h += a - o : h-- : a < o && (a == o - h ? h -= a - o : h++), a !== n + h && (i.__u |= 65536))) : (r = e[o]) && r.key == null && r.__e && !(131072 & r.__u) && (r.__e == s.__d && (s.__d = ce(r)), jn(r, r, !1), e[o] = null, u--); if (u) - for (s = 0; s < c; s++) - (r = e[s]) != null && !(131072 & r.__u) && (r.__e == n.__d && (n.__d = ie(r)), Nn(r, r)); -} -function so(n, t, e) { - var s, i; - if (typeof n.type == "function") { - for (s = n.__k, i = 0; s && i < s.length; i++) - s[i] && (s[i].__ = n, t = so(s[i], t, e)); + for (n = 0; n < c; n++) + (r = e[n]) != null && !(131072 & r.__u) && (r.__e == s.__d && (s.__d = ce(r)), jn(r, r)); +} +function Io(s, t, e) { + var n, i; + if (typeof s.type == "function") { + for (n = s.__k, i = 0; n && i < n.length; i++) + n[i] && (n[i].__ = s, t = Io(n[i], t, e)); return t; } - n.__e != t && (e.insertBefore(n.__e, t || null), t = n.__e); + s.__e != t && (t && s.type && !e.contains(t) && (t = ce(s)), e.insertBefore(s.__e, t || null), t = s.__e); do t = t && t.nextSibling; while (t != null && t.nodeType === 8); return t; } -function Cs(n, t) { - return t = t || [], n == null || typeof n == "boolean" || (Vs(n) ? n.some(function(e) { - Cs(e, t); - }) : t.push(n)), t; +function Ps(s, t) { + return t = t || [], s == null || typeof s == "boolean" || (sn(s) ? s.some(function(e) { + Ps(e, t); + }) : t.push(s)), t; } -function Rl(n, t, e, s) { - var i = n.key, r = n.type, o = e - 1, a = e + 1, l = t[e]; +function yc(s, t, e, n) { + var i = s.key, r = s.type, o = e - 1, a = e + 1, l = t[e]; if (l === null || l && i == l.key && r === l.type && !(131072 & l.__u)) return e; - if (s > (l != null && !(131072 & l.__u) ? 1 : 0)) + if (n > (l != null && !(131072 & l.__u) ? 1 : 0)) for (; o >= 0 || a < t.length; ) { if (o >= 0) { if ((l = t[o]) && !(131072 & l.__u) && i == l.key && r === l.type) @@ -1434,58 +1431,58 @@ function Rl(n, t, e, s) { } return -1; } -function rr(n, t, e) { - t[0] === "-" ? n.setProperty(t, e ?? "") : n[t] = e == null ? "" : typeof e != "number" || Pl.test(t) ? e : e + "px"; +function Tr(s, t, e) { + t[0] === "-" ? s.setProperty(t, e ?? "") : s[t] = e == null ? "" : typeof e != "number" || mc.test(t) ? e : e + "px"; } -function as(n, t, e, s, i) { +function gs(s, t, e, n, i) { var r; t: if (t === "style") if (typeof e == "string") - n.style.cssText = e; + s.style.cssText = e; else { - if (typeof s == "string" && (n.style.cssText = s = ""), s) - for (t in s) - e && t in e || rr(n.style, t, ""); + if (typeof n == "string" && (s.style.cssText = n = ""), n) + for (t in n) + e && t in e || Tr(s.style, t, ""); if (e) for (t in e) - s && e[t] === s[t] || rr(n.style, t, e[t]); + n && e[t] === n[t] || Tr(s.style, t, e[t]); } else if (t[0] === "o" && t[1] === "n") - r = t !== (t = t.replace(/(PointerCapture)$|Capture$/i, "$1")), t = t.toLowerCase() in n || t === "onFocusOut" || t === "onFocusIn" ? t.toLowerCase().slice(2) : t.slice(2), n.l || (n.l = {}), n.l[t + r] = e, e ? s ? e.u = s.u : (e.u = ai, n.addEventListener(t, r ? Tn : kn, r)) : n.removeEventListener(t, r ? Tn : kn, r); + r = t !== (t = t.replace(/(PointerCapture)$|Capture$/i, "$1")), t = t.toLowerCase() in s || t === "onFocusOut" || t === "onFocusIn" ? t.toLowerCase().slice(2) : t.slice(2), s.l || (s.l = {}), s.l[t + r] = e, e ? n ? e.u = n.u : (e.u = ki, s.addEventListener(t, r ? Wn : Fn, r)) : s.removeEventListener(t, r ? Wn : Fn, r); else { if (i == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s"); - else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in n) + else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in s) try { - n[t] = e ?? ""; + s[t] = e ?? ""; break t; } catch { } - typeof e == "function" || (e == null || e === !1 && t[4] !== "-" ? n.removeAttribute(t) : n.setAttribute(t, t == "popover" && e == 1 ? "" : e)); + typeof e == "function" || (e == null || e === !1 && t[4] !== "-" ? s.removeAttribute(t) : s.setAttribute(t, t == "popover" && e == 1 ? "" : e)); } } -function or(n) { +function Nr(s) { return function(t) { if (this.l) { - var e = this.l[t.type + n]; + var e = this.l[t.type + s]; if (t.t == null) - t.t = ai++; + t.t = ki++; else if (t.t < e.u) return; - return e(F.event ? F.event(t) : t); + return e(O.event ? O.event(t) : t); } }; } -function li(n, t, e, s, i, r, o, a, l, c) { - var u, h, p, d, m, _, v, y, w, C, b, S, N, A, E, $, T = t.type; +function Ti(s, t, e, n, i, r, o, a, l, c) { + var u, h, p, d, m, _, v, y, w, C, b, S, N, A, $, E, T = t.type; if (t.constructor !== void 0) return null; - 128 & e.__u && (l = !!(32 & e.__u), r = [a = t.__e = e.__e]), (u = F.__b) && u(t); + 128 & e.__u && (l = !!(32 & e.__u), r = [a = t.__e = e.__e]), (u = O.__b) && u(t); t: if (typeof T == "function") try { - if (y = t.props, w = "prototype" in T && T.prototype.render, C = (u = T.contextType) && s[u.__c], b = u ? C ? C.props.value : u.__ : s, e.__c ? v = (h = t.__c = e.__c).__ = h.__E : (w ? t.__c = h = new T(y, b) : (t.__c = h = new j(y, b), h.constructor = T, h.render = Ll), C && C.sub(h), h.props = y, h.state || (h.state = {}), h.context = b, h.__n = s, p = h.__d = !0, h.__h = [], h._sb = []), w && h.__s == null && (h.__s = h.state), w && T.getDerivedStateFromProps != null && (h.__s == h.state && (h.__s = Bt({}, h.__s)), Bt(h.__s, T.getDerivedStateFromProps(y, h.__s))), d = h.props, m = h.state, h.__v = t, p) + if (y = t.props, w = "prototype" in T && T.prototype.render, C = (u = T.contextType) && n[u.__c], b = u ? C ? C.props.value : u.__ : n, e.__c ? v = (h = t.__c = e.__c).__ = h.__E : (w ? t.__c = h = new T(y, b) : (t.__c = h = new W(y, b), h.constructor = T, h.render = wc), C && C.sub(h), h.props = y, h.state || (h.state = {}), h.context = b, h.__n = n, p = h.__d = !0, h.__h = [], h._sb = []), w && h.__s == null && (h.__s = h.state), w && T.getDerivedStateFromProps != null && (h.__s == h.state && (h.__s = qt({}, h.__s)), qt(h.__s, T.getDerivedStateFromProps(y, h.__s))), d = h.props, m = h.state, h.__v = t, p) w && T.getDerivedStateFromProps == null && h.componentWillMount != null && h.componentWillMount(), w && h.componentDidMount != null && h.__h.push(h.componentDidMount); else { if (w && T.getDerivedStateFromProps == null && y !== d && h.componentWillReceiveProps != null && h.componentWillReceiveProps(y, b), !h.__e && (h.shouldComponentUpdate != null && h.shouldComponentUpdate(y, h.__s, b) === !1 || t.__v === e.__v)) { @@ -1500,56 +1497,62 @@ function li(n, t, e, s, i, r, o, a, l, c) { h.componentDidUpdate(d, m, _); }); } - if (h.context = b, h.props = y, h.__P = n, h.__e = !1, N = F.__r, A = 0, w) { - for (h.state = h.__s, h.__d = !1, N && N(t), u = h.render(h.props, h.state, h.context), E = 0; E < h._sb.length; E++) - h.__h.push(h._sb[E]); + if (h.context = b, h.props = y, h.__P = s, h.__e = !1, N = O.__r, A = 0, w) { + for (h.state = h.__s, h.__d = !1, N && N(t), u = h.render(h.props, h.state, h.context), $ = 0; $ < h._sb.length; $++) + h.__h.push(h._sb[$]); h._sb = []; } else do h.__d = !1, N && N(t), u = h.render(h.props, h.state, h.context), h.state = h.__s; while (h.__d && ++A < 25); - h.state = h.__s, h.getChildContext != null && (s = Bt(Bt({}, s), h.getChildContext())), w && !p && h.getSnapshotBeforeUpdate != null && (_ = h.getSnapshotBeforeUpdate(d, m)), eo(n, Vs($ = u != null && u.type === Se && u.key == null ? u.props.children : u) ? $ : [$], t, e, s, i, r, o, a, l, c), h.base = t.__e, t.__u &= -161, h.__h.length && o.push(h), v && (h.__E = h.__ = null); + h.state = h.__s, h.getChildContext != null && (n = qt(qt({}, n), h.getChildContext())), w && !p && h.getSnapshotBeforeUpdate != null && (_ = h.getSnapshotBeforeUpdate(d, m)), Po(s, sn(E = u != null && u.type === $e && u.key == null ? u.props.children : u) ? E : [E], t, e, n, i, r, o, a, l, c), h.base = t.__e, t.__u &= -161, h.__h.length && o.push(h), v && (h.__E = h.__ = null); } catch (M) { - t.__v = null, l || r != null ? (t.__e = a, t.__u |= l ? 160 : 32, r[r.indexOf(a)] = null) : (t.__e = e.__e, t.__k = e.__k), F.__e(M, t, e); + if (t.__v = null, l || r != null) { + for (t.__u |= l ? 160 : 32; a && a.nodeType === 8 && a.nextSibling; ) + a = a.nextSibling; + r[r.indexOf(a)] = null, t.__e = a; + } else + t.__e = e.__e, t.__k = e.__k; + O.__e(M, t, e); } else - r == null && t.__v === e.__v ? (t.__k = e.__k, t.__e = e.__e) : t.__e = Dl(e.__e, t, e, s, i, r, o, l, c); - (u = F.diffed) && u(t); + r == null && t.__v === e.__v ? (t.__k = e.__k, t.__e = e.__e) : t.__e = vc(e.__e, t, e, n, i, r, o, l, c); + (u = O.diffed) && u(t); } -function no(n, t, e) { +function Ro(s, t, e) { t.__d = void 0; - for (var s = 0; s < e.length; s++) - ci(e[s], e[++s], e[++s]); - F.__c && F.__c(t, n), n.some(function(i) { + for (var n = 0; n < e.length; n++) + Ni(e[n], e[++n], e[++n]); + O.__c && O.__c(t, s), s.some(function(i) { try { - n = i.__h, i.__h = [], n.some(function(r) { + s = i.__h, i.__h = [], s.some(function(r) { r.call(i); }); } catch (r) { - F.__e(r, i.__v); + O.__e(r, i.__v); } }); } -function Dl(n, t, e, s, i, r, o, a, l) { +function vc(s, t, e, n, i, r, o, a, l) { var c, u, h, p, d, m, _, v = e.props, y = t.props, w = t.type; if (w === "svg" ? i = "http://www.w3.org/2000/svg" : w === "math" ? i = "http://www.w3.org/1998/Math/MathML" : i || (i = "http://www.w3.org/1999/xhtml"), r != null) { for (c = 0; c < r.length; c++) if ((d = r[c]) && "setAttribute" in d == !!w && (w ? d.localName === w : d.nodeType === 3)) { - n = d, r[c] = null; + s = d, r[c] = null; break; } } - if (n == null) { + if (s == null) { if (w === null) return document.createTextNode(y); - n = document.createElementNS(i, w, y.is && y), r = null, a = !1; + s = document.createElementNS(i, w, y.is && y), r = null, a = !1; } if (w === null) - v === y || a && n.data === y || (n.data = y); + v === y || a && s.data === y || (s.data = y); else { - if (r = r && Bs.call(n.childNodes), v = e.props || je, !a && r != null) - for (v = {}, c = 0; c < n.attributes.length; c++) - v[(d = n.attributes[c]).name] = d.value; + if (r = r && en.call(s.childNodes), v = e.props || Ye, !a && r != null) + for (v = {}, c = 0; c < s.attributes.length; c++) + v[(d = s.attributes[c]).name] = d.value; for (c in v) if (d = v[c], c != "children") { if (c == "dangerouslySetInnerHTML") @@ -1557,86 +1560,90 @@ function Dl(n, t, e, s, i, r, o, a, l) { else if (c !== "key" && !(c in y)) { if (c == "value" && "defaultValue" in y || c == "checked" && "defaultChecked" in y) continue; - as(n, c, null, d, i); + gs(s, c, null, d, i); } } for (c in y) - d = y[c], c == "children" ? p = d : c == "dangerouslySetInnerHTML" ? u = d : c == "value" ? m = d : c == "checked" ? _ = d : c === "key" || a && typeof d != "function" || v[c] === d || as(n, c, d, v[c], i); + d = y[c], c == "children" ? p = d : c == "dangerouslySetInnerHTML" ? u = d : c == "value" ? m = d : c == "checked" ? _ = d : c === "key" || a && typeof d != "function" || v[c] === d || gs(s, c, d, v[c], i); if (u) - a || h && (u.__html === h.__html || u.__html === n.innerHTML) || (n.innerHTML = u.__html), t.__k = []; - else if (h && (n.innerHTML = ""), eo(n, Vs(p) ? p : [p], t, e, s, w === "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, r, o, r ? r[0] : e.__k && ie(e, 0), a, l), r != null) + a || h && (u.__html === h.__html || u.__html === s.innerHTML) || (s.innerHTML = u.__html), t.__k = []; + else if (h && (s.innerHTML = ""), Po(s, sn(p) ? p : [p], t, e, n, w === "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, r, o, r ? r[0] : e.__k && ce(e, 0), a, l), r != null) for (c = r.length; c--; ) - r[c] != null && Qr(r[c]); - a || (c = "value", m !== void 0 && (m !== n[c] || w === "progress" && !m || w === "option" && m !== v[c]) && as(n, c, m, v[c], i), c = "checked", _ !== void 0 && _ !== n[c] && as(n, c, _, v[c], i)); + r[c] != null && Ao(r[c]); + a || (c = "value", m !== void 0 && (m !== s[c] || w === "progress" && !m || w === "option" && m !== v[c]) && gs(s, c, m, v[c], i), c = "checked", _ !== void 0 && _ !== s[c] && gs(s, c, _, v[c], i)); } - return n; + return s; } -function ci(n, t, e) { +function Ni(s, t, e) { try { - typeof n == "function" ? n(t) : n.current = t; - } catch (s) { - F.__e(s, e); + if (typeof s == "function") { + var n = typeof s.__u == "function"; + n && s.__u(), n && t == null || (s.__u = s(t)); + } else + s.current = t; + } catch (i) { + O.__e(i, e); } } -function Nn(n, t, e) { - var s, i; - if (F.unmount && F.unmount(n), (s = n.ref) && (s.current && s.current !== n.__e || ci(s, null, t)), (s = n.__c) != null) { - if (s.componentWillUnmount) +function jn(s, t, e) { + var n, i; + if (O.unmount && O.unmount(s), (n = s.ref) && (n.current && n.current !== s.__e || Ni(n, null, t)), (n = s.__c) != null) { + if (n.componentWillUnmount) try { - s.componentWillUnmount(); + n.componentWillUnmount(); } catch (r) { - F.__e(r, t); + O.__e(r, t); } - s.base = s.__P = null; + n.base = n.__P = null; } - if (s = n.__k) - for (i = 0; i < s.length; i++) - s[i] && Nn(s[i], t, e || typeof n.type != "function"); - e || n.__e == null || Qr(n.__e), n.__c = n.__ = n.__e = n.__d = void 0; + if (n = s.__k) + for (i = 0; i < n.length; i++) + n[i] && jn(n[i], t, e || typeof s.type != "function"); + e || s.__e == null || Ao(s.__e), s.__c = s.__ = s.__e = s.__d = void 0; } -function Ll(n, t, e) { - return this.constructor(n, e); +function wc(s, t, e) { + return this.constructor(s, e); } -function me(n, t, e) { - var s, i, r, o; - F.__ && F.__(n, t), i = (s = typeof e == "function") ? null : e && e.__k || t.__k, r = [], o = [], li(t, n = (!s && e || t).__k = mt(Se, null, [n]), i || je, je, t.namespaceURI, !s && e ? [e] : i ? null : t.firstChild ? Bs.call(t.childNodes) : null, r, !s && e ? e : i ? i.__e : t.firstChild, s, o), no(r, n, o); +function be(s, t, e) { + var n, i, r, o; + O.__ && O.__(s, t), i = (n = typeof e == "function") ? null : e && e.__k || t.__k, r = [], o = [], Ti(t, s = (!n && e || t).__k = wt($e, null, [s]), i || Ye, Ye, t.namespaceURI, !n && e ? [e] : i ? null : t.firstChild ? en.call(t.childNodes) : null, r, !n && e ? e : i ? i.__e : t.firstChild, n, o), Ro(r, s, o); } -Bs = Xr.slice, F = { __e: function(n, t, e, s) { +en = Eo.slice, O = { __e: function(s, t, e, n) { for (var i, r, o; t = t.__; ) if ((i = t.__c) && !i.__) try { - if ((r = i.constructor) && r.getDerivedStateFromError != null && (i.setState(r.getDerivedStateFromError(n)), o = i.__d), i.componentDidCatch != null && (i.componentDidCatch(n, s || {}), o = i.__d), o) + if ((r = i.constructor) && r.getDerivedStateFromError != null && (i.setState(r.getDerivedStateFromError(s)), o = i.__d), i.componentDidCatch != null && (i.componentDidCatch(s, n || {}), o = i.__d), o) return i.__E = i; } catch (a) { - n = a; + s = a; } - throw n; -} }, Jr = 0, gt = function(n) { - return n != null && n.constructor == null; -}, j.prototype.setState = function(n, t) { + throw s; +} }, No = 0, ft = function(s) { + return s != null && s.constructor == null; +}, W.prototype.setState = function(s, t) { var e; - e = this.__s != null && this.__s !== this.state ? this.__s : this.__s = Bt({}, this.state), typeof n == "function" && (n = n(Bt({}, e), this.props)), n && Bt(e, n), n != null && this.__v && (t && this._sb.push(t), ir(this)); -}, j.prototype.forceUpdate = function(n) { - this.__v && (this.__e = !0, n && this.__h.push(n), ir(this)); -}, j.prototype.render = Se, te = [], Zr = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, xn = function(n, t) { - return n.__v.__b - t.__v.__b; -}, bs.__r = 0, ai = 0, kn = or(!1), Tn = or(!0); -function L(n, ...t) { + e = this.__s != null && this.__s !== this.state ? this.__s : this.__s = qt({}, this.state), typeof s == "function" && (s = s(qt({}, e), this.props)), s && qt(e, s), s != null && this.__v && (t && this._sb.push(t), kr(this)); +}, W.prototype.forceUpdate = function(s) { + this.__v && (this.__e = !0, s && this.__h.push(s), kr(this)); +}, W.prototype.render = $e, re = [], $o = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Hn = function(s, t) { + return s.__v.__b - t.__v.__b; +}, Ms.__r = 0, ki = 0, Fn = Nr(!1), Wn = Nr(!0); +function z(s, ...t) { return t.forEach((e) => { - !e || typeof e != "object" || Object.keys(e).forEach((s) => { - let i = e[s]; - const r = n[s]; - i !== r && (r !== void 0 && (s === "className" || s.endsWith("Class") ? i = [r, i] : s === "children" ? i = [...Cs(r), ...Cs(i)] : typeof r == "object" && (s === "style" || s.endsWith("Style") || s === "attrs" || s.endsWith("Attrs") || s === "props") && (i = f.extend(r, i))), n[s] = i); + !e || typeof e != "object" || Object.keys(e).forEach((n) => { + let i = e[n]; + const r = s[n]; + i !== r && (r !== void 0 && (n === "className" || n.endsWith("Class") ? i = [r, i] : n === "children" ? i = [...Ps(r), ...Ps(i)] : typeof r == "object" && (n === "style" || n.endsWith("Style") || n === "attrs" || n.endsWith("Attrs") || n === "props") && (i = f.extend(r, i))), s[n] = i); }); - }), n; + }), s; } -function io(n) { - return Object.keys(n).forEach((t) => { - n[t] === void 0 && delete n[t]; - }), n; +function Do(s) { + return Object.keys(s).forEach((t) => { + s[t] === void 0 && delete s[t]; + }), s; } -function zl(n, t = !0) { - const e = f(n), s = e[0], i = "zui-disable-scroll"; +function bc(s, t = !0) { + const e = f(s), n = e[0], i = "zui-disable-scroll"; if (t) { if (e.data(i)) return; @@ -1644,7 +1651,7 @@ function zl(n, t = !0) { e.data(i, { overflow: e.css("overflow") }).css("overflow", "hidden"); return; } - const r = s === document.body || e.is("html") ? window.innerWidth - document.body.clientWidth : s.offsetWidth - s.clientWidth; + const r = n === document.body || e.is("html") ? window.innerWidth - document.body.clientWidth : n.offsetWidth - n.clientWidth; if (!r) return; const o = e.css("paddingRight") || "0"; @@ -1662,19 +1669,19 @@ function zl(n, t = !0) { e.css(r).removeData(i); } } -f.fn.disableScroll = function(n = !0) { +f.fn.disableScroll = function(s = !0) { return this.each((t, e) => { - zl(e, n); + bc(e, s); }); }; -f.fn.enableScroll = function(n = !0) { - return this.disableScroll(!n); +f.fn.enableScroll = function(s = !0) { + return this.disableScroll(!s); }; -function dn(n, t, e) { +function kn(s, t, e) { if (!(e.on || "click").split(" ").includes(t.type)) return; - const s = e.selector ? f(t.target).closest(e.selector) : n; - if (!s.length) + const n = e.selector ? f(t.target).closest(e.selector) : s; + if (!n.length) return; const i = (c) => c === "" ? !0 : c, r = (c) => { if (typeof c == "string") @@ -1687,70 +1694,70 @@ function dn(n, t, e) { if (i(e.once)) { if (e.onceCalled) return; - n.dataset("once-called", !0); + s.dataset("once-called", !0); } if (i(e.prevent) && t.preventDefault(), i(e.stop) && t.stopPropagation(), i(e.self) && t.currentTarget !== t.target) return; - const o = [["$element", n], ["event", t], ["options", e], ["$target", s]], a = (c) => typeof c == "function" ? c(...o) : f.runJS(c, ...o); + const o = [["$element", s], ["event", t], ["options", e], ["$target", n]], a = (c) => typeof c == "function" ? c(...o) : f.runJS(c, ...o); if (e.if !== void 0 && !a(e.if)) return; const l = e.call; if (l) { let c; - if (typeof l == "string" ? c = /^[$A-Z_][0-9A-Z_$.]*$/i.test(l) ? Kr(window, l) : a(l) : c = l, typeof c == "function") { + if (typeof l == "string" ? c = /^[$A-Z_][0-9A-Z_$.]*$/i.test(l) ? So(window, l) : a(l) : c = l, typeof c == "function") { const u = [], h = e.params; - e.params = u, typeof h == "string" && h.length ? h[0] === "[" ? u.push(...r(h)) : u.push(...h.split(", ").map((p) => (p = p.trim(), p === "$element" ? n : p === "event" ? t : p === "options" ? e : p.startsWith("$element.") || p.startsWith("event.") || p.startsWith("options.") ? a(p) : r(p)))) : Array.isArray(h) ? u.push(...h) : u.push(h), c(...u); + e.params = u, typeof h == "string" && h.length ? h[0] === "[" ? u.push(...r(h)) : u.push(...h.split(", ").map((p) => (p = p.trim(), p === "$element" ? s : p === "event" ? t : p === "options" ? e : p.startsWith("$element.") || p.startsWith("event.") || p.startsWith("options.") ? a(p) : r(p)))) : Array.isArray(h) ? u.push(...h) : u.push(h), c(...u); } } e.do && a(e.do); } -function Ol(n) { - const t = f(this), e = n.type, s = t.attr("zui-on"); - if (s) { - const [o, a] = s.split("~").map((l) => l.trim()); - o && o.split(" ").includes(e) && dn(t, n, f.extend({ +function Cc(s) { + const t = f(this), e = s.type, n = t.attr("zui-on"); + if (n) { + const [o, a] = n.split("~").map((l) => l.trim()); + o && o.split(" ").includes(e) && kn(t, s, f.extend({ on: o - }, a ? a.startsWith("{") ? ve(a) : { do: a } : We(t, { prefix: "data-", evalValue: ["call", "if", "do"] }))); + }, a ? a.startsWith("{") ? xe(a) : { do: a } : Ge(t, { prefix: "data-", evalValue: ["call", "if", "do"] }))); } const i = t.attr(`zui-on-${e}`); - i && dn(t, n, f.extend({ + i && kn(t, s, f.extend({ on: e - }, i.startsWith("{") ? ve(i) : { do: i })); + }, i.startsWith("{") ? xe(i) : { do: i })); const r = t.attr("data-on"); - r && r.split(" ").includes(e) && dn(t, n, We(t, { prefix: "data-", evalValue: ["call", "if", "do"] })); -} -function Fl(n) { - f(document).off(".zui.global").on(n.map((t) => `${t}.zui.global`).join(" "), `[zui-on],${n.map((t) => `[zui-on-${t}]`)},[data-on]`, Ol); -} -Fl(["click", "change", "inited"]); -function hi(n, t) { - if (typeof n == "function") - return hi(n(...t || [])); - if (typeof n == "number") - return [n]; - let e = n.match(/(\d+)(%|px)?/); - return e ? [parseInt(e[1]), e[2]] : (e = n.match(/(\d+)\/(\d+)/), e ? [100 * parseInt(e[1]) / parseInt(e[2]), "%"] : [NaN]); -} -function Vt(n, t) { - if (n == null) + r && r.split(" ").includes(e) && kn(t, s, Ge(t, { prefix: "data-", evalValue: ["call", "if", "do"] })); +} +function Sc(s) { + f(document).off(".zui.global").on(s.map((t) => `${t}.zui.global`).join(" "), `[zui-on],${s.map((t) => `[zui-on-${t}]`)},[data-on]`, Cc); +} +Sc(["click", "change", "inited"]); +function $i(s, t) { + if (typeof s == "function") + return $i(s(...t || [])); + if (typeof s == "number") + return [s]; + let e = s.match(/(\d+)(%|px)?/); + return e ? [parseInt(e[1]), e[2]] : (e = s.match(/(\d+)\/(\d+)/), e ? [100 * parseInt(e[1]) / parseInt(e[2]), "%"] : [NaN]); +} +function Gt(s, t) { + if (s == null) return null; - const [e, s = "px"] = hi(n, t); - return Number.isNaN(e) ? typeof n == "string" ? n : null : `${e}${s}`; + const [e, n = "px"] = $i(s, t); + return Number.isNaN(e) ? typeof s == "string" ? s : null : `${e}${n}`; } -async function ar(n, t) { - var s, i, r; - if (n instanceof Blob) { +async function $r(s, t) { + var n, i, r; + if (s instanceof Blob) { const o = document.createElement("a"); - return o.href = window.URL.createObjectURL(n), t && (o.download = decodeURIComponent(t)), o.click(), o.remove(), n; + return o.href = window.URL.createObjectURL(s), t && (o.download = decodeURIComponent(t)), o.click(), o.remove(), s; } - if (n instanceof Response) { - const o = await n.blob(); - return t = t || ((r = (i = (s = n.headers.get("Content-Disposition")) == null ? void 0 : s.split(";")[1]) == null ? void 0 : i.split("=")[1]) == null ? void 0 : r.replace(/"/g, "")), ar(o, t); + if (s instanceof Response) { + const o = await s.blob(); + return t = t || ((r = (i = (n = s.headers.get("Content-Disposition")) == null ? void 0 : n.split(";")[1]) == null ? void 0 : i.split("=")[1]) == null ? void 0 : r.replace(/"/g, "")), $r(o, t); } - const e = await fetch(n); - return ar(e); + const e = await fetch(s); + return $r(e); } -class Hl { +class xc { constructor(t) { this._$target = f(t); } @@ -1767,72 +1774,72 @@ class Hl { return this._$target.trigger(...t), this; } } -const zt = new Hl(document); -f.bus = zt; -f.on = zt.on.bind(zt); -f.one = zt.one.bind(zt); -f.off = zt.off.bind(zt); -f.trigger = zt.trigger.bind(zt); -var Wl = ["Shift", "Meta", "Alt", "Control"], ro = typeof navigator == "object" ? navigator.platform : "", oo = /Mac|iPod|iPhone|iPad/.test(ro), jl = oo ? "Meta" : "Control", Bl = ro === "Win32" ? ["Control", "Alt"] : oo ? ["Alt"] : []; -function fn(n, t) { - return typeof n.getModifierState == "function" && (n.getModifierState(t) || Bl.includes(t) && n.getModifierState("AltGraph")); +const Wt = new xc(document); +f.bus = Wt; +f.on = Wt.on.bind(Wt); +f.one = Wt.one.bind(Wt); +f.off = Wt.off.bind(Wt); +f.trigger = Wt.trigger.bind(Wt); +var kc = ["Shift", "Meta", "Alt", "Control"], Lo = typeof navigator == "object" ? navigator.platform : "", zo = /Mac|iPod|iPhone|iPad/.test(Lo), Tc = zo ? "Meta" : "Control", Nc = Lo === "Win32" ? ["Control", "Alt"] : zo ? ["Alt"] : []; +function Tn(s, t) { + return typeof s.getModifierState == "function" && (s.getModifierState(t) || Nc.includes(t) && s.getModifierState("AltGraph")); } -function Vl(n) { - return n.trim().split(" ").map(function(t) { - var e = t.split(/\b\+/), s = e.pop(); +function $c(s) { + return s.trim().split(" ").map(function(t) { + var e = t.split(/\b\+/), n = e.pop(); return [e = e.map(function(i) { - return i === "$mod" ? jl : i; - }), s]; + return i === "$mod" ? Tc : i; + }), n]; }); } -function ao(n, t) { +function Oo(s, t) { var e; t === void 0 && (t = {}); - var s = (e = t.timeout) != null ? e : 1e3, i = Object.keys(n).map(function(a) { - return [Vl(a), n[a]]; + var n = (e = t.timeout) != null ? e : 1e3, i = Object.keys(s).map(function(a) { + return [$c(a), s[a]]; }), r = /* @__PURE__ */ new Map(), o = null; return function(a) { a instanceof KeyboardEvent && (i.forEach(function(l) { var c = l[0], u = l[1], h = r.get(c) || c; (function(p, d) { return !(d[1].toUpperCase() !== p.key.toUpperCase() && d[1] !== p.code || d[0].find(function(m) { - return !fn(p, m); - }) || Wl.find(function(m) { - return !d[0].includes(m) && d[1] !== m && fn(p, m); + return !Tn(p, m); + }) || kc.find(function(m) { + return !d[0].includes(m) && d[1] !== m && Tn(p, m); })); - })(a, h[0]) ? h.length > 1 ? r.set(c, h.slice(1)) : (r.delete(c), u(a)) : fn(a, a.key) || r.delete(c); - }), o && clearTimeout(o), o = setTimeout(r.clear.bind(r), s)); + })(a, h[0]) ? h.length > 1 ? r.set(c, h.slice(1)) : (r.delete(c), u(a)) : Tn(a, a.key) || r.delete(c); + }), o && clearTimeout(o), o = setTimeout(r.clear.bind(r), n)); }; } -function Ul(n, t, e) { - var s; +function Ec(s, t, e) { + var n; e === void 0 && (e = {}); - var i = (s = e.event) != null ? s : "keydown", r = ao(t, e); - return n.addEventListener(i, r), function() { - n.removeEventListener(i, r); + var i = (n = e.event) != null ? n : "keydown", r = Oo(t, e); + return s.addEventListener(i, r), function() { + s.removeEventListener(i, r); }; } -function lo(n, t = {}) { - if (!n) +function Ho(s, t = {}) { + if (!s) return; - const e = Object.keys(t).reduce((s, i) => (t[i].optional || (s[i] = { + const e = Object.keys(t).reduce((n, i) => (t[i].optional || (n[i] = { ...t[i] - }), s), {}); - return Object.keys(n).forEach((s) => { - const i = n[s]; - i ? i === !0 ? t[s] && (e[s] = { - ...t[s] - }) : e[s] = i : delete e[s]; - }), Object.keys(e).reduce((s, i) => { + }), n), {}); + return Object.keys(s).forEach((n) => { + const i = s[n]; + i ? i === !0 ? t[n] && (e[n] = { + ...t[n] + }) : e[n] = i : delete e[n]; + }), Object.keys(e).reduce((n, i) => { const { keys: r, handler: o } = e[i]; - return typeof r == "string" ? s[r] = o : r.forEach((a) => { - s[a] = o; - }), s; + return typeof r == "string" ? n[r] = o : r.forEach((a) => { + n[a] = o; + }), n; }, {}); } -function co(n, t, e) { - const { timeout: s, event: i = "keydown", scope: r, when: o } = e || {}, a = ao(t, { timeout: s }), l = `.zui.hotkeys${r ? `.${r}` : ""}`, c = "zui-hotkeys-composing"; - return f(n).on(`${i}${l}`, function(u) { +function Fo(s, t, e) { + const { timeout: n, event: i = "keydown", scope: r, when: o } = e || {}, a = Oo(t, { timeout: n }), l = `.zui.hotkeys${r ? `.${r}` : ""}`, c = "zui-hotkeys-composing"; + return f(s).on(`${i}${l}`, function(u) { o && o(u) === !1 || f(u.target).data(c) || a(u); }).on(`compositionstart${l}`, (u) => { f(u.target).data(c, !0); @@ -1840,28 +1847,28 @@ function co(n, t, e) { f(u.target).removeData(c); }); } -function ho(n, t) { - return f(n).off(`.zui.hotkeys${t ? `.${t}` : ""}`); +function Wo(s, t) { + return f(s).off(`.zui.hotkeys${t ? `.${t}` : ""}`); } -const Tu = Ul; -f.fn.hotkeys = function(n, t) { - return co(this, n, t); +const wd = Ec; +f.fn.hotkeys = function(s, t) { + return Fo(this, s, t); }; -f.fn.unbindHotkeys = function(n) { - return ho(this, n); +f.fn.unbindHotkeys = function(s) { + return Wo(this, s); }; -f.hotkeys = function(n, t) { - co(window, n, t); +f.hotkeys = function(s, t) { + Fo(window, s, t); }; -f.unbindHotkeys = function(n) { - ho(window, n); +f.unbindHotkeys = function(s) { + Wo(window, s); }; -function ui() { +function Ei() { return document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement; } -async function Kl(n) { - (typeof n == "string" || n instanceof Element || n instanceof f) && (n = { target: n }); - const { target: t, onError: e, onSuccess: s, afterExit: i, afterEnter: r } = n, o = f(t), a = o[0]; +async function Ac(s) { + (typeof s == "string" || s instanceof Element || s instanceof f) && (s = { target: s }); + const { target: t, onError: e, onSuccess: n, afterExit: i, afterEnter: r } = s, o = f(t), a = o[0]; if (!a) return; const l = a.requestFullscreen || a.webkitRequestFullscreen || a.mozRequestFullScreen; @@ -1870,39 +1877,39 @@ async function Kl(n) { return; } try { - await l.call(a), s == null || s.call(a), f(a).off(".zui.fullscreen"), i && o.on("exitFullscreen.zui.fullscreen", i), r && o.on("enterFullscreen.zui.fullscreen", r); + await l.call(a), n == null || n.call(a), f(a).off(".zui.fullscreen"), i && o.on("exitFullscreen.zui.fullscreen", i), r && o.on("enterFullscreen.zui.fullscreen", r); } catch (c) { e == null || e.call(a, c); } document.zuiBindFullscreenChange || (document.zuiBindFullscreenChange = !0, f(document).on("fullscreenchange.zui webkitfullscreenchange.zui mozfullscreenchange.zui", (c) => { - const u = ui(); + const u = Ei(); let h = u; u ? f(u).addClass("is-in-fullscreen") : (h = f(document).find(".is-in-fullscreen")[0] || document, f(h).removeClass("is-in-fullscreen")), f("body").toggleClass("has-in-fullscreen", !!u); const p = { event: c, target: h, fullscreenElement: u }; f(h).trigger(u ? "enterFullscreen" : "exitFullscreen", p).trigger("toggleFullscreen", p); })); } -async function uo(n) { - const t = ui(); - return n === !1 && !!t === n ? n : t ? (document.exitFullscreen(), !1) : (await Kl(n), !0); +async function jo(s) { + const t = Ei(); + return s === !1 && !!t === s ? s : t ? (document.exitFullscreen(), !1) : (await Ac(s), !0); } -f.fn.fullscreen = function(n) { - return uo({ +f.fn.fullscreen = function(s) { + return jo({ target: this, - ...n + ...s }); }; -f.getFullscreenElement = ui; -f.toggleFullscreen = uo; -function ce(n) { - return !n || n.parentNode === document ? !1 : n.parentNode ? ce(n.parentNode) : !0; +f.getFullscreenElement = Ei; +f.toggleFullscreen = jo; +function pe(s) { + return !s || s.parentNode === document ? !1 : s.parentNode ? pe(s.parentNode) : !0; } -f.isDetached = ce; +f.isDetached = pe; f.fn.isDetached = function() { - const n = this[0]; - return !n || ce(n); + const s = this[0]; + return !s || pe(s); }; -const he = class fo { +const ge = class Bo { /** * The component constructor. * @@ -1910,15 +1917,15 @@ const he = class fo { */ constructor(t, e) { this._inited = !1, this._autoDestory = 0, this._destroyed = !1; - const { KEY: s, DATA_KEY: i, DEFAULT: r, MULTI_INSTANCE: o, NAME: a, ATTR_KEY: l, ALL: c, TYPED_ALL: u } = this.constructor; + const { KEY: n, DATA_KEY: i, DEFAULT: r, MULTI_INSTANCE: o, NAME: a, ATTR_KEY: l, ALL: c, TYPED_ALL: u } = this.constructor; if (!a) throw new Error('[ZUI] The component must have a "NAME" static property.'); const h = f(t); - if (h.data(s) && !o) + if (h.data(n) && !o) throw new Error(`[ZUI] The component "${a}" has been initialized on element.`); - const p = h[0], d = ct(); - if (this._gid = d, this._element = p, this._options = { ...r, ...(e == null ? void 0 : e.$optionsFromDataset) !== !1 ? h.dataset() : {} }, this.setOptions(e), this._key = this.options.key ?? `__${d}`, c.has(p) ? c.get(p).add(this) : c.set(p, /* @__PURE__ */ new Set([this])), u.has(a) ? u.get(a).add(this) : u.set(a, /* @__PURE__ */ new Set([this])), h.data(s, this).attr(l, "").attr(i, `${d}`), o) { - const m = `${s}:ALL`; + const p = h[0], d = pt(); + if (this._gid = d, this._element = p, this._options = { ...r, ...(e == null ? void 0 : e.$optionsFromDataset) !== !1 ? h.dataset() : {} }, this.setOptions(e), this._key = this.options.key ?? `__${d}`, c.has(p) ? c.get(p).add(this) : c.set(p, /* @__PURE__ */ new Set([this])), u.has(a) ? u.get(a).add(this) : u.set(a, /* @__PURE__ */ new Set([this])), h.data(n, this).attr(l, "").attr(i, `${d}`), o) { + const m = `${n}:ALL`; let _ = h.data(m); _ || (_ = /* @__PURE__ */ new Map(), h.data(m, _)), _.set(this._key, this); } @@ -2035,7 +2042,7 @@ const he = class fo { * Destroy the component. */ destroy() { - const { KEY: t, DATA_KEY: e, ALL: s, TYPED_ALL: i, NAME: r, MULTI_INSTANCE: o, ATTR_KEY: a } = this.constructor, { $element: l, element: c } = this; + const { KEY: t, DATA_KEY: e, ALL: n, TYPED_ALL: i, NAME: r, MULTI_INSTANCE: o, ATTR_KEY: a } = this.constructor, { $element: l, element: c } = this; if (this.emit("destroyed"), this._destroyed = !0, l.off(this.namespace).removeData(t).removeAttr(a).removeAttr(e), o) { const p = this.$element.data(`${t}:ALL`); if (p) @@ -2046,8 +2053,8 @@ const he = class fo { l.data(t, d).attr(e, d.gid); } } - const u = s.get(c); - u && (u.delete(this), u.size === 0 && s.delete(c)); + const u = n.get(c); + u && (u.delete(this), u.size === 0 && n.delete(c)); const h = i.get(r); h && (h.delete(this), h.size === 0 && i.delete(r)); } @@ -2056,7 +2063,7 @@ const he = class fo { */ autoDestroy(t = 100) { this._autoDestory && clearTimeout(this._autoDestory), this._autoDestory = window.setTimeout(() => { - this._autoDestory = 0, ce(this.element) && this.destroy(); + this._autoDestory = 0, pe(this.element) && this.destroy(); }, t); } /** @@ -2078,8 +2085,8 @@ const he = class fo { * @param args The event arguments. */ emit(t, ...e) { - const s = f.Event(t); - return s.__src = this, this.$emitter.trigger(s, [this, ...e]), s; + const n = f.Event(t); + return n.__src = this, this.$emitter.trigger(n, [this, ...e]), n; } /** * Listen to a component event. @@ -2087,9 +2094,9 @@ const he = class fo { * @param event The event name. * @param callback The event callback. */ - on(t, e, s) { + on(t, e, n) { const i = this; - this.$element[s != null && s.once ? "one" : "on"](this._wrapEvent(t), function(r, o) { + this.$element[n != null && n.once ? "one" : "on"](this._wrapEvent(t), function(r, o) { (!r.__src || r.__src === i) && e.call(this, r, o); }); } @@ -2118,9 +2125,9 @@ const he = class fo { * @param defaultValue The default value if the key is not found. * @returns The i18n text. */ - i18n(t, e, s) { + i18n(t, e, n) { const { i18nData: i } = this; - return O(i, t, e, s, this.options.lang, this.constructor.NAME) ?? O(i, t, e, s, this.options.lang) ?? `{i18n:${t}}`; + return F(i, t, e, n, this.options.lang, this.constructor.NAME) ?? F(i, t, e, n, this.options.lang) ?? `{i18n:${t}}`; } /** * Get event namespace. @@ -2146,12 +2153,12 @@ const he = class fo { * @returns The component instance. */ static get(t, e) { - const s = f(t); + const n = f(t); if (this.MULTI_INSTANCE && e !== void 0) { - const i = s.data(`${this.KEY}:ALL`); + const i = n.data(`${this.KEY}:ALL`); return i ? i.get(e) : void 0; } - return s.data(this.KEY); + return n.data(this.KEY); } // eslint-disable-next-line @typescript-eslint/no-unused-vars static isValid(t) { @@ -2166,11 +2173,11 @@ const he = class fo { * @returns The component instance. */ static ensure(t, e) { - const s = this.get(t, e == null ? void 0 : e.key); - if (s) { - if (this.isValid(s)) - return e && s.setOptions(e), s; - s.destroy(); + const n = this.get(t, e == null ? void 0 : e.key); + if (n) { + if (this.isValid(n)) + return e && n.setOptions(e), n; + n.destroy(); } return new this(t, e); } @@ -2183,13 +2190,13 @@ const he = class fo { */ static getAll(t, e) { var l; - const { SELECTOR: s, ALL: i, TYPED_ALL: r } = this, o = [], a = (c) => { + const { SELECTOR: n, ALL: i, TYPED_ALL: r } = this, o = [], a = (c) => { c instanceof this && (!e || e(c) !== !1) && o.push(c); }; - return t ? f(t).find(s).each((c, u) => { + return t ? f(t).find(n).each((c, u) => { var h; (h = i.get(u)) == null || h.forEach(a); - }) : this !== fo ? (l = r.get(this.NAME)) == null || l.forEach(a) : i.forEach((c) => { + }) : this !== Bo ? (l = r.get(this.NAME)) == null || l.forEach(a) : i.forEach((c) => { c.forEach(a); }), o.sort((c, u) => c.gid - u.gid); } @@ -2200,8 +2207,8 @@ const he = class fo { * @param selector The component element selector. * @returns The component instance. */ - static query(t, e, s) { - return t === void 0 ? this.getAll(void 0, s).pop() : this.get(f(t).closest(this.SELECTOR), e); + static query(t, e, n) { + return t === void 0 ? this.getAll(void 0, n).pop() : this.get(f(t).closest(this.SELECTOR), e); } /** * Create cash fn.method for current component. @@ -2211,14 +2218,14 @@ const he = class fo { static defineFn(t) { let e = t || this.ZUI; f.fn[e] && (e = `zui${this.NAME}`); - const s = this; + const n = this; f.fn.extend({ [e](i, ...r) { const o = typeof i == "object" ? i : void 0, a = typeof i == "string" ? i : void 0; let l; return this.each((c, u) => { - let h = s.get(u); - if (h ? o && h.render(o) : h = new s(u, o), a) { + let h = n.get(u); + if (h ? o && h.render(o) : h = new n(u, o), a) { let p = h[a], d = h; p === void 0 && (d = h.$, p = d[a]), typeof p == "function" ? l = p.call(d, ...r) : l = p; } @@ -2229,61 +2236,61 @@ const he = class fo { static register(t, e) { var i, r; t = t || this, e = (e ?? t.NAME).toLowerCase(), this.map.set(e, t); - const s = (r = (i = t.toggle) == null ? void 0 : i.name) == null ? void 0 : r.toLowerCase(); - s && s !== e && this.toggleMap.set(s, t); - } -}; -he.DEFAULT = {}; -he.MULTI_INSTANCE = !1; -he.ALL = /* @__PURE__ */ new Map(); -he.TYPED_ALL = /* @__PURE__ */ new Map(); -he.map = /* @__PURE__ */ new Map(); -he.toggleMap = /* @__PURE__ */ new Map(); -let ft = he; -function Us(n) { - return ft.map.get(n.toLowerCase()); -} -function po(n, t, e = {}) { - let s = Us(n); - if (s || (s = go(n)), !s) + const n = (r = (i = t.toggle) == null ? void 0 : i.name) == null ? void 0 : r.toLowerCase(); + n && n !== e && this.toggleMap.set(n, t); + } +}; +ge.DEFAULT = {}; +ge.MULTI_INSTANCE = !1; +ge.ALL = /* @__PURE__ */ new Map(); +ge.TYPED_ALL = /* @__PURE__ */ new Map(); +ge.map = /* @__PURE__ */ new Map(); +ge.toggleMap = /* @__PURE__ */ new Map(); +let yt = ge; +function nn(s) { + return yt.map.get(s.toLowerCase()); +} +function Vo(s, t, e = {}) { + let n = nn(s); + if (n || (n = Uo(s)), !n) return null; const { $update: i, ...r } = e; - if (!s.MULTI_INSTANCE) { - const o = s.get(t); + if (!n.MULTI_INSTANCE) { + const o = n.get(t); if (o) return i && o.render(r, i === "reset"), o; } - return new s(t, r); + return new n(t, r); } -function ql(n, t, e = {}) { - requestAnimationFrame(() => po(n, t, e)); +function Mc(s, t, e = {}) { + requestAnimationFrame(() => Vo(s, t, e)); } -function Gl(n, t) { - ft.register(n, t); +function Pc(s, t) { + yt.register(s, t); } -function go(n) { +function Uo(s) { const { zui: t } = window; if (t) { - n = n == null ? void 0 : n.toLowerCase(); + s = s == null ? void 0 : s.toLowerCase(); for (const e in t) { - const s = e.toLowerCase() === n; - if (n && !s) + const n = e.toLowerCase() === s; + if (s && !n) continue; const i = t[e]; - if (!(typeof i != "function" || !i.NAME || !i.ZUI) && (ft.map.has(e.toLowerCase()) || Gl(i), s)) + if (!(typeof i != "function" || !i.NAME || !i.ZUI) && (yt.map.has(e.toLowerCase()) || Pc(i), n)) return i; } } } -function Nu(n) { +function bd(s) { var t; - n ? (t = Us(n)) == null || t.defineFn() : window._zuiDefined || (go(), ft.map.forEach((e) => { + s ? (t = nn(s)) == null || t.defineFn() : window._zuiDefined || (Uo(), yt.map.forEach((e) => { e.defineFn(); }), Object.assign(window, { _zuiDefined: !0 })); } -function Yl(n, t = {}) { - const e = f(n); - let s = e.attr("zui-create"); +function Ic(s, t = {}) { + const e = f(s); + let n = e.attr("zui-create"); const { update: i, onCreate: r } = t, o = (a, l) => { if (l = { $update: i, @@ -2297,14 +2304,14 @@ function Yl(n, t = {}) { } const c = l.$lib; if (c) { - delete l.$lib, f.getLib(c).then(() => po(a, n, l)); + delete l.$lib, f.getLib(c).then(() => Vo(a, s, l)); return; } - ql(a, n, l); + Mc(a, s, l); }; - if (typeof s == "string") { - s = s.trim(); - const a = s.length ? s.split(",").map((u) => u.trim()) : [], l = We(n, { prefix: "zui-create-", evalValue: !0 }), c = Object.keys(l); + if (typeof n == "string") { + n = n.trim(); + const a = n.length ? n.split(",").map((u) => u.trim()) : [], l = Ge(s, { prefix: "zui-create-", evalValue: !0 }), c = Object.keys(l); if (!c.length && a.length === 1) o(a[0], e.dataset()); else { @@ -2320,128 +2327,128 @@ function Yl(n, t = {}) { const a = e.dataset(), l = a == null ? void 0 : a.zui; if (!l) return; - console.warn("[ZUI] create component instance with [data-zui] is deprecated, use [zui-create] instead.", { element: n, options: t }), delete a.zui, o(l, a); + console.warn("[ZUI] create component instance with [data-zui] is deprecated, use [zui-create] instead.", { element: s, options: t }), delete a.zui, o(l, a); } } -function Jl() { - f(document).on("click.zui.toggle mouseenter.zui.toggle", "[data-toggle],[zui-toggle]", function(n) { +function Rc() { + f(document).on("click.zui.toggle mouseenter.zui.toggle", "[data-toggle],[zui-toggle]", function(s) { const t = f(this), e = t.dataset("toggle") || t.attr("zui-toggle"); if (!e) return; - const s = ft.toggleMap.get(e) || Us(e), i = s == null ? void 0 : s.toggle; + const n = yt.toggleMap.get(e) || nn(e), i = n == null ? void 0 : n.toggle; if (!i) return; - const { trigger: r = "click", skip: o = "[disabled],.disabled", check: a } = i, l = n.type === "mouseover" ? "hover" : "click"; - if (!r.includes(l) || a && !a.call(s, this, l, n) || o && t.is(o)) + const { trigger: r = "click", skip: o = "[disabled],.disabled", check: a } = i, l = s.type === "mouseover" ? "hover" : "click"; + if (!r.includes(l) || a && !a.call(n, this, l, s) || o && t.is(o)) return; const { onGet: c, onCreate: u, setOptions: h = !0, getOptions: p, prevent: d = !0, handler: m, onToggle: _, convertHref: v } = i; let y = t.dataset(); const w = t.attr(`zui-toggle-${e}`); - if (w && (y = f.extend(y, ve(w))), v && t.is("a")) { + if (w && (y = f.extend(y, xe(w))), v && t.is("a")) { const b = t.attr("href"); if (b) { const S = v === !0 ? { selector: "target", url: "url" } : v; "#.".includes(b[0]) ? S.selector && y[S.selector] === void 0 && (y[S.selector] = b) : S.url && y[S.url] === void 0 && (y[S.url] = b); } } - if (p && (y = p.call(s, this, y, n)), m) { - m.call(s, this, y, l, n), d && n.preventDefault(); + if (p && (y = p.call(n, this, y, s)), m) { + m.call(n, this, y, l, s), d && s.preventDefault(); return; } - let C = c ? c.call(s, this) : s.get(this); + let C = c ? c.call(n, this) : n.get(this); if (C) h && C.setOptions(y); else { - const b = u ? u.call(s, this, n, y) : new s(this, y); + const b = u ? u.call(n, this, s, y) : new n(this, y); if (!b) return; C = b; } if (_) { - if (_.call(s, C, this, n) === !1) + if (_.call(n, C, this, s) === !1) return; } else { const { shown: b, show: S, hide: N, toggle: A } = C; - let E; - if (A ? E = A : S && N ? b ? E = N : E = S : S && (E = S), E) - E.call(C); + let $; + if (A ? $ = A : S && N ? b ? $ = N : $ = S : S && ($ = S), $) + $.call(C); else return; } - d && n.preventDefault(); + d && s.preventDefault(); }); } -function Zl(n, t) { - const e = oi(n), s = []; +function Dc(s, t) { + const e = xi(s), n = []; return Object.keys(e).forEach((i) => { if (!i.startsWith("zui.")) return; const r = e[i]; - (t == null ? void 0 : t(r, i)) !== !1 && s.push(e[i]); - }), s; + (t == null ? void 0 : t(r, i)) !== !1 && n.push(e[i]); + }), n; } -let ls = 0; -function mo(n = 100) { - if (ls && clearTimeout(ls), n) { - ls = window.setTimeout(() => mo(0), n); +let ms = 0; +function Ko(s = 100) { + if (ms && clearTimeout(ms), s) { + ms = window.setTimeout(() => Ko(0), s); return; } - ls = 0, ft.ALL.forEach((t) => { + ms = 0, yt.ALL.forEach((t) => { t.forEach((e) => e.autoDestroy()); }); } -function Xl() { - if (!document.body || oi(document.body, "_autoDestoryMob")) +function Lc() { + if (!document.body || xi(document.body, "_autoDestoryMob")) return; - const n = new MutationObserver((t) => { + const s = new MutationObserver((t) => { let e = !1; - for (const s of t) - if (s.removedNodes.length) { + for (const n of t) + if (n.removedNodes.length) { e = !0; break; } - e && mo(); + e && Ko(); }); - n.observe(document.body, { childList: !0, subtree: !0 }), ri(document.body, "_autoDestoryMob", n); + s.observe(document.body, { childList: !0, subtree: !0 }), Si(document.body, "_autoDestoryMob", s); } -f.fn.zuiInit = function(n) { +f.fn.zuiInit = function(s) { return this.find("[zui-create],[data-zui]").each(function() { var t; - ((t = n == null ? void 0 : n.beforeCreate) == null ? void 0 : t.call(n, this)) !== !1 && Yl(this, n); + ((t = s == null ? void 0 : s.beforeCreate) == null ? void 0 : t.call(s, this)) !== !1 && Ic(this, s); }), this.find("[zui-init]").each(function() { this.hasAttribute("z-zui-inited") || (this.setAttribute("z-zui-inited", ""), f.runJS(this.getAttribute("zui-init"), ["$element", f(this)])); }), this.find(".hide-before-init").removeClass("invisible hidden opacity-0"), this.find(".scroll-into-view").scrollIntoView(), this.find('[data-on="inited"],[zui-on-inited]').each((t, e) => { - const s = f(e); - s.zui() || s.trigger("inited"); + const n = f(e); + n.zui() || n.trigger("inited"); }), this; }; -f.fn.zui = function(n, t) { +f.fn.zui = function(s, t) { const e = this[0]; if (!e) return; - if (typeof n != "string") { + if (typeof s != "string") { const i = {}; let r; - return Zl(e, (o, a) => { + return Dc(e, (o, a) => { i[a] = o, (!r || r.gid < o.gid) && (r = i[a]); - }), n === !0 ? i : r; + }), s === !0 ? i : r; } - const s = Us(n); - return s ? t === !0 ? s.getAll(e) : s.query(e, t) : f(e).data(`zui.${n}`); + const n = nn(s); + return n ? t === !0 ? n.getAll(e) : n.query(e, t) : f(e).data(`zui.${s}`); }; -f.fn.zuiCall = function(n, t = []) { +f.fn.zuiCall = function(s, t = []) { return this.each(function() { - const e = n.split("."), s = e.length > 1 ? e[0] : void 0, i = e[e.length > 1 ? 1 : 0], r = f(this).zui(s), o = r == null ? void 0 : r[i]; + const e = s.split("."), n = e.length > 1 ? e[0] : void 0, i = e[e.length > 1 ? 1 : 0], r = f(this).zui(n), o = r == null ? void 0 : r[i]; typeof o == "function" && o.apply(r, t); }), this; }; f(() => { - f("body").zuiInit({ update: !0 }), Jl(), Xl(); + f("body").zuiInit({ update: !0 }), Rc(), Lc(); }); -class Ql extends ft { +class zc extends yt { init() { - const { offset: t = 1, side: e, zIndex: s, pinnedClass: i = "is-pinned", targets: r, scrollContainer: o } = this.options, { $element: a } = this, l = r ? a.find(r) : a; - if (l.css({ position: "sticky", zIndex: s }), e && l.css(e, -t), o) { + const { offset: t = 1, side: e, zIndex: n, pinnedClass: i = "is-pinned", targets: r, scrollContainer: o } = this.options, { $element: a } = this, l = r ? a.find(r) : a; + if (l.css({ position: "sticky", zIndex: n }), e && l.css(e, -t), o) { const c = a.closest(o)[0]; if (c) { const u = () => { @@ -2475,92 +2482,92 @@ class Ql extends ft { (t = this._ob) == null || t.disconnect(), this._container && (this._container.removeEventListener("scroll", this._scrollListener), this._raf && cancelAnimationFrame(this._raf)); } } -Ql.NAME = "Sticky"; -function Ks(n, t = {}) { - const e = f(n)[0]; +zc.NAME = "Sticky"; +function rn(s, t = {}) { + const e = f(s)[0]; if (!e) return !1; - let { viewport: s } = t; + let { viewport: n } = t; const { left: i, top: r, width: o, height: a } = e.getBoundingClientRect(); if (t.checkZeroSize && !(o * a)) return !1; - if (!s) + if (!n) if (t.container) - s = f(e).closest(t.container)[0].getBoundingClientRect(); + n = f(e).closest(t.container)[0].getBoundingClientRect(); else { const { innerHeight: m, innerWidth: _ } = window, { clientHeight: v, clientWidth: y } = document.documentElement; - s = { left: 0, top: 0, width: _ || y, height: m || v }; + n = { left: 0, top: 0, width: _ || y, height: m || v }; } - const { left: l, top: c, width: u, height: h } = s; + const { left: l, top: c, width: u, height: h } = n; if (t.fullyCheck) return i >= l && r >= c && i + o <= u + l && r + a <= h + c; const p = i <= l + u && i + o >= l; return r <= c + h && r + a >= c && p; } -f.fn.isVisible = function(n) { - return Ks(this, n); +f.fn.isVisible = function(s) { + return rn(this, s); }; -function Ss(n, t, e = !1) { +function Is(s, t, e = !1) { var i; - const s = f(n); + const n = f(s); if (t !== void 0) { if (typeof t == "string" && t.length) { - const r = `zui-runjs-${ct()}`; - s.append(``);\n if (removeAfterRun) {\n $element.find(`#${id}`).remove();\n }\n }\n return;\n }\n if ($element.is('script')) {\n const code = $element[0]?.textContent;\n if (code) {\n runJS($element.parent(), code);\n }\n return;\n }\n $element.find('script').each((_, script) => {\n runJS($element, (script as HTMLScriptElement).textContent);\n script.remove();\n });\n}\n\n/* Declare types. */\ndeclare module 'cash-dom' {\n interface Cash {\n runJS(jsCode?: string): this;\n }\n\n interface CashStatic {\n runJS(jsCode: string, ...args: [name: string, value: unknown][]): T;\n }\n}\n\n/* Extend as $.runJS() */\n$.runJS = (jsCode: string, ...args: [name: string, value: unknown][]): T => {\n jsCode = jsCode.trim();\n if (!jsCode.startsWith('return ') && !jsCode.endsWith(';')) {\n jsCode = `return ${jsCode}`;\n }\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const func = new Function(...args.map(([name]) => name), jsCode);\n return func(...args.map(([, value]) => value));\n};\n\n/* Extend as $.fn.runJS() */\n$.fn.runJS = function (this: Cash, jsCode?: string) {\n return this.each((_, ele) => {\n runJS(ele, jsCode);\n });\n};\n","import {$, Cash, Selector, Comparator} from '../cash';\nimport {isVisible} from './is-visible';\n\n/**\n * Options for {@link scrollIntoView}.\n */\ntype CashScrollIntoViewOptions = ScrollIntoViewOptions & {\n ifNeeded?: boolean;\n container?: Comparator;\n};\n\nfunction hasScrollbar(element: HTMLElement, direction: 'vert' | 'horz' | 'both' = 'both') {\n if (direction === 'vert' || direction === 'both') {\n if (element.clientHeight < element.scrollHeight) {\n return true;\n }\n }\n\n if (direction === 'horz' || direction === 'both') {\n if (element.clientWidth < element.scrollWidth) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Scroll into view.\n *\n * @param selector Element selector to scroll into view.\n * @param options Options.\n * @returns True if the element is visible.\n * @see https://stackoverflow.com/a/26039199\n */\nexport function scrollIntoView(selector: Selector, options?: CashScrollIntoViewOptions): Cash {\n const $element = $(selector);\n const {ifNeeded = true, container, ...other} = options || {};\n $element.each((_, ele) => {\n if (container) {\n const $container = $(ele).closest(container);\n if (!$container.length || !hasScrollbar($container[0] as HTMLElement)) {\n return;\n }\n }\n if (ifNeeded) {\n if ((ele as unknown as {scrollIntoViewIfNeeded?: (options: ScrollIntoViewOptions) => void}).scrollIntoViewIfNeeded) {\n return (ele as unknown as {scrollIntoViewIfNeeded: (options: ScrollIntoViewOptions) => void}).scrollIntoViewIfNeeded(other);\n }\n if (isVisible(ele, {viewport: ele.getBoundingClientRect()})) {\n return;\n }\n }\n ele.scrollIntoView(other);\n });\n return $element;\n}\n\n/* Declare types. */\ndeclare module 'cash-dom' {\n interface Cash {\n scrollIntoView(options?: CashScrollIntoViewOptions): this;\n }\n}\n\n/* Extend as $.fn.scrollIntoView() */\n$.fn.scrollIntoView = function (this: Cash, options?: CashScrollIntoViewOptions) {\n return this.each((_, ele) => {\n scrollIntoView(ele, options);\n });\n};\n","import {$} from '../cash';\n\nexport type GetLibCallback = () => void;\n\nexport interface LoadJSOptions {\n src: string;\n id?: string;\n async?: boolean;\n defer?: boolean;\n noModule?: boolean;\n type?: string;\n integrity?: string;\n}\n\nexport interface LoadCSSOptions {\n src: string;\n id?: string;\n type?: 'css';\n}\n\nexport type GetLibOptions = {\n src: string | (string | LoadJSOptions | LoadCSSOptions)[];\n id?: string;\n async?: boolean;\n defer?: boolean;\n noModule?: boolean;\n type?: string;\n integrity?: string;\n name?: string;\n root?: string;\n css?: string;\n check?: string | boolean | (() => boolean | Promise);\n success?: GetLibCallback;\n};\n\n/* Declare types. */\ndeclare module 'cash-dom' {\n interface CashStatic {\n libRoot?: string;\n\n libMap?: Record;\n\n setLibRoot(root: string): void;\n\n registerLib(name: string, options: GetLibOptions): void;\n\n getLib(options: GetLibOptions): Promise;\n getLib(src: string | string[]): Promise;\n getLib(src: string | string[], options: Omit): Promise;\n getLib(src: string | string[], callback: GetLibCallback): Promise;\n getLib(src: string | string[], options: GetLibCallback, callback?: GetLibCallback): Promise;\n getLib(optionsOrSrc: string | string[] | GetLibOptions, optionsOrCallback?: Omit | GetLibCallback, callback?: GetLibCallback): Promise;\n\n /**\n * @deprecated Use $.getLib instead.\n */\n getScript(optionsOrSrc: string | (GetLibOptions & {src: string}), optionsOrCallback?: Omit | GetLibCallback, callback?: GetLibCallback): Promise;\n }\n}\n\n/** Define the $.libRoot property. */\n$.setLibRoot = function (root: string): void {\n $.libRoot = root;\n};\n\n/** Define the $.libMap property. */\n$.registerLib = function (name: string, options: GetLibOptions): void {\n if (!$.libMap) {\n $.libMap = {};\n }\n if (!options.name && options.id) {\n options.id = `zui-lib-${name}`;\n }\n $.libMap[name] = options;\n};\n\n/**\n * Load a CSS file by append a link tag to the head.\n */\nfunction loadCSS(options: string | LoadCSSOptions): Promise {\n return new Promise((resolve, reject) => {\n if (typeof options === 'string') {\n options = {src: options};\n }\n const {src, id} = options;\n const $oldLinks = $(id ? `#${id}` : `link[href=\"${src}\"]`);\n if ($oldLinks.length) {\n resolve();\n return;\n }\n const link = document.createElement('link');\n link.onload = () => {\n resolve();\n };\n link.onerror = () => {\n reject(new Error(`[ZUI] Failed to load CSS from: ${src}`));\n };\n link.rel = 'stylesheet';\n link.href = src;\n if (id) {\n link.id = id;\n }\n $('head').append(link);\n });\n}\n\nfunction loadJS(options: string | LoadJSOptions): Promise {\n return new Promise((resolve, reject) => {\n if (typeof options === 'string') {\n options = {src: options};\n }\n const {src, id} = options;\n const $oldScripts = $(id ? `#${id}` : `script[src=\"${src}\"]`);\n if ($oldScripts.length) {\n if ($oldScripts.dataset('loaded')) {\n resolve();\n } else {\n const callbacks = $oldScripts.data('loadCalls') || [];\n callbacks.push(resolve);\n $oldScripts.data('loadCalls', callbacks);\n }\n return;\n }\n const {async = true, defer = false, noModule = false, type, integrity} = options;\n const script = document.createElement('script');\n script.async = async;\n script.defer = defer;\n script.noModule = noModule;\n if (type) {\n script.type = type;\n }\n if (integrity) {\n script.integrity = integrity;\n }\n\n script.onload = () => {\n resolve();\n const callbacks: GetLibCallback[] = $(script).dataset('loaded', true).data('loadCalls') || [];\n callbacks.forEach(x => x());\n $(script).removeData('loadCalls');\n };\n script.onerror = () => {\n reject(new Error(`[ZUI] Failed to load JS from: ${src}`));\n };\n $('head').append(script);\n script.src = src;\n });\n}\n\n/** Define the $.getLib method. */\n$.getLib = async function (optionsOrSrc: string | string[] | GetLibOptions, optionsOrCallback?: Omit | GetLibCallback, callback?: GetLibCallback): Promise {\n if (typeof optionsOrSrc === 'string') {\n optionsOrSrc = ($.libMap?.[optionsOrSrc] || {src: optionsOrSrc}) as GetLibOptions;\n }\n let options: GetLibOptions = Array.isArray(optionsOrSrc) ? {src: optionsOrSrc} : $.extend({}, optionsOrSrc);\n if (typeof optionsOrCallback === 'function') {\n options.success = optionsOrCallback;\n } else if (optionsOrCallback) {\n $.extend(options, optionsOrCallback);\n }\n if (callback) {\n options.success = callback;\n }\n\n let {src: srcList} = options;\n const {name, success} = options;\n const lib = ($.libMap && name) ? $.libMap[name] : null;\n if (lib) {\n options = $.extend({}, lib, options);\n srcList = lib.src || options.src;\n }\n if (typeof srcList === 'string') {\n srcList = [srcList];\n }\n if (!srcList || !srcList.length) {\n throw new Error('[ZUI] No src provided for $.getLib.');\n }\n\n let {check = true} = options;\n if (check === true && name) {\n check = name;\n }\n const libVarName = typeof check === 'string' ? check : name;\n const getLibVar = (): T | undefined => {\n return libVarName ? ((window as unknown as Record)[libVarName] as T) : undefined;\n };\n if (typeof check === 'string') {\n check = () => !!getLibVar();\n }\n const onSuccess = () => {\n success?.();\n return getLibVar();\n };\n if (typeof check === 'function') {\n const checkResult = await check();\n if (checkResult) {\n return onSuccess();\n }\n }\n\n const {root = $.libRoot} = options;\n for (let srcOptions of srcList) {\n if (typeof srcOptions === 'string') {\n srcOptions = {src: srcOptions};\n }\n let {src} = srcOptions;\n if (root && !/https?:\\/\\//.test(src)) {\n src = `${root}${(root.endsWith('/') || src.startsWith('/')) ? '' : '/'}${src}`;\n }\n const loadOptions = {\n ...options,\n ...srcOptions,\n src,\n };\n if (srcOptions.type === 'css' || (!srcOptions.type && src.endsWith('.css'))) {\n await loadCSS(loadOptions as LoadCSSOptions);\n continue;\n }\n await loadJS(loadOptions as LoadJSOptions);\n }\n return onSuccess();\n};\n\n/** Define the $.getScript method. */\n$.getScript = $.getLib;\n","import {$, Cash, Selector} from '../cash';\n\n/**\n * Listen element resize with ResizeObserver.\n *\n * @param selector Element selector to check.\n * @returns True if the element is disabled.\n */\nexport function listenResize(selector: Selector, callback: ResizeObserverCallback): ResizeObserver {\n const $elements = $(selector);\n const observer = new ResizeObserver(callback);\n\n $elements.each((_, ele) => {\n observer.observe(ele);\n });\n\n return observer;\n}\n\n/* Declare types. */\ndeclare module 'cash-dom' {\n interface Cash {\n resize(callback: ResizeObserverCallback): ResizeObserver;\n }\n}\n\n/* Extend as $.fn.resize() */\n$.fn.resize = function (this: Cash, callback: ResizeObserverCallback) {\n return listenResize(this, callback);\n};\n","import type {ComponentType} from 'preact';\n\nexport const reactComponents: Record = {};\n\nexport function registerReactComponent

    (name: string, component?: ComponentType

    ): void;\n\nexport function registerReactComponent(componentMap: Record): void;\n\nexport function registerReactComponent(nameOrMap: string | Record, component?: ComponentType): void {\n if (typeof nameOrMap === 'object') {\n Object.keys(nameOrMap).forEach(name => {\n registerReactComponent(name, nameOrMap[name] as ComponentType);\n });\n } else if (component) {\n reactComponents[nameOrMap.toLowerCase()] = component;\n }\n}\n\nexport function getReactComponent

    (name: string): ComponentType

    | undefined {\n return reactComponents[name.toLowerCase()] as (ComponentType

    | undefined);\n}\n","import {h, Component} from 'preact';\nimport {nextGid} from '../../helpers/gid';\nimport {classes} from '../../helpers/classes';\nimport {getReactComponent} from './components';\nimport {i18n} from '../../i18n';\n\nimport type {JSX, ComponentType, RenderableProps, ComponentChildren} from 'preact';\nimport type {ClassNameLike} from '../../helpers/classes';\nimport type {HElementProps} from '../types';\nimport type {I18nLangMap} from '../../i18n';\n\n/**\n * The base HTML element.\n */\nexport class HElement

    extends Component {\n static HElement = true;\n\n static customProps: string[] = [];\n\n /**\n * The component name.\n * It usually equals to the class name.\n * The name must be provided in subclass.\n */\n static NAME: string;\n\n /**\n * The component i18n data.\n * It will be merged with global i18n data.\n */\n static i18n: I18nLangMap | undefined;\n\n /**\n * Access to static properties via this.constructor.\n *\n * @see https://github.com/Microsoft/TypeScript/issues/3841#issuecomment-337560146\n */\n declare ['constructor']: typeof HElement;\n\n protected _gid = nextGid();\n\n constructor(props: P) {\n super(props);\n\n this.state = this.getDefaultState(props);\n }\n\n get gid() {\n return this._gid;\n }\n\n get element() {\n return document.querySelector(`[z-gid-${this._gid}]`);\n }\n\n /**\n * Get the component i18n data.\n */\n get i18nData(): (I18nLangMap | undefined)[] {\n return [this.props.i18n, this.constructor.i18n];\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getDefaultState(_props?: RenderableProps

    ): S {\n return {} as S;\n }\n\n resetState(props?: RenderableProps

    , init?: boolean) {\n const defaultState = this.getDefaultState(props);\n if (init) {\n this.state = defaultState;\n } else {\n this.changeState(defaultState);\n }\n }\n\n /**\n * Get the i18n text.\n *\n * @param key The i18n key.\n * @param defaultValue The default value if the key is not found.\n */\n i18n(key: string, defaultValue?: string): string;\n\n /**\n * Get the i18n text.\n *\n * @param key The i18n key.\n * @param args The i18n arguments.\n * @param defaultValue The default value if the key is not found.\n */\n i18n(key: string, args?: (string | number)[], defaultValue?: string): string;\n\n /**\n * Get the i18n text.\n *\n * @param key The i18n key.\n * @param args The i18n arguments.\n * @param defaultValue The default value if the key is not found.\n */\n i18n(key: string, args?: Record, defaultValue?: string): string;\n\n /**\n * Get the i18n text.\n *\n * @param key The i18n key.\n * @param args The i18n arguments or the default value.\n * @param defaultValue The default value if the key is not found.\n * @returns The i18n text.\n */\n i18n(key: string, args?: string | (string | number)[] | Record, defaultValue?: string): string {\n const {i18nData} = this;\n return i18n(i18nData, key, args, defaultValue, this.props.lang, this.constructor.NAME)\n ?? i18n(i18nData, key, args, defaultValue, this.props.lang)\n ?? `{i18n:${key}}`;\n }\n\n changeState(state: Partial | ((prevState: Readonly) => Partial), callback?: () => void): Promise {\n return new Promise(resolve => {\n this.setState(state, () => {\n callback?.();\n resolve(this.state);\n });\n });\n }\n\n protected _getClassName(props: RenderableProps

    ): ClassNameLike {\n return props.className;\n }\n\n protected _getProps(props: RenderableProps

    ): Record {\n const {className, attrs, props: componentProps, data, forwardRef, children, component, style, class: classNameAlt, ...others} = props;\n const customProps = new Set((this.constructor as typeof HElement).customProps);\n const strDangerouslySetInnerHTML = 'dangerouslySetInnerHTML';\n const other = Object.keys(others).reduce>((map, key) => {\n if (!customProps.has(key) && (key === strDangerouslySetInnerHTML || /^(on[A-Z]|data-|zui-|z-)[a-zA-Z-]+/.test(key))) {\n const val = others[key as keyof typeof others];\n map[key] = (key !== strDangerouslySetInnerHTML && val && typeof val === 'object') ? JSON.stringify(val) : val;\n }\n return map;\n }, {});\n return {ref: forwardRef, className: classes(this._getClassName(props), classNameAlt) || undefined, style, [`z-gid-${this._gid}`]: '', ...other, ...attrs, ...componentProps};\n }\n\n protected _getComponent(props: RenderableProps

    ): ComponentType | keyof JSX.IntrinsicElements {\n const {component = 'div'} = props;\n return (typeof component === 'string' ? getReactComponent(component as string) : component) || component;\n }\n\n protected _getChildren(props: RenderableProps

    ): ComponentChildren {\n return props.children;\n }\n\n protected _beforeRender(props: RenderableProps

    ): RenderableProps

    | undefined | void {\n return props;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected _onRender(component: ComponentType | keyof JSX.IntrinsicElements, componentProps: Record, children: ComponentChildren, _props: RenderableProps

    ): [component: ComponentType | keyof JSX.IntrinsicElements, componentProps: Record, children: ComponentChildren] | void {\n return [component, componentProps, children];\n }\n\n render(props: RenderableProps

    ) {\n props = this._beforeRender(props) || props;\n let component = this._getComponent(props);\n let children = this._getChildren(props);\n let componentProps = this._getProps(props);\n const renderResult = this._onRender(component, componentProps, children, props);\n if (renderResult) {\n [component, componentProps, children] = renderResult;\n }\n return h(component as ComponentType, componentProps, children);\n }\n}\n","import{options as r,Fragment as e}from\"preact\";export{Fragment}from\"preact\";var t=/[\"&<]/;function n(r){if(0===r.length||!1===t.test(r))return r;for(var e=0,n=0,o=\"\",f=\"\";n

    Hello world

    \n * Hello world\" />\n *\n * // Render and execute script\n * alert('Hello world')\" executeScript />\n */\nexport class HtmlContent extends Component {\n protected _ref = createRef();\n\n protected _runJS() {\n if (!this.props.executeScript) {\n return;\n }\n $(this._ref.current).runJS().zuiInit();\n }\n\n componentDidMount(): void {\n this._runJS();\n }\n\n componentDidUpdate(previousProps: Readonly): void {\n if (this.props.html !== previousProps.html) {\n this._runJS();\n }\n }\n\n render(props: HtmlContentProps) {\n const {executeScript, html, ...others} = props;\n return ;\n }\n}\n","import {h as _h, isValidElement, ComponentChildren, JSX, Attributes} from 'preact';\nimport {classes, ClassNameLike} from '../../helpers';\n\n/**\n * @deprecated Use `CustomContent` instead.\n */\nexport type CustomRenderResultItem = Partial<{\n html: string;\n __html: string;\n style: JSX.CSSProperties;\n className: ClassNameLike;\n children: ComponentChildren;\n attrs: JSX.HTMLAttributes;\n [prop: string]: unknown;\n}>;\n\n/**\n * @deprecated Use `CustomContent` instead.\n */\nexport type CustomRenderResultGenerator = unknown[], THIS = unknown> = (this: THIS, result: ComponentChildren[], ...args: T) => (ComponentChildren | CustomRenderResultItem)[] | undefined | void;\n\n/**\n * @deprecated Use `CustomContent` instead.\n */\nexport type CustomRenderResult = unknown[], THIS = unknown> = CustomRenderResultGenerator | CustomRenderResultItem | ComponentChildren;\n\n/**\n * @deprecated Use `CustomContent` instead.\n */\nexport type CustomRenderResultList = unknown[], THIS = unknown> = CustomRenderResult[];\n\n/**\n * @deprecated Use `CustomContent` instead.\n */\nexport type CustomRenderProps = unknown[], THIS = unknown> = {\n tag?: string;\n className?: ClassNameLike;\n style?: JSX.CSSProperties;\n renders: CustomRenderResultList;\n generateArgs?: T;\n generators?: Record>;\n generatorThis?: THIS;\n onGenerate?: (this: THIS, generator: CustomRenderResultGenerator, result: ComponentChildren[], ...args: T) => (ComponentChildren | CustomRenderResultItem)[];\n onRenderItem?: (item: CustomRenderResultItem) => ComponentChildren;\n children?: ComponentChildren;\n};\n\n/**\n * @deprecated Use `renderCustomContent` instead.\n */\nexport function renderCustomResult(props: CustomRenderProps): [JSX.HTMLAttributes, ComponentChildren[]] {\n const {\n tag,\n className,\n style,\n renders,\n generateArgs = [],\n generatorThis,\n generators,\n onGenerate,\n onRenderItem,\n ...others\n } = props;\n const classList: ClassNameLike = [className];\n const rootStyle: JSX.CSSProperties = {...style};\n const result: ComponentChildren[] = [];\n const rawHtml: string[] = [];\n renders.forEach(render => {\n const items: (CustomRenderResultItem | ComponentChildren)[] = [];\n if (typeof render === 'string' && generators && generators[render]) {\n render = generators[render];\n }\n if (typeof render === 'function') {\n if (onGenerate) {\n items.push(...onGenerate.call(generatorThis, render as CustomRenderResultGenerator, result, ...generateArgs));\n } else {\n const renderResult = (render as CustomRenderResultGenerator).call(generatorThis, result, ...generateArgs);\n if (renderResult) {\n if (Array.isArray(renderResult)) {\n items.push(...renderResult);\n } else {\n items.push(renderResult);\n }\n }\n }\n } else {\n items.push(render);\n }\n items.forEach(item => {\n if (item === undefined || item === null) {\n return;\n }\n if (typeof item === 'object' && !isValidElement(item) && ('html' in item || '__html' in item || 'className' in item || 'style' in item || 'attrs' in item || 'children' in item)) {\n if (item.html) {\n result.push(\n
    )}>
    ,\n );\n } else if (item.__html) {\n rawHtml.push(item.__html);\n } else {\n if (item.style) {\n Object.assign(rootStyle, item.style);\n }\n if (item.className) {\n classList.push(item.className);\n }\n if (item.children) {\n result.push(item.children);\n }\n if (item.attrs) {\n Object.assign(others, item.attrs);\n }\n }\n } else {\n result.push(item);\n }\n });\n });\n\n if (rawHtml.length) {\n Object.assign(others, {dangerouslySetInnerHTML: {__html: rawHtml}});\n }\n\n return [{\n className: classes(classList),\n style: rootStyle,\n ...others,\n }, result];\n}\n\n/**\n * @deprecated Use `CustomContent` instead.\n */\nexport function CustomRender({\n tag = 'div',\n ...props\n}: CustomRenderProps) {\n const [attrs, children] = renderCustomResult(props);\n return _h(tag, attrs as Attributes, ...children);\n}\n","import {isValidElement} from 'preact';\nimport {HtmlContent} from './html-content';\nimport {HElement} from './h-element';\nimport {mergeProps} from '../../helpers';\n\nimport type {ComponentChildren, VNode} from 'preact';\nimport type {HtmlContentProps, HElementProps, CustomContentType, CustomContentGenerator, CustomContentProps} from '../types';\n\n/**\n * Render custom content.\n *\n * @param content The content to render.\n * @param generatorThis The `this` value to use when calling the generator.\n * @param generatorArgs The arguments to pass to the generator.\n * @returns The rendered content.\n */\nexport function renderCustomContent(props: CustomContentProps): ComponentChildren {\n const {content: contentSetting, generatorArgs, generatorThis, ...others} = props;\n let content = contentSetting;\n if (typeof content === 'function') {\n content = (content as CustomContentGenerator).call(generatorThis, ...(generatorArgs || []));\n }\n if (Array.isArray(content)) {\n return content.map((x) => renderCustomContent({...others, content: x, generatorThis, generatorArgs}));\n }\n if ((typeof content === 'string' || typeof content === 'number')) {\n if (Object.keys(others).length) {\n return
    {content}
    ;\n }\n return content;\n }\n if (content && typeof content === 'object' && (typeof (content as HtmlContentProps).html === 'string' || (content as HtmlContentProps).component)) {\n if ((content as HtmlContentProps).html) {\n return ;\n }\n const {children, ...contentOthers} = content as HElementProps;\n if (children) {\n content = mergeProps({children: ((Array.isArray(children) ? children : [children]) as CustomContentType[]).map((x) => renderCustomContent({...others, content: x, generatorThis, generatorArgs}))}, contentOthers);\n }\n return ;\n }\n if (isValidElement(content)) {\n return content;\n }\n if (content) {\n console.groupCollapsed('[ZUI] CustomContent format error');\n console.trace('content:', content);\n console.log('props:', props);\n console.groupEnd();\n }\n return null;\n}\n\n/**\n * Component for rendering custom content.\n *\n * @param props Custom content props.\n * @returns Custom content.\n */\nexport function CustomContent(props: CustomContentProps): VNode | null {\n const result = renderCustomContent(props);\n if (result === undefined || result === null || typeof result === 'boolean') {\n return null;\n }\n if (isValidElement(result)) {\n return result;\n }\n return <>{result};\n}\n","import {isValidElement} from 'preact';\nimport {classes} from '../../helpers/classes';\n\nimport type {ClassNameLike} from '../../helpers/classes';\nimport type {IconProps} from '../types';\n\nconst createIconClass = (icon: string) => icon.startsWith('icon-') ? icon : `icon-${icon}`;\n\n/**\n * Component for rendering icons.\n *\n * @param props Icon properties.\n * @returns Icon element.\n */\nexport function Icon(props: IconProps) {\n const {icon, className, ...others} = props;\n if (!icon) {\n return null;\n }\n if (isValidElement(icon)) {\n return icon;\n }\n const classList: ClassNameLike[] = ['icon', className as string];\n if (typeof icon === 'string') {\n classList.push(createIconClass(icon));\n } else if (typeof icon === 'object') {\n const {className: iconClass, icon: finalIcon, ...iconOthers} = icon;\n classList.push(iconClass as string, finalIcon ? createIconClass(finalIcon as string) : '');\n Object.assign(others, iconOthers);\n }\n return ;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {createElement, render} from 'preact';\n\nimport type {VNode, RenderableProps, ContainerNode} from 'preact';\n\n/**\n * @param {import('../../src/index').RenderableProps<{ context: any }>} props\n */\nfunction ContextProvider(this: any, props: RenderableProps<{context: any}>) {\n this.getChildContext = () => props.context;\n return props.children;\n}\n\n/**\n * Portal component\n * @this {import('preact').Component}\n * @param {object | null | undefined} props\n *\n * TODO: use createRoot() instead of fake root\n */\nexport function Portal(this: any, props: any) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n const container = props._container;\n\n that.componentWillUnmount = function () {\n render(null, that._temp);\n that._temp = null;\n that._container = null;\n };\n\n // When we change container we should clear our old container and\n // indicate a new mount.\n if (that._container && that._container !== container) {\n that.componentWillUnmount();\n }\n\n // When props.vnode is undefined/false/null we are dealing with some kind of\n // conditional vnode. This should not trigger a render.\n if (props._vnode) {\n if (!that._temp) {\n that._container = container;\n\n // Create a fake DOM parent node that manages a subset of `container`'s children:\n that._temp = {\n nodeType: 1,\n parentNode: container,\n childNodes: [],\n appendChild(child: VNode) {\n this.childNodes.push(child);\n that._container.appendChild(child);\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n insertBefore(child: VNode, _before: VNode) {\n this.childNodes.push(child);\n that._container.appendChild(child);\n },\n removeChild(child: VNode) {\n this.childNodes.splice(this.childNodes.indexOf(child) >>> 1, 1);\n that._container.removeChild(child);\n },\n };\n }\n\n // Render our wrapping element into temp.\n render(\n createElement(ContextProvider as any, {context: that.context}, props._vnode),\n that._temp,\n );\n } else if (that._temp) {\n // When we come from a conditional render, on a mounted\n // portal we should clear the DOM.\n that.componentWillUnmount();\n }\n}\n\n/**\n * Create a `Portal` to continue rendering the vnode tree at a different DOM node\n *\n * @param {import('preact').VNode} vnode The vnode to render\n * @param {import('preact').PreactElement} container The DOM node to continue rendering in to.\n * @see https://github.com/developit/preact-portal/blob/master/src/preact-portal.js\n */\nexport function createPortal(vnode: VNode, container: ContainerNode): VNode {\n const el = createElement(Portal as any, {_vnode: vnode, _container: container}) as any;\n el.containerInfo = container;\n return el;\n}\n","import {HElement} from './h-element';\nimport {HtmlContent} from './html-content';\nimport {CustomContent} from './custom-content';\nimport {Icon} from './icon';\nimport {Portal} from './portals';\nimport {registerReactComponent} from './components';\n\nregisterReactComponent({\n HElement,\n element: HElement,\n HtmlContent,\n html: HtmlContent,\n CustomContent,\n custom: CustomContent,\n Icon,\n Portal,\n});\n","import {createRef, render, h} from 'preact';\nimport {Component as ComponentBase} from '../component';\nimport {mergeProps} from '../helpers';\n\nimport type {Component as ComponentReact, ComponentClass} from 'preact';\nimport {type I18nLangMap} from '../i18n';\nimport type {ComponentEventsDefnition} from '../component';\n\nexport class ComponentFromReact = ComponentReact, E extends ComponentEventsDefnition = {}, U extends HTMLElement = HTMLElement> extends ComponentBase {\n /**\n * The React component class.\n */\n static Component: unknown;\n\n /**\n * Whether replace the element.\n */\n static replace: boolean | keyof HTMLElementTagNameMap | (string & {}) = false;\n\n /**\n * Access to static properties via this.constructor.\n *\n * @see https://github.com/Microsoft/TypeScript/issues/3841#issuecomment-337560146\n */\n declare ['constructor']: typeof ComponentFromReact;\n\n /**\n * The React ref for component instance.\n */\n protected _ref = createRef();\n\n /**\n * The React component instance.\n */\n get $(): C | null {\n return this._ref.current;\n }\n\n /**\n * The i18n data.\n */\n get i18nData() {\n const {i18n, i18nData} = this.constructor.Component as {i18n?: I18nLangMap, i18nData?: (I18nLangMap | undefined)[]};\n if (i18nData) {\n return [...i18nData, this.constructor.i18n];\n }\n return [i18n, ...super.i18nData];\n }\n\n /**\n * Render after component init.\n */\n afterInit() {\n this.render();\n }\n\n /**\n * Destroy component.\n */\n destroy() {\n this.$?.componentWillUnmount?.();\n if (this.element) {\n this.element.innerHTML = '';\n }\n super.destroy();\n }\n\n /**\n * Render component.\n *\n * @param options new options.\n */\n render(options?: Partial, reset?: boolean) {\n const {element, $: instance} = this;\n const {Component, replace} = this.constructor;\n const {$replace = replace, $optionsFromDataset, ...userOptions} = this.setOptions(options, reset);\n const props = {\n ref: this._ref,\n ...userOptions,\n };\n if (reset) {\n (instance as {resetState?: (props?: Record, init?: boolean) => void})?.resetState?.(userOptions);\n }\n\n if ($replace && (Component as {HElement?: boolean}).HElement && (element.tagName.toLowerCase() === $replace || $replace === true)) {\n const attrs = Array.from(element.attributes).reduce>((data, attribute) => {\n const {name, value} = attribute;\n data[name === 'class' ? 'className' : name] = value;\n return data;\n }, {});\n render(\n h(Component as ComponentClass, mergeProps({component: element.tagName.toLowerCase(), attrs}, props)),\n element.parentElement!,\n element,\n );\n } else {\n render(\n h(Component as ComponentClass, props),\n element,\n );\n }\n }\n\n static renderHTML(options: Record): string {\n const tmpNode = document.createElement('div');\n render(h(this.Component as ComponentClass, options), tmpNode);\n return tmpNode.innerHTML;\n }\n}\n","import {HElement, Icon, classes} from '@zui/core';\n\nimport type {ClassNameLike} from '@zui/core';\nimport type {ButtonProps} from '../types/button-props';\nimport type {RenderableProps} from 'preact';\n\nexport class Button

    extends HElement

    {\n protected declare _isEmptyText?: boolean;\n\n protected declare _onlyCaret?: boolean;\n\n protected _beforeRender(props: RenderableProps

    ) {\n const {text, loading, loadingText, caret, icon, trailingIcon, children} = props;\n this._isEmptyText = text === undefined || text === null || (typeof text === 'string' && !text.length) || loading && !loadingText;\n this._onlyCaret = caret && this._isEmptyText && !icon && !trailingIcon && !children && !loading;\n }\n\n protected _getChildren(props: RenderableProps

    ) {\n const {loading, loadingIcon, loadingText, icon, text, children, trailingIcon, caret} = props;\n return [\n loading ? : ,\n this._isEmptyText ? null : {loading ? loadingText : text},\n loading ? null : children,\n loading ? null : ,\n loading ? null : caret ? : null,\n ];\n }\n\n protected _getClassName(props: RenderableProps

    ) {\n const {type, className, disabled, loading, active, children, square, size, rounded} = props;\n return ['btn', type, className, {\n 'btn-caret': this._onlyCaret,\n disabled: disabled || loading,\n active,\n loading,\n square: square === undefined ? (!this._onlyCaret && !children && this._isEmptyText) : square,\n }, size ? `size-${size}` : '', typeof rounded === 'string' ? `rounded-${rounded}` : {rounded}];\n }\n\n protected _getComponent(props: RenderableProps

    ) {\n return props.component || (props.url ? 'a' : 'button');\n }\n\n protected _getProps(props: RenderableProps

    ) {\n const component = this._getComponent(props);\n const {url, target, disabled, btnType = 'button', hint} = props;\n const asLink = component === 'a';\n const componentProps: Record = {\n ...super._getProps(props),\n type: asLink ? undefined : 'button',\n disabled: (!asLink && disabled) ? '' : undefined,\n title: hint,\n };\n if (btnType) {\n if (['button', 'reset', 'submit'].includes(btnType)) {\n if (component === 'button') {\n componentProps.type = btnType;\n }\n } else {\n componentProps.className = classes([componentProps.className as ClassNameLike, btnType]);\n }\n }\n if (!disabled) {\n if (url !== undefined) {\n componentProps[asLink ? 'href' : 'data-url'] = url;\n }\n if (target !== undefined) {\n componentProps[asLink ? 'target' : 'data-target'] = target;\n }\n }\n return componentProps;\n }\n}\n","import {registerReactComponent} from '@zui/core';\nimport * as components from './index';\n\nregisterReactComponent(components);\n","import {CustomContent, HElement, mergeProps} from '@zui/core';\n\nimport type {ComponentChild, ComponentChildren, ComponentType, JSX, RenderableProps} from 'preact';\nimport type {ClassNameLike} from '../../../core/src/helpers';\nimport type {CommonListProps, Item, ItemKey, ItemType} from '../types';\n\n/**\n * Generic list component.\n */\nexport class CommonList

    extends HElement {\n /**\n * Root element default name, used for class name.\n */\n static NAME = '';\n\n /**\n * Item default name, used for class name.\n */\n static ITEM_NAME = 'item';\n\n /**\n * Root element default tag name, used for DOM rendering.\n */\n static TAG = 'ul';\n\n /**\n * Item components, used for rendering for different item types.\n */\n static ItemComponents: Partial | ((this: CommonList, item: Item, props: CommonListProps) => Partial)]>> = {\n default: HElement,\n divider: [HElement, {className: 'divider'}],\n space: [HElement, (item) => {\n const {space, flex, style} = item as {space: JSX.CSSProperties['width'], flex: JSX.CSSProperties['flex'], style: JSX.CSSProperties};\n return {\n style: {width: space, height: space, flex, ...style},\n };\n }],\n };\n\n /**\n * Item default common props, used for rendering for all item types.\n */\n static defaultItemProps: Partial = {\n component: 'li',\n };\n\n /**\n * Item default props, used for rendering for different item types.\n */\n static defaultItemPropsMap: Partial>> = {};\n\n /**\n * Item default type, used for rendering for item without type.\n */\n static defaultItemType = 'item';\n\n static defaultProps: Partial = {\n itemKey: 'id',\n };\n\n /**\n * Access to static properties via this.constructor.\n *\n * @see https://github.com/Microsoft/TypeScript/issues/3841#issuecomment-337560146\n */\n declare ['constructor']: typeof CommonList;\n\n /**\n * Store the raw items.\n */\n protected declare _items: Item[];\n\n /**\n * Store the rendered items.\n */\n protected declare _renderedItems: Item[];\n\n constructor(props: P) {\n super(props);\n this._handleClick = this._handleClick.bind(this);\n }\n\n /**\n * Get the root element name, used for class name.\n */\n get name() {\n return this.props.name || this.constructor.NAME;\n }\n\n /**\n * Get the item element name, used for class name.\n */\n get itemName() {\n return this.props.itemName || this.constructor.ITEM_NAME;\n }\n\n getItems() {\n return this._items;\n }\n\n getRenderedItem(key: ItemKey) {\n return this._renderedItems.find((item) => item.key === key);\n }\n\n getItem(key: ItemKey): Item | undefined {\n return this._items[this.getItemIndex(key)];\n }\n\n getItemIndex(key: ItemKey) {\n return this._renderedItems.findIndex((item) => item.key === key);\n }\n\n getItemByIndex(index: number) {\n return this._items[index];\n }\n\n /**\n * Get the item key by index.\n *\n * @param index The rendered item index.\n * @returns The item key, if the item is not rendered, return undefined.\n */\n getKey(index: number): ItemKey | undefined {\n return this._renderedItems?.[index]?.key;\n }\n\n protected _getItemFromEvent(event: MouseEvent, target?: HTMLElement): {\n index: number;\n item: Item;\n renderedItem: Item;\n element: HTMLElement;\n event: MouseEvent;\n key: ItemKey;\n relativeTarget?: unknown;\n } | undefined {\n const element = (target || event.target as HTMLElement).closest('[z-item]') as HTMLElement;\n if (!element || !element.parentElement?.hasAttribute(`z-gid-${this._gid}`)) {\n return;\n }\n const index = +element.getAttribute('z-item')!;\n const item = this._items[index];\n if (!item) {\n return;\n }\n const key = this.getKey(index);\n if (key === undefined) {\n return;\n }\n const renderedItem = this._renderedItems[index];\n return {index, item, element, event, key, renderedItem, relativeTarget: this.props.relativeTarget};\n }\n\n protected _handleClick(event: MouseEvent) {\n const info = this._getItemFromEvent(event);\n if (!info) {\n return;\n }\n this.props.onClickItem?.call(this, info);\n info.item.onClick?.call(this, event, info);\n return info;\n }\n\n /**\n * Render the item content.\n *\n * @param props Current list properties.\n * @param item The item to render.\n * @param index The item index.\n * @returns The item rendered content.\n */\n protected _renderItem(props: RenderableProps

    , item: Item, index: number): ComponentChildren {\n const {beforeRenderItem} = props;\n if (beforeRenderItem) {\n const result = beforeRenderItem.call(this, item, index);\n if (result !== undefined) {\n item = result;\n }\n }\n\n const {type} = item;\n let {itemRender} = props;\n if (itemRender && typeof itemRender === 'object') {\n itemRender = itemRender[type!];\n }\n if (itemRender) {\n const customResult = itemRender.call(this, item, index);\n if (customResult !== undefined) {\n return ;\n }\n }\n\n const {ItemComponents} = this.constructor;\n let ItemComponent = ItemComponents[type!];\n if (!ItemComponent && item.component) {\n return ;\n }\n ItemComponent = ItemComponent || ItemComponents.default || HElement;\n if (Array.isArray(ItemComponent)) {\n let defaultItemProps = ItemComponent[1];\n if (typeof defaultItemProps === 'function') {\n defaultItemProps = defaultItemProps.call(this as CommonList, item, props);\n }\n item = mergeProps({}, defaultItemProps, item);\n ItemComponent = ItemComponent[0];\n }\n return ;\n }\n\n /**\n * Get the rendered item final properties.\n *\n * @param props Current list properties.\n * @param item The item to render.\n * @param index The item index.\n * @returns The item to rendered, if return false, the item will not be rendered.\n */\n protected _getItem(props: RenderableProps

    , item: Item, index: number): Item | false {\n if (!item) {\n return false;\n }\n const {itemProps, itemPropsMap = {}, getItem, itemKey} = props;\n const {type = this.constructor.defaultItemType} = item;\n const {name, itemName} = this;\n const {defaultItemProps = {}, defaultItemPropsMap = {}} = this.constructor;\n\n item = mergeProps(\n {type},\n defaultItemProps,\n defaultItemPropsMap[type],\n itemProps,\n itemPropsMap[type],\n {className: [name ? `${name}-${type}` : '', itemName]},\n item,\n {\n _item: item,\n _index: index,\n key: String((itemKey ? item[itemKey] : item.key) ?? (item.key ?? index)),\n onClick: undefined,\n },\n );\n\n if (getItem) {\n const result = getItem.call(this, item, index);\n if (result !== undefined) {\n return result;\n }\n }\n return item;\n }\n\n protected _getProps(props: RenderableProps

    ): Record {\n const finalProps = super._getProps(props);\n return {onClick: this._handleClick, ...finalProps};\n }\n\n /**\n * Get the list root element classname list.\n *\n * @param props Current list properties.\n * @returns The list root element classname list.\n */\n protected _getClassName(props: RenderableProps

    ): ClassNameLike {\n return [this.name, props.className];\n }\n\n /**\n * Get final rendered item list.\n *\n * @param props Current list properties.\n * @returns Item list.\n */\n protected _getItems(props: RenderableProps

    ): Item[] {\n let {items = []} = props;\n if (typeof items === 'function') {\n items = items.call(this);\n } else if (!Array.isArray(items)) {\n items = [];\n }\n const {getItems} = props;\n if (getItems) {\n const result = getItems.call(this, items as Item[]);\n if (result !== undefined) {\n return result;\n }\n }\n return items as Item[];\n }\n\n /**\n * Render items.\n *\n * @param props props Current list properties.\n * @param items Render items.\n * @returns React render children.\n */\n protected _renderItems(props: RenderableProps

    , items: Item[]): ComponentChild[] {\n this._renderedItems = items.map((item, index) => {\n const finalItem = this._getItem(props, item, index);\n return finalItem ? finalItem : undefined;\n }) as Item[];\n return this._renderedItems.reduce((children, item, index) => {\n if (item) {\n children.push(this._renderItem(props, item, index));\n }\n return children;\n }, []);\n }\n\n /**\n * Get root element rendered children.\n *\n * @param props Current list properties.\n * @returns React render children.\n */\n protected _getChildren(props: RenderableProps

    ): ComponentChildren {\n const items = this._getItems(props);\n this._items = items;\n const children = this._renderItems(props, items);\n if (props.children) {\n children.push(props.children);\n }\n return children;\n }\n\n /**\n * Get root element rendered component type.\n *\n * @param props Current list properties.\n * @returns React component type.\n */\n protected _getComponent(props: RenderableProps

    ): ComponentType | keyof JSX.IntrinsicElements {\n return props.component || (this.constructor.TAG as keyof JSX.IntrinsicElements);\n }\n}\n","import {ComponentFromReact} from '@zui/core';\nimport {CommonList as CommonListReact} from '../component';\n\nimport type {CommonListProps} from '../types';\n\nexport class CommonList extends ComponentFromReact {\n static NAME = 'CommonList';\n\n static Component = CommonListReact;\n\n static replace = CommonListReact.TAG;\n}\n\nCommonList.register();\n","import {registerReactComponent} from '@zui/core';\nimport * as components from './index';\n\nregisterReactComponent(components);\n","export type RGBColor = [r: number, g: number, b: number];\n\nexport function hex2Rgb(hex: string): RGBColor {\n if (hex.indexOf('#') === 0) {\n hex = hex.slice(1);\n }\n // convert 3-digit hex to 6-digits.\n if (hex.length === 3) {\n hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];\n }\n if (hex.length !== 6) {\n throw new Error(`Invalid HEX color \"${hex}\".`);\n }\n return [\n parseInt(hex.slice(0, 2), 16), // r\n parseInt(hex.slice(2, 4), 16), // g\n parseInt(hex.slice(4, 6), 16), // b\n ];\n}\n\nexport function isLightColor(color: string | RGBColor): boolean {\n const [r, g, b] = typeof color === 'string' ? hex2Rgb(color) : color;\n return (r * 0.299 + g * 0.587 + b * 0.114) > 186;\n}\n\nexport function contrastColor(color: string | RGBColor, options?: {dark: string, light: string}) {\n return isLightColor(color) ? (options?.dark ?? '#333333') : (options?.light ?? '#ffffff');\n}\n\nfunction clamp(value: number, max = 255): number {\n return Math.min(Math.max(value, 0), max);\n}\n\nexport function hslToRgb(h: number, s: number, l: number): RGBColor {\n h = (h % 360) / 360;\n s = clamp(s);\n l = clamp(l);\n\n const m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n const m1 = l * 2 - m2;\n\n const hue = (value: number): number => {\n value = value < 0 ? value + 1 : (value > 1 ? value - 1 : value);\n if (value * 6 < 1) {\n return m1 + (m2 - m1) * value * 6;\n } else if (value * 2 < 1) {\n return m2;\n } else if (value * 3 < 2) {\n return m1 + (m2 - m1) * (2 / 3 - value) * 6;\n } else {\n return m1;\n }\n };\n\n return [\n hue(h + 1 / 3) * 255,\n hue(h) * 255,\n hue(h - 1 / 3) * 255,\n ];\n}\n","export function getUniqueCode(str: string): number {\n let code = 0;\n if (typeof str !== 'string') str = String(str);\n if (str && str.length) {\n for (let i = 0; i < str.length; ++i) {\n code += (i + 1) * str.charCodeAt(i);\n }\n }\n return code;\n}\n","import {Component, ComponentChildren, JSX} from 'preact';\nimport {classes, Icon} from '@zui/core';\nimport {contrastColor, hslToRgb} from '@zui/helpers/src/color-helper';\nimport {getUniqueCode} from '@zui/helpers/src/string-code';\nimport {AvatarOptions} from '../types/';\n\nfunction getAvatarText(text: string, maxTextLength: number) {\n if (/^[\\u4e00-\\u9fa5\\s]+$/.test(text)) {\n return text.length <= maxTextLength ? text : text.substring(text.length - maxTextLength);\n }\n if (/^[A-Za-z\\d\\s]+$/.test(text)) {\n return text[0].toUpperCase();\n }\n return text.length <= maxTextLength ? text : text.substring(0, maxTextLength);\n}\n\nexport class Avatar extends Component {\n render() {\n const {\n className,\n style,\n size = '',\n circle,\n rounded,\n background,\n foreColor,\n icon,\n text,\n code,\n maxTextLength = 2,\n src,\n hueDistance = 43,\n saturation = 0.4,\n lightness = 0.6,\n children,\n ...others\n } = this.props;\n\n const finalClass = ['avatar', className];\n const finalStyle = {...style, background, color: foreColor};\n\n let actualSize = 32;\n if (size) {\n if (typeof size === 'number') {\n finalStyle.width = `${size}px`;\n finalStyle.height = `${size}px`;\n finalStyle.fontSize = `${Math.max(12, Math.round(size / 2))}px`;\n actualSize = size;\n } else {\n finalClass.push(`size-${size}`);\n actualSize = ({xs: 20, sm: 24, lg: 48, xl: 80})[size];\n }\n }\n if (circle) {\n finalClass.push('circle');\n } else if (rounded) {\n if (typeof rounded === 'number') {\n finalStyle.borderRadius = `${rounded}px`;\n } else {\n finalClass.push(`rounded-${rounded}`);\n }\n }\n\n let content: ComponentChildren | undefined;\n if (src) {\n finalClass.push('has-img');\n content = {text};\n } else if (icon) {\n finalClass.push('has-icon');\n content = ;\n } else if (text?.length) {\n const displayText = getAvatarText(text, maxTextLength);\n const displayTextLength = displayText.length;\n finalClass.push('has-text', `has-text-${displayTextLength}`);\n\n if (background === undefined) {\n const avatarCode = code ?? text;\n const hue = (typeof avatarCode === 'number' ? avatarCode : getUniqueCode(avatarCode)) * hueDistance % 360;\n finalStyle.background = `hsl(${hue},${saturation * 100}%,${lightness * 100}%)`;\n if (!foreColor) {\n const rgb = hslToRgb(hue, saturation, lightness);\n finalStyle.color = contrastColor(rgb);\n }\n } else if (!foreColor && background) {\n finalStyle.color = contrastColor(background);\n }\n let textStyle: JSX.CSSProperties | undefined;\n if (actualSize && actualSize < (16 * displayTextLength)) {\n textStyle = {transform: `scale(${actualSize / (16 * displayTextLength)})`, whiteSpace: 'nowrap'};\n }\n\n content =

    {displayText}
    ;\n }\n\n return (\n \n {content}\n {children}\n \n );\n }\n}\n","import {$, mergeProps, removeUndefinedProps} from '@zui/core';\nimport {Button} from '@zui/button/src/component';\nimport {CommonList} from '@zui/common-list/src/component';\n\nimport type {RenderableProps} from 'preact';\nimport type {ButtonProps} from '@zui/button';\nimport type {Item} from '@zui/common-list';\nimport type {BtnGroupOptions} from '../types';\n\nexport class BtnGroup extends CommonList {\n static NAME = 'btn-group';\n\n /**\n * Root element default tag name, used for DOM rendering.\n */\n static TAG = 'nav';\n\n static ItemComponents = {\n ...CommonList.ItemComponents,\n default: Button,\n };\n\n /**\n * Item default common props, used for rendering for all item types.\n */\n static defaultItemProps: Partial = {\n component: undefined,\n };\n\n protected _shareBtnProps?: Partial;\n\n protected _isBtnType({type}: Item): boolean {\n return type === 'item' || type === 'dropdown';\n }\n\n protected _getItem(props: RenderableProps, item: Item, index: number): false | Item {\n if (!item) {\n return false;\n }\n if (!item.type) {\n item = $.extend({type: (item.dropdown || item.items) ? 'dropdown' : 'item'}, item);\n }\n let itemProps = super._getItem(props, item, index);\n if (!itemProps) {\n return itemProps;\n }\n if (this._isBtnType(itemProps)) {\n itemProps = mergeProps({}, this._shareBtnProps, itemProps);\n }\n return itemProps;\n }\n\n protected _beforeRender(props: RenderableProps): void | RenderableProps | undefined {\n const {btnProps, btnType, size} = props;\n\n this._shareBtnProps = mergeProps({}, btnProps, removeUndefinedProps({btnType, size}));\n }\n}\n","import {classes, $, mergeProps} from '@zui/core';\nimport {BtnGroup} from '@zui/btn-group/src/component/btn-group';\n\nimport type {Item} from '@zui/common-list';\nimport type {ToolbarOptions, ToolbarSetting} from '../types';\nimport type {ClassNameLike} from '@zui/core/src/helpers';\nimport type {Attributes, RenderableProps} from 'preact';\n\nexport class Toolbar extends BtnGroup {\n static NAME = 'toolbar';\n\n static defaultProps: Partial = {\n btnProps: {\n btnType: 'ghost',\n },\n };\n\n static ItemComponents = {\n ...BtnGroup.ItemComponents,\n btnGroup: BtnGroup,\n 'btn-group': BtnGroup,\n };\n\n protected _getProps(props: RenderableProps): Record {\n const {gap} = props;\n const propsMap = super._getProps(props);\n if (gap) {\n if (typeof gap === 'number') {\n propsMap.className = classes(propsMap.className as ClassNameLike, `gap-${gap}`);\n } else {\n propsMap.style = $.extend(propsMap.style || {}, {gap: gap});\n }\n }\n return propsMap;\n }\n\n protected _getItem(props: RenderableProps, item: Item, index: number): false | Item {\n const itemProps = super._getItem(props, item, index);\n if (!itemProps) {\n return itemProps;\n }\n const {type} = itemProps;\n const isBtnGroup = type === 'btn-group' || type === 'btnGroup';\n if (isBtnGroup) {\n itemProps.btnProps = mergeProps({}, this._shareBtnProps, itemProps.btnProps);\n }\n if ((isBtnGroup || type === 'dropdown') && !itemProps.relativeTarget) {\n itemProps.relativeTarget = props.relativeTarget;\n }\n return itemProps;\n }\n\n static render(this: unknown, setting: ToolbarSetting | undefined, args: T, defaultProps?: Partial & Attributes, thisObject?: unknown) {\n let toolbarOptions = typeof setting === 'function' ? setting.call(thisObject ?? this, ...args) : setting;\n if (!toolbarOptions) {\n return;\n }\n if (Array.isArray(toolbarOptions)) {\n toolbarOptions = {\n items: toolbarOptions,\n };\n }\n if (defaultProps) {\n toolbarOptions = mergeProps(defaultProps as Record, toolbarOptions);\n }\n return ;\n }\n}\n","import {CustomContent, HElement} from '@zui/core';\n\nimport type {ClassNameLike} from '@zui/core';\nimport type {ComponentChildren, RenderableProps} from 'preact';\nimport type {CheckboxProps, CheckboxState} from '../types';\n\nexport class Checkbox

    extends HElement {\n protected _controlled: boolean;\n\n constructor(props: P) {\n super(props);\n this.state = {\n checked: props.checked ?? props.defaultChecked ?? false,\n };\n this._controlled = props.checked !== undefined;\n }\n\n get checked() {\n return this._controlled ? this.props.checked : this.state.checked;\n }\n\n protected _getClassName(props: RenderableProps

    ): ClassNameLike {\n const {disabled, type = 'checkbox'} = props;\n const {checked} = this;\n return [props.className, type === 'switch' ? type : `${type}-primary`, {\n disabled,\n checked: checked === true,\n indeterminate: checked === 'indeterminate',\n }];\n }\n\n protected _handleChange = (event: Event) => {\n const {onChange} = this.props;\n const checked = (event.target as HTMLInputElement).indeterminate ? 'indeterminate' : (event.target as HTMLInputElement).checked;\n if (onChange) {\n onChange.call(this, event, checked);\n }\n if (!this._controlled) {\n this.setState({checked});\n }\n };\n\n protected _getChildren(props: RenderableProps

    ): ComponentChildren {\n const {name, type, value, id, label} = props;\n const {checked} = this;\n return [\n name ? (\n \n ) : null,\n (),\n ];\n }\n}\n","import {RadioProps} from '../types';\nimport {Checkbox} from './checkbox';\n\nexport class Radio

    extends Checkbox

    {\n static defaultProps: Partial = {\n type: 'radio',\n };\n}\n","import {SwitchProps} from '../types';\nimport {Checkbox} from './checkbox';\n\nexport class Switch

    extends Checkbox

    {\n static defaultProps: Partial = {\n type: 'switch',\n };\n}\n","import {toChildArray} from 'preact';\nimport {CustomContent, HElement, Icon, classes, mergeProps} from '@zui/core';\nimport {Avatar} from '@zui/avatar/src/component';\nimport {Toolbar} from '@zui/toolbar/src/component';\nimport {Checkbox} from '@zui/checkbox/src/component';\n\nimport type {ComponentChild, ComponentChildren, ComponentType, JSX, RenderableProps} from 'preact';\nimport type {ListitemProps} from '../types';\n\nexport class Listitem

    extends HElement {\n protected _renderLeading(props: RenderableProps

    ): ComponentChild[] {\n const {\n icon,\n avatar,\n toggleIcon,\n leading,\n leadingClass,\n checked,\n checkbox,\n multiline,\n } = props;\n const contents: ComponentChild[] = [];\n if (toggleIcon) {\n contents.push();\n }\n if (checked !== undefined) {\n contents.push();\n }\n if (icon) {\n contents.push();\n }\n if (avatar) {\n const avatarProps = typeof avatar === 'function' ? avatar.call(this, props) : avatar;\n if (avatarProps) {\n avatarProps.className = classes('item-avatar', avatarProps.className);\n contents.push();\n }\n }\n const customLeading = leading ? : null;\n if (customLeading) {\n contents.push(customLeading);\n }\n if (multiline) {\n return contents.length ? [\n

    {contents}
    ,\n ] : [];\n }\n return contents;\n }\n\n protected _renderContent(props: RenderableProps

    , linkRendered?: boolean): ComponentChild[] {\n const {\n textClass,\n titleClass,\n titleAttrs,\n subtitle,\n subtitleClass,\n url,\n target,\n content,\n contentClass,\n contentAttrs,\n } = props;\n const titleAsLink = url && !linkRendered;\n const TitleComponent = titleAsLink ? 'a' : 'div';\n let {title, text} = props;\n if (title === undefined) {\n title = text;\n text = null;\n }\n return [\n

    \n {title ? : null}\n {subtitle ?
    : null}\n {text ?
    {text}
    : null}\n {content ? : null}\n
    ,\n ];\n }\n\n protected _renderTrailing(props: RenderableProps

    ): ComponentChild[] {\n const {\n multiline,\n trailing,\n trailingClass,\n trailingIcon,\n actions,\n } = props;\n const contents: ComponentChild[] = [];\n if (trailingIcon) {\n contents.push();\n }\n if (actions) {\n contents.push(Toolbar.render(actions, [props], {key: 'actions', relativeTarget: props, size: 'sm'}, this));\n }\n const customTrailing = trailing ? : null;\n if (customTrailing) {\n contents.push(customTrailing);\n }\n if (multiline) {\n return contents.length ? [\n

    {contents}{customTrailing}
    ,\n ] : [];\n }\n return contents;\n }\n\n protected _render(props: RenderableProps

    , extraAttrs?: Record): ComponentChild {\n const {\n innerComponent,\n innerClass,\n innerAttrs,\n url,\n actions,\n target,\n active,\n disabled,\n divider,\n checked,\n multiline,\n title,\n subtitle,\n hint,\n selected,\n } = props;\n const ComponentName = innerComponent || ((url && !actions) ? 'a' : 'div');\n const asLink = ComponentName === 'a';\n const attrs = mergeProps({\n key: 'item',\n title: hint,\n className: classes('listitem', innerClass, {\n active,\n disabled,\n 'has-divider': divider,\n selected,\n checked,\n multiline: multiline ?? !!(title && subtitle),\n state: asLink && !disabled,\n }),\n }, asLink ? {href: url || 'javascript:;', target} : null, extraAttrs, innerAttrs);\n return (\n \n {this._renderLeading(props)}\n {this._renderContent(props, asLink)}\n {this._renderTrailing(props)}\n \n );\n }\n\n protected _onRender(component: ComponentType | keyof JSX.IntrinsicElements, componentProps: Record, children: ComponentChildren, _props: RenderableProps

    ): void | [component: ComponentType | keyof JSX.IntrinsicElements, componentProps: Record, children: ComponentChildren] {\n const innerAttrs = Object.keys(componentProps).reduce>((attrs, key) => {\n if (key.startsWith('data-')) {\n attrs[key] = componentProps[key];\n delete componentProps[key];\n }\n return attrs;\n }, {});\n return [component, componentProps, [this._render(_props, innerAttrs), ...toChildArray(children)]];\n }\n}\n","import {$, Computed, HElement, classes, fetchData, mergeProps, removeUndefinedProps} from '@zui/core';\nimport {CommonList} from '@zui/common-list/src/component';\nimport {Listitem} from './listitem';\n\nimport type {ComponentChild, ComponentChildren, RenderableProps} from 'preact';\nimport type {ClassNameLike, CustomContentType} from '@zui/core';\nimport type {Item, ItemKey} from '@zui/common-list';\nimport type {CheckedType} from '@zui/checkbox';\nimport type {ListProps, ListState, ListItemsSetting, ListItemsFetcher} from '../types';\n\nexport class List

    extends CommonList {\n static ItemComponents: typeof CommonList.ItemComponents = {\n ...CommonList.ItemComponents,\n default: HElement,\n item: Listitem,\n heading: Listitem,\n };\n\n static NAME = 'list';\n\n protected _loadedSetting?: ListItemsSetting;\n\n protected declare _hasIcons: boolean;\n\n protected declare _hasCheckbox: boolean;\n\n protected _activeSet = new Computed>(() => {\n const map = new Set();\n const {active} = this.props;\n if (Array.isArray(active)) {\n active.forEach(x => map.add(x));\n } else if (typeof active === 'string') {\n map.add(active);\n } else if (active) {\n Object.keys(active).forEach(x => active[x] && map.add(x));\n }\n const {activeMap} = this.state;\n Object.keys(activeMap).forEach(x => activeMap[x] ? map.add(x) : map.delete(x));\n return map;\n }, () => [this.state.activeMap, this.props.active]);\n\n constructor(props: P) {\n super(props);\n this.state = {\n checked: {},\n activeMap: {},\n } as S;\n }\n\n get namespace() {\n return `.zui.${this.constructor.NAME}.list_${this.gid}`;\n }\n\n get isLazyItems() {\n const {items} = this.props;\n return items && !Array.isArray(items);\n }\n\n componentDidMount() {\n this._afterRender(true);\n this.tryLoad();\n\n if (this.props.activeOnHover && !this.props.multipleActive) {\n $(this.element).on(`mouseenter${this.namespace}`, '[z-item]', (event) => {\n const info = this._getItemFromEvent(event);\n if (info && info.renderedItem.type === 'item' && !info.renderedItem.disabled && !this.isActive(info.key)) {\n this.toggleActive(info.key, true);\n }\n });\n }\n }\n\n componentDidUpdate(): void {\n this._afterRender(false);\n this.tryLoad();\n }\n\n componentWillUnmount(): void {\n $(this.element).off(this.namespace);\n this.props.beforeDestroy?.call(this);\n }\n\n setItems(items?: Item[], error?: Error) {\n const {onLoadFail} = this.props;\n return this.changeState({\n loading: false,\n items: items || [],\n loadFailed: error ? (typeof onLoadFail === 'function' ? (onLoadFail as (error: Error) => CustomContentType | undefined).call(this, error as Error) : onLoadFail) || String(error) : undefined,\n } as S);\n }\n\n load(): void {\n const {items, onLoad} = this.props;\n this._loadedSetting = items;\n this.setState({loading: true, items: []}, async () => {\n try {\n const newItems = await fetchData(items as ListItemsFetcher, [this], {throws: true});\n this.setItems(onLoad?.call(this, newItems) || newItems);\n } catch (error) {\n this.setItems(undefined, error as Error);\n }\n });\n }\n\n tryLoad() {\n const {loading} = this.state;\n const {items} = this.props;\n if (loading || !items || Array.isArray(items) || items === this._loadedSetting) {\n return false;\n }\n this.load();\n return true;\n }\n\n isChecked(key: ItemKey, index?: number, defaultChecked: CheckedType = false): CheckedType {\n const item = (typeof index === 'number' ? this._items[index] : this.getItem(key)) || {};\n return this.state.checked[key] ?? item.checked ?? defaultChecked;\n }\n\n isAllChecked(): boolean {\n return this._renderedItems.every(({key}, index) => this.isChecked(key!, index) === true);\n }\n\n toggleAllChecked(checked?: boolean) {\n if (checked === undefined) {\n checked = !this.isAllChecked();\n }\n return this.toggleChecked(this._renderedItems.map(x => x.key!), checked);\n }\n\n async toggleChecked(keyOrChange: ItemKey | ItemKey[] | Record, checked?: boolean) {\n let change: Record;\n if (Array.isArray(keyOrChange)) {\n if (!keyOrChange.length) {\n return;\n }\n if (checked === undefined) {\n checked = !this.isChecked(keyOrChange[0]);\n }\n change = keyOrChange.reduce>((map, key) => {\n map[key] = checked!;\n return map;\n }, {});\n } else if (typeof keyOrChange === 'object') {\n change = keyOrChange;\n } else {\n const isChecked = this.isChecked(keyOrChange);\n if (checked === undefined) {\n checked = !isChecked;\n }\n change = {[keyOrChange]: checked!};\n }\n if (!Object.keys(change).length) {\n return;\n }\n\n await this.changeState(prevState => ({\n checked: {\n ...prevState.checked,\n ...change,\n },\n } as Partial), () => {\n const checkState = this.state.checked;\n this.props.onCheck?.call(this, change, Object.keys(checkState).filter(x => checkState[x] === true));\n });\n }\n\n getChecks() {\n return this._renderedItems.reduce((checks, {key}, index) => {\n if (key !== undefined && this.isChecked(key, index) === true) {\n checks.push(key);\n }\n return checks;\n }, []);\n }\n\n isActive(key: string | Item) {\n if (typeof key === 'object') {\n key = key.key!;\n }\n return this._activeSet.cache.has(key);\n }\n\n getActiveKeys() {\n return [...this._activeSet.value];\n }\n\n getActiveKey() {\n return this.getActiveKeys()[0];\n }\n\n async toggleActive(keys: string | string[], active?: boolean) {\n if (typeof keys === 'string') {\n keys = [keys];\n }\n if (!keys.length) {\n return;\n }\n active = active ?? !this.isActive(keys[0]);\n await this.changeState(prevState => {\n const activeMap = this.props.multipleActive ? (keys as string[]).reduce>((map, key) => {\n map[key] = active!;\n return map;\n }, {...prevState.activeMap}) : {[keys[0]]: active!};\n return {activeMap} as Partial;\n }, () => {\n this.props.onActive?.call(this, keys as string[], active!);\n });\n }\n\n getNextItem(key: string | undefined, condition?: (item: Item, index: number) => boolean, step = 1, items: Item[] | undefined = undefined): Item | undefined {\n items = items || this._renderedItems;\n const count = items.length;\n if (key === undefined) {\n return items[step ? 0 : count - 1];\n }\n let index = items.findIndex(x => x.key === key);\n if (index < 0 || count < 2) {\n return items[step ? 0 : count - 1];\n }\n let checkCount = 0;\n condition = condition || ((x) => x.type === 'item' && !x.disabled);\n while (checkCount < count) {\n index = (index + step + count) % count;\n const nextItem = items[index];\n if (nextItem && !nextItem.disabled && !nextItem.hidden && condition.call(this, nextItem, index)) {\n return nextItem;\n }\n checkCount++;\n }\n }\n\n getPrevItem(key: string | undefined, condition?: (item: Item, index: number) => boolean): Item | undefined {\n return this.getNextItem(key, condition, -1);\n }\n\n activeNext(condition?: (item: Item, index: number) => boolean, step = 1) {\n const nextItem = this.getNextItem(this.getActiveKey(), condition, step);\n if (nextItem) {\n this.toggleActive(nextItem.key!);\n }\n }\n\n activePrev(condition?: (item: Item, index: number) => boolean) {\n this.activeNext(condition, -1);\n }\n\n protected _afterRender(firstRender: boolean) {\n this.props.afterRender?.call(this, firstRender);\n }\n\n protected _beforeRender(props: RenderableProps

    ): void | RenderableProps

    | undefined {\n return this.props.beforeRender?.call(this, props);\n }\n\n protected _getItems(props: RenderableProps

    ): Item[] {\n const {items} = props;\n const {items: stateItems} = this.state;\n return stateItems || (Array.isArray(items) ? items : []);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected _getRenderedItem(props: RenderableProps

    , renderedItem: Item, index: number): Item {\n const {divider, multiline} = props;\n renderedItem = mergeProps({}, removeUndefinedProps({\n divider,\n multiline,\n }), renderedItem);\n\n const {itemName, name} = this;\n renderedItem.innerClass = [itemName ? `${itemName}-inner${name ? ` ${name}-${renderedItem.type}-inner` : ''}` : '', renderedItem.innerClass];\n\n if (renderedItem.type === 'item') {\n const {checkbox} = props;\n if (renderedItem.checkbox === false) {\n renderedItem.checked = undefined;\n } else if (checkbox || renderedItem.checkbox) {\n renderedItem.checked = this.isChecked(renderedItem.key!, index, renderedItem.checked as CheckedType);\n if (typeof checkbox === 'object' && renderedItem.checkbox !== false) {\n renderedItem.checkbox = renderedItem.checkbox ? $.extend({}, checkbox, renderedItem.checkbox) : checkbox;\n }\n if (props.selectOnChecked && renderedItem.checked === true) {\n renderedItem.selected = true;\n }\n }\n if (renderedItem.active === undefined && this.isActive(renderedItem)) {\n renderedItem.active = true;\n }\n }\n\n if (renderedItem.icon) {\n this._hasIcons = true;\n }\n if (renderedItem.checked !== undefined) {\n this._hasCheckbox = true;\n }\n\n return renderedItem;\n }\n\n protected _getItem(props: RenderableProps

    , item: Item, index: number): Item | false {\n const renderedItem = super._getItem(props, item, index);\n if (!renderedItem) {\n return renderedItem;\n }\n return this._getRenderedItem(props, renderedItem, index);\n }\n\n protected _renderItem(props: RenderableProps

    , item: Item, index: number): ComponentChildren {\n if (item.type === 'item' && this._hasIcons && item.icon === undefined) {\n item.icon = 'EMPTY';\n }\n return super._renderItem(props, item, index);\n }\n\n protected _handleClick(event: MouseEvent) {\n const info = super._handleClick(event);\n let {checkOnClick} = this.props;\n if (checkOnClick === 'any') {\n checkOnClick = '.item-checkbox,.item-content,.item-icon';\n } else if (checkOnClick === true) {\n checkOnClick = '.item-checkbox';\n }\n if (!checkOnClick || !info || !info.renderedItem) {\n return info;\n }\n const renderedItem = info.renderedItem;\n const itemCheckbox = renderedItem.checkbox;\n const hasCheckbox = itemCheckbox !== false && (this.props.checkbox || itemCheckbox || renderedItem.checked !== undefined);\n if (hasCheckbox && !renderedItem.disabled && info && (event.target as HTMLElement).closest(checkOnClick)) {\n this.toggleChecked(info.key);\n event.stopPropagation();\n return;\n }\n return info;\n }\n\n protected _getClassName(props: RenderableProps

    ): ClassNameLike {\n const {loading, loadFailed} = this.state;\n return [super._getClassName(props), loading ? 'loading' : (loadFailed ? 'is-load-failed' : '')];\n }\n\n protected _getProps(props: RenderableProps

    ): Record {\n const {className, ...others} = super._getProps(props);\n return {\n ...others,\n className: classes(className as ClassNameLike, this._hasIcons ? 'has-icons' : '', this._hasCheckbox ? 'has-checkbox' : ''),\n };\n }\n\n protected _getChildren(props: RenderableProps

    ): ComponentChildren {\n this._hasIcons = false;\n this._hasCheckbox = false;\n this._activeSet.compute();\n const children = super._getChildren(props) as ComponentChild[];\n const {loadFailed} = this.state;\n if (loadFailed) {\n children.push(loadFailed);\n }\n return children;\n }\n}\n","/** Store type. */\nexport type StoreType = 'local' | 'session';\n\nconst STR_PREFIX = '```ZUI_STR\\n';\n\n/**\n * Store for using localStorage and sessionStorage.\n */\nexport class Store {\n protected _type: StoreType;\n\n protected _name: string;\n\n protected _id: string;\n\n protected _storage: Storage;\n\n protected _altStorage?: Store;\n\n /**\n * Create new store instance.\n * @param id Store profile ID.\n * @param type Store type.\n */\n constructor(id: string = '', type: StoreType = 'local') {\n this._type = type;\n this._id = id;\n this._name = `ZUI_STORE:${this._id}`;\n this._storage = type === 'local' ? localStorage : sessionStorage;\n }\n\n /**\n * Get store type.\n */\n get type(): StoreType {\n return this._type;\n }\n\n /**\n * Get session type store instance.\n */\n get session(): Store {\n if (this.type === 'session') {\n return this;\n }\n if (!this._altStorage) {\n this._altStorage = new Store(this._id, 'session');\n }\n return this._altStorage;\n }\n\n protected _getKey(key: string): string {\n return `${this._name}:${key}`;\n }\n\n /**\n * Switch store profile.\n *\n * @param id Store profile ID.\n */\n switch(id: string) {\n this._id = id;\n this._name = `ZUI_STORE:${this._id}`;\n }\n\n /**\n * Get value from store.\n *\n * @param key Key to get\n * @returns Value of key or undefined if key is not found\n */\n get(key: string): T | undefined;\n\n /**\n * Get value from store, if key is not found, return defaultValue.\n *\n * @param key Key to get.\n * @param defaultValue Default value to return if key is not found.\n */\n get(key: string, defaultValue: T): T;\n\n /**\n * Get value from store.\n *\n * @param key Key to get.\n * @param defaultValue Default value to return if key is not found.\n * @returns Value of key or defaultValue if key is not found.\n */\n get(key: string, defaultValue?: T): T | undefined {\n const value = this._storage.getItem(this._getKey(key));\n if (typeof value === 'string') {\n if (value.startsWith(STR_PREFIX)) {\n return value.substring(STR_PREFIX.length) as T;\n }\n try {\n return JSON.parse(value);\n // eslint-disable-next-line no-empty\n } catch (_error) {}\n }\n return (value as T) ?? defaultValue;\n }\n\n /**\n * Set key-value pair in store.\n *\n * @param key Key to set.\n * @param value Value to set.\n */\n set(key: string, value: unknown): void {\n if (value === undefined || value === null) {\n return this.remove(key);\n }\n this._storage.setItem(this._getKey(key), typeof value === 'string' ? `${STR_PREFIX}${value}` : JSON.stringify(value));\n }\n\n /**\n * Remove key-value pair from store.\n *\n * @param key Key to remove.\n */\n remove(key: string): void {\n this._storage.removeItem(this._getKey(key));\n }\n\n /**\n * Iterate all key-value pairs in store.\n *\n * @param callback Callback function to call for each key-value pair in the store.\n */\n each(callback: (name: string, value: unknown) => void): void {\n for (let i = 0; i < this._storage.length; i++) {\n const key = this._storage.key(i);\n if (key?.startsWith(this._name)) {\n const value = this._storage.getItem(key);\n if (typeof value === 'string') {\n callback(key.substring(this._name.length + 1), JSON.parse(value));\n }\n }\n }\n }\n\n /**\n * Get all key values in store.\n *\n * @returns All key-value pairs in the store.\n */\n getAll(): Record {\n const result: Record = {};\n this.each((key, value) => {\n result[key] = value;\n });\n return result;\n }\n}\n","import {Store, StoreType} from './store';\n\nexport type {Store} from './store';\n\nexport const store = new Store('DEFAULT');\n\nfunction createStore(name?: string, type: StoreType = 'local') {\n return new Store(name, type);\n}\n\nObject.assign(store, {create: createStore});\n","import {Icon, classes, mergeProps, $, isValidElement} from '@zui/core';\nimport {store} from '@zui/store';\nimport {List} from './list';\nimport '@zui/css-icons/src/icons/caret.css';\n\nimport type {ComponentChild, ComponentChildren, RenderableProps} from 'preact';\nimport type {ClassNameLike} from '@zui/core';\nimport type {Item, ItemKey} from '@zui/common-list';\nimport type {CheckedType} from '@zui/checkbox';\nimport type {ListItemsSetting, NestedItem, NestedListProps, NestedListState} from '../types';\n\nexport type MouseEventInfo = {\n index: number;\n item: NestedItem;\n renderedItem: NestedItem;\n element: HTMLElement;\n target: HTMLElement;\n event: MouseEvent;\n key: ItemKey;\n parentKey?: ItemKey;\n hover?: boolean;\n keyPath: string;\n};\n\nexport type ItemInfo = {\n key: string;\n level: number;\n keyPath: string;\n parentKey?: string;\n parent?: ItemInfo;\n children: ItemInfo[];\n data: Item;\n};\n\nfunction forEachChild(item: ItemInfo, callback: (child: ItemInfo) => void) {\n const {children} = item;\n if (!children.length) {\n return;\n }\n children.forEach(child => {\n callback(child);\n forEachChild(child, callback);\n });\n}\n\nfunction forEachParent(item: ItemInfo, callback: (parent: ItemInfo) => void) {\n let parent = item.parent;\n while (parent) {\n callback(parent);\n parent = parent.parent;\n }\n}\n\nfunction parentKeys(keyPath: string) {\n return keyPath.split(':').reduce((keys, item, index) => {\n keys.push(index ? keys[index - 1] + ':' + item : item);\n return keys;\n }, []);\n}\n\n\nfunction reduceNestedItems(items: Item[], itemKey: string | undefined, reducer: (previousValue: T, info: ItemInfo) => T, initialValue: T, level = 0, parent?: ItemInfo): T {\n return items.reduce((currentValue, item, index) => {\n if (!item) {\n return currentValue;\n }\n const key = String((itemKey ? item[itemKey] : item.key) ?? (item.key ?? index));\n const keyPath = parent ? `${parent.keyPath}:${key}` : key;\n const itemInfo = {\n key,\n level,\n keyPath,\n parentKey: parent?.keyPath,\n parent: parent,\n data: item,\n children: [],\n };\n if (parent) {\n parent.children.push(itemInfo);\n }\n currentValue = reducer(currentValue, itemInfo);\n if (Array.isArray(item.items)) {\n return reduceNestedItems(item.items as Item[], itemKey, reducer, currentValue, level + 1, itemInfo);\n }\n return currentValue;\n }, initialValue);\n}\n\nexport class NestedList

    extends List {\n static defaultProps: Partial = {\n ...List.defaultProps,\n defaultNestedShow: false,\n level: 0,\n indent: 20,\n } as Partial;\n\n static inheritNestedProps = ['component', 'name', 'itemName', 'itemKey', 'indent', 'hover', 'divider', 'multiline', 'toggleIcons', 'nestedToggle', 'accordion', 'itemRender', 'itemProps', 'onToggle', 'checkbox', 'getItem', 'getItems', 'checkOnClick', 'selectOnChecked', 'checkedState', 'onClickItem', 'activeOnHover', 'multipleActive', 'onActive'];\n\n protected declare _hasNestedItems: boolean;\n\n protected declare _storeID: string;\n\n protected declare _renderedItemMap: Map;\n\n protected declare _itemMap?: Map;\n\n protected declare _itemMapCache: Map;\n\n protected declare _needInitChecks?: boolean;\n\n constructor(props: P) {\n super(props);\n const {defaultNestedShow, preserve, nestedShow} = props;\n $.extend(\n this.state,\n typeof defaultNestedShow === 'boolean' ? {defaultShow: defaultNestedShow, nestedShow: {}} : {nestedShow: defaultNestedShow || {}},\n nestedShow !== undefined ? {nestedShow} : null,\n );\n if (preserve && nestedShow === undefined) {\n this._storeID = `${this.constructor.NAME}:${preserve}:state`;\n const storeState = store.get(this._storeID) as NestedListState;\n if (storeState) {\n (this.state as NestedListState).nestedShow = storeState.nestedShow;\n }\n }\n\n if (!props.level) {\n const nestedState = this.state.nestedShow;\n if (nestedState) {\n Object.keys(nestedState).forEach(key => {\n if (!nestedState[key]) {\n return;\n }\n parentKeys(key).forEach(parentKey => {\n nestedState[parentKey] = true;\n });\n });\n }\n this._needInitChecks = true;\n }\n\n this._renderedItemMap = new Map();\n this._handleClick = this._handleClick.bind(this);\n this._beforeRenderNestedItem = this._beforeRenderNestedItem.bind(this);\n this._handleNestedToggle = this._handleNestedToggle.bind(this);\n this._handleNestedCheck = this._handleNestedCheck.bind(this);\n this._preserveState = this._preserveState.bind(this);\n }\n\n get isRoot() {\n return !this.props.level;\n }\n\n get nestedShow() {\n return this.props.nestedShow ?? this.state.nestedShow ?? false;\n }\n\n async setItems(items?: Item[] | undefined, error?: Error | undefined) {\n if (this.isRoot) {\n this._needInitChecks = true;\n }\n const state = await super.setItems(items, error);\n if (items && this.props.parent?.checked === true) {\n this.toggleChecked(this._renderedItems.map(x => x.key!), true);\n } else if (items?.some((x) => x.checked)) {\n this._needInitChecks = true;\n this.forceUpdate();\n }\n return state;\n }\n\n getItemMap(useCache?: boolean) {\n if (useCache && (this._itemMap || this._itemMapCache)) {\n return this._itemMap || this._itemMapCache;\n }\n if (!this._itemMap) {\n let needCheckRenderItems = false;\n const map: Map = reduceNestedItems(this._items, this.props.itemKey, (currentMap, info) => {\n currentMap.set(info.keyPath, info);\n if (info.data.items && !Array.isArray(info.data.items)) {\n needCheckRenderItems = true;\n }\n return currentMap;\n }, new Map());\n if (needCheckRenderItems) {\n this._renderedItemMap.forEach((item, keyPath) => {\n if (map.has(keyPath)) {\n return;\n }\n map.set(keyPath, {\n key: item.key,\n level: item._level,\n keyPath,\n parentKey: `${keyPath.split(':').slice(0, -1).join(':')}`,\n children: [],\n data: item,\n } as ItemInfo);\n });\n map.forEach((info) => {\n const {parentKey} = info;\n if (!parentKey) {\n return;\n }\n const parent = map.get(parentKey);\n if (parent) {\n parent.children.push(info);\n info.parent = parent;\n }\n });\n this._itemMapCache = map;\n return map;\n }\n this._itemMap = map;\n }\n return this._itemMap;\n }\n\n getRenderedItem(keyPath: string): Item | undefined {\n return this._renderedItemMap.get(keyPath);\n }\n\n getItem(keyPath: string) {\n const itemMap = this._itemMap || this._itemMapCache;\n if (itemMap) {\n return itemMap.get(keyPath)?.data;\n }\n const renderedItem = this.getRenderedItem(keyPath);\n return renderedItem ? (renderedItem._item as Item) : super.getItem(keyPath);\n }\n\n isExpanded(keyPath: string) {\n const {nestedShow} = this;\n if (typeof nestedShow === 'boolean') {\n return nestedShow;\n }\n return !!(nestedShow[keyPath] ?? this.state.defaultShow);\n }\n\n async toggle(keyPath: string, toggle?: boolean, reset?: boolean) {\n const isExpanded = this.isExpanded(keyPath);\n if (!reset && toggle === isExpanded) {\n return;\n }\n if (toggle === undefined) {\n toggle = !isExpanded;\n }\n const {nestedShow, onToggle, accordion} = this.props;\n if (onToggle && onToggle.call(this, keyPath, toggle, reset) === false) {\n return;\n }\n if (nestedShow !== undefined) {\n return;\n }\n await this.changeState(prevState => {\n let newNestedShow: Record = {\n ...(reset ? {} : prevState.nestedShow),\n [keyPath]: toggle!,\n };\n if (toggle && accordion) {\n let parentKey = `${keyPath.split(':').slice(0, -1).join(':')}`;\n if (parentKey.length) {\n parentKey += ':';\n }\n Object.keys(newNestedShow).forEach(key => {\n if (key !== keyPath && key.startsWith(parentKey)) {\n newNestedShow[key] = false;\n }\n });\n }\n newNestedShow = toggle ? parentKeys(keyPath).reduce>((map, key) => {\n map[key] = toggle!;\n return map;\n }, newNestedShow) : newNestedShow;\n return {\n nestedShow: newNestedShow,\n } as Partial;\n }, this._preserveState);\n }\n\n toggleAll(show: boolean) {\n if (this.props.nestedShow !== undefined) {\n return;\n }\n return this.setState({nestedShow: {}, defaultShow: show}, this._preserveState);\n }\n\n getChecks() {\n return Array.from(this.getItemMap(true).values()).reduce((checks, {keyPath, data}) => {\n const checkState = this.state.checked[keyPath];\n if ((checkState === true || (data.checked && checkState !== false)) === true) {\n checks.push(keyPath);\n }\n return checks;\n }, []);\n }\n\n isChecked(key: ItemKey, index?: number, defaultChecked: CheckedType = false): CheckedType {\n const item = (typeof index === 'number' ? this._items[index] : this.getItem(key)) || {};\n if (this.isRoot) {\n return this.state.checked[key] ?? (item.checked as CheckedType) ?? defaultChecked;\n }\n return this.props.checkedState![`${this.props.parentKey}:${key}`] ?? (item.checked as CheckedType) ?? defaultChecked;\n }\n\n async toggleChecked(keyOrChange: ItemKey | ItemKey[] | Record, checked?: CheckedType) {\n let change: Record;\n if (Array.isArray(keyOrChange)) {\n if (!keyOrChange.length) {\n return;\n }\n if (checked === undefined) {\n checked = !this.isChecked(keyOrChange[0]);\n }\n change = keyOrChange.reduce>((map, key) => {\n map[key] = checked!;\n return map;\n }, {});\n } else if (typeof keyOrChange === 'object') {\n change = keyOrChange;\n } else {\n if (checked === undefined) {\n checked = !this.isChecked(keyOrChange);\n }\n change = {[keyOrChange]: checked!};\n }\n if (!Object.keys(change).length) {\n return;\n }\n if (this.isRoot) {\n await this.changeState(({checked: prevChecked, nestedShow: preNestedShow}) => {\n const isChecked = (item: ItemInfo) => {\n return change[item.keyPath] ?? prevChecked[item.keyPath] ?? item.data.checked ?? false;\n };\n const map = this.getItemMap();\n const nestedShow: Record = {};\n const {expandChildrenOnCheck} = this.props;\n Object.keys(change).forEach(key => {\n checked = change[key];\n const item = map.get(key);\n if (!item) {\n return;\n }\n forEachChild(item, child => {\n if (isChecked(child) !== checked) {\n change[child.keyPath] = checked!;\n }\n });\n forEachParent(item, parent => {\n const {children} = parent;\n const checkedCount = children.reduce((count, child) => {\n if (isChecked(child)) {\n count++;\n }\n return count;\n }, 0);\n\n change[parent.keyPath] = checkedCount === children.length ? true : (checkedCount ? 'indeterminate' : false);\n });\n if (expandChildrenOnCheck && checked && item.data.items) {\n nestedShow[key] = true;\n }\n });\n return {\n checked: {\n ...prevChecked,\n ...change,\n },\n nestedShow: {\n ...preNestedShow,\n ...nestedShow,\n },\n } as Partial;\n }, () => {\n const checkState = this.state.checked;\n this.props.onCheck?.call(this, change, Object.keys(checkState).filter(x => checkState[x] === true));\n });\n return;\n }\n\n const {parentKey, onCheck} = this.props;\n const nestedChange = Object.keys(change).reduce>((map, key) => {\n map[`${parentKey !== undefined ? `${parentKey}:` : ''}${key}`] = change[key];\n return map;\n }, {});\n onCheck!.call(this, nestedChange, []);\n }\n\n getKeyPath(key: string) {\n if (this.isRoot) {\n return key;\n }\n const parentKey = this.props.parentKey!;\n if (!key.startsWith(parentKey + ':')) {\n return `${parentKey}:${key}`;\n }\n return key;\n }\n\n isActive(keyPath: string | Item) {\n if (typeof keyPath === 'object') {\n const keyOrKeyPath = (keyPath._keyPath ?? keyPath.key) as (string | undefined);\n if (keyOrKeyPath === undefined) {\n return false;\n }\n keyPath = keyOrKeyPath;\n }\n return this._activeSet.cache.has(this.getKeyPath(keyPath));\n }\n\n async toggleActive(keys: string | string[], active?: boolean) {\n if (typeof keys === 'string') {\n keys = [keys];\n }\n keys = keys.map(key => this.getKeyPath(key));\n if (this.isRoot) {\n await super.toggleActive(keys, active);\n if (this.props.toggleOnActive) {\n (keys as string[]).forEach(key => {\n if (this.isActive(key) && !this.isExpanded(key)) {\n this.toggle(key, true);\n }\n });\n }\n return;\n }\n\n this.props.onActive!.call(this, keys, active ?? !this.isActive(keys[0]));\n }\n\n activeNext(condition?: (item: Item, index: number) => boolean, step = 1) {\n const nextItem = this.getNextItem(this.getActiveKey(), condition, step);\n if (nextItem) {\n this.toggleActive(nextItem._keyPath as string);\n }\n }\n\n getNextItem(key: string | undefined, condition?: (item: Item, index: number) => boolean, step = 1, items: Item[] | undefined = undefined): Item | undefined {\n items = items || reduceNestedItems(this._items, this.props.itemKey, (list, info) => {\n if (info.data.disabled) {\n return list;\n }\n list.push({\n _keyPath: info.keyPath,\n type: 'item',\n ...info.data,\n ...this._renderedItemMap.get(info.keyPath),\n key: info.keyPath,\n });\n return list;\n }, []);\n return super.getNextItem(key, condition, step, items);\n }\n\n protected _afterRender(firstRender: boolean): void {\n super._afterRender(firstRender);\n if (this._needInitChecks) {\n const initChecks: Record = {};\n const itemMap = this.getItemMap();\n itemMap.forEach(item => {\n if (item.data.checked !== undefined) {\n initChecks[item.keyPath] = item.data.checked as CheckedType;\n }\n });\n this.toggleChecked(initChecks);\n this._needInitChecks = false;\n }\n }\n\n protected _preserveState() {\n if (this._storeID) {\n store.set(this._storeID, {nestedShow: this.state.nestedShow});\n }\n }\n\n protected _getClassName(props: RenderableProps

    ): ClassNameLike {\n return [super._getClassName(props), 'is-nested', props.level ? 'is-nested-sub' : 'is-nested-root'];\n }\n\n protected _getNestedProps(props: RenderableProps

    , items: ListItemsSetting, item: NestedItem, expanded: boolean): NestedListProps {\n const {\n parentKey,\n level = 0,\n } = props;\n const {isRoot} = this;\n return mergeProps(((this.constructor as typeof NestedList).inheritNestedProps.reduce>((propMap, key) => {\n propMap[key] = props[key as keyof P];\n return propMap;\n }, {})), {\n key: item.key,\n level: level + 1,\n className: `is-nested-${expanded ? 'expanded' : 'collapsed'}`,\n items,\n parent: item,\n parentKey: parentKey ? `${parentKey}:${item.key}` : item.key,\n nestedShow: this.nestedShow,\n defaultNestedShow: this.state.defaultShow,\n checkedState: props.checkedState || this.state.checked,\n onCheck: isRoot ? this._handleNestedCheck : props.onCheck,\n onToggle: isRoot ? this._handleNestedToggle : props.onToggle,\n beforeRenderItem: isRoot ? this._beforeRenderNestedItem : props.beforeRenderItem,\n active: isRoot ? this.getActiveKeys() : props.active,\n onActive: isRoot ? this.toggleActive.bind(this) : props.onActive,\n }, item.listProps);\n }\n\n protected _renderNestedList(props: RenderableProps

    , items: ListItemsSetting, item: NestedItem, expanded: boolean): ComponentChildren {\n if (!expanded && !props.renderCollapsedList) {\n return;\n }\n const nestedListProps = this._getNestedProps(props, items, item, expanded);\n const NestedListComponent = this.constructor as typeof NestedList;\n return ;\n }\n\n protected _renderNestedToggle(props: RenderableProps

    , isExpanded: boolean | undefined): ComponentChild {\n let toggleIcon: ComponentChild;\n let toggleClass = '';\n const {toggleIcons = {}} = props;\n if (typeof isExpanded === 'boolean') {\n toggleIcon = isExpanded ? (toggleIcons.expanded || ) : (toggleIcons.collapsed || );\n toggleClass = `state is-${isExpanded ? 'expanded' : 'collapsed'}`;\n if (!isValidElement(toggleIcon)) {\n toggleIcon = ;\n }\n } else {\n toggleIcon = ;\n toggleClass = 'is-empty';\n }\n return {toggleIcon};\n }\n\n protected _getItems(props: RenderableProps

    ): Item[] {\n const items = super._getItems(props);\n if (this.isRoot && items !== this._items) {\n this._itemMap = undefined;\n }\n return items;\n }\n\n protected _getItem(props: RenderableProps

    , item: NestedItem, index: number): NestedItem | false {\n const nestedItem = super._getItem(props, item, index) ?? item;\n if (!nestedItem) {\n return nestedItem;\n }\n const {parentKey} = props;\n const key = nestedItem.key!;\n const keyPath = `${parentKey !== undefined ? `${parentKey}:` : ''}${key}`;\n if (nestedItem.items) {\n const expanded = nestedItem.expanded ?? this.isExpanded(keyPath);\n mergeProps(nestedItem, {\n expanded: expanded,\n className: ['is-nested', `is-nested-${expanded ? 'show' : 'hide'}`],\n });\n this._hasNestedItems = true;\n }\n return mergeProps(nestedItem, {\n _level: props.level,\n _keyPath: keyPath,\n parentKey,\n });\n }\n\n protected _beforeRenderNestedItem(item: NestedItem, index: number): NestedItem | false {\n const {beforeRenderItem} = this.props;\n if (beforeRenderItem) {\n const result = beforeRenderItem.call(this, item, index);\n if (result !== undefined) {\n item = result;\n }\n }\n this._renderedItemMap.set(item._keyPath as string, item);\n return item;\n }\n\n protected _renderItem(props: RenderableProps

    , renderedItem: NestedItem, index: number): ComponentChildren {\n if ((this._hasNestedItems || !this.isRoot) && renderedItem.type === 'item' && renderedItem.toggleIcon === undefined) {\n renderedItem.toggleIcon = this._renderNestedToggle(props, renderedItem.expanded as boolean | undefined);\n }\n const nestedListContent = renderedItem.items ? this._renderNestedList(props, renderedItem.items, renderedItem, renderedItem.expanded as boolean) : null;\n renderedItem = mergeProps(renderedItem, {\n 'z-parent': renderedItem.parentKey,\n 'z-key-path': renderedItem._keyPath,\n }, nestedListContent ? {children: nestedListContent} : null);\n this._renderedItemMap.set(renderedItem._keyPath as string, renderedItem);\n return super._renderItem(props, renderedItem, index);\n }\n\n protected _getItemFromEvent(event: MouseEvent, target?: HTMLElement): MouseEventInfo | undefined {\n target = target || event.target as HTMLElement;\n let info = super._getItemFromEvent(event, target) as MouseEventInfo;\n if (!info) {\n const listEle = target.closest('[z-list]') as HTMLElement;\n if (listEle) {\n const listKey = listEle.getAttribute('z-list')!;\n const item = this.getItem(listKey);\n const renderedItem = this.getRenderedItem(listKey);\n if (!item || !renderedItem) {\n return;\n }\n info = {\n target,\n index: renderedItem._index as number,\n item,\n element: listEle,\n event,\n key: listKey,\n keyPath: listKey,\n renderedItem,\n };\n }\n return;\n }\n if (event.type === 'mouseenter' || event.type === 'mouseleave' || event.type === 'mouseover') {\n info.hover = event.type !== 'mouseleave';\n }\n const {parentKey} = this.props;\n return {...info, parentKey, keyPath: `${parentKey !== undefined ? `${parentKey}:` : ''}${info.key}`, target};\n }\n\n protected _handleNestedToggle(key: ItemKey, toggle: boolean, reset?: boolean) {\n this.toggle(key, toggle, reset);\n }\n\n protected _handleClick(event: MouseEvent) {\n const info = super._handleClick(event);\n if (info) {\n const {renderedItem: item, keyPath, target} = info as MouseEventInfo;\n const {nestedToggle} = this.props;\n if (!item.items || event.defaultPrevented || target.closest('.not-nested-toggle') || (nestedToggle && !item.disabled && !target.closest(nestedToggle)) || (!nestedToggle && !item.disabled && target.closest('a,.btn,.item-checkbox,.open-url,input,select,textarea') && !target.closest('.nested-toggle-icon,.item-icon'))) {\n return info;\n }\n this.toggle(keyPath);\n event.preventDefault();\n }\n return info;\n }\n\n protected _handleNestedCheck(change: Record) {\n this.toggleChecked(change);\n }\n\n protected _getProps(props: RenderableProps

    ): Record {\n const {level = 0, indent = 20, parentKey} = props;\n const finalProps = mergeProps(super._getProps(props), {\n 'z-level': level,\n 'z-list': parentKey,\n style: {'--list-nested-indent': `${level * indent}px`, '--list-indent': `${indent}px`},\n className: this._hasNestedItems ? 'has-nested-items' : 'no-nested-items',\n });\n finalProps.className = classes(finalProps.className as ClassNameLike);\n return finalProps;\n }\n\n protected _beforeRender(props: RenderableProps

    ): void | RenderableProps

    | undefined {\n this._renderedItemMap.clear();\n this._hasIcons = false;\n this._hasNestedItems = false;\n return super._beforeRender(props);\n }\n}\n","import {CustomContent, classes, mergeProps} from '@zui/core';\nimport {NestedList, Listitem} from '@zui/list/src/component';\n\nimport type {Attributes, ComponentChildren, RenderableProps} from 'preact';\nimport type {ClassNameLike} from '@zui/core';\nimport type {NestedListState} from '@zui/list';\nimport type {MenuOptions, MenuSetting} from '../types';\n\nexport class Menu extends NestedList {\n static NAME = 'menu';\n\n static TAG = 'menu';\n\n static inheritNestedProps = [...NestedList.inheritNestedProps, 'compact'];\n\n static ItemComponents: typeof NestedList.ItemComponents = {\n ...NestedList.ItemComponents,\n item: [Listitem, {innerComponent: 'a'}],\n };\n\n static defaultProps: Partial = {\n ...NestedList.defaultProps,\n scrollbarHover: true,\n };\n\n protected declare _hoverInfo?: {timer: number, keyPath?: string | null, shown?: boolean};\n\n constructor(props: T) {\n super(props);\n this._handleHover = this._handleHover.bind(this);\n }\n\n get isHoverTrigger() {\n return this.props.nestedTrigger === 'hover';\n }\n\n protected _getClassName(props: RenderableProps): ClassNameLike {\n return [super._getClassName(props), this._hasNestedItems ? 'menu-nested' : '', props.className, props.wrap ? {'scrollbar-thin': props.scrollbarThin, 'scrollbar-hover': props.scrollbarHover} : {popup: props.popup, compact: props.compact}];\n }\n\n protected _getWrapClass(props: RenderableProps): ClassNameLike {\n return ['menu-wrapper', props.wrapClass, {popup: props.popup, compact: props.compact}];\n }\n\n protected _getWrapperProps(props: RenderableProps): Record {\n const {wrapAttrs, height, maxHeight, parentKey} = props;\n const wrapProps = mergeProps(\n {'z-list-wrapper': parentKey},\n wrapAttrs,\n (height || maxHeight) ? {style: {height, maxHeight}} : null,\n this.isRoot && this.isHoverTrigger ? {\n onMouseEnter: this._handleHover,\n onMouseLeave: this._handleHover,\n onMouseOver: this._handleHover,\n } : null,\n );\n wrapProps.className = classes(this._getWrapClass(props), wrapProps.className as ClassNameLike);\n return wrapProps;\n }\n\n protected _renderWrapperHeader(props: RenderableProps): ComponentChildren {\n return ;\n }\n\n protected _renderWrapperFooter(props: RenderableProps): ComponentChildren {\n return ;\n }\n\n protected _handleHover(event: MouseEvent) {\n const target = event.target;\n if (!(target instanceof HTMLElement) || !this.isHoverTrigger) {\n return;\n }\n\n let keyPath: string | null | undefined;\n if (event.type !== 'mouseleave') {\n const itemEle = target.closest('[z-item]');\n if (itemEle) {\n keyPath = itemEle.getAttribute('z-key-path') as string;\n if (!itemEle.classList.contains('is-nested')) {\n keyPath = itemEle.getAttribute('z-parent') as string;\n }\n } else {\n const listEle = target.closest('[z-list-wrapper]');\n keyPath = listEle?.getAttribute('z-list-wrapper');\n }\n }\n\n const lastInfo = this._hoverInfo;\n const lastKeyPath = lastInfo?.keyPath;\n if (lastKeyPath === keyPath) {\n return;\n }\n if (lastInfo?.timer) {\n clearTimeout(lastInfo.timer);\n }\n const hasKey = typeof keyPath === 'string';\n const lastHasKey = typeof lastKeyPath === 'string';\n const delay = hasKey ? ((lastHasKey && lastInfo?.shown) ? 50 : 200) : (lastInfo?.shown ? 100 : 200);\n this._hoverInfo = {\n keyPath,\n timer: window.setTimeout(() => {\n if (hasKey) {\n this.toggle(keyPath!, true, true);\n this._hoverInfo!.shown = true;\n } else {\n this.toggleAll(false);\n this._hoverInfo = undefined;\n }\n }, delay),\n };\n }\n\n componentWillUnmount(): void {\n super.componentWillUnmount();\n const timer = this._hoverInfo?.timer;\n if (timer) {\n clearTimeout(timer);\n }\n }\n\n render(props: RenderableProps) {\n const menuView = super.render(props);\n if (props.wrap) {\n return (\n

    \n {this._renderWrapperHeader(props)}\n {menuView}\n {this._renderWrapperFooter(props)}\n \n );\n }\n return menuView;\n }\n\n static render(this: unknown, setting: MenuSetting | undefined, args: T, defaultProps?: Partial & Attributes, thisObject?: unknown) {\n let menuOptions = typeof setting === 'function' ? setting.call(thisObject ?? this, ...args) : setting;\n if (!menuOptions) {\n return;\n }\n if (Array.isArray(menuOptions)) {\n menuOptions = {\n items: menuOptions,\n };\n }\n if (defaultProps) {\n menuOptions = mergeProps(defaultProps as Record, menuOptions);\n }\n return ;\n }\n}\n","import {Component, createRef} from 'preact';\nimport {$, classes, getHotkeysMap, Icon, nextGid} from '@zui/core';\nimport '../style';\n\nimport type {ComponentChildren, RenderableProps} from 'preact';\nimport type {SearchBoxOptions, SearchBoxState} from '../types';\n\nexport class SearchBox extends Component {\n static defaultProps: Partial = {\n clearIcon: true,\n searchIcon: true,\n delay: 500,\n hotkeys: true,\n };\n\n protected _gid: string;\n\n protected _input = createRef();\n\n protected _timer = 0;\n\n protected _hotkeysScope?: string;\n\n constructor(props: SearchBoxOptions) {\n super(props);\n this.state = {focus: false, value: props.defaultValue || ''};\n this._gid = props.id || `search-box-${nextGid()}`;\n }\n\n componentDidMount(): void {\n const {hotkeys} = this.props;\n if (hotkeys) {\n const hotkeysMap = getHotkeysMap(hotkeys, {\n clear: {\n keys: 'Escape',\n handler: (event) => {\n this.clear(event);\n },\n },\n enter: {\n keys: 'Enter',\n handler: (event) => {\n this.props.onEnter?.(this.state.value, event);\n },\n },\n });\n if (hotkeysMap) {\n this._hotkeysScope = `SearchBox_${this._gid}`;\n $(this.input).hotkeys(hotkeysMap, {\n scope: this._hotkeysScope,\n event: 'keydown',\n });\n }\n }\n }\n\n componentWillUnmount(): void {\n if (this._hotkeysScope) {\n $(this.input).unbindHotkeys(this._hotkeysScope);\n }\n }\n\n get id() {\n return this._gid;\n }\n\n get input() {\n return this._input.current;\n }\n\n focus() {\n this.input?.focus();\n }\n\n blur() {\n this.input?.blur();\n }\n\n clear(event?: Event) {\n const oldValue = this.state.value;\n this.setState({value: ''}, () => {\n const {onChange, onClear} = this.props;\n onClear?.(event);\n this.focus();\n if (oldValue.trim() !== '') {\n onChange?.('', event);\n }\n });\n }\n\n _handleClearBtnClick = (event: MouseEvent) => {\n event.stopPropagation();\n this.clear(event);\n };\n\n _handleChange = (event: Event) => {\n const oldValue = this.state.value;\n const value = (event.target as HTMLInputElement).value;\n const {onChange, delay} = this.props;\n this.setState({value}, () => {\n if (!onChange || oldValue === value) {\n return;\n }\n if (delay) {\n this._clearTimer();\n this._timer = window.setTimeout(() => {\n onChange(value, event);\n this._timer = 0;\n }, delay);\n } else {\n onChange(value, event);\n }\n });\n };\n\n _handleFocus = (event: FocusEvent) => {\n const focus = event.type === 'focus';\n this.setState({focus}, () => {\n const callback = focus ? this.props.onFocus : this.props.onBlur;\n callback?.(event);\n });\n };\n\n _clearTimer() {\n if (this._timer) {\n clearTimeout(this._timer);\n }\n this._timer = 0;\n }\n\n render(props: RenderableProps, state: Readonly) {\n const {style, className, rootClass, rootStyle, readonly, disabled, circle, placeholder, mergeIcon, searchIcon, clearIcon, value: controlledValue, compact, prefixClass, suffixClass} = props;\n const {focus, value} = state;\n const {id} = this;\n const finalValue = controlledValue ?? value;\n const empty = typeof finalValue !== 'string' || !finalValue.trim().length;\n let prefixView: ComponentChildren;\n let suffixView: ComponentChildren;\n let searchIconView: ComponentChildren;\n if (searchIcon) {\n searchIconView = searchIcon === true ? : ;\n }\n if (!mergeIcon && searchIcon) {\n prefixView = ;\n }\n if (clearIcon && !empty) {\n suffixView = (\n \n {clearIcon === true ? : }\n \n );\n } else if (mergeIcon && searchIcon) {\n suffixView = searchIconView;\n }\n if (suffixView) {\n suffixView = (\n \n );\n }\n\n return (\n
    \n {prefixView}\n \n {suffixView}\n
    \n );\n }\n}\n","import {$, classes, mergeProps} from '@zui/core';\nimport {SearchBox} from '@zui/search-box/src/components';\nimport {Menu} from './menu';\n\nimport {type ComponentChild, type ComponentChildren, type RenderableProps} from 'preact';\nimport type {ClassNameLike} from '@zui/core';\nimport type {Item, ItemKey} from '@zui/common-list';\nimport type {ListItemsSetting, NestedItem, NestedListItem, NestedListProps} from '@zui/list';\nimport type {SearchBoxOptions} from '@zui/search-box';\nimport type {SearchMenuOptions, SearchMenuState} from '../types';\n\nexport class SearchMenu extends Menu {\n static inheritNestedProps = [...Menu.inheritNestedProps, 'isItemMatch', 'search', 'underlineKeys', 'nestedSearch'];\n\n static defaultProps: Partial = {\n ...Menu.defaultProps,\n defaultNestedShow: true,\n wrap: true,\n nestedSearch: true,\n underlineKeys: true,\n };\n\n protected declare _searchKeys: string[];\n\n protected declare _matchedParents: Set;\n\n protected declare _showCount: number;\n\n constructor(props: T) {\n super(props);\n (this.state as SearchMenuState).search = props.search ?? props.defaultSearch;\n this._searchKeys = (this.constructor as typeof SearchMenu).getSearchKeys(this.state.search);\n this._isNestedItemMatch = this._isNestedItemMatch.bind(this);\n }\n\n componentWillUpdate(nextProps: Readonly): void {\n if (this.isRoot) {\n if (nextProps.search !== undefined && nextProps.search !== this.props.search) {\n this._searchKeys = (this.constructor as typeof SearchMenu).getSearchKeys(nextProps.search);\n }\n }\n }\n\n componentDidMount(): void {\n super.componentDidMount();\n this._updateMatchedParents();\n }\n\n componentDidUpdate(): void {\n super.componentDidUpdate();\n this._updateMatchedParents();\n }\n\n isExpanded(keyPath: string): boolean {\n if (this.props.expandOnSearch && this._searchKeys.length) {\n return true;\n }\n return super.isExpanded(keyPath);\n }\n\n protected _updateMatchedParents(): void {\n if (!this.isRoot) {\n return;\n }\n const $element = $(this.element);\n const $matchedChildren = $element.find('.item.is-nested.is-not-match').filter((_, element) => this._matchedParents.has(element.getAttribute('z-key-path') || '')).addClass('has-match-child');\n $element.parent().toggleClass('no-match-child', !!this._searchKeys?.length && !$matchedChildren.length && !$element.children('.item').not('.is-not-match').length);\n }\n\n protected _handleSearchChange = (search: string) => {\n const searchKeys = (this.constructor as typeof SearchMenu).getSearchKeys(search);\n this._searchKeys = searchKeys;\n this.setState({search: searchKeys.join(' ')});\n };\n\n protected _isItemMatch(props: RenderableProps, item: NestedItem, index: number, parentKey: ItemKey | undefined) {\n const {isItemMatch, nestedSearch} = props;\n const isMatch = isItemMatch ? isItemMatch.call(this, item, this._searchKeys, index, parentKey) : (this.constructor as typeof SearchMenu).isItemMatch(item, this._searchKeys, props.searchProps);\n if ((nestedSearch && this.isRoot) && isMatch && parentKey !== undefined) {\n let key = '';\n String(parentKey).split(':').forEach(x => {\n key += `${key.length ? ':' : ''}${x}`;\n this._matchedParents.add(key);\n });\n }\n return isMatch;\n }\n\n protected _isNestedItemMatch(item: NestedItem, _searchKeys: string[], index: number, parentKey: ItemKey | undefined): boolean {\n return this._isItemMatch(this.props, item, index, parentKey);\n }\n\n protected _getNestedProps(props: RenderableProps, items: ListItemsSetting, item: NestedItem, expanded: boolean): NestedListProps {\n const nestedProps = super._getNestedProps(props, items, item, expanded) as SearchMenuOptions;\n if (this.isRoot && props.nestedSearch) {\n nestedProps.isItemMatch = this._isNestedItemMatch;\n nestedProps.search = this._searchKeys.join(' ');\n } else if (!props.nestedSearch) {\n mergeProps(nestedProps as Record, {search: undefined, defaultSearch: undefined}, item.listProps);\n }\n return nestedProps;\n }\n\n protected _getItem(props: RenderableProps, item: NestedItem, index: number): NestedItem | false {\n const finalItem = super._getItem(props, item, index);\n if (!finalItem) {\n return finalItem;\n }\n if (this.isRoot && this.props.limit && this._showCount >= this.props.limit) {\n return false;\n }\n finalItem.hidden = !this._isItemMatch(props, item, index, props.parentKey);\n if (!finalItem.hidden) {\n this._showCount++;\n }\n return finalItem;\n }\n\n protected _renderItem(props: RenderableProps, item: Item, index: number): ComponentChildren {\n item.className = [item.className, item.hidden ? 'is-not-match' : ''];\n if (props.underlineKeys && this._searchKeys.length) {\n ['text', 'title', 'subtitle', 'content'].forEach(key => {\n if (typeof item[key] === 'string') {\n item[key] = (this.constructor as typeof SearchMenu).underlineKeys(this._searchKeys, [item[key] as string]);\n }\n });\n }\n return super._renderItem(props, item, index);\n }\n\n protected _getWrapClass(props: RenderableProps): ClassNameLike {\n const isSearchMode = this.isRoot && this._searchKeys.length;\n return classes(super._getWrapClass(props), 'search-menu', props.searchBox ? `search-menu-on-${props.searchPlacement || 'top'}` : '', isSearchMode ? 'is-search-mode' : '', isSearchMode && props.expandOnSearch ? 'no-toggle-on-search' : '');\n }\n\n protected _getSearchBoxProps(props: RenderableProps): SearchBoxOptions {\n const {searchBox} = props;\n const searchOptions: SearchBoxOptions = {\n compact: true,\n className: 'not-nested-toggle',\n onChange: this._handleSearchChange,\n };\n if (typeof searchBox === 'object') {\n mergeProps(searchOptions, searchBox);\n }\n if (props.search !== undefined) {\n searchOptions.value = this._searchKeys.join(' ');\n searchOptions.disabled = true;\n }\n return searchOptions;\n }\n\n protected _renderSearchBox(props: RenderableProps): ComponentChildren {\n const searchBoxOptions = this._getSearchBoxProps(props);\n return ;\n }\n\n protected _renderWrapperHeader(props: RenderableProps): ComponentChildren {\n const hasHeader = props.header;\n const {noMatchHint, searchBox, searchPlacement, nestedSearch, headerClass} = props;\n const hasTopSearchBox = (!nestedSearch || this.isRoot) && searchBox && searchPlacement !== 'bottom';\n if (!hasHeader && !hasTopSearchBox && !noMatchHint) {\n return null;\n }\n return [\n noMatchHint ?
    {noMatchHint}
    : null,\n (hasHeader || hasTopSearchBox) ? (
    \n {hasHeader ? super._renderWrapperHeader(props) : null}\n {hasTopSearchBox ? this._renderSearchBox(props) : null}\n
    ) : null,\n ];\n }\n\n protected _renderWrapperFooter(props: RenderableProps): ComponentChildren {\n const hasFooter = props.footer;\n const {searchBox, searchPlacement, nestedSearch, footerClass} = props;\n const hasBottomSearchBox = (!nestedSearch || this.isRoot) && searchBox && searchPlacement === 'bottom';\n if (!hasFooter && !hasBottomSearchBox) {\n return null;\n }\n return (\n
    \n {hasFooter ? super._renderWrapperFooter(props) : null}\n {hasBottomSearchBox ? this._renderSearchBox(props) : null}\n
    \n );\n }\n\n protected _beforeRender(props: RenderableProps): void | RenderableProps | undefined {\n if (this.isRoot) {\n this._matchedParents = new Set();\n this._showCount = 0;\n }\n return super._beforeRender(props);\n }\n\n /**\n * Check whether item is matched.\n *\n * @param item Item to match.\n * @param searchKeys Search keys.\n * @returns Whether item is matched.\n */\n static isItemMatch(item: Item, searchKeys: string[], searchProps = ['keys', 'text', 'title', 'subtitle']) {\n if (!searchKeys.length) {\n return true;\n }\n return searchKeys.every(searchKey => searchProps.some(propName => {\n const propValue = item[propName];\n return typeof propValue === 'string' && propValue.length && propValue.toLowerCase().includes(searchKey);\n }));\n }\n\n /**\n * Convert search string to search keys.\n *\n * @param search Search string.\n * @returns Search keys array.\n */\n static getSearchKeys(search: string = ''): string[] {\n return $.unique((search).toLowerCase().split(' ').filter(x => x.length)) as string[];\n }\n\n static underlineKeys(searchKeys: string[], text: string[], className = 'is-match-keys'): ComponentChild[] {\n return searchKeys.reduce((result, key) => {\n return [...result].reduce((list, span) => {\n if (typeof span !== 'string') {\n list.push(span);\n return list;\n }\n const parts = span.toLowerCase().split(key);\n if (parts.length === 1) {\n list.push(span);\n return list;\n }\n let start = 0;\n parts.forEach((part, index) => {\n if (index) {\n list.push({span.substring(start, start + key.length)});\n start += key.length;\n }\n list.push(span.substring(start, start + part.length));\n start += part.length;\n });\n return list;\n }, []);\n }, text);\n }\n}\n","import {ComponentFromReact} from '@zui/core';\nimport {Menu as MenuReact} from '../component';\n\nimport type {MenuOptions} from '../types';\n\nexport class Menu extends ComponentFromReact> {\n static NAME = 'Menu';\n\n static Component = MenuReact;\n\n static replace = MenuReact.TAG;\n}\n","import {ComponentFromReact} from '@zui/core';\nimport {SearchMenu as MenuReact} from '../component';\n\nimport type {SearchMenuOptions} from '../types';\n\nexport class SearchMenu extends ComponentFromReact {\n static NAME = 'SearchMenu';\n\n static Component = MenuReact;\n\n static replace = MenuReact.TAG;\n}\n","import {registerReactComponent} from '@zui/core';\nimport * as components from './index';\n\nregisterReactComponent(components);\n","import {isValidElement, ComponentChildren} from 'preact';\nimport {classes, CustomContent, Icon} from '@zui/core';\nimport {Button} from '@zui/button/src/component/button';\nimport type {ButtonProps} from '@zui/button';\nimport '@zui/css-icons/src/icons/close.css';\nimport {AlertOptions} from '../types';\nimport {Toolbar} from '@zui/toolbar/src/component';\n\nexport function Alert({\n className,\n style,\n actions,\n heading,\n content,\n contentClass,\n children,\n close,\n onClose,\n icon,\n iconClass,\n ...others\n}: AlertOptions) {\n let closeButton: ComponentChildren;\n if (close === true) {\n closeButton = ;\n } else if (isValidElement(close)) {\n closeButton = close;\n } else if (typeof close === 'object') {\n closeButton =