wz-h5-design 1.0.0

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 (241) hide show
  1. package/README.md +51 -0
  2. package/dist/Button/index.js +84 -0
  3. package/dist/Button/index.umd.cjs +1 -0
  4. package/dist/Button/style/index.css +1 -0
  5. package/dist/Button/style/index.js +1 -0
  6. package/dist/Button/style.css +1 -0
  7. package/dist/Card/index.js +32 -0
  8. package/dist/Card/index.umd.cjs +1 -0
  9. package/dist/Card/style/index.css +1 -0
  10. package/dist/Card/style/index.js +1 -0
  11. package/dist/Card/style.css +1 -0
  12. package/dist/Cascader/index.js +94 -0
  13. package/dist/Cascader/index.umd.cjs +1 -0
  14. package/dist/Cascader/style/index.css +1 -0
  15. package/dist/Cascader/style/index.js +1 -0
  16. package/dist/Cascader/style.css +1 -0
  17. package/dist/Cell/index.js +135 -0
  18. package/dist/Cell/index.umd.cjs +6 -0
  19. package/dist/Cell/style/index.css +1 -0
  20. package/dist/Cell/style/index.js +1 -0
  21. package/dist/Cell/style.css +1 -0
  22. package/dist/CheckList/index.js +34 -0
  23. package/dist/CheckList/index.umd.cjs +1 -0
  24. package/dist/CheckList/style/index.css +1 -0
  25. package/dist/CheckList/style/index.js +1 -0
  26. package/dist/CheckList/style.css +1 -0
  27. package/dist/Checkbox/index.js +84 -0
  28. package/dist/Checkbox/index.umd.cjs +1 -0
  29. package/dist/Checkbox/style/index.css +1 -0
  30. package/dist/Checkbox/style/index.js +1 -0
  31. package/dist/Checkbox/style.css +1 -0
  32. package/dist/Collapse/index.js +72 -0
  33. package/dist/Collapse/index.umd.cjs +1 -0
  34. package/dist/Collapse/style/index.css +1 -0
  35. package/dist/Collapse/style/index.js +1 -0
  36. package/dist/Collapse/style.css +1 -0
  37. package/dist/DatePicker/index.js +154 -0
  38. package/dist/DatePicker/index.umd.cjs +1 -0
  39. package/dist/DatePicker/style/index.css +1 -0
  40. package/dist/DatePicker/style/index.js +1 -0
  41. package/dist/DatePicker/style.css +1 -0
  42. package/dist/DateRangePicker/index.js +220 -0
  43. package/dist/DateRangePicker/index.umd.cjs +1 -0
  44. package/dist/DateRangePicker/style/index.css +1 -0
  45. package/dist/DateRangePicker/style/index.js +1 -0
  46. package/dist/DateRangePicker/style.css +1 -0
  47. package/dist/Dialog/index.js +216 -0
  48. package/dist/Dialog/index.umd.cjs +6 -0
  49. package/dist/Dialog/style/index.css +1 -0
  50. package/dist/Dialog/style/index.js +1 -0
  51. package/dist/Dialog/style.css +1 -0
  52. package/dist/Divider/index.js +27 -0
  53. package/dist/Divider/index.umd.cjs +1 -0
  54. package/dist/Divider/style/index.css +1 -0
  55. package/dist/Divider/style/index.js +1 -0
  56. package/dist/Divider/style.css +1 -0
  57. package/dist/DropDownMenu/index.js +111 -0
  58. package/dist/DropDownMenu/index.umd.cjs +1 -0
  59. package/dist/DropDownMenu/style/index.css +1 -0
  60. package/dist/DropDownMenu/style/index.js +1 -0
  61. package/dist/DropDownMenu/style.css +1 -0
  62. package/dist/Flex/index.js +85 -0
  63. package/dist/Flex/index.umd.cjs +1 -0
  64. package/dist/Flex/style/index.css +1 -0
  65. package/dist/Flex/style/index.js +1 -0
  66. package/dist/Flex/style.css +1 -0
  67. package/dist/Grid/index.js +54 -0
  68. package/dist/Grid/index.umd.cjs +1 -0
  69. package/dist/Grid/style/index.css +1 -0
  70. package/dist/Grid/style/index.js +1 -0
  71. package/dist/Grid/style.css +1 -0
  72. package/dist/GridView/index.js +90 -0
  73. package/dist/GridView/index.umd.cjs +1 -0
  74. package/dist/GridView/style/index.css +1 -0
  75. package/dist/GridView/style/index.js +1 -0
  76. package/dist/GridView/style.css +1 -0
  77. package/dist/Icon/index.js +31 -0
  78. package/dist/Icon/index.umd.cjs +1 -0
  79. package/dist/Icon/style/index.css +1 -0
  80. package/dist/Icon/style/index.js +1 -0
  81. package/dist/Icon/style.css +1 -0
  82. package/dist/Input/index.js +148 -0
  83. package/dist/Input/index.umd.cjs +1 -0
  84. package/dist/Input/style/index.css +1 -0
  85. package/dist/Input/style/index.js +1 -0
  86. package/dist/Input/style.css +1 -0
  87. package/dist/NavBar/index.js +175 -0
  88. package/dist/NavBar/index.umd.cjs +6 -0
  89. package/dist/NavBar/style/index.css +1 -0
  90. package/dist/NavBar/style/index.js +1 -0
  91. package/dist/NavBar/style.css +1 -0
  92. package/dist/Popup/index.js +124 -0
  93. package/dist/Popup/index.umd.cjs +1 -0
  94. package/dist/Popup/style/index.css +1 -0
  95. package/dist/Popup/style/index.js +1 -0
  96. package/dist/Popup/style.css +1 -0
  97. package/dist/Radio/index.js +82 -0
  98. package/dist/Radio/index.umd.cjs +1 -0
  99. package/dist/Radio/style/index.css +1 -0
  100. package/dist/Radio/style/index.js +1 -0
  101. package/dist/Radio/style.css +1 -0
  102. package/dist/Search/index.js +158 -0
  103. package/dist/Search/index.umd.cjs +1 -0
  104. package/dist/Search/style/index.css +1 -0
  105. package/dist/Search/style/index.js +1 -0
  106. package/dist/Search/style.css +1 -0
  107. package/dist/Stepper/index.js +140 -0
  108. package/dist/Stepper/index.umd.cjs +1 -0
  109. package/dist/Stepper/style/index.css +1 -0
  110. package/dist/Stepper/style/index.js +1 -0
  111. package/dist/Stepper/style.css +1 -0
  112. package/dist/Switch/index.js +53 -0
  113. package/dist/Switch/index.umd.cjs +1 -0
  114. package/dist/Switch/style/index.css +1 -0
  115. package/dist/Switch/style/index.js +1 -0
  116. package/dist/Switch/style.css +1 -0
  117. package/dist/Tabbar/index.js +159 -0
  118. package/dist/Tabbar/index.umd.cjs +6 -0
  119. package/dist/Tabbar/style/index.css +1 -0
  120. package/dist/Tabbar/style/index.js +1 -0
  121. package/dist/Tabbar/style.css +1 -0
  122. package/dist/Tabs/index.js +50 -0
  123. package/dist/Tabs/index.umd.cjs +1 -0
  124. package/dist/Tabs/style/index.css +1 -0
  125. package/dist/Tabs/style/index.js +1 -0
  126. package/dist/Tabs/style.css +1 -0
  127. package/dist/Tag/index.js +96 -0
  128. package/dist/Tag/index.umd.cjs +6 -0
  129. package/dist/Tag/style/index.css +1 -0
  130. package/dist/Tag/style/index.js +1 -0
  131. package/dist/Tag/style.css +1 -0
  132. package/dist/TimePicker/index.js +201 -0
  133. package/dist/TimePicker/index.umd.cjs +1 -0
  134. package/dist/TimePicker/style/index.css +1 -0
  135. package/dist/TimePicker/style/index.js +1 -0
  136. package/dist/TimePicker/style.css +1 -0
  137. package/dist/Tip/index.js +104 -0
  138. package/dist/Tip/index.umd.cjs +6 -0
  139. package/dist/Tip/style/index.css +1 -0
  140. package/dist/Tip/style/index.js +1 -0
  141. package/dist/Tip/style.css +1 -0
  142. package/dist/Toast/index.js +183 -0
  143. package/dist/Toast/index.umd.cjs +6 -0
  144. package/dist/Toast/style/index.css +1 -0
  145. package/dist/Toast/style/index.js +1 -0
  146. package/dist/Toast/style.css +1 -0
  147. package/dist/Tooltip/index.js +172 -0
  148. package/dist/Tooltip/index.umd.cjs +6 -0
  149. package/dist/Tooltip/style/index.css +1 -0
  150. package/dist/Tooltip/style/index.js +1 -0
  151. package/dist/Tooltip/style.css +1 -0
  152. package/dist/assets/fonts/qitu/iconfont.css +140 -0
  153. package/dist/assets/fonts/qitu/iconfont.ttf +0 -0
  154. package/dist/assets/fonts/qitu/iconfont.woff +0 -0
  155. package/dist/assets/fonts/qitu/iconfont.woff2 +0 -0
  156. package/dist/assets/fonts/qituyonghu/iconfont.css +64 -0
  157. package/dist/assets/fonts/qituyonghu/iconfont.ttf +0 -0
  158. package/dist/assets/fonts/qituyonghu/iconfont.woff +0 -0
  159. package/dist/assets/fonts/qituyonghu/iconfont.woff2 +0 -0
  160. package/dist/assets/fonts/wzdaili/iconfont.css +71 -0
  161. package/dist/assets/fonts/wzdaili/iconfont.ttf +0 -0
  162. package/dist/assets/fonts/wzdaili/iconfont.woff +0 -0
  163. package/dist/assets/fonts/wzdaili/iconfont.woff2 +0 -0
  164. package/dist/assets/fonts/wzyonghu/iconfont.css +97 -0
  165. package/dist/assets/fonts/wzyonghu/iconfont.ttf +0 -0
  166. package/dist/assets/fonts/wzyonghu/iconfont.woff +0 -0
  167. package/dist/assets/fonts/wzyonghu/iconfont.woff2 +0 -0
  168. package/dist/assets/fonts/yunying/iconfont.css +303 -0
  169. package/dist/assets/fonts/yunying/iconfont.ttf +0 -0
  170. package/dist/assets/fonts/yunying/iconfont.woff +0 -0
  171. package/dist/assets/fonts/yunying/iconfont.woff2 +0 -0
  172. package/dist/style.css +1 -0
  173. package/dist/types/components/Button/Button.d.ts +16 -0
  174. package/dist/types/components/Button/index.d.ts +5 -0
  175. package/dist/types/components/Card/Card.d.ts +15 -0
  176. package/dist/types/components/Card/index.d.ts +3 -0
  177. package/dist/types/components/Cascader/Cascader.d.ts +14 -0
  178. package/dist/types/components/Cascader/index.d.ts +3 -0
  179. package/dist/types/components/Cell/Cell.d.ts +24 -0
  180. package/dist/types/components/Cell/CellGroup.d.ts +8 -0
  181. package/dist/types/components/Cell/index.d.ts +8 -0
  182. package/dist/types/components/CheckList/CheckList.d.ts +11 -0
  183. package/dist/types/components/CheckList/index.d.ts +3 -0
  184. package/dist/types/components/Checkbox/Checkbox.d.ts +62 -0
  185. package/dist/types/components/Checkbox/index.d.ts +3 -0
  186. package/dist/types/components/Collapse/Collapse.d.ts +17 -0
  187. package/dist/types/components/Collapse/index.d.ts +3 -0
  188. package/dist/types/components/DatePicker/DatePicker.d.ts +13 -0
  189. package/dist/types/components/DatePicker/index.d.ts +3 -0
  190. package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +13 -0
  191. package/dist/types/components/DateRangePicker/index.d.ts +3 -0
  192. package/dist/types/components/Dialog/Dialog.d.ts +16 -0
  193. package/dist/types/components/Dialog/imperative.d.ts +8 -0
  194. package/dist/types/components/Dialog/index.d.ts +8 -0
  195. package/dist/types/components/Divider/Divider.d.ts +11 -0
  196. package/dist/types/components/Divider/index.d.ts +3 -0
  197. package/dist/types/components/DropDownMenu/DropdownMenu.d.ts +19 -0
  198. package/dist/types/components/DropDownMenu/index.d.ts +2 -0
  199. package/dist/types/components/Flex/Flex.d.ts +25 -0
  200. package/dist/types/components/Flex/index.d.ts +3 -0
  201. package/dist/types/components/Grid/Grid.d.ts +22 -0
  202. package/dist/types/components/Grid/index.d.ts +3 -0
  203. package/dist/types/components/GridView/GridView.d.ts +59 -0
  204. package/dist/types/components/GridView/index.d.ts +2 -0
  205. package/dist/types/components/Icon/Icon.d.ts +12 -0
  206. package/dist/types/components/Icon/icon-data.d.ts +42 -0
  207. package/dist/types/components/Icon/index.d.ts +3 -0
  208. package/dist/types/components/Input/Input.d.ts +17 -0
  209. package/dist/types/components/Input/index.d.ts +3 -0
  210. package/dist/types/components/NavBar/NavBar.d.ts +20 -0
  211. package/dist/types/components/NavBar/index.d.ts +3 -0
  212. package/dist/types/components/Popup/Popup.d.ts +23 -0
  213. package/dist/types/components/Popup/index.d.ts +3 -0
  214. package/dist/types/components/Radio/Radio.d.ts +62 -0
  215. package/dist/types/components/Radio/index.d.ts +3 -0
  216. package/dist/types/components/Search/Search.d.ts +26 -0
  217. package/dist/types/components/Search/index.d.ts +3 -0
  218. package/dist/types/components/Stepper/Stepper.d.ts +22 -0
  219. package/dist/types/components/Stepper/index.d.ts +3 -0
  220. package/dist/types/components/Switch/Switch.d.ts +16 -0
  221. package/dist/types/components/Switch/index.d.ts +3 -0
  222. package/dist/types/components/Tabbar/Tabbar.d.ts +39 -0
  223. package/dist/types/components/Tabbar/index.d.ts +3 -0
  224. package/dist/types/components/Tabs/Tabs.d.ts +25 -0
  225. package/dist/types/components/Tabs/index.d.ts +3 -0
  226. package/dist/types/components/Tag/Tag.d.ts +39 -0
  227. package/dist/types/components/Tag/index.d.ts +3 -0
  228. package/dist/types/components/TimePicker/TimePicker.d.ts +12 -0
  229. package/dist/types/components/TimePicker/index.d.ts +3 -0
  230. package/dist/types/components/Tip/Tip.d.ts +32 -0
  231. package/dist/types/components/Tip/index.d.ts +3 -0
  232. package/dist/types/components/Toast/Toast.d.ts +11 -0
  233. package/dist/types/components/Toast/index.d.ts +15 -0
  234. package/dist/types/components/Tooltip/Tooltip.d.ts +17 -0
  235. package/dist/types/components/Tooltip/index.d.ts +3 -0
  236. package/dist/types/components/index.d.ts +31 -0
  237. package/dist/types/index.d.ts +7 -0
  238. package/dist/types/utils/color.d.ts +1 -0
  239. package/dist/wz-h5-design.es.js +2449 -0
  240. package/dist/wz-h5-design.umd.js +6 -0
  241. package/package.json +84 -0
