wz-h5-design 1.0.3 → 1.0.5

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.
Files changed (90) hide show
  1. package/dist/Button/index.js +23 -7
  2. package/dist/Button/index.umd.cjs +1 -1
  3. package/dist/Button/style/index.css +1 -1
  4. package/dist/Button/style.css +1 -1
  5. package/dist/ButtonGroup/index.js +34 -0
  6. package/dist/ButtonGroup/index.umd.cjs +1 -0
  7. package/dist/ButtonGroup/style/index.css +1 -0
  8. package/dist/ButtonGroup/style/index.js +1 -0
  9. package/dist/ButtonGroup/style.css +1 -0
  10. package/dist/Cell/index.js +29 -2
  11. package/dist/Cell/index.umd.cjs +2 -2
  12. package/dist/Cell/style/index.css +1 -1
  13. package/dist/Cell/style.css +1 -1
  14. package/dist/CheckList/index.js +28 -1
  15. package/dist/CheckList/index.umd.cjs +1 -1
  16. package/dist/CheckList/style.css +1 -1
  17. package/dist/Checkbox/index.js +34 -2
  18. package/dist/Checkbox/index.umd.cjs +1 -1
  19. package/dist/Checkbox/style/index.css +1 -1
  20. package/dist/Checkbox/style.css +1 -1
  21. package/dist/DatePicker/style/index.css +1 -1
  22. package/dist/DatePicker/style.css +1 -1
  23. package/dist/DateRangePicker/index.js +65 -9
  24. package/dist/DateRangePicker/index.umd.cjs +1 -1
  25. package/dist/DateRangePicker/style/index.css +1 -1
  26. package/dist/DateRangePicker/style.css +1 -1
  27. package/dist/Dialog/index.js +23 -7
  28. package/dist/Dialog/index.umd.cjs +1 -1
  29. package/dist/Dialog/style.css +1 -1
  30. package/dist/Divider/index.js +13 -4
  31. package/dist/Divider/index.umd.cjs +1 -1
  32. package/dist/Divider/style/index.css +1 -1
  33. package/dist/Divider/style.css +1 -1
  34. package/dist/GridView/index.js +26 -2
  35. package/dist/GridView/index.umd.cjs +1 -1
  36. package/dist/GridView/style/index.css +1 -1
  37. package/dist/GridView/style.css +1 -1
  38. package/dist/Input/index.js +47 -5
  39. package/dist/Input/index.umd.cjs +1 -1
  40. package/dist/Input/style/index.css +1 -1
  41. package/dist/Input/style.css +1 -1
  42. package/dist/Popup/style/index.css +1 -1
  43. package/dist/Popup/style.css +1 -1
  44. package/dist/Radio/index.js +34 -2
  45. package/dist/Radio/index.umd.cjs +1 -1
  46. package/dist/Radio/style/index.css +1 -1
  47. package/dist/Radio/style.css +1 -1
  48. package/dist/Search/index.js +10 -2
  49. package/dist/Search/index.umd.cjs +1 -1
  50. package/dist/Search/style/index.css +1 -1
  51. package/dist/Search/style.css +1 -1
  52. package/dist/Switch/index.js +10 -3
  53. package/dist/Switch/index.umd.cjs +1 -1
  54. package/dist/Switch/style/index.css +1 -1
  55. package/dist/Switch/style.css +1 -1
  56. package/dist/Tabbar/index.js +6 -3
  57. package/dist/Tabbar/index.umd.cjs +1 -1
  58. package/dist/Tabbar/style/index.css +1 -1
  59. package/dist/Tabbar/style.css +1 -1
  60. package/dist/Tabs/index.js +57 -17
  61. package/dist/Tabs/index.umd.cjs +1 -1
  62. package/dist/Tabs/style/index.css +1 -1
  63. package/dist/Tabs/style.css +1 -1
  64. package/dist/TimePicker/style/index.css +1 -1
  65. package/dist/TimePicker/style.css +1 -1
  66. package/dist/Tip/index.js +28 -5
  67. package/dist/Tip/index.umd.cjs +2 -2
  68. package/dist/Tip/style/index.css +1 -1
  69. package/dist/Tip/style.css +1 -1
  70. package/dist/Tooltip/index.js +59 -14
  71. package/dist/Tooltip/index.umd.cjs +2 -2
  72. package/dist/Tooltip/style/index.css +1 -1
  73. package/dist/Tooltip/style.css +1 -1
  74. package/dist/style.css +1 -1
  75. package/dist/types/components/Button/Button.d.ts +3 -0
  76. package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +20 -0
  77. package/dist/types/components/ButtonGroup/index.d.ts +5 -0
  78. package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +6 -0
  79. package/dist/types/components/Divider/Divider.d.ts +2 -0
  80. package/dist/types/components/GridView/GridView.d.ts +8 -0
  81. package/dist/types/components/Input/Input.d.ts +11 -1
  82. package/dist/types/components/Search/Search.d.ts +1 -0
  83. package/dist/types/components/Tabbar/Tabbar.d.ts +2 -0
  84. package/dist/types/components/Tabs/Tabs.d.ts +4 -1
  85. package/dist/types/components/Tip/Tip.d.ts +21 -2
  86. package/dist/types/components/Tooltip/Tooltip.d.ts +6 -2
  87. package/dist/types/components/index.d.ts +2 -1
  88. package/dist/wz-h5-design.es.js +357 -99
  89. package/dist/wz-h5-design.umd.js +2 -2
  90. package/package.json +1 -1
