wz-h5-design 1.0.1 → 1.0.3

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 (60) hide show
  1. package/dist/Button/index.js +24 -3
  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/Card/style/index.css +1 -1
  6. package/dist/Card/style.css +1 -1
  7. package/dist/Cascader/style/index.css +1 -1
  8. package/dist/Cascader/style.css +1 -1
  9. package/dist/Cell/style/index.css +1 -1
  10. package/dist/Cell/style.css +1 -1
  11. package/dist/CheckList/style/index.css +1 -1
  12. package/dist/CheckList/style.css +1 -1
  13. package/dist/Checkbox/style/index.css +1 -1
  14. package/dist/Checkbox/style.css +1 -1
  15. package/dist/Collapse/style/index.css +1 -1
  16. package/dist/Collapse/style.css +1 -1
  17. package/dist/ConfigProvider/index.js +68 -0
  18. package/dist/ConfigProvider/index.umd.cjs +1 -0
  19. package/dist/DateRangePicker/style/index.css +1 -1
  20. package/dist/DateRangePicker/style.css +1 -1
  21. package/dist/Dialog/index.js +24 -3
  22. package/dist/Dialog/index.umd.cjs +2 -2
  23. package/dist/Dialog/style/index.css +1 -1
  24. package/dist/Dialog/style.css +1 -1
  25. package/dist/Divider/style/index.css +1 -1
  26. package/dist/Divider/style.css +1 -1
  27. package/dist/DropDownMenu/style/index.css +1 -1
  28. package/dist/DropDownMenu/style.css +1 -1
  29. package/dist/GridView/style/index.css +1 -1
  30. package/dist/GridView/style.css +1 -1
  31. package/dist/Input/style/index.css +1 -1
  32. package/dist/Input/style.css +1 -1
  33. package/dist/NavBar/style/index.css +1 -1
  34. package/dist/NavBar/style.css +1 -1
  35. package/dist/Radio/style/index.css +1 -1
  36. package/dist/Radio/style.css +1 -1
  37. package/dist/Search/style/index.css +1 -1
  38. package/dist/Search/style.css +1 -1
  39. package/dist/Stepper/style/index.css +1 -1
  40. package/dist/Stepper/style.css +1 -1
  41. package/dist/Switch/style/index.css +1 -1
  42. package/dist/Switch/style.css +1 -1
  43. package/dist/Tabbar/style/index.css +1 -1
  44. package/dist/Tabbar/style.css +1 -1
  45. package/dist/Tabs/style/index.css +1 -1
  46. package/dist/Tabs/style.css +1 -1
  47. package/dist/Tag/style/index.css +1 -1
  48. package/dist/Tag/style.css +1 -1
  49. package/dist/Tip/style/index.css +1 -1
  50. package/dist/Tip/style.css +1 -1
  51. package/dist/Tooltip/style/index.css +1 -1
  52. package/dist/Tooltip/style.css +1 -1
  53. package/dist/style.css +1 -1
  54. package/dist/types/components/Button/Button.d.ts +3 -1
  55. package/dist/types/components/ConfigProvider/ConfigProvider.d.ts +34 -0
  56. package/dist/types/components/ConfigProvider/index.d.ts +5 -0
  57. package/dist/types/components/index.d.ts +4 -1
  58. package/dist/wz-h5-design.es.js +88 -4
  59. package/dist/wz-h5-design.umd.js +2 -2
  60. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import './Button.scss';
