wz-h5-design 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,11 +25,19 @@ const Button = forwardRef(({
25
25
  if (value === void 0) return void 0;
26
26
  return typeof value === "number" ? `${value}px` : value;
27
27
  };
28
+ const calcBorderRadius = () => {
29
+ if (height !== void 0) {
30
+ const h = typeof height === "number" ? height : parseFloat(height);
31
+ if (!isNaN(h)) return `${h / 2}px`;
32
+ }
33
+ return void 0;
34
+ };
28
35
  const buttonStyle = useMemo(() => {
29
36
  const customStyle = {
30
37
  width: formatSize(width),
31
38
  height: formatSize(height),
32
- fontSize: formatSize(fontSize)
39
+ fontSize: formatSize(fontSize),
40
+ borderRadius: calcBorderRadius()
33
41
  };
34
42
  if (type === "cancel") {
35
43
  return {
@@ -61,7 +69,7 @@ const Button = forwardRef(({
61
69
  if (type === "plain") {
62
70
  return {
63
71
  color: textColor || "#666666",
64
- borderColor: borderColor || "#666666",
72
+ borderColor: borderColor || "rgba(102, 102, 102, 0.2)",
65
73
  background: "transparent",
66
74
  ...style,
67
75
  ...customStyle
@@ -1,6 +1,6 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react/jsx-runtime"),require("react"),require("react-dom/client")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","react","react-dom/client"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["wz-h5-design"]={},e.jsxRuntime,e.React,e.client)}(this,(function(e,t,s,r){"use strict";const l=s.forwardRef((({type:e="primary",size:r="medium",block:l=!1,disabled:n=!1,color:a="",textColor:i="",borderColor:c="",width:o,height:d,fontSize:u,className:m="",style:h={},children:p,icon:v,iconPosition:w="left",onClick:x},b)=>{const[f,z]=s.useState(!1),g=s.useRef(null),y=e=>{if(void 0!==e)return"number"==typeof e?`${e}px`:e},N=s.useMemo((()=>{const t={width:y(o),height:y(d),fontSize:y(u)};if("cancel"===e)return{background:"#D6D6D6",color:i||"#fff",...h,...t};if("outline"===e)return{color:i||"var(--wz-primary-color)",borderColor:c||"var(--wz-primary-color)",background:"transparent",...h,...t};if("text"===e)return{color:i||h.color||"var(--wz-primary-color, #22C94D)",background:"transparent",border:"none",boxShadow:"none",...h,...t};if("plain"===e)return{color:i||"#666666",borderColor:c||"#666666",background:"transparent",...h,...t};if("primary"===e){let e={...h};return n||(e.background=a||"var(--wz-primary-gradient, var(--wz-primary-color))"),e.color=i||"#fff",{...e,...t}}return{...h,...t}}),[e,a,i,c,o,d,u,h]),j=["wz-button",`wz-button--${e}`,`wz-button--${r}`,l?"wz-button--block":"",n?"wz-button--disabled":"",f&&!n?"wz-button--active":"",m].filter(Boolean).join(" ");return t.jsxs("button",{ref:b,type:"button",className:j,style:N,disabled:n,onClick:e=>{n||(z(!0),g.current&&window.clearTimeout(g.current),g.current=window.setTimeout((()=>z(!1)),100),null==x||x(e))},children:["left"===w&&v,p,"right"===w&&v,"primary"===e&&f&&t.jsx("span",{className:"wz-button__mask"}),"outline"===e&&f&&t.jsx("span",{className:"wz-button__mask"}),"outline"===e&&n&&t.jsx("span",{className:"wz-button__mask--disabled"}),"cancel"===e&&f&&t.jsx("span",{className:"wz-button__mask--cancel"}),"plain"===e&&f&&t.jsx("span",{className:"wz-button__mask"})]})}));l.displayName="Button";const n=({bgColor:e="#fff",height:s,padding:r="2px 10px",fixed:l=!1,gap:n=9,className:a="",style:i={},children:c})=>{const o=e=>{if(void 0!==e)return"number"==typeof e?`${e}px`:e},d={backgroundColor:e,height:o(s),padding:o(r),gap:o(n),...i},u=["wz-button-group",l?"wz-button-group--fixed":"",a].filter(Boolean).join(" ");return t.jsx("div",{className:u,style:d,children:c})};n.displayName="ButtonGroup";const a=({name:e,size:s=24,color:r="currentColor",className:l="",style:n,onClick:a,type:i="yunying"})=>{const c={fontSize:"number"==typeof s?`${s}px`:s,color:r,...n},o=`iconfont-${i}`,d=`icon-${e}`;return t.jsx("i",{className:`wz-icon ${o} ${d} ${l}`,style:c,onClick:a})},i=s.createContext({}),c=({size:e,checked:r,disabled:l,onChange:n,children:c,value:o,className:d="",style:u,...m})=>{const h=s.useContext(i),p=!!h.value,v=p?h.value===o:r,w=l||h.disabled,x=e||h.size||"medium";return t.jsxs("label",{className:`wz-radio-wrapper ${w?"wz-radio--disabled":""} wz-radio--${x} ${d}`,style:u,children:[t.jsx("input",{type:"radio",className:"wz-radio-input",checked:v,disabled:w,onChange:e=>{var t;l||h.disabled||(p?null==(t=h.onChange)||t.call(h,o):null==n||n(e.target.checked))},value:o,...m}),t.jsx("span",{className:"wz-radio-inner",children:t.jsx(a,{name:v?"radio-sel":"radio-nor",type:"yunying",size:{small:16,medium:18,large:20}[x]})}),c&&t.jsx("span",{className:"wz-radio-label",children:c})]})},o=({value:e,defaultValue:r,onChange:l,disabled:n,size:a,children:c,className:o="",style:d})=>{const[u,m]=s.useState(r),h={value:void 0!==e?e:u,onChange:e=>{m(e),null==l||l(e)},disabled:n,size:a};return t.jsx(i.Provider,{value:h,children:t.jsx("div",{className:`wz-radio-group ${o}`,style:d,children:c})})};c.Group=o,c.displayName="Radio",o.displayName="Radio.Group";const d=s.createContext({}),u=({size:e,checked:r,disabled:l,onChange:n,children:i,value:c,className:o="",style:u,...m})=>{var h;const p=s.useContext(d),v=!!p.value,w=v?null==(h=p.value)?void 0:h.includes(c):r,x=l||p.disabled,b=e||p.size||"medium";return t.jsxs("label",{className:`wz-checkbox-wrapper ${x?"wz-checkbox--disabled":""} wz-checkbox--${b} ${o}`,style:u,children:[t.jsx("input",{type:"checkbox",className:"wz-checkbox-input",checked:w,disabled:x,onChange:e=>{var t;if(!l&&!p.disabled)if(v){const s=e.target.checked?[...p.value||[],c]:(p.value||[]).filter((e=>e!==c));null==(t=p.onChange)||t.call(p,s)}else null==n||n(e.target.checked)},value:c,...m}),t.jsx("span",{className:"wz-checkbox-inner",children:t.jsx(a,{name:w?"checkbox-checked":"checkbox",type:"yunying",size:{small:16,medium:18,large:20}[b]})}),i&&t.jsx("span",{className:"wz-checkbox-label",children:i})]})},m=({value:e,defaultValue:r,onChange:l,disabled:n,size:a,children:i,className:c="",style:o})=>{const[u,m]=s.useState(r||[]),h={value:void 0!==e?e:u,onChange:e=>{m(e),null==l||l(e)},disabled:n,size:a};return t.jsx(d.Provider,{value:h,children:t.jsx("div",{className:`wz-checkbox-group ${c}`,style:o,children:i})})};u.Group=m,u.displayName="Checkbox",m.displayName="Checkbox.Group";function h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p,v={exports:{}};
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react/jsx-runtime"),require("react"),require("react-dom/client")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","react","react-dom/client"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["wz-h5-design"]={},e.jsxRuntime,e.React,e.client)}(this,(function(e,t,s,r){"use strict";const l=s.forwardRef((({type:e="primary",size:r="medium",block:l=!1,disabled:n=!1,color:a="",textColor:i="",borderColor:c="",width:o,height:d,fontSize:u,className:m="",style:h={},children:p,icon:v,iconPosition:w="left",onClick:x},b)=>{const[f,z]=s.useState(!1),g=s.useRef(null),N=e=>{if(void 0!==e)return"number"==typeof e?`${e}px`:e},y=()=>{if(void 0!==d){const e="number"==typeof d?d:parseFloat(d);if(!isNaN(e))return e/2+"px"}},j=s.useMemo((()=>{const t={width:N(o),height:N(d),fontSize:N(u),borderRadius:y()};if("cancel"===e)return{background:"#D6D6D6",color:i||"#fff",...h,...t};if("outline"===e)return{color:i||"var(--wz-primary-color)",borderColor:c||"var(--wz-primary-color)",background:"transparent",...h,...t};if("text"===e)return{color:i||h.color||"var(--wz-primary-color, #22C94D)",background:"transparent",border:"none",boxShadow:"none",...h,...t};if("plain"===e)return{color:i||"#666666",borderColor:c||"rgba(102, 102, 102, 0.2)",background:"transparent",...h,...t};if("primary"===e){let e={...h};return n||(e.background=a||"var(--wz-primary-gradient, var(--wz-primary-color))"),e.color=i||"#fff",{...e,...t}}return{...h,...t}}),[e,a,i,c,o,d,u,h]),k=["wz-button",`wz-button--${e}`,`wz-button--${r}`,l?"wz-button--block":"",n?"wz-button--disabled":"",f&&!n?"wz-button--active":"",m].filter(Boolean).join(" ");return t.jsxs("button",{ref:b,type:"button",className:k,style:j,disabled:n,onClick:e=>{n||(z(!0),g.current&&window.clearTimeout(g.current),g.current=window.setTimeout((()=>z(!1)),100),null==x||x(e))},children:["left"===w&&v,p,"right"===w&&v,"primary"===e&&f&&t.jsx("span",{className:"wz-button__mask"}),"outline"===e&&f&&t.jsx("span",{className:"wz-button__mask"}),"outline"===e&&n&&t.jsx("span",{className:"wz-button__mask--disabled"}),"cancel"===e&&f&&t.jsx("span",{className:"wz-button__mask--cancel"}),"plain"===e&&f&&t.jsx("span",{className:"wz-button__mask"})]})}));l.displayName="Button";const n=({bgColor:e="#fff",height:s,padding:r="2px 10px",fixed:l=!1,gap:n=9,className:a="",style:i={},children:c})=>{const o=e=>{if(void 0!==e)return"number"==typeof e?`${e}px`:e},d={backgroundColor:e,height:o(s),padding:o(r),gap:o(n),...i},u=["wz-button-group",l?"wz-button-group--fixed":"",a].filter(Boolean).join(" ");return t.jsx("div",{className:u,style:d,children:c})};n.displayName="ButtonGroup";const a=({name:e,size:s=24,color:r="currentColor",className:l="",style:n,onClick:a,type:i="yunying"})=>{const c={fontSize:"number"==typeof s?`${s}px`:s,color:r,...n},o=`iconfont-${i}`,d=`icon-${e}`;return t.jsx("i",{className:`wz-icon ${o} ${d} ${l}`,style:c,onClick:a})},i=s.createContext({}),c=({size:e,checked:r,disabled:l,onChange:n,children:c,value:o,className:d="",style:u,...m})=>{const h=s.useContext(i),p=!!h.value,v=p?h.value===o:r,w=l||h.disabled,x=e||h.size||"medium";return t.jsxs("label",{className:`wz-radio-wrapper ${w?"wz-radio--disabled":""} wz-radio--${x} ${d}`,style:u,children:[t.jsx("input",{type:"radio",className:"wz-radio-input",checked:v,disabled:w,onChange:e=>{var t;l||h.disabled||(p?null==(t=h.onChange)||t.call(h,o):null==n||n(e.target.checked))},value:o,...m}),t.jsx("span",{className:"wz-radio-inner",children:t.jsx(a,{name:v?"radio-sel":"radio-nor",type:"yunying",size:{small:16,medium:18,large:20}[x]})}),c&&t.jsx("span",{className:"wz-radio-label",children:c})]})},o=({value:e,defaultValue:r,onChange:l,disabled:n,size:a,children:c,className:o="",style:d})=>{const[u,m]=s.useState(r),h={value:void 0!==e?e:u,onChange:e=>{m(e),null==l||l(e)},disabled:n,size:a};return t.jsx(i.Provider,{value:h,children:t.jsx("div",{className:`wz-radio-group ${o}`,style:d,children:c})})};c.Group=o,c.displayName="Radio",o.displayName="Radio.Group";const d=s.createContext({}),u=({size:e,checked:r,disabled:l,onChange:n,children:i,value:c,className:o="",style:u,...m})=>{var h;const p=s.useContext(d),v=!!p.value,w=v?null==(h=p.value)?void 0:h.includes(c):r,x=l||p.disabled,b=e||p.size||"medium";return t.jsxs("label",{className:`wz-checkbox-wrapper ${x?"wz-checkbox--disabled":""} wz-checkbox--${b} ${o}`,style:u,children:[t.jsx("input",{type:"checkbox",className:"wz-checkbox-input",checked:w,disabled:x,onChange:e=>{var t;if(!l&&!p.disabled)if(v){const s=e.target.checked?[...p.value||[],c]:(p.value||[]).filter((e=>e!==c));null==(t=p.onChange)||t.call(p,s)}else null==n||n(e.target.checked)},value:c,...m}),t.jsx("span",{className:"wz-checkbox-inner",children:t.jsx(a,{name:w?"checkbox-checked":"checkbox",type:"yunying",size:{small:16,medium:18,large:20}[b]})}),i&&t.jsx("span",{className:"wz-checkbox-label",children:i})]})},m=({value:e,defaultValue:r,onChange:l,disabled:n,size:a,children:i,className:c="",style:o})=>{const[u,m]=s.useState(r||[]),h={value:void 0!==e?e:u,onChange:e=>{m(e),null==l||l(e)},disabled:n,size:a};return t.jsx(d.Provider,{value:h,children:t.jsx("div",{className:`wz-checkbox-group ${c}`,style:o,children:i})})};u.Group=m,u.displayName="Checkbox",m.displayName="Checkbox.Group";function h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p,v={exports:{}};
2
2
  /*!
3
3
  Copyright (c) 2018 Jed Watson.
4
4
  Licensed under the MIT License (MIT), see
5
5
  http://jedwatson.github.io/classnames
6
- */p=v,function(){var e={}.hasOwnProperty;function t(){for(var s=[],r=0;r<arguments.length;r++){var l=arguments[r];if(l){var n=typeof l;if("string"===n||"number"===n)s.push(l);else if(Array.isArray(l)){if(l.length){var a=t.apply(null,l);a&&s.push(a)}}else if("object"===n){if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]")){s.push(l.toString());continue}for(var i in l)e.call(l,i)&&l[i]&&s.push(i)}}}return s.join(" ")}p.exports?(t.default=t,p.exports=t):window.classNames=t}();const w=h(v.exports),x=e=>{const{title:r,icon:l,activeIcon:n,badge:i,badgeAsBubble:c,dot:o,hump:d,active:u,onItemClick:m,onClick:h,activeColor:p}=e,v=e=>"string"==typeof e?t.jsx(a,{size:22,name:e}):e,x=w("wz-tabbar-item",{"wz-tabbar-item-active":!d&&u,"wz-tabbar-item-hump":d}),b=s.useMemo((()=>{const e={};return u&&p&&(e.color=p),e}),[u,p]);return t.jsxs("div",{className:x,style:b,onClick:d?h:m,children:[t.jsxs("div",{className:"wz-tabbar-item-icon",children:[v(u&&n||l),o?t.jsx("div",{className:"wz-tabbar-item-dot"}):i?c?t.jsx("div",{className:"wz-tabbar-item-badge-custom",children:t.jsxs("div",{className:"wz-tabbar-item-badge-bubble",children:[i,t.jsx("div",{className:"wz-tabbar-item-badge-bubble-arrow"})]})}):s.isValidElement(i)?t.jsx("div",{className:"wz-tabbar-item-badge-custom",children:i}):t.jsx("div",{className:"wz-tabbar-item-badge",children:i}):null]}),!d&&t.jsx("div",{className:"wz-tabbar-item-title",children:r})]})},b=e=>{const{title:s,label:r,value:l,icon:n,arrow:i=!1,border:c=!0,center:o=!1,disabled:d=!1,required:u=!1,className:m,style:h,titleStyle:p,titleClassName:v,labelStyle:x,labelClassName:b,valueStyle:f,valueClassName:z,onClick:g,children:y}=e,N=w("wz-cell",{"wz-cell-border":c,"wz-cell-center":o,"wz-cell-disabled":d},m);return t.jsxs("div",{className:N,style:h,onClick:d?void 0:g,children:[n?t.jsx("div",{className:"wz-cell-icon",children:n}):null,t.jsxs("div",{className:"wz-cell-content",children:[s?t.jsxs("div",{className:w("wz-cell-title",v),style:p,children:[u&&t.jsx("span",{className:"wz-cell-required",children:"*"}),s,l&&t.jsx("span",{className:w("wz-cell-value",z),style:f,children:l})]}):null,r?t.jsx("div",{className:w("wz-cell-label",b),style:x,children:r}):null]}),null,y&&t.jsx("div",{className:"wz-cell-extra",children:y}),i?t.jsx("div",{className:"wz-cell-arrow",children:t.jsx(a,{name:"right-arrow",size:16})}):null]})};b.Group=e=>{const{className:s,style:r,children:l}=e;return t.jsx("div",{className:w("wz-cell-group",s),style:r,children:l})};const f=({type:e="line",align:r="center",value:l,defaultValue:n=0,onChange:a,className:i="",style:c,headerClassName:o="",headerStyle:d,contentClassName:u="",contentStyle:m,children:h,maxTabs:p=5})=>{const v=void 0!==l,[w,x]=s.useState(n),b=v?l:w,f=s.useRef(null),z=s.useRef(!1),g=s.useRef(0),y=s.useRef(0),N=s.useCallback((e=>{"left"===r&&f.current&&(z.current=!0,g.current=e.pageX-f.current.offsetLeft,y.current=f.current.scrollLeft)}),[r]),j=s.useCallback((e=>{if(!z.current||!f.current)return;e.preventDefault();const t=1.5*(e.pageX-f.current.offsetLeft-g.current);f.current.scrollLeft=y.current-t}),[]),k=s.useCallback((()=>{z.current=!1}),[]),C=s.useCallback((()=>{z.current=!1}),[]),$=s.Children.toArray(h).filter(Boolean).slice(0,p),S="card"===e?{flex:$.length>3?"0 0 calc((100% - 28px) / 3)":"1"}:void 0;return t.jsxs("div",{className:`wz-tabs wz-tabs-${e}${"left"===r?" wz-tabs-align-left":""} ${i}`,style:c,children:[t.jsx("div",{ref:f,className:`wz-tabs-header ${o}`,style:d,onMouseDown:N,onMouseMove:j,onMouseUp:k,onMouseLeave:C,children:$.map(((s,r)=>t.jsx("div",{className:`wz-tabs-tab${r===b?" wz-tabs-tab-active":""}${s.props.disabled?" wz-tabs-tab-disabled":""}`,style:S,onClick:()=>((e,t)=>{t||(v||x(e),null==a||a(e))})(r,s.props.disabled),children:t.jsxs("div",{className:"wz-tabs-tab-text",children:[s.props.title,s.props.badge&&t.jsx("div",{className:"wz-tabs-badge",children:s.props.badge}),r===b&&"line"===e&&t.jsx("div",{className:"wz-tabs-underline"})]})},r)))}),t.jsx("div",{className:`wz-tabs-content ${u}`,style:m,children:$[b]})]})};f.TabPane=({children:e})=>t.jsx(t.Fragment,{children:e});const z=s.forwardRef((({clearable:e=!1,align:r="left",value:l,defaultValue:n,onChange:i,style:c,className:o="",type:d="text",showCount:u=!1,rows:m=3,maxLength:h,countStyle:p,suffix:v,borderRadius:w,backgroundColor:x,bordered:b,codeCountdown:f=60,onGetCode:z,codeText:g="获取验证码",codeCountingText:y="{s}s后重新获取",codeResendText:N="重新获取验证码",...j},k)=>{const C=void 0!==l,[$,S]=s.useState(n||""),T=e&&!!(C?l:$),[_,R]=s.useState(!1),[E,M]=s.useState(!1),[L,D]=s.useState(f),[A,I]=s.useState(!1),[B,F]=s.useState(0),P=s.useRef(null);s.useEffect((()=>{if(P.current){const e=P.current.offsetWidth;F(e)}}),[E,L,A,v,g,y,N]),s.useEffect((()=>{let e;return E&&L>0?e=setInterval((()=>{D((e=>e-1))}),1e3):0===L&&(M(!1),D(f)),()=>clearInterval(e)}),[E,L,f]);const O=s.useCallback((async()=>{if(!E)try{await(null==z?void 0:z()),M(!0),I(!0)}catch{}}),[E,z]),V=e=>{C||S(e.target.value),null==i||i(e)},q={position:"relative",width:null==c?void 0:c.width,...c},G={textAlign:r,borderRadius:w,backgroundColor:x,border:void 0!==b?void 0:"none",...B>0&&(v||"code"===d)?{paddingRight:B+22+12}:{}},W=C?l:$,Y=(null==W?void 0:W.toString().length)||0,H=h&&Y>h;return t.jsxs("div",{className:`wz-input-affix-wrapper ${"textarea"===d?"wz-input-affix-wrapper-textarea":""} ${v||"code"===d?"wz-input-has-suffix":""} ${void 0===b?"wz-input-no-border":""} ${e?"wz-input-has-clear":""} ${"password"===d?"wz-input-has-password":""}`,style:q,children:["textarea"===d?t.jsxs(t.Fragment,{children:[t.jsx("textarea",{ref:k,className:`wz-input ${o}`,value:W,onChange:V,style:{...G,resize:"none"},rows:m,maxLength:h,...j}),u&&h&&t.jsxs("div",{className:"wz-input-count "+(H?"wz-input-count-exceeded":""),style:p,children:[Y,"/",h]})]}):t.jsx("input",{ref:k,className:`wz-input ${o}`,value:W,onChange:V,style:G,type:"password"===d&&_?"text":d,maxLength:h,...j}),T&&!j.disabled&&"textarea"!==d&&!v&&t.jsx("span",{className:"wz-input-clear",onClick:()=>{C||S("");const e={...j,target:{value:""}};null==i||i(e)},children:t.jsx(a,{name:"close",size:22})}),"password"===d&&!v&&t.jsx("span",{className:"wz-input-password",onClick:()=>{R(!_)},children:t.jsx(a,{name:_?"eyes-close":"eyes-open",size:22})}),v&&t.jsxs("div",{className:"wz-input-suffix",ref:P,children:[t.jsx("span",{className:"wz-input-suffix-divider"}),v]}),"code"===d&&t.jsxs("div",{className:"wz-input-suffix",ref:v?void 0:P,children:[t.jsx("span",{className:"wz-input-suffix-divider"}),E?t.jsx("span",{className:"wz-input-code-btn wz-input-code-btn--disabled",children:y.replace("{s}",String(L))}):t.jsx("span",{className:"wz-input-code-btn",onClick:O,children:A?N:g})]})]})}));z.displayName="Input";const g={horizontal:{default:"#f7f7f7",emphasis:"#eeeeee"},vertical:"rgba(0, 0, 0, 0.1)"},y=s.forwardRef((({value:e,defaultValue:r,placeholder:l="输入关键词搜索",shape:n="round",clearable:i=!0,disabled:c=!1,prefix:o,suffix:d,leftIcon:u=t.jsx(a,{name:"search",size:16}),actionText:m="搜索",actionColor:h,showCancel:p=!1,cancelText:v="返回",background:w,style:x,className:b="",onSearch:f,onClear:z,onChange:g,onFocus:y,onBlur:N,onCancel:j,...k},C)=>{const $=void 0!==e,[S,T]=s.useState(r||""),[_,R]=s.useState(!1),E=s.useRef(null);s.useImperativeHandle(C,(()=>E.current));const M=$?e:S,L=i&&M&&_&&!c,D=()=>{var e;c||(null==(e=E.current)||e.blur(),null==f||f(M))},A=()=>{R(!1),null==j||j()},I={...x,backgroundColor:w};return t.jsxs("div",{className:`wz-search ${_?"wz-search-focused":""} ${b}`,style:I,children:[o&&t.jsx("div",{className:"wz-search-prefix",children:o}),!o&&p&&_?t.jsx("div",{className:"wz-search-cancel",onClick:A,children:v}):null,t.jsxs("div",{className:`wz-search-content wz-search-shape-${n} ${c?"wz-search-disabled":""}`,children:[t.jsxs("div",{className:"wz-search-input-wrapper "+(L?"wz-search-input-wrapper--with-clear":""),children:[u&&t.jsx("div",{className:"wz-search-left-icon",children:u}),t.jsx("input",{ref:E,className:"wz-search-input",value:M,onChange:e=>{const t=e.target.value;$||T(t),null==g||g(t)},onFocus:e=>{R(!0),null==y||y(e)},onBlur:e=>{R(!1),null==N||N(e)},onKeyDown:e=>{"Enter"!==e.key||c||D()},placeholder:l,disabled:c,...k}),L&&t.jsx("div",{className:"wz-search-clear",onMouseDown:e=>{var t;e.preventDefault(),$||T(""),null==g||g(""),null==z||z(),null==(t=E.current)||t.focus()},children:t.jsx(a,{name:"close",size:16,color:"#CCCCCC"})})]}),m&&t.jsxs("div",{className:"wz-search-action",onClick:D,children:[t.jsx("div",{className:"wz-search-divider"}),t.jsx("div",{className:"wz-search-action-text",style:h?{color:h}:void 0,children:m})]})]}),d&&t.jsx("div",{className:"wz-search-suffix",children:d})]})}));y.displayName="Search";const N=Array.from({length:24},((e,t)=>`${t+1}小时`)),j=Array.from({length:24},((e,t)=>t.toString().padStart(2,"0"))),k=Array.from({length:60},((e,t)=>t.toString().padStart(2,"0"))),C=({value:e,onChange:r,min:l="1970-01-01",max:n="2100-12-31",columns:a=["year","month","day"],itemHeight:i=48,className:c="",style:o})=>{const d=new Date,[u,m,h]=e?e.split("-").map(Number):[d.getFullYear(),d.getMonth()+1,d.getDate()],p=Number(l.split("-")[0]),v=Number(n.split("-")[0]),w=s.useMemo((()=>((e,t)=>{const s=[];for(let r=e;r<=t;r++)s.push(r.toString());return s})(p,v)),[p,v]),[x,b]=s.useState(u),[f,z]=s.useState(m),[g,y]=s.useState(h),N=Array.from({length:12},((e,t)=>(t+1).toString().padStart(2,"0"))),j=((e,t)=>{const s=new Date(e,t,0).getDate();return Array.from({length:s},((e,t)=>(t+1).toString().padStart(2,"0")))})(x,f),k=s.useRef(null),C=s.useRef(null),$=s.useRef(null),S=s.useRef(0),T=s.useRef(0),_=s.useRef(!1),R=s.useRef(null);s.useLayoutEffect((()=>{k.current&&k.current.scrollTo({top:(x-p)*i,behavior:"auto"})}),[x,i,p]),s.useLayoutEffect((()=>{C.current&&C.current.scrollTo({top:(f-1)*i,behavior:"auto"})}),[f,i]),s.useLayoutEffect((()=>{$.current&&$.current.scrollTo({top:(g-1)*i,behavior:"auto"})}),[g,i]);const E=e=>t=>{var s,r,l;_.current=!0,R.current=e,S.current=t.touches[0].clientY;let n=0;"year"===e&&(n=(null==(s=k.current)?void 0:s.scrollTop)||0),"month"===e&&(n=(null==(r=C.current)?void 0:r.scrollTop)||0),"day"===e&&(n=(null==(l=$.current)?void 0:l.scrollTop)||0),T.current=n},M=e=>{if(!_.current||!R.current)return;const t=e.touches[0].clientY-S.current;"year"===R.current&&k.current&&(k.current.scrollTop=T.current-t),"month"===R.current&&C.current&&(C.current.scrollTop=T.current-t),"day"===R.current&&$.current&&($.current.scrollTop=T.current-t)},L=()=>{if(_.current&&R.current){if("year"===R.current&&k.current){const e=Math.round(k.current.scrollTop/i);b(Number(w[e])),null==r||r(`${w[e]}-${f.toString().padStart(2,"0")}-${g.toString().padStart(2,"0")}`)}if("month"===R.current&&C.current){const e=Math.round(C.current.scrollTop/i);z(Number(N[e])),null==r||r(`${x}-${N[e]}-${g.toString().padStart(2,"0")}`)}if("day"===R.current&&$.current){const e=Math.round($.current.scrollTop/i);y(Number(j[e])),null==r||r(`${x}-${f.toString().padStart(2,"0")}-${j[e]}`)}_.current=!1,R.current=null}},D=e=>()=>{if(!_.current){if("year"===e&&k.current){const e=Math.round(k.current.scrollTop/i);b(Number(w[e])),null==r||r(`${w[e]}-${f.toString().padStart(2,"0")}-${g.toString().padStart(2,"0")}`)}if("month"===e&&C.current){const e=Math.round(C.current.scrollTop/i);z(Number(N[e])),null==r||r(`${x}-${N[e]}-${g.toString().padStart(2,"0")}`)}if("day"===e&&$.current){const e=Math.round($.current.scrollTop/i);y(Number(j[e])),null==r||r(`${x}-${f.toString().padStart(2,"0")}-${j[e]}`)}}};s.useEffect((()=>{if(e){const[t,s,r]=e.split("-").map(Number);b(t),z(s),y(r),k.current&&k.current.scrollTo({top:(t-p)*i,behavior:"auto"}),C.current&&C.current.scrollTo({top:(s-1)*i,behavior:"auto"}),$.current&&$.current.scrollTo({top:(r-1)*i,behavior:"auto"})}}),[e]);const A=(e,s,r,l)=>t.jsxs("div",{className:"wz-date-picker-list",ref:r,style:{height:3*i},onTouchStart:E(l),onTouchMove:M,onTouchEnd:L,onScroll:D(l),children:[t.jsx("div",{style:{height:i}}),e.map(((e,r)=>t.jsx("div",{className:"wz-date-picker-item"+(r===s?" active":""),style:{height:i},children:"year"===l?`${e}年`:"month"===l?`${e}月`:`${e}日`},e))),t.jsx("div",{style:{height:i}})]});return t.jsxs("div",{className:`wz-date-picker ${c}`,style:o,children:[t.jsx("div",{className:"wz-date-picker-mask wz-date-picker-mask-top",style:{height:i}}),t.jsx("div",{className:"wz-date-picker-indicator",style:{height:i}}),t.jsxs("div",{className:"wz-date-picker-columns",children:[a.includes("year")&&A(w,x-p,k,"year"),a.includes("month")&&A(N,f-1,C,"month"),a.includes("day")&&A(j,g-1,$,"day")]}),t.jsx("div",{className:"wz-date-picker-mask wz-date-picker-mask-bottom",style:{height:i}})]})},$={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",baseline:"baseline"},S={start:"flex-start",center:"center",end:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly"},T=({direction:e="row",align:s="stretch",justify:r="start",wrap:l="nowrap",gap:n=0,className:a="",style:i={},children:c})=>{const o={display:"flex",flexDirection:e,alignItems:$[s],justifyContent:S[r],flexWrap:l,gap:"number"==typeof n?`${n}px`:n,...i};return t.jsx("div",{className:"wz-flex"+(a?" "+a:""),style:o,children:c})};T.Item=({span:e,order:s,offset:r,className:l="",style:n={},children:a})=>{process.env.NODE_ENV;const i={flexBasis:void 0!==e?100*e+"%":void 0,flexGrow:void 0!==e?0:void 0,flexShrink:void 0!==e?0:void 0,order:s,marginLeft:void 0!==r?100*r+"%":void 0,...n};return t.jsx("div",{className:"wz-flex-item"+(l?" "+l:""),style:i,children:a})};const _=s.createContext(24),R=({cols:e=24,gap:s=0,className:r="",style:l={},children:n})=>{const a={display:"flex",flexWrap:"wrap",gap:"number"==typeof s?`${s}px`:s,...l};return t.jsx(_.Provider,{value:e,children:t.jsx("div",{className:"wz-grid"+(r?" "+r:""),style:a,children:n})})};R.Item=({span:e=1,offset:r=0,order:l,className:n="",style:a={},children:i})=>{const c=s.useContext(_);process.env.NODE_ENV;const o=e/c*100+"%",d=r?r/c*100+"%":void 0;return t.jsx("div",{className:"wz-grid-item"+(n?" "+n:""),style:{width:o,marginLeft:d,order:l,...a},children:i})};const E=({columns:e=4,gap:s=0,square:r=!0,className:l="",style:n={},children:a,noBg:i=!1,rounded:c=!1,shadow:o=!1,horizontal:d=!1})=>{const u={gridTemplateColumns:`repeat(${e}, 1fr)`,gap:"number"==typeof s?`${s}px`:s,...n},m=["wz-grid-view",r?"wz-grid-view--square":"",i?"wz-grid-view--no-bg":"",c?"wz-grid-view--rounded":"",o?"wz-grid-view--shadow":"",d?"wz-grid-view--horizontal":"",l].filter(Boolean).join(" ");return t.jsx("div",{className:m,style:u,children:a})};E.Item=({icon:e,text:s,textColor:r,textSize:l,description:n,descriptionColor:a,descriptionSize:i,badge:c,corner:o,onClick:d,className:u="",style:m={},disabled:h=!1,children:p,horizontal:v=!1,compact:w=!1,backgroundImage:x,backgroundStyle:b={}})=>{const f=()=>{!h&&d&&d()},z=["wz-grid-view-item",h?"wz-grid-view-item--disabled":"",d?"wz-grid-view-item--clickable":"",v?"wz-grid-view-item--horizontal":"",w?"wz-grid-view-item--compact":"",x?"wz-grid-view-item--with-bg":"",u].filter(Boolean).join(" "),g=x?{backgroundImage:`url(${x})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",...b,...m}:m;return p?t.jsxs("div",{className:z,style:g,onClick:f,children:[o&&t.jsx("div",{className:"wz-grid-view-item__corner",children:o}),p,c&&t.jsx("div",{className:"wz-grid-view-item__badge",children:c})]}):t.jsxs("div",{className:z,style:g,onClick:f,children:[o&&t.jsx("div",{className:"wz-grid-view-item__corner",children:o}),t.jsxs("div",{className:"wz-grid-view-item__content",children:[e&&t.jsx("div",{className:"wz-grid-view-item__icon",children:e}),t.jsxs("div",{className:"wz-grid-view-item__text",children:[s&&t.jsx("div",{className:"wz-grid-view-item__title",style:{...r?{color:r}:{},...l?{fontSize:"number"==typeof l?`${l}px`:l}:{}},children:s}),n&&t.jsx("div",{className:"wz-grid-view-item__desc",style:{...a?{color:a}:{},...i?{fontSize:"number"==typeof i?`${i}px`:i}:{}},children:n})]})]}),c&&t.jsx("div",{className:"wz-grid-view-item__badge",children:c})]})};const M=({content:e,duration:r=2e3,icon:l,visible:n=!1,onClose:a})=>{const[i,c]=s.useState(n);s.useEffect((()=>{let e;return c(n),n&&r>0&&(e=setTimeout((()=>{c(!1),null==a||a()}),r)),()=>{clearTimeout(e)}}),[n,r,a]);const o=w("wz-toast",{"wz-toast-visible":i}),d=w("wz-toast-icon");return t.jsx("div",{className:o,children:t.jsxs("div",{className:"wz-toast-content",children:[l&&t.jsx("div",{className:d,children:l}),t.jsx("div",{className:"wz-toast-text",children:e})]})})};let L=null,D=null;const A=()=>{L&&(L.unmount(),L=null),D&&D.parentNode&&(D.parentNode.removeChild(D),D=null)},I=e=>{D||(D=document.createElement("div"),document.body.appendChild(D),L=r.createRoot(D)),L.render(t.jsx(M,{...e}))},B={show:e=>{I({..."string"==typeof e?{content:e}:e,visible:!0,onClose:A})},success:(e,s)=>{I({content:e,duration:s,icon:t.jsx(a,{name:"check-round",size:37.14}),visible:!0,onClose:A})},fail:(e,s)=>{I({content:e,duration:s,icon:t.jsx(a,{name:"close",size:37.14}),visible:!0,onClose:A})},loading:(e,s)=>{I({content:e,duration:s,icon:t.jsx(a,{name:"loading",size:37.14}),visible:!0,onClose:A})},warn:(e,s)=>{I({content:e,duration:s,icon:t.jsx(a,{name:"info",size:37.14}),visible:!0,onClose:A})},hide:()=>{I({content:"",visible:!1}),A()}},F=({visible:e,title:s,content:r,onClose:n,actions:a,closeOnAction:i,closeOnMaskClick:c})=>t.jsxs("div",{className:w("wz-dialog-root",{visible:e}),children:[t.jsx("div",{className:"wz-dialog-mask",onClick:()=>{c&&(null==n||n())}}),t.jsxs("div",{className:"wz-dialog-wrap",children:[s&&t.jsx("div",{className:"wz-dialog-header",children:t.jsx("div",{className:"wz-dialog-title",children:s})}),t.jsx("div",{className:"wz-dialog-content",children:r}),t.jsx("div",{className:"wz-dialog-footer",children:null==a?void 0:a.map((e=>t.jsx(l,{className:"wz-dialog-button",onClick:()=>{return null==(t=e.onClick)||t(),void(i&&(null==n||n()));var t},children:e.text},e.key)))})]})]}),P=e=>{const s=document.createElement("div");document.body.appendChild(s);const l=r.createRoot(s);l.render(t.jsx(F,{...e,visible:!0,onClose:()=>{l.unmount(),document.body.removeChild(s)}}))},O=Object.assign(F,{alert:e=>{P({...e,closeOnAction:!0,actions:[{key:"confirm",text:"确定",onClick:e.onConfirm}]})},confirm:e=>{P({...e,closeOnAction:!0,actions:[{key:"cancel",text:"取消",onClick:e.onCancel},{key:"confirm",text:"确定",onClick:e.onConfirm}]})}}),V=s.createContext({theme:"default"}),q={primaryColor:"--wz-primary-color",primaryGradient:"--wz-primary-gradient",primaryColorLight:"--wz-primary-color-light",primaryColorDark:"--wz-primary-color-dark",successColor:"--wz-success-color",warningColor:"--wz-warning-color",dangerColor:"--wz-danger-color",infoColor:"--wz-info-color",textColorPrimary:"--wz-text-color-primary",textColorRegular:"--wz-text-color-regular",textColorSecondary:"--wz-text-color-secondary",bgColorBase:"--wz-bg-color-base",bgColorLight:"--wz-bg-color-light",bgColorWhite:"--wz-bg-color-white",borderColorBase:"--wz-border-color-base",borderColorLight:"--wz-border-color-light"};e.Button=l,e.ButtonGroup=n,e.Card=({title:e,extra:s,cover:r,actions:l,bordered:n,noDivider:a=!1,className:i="",style:c,children:o,onClick:d})=>{const u=["wz-card",void 0!==n?"wz-card-bordered":"",a?"wz-card-no-divider":"",i].filter(Boolean).join(" ");return t.jsxs("div",{className:u,style:c,onClick:d,children:[r&&t.jsx("div",{className:"wz-card-cover",children:r}),(e||s)&&t.jsxs("div",{className:"wz-card-header",children:[e&&t.jsx("div",{className:"wz-card-title",children:e}),s&&t.jsx("div",{className:"wz-card-extra",children:s})]}),t.jsx("div",{className:"wz-card-body",children:o}),l&&l.length>0&&t.jsx("div",{className:"wz-card-actions",children:l.map(((e,s)=>t.jsx("div",{className:"wz-card-action",children:e},s)))})]})},e.Cascader=({value:e,onChange:r,data:l})=>{const[n,a]=s.useState(e||[]),[i,c]=s.useState(Math.min((e||[]).length,2));s.useEffect((()=>{void 0!==e&&(a(e),c(Math.min(e.length,2)))}),[e]);const o=s.useMemo((()=>{if(0===i)return l;let e=l;for(let t=0;t<i;t++){const s=e.find((e=>e.value===n[t]));e=(null==s?void 0:s.children)||[]}return e}),[l,i,n]),d=s.useMemo((()=>{let e=l;const t=["请选择","请选择","请选择"];return n.map(((s,r)=>{const l=e.find((e=>e.value===s));return e=(null==l?void 0:l.children)||[],(null==l?void 0:l.label)||t[r]}))}),[l,n]);return t.jsxs("div",{className:"wz-cascader",children:[t.jsx("div",{className:"wz-cascader-levels",children:["省","市","区"].map(((e,s)=>s>0&&n.length<s?null:t.jsx("div",{className:`\n wz-cascader-level \n ${i===s?"active":""}\n ${n[s]?"selected":""}\n `,onClick:()=>{var e;(e=s)<=n.length&&c(e)},children:n[s]?d[s]:"请选择"},e)))}),t.jsx("div",{className:"wz-cascader-content",children:t.jsx("div",{className:"wz-cascader-options",children:o.map((e=>t.jsxs("div",{className:`\n wz-cascader-option \n ${n.includes(e.value)?"selected":""}\n ${e.disabled?"disabled":""}\n `,onClick:()=>(e=>{if(e.disabled)return;const t=[...n];t[i]=e.value,t.length=i+1,a(t),0===i&&e.children?c(1):1===i&&e.children?c(2):2===i&&(null==r||r(t))})(e),children:[e.label,e.disabled&&t.jsx("span",{className:"wz-cascader-option-tip",children:"不可选"})]},e.value)))})})]})},e.Cell=b,e.CheckList=({options:e,value:s,onChange:r,multiple:l=!1,style:n,className:i=""})=>{const c=e=>l&&Array.isArray(s)?s.includes(e):s===e;return t.jsx("div",{className:`wz-check-list ${i}`,style:n,children:e.map((e=>t.jsxs("div",{className:"wz-check-list__item"+(c(e)?" wz-check-list__item--active":""),onClick:()=>(e=>{if(l){if(!Array.isArray(s))return;s.includes(e)?r(s.filter((t=>t!==e))):r([...s,e])}else r(e)})(e),children:[t.jsx("span",{className:"wz-check-list__label",children:e}),c(e)&&t.jsx("span",{className:"wz-check-list__icon",children:t.jsx(a,{name:"check",size:18,type:"yunying"})})]},e)))})},e.Checkbox=u,e.Collapse=({title:e,extra:r,children:l,defaultExpanded:n=!1,expanded:a,onChange:i,style:c,className:o="",headerStyle:d,headerClassName:u="",contentStyle:m,contentClassName:h=""})=>{const[p,v]=s.useState(n),w=void 0!==a,x=w?a:p;return t.jsxs("div",{className:"wz-collapse"+(o?" "+o:""),style:c,children:[t.jsxs("div",{className:`wz-collapse-header ${u}`,onClick:()=>{w||v(!x),null==i||i(!x)},style:d,children:[t.jsx("div",{className:"wz-collapse-title",children:e}),t.jsx("div",{className:"wz-collapse-extra",onClick:e=>e.stopPropagation(),children:r}),t.jsx("svg",{className:"wz-collapse-arrow"+(x?" expanded":""),width:"20",height:"20",viewBox:"0 0 20 20",style:{transition:"transform 0.2s",transform:x?"rotate(90deg)":"rotate(0deg)"},children:t.jsx("polyline",{points:"7,5 13,10 7,15",fill:"none",stroke:"#888",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),t.jsx("div",{className:`wz-collapse-content${x?" expanded":""} ${h}`,style:m,children:l})]})},e.ConfigProvider=({children:e,theme:r="default",themeVars:l})=>{s.useEffect((()=>{const e=document.documentElement;return"default"===r?e.removeAttribute("data-theme"):e.setAttribute("data-theme",r),l&&Object.entries(l).forEach((([t,s])=>{if(s){const r=q[t];r&&e.style.setProperty(r,s)}})),()=>{l&&Object.keys(l).forEach((t=>{const s=q[t];s&&e.style.removeProperty(s)}))}}),[r,l]);const n=s.useMemo((()=>({theme:r,themeVars:l})),[r,l]);return t.jsx(V.Provider,{value:n,children:e})},e.DatePicker=C,e.DateRangePicker=({value:e,onChange:r,min:l="1970-01-01",max:n="2100-12-31",startLabel:i="开始时间",endLabel:c="结束时间",className:o="",style:d,showLongTerm:u=!1,longTermLabel:m="长期有效",longTermValue:h="9999-12-31"})=>{const p=s.useMemo((()=>{const e=new Date;return`${e.getFullYear()}-${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")}`}),[]),[v,w]=s.useState(e||[p,p]),x=e||v,[b,f]=s.useState("start"),z=x[1]===h;return t.jsxs("div",{className:`wz-date-range-picker ${o}`,style:d,children:[t.jsxs("div",{className:"wz-date-range-picker-label-row",children:[t.jsx("div",{className:"wz-date-range-picker-label",children:i}),t.jsx("div",{className:"wz-date-range-picker-label",children:c})]}),t.jsxs("div",{className:"wz-date-range-picker-row",children:[t.jsx("div",{className:"wz-date-range-picker-col",children:t.jsx("div",{className:"wz-date-range-picker-value"+("start"===b?" active":""),onClick:()=>f("start"),children:x[0]||"请选择"})}),t.jsx("div",{className:"wz-date-range-picker-sep",children:"至"}),t.jsxs("div",{className:"wz-date-range-picker-col",children:[t.jsx("div",{className:`wz-date-range-picker-value${"end"===b?" active":""}${z?" disabled":""}`,onClick:()=>!z&&f("end"),children:z?m:x[1]||"请选择"}),u&&t.jsxs("div",{className:"wz-date-range-picker-long-term",onClick:()=>{if(z){const e=[x[0],x[0]];w(e),null==r||r(e)}else{const e=[x[0],h];w(e),null==r||r(e)}},children:[t.jsx(a,{name:z?"radio-sel":"radio-nor",type:"yunying",size:20,color:z?"var(--active-color)":"#ccc"}),t.jsx("span",{className:"wz-date-range-picker-long-term-text",children:m})]})]})]}),t.jsx("div",{className:"wz-date-range-picker-picker",children:t.jsx(C,{value:"start"===b?x[0]:x[1],onChange:e=>{if("start"===b){const t=[e,x[1]&&x[1]>=e?x[1]:e];w(t),null==r||r(t)}else{const t=[x[0],e&&e>=x[0]?e:x[0]];w(t),null==r||r(t)}},min:l,max:n})})]})},e.Dialog=O,e.Divider=({direction:e="horizontal",type:s="default",color:r,length:l,margin:n,style:a,className:i=""})=>{const c="vertical"===e,o=c?g.vertical:g.horizontal[s];return t.jsx("div",{className:`wz-divider wz-divider--${e} ${i}`,style:{background:r||o,width:c?2:l||"100%",height:c?l||24:2,margin:n,...a}})},e.DropdownMenu=({items:e,extension:r,onChange:l,value:n,defaultValue:i={}})=>{const[c,o]=s.useState(null),[d,u]=s.useState(i);s.useEffect((()=>{void 0!==n&&u(n)}),[n]);const m=void 0!==n,h=()=>m?n:d,p=t=>{const s=h()[t];if(void 0===s)return e[t].title;const r=e[t].options.find((e=>e.value===s));return r?r.text:e[t].title};return t.jsxs("div",{className:"wz-dropdown-menu-wrapper",children:[t.jsxs("div",{className:"wz-dropdown-menu",children:[e.map(((e,s)=>t.jsxs("div",{className:"wz-dropdown-item "+(c===s?"active":""),onClick:()=>(e=>{o(c===e?null:e)})(s),children:[t.jsx("span",{children:p(s)}),e.icon||t.jsx(a,{name:"dropdown",size:12})]},s))),r&&t.jsx("div",{className:"wz-dropdown-extension",children:r})]}),null!==c&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"wz-dropdown-mask",onClick:()=>{o(null)}}),t.jsx("div",{className:"wz-dropdown-popup",children:e[c].options.map((e=>t.jsx("div",{className:"wz-dropdown-option "+(h()[c]===e.value?"selected":""),onClick:()=>((e,t)=>{const s={...h(),[e]:t};m||u(s),o(null),l&&l(e,t,s)})(c,e.value),children:e.text},e.value)))})]})]})},e.Flex=T,e.Grid=R,e.GridView=E,e.Icon=a,e.Input=z,e.NavBar=({title:e,leftArrow:r=!0,leftText:l,rightText:n,onLeftClick:i,onRightClick:c,leftSlot:o,rightSlot:d,titleSlot:u,className:m,style:h,fixed:p=!1,scrollFixed:v=!1})=>{const[x,b]=s.useState(p),f=s.useRef(null),z=s.useRef(null);s.useEffect((()=>{if(!1===v)return void b(p);const e="number"==typeof v?v:0,t=()=>{const t=window.pageYOffset||document.documentElement.scrollTop;b(t>e)};return window.addEventListener("scroll",t),t(),()=>{window.removeEventListener("scroll",t)}}),[v,p]);const g=()=>{i&&i()},y=()=>{c&&c()},N=w("wz-navbar",{"wz-navbar-fixed":x},m);return t.jsxs(t.Fragment,{children:[x&&t.jsx("div",{ref:z,style:{height:"44px"}}),t.jsxs("div",{ref:f,className:N,style:h,children:[o?t.jsx("div",{className:"wz-navbar-left",children:o}):t.jsxs("div",{className:"wz-navbar-left",onClick:g,children:[r&&t.jsx(a,{name:"right-arrow",size:20,style:{transform:"scaleX(-1)"},className:"wz-navbar-icon"}),l&&t.jsx("span",{className:"wz-navbar-text",children:l})]}),u?t.jsx("div",{className:"wz-navbar-title",children:u}):t.jsx("div",{className:"wz-navbar-title",children:e}),d?t.jsx("div",{className:"wz-navbar-right",children:d}):t.jsxs("div",{className:"wz-navbar-right",onClick:y,children:[n&&t.jsx("span",{className:"wz-navbar-text",children:n}),!n&&t.jsx(a,{name:"more-h",className:"wz-navbar-icon"})]})]})]})},e.Popup=({visible:e=!1,position:r="bottom",mask:l=!0,maskClosable:n=!0,round:a=!1,duration:i=300,zIndex:c=1e3,destroyOnClose:o=!1,className:d="",style:u={},maskStyle:m={},children:h,onClose:p,onClosed:v,afterShow:w,closeable:x=!1,title:b})=>{const[f,z]=s.useState(e),[g,y]=s.useState(!1),[N,j]=s.useState(e);s.useEffect((()=>{e?k():C()}),[e]);const k=()=>{f||(z(!0),y(!0),requestAnimationFrame((()=>{requestAnimationFrame((()=>{j(!0),setTimeout((()=>{y(!1),null==w||w()}),i)}))})))},C=()=>{f&&(j(!1),y(!0),setTimeout((()=>{y(!1),z(!1),null==v||v()}),i))},$={...u,zIndex:c,transitionDuration:`${i}ms`},S={...m,zIndex:c,transitionDuration:`${i}ms`};return!f&&o?null:t.jsxs("div",{className:"wz-popup-container "+(f?"wz-popup--display":""),style:{zIndex:c},children:[l&&t.jsx("div",{className:"wz-popup-mask "+(N?"wz-popup-mask--active":""),style:S,onClick:()=>{n&&!g&&(null==p||p())}}),t.jsxs("div",{className:`\n wz-popup \n wz-popup--${r} \n ${N?"wz-popup--active":""} \n ${a?"wz-popup--round":""}\n ${d}\n `,style:$,children:[x&&t.jsx("div",{className:"wz-popup-close",onClick:()=>{g||null==p||p()},children:t.jsx("span",{className:"wz-popup-close-icon",children:"×"})}),b&&t.jsx("div",{className:"wz-popup-title",children:b}),h]})]})},e.Radio=c,e.Search=y,e.Stepper=({value:e,min:r=-1/0,max:l=1/0,step:n=1,onChange:i,disabled:c=!1,prefix:o,suffix:d,showMinus:u=!0,showPlus:m=!0,precision:h,className:p="",style:v,inputStyle:w,inputClassName:x="",buttonStyle:b,buttonClassName:f=""})=>{const[z,g]=s.useState(String(e)),[y,N]=s.useState(!1);s.useEffect((()=>{y||g(String(e))}),[e,y]);const j=c||Number(e)<=r,k=c||Number(e)>=l;return t.jsxs("div",{className:`wz-stepper ${p}`,style:v,children:[u&&t.jsx("button",{className:`wz-stepper-btn wz-stepper-btn-minus ${f}`,onClick:()=>{if(c)return;let t=Number(e)-n;t<r&&(t=r),t=void 0!==h?parseFloat(t.toFixed(h)):t,i(t),g(String(t))},disabled:j,type:"button",style:b,children:t.jsx(a,{name:"jian",type:"yunying",size:21})}),t.jsxs("div",{className:"wz-stepper-input-wrapper",children:[o&&t.jsx("span",{className:"wz-stepper-prefix",children:o}),t.jsx("input",{className:`wz-stepper-input ${x}`,type:"text",value:z,onChange:e=>{g(e.target.value)},onFocus:e=>{N(!0),e.target.select()},onBlur:()=>{N(!1);let t=Number(z);isNaN(t)?g(String(e)):(t>l&&(t=l),t<r&&(t=r),t=void 0!==h?parseFloat(t.toFixed(h)):t,i(t),g(String(t)))},disabled:c,style:w}),d&&t.jsx("span",{className:"wz-stepper-suffix",children:d})]}),m&&t.jsx("button",{className:`wz-stepper-btn wz-stepper-btn-plus ${f}`,onClick:()=>{if(c)return;let t=Number(e)+n;t>l&&(t=l),t=void 0!==h?parseFloat(t.toFixed(h)):t,i(t),g(String(t))},disabled:k,type:"button",style:b,children:t.jsx(a,{name:"jia",type:"yunying",size:21})})]})},e.Switch=({value:e,defaultValue:r=!1,onChange:l,disabled:n=!1,showText:a=!0,activeText:i="",inactiveText:c="",style:o,className:d="",size:u="default",activeColor:m})=>{const[h,p]=s.useState(r),v=void 0!==e,w=v?e:h,x=i||"开启",b=c||"关闭",f=w?x:b,z=a?12*f.length+8+"px":"0px",g=Math.max(x.length,b.length),y="large"===u?62:60,N=a?12*g+40:y,j=Math.max(N,y),k=`${j}px`,C=w?j-("large"===u?24:22)-4:0,$=m?(m.includes("gradient"),m):void 0,S=w&&m?{background:$}:{};return t.jsxs("div",{className:`wz-switch-bg ${w?"wz-switch-on":"wz-switch-off"}${n?" wz-switch-disabled":""}${d?" "+d:""} wz-switch-${u}`,style:{width:k,minWidth:`${y}px`,...o,...S},onClick:()=>{n||(v||p(!w),null==l||l(!w))},children:[a&&t.jsx("span",{className:"wz-switch-text",style:{width:z},children:f}),t.jsx("div",{className:"wz-switch-slider "+(w?"wz-switch-slider-on":"wz-switch-slider-off"),style:{transform:`translateX(${C}px)`}})]})},e.Tabbar=e=>{var r;const{activeKey:l,defaultActiveKey:n,onChange:a,items:i,fixed:c=!0,className:o,style:d}=e,[u,m]=s.useState(l??n??(null==(r=null==i?void 0:i[0])?void 0:r.key));s.useEffect((()=>{void 0!==l&&m(l)}),[l]);const h=w("wz-tabbar",{"wz-tabbar-fixed":c},o);return t.jsx("div",{className:h,style:d,children:i.map((e=>s.createElement(x,{...e,key:e.key,active:!e.hump&&u===e.key,onItemClick:()=>{return t=e.key,void 0===l&&m(t),void(null==a||a(t));var t}})))})},e.Tabs=f,e.Tag=e=>{const{type:r="solid",size:l="large",color:n,bgColor:a,fontWeight:i,className:c,style:o,children:d}=e,u=w("wz-tag",`wz-tag-${r}`,`wz-tag-${l}`,c),m=s.useMemo((()=>{const e={...o};return n&&(e.color=n,"line"===r&&(e.borderColor=function(e,t){let s=e.replace("#","");return 3===s.length&&(s=s.split("").map((e=>e+e)).join("")),`rgba(${parseInt(s.substring(0,2),16)}, ${parseInt(s.substring(2,4),16)}, ${parseInt(s.substring(4,6),16)}, ${t})`}(n,.5))),a&&"solid"===r&&(e.backgroundColor=a),i&&(e.fontWeight=i),e}),[r,n,a,i,o]);return t.jsx("div",{className:u,style:m,children:d})},e.TimePicker=({type:e="single",options:r,value:l,onChange:n,className:a="",style:i,itemHeight:c=48})=>{if("single"===e){const e=r&&r.length>0?r:N,[o,d]=s.useState((()=>{const t=l?e.indexOf(l):0;return t>=0?t:0})),u=s.useRef(null),m=s.useRef(0),h=s.useRef(0),p=s.useRef(!1);s.useEffect((()=>{l&&e.includes(l)&&d(e.indexOf(l))}),[l,e]),s.useEffect((()=>{u.current&&u.current.scrollTo({top:o*c,behavior:"smooth"})}),[o,c]);const v=e=>{var t;p.current=!0,m.current=e.touches[0].clientY,h.current=(null==(t=u.current)?void 0:t.scrollTop)||0},w=e=>{if(!p.current)return;const t=e.touches[0].clientY-m.current;u.current&&(u.current.scrollTop=h.current-t)},x=()=>{if(p.current=!1,!u.current)return;const t=Math.round(u.current.scrollTop/c);d(t),null==n||n(e[t])},b=()=>{if(!p.current&&u.current){const t=Math.round(u.current.scrollTop/c);d(t),null==n||n(e[t])}},f=e=>e===o;return t.jsxs("div",{className:`wz-time-picker ${a}`,style:i,children:[t.jsx("div",{className:"wz-time-picker-mask wz-time-picker-mask-top",style:{height:c}}),t.jsx("div",{className:"wz-time-picker-indicator",style:{height:c}}),t.jsxs("div",{className:"wz-time-picker-list",ref:u,style:{height:3*c},onTouchStart:v,onTouchMove:w,onTouchEnd:x,onScroll:b,children:[t.jsx("div",{style:{height:c}}),e.map(((e,s)=>t.jsx("div",{className:"wz-time-picker-item"+(f(s)?" active":""),style:{height:c},children:e},e))),t.jsx("div",{style:{height:c}})]}),t.jsx("div",{className:"wz-time-picker-mask wz-time-picker-mask-bottom",style:{height:c}})]})}const[o,d]=l?l.split(":"):[j[0],k[0]],[u,m]=s.useState(j.indexOf(o)),[h,p]=s.useState(k.indexOf(d)),v=s.useRef(null),w=s.useRef(null),x=s.useRef(0),b=s.useRef(0),f=s.useRef(!1),z=s.useRef(null);s.useEffect((()=>{v.current&&v.current.scrollTo({top:u*c,behavior:"smooth"})}),[u,c]),s.useEffect((()=>{w.current&&w.current.scrollTo({top:h*c,behavior:"smooth"})}),[h,c]);const g=e=>t=>{var s,r;f.current=!0,z.current=e,x.current=t.touches[0].clientY,b.current=("hour"===e?null==(s=v.current)?void 0:s.scrollTop:null==(r=w.current)?void 0:r.scrollTop)||0},y=e=>{if(!f.current||!z.current)return;const t=e.touches[0].clientY-x.current;"hour"===z.current&&v.current?v.current.scrollTop=b.current-t:"minute"===z.current&&w.current&&(w.current.scrollTop=b.current-t)},C=()=>{if(f.current&&z.current){if("hour"===z.current&&v.current){const e=Math.round(v.current.scrollTop/c);m(e),null==n||n(`${j[e]}:${k[h]}`)}else if("minute"===z.current&&w.current){const e=Math.round(w.current.scrollTop/c);p(e),null==n||n(`${j[u]}:${k[e]}`)}f.current=!1,z.current=null}},$=e=>()=>{if(!f.current)if("hour"===e&&v.current){const e=Math.round(v.current.scrollTop/c);m(e),null==n||n(`${j[e]}:${k[h]}`)}else if("minute"===e&&w.current){const e=Math.round(w.current.scrollTop/c);p(e),null==n||n(`${j[u]}:${k[e]}`)}},S=(e,s,r,l)=>t.jsxs("div",{className:"wz-time-picker-list",ref:r,style:{height:3*c},onTouchStart:g(l),onTouchMove:y,onTouchEnd:C,onScroll:$(l),children:[t.jsx("div",{style:{height:c}}),e.map(((e,r)=>t.jsx("div",{className:"wz-time-picker-item"+(r===s?" active":""),style:{height:c},children:e},e))),t.jsx("div",{style:{height:c}})]});return t.jsxs("div",{className:`wz-time-picker wz-time-picker-double ${a}`,style:i,children:[t.jsx("div",{className:"wz-time-picker-mask wz-time-picker-mask-top",style:{height:c}}),t.jsx("div",{className:"wz-time-picker-indicator",style:{height:c}}),t.jsxs("div",{className:"wz-time-picker-double-columns",children:[S(j,u,v,"hour"),S(k,h,w,"minute")]}),t.jsx("div",{className:"wz-time-picker-mask wz-time-picker-mask-bottom",style:{height:c}})]})},e.Tip=({content:e,className:r,visible:l=!0,onClose:n,marquee:i=!1,bold:c=!1,icon:o,showAction:d=!1,actionText:u="查看",onAction:m})=>{const h=s.useRef(null),[p,v]=s.useState(!1);if(s.useEffect((()=>{if(h.current&&!i){const e=h.current,t=parseFloat(getComputedStyle(e).lineHeight)||20;v(e.scrollHeight>1.5*t)}}),[e,i]),!l)return null;const x="wz-tip",b=d||n,f=w(x,r,{[`${x}--marquee`]:i,[`${x}--bold`]:c,[`${x}--center`]:!i&&!p,[`${x}--left`]:!i&&p,[`${x}--has-icon`]:!!o,[`${x}--has-right`]:b}),z=i?t.jsx("div",{className:`${x}-marquee-box`,children:t.jsx("span",{children:e})}):e;return t.jsxs("div",{className:f,children:[t.jsxs("div",{className:`${x}-content`,ref:h,children:[o&&t.jsx("span",{className:`${x}-icon`,children:t.jsx(a,{name:o,size:16})}),t.jsx("span",{className:`${x}-text`,children:z})]}),d&&t.jsx("div",{className:`${x}-action`,onClick:m,children:u}),n&&t.jsx("div",{className:`${x}-close`,onClick:n,children:t.jsx(a,{name:"close",size:16})})]})},e.Toast=B,e.Tooltip=({content:e,children:r,className:l,style:n,color:i,textColor:c,trigger:o="click",visible:d,onVisibleChange:u,showMask:m=!1,actionText:h,onAction:p,closable:v=!1})=>{const[x,b]=s.useState(!1),[f,z]=s.useState({}),[g,y]=s.useState("bottom"),N=s.useRef(null),j=s.useRef(null),k=void 0!==d,C=k?d:x,$=e=>{k||b(e),null==u||u(e)},S=s.useCallback((()=>{if(N.current&&j.current){const e=N.current,t=j.current,{width:s,height:r}=e.getBoundingClientRect(),{top:l,left:n,width:a,height:i}=t.getBoundingClientRect(),{innerWidth:c,innerHeight:o}=window,d=8;let u,m=n+a/2-s/2,h="bottom";m<d&&(m=d),m+s>c-d&&(m=c-s-d),u=l+i+d,u+r>o-d&&(h="top",u=l-r-d),u<d&&(h="bottom",u=l+i+d);const p=n+a/2-m;y(h),z({top:`${u}px`,left:`${m}px`,"--wz-tooltip-arrow-left":`${p}px`})}}),[]);s.useLayoutEffect((()=>{C&&S()}),[C,S]),s.useEffect((()=>{if(!C)return;const e=()=>{S()};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}}),[C,S]);const T=e=>{e.stopPropagation(),$(!1)},_=w("wz-tooltip-bubble",`wz-tooltip-bubble--placement-${g}`,l),R={...n,...f,opacity:f.top?1:0,transition:"opacity 150ms ease-in","--wz-tooltip-bubble-bg":i,color:c},E={onClick:()=>{"click"===o&&$(!C)},ref:j};return t.jsxs(t.Fragment,{children:[s.cloneElement(r,E),(()=>{if(!C)return null;return t.jsxs(t.Fragment,{children:[m&&t.jsx("div",{className:"wz-tooltip-mask",onClick:T}),t.jsxs("div",{className:_,style:R,ref:N,children:[t.jsx("div",{className:"wz-tooltip-bubble__arrow"}),t.jsxs("div",{className:"wz-tooltip-bubble__inner",children:[t.jsx("div",{className:"wz-tooltip-bubble__body",children:e}),(()=>{if(!h)return null;return t.jsx("div",{className:"wz-tooltip-bubble__action-slot",children:t.jsx("span",{className:"wz-tooltip-bubble__action-btn",onClick:e=>{e.stopPropagation(),null==p||p(),$(!1)},children:h})})})(),v?t.jsx("div",{className:"wz-tooltip-bubble__close-slot",children:t.jsx("span",{className:"wz-tooltip-bubble__close-btn",onClick:T,children:t.jsx(a,{name:"close",type:"yunying"})})}):null]})]})]})})()]})},e.useConfig=()=>s.useContext(V),Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
6
+ */p=v,function(){var e={}.hasOwnProperty;function t(){for(var s=[],r=0;r<arguments.length;r++){var l=arguments[r];if(l){var n=typeof l;if("string"===n||"number"===n)s.push(l);else if(Array.isArray(l)){if(l.length){var a=t.apply(null,l);a&&s.push(a)}}else if("object"===n){if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]")){s.push(l.toString());continue}for(var i in l)e.call(l,i)&&l[i]&&s.push(i)}}}return s.join(" ")}p.exports?(t.default=t,p.exports=t):window.classNames=t}();const w=h(v.exports),x=e=>{const{title:r,icon:l,activeIcon:n,badge:i,badgeAsBubble:c,dot:o,hump:d,active:u,onItemClick:m,onClick:h,activeColor:p}=e,v=e=>"string"==typeof e?t.jsx(a,{size:22,name:e}):e,x=w("wz-tabbar-item",{"wz-tabbar-item-active":!d&&u,"wz-tabbar-item-hump":d}),b=s.useMemo((()=>{const e={};return u&&p&&(e.color=p),e}),[u,p]);return t.jsxs("div",{className:x,style:b,onClick:d?h:m,children:[t.jsxs("div",{className:"wz-tabbar-item-icon",children:[v(u&&n||l),o?t.jsx("div",{className:"wz-tabbar-item-dot"}):i?c?t.jsx("div",{className:"wz-tabbar-item-badge-custom",children:t.jsxs("div",{className:"wz-tabbar-item-badge-bubble",children:[i,t.jsx("div",{className:"wz-tabbar-item-badge-bubble-arrow"})]})}):s.isValidElement(i)?t.jsx("div",{className:"wz-tabbar-item-badge-custom",children:i}):t.jsx("div",{className:"wz-tabbar-item-badge",children:i}):null]}),!d&&t.jsx("div",{className:"wz-tabbar-item-title",children:r})]})},b=e=>{const{title:s,label:r,value:l,icon:n,arrow:i=!1,border:c=!0,center:o=!1,disabled:d=!1,required:u=!1,className:m,style:h,titleStyle:p,titleClassName:v,labelStyle:x,labelClassName:b,valueStyle:f,valueClassName:z,onClick:g,children:N}=e,y=w("wz-cell",{"wz-cell-border":c,"wz-cell-center":o,"wz-cell-disabled":d},m);return t.jsxs("div",{className:y,style:h,onClick:d?void 0:g,children:[n?t.jsx("div",{className:"wz-cell-icon",children:n}):null,t.jsxs("div",{className:"wz-cell-content",children:[s?t.jsxs("div",{className:w("wz-cell-title",v),style:p,children:[u&&t.jsx("span",{className:"wz-cell-required",children:"*"}),s,l&&t.jsx("span",{className:w("wz-cell-value",z),style:f,children:l})]}):null,r?t.jsx("div",{className:w("wz-cell-label",b),style:x,children:r}):null]}),null,N&&t.jsx("div",{className:"wz-cell-extra",children:N}),i?t.jsx("div",{className:"wz-cell-arrow",children:t.jsx(a,{name:"right-arrow",size:16})}):null]})};b.Group=e=>{const{className:s,style:r,children:l}=e;return t.jsx("div",{className:w("wz-cell-group",s),style:r,children:l})};const f=({type:e="line",align:r="center",value:l,defaultValue:n=0,onChange:a,className:i="",style:c,headerClassName:o="",headerStyle:d,contentClassName:u="",contentStyle:m,children:h,maxTabs:p=5})=>{const v=void 0!==l,[w,x]=s.useState(n),b=v?l:w,f=s.useRef(null),z=s.useRef(!1),g=s.useRef(0),N=s.useRef(0),y=s.useCallback((e=>{"left"===r&&f.current&&(z.current=!0,g.current=e.pageX-f.current.offsetLeft,N.current=f.current.scrollLeft)}),[r]),j=s.useCallback((e=>{if(!z.current||!f.current)return;e.preventDefault();const t=1.5*(e.pageX-f.current.offsetLeft-g.current);f.current.scrollLeft=N.current-t}),[]),k=s.useCallback((()=>{z.current=!1}),[]),C=s.useCallback((()=>{z.current=!1}),[]),$=s.Children.toArray(h).filter(Boolean).slice(0,p),S="card"===e?{flex:$.length>3?"0 0 calc((100% - 28px) / 3)":"1"}:void 0;return t.jsxs("div",{className:`wz-tabs wz-tabs-${e}${"left"===r?" wz-tabs-align-left":""} ${i}`,style:c,children:[t.jsx("div",{ref:f,className:`wz-tabs-header ${o}`,style:d,onMouseDown:y,onMouseMove:j,onMouseUp:k,onMouseLeave:C,children:$.map(((s,r)=>t.jsx("div",{className:`wz-tabs-tab${r===b?" wz-tabs-tab-active":""}${s.props.disabled?" wz-tabs-tab-disabled":""}`,style:S,onClick:()=>((e,t)=>{t||(v||x(e),null==a||a(e))})(r,s.props.disabled),children:t.jsxs("div",{className:"wz-tabs-tab-text",children:[s.props.title,s.props.badge&&t.jsx("div",{className:"wz-tabs-badge",children:s.props.badge}),r===b&&"line"===e&&t.jsx("div",{className:"wz-tabs-underline"})]})},r)))}),t.jsx("div",{className:`wz-tabs-content ${u}`,style:m,children:$[b]})]})};f.TabPane=({children:e})=>t.jsx(t.Fragment,{children:e});const z=s.forwardRef((({clearable:e=!1,align:r="left",value:l,defaultValue:n,onChange:i,style:c,className:o="",type:d="text",showCount:u=!1,rows:m=3,maxLength:h,countStyle:p,suffix:v,borderRadius:w,backgroundColor:x,bordered:b,codeCountdown:f=60,onGetCode:z,codeText:g="获取验证码",codeCountingText:N="{s}s后重新获取",codeResendText:y="重新获取验证码",...j},k)=>{const C=void 0!==l,[$,S]=s.useState(n||""),T=e&&!!(C?l:$),[_,R]=s.useState(!1),[E,M]=s.useState(!1),[L,D]=s.useState(f),[A,F]=s.useState(!1),[I,B]=s.useState(0),P=s.useRef(null);s.useEffect((()=>{if(P.current){const e=P.current.offsetWidth;B(e)}}),[E,L,A,v,g,N,y]),s.useEffect((()=>{let e;return E&&L>0?e=setInterval((()=>{D((e=>e-1))}),1e3):0===L&&(M(!1),D(f)),()=>clearInterval(e)}),[E,L,f]);const O=s.useCallback((async()=>{if(!E)try{await(null==z?void 0:z()),M(!0),F(!0)}catch{}}),[E,z]),V=e=>{C||S(e.target.value),null==i||i(e)},q={position:"relative",width:null==c?void 0:c.width,...c},G={textAlign:r,borderRadius:w,backgroundColor:x,border:void 0!==b?void 0:"none",...I>0&&(v||"code"===d)?{paddingRight:I+22+12}:{}},W=C?l:$,Y=(null==W?void 0:W.toString().length)||0,H=h&&Y>h;return t.jsxs("div",{className:`wz-input-affix-wrapper ${"textarea"===d?"wz-input-affix-wrapper-textarea":""} ${v||"code"===d?"wz-input-has-suffix":""} ${void 0===b?"wz-input-no-border":""} ${e?"wz-input-has-clear":""} ${"password"===d?"wz-input-has-password":""}`,style:q,children:["textarea"===d?t.jsxs(t.Fragment,{children:[t.jsx("textarea",{ref:k,className:`wz-input ${o}`,value:W,onChange:V,style:{...G,resize:"none"},rows:m,maxLength:h,...j}),u&&h&&t.jsxs("div",{className:"wz-input-count "+(H?"wz-input-count-exceeded":""),style:p,children:[Y,"/",h]})]}):t.jsx("input",{ref:k,className:`wz-input ${o}`,value:W,onChange:V,style:G,type:"password"===d&&_?"text":d,maxLength:h,...j}),T&&!j.disabled&&"textarea"!==d&&!v&&t.jsx("span",{className:"wz-input-clear",onClick:()=>{C||S("");const e={...j,target:{value:""}};null==i||i(e)},children:t.jsx(a,{name:"close",size:22})}),"password"===d&&!v&&t.jsx("span",{className:"wz-input-password",onClick:()=>{R(!_)},children:t.jsx(a,{name:_?"eyes-close":"eyes-open",size:22})}),v&&t.jsxs("div",{className:"wz-input-suffix",ref:P,children:[t.jsx("span",{className:"wz-input-suffix-divider"}),v]}),"code"===d&&t.jsxs("div",{className:"wz-input-suffix",ref:v?void 0:P,children:[t.jsx("span",{className:"wz-input-suffix-divider"}),E?t.jsx("span",{className:"wz-input-code-btn wz-input-code-btn--disabled",children:N.replace("{s}",String(L))}):t.jsx("span",{className:"wz-input-code-btn",onClick:O,children:A?y:g})]})]})}));z.displayName="Input";const g={horizontal:{default:"#f7f7f7",emphasis:"#eeeeee"},vertical:"rgba(0, 0, 0, 0.1)"},N=s.forwardRef((({value:e,defaultValue:r,placeholder:l="输入关键词搜索",shape:n="round",clearable:i=!0,disabled:c=!1,prefix:o,suffix:d,leftIcon:u=t.jsx(a,{name:"search",size:16}),actionText:m="搜索",actionColor:h,showCancel:p=!1,cancelText:v="返回",background:w,style:x,className:b="",onSearch:f,onClear:z,onChange:g,onFocus:N,onBlur:y,onCancel:j,...k},C)=>{const $=void 0!==e,[S,T]=s.useState(r||""),[_,R]=s.useState(!1),E=s.useRef(null);s.useImperativeHandle(C,(()=>E.current));const M=$?e:S,L=i&&M&&_&&!c,D=()=>{var e;c||(null==(e=E.current)||e.blur(),null==f||f(M))},A=()=>{R(!1),null==j||j()},F={...x,backgroundColor:w};return t.jsxs("div",{className:`wz-search ${_?"wz-search-focused":""} ${b}`,style:F,children:[o&&t.jsx("div",{className:"wz-search-prefix",children:o}),!o&&p&&_?t.jsx("div",{className:"wz-search-cancel",onClick:A,children:v}):null,t.jsxs("div",{className:`wz-search-content wz-search-shape-${n} ${c?"wz-search-disabled":""}`,children:[t.jsxs("div",{className:"wz-search-input-wrapper "+(L?"wz-search-input-wrapper--with-clear":""),children:[u&&t.jsx("div",{className:"wz-search-left-icon",children:u}),t.jsx("input",{ref:E,className:"wz-search-input",value:M,onChange:e=>{const t=e.target.value;$||T(t),null==g||g(t)},onFocus:e=>{R(!0),null==N||N(e)},onBlur:e=>{R(!1),null==y||y(e)},onKeyDown:e=>{"Enter"!==e.key||c||D()},placeholder:l,disabled:c,...k}),L&&t.jsx("div",{className:"wz-search-clear",onMouseDown:e=>{var t;e.preventDefault(),$||T(""),null==g||g(""),null==z||z(),null==(t=E.current)||t.focus()},children:t.jsx(a,{name:"close",size:16,color:"#CCCCCC"})})]}),m&&t.jsxs("div",{className:"wz-search-action",onClick:D,children:[t.jsx("div",{className:"wz-search-divider"}),t.jsx("div",{className:"wz-search-action-text",style:h?{color:h}:void 0,children:m})]})]}),d&&t.jsx("div",{className:"wz-search-suffix",children:d})]})}));N.displayName="Search";const y=Array.from({length:24},((e,t)=>`${t+1}小时`)),j=Array.from({length:24},((e,t)=>t.toString().padStart(2,"0"))),k=Array.from({length:60},((e,t)=>t.toString().padStart(2,"0"))),C=({value:e,onChange:r,min:l="1970-01-01",max:n="2100-12-31",columns:a=["year","month","day"],itemHeight:i=48,className:c="",style:o})=>{const d=new Date,[u,m,h]=e?e.split("-").map(Number):[d.getFullYear(),d.getMonth()+1,d.getDate()],p=Number(l.split("-")[0]),v=Number(n.split("-")[0]),w=s.useMemo((()=>((e,t)=>{const s=[];for(let r=e;r<=t;r++)s.push(r.toString());return s})(p,v)),[p,v]),[x,b]=s.useState(u),[f,z]=s.useState(m),[g,N]=s.useState(h),y=Array.from({length:12},((e,t)=>(t+1).toString().padStart(2,"0"))),j=((e,t)=>{const s=new Date(e,t,0).getDate();return Array.from({length:s},((e,t)=>(t+1).toString().padStart(2,"0")))})(x,f),k=s.useRef(null),C=s.useRef(null),$=s.useRef(null),S=s.useRef(0),T=s.useRef(0),_=s.useRef(!1),R=s.useRef(null);s.useLayoutEffect((()=>{k.current&&k.current.scrollTo({top:(x-p)*i,behavior:"auto"})}),[x,i,p]),s.useLayoutEffect((()=>{C.current&&C.current.scrollTo({top:(f-1)*i,behavior:"auto"})}),[f,i]),s.useLayoutEffect((()=>{$.current&&$.current.scrollTo({top:(g-1)*i,behavior:"auto"})}),[g,i]);const E=e=>t=>{var s,r,l;_.current=!0,R.current=e,S.current=t.touches[0].clientY;let n=0;"year"===e&&(n=(null==(s=k.current)?void 0:s.scrollTop)||0),"month"===e&&(n=(null==(r=C.current)?void 0:r.scrollTop)||0),"day"===e&&(n=(null==(l=$.current)?void 0:l.scrollTop)||0),T.current=n},M=e=>{if(!_.current||!R.current)return;const t=e.touches[0].clientY-S.current;"year"===R.current&&k.current&&(k.current.scrollTop=T.current-t),"month"===R.current&&C.current&&(C.current.scrollTop=T.current-t),"day"===R.current&&$.current&&($.current.scrollTop=T.current-t)},L=()=>{if(_.current&&R.current){if("year"===R.current&&k.current){const e=Math.round(k.current.scrollTop/i);b(Number(w[e])),null==r||r(`${w[e]}-${f.toString().padStart(2,"0")}-${g.toString().padStart(2,"0")}`)}if("month"===R.current&&C.current){const e=Math.round(C.current.scrollTop/i);z(Number(y[e])),null==r||r(`${x}-${y[e]}-${g.toString().padStart(2,"0")}`)}if("day"===R.current&&$.current){const e=Math.round($.current.scrollTop/i);N(Number(j[e])),null==r||r(`${x}-${f.toString().padStart(2,"0")}-${j[e]}`)}_.current=!1,R.current=null}},D=e=>()=>{if(!_.current){if("year"===e&&k.current){const e=Math.round(k.current.scrollTop/i);b(Number(w[e])),null==r||r(`${w[e]}-${f.toString().padStart(2,"0")}-${g.toString().padStart(2,"0")}`)}if("month"===e&&C.current){const e=Math.round(C.current.scrollTop/i);z(Number(y[e])),null==r||r(`${x}-${y[e]}-${g.toString().padStart(2,"0")}`)}if("day"===e&&$.current){const e=Math.round($.current.scrollTop/i);N(Number(j[e])),null==r||r(`${x}-${f.toString().padStart(2,"0")}-${j[e]}`)}}};s.useEffect((()=>{if(e){const[t,s,r]=e.split("-").map(Number);b(t),z(s),N(r),k.current&&k.current.scrollTo({top:(t-p)*i,behavior:"auto"}),C.current&&C.current.scrollTo({top:(s-1)*i,behavior:"auto"}),$.current&&$.current.scrollTo({top:(r-1)*i,behavior:"auto"})}}),[e]);const A=(e,s,r,l)=>t.jsxs("div",{className:"wz-date-picker-list",ref:r,style:{height:3*i},onTouchStart:E(l),onTouchMove:M,onTouchEnd:L,onScroll:D(l),children:[t.jsx("div",{style:{height:i}}),e.map(((e,r)=>t.jsx("div",{className:"wz-date-picker-item"+(r===s?" active":""),style:{height:i},children:"year"===l?`${e}年`:"month"===l?`${e}月`:`${e}日`},e))),t.jsx("div",{style:{height:i}})]});return t.jsxs("div",{className:`wz-date-picker ${c}`,style:o,children:[t.jsx("div",{className:"wz-date-picker-mask wz-date-picker-mask-top",style:{height:i}}),t.jsx("div",{className:"wz-date-picker-indicator",style:{height:i}}),t.jsxs("div",{className:"wz-date-picker-columns",children:[a.includes("year")&&A(w,x-p,k,"year"),a.includes("month")&&A(y,f-1,C,"month"),a.includes("day")&&A(j,g-1,$,"day")]}),t.jsx("div",{className:"wz-date-picker-mask wz-date-picker-mask-bottom",style:{height:i}})]})},$={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",baseline:"baseline"},S={start:"flex-start",center:"center",end:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly"},T=({direction:e="row",align:s="stretch",justify:r="start",wrap:l="nowrap",gap:n=0,className:a="",style:i={},children:c})=>{const o={display:"flex",flexDirection:e,alignItems:$[s],justifyContent:S[r],flexWrap:l,gap:"number"==typeof n?`${n}px`:n,...i};return t.jsx("div",{className:"wz-flex"+(a?" "+a:""),style:o,children:c})};T.Item=({span:e,order:s,offset:r,className:l="",style:n={},children:a})=>{process.env.NODE_ENV;const i={flexBasis:void 0!==e?100*e+"%":void 0,flexGrow:void 0!==e?0:void 0,flexShrink:void 0!==e?0:void 0,order:s,marginLeft:void 0!==r?100*r+"%":void 0,...n};return t.jsx("div",{className:"wz-flex-item"+(l?" "+l:""),style:i,children:a})};const _=s.createContext(24),R=({cols:e=24,gap:s=0,className:r="",style:l={},children:n})=>{const a={display:"flex",flexWrap:"wrap",gap:"number"==typeof s?`${s}px`:s,...l};return t.jsx(_.Provider,{value:e,children:t.jsx("div",{className:"wz-grid"+(r?" "+r:""),style:a,children:n})})};R.Item=({span:e=1,offset:r=0,order:l,className:n="",style:a={},children:i})=>{const c=s.useContext(_);process.env.NODE_ENV;const o=e/c*100+"%",d=r?r/c*100+"%":void 0;return t.jsx("div",{className:"wz-grid-item"+(n?" "+n:""),style:{width:o,marginLeft:d,order:l,...a},children:i})};const E=({columns:e=4,gap:s=0,square:r=!0,className:l="",style:n={},children:a,noBg:i=!1,rounded:c=!1,shadow:o=!1,horizontal:d=!1})=>{const u={gridTemplateColumns:`repeat(${e}, 1fr)`,gap:"number"==typeof s?`${s}px`:s,...n},m=["wz-grid-view",r?"wz-grid-view--square":"",i?"wz-grid-view--no-bg":"",c?"wz-grid-view--rounded":"",o?"wz-grid-view--shadow":"",d?"wz-grid-view--horizontal":"",l].filter(Boolean).join(" ");return t.jsx("div",{className:m,style:u,children:a})};E.Item=({icon:e,text:s,textColor:r,textSize:l,description:n,descriptionColor:a,descriptionSize:i,badge:c,corner:o,onClick:d,className:u="",style:m={},disabled:h=!1,children:p,horizontal:v=!1,compact:w=!1,backgroundImage:x,backgroundStyle:b={}})=>{const f=()=>{!h&&d&&d()},z=["wz-grid-view-item",h?"wz-grid-view-item--disabled":"",d?"wz-grid-view-item--clickable":"",v?"wz-grid-view-item--horizontal":"",w?"wz-grid-view-item--compact":"",x?"wz-grid-view-item--with-bg":"",u].filter(Boolean).join(" "),g=x?{backgroundImage:`url(${x})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",...b,...m}:m;return p?t.jsxs("div",{className:z,style:g,onClick:f,children:[o&&t.jsx("div",{className:"wz-grid-view-item__corner",children:o}),p,c&&t.jsx("div",{className:"wz-grid-view-item__badge",children:c})]}):t.jsxs("div",{className:z,style:g,onClick:f,children:[o&&t.jsx("div",{className:"wz-grid-view-item__corner",children:o}),t.jsxs("div",{className:"wz-grid-view-item__content",children:[e&&t.jsx("div",{className:"wz-grid-view-item__icon",children:e}),t.jsxs("div",{className:"wz-grid-view-item__text",children:[s&&t.jsx("div",{className:"wz-grid-view-item__title",style:{...r?{color:r}:{},...l?{fontSize:"number"==typeof l?`${l}px`:l}:{}},children:s}),n&&t.jsx("div",{className:"wz-grid-view-item__desc",style:{...a?{color:a}:{},...i?{fontSize:"number"==typeof i?`${i}px`:i}:{}},children:n})]})]}),c&&t.jsx("div",{className:"wz-grid-view-item__badge",children:c})]})};const M=({content:e,duration:r=2e3,icon:l,visible:n=!1,onClose:a})=>{const[i,c]=s.useState(n);s.useEffect((()=>{let e;return c(n),n&&r>0&&(e=setTimeout((()=>{c(!1),null==a||a()}),r)),()=>{clearTimeout(e)}}),[n,r,a]);const o=w("wz-toast",{"wz-toast-visible":i}),d=w("wz-toast-icon");return t.jsx("div",{className:o,children:t.jsxs("div",{className:"wz-toast-content",children:[l&&t.jsx("div",{className:d,children:l}),t.jsx("div",{className:"wz-toast-text",children:e})]})})};let L=null,D=null;const A=()=>{L&&(L.unmount(),L=null),D&&D.parentNode&&(D.parentNode.removeChild(D),D=null)},F=e=>{D||(D=document.createElement("div"),document.body.appendChild(D),L=r.createRoot(D)),L.render(t.jsx(M,{...e}))},I={show:e=>{F({..."string"==typeof e?{content:e}:e,visible:!0,onClose:A})},success:(e,s)=>{F({content:e,duration:s,icon:t.jsx(a,{name:"check-round",size:37.14}),visible:!0,onClose:A})},fail:(e,s)=>{F({content:e,duration:s,icon:t.jsx(a,{name:"close",size:37.14}),visible:!0,onClose:A})},loading:(e,s)=>{F({content:e,duration:s,icon:t.jsx(a,{name:"loading",size:37.14}),visible:!0,onClose:A})},warn:(e,s)=>{F({content:e,duration:s,icon:t.jsx(a,{name:"info",size:37.14}),visible:!0,onClose:A})},hide:()=>{F({content:"",visible:!1}),A()}},B=({visible:e,title:s,content:r,onClose:n,actions:a,closeOnAction:i,closeOnMaskClick:c})=>t.jsxs("div",{className:w("wz-dialog-root",{visible:e}),children:[t.jsx("div",{className:"wz-dialog-mask",onClick:()=>{c&&(null==n||n())}}),t.jsxs("div",{className:"wz-dialog-wrap",children:[s&&t.jsx("div",{className:"wz-dialog-header",children:t.jsx("div",{className:"wz-dialog-title",children:s})}),t.jsx("div",{className:"wz-dialog-content",children:r}),t.jsx("div",{className:"wz-dialog-footer",children:null==a?void 0:a.map((e=>t.jsx(l,{className:"wz-dialog-button",onClick:()=>{return null==(t=e.onClick)||t(),void(i&&(null==n||n()));var t},children:e.text},e.key)))})]})]}),P=e=>{const s=document.createElement("div");document.body.appendChild(s);const l=r.createRoot(s);l.render(t.jsx(B,{...e,visible:!0,onClose:()=>{l.unmount(),document.body.removeChild(s)}}))},O=Object.assign(B,{alert:e=>{P({...e,closeOnAction:!0,actions:[{key:"confirm",text:"确定",onClick:e.onConfirm}]})},confirm:e=>{P({...e,closeOnAction:!0,actions:[{key:"cancel",text:"取消",onClick:e.onCancel},{key:"confirm",text:"确定",onClick:e.onConfirm}]})}}),V=s.createContext({theme:"default"}),q={primaryColor:"--wz-primary-color",primaryGradient:"--wz-primary-gradient",primaryColorLight:"--wz-primary-color-light",primaryColorDark:"--wz-primary-color-dark",successColor:"--wz-success-color",warningColor:"--wz-warning-color",dangerColor:"--wz-danger-color",infoColor:"--wz-info-color",textColorPrimary:"--wz-text-color-primary",textColorRegular:"--wz-text-color-regular",textColorSecondary:"--wz-text-color-secondary",bgColorBase:"--wz-bg-color-base",bgColorLight:"--wz-bg-color-light",bgColorWhite:"--wz-bg-color-white",borderColorBase:"--wz-border-color-base",borderColorLight:"--wz-border-color-light"};e.Button=l,e.ButtonGroup=n,e.Card=({title:e,extra:s,cover:r,actions:l,bordered:n,noDivider:a=!1,className:i="",style:c,children:o,onClick:d})=>{const u=["wz-card",void 0!==n?"wz-card-bordered":"",a?"wz-card-no-divider":"",i].filter(Boolean).join(" ");return t.jsxs("div",{className:u,style:c,onClick:d,children:[r&&t.jsx("div",{className:"wz-card-cover",children:r}),(e||s)&&t.jsxs("div",{className:"wz-card-header",children:[e&&t.jsx("div",{className:"wz-card-title",children:e}),s&&t.jsx("div",{className:"wz-card-extra",children:s})]}),t.jsx("div",{className:"wz-card-body",children:o}),l&&l.length>0&&t.jsx("div",{className:"wz-card-actions",children:l.map(((e,s)=>t.jsx("div",{className:"wz-card-action",children:e},s)))})]})},e.Cascader=({value:e,onChange:r,data:l})=>{const[n,a]=s.useState(e||[]),[i,c]=s.useState(Math.min((e||[]).length,2));s.useEffect((()=>{void 0!==e&&(a(e),c(Math.min(e.length,2)))}),[e]);const o=s.useMemo((()=>{if(0===i)return l;let e=l;for(let t=0;t<i;t++){const s=e.find((e=>e.value===n[t]));e=(null==s?void 0:s.children)||[]}return e}),[l,i,n]),d=s.useMemo((()=>{let e=l;const t=["请选择","请选择","请选择"];return n.map(((s,r)=>{const l=e.find((e=>e.value===s));return e=(null==l?void 0:l.children)||[],(null==l?void 0:l.label)||t[r]}))}),[l,n]);return t.jsxs("div",{className:"wz-cascader",children:[t.jsx("div",{className:"wz-cascader-levels",children:["省","市","区"].map(((e,s)=>s>0&&n.length<s?null:t.jsx("div",{className:`\n wz-cascader-level \n ${i===s?"active":""}\n ${n[s]?"selected":""}\n `,onClick:()=>{var e;(e=s)<=n.length&&c(e)},children:n[s]?d[s]:"请选择"},e)))}),t.jsx("div",{className:"wz-cascader-content",children:t.jsx("div",{className:"wz-cascader-options",children:o.map((e=>t.jsxs("div",{className:`\n wz-cascader-option \n ${n.includes(e.value)?"selected":""}\n ${e.disabled?"disabled":""}\n `,onClick:()=>(e=>{if(e.disabled)return;const t=[...n];t[i]=e.value,t.length=i+1,a(t),0===i&&e.children?c(1):1===i&&e.children?c(2):2===i&&(null==r||r(t))})(e),children:[e.label,e.disabled&&t.jsx("span",{className:"wz-cascader-option-tip",children:"不可选"})]},e.value)))})})]})},e.Cell=b,e.CheckList=({options:e,value:s,onChange:r,multiple:l=!1,style:n,className:i=""})=>{const c=e=>l&&Array.isArray(s)?s.includes(e):s===e;return t.jsx("div",{className:`wz-check-list ${i}`,style:n,children:e.map((e=>t.jsxs("div",{className:"wz-check-list__item"+(c(e)?" wz-check-list__item--active":""),onClick:()=>(e=>{if(l){if(!Array.isArray(s))return;s.includes(e)?r(s.filter((t=>t!==e))):r([...s,e])}else r(e)})(e),children:[t.jsx("span",{className:"wz-check-list__label",children:e}),c(e)&&t.jsx("span",{className:"wz-check-list__icon",children:t.jsx(a,{name:"check",size:18,type:"yunying"})})]},e)))})},e.Checkbox=u,e.Collapse=({title:e,extra:r,children:l,defaultExpanded:n=!1,expanded:a,onChange:i,style:c,className:o="",headerStyle:d,headerClassName:u="",contentStyle:m,contentClassName:h=""})=>{const[p,v]=s.useState(n),w=void 0!==a,x=w?a:p;return t.jsxs("div",{className:"wz-collapse"+(o?" "+o:""),style:c,children:[t.jsxs("div",{className:`wz-collapse-header ${u}`,onClick:()=>{w||v(!x),null==i||i(!x)},style:d,children:[t.jsx("div",{className:"wz-collapse-title",children:e}),t.jsx("div",{className:"wz-collapse-extra",onClick:e=>e.stopPropagation(),children:r}),t.jsx("svg",{className:"wz-collapse-arrow"+(x?" expanded":""),width:"20",height:"20",viewBox:"0 0 20 20",style:{transition:"transform 0.2s",transform:x?"rotate(90deg)":"rotate(0deg)"},children:t.jsx("polyline",{points:"7,5 13,10 7,15",fill:"none",stroke:"#888",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),t.jsx("div",{className:`wz-collapse-content${x?" expanded":""} ${h}`,style:m,children:l})]})},e.ConfigProvider=({children:e,theme:r="default",themeVars:l})=>{s.useEffect((()=>{const e=document.documentElement;return"default"===r?e.removeAttribute("data-theme"):e.setAttribute("data-theme",r),l&&Object.entries(l).forEach((([t,s])=>{if(s){const r=q[t];r&&e.style.setProperty(r,s)}})),()=>{l&&Object.keys(l).forEach((t=>{const s=q[t];s&&e.style.removeProperty(s)}))}}),[r,l]);const n=s.useMemo((()=>({theme:r,themeVars:l})),[r,l]);return t.jsx(V.Provider,{value:n,children:e})},e.DatePicker=C,e.DateRangePicker=({value:e,onChange:r,min:l="1970-01-01",max:n="2100-12-31",startLabel:i="开始时间",endLabel:c="结束时间",className:o="",style:d,showLongTerm:u=!1,longTermLabel:m="长期有效",longTermValue:h="9999-12-31"})=>{const p=s.useMemo((()=>{const e=new Date;return`${e.getFullYear()}-${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")}`}),[]),[v,w]=s.useState(e||[p,p]),x=e||v,[b,f]=s.useState("start"),z=x[1]===h;return t.jsxs("div",{className:`wz-date-range-picker ${o}`,style:d,children:[t.jsxs("div",{className:"wz-date-range-picker-label-row",children:[t.jsx("div",{className:"wz-date-range-picker-label",children:i}),t.jsx("div",{className:"wz-date-range-picker-label",children:c})]}),t.jsxs("div",{className:"wz-date-range-picker-row",children:[t.jsx("div",{className:"wz-date-range-picker-col",children:t.jsx("div",{className:"wz-date-range-picker-value"+("start"===b?" active":""),onClick:()=>f("start"),children:x[0]||"请选择"})}),t.jsx("div",{className:"wz-date-range-picker-sep",children:"至"}),t.jsxs("div",{className:"wz-date-range-picker-col",children:[t.jsx("div",{className:`wz-date-range-picker-value${"end"===b?" active":""}${z?" disabled":""}`,onClick:()=>!z&&f("end"),children:z?m:x[1]||"请选择"}),u&&t.jsxs("div",{className:"wz-date-range-picker-long-term",onClick:()=>{if(z){const e=[x[0],x[0]];w(e),null==r||r(e)}else{const e=[x[0],h];w(e),null==r||r(e)}},children:[t.jsx(a,{name:z?"radio-sel":"radio-nor",type:"yunying",size:20,color:z?"var(--active-color)":"#ccc"}),t.jsx("span",{className:"wz-date-range-picker-long-term-text",children:m})]})]})]}),t.jsx("div",{className:"wz-date-range-picker-picker",children:t.jsx(C,{value:"start"===b?x[0]:x[1],onChange:e=>{if("start"===b){const t=[e,x[1]&&x[1]>=e?x[1]:e];w(t),null==r||r(t)}else{const t=[x[0],e&&e>=x[0]?e:x[0]];w(t),null==r||r(t)}},min:l,max:n})})]})},e.Dialog=O,e.Divider=({direction:e="horizontal",type:s="default",color:r,length:l,margin:n,style:a,className:i=""})=>{const c="vertical"===e,o=c?g.vertical:g.horizontal[s];return t.jsx("div",{className:`wz-divider wz-divider--${e} ${i}`,style:{background:r||o,width:c?2:l||"100%",height:c?l||24:2,margin:n,...a}})},e.DropdownMenu=({items:e,extension:r,onChange:l,value:n,defaultValue:i={}})=>{const[c,o]=s.useState(null),[d,u]=s.useState(i);s.useEffect((()=>{void 0!==n&&u(n)}),[n]);const m=void 0!==n,h=()=>m?n:d,p=t=>{const s=h()[t];if(void 0===s)return e[t].title;const r=e[t].options.find((e=>e.value===s));return r?r.text:e[t].title};return t.jsxs("div",{className:"wz-dropdown-menu-wrapper",children:[t.jsxs("div",{className:"wz-dropdown-menu",children:[e.map(((e,s)=>t.jsxs("div",{className:"wz-dropdown-item "+(c===s?"active":""),onClick:()=>(e=>{o(c===e?null:e)})(s),children:[t.jsx("span",{children:p(s)}),e.icon||t.jsx(a,{name:"dropdown",size:12})]},s))),r&&t.jsx("div",{className:"wz-dropdown-extension",children:r})]}),null!==c&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"wz-dropdown-mask",onClick:()=>{o(null)}}),t.jsx("div",{className:"wz-dropdown-popup",children:e[c].options.map((e=>t.jsx("div",{className:"wz-dropdown-option "+(h()[c]===e.value?"selected":""),onClick:()=>((e,t)=>{const s={...h(),[e]:t};m||u(s),o(null),l&&l(e,t,s)})(c,e.value),children:e.text},e.value)))})]})]})},e.Flex=T,e.Grid=R,e.GridView=E,e.Icon=a,e.Input=z,e.NavBar=({title:e,leftArrow:r=!0,leftText:l,rightText:n,onLeftClick:i,onRightClick:c,leftSlot:o,rightSlot:d,titleSlot:u,className:m,style:h,fixed:p=!1,scrollFixed:v=!1})=>{const[x,b]=s.useState(p),f=s.useRef(null),z=s.useRef(null);s.useEffect((()=>{if(!1===v)return void b(p);const e="number"==typeof v?v:0,t=()=>{const t=window.pageYOffset||document.documentElement.scrollTop;b(t>e)};return window.addEventListener("scroll",t),t(),()=>{window.removeEventListener("scroll",t)}}),[v,p]);const g=()=>{i&&i()},N=()=>{c&&c()},y=w("wz-navbar",{"wz-navbar-fixed":x},m);return t.jsxs(t.Fragment,{children:[x&&t.jsx("div",{ref:z,style:{height:"44px"}}),t.jsxs("div",{ref:f,className:y,style:h,children:[o?t.jsx("div",{className:"wz-navbar-left",children:o}):t.jsxs("div",{className:"wz-navbar-left",onClick:g,children:[r&&t.jsx(a,{name:"right-arrow",size:20,style:{transform:"scaleX(-1)"},className:"wz-navbar-icon"}),l&&t.jsx("span",{className:"wz-navbar-text",children:l})]}),u?t.jsx("div",{className:"wz-navbar-title",children:u}):t.jsx("div",{className:"wz-navbar-title",children:e}),d?t.jsx("div",{className:"wz-navbar-right",children:d}):t.jsxs("div",{className:"wz-navbar-right",onClick:N,children:[n&&t.jsx("span",{className:"wz-navbar-text",children:n}),!n&&t.jsx(a,{name:"more-h",className:"wz-navbar-icon"})]})]})]})},e.Popup=({visible:e=!1,position:r="bottom",mask:l=!0,maskClosable:n=!0,round:a=!1,duration:i=300,zIndex:c=1e3,destroyOnClose:o=!1,className:d="",style:u={},maskStyle:m={},children:h,onClose:p,onClosed:v,afterShow:w,closeable:x=!1,title:b})=>{const[f,z]=s.useState(e),[g,N]=s.useState(!1),[y,j]=s.useState(e);s.useEffect((()=>{e?k():C()}),[e]);const k=()=>{f||(z(!0),N(!0),requestAnimationFrame((()=>{requestAnimationFrame((()=>{j(!0),setTimeout((()=>{N(!1),null==w||w()}),i)}))})))},C=()=>{f&&(j(!1),N(!0),setTimeout((()=>{N(!1),z(!1),null==v||v()}),i))},$={...u,zIndex:c,transitionDuration:`${i}ms`},S={...m,zIndex:c,transitionDuration:`${i}ms`};return!f&&o?null:t.jsxs("div",{className:"wz-popup-container "+(f?"wz-popup--display":""),style:{zIndex:c},children:[l&&t.jsx("div",{className:"wz-popup-mask "+(y?"wz-popup-mask--active":""),style:S,onClick:()=>{n&&!g&&(null==p||p())}}),t.jsxs("div",{className:`\n wz-popup \n wz-popup--${r} \n ${y?"wz-popup--active":""} \n ${a?"wz-popup--round":""}\n ${d}\n `,style:$,children:[x&&t.jsx("div",{className:"wz-popup-close",onClick:()=>{g||null==p||p()},children:t.jsx("span",{className:"wz-popup-close-icon",children:"×"})}),b&&t.jsx("div",{className:"wz-popup-title",children:b}),h]})]})},e.Radio=c,e.Search=N,e.Stepper=({value:e,min:r=-1/0,max:l=1/0,step:n=1,onChange:i,disabled:c=!1,prefix:o,suffix:d,showMinus:u=!0,showPlus:m=!0,precision:h,className:p="",style:v,inputStyle:w,inputClassName:x="",buttonStyle:b,buttonClassName:f=""})=>{const[z,g]=s.useState(String(e)),[N,y]=s.useState(!1);s.useEffect((()=>{N||g(String(e))}),[e,N]);const j=c||Number(e)<=r,k=c||Number(e)>=l;return t.jsxs("div",{className:`wz-stepper ${p}`,style:v,children:[u&&t.jsx("button",{className:`wz-stepper-btn wz-stepper-btn-minus ${f}`,onClick:()=>{if(c)return;let t=Number(e)-n;t<r&&(t=r),t=void 0!==h?parseFloat(t.toFixed(h)):t,i(t),g(String(t))},disabled:j,type:"button",style:b,children:t.jsx(a,{name:"jian",type:"yunying",size:21})}),t.jsxs("div",{className:"wz-stepper-input-wrapper",children:[o&&t.jsx("span",{className:"wz-stepper-prefix",children:o}),t.jsx("input",{className:`wz-stepper-input ${x}`,type:"text",value:z,onChange:e=>{g(e.target.value)},onFocus:e=>{y(!0),e.target.select()},onBlur:()=>{y(!1);let t=Number(z);isNaN(t)?g(String(e)):(t>l&&(t=l),t<r&&(t=r),t=void 0!==h?parseFloat(t.toFixed(h)):t,i(t),g(String(t)))},disabled:c,style:w}),d&&t.jsx("span",{className:"wz-stepper-suffix",children:d})]}),m&&t.jsx("button",{className:`wz-stepper-btn wz-stepper-btn-plus ${f}`,onClick:()=>{if(c)return;let t=Number(e)+n;t>l&&(t=l),t=void 0!==h?parseFloat(t.toFixed(h)):t,i(t),g(String(t))},disabled:k,type:"button",style:b,children:t.jsx(a,{name:"jia",type:"yunying",size:21})})]})},e.Switch=({value:e,defaultValue:r=!1,onChange:l,disabled:n=!1,showText:a=!0,activeText:i="",inactiveText:c="",style:o,className:d="",size:u="default",activeColor:m})=>{const[h,p]=s.useState(r),v=void 0!==e,w=v?e:h,x=i||"开启",b=c||"关闭",f=w?x:b,z=a?12*f.length+8+"px":"0px",g=Math.max(x.length,b.length),N="large"===u?62:60,y=a?12*g+40:N,j=Math.max(y,N),k=`${j}px`,C=w?j-("large"===u?24:22)-4:0,$=m?(m.includes("gradient"),m):void 0,S=w&&m?{background:$}:{};return t.jsxs("div",{className:`wz-switch-bg ${w?"wz-switch-on":"wz-switch-off"}${n?" wz-switch-disabled":""}${d?" "+d:""} wz-switch-${u}`,style:{width:k,minWidth:`${N}px`,...o,...S},onClick:()=>{n||(v||p(!w),null==l||l(!w))},children:[a&&t.jsx("span",{className:"wz-switch-text",style:{width:z},children:f}),t.jsx("div",{className:"wz-switch-slider "+(w?"wz-switch-slider-on":"wz-switch-slider-off"),style:{transform:`translateX(${C}px)`}})]})},e.Tabbar=e=>{var r;const{activeKey:l,defaultActiveKey:n,onChange:a,items:i,fixed:c=!0,className:o,style:d}=e,[u,m]=s.useState(l??n??(null==(r=null==i?void 0:i[0])?void 0:r.key));s.useEffect((()=>{void 0!==l&&m(l)}),[l]);const h=w("wz-tabbar",{"wz-tabbar-fixed":c},o);return t.jsx("div",{className:h,style:d,children:i.map((e=>s.createElement(x,{...e,key:e.key,active:!e.hump&&u===e.key,onItemClick:()=>{return t=e.key,void 0===l&&m(t),void(null==a||a(t));var t}})))})},e.Tabs=f,e.Tag=e=>{const{type:r="solid",size:l="large",color:n,bgColor:a,fontWeight:i,className:c,style:o,children:d}=e,u=w("wz-tag",`wz-tag-${r}`,`wz-tag-${l}`,c),m=s.useMemo((()=>{const e={...o};return n&&(e.color=n,"line"===r&&(e.borderColor=function(e,t){let s=e.replace("#","");return 3===s.length&&(s=s.split("").map((e=>e+e)).join("")),`rgba(${parseInt(s.substring(0,2),16)}, ${parseInt(s.substring(2,4),16)}, ${parseInt(s.substring(4,6),16)}, ${t})`}(n,.5))),a&&"solid"===r&&(e.backgroundColor=a),i&&(e.fontWeight=i),e}),[r,n,a,i,o]);return t.jsx("div",{className:u,style:m,children:d})},e.TimePicker=({type:e="single",options:r,value:l,onChange:n,className:a="",style:i,itemHeight:c=48})=>{if("single"===e){const e=r&&r.length>0?r:y,[o,d]=s.useState((()=>{const t=l?e.indexOf(l):0;return t>=0?t:0})),u=s.useRef(null),m=s.useRef(0),h=s.useRef(0),p=s.useRef(!1);s.useEffect((()=>{l&&e.includes(l)&&d(e.indexOf(l))}),[l,e]),s.useEffect((()=>{u.current&&u.current.scrollTo({top:o*c,behavior:"smooth"})}),[o,c]);const v=e=>{var t;p.current=!0,m.current=e.touches[0].clientY,h.current=(null==(t=u.current)?void 0:t.scrollTop)||0},w=e=>{if(!p.current)return;const t=e.touches[0].clientY-m.current;u.current&&(u.current.scrollTop=h.current-t)},x=()=>{if(p.current=!1,!u.current)return;const t=Math.round(u.current.scrollTop/c);d(t),null==n||n(e[t])},b=()=>{if(!p.current&&u.current){const t=Math.round(u.current.scrollTop/c);d(t),null==n||n(e[t])}},f=e=>e===o;return t.jsxs("div",{className:`wz-time-picker ${a}`,style:i,children:[t.jsx("div",{className:"wz-time-picker-mask wz-time-picker-mask-top",style:{height:c}}),t.jsx("div",{className:"wz-time-picker-indicator",style:{height:c}}),t.jsxs("div",{className:"wz-time-picker-list",ref:u,style:{height:3*c},onTouchStart:v,onTouchMove:w,onTouchEnd:x,onScroll:b,children:[t.jsx("div",{style:{height:c}}),e.map(((e,s)=>t.jsx("div",{className:"wz-time-picker-item"+(f(s)?" active":""),style:{height:c},children:e},e))),t.jsx("div",{style:{height:c}})]}),t.jsx("div",{className:"wz-time-picker-mask wz-time-picker-mask-bottom",style:{height:c}})]})}const[o,d]=l?l.split(":"):[j[0],k[0]],[u,m]=s.useState(j.indexOf(o)),[h,p]=s.useState(k.indexOf(d)),v=s.useRef(null),w=s.useRef(null),x=s.useRef(0),b=s.useRef(0),f=s.useRef(!1),z=s.useRef(null);s.useEffect((()=>{v.current&&v.current.scrollTo({top:u*c,behavior:"smooth"})}),[u,c]),s.useEffect((()=>{w.current&&w.current.scrollTo({top:h*c,behavior:"smooth"})}),[h,c]);const g=e=>t=>{var s,r;f.current=!0,z.current=e,x.current=t.touches[0].clientY,b.current=("hour"===e?null==(s=v.current)?void 0:s.scrollTop:null==(r=w.current)?void 0:r.scrollTop)||0},N=e=>{if(!f.current||!z.current)return;const t=e.touches[0].clientY-x.current;"hour"===z.current&&v.current?v.current.scrollTop=b.current-t:"minute"===z.current&&w.current&&(w.current.scrollTop=b.current-t)},C=()=>{if(f.current&&z.current){if("hour"===z.current&&v.current){const e=Math.round(v.current.scrollTop/c);m(e),null==n||n(`${j[e]}:${k[h]}`)}else if("minute"===z.current&&w.current){const e=Math.round(w.current.scrollTop/c);p(e),null==n||n(`${j[u]}:${k[e]}`)}f.current=!1,z.current=null}},$=e=>()=>{if(!f.current)if("hour"===e&&v.current){const e=Math.round(v.current.scrollTop/c);m(e),null==n||n(`${j[e]}:${k[h]}`)}else if("minute"===e&&w.current){const e=Math.round(w.current.scrollTop/c);p(e),null==n||n(`${j[u]}:${k[e]}`)}},S=(e,s,r,l)=>t.jsxs("div",{className:"wz-time-picker-list",ref:r,style:{height:3*c},onTouchStart:g(l),onTouchMove:N,onTouchEnd:C,onScroll:$(l),children:[t.jsx("div",{style:{height:c}}),e.map(((e,r)=>t.jsx("div",{className:"wz-time-picker-item"+(r===s?" active":""),style:{height:c},children:e},e))),t.jsx("div",{style:{height:c}})]});return t.jsxs("div",{className:`wz-time-picker wz-time-picker-double ${a}`,style:i,children:[t.jsx("div",{className:"wz-time-picker-mask wz-time-picker-mask-top",style:{height:c}}),t.jsx("div",{className:"wz-time-picker-indicator",style:{height:c}}),t.jsxs("div",{className:"wz-time-picker-double-columns",children:[S(j,u,v,"hour"),S(k,h,w,"minute")]}),t.jsx("div",{className:"wz-time-picker-mask wz-time-picker-mask-bottom",style:{height:c}})]})},e.Tip=({content:e,className:r,visible:l=!0,onClose:n,marquee:i=!1,bold:c=!1,icon:o,showAction:d=!1,actionText:u="查看",onAction:m})=>{const h=s.useRef(null),[p,v]=s.useState(!1);if(s.useEffect((()=>{if(h.current&&!i){const e=h.current,t=parseFloat(getComputedStyle(e).lineHeight)||20;v(e.scrollHeight>1.5*t)}}),[e,i]),!l)return null;const x="wz-tip",b=d||n,f=w(x,r,{[`${x}--marquee`]:i,[`${x}--bold`]:c,[`${x}--center`]:!i&&!p,[`${x}--left`]:!i&&p,[`${x}--has-icon`]:!!o,[`${x}--has-right`]:b}),z=i?t.jsx("div",{className:`${x}-marquee-box`,children:t.jsx("span",{children:e})}):e;return t.jsxs("div",{className:f,children:[t.jsxs("div",{className:`${x}-content`,ref:h,children:[o&&t.jsx("span",{className:`${x}-icon`,children:t.jsx(a,{name:o,size:16})}),t.jsx("span",{className:`${x}-text`,children:z})]}),d&&t.jsx("div",{className:`${x}-action`,onClick:m,children:u}),n&&t.jsx("div",{className:`${x}-close`,onClick:n,children:t.jsx(a,{name:"close",size:16})})]})},e.Toast=I,e.Tooltip=({content:e,children:r,className:l,style:n,color:i,textColor:c,trigger:o="click",visible:d,onVisibleChange:u,showMask:m=!1,actionText:h,onAction:p,closable:v=!1})=>{const[x,b]=s.useState(!1),[f,z]=s.useState({}),[g,N]=s.useState("bottom"),y=s.useRef(null),j=s.useRef(null),k=void 0!==d,C=k?d:x,$=e=>{k||b(e),null==u||u(e)},S=s.useCallback((()=>{if(y.current&&j.current){const e=y.current,t=j.current,{width:s,height:r}=e.getBoundingClientRect(),{top:l,left:n,width:a,height:i}=t.getBoundingClientRect(),{innerWidth:c,innerHeight:o}=window,d=8;let u,m=n+a/2-s/2,h="bottom";m<d&&(m=d),m+s>c-d&&(m=c-s-d),u=l+i+d,u+r>o-d&&(h="top",u=l-r-d),u<d&&(h="bottom",u=l+i+d);const p=n+a/2-m;N(h),z({top:`${u}px`,left:`${m}px`,"--wz-tooltip-arrow-left":`${p}px`})}}),[]);s.useLayoutEffect((()=>{C&&S()}),[C,S]),s.useEffect((()=>{if(!C)return;const e=()=>{S()};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}}),[C,S]);const T=e=>{e.stopPropagation(),$(!1)},_=w("wz-tooltip-bubble",`wz-tooltip-bubble--placement-${g}`,l),R={...n,...f,opacity:f.top?1:0,transition:"opacity 150ms ease-in","--wz-tooltip-bubble-bg":i,color:c},E={onClick:()=>{"click"===o&&$(!C)},ref:j};return t.jsxs(t.Fragment,{children:[s.cloneElement(r,E),(()=>{if(!C)return null;return t.jsxs(t.Fragment,{children:[m&&t.jsx("div",{className:"wz-tooltip-mask",onClick:T}),t.jsxs("div",{className:_,style:R,ref:y,children:[t.jsx("div",{className:"wz-tooltip-bubble__arrow"}),t.jsxs("div",{className:"wz-tooltip-bubble__inner",children:[t.jsx("div",{className:"wz-tooltip-bubble__body",children:e}),(()=>{if(!h)return null;return t.jsx("div",{className:"wz-tooltip-bubble__action-slot",children:t.jsx("span",{className:"wz-tooltip-bubble__action-btn",onClick:e=>{e.stopPropagation(),null==p||p(),$(!1)},children:h})})})(),v?t.jsx("div",{className:"wz-tooltip-bubble__close-slot",children:t.jsx("span",{className:"wz-tooltip-bubble__close-btn",onClick:T,children:t.jsx(a,{name:"close",type:"yunying"})})}):null]})]})]})})()]})},e.useConfig=()=>s.useContext(V),Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wz-h5-design",
3
3
  "private": false,
4
- "version": "1.0.5",
4
+ "version": "1.0.6",
5
5
  "description": "一套基于 React 的移动端 H5 组件库",
6
6
  "keywords": [
7
7
  "react",