diff --git a/dev/404.html b/dev/404.html index 903619a3ae..66c957ba78 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.B490h7TP.js b/dev/assets/guide_start_index.md.BgZBIJk1.js similarity index 94% rename from dev/assets/guide_start_index.md.B490h7TP.js rename to dev/assets/guide_start_index.md.BgZBIJk1.js index 10676d04a2..e263a7d30f 100644 --- a/dev/assets/guide_start_index.md.B490h7TP.js +++ b/dev/assets/guide_start_index.md.BgZBIJk1.js @@ -1,4 +1,4 @@ -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(`

下载后将如下文件解压到你的项目中:

text
zui/
+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),T=["href"],A=s("i",{class:"icon icon-github icon-lg"},null,-1),D=a(`

下载后将如下文件解压到你的项目中:

text
zui/
 ├── zui.css
 ├── zui.js
 └── zui.esm.js

下载后在页面中导入:

html
<!doctype html>
@@ -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),V=a('<html lang="zh-CN">',1),z=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"},j=a(' <link rel="stylesheet" href=',7),U={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),H=a(' <a class="btn" href="/">访问 ZUI 网站</a>',1),W={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),Q=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"=",-1),Y={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},G=a(' crossorigin="anonymous"></script>',6),K=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),qs={class:"shiki shiki-themes github-light github-dark vp-code"},Ps=a('<!doctype html>',1),Vs=a('<html lang="zh-CN">',1),zs=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"},js=a(' <link rel="stylesheet" href=',7),Us={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),Hs=a(' <a class="btn" href="/">访问 ZUI 网站</a>',1),Ws={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),Qs=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"=",-1),Ys={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},Gs=a(' crossorigin="anonymous"></script>',6),Ks=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>
+</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),V=a('<html lang="zh-CN">',1),z=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),R=a(' <title>ZUI</title>',1),w={class:"line highlighted"},Z=a(' <link rel="stylesheet" href=',7),U={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},j=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),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),H=a(' <a class="btn" href="/">访问 ZUI 网站</a>',1),L={class:"line highlighted"},W=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <",-1),$=s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"script",-1),G=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"}},K=a(' crossorigin="anonymous"></script>',6),Q=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),Ts=s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," src",-1),As=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),Vs=a('<html lang="zh-CN">',1),zs=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),Rs=a(' <title>ZUI</title>',1),ws={class:"line highlighted"},Zs=a(' <link rel="stylesheet" href=',7),Us={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},js=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),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),Hs=a(' <a class="btn" href="/">访问 ZUI 网站</a>',1),Ls={class:"line highlighted"},Ws=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <",-1),$s=s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"script",-1),Gs=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"}},Ks=a(' crossorigin="anonymous"></script>',6),Qs=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,19 +51,19 @@ 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"},[A,i(" 从 GitHub 下载")],8,T)]),D,s("div",m,[B,s("div",b,[s("div",v,[S,I,s("pre",q,[s("code",null,[P,i(` `),V,i(` `),z,i(` `),N,i(` `),f,i(` -`),w,i(` -`),s("span",R,[j,s("span",U,'"///cdn.jsdelivr.net/npm/zui/dist/'+l(t.zui.version)+'/zui.css"',1),x]),i(` -`),Z,i(` +`),R,i(` +`),s("span",w,[Z,s("span",U,'"///cdn.jsdelivr.net/npm/zui/dist/'+l(t.zui.version)+'/zui.css"',1),j]),i(` +`),x,i(` `),M,i(` `),J,i(` `),H,i(` -`),s("span",W,[$,L,O,Q,s("span",Y,'"///cdn.jsdelivr.net/npm/zui/dist/'+l(t.zui.version)+'/zui.js"',1),G]),i(` -`),K,i(` +`),s("span",L,[W,$,G,O,s("span",Y,'"///cdn.jsdelivr.net/npm/zui/dist/'+l(t.zui.version)+'/zui.js"',1),K]),i(` +`),Q,i(` `),X])])]),s("div",ss,[is,as,s("pre",ts,[s("code",null,[hs,i(` `),ns,i(` `),ls,i(` @@ -75,19 +75,19 @@ 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 `),os,i(` `),ys,i(` `),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(` +`),s("span",Fs,[us,Cs,Ts,As,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(` `),Vs,i(` `),zs,i(` `),Ns,i(` `),fs,i(` -`),ws,i(` -`),s("span",Rs,[js,s("span",Us,'"///unpkg.com/zui@'+l(t.zui.version)+'/zui.css"',1),xs]),i(` -`),Zs,i(` +`),Rs,i(` +`),s("span",ws,[Zs,s("span",Us,'"///unpkg.com/zui@'+l(t.zui.version)+'/zui.css"',1),js]),i(` +`),xs,i(` `),Ms,i(` `),Js,i(` `),Hs,i(` -`),s("span",Ws,[$s,Ls,Os,Qs,s("span",Ys,'"///unpkg.com/zui@'+l(t.zui.version)+'/zui.js"',1),Gs]),i(` -`),Ks,i(` +`),s("span",Ls,[Ws,$s,Gs,Os,s("span",Ys,'"///unpkg.com/zui@'+l(t.zui.version)+'/zui.js"',1),Ks]),i(` +`),Qs,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.B490h7TP.lean.js b/dev/assets/guide_start_index.md.BgZBIJk1.lean.js similarity index 83% rename from dev/assets/guide_start_index.md.B490h7TP.lean.js rename to dev/assets/guide_start_index.md.BgZBIJk1.lean.js index d2f58f3d06..42740ffef5 100644 --- a/dev/assets/guide_start_index.md.B490h7TP.lean.js +++ b/dev/assets/guide_start_index.md.BgZBIJk1.lean.js @@ -1,21 +1,21 @@ -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),V=a("",1),z=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"},j=a("",7),U={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),H=a("",1),W={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),Q=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"=",-1),Y={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},G=a("",6),K=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),qs={class:"shiki shiki-themes github-light github-dark vp-code"},Ps=a("",1),Vs=a("",1),zs=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"},js=a("",7),Us={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),Hs=a("",1),Ws={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),Qs=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}},"=",-1),Ys={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},Gs=a("",6),Ks=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(` +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),T=["href"],A=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),V=a("",1),z=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),R=a("",1),w={class:"line highlighted"},Z=a("",7),U={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},j=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),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),H=a("",1),L={class:"line highlighted"},W=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <",-1),$=s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"script",-1),G=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"}},K=a("",6),Q=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),Ts=s("span",{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"}}," src",-1),As=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),Vs=a("",1),zs=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),Rs=a("",1),ws={class:"line highlighted"},Zs=a("",7),Us={style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"}},js=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),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),Hs=a("",1),Ls={class:"line highlighted"},Ws=s("span",{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}}," <",-1),$s=s("span",{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"}},"script",-1),Gs=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"}},Ks=a("",6),Qs=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"},[A,i(" 从 GitHub 下载")],8,T)]),D,s("div",m,[B,s("div",b,[s("div",v,[S,I,s("pre",q,[s("code",null,[P,i(` `),V,i(` `),z,i(` `),N,i(` `),f,i(` -`),w,i(` -`),s("span",R,[j,s("span",U,'"///cdn.jsdelivr.net/npm/zui/dist/'+l(t.zui.version)+'/zui.css"',1),x]),i(` -`),Z,i(` +`),R,i(` +`),s("span",w,[Z,s("span",U,'"///cdn.jsdelivr.net/npm/zui/dist/'+l(t.zui.version)+'/zui.css"',1),j]),i(` +`),x,i(` `),M,i(` `),J,i(` `),H,i(` -`),s("span",W,[$,L,O,Q,s("span",Y,'"///cdn.jsdelivr.net/npm/zui/dist/'+l(t.zui.version)+'/zui.js"',1),G]),i(` -`),K,i(` +`),s("span",L,[W,$,G,O,s("span",Y,'"///cdn.jsdelivr.net/npm/zui/dist/'+l(t.zui.version)+'/zui.js"',1),K]),i(` +`),Q,i(` `),X])])]),s("div",ss,[is,as,s("pre",ts,[s("code",null,[hs,i(` `),ns,i(` `),ls,i(` @@ -27,19 +27,19 @@ 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 `),os,i(` `),ys,i(` `),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(` +`),s("span",Fs,[us,Cs,Ts,As,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(` `),Vs,i(` `),zs,i(` `),Ns,i(` `),fs,i(` -`),ws,i(` -`),s("span",Rs,[js,s("span",Us,'"///unpkg.com/zui@'+l(t.zui.version)+'/zui.css"',1),xs]),i(` -`),Zs,i(` +`),Rs,i(` +`),s("span",ws,[Zs,s("span",Us,'"///unpkg.com/zui@'+l(t.zui.version)+'/zui.css"',1),js]),i(` +`),xs,i(` `),Ms,i(` `),Js,i(` `),Hs,i(` -`),s("span",Ws,[$s,Ls,Os,Qs,s("span",Ys,'"///unpkg.com/zui@'+l(t.zui.version)+'/zui.js"',1),Gs]),i(` -`),Ks,i(` +`),s("span",Ls,[Ws,$s,Gs,Os,s("span",Ys,'"///unpkg.com/zui@'+l(t.zui.version)+'/zui.js"',1),Ks]),i(` +`),Qs,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 f14cf21a0c..78053d17ff 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 b3317fc311..7f9db5b656 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 8e3e77ec28..d130c59bf5 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 866253e684..54705da44c 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 6aa2c2da27..41546bef36 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 d397bd4eac..5601ad0e64 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 3065be4b72..e284b8f9cf 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 c78eda46b8..6096f12e29 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 6d2950ba25..69a91ef191 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 f13e2e5168..d19663034c 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 3bf4b56c0b..0196b07b87 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 800bc1272f..462246c173 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 5ddf7d7185..54a9c3a5db 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 37eba5bb67..c32482053b 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 77acdb100e..a25185bcf4 100644 --- a/dev/hashmap.json +++ b/dev/hashmap.json @@ -1 +1 @@ -{"guide_customize_exts-lib.md":"BKuxQGR7","guide_index.md":"t3LZT4QY","guide_start_intro.md":"DEIJsFre","guide_config_base_color.md":"B_i0YNBV","lib_helpers_store_index.md":"Bb0Q5VMq","utilities_layout_utilities_z-index.md":"DKY1uWyd","lib_components_tree_index.md":"Dn03SufJ","lib_components_upload-imgs_index.md":"erXa6IN9","utilities_layout_utilities_display.md":"DcXW9WtS","utilities_flex_utilities_gap.md":"DArM8pom","utilities_sizing_utilities_width.md":"DNXQWQFd","utilities_typography_utilities_leading.md":"DOlxRw-6","utilities_skin_utilities_outline.md":"bsC71Qhi","utilities_typography_utilities_word-break.md":"BxSlEVBy","lib_index.md":"Ci-MFpvh","utilities_interactivity_utilities_user-select.md":"BrNPbIfK","utilities_effects_utilities_animation.md":"B91izYvM","index.md":"0I4m7CHi","utilities_interactivity_utilities_scroll.md":"-0JODEPX","lib_basic_core_zui-create.md":"DLe7A4Hj","lib_basic_core_css-component.md":"BwdGvlia","lib_components_breadcrumb_index.md":"9pymY2C8","lib_basic_core_react.md":"BTwYD_hf","guide_customize_build.md":"BnMDMPqz","lib_components_color-picker_index.md":"TddEDwtA","lib_components_dashboard_index.md":"DRaM25zK","lib_components_btn-group_index.md":"5V7X7r4P","lib_components_contextmenu_index.md":"DmEkUwKC","lib_basic_core_component.md":"uPNn0zXQ","guide_start_compatibility.md":"CltyrLny","guide_config_base_shadow.md":"BNzZgBvC","guide_config_base_spacing.md":"B653NiFv","guide_config_base_font.md":"Ba4TxUmX","lib_components_kanban_index.md":"BFBze8B1","lib_components_menu_js.md":"CtCBsfaZ","lib_components_file-selector_index.md":"DvywDJ4t","lib_components_panel_index.md":"CoS14bNk","themes_index.md":"BufleTaf","lib_components_toolbar_js.md":"ih1Bb-Rr","utilities_layout_utilities_floats.md":"pUvtfQiw","lib_components_pager_js.md":"DDMQ9lXw","utilities_typography_utilities_line-clamp.md":"CvO9OG4z","utilities_borders_utilities_ring-width.md":"DzwqJDAb","utilities_borders_utilities_ring-color.md":"s0nb0vey","utilities_borders_utilities_border-radius.md":"Dh1Nfe3A","guide_customize_dev.md":"BHKWgm2m","utilities_interactivity_utilities_state.md":"0ZTXUBo7","utilities_skin_utilities_solid.md":"Cst9ctTO","utilities_effects_utilities_opacity.md":"BcIL05hy","utilities_flex_utilities_align-items.md":"CoFxBC8U","lib_forms_form-control_index.md":"BiHmr69s","lib_components_table_index.md":"Ck9c8Ek4","public_zui_icons_fontawesome-license.md":"gfk3cURr","utilities_borders_utilities_border-color.md":"YFsIdVzo","utilities_typography_utilities_list-style.md":"LuK8VgZf","utilities_interactivity_utilities_disabled.md":"CEB7Waub","lib_components_toolbar_index.md":"DvojQFd3","utilities_flex_utilities_direction.md":"ByjEgbMo","lib_components_search-box_index.md":"C6d4tMjv","lib_components_upload_index.md":"CzVklHlh","lib_components_scrollbar_index.md":"BjI3vUqu","utilities_skin_utilities_pale.md":"D1L1NRKs","lib_forms_input-control_index.md":"Cv0HAFHI","lib_helpers_helpers_date-helper.md":"8AhG85Op","utilities_flex_utilities_align-self.md":"FvSQ-0Fm","utilities_typography_utilities_text-transform.md":"CM7k043G","lib_components_progress_index.md":"CEtektTK","utilities_layout_utilities_aspect-ratio.md":"_oWsoIYV","lib_helpers_helpers_string-helper.md":"me2jtoF5","utilities_flex_utilities_align-content.md":"BXGtlw9g","utilities_flex_utilities_shrink.md":"CangfHwT","utilities_index.md":"CTpyUmIw","lib_forms_input-group_index.md":"BMbSYMAL","utilities_effects_utilities_filter.md":"BECjG4KT","utilities_spacing_utilities_space.md":"xgZHI4vS","utilities_flex_utilities_wrap.md":"DZ1moX26","lib_components_dtable_index.md":"BffsFMb4","lib_components_tooltip_index.md":"Co1ECN3g","utilities_layout_utilities_container.md":"Bb3Lxa_7","lib_forms_datetime-picker_time.md":"BTTIPCd8","utilities_layout_utilities_top-right-bottom-left.md":"C3lYdIa5","utilities_interactivity_utilities_cursor.md":"DvV2lotG","utilities_typography_utilities_vertical-align.md":"DiLQT3Ni","utilities_typography_utilities_whitespace.md":"BFKZWjDW","utilities_layout_utilities_visibility.md":"CKuADuoh","lib_components_progress-circle_index.md":"B0UUIqGM","lib_forms_datetime-picker_datetime.md":"CPkUUpoa","utilities_flex_utilities_order.md":"CfeTP7tL","utilities_effects_utilities_transition.md":"SqXrre1m","lib_forms_form_index.md":"sRq2u4jF","utilities_flex_utilities_grow.md":"Cn0nOehN","utilities_skin_utilities_ghost.md":"DIt2ElJv","utilities_skin_utilities_surface.md":"CN20jMqq","utilities_spacing_utilities_padding.md":"DuVwhAAe","utilities_borders_utilities_border-width.md":"DVKauZHZ","utilities_effects_utilities_shadow.md":"CaSFSOMl","utilities_interactivity_utilities_pointer-events.md":"EHN_kBvp","lib_forms_picker_index.md":"DRGaAh8C","utilities_borders_utilities_divider.md":"khTQtOjv","utilities_interactivity_utilities_loading.md":"Da_3FM-1","utilities_effects_utilities_transform.md":"DOI7WnD2","utilities_flex_utilities_basis.md":"CD8bfBkC","lib_forms_checkbox_switch.md":"QH8sYaT3","lib_components_pager_index.md":"D-bROEeS","utilities_sizing_utilities_height.md":"CdF7aUuw","lib_components_dropdown_index.md":"DbbvFq7u","utilities_flex_utilities_flex.md":"BlvjgLjv","utilities_backgrounds_utilities_index.md":"83vrBdjK","lib_components_tabs_index.md":"D-2YSS_0","utilities_typography_utilities_font-family.md":"BHWBVXg4","utilities_typography_utilities_text-align.md":"CtJ4rtrI","lib_forms_datetime-picker_date.md":"D59eL2rp","utilities_typography_utilities_font-size.md":"B3W8gyR3","utilities_typography_utilities_font-weight.md":"CV3nf15_","utilities_spacing_utilities_margin.md":"C9jBOzP9","utilities_borders_utilities_ring-offset.md":"DVb4azgP","utilities_layout_utilities_object-fit.md":"D4YmLxEC","utilities_layout_utilities_position.md":"rEqgc51a","utilities_typography_utilities_text-color.md":"D1fjRsa-","lib_forms_checkbox_index.md":"D_VspyHI","utilities_typography_utilities_text-overflow.md":"CCaD8PoB","utilities_layout_utilities_overflow.md":"DVHk2FQA","guide_config_base_rounded.md":"-jZtXV-b","guide_start_tutorial.md":"CmfMgriO","lib_components_avatar_index.md":"7j-ew9BZ","lib_components_alert_index.md":"Bep50ZBz","guide_config_base_screens.md":"CXV8MRfe","lib_components_label_index.md":"q76w0qb_","lib_components_messager_index.md":"BW-SbOyW","lib_components_dtable_plugins.md":"CrBZnIMk","lib_components_modal_index.md":"CgbVseyc","lib_components_modal_trigger.md":"BMBZZybJ","lib_basic_core_zui-on.md":"IjDbHIdO","lib_basic_core_zui-toggle.md":"D_sPxQQs","guide_start_index.md":"B490h7TP","utilities_typography_utilities_text-decoration.md":"BvY6hqYi","lib_basic_core_cash.md":"Bzo_CH3I","utilities_flex_utilities_justify-content.md":"D4BVZfVC","lib_components_nav_index.md":"LeXRijcV","lib_components_menu_index.md":"GncmWrZR","lib_components_nav_js.md":"OePgMXXa","lib_components_button_index.md":"B_1XMQuI","lib_components_avatar-group_index.md":"BqwB9RZP"} +{"lib_basic_core_cash.md":"Bzo_CH3I","guide_start_intro.md":"DEIJsFre","lib_components_dashboard_index.md":"DRaM25zK","lib_components_contextmenu_index.md":"DmEkUwKC","lib_components_alert_index.md":"Bep50ZBz","index.md":"0I4m7CHi","lib_basic_core_css-component.md":"BwdGvlia","lib_components_dtable_index.md":"BffsFMb4","lib_basic_core_zui-create.md":"DLe7A4Hj","guide_customize_dev.md":"BHKWgm2m","lib_components_dropdown_index.md":"DbbvFq7u","guide_index.md":"t3LZT4QY","guide_config_base_shadow.md":"BNzZgBvC","lib_basic_core_react.md":"BTwYD_hf","guide_start_index.md":"BgZBIJk1","guide_start_compatibility.md":"CltyrLny","lib_components_avatar-group_index.md":"BqwB9RZP","guide_config_base_spacing.md":"B653NiFv","lib_components_button_index.md":"B_1XMQuI","guide_config_base_screens.md":"CXV8MRfe","lib_components_breadcrumb_index.md":"9pymY2C8","lib_basic_core_zui-toggle.md":"D_sPxQQs","guide_customize_build.md":"BnMDMPqz","lib_components_avatar_index.md":"7j-ew9BZ","lib_components_color-picker_index.md":"TddEDwtA","lib_components_btn-group_index.md":"5V7X7r4P","lib_components_nav_index.md":"LeXRijcV","lib_components_panel_index.md":"CoS14bNk","lib_components_progress-circle_index.md":"B0UUIqGM","guide_config_base_color.md":"B_i0YNBV","lib_basic_core_component.md":"uPNn0zXQ","lib_components_pager_js.md":"DDMQ9lXw","guide_config_base_font.md":"Ba4TxUmX","lib_components_progress_index.md":"CEtektTK","lib_basic_core_zui-on.md":"IjDbHIdO","guide_config_base_rounded.md":"-jZtXV-b","guide_customize_exts-lib.md":"BKuxQGR7","lib_components_pager_index.md":"D-bROEeS","lib_components_toolbar_js.md":"ih1Bb-Rr","lib_components_messager_index.md":"BW-SbOyW","lib_components_toolbar_index.md":"DvojQFd3","lib_components_tabs_index.md":"D-2YSS_0","lib_components_tooltip_index.md":"Co1ECN3g","lib_components_upload-imgs_index.md":"erXa6IN9","lib_forms_datetime-picker_date.md":"D59eL2rp","lib_forms_datetime-picker_time.md":"BTTIPCd8","lib_components_upload_index.md":"CzVklHlh","lib_forms_datetime-picker_datetime.md":"CPkUUpoa","lib_components_label_index.md":"q76w0qb_","lib_components_kanban_index.md":"BFBze8B1","lib_forms_checkbox_index.md":"D_VspyHI","lib_components_modal_trigger.md":"BMBZZybJ","lib_components_file-selector_index.md":"DvywDJ4t","lib_components_modal_index.md":"CgbVseyc","lib_components_scrollbar_index.md":"BjI3vUqu","lib_helpers_helpers_string-helper.md":"me2jtoF5","lib_components_search-box_index.md":"C6d4tMjv","lib_components_nav_js.md":"OePgMXXa","guide_start_tutorial.md":"CmfMgriO","lib_forms_checkbox_switch.md":"QH8sYaT3","lib_components_menu_js.md":"CtCBsfaZ","lib_helpers_helpers_date-helper.md":"8AhG85Op","lib_forms_input-group_index.md":"BMbSYMAL","lib_forms_picker_index.md":"DRGaAh8C","lib_helpers_store_index.md":"Bb0Q5VMq","lib_index.md":"Ci-MFpvh","themes_index.md":"BufleTaf","public_zui_icons_fontawesome-license.md":"gfk3cURr","utilities_backgrounds_utilities_index.md":"83vrBdjK","utilities_borders_utilities_border-color.md":"YFsIdVzo","utilities_borders_utilities_divider.md":"khTQtOjv","utilities_borders_utilities_border-width.md":"DVKauZHZ","utilities_borders_utilities_ring-color.md":"s0nb0vey","lib_forms_form-control_index.md":"BiHmr69s","utilities_borders_utilities_ring-offset.md":"DVb4azgP","utilities_borders_utilities_ring-width.md":"DzwqJDAb","utilities_effects_utilities_animation.md":"B91izYvM","utilities_effects_utilities_opacity.md":"BcIL05hy","utilities_effects_utilities_filter.md":"BECjG4KT","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-items.md":"CoFxBC8U","utilities_flex_utilities_align-self.md":"FvSQ-0Fm","utilities_flex_utilities_basis.md":"CD8bfBkC","utilities_flex_utilities_direction.md":"ByjEgbMo","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_flex_utilities_wrap.md":"DZ1moX26","utilities_flex_utilities_shrink.md":"CangfHwT","utilities_index.md":"CTpyUmIw","lib_components_tree_index.md":"Dn03SufJ","utilities_interactivity_utilities_loading.md":"Da_3FM-1","utilities_interactivity_utilities_pointer-events.md":"EHN_kBvp","utilities_interactivity_utilities_cursor.md":"DvV2lotG","lib_components_table_index.md":"Ck9c8Ek4","utilities_interactivity_utilities_scroll.md":"-0JODEPX","utilities_interactivity_utilities_state.md":"0ZTXUBo7","utilities_interactivity_utilities_user-select.md":"BrNPbIfK","utilities_layout_utilities_container.md":"Bb3Lxa_7","utilities_layout_utilities_aspect-ratio.md":"_oWsoIYV","utilities_layout_utilities_display.md":"DcXW9WtS","utilities_interactivity_utilities_disabled.md":"CEB7Waub","utilities_layout_utilities_object-fit.md":"D4YmLxEC","utilities_layout_utilities_position.md":"rEqgc51a","utilities_layout_utilities_z-index.md":"DKY1uWyd","utilities_layout_utilities_top-right-bottom-left.md":"C3lYdIa5","utilities_layout_utilities_visibility.md":"CKuADuoh","utilities_layout_utilities_overflow.md":"DVHk2FQA","utilities_sizing_utilities_width.md":"DNXQWQFd","utilities_sizing_utilities_height.md":"CdF7aUuw","utilities_skin_utilities_ghost.md":"DIt2ElJv","utilities_skin_utilities_pale.md":"D1L1NRKs","utilities_skin_utilities_outline.md":"bsC71Qhi","utilities_skin_utilities_solid.md":"Cst9ctTO","utilities_skin_utilities_surface.md":"CN20jMqq","utilities_typography_utilities_font-size.md":"B3W8gyR3","utilities_spacing_utilities_padding.md":"DuVwhAAe","utilities_typography_utilities_line-clamp.md":"CvO9OG4z","utilities_typography_utilities_leading.md":"DOlxRw-6","utilities_typography_utilities_font-family.md":"BHWBVXg4","utilities_typography_utilities_font-weight.md":"CV3nf15_","utilities_spacing_utilities_space.md":"xgZHI4vS","utilities_typography_utilities_vertical-align.md":"DiLQT3Ni","utilities_typography_utilities_text-decoration.md":"BvY6hqYi","utilities_typography_utilities_text-color.md":"D1fjRsa-","utilities_typography_utilities_text-overflow.md":"CCaD8PoB","utilities_typography_utilities_word-break.md":"BxSlEVBy","utilities_typography_utilities_whitespace.md":"BFKZWjDW","utilities_spacing_utilities_margin.md":"C9jBOzP9","lib_components_menu_index.md":"GncmWrZR","utilities_typography_utilities_text-transform.md":"CM7k043G","utilities_flex_utilities_order.md":"CfeTP7tL","utilities_borders_utilities_border-radius.md":"Dh1Nfe3A","utilities_layout_utilities_floats.md":"pUvtfQiw","lib_components_dtable_plugins.md":"CrBZnIMk","utilities_typography_utilities_text-align.md":"CtJ4rtrI","utilities_typography_utilities_list-style.md":"LuK8VgZf","lib_forms_input-control_index.md":"Cv0HAFHI","lib_forms_form_index.md":"sRq2u4jF"} diff --git a/dev/index.html b/dev/index.html index 237dc4dbe5..d1334f1fe3 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 99dfb25d19..56882636c1 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 f5fe823cbd..b4bf394442 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 f3769e317c..adb8e75620 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)