3
3
  export interface ButtonProps {
4
- type?: 'primary' | 'outline' | 'cancel' | 'text';
4
+ type?: 'primary' | 'outline' | 'cancel' | 'text' | 'plain';
5
5
  size?: 'small' | 'medium' | 'large';
6
6
  block?: boolean;
7
7
  disabled?: boolean;
@@ -11,6 +11,8 @@ export interface ButtonProps {
11
11
  className?: string;
12
12
  style?: React.CSSProperties;
13
13
  children?: React.ReactNode;
14
+ icon?: React.ReactNode;
15
+ iconPosition?: 'left' | 'right';
14
16
  onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
15
17
  }
16
18
  export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ export type ThemeType = 'default' | 'qitu' | 'wz-c' | 'home' | 'dark';
3
+ export interface ThemeVars {
4
+ primaryColor?: string;
5
+ primaryGradient?: string;
6
+ primaryColorLight?: string;
7
+ primaryColorDark?: string;
8
+ successColor?: string;
9
+ warningColor?: string;
10
+ dangerColor?: string;
11
+ infoColor?: string;
12
+ textColorPrimary?: string;
13
+ textColorRegular?: string;
14
+ textColorSecondary?: string;
15
+ bgColorBase?: string;
16
+ bgColorLight?: string;
17
+ bgColorWhite?: string;
18
+ borderColorBase?: string;
19
+ borderColorLight?: string;
20
+ }
21
+ export interface ConfigProviderProps {
22
+ children: React.ReactNode;
23
+ /** 预设主题 */
24
+ theme?: ThemeType;
25
+ /** 自定义主题变量,优先级高于预设主题 */
26
+ themeVars?: ThemeVars;
27
+ }
28
+ interface ConfigContextValue {
29
+ theme: ThemeType;
30
+ themeVars?: ThemeVars;
31
+ }
32
+ export declare const useConfig: () => ConfigContextValue;
33
+ export declare const ConfigProvider: React.FC<ConfigProviderProps>;
34
+ export default ConfigProvider;
@@ -0,0 +1,5 @@
1
+ import { ConfigProvider, useConfig } from './ConfigProvider';
2
+ import type { ConfigProviderProps, ThemeType, ThemeVars } from './ConfigProvider';
3
+ export { ConfigProvider, useConfig };
4
+ export type { ConfigProviderProps, ThemeType, ThemeVars };
5
+ export default ConfigProvider;
@@ -28,4 +28,7 @@ import { DropdownMenu } from "./DropDownMenu";
28
28
  import { Toast } from "./Toast";
29
29
  import { Tooltip } from "./Tooltip/Tooltip";
30
30
  import { Dialog } from "./Dialog";
31
- export { Button, Radio, Checkbox, Switch, Tabbar, Icon, Card, Cell, Tabs, Collapse, Stepper, Popup, Cascader, Input, Divider, CheckList, Search, TimePicker, DatePicker, DateRangePicker, Flex, Grid, GridView, Tag, Tip, NavBar, DropdownMenu, Toast, Tooltip, Dialog, };
31
+ import { ConfigProvider, useConfig } from "./ConfigProvider";
32
+ import type { ConfigProviderProps, ThemeType, ThemeVars } from "./ConfigProvider";
33
+ export { Button, Radio, Checkbox, Switch, Tabbar, Icon, Card, Cell, Tabs, Collapse, Stepper, Popup, Cascader, Input, Divider, CheckList, Search, TimePicker, DatePicker, DateRangePicker, Flex, Grid, GridView, Tag, Tip, NavBar, DropdownMenu, Toast, Tooltip, Dialog, ConfigProvider, useConfig, };
34
+ export type { ConfigProviderProps, ThemeType, ThemeVars };
@@ -12,12 +12,20 @@ const Button = forwardRef(({
12
12
  className = "",
13
13
  style = {},
14
14
  children,
15
+ icon,
16
+ iconPosition = "left",
15
17
  onClick
16
18
  }, ref) => {
17
19
  const [isActive, setIsActive] = useState(false);
18
20
  const timerRef = useRef(null);
19
21
  const buttonStyle = useMemo(() => {
20
- if (type === "cancel") return style;
22
+ if (type === "cancel") {
23
+ return {
24
+ background: "#D6D6D6",
25
+ color: textColor || "#fff",
26
+ ...style
27
+ };
28
+ }
21
29
  if (type === "outline") {
22
30
  return {
23
31
  color: textColor || "var(--wz-primary-color)",
@@ -35,9 +43,19 @@ const Button = forwardRef(({
35
43
  ...style
36
44
  };
37
45
  }
46
+ if (type === "plain") {
47
+ return {
48
+ color: textColor || "#666666",
49
+ borderColor: borderColor || "#666666",
50
+ background: "transparent",
51
+ ...style
52
+ };
53
+ }
38
54
  if (type === "primary") {
39
55
  let s = { ...style };
40
- s.background = color || "var(--wz-primary-gradient, var(--wz-primary-color))";
56
+ if (!disabled) {
57
+ s.background = color || "var(--wz-primary-gradient, var(--wz-primary-color))";
58
+ }
41
59
  s.color = textColor || "#fff";
42
60
  return s;
43
61
  }
@@ -69,11 +87,14 @@ const Button = forwardRef(({
69
87
  disabled,
70
88
  onClick: handleClick,
71
89
  children: [
90
+ iconPosition === "left" && icon,
72
91
  children,
92
+ iconPosition === "right" && icon,
73
93
  type === "primary" && isActive && /* @__PURE__ */ jsx("span", { className: "wz-button__mask" }),
74
94
  type === "outline" && isActive && /* @__PURE__ */ jsx("span", { className: "wz-button__mask" }),
75
95
  type === "outline" && disabled && /* @__PURE__ */ jsx("span", { className: "wz-button__mask--disabled" }),
76
- type === "cancel" && isActive && /* @__PURE__ */ jsx("span", { className: "wz-button__mask--cancel" })
96
+ type === "cancel" && isActive && /* @__PURE__ */ jsx("span", { className: "wz-button__mask--cancel" }),
97
+ type === "plain" && isActive && /* @__PURE__ */ jsx("span", { className: "wz-button__mask" })
77
98
  ]
78
99
  }
79
100
  );
@@ -2415,6 +2436,67 @@ const confirm = (props) => {
2415
2436
  });
2416
2437
  };
2417
2438
  const Dialog = Object.assign(Dialog$1, { alert, confirm });
2439
+ const ConfigContext = createContext({
2440
+ theme: "default"
2441
+ });
2442
+ const useConfig = () => useContext(ConfigContext);
2443
+ const varNameMap = {
2444
+ primaryColor: "--wz-primary-color",
2445
+ primaryGradient: "--wz-primary-gradient",
2446
+ primaryColorLight: "--wz-primary-color-light",
2447
+ primaryColorDark: "--wz-primary-color-dark",
2448
+ successColor: "--wz-success-color",
2449
+ warningColor: "--wz-warning-color",
2450
+ dangerColor: "--wz-danger-color",
2451
+ infoColor: "--wz-info-color",
2452
+ textColorPrimary: "--wz-text-color-primary",
2453
+ textColorRegular: "--wz-text-color-regular",
2454
+ textColorSecondary: "--wz-text-color-secondary",
2455
+ bgColorBase: "--wz-bg-color-base",
2456
+ bgColorLight: "--wz-bg-color-light",
2457
+ bgColorWhite: "--wz-bg-color-white",
2458
+ borderColorBase: "--wz-border-color-base",
2459
+ borderColorLight: "--wz-border-color-light"
2460
+ };
2461
+ const ConfigProvider = ({
2462
+ children,
2463
+ theme = "default",
2464
+ themeVars
2465
+ }) => {
2466
+ useEffect(() => {
2467
+ const root2 = document.documentElement;
2468
+ if (theme === "default") {
2469
+ root2.removeAttribute("data-theme");
2470
+ } else {
2471
+ root2.setAttribute("data-theme", theme);
2472
+ }
2473
+ if (themeVars) {
2474
+ Object.entries(themeVars).forEach(([key, value]) => {
2475
+ if (value) {
2476
+ const cssVarName = varNameMap[key];
2477
+ if (cssVarName) {
2478
+ root2.style.setProperty(cssVarName, value);
2479
+ }
2480
+ }
2481
+ });
2482
+ }
2483
+ return () => {
2484
+ if (themeVars) {
2485
+ Object.keys(themeVars).forEach((key) => {
2486
+ const cssVarName = varNameMap[key];
2487
+ if (cssVarName) {
2488
+ root2.style.removeProperty(cssVarName);
2489
+ }
2490
+ });
2491
+ }
2492
+ };
2493
+ }, [theme, themeVars]);
2494
+ const contextValue = useMemo(
2495
+ () => ({ theme, themeVars }),
2496
+ [theme, themeVars]
2497
+ );
2498
+ return /* @__PURE__ */ jsx(ConfigContext.Provider, { value: contextValue, children });
2499
+ };
2418
2500
  export {
2419
2501
  Button,
2420
2502
  Card,
@@ -2423,6 +2505,7 @@ export {
2423
2505
  CheckList,
2424
2506
  Checkbox,
2425
2507
  Collapse,
2508
+ ConfigProvider,
2426
2509
  DatePicker,
2427
2510
  DateRangePicker,
2428
2511
  Dialog,
@@ -2445,5 +2528,6 @@ export {
2445
2528
  TimePicker,
2446
2529
  Tip,
2447
2530
  Toast,
2448
- Tooltip
2531
+ Tooltip,
2532
+ useConfig
2449
2533
  };
@@ -1,6 +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:{}};
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:{}};
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 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"})}));
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"})}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wz-h5-design",
3
3
  "private": false,
4
- "version": "1.0.1",
4
+ "version": "1.0.3",
5
5
  "description": "一套基于 React 的移动端 H5 组件库",
6
6
  "keywords": [
7
7
  "react",