@@ -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,l){"use strict";const r=s.forwardRef((({type:e="primary",size:l="medium",block:r=!1,disabled:n=!1,color:a="",textColor:i="",borderColor:c="",className:o="",style:d={},children:u,icon:m,iconPosition:h="left",onClick:p},v)=>{const[w,x]=s.useState(!1),b=s.useRef(null),z=s.useMemo((()=>{if("cancel"===e)return{background:"#D6D6D6",color:i||"#fff",...d};if("outline"===e)return{color:i||"var(--wz-primary-color)",borderColor:c||"var(--wz-primary-color)",background:"transparent",...d};if("text"===e)return{color:i||d.color||"var(--wz-primary-color, #22C94D)",background:"transparent",border:"none",boxShadow:"none",...d};if("plain"===e)return{color:i||"#666666",borderColor:c||"#666666",background:"transparent",...d};if("primary"===e){let e={...d};return n||(e.background=a||"var(--wz-primary-gradient, var(--wz-primary-color))"),e.color=i||"#fff",e}return d}),[e,a,i,c,d]),g=["wz-button",`wz-button--${e}`,`wz-button--${l}`,r?"wz-button--block":"",n?"wz-button--disabled":"",w&&!n?"wz-button--active":"",o].filter(Boolean).join(" ");return t.jsxs("button",{ref:v,type:"button",className:g,style:z,disabled:n,onClick:e=>{n||(x(!0),b.current&&window.clearTimeout(b.current),b.current=window.setTimeout((()=>x(!1)),100),null==p||p(e))},children:["left"===h&&m,u,"right"===h&&m,"primary"===e&&w&&t.jsx("span",{className:"wz-button__mask"}),"outline"===e&&w&&t.jsx("span",{className:"wz-button__mask"}),"outline"===e&&n&&t.jsx("span",{className:"wz-button__mask--disabled"}),"cancel"===e&&w&&t.jsx("span",{className:"wz-button__mask--cancel"}),"plain"===e&&w&&t.jsx("span",{className:"wz-button__mask"})]})}));r.displayName="Button";const n=s.createContext({}),a=({size:e,checked:l,disabled:r,onChange:a,children:i,value:c,className:o="",style:d,...u})=>{const m=s.useContext(n),h=!!m.value,p=h?m.value===c:l,v=r||m.disabled,w=e||m.size||"medium";return t.jsxs("label",{className:`wz-radio-wrapper ${v?"wz-radio--disabled":""} wz-radio--${w} ${o}`,style:d,children:[t.jsx("input",{type:"radio",className:"wz-radio-input",checked:p,disabled:v,onChange:e=>{var t;r||m.disabled||(h?null==(t=m.onChange)||t.call(m,c):null==a||a(e.target.checked))},value:c,...u}),t.jsx("span",{className:"wz-radio-inner"}),i&&t.jsx("span",{className:"wz-radio-label",children:i})]})},i=({value:e,defaultValue:l,onChange:r,disabled:a,size:i,children:c,className:o="",style:d})=>{const[u,m]=s.useState(l),h={value:void 0!==e?e:u,onChange:e=>{m(e),null==r||r(e)},disabled:a,size:i};return t.jsx(n.Provider,{value:h,children:t.jsx("div",{className:`wz-radio-group ${o}`,style:d,children:c})})};a.Group=i,a.displayName="Radio",i.displayName="Radio.Group";const c=s.createContext({}),o=({size:e,checked:l,disabled:r,onChange:n,children:a,value:i,className:o="",style:d,...u})=>{var m;const h=s.useContext(c),p=!!h.value,v=p?null==(m=h.value)?void 0:m.includes(i):l,w=r||h.disabled,x=e||h.size||"medium";return t.jsxs("label",{className:`wz-checkbox-wrapper ${w?"wz-checkbox--disabled":""} wz-checkbox--${x} ${o}`,style:d,children:[t.jsx("input",{type:"checkbox",className:"wz-checkbox-input",checked:v,disabled:w,onChange:e=>{var t;if(!r&&!h.disabled)if(p){const s=e.target.checked?[...h.value||[],i]:(h.value||[]).filter((e=>e!==i));null==(t=h.onChange)||t.call(h,s)}else null==n||n(e.target.checked)},value:i,...u}),t.jsx("span",{className:"wz-checkbox-inner"}),a&&t.jsx("span",{className:"wz-checkbox-label",children:a})]})},d=({value:e,defaultValue:l,onChange:r,disabled:n,size:a,children:i,className:o="",style:d})=>{const[u,m]=s.useState(l||[]),h={value:void 0!==e?e:u,onChange:e=>{m(e),null==r||r(e)},disabled:n,size:a};return t.jsx(c.Provider,{value:h,children:t.jsx("div",{className:`wz-checkbox-group ${o}`,style:d,children:i})})};o.Group=d,o.displayName="Checkbox",d.displayName="Checkbox.Group";function u(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var m,h={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),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:{}};
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
- */m=h,function(){var e={}.hasOwnProperty;function t(){for(var s=[],l=0;l<arguments.length;l++){var r=arguments[l];if(r){var n=typeof r;if("string"===n||"number"===n)s.push(r);else if(Array.isArray(r)){if(r.length){var a=t.apply(null,r);a&&s.push(a)}}else if("object"===n){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){s.push(r.toString());continue}for(var i in r)e.call(r,i)&&r[i]&&s.push(i)}}}return s.join(" ")}m.exports?(t.default=t,m.exports=t):window.classNames=t}();const p=u(h.exports),v=({name:e,size:s=24,color:l="currentColor",className:r="",style:n,onClick:a,type:i="yunying"})=>{const c={fontSize:"number"==typeof s?`${s}px`:s,color:l,...n},o=`iconfont-${i}`,d=`icon-${e}`;return t.jsx("i",{className:`wz-icon ${o} ${d} ${r}`,style:c,onClick:a})},w=e=>{const{title:l,icon:r,activeIcon:n,badge:a,badgeAsBubble:i,hump:c,active:o,onItemClick:d,onClick:u,activeColor:m}=e,h=e=>"string"==typeof e?t.jsx(v,{name:e}):e,w=p("wz-tabbar-item",{"wz-tabbar-item-active":!c&&o,"wz-tabbar-item-hump":c}),x=s.useMemo((()=>{const e={};return o&&m&&(e.color=m),e}),[o,m]);return t.jsxs("div",{className:w,style:x,onClick:c?u:d,children:[t.jsxs("div",{className:"wz-tabbar-item-icon",children:[h(o&&n||r),a?i?t.jsx("div",{className:"wz-tabbar-item-badge-custom",children:t.jsxs("div",{className:"wz-tabbar-item-badge-bubble",children:[a,t.jsx("div",{className:"wz-tabbar-item-badge-bubble-arrow"})]})}):s.isValidElement(a)?t.jsx("div",{className:"wz-tabbar-item-badge-custom",children:a}):t.jsx("div",{className:"wz-tabbar-item-badge",children:a}):null]}),t.jsx("div",{className:"wz-tabbar-item-title",children:l})]})},x=e=>{const{title:s,label:l,value:r,icon:n,arrow:a=!1,border:i=!0,center:c=!1,disabled:o=!1,required:d=!1,className:u,style:m,titleStyle:h,titleClassName:v,labelStyle:w,labelClassName:x,valueStyle:b,valueClassName:z,onClick:g,children:f}=e,N=p("wz-cell",{"wz-cell-border":i,"wz-cell-center":c,"wz-cell-disabled":o},u);return t.jsxs("div",{className:N,style:m,onClick:o?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:p("wz-cell-title",v),style:h,children:[d&&t.jsx("span",{className:"wz-cell-required",children:"*"}),s,r&&t.jsx("span",{className:p("wz-cell-value",z),style:b,children:r})]}):null,l?t.jsx("div",{className:p("wz-cell-label",x),style:w,children:l}):null]}),null,f&&t.jsx("div",{className:"wz-cell-extra",children:f}),a?t.jsx("div",{className:"wz-cell-arrow"}):null]})};x.Group=e=>{const{className:s,style:l,children:r}=e;return t.jsx("div",{className:p("wz-cell-group",s),style:l,children:r})};const b=({type:e="line",value:l,defaultValue:r=0,onChange:n,className:a="",style:i,headerClassName:c="",headerStyle:o,contentClassName:d="",contentStyle:u,children:m})=>{const h=void 0!==l,[p,v]=s.useState(r),w=h?l:p,x=s.Children.toArray(m).filter(Boolean);return t.jsxs("div",{className:`wz-tabs wz-tabs-${e} ${a}`,style:i,children:[t.jsx("div",{className:`wz-tabs-header ${c}`,style:o,children:x.map(((s,l)=>t.jsxs("div",{className:`wz-tabs-tab${l===w?" wz-tabs-tab-active":""}${s.props.disabled?" wz-tabs-tab-disabled":""}`,onClick:()=>((e,t)=>{t||(h||v(e),null==n||n(e))})(l,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})]}),l===w&&"line"===e&&t.jsx("div",{className:"wz-tabs-underline"})]},l)))}),t.jsx("div",{className:`wz-tabs-content ${d}`,style:u,children:x[w]})]})};b.TabPane=({children:e})=>t.jsx(t.Fragment,{children:e});const z=s.forwardRef((({clearable:e=!1,align:l="center",value:r,defaultValue:n,onChange:a,style:i,className:c="",type:o="text",showCount:d=!1,rows:u=3,maxLength:m,countStyle:h,suffix:p,borderRadius:w,backgroundColor:x,bordered:b,...z},g)=>{const f=void 0!==r,[N,j]=s.useState(n||""),y=e&&!!(f?r:N),[k,C]=s.useState(!1),$=e=>{f||j(e.target.value),null==a||a(e)},S={position:"relative",width:null==i?void 0:i.width,...i},T={textAlign:l,borderRadius:w,backgroundColor:x,border:void 0!==b?void 0:"none"},_=f?r:N,R=(null==_?void 0:_.toString().length)||0,E=m&&R>m;return t.jsxs("div",{className:`wz-input-affix-wrapper ${"textarea"===o?"wz-input-affix-wrapper-textarea":""} ${p?"wz-input-has-suffix":""} ${void 0===b?"wz-input-no-border":""}`,style:S,children:["textarea"===o?t.jsxs(t.Fragment,{children:[t.jsx("textarea",{ref:g,className:`wz-input ${c}`,value:_,onChange:$,style:{...T,resize:"none"},rows:u,maxLength:m,...z}),d&&m&&t.jsxs("div",{className:"wz-input-count "+(E?"wz-input-count-exceeded":""),style:h,children:[R,"/",m]})]}):t.jsx("input",{ref:g,className:`wz-input ${c}`,value:_,onChange:$,style:T,type:"password"===o&&k?"text":o,maxLength:m,...z}),y&&!z.disabled&&"textarea"!==o&&!p&&t.jsx("span",{className:"wz-input-clear",onClick:()=>{f||j("");const e={...z,target:{value:""}};null==a||a(e)},children:t.jsx(v,{name:"close",size:22})}),"password"===o&&!p&&t.jsx("span",{className:"wz-input-password",onClick:()=>{C(!k)},children:t.jsx(v,{name:k?"eyes-close":"eyes-open",size:22})}),p&&t.jsxs("div",{className:"wz-input-suffix",children:[t.jsx("span",{className:"wz-input-suffix-divider"}),p]})]})}));z.displayName="Input";const g=s.forwardRef((({value:e,defaultValue:l,placeholder:r="输入关键词搜索",shape:n="round",clearable:a=!0,disabled:i=!1,prefix:c,suffix:o,leftIcon:d=t.jsx(v,{name:"search",size:16}),actionText:u="搜索",showCancel:m=!1,cancelText:h="返回",background:p,style:w,className:x="",onSearch:b,onClear:z,onChange:g,onFocus:f,onBlur:N,onCancel:j,...y},k)=>{const C=void 0!==e,[$,S]=s.useState(l||""),[T,_]=s.useState(!1),R=s.useRef(null);s.useImperativeHandle(k,(()=>R.current));const E=C?e:$,M=a&&E&&T&&!i,D=()=>{var e;i||(null==(e=R.current)||e.blur(),null==b||b(E))},A=()=>{_(!1),null==j||j()},B={...w,backgroundColor:p};return t.jsxs("div",{className:`wz-search ${T?"wz-search-focused":""} ${x}`,style:B,children:[c&&t.jsx("div",{className:"wz-search-prefix",children:c}),!c&&m&&T?t.jsx("div",{className:"wz-search-cancel",onClick:A,children:h}):null,t.jsxs("div",{className:`wz-search-content wz-search-shape-${n} ${i?"wz-search-disabled":""}`,children:[t.jsxs("div",{className:"wz-search-input-wrapper "+(M?"wz-search-input-wrapper--with-clear":""),children:[d&&t.jsx("div",{className:"wz-search-left-icon",children:d}),t.jsx("input",{ref:R,className:"wz-search-input",value:E,onChange:e=>{const t=e.target.value;C||S(t),null==g||g(t)},onFocus:e=>{_(!0),null==f||f(e)},onBlur:e=>{_(!1),null==N||N(e)},onKeyDown:e=>{"Enter"!==e.key||i||D()},placeholder:r,disabled:i,...y}),M&&t.jsx("div",{className:"wz-search-clear",onMouseDown:e=>{var t;e.preventDefault(),C||S(""),null==g||g(""),null==z||z(),null==(t=R.current)||t.focus()},children:t.jsx(v,{name:"close",size:16,color:"#BDBDBD"})})]}),u&&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",children:u})]})]}),o&&t.jsx("div",{className:"wz-search-suffix",children:o})]})}));g.displayName="Search";const f=Array.from({length:24},((e,t)=>`${t+1}小时`)),N=Array.from({length:24},((e,t)=>t.toString().padStart(2,"0"))),j=Array.from({length:60},((e,t)=>t.toString().padStart(2,"0"))),y=({value:e,onChange:l,min:r="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(r.split("-")[0]),v=Number(n.split("-")[0]),w=s.useMemo((()=>((e,t)=>{const s=[];for(let l=e;l<=t;l++)s.push(l.toString());return s})(p,v)),[p,v]),[x,b]=s.useState(u),[z,g]=s.useState(m),[f,N]=s.useState(h),j=Array.from({length:12},((e,t)=>(t+1).toString().padStart(2,"0"))),y=((e,t)=>{const s=new Date(e,t,0).getDate();return Array.from({length:s},((e,t)=>(t+1).toString().padStart(2,"0")))})(x,z),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:(z-1)*i,behavior:"auto"})}),[z,i]),s.useLayoutEffect((()=>{$.current&&$.current.scrollTo({top:(f-1)*i,behavior:"auto"})}),[f,i]);const E=e=>t=>{var s,l,r;_.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==(l=C.current)?void 0:l.scrollTop)||0),"day"===e&&(n=(null==(r=$.current)?void 0:r.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)},D=()=>{if(_.current&&R.current){if("year"===R.current&&k.current){const e=Math.round(k.current.scrollTop/i);b(Number(w[e])),null==l||l(`${w[e]}-${z.toString().padStart(2,"0")}-${f.toString().padStart(2,"0")}`)}if("month"===R.current&&C.current){const e=Math.round(C.current.scrollTop/i);g(Number(j[e])),null==l||l(`${x}-${j[e]}-${f.toString().padStart(2,"0")}`)}if("day"===R.current&&$.current){const e=Math.round($.current.scrollTop/i);N(Number(y[e])),null==l||l(`${x}-${z.toString().padStart(2,"0")}-${y[e]}`)}_.current=!1,R.current=null}},A=e=>()=>{if(!_.current){if("year"===e&&k.current){const e=Math.round(k.current.scrollTop/i);b(Number(w[e])),null==l||l(`${w[e]}-${z.toString().padStart(2,"0")}-${f.toString().padStart(2,"0")}`)}if("month"===e&&C.current){const e=Math.round(C.current.scrollTop/i);g(Number(j[e])),null==l||l(`${x}-${j[e]}-${f.toString().padStart(2,"0")}`)}if("day"===e&&$.current){const e=Math.round($.current.scrollTop/i);N(Number(y[e])),null==l||l(`${x}-${z.toString().padStart(2,"0")}-${y[e]}`)}}};s.useEffect((()=>{if(e){const[t,s,l]=e.split("-").map(Number);b(t),g(s),N(l),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:(l-1)*i,behavior:"auto"})}}),[e]);const B=(e,s,l,r)=>t.jsxs("div",{className:"wz-date-picker-list",ref:l,style:{height:3*i},onTouchStart:E(r),onTouchMove:M,onTouchEnd:D,onScroll:A(r),children:[t.jsx("div",{style:{height:i}}),e.map(((e,l)=>t.jsx("div",{className:"wz-date-picker-item"+(l===s?" active":""),style:{height:i},children:"year"===r?`${e}年`:"month"===r?`${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")&&B(w,x-p,k,"year"),a.includes("month")&&B(j,z-1,C,"month"),a.includes("day")&&B(y,f-1,$,"day")]}),t.jsx("div",{className:"wz-date-picker-mask wz-date-picker-mask-bottom",style:{height:i}})]})},k={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",baseline:"baseline"},C={start:"flex-start",center:"center",end:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly"},$=({direction:e="row",align:s="stretch",justify:l="start",wrap:r="nowrap",gap:n=0,className:a="",style:i={},children:c})=>{const o={display:"flex",flexDirection:e,alignItems:k[s],justifyContent:C[l],flexWrap:r,gap:"number"==typeof n?`${n}px`:n,...i};return t.jsx("div",{className:"wz-flex"+(a?" "+a:""),style:o,children:c})};$.Item=({span:e,order:s,offset:l,className:r="",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!==l?100*l+"%":void 0,...n};return t.jsx("div",{className:"wz-flex-item"+(r?" "+r:""),style:i,children:a})};const S=s.createContext(24),T=({cols:e=24,gap:s=0,className:l="",style:r={},children:n})=>{const a={display:"flex",flexWrap:"wrap",gap:"number"==typeof s?`${s}px`:s,...r};return t.jsx(S.Provider,{value:e,children:t.jsx("div",{className:"wz-grid"+(l?" "+l:""),style:a,children:n})})};T.Item=({span:e=1,offset:l=0,order:r,className:n="",style:a={},children:i})=>{const c=s.useContext(S);process.env.NODE_ENV;const o=e/c*100+"%",d=l?l/c*100+"%":void 0;return t.jsx("div",{className:"wz-grid-item"+(n?" "+n:""),style:{width:o,marginLeft:d,order:r,...a},children:i})};const _=({columns:e=4,gap:s=0,square:l=!0,className:r="",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",l?"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":"",r].filter(Boolean).join(" ");return t.jsx("div",{className:m,style:u,children:a})};_.Item=({icon:e,text:s,description:l,badge:r,corner:n,onClick:a,className:i="",style:c={},disabled:o=!1,children:d,horizontal:u=!1,compact:m=!1,backgroundImage:h,backgroundStyle:p={}})=>{const v=()=>{!o&&a&&a()},w=["wz-grid-view-item",o?"wz-grid-view-item--disabled":"",a?"wz-grid-view-item--clickable":"",u?"wz-grid-view-item--horizontal":"",m?"wz-grid-view-item--compact":"",h?"wz-grid-view-item--with-bg":"",i].filter(Boolean).join(" "),x=h?{backgroundImage:`url(${h})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",...p,...c}:c;return d?t.jsxs("div",{className:w,style:x,onClick:v,children:[n&&t.jsx("div",{className:"wz-grid-view-item__corner",children:n}),d,r&&t.jsx("div",{className:"wz-grid-view-item__badge",children:r})]}):t.jsxs("div",{className:w,style:x,onClick:v,children:[n&&t.jsx("div",{className:"wz-grid-view-item__corner",children:n}),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",children:s}),l&&t.jsx("div",{className:"wz-grid-view-item__desc",children:l})]})]}),r&&t.jsx("div",{className:"wz-grid-view-item__badge",children:r})]})};const R=({content:e,duration:l=2e3,icon:r,visible:n=!1,onClose:a})=>{const[i,c]=s.useState(n);s.useEffect((()=>{let e;return c(n),n&&l>0&&(e=setTimeout((()=>{c(!1),null==a||a()}),l)),()=>{clearTimeout(e)}}),[n,l,a]);const o=p("wz-toast",{"wz-toast-visible":i}),d=p("wz-toast-icon");return t.jsx("div",{className:o,children:t.jsxs("div",{className:"wz-toast-content",children:[r&&t.jsx("div",{className:d,children:r}),t.jsx("div",{className:"wz-toast-text",children:e})]})})};let E=null,M=null;const D=()=>{E&&(E.unmount(),E=null),M&&M.parentNode&&(M.parentNode.removeChild(M),M=null)},A=e=>{M||(M=document.createElement("div"),document.body.appendChild(M),E=l.createRoot(M)),E.render(t.jsx(R,{...e}))},B={show:e=>{A({..."string"==typeof e?{content:e}:e,visible:!0,onClose:D})},success:(e,s)=>{A({content:e,duration:s,icon:t.jsx(v,{name:"check-round",size:37.14}),visible:!0,onClose:D})},fail:(e,s)=>{A({content:e,duration:s,icon:t.jsx(v,{name:"close",size:37.14}),visible:!0,onClose:D})},loading:(e,s)=>{A({content:e,duration:s,icon:t.jsx(v,{name:"loading",size:37.14}),visible:!0,onClose:D})},warn:(e,s)=>{A({content:e,duration:s,icon:t.jsx(v,{name:"info",size:37.14}),visible:!0,onClose:D})},hide:()=>{A({content:"",visible:!1}),D()}},I=({visible:e,title:s,content:l,onClose:n,actions:a,closeOnAction:i,closeOnMaskClick:c})=>t.jsxs("div",{className:p("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:l}),t.jsx("div",{className:"wz-dialog-footer",children:null==a?void 0:a.map((e=>t.jsx(r,{className:"wz-dialog-button",onClick:()=>{return null==(t=e.onClick)||t(),void(i&&(null==n||n()));var t},children:e.text},e.key)))})]})]}),F=e=>{const s=document.createElement("div");document.body.appendChild(s);const r=l.createRoot(s);r.render(t.jsx(I,{...e,visible:!0,onClose:()=>{r.unmount(),document.body.removeChild(s)}}))},P=Object.assign(I,{alert:e=>{F({...e,closeOnAction:!0,actions:[{key:"confirm",text:"确定",onClick:e.onConfirm}]})},confirm:e=>{F({...e,closeOnAction:!0,actions:[{key:"cancel",text:"取消",onClick:e.onCancel},{key:"confirm",text:"确定",onClick:e.onConfirm}]})}}),L=s.createContext({theme:"default"}),O={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=r,e.Card=({title:e,extra:s,cover:l,actions:r,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:[l&&t.jsx("div",{className:"wz-card-cover",children:l}),(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}),r&&r.length>0&&t.jsx("div",{className:"wz-card-actions",children:r.map(((e,s)=>t.jsx("div",{className:"wz-card-action",children:e},s)))})]})},e.Cascader=({value:e,onChange:l,data:r})=>{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 r;let e=r;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}),[r,i,n]),d=s.useMemo((()=>{let e=r;const t=["请选择","请选择","请选择"];return n.map(((s,l)=>{const r=e.find((e=>e.value===s));return e=(null==r?void 0:r.children)||[],(null==r?void 0:r.label)||t[l]}))}),[r,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==l||l(t))})(e),children:[e.label,e.disabled&&t.jsx("span",{className:"wz-cascader-option-tip",children:"不可选"})]},e.value)))})})]})},e.Cell=x,e.CheckList=({options:e,value:s,onChange:l,multiple:r=!1,style:n,className:a=""})=>{const i=e=>r&&Array.isArray(s)?s.includes(e):s===e;return t.jsx("div",{className:`wz-check-list ${a}`,style:n,children:e.map((e=>t.jsxs("div",{className:"wz-check-list__item"+(i(e)?" wz-check-list__item--active":""),onClick:()=>(e=>{if(r){if(!Array.isArray(s))return;s.includes(e)?l(s.filter((t=>t!==e))):l([...s,e])}else l(e)})(e),children:[t.jsx("span",{className:"wz-check-list__label",children:e}),i(e)&&t.jsx("span",{className:"wz-check-list__icon",children:"✔"})]},e)))})},e.Checkbox=o,e.Collapse=({title:e,extra:l,children:r,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:l}),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:r})]})},e.ConfigProvider=({children:e,theme:l="default",themeVars:r})=>{s.useEffect((()=>{const e=document.documentElement;return"default"===l?e.removeAttribute("data-theme"):e.setAttribute("data-theme",l),r&&Object.entries(r).forEach((([t,s])=>{if(s){const l=O[t];l&&e.style.setProperty(l,s)}})),()=>{r&&Object.keys(r).forEach((t=>{const s=O[t];s&&e.style.removeProperty(s)}))}}),[l,r]);const n=s.useMemo((()=>({theme:l,themeVars:r})),[l,r]);return t.jsx(L.Provider,{value:n,children:e})},e.DatePicker=y,e.DateRangePicker=({value:e,onChange:l,min:r="1970-01-01",max:n="2100-12-31",startLabel:a="开始时间",endLabel:i="结束时间",className:c="",style:o})=>{const d=s.useMemo((()=>{const e=new Date;return`${e.getFullYear()}-${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")}`}),[]),[u,m]=s.useState(e||[d,d]),h=e||u,[p,v]=s.useState("start");return t.jsxs("div",{className:`wz-date-range-picker ${c}`,style:o,children:[t.jsxs("div",{className:"wz-date-range-picker-label-row",children:[t.jsx("div",{className:"wz-date-range-picker-label",children:a}),t.jsx("div",{className:"wz-date-range-picker-label",children:i})]}),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"===p?" active":""),onClick:()=>v("start"),children:h[0]||"请选择"})}),t.jsx("div",{className:"wz-date-range-picker-sep",children:"至"}),t.jsx("div",{className:"wz-date-range-picker-col",children:t.jsx("div",{className:"wz-date-range-picker-value"+("end"===p?" active":""),onClick:()=>v("end"),children:h[1]||"请选择"})})]}),t.jsx("div",{className:"wz-date-range-picker-picker",children:t.jsx(y,{value:"start"===p?h[0]:h[1],onChange:e=>{if("start"===p){const t=[e,h[1]&&h[1]>=e?h[1]:e];m(t),null==l||l(t)}else{const t=[h[0],e&&e>=h[0]?e:h[0]];m(t),null==l||l(t)}},min:r,max:n})})]})},e.Dialog=P,e.Divider=({direction:e="horizontal",color:s="#eee",length:l,margin:r,style:n,className:a=""})=>{const i="vertical"===e;return t.jsx("div",{className:`wz-divider wz-divider--${e} ${a}`,style:{background:s,width:i?1:l||"100%",height:i?l||24:1,margin:r,...n}})},e.DropdownMenu=({items:e,extension:l,onChange:r,value:n,defaultValue:a={}})=>{const[i,c]=s.useState(null),[o,d]=s.useState(a);s.useEffect((()=>{void 0!==n&&d(n)}),[n]);const u=void 0!==n,m=()=>u?n:o,h=t=>{const s=m()[t];if(void 0===s)return e[t].title;const l=e[t].options.find((e=>e.value===s));return l?l.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 "+(i===s?"active":""),onClick:()=>(e=>{c(i===e?null:e)})(s),children:[t.jsx("span",{children:h(s)}),e.icon||t.jsx(v,{name:"dropdown",size:12})]},s))),l&&t.jsx("div",{className:"wz-dropdown-extension",children:l})]}),null!==i&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"wz-dropdown-mask",onClick:()=>{c(null)}}),t.jsx("div",{className:"wz-dropdown-popup",children:e[i].options.map((e=>t.jsx("div",{className:"wz-dropdown-option "+(m()[i]===e.value?"selected":""),onClick:()=>((e,t)=>{const s={...m(),[e]:t};u||d(s),c(null),r&&r(e,t,s)})(i,e.value),children:e.text},e.value)))})]})]})},e.Flex=$,e.Grid=T,e.GridView=_,e.Icon=v,e.Input=z,e.NavBar=({title:e,leftArrow:l=!0,leftText:r,rightText:n,onLeftClick:a,onRightClick:i,leftSlot:c,rightSlot:o,titleSlot:d,className:u,style:m,fixed:h=!1,scrollFixed:w=!1})=>{const[x,b]=s.useState(h),z=s.useRef(null),g=s.useRef(null);s.useEffect((()=>{if(!1===w)return void b(h);const e="number"==typeof w?w:0,t=()=>{const t=window.pageYOffset||document.documentElement.scrollTop;b(t>e)};return window.addEventListener("scroll",t),t(),()=>{window.removeEventListener("scroll",t)}}),[w,h]);const f=()=>{a&&a()},N=()=>{i&&i()},j=p("wz-navbar",{"wz-navbar-fixed":x},u);return t.jsxs(t.Fragment,{children:[x&&t.jsx("div",{ref:g,style:{height:"44px"}}),t.jsxs("div",{ref:z,className:j,style:m,children:[c?t.jsx("div",{className:"wz-navbar-left",children:c}):t.jsxs("div",{className:"wz-navbar-left",onClick:f,children:[l&&t.jsx(v,{name:"right-arrow",size:20,style:{transform:"scaleX(-1)"},className:"wz-navbar-icon"}),r&&t.jsx("span",{className:"wz-navbar-text",children:r})]}),d?t.jsx("div",{className:"wz-navbar-title",children:d}):t.jsx("div",{className:"wz-navbar-title",children:e}),o?t.jsx("div",{className:"wz-navbar-right",children:o}):t.jsxs("div",{className:"wz-navbar-right",onClick:N,children:[n&&t.jsx("span",{className:"wz-navbar-text",children:n}),!n&&t.jsx(v,{name:"more-h",className:"wz-navbar-icon"})]})]})]})},e.Popup=({visible:e=!1,position:l="bottom",mask:r=!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[z,g]=s.useState(e),[f,N]=s.useState(!1),[j,y]=s.useState(e);s.useEffect((()=>{e?k():C()}),[e]);const k=()=>{z||(g(!0),N(!0),requestAnimationFrame((()=>{requestAnimationFrame((()=>{y(!0),setTimeout((()=>{N(!1),null==w||w()}),i)}))})))},C=()=>{z&&(y(!1),N(!0),setTimeout((()=>{N(!1),g(!1),null==v||v()}),i))},$={...u,zIndex:c,transitionDuration:`${i}ms`},S={...m,zIndex:c,transitionDuration:`${i}ms`};return!z&&o?null:t.jsxs("div",{className:"wz-popup-container "+(z?"wz-popup--display":""),style:{zIndex:c},children:[r&&t.jsx("div",{className:"wz-popup-mask "+(j?"wz-popup-mask--active":""),style:S,onClick:()=>{n&&!f&&(null==p||p())}}),t.jsxs("div",{className:`\n wz-popup \n wz-popup--${l} \n ${j?"wz-popup--active":""} \n ${a?"wz-popup--round":""}\n ${d}\n `,style:$,children:[x&&t.jsx("div",{className:"wz-popup-close",onClick:()=>{f||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=a,e.Search=g,e.Stepper=({value:e,min:l=-1/0,max:r=1/0,step:n=1,onChange:a,disabled:i=!1,prefix:c,suffix:o,showMinus:d=!0,showPlus:u=!0,precision:m,className:h="",style:p,inputStyle:w,inputClassName:x="",buttonStyle:b,buttonClassName:z=""})=>{const[g,f]=s.useState(String(e)),[N,j]=s.useState(!1);s.useEffect((()=>{N||f(String(e))}),[e,N]);const y=i||Number(e)<=l,k=i||Number(e)>=r;return t.jsxs("div",{className:`wz-stepper ${h}`,style:p,children:[d&&t.jsx("button",{className:`wz-stepper-btn wz-stepper-btn-minus ${z}`,onClick:()=>{if(i)return;let t=Number(e)-n;t<l&&(t=l),t=void 0!==m?parseFloat(t.toFixed(m)):t,a(t),f(String(t))},disabled:y,type:"button",style:b,children:t.jsx(v,{name:"jian",type:"yunying",size:21})}),t.jsxs("div",{className:"wz-stepper-input-wrapper",children:[c&&t.jsx("span",{className:"wz-stepper-prefix",children:c}),t.jsx("input",{className:`wz-stepper-input ${x}`,type:"text",value:g,onChange:e=>{f(e.target.value)},onFocus:e=>{j(!0),e.target.select()},onBlur:()=>{j(!1);let t=Number(g);isNaN(t)?f(String(e)):(t>r&&(t=r),t<l&&(t=l),t=void 0!==m?parseFloat(t.toFixed(m)):t,a(t),f(String(t)))},disabled:i,style:w}),o&&t.jsx("span",{className:"wz-stepper-suffix",children:o})]}),u&&t.jsx("button",{className:`wz-stepper-btn wz-stepper-btn-plus ${z}`,onClick:()=>{if(i)return;let t=Number(e)+n;t>r&&(t=r),t=void 0!==m?parseFloat(t.toFixed(m)):t,a(t),f(String(t))},disabled:k,type:"button",style:b,children:t.jsx(v,{name:"jia",type:"yunying",size:21})})]})},e.Switch=({value:e,defaultValue:l=!1,onChange:r,disabled:n=!1,showText:a=!0,activeText:i="",inactiveText:c="",style:o,className:d="",size:u="default",activeColor:m})=>{const[h,p]=s.useState(l),v=void 0!==e,w=v?e:h,x=w?i||"开启":c||"关闭",b=a?12*x.length+8+"px":"0px",z="large"===u?62:60,g=`${a?12*x.length+40:z}px`,f=m?(m.includes("gradient"),m):void 0,N=w&&m?{background:f}:{};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:g,minWidth:`${z}px`,...o,...N},onClick:()=>{n||(v||p(!w),null==r||r(!w))},children:[a&&t.jsx("span",{className:"wz-switch-text",style:{width:b},children:x}),t.jsx("div",{className:"wz-switch-slider "+(w?"wz-switch-slider-on":"wz-switch-slider-off")})]})},e.Tabbar=e=>{var l;const{activeKey:r,defaultActiveKey:n,onChange:a,items:i,fixed:c=!0,className:o,style:d}=e,[u,m]=s.useState(r??n??(null==(l=null==i?void 0:i[0])?void 0:l.key));s.useEffect((()=>{void 0!==r&&m(r)}),[r]);const h=p("wz-tabbar",{"wz-tabbar-fixed":c},o);return t.jsx("div",{className:h,style:d,children:i.map((e=>s.createElement(w,{...e,key:e.key,active:!e.hump&&u===e.key,onItemClick:()=>{return t=e.key,void 0===r&&m(t),void(null==a||a(t));var t}})))})},e.Tabs=b,e.Tag=e=>{const{type:l="solid",size:r="large",color:n,bgColor:a,fontWeight:i,className:c,style:o,children:d}=e,u=p("wz-tag",`wz-tag-${l}`,`wz-tag-${r}`,c),m=s.useMemo((()=>{const e={...o};return n&&(e.color=n,"line"===l&&(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"===l&&(e.backgroundColor=a),i&&(e.fontWeight=i),e}),[l,n,a,i,o]);return t.jsx("div",{className:u,style:m,children:d})},e.TimePicker=({type:e="single",options:l,value:r,onChange:n,className:a="",style:i,itemHeight:c=48})=>{if("single"===e){const e=l&&l.length>0?l:f,[o,d]=s.useState((()=>{const t=r?e.indexOf(r):0;return t>=0?t:0})),u=s.useRef(null),m=s.useRef(0),h=s.useRef(0),p=s.useRef(!1);s.useEffect((()=>{r&&e.includes(r)&&d(e.indexOf(r))}),[r,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])}},z=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"+(z(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]=r?r.split(":"):[N[0],j[0]],[u,m]=s.useState(N.indexOf(o)),[h,p]=s.useState(j.indexOf(d)),v=s.useRef(null),w=s.useRef(null),x=s.useRef(0),b=s.useRef(0),z=s.useRef(!1),g=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 y=e=>t=>{var s,l;z.current=!0,g.current=e,x.current=t.touches[0].clientY,b.current=("hour"===e?null==(s=v.current)?void 0:s.scrollTop:null==(l=w.current)?void 0:l.scrollTop)||0},k=e=>{if(!z.current||!g.current)return;const t=e.touches[0].clientY-x.current;"hour"===g.current&&v.current?v.current.scrollTop=b.current-t:"minute"===g.current&&w.current&&(w.current.scrollTop=b.current-t)},C=()=>{if(z.current&&g.current){if("hour"===g.current&&v.current){const e=Math.round(v.current.scrollTop/c);m(e),null==n||n(`${N[e]}:${j[h]}`)}else if("minute"===g.current&&w.current){const e=Math.round(w.current.scrollTop/c);p(e),null==n||n(`${N[u]}:${j[e]}`)}z.current=!1,g.current=null}},$=e=>()=>{if(!z.current)if("hour"===e&&v.current){const e=Math.round(v.current.scrollTop/c);m(e),null==n||n(`${N[e]}:${j[h]}`)}else if("minute"===e&&w.current){const e=Math.round(w.current.scrollTop/c);p(e),null==n||n(`${N[u]}:${j[e]}`)}},S=(e,s,l,r)=>t.jsxs("div",{className:"wz-time-picker-list",ref:l,style:{height:3*c},onTouchStart:y(r),onTouchMove:k,onTouchEnd:C,onScroll:$(r),children:[t.jsx("div",{style:{height:c}}),e.map(((e,l)=>t.jsx("div",{className:"wz-time-picker-item"+(l===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(N,u,v,"hour"),S(j,h,w,"minute")]}),t.jsx("div",{className:"wz-time-picker-mask wz-time-picker-mask-bottom",style:{height:c}})]})},e.Tip=({content:e,className:s,visible:l=!0,onClose:r,action:n,marquee:a=!1})=>{if(!l)return null;const i="wz-tip",c=p(i,s,{[`${i}--marquee`]:a}),o=a?t.jsx("div",{className:`${i}-marquee-box`,children:t.jsx("span",{children:e})}):e;return t.jsxs("div",{className:c,children:[t.jsx("div",{className:`${i}-content`,children:o}),n&&t.jsx("div",{className:`${i}-action`,children:n}),r&&t.jsx("div",{className:`${i}-close`,onClick:r,children:t.jsx(v,{name:"close",size:16})})]})},e.Toast=B,e.Tooltip=({content:e,children:l,className:r,style:n,color:a,textColor:i,trigger:c="click",visible:o,onVisibleChange:d,showMask:u=!1,action:m,closeIcon:h})=>{const[v,w]=s.useState(!1),[x,b]=s.useState({}),[z,g]=s.useState("bottom"),f=s.useRef(null),N=s.useRef(null),j=void 0!==o,y=j?o:v,k=e=>{j||w(e),null==d||d(e)};s.useLayoutEffect((()=>{if(y&&f.current&&N.current){const e=f.current,t=N.current,{width:s,height:l}=e.getBoundingClientRect(),{top:r,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=r+i+d,u+l>o-d&&(h="top",u=r-l-d),u<d&&(h="bottom",u=r+i+d);const p=n+a/2-m;g(h),b({top:`${u}px`,left:`${m}px`,"--wz-tooltip-arrow-left":`${p}px`})}}),[y]);const C=e=>{e.stopPropagation(),k(!1)},$=p("wz-tooltip-bubble",`wz-tooltip-bubble--placement-${z}`,r),S={...n,...x,opacity:x.top?1:0,transition:"opacity 150ms ease-in","--wz-tooltip-bubble-bg":a,color:i},T={onClick:()=>{"click"===c&&k(!y)},ref:N};return t.jsxs(t.Fragment,{children:[s.cloneElement(l,T),(()=>{if(!y)return null;return t.jsxs(t.Fragment,{children:[u&&t.jsx("div",{className:"wz-tooltip-mask",onClick:C}),t.jsxs("div",{className:$,style:S,ref:f,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(!m)return null;const e=m.props.onClick;return t.jsx("div",{className:"wz-tooltip-bubble__action-slot",children:s.cloneElement(m,{onClick:t=>{null==e||e(t),k(!1)}})})})(),h?t.jsx("div",{className:"wz-tooltip-bubble__close-slot",children:s.cloneElement(h,{onClick:C})}):null]})]})]})})()]})},e.useConfig=()=>s.useContext(L),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: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"})}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wz-h5-design",
3
3
  "private": false,
4
- "version": "1.0.3",
4
+ "version": "1.0.5",
5
5
  "description": "一套基于 React 的移动端 H5 组件库",
6
6
  "keywords": [
7
7
  "react",