@@ -0,0 +1,6 @@
1
+ !function(e,s){"object"==typeof exports&&"undefined"!=typeof module?s(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"],s):s((e="undefined"!=typeof globalThis?globalThis:e||self)["wz-h5-design"]={},e.jsxRuntime,e.React,e.client)}(this,(function(e,s,t,l){"use strict";const n=t.forwardRef((({type:e="primary",size:l="medium",block:n=!1,disabled:a=!1,color:r="",textColor:i="",borderColor:c="",className:o="",style:d={},children:u,onClick:m},h)=>{const[p,v]=t.useState(!1),w=t.useRef(null),x=t.useMemo((()=>{if("cancel"===e)return 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("primary"===e){let e={...d};return e.background=r||"var(--wz-primary-gradient, var(--wz-primary-color))",e.color=i||"#fff",e}return d}),[e,r,i,c,d]),b=["wz-button",`wz-button--${e}`,`wz-button--${l}`,n?"wz-button--block":"",a?"wz-button--disabled":"",p&&!a?"wz-button--active":"",o].filter(Boolean).join(" ");return s.jsxs("button",{ref:h,type:"button",className:b,style:x,disabled:a,onClick:e=>{a||(v(!0),w.current&&window.clearTimeout(w.current),w.current=window.setTimeout((()=>v(!1)),100),null==m||m(e))},children:[u,"primary"===e&&p&&s.jsx("span",{className:"wz-button__mask"}),"outline"===e&&p&&s.jsx("span",{className:"wz-button__mask"}),"outline"===e&&a&&s.jsx("span",{className:"wz-button__mask--disabled"}),"cancel"===e&&p&&s.jsx("span",{className:"wz-button__mask--cancel"})]})}));n.displayName="Button";const a=t.createContext({}),r=({size:e,checked:l,disabled:n,onChange:r,children:i,value:c,className:o="",style:d,...u})=>{const m=t.useContext(a),h=!!m.value,p=h?m.value===c:l,v=n||m.disabled,w=e||m.size||"medium";return s.jsxs("label",{className:`wz-radio-wrapper ${v?"wz-radio--disabled":""} wz-radio--${w} ${o}`,style:d,children:[s.jsx("input",{type:"radio",className:"wz-radio-input",checked:p,disabled:v,onChange:e=>{var s;n||m.disabled||(h?null==(s=m.onChange)||s.call(m,c):null==r||r(e.target.checked))},value:c,...u}),s.jsx("span",{className:"wz-radio-inner"}),i&&s.jsx("span",{className:"wz-radio-label",children:i})]})},i=({value:e,defaultValue:l,onChange:n,disabled:r,size:i,children:c,className:o="",style:d})=>{const[u,m]=t.useState(l),h={value:void 0!==e?e:u,onChange:e=>{m(e),null==n||n(e)},disabled:r,size:i};return s.jsx(a.Provider,{value:h,children:s.jsx("div",{className:`wz-radio-group ${o}`,style:d,children:c})})};r.Group=i,r.displayName="Radio",i.displayName="Radio.Group";const c=t.createContext({}),o=({size:e,checked:l,disabled:n,onChange:a,children:r,value:i,className:o="",style:d,...u})=>{var m;const h=t.useContext(c),p=!!h.value,v=p?null==(m=h.value)?void 0:m.includes(i):l,w=n||h.disabled,x=e||h.size||"medium";return s.jsxs("label",{className:`wz-checkbox-wrapper ${w?"wz-checkbox--disabled":""} wz-checkbox--${x} ${o}`,style:d,children:[s.jsx("input",{type:"checkbox",className:"wz-checkbox-input",checked:v,disabled:w,onChange:e=>{var s;if(!n&&!h.disabled)if(p){const t=e.target.checked?[...h.value||[],i]:(h.value||[]).filter((e=>e!==i));null==(s=h.onChange)||s.call(h,t)}else null==a||a(e.target.checked)},value:i,...u}),s.jsx("span",{className:"wz-checkbox-inner"}),r&&s.jsx("span",{className:"wz-checkbox-label",children:r})]})},d=({value:e,defaultValue:l,onChange:n,disabled:a,size:r,children:i,className:o="",style:d})=>{const[u,m]=t.useState(l||[]),h={value:void 0!==e?e:u,onChange:e=>{m(e),null==n||n(e)},disabled:a,size:r};return s.jsx(c.Provider,{value:h,children:s.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:{}};
2
+ /*!
3
+ Copyright (c) 2018 Jed Watson.
4
+ Licensed under the MIT License (MIT), see
5
+ http://jedwatson.github.io/classnames
6
+ */m=h,function(){var e={}.hasOwnProperty;function s(){for(var t=[],l=0;l<arguments.length;l++){var n=arguments[l];if(n){var a=typeof n;if("string"===a||"number"===a)t.push(n);else if(Array.isArray(n)){if(n.length){var r=s.apply(null,n);r&&t.push(r)}}else if("object"===a){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){t.push(n.toString());continue}for(var i in n)e.call(n,i)&&n[i]&&t.push(i)}}}return t.join(" ")}m.exports?(s.default=s,m.exports=s):window.classNames=s}();const p=u(h.exports),v=({name:e,size:t=24,color:l="currentColor",className:n="",style:a,onClick:r,type:i="yunying"})=>{const c={fontSize:"number"==typeof t?`${t}px`:t,color:l,...a},o=`iconfont-${i}`,d=`icon-${e}`;return s.jsx("i",{className:`wz-icon ${o} ${d} ${n}`,style:c,onClick:r})},w=e=>{const{title:l,icon:n,activeIcon:a,badge:r,badgeAsBubble:i,hump:c,active:o,onItemClick:d,onClick:u,activeColor:m}=e,h=e=>"string"==typeof e?s.jsx(v,{name:e}):e,w=p("wz-tabbar-item",{"wz-tabbar-item-active":!c&&o,"wz-tabbar-item-hump":c}),x=t.useMemo((()=>{const e={};return o&&m&&(e.color=m),e}),[o,m]);return s.jsxs("div",{className:w,style:x,onClick:c?u:d,children:[s.jsxs("div",{className:"wz-tabbar-item-icon",children:[h(o&&a||n),r?i?s.jsx("div",{className:"wz-tabbar-item-badge-custom",children:s.jsxs("div",{className:"wz-tabbar-item-badge-bubble",children:[r,s.jsx("div",{className:"wz-tabbar-item-badge-bubble-arrow"})]})}):t.isValidElement(r)?s.jsx("div",{className:"wz-tabbar-item-badge-custom",children:r}):s.jsx("div",{className:"wz-tabbar-item-badge",children:r}):null]}),s.jsx("div",{className:"wz-tabbar-item-title",children:l})]})},x=e=>{const{title:t,label:l,value:n,icon:a,arrow:r=!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 s.jsxs("div",{className:N,style:m,onClick:o?void 0:g,children:[a?s.jsx("div",{className:"wz-cell-icon",children:a}):null,s.jsxs("div",{className:"wz-cell-content",children:[t?s.jsxs("div",{className:p("wz-cell-title",v),style:h,children:[d&&s.jsx("span",{className:"wz-cell-required",children:"*"}),t,n&&s.jsx("span",{className:p("wz-cell-value",z),style:b,children:n})]}):null,l?s.jsx("div",{className:p("wz-cell-label",x),style:w,children:l}):null]}),null,f&&s.jsx("div",{className:"wz-cell-extra",children:f}),r?s.jsx("div",{className:"wz-cell-arrow"}):null]})};x.Group=e=>{const{className:t,style:l,children:n}=e;return s.jsx("div",{className:p("wz-cell-group",t),style:l,children:n})};const b=({type:e="line",value:l,defaultValue:n=0,onChange:a,className:r="",style:i,headerClassName:c="",headerStyle:o,contentClassName:d="",contentStyle:u,children:m})=>{const h=void 0!==l,[p,v]=t.useState(n),w=h?l:p,x=t.Children.toArray(m).filter(Boolean);return s.jsxs("div",{className:`wz-tabs wz-tabs-${e} ${r}`,style:i,children:[s.jsx("div",{className:`wz-tabs-header ${c}`,style:o,children:x.map(((t,l)=>s.jsxs("div",{className:`wz-tabs-tab${l===w?" wz-tabs-tab-active":""}${t.props.disabled?" wz-tabs-tab-disabled":""}`,onClick:()=>((e,s)=>{s||(h||v(e),null==a||a(e))})(l,t.props.disabled),children:[s.jsxs("div",{className:"wz-tabs-tab-text",children:[t.props.title,t.props.badge&&s.jsx("div",{className:"wz-tabs-badge",children:t.props.badge})]}),l===w&&"line"===e&&s.jsx("div",{className:"wz-tabs-underline"})]},l)))}),s.jsx("div",{className:`wz-tabs-content ${d}`,style:u,children:x[w]})]})};b.TabPane=({children:e})=>s.jsx(s.Fragment,{children:e});const z=t.forwardRef((({clearable:e=!1,align:l="center",value:n,defaultValue:a,onChange:r,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!==n,[N,j]=t.useState(a||""),y=e&&!!(f?n:N),[k,C]=t.useState(!1),$=e=>{f||j(e.target.value),null==r||r(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?n:N,R=(null==_?void 0:_.toString().length)||0,E=m&&R>m;return s.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?s.jsxs(s.Fragment,{children:[s.jsx("textarea",{ref:g,className:`wz-input ${c}`,value:_,onChange:$,style:{...T,resize:"none"},rows:u,maxLength:m,...z}),d&&m&&s.jsxs("div",{className:"wz-input-count "+(E?"wz-input-count-exceeded":""),style:h,children:[R,"/",m]})]}):s.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&&s.jsx("span",{className:"wz-input-clear",onClick:()=>{f||j("");const e={...z,target:{value:""}};null==r||r(e)},children:s.jsx(v,{name:"close",size:22})}),"password"===o&&!p&&s.jsx("span",{className:"wz-input-password",onClick:()=>{C(!k)},children:s.jsx(v,{name:k?"eyes-close":"eyes-open",size:22})}),p&&s.jsxs("div",{className:"wz-input-suffix",children:[s.jsx("span",{className:"wz-input-suffix-divider"}),p]})]})}));z.displayName="Input";const g=t.forwardRef((({value:e,defaultValue:l,placeholder:n="输入关键词搜索",shape:a="round",clearable:r=!0,disabled:i=!1,prefix:c,suffix:o,leftIcon:d=s.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]=t.useState(l||""),[T,_]=t.useState(!1),R=t.useRef(null);t.useImperativeHandle(k,(()=>R.current));const E=C?e:$,M=r&&E&&T&&!i,D=()=>{var e;i||(null==(e=R.current)||e.blur(),null==b||b(E))},I=()=>{_(!1),null==j||j()},A={...w,backgroundColor:p};return s.jsxs("div",{className:`wz-search ${T?"wz-search-focused":""} ${x}`,style:A,children:[c&&s.jsx("div",{className:"wz-search-prefix",children:c}),!c&&m&&T?s.jsx("div",{className:"wz-search-cancel",onClick:I,children:h}):null,s.jsxs("div",{className:`wz-search-content wz-search-shape-${a} ${i?"wz-search-disabled":""}`,children:[s.jsxs("div",{className:"wz-search-input-wrapper "+(M?"wz-search-input-wrapper--with-clear":""),children:[d&&s.jsx("div",{className:"wz-search-left-icon",children:d}),s.jsx("input",{ref:R,className:"wz-search-input",value:E,onChange:e=>{const s=e.target.value;C||S(s),null==g||g(s)},onFocus:e=>{_(!0),null==f||f(e)},onBlur:e=>{_(!1),null==N||N(e)},onKeyDown:e=>{"Enter"!==e.key||i||D()},placeholder:n,disabled:i,...y}),M&&s.jsx("div",{className:"wz-search-clear",onMouseDown:e=>{var s;e.preventDefault(),C||S(""),null==g||g(""),null==z||z(),null==(s=R.current)||s.focus()},children:s.jsx(v,{name:"close",size:16,color:"#BDBDBD"})})]}),u&&s.jsxs("div",{className:"wz-search-action",onClick:D,children:[s.jsx("div",{className:"wz-search-divider"}),s.jsx("div",{className:"wz-search-action-text",children:u})]})]}),o&&s.jsx("div",{className:"wz-search-suffix",children:o})]})}));g.displayName="Search";const f=Array.from({length:24},((e,s)=>`${s+1}小时`)),N=Array.from({length:24},((e,s)=>s.toString().padStart(2,"0"))),j=Array.from({length:60},((e,s)=>s.toString().padStart(2,"0"))),y=({value:e,onChange:l,min:n="1970-01-01",max:a="2100-12-31",columns:r=["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(n.split("-")[0]),v=Number(a.split("-")[0]),w=t.useMemo((()=>((e,s)=>{const t=[];for(let l=e;l<=s;l++)t.push(l.toString());return t})(p,v)),[p,v]),[x,b]=t.useState(u),[z,g]=t.useState(m),[f,N]=t.useState(h),j=Array.from({length:12},((e,s)=>(s+1).toString().padStart(2,"0"))),y=((e,s)=>{const t=new Date(e,s,0).getDate();return Array.from({length:t},((e,s)=>(s+1).toString().padStart(2,"0")))})(x,z),k=t.useRef(null),C=t.useRef(null),$=t.useRef(null),S=t.useRef(0),T=t.useRef(0),_=t.useRef(!1),R=t.useRef(null);t.useLayoutEffect((()=>{k.current&&k.current.scrollTo({top:(x-p)*i,behavior:"auto"})}),[x,i,p]),t.useLayoutEffect((()=>{C.current&&C.current.scrollTo({top:(z-1)*i,behavior:"auto"})}),[z,i]),t.useLayoutEffect((()=>{$.current&&$.current.scrollTo({top:(f-1)*i,behavior:"auto"})}),[f,i]);const E=e=>s=>{var t,l,n;_.current=!0,R.current=e,S.current=s.touches[0].clientY;let a=0;"year"===e&&(a=(null==(t=k.current)?void 0:t.scrollTop)||0),"month"===e&&(a=(null==(l=C.current)?void 0:l.scrollTop)||0),"day"===e&&(a=(null==(n=$.current)?void 0:n.scrollTop)||0),T.current=a},M=e=>{if(!_.current||!R.current)return;const s=e.touches[0].clientY-S.current;"year"===R.current&&k.current&&(k.current.scrollTop=T.current-s),"month"===R.current&&C.current&&(C.current.scrollTop=T.current-s),"day"===R.current&&$.current&&($.current.scrollTop=T.current-s)},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}},I=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]}`)}}};t.useEffect((()=>{if(e){const[s,t,l]=e.split("-").map(Number);b(s),g(t),N(l),k.current&&k.current.scrollTo({top:(s-p)*i,behavior:"auto"}),C.current&&C.current.scrollTo({top:(t-1)*i,behavior:"auto"}),$.current&&$.current.scrollTo({top:(l-1)*i,behavior:"auto"})}}),[e]);const A=(e,t,l,n)=>s.jsxs("div",{className:"wz-date-picker-list",ref:l,style:{height:3*i},onTouchStart:E(n),onTouchMove:M,onTouchEnd:D,onScroll:I(n),children:[s.jsx("div",{style:{height:i}}),e.map(((e,l)=>s.jsx("div",{className:"wz-date-picker-item"+(l===t?" active":""),style:{height:i},children:"year"===n?`${e}年`:"month"===n?`${e}月`:`${e}日`},e))),s.jsx("div",{style:{height:i}})]});return s.jsxs("div",{className:`wz-date-picker ${c}`,style:o,children:[s.jsx("div",{className:"wz-date-picker-mask wz-date-picker-mask-top",style:{height:i}}),s.jsx("div",{className:"wz-date-picker-indicator",style:{height:i}}),s.jsxs("div",{className:"wz-date-picker-columns",children:[r.includes("year")&&A(w,x-p,k,"year"),r.includes("month")&&A(j,z-1,C,"month"),r.includes("day")&&A(y,f-1,$,"day")]}),s.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:t="stretch",justify:l="start",wrap:n="nowrap",gap:a=0,className:r="",style:i={},children:c})=>{const o={display:"flex",flexDirection:e,alignItems:k[t],justifyContent:C[l],flexWrap:n,gap:"number"==typeof a?`${a}px`:a,...i};return s.jsx("div",{className:"wz-flex"+(r?" "+r:""),style:o,children:c})};$.Item=({span:e,order:t,offset:l,className:n="",style:a={},children:r})=>{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:t,marginLeft:void 0!==l?100*l+"%":void 0,...a};return s.jsx("div",{className:"wz-flex-item"+(n?" "+n:""),style:i,children:r})};const S=t.createContext(24),T=({cols:e=24,gap:t=0,className:l="",style:n={},children:a})=>{const r={display:"flex",flexWrap:"wrap",gap:"number"==typeof t?`${t}px`:t,...n};return s.jsx(S.Provider,{value:e,children:s.jsx("div",{className:"wz-grid"+(l?" "+l:""),style:r,children:a})})};T.Item=({span:e=1,offset:l=0,order:n,className:a="",style:r={},children:i})=>{const c=t.useContext(S);process.env.NODE_ENV;const o=e/c*100+"%",d=l?l/c*100+"%":void 0;return s.jsx("div",{className:"wz-grid-item"+(a?" "+a:""),style:{width:o,marginLeft:d,order:n,...r},children:i})};const _=({columns:e=4,gap:t=0,square:l=!0,className:n="",style:a={},children:r,noBg:i=!1,rounded:c=!1,shadow:o=!1,horizontal:d=!1})=>{const u={gridTemplateColumns:`repeat(${e}, 1fr)`,gap:"number"==typeof t?`${t}px`:t,...a},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":"",n].filter(Boolean).join(" ");return s.jsx("div",{className:m,style:u,children:r})};_.Item=({icon:e,text:t,description:l,badge:n,corner:a,onClick:r,className:i="",style:c={},disabled:o=!1,children:d,horizontal:u=!1,compact:m=!1,backgroundImage:h,backgroundStyle:p={}})=>{const v=()=>{!o&&r&&r()},w=["wz-grid-view-item",o?"wz-grid-view-item--disabled":"",r?"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?s.jsxs("div",{className:w,style:x,onClick:v,children:[a&&s.jsx("div",{className:"wz-grid-view-item__corner",children:a}),d,n&&s.jsx("div",{className:"wz-grid-view-item__badge",children:n})]}):s.jsxs("div",{className:w,style:x,onClick:v,children:[a&&s.jsx("div",{className:"wz-grid-view-item__corner",children:a}),s.jsxs("div",{className:"wz-grid-view-item__content",children:[e&&s.jsx("div",{className:"wz-grid-view-item__icon",children:e}),s.jsxs("div",{className:"wz-grid-view-item__text",children:[t&&s.jsx("div",{className:"wz-grid-view-item__title",children:t}),l&&s.jsx("div",{className:"wz-grid-view-item__desc",children:l})]})]}),n&&s.jsx("div",{className:"wz-grid-view-item__badge",children:n})]})};const R=({content:e,duration:l=2e3,icon:n,visible:a=!1,onClose:r})=>{const[i,c]=t.useState(a);t.useEffect((()=>{let e;return c(a),a&&l>0&&(e=setTimeout((()=>{c(!1),null==r||r()}),l)),()=>{clearTimeout(e)}}),[a,l,r]);const o=p("wz-toast",{"wz-toast-visible":i}),d=p("wz-toast-icon");return s.jsx("div",{className:o,children:s.jsxs("div",{className:"wz-toast-content",children:[n&&s.jsx("div",{className:d,children:n}),s.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)},I=e=>{M||(M=document.createElement("div"),document.body.appendChild(M),E=l.createRoot(M)),E.render(s.jsx(R,{...e}))},A={show:e=>{I({..."string"==typeof e?{content:e}:e,visible:!0,onClose:D})},success:(e,t)=>{I({content:e,duration:t,icon:s.jsx(v,{name:"check-round",size:37.14}),visible:!0,onClose:D})},fail:(e,t)=>{I({content:e,duration:t,icon:s.jsx(v,{name:"close",size:37.14}),visible:!0,onClose:D})},loading:(e,t)=>{I({content:e,duration:t,icon:s.jsx(v,{name:"loading",size:37.14}),visible:!0,onClose:D})},warn:(e,t)=>{I({content:e,duration:t,icon:s.jsx(v,{name:"info",size:37.14}),visible:!0,onClose:D})},hide:()=>{I({content:"",visible:!1}),D()}},F=({visible:e,title:t,content:l,onClose:a,actions:r,closeOnAction:i,closeOnMaskClick:c})=>s.jsxs("div",{className:p("wz-dialog-root",{visible:e}),children:[s.jsx("div",{className:"wz-dialog-mask",onClick:()=>{c&&(null==a||a())}}),s.jsxs("div",{className:"wz-dialog-wrap",children:[t&&s.jsx("div",{className:"wz-dialog-header",children:s.jsx("div",{className:"wz-dialog-title",children:t})}),s.jsx("div",{className:"wz-dialog-content",children:l}),s.jsx("div",{className:"wz-dialog-footer",children:null==r?void 0:r.map((e=>s.jsx(n,{className:"wz-dialog-button",onClick:()=>{return null==(s=e.onClick)||s(),void(i&&(null==a||a()));var s},children:e.text},e.key)))})]})]}),B=e=>{const t=document.createElement("div");document.body.appendChild(t);const n=l.createRoot(t);n.render(s.jsx(F,{...e,visible:!0,onClose:()=>{n.unmount(),document.body.removeChild(t)}}))},O=Object.assign(F,{alert:e=>{B({...e,closeOnAction:!0,actions:[{key:"confirm",text:"确定",onClick:e.onConfirm}]})},confirm:e=>{B({...e,closeOnAction:!0,actions:[{key:"cancel",text:"取消",onClick:e.onCancel},{key:"confirm",text:"确定",onClick:e.onConfirm}]})}});e.Button=n,e.Card=({title:e,extra:t,cover:l,actions:n,bordered:a,noDivider:r=!1,className:i="",style:c,children:o,onClick:d})=>{const u=["wz-card",void 0!==a?"wz-card-bordered":"",r?"wz-card-no-divider":"",i].filter(Boolean).join(" ");return s.jsxs("div",{className:u,style:c,onClick:d,children:[l&&s.jsx("div",{className:"wz-card-cover",children:l}),(e||t)&&s.jsxs("div",{className:"wz-card-header",children:[e&&s.jsx("div",{className:"wz-card-title",children:e}),t&&s.jsx("div",{className:"wz-card-extra",children:t})]}),s.jsx("div",{className:"wz-card-body",children:o}),n&&n.length>0&&s.jsx("div",{className:"wz-card-actions",children:n.map(((e,t)=>s.jsx("div",{className:"wz-card-action",children:e},t)))})]})},e.Cascader=({value:e,onChange:l,data:n})=>{const[a,r]=t.useState(e||[]),[i,c]=t.useState(Math.min((e||[]).length,2));t.useEffect((()=>{void 0!==e&&(r(e),c(Math.min(e.length,2)))}),[e]);const o=t.useMemo((()=>{if(0===i)return n;let e=n;for(let s=0;s<i;s++){const t=e.find((e=>e.value===a[s]));e=(null==t?void 0:t.children)||[]}return e}),[n,i,a]),d=t.useMemo((()=>{let e=n;const s=["请选择","请选择","请选择"];return a.map(((t,l)=>{const n=e.find((e=>e.value===t));return e=(null==n?void 0:n.children)||[],(null==n?void 0:n.label)||s[l]}))}),[n,a]);return s.jsxs("div",{className:"wz-cascader",children:[s.jsx("div",{className:"wz-cascader-levels",children:["省","市","区"].map(((e,t)=>t>0&&a.length<t?null:s.jsx("div",{className:`\n wz-cascader-level \n ${i===t?"active":""}\n ${a[t]?"selected":""}\n `,onClick:()=>{var e;(e=t)<=a.length&&c(e)},children:a[t]?d[t]:"请选择"},e)))}),s.jsx("div",{className:"wz-cascader-content",children:s.jsx("div",{className:"wz-cascader-options",children:o.map((e=>s.jsxs("div",{className:`\n wz-cascader-option \n ${a.includes(e.value)?"selected":""}\n ${e.disabled?"disabled":""}\n `,onClick:()=>(e=>{if(e.disabled)return;const s=[...a];s[i]=e.value,s.length=i+1,r(s),0===i&&e.children?c(1):1===i&&e.children?c(2):2===i&&(null==l||l(s))})(e),children:[e.label,e.disabled&&s.jsx("span",{className:"wz-cascader-option-tip",children:"不可选"})]},e.value)))})})]})},e.Cell=x,e.CheckList=({options:e,value:t,onChange:l,multiple:n=!1,style:a,className:r=""})=>{const i=e=>n&&Array.isArray(t)?t.includes(e):t===e;return s.jsx("div",{className:`wz-check-list ${r}`,style:a,children:e.map((e=>s.jsxs("div",{className:"wz-check-list__item"+(i(e)?" wz-check-list__item--active":""),onClick:()=>(e=>{if(n){if(!Array.isArray(t))return;t.includes(e)?l(t.filter((s=>s!==e))):l([...t,e])}else l(e)})(e),children:[s.jsx("span",{className:"wz-check-list__label",children:e}),i(e)&&s.jsx("span",{className:"wz-check-list__icon",children:"✔"})]},e)))})},e.Checkbox=o,e.Collapse=({title:e,extra:l,children:n,defaultExpanded:a=!1,expanded:r,onChange:i,style:c,className:o="",headerStyle:d,headerClassName:u="",contentStyle:m,contentClassName:h=""})=>{const[p,v]=t.useState(a),w=void 0!==r,x=w?r:p;return s.jsxs("div",{className:"wz-collapse"+(o?" "+o:""),style:c,children:[s.jsxs("div",{className:`wz-collapse-header ${u}`,onClick:()=>{w||v(!x),null==i||i(!x)},style:d,children:[s.jsx("div",{className:"wz-collapse-title",children:e}),s.jsx("div",{className:"wz-collapse-extra",onClick:e=>e.stopPropagation(),children:l}),s.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:s.jsx("polyline",{points:"7,5 13,10 7,15",fill:"none",stroke:"#888",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),s.jsx("div",{className:`wz-collapse-content${x?" expanded":""} ${h}`,style:m,children:n})]})},e.DatePicker=y,e.DateRangePicker=({value:e,onChange:l,min:n="1970-01-01",max:a="2100-12-31",startLabel:r="开始时间",endLabel:i="结束时间",className:c="",style:o})=>{const d=t.useMemo((()=>{const e=new Date;return`${e.getFullYear()}-${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")}`}),[]),[u,m]=t.useState(e||[d,d]),h=e||u,[p,v]=t.useState("start");return s.jsxs("div",{className:`wz-date-range-picker ${c}`,style:o,children:[s.jsxs("div",{className:"wz-date-range-picker-label-row",children:[s.jsx("div",{className:"wz-date-range-picker-label",children:r}),s.jsx("div",{className:"wz-date-range-picker-label",children:i})]}),s.jsxs("div",{className:"wz-date-range-picker-row",children:[s.jsx("div",{className:"wz-date-range-picker-col",children:s.jsx("div",{className:"wz-date-range-picker-value"+("start"===p?" active":""),onClick:()=>v("start"),children:h[0]||"请选择"})}),s.jsx("div",{className:"wz-date-range-picker-sep",children:"至"}),s.jsx("div",{className:"wz-date-range-picker-col",children:s.jsx("div",{className:"wz-date-range-picker-value"+("end"===p?" active":""),onClick:()=>v("end"),children:h[1]||"请选择"})})]}),s.jsx("div",{className:"wz-date-range-picker-picker",children:s.jsx(y,{value:"start"===p?h[0]:h[1],onChange:e=>{if("start"===p){const s=[e,h[1]&&h[1]>=e?h[1]:e];m(s),null==l||l(s)}else{const s=[h[0],e&&e>=h[0]?e:h[0]];m(s),null==l||l(s)}},min:n,max:a})})]})},e.Dialog=O,e.Divider=({direction:e="horizontal",color:t="#eee",length:l,margin:n,style:a,className:r=""})=>{const i="vertical"===e;return s.jsx("div",{className:`wz-divider wz-divider--${e} ${r}`,style:{background:t,width:i?1:l||"100%",height:i?l||24:1,margin:n,...a}})},e.DropdownMenu=({items:e,extension:l,onChange:n,value:a,defaultValue:r={}})=>{const[i,c]=t.useState(null),[o,d]=t.useState(r);t.useEffect((()=>{void 0!==a&&d(a)}),[a]);const u=void 0!==a,m=()=>u?a:o,h=s=>{const t=m()[s];if(void 0===t)return e[s].title;const l=e[s].options.find((e=>e.value===t));return l?l.text:e[s].title};return s.jsxs("div",{className:"wz-dropdown-menu-wrapper",children:[s.jsxs("div",{className:"wz-dropdown-menu",children:[e.map(((e,t)=>s.jsxs("div",{className:"wz-dropdown-item "+(i===t?"active":""),onClick:()=>(e=>{c(i===e?null:e)})(t),children:[s.jsx("span",{children:h(t)}),e.icon||s.jsx(v,{name:"dropdown",size:12})]},t))),l&&s.jsx("div",{className:"wz-dropdown-extension",children:l})]}),null!==i&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"wz-dropdown-mask",onClick:()=>{c(null)}}),s.jsx("div",{className:"wz-dropdown-popup",children:e[i].options.map((e=>s.jsx("div",{className:"wz-dropdown-option "+(m()[i]===e.value?"selected":""),onClick:()=>((e,s)=>{const t={...m(),[e]:s};u||d(t),c(null),n&&n(e,s,t)})(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:n,rightText:a,onLeftClick:r,onRightClick:i,leftSlot:c,rightSlot:o,titleSlot:d,className:u,style:m,fixed:h=!1,scrollFixed:w=!1})=>{const[x,b]=t.useState(h),z=t.useRef(null),g=t.useRef(null);t.useEffect((()=>{if(!1===w)return void b(h);const e="number"==typeof w?w:0,s=()=>{const s=window.pageYOffset||document.documentElement.scrollTop;b(s>e)};return window.addEventListener("scroll",s),s(),()=>{window.removeEventListener("scroll",s)}}),[w,h]);const f=()=>{r&&r()},N=()=>{i&&i()},j=p("wz-navbar",{"wz-navbar-fixed":x},u);return s.jsxs(s.Fragment,{children:[x&&s.jsx("div",{ref:g,style:{height:"44px"}}),s.jsxs("div",{ref:z,className:j,style:m,children:[c?s.jsx("div",{className:"wz-navbar-left",children:c}):s.jsxs("div",{className:"wz-navbar-left",onClick:f,children:[l&&s.jsx(v,{name:"right-arrow",size:20,style:{transform:"scaleX(-1)"},className:"wz-navbar-icon"}),n&&s.jsx("span",{className:"wz-navbar-text",children:n})]}),d?s.jsx("div",{className:"wz-navbar-title",children:d}):s.jsx("div",{className:"wz-navbar-title",children:e}),o?s.jsx("div",{className:"wz-navbar-right",children:o}):s.jsxs("div",{className:"wz-navbar-right",onClick:N,children:[a&&s.jsx("span",{className:"wz-navbar-text",children:a}),!a&&s.jsx(v,{name:"more-h",className:"wz-navbar-icon"})]})]})]})},e.Popup=({visible:e=!1,position:l="bottom",mask:n=!0,maskClosable:a=!0,round:r=!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]=t.useState(e),[f,N]=t.useState(!1),[j,y]=t.useState(e);t.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:s.jsxs("div",{className:"wz-popup-container "+(z?"wz-popup--display":""),style:{zIndex:c},children:[n&&s.jsx("div",{className:"wz-popup-mask "+(j?"wz-popup-mask--active":""),style:S,onClick:()=>{a&&!f&&(null==p||p())}}),s.jsxs("div",{className:`\n wz-popup \n wz-popup--${l} \n ${j?"wz-popup--active":""} \n ${r?"wz-popup--round":""}\n ${d}\n `,style:$,children:[x&&s.jsx("div",{className:"wz-popup-close",onClick:()=>{f||null==p||p()},children:s.jsx("span",{className:"wz-popup-close-icon",children:"×"})}),b&&s.jsx("div",{className:"wz-popup-title",children:b}),h]})]})},e.Radio=r,e.Search=g,e.Stepper=({value:e,min:l=-1/0,max:n=1/0,step:a=1,onChange:r,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]=t.useState(String(e)),[N,j]=t.useState(!1);t.useEffect((()=>{N||f(String(e))}),[e,N]);const y=i||Number(e)<=l,k=i||Number(e)>=n;return s.jsxs("div",{className:`wz-stepper ${h}`,style:p,children:[d&&s.jsx("button",{className:`wz-stepper-btn wz-stepper-btn-minus ${z}`,onClick:()=>{if(i)return;let s=Number(e)-a;s<l&&(s=l),s=void 0!==m?parseFloat(s.toFixed(m)):s,r(s),f(String(s))},disabled:y,type:"button",style:b,children:s.jsx(v,{name:"jian",type:"yunying",size:21})}),s.jsxs("div",{className:"wz-stepper-input-wrapper",children:[c&&s.jsx("span",{className:"wz-stepper-prefix",children:c}),s.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 s=Number(g);isNaN(s)?f(String(e)):(s>n&&(s=n),s<l&&(s=l),s=void 0!==m?parseFloat(s.toFixed(m)):s,r(s),f(String(s)))},disabled:i,style:w}),o&&s.jsx("span",{className:"wz-stepper-suffix",children:o})]}),u&&s.jsx("button",{className:`wz-stepper-btn wz-stepper-btn-plus ${z}`,onClick:()=>{if(i)return;let s=Number(e)+a;s>n&&(s=n),s=void 0!==m?parseFloat(s.toFixed(m)):s,r(s),f(String(s))},disabled:k,type:"button",style:b,children:s.jsx(v,{name:"jia",type:"yunying",size:21})})]})},e.Switch=({value:e,defaultValue:l=!1,onChange:n,disabled:a=!1,showText:r=!0,activeText:i="",inactiveText:c="",style:o,className:d="",size:u="default",activeColor:m})=>{const[h,p]=t.useState(l),v=void 0!==e,w=v?e:h,x=w?i||"开启":c||"关闭",b=r?12*x.length+8+"px":"0px",z="large"===u?62:60,g=`${r?12*x.length+40:z}px`,f=m?(m.includes("gradient"),m):void 0,N=w&&m?{background:f}:{};return s.jsxs("div",{className:`wz-switch-bg ${w?"wz-switch-on":"wz-switch-off"}${a?" wz-switch-disabled":""}${d?" "+d:""} wz-switch-${u}`,style:{width:g,minWidth:`${z}px`,...o,...N},onClick:()=>{a||(v||p(!w),null==n||n(!w))},children:[r&&s.jsx("span",{className:"wz-switch-text",style:{width:b},children:x}),s.jsx("div",{className:"wz-switch-slider "+(w?"wz-switch-slider-on":"wz-switch-slider-off")})]})},e.Tabbar=e=>{var l;const{activeKey:n,defaultActiveKey:a,onChange:r,items:i,fixed:c=!0,className:o,style:d}=e,[u,m]=t.useState(n??a??(null==(l=null==i?void 0:i[0])?void 0:l.key));t.useEffect((()=>{void 0!==n&&m(n)}),[n]);const h=p("wz-tabbar",{"wz-tabbar-fixed":c},o);return s.jsx("div",{className:h,style:d,children:i.map((e=>t.createElement(w,{...e,key:e.key,active:!e.hump&&u===e.key,onItemClick:()=>{return s=e.key,void 0===n&&m(s),void(null==r||r(s));var s}})))})},e.Tabs=b,e.Tag=e=>{const{type:l="solid",size:n="large",color:a,bgColor:r,fontWeight:i,className:c,style:o,children:d}=e,u=p("wz-tag",`wz-tag-${l}`,`wz-tag-${n}`,c),m=t.useMemo((()=>{const e={...o};return a&&(e.color=a,"line"===l&&(e.borderColor=function(e,s){let t=e.replace("#","");return 3===t.length&&(t=t.split("").map((e=>e+e)).join("")),`rgba(${parseInt(t.substring(0,2),16)}, ${parseInt(t.substring(2,4),16)}, ${parseInt(t.substring(4,6),16)}, ${s})`}(a,.5))),r&&"solid"===l&&(e.backgroundColor=r),i&&(e.fontWeight=i),e}),[l,a,r,i,o]);return s.jsx("div",{className:u,style:m,children:d})},e.TimePicker=({type:e="single",options:l,value:n,onChange:a,className:r="",style:i,itemHeight:c=48})=>{if("single"===e){const e=l&&l.length>0?l:f,[o,d]=t.useState((()=>{const s=n?e.indexOf(n):0;return s>=0?s:0})),u=t.useRef(null),m=t.useRef(0),h=t.useRef(0),p=t.useRef(!1);t.useEffect((()=>{n&&e.includes(n)&&d(e.indexOf(n))}),[n,e]),t.useEffect((()=>{u.current&&u.current.scrollTo({top:o*c,behavior:"smooth"})}),[o,c]);const v=e=>{var s;p.current=!0,m.current=e.touches[0].clientY,h.current=(null==(s=u.current)?void 0:s.scrollTop)||0},w=e=>{if(!p.current)return;const s=e.touches[0].clientY-m.current;u.current&&(u.current.scrollTop=h.current-s)},x=()=>{if(p.current=!1,!u.current)return;const s=Math.round(u.current.scrollTop/c);d(s),null==a||a(e[s])},b=()=>{if(!p.current&&u.current){const s=Math.round(u.current.scrollTop/c);d(s),null==a||a(e[s])}},z=e=>e===o;return s.jsxs("div",{className:`wz-time-picker ${r}`,style:i,children:[s.jsx("div",{className:"wz-time-picker-mask wz-time-picker-mask-top",style:{height:c}}),s.jsx("div",{className:"wz-time-picker-indicator",style:{height:c}}),s.jsxs("div",{className:"wz-time-picker-list",ref:u,style:{height:3*c},onTouchStart:v,onTouchMove:w,onTouchEnd:x,onScroll:b,children:[s.jsx("div",{style:{height:c}}),e.map(((e,t)=>s.jsx("div",{className:"wz-time-picker-item"+(z(t)?" active":""),style:{height:c},children:e},e))),s.jsx("div",{style:{height:c}})]}),s.jsx("div",{className:"wz-time-picker-mask wz-time-picker-mask-bottom",style:{height:c}})]})}const[o,d]=n?n.split(":"):[N[0],j[0]],[u,m]=t.useState(N.indexOf(o)),[h,p]=t.useState(j.indexOf(d)),v=t.useRef(null),w=t.useRef(null),x=t.useRef(0),b=t.useRef(0),z=t.useRef(!1),g=t.useRef(null);t.useEffect((()=>{v.current&&v.current.scrollTo({top:u*c,behavior:"smooth"})}),[u,c]),t.useEffect((()=>{w.current&&w.current.scrollTo({top:h*c,behavior:"smooth"})}),[h,c]);const y=e=>s=>{var t,l;z.current=!0,g.current=e,x.current=s.touches[0].clientY,b.current=("hour"===e?null==(t=v.current)?void 0:t.scrollTop:null==(l=w.current)?void 0:l.scrollTop)||0},k=e=>{if(!z.current||!g.current)return;const s=e.touches[0].clientY-x.current;"hour"===g.current&&v.current?v.current.scrollTop=b.current-s:"minute"===g.current&&w.current&&(w.current.scrollTop=b.current-s)},C=()=>{if(z.current&&g.current){if("hour"===g.current&&v.current){const e=Math.round(v.current.scrollTop/c);m(e),null==a||a(`${N[e]}:${j[h]}`)}else if("minute"===g.current&&w.current){const e=Math.round(w.current.scrollTop/c);p(e),null==a||a(`${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==a||a(`${N[e]}:${j[h]}`)}else if("minute"===e&&w.current){const e=Math.round(w.current.scrollTop/c);p(e),null==a||a(`${N[u]}:${j[e]}`)}},S=(e,t,l,n)=>s.jsxs("div",{className:"wz-time-picker-list",ref:l,style:{height:3*c},onTouchStart:y(n),onTouchMove:k,onTouchEnd:C,onScroll:$(n),children:[s.jsx("div",{style:{height:c}}),e.map(((e,l)=>s.jsx("div",{className:"wz-time-picker-item"+(l===t?" active":""),style:{height:c},children:e},e))),s.jsx("div",{style:{height:c}})]});return s.jsxs("div",{className:`wz-time-picker wz-time-picker-double ${r}`,style:i,children:[s.jsx("div",{className:"wz-time-picker-mask wz-time-picker-mask-top",style:{height:c}}),s.jsx("div",{className:"wz-time-picker-indicator",style:{height:c}}),s.jsxs("div",{className:"wz-time-picker-double-columns",children:[S(N,u,v,"hour"),S(j,h,w,"minute")]}),s.jsx("div",{className:"wz-time-picker-mask wz-time-picker-mask-bottom",style:{height:c}})]})},e.Tip=({content:e,className:t,visible:l=!0,onClose:n,action:a,marquee:r=!1})=>{if(!l)return null;const i="wz-tip",c=p(i,t,{[`${i}--marquee`]:r}),o=r?s.jsx("div",{className:`${i}-marquee-box`,children:s.jsx("span",{children:e})}):e;return s.jsxs("div",{className:c,children:[s.jsx("div",{className:`${i}-content`,children:o}),a&&s.jsx("div",{className:`${i}-action`,children:a}),n&&s.jsx("div",{className:`${i}-close`,onClick:n,children:s.jsx(v,{name:"close",size:16})})]})},e.Toast=A,e.Tooltip=({content:e,children:l,className:n,style:a,color:r,textColor:i,trigger:c="click",visible:o,onVisibleChange:d,showMask:u=!1,action:m,closeIcon:h})=>{const[v,w]=t.useState(!1),[x,b]=t.useState({}),[z,g]=t.useState("bottom"),f=t.useRef(null),N=t.useRef(null),j=void 0!==o,y=j?o:v,k=e=>{j||w(e),null==d||d(e)};t.useLayoutEffect((()=>{if(y&&f.current&&N.current){const e=f.current,s=N.current,{width:t,height:l}=e.getBoundingClientRect(),{top:n,left:a,width:r,height:i}=s.getBoundingClientRect(),{innerWidth:c,innerHeight:o}=window,d=8;let u,m=a+r/2-t/2,h="bottom";m<d&&(m=d),m+t>c-d&&(m=c-t-d),u=n+i+d,u+l>o-d&&(h="top",u=n-l-d),u<d&&(h="bottom",u=n+i+d);const p=a+r/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}`,n),S={...a,...x,opacity:x.top?1:0,transition:"opacity 150ms ease-in","--wz-tooltip-bubble-bg":r,color:i},T={onClick:()=>{"click"===c&&k(!y)},ref:N};return s.jsxs(s.Fragment,{children:[t.cloneElement(l,T),(()=>{if(!y)return null;return s.jsxs(s.Fragment,{children:[u&&s.jsx("div",{className:"wz-tooltip-mask",onClick:C}),s.jsxs("div",{className:$,style:S,ref:f,children:[s.jsx("div",{className:"wz-tooltip-bubble__arrow"}),s.jsxs("div",{className:"wz-tooltip-bubble__inner",children:[s.jsx("div",{className:"wz-tooltip-bubble__body",children:e}),(()=>{if(!m)return null;const e=m.props.onClick;return s.jsx("div",{className:"wz-tooltip-bubble__action-slot",children:t.cloneElement(m,{onClick:s=>{null==e||e(s),k(!1)}})})})(),h?s.jsx("div",{className:"wz-tooltip-bubble__close-slot",children:t.cloneElement(h,{onClick:C})}):null]})]})]})})()]})},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
package/package.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "name": "wz-h5-design",
3
+ "private": false,
4
+ "version": "1.0.0",
5
+ "description": "一套基于 React 的移动端 H5 组件库",
6
+ "keywords": [
7
+ "react",
8
+ "mobile",
9
+ "h5",
10
+ "ui",
11
+ "components",
12
+ "react-components",
13
+ "mobile-ui",
14
+ "design-system"
15
+ ],
16
+ "author": "huwei",
17
+ "license": "MIT",
18
+ "homepage": "https://dev-ui-h5.wanzhuangkj.com",
19
+ "repository": {
20
+ "type": "gitlab",
21
+ "url": "https://gitlab.wanzhuangkj.com/huwei/wz-ui-h5"
22
+ },
23
+ "engines": {
24
+ "node": ">=16.0.0"
25
+ },
26
+ "type": "module",
27
+ "scripts": {
28
+ "dev": "vite",
29
+ "build": "tsc && vite build",
30
+ "build:types": "tsc --project tsconfig.build.json",
31
+ "build:lib": "node scripts/build.mjs",
32
+ "extract-icons": "node scripts/extract-icons.mjs",
33
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
34
+ "preview": "vite preview",
35
+ "docs:dev": "dumi dev",
36
+ "docs:build": "dumi build",
37
+ "docs:preview": "dumi preview",
38
+ "test": "vitest",
39
+ "test:coverage": "vitest run --coverage"
40
+ },
41
+ "peerDependencies": {
42
+ "react": ">=18.0.0",
43
+ "react-dom": ">=18.0.0"
44
+ },
45
+ "devDependencies": {
46
+ "react": "^18.2.0",
47
+ "react-dom": "^18.2.0",
48
+ "@testing-library/jest-dom": "^6.9.1",
49
+ "@testing-library/react": "^16.3.0",
50
+ "@testing-library/user-event": "^14.6.1",
51
+ "@types/react": "^18.2.64",
52
+ "@types/react-dom": "^18.2.21",
53
+ "@typescript-eslint/eslint-plugin": "^7.1.1",
54
+ "@typescript-eslint/parser": "^7.1.1",
55
+ "@vitejs/plugin-react": "^4.2.1",
56
+ "@vitejs/plugin-react-swc": "^3.5.0",
57
+ "@vitest/coverage-v8": "^1.6.1",
58
+ "dumi": "^2.0.0",
59
+ "dumi-theme-mobile": "^2.3.5",
60
+ "eslint": "^8.57.0",
61
+ "eslint-config-prettier": "^9.1.0",
62
+ "eslint-plugin-react-hooks": "^4.6.0",
63
+ "eslint-plugin-react-refresh": "^0.4.5",
64
+ "fs-extra": "^11.3.0",
65
+ "jsdom": "^27.2.0",
66
+ "sass": "^1.89.0",
67
+ "vite": "^5.1.6",
68
+ "vitest": "^1.0.0"
69
+ },
70
+ "main": "dist/wz-h5-design.umd.js",
71
+ "module": "dist/wz-h5-design.es.js",
72
+ "types": "dist/types/index.d.ts",
73
+ "files": [
74
+ "dist"
75
+ ],
76
+ "sideEffects": [
77
+ "**/*.css",
78
+ "**/*.scss"
79
+ ],
80
+ "publishConfig": {
81
+ "access": "public",
82
+ "registry": "https://registry.npmjs.org/"
83
+ }
84
+ }