- + \ No newline at end of file diff --git a/dev/lib/basic/core/react.html b/dev/lib/basic/core/react.html index d544bb5baf..3daa066362 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 99a69c9579..1b44e2dd51 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)

- + \ 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 5b61fd6ac5..2d48201598 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 fc13ec1b58..d681a42d97 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)

- +
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 ea748e4d0b..041ce3e4c8 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)

- +
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 2d7aa716bc..c1bac598bd 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)

- + \ No newline at end of file diff --git a/dev/lib/components/avatar/index.html b/dev/lib/components/avatar/index.html index 2b44ba95d5..251cb52fdd 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)

- + \ No newline at end of file diff --git a/dev/lib/components/breadcrumb/index.html b/dev/lib/components/breadcrumb/index.html index cdda1c661b..fdd56bc3ac 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 48dd302035..2b49cac8a4 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 3111f0a93d..ee42b6cb03 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)

- + \ 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 a5be65459b..acbd452f87 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)

- + \ No newline at end of file diff --git a/dev/lib/components/contextmenu/index.html b/dev/lib/components/contextmenu/index.html index 1460264671..fbfaa05ba1 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 ca371028a0..f969111a33 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 a321d44b07..d35fdccaa5 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 9622647cec..715e79f56e 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 30ae88a391..52a57647c0 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 9379589ca7..cc37f74d7c 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 15320a6da3..45968617e2 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 ac8dbca784..c770e576af 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 3663028840..8958632794 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 57873dc25a..059cab9598 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 54818df7bc..9827d811ac 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)

    - +
    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 566672dce7..2b7867302c 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)

    - +
    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 2b5f9df785..73280eeee6 100644 --- a/dev/lib/components/modal/trigger.html +++ b/dev/lib/components/modal/trigger.html @@ -14,18 +14,18 @@ - - + + -
    Skip to content

    对话框触发器

    对话框触发器允许你不需要书写静态对话框 HTML,直接使用触发按钮或者一行 JS 代码即可让一个全新的对话框展现。支持使用 Ajax 从远程获取内容,或者通过 iframe 加载任何页面内容,当然不使用远程内容,直接使用本地内容也是很方便。

    Ajax 对话框

    在对话框触发按钮上通过 data-url 属性指定远程内容的 URL 地址。

    Ajax 对话框支持手动通过 Modal.open 方法按需打开:

    js
    zui.Modal.open({
    +    
    Skip to content

    对话框触发器

    对话框触发器允许你不需要书写静态对话框 HTML,直接使用触发按钮或者一行 JS 代码即可让一个全新的对话框展现。支持使用 Ajax 从远程获取内容,或者通过 iframe 加载任何页面内容,当然不使用远程内容,直接使用本地内容也是很方便。

    Ajax 对话框

    在对话框触发按钮上通过 data-url 属性指定远程内容的 URL 地址。

    Ajax 对话框支持手动通过 Modal.open 方法按需打开:

    js
    zui.Modal.open({
         url: '/assets/modal/ajax-modal.html',
    -});

    iframe 对话框

    在对话框触发按钮上通过 data-type="iframe" 属性指定对话框类型为 iframe 对话框,然后通过 data-url 属性指定对话框内容页面地址。

    iframe 对话框支持手动通过 Modal.open 方法按需打开:

    js
    zui.Modal.open({
    +});

    iframe 对话框

    在对话框触发按钮上通过 data-type="iframe" 属性指定对话框类型为 iframe 对话框,然后通过 data-url 属性指定对话框内容页面地址。

    iframe 对话框支持手动通过 Modal.open 方法按需打开:

    js
    zui.Modal.open({
         type: 'iframe',
         url: '/assets/modal/iframe-modal.html',
    -});

    自定义信息提示弹窗

    在对话框触发按钮上通过 data-title 属性指定对话框标题,通过 data-content 属性指定对话框内容。

    iframe 对话框支持手动通过 Modal.open 方法按需打开:

    js
    zui.Modal.open({
    +});

    自定义信息提示弹窗

    在对话框触发按钮上通过 data-title 属性指定对话框标题,通过 data-content 属性指定对话框内容。

    iframe 对话框支持手动通过 Modal.open 方法按需打开:

    js
    zui.Modal.open({
         title: '自定义对话框',
         content: '这里是对话框内容',
     });

    系统对话框

    警告框

    通过 zui.Modal.alert() 方法可以打开一个警告框,该方法定义如下:

    ts
    /* 直接指定要提示的消息文本 */
    @@ -47,15 +47,15 @@
     
         /* 当点击提示按钮时的回调函数 */
         onClickAction?: (item: ToolbarItemOptions, modal: Modal) => false | void;
    -}

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

    下面为一个示例:

    确认框

    通过 Modal.confirm() 方法可以打开一个确认框,该方法定义如下:

    ts
    /* 直接指定要提示的消息文本 */
    +}

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

    下面为一个示例:

    确认框

    通过 Modal.confirm() 方法可以打开一个确认框,该方法定义如下:

    ts
    /* 直接指定要提示的消息文本 */
     Modal.confirm(message: string): Promise<string | undefined>;
     
     /* 通过一个选项对象定义个性化对话框 */
     Modal.confirm(options: ModalComfirmOptions): Promise<string | undefined>;

    其中参数定义如下:

    • message:要提示的消息文本;
    • options:一个警告框选项对象 ModalConfirmOptions,定义如下:
    ts
    interface ModalConfirmOptions extends ModalAlertOptions {
         /* 当用户点击确认或取消时的回调函数 */
         onResult?: (confirmed: boolean, modal: Modal) => void;
    -}

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

    下面为一个示例:

    MIT License (MIT)

    - +}

    该方法会通过 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 abc1deb3fd..5dbcf13090 100644 --- a/dev/lib/components/nav/index.html +++ b/dev/lib/components/nav/index.html @@ -14,17 +14,17 @@ - - + + -
    Skip to content

    导航

    基础用法

    使用组件类 .nav 来获得导航外观 通常搭配 <ul><menu><li> 标签来使用。

    带标题的导航

    可以通过 CSS 类 nav-heading 给导航项设置标题样式。

    html
    <menu class="nav">
    +    
    Skip to content

    导航

    基础用法

    使用组件类 .nav 来获得导航外观 通常搭配 <ul><menu><li> 标签来使用。

    带标题的导航

    可以通过 CSS 类 nav-heading 给导航项设置标题样式。

    html
    <menu class="nav">
       <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)

    - +</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 afd8404242..1b57e78577 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 dfbdc13348..1fa8779eb0 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 8fd0e72802..a8bb844dbc 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 cfb5978276..db31ca6fef 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 23ec0220ab..e03817ee0e 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 a698215cb3..b7032db738 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 61db1184b1..7362afa497 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)

    - +
    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 0138863f34..c0d2485a47 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 3d2cf1823a..c8064e5b53 100644 --- a/dev/lib/components/table/index.html +++ b/dev/lib/components/table/index.html @@ -14,16 +14,16 @@ - - + + -
    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">
    +    
    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)

    - +</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 5f3987d8be..57d159a11d 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)

    - +
    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 4ca42014ff..ff2a0a1197 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 a36a4c2baf..6aa993d41f 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 7c5a40cebc..fecee437ed 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 337161a0ff..a2ad35def9 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 63757c63e6..6f794a346d 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 f9f4656d6a..afd81ad579 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 097367b5e7..5db06b2dca 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 a74c7532ca..8d0efb9537 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 4e0908d7d7..d12c473b04 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 7051766039..11385aa33d 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 8fef8a7475..5c20e811c5 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)

    - + \ 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 cc626398b7..477f0f4cf0 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)

    - + \ No newline at end of file diff --git a/dev/lib/forms/form/index.html b/dev/lib/forms/form/index.html index 773e02e0d2..7c6d9b1169 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 70173055db..8e746bf0b2 100644 --- a/dev/lib/forms/input-control/index.html +++ b/dev/lib/forms/input-control/index.html @@ -14,8 +14,8 @@ - - + + @@ -26,7 +26,7 @@ <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 10f1547b36..f00957ff7e 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)

    - +
    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 da415a4f15..8abcaf43dd 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 4c35afdb77..2d8b9ece56 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 0470c5a783..d5c246924d 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;

    参数

    返回值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 530b04eb85..ca14c48bd8 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 83a9069c54..f175d2e87e 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 b398985558..85e26d194b 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 045c14a16b..d6fa27856b 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 4f75f0dda5..f9f43b915e 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 1a5c9ba90e..d5e91c13c5 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 0d83d610ea..ff621d3cae 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 763295d722..88bfe44fbe 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 4f6d838cac..ce44810e8b 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 c8a20a6ab4..ed7a787516 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 4956de3a0a..24356a80ec 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 0150f583ba..132ff1666f 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 37867b2a16..095137b065 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 6d8113c253..7c24d4431a 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 b0b36b3703..8aed9155d3 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 a552f2022b..69865c6551 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 e2c4d3a833..c18b62f5ce 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 a4fd262e5c..57138b27fd 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 1f34f2cdbc..051da7f428 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 f623cd22a2..1991bca8ad 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 c55423cf9d..1ff3d397f1 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 de23bb0a0c..b631e90b53 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 abd245fed2..8319445af7 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 eac8ab37e5..23a739d8ba 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 eead418d54..c375ca1d4f 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 78ea26ac3f..fd9a3b1e84 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 0f26c02e85..0b63ea0acd 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 c1a5909e5b..07c4c0dee3 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 495716b1a1..24135e1759 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 3576e4367b..cfd5bc61b0 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 9c35fdd81c..f6b6ad414e 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 8d23353ced..d8f5de51b7 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 51279c1943..f557419bdd 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 4ad6dbd0ba..b184798141 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 dd099c3c8f..56e2ff826f 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 06ef4cd2e1..985151ffe3 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 ab0ed55809..6f77b5307c 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)

    - +
    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 996ac33d13..61efbaf0c6 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)

    - +
    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 2224157f11..af1cba4755 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 286a84cac0..c1909a2db2 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)

    - +
    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 faa7c93da0..d1f61a38d8 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 8d49322aa5..6a5f85b190 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)

    - + \ 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 27a475452a..5e910057d8 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)

    - + \ No newline at end of file diff --git a/dev/utilities/layout/utilities/overflow.html b/dev/utilities/layout/utilities/overflow.html index 9c6795c69d..8962d6f976 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)

    - +
    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 5af4a8dbea..27b5a19c26 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 d1760a9044..665c0c568a 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 6a5cd13ff9..ab8b9dc532 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 e01a127fee..def0a4e696 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 6ce0670e76..9cb94d5a2f 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 deaabb928c..c72a49fb4b 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 db27c7a9d7..881a028b73 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)

    - +
    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 0f748fc9d7..29caef16c2 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)

    - +
    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 b140d15efa..bac65f3115 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)

    - +
    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 1b60b98249..b127b18efe 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)

    - +
    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 ab32c175c9..51212f5034 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)

    - +
    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 f70f5e53e1..f23d541f30 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)

    - +
    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 d52fad9330..1487426a20 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)

    - +
    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 7cfeaf65a5..9d6ab12759 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)

    - +
    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 341d7aed12..1b8f53ce27 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 442a9a3af6..42312e463e 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 3f5ecad20b..c58d47d7c3 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)

    - +
    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 23bf16539c..2960e5f841 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 5b56680529..68293d48ea 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 6edcebf297..56a738f63d 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 768a7eae84..a55426c9ac 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)

    - +
    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 63abdcd9ca..ae56760799 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 055b0ecf0b..21ece4891e 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)

    - +
    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 045a1f81bc..63476cedfc 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)

    - +
    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 8b3357ada7..baaf405a3d 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)

    - +
    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 eaf3c1d826..c93c9cc591 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)

    - +
    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 06ea7efa85..8ed9d8638c 100644 --- a/dev/utilities/typography/utilities/whitespace.html +++ b/dev/utilities/typography/utilities/whitespace.html @@ -14,22 +14,22 @@ - - + + -
    Skip to content

    空白处理

    定义

    用于控制元素的空格属性的工具类。

    工具类属性
    whitespace-nowrapwhite-space: nowrap;
    whitespace-prewhite-space: pre;
    whitespace-pre-linewhite-space: pre-line;
    whitespace-pre-wrapwhite-space: pre-wrap;

    示例

    不保留空格不自动换行

    使用 whitespace-nowrap 来防止文本在元素中被包裹。换行和空格将被折叠。

    The quick brown fox jumps over the lazy dog. +
    Skip to content

    空白处理

    定义

    用于控制元素的空格属性的工具类。

    工具类属性
    whitespace-nowrapwhite-space: nowrap;
    whitespace-prewhite-space: pre;
    whitespace-pre-linewhite-space: pre-line;
    whitespace-pre-wrapwhite-space: pre-wrap;

    示例

    不保留空格不自动换行

    使用 whitespace-nowrap 来防止文本在元素中被包裹。换行和空格将被折叠。

    The quick brown fox jumps over the lazy dog. 白日依山尽,黄河入海流。 - 欲穷千里目,更上一层楼。

    保留空格不自动换行

    使用 pre 来保留元素中的换行和空格。文本不会被包装。

    The quick brown fox jumps over the lazy dog. + 欲穷千里目,更上一层楼。

    保留空格不自动换行

    使用 pre 来保留元素中的换行和空格。文本不会被包装。

    The quick brown fox jumps over the lazy dog. 白日依山尽,黄河入海流。 - 欲穷千里目,更上一层楼。

    不保留空格自动换行

    使用 whitespace-pre-line 保留换行,但不保留元素中的空格。文本将被正常包装。

    The quick brown fox jumps over the lazy dog. + 欲穷千里目,更上一层楼。

    不保留空格自动换行

    使用 whitespace-pre-line 保留换行,但不保留元素中的空格。文本将被正常包装。

    The quick brown fox jumps over the lazy dog. 白日依山尽,黄河入海流。 - 欲穷千里目,更上一层楼。

    保留空格自动换行

    使用 whitespace-pre-wrap 来保留元素中的换行和空格。文本将被正常包装。

    The quick brown fox jumps over the lazy dog. + 欲穷千里目,更上一层楼。

    保留空格自动换行

    使用 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 e1c1bdbf31..2a3de0366c 100644 --- a/dev/utilities/typography/utilities/word-break.html +++ b/dev/utilities/typography/utilities/word-break.html @@ -14,20 +14,20 @@ - - + + -
    Skip to content

    文本换行

    定义

    用于控制元素中的换行符的工具类。

    工具类属性
    break-normaloverflow-wrap: normal;word-break: normal;
    break-wordsoverflow-wrap: break-word;
    break-allword-break: break-all;

    示例

    字内换行

    使用 break-normal 只在正常的换行点添加换行符。

    The quick brown fox jumps over the lazy dog. +
    Skip to content

    文本换行

    定义

    用于控制元素中的换行符的工具类。

    工具类属性
    break-normaloverflow-wrap: normal;word-break: normal;
    break-wordsoverflow-wrap: break-word;
    break-allword-break: break-all;

    示例

    字内换行

    使用 break-normal 只在正常的换行点添加换行符。

    The quick brown fox jumps over the lazy dog. 白日依山尽,黄河入海流。 - 欲穷千里目,更上一层楼。

    单词内换行

    使用 break-words 在词中间添加换行符。

    The quick brown fox jumps over the lazy dog. + 欲穷千里目,更上一层楼。

    单词内换行

    使用 break-words 在词中间添加换行符。

    The quick brown fox jumps over the lazy dog. 白日依山尽,黄河入海流。 - 欲穷千里目,更上一层楼。

    任意字内断开

    使用 break-all 在必要的时候添加换行符,而不是试图保留整个单词。

    The quick brown fox jumps over the lazy dog. + 欲穷千里目,更上一层楼。

    任意字内断开

    使用 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 146fe600f1..753c82c25d 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 c6b9878440..9759f7a449 100644 --- a/dev/zui/zui.esm.js +++ b/dev/zui/zui.esm.js @@ -8,7 +8,7 @@ var it = (n, t, e) => (an(n, t, "read from private field"), e ? e.call(n) : t.ge 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 bu = "3.0.0", wu = 1724845474675, 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+$/; +const bu = "3.0.0", wu = 1724895936565, 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); diff --git a/dev/zui/zui.esm.js.map b/dev/zui/zui.esm.js.map index c7cd705528..02d281398b 100644 --- a/dev/zui/zui.esm.js.map +++ b/dev/zui/zui.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"zui.esm.js","sources":["../../../../lib/core/src/config/index.ts","../../../../node_modules/cash-dom/dist/cash.esm.js","../../../../lib/core/src/cash/cash.ts","../../../../lib/helpers/src/object/deep-get.ts","../../../../lib/helpers/src/format-string.ts","../../../../lib/core/src/i18n/i18n.ts","../../../../lib/core/src/i18n/common.ts","../../../../lib/core/src/ajax/ajax.ts","../../../../lib/core/src/ajax/helper.ts","../../../../lib/core/src/ajax/fetcher.ts","../../../../lib/core/src/helpers/gid.ts","../../../../lib/core/src/helpers/is-diff.ts","../../../../lib/core/src/helpers/computed.ts","../../../../lib/core/src/helpers/classes.ts","../../../../lib/core/src/helpers/data.ts","../../../../lib/core/src/helpers/raw-data.ts","../../../../lib/core/src/helpers/z.ts","../../../../lib/core/src/helpers/attr.ts","../../../../lib/core/src/helpers/event.ts","../../../../lib/core/src/helpers/delay.ts","../../../../lib/core/src/helpers/share-data.ts","../../../../node_modules/preact/dist/preact.module.js","../../../../lib/core/src/helpers/merge-props.ts","../../../../lib/core/src/helpers/scroll.ts","../../../../lib/core/src/helpers/global-event.ts","../../../../lib/core/src/helpers/size.ts","../../../../lib/core/src/helpers/download-file.ts","../../../../lib/core/src/helpers/bus.ts","../../../../node_modules/tinykeys/dist/tinykeys.module.js","../../../../lib/core/src/helpers/hotkeys.ts","../../../../lib/core/src/helpers/fullscreen.ts","../../../../lib/core/src/dom/is-detached.ts","../../../../lib/core/src/component/component.ts","../../../../lib/core/src/component/creator.ts","../../../../lib/core/src/helpers/sticky.ts","../../../../lib/core/src/dom/is-visible.ts","../../../../lib/core/src/dom/run-js.ts","../../../../lib/core/src/dom/scroll-into-view.ts","../../../../lib/core/src/dom/get-lib.ts","../../../../lib/core/src/dom/resize.ts","../../../../lib/core/src/react/components/components.ts","../../../../lib/core/src/react/components/h-element.ts","../../../../node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js","../../../../lib/core/src/react/components/html-content.tsx","../../../../lib/core/src/react/components/custom-render.tsx","../../../../lib/core/src/react/components/custom-content.tsx","../../../../lib/core/src/react/components/icon.tsx","../../../../lib/core/src/react/components/portals.ts","../../../../lib/core/src/react/components/share.ts","../../../../lib/core/src/react/component-from-react.ts","../../../../lib/button/src/component/button.tsx","../../../../lib/button/src/component/share.ts","../../../../lib/common-list/src/component/common-list.tsx","../../../../lib/common-list/src/vanilla/common-list.ts","../../../../lib/common-list/src/component/share.ts","../../../../lib/helpers/src/color-helper.ts","../../../../lib/helpers/src/string-code.ts","../../../../lib/avatar/src/component/avatar.tsx","../../../../lib/btn-group/src/component/btn-group.tsx","../../../../lib/toolbar/src/component/toolbar.tsx","../../../../lib/checkbox/src/component/checkbox.tsx","../../../../lib/checkbox/src/component/radio.tsx","../../../../lib/checkbox/src/component/switch.tsx","../../../../lib/list/src/component/listitem.tsx","../../../../lib/list/src/component/list.tsx","../../../../lib/store/src/store.ts","../../../../lib/store/src/main.ts","../../../../lib/list/src/component/nested-list.tsx","../../../../lib/menu/src/component/menu.tsx","../../../../lib/search-box/src/components/search-box.tsx","../../../../lib/menu/src/component/search-menu.tsx","../../../../lib/menu/src/vanilla/menu.ts","../../../../lib/menu/src/vanilla/search-menu.ts","../../../../lib/menu/src/component/share.ts","../../../../lib/alert/src/component/alert.tsx","../../../../lib/messager/src/component/messager-item.tsx","../../../../lib/messager/src/vanilla/messager-item.ts","../../../../lib/messager/src/vanilla/messager.ts","../../../../lib/progress/src/components/progress-bar.tsx","../../../../lib/progress/src/components/share.ts","../../../../lib/progress/src/vanilla/index.ts","../../../../lib/progress-circle/src/component/progress-circle.tsx","../../../../lib/progress-circle/src/vanilla/index.ts","../../../../lib/progress-circle/src/component/share.ts","../../../../lib/avatar/src/vanilla/index.ts","../../../../lib/avatar/src/component/share.ts","../../../../lib/btn-group/src/vanilla/index.ts","../../../../lib/btn-group/src/component/share.ts","../../../../lib/pick/src/components/pick-trigger.tsx","../../../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../../../../lib/pick/src/components/pick-pop.tsx","../../../../lib/pick/src/components/pick.tsx","../../../../lib/color-picker/src/components/color-picker.tsx","../../../../lib/color-picker/src/vanilla/color-picker.ts","../../../../lib/helpers/src/date-helper.ts","../../../../lib/datetime-picker/src/component/time-picker-menu.tsx","../../../../lib/datetime-picker/src/component/time-picker.tsx","../../../../lib/datetime-picker/src/helpers/date-helper.ts","../../../../lib/datetime-picker/src/i18n/index.ts","../../../../lib/datetime-picker/src/component/mini-calendar.tsx","../../../../lib/datetime-picker/src/component/value-selector.tsx","../../../../lib/datetime-picker/src/component/date-picker-menu.tsx","../../../../lib/datetime-picker/src/component/date-picker.tsx","../../../../lib/datetime-picker/src/component/datetime-picker.tsx","../../../../lib/datetime-picker/src/vanilla/time-picker.ts","../../../../lib/datetime-picker/src/vanilla/date-picker.ts","../../../../lib/datetime-picker/src/vanilla/datetime-picker.ts","../../../../lib/modal/src/vanilla/modal-base.ts","../../../../lib/modal/src/component/modal-dialog.tsx","../../../../lib/modal/src/component/modal-iframe-content.tsx","../../../../lib/modal/src/vanilla/modal.tsx","../../../../lib/modal/src/vanilla/modal-trigger.ts","../../../../lib/file-selector/src/i18n/index.ts","../../../../lib/file-selector/src/components/file-selector.tsx","../../../../lib/file-selector/src/components/image-selector.tsx","../../../../lib/file-selector/src/vanilla/file-selector.ts","../../../../lib/file-selector/src/vanilla/image-selector.ts","../../../../lib/file-selector/src/components/share.ts","../../../../lib/nav/src/component/nav.tsx","../../../../lib/nav/src/vanilla/nav.ts","../../../../lib/nav/src/component/share.ts","../../../../lib/pager/src/helpers/update-pager-info.ts","../../../../lib/pager/src/component/pager-link.tsx","../../../../lib/pager/src/component/pager-info.tsx","../../../../lib/pager/src/component/pager-nav.tsx","../../../../lib/popover/src/component/popover-panel.tsx","../../../../lib/popover/src/vanilla/popover-panel.ts","../../../../lib/popover/src/vanilla/popover.ts","../../../../lib/dropdown/src/vanilla/dropdown.ts","../../../../lib/dropdown/src/component/dropdown-button.tsx","../../../../lib/dropdown/src/component/dropdown-menu.tsx","../../../../lib/pager/src/component/pager-size-menu.tsx","../../../../lib/pager/src/component/pager-goto.tsx","../../../../lib/pager/src/component/pager.tsx","../../../../lib/pager/src/vanilla/index.ts","../../../../lib/pager/src/component/share.ts","../../../../lib/pick/src/vanilla/pick.ts","../../../../lib/picker/src/component/picker-search.tsx","../../../../lib/picker/src/component/picker-multi-select.tsx","../../../../lib/picker/src/component/picker-single-select.tsx","../../../../lib/tree/src/components/tree.tsx","../../../../lib/tree/src/components/search-tree.tsx","../../../../lib/picker/src/component/picker-menu.tsx","../../../../lib/picker/src/component/picker.tsx","../../../../lib/picker/src/vanilla/picker.ts","../../../../lib/picker/src/i18n/index.ts","../../../../lib/search-box/src/vanilla/search-box.ts","../../../../lib/search-box/src/components/share.ts","../../../../lib/toolbar/src/vanilla/index.ts","../../../../lib/toolbar/src/component/share.ts","../../../../lib/tooltip/src/vanilla/tooltip.ts","../../../../lib/scrollbar/src/component/scrollbar.tsx","../../../../lib/dtable/src/helpers/shared-plugins.ts","../../../../lib/dtable/src/helpers/default-options.ts","../../../../lib/dtable/src/helpers/number.ts","../../../../lib/dtable/src/helpers/layout.ts","../../../../lib/dtable/src/components/cell.tsx","../../../../lib/dtable/src/components/cells.tsx","../../../../lib/dtable/src/components/block.tsx","../../../../lib/dtable/src/components/dtable.tsx","../../../../lib/dtable/src/plugins/rich/index.tsx","../../../../lib/dtable/src/plugins/sort/index.tsx","../../../../lib/dtable/src/plugins/custom/index.tsx","../../../../lib/dtable/src/plugins/checkable/index.tsx","../../../../lib/dtable/src/plugins/store/index.ts","../../../../lib/dtable/src/plugins/nested/index.tsx","../../../../lib/dtable/src/plugins/avatar/index.tsx","../../../../lib/dtable/src/plugins/sort-type/index.tsx","../../../../lib/dtable/src/plugins/group/index.tsx","../../../../lib/dtable/src/plugins/header-group/index.tsx","../../../../lib/dtable/src/plugins/cellspan/index.ts","../../../../lib/dtable/src/plugins/mousemove/index.ts","../../../../lib/dtable/src/plugins/autoscroll/index.ts","../../../../lib/dtable/src/plugins/sortable/index.tsx","../../../../lib/dtable/src/vanilla/index.ts","../../../../lib/tabs/src/vanilla/tabs.ts"],"sourcesContent":["\n// eslint-disable-next-line @typescript-eslint/naming-convention\ndeclare const __APP_VERSION__: string;\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\ndeclare const __BUILD_TIME__: number;\n\nexport const VERSION = __APP_VERSION__;\nexport const BUILD = __BUILD_TIME__;\n","const doc = document;\nconst win = window;\nconst docEle = doc.documentElement;\nconst createElement = doc.createElement.bind(doc);\nconst div = createElement('div');\nconst table = createElement('table');\nconst tbody = createElement('tbody');\nconst tr = createElement('tr');\nconst { isArray, prototype: ArrayPrototype } = Array;\nconst { concat, filter, indexOf, map, push, slice, some, splice } = ArrayPrototype;\nconst idRe = /^#(?:[\\w-]|\\\\.|[^\\x00-\\xa0])*$/;\nconst classRe = /^\\.(?:[\\w-]|\\\\.|[^\\x00-\\xa0])*$/;\nconst htmlRe = /<.+>/;\nconst tagRe = /^\\w+$/;\n// @require ./variables.ts\nfunction find(selector, context) {\n const isFragment = isDocumentFragment(context);\n return !selector || (!isFragment && !isDocument(context) && !isElement(context))\n ? []\n : !isFragment && classRe.test(selector)\n ? context.getElementsByClassName(selector.slice(1).replace(/\\\\/g, ''))\n : !isFragment && tagRe.test(selector)\n ? context.getElementsByTagName(selector)\n : context.querySelectorAll(selector);\n}\n// @require ./find.ts\n// @require ./variables.ts\nclass Cash {\n constructor(selector, context) {\n if (!selector)\n return;\n if (isCash(selector))\n return selector;\n let eles = selector;\n if (isString(selector)) {\n const ctx = context || doc;\n eles = idRe.test(selector) && isDocument(ctx)\n ? ctx.getElementById(selector.slice(1).replace(/\\\\/g, ''))\n : htmlRe.test(selector)\n ? parseHTML(selector)\n : isCash(ctx)\n ? ctx.find(selector)\n : isString(ctx)\n ? cash(ctx).find(selector)\n : find(selector, ctx);\n if (!eles)\n return;\n }\n else if (isFunction(selector)) {\n return this.ready(selector); //FIXME: `fn.ready` is not included in `core`, but it's actually a core functionality\n }\n if (eles.nodeType || eles === win)\n eles = [eles];\n this.length = eles.length;\n for (let i = 0, l = this.length; i < l; i++) {\n this[i] = eles[i];\n }\n }\n init(selector, context) {\n return new Cash(selector, context);\n }\n}\nconst fn = Cash.prototype;\nconst cash = fn.init;\ncash.fn = cash.prototype = fn; // Ensuring that `cash () instanceof cash`\nfn.length = 0;\nfn.splice = splice; // Ensuring a cash collection gets printed as array-like in Chrome's devtools\nif (typeof Symbol === 'function') { // Ensuring a cash collection is iterable\n fn[Symbol['iterator']] = ArrayPrototype[Symbol['iterator']];\n}\nfunction isCash(value) {\n return value instanceof Cash;\n}\nfunction isWindow(value) {\n return !!value && value === value.window;\n}\nfunction isDocument(value) {\n return !!value && value.nodeType === 9;\n}\nfunction isDocumentFragment(value) {\n return !!value && value.nodeType === 11;\n}\nfunction isElement(value) {\n return !!value && value.nodeType === 1;\n}\nfunction isText(value) {\n return !!value && value.nodeType === 3;\n}\nfunction isBoolean(value) {\n return typeof value === 'boolean';\n}\nfunction isFunction(value) {\n return typeof value === 'function';\n}\nfunction isString(value) {\n return typeof value === 'string';\n}\nfunction isUndefined(value) {\n return value === undefined;\n}\nfunction isNull(value) {\n return value === null;\n}\nfunction isNumeric(value) {\n return !isNaN(parseFloat(value)) && isFinite(value);\n}\nfunction isPlainObject(value) {\n if (typeof value !== 'object' || value === null)\n return false;\n const proto = Object.getPrototypeOf(value);\n return proto === null || proto === Object.prototype;\n}\ncash.isWindow = isWindow;\ncash.isFunction = isFunction;\ncash.isArray = isArray;\ncash.isNumeric = isNumeric;\ncash.isPlainObject = isPlainObject;\nfunction each(arr, callback, _reverse) {\n if (_reverse) {\n let i = arr.length;\n while (i--) {\n if (callback.call(arr[i], i, arr[i]) === false)\n return arr;\n }\n }\n else if (isPlainObject(arr)) {\n const keys = Object.keys(arr);\n for (let i = 0, l = keys.length; i < l; i++) {\n const key = keys[i];\n if (callback.call(arr[key], key, arr[key]) === false)\n return arr;\n }\n }\n else {\n for (let i = 0, l = arr.length; i < l; i++) {\n if (callback.call(arr[i], i, arr[i]) === false)\n return arr;\n }\n }\n return arr;\n}\ncash.each = each;\nfn.each = function (callback) {\n return each(this, callback);\n};\nfn.empty = function () {\n return this.each((i, ele) => {\n while (ele.firstChild) {\n ele.removeChild(ele.firstChild);\n }\n });\n};\nfunction extend(...sources) {\n const deep = isBoolean(sources[0]) ? sources.shift() : false;\n const target = sources.shift();\n const length = sources.length;\n if (!target)\n return {};\n if (!length)\n return extend(deep, cash, target);\n for (let i = 0; i < length; i++) {\n const source = sources[i];\n for (const key in source) {\n if (deep && (isArray(source[key]) || isPlainObject(source[key]))) {\n if (!target[key] || target[key].constructor !== source[key].constructor)\n target[key] = new source[key].constructor();\n extend(deep, target[key], source[key]);\n }\n else {\n target[key] = source[key];\n }\n }\n }\n return target;\n}\ncash.extend = extend;\nfn.extend = function (plugins) {\n return extend(fn, plugins);\n};\n// @require ./type_checking.ts\nconst splitValuesRe = /\\S+/g;\nfunction getSplitValues(str) {\n return isString(str) ? str.match(splitValuesRe) || [] : [];\n}\nfn.toggleClass = function (cls, force) {\n const classes = getSplitValues(cls);\n const isForce = !isUndefined(force);\n return this.each((i, ele) => {\n if (!isElement(ele))\n return;\n each(classes, (i, c) => {\n if (isForce) {\n force ? ele.classList.add(c) : ele.classList.remove(c);\n }\n else {\n ele.classList.toggle(c);\n }\n });\n });\n};\nfn.addClass = function (cls) {\n return this.toggleClass(cls, true);\n};\nfn.removeAttr = function (attr) {\n const attrs = getSplitValues(attr);\n return this.each((i, ele) => {\n if (!isElement(ele))\n return;\n each(attrs, (i, a) => {\n ele.removeAttribute(a);\n });\n });\n};\nfunction attr(attr, value) {\n if (!attr)\n return;\n if (isString(attr)) {\n if (arguments.length < 2) {\n if (!this[0] || !isElement(this[0]))\n return;\n const value = this[0].getAttribute(attr);\n return isNull(value) ? undefined : value;\n }\n if (isUndefined(value))\n return this;\n if (isNull(value))\n return this.removeAttr(attr);\n return this.each((i, ele) => {\n if (!isElement(ele))\n return;\n ele.setAttribute(attr, value);\n });\n }\n for (const key in attr) {\n this.attr(key, attr[key]);\n }\n return this;\n}\nfn.attr = attr;\nfn.removeClass = function (cls) {\n if (arguments.length)\n return this.toggleClass(cls, false);\n return this.attr('class', '');\n};\nfn.hasClass = function (cls) {\n return !!cls && some.call(this, (ele) => isElement(ele) && ele.classList.contains(cls));\n};\nfn.get = function (index) {\n if (isUndefined(index))\n return slice.call(this);\n index = Number(index);\n return this[index < 0 ? index + this.length : index];\n};\nfn.eq = function (index) {\n return cash(this.get(index));\n};\nfn.first = function () {\n return this.eq(0);\n};\nfn.last = function () {\n return this.eq(-1);\n};\nfunction text(text) {\n if (isUndefined(text)) {\n return this.get().map(ele => isElement(ele) || isText(ele) ? ele.textContent : '').join('');\n }\n return this.each((i, ele) => {\n if (!isElement(ele))\n return;\n ele.textContent = text;\n });\n}\nfn.text = text;\n// @require core/type_checking.ts\n// @require core/variables.ts\nfunction computeStyle(ele, prop, isVariable) {\n if (!isElement(ele))\n return;\n const style = win.getComputedStyle(ele, null);\n return isVariable ? style.getPropertyValue(prop) || undefined : style[prop] || ele.style[prop];\n}\n// @require ./compute_style.ts\nfunction computeStyleInt(ele, prop) {\n return parseInt(computeStyle(ele, prop), 10) || 0;\n}\n// @require css/helpers/compute_style_int.ts\nfunction getExtraSpace(ele, xAxis) {\n return computeStyleInt(ele, `border${xAxis ? 'Left' : 'Top'}Width`) + computeStyleInt(ele, `padding${xAxis ? 'Left' : 'Top'}`) + computeStyleInt(ele, `padding${xAxis ? 'Right' : 'Bottom'}`) + computeStyleInt(ele, `border${xAxis ? 'Right' : 'Bottom'}Width`);\n}\n// @require css/helpers/compute_style.ts\nconst defaultDisplay = {};\nfunction getDefaultDisplay(tagName) {\n if (defaultDisplay[tagName])\n return defaultDisplay[tagName];\n const ele = createElement(tagName);\n doc.body.insertBefore(ele, null);\n const display = computeStyle(ele, 'display');\n doc.body.removeChild(ele);\n return defaultDisplay[tagName] = display !== 'none' ? display : 'block';\n}\n// @require css/helpers/compute_style.ts\nfunction isHidden(ele) {\n return computeStyle(ele, 'display') === 'none';\n}\n// @require ./cash.ts\nfunction matches(ele, selector) {\n const matches = ele && (ele['matches'] || ele['webkitMatchesSelector'] || ele['msMatchesSelector']);\n return !!matches && !!selector && matches.call(ele, selector);\n}\n// @require ./matches.ts\n// @require ./type_checking.ts\nfunction getCompareFunction(comparator) {\n return isString(comparator)\n ? (i, ele) => matches(ele, comparator)\n : isFunction(comparator)\n ? comparator\n : isCash(comparator)\n ? (i, ele) => comparator.is(ele)\n : !comparator\n ? () => false\n : (i, ele) => ele === comparator;\n}\nfn.filter = function (comparator) {\n const compare = getCompareFunction(comparator);\n return cash(filter.call(this, (ele, i) => compare.call(ele, i, ele)));\n};\n// @require collection/filter.ts\nfunction filtered(collection, comparator) {\n return !comparator ? collection : collection.filter(comparator);\n}\nfn.detach = function (comparator) {\n filtered(this, comparator).each((i, ele) => {\n if (ele.parentNode) {\n ele.parentNode.removeChild(ele);\n }\n });\n return this;\n};\nconst fragmentRe = /^\\s*<(\\w+)[^>]*>/;\nconst singleTagRe = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>)?$/;\nconst containers = {\n '*': div,\n tr: tbody,\n td: tr,\n th: tr,\n thead: table,\n tbody: table,\n tfoot: table\n};\n//TODO: Create elements inside a document fragment, in order to prevent inline event handlers from firing\n//TODO: Ensure the created elements have the fragment as their parent instead of null, this also ensures we can deal with detatched nodes more reliably\nfunction parseHTML(html) {\n if (!isString(html))\n return [];\n if (singleTagRe.test(html))\n return [createElement(RegExp.$1)];\n const fragment = fragmentRe.test(html) && RegExp.$1;\n const container = containers[fragment] || containers['*'];\n container.innerHTML = html;\n return cash(container.childNodes).detach().get();\n}\ncash.parseHTML = parseHTML;\nfn.has = function (selector) {\n const comparator = isString(selector)\n ? (i, ele) => find(selector, ele).length\n : (i, ele) => ele.contains(selector);\n return this.filter(comparator);\n};\nfn.not = function (comparator) {\n const compare = getCompareFunction(comparator);\n return this.filter((i, ele) => (!isString(comparator) || isElement(ele)) && !compare.call(ele, i, ele));\n};\nfunction pluck(arr, prop, deep, until) {\n const plucked = [];\n const isCallback = isFunction(prop);\n const compare = until && getCompareFunction(until);\n for (let i = 0, l = arr.length; i < l; i++) {\n if (isCallback) {\n const val = prop(arr[i]);\n if (val.length)\n push.apply(plucked, val);\n }\n else {\n let val = arr[i][prop];\n while (val != null) {\n if (until && compare(-1, val))\n break;\n plucked.push(val);\n val = deep ? val[prop] : null;\n }\n }\n }\n return plucked;\n}\n// @require core/pluck.ts\n// @require core/variables.ts\nfunction getValue(ele) {\n if (ele.multiple && ele.options)\n return pluck(filter.call(ele.options, option => option.selected && !option.disabled && !option.parentNode.disabled), 'value');\n return ele.value || '';\n}\nfunction val(value) {\n if (!arguments.length)\n return this[0] && getValue(this[0]);\n return this.each((i, ele) => {\n const isSelect = ele.multiple && ele.options;\n if (isSelect || checkableRe.test(ele.type)) {\n const eleValue = isArray(value) ? map.call(value, String) : (isNull(value) ? [] : [String(value)]);\n if (isSelect) {\n each(ele.options, (i, option) => {\n option.selected = eleValue.indexOf(option.value) >= 0;\n }, true);\n }\n else {\n ele.checked = eleValue.indexOf(ele.value) >= 0;\n }\n }\n else {\n ele.value = isUndefined(value) || isNull(value) ? '' : value;\n }\n });\n}\nfn.val = val;\nfn.is = function (comparator) {\n const compare = getCompareFunction(comparator);\n return some.call(this, (ele, i) => compare.call(ele, i, ele));\n};\ncash.guid = 1;\nfunction unique(arr) {\n return arr.length > 1 ? filter.call(arr, (item, index, self) => indexOf.call(self, item) === index) : arr;\n}\ncash.unique = unique;\nfn.add = function (selector, context) {\n return cash(unique(this.get().concat(cash(selector, context).get())));\n};\nfn.children = function (comparator) {\n return filtered(cash(unique(pluck(this, ele => ele.children))), comparator);\n};\nfn.parent = function (comparator) {\n return filtered(cash(unique(pluck(this, 'parentNode'))), comparator);\n};\nfn.index = function (selector) {\n const child = selector ? cash(selector)[0] : this[0];\n const collection = selector ? this : cash(child).parent().children();\n return indexOf.call(collection, child);\n};\nfn.closest = function (comparator) {\n const filtered = this.filter(comparator);\n if (filtered.length)\n return filtered;\n const $parent = this.parent();\n if (!$parent.length)\n return filtered;\n return $parent.closest(comparator);\n};\nfn.siblings = function (comparator) {\n return filtered(cash(unique(pluck(this, ele => cash(ele).parent().children().not(ele)))), comparator);\n};\nfn.find = function (selector) {\n return cash(unique(pluck(this, ele => find(selector, ele))));\n};\n// @require core/variables.ts\n// @require collection/filter.ts\n// @require traversal/find.ts\nconst HTMLCDATARe = /^\\s*\\s*$/g;\nconst scriptTypeRe = /^$|^module$|\\/(java|ecma)script/i;\nconst scriptAttributes = ['type', 'src', 'nonce', 'noModule'];\nfunction evalScripts(node, doc) {\n const collection = cash(node);\n collection.filter('script').add(collection.find('script')).each((i, ele) => {\n if (scriptTypeRe.test(ele.type) && docEle.contains(ele)) { // The script type is supported // The element is attached to the DOM // Using `documentElement` for broader browser support\n const script = createElement('script');\n script.text = ele.textContent.replace(HTMLCDATARe, '');\n each(scriptAttributes, (i, attr) => {\n if (ele[attr])\n script[attr] = ele[attr];\n });\n doc.head.insertBefore(script, null);\n doc.head.removeChild(script);\n }\n });\n}\n// @require ./eval_scripts.ts\nfunction insertElement(anchor, target, left, inside, evaluate) {\n if (inside) { // prepend/append\n anchor.insertBefore(target, left ? anchor.firstChild : null);\n }\n else { // before/after\n if (anchor.nodeName === 'HTML') {\n anchor.parentNode.replaceChild(target, anchor);\n }\n else {\n anchor.parentNode.insertBefore(target, left ? anchor : anchor.nextSibling);\n }\n }\n if (evaluate) {\n evalScripts(target, anchor.ownerDocument);\n }\n}\n// @require ./insert_element.ts\nfunction insertSelectors(selectors, anchors, inverse, left, inside, reverseLoop1, reverseLoop2, reverseLoop3) {\n each(selectors, (si, selector) => {\n each(cash(selector), (ti, target) => {\n each(cash(anchors), (ai, anchor) => {\n const anchorFinal = inverse ? target : anchor;\n const targetFinal = inverse ? anchor : target;\n const indexFinal = inverse ? ti : ai;\n insertElement(anchorFinal, !indexFinal ? targetFinal : targetFinal.cloneNode(true), left, inside, !indexFinal);\n }, reverseLoop3);\n }, reverseLoop2);\n }, reverseLoop1);\n return anchors;\n}\nfn.after = function () {\n return insertSelectors(arguments, this, false, false, false, true, true);\n};\nfn.append = function () {\n return insertSelectors(arguments, this, false, false, true);\n};\nfunction html(html) {\n if (!arguments.length)\n return this[0] && this[0].innerHTML;\n if (isUndefined(html))\n return this;\n const hasScript = /]/.test(html);\n return this.each((i, ele) => {\n if (!isElement(ele))\n return;\n if (hasScript) {\n cash(ele).empty().append(html);\n }\n else {\n ele.innerHTML = html;\n }\n });\n}\nfn.html = html;\nfn.appendTo = function (selector) {\n return insertSelectors(arguments, this, true, false, true);\n};\nfn.wrapInner = function (selector) {\n return this.each((i, ele) => {\n const $ele = cash(ele);\n const contents = $ele.contents();\n contents.length ? contents.wrapAll(selector) : $ele.append(selector);\n });\n};\nfn.before = function () {\n return insertSelectors(arguments, this, false, true);\n};\nfn.wrapAll = function (selector) {\n let structure = cash(selector);\n let wrapper = structure[0];\n while (wrapper.children.length)\n wrapper = wrapper.firstElementChild;\n this.first().before(structure);\n return this.appendTo(wrapper);\n};\nfn.wrap = function (selector) {\n return this.each((i, ele) => {\n const wrapper = cash(selector)[0];\n cash(ele).wrapAll(!i ? wrapper : wrapper.cloneNode(true));\n });\n};\nfn.insertAfter = function (selector) {\n return insertSelectors(arguments, this, true, false, false, false, false, true);\n};\nfn.insertBefore = function (selector) {\n return insertSelectors(arguments, this, true, true);\n};\nfn.prepend = function () {\n return insertSelectors(arguments, this, false, true, true, true, true);\n};\nfn.prependTo = function (selector) {\n return insertSelectors(arguments, this, true, true, true, false, false, true);\n};\nfn.contents = function () {\n return cash(unique(pluck(this, ele => ele.tagName === 'IFRAME' ? [ele.contentDocument] : (ele.tagName === 'TEMPLATE' ? ele.content.childNodes : ele.childNodes))));\n};\nfn.next = function (comparator, _all, _until) {\n return filtered(cash(unique(pluck(this, 'nextElementSibling', _all, _until))), comparator);\n};\nfn.nextAll = function (comparator) {\n return this.next(comparator, true);\n};\nfn.nextUntil = function (until, comparator) {\n return this.next(comparator, true, until);\n};\nfn.parents = function (comparator, _until) {\n return filtered(cash(unique(pluck(this, 'parentElement', true, _until))), comparator);\n};\nfn.parentsUntil = function (until, comparator) {\n return this.parents(comparator, until);\n};\nfn.prev = function (comparator, _all, _until) {\n return filtered(cash(unique(pluck(this, 'previousElementSibling', _all, _until))), comparator);\n};\nfn.prevAll = function (comparator) {\n return this.prev(comparator, true);\n};\nfn.prevUntil = function (until, comparator) {\n return this.prev(comparator, true, until);\n};\nfn.map = function (callback) {\n return cash(concat.apply([], map.call(this, (ele, i) => callback.call(ele, i, ele))));\n};\nfn.clone = function () {\n return this.map((i, ele) => ele.cloneNode(true));\n};\nfn.offsetParent = function () {\n return this.map((i, ele) => {\n let offsetParent = ele.offsetParent;\n while (offsetParent && computeStyle(offsetParent, 'position') === 'static') {\n offsetParent = offsetParent.offsetParent;\n }\n return offsetParent || docEle;\n });\n};\nfn.slice = function (start, end) {\n return cash(slice.call(this, start, end));\n};\n// @require ./cash.ts\nconst dashAlphaRe = /-([a-z])/g;\nfunction camelCase(str) {\n return str.replace(dashAlphaRe, (match, letter) => letter.toUpperCase());\n}\nfn.ready = function (callback) {\n const cb = () => setTimeout(callback, 0, cash);\n if (doc.readyState !== 'loading') {\n cb();\n }\n else {\n doc.addEventListener('DOMContentLoaded', cb);\n }\n return this;\n};\nfn.unwrap = function () {\n this.parent().each((i, ele) => {\n if (ele.tagName === 'BODY')\n return;\n const $ele = cash(ele);\n $ele.replaceWith($ele.children());\n });\n return this;\n};\nfn.offset = function () {\n const ele = this[0];\n if (!ele)\n return;\n const rect = ele.getBoundingClientRect();\n return {\n top: rect.top + win.pageYOffset,\n left: rect.left + win.pageXOffset\n };\n};\nfn.position = function () {\n const ele = this[0];\n if (!ele)\n return;\n const isFixed = (computeStyle(ele, 'position') === 'fixed');\n const offset = isFixed ? ele.getBoundingClientRect() : this.offset();\n if (!isFixed) {\n const doc = ele.ownerDocument;\n let offsetParent = ele.offsetParent || doc.documentElement;\n while ((offsetParent === doc.body || offsetParent === doc.documentElement) && computeStyle(offsetParent, 'position') === 'static') {\n offsetParent = offsetParent.parentNode;\n }\n if (offsetParent !== ele && isElement(offsetParent)) {\n const parentOffset = cash(offsetParent).offset();\n offset.top -= parentOffset.top + computeStyleInt(offsetParent, 'borderTopWidth');\n offset.left -= parentOffset.left + computeStyleInt(offsetParent, 'borderLeftWidth');\n }\n }\n return {\n top: offset.top - computeStyleInt(ele, 'marginTop'),\n left: offset.left - computeStyleInt(ele, 'marginLeft')\n };\n};\nconst propMap = {\n /* GENERAL */\n class: 'className',\n contenteditable: 'contentEditable',\n /* LABEL */\n for: 'htmlFor',\n /* INPUT */\n readonly: 'readOnly',\n maxlength: 'maxLength',\n tabindex: 'tabIndex',\n /* TABLE */\n colspan: 'colSpan',\n rowspan: 'rowSpan',\n /* IMAGE */\n usemap: 'useMap'\n};\nfn.prop = function (prop, value) {\n if (!prop)\n return;\n if (isString(prop)) {\n prop = propMap[prop] || prop;\n if (arguments.length < 2)\n return this[0] && this[0][prop];\n return this.each((i, ele) => { ele[prop] = value; });\n }\n for (const key in prop) {\n this.prop(key, prop[key]);\n }\n return this;\n};\nfn.removeProp = function (prop) {\n return this.each((i, ele) => { delete ele[propMap[prop] || prop]; });\n};\nconst cssVariableRe = /^--/;\n// @require ./variables.ts\nfunction isCSSVariable(prop) {\n return cssVariableRe.test(prop);\n}\n// @require core/camel_case.ts\n// @require core/cash.ts\n// @require core/each.ts\n// @require core/variables.ts\n// @require ./is_css_variable.ts\nconst prefixedProps = {};\nconst { style } = div;\nconst vendorsPrefixes = ['webkit', 'moz', 'ms'];\nfunction getPrefixedProp(prop, isVariable = isCSSVariable(prop)) {\n if (isVariable)\n return prop;\n if (!prefixedProps[prop]) {\n const propCC = camelCase(prop);\n const propUC = `${propCC[0].toUpperCase()}${propCC.slice(1)}`;\n const props = (`${propCC} ${vendorsPrefixes.join(`${propUC} `)}${propUC}`).split(' ');\n each(props, (i, p) => {\n if (p in style) {\n prefixedProps[prop] = p;\n return false;\n }\n });\n }\n return prefixedProps[prop];\n}\n// @require core/type_checking.ts\n// @require ./is_css_variable.ts\nconst numericProps = {\n animationIterationCount: true,\n columnCount: true,\n flexGrow: true,\n flexShrink: true,\n fontWeight: true,\n gridArea: true,\n gridColumn: true,\n gridColumnEnd: true,\n gridColumnStart: true,\n gridRow: true,\n gridRowEnd: true,\n gridRowStart: true,\n lineHeight: true,\n opacity: true,\n order: true,\n orphans: true,\n widows: true,\n zIndex: true\n};\nfunction getSuffixedValue(prop, value, isVariable = isCSSVariable(prop)) {\n return !isVariable && !numericProps[prop] && isNumeric(value) ? `${value}px` : value;\n}\nfunction css(prop, value) {\n if (isString(prop)) {\n const isVariable = isCSSVariable(prop);\n prop = getPrefixedProp(prop, isVariable);\n if (arguments.length < 2)\n return this[0] && computeStyle(this[0], prop, isVariable);\n if (!prop)\n return this;\n value = getSuffixedValue(prop, value, isVariable);\n return this.each((i, ele) => {\n if (!isElement(ele))\n return;\n if (isVariable) {\n ele.style.setProperty(prop, value);\n }\n else {\n ele.style[prop] = value;\n }\n });\n }\n for (const key in prop) {\n this.css(key, prop[key]);\n }\n return this;\n}\n;\nfn.css = css;\nfunction attempt(fn, arg) {\n try {\n return fn(arg);\n }\n catch (_a) {\n return arg;\n }\n}\n// @require core/attempt.ts\n// @require core/camel_case.ts\nconst JSONStringRe = /^\\s+|\\s+$/;\nfunction getData(ele, key) {\n const value = ele.dataset[key] || ele.dataset[camelCase(key)];\n if (JSONStringRe.test(value))\n return value;\n return attempt(JSON.parse, value);\n}\n// @require core/attempt.ts\n// @require core/camel_case.ts\nfunction setData(ele, key, value) {\n value = attempt(JSON.stringify, value);\n ele.dataset[camelCase(key)] = value;\n}\nfunction data(name, value) {\n if (!name) {\n if (!this[0])\n return;\n const datas = {};\n for (const key in this[0].dataset) {\n datas[key] = getData(this[0], key);\n }\n return datas;\n }\n if (isString(name)) {\n if (arguments.length < 2)\n return this[0] && getData(this[0], name);\n if (isUndefined(value))\n return this;\n return this.each((i, ele) => { setData(ele, name, value); });\n }\n for (const key in name) {\n this.data(key, name[key]);\n }\n return this;\n}\nfn.data = data;\nfunction getDocumentDimension(doc, dimension) {\n const docEle = doc.documentElement;\n return Math.max(doc.body[`scroll${dimension}`], docEle[`scroll${dimension}`], doc.body[`offset${dimension}`], docEle[`offset${dimension}`], docEle[`client${dimension}`]);\n}\neach([true, false], (i, outer) => {\n each(['Width', 'Height'], (i, prop) => {\n const name = `${outer ? 'outer' : 'inner'}${prop}`;\n fn[name] = function (includeMargins) {\n if (!this[0])\n return;\n if (isWindow(this[0]))\n return outer ? this[0][`inner${prop}`] : this[0].document.documentElement[`client${prop}`];\n if (isDocument(this[0]))\n return getDocumentDimension(this[0], prop);\n return this[0][`${outer ? 'offset' : 'client'}${prop}`] + (includeMargins && outer ? computeStyleInt(this[0], `margin${i ? 'Top' : 'Left'}`) + computeStyleInt(this[0], `margin${i ? 'Bottom' : 'Right'}`) : 0);\n };\n });\n});\neach(['Width', 'Height'], (index, prop) => {\n const propLC = prop.toLowerCase();\n fn[propLC] = function (value) {\n if (!this[0])\n return isUndefined(value) ? undefined : this;\n if (!arguments.length) {\n if (isWindow(this[0]))\n return this[0].document.documentElement[`client${prop}`];\n if (isDocument(this[0]))\n return getDocumentDimension(this[0], prop);\n return this[0].getBoundingClientRect()[propLC] - getExtraSpace(this[0], !index);\n }\n const valueNumber = parseInt(value, 10);\n return this.each((i, ele) => {\n if (!isElement(ele))\n return;\n const boxSizing = computeStyle(ele, 'boxSizing');\n ele.style[propLC] = getSuffixedValue(propLC, valueNumber + (boxSizing === 'border-box' ? getExtraSpace(ele, !index) : 0));\n });\n };\n});\nconst displayProperty = '___cd';\nfn.toggle = function (force) {\n return this.each((i, ele) => {\n if (!isElement(ele))\n return;\n const hidden = isHidden(ele);\n const show = isUndefined(force) ? hidden : force;\n if (show) {\n ele.style.display = ele[displayProperty] || '';\n if (isHidden(ele)) {\n ele.style.display = getDefaultDisplay(ele.tagName);\n }\n }\n else if (!hidden) {\n ele[displayProperty] = computeStyle(ele, 'display');\n ele.style.display = 'none';\n }\n });\n};\nfn.hide = function () {\n return this.toggle(false);\n};\nfn.show = function () {\n return this.toggle(true);\n};\nconst eventsNamespace = '___ce';\nconst eventsNamespacesSeparator = '.';\nconst eventsFocus = { focus: 'focusin', blur: 'focusout' };\nconst eventsHover = { mouseenter: 'mouseover', mouseleave: 'mouseout' };\nconst eventsMouseRe = /^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;\n// @require ./variables.ts\nfunction getEventNameBubbling(name) {\n return eventsHover[name] || eventsFocus[name] || name;\n}\n// @require ./variables.ts\nfunction parseEventName(eventName) {\n const parts = eventName.split(eventsNamespacesSeparator);\n return [parts[0], parts.slice(1).sort()]; // [name, namespace[]]\n}\nfn.trigger = function (event, data) {\n if (isString(event)) {\n const [nameOriginal, namespaces] = parseEventName(event);\n const name = getEventNameBubbling(nameOriginal);\n if (!name)\n return this;\n const type = eventsMouseRe.test(name) ? 'MouseEvents' : 'HTMLEvents';\n event = doc.createEvent(type);\n event.initEvent(name, true, true);\n event.namespace = namespaces.join(eventsNamespacesSeparator);\n event.___ot = nameOriginal;\n }\n event.___td = data;\n const isEventFocus = (event.___ot in eventsFocus);\n return this.each((i, ele) => {\n if (isEventFocus && isFunction(ele[event.___ot])) {\n ele[`___i${event.type}`] = true; // Ensuring the native event is ignored\n ele[event.___ot]();\n ele[`___i${event.type}`] = false; // Ensuring the custom event is not ignored\n }\n ele.dispatchEvent(event);\n });\n};\n// @require ./variables.ts\nfunction getEventsCache(ele) {\n return ele[eventsNamespace] = (ele[eventsNamespace] || {});\n}\n// @require core/guid.ts\n// @require events/helpers/get_events_cache.ts\nfunction addEvent(ele, name, namespaces, selector, callback) {\n const eventCache = getEventsCache(ele);\n eventCache[name] = (eventCache[name] || []);\n eventCache[name].push([namespaces, selector, callback]);\n ele.addEventListener(name, callback);\n}\nfunction hasNamespaces(ns1, ns2) {\n return !ns2 || !some.call(ns2, (ns) => ns1.indexOf(ns) < 0);\n}\n// @require ./get_events_cache.ts\n// @require ./has_namespaces.ts\n// @require ./parse_event_name.ts\nfunction removeEvent(ele, name, namespaces, selector, callback) {\n const cache = getEventsCache(ele);\n if (!name) {\n for (name in cache) {\n removeEvent(ele, name, namespaces, selector, callback);\n }\n }\n else if (cache[name]) {\n cache[name] = cache[name].filter(([ns, sel, cb]) => {\n if ((callback && cb.guid !== callback.guid) || !hasNamespaces(ns, namespaces) || (selector && selector !== sel))\n return true;\n ele.removeEventListener(name, cb);\n });\n }\n}\nfn.off = function (eventFullName, selector, callback) {\n if (isUndefined(eventFullName)) {\n this.each((i, ele) => {\n if (!isElement(ele) && !isDocument(ele) && !isWindow(ele))\n return;\n removeEvent(ele);\n });\n }\n else if (!isString(eventFullName)) {\n for (const key in eventFullName) {\n this.off(key, eventFullName[key]);\n }\n }\n else {\n if (isFunction(selector)) {\n callback = selector;\n selector = '';\n }\n each(getSplitValues(eventFullName), (i, eventFullName) => {\n const [nameOriginal, namespaces] = parseEventName(eventFullName);\n const name = getEventNameBubbling(nameOriginal);\n this.each((i, ele) => {\n if (!isElement(ele) && !isDocument(ele) && !isWindow(ele))\n return;\n removeEvent(ele, name, namespaces, selector, callback);\n });\n });\n }\n return this;\n};\nfn.remove = function (comparator) {\n filtered(this, comparator).detach().off();\n return this;\n};\nfn.replaceWith = function (selector) {\n return this.before(selector).remove();\n};\nfn.replaceAll = function (selector) {\n cash(selector).replaceWith(this);\n return this;\n};\nfunction on(eventFullName, selector, data, callback, _one) {\n if (!isString(eventFullName)) {\n for (const key in eventFullName) {\n this.on(key, selector, data, eventFullName[key], _one);\n }\n return this;\n }\n if (!isString(selector)) {\n if (isUndefined(selector) || isNull(selector)) {\n selector = '';\n }\n else if (isUndefined(data)) {\n data = selector;\n selector = '';\n }\n else {\n callback = data;\n data = selector;\n selector = '';\n }\n }\n if (!isFunction(callback)) {\n callback = data;\n data = undefined;\n }\n if (!callback)\n return this;\n each(getSplitValues(eventFullName), (i, eventFullName) => {\n const [nameOriginal, namespaces] = parseEventName(eventFullName);\n const name = getEventNameBubbling(nameOriginal);\n const isEventHover = (nameOriginal in eventsHover);\n const isEventFocus = (nameOriginal in eventsFocus);\n if (!name)\n return;\n this.each((i, ele) => {\n if (!isElement(ele) && !isDocument(ele) && !isWindow(ele))\n return;\n const finalCallback = function (event) {\n if (event.target[`___i${event.type}`])\n return event.stopImmediatePropagation(); // Ignoring native event in favor of the upcoming custom one\n if (event.namespace && !hasNamespaces(namespaces, event.namespace.split(eventsNamespacesSeparator)))\n return;\n if (!selector && ((isEventFocus && (event.target !== ele || event.___ot === name)) || (isEventHover && event.relatedTarget && ele.contains(event.relatedTarget))))\n return;\n let thisArg = ele;\n if (selector) {\n let target = event.target;\n while (!matches(target, selector)) {\n if (target === ele)\n return;\n target = target.parentNode;\n if (!target)\n return;\n }\n thisArg = target;\n }\n Object.defineProperty(event, 'currentTarget', {\n configurable: true,\n get() {\n return thisArg;\n }\n });\n Object.defineProperty(event, 'delegateTarget', {\n configurable: true,\n get() {\n return ele;\n }\n });\n Object.defineProperty(event, 'data', {\n configurable: true,\n get() {\n return data;\n }\n });\n const returnValue = callback.call(thisArg, event, event.___td);\n if (_one) {\n removeEvent(ele, name, namespaces, selector, finalCallback);\n }\n if (returnValue === false) {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n finalCallback.guid = callback.guid = (callback.guid || cash.guid++);\n addEvent(ele, name, namespaces, selector, finalCallback);\n });\n });\n return this;\n}\nfn.on = on;\nfunction one(eventFullName, selector, data, callback) {\n return this.on(eventFullName, selector, data, callback, true);\n}\n;\nfn.one = one;\nconst queryEncodeCRLFRe = /\\r?\\n/g;\nfunction queryEncode(prop, value) {\n return `&${encodeURIComponent(prop)}=${encodeURIComponent(value.replace(queryEncodeCRLFRe, '\\r\\n'))}`;\n}\nconst skippableRe = /file|reset|submit|button|image/i;\nconst checkableRe = /radio|checkbox/i;\nfn.serialize = function () {\n let query = '';\n this.each((i, ele) => {\n each(ele.elements || [ele], (i, ele) => {\n if (ele.disabled || !ele.name || ele.tagName === 'FIELDSET' || skippableRe.test(ele.type) || (checkableRe.test(ele.type) && !ele.checked))\n return;\n const value = getValue(ele);\n if (!isUndefined(value)) {\n const values = isArray(value) ? value : [value];\n each(values, (i, value) => {\n query += queryEncode(ele.name, value);\n });\n }\n });\n });\n return query.slice(1);\n};\n// @require core/types.ts\n// @require core/cash.ts\n// @require core/type_checking.ts\n// @require core/variables.ts\n// @require core/each.ts\n// @require core/extend.ts\n// @require core/find.ts\n// @require core/get_compare_function.ts\n// @require core/get_split_values.ts\n// @require core/guid.ts\n// @require core/parse_html.ts\n// @require core/unique.ts\n// @require attributes/add_class.ts\n// @require attributes/attr.ts\n// @require attributes/has_class.ts\n// @require attributes/prop.ts\n// @require attributes/remove_attr.ts\n// @require attributes/remove_class.ts\n// @require attributes/remove_prop.ts\n// @require attributes/toggle_class.ts\n// @require collection/add.ts\n// @require collection/each.ts\n// @require collection/eq.ts\n// @require collection/filter.ts\n// @require collection/first.ts\n// @require collection/get.ts\n// @require collection/index.ts\n// @require collection/last.ts\n// @require collection/map.ts\n// @require collection/slice.ts\n// @require css/css.ts\n// @require data/data.ts\n// @require dimensions/inner_outer.ts\n// @require dimensions/normal.ts\n// @require effects/hide.ts\n// @require effects/show.ts\n// @require effects/toggle.ts\n// @require events/off.ts\n// @require events/on.ts\n// @require events/one.ts\n// @require events/ready.ts\n// @require events/trigger.ts\n// @require forms/serialize.ts\n// @require forms/val.ts\n// @require manipulation/after.ts\n// @require manipulation/append.ts\n// @require manipulation/append_to.ts\n// @require manipulation/before.ts\n// @require manipulation/clone.ts\n// @require manipulation/detach.ts\n// @require manipulation/empty.ts\n// @require manipulation/html.ts\n// @require manipulation/insert_after.ts\n// @require manipulation/insert_before.ts\n// @require manipulation/prepend.ts\n// @require manipulation/prepend_to.ts\n// @require manipulation/remove.ts\n// @require manipulation/replace_all.ts\n// @require manipulation/replace_with.ts\n// @require manipulation/text.ts\n// @require manipulation/unwrap.ts\n// @require manipulation/wrap.ts\n// @require manipulation/wrap_all.ts\n// @require manipulation/wrap_inner.ts\n// @require offset/offset.ts\n// @require offset/offset_parent.ts\n// @require offset/position.ts\n// @require traversal/children.ts\n// @require traversal/closest.ts\n// @require traversal/contents.ts\n// @require traversal/find.ts\n// @require traversal/has.ts\n// @require traversal/is.ts\n// @require traversal/next.ts\n// @require traversal/next_all.ts\n// @require traversal/next_until.ts\n// @require traversal/not.ts\n// @require traversal/parent.ts\n// @require traversal/parents.ts\n// @require traversal/parents_until.ts\n// @require traversal/prev.ts\n// @require traversal/prev_all.ts\n// @require traversal/prev_until.ts\n// @require traversal/siblings.ts\n// @no-require extras/get_script.ts\n// @no-require extras/shorthands.ts\n// @require methods.ts\nexport default cash;\nexport { Cash };\n","import $ from 'cash-dom';\nexport type * from 'cash-dom';\n\ndeclare global {\n interface Window {\n $: typeof $\n }\n}\n\nwindow.$ = $;\n\nexport {$, $ as cash};\n","/**\n * Get all values in path from an object\n * @param object The object to access\n * @param pathName Access path\n * @returns All values in path\n * @example\n * const object = {\n * a: [{b: {c: 1}, d: 2}]\n * };\n *\n * deepGetPath(object, 'a[0].b.c'); // Output [[{b: {c: 1}, d: 2}], {b: {c: 1}, {c: 1}, 1]\n */\nexport function deepGetPath(object: object, pathName: string | string[]): (object | undefined)[] {\n if (object === null || object === undefined) {\n return [object, undefined];\n }\n\n if (typeof pathName === 'string') {\n pathName = pathName.split('.');\n }\n\n const fullPath = pathName.join('.');\n let context = object;\n const way = [context];\n while (typeof context === 'object' && context !== null && pathName.length) {\n let name = pathName.shift()!;\n let subName: string | undefined;\n const bracketIndex = name.indexOf('[');\n if (bracketIndex > 0 && bracketIndex < (name.length - 1) && name.endsWith(']')) {\n subName = name.substring(bracketIndex + 1, name.length - 1);\n name = name.substring(0, bracketIndex);\n }\n\n context = (context as Record)[name];\n way.push(context);\n if (subName !== undefined) {\n if (typeof context === 'object' && context !== null) {\n if (context instanceof Map) {\n context = context.get(subName);\n } else {\n context = (context as Record)[subName];\n }\n way.push(context);\n } else {\n throw new Error(`Cannot access property \"${name}[${subName}]\", the full path is \"${fullPath}\".`);\n }\n }\n }\n\n if (pathName.length) {\n throw new Error(`Cannot access property with rest path \"${pathName.join('.')}\", the full path is \"${fullPath}\".`);\n }\n\n return way;\n}\n\n/**\n * Get object inner value with dot-strings\n * @param object The object to access\n * @param pathName Access path\n * @param defaultValue Default value\n * @returns Final value\n * @example\n * const object = {\n * a: [{b: {c: 1}, d: 2}]\n * };\n *\n * deepGetPath(object, 'a[0].b.c'); // Output 1\n * deepGetPath(object, 'a[0].d'); // Output 2\n * deepGetPath(object, 'a'); // Output [{b: {c: 1}, d: 2}]\n */\nexport function deepGet(object: object, pathName: string | string[], defaultValue?: T): T | undefined {\n try {\n const way = deepGetPath(object, pathName);\n const lastValue = way[way.length - 1] as T | undefined;\n return lastValue === undefined ? defaultValue : lastValue;\n } catch (_) {\n return defaultValue;\n }\n}\n","\n/**\n * 格式化字符串\n * @param str 要格式化的字符串\n * @param args 格式化参数\n * @returns 格式化后的字符串\n * @example 通过参数序号格式化\n * const hello = formatString('{0} {1}!', 'Hello', 'world');\n * // hello 值为 'Hello world!'\n */\nexport function formatString(str: string, ...args: unknown[]): string;\n\n/**\n * 格式化字符串\n * @param str 要格式化的字符串\n * @param obj 格式化参数\n * @returns 格式化后的字符串\n * @example 通过对象名称格式化\n * const say = formatString('Say {what} to {who}', {what: 'hello', who: 'you'});\n * // say 值为 'Say hello to you'\n */\nexport function formatString(str: string, obj: Record): string;\n\nexport function formatString(str: string, ...args: [Record] | unknown[]): string {\n if (args.length === 0) {\n return str;\n }\n if (args.length === 1 && typeof args[0] === 'object' && args[0]) {\n const obj = args[0];\n Object.keys(obj).forEach(key => {\n const value = (obj as Record)[key] ?? '';\n str = str.replace(new RegExp(`\\\\{${key}\\\\}`, 'g'), `${value}`);\n });\n return str;\n }\n\n for (let i = 0; i < args.length; i++) {\n const arg = args[i] ?? '';\n str = str.replace(new RegExp(`\\\\{${i}\\\\}`, 'g'), `${arg}`);\n }\n return str;\n}\n\n/**\n * 字节单位表\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nenum BYTE_UNITS {\n B = 1,\n KB = 1024,\n MB = 1024 * 1024,\n GB = 1024 * 1024 * 1024,\n TB = 1024 * 1024 * 1024 * 1024,\n}\n\n/**\n * 格式化字节值为包含单位的字符串\n * @param size 字节大小\n * @param fixed 保留的小数点位数\n * @param unit 单位,如果留空,则自动使用最合适的单位\n * @returns 格式化后的字符串\n */\nexport function formatBytes(size: number, fixed = 2, unit?: keyof typeof BYTE_UNITS) {\n if (Number.isNaN(size)) {\n return '?KB';\n }\n if (!unit) {\n if (size < BYTE_UNITS.KB) {\n unit = 'B';\n } else if (size < BYTE_UNITS.MB) {\n unit = 'KB';\n } else if (size < BYTE_UNITS.GB) {\n unit = 'MB';\n } else if (size < BYTE_UNITS.TB) {\n unit = 'GB';\n } else {\n unit = 'TB';\n }\n }\n\n return (size / BYTE_UNITS[unit]).toFixed(fixed) + unit;\n}\n\n/**\n * 转换带单位的字节字符串为字节数\n * @param str 带单位的字节字符串\n * @returns 字节数\n */\nexport const convertBytes = (str: string) => {\n const pattern = /^[0-9]*(B|KB|MB|GB|TB)$/;\n str = str.toUpperCase();\n const matchRes = str.match(pattern);\n if (!matchRes) {\n return 0;\n }\n const unit = matchRes[1] as keyof typeof BYTE_UNITS;\n str = str.replace(unit, '');\n return Number.parseInt(str, 10) * BYTE_UNITS[unit];\n};\n","import {$} from '../cash';\nimport {deepGet} from '@zui/helpers/src/object/deep-get';\nimport {formatString} from '@zui/helpers/src/format-string';\nimport {I18nLangMap, I18nLangCode, I18nValuesMap} from './types';\n\nlet globalLangCode = (document.documentElement.getAttribute('lang') || 'zh_cn').toLowerCase().replace('-', '_');\n\nlet globalLangMap: I18nLangMap | undefined;\n\nexport function getLangCode() {\n return globalLangCode;\n}\n\nexport function setLangCode(langCode: I18nLangCode) {\n globalLangCode = langCode.toLowerCase().replace('-', '_');\n}\n\nexport function addI18nMap(map: I18nLangMap): void;\nexport function addI18nMap(code: I18nLangCode, values: I18nValuesMap): void;\nexport function addI18nMap(codeOrMap: I18nLangCode | I18nLangMap, values?: I18nValuesMap): void {\n if (!globalLangMap) {\n globalLangMap = {};\n }\n if (typeof codeOrMap === 'string') {\n codeOrMap = {[codeOrMap]: values ?? {}};\n }\n $.extend(true, globalLangMap, codeOrMap);\n}\n\nexport function i18n(maps: I18nLangMap | (I18nLangMap | undefined)[] | undefined, key: string, defaultValue?: T, langCode?: I18nLangCode, globalPrefix?: string): T | undefined;\nexport function i18n(maps: I18nLangMap | (I18nLangMap | undefined)[] | undefined, key: string, args?: string | (string | number)[] | Record, defaultValue?: T, langCode?: I18nLangCode, globalPrefix?: string): T | undefined;\nexport function i18n(maps: I18nLangMap | (I18nLangMap | undefined)[] | undefined, key: string, args?: string | (string | number)[] | Record, defaultValue?: T | I18nLangCode, langCode?: I18nLangCode, globalPrefix?: string): T | undefined {\n if (!Array.isArray(maps)) {\n maps = globalLangMap ? [globalLangMap, maps] : [maps];\n } else if (globalLangMap) {\n maps.unshift(globalLangMap);\n }\n if (typeof args === 'string') {\n globalPrefix = langCode;\n langCode = defaultValue as I18nLangCode;\n defaultValue = args;\n args = undefined;\n }\n const lang = langCode || globalLangCode;\n let value: T | undefined;\n for (const map of maps) {\n if (!map) {\n continue;\n }\n const mapValues = map[lang] || map.default;\n if (!mapValues) {\n continue;\n }\n const mapKey = (globalPrefix && map === globalLangMap) ? `${globalPrefix}.${key}` : key;\n value = deepGet(mapValues, mapKey);\n if (value !== undefined) {\n break;\n }\n }\n if (value === undefined) {\n return defaultValue as T;\n }\n if (args) {\n return formatString(value as string, ...(Array.isArray(args) ? args : [args])) as T;\n }\n return value;\n}\n\nexport function getLang(key: string, args?: string | (string | number)[] | Record, defaultValue?: T, langCode?: I18nLangCode): T | undefined {\n return i18n(undefined, key, args, defaultValue, langCode);\n}\n\ni18n.addLang = addI18nMap;\ni18n.getLang = getLang;\ni18n.getCode = getLangCode;\ni18n.setCode = setLangCode;\ni18n.map = globalLangMap;\n","import {addI18nMap} from './i18n';\n\naddI18nMap({\n 'zh_cn': {\n confirm: '确定',\n save: '保存',\n cancel: '取消',\n delete: '删除',\n reset: '重置',\n add: '添加',\n copy: '复制',\n close: '关闭',\n },\n 'zh_tw': {\n confirm: '確定',\n save: '儲存',\n cancel: '取消',\n delete: '刪除',\n reset: '重置',\n add: '添加',\n Copy: '複製',\n close: '關閉',\n },\n en: {\n confirm: 'Confirm',\n save: 'Save',\n cancel: 'Cancel',\n delete: 'Delete',\n reset: 'Reset',\n add: 'Add',\n copy: 'Copy',\n close: 'Close',\n },\n});\n","import {$} from '@zui/core';\n\nimport type {AjaxCallbackMap, AjaxCompleteCallback, AjaxErrorCallback, AjaxFormItemValue, AjaxSetting, AjaxSuccessCallback} from './types';\n\nfunction setHeader(headers: HeadersInit, name: string, value: string) {\n if (headers instanceof Headers) {\n headers.set(name, value);\n } else if (Array.isArray(headers)) {\n headers.push([name, value]);\n } else {\n headers[name] = value;\n }\n}\n\nfunction setFormItem(formData: FormData, name: string, value: AjaxFormItemValue | AjaxFormItemValue[] | Record) {\n if (value === undefined || value === null) {\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((v) => setFormItem(formData, name, v));\n } else if (!(value instanceof Blob) && $.isPlainObject(value)) {\n Object.entries(value).forEach(([key, v]) => {\n setFormItem(formData, `${name}[${key}]`, v);\n });\n } else {\n formData.append(name, value instanceof Blob ? value : String(value));\n }\n}\n\nfunction getDataType(contentType: string | undefined | null, accepts: Record | undefined) {\n if (contentType) {\n const map = {\n text: 'text/plain',\n html: 'text/html',\n json: 'application/json',\n ...accepts,\n };\n for (const [key, value] of Object.entries(map)) {\n if (value.split(',').map(x => x.trim()).includes(contentType)) {\n return key;\n }\n }\n }\n\n return 'text';\n}\n\nexport function createFormData(data: string | FormData | URLSearchParams | Record | [name: string, value: AjaxFormItemValue][], existingFormData?: FormData): FormData {\n const formData = existingFormData || new FormData();\n if (data) {\n if (typeof data === 'string') {\n data = new URLSearchParams(data);\n }\n if (data instanceof URLSearchParams) {\n data.forEach((value, name) => {\n setFormItem(formData, name, value);\n });\n } else if (Array.isArray(data)) {\n data.forEach(([name, value]) => {\n setFormItem(formData, name, value);\n });\n } else if (data instanceof FormData) {\n data.forEach((value, name) => {\n setFormItem(formData, name, value);\n });\n } else if ($.isPlainObject(data)) {\n Object.entries(data).forEach(([name, value]) => {\n setFormItem(formData, name, value);\n });\n }\n }\n return formData;\n}\n\nexport class Ajax {\n private declare _timeoutID: number;\n\n private _controller: AbortController;\n\n private _callbacks: {[P in keyof AjaxCallbackMap]: AjaxCallbackMap[P][];};\n\n private declare _abortError?: Error;\n\n setting: AjaxSetting;\n\n declare data: T;\n\n declare error: Error;\n\n declare response: Response;\n\n declare url: string;\n\n declare request: RequestInit;\n\n get completed() {\n return this.data !== undefined || this.error !== undefined;\n }\n\n get [Symbol.toStringTag]() {\n return 'Ajax';\n }\n\n constructor(setting: AjaxSetting) {\n this.setting = setting;\n this._controller = new AbortController();\n this._callbacks = {success: [], error: [], complete: []};\n }\n\n on(name: N, callback: AjaxCallbackMap[N]) {\n (this._callbacks[name]).push(callback);\n return this;\n }\n\n success(calback: AjaxSuccessCallback) {\n return this.on('success', calback);\n }\n\n done(calback: AjaxSuccessCallback) {\n return this.success(calback);\n }\n\n fail(calback: AjaxErrorCallback) {\n return this.on('error', calback);\n }\n\n complete(calback: AjaxCompleteCallback) {\n return this.on('complete', calback);\n }\n\n always(calback: AjaxCompleteCallback) {\n return this.complete(calback);\n }\n\n then(resolve: (data: T) => void, reject?: (error: Error) => void) {\n if (this.completed) {\n if (reject && this.error) {\n reject(this.error);\n } else {\n resolve(this.data);\n }\n } else {\n this.success((data) => resolve(data as T));\n if (reject) {\n this.fail(reject);\n }\n }\n return this;\n }\n\n catch(calback: (error: Error) => void) {\n if (this.error) {\n calback(this.error);\n return this;\n }\n return this.on('error', (error) => calback(error));\n }\n\n finally(onFinally: () => void) {\n if (this.completed) {\n onFinally();\n return this;\n }\n return this.complete(() => onFinally());\n }\n\n abort(abortError?: Error) {\n if (this.completed) {\n return false;\n }\n this._abortError = abortError;\n this._controller.abort();\n return true;\n }\n\n getResponseHeader(name: string) {\n return this.response?.headers.get(name);\n }\n\n private _init() {\n if (this.completed) {\n return;\n }\n const {\n url,\n type,\n data,\n processData = true,\n contentType,\n crossDomain,\n accepts,\n dataType,\n timeout,\n dataFilter,\n beforeSend,\n success,\n error,\n complete,\n ...initOptions\n } = this.setting;\n\n if (beforeSend?.(initOptions) === false) {\n return;\n }\n if (type) {\n initOptions.method = type;\n }\n let dataSetting = data;\n if (dataSetting) {\n if (processData) {\n dataSetting = createFormData(dataSetting);\n }\n initOptions.body = dataSetting as BodyInit;\n }\n if (crossDomain) {\n initOptions.mode = 'cors';\n }\n const headers = initOptions.headers || {};\n setHeader(headers, 'X-Requested-With', 'XMLHttpRequest');\n if (contentType) {\n setHeader(headers, 'Content-Type', contentType);\n }\n initOptions.headers = headers;\n\n if (initOptions.signal) {\n initOptions.signal.addEventListener('abort', () => {\n this.abort();\n });\n }\n if (success) {\n this.success(success);\n }\n if (error) {\n this.fail(error);\n }\n if (complete) {\n this.complete(complete);\n }\n initOptions.signal = this._controller.signal;\n this.url = url;\n this.request = initOptions;\n }\n\n private _emit(name: N, ...args: Parameters) {\n this._callbacks[name].forEach((callback) => {\n callback.call(this, ...(args as [arg0: Error & Response, statusText: string, arg2: string & Response]));\n });\n }\n\n async send(): Promise<[data?: D | undefined, error?: Error | undefined, response?: Response | undefined]> {\n if (this.completed) {\n return [];\n }\n this._init();\n\n const {timeout, dataType: dataTypeSetting, accepts, dataFilter, throws, jsonParser} = this.setting;\n if (timeout) {\n this._timeoutID = window.setTimeout(() => {\n this.abort(new Error('timeout'));\n }, timeout);\n }\n\n let response: Response | undefined;\n let error: Error | undefined;\n let data: unknown | undefined;\n try {\n response = await fetch(this.url, this.request);\n this.response = response;\n const {statusText} = response;\n if (response.ok) {\n const isAttachment = response.headers.get('Content-Disposition')?.startsWith('attachment');\n const dataType = isAttachment ? 'blob' : (dataTypeSetting || getDataType(response.headers.get('Content-Type'), accepts));\n if (isAttachment || dataType === 'blob' || dataType === 'file') {\n data = await response.blob();\n } else if (dataType === 'json') {\n if (typeof jsonParser === 'function') {\n data = await response.text();\n data = jsonParser(data as string);\n } else {\n data = await response.json();\n }\n } else {\n data = await response.text();\n }\n this.data = data as T;\n const filteredData = dataFilter?.(data, dataType) ?? data;\n this._emit('success', filteredData, statusText, response);\n } else {\n this.data = await response.text() as T;\n throw new Error(statusText);\n }\n } catch (err) {\n if (this.data === undefined && data !== undefined) {\n this.data = data as T;\n }\n error = err as Error;\n let skipTriggerError = false;\n if (error.name === 'AbortError') {\n if (this._abortError) {\n error = this._abortError;\n } else {\n skipTriggerError = true;\n }\n }\n this.error = error;\n if (!skipTriggerError) {\n this._emit('error', error, response?.statusText, error.message);\n }\n }\n\n if (this._timeoutID) {\n clearTimeout(this._timeoutID);\n }\n\n this._emit('complete', response, response?.statusText);\n if (error && throws) {\n throw error;\n }\n return [data as D, error, response];\n }\n}\n","import {$, Cash} from '@zui/core';\nimport {Ajax} from './ajax';\nimport type {AjaxFormData, AjaxSetting, AjaxSuccessCallback} from './types';\n\n/* Declare types. */\ndeclare module 'cash-dom' {\n interface CashStatic {\n ajax(urlOrSetting: string | AjaxSetting, setting?: Partial): Ajax;\n\n getJSON(url: string, dataOrSuccess?: AjaxFormData | AjaxSuccessCallback, success?: AjaxSuccessCallback): Ajax;\n\n get(url: string, dataOrSuccess?: AjaxFormData | AjaxSuccessCallback, successOrDataType?: AjaxSuccessCallback | string, dataType?: string, method?: string): Ajax;\n\n post(url: string, dataOrSuccess?: AjaxFormData | AjaxSuccessCallback, successOrDataType?: AjaxSuccessCallback | string, dataType?: string): Ajax;\n }\n\n interface Cash {\n load(this: Cash, url: string, dataOrSuccess?: AjaxFormData | AjaxSuccessCallback, success?: AjaxSuccessCallback): Cash;\n }\n}\n\n/* Extend as $.ajax() to create ajax for cash. */\n$.ajax = (urlOrSetting: string | AjaxSetting, setting?: Partial) => {\n setting = setting || {};\n if (typeof urlOrSetting === 'string') {\n setting.url = urlOrSetting;\n } else {\n $.extend(setting, urlOrSetting);\n }\n const ajax = new Ajax(setting as AjaxSetting);\n ajax.send();\n return ajax;\n};\n\n/* Extend as $.getJSON() to create getJSON for cash. */\n$.getJSON = (url: string, dataOrSuccess?: AjaxFormData | AjaxSuccessCallback, success?: AjaxSuccessCallback) => {\n if (typeof dataOrSuccess === 'function') {\n success = dataOrSuccess;\n dataOrSuccess = undefined;\n }\n return $.ajax({\n url,\n data: dataOrSuccess,\n success,\n dataType: 'json',\n });\n};\n\n/* Extend as $.get() to create get for cash. */\n$.get = (url: string, dataOrSuccess?: AjaxFormData | AjaxSuccessCallback, successOrDataType?: AjaxSuccessCallback | string, dataType?: string, method = 'GET') => {\n let success: AjaxSuccessCallback | undefined;\n let data: AjaxFormData | undefined;\n if (typeof dataOrSuccess === 'function') {\n success = dataOrSuccess;\n data = undefined;\n } else {\n data = dataOrSuccess;\n }\n if (typeof successOrDataType === 'function') {\n success = successOrDataType;\n dataType = undefined;\n } else {\n dataType = successOrDataType;\n }\n return $.ajax({\n method,\n url,\n data,\n success,\n dataType,\n });\n};\n\n/* Extend as $.post() to create post for cash. */\n$.post = (url: string, dataOrSuccess?: AjaxFormData | AjaxSuccessCallback, successOrDataType?: AjaxSuccessCallback | string, dataType?: string) => {\n return $.get(url, dataOrSuccess, successOrDataType, dataType, 'POST');\n};\n\n/* Extend as $.load() to create load for cash. */\n$.fn.load = function (this: Cash, url: string, dataOrSuccess?: AjaxFormData | AjaxSuccessCallback, success?: AjaxSuccessCallback): Cash {\n if (typeof dataOrSuccess === 'function') {\n success = dataOrSuccess;\n dataOrSuccess = undefined;\n }\n const [realUrl, selector] = url.split(' ');\n $.get(realUrl, dataOrSuccess, (data, statusText, response) => {\n if (selector) {\n data = $(data as string).find(selector).html();\n }\n $(this).html(data as string).zuiInit();\n success?.call(this, data, statusText, response);\n }, 'html');\n return this;\n};\n","import {$} from '../cash';\nimport {Ajax} from './ajax';\nimport type {AjaxSetting, FetcherSetting} from './types';\n\nexport async function fetchData(setting: FetcherSetting, args: A = ([] as unknown as A), extraAjaxSetting?: Partial | ((ajaxSetting: AjaxSetting) => Partial)): Promise {\n const ajaxSetting = {throws: true, dataType: 'json'} as AjaxSetting;\n if (typeof setting === 'string') {\n ajaxSetting.url = setting;\n } else if (typeof setting === 'object') {\n $.extend(ajaxSetting, setting);\n } else if (typeof setting === 'function') {\n const result = setting(...args);\n if (result instanceof Promise) {\n const data = await result;\n return data;\n }\n return result;\n }\n if (extraAjaxSetting) {\n $.extend(ajaxSetting, typeof extraAjaxSetting === 'function' ? extraAjaxSetting(ajaxSetting) : extraAjaxSetting);\n }\n const ajax = new Ajax(ajaxSetting);\n const [data] = await ajax.send();\n return data as T;\n}\n\nexport function isFetchSetting(setting: FetcherSetting | unknown): setting is FetcherSetting {\n return !!(setting && (typeof setting === 'string' || (typeof setting === 'object' && (setting as AjaxSetting).url) || typeof setting === 'function'));\n}\n\ndeclare module 'cash-dom' {\n interface CashStatic {\n fetch(setting: FetcherSetting, args?: A, extraAjaxSetting?: Partial | ((ajaxSetting: AjaxSetting) => Partial)): Promise\n }\n}\n\n$.fetch = fetchData;\n","import {$} from '../cash';\n\nexport function nextGid() {\n return $.guid++;\n}\n","export function isDiff(value1: unknown, value2: unknown) {\n if (value1 === value2) {\n return false;\n }\n if (value1 && value2) {\n const typeOfValue1 = typeof value1;\n const typeOfValue2 = typeof value2;\n if (typeOfValue1 !== typeOfValue2) {\n return true;\n }\n if (typeOfValue1 === 'object' && typeOfValue2 === 'object') {\n const isArray1 = Array.isArray(value1);\n const isArray2 = Array.isArray(value2);\n if (isArray1 !== isArray2) {\n return true;\n }\n if (isArray1 && isArray2) {\n if (value1.length !== value2.length) {\n return true;\n }\n for (let i = 0; i < value1.length; i++) {\n if (isDiff(value1[i], value2[i])) {\n return true;\n }\n }\n return true;\n }\n\n const keys1 = Object.keys(value1);\n const keys2 = Object.keys(value2);\n if (keys1.length !== keys2.length) {\n return true;\n }\n for (const key of keys1) {\n if (isDiff((value1 as Record)[key], (value2 as Record)[key])) {\n return true;\n }\n }\n return true;\n }\n if (typeOfValue1 === 'function' && typeOfValue2 === 'function') {\n return value1.toString() !== value2.toString();\n }\n }\n return true;\n}\n","import {isDiff} from './is-diff';\n\n/**\n * A class representing a computed value that can be cached and recomputed when its dependencies change.\n * @template T The type of the computed value.\n * @template D The type of the dependencies array.\n */\nexport class Computed {\n /**\n * The dependencies of the computed value.\n */\n protected _dependencies: D | (() => D);\n\n /**\n * The function that computes the value.\n */\n protected _compute: () => T;\n\n /**\n * The cached value of the computed value.\n */\n protected _value?: T;\n\n /**\n * The last dependencies array used to compute the value.\n */\n protected _lastDependencies: D | undefined;\n\n /**\n * Creates a new Computed instance.\n * @param compute The function that computes the value.\n * @param dependencies The dependencies of the computed value.\n */\n constructor(compute: () => T, dependencies: D | (() => D)) {\n this._compute = compute;\n this._dependencies = dependencies;\n }\n\n /**\n * Gets the computed value.\n */\n get value(): T {\n return this.compute();\n }\n\n /**\n * Gets the cached value of the computed value.\n */\n get cache(): T {\n return this._lastDependencies ? this._value as T : this.compute();\n }\n\n /**\n * Set the dependencies of the computed value.\n *\n * @param dependencies The dependencies of the computed value.\n * @returns The computed value.\n */\n depends(dependencies: D | (() => D)) {\n this._dependencies = dependencies;\n return this;\n }\n\n /**\n * Forces the computed value to be recomputed.\n * @param dependencies The new dependencies to use for recomputing the value.\n * @returns The recomputed value.\n */\n forceCompute(dependencies?: D | (() => D)) {\n this._lastDependencies = undefined;\n return this.compute(dependencies);\n }\n\n /**\n * Computes the value of the computed value.\n * @param dependencies The dependencies to use for computing the value.\n * @returns The computed value.\n */\n compute(dependencies?: D | (() => D)): T {\n if (dependencies !== undefined) {\n this._dependencies = dependencies;\n }\n\n dependencies = this._dependencies;\n if (typeof dependencies === 'function') {\n dependencies = dependencies();\n }\n\n // Check if dependencies changed.\n const lastDependencies = this._lastDependencies;\n if (!lastDependencies || dependencies.some((dept, index) => {\n return isDiff(dept instanceof Computed ? dept.value : dept, lastDependencies[index]);\n })) {\n this._value = this._compute();\n this._lastDependencies = dependencies.map(x => x instanceof Computed ? x.cache : x) as D;\n }\n\n return this._value as T;\n }\n}\n\n/**\n * Creates a new computed value.\n *\n * @param compute The function that computes the value.\n * @param dependencies The dependencies of the computed value.\n * @returns\n */\nexport function computed(compute: () => T, dependencies?: D | (() => D)) {\n return new Computed(compute, dependencies || []);\n}\n","import {$, Cash} from '../cash';\n\n/**\n * Classname like.\n */\nexport type ClassNameLike = string | null | undefined | boolean | {[key: string]: unknown} | (() => ClassNameLike) | ClassNameLike[];\n\n/**\n * Classname setting.\n */\nexport type ClassNameSetting = [name: string, toggle: boolean];\n\n/**\n * Get class name setting list from arguments.\n *\n * @param args Classname like arguments.\n * @returns Classname setting list.\n */\nexport function getClassList(...args: ClassNameLike[]): ClassNameSetting[] {\n const settings: ClassNameSetting[] = [];\n\n /* Indexes map to keep classname's order. */\n const indexes = new Map();\n\n const setSetting = (name: string | [name: string, toggle?: unknown], toggle?: unknown) => {\n if (Array.isArray(name)) {\n toggle = name[1];\n name = name[0];\n }\n if (!name.length) {\n return;\n }\n const index = indexes.get(name);\n if (typeof index === 'number') {\n settings[index][1] = !!toggle;\n } else {\n indexes.set(name, settings.length);\n settings.push([name, !!toggle]);\n }\n };\n\n args.forEach((arg) => {\n if (typeof arg === 'function') {\n arg = arg();\n }\n\n if (Array.isArray(arg)) {\n getClassList(...arg).forEach(setSetting);\n } else if (arg && typeof arg === 'object') {\n Object.entries(arg).forEach(setSetting);\n } else if (typeof arg === 'string') {\n arg.split(' ').forEach(name => setSetting(name, true));\n }\n });\n\n return settings.sort((a, b) => (indexes.get(a[0]) || 0) - (indexes.get(b[0]) || 0));\n}\n\n/**\n * Get classname string from arguments.\n *\n * @param args Classname like arguments.\n * @returns Classname string.\n */\nexport const classes = (...args: ClassNameLike[]): string => {\n return getClassList(...args).reduce((classList, [name, toggle]) => {\n if (toggle) {\n classList.push(name);\n }\n return classList;\n }, []).join(' ');\n};\n\n/* Declare types. */\ndeclare module 'cash-dom' {\n interface CashStatic {\n classes(...args: ClassNameLike[]): string;\n }\n\n interface Cash {\n setClass(merge: ClassNameLike | boolean, ...args: ClassNameLike[]): Cash;\n }\n}\n\n/* Extend as $.classes() */\n$.classes = classes;\n\n/* Extend as $.fn.setClass() */\n$.fn.setClass = function (this: Cash, merge: ClassNameLike | boolean, ...args: ClassNameLike[]): Cash {\n return this.each((_, ele) => {\n const $ele = $(ele);\n if (merge === true) {\n $ele.attr('class', classes($ele.attr('class'), ...args));\n } else {\n $ele.addClass(classes(merge, ...args));\n }\n });\n};\n","import {$, Cash} from '../cash';\n\n/**\n * Cache for data associated with the target object.\n */\nconst cache = new WeakMap>();\n\n/**\n * Store data associated with the target object with key value in the cache.\n *\n * @param target Target object to store data.\n * @param key Key to store.\n * @param value Value to store.\n */\nexport function storeData(target: object, key: string | null, value?: unknown): void;\n\n/**\n * Store data associated with the target object in the cache.\n *\n * @param target Target object to store data.\n * @param data Data to store.\n */\nexport function storeData(target: object, data: Record): void;\n\n/**\n * Store data associated with the target object in the cache.\n *\n * @param target Target object to store data.\n * @param keyOrData Key or data to store.\n * @param value Value to store.\n */\nexport function storeData(target: object, keyOrData: string | Record | null, value?: unknown): void {\n const hasCache = cache.has(target);\n const data = hasCache ? cache.get(target)! : {};\n if (typeof keyOrData === 'string') {\n data[keyOrData] = value;\n } else if (keyOrData === null) {\n Object.keys(data).forEach((key) => {\n delete data[key];\n });\n } else {\n Object.assign(data, keyOrData);\n }\n\n Object.keys(data).forEach((key) => {\n if (data[key] === undefined) {\n delete data[key];\n }\n });\n\n if (Object.keys(data).length) {\n if (!hasCache && target instanceof Element) {\n Object.assign(data, $(target).dataset(), data);\n }\n cache.set(target, data);\n } else {\n cache.delete(target);\n }\n}\n\n/**\n * Take data associated with the target object from the cache.\n *\n * @param target Target object to take data.\n */\nexport function takeData(target: object): Record;\n\n/**\n * Take data associated by key with the target object from the cache.\n *\n * @param target Target object to take data.\n * @param key Key to take.\n */\nexport function takeData(target: object, key: string): unknown;\n\n/**\n * Take data associated by key with the target object from the cache.\n *\n * @param target Target object to take data.\n * @param key Key to take.\n * @param mergeElementData Whether to merge element dataset.\n */\nexport function takeData(target: object, key: string | undefined, mergeElementData: boolean): unknown;\n\n/**\n * Take data associated with the target object from the cache.\n *\n * @param target Target object to take data.\n * @param key Key to take.\n * @param mergeElementData Whether to merge element dataset.\n * @returns Data associated with the target object.\n */\nexport function takeData(target: object, key?: string, mergeElementData?: boolean): unknown {\n let data = cache.get(target) || {};\n if (mergeElementData && target instanceof Element) {\n data = Object.assign({}, $(target).dataset(), data);\n }\n if (key === undefined) {\n return data;\n }\n return data[key];\n}\n\n/**\n * Clear data associated with the target object from the cache.\n */\nexport function clearData(target: object): void {\n cache.delete(target);\n}\n\n/* Declare types. */\ndeclare module 'cash-dom' {\n interface Cash {\n dataset(): Record | undefined;\n dataset(name: string): unknown | undefined;\n dataset(name: string, value: unknown): Cash;\n dataset(dataset: Record): Cash;\n\n removeData(name?: string): Cash;\n }\n}\n\n/* Backup the origin $.fn.data method. */\n$.fn.dataset = $.fn.data;\n\n/* Extend as $.fn.data() */\n$.fn.data = function (this: Cash, ...args: (string | Record | unknown)[]) {\n const [data, value] = args;\n if (!args.length || (args.length === 1 && typeof data === 'string')) {\n if (!this.length) {\n return;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return takeData(this[0]!, data as string, true) as any;\n }\n return this.each((_, ele) => {\n return storeData(ele, data as string, value);\n });\n};\n\n/* Extend as $.fn.removeData() */\n$.fn.removeData = function (this: Cash, name: string | null = null) {\n return this.each((_, ele) => {\n return storeData(ele, name);\n });\n};\n","export function evalValue(value: string, ...args: unknown[]): T {\n if (value.includes('RAWJS')) {\n value = value.split('\"RAWJS<').join('').split('>RAWJS\"').join('').split('').join('\"').split('').join('\\n');\n }\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n const func = new Function(`return ${value}`);\n return func(...args);\n}\n\nexport function parseRawData(data: string, ...args: unknown[]): T {\n if (data.includes('RAWJS')) {\n return evalValue(data, ...args);\n }\n\n return JSON.parse(data);\n}\n","import {$, Cash, Selector} from '../cash';\nimport {evalValue} from './raw-data';\n\n/* Declare types. */\ndeclare module 'cash-dom' {\n interface Cash {\n z(): Record | undefined;\n z(name: string): unknown | undefined;\n z(name: string, value: unknown): Cash;\n z(data: Record): Cash;\n }\n}\n\ntype ZDataGetterOptions = {\n prefix?: string;\n evalValue?: boolean | string[];\n evalArgs?: unknown[];\n json?: boolean;\n getter?: (name: string, value: unknown) => unknown;\n};\n\nexport function getZData(selector: Selector, prefixOrOptions?: ZDataGetterOptions | string): Record | undefined {\n const element = $(selector)[0];\n if (!element) {\n return;\n }\n const {prefix, getter, evalValue: evalValueSetting, json = true, evalArgs = []} = {\n prefix: 'z-',\n ...(typeof prefixOrOptions === 'string' ? {prefix: prefixOrOptions} : prefixOrOptions),\n };\n const evalValueSet = Array.isArray(evalValueSetting) ? new Set(evalValueSetting) : undefined;\n return Array.from(element.attributes).reduce>((data, attribute) => {\n let {name} = attribute;\n const {value} = attribute;\n let finalValue: unknown = value;\n if (name.startsWith(prefix)) {\n name = name.slice(prefix.length).replace(/-([a-z])/g, (g) => g[1].toUpperCase());\n if (getter) {\n finalValue = getter(name, value);\n } else {\n try {\n if ((evalValueSetting && (!evalValueSet || evalValueSet.has(name))) || (evalValueSetting === undefined && value.includes('RAWJS'))) {\n finalValue = evalValue(value, ...evalArgs);\n } else if (json) {\n finalValue = JSON.parse(value);\n }\n } catch (error) {\n // Ignore.\n }\n }\n data[name] = finalValue;\n }\n return data;\n }, {});\n}\n\nexport function setZData(selector: Selector, data: Record, prefix = 'z-') {\n const $element = $(selector);\n Object.keys(data).forEach((name) => {\n let value = data[name];\n if (typeof value === 'function') {\n value = `RAWJS<${value}>RAWJS`;\n }\n if (typeof value !== 'string') {\n value = JSON.stringify(value);\n }\n name = name.replace(/[A-Z]/g, (g) => `-${g.toLowerCase()}`);\n $element.attr(`${prefix}${name}`, value as string);\n });\n}\n\nfunction z(): Record | undefined;\nfunction z(name: string): unknown | undefined;\nfunction z(name: string, value: unknown): Cash;\nfunction z(data: Record): Cash;\nfunction z(this: Cash, ...args: unknown[]): Record | unknown | Cash | undefined {\n const argsLength = args.length;\n if (!argsLength) {\n return getZData(this);\n }\n if (argsLength === 1) {\n const [nameOrData] = args;\n if (typeof nameOrData === 'string') {\n return getZData(this)?.[nameOrData];\n }\n if ($.isPlainObject(nameOrData)) {\n setZData(this, nameOrData);\n }\n return this;\n }\n setZData(this, {[args[0] as string]: args[1]});\n return this;\n}\n\n/* Extend as $.fn.z() */\n$.fn.z = z;\n","import {$, Cash} from '../cash';\n\n/* Declare types. */\ndeclare module 'cash-dom' {\n interface Cash {\n _attr(): undefined;\n _attr(attrs: string): string | null;\n _attr(attrs: string, value: string): this;\n _attr(attrs: Record): this;\n\n attr(attrs: string, value: string | null): Cash;\n attr(attrs: Record): Cash;\n }\n}\n\n/* Backup the origin $.fn.attr() method. */\n$.fn._attr = $.fn.attr;\n\n/* Extend the attr method. */\n$.fn.extend({\n attr(this: Cash, ...args: (string | Record | null)[]): Cash | string | null | undefined {\n const [attrs, value] = args;\n if (!args.length || (args.length === 1 && typeof attrs === 'string')) {\n // eslint-disable-next-line prefer-spread\n return this._attr.apply(this, args as [attrs: Record]);\n }\n if (typeof attrs === 'object') {\n if (attrs) {\n Object.keys(attrs).forEach((key) => {\n const val = attrs[key];\n if (val === null) {\n this.removeAttr(key);\n } else {\n this._attr(key, val);\n }\n });\n }\n return this;\n }\n if (value === null) {\n return this.removeAttr(attrs as string);\n }\n return this._attr(attrs as string, value as string);\n },\n});\n","import {$} from '../cash';\n\n/**\n * Cash event.\n */\ntype CashEvent = Exclude[0], string>;\n\n/* Declare types. */\ndeclare module 'cash-dom' {\n interface CashStatic {\n Event(event: string, data?: unknown): CashEvent;\n }\n}\n\n/* Extend as $.Event() to create custom event for cash. */\nif (!$.Event) {\n $.Event = (event: string, data?: unknown): CashEvent => {\n const [name, ...namespaces] = event.split('.');\n const eventObject = new Event(name, {\n bubbles: true,\n cancelable: true,\n });\n (eventObject as Event & {namespace: string}).namespace = namespaces.join('.');\n (eventObject as Event & {___ot: string}).___ot = name;\n (eventObject as Event & {___td: unknown}).___td = data;\n return eventObject as unknown as CashEvent;\n };\n}\n","export const delay = (ms: number, setTimerID?: (timerID: number) => void) => new Promise(resolve => {\n const id = window.setTimeout(resolve, ms);\n if (setTimerID) {\n setTimerID(id);\n }\n});\n","import {$} from '../cash';\n\nexport const shareData: Record = {};\n\n/* Declare types. */\ndeclare module 'cash-dom' {\n interface CashStatic {\n share: Record;\n }\n}\n\n/** Define $.share helper. */\n$.share = shareData;\n","var n,l,u,t,i,o,r,f,e,c,s,a,h={},p=[],v=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function d(n,l){for(var u in l)n[u]=l[u];return n}function w(n){var l=n.parentNode;l&&l.removeChild(n)}function _(l,u,t){var i,o,r,f={};for(r in u)\"key\"==r?i=u[r]:\"ref\"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),\"function\"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return g(l,f,i,o,null)}function g(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++u:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(f),f}function m(){return{current:null}}function k(n){return n.children}function b(n,l){this.props=n,this.context=l}function x(n,l){if(null==l)return n.__?x(n.__,n.__i+1):null;for(var u;lu&&i.sort(f));P.__r=0}function S(n,l,u,t,i,o,r,f,e,c,s){var a,v,y,d,w,_=t&&t.__k||p,g=l.length;for(u.__d=e,$(u,l,_),e=u.__d,a=0;a0?g(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=n,i.__b=n.__b+1,f=L(i,u,r,s),i.__i=f,o=null,-1!==f&&(s--,(o=u[f])&&(o.__u|=131072)),null==o||null===o.__v?(-1==f&&a--,\"function\"!=typeof i.type&&(i.__u|=65536)):f!==r&&(f==r-1?a=f-r:f==r+1?a++:f>r?s>e-r?a+=f-r:a--:f(null!=e&&0==(131072&e.__u)?1:0))for(;r>=0||f=0){if((e=l[r])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return r;r--}if(f2&&(e.children=arguments.length>3?n.call(arguments,2):t),g(l.type,e,i||l.key,o||l.ref,null)}function G(n,l){var u={__c:l=\"__cC\"+a++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=[],(t={})[l]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(function(n){n.__e=!0,M(n)})},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=p.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},b.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),\"function\"==typeof n&&(n=n(d({},u),this.props)),n&&d(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},b.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},b.prototype.render=k,i=[],r=\"function\"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(n,l){return n.__v.__b-l.__v.__b},P.__r=0,e=0,c=F(!1),s=F(!0),a=0;export{b as Component,k as Fragment,E as cloneElement,G as createContext,_ as createElement,m as createRef,_ as h,D as hydrate,t as isValidElement,l as options,B as render,H as toChildArray};\n//# sourceMappingURL=preact.module.js.map\n","import {ComponentChildren, toChildArray} from 'preact';\nimport {$} from '../cash';\n\nexport function mergeProps = Record>(props: Record, ...args: unknown[]) {\n args.forEach(arg => {\n if (!arg || typeof arg !== 'object') {\n return;\n }\n Object.keys(arg as Partial).forEach(key => {\n let value = (arg as Record)[key];\n const oldValue = props[key];\n if (value === oldValue) {\n return;\n }\n if (oldValue !== undefined) {\n if (key === 'className' || key.endsWith('Class')) {\n value = [oldValue, value];\n } else if (key === 'children') {\n value = [...toChildArray(oldValue), ...toChildArray(value as ComponentChildren)];\n } else if (typeof oldValue == 'object' && (key === 'style' || key.endsWith('Style') || key === 'attrs' || key.endsWith('Attrs') || key === 'props')) {\n value = $.extend(oldValue, value);\n }\n }\n props[key] = value;\n });\n });\n return props;\n}\n\nexport function removeUndefinedProps(props: Record) {\n Object.keys(props).forEach(key => {\n if (props[key] === undefined) {\n delete props[key];\n }\n });\n return props;\n}\n","import {$, Cash, Selector} from '../cash';\n\n/* Declare types. */\ndeclare module 'cash-dom' {\n interface Cash {\n disableScroll(disable?: boolean): Cash;\n enableScroll(enable?: boolean): Cash;\n }\n}\n\nexport function disableScroll(selector: Selector, disable = true): void {\n const $element = $(selector);\n const element = $element[0] as HTMLElement;\n const dataName = 'zui-disable-scroll';\n if (disable) {\n if ($element.data(dataName)) {\n return;\n }\n if (($element.css('scrollbar-gutter') || '').includes('stable')) {\n $element.data(dataName, {overflow: $element.css('overflow')}).css('overflow', 'hidden');\n return;\n }\n const scrollbarWidth = (element === document.body || $element.is('html')) ? (window.innerWidth - document.body.clientWidth) : (element.offsetWidth - element.clientWidth);\n if (!scrollbarWidth) {\n return;\n }\n const paddingRight = $element.css('paddingRight') || '0';\n $element.data(dataName, {\n paddingRight: paddingRight,\n overflow: $element.css('overflow'),\n }).css({\n paddingRight: `${scrollbarWidth + Number.parseInt(paddingRight, 10)}px`,\n overflow: 'hidden',\n });\n } else {\n const oldStyle = $element.data(dataName);\n if (!oldStyle) {\n return;\n }\n $element.css(oldStyle).removeData(dataName);\n }\n}\n\n/* Extend as $.fn.disableScroll() */\n$.fn.disableScroll = function (this: Cash, disable = true): Cash {\n return this.each((_, ele) => {\n disableScroll(ele, disable);\n });\n};\n\n$.fn.enableScroll = function (this: Cash, enable = true): Cash {\n return this.disableScroll(!enable);\n};\n","import {$, Cash} from '../cash';\nimport {evalValue} from './raw-data';\nimport {deepGet} from '@zui/helpers/src/object/deep-get';\nimport {getZData} from './z';\n\nexport type GlobalEventOptions = {\n on: string;\n selector?: string;\n prevent?: boolean;\n stop?: boolean;\n call?: string | ((...args: unknown[]) => void);\n self?: boolean;\n params?: unknown[] | string;\n once?: boolean;\n if?: string | ((...args: unknown[]) => boolean);\n do?: string | ((...args: unknown[]) => void);\n [option: string]: unknown;\n};\n\nfunction processGlobalEvent($element: Cash, event: Event, options: GlobalEventOptions) {\n if (!(options.on as string || 'click').split(' ').includes(event.type)) {\n return;\n }\n const $target = options.selector ? $(event.target as HTMLElement).closest(options.selector as string) : $element;\n if (!$target.length) {\n return;\n }\n const parseBool = (value: unknown) => {\n return value === '' ? true : value;\n };\n const parseVal = (value: unknown) => {\n if (typeof value === 'string') {\n try {\n value = JSON.parse(value);\n // eslint-disable-next-line no-empty\n } catch (_) {}\n }\n return value;\n };\n if (parseBool(options.once)) {\n if (options.onceCalled) {\n return;\n }\n $element.dataset('once-called', true);\n }\n if (parseBool(options.prevent)) {\n event.preventDefault();\n }\n if (parseBool(options.stop)) {\n event.stopPropagation();\n }\n if (parseBool(options.self) && event.currentTarget !== event.target) {\n return;\n }\n\n const runParams: [string, unknown][] = [['$element', $element], ['event', event], ['options', options], ['$target', $target]];\n const runCode = (code: string | ((...args: unknown[]) => boolean)) => {\n if (typeof code === 'function') {\n return code(...runParams);\n }\n return $.runJS(code as string, ...runParams);\n };\n if (options.if !== undefined && !runCode(options.if)) {\n return;\n }\n\n const call = options.call;\n if (call) {\n let callback: unknown;\n if (typeof call === 'string') {\n const isFuncName = /^[$A-Z_][0-9A-Z_$.]*$/i.test(call);\n callback = isFuncName ? deepGet(window, call) : runCode(call);\n } else {\n callback = call;\n }\n if (typeof callback === 'function') {\n const params: unknown[] = [];\n const paramsOption = options.params;\n options.params = params;\n if (typeof paramsOption === 'string' && paramsOption.length) {\n if (paramsOption[0] === '[') {\n params.push(...(parseVal(paramsOption) as unknown[]));\n } else {\n params.push(...paramsOption.split(', ').map(x => {\n x = x.trim();\n if (x === '$element') return $element;\n if (x === 'event') return event;\n if (x === 'options') return options;\n if (x.startsWith('$element.') || x.startsWith('event.') || x.startsWith('options.')) return runCode(x);\n return parseVal(x);\n }));\n }\n } else if (Array.isArray(paramsOption)) {\n params.push(...paramsOption);\n } else {\n params.push(paramsOption);\n }\n callback(...params);\n }\n }\n\n if (options.do) {\n runCode(options.do as string);\n }\n}\n\n/**\n * Handle global event.\n * @param event The event object\n * @example\n * ```html\n * Click or changed\n * console.log('clicked or changed'), if: () => confirm('continue?')}\">Click or changed\n * Click\n * Click or changed\n * console.log('clicked')}\">Click or changed\n *\n * [data-on] is deprecated\n * ```\n */\nfunction handleGlobalEvent(this: Cash, event: Event) {\n const $element = $(this);\n const type = event.type;\n const zuiOn = $element.attr('zui-on');\n if (zuiOn) {\n const [events, code] = zuiOn.split('~').map(x => x.trim());\n if (events) {\n processGlobalEvent($element, event, $.extend({\n on: events,\n }, code ? (code.startsWith('{') ? evalValue(code) : {do: code}) : getZData($element, {prefix: 'data-', evalValue: ['call', 'if', 'do']})));\n }\n }\n const zuiOnEvent = $element.attr(`zui-on-${type}`);\n if (zuiOnEvent) {\n processGlobalEvent($element, event, $.extend({\n on: type,\n }, zuiOnEvent.startsWith('{') ? evalValue(zuiOnEvent) : {do: zuiOnEvent}));\n }\n\n const dataOn = $element.attr('data-on');\n if (dataOn) {\n processGlobalEvent($element, event, getZData($element, {prefix: 'data-', evalValue: ['call', 'if', 'do']}) as GlobalEventOptions);\n }\n}\n\nexport function registerGlobalListener(events: string[]) {\n $(document).off('.zui.global').on(events.map(event => `${event}.zui.global`).join(' '), `[zui-on],${events.map(x => `[zui-on-${x}]`)},[data-on]`, handleGlobalEvent);\n}\n\nregisterGlobalListener(['click', 'change', 'inited']);\n","export type SizeSetting = number | `${number}%` | `${number}px` | `${number}/${number}` | (string & {}) | ((...args: A) => SizeSetting);\n\nexport function parseSize(size: SizeSetting, callbackArgs?: A): [value: number, type?: 'px' | '%'] {\n if (typeof size === 'function') {\n return parseSize(size(...(callbackArgs || [])));\n }\n if (typeof size === 'number') {\n return [size];\n }\n let match = size.match(/(\\d+)(%|px)?/);\n if (match) {\n return [parseInt(match[1]), match[2] as 'px' | '%'];\n }\n match = size.match(/(\\d+)\\/(\\d+)/);\n if (match) {\n return [100 * parseInt(match[1]) / parseInt(match[2]), '%'];\n }\n return [NaN];\n}\n\nexport function toCssSize(size: SizeSetting | undefined | null, callbackArgs?: A): string | null {\n if (size === undefined || size === null) {\n return null;\n }\n const [val, unit = 'px'] = parseSize(size, callbackArgs);\n if (Number.isNaN(val)) {\n return typeof size === 'string' ? size : null;\n }\n return `${val}${unit}`;\n}\n","export async function downloadFile(file: Blob | Response | string, fileName?: string): Promise {\n if (file instanceof Blob) {\n const link = document.createElement('a');\n link.href = window.URL.createObjectURL(file);\n if (fileName) {\n link.download = decodeURIComponent(fileName);\n }\n link.click();\n link.remove();\n return file;\n }\n if (file instanceof Response) {\n const blob = await file.blob();\n fileName = fileName || file.headers.get('Content-Disposition')?.split(';')[1]?.split('=')[1]?.replace(/\"/g, '');\n return downloadFile(blob, fileName);\n }\n const response = await fetch(file);\n return downloadFile(response);\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {$, type Cash, type Selector} from '../cash';\n\ntype EventCallback = {\n (event: any, data?: any): any;\n guid?: number;\n};\n\nexport class Bus {\n protected _$target: Cash;\n\n constructor(target: Selector) {\n this._$target = $(target);\n }\n\n on(events: Record): this;\n on(events: Record, selector: string): this;\n on(events: Record, data: any): this;\n on(events: Record, selector: string | null | undefined, data: any): this;\n on(events: string, callback: EventCallback): this;\n on(events: string, selector: string, callback: EventCallback): this;\n on(events: string, data: any, callback: EventCallback): this;\n on(events: string, selector: string | null | undefined, data: any, callback: EventCallback, _one?: boolean): this;\n on(...args: any[]): this {\n this._$target.on(...(args as Parameters));\n return this;\n }\n\n one(events: Record): this;\n one(events: Record, selector: string): this;\n one(events: Record, data: any): this;\n one(events: Record, selector: string | null | undefined, data: any): this;\n one(events: string, callback: EventCallback): this;\n one(events: string, selector: string, callback: EventCallback): this;\n one(events: string, data: any, callback: EventCallback): this;\n one(events: string, selector: string | null | undefined, data: any, callback: EventCallback): this;\n one(...args: any[]): this {\n this._$target.one(...(args as Parameters));\n return this;\n }\n\n off(): this;\n off(events: string): this;\n off(events: Record): this;\n off(events: string, callback: EventCallback): this;\n off(events: string, selector: string, callback: EventCallback): this;\n off(...args: any[]): this {\n this._$target.off(...(args as Parameters));\n return this;\n }\n\n trigger(event: Event | string, data?: any): this;\n trigger(...args: any[]): this {\n this._$target.trigger(...(args as Parameters));\n return this;\n }\n}\n\nexport const bus = new Bus(document);\n\n/* Declare types. */\ndeclare module 'cash-dom' {\n interface CashStatic {\n bus: Bus;\n\n on(events: Record): Bus;\n on(events: Record, selector: string): Bus;\n on(events: Record, data: any): Bus;\n on(events: Record, selector: string | null | undefined, data: any): Bus;\n on(events: string, callback: EventCallback): Bus;\n on(events: string, selector: string, callback: EventCallback): Bus;\n on(events: string, data: any, callback: EventCallback): Bus;\n on(events: string, selector: string | null | undefined, data: any, callback: EventCallback, _one?: boolean): Bus;\n\n one(events: Record): Bus;\n one(events: Record, selector: string): Bus;\n one(events: Record, data: any): Bus;\n one(events: Record, selector: string | null | undefined, data: any): Bus;\n one(events: string, callback: EventCallback): Bus;\n one(events: string, selector: string, callback: EventCallback): Bus;\n one(events: string, data: any, callback: EventCallback): Bus;\n one(events: string, selector: string | null | undefined, data: any, callback: EventCallback): Bus;\n\n off(): Bus;\n off(events: string): Bus;\n off(events: Record): Bus;\n off(events: string, callback: EventCallback): Bus;\n off(events: string, selector: string, callback: EventCallback): Bus;\n\n trigger(event: Event | string, data?: any): Bus;\n }\n}\n\n$.bus = bus;\n$.on = bus.on.bind(bus);\n$.one = bus.one.bind(bus);\n$.off = bus.off.bind(bus);\n$.trigger = bus.trigger.bind(bus);\n","var t=[\"Shift\",\"Meta\",\"Alt\",\"Control\"],e=\"object\"==typeof navigator?navigator.platform:\"\",n=/Mac|iPod|iPhone|iPad/.test(e),r=n?\"Meta\":\"Control\",o=\"Win32\"===e?[\"Control\",\"Alt\"]:n?[\"Alt\"]:[];function i(t,e){return\"function\"==typeof t.getModifierState&&(t.getModifierState(e)||o.includes(e)&&t.getModifierState(\"AltGraph\"))}function a(t){return t.trim().split(\" \").map(function(t){var e=t.split(/\\b\\+/),n=e.pop();return[e=e.map(function(t){return\"$mod\"===t?r:t}),n]})}function u(e,n){var r;void 0===n&&(n={});var o=null!=(r=n.timeout)?r:1e3,u=Object.keys(e).map(function(t){return[a(t),e[t]]}),c=new Map,f=null;return function(e){e instanceof KeyboardEvent&&(u.forEach(function(n){var r=n[0],o=n[1],a=c.get(r)||r;!function(e,n){return!(n[1].toUpperCase()!==e.key.toUpperCase()&&n[1]!==e.code||n[0].find(function(t){return!i(e,t)})||t.find(function(t){return!n[0].includes(t)&&n[1]!==t&&i(e,t)}))}(e,a[0])?i(e,e.key)||c.delete(r):a.length>1?c.set(r,a.slice(1)):(c.delete(r),o(e))}),f&&clearTimeout(f),f=setTimeout(c.clear.bind(c),o))}}function c(t,e,n){var r;void 0===n&&(n={});var o=null!=(r=n.event)?r:\"keydown\",i=u(e,n);return t.addEventListener(o,i),function(){t.removeEventListener(o,i)}}export{u as createKeybindingsHandler,a as parseKeybinding,c as tinykeys};\n//# sourceMappingURL=tinykeys.module.js.map\n","import {tinykeys, createKeybindingsHandler, type KeyBindingMap, type KeyBindingHandlerOptions} from 'tinykeys';\nimport {$, type Selector, Cash} from '../cash';\n\nexport type HotkeysBindingOptions = KeyBindingHandlerOptions & {\n scope?: string;\n event?: 'keydown' | 'keyup' | 'keypress';\n when?: (event: KeyboardEvent) => boolean;\n};\n\nexport type HotkeysBindingMap = KeyBindingMap;\n\nexport type HotkeyBindingCallback = (event: KeyboardEvent) => void;\n\nexport type HotkeySetting = {\n keys: string | string[];\n handler: HotkeyBindingCallback;\n optional?: boolean;\n};\n\nexport type HotkeyName = string;\n\nexport type HotkeysMap = Record;\n\nexport type HotkeysSettings = boolean | Record;\n\nexport function getHotkeysMap(settings: HotkeysSettings, defaultMap: HotkeysMap = {}): HotkeysBindingMap | undefined {\n if (!settings) {\n return;\n }\n\n const map = Object.keys(defaultMap).reduce((currentMap, name) => {\n if (!defaultMap[name].optional) {\n currentMap[name] = {\n ...defaultMap[name],\n };\n }\n return currentMap;\n }, {});\n Object.keys(settings).forEach((name) => {\n const setting = (settings as Record)[name];\n if (!setting) {\n delete map[name];\n } else if (setting === true) {\n if (defaultMap[name]) {\n map[name] = {\n ...defaultMap[name],\n };\n }\n } else {\n map[name] = setting;\n }\n });\n\n return Object.keys(map).reduce((bindingMap, name) => {\n const {keys, handler} = map[name];\n if (typeof keys === 'string') {\n bindingMap[keys] = handler;\n } else {\n keys.forEach((key) => {\n bindingMap[key] = handler;\n });\n }\n return bindingMap;\n }, {});\n}\n\nexport function bindHotkeys(selector: Selector, bindingMap: HotkeysBindingMap, options?: HotkeysBindingOptions) {\n const {timeout, event = 'keydown', scope, when} = options || {};\n const handler = createKeybindingsHandler(bindingMap, {timeout});\n const namespace = `.zui.hotkeys${scope ? `.${scope}` : ''}`;\n const composingDataKey = 'zui-hotkeys-composing';\n return $(selector).on(`${event}${namespace}`, function (e: KeyboardEvent) {\n if (when && when(e) === false) {\n return;\n }\n if ($(e.target as HTMLElement).data(composingDataKey)) {\n return;\n }\n handler(e);\n }).on(`compositionstart${namespace}`, (e: Event) => {\n $(e.target as HTMLElement).data(composingDataKey, true);\n }).on(`compositionend${namespace}`, (e: Event) => {\n $(e.target as HTMLElement).removeData(composingDataKey);\n });\n}\n\nexport function unbindHotkeys(selector: Selector, scope?: string) {\n return $(selector).off(`.zui.hotkeys${scope ? `.${scope}` : ''}`);\n}\n\nexport const hotkeys = tinykeys;\n\n/* Declare types. */\ndeclare module 'cash-dom' {\n interface CashStatic {\n hotkeys(bindingMap: HotkeysBindingMap, options?: HotkeysBindingOptions): void;\n\n unbindHotkeys(scope?: string): void;\n }\n\n interface Cash {\n hotkeys(bindingMap: HotkeysBindingMap, options?: HotkeysBindingOptions): Cash;\n\n unbindHotkeys(scope?: string): Cash;\n }\n}\n\n/* Extend $.fn.hotkeys(). */\n$.fn.hotkeys = function (this: Cash, bindingMap: HotkeysBindingMap, options?: HotkeysBindingOptions): Cash {\n return bindHotkeys(this, bindingMap, options);\n};\n\n/* Extend $.fn.unbindHotkeys. */\n$.fn.unbindHotkeys = function (this: Cash, scope?: string): Cash {\n return unbindHotkeys(this, scope);\n};\n\n/* Extend $.hotkeys(). */\n$.hotkeys = function (bindingMap: HotkeysBindingMap, options?: HotkeysBindingOptions): void {\n bindHotkeys(window, bindingMap, options);\n};\n\n/* Extend $.unbindHotkeys. */\n$.unbindHotkeys = function (scope?: string): void {\n unbindHotkeys(window, scope);\n};\n","import {$, Cash, type Selector} from '../cash';\n\nexport type EnterFullscreenOptions = {\n target: Selector;\n onError?: (error: Error) => void;\n onSuccess?: () => void;\n afterEnter?: (event: Event) => void;\n afterExit?: (event: Event) => void;\n};\n\nexport function getFullscreenElement() {\n return document.fullscreenElement || (document as {webkitFullscreenElement?: typeof document.fullscreenElement}).webkitFullscreenElement || (document as {mozFullScreenElement?: typeof document.fullscreenElement}).mozFullScreenElement;\n}\n\nexport async function enterFullscreen(options: Selector | EnterFullscreenOptions) {\n if (typeof options === 'string' || options instanceof Element || options instanceof $) {\n options = {target: options as Selector};\n }\n const {target, onError, onSuccess, afterExit, afterEnter} = options as EnterFullscreenOptions;\n const $target = $(target);\n const element = $target[0] as Element;\n if (!element) {\n return;\n }\n const requestMethod = element.requestFullscreen || (element as {webkitRequestFullscreen?: typeof element.requestFullscreen}).webkitRequestFullscreen || (element as {mozRequestFullScreen?: typeof element.requestFullscreen}).mozRequestFullScreen;\n if (!requestMethod) {\n onError?.call(element, new Error('[ZUI] The browser does not support full screen feature.'));\n return;\n }\n\n try {\n await requestMethod.call(element);\n onSuccess?.call(element);\n $(element).off('.zui.fullscreen');\n if (afterExit) {\n $target.on('exitFullscreen.zui.fullscreen', afterExit);\n }\n if (afterEnter) {\n $target.on('enterFullscreen.zui.fullscreen', afterEnter);\n }\n } catch (error) {\n onError?.call(element, error as Error);\n }\n\n if (!(document as {zuiBindFullscreenChange?: boolean}).zuiBindFullscreenChange) {\n (document as {zuiBindFullscreenChange?: boolean}).zuiBindFullscreenChange = true;\n $(document).on('fullscreenchange.zui webkitfullscreenchange.zui mozfullscreenchange.zui', (event) => {\n const fullscreenElement = getFullscreenElement();\n let triggerElement: Element | Document | null | undefined = fullscreenElement;\n if (fullscreenElement) {\n $(fullscreenElement).addClass('is-in-fullscreen');\n } else {\n triggerElement = $(document).find('.is-in-fullscreen')[0] || document;\n $(triggerElement).removeClass('is-in-fullscreen');\n }\n $('body').toggleClass('has-in-fullscreen', !!fullscreenElement);\n const data = {event, target: triggerElement, fullscreenElement};\n $(triggerElement).trigger(fullscreenElement ? 'enterFullscreen' : 'exitFullscreen', data).trigger('toggleFullscreen', data);\n });\n }\n}\n\nexport async function toggleFullscreen(options?: Selector | EnterFullscreenOptions | false) {\n const fullscreenElement = getFullscreenElement();\n if (options === false) {\n if (!!fullscreenElement === options) {\n return options;\n }\n }\n\n if (fullscreenElement) {\n document.exitFullscreen();\n return false;\n }\n await enterFullscreen(options);\n return true;\n}\n\n/* Declare types. */\ndeclare module 'cash-dom' {\n interface Cash {\n fullscreen(this: Cash, options?: EnterFullscreenOptions | false): Promise;\n }\n\n interface CashStatic {\n getFullscreenElement: typeof getFullscreenElement;\n toggleFullscreen: typeof toggleFullscreen;\n }\n}\n\n/** Extend the $.fn.fullscreen. */\n$.fn.fullscreen = function (this: Cash, options?: EnterFullscreenOptions | false) {\n return toggleFullscreen({\n target: this,\n ...options,\n });\n};\n\n/** Extend the $.getFullscreenElement. */\n$.getFullscreenElement = getFullscreenElement;\n\n/** Extend the $.toggleFullscreen. */\n$.toggleFullscreen = toggleFullscreen;\n","import {$, Cash} from '../cash';\n\n/**\n * Check whether the element is detached from document.\n * @param element The element to check.\n * @returns Whether the element is detached from document.\n */\nexport function isElementDetached(element?: Node): boolean {\n if (!element || element.parentNode === document) {\n return false;\n }\n if (!element.parentNode) {\n return true;\n }\n return isElementDetached(element.parentNode);\n}\n\n/* Declare types. */\ndeclare module 'cash-dom' {\n interface CashStatic {\n isDetached(element: Node): boolean;\n }\n\n interface Cash {\n isDetached(): boolean;\n }\n}\n\n/* Extend $.isDetached. */\n$.isDetached = isElementDetached;\n\n/* Extend as $.fn.isDisabled(). */\n$.fn.isDetached = function (this: Cash) {\n const element = this[0];\n return !element || isElementDetached(element);\n};\n","import {I18nLangMap, i18n} from '../i18n';\nimport {$} from '../cash';\nimport {nextGid} from '../helpers';\nimport {isElementDetached} from '../dom/is-detached';\n\nimport type {Cash, Element, Selector} from '../cash';\nimport type {ComponentEventArgs, ComponentEventName, ComponentOptions, ComponentEvents, ComponentEventsDefnition, ComponentToggleConfig} from './types';\n\n/**\n * The event callback for component.\n */\nexport type ComponentEventCallback> = (event: N extends keyof HTMLElementEventMap ? HTMLElementEventMap[N] : Event, args: [Component, ComponentEventArgs]) => void | false;\n\n/**\n * The component base class.\n */\nexport class Component {\n /**\n * The default options.\n */\n static DEFAULT = {};\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 * Whether the component supports multiple instances.\n */\n static MULTI_INSTANCE = false;\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 * The component toggle config.\n */\n static toggle: ComponentToggleConfig | undefined;\n\n /**\n * ZUI name\n */\n static get ZUI() {\n return this.NAME.replace(/(^[A-Z]+)/, (match) => match.toLowerCase());\n }\n\n /**\n * Component data key, like \"zui.menu\"\n */\n static get KEY(): `zui.${string}` {\n return `zui.${this.NAME}`;\n }\n\n /**\n * Component namespace, like \".zui.menu\"\n */\n static get NAMESPACE(): `.zui.${string}` {\n return `.zui.${this.ZUI}`;\n }\n\n /**\n * @deprecated Use ATTR_KEY instead.\n */\n static get DATA_KEY(): `data-zui-${string}` {\n return `data-zui-${this.NAME}`;\n }\n\n /**\n * Component attribute key, like \"z-use-menu\"\n */\n static get ATTR_KEY(): `z-use-${string}` {\n return `z-use-${this.NAME}`;\n }\n\n /**\n * The component default selector.\n */\n static get SELECTOR() {\n return `[${this.DATA_KEY}]`;\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 Component;\n\n /**\n * Store the component options.\n */\n private _options?: ComponentOptions;\n\n /**\n * Store the component element.\n */\n private _element?: U;\n\n /**\n * The component global ID.\n */\n private _gid: number;\n\n /**\n * The component key.\n */\n protected _key: string | number;\n\n /**\n * The component initialized flag.\n */\n private _inited = false;\n\n /**\n * Auto destroy flag.\n */\n private _autoDestory = 0;\n\n /**\n * The component destroyed flag.\n */\n protected _destroyed = false;\n\n /**\n * The component constructor.\n *\n * @param options The component initial options.\n */\n constructor(selector: Selector, options?: Partial>) {\n const {KEY, DATA_KEY, DEFAULT, MULTI_INSTANCE, NAME, ATTR_KEY, ALL, TYPED_ALL} = this.constructor;\n\n if (!NAME) {\n throw new Error('[ZUI] The component must have a \"NAME\" static property.');\n }\n\n const $element = $(selector);\n if ($element.data(KEY) && !MULTI_INSTANCE) {\n throw new Error(`[ZUI] The component \"${NAME}\" has been initialized on element.`);\n }\n\n const element = $element[0] as U;\n const gid = nextGid();\n this._gid = gid;\n this._element = element;\n\n this._options = {...DEFAULT, ...(options?.$optionsFromDataset !== false ? $element.dataset() : {})} as ComponentOptions;\n this.setOptions(options);\n this._key = this.options.key ?? `__${gid}`;\n\n if (ALL.has(element)) {\n ALL.get(element)!.add(this);\n } else {\n ALL.set(element, new Set([this]));\n }\n\n if (TYPED_ALL.has(NAME)) {\n TYPED_ALL.get(NAME)!.add(this);\n } else {\n TYPED_ALL.set(NAME, new Set([this]));\n }\n\n $element.data(KEY, this).attr(ATTR_KEY, '').attr(DATA_KEY, `${gid}`);\n if (MULTI_INSTANCE) {\n const dataName = `${KEY}:ALL`;\n let instanceMap: Map | undefined = $element.data(dataName);\n if (!instanceMap) {\n instanceMap = new Map();\n $element.data(dataName, instanceMap);\n }\n instanceMap.set(this._key, this);\n }\n\n this.init();\n requestAnimationFrame(async () => {\n this._inited = true;\n await this.afterInit();\n this.emit('inited', this.options);\n });\n }\n\n /**\n * Get the component initialized flag.\n */\n get inited() {\n return this._inited;\n }\n\n /**\n * Get the component destroyed flag.\n */\n get destroyed() {\n return this._destroyed;\n }\n\n /**\n * Get the component element.\n */\n get element() {\n return this._element!;\n }\n\n get key() {\n return this._key;\n }\n\n /**\n * Get the component options.\n */\n get options() {\n return this._options!;\n }\n\n /**\n * Get the component global id.\n */\n get gid() {\n return this._gid;\n }\n\n /**\n * Get the component element as a jQuery like object.\n */\n get $element() {\n return $(this.element);\n }\n\n /**\n * Get the component event emitter.\n */\n get $emitter() {\n return this.$element;\n }\n\n /**\n * Get the component i18n data.\n */\n get i18nData(): (I18nLangMap | undefined)[] {\n return [this.options.i18n, this.constructor.i18n];\n }\n\n /**\n * Initialize the component.\n */\n init() {}\n\n /**\n * Do something after the component initialized.\n */\n afterInit(): void | Promise {}\n\n /**\n * Render the component.\n *\n * @param options The component options to override before render.\n */\n render(options?: Partial>, reset?: boolean) {\n this.setOptions(options, reset);\n }\n\n /**\n * Destroy the component.\n */\n destroy() {\n const {KEY, DATA_KEY, ALL, TYPED_ALL, NAME, MULTI_INSTANCE, ATTR_KEY} = this.constructor;\n const {$element, element} = this;\n\n (this.emit as ((event: string, ...args: unknown[]) => void))('destroyed');\n\n this._destroyed = true;\n\n $element\n .off(this.namespace)\n .removeData(KEY)\n .removeAttr(ATTR_KEY)\n .removeAttr(DATA_KEY);\n\n if (MULTI_INSTANCE) {\n const map = this.$element.data(`${KEY}:ALL`) as Map>;\n if (map) {\n map.delete(this._key);\n if (map.size === 0) {\n this.$element.removeData(`${KEY}:ALL`);\n } else {\n const nextInstance = map.values().next().value;\n $element.data(KEY, nextInstance).attr(DATA_KEY, nextInstance.gid);\n }\n }\n }\n\n const map = ALL.get(element);\n if (map) {\n map.delete(this);\n if (map.size === 0) {\n ALL.delete(element);\n }\n }\n\n const typedMap = TYPED_ALL.get(NAME);\n if (typedMap) {\n typedMap.delete(this);\n if (typedMap.size === 0) {\n TYPED_ALL.delete(NAME);\n }\n }\n }\n\n /**\n * Auto destroy the component when detached.\n */\n autoDestroy(delay = 100) {\n if (this._autoDestory) {\n clearTimeout(this._autoDestory);\n }\n this._autoDestory = window.setTimeout(() => {\n this._autoDestory = 0;\n if (isElementDetached(this.element)) {\n this.destroy();\n }\n }, delay);\n }\n\n /**\n * Set the component options.\n *\n * @param options The component options to set.\n * @returns The component options.\n */\n setOptions(options?: Partial>, reset?: boolean): ComponentOptions {\n if (reset) {\n this._options = {\n ...this.constructor.DEFAULT,\n ...(options?.$optionsFromDataset !== false ? this.$element.dataset() : {}),\n ...options,\n } as ComponentOptions;\n } else if (options) {\n $.extend(this._options, options);\n }\n return this._options!;\n }\n\n /**\n * Emit a component event.\n * @param event The event name.\n * @param args The event arguments.\n */\n emit>(event: N, ...args: ComponentEventArgs): Event {\n const eventObject = $.Event(event);\n (eventObject as unknown as {__src?: unknown}).__src = this;\n this.$emitter.trigger(eventObject, [this, ...args]);\n return eventObject as unknown as Event;\n }\n\n /**\n * Listen to a component event.\n *\n * @param event The event name.\n * @param callback The event callback.\n */\n on>(event: N | (string & {}), callback: ComponentEventCallback, options?: {once?: boolean}) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const component = this;\n this.$element[options?.once ? 'one' : 'on'](this._wrapEvent(event), function (this: Component, e: N extends keyof HTMLElementEventMap ? HTMLElementEventMap[N] : Event, info: [Component, ComponentEventArgs]) {\n if (!(e as {__src?: unknown}).__src || (e as {__src?: unknown}).__src === component) {\n callback.call(this, e, info);\n }\n });\n }\n\n /**\n * Listen to a component event.\n *\n * @param event The event name.\n * @param callback The event callback.\n */\n one>(event: N, callback: ComponentEventCallback) {\n this.on(event, callback, {once: true});\n }\n\n /**\n * Stop listening to a component event.\n * @param event The event name.\n * @param callback The event callback.\n */\n off>(event: N | (string & {})) {\n this.$element.off(this._wrapEvent(event));\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.options.lang, this.constructor.NAME)\n ?? i18n(i18nData, key, args, defaultValue, this.options.lang)\n ?? `{i18n:${key}}`;\n }\n\n /**\n * Get event namespace.\n * @returns Event namespace.\n */\n get namespace(): `.zui.${string}` {\n return `${this.constructor.NAMESPACE}.${this._key}`;\n }\n\n /**\n * Wrap event names with component namespace.\n *\n * @param names The event names.\n * @returns The wrapped event names.\n */\n protected _wrapEvent(names: string) {\n return names.split(' ').map(name => name.includes('.') ? name : `${name}${this.namespace}`).join(' ');\n }\n\n static ALL = new Map>();\n\n static TYPED_ALL = new Map>();\n\n /**\n * Get the component instance of the given element.\n *\n * @param this Current component constructor.\n * @param selector The component element selector.\n * @returns The component instance.\n */\n static get>(this: T, selector: Selector, key?: string | number): InstanceType | undefined {\n const $element = $(selector);\n if (this.MULTI_INSTANCE && key !== undefined) {\n const instanceMap = $element.data(`${this.KEY}:ALL`);\n if (instanceMap) {\n return instanceMap.get(key);\n }\n return;\n }\n return $element.data(this.KEY);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static isValid>(this: T, _instance: InstanceType): boolean {\n return true;\n }\n\n /**\n * Ensure the component instance of the given element.\n *\n * @param this Current component constructor.\n * @param selector The component element selector.\n * @param options The component options.\n * @returns The component instance.\n */\n static ensure>(this: T, selector: Selector, options?: Partial>): InstanceType {\n const instance = this.get(selector, options?.key);\n if (instance) {\n if (this.isValid(instance)) {\n if (options) {\n instance.setOptions(options);\n }\n return instance;\n } else {\n instance.destroy();\n }\n }\n return new this(selector, options) as InstanceType;\n }\n\n /**\n * Get all component instances.\n *\n * @param this Current component constructor.\n * @param selector The component element selector.\n * @returns All component instances.\n */\n static getAll>(this: T, selector?: Selector, filter?: (instance: InstanceType) => boolean): InstanceType[] {\n const {SELECTOR, ALL, TYPED_ALL} = this;\n const list: InstanceType[] = [];\n const checkInstance = (instance: Component) => {\n if (instance instanceof this && (!filter || filter(instance as InstanceType) !== false)) {\n list.push(instance as InstanceType);\n }\n };\n if (selector) {\n $(selector)\n .find(SELECTOR)\n .each((_, element) => {\n ALL.get(element)?.forEach(checkInstance);\n });\n } else if (this !== Component) {\n TYPED_ALL.get(this.NAME)?.forEach(checkInstance);\n } else {\n ALL.forEach((components) => {\n components.forEach(checkInstance);\n });\n }\n return list.sort((a, b) => a.gid - b.gid);\n }\n\n /**\n * Query the component instance.\n *\n * @param this Current component constructor.\n * @param selector The component element selector.\n * @returns The component instance.\n */\n static query>(this: T, selector?: Selector, key?: string | number, filter?: (instance: InstanceType) => boolean): InstanceType | undefined {\n if (selector === undefined) {\n return this.getAll(undefined, filter).pop();\n }\n return this.get($(selector).closest(this.SELECTOR), key);\n }\n\n /**\n * Create cash fn.method for current component.\n *\n * @param name The method name.\n */\n static defineFn(name?: string) {\n let fnName = (name || this.ZUI) as keyof Cash;\n if ($.fn[fnName]) {\n fnName = `zui${this.NAME}` as keyof Cash;\n }\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const ZUIComponent = this;\n $.fn.extend({\n [fnName](options: Partial> | string, ...args: unknown[]) {\n const initOptions = typeof options === 'object' ? options : undefined;\n const callMethod = typeof options === 'string' ? options : undefined;\n let callResult: unknown;\n this.each((_: number, element: Element) => {\n let instance = ZUIComponent.get(element);\n if (instance) {\n if (initOptions) {\n instance.render(initOptions);\n }\n } else {\n instance = new ZUIComponent(element, initOptions);\n }\n if (callMethod) {\n let method: ((...args: unknown[]) => void) = (instance as unknown as Record void>)[callMethod];\n let callThis: unknown = instance;\n if (method === undefined) {\n callThis = (instance as unknown as {$: Record void>}).$;\n method = (callThis as Record void>)[callMethod as string];\n }\n if (typeof method === 'function') {\n callResult = method.call(callThis, ...args);\n } else {\n callResult = method;\n }\n }\n });\n return callResult !== undefined ? callResult : this;\n },\n });\n }\n\n static map = new Map();\n\n static toggleMap = new Map();\n\n static register(ComponentClass?: typeof Component, name?: string) {\n ComponentClass = ComponentClass || this;\n name = (name ?? ComponentClass.NAME).toLowerCase();\n this.map.set(name, ComponentClass);\n\n const toggleName = ComponentClass.toggle?.name?.toLowerCase();\n if (toggleName && toggleName !== name) {\n this.toggleMap.set(toggleName, ComponentClass);\n }\n }\n}\n","import {$, Cash} from '../cash';\nimport {type GetLibOptions} from '../dom';\nimport {evalValue} from '../helpers';\nimport {storeData, takeData} from '../helpers/data';\nimport {getZData} from '../helpers/z';\nimport {Component} from './component';\n\nimport type {ComponentOptions} from './types';\n\nexport type ComponentClass = typeof Component;\n\nexport type ComponentCreateOptions = ComponentOptions & {\n $update?: boolean | 'reset';\n $reset?: boolean;\n};\n\nexport type ZUIInitOptions = {\n update?: boolean | 'reset';\n beforeCreate?: BeforeCreateCallback;\n onCreate?: OnCreateCallback;\n};\n\nexport function getComponent(name: string): ComponentClass | undefined {\n return Component.map.get(name.toLowerCase());\n}\n\nexport function create(name: string, element: HTMLElement, options: ComponentCreateOptions = {}) {\n let TheComponentClass = getComponent(name);\n if (!TheComponentClass) {\n TheComponentClass = initGlobalComponents(name);\n }\n if (!TheComponentClass) {\n return null;\n }\n const {$update, ...componentOptions} = options;\n if (!TheComponentClass.MULTI_INSTANCE) {\n const component = TheComponentClass.get(element);\n if (component) {\n if ($update) {\n component.render(componentOptions, $update === 'reset');\n }\n return component;\n }\n }\n return new TheComponentClass(element, componentOptions);\n}\n\nfunction createInAnimationFrame(name: string, element: HTMLElement, options: ComponentCreateOptions = {}) {\n requestAnimationFrame(() => create(name, element, options));\n}\n\nexport function registerComponent(component: ComponentClass, name?: string) {\n Component.register(component, name);\n}\n\nexport function initGlobalComponents(name?: string): ComponentClass | undefined {\n const {zui} = window as unknown as {zui: Record};\n if (!zui) {\n return;\n }\n name = name?.toLowerCase();\n for (const n in zui) {\n const isMatch = n.toLowerCase() === name;\n if (name && !isMatch) {\n continue;\n }\n const TheComponentClass = zui[n];\n if (typeof TheComponentClass !== 'function' || !TheComponentClass.NAME || !TheComponentClass.ZUI) {\n continue;\n }\n if (!Component.map.has(n.toLowerCase())) {\n registerComponent(TheComponentClass);\n }\n if (isMatch) {\n return TheComponentClass;\n }\n }\n}\n\nexport function defineFn(name?: string) {\n if (name) {\n getComponent(name)?.defineFn();\n } else if (!(window as unknown as {_zuiDefined: Record})._zuiDefined) {\n initGlobalComponents();\n Component.map.forEach((TheComponentClass) => {\n TheComponentClass.defineFn();\n });\n Object.assign(window, {_zuiDefined: true});\n }\n}\n\n/* Declare types. */\ndeclare module 'cash-dom' {\n interface Cash {\n zuiInit(this: Cash, options?: ZUIInitOptions): Cash;\n zui(this: Cash, name?: string, key?: string | number | true): ComponentClass | ComponentClass[] | Record | undefined;\n zuiCall(this: Cash, method: string, args?: unknown[]): Cash;\n }\n}\n\nexport type BeforeCreateCallback = (element: HTMLElement) => boolean | void;\n\nexport type OnCreateCallback = (name: string, options: Record) => false | Record | void;\n\n/**\n * Create zui component instance from elements which match [zui-create], [data-zui], [data-zui] is deprecated, use [zui-create] instead.\n * 为匹配 [zui-create], [data-zui] 的元素创建 zui 组件实例,[data-zui] 被弃用,优先使用 [zui-create]。\n *\n * @param element - The element to create zui components. 要创建 zui 组件的元素。\n * @param options - The options. 选项。\n *\n * @example\n * ```html\n *
    \n * \n * Create multiple components\n *\n *
    Deprecated usage
    \n * ```\n */\nfunction initCreators(element: HTMLElement, options: ZUIInitOptions = {}): void {\n const $element = $(element);\n let createNames = $element.attr('zui-create');\n const {update: $update, onCreate} = options;\n const createInstance = (name: string, createOptions?: Record) => {\n createOptions = {\n $update,\n $optionsFromDataset: false,\n ...createOptions,\n };\n if (onCreate) {\n const newCreateOptions = onCreate(name, createOptions);\n if (newCreateOptions === false) {\n return;\n }\n if (newCreateOptions) {\n createOptions = newCreateOptions;\n }\n }\n const $lib = createOptions.$lib as (GetLibOptions | undefined);\n if ($lib) {\n delete createOptions.$lib;\n $.getLib($lib).then(() => create(name, element, createOptions));\n return;\n }\n createInAnimationFrame(name, element, createOptions);\n };\n if (typeof createNames === 'string') {\n createNames = createNames.trim();\n const names = createNames.length ? createNames.split(',').map((name) => name.trim()) : [];\n const createOptionsMap = getZData(element, {prefix: 'zui-create-', evalValue: true})!;\n const createOptionsNames = Object.keys(createOptionsMap);\n if (!createOptionsNames.length && names.length === 1) {\n createInstance(names[0], $element.dataset());\n } else {\n const initedNames = new Set();\n [...names, ...createOptionsNames].forEach(name => {\n if (initedNames.has(name)) {\n return;\n }\n const createOptions = createOptionsMap[name] as ComponentCreateOptions | undefined;\n createInstance(name, createOptions);\n delete createOptionsMap[name];\n initedNames.add(name);\n });\n }\n } else {\n const initOptions = $element.dataset();\n const name = initOptions?.zui as string;\n if (!name) {\n return;\n }\n console.warn('[ZUI] create component instance with [data-zui] is deprecated, use [zui-create] instead.', {element, options});\n delete initOptions!.zui;\n createInstance(name, initOptions);\n }\n}\n\n/**\n * Bind toggle events.\n */\nfunction bindToggleEvents() {\n $(document).on('click.zui.toggle mouseenter.zui.toggle', '[data-toggle],[zui-toggle]', function (this: HTMLElement, event) {\n const $this = $(this);\n const toggleName = ($this.dataset('toggle') || $this.attr('zui-toggle')) as string;\n if (!toggleName) {\n return;\n }\n const TheComponentClass = Component.toggleMap.get(toggleName) || getComponent(toggleName);\n const toggleConfig = TheComponentClass?.toggle;\n if (!toggleConfig) {\n return;\n }\n\n const {trigger = 'click', skip = '[disabled],.disabled', check} = toggleConfig;\n const eventTriggerType = event.type === 'mouseover' ? 'hover' : 'click';\n if (!trigger.includes(eventTriggerType) || (check && !check.call(TheComponentClass, this, eventTriggerType, event)) || (skip && $this.is(skip))) {\n return;\n }\n\n const {onGet, onCreate, setOptions = true, getOptions, prevent = true, handler, onToggle, convertHref} = toggleConfig;\n let options = $this.dataset() as Record;\n const toggleOptions = $this.attr(`zui-toggle-${toggleName}`);\n if (toggleOptions) {\n options = $.extend(options, evalValue(toggleOptions));\n }\n if (convertHref && $this.is('a')) {\n const href = $this.attr('href');\n if (href) {\n const hrefMap = convertHref === true ? {selector: 'target', url: 'url'} : convertHref;\n if ('#.'.includes(href[0])) {\n if (hrefMap.selector && options[hrefMap.selector] === undefined) {\n options[hrefMap.selector] = href;\n }\n } else if (hrefMap.url && options[hrefMap.url] === undefined) {\n options[hrefMap.url] = href;\n }\n }\n }\n if (getOptions) {\n options = getOptions.call(TheComponentClass, this, options, event);\n }\n\n if (handler) {\n handler.call(TheComponentClass, this, options, eventTriggerType, event);\n if (prevent) {\n event.preventDefault();\n }\n return;\n }\n\n let component = onGet ? onGet.call(TheComponentClass, this) : TheComponentClass.get(this);\n if (!component) {\n const newComponent = onCreate ? onCreate.call(TheComponentClass, this, event, options) : (new TheComponentClass(this, options));\n if (!newComponent) {\n return;\n }\n component = newComponent;\n } else if (setOptions) {\n component.setOptions(options);\n }\n\n if (onToggle) {\n if (onToggle.call(TheComponentClass, component, this, event) === false) {\n return;\n }\n } else {\n const {shown, show, hide, toggle: toggleFunc} = component as unknown as {\n shown?: boolean,\n show?: () => void,\n hide?: () => void,\n toggle?: () => void,\n };\n\n let func: (() => void) | undefined;\n if (toggleFunc) {\n func = toggleFunc;\n } else if (show && hide) {\n if (shown) {\n func = hide;\n } else {\n func = show;\n }\n } else if (show) {\n func = show;\n }\n if (func) {\n func.call(component);\n } else {\n return;\n }\n }\n\n if (prevent) {\n event.preventDefault();\n }\n });\n}\n\nfunction getComponentsOnElement(element: HTMLElement, forEach?: (component: Component, dataKey: string) => void | boolean): Component[] {\n const data = takeData(element) as Record;\n const components: Component[] = [];\n Object.keys(data).forEach((dataKey) => {\n if (!dataKey.startsWith('zui.')) {\n return;\n }\n const component = data[dataKey] as Component;\n if (forEach?.(component, dataKey) === false) {\n return;\n }\n components.push(data[dataKey] as Component);\n });\n return components;\n}\n\nlet checkComponentsTimer = 0;\n\nfunction checkComponents(delay = 100) {\n if (checkComponentsTimer) {\n clearTimeout(checkComponentsTimer);\n }\n if (delay) {\n checkComponentsTimer = window.setTimeout(() => checkComponents(0), delay);\n return;\n }\n checkComponentsTimer = 0;\n Component.ALL.forEach((components) => {\n components.forEach((component) => component.autoDestroy());\n });\n}\n\nfunction autoDestroyComponents() {\n if (!document.body || takeData(document.body, '_autoDestoryMob')) {\n return;\n }\n const mob = new MutationObserver((mutations) => {\n let hasRemovedNodes = false;\n for (const mutation of mutations) {\n if (mutation.removedNodes.length) {\n hasRemovedNodes = true;\n break;\n }\n }\n\n if (hasRemovedNodes) {\n checkComponents();\n }\n });\n mob.observe(document.body, {childList: true, subtree: true});\n storeData(document.body, '_autoDestoryMob', mob);\n}\n\n/** Define the $.fn.zuiInit method. */\n$.fn.zuiInit = function (this: Cash, options?: ZUIInitOptions) {\n this.find('[zui-create],[data-zui]').each(function () {\n if (options?.beforeCreate?.(this) === false) {\n return;\n }\n initCreators(this, options);\n });\n this.find('[zui-init]').each(function () {\n if (this.hasAttribute('z-zui-inited')) {\n return;\n }\n this.setAttribute('z-zui-inited', '');\n $.runJS(this.getAttribute('zui-init')!, ['$element', $(this)]);\n });\n this.find('.hide-before-init').removeClass('invisible hidden opacity-0');\n this.find('.scroll-into-view').scrollIntoView();\n this.find('[data-on=\"inited\"],[zui-on-inited]').each((_, ele) => {\n const $ele = $(ele);\n if (!$ele.zui()) {\n $ele.trigger('inited');\n }\n });\n return this;\n};\n\n/** Define the $.fn.zui method. */\n$.fn.zui = function (this: Cash, name?: string | true, key?: string | number | true) {\n const element = this[0];\n if (!element) {\n return;\n }\n if (typeof name !== 'string') {\n const result: Record = {};\n let lastComponent: Component | undefined;\n getComponentsOnElement(element, (component, dataKey) => {\n result[dataKey] = component;\n if (!lastComponent || lastComponent.gid < component.gid) {\n lastComponent = result[dataKey];\n }\n });\n return name === true ? result : lastComponent;\n }\n const TheComponentClass = getComponent(name);\n if (!TheComponentClass) {\n return $(element).data(`zui.${name}`);\n }\n if (key === true) {\n return TheComponentClass.getAll(element);\n }\n return TheComponentClass.query(element, key);\n};\n\n$.fn.zuiCall = function (this: Cash, componentMethod: string, args: unknown[] = []) {\n this.each(function () {\n const parts = componentMethod.split('.');\n const name = parts.length > 1 ? parts[0] : undefined;\n const method = parts[parts.length > 1 ? 1 : 0];\n const component = $(this).zui(name) as (Component | undefined);\n const methodFunc = component?.[method as keyof Component];\n if (typeof methodFunc === 'function') {\n (methodFunc as ((...args: unknown[]) => void)).apply(component, args);\n }\n });\n return this;\n};\n\n$(() => {\n // Init zui creators and call [zui-init] code.\n $('body').zuiInit({update: true});\n\n // Bind toggle events.\n bindToggleEvents();\n\n // Auto destroy components when detached.\n autoDestroyComponents();\n});\n","import {Component} from '../component';\n\nexport type StickyOptions = {\n side?: 'top' | 'bottom';\n offset?: number;\n zIndex?: number;\n pinnedClass?: string;\n targets?: string;\n scrollContainer?: string;\n};\n\nexport class Sticky extends Component {\n static NAME = 'Sticky';\n\n protected declare _ob: IntersectionObserver;\n\n protected declare _container: HTMLElement;\n\n protected declare _scrollListener: () => void;\n\n protected declare _raf: number;\n\n init() {\n const {offset = 1, side, zIndex, pinnedClass = 'is-pinned', targets, scrollContainer} = this.options;\n const {$element} = this;\n const $targets = targets ? $element.find(targets) : $element;\n $targets.css({position: 'sticky', zIndex});\n if (side) $targets.css(side, -offset);\n\n if (scrollContainer) {\n const container = $element.closest(scrollContainer)[0] as HTMLElement;\n if (container) {\n const listener = () => {\n if (this._raf) {\n cancelAnimationFrame(this._raf);\n }\n this._raf = requestAnimationFrame(() => {\n this._raf = 0;\n if (container.scrollTop === 0 && (!side || side === 'top')) {\n $targets.toggleClass(pinnedClass, false);\n return;\n }\n const containerRect = container.getBoundingClientRect();\n $targets.each((_, target) => {\n const rect = target.getBoundingClientRect();\n const pinned = rect[side || 'top'] === containerRect[side || 'top'];\n target.classList.toggle(pinnedClass, pinned);\n });\n });\n };\n this._scrollListener = listener;\n container.addEventListener('scroll', listener);\n }\n this._container = container;\n } else {\n this._ob = new IntersectionObserver(\n (entries) => {\n entries.forEach(e => {\n e.target.classList.toggle(pinnedClass, e.intersectionRatio < offset);\n });\n },\n {threshold: [1]},\n );\n\n $targets.each((_, e) => this._ob.observe(e));\n }\n }\n\n destroy() {\n this._ob?.disconnect();\n if (this._container) {\n this._container.removeEventListener('scroll', this._scrollListener);\n if (this._raf) {\n cancelAnimationFrame(this._raf);\n }\n }\n }\n}\n","import {$, Cash, Selector, Comparator} from '../cash';\n\n/**\n * Options for {@link isVisible}.\n */\ntype ISVisibleOptions = {\n /** Whether to check if the element is fully visible. */\n fullyCheck?: boolean;\n viewport?: {left: number, top: number, width: number, height: number} | DOMRectReadOnly;\n container?: Comparator;\n checkZeroSize?: boolean;\n};\n\n/**\n * Check an element whethear is visible in the current viewport.\n *\n * @param selector Element selector to check.\n * @param options Options.\n * @returns True if the element is visible.\n * @see https://stackoverflow.com/a/26039199\n */\nexport function isVisible(selector: Selector, options: ISVisibleOptions = {}): boolean {\n const element = $(selector)[0];\n if (!element) {\n return false;\n }\n\n let {viewport} = options;\n const {left, top, width, height} = element.getBoundingClientRect();\n if (options.checkZeroSize && !(width * height)) {\n return false;\n }\n if (!viewport) {\n if (options.container) {\n viewport = $(element).closest(options.container)[0]!.getBoundingClientRect();\n } else {\n const {innerHeight, innerWidth} = window;\n const {clientHeight, clientWidth} = document.documentElement;\n viewport = {left: 0, top: 0, width: innerWidth || clientWidth, height: innerHeight || clientHeight};\n }\n }\n const {left: viewportLeft, top: viewportTop, width: viewportWidth, height: viewportHeight} = viewport;\n if (options.fullyCheck) {\n return (\n (left >= viewportLeft)\n && (top >= viewportTop)\n && ((left + width) <= (viewportWidth + viewportLeft))\n && ((top + height) <= (viewportHeight + viewportTop))\n );\n }\n // http://stackoverflow.com/questions/325933/determine-whether-two-date-ranges-overlap\n const horInView = (left <= (viewportLeft + viewportWidth)) && ((left + width) >= viewportLeft);\n const vertInView = (top <= (viewportTop + viewportHeight)) && ((top + height) >= viewportTop);\n\n return vertInView && horInView;\n}\n\n/* Declare types. */\ndeclare module 'cash-dom' {\n interface Cash {\n isVisible(options?: ISVisibleOptions): boolean;\n }\n}\n\n/* Extend as $.fn.isVisible() */\n$.fn.isVisible = function (this: Cash, options?: ISVisibleOptions) {\n return isVisible(this, options);\n};\n","import {$, Cash} from '../cash';\nimport {nextGid} from '../helpers';\n\nimport type {Selector} from '../cash';\n\n/**\n * Run javascript in an element.\n *\n * @param selector Element selector to run.\n * @param jsCode If not set, run all scripts in the element.\n */\nexport function runJS(selector: Selector, jsCode?: string | null, removeAfterRun = false) {\n const $element = $(selector);\n if (jsCode !== undefined) {\n if (typeof jsCode === 'string' && jsCode.length) {\n const id = `zui-runjs-${nextGid()}`;\n $element.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 {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 =