wz-h5-design 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,11 +24,19 @@ const Button = forwardRef(({
24
24
  if (value === void 0) return void 0;
25
25
  return typeof value === "number" ? `${value}px` : value;
26
26
  };
27
+ const calcBorderRadius = () => {
28
+ if (height !== void 0) {
29
+ const h = typeof height === "number" ? height : parseFloat(height);
30
+ if (!isNaN(h)) return `${h / 2}px`;
31
+ }
32
+ return void 0;
33
+ };
27
34
  const buttonStyle = useMemo(() => {
28
35
  const customStyle = {
29
36
  width: formatSize(width),
30
37
  height: formatSize(height),
31
- fontSize: formatSize(fontSize)
38
+ fontSize: formatSize(fontSize),
39
+ borderRadius: calcBorderRadius()
32
40
  };
33
41
  if (type === "cancel") {
34
42
  return {
@@ -60,7 +68,7 @@ const Button = forwardRef(({
60
68
  if (type === "plain") {
61
69
  return {
62
70
  color: textColor || "#666666",
63
- borderColor: borderColor || "#666666",
71
+ borderColor: borderColor || "rgba(102, 102, 102, 0.2)",
64
72
  background: "transparent",
65
73
  ...style,
66
74
  ...customStyle
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react/jsx-runtime"),require("react")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Button={},e.jsxRuntime,e.React)}(this,(function(e,t,o){"use strict";const r=o.forwardRef((({type:e="primary",size:r="medium",block:n=!1,disabled:a=!1,color:i="",textColor:l="",borderColor:s="",width:u,height:c,fontSize:d,className:f="",style:b={},children:m,icon:p,iconPosition:w="left",onClick:y},z)=>{const[x,k]=o.useState(!1),g=o.useRef(null),h=e=>{if(void 0!==e)return"number"==typeof e?`${e}px`:e},j=o.useMemo((()=>{const t={width:h(u),height:h(c),fontSize:h(d)};if("cancel"===e)return{background:"#D6D6D6",color:l||"#fff",...b,...t};if("outline"===e)return{color:l||"var(--wz-primary-color)",borderColor:s||"var(--wz-primary-color)",background:"transparent",...b,...t};if("text"===e)return{color:l||b.color||"var(--wz-primary-color, #22C94D)",background:"transparent",border:"none",boxShadow:"none",...b,...t};if("plain"===e)return{color:l||"#666666",borderColor:s||"#666666",background:"transparent",...b,...t};if("primary"===e){let e={...b};return a||(e.background=i||"var(--wz-primary-gradient, var(--wz-primary-color))"),e.color=l||"#fff",{...e,...t}}return{...b,...t}}),[e,i,l,s,u,c,d,b]),_=["wz-button",`wz-button--${e}`,`wz-button--${r}`,n?"wz-button--block":"",a?"wz-button--disabled":"",x&&!a?"wz-button--active":"",f].filter(Boolean).join(" ");return t.jsxs("button",{ref:z,type:"button",className:_,style:j,disabled:a,onClick:e=>{a||(k(!0),g.current&&window.clearTimeout(g.current),g.current=window.setTimeout((()=>k(!1)),100),null==y||y(e))},children:["left"===w&&p,m,"right"===w&&p,"primary"===e&&x&&t.jsx("span",{className:"wz-button__mask"}),"outline"===e&&x&&t.jsx("span",{className:"wz-button__mask"}),"outline"===e&&a&&t.jsx("span",{className:"wz-button__mask--disabled"}),"cancel"===e&&x&&t.jsx("span",{className:"wz-button__mask--cancel"}),"plain"===e&&x&&t.jsx("span",{className:"wz-button__mask"})]})}));r.displayName="Button",e.Button=r,e.default=r,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react/jsx-runtime"),require("react")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Button={},e.jsxRuntime,e.React)}(this,(function(e,t,r){"use strict";const o=r.forwardRef((({type:e="primary",size:o="medium",block:n=!1,disabled:a=!1,color:i="",textColor:s="",borderColor:l="",width:u,height:c,fontSize:d,className:f="",style:b={},children:m,icon:p,iconPosition:w="left",onClick:y},z)=>{const[x,g]=r.useState(!1),k=r.useRef(null),h=e=>{if(void 0!==e)return"number"==typeof e?`${e}px`:e},j=()=>{if(void 0!==c){const e="number"==typeof c?c:parseFloat(c);if(!isNaN(e))return e/2+"px"}},_=r.useMemo((()=>{const t={width:h(u),height:h(c),fontSize:h(d),borderRadius:j()};if("cancel"===e)return{background:"#D6D6D6",color:s||"#fff",...b,...t};if("outline"===e)return{color:s||"var(--wz-primary-color)",borderColor:l||"var(--wz-primary-color)",background:"transparent",...b,...t};if("text"===e)return{color:s||b.color||"var(--wz-primary-color, #22C94D)",background:"transparent",border:"none",boxShadow:"none",...b,...t};if("plain"===e)return{color:s||"#666666",borderColor:l||"rgba(102, 102, 102, 0.2)",background:"transparent",...b,...t};if("primary"===e){let e={...b};return a||(e.background=i||"var(--wz-primary-gradient, var(--wz-primary-color))"),e.color=s||"#fff",{...e,...t}}return{...b,...t}}),[e,i,s,l,u,c,d,b]),v=["wz-button",`wz-button--${e}`,`wz-button--${o}`,n?"wz-button--block":"",a?"wz-button--disabled":"",x&&!a?"wz-button--active":"",f].filter(Boolean).join(" ");return t.jsxs("button",{ref:z,type:"button",className:v,style:_,disabled:a,onClick:e=>{a||(g(!0),k.current&&window.clearTimeout(k.current),k.current=window.setTimeout((()=>g(!1)),100),null==y||y(e))},children:["left"===w&&p,m,"right"===w&&p,"primary"===e&&x&&t.jsx("span",{className:"wz-button__mask"}),"outline"===e&&x&&t.jsx("span",{className:"wz-button__mask"}),"outline"===e&&a&&t.jsx("span",{className:"wz-button__mask--disabled"}),"cancel"===e&&x&&t.jsx("span",{className:"wz-button__mask--cancel"}),"plain"===e&&x&&t.jsx("span",{className:"wz-button__mask"})]})}));o.displayName="Button",e.Button=o,e.default=o,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
@@ -1 +1 @@
1
- .wz-button{box-sizing:border-box;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;outline:none;justify-content:center;align-items:center;gap:5px;font-family:"Alibaba PuHuiTi 2.0";font-weight:600;transition:all .2s;display:inline-flex;position:relative;overflow:hidden}.wz-button--primary{color:var(--wz-text-color-white,#fff);background:var(--wz-primary-gradient);border:none}.wz-button--primary.wz-button--disabled{color:#fff;background-color:#d6d6d6}.wz-button--outline{color:var(--wz-primary-color,#22c94d);border:1px solid var(--wz-primary-color,#22c94d);background:0 0}.wz-button--plain{color:#666;background:0 0;border:1px solid #666}.wz-button--plain.wz-button--disabled{opacity:.5;background:#fff!important;border:1px solid #ccc!important}.wz-button--cancel{color:#fff;background:#c0c4cc;border:none}.wz-button--block{width:100%;display:flex}.wz-button--large{border-radius:23px;height:46px;padding:10px 20px;font-size:18px;line-height:26px}.wz-button--medium{border-radius:23px;height:30px;padding:4px 16px;font-size:14px;line-height:22px}.wz-button--small{border-radius:13px;height:26px;padding:3px 10px;font-size:13px;line-height:20px}.wz-button--disabled{cursor:not-allowed;opacity:.8}.wz-button--active{opacity:.6}.wz-button__mask{pointer-events:none;border-radius:inherit;z-index:1;background:#00000014;width:100%;height:100%;position:absolute;top:0;left:0}.wz-button__mask--disabled{pointer-events:none;border-radius:inherit;z-index:10;background:#ffffff80;width:100%;height:100%;position:absolute;top:0;left:0}.wz-button__mask--cancel{pointer-events:none;border-radius:inherit;z-index:10;background:#0000000f;width:100%;height:100%;position:absolute;top:0;left:0}.wz-button--text{color:var(--wz-primary-color,#22c94d);box-shadow:none;background:0 0;border:none;height:auto;padding:0 8px;transition:color .2s}.wz-button--text:active{color:var(--wz-primary-color-dark,#179a38);background:var(--wz-bg-color-base,#f5f7f9)}.wz-button--disabled.wz-button--text{color:var(--wz-disabled-color,#c0c4cc);background:0 0}
1
+ .wz-button{box-sizing:border-box;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;outline:none;justify-content:center;align-items:center;gap:5px;font-family:"Alibaba PuHuiTi 2.0";font-weight:600;transition:all .2s;display:inline-flex;position:relative;overflow:hidden}.wz-button--primary{color:var(--wz-text-color-white,#fff);background:var(--wz-primary-gradient);border:none}.wz-button--primary.wz-button--disabled{color:#fff;background-color:#d6d6d6}.wz-button--outline{color:var(--wz-primary-color,#22c94d);border:1px solid var(--wz-primary-color,#22c94d);background:0 0}.wz-button--plain{color:#666;background:0 0;border:1px solid #6663}.wz-button--plain.wz-button--disabled{opacity:.5;background:#fff!important;border:1px solid #6663!important}.wz-button--cancel{color:#fff;background:#c0c4cc;border:none}.wz-button--block{width:100%;display:flex}.wz-button--large{border-radius:23px;height:46px;padding:10px 20px;font-size:18px;line-height:26px}.wz-button--medium{border-radius:23px;height:30px;padding:4px 16px;font-size:14px;line-height:22px}.wz-button--small{border-radius:13px;height:26px;padding:3px 10px;font-size:13px;line-height:20px}.wz-button--disabled{cursor:not-allowed;opacity:.8}.wz-button--active{opacity:.6}.wz-button__mask{pointer-events:none;border-radius:inherit;z-index:1;background:#00000014;width:100%;height:100%;position:absolute;top:0;left:0}.wz-button__mask--disabled{pointer-events:none;border-radius:inherit;z-index:10;background:#ffffff80;width:100%;height:100%;position:absolute;top:0;left:0}.wz-button__mask--cancel{pointer-events:none;border-radius:inherit;z-index:10;background:#0000000f;width:100%;height:100%;position:absolute;top:0;left:0}.wz-button--text{color:var(--wz-primary-color,#22c94d);box-shadow:none;background:0 0;border:none;height:auto;padding:0 8px;transition:color .2s}.wz-button--text:active{color:var(--wz-primary-color-dark,#179a38);background:var(--wz-bg-color-base,#f5f7f9)}.wz-button--disabled.wz-button--text{color:var(--wz-disabled-color,#c0c4cc);opacity:.4;background:0 0}
@@ -1 +1 @@
1
- .wz-button{box-sizing:border-box;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;outline:none;justify-content:center;align-items:center;gap:5px;font-family:"Alibaba PuHuiTi 2.0";font-weight:600;transition:all .2s;display:inline-flex;position:relative;overflow:hidden}.wz-button--primary{color:var(--wz-text-color-white,#fff);background:var(--wz-primary-gradient);border:none}.wz-button--primary.wz-button--disabled{color:#fff;background-color:#d6d6d6}.wz-button--outline{color:var(--wz-primary-color,#22c94d);border:1px solid var(--wz-primary-color,#22c94d);background:0 0}.wz-button--plain{color:#666;background:0 0;border:1px solid #666}.wz-button--plain.wz-button--disabled{opacity:.5;background:#fff!important;border:1px solid #ccc!important}.wz-button--cancel{color:#fff;background:#c0c4cc;border:none}.wz-button--block{width:100%;display:flex}.wz-button--large{border-radius:23px;height:46px;padding:10px 20px;font-size:18px;line-height:26px}.wz-button--medium{border-radius:23px;height:30px;padding:4px 16px;font-size:14px;line-height:22px}.wz-button--small{border-radius:13px;height:26px;padding:3px 10px;font-size:13px;line-height:20px}.wz-button--disabled{cursor:not-allowed;opacity:.8}.wz-button--active{opacity:.6}.wz-button__mask{pointer-events:none;border-radius:inherit;z-index:1;background:#00000014;width:100%;height:100%;position:absolute;top:0;left:0}.wz-button__mask--disabled{pointer-events:none;border-radius:inherit;z-index:10;background:#ffffff80;width:100%;height:100%;position:absolute;top:0;left:0}.wz-button__mask--cancel{pointer-events:none;border-radius:inherit;z-index:10;background:#0000000f;width:100%;height:100%;position:absolute;top:0;left:0}.wz-button--text{color:var(--wz-primary-color,#22c94d);box-shadow:none;background:0 0;border:none;height:auto;padding:0 8px;transition:color .2s}.wz-button--text:active{color:var(--wz-primary-color-dark,#179a38);background:var(--wz-bg-color-base,#f5f7f9)}.wz-button--disabled.wz-button--text{color:var(--wz-disabled-color,#c0c4cc);background:0 0}
1
+ .wz-button{box-sizing:border-box;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;outline:none;justify-content:center;align-items:center;gap:5px;font-family:"Alibaba PuHuiTi 2.0";font-weight:600;transition:all .2s;display:inline-flex;position:relative;overflow:hidden}.wz-button--primary{color:var(--wz-text-color-white,#fff);background:var(--wz-primary-gradient);border:none}.wz-button--primary.wz-button--disabled{color:#fff;background-color:#d6d6d6}.wz-button--outline{color:var(--wz-primary-color,#22c94d);border:1px solid var(--wz-primary-color,#22c94d);background:0 0}.wz-button--plain{color:#666;background:0 0;border:1px solid #6663}.wz-button--plain.wz-button--disabled{opacity:.5;background:#fff!important;border:1px solid #6663!important}.wz-button--cancel{color:#fff;background:#c0c4cc;border:none}.wz-button--block{width:100%;display:flex}.wz-button--large{border-radius:23px;height:46px;padding:10px 20px;font-size:18px;line-height:26px}.wz-button--medium{border-radius:23px;height:30px;padding:4px 16px;font-size:14px;line-height:22px}.wz-button--small{border-radius:13px;height:26px;padding:3px 10px;font-size:13px;line-height:20px}.wz-button--disabled{cursor:not-allowed;opacity:.8}.wz-button--active{opacity:.6}.wz-button__mask{pointer-events:none;border-radius:inherit;z-index:1;background:#00000014;width:100%;height:100%;position:absolute;top:0;left:0}.wz-button__mask--disabled{pointer-events:none;border-radius:inherit;z-index:10;background:#ffffff80;width:100%;height:100%;position:absolute;top:0;left:0}.wz-button__mask--cancel{pointer-events:none;border-radius:inherit;z-index:10;background:#0000000f;width:100%;height:100%;position:absolute;top:0;left:0}.wz-button--text{color:var(--wz-primary-color,#22c94d);box-shadow:none;background:0 0;border:none;height:auto;padding:0 8px;transition:color .2s}.wz-button--text:active{color:var(--wz-primary-color-dark,#179a38);background:var(--wz-bg-color-base,#f5f7f9)}.wz-button--disabled.wz-button--text{color:var(--wz-disabled-color,#c0c4cc);opacity:.4;background:0 0}
@@ -76,11 +76,19 @@ const Button = forwardRef(({
76
76
  if (value === void 0) return void 0;
77
77
  return typeof value === "number" ? `${value}px` : value;
78
78
  };
79
+ const calcBorderRadius = () => {
80
+ if (height !== void 0) {
81
+ const h = typeof height === "number" ? height : parseFloat(height);
82
+ if (!isNaN(h)) return `${h / 2}px`;
83
+ }
84
+ return void 0;
85
+ };
79
86
  const buttonStyle = useMemo(() => {
80
87
  const customStyle = {
81
88
  width: formatSize(width),
82
89
  height: formatSize(height),
83
- fontSize: formatSize(fontSize)
90
+ fontSize: formatSize(fontSize),
91
+ borderRadius: calcBorderRadius()
84
92
  };
85
93
  if (type === "cancel") {
86
94
  return {
@@ -112,7 +120,7 @@ const Button = forwardRef(({
112
120
  if (type === "plain") {
113
121
  return {
114
122
  color: textColor || "#666666",
115
- borderColor: borderColor || "#666666",
123
+ borderColor: borderColor || "rgba(102, 102, 102, 0.2)",
116
124
  background: "transparent",
117
125
  ...style,
118
126
  ...customStyle
@@ -3,4 +3,4 @@
3
3
  Copyright (c) 2018 Jed Watson.
4
4
  Licensed under the MIT License (MIT), see
5
5
  http://jedwatson.github.io/classnames
6
- */i=a,function(){var e={}.hasOwnProperty;function o(){for(var t=[],n=0;n<arguments.length;n++){var r=arguments[n];if(r){var i=typeof r;if("string"===i||"number"===i)t.push(r);else if(Array.isArray(r)){if(r.length){var a=o.apply(null,r);a&&t.push(a)}}else if("object"===i){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){t.push(r.toString());continue}for(var l in r)e.call(r,l)&&r[l]&&t.push(l)}}}return t.join(" ")}i.exports?(o.default=o,i.exports=o):window.classNames=o}();const l=r(a.exports),s=t.forwardRef((({type:e="primary",size:n="medium",block:r=!1,disabled:i=!1,color:a="",textColor:l="",borderColor:s="",width:c,height:u,fontSize:d,className:m="",style:f={},children:p,icon:b,iconPosition:w="left",onClick:y},x)=>{const[g,h]=t.useState(!1),v=t.useRef(null),k=e=>{if(void 0!==e)return"number"==typeof e?`${e}px`:e},z=t.useMemo((()=>{const o={width:k(c),height:k(u),fontSize:k(d)};if("cancel"===e)return{background:"#D6D6D6",color:l||"#fff",...f,...o};if("outline"===e)return{color:l||"var(--wz-primary-color)",borderColor:s||"var(--wz-primary-color)",background:"transparent",...f,...o};if("text"===e)return{color:l||f.color||"var(--wz-primary-color, #22C94D)",background:"transparent",border:"none",boxShadow:"none",...f,...o};if("plain"===e)return{color:l||"#666666",borderColor:s||"#666666",background:"transparent",...f,...o};if("primary"===e){let e={...f};return i||(e.background=a||"var(--wz-primary-gradient, var(--wz-primary-color))"),e.color=l||"#fff",{...e,...o}}return{...f,...o}}),[e,a,l,s,c,u,d,f]),j=["wz-button",`wz-button--${e}`,`wz-button--${n}`,r?"wz-button--block":"",i?"wz-button--disabled":"",g&&!i?"wz-button--active":"",m].filter(Boolean).join(" ");return o.jsxs("button",{ref:x,type:"button",className:j,style:z,disabled:i,onClick:e=>{i||(h(!0),v.current&&window.clearTimeout(v.current),v.current=window.setTimeout((()=>h(!1)),100),null==y||y(e))},children:["left"===w&&b,p,"right"===w&&b,"primary"===e&&g&&o.jsx("span",{className:"wz-button__mask"}),"outline"===e&&g&&o.jsx("span",{className:"wz-button__mask"}),"outline"===e&&i&&o.jsx("span",{className:"wz-button__mask--disabled"}),"cancel"===e&&g&&o.jsx("span",{className:"wz-button__mask--cancel"}),"plain"===e&&g&&o.jsx("span",{className:"wz-button__mask"})]})}));s.displayName="Button";const c=({visible:e,title:t,content:n,onClose:r,actions:i,closeOnAction:a,closeOnMaskClick:c})=>o.jsxs("div",{className:l("wz-dialog-root",{visible:e}),children:[o.jsx("div",{className:"wz-dialog-mask",onClick:()=>{c&&(null==r||r())}}),o.jsxs("div",{className:"wz-dialog-wrap",children:[t&&o.jsx("div",{className:"wz-dialog-header",children:o.jsx("div",{className:"wz-dialog-title",children:t})}),o.jsx("div",{className:"wz-dialog-content",children:n}),o.jsx("div",{className:"wz-dialog-footer",children:null==i?void 0:i.map((e=>o.jsx(s,{className:"wz-dialog-button",onClick:()=>{return null==(o=e.onClick)||o(),void(a&&(null==r||r()));var o},children:e.text},e.key)))})]})]}),u=e=>{const t=document.createElement("div");document.body.appendChild(t);const r=n.createRoot(t);r.render(o.jsx(c,{...e,visible:!0,onClose:()=>{r.unmount(),document.body.removeChild(t)}}))},d=e=>{u({...e,closeOnAction:!0,actions:[{key:"confirm",text:"确定",onClick:e.onConfirm}]})},m=e=>{u({...e,closeOnAction:!0,actions:[{key:"cancel",text:"取消",onClick:e.onCancel},{key:"confirm",text:"确定",onClick:e.onConfirm}]})},f=Object.assign(c,{alert:d,confirm:m});e.Dialog=f,e.alert=d,e.confirm=m,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
6
+ */i=a,function(){var e={}.hasOwnProperty;function o(){for(var t=[],n=0;n<arguments.length;n++){var r=arguments[n];if(r){var i=typeof r;if("string"===i||"number"===i)t.push(r);else if(Array.isArray(r)){if(r.length){var a=o.apply(null,r);a&&t.push(a)}}else if("object"===i){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){t.push(r.toString());continue}for(var l in r)e.call(r,l)&&r[l]&&t.push(l)}}}return t.join(" ")}i.exports?(o.default=o,i.exports=o):window.classNames=o}();const l=r(a.exports),s=t.forwardRef((({type:e="primary",size:n="medium",block:r=!1,disabled:i=!1,color:a="",textColor:l="",borderColor:s="",width:c,height:u,fontSize:d,className:f="",style:m={},children:p,icon:b,iconPosition:w="left",onClick:y},x)=>{const[g,v]=t.useState(!1),h=t.useRef(null),k=e=>{if(void 0!==e)return"number"==typeof e?`${e}px`:e},z=()=>{if(void 0!==u){const e="number"==typeof u?u:parseFloat(u);if(!isNaN(e))return e/2+"px"}},j=t.useMemo((()=>{const o={width:k(c),height:k(u),fontSize:k(d),borderRadius:z()};if("cancel"===e)return{background:"#D6D6D6",color:l||"#fff",...m,...o};if("outline"===e)return{color:l||"var(--wz-primary-color)",borderColor:s||"var(--wz-primary-color)",background:"transparent",...m,...o};if("text"===e)return{color:l||m.color||"var(--wz-primary-color, #22C94D)",background:"transparent",border:"none",boxShadow:"none",...m,...o};if("plain"===e)return{color:l||"#666666",borderColor:s||"rgba(102, 102, 102, 0.2)",background:"transparent",...m,...o};if("primary"===e){let e={...m};return i||(e.background=a||"var(--wz-primary-gradient, var(--wz-primary-color))"),e.color=l||"#fff",{...e,...o}}return{...m,...o}}),[e,a,l,s,c,u,d,m]),C=["wz-button",`wz-button--${e}`,`wz-button--${n}`,r?"wz-button--block":"",i?"wz-button--disabled":"",g&&!i?"wz-button--active":"",f].filter(Boolean).join(" ");return o.jsxs("button",{ref:x,type:"button",className:C,style:j,disabled:i,onClick:e=>{i||(v(!0),h.current&&window.clearTimeout(h.current),h.current=window.setTimeout((()=>v(!1)),100),null==y||y(e))},children:["left"===w&&b,p,"right"===w&&b,"primary"===e&&g&&o.jsx("span",{className:"wz-button__mask"}),"outline"===e&&g&&o.jsx("span",{className:"wz-button__mask"}),"outline"===e&&i&&o.jsx("span",{className:"wz-button__mask--disabled"}),"cancel"===e&&g&&o.jsx("span",{className:"wz-button__mask--cancel"}),"plain"===e&&g&&o.jsx("span",{className:"wz-button__mask"})]})}));s.displayName="Button";const c=({visible:e,title:t,content:n,onClose:r,actions:i,closeOnAction:a,closeOnMaskClick:c})=>o.jsxs("div",{className:l("wz-dialog-root",{visible:e}),children:[o.jsx("div",{className:"wz-dialog-mask",onClick:()=>{c&&(null==r||r())}}),o.jsxs("div",{className:"wz-dialog-wrap",children:[t&&o.jsx("div",{className:"wz-dialog-header",children:o.jsx("div",{className:"wz-dialog-title",children:t})}),o.jsx("div",{className:"wz-dialog-content",children:n}),o.jsx("div",{className:"wz-dialog-footer",children:null==i?void 0:i.map((e=>o.jsx(s,{className:"wz-dialog-button",onClick:()=>{return null==(o=e.onClick)||o(),void(a&&(null==r||r()));var o},children:e.text},e.key)))})]})]}),u=e=>{const t=document.createElement("div");document.body.appendChild(t);const r=n.createRoot(t);r.render(o.jsx(c,{...e,visible:!0,onClose:()=>{r.unmount(),document.body.removeChild(t)}}))},d=e=>{u({...e,closeOnAction:!0,actions:[{key:"confirm",text:"确定",onClick:e.onConfirm}]})},f=e=>{u({...e,closeOnAction:!0,actions:[{key:"cancel",text:"取消",onClick:e.onCancel},{key:"confirm",text:"确定",onClick:e.onConfirm}]})},m=Object.assign(c,{alert:d,confirm:f});e.Dialog=m,e.alert=d,e.confirm=f,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
@@ -1 +1 @@
1
- .wz-dialog-root{z-index:1000;visibility:hidden;opacity:0;justify-content:center;align-items:center;width:100%;height:100%;transition:all .3s;display:flex;position:fixed;top:0;left:0}.wz-dialog-root.visible{visibility:visible;opacity:1}.wz-dialog-mask{background-color:#0006;width:100%;height:100%;position:absolute;top:0;left:0}.wz-dialog-wrap{background-color:var(--wz-bg-color-white,#fff);border-radius:8px;width:85%;max-width:300px;padding-top:24px;position:relative;overflow:hidden}.wz-dialog-header{text-align:center;padding:0 24px 8px}.wz-dialog-title{font-size:18px;font-weight:500}.wz-dialog-content{text-align:center;color:var(--wz-text-color-regular,#666);padding:8px 24px 24px;font-size:14px}.wz-dialog-footer{padding:0 24px 24px;display:flex}.wz-dialog-footer .wz-dialog-button{background-color:var(--wz-primary-color,#00b578);color:var(--wz-text-color-white,#fff);border-radius:100px;flex:1}.wz-dialog-footer .wz-dialog-button:not(:last-child){margin-right:12px}.wz-button{box-sizing:border-box;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;outline:none;justify-content:center;align-items:center;gap:5px;font-family:"Alibaba PuHuiTi 2.0";font-weight:600;transition:all .2s;display:inline-flex;position:relative;overflow:hidden}.wz-button--primary{color:var(--wz-text-color-white,#fff);background:var(--wz-primary-gradient);border:none}.wz-button--primary.wz-button--disabled{color:#fff;background-color:#d6d6d6}.wz-button--outline{color:var(--wz-primary-color,#22c94d);border:1px solid var(--wz-primary-color,#22c94d);background:0 0}.wz-button--plain{color:#666;background:0 0;border:1px solid #666}.wz-button--plain.wz-button--disabled{opacity:.5;background:#fff!important;border:1px solid #ccc!important}.wz-button--cancel{color:#fff;background:#c0c4cc;border:none}.wz-button--block{width:100%;display:flex}.wz-button--large{border-radius:23px;height:46px;padding:10px 20px;font-size:18px;line-height:26px}.wz-button--medium{border-radius:23px;height:30px;padding:4px 16px;font-size:14px;line-height:22px}.wz-button--small{border-radius:13px;height:26px;padding:3px 10px;font-size:13px;line-height:20px}.wz-button--disabled{cursor:not-allowed;opacity:.8}.wz-button--active{opacity:.6}.wz-button__mask{pointer-events:none;border-radius:inherit;z-index:1;background:#00000014;width:100%;height:100%;position:absolute;top:0;left:0}.wz-button__mask--disabled{pointer-events:none;border-radius:inherit;z-index:10;background:#ffffff80;width:100%;height:100%;position:absolute;top:0;left:0}.wz-button__mask--cancel{pointer-events:none;border-radius:inherit;z-index:10;background:#0000000f;width:100%;height:100%;position:absolute;top:0;left:0}.wz-button--text{color:var(--wz-primary-color,#22c94d);box-shadow:none;background:0 0;border:none;height:auto;padding:0 8px;transition:color .2s}.wz-button--text:active{color:var(--wz-primary-color-dark,#179a38);background:var(--wz-bg-color-base,#f5f7f9)}.wz-button--disabled.wz-button--text{color:var(--wz-disabled-color,#c0c4cc);background:0 0}
1
+ .wz-dialog-root{z-index:1000;visibility:hidden;opacity:0;justify-content:center;align-items:center;width:100%;height:100%;transition:all .3s;display:flex;position:fixed;top:0;left:0}.wz-dialog-root.visible{visibility:visible;opacity:1}.wz-dialog-mask{background-color:#0006;width:100%;height:100%;position:absolute;top:0;left:0}.wz-dialog-wrap{background-color:var(--wz-bg-color-white,#fff);border-radius:8px;width:85%;max-width:300px;padding-top:24px;position:relative;overflow:hidden}.wz-dialog-header{text-align:center;padding:0 24px 8px}.wz-dialog-title{font-size:18px;font-weight:500}.wz-dialog-content{text-align:center;color:var(--wz-text-color-regular,#666);padding:8px 24px 24px;font-size:14px}.wz-dialog-footer{padding:0 24px 24px;display:flex}.wz-dialog-footer .wz-dialog-button{background-color:var(--wz-primary-color,#00b578);color:var(--wz-text-color-white,#fff);border-radius:100px;flex:1}.wz-dialog-footer .wz-dialog-button:not(:last-child){margin-right:12px}.wz-button{box-sizing:border-box;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;outline:none;justify-content:center;align-items:center;gap:5px;font-family:"Alibaba PuHuiTi 2.0";font-weight:600;transition:all .2s;display:inline-flex;position:relative;overflow:hidden}.wz-button--primary{color:var(--wz-text-color-white,#fff);background:var(--wz-primary-gradient);border:none}.wz-button--primary.wz-button--disabled{color:#fff;background-color:#d6d6d6}.wz-button--outline{color:var(--wz-primary-color,#22c94d);border:1px solid var(--wz-primary-color,#22c94d);background:0 0}.wz-button--plain{color:#666;background:0 0;border:1px solid #6663}.wz-button--plain.wz-button--disabled{opacity:.5;background:#fff!important;border:1px solid #6663!important}.wz-button--cancel{color:#fff;background:#c0c4cc;border:none}.wz-button--block{width:100%;display:flex}.wz-button--large{border-radius:23px;height:46px;padding:10px 20px;font-size:18px;line-height:26px}.wz-button--medium{border-radius:23px;height:30px;padding:4px 16px;font-size:14px;line-height:22px}.wz-button--small{border-radius:13px;height:26px;padding:3px 10px;font-size:13px;line-height:20px}.wz-button--disabled{cursor:not-allowed;opacity:.8}.wz-button--active{opacity:.6}.wz-button__mask{pointer-events:none;border-radius:inherit;z-index:1;background:#00000014;width:100%;height:100%;position:absolute;top:0;left:0}.wz-button__mask--disabled{pointer-events:none;border-radius:inherit;z-index:10;background:#ffffff80;width:100%;height:100%;position:absolute;top:0;left:0}.wz-button__mask--cancel{pointer-events:none;border-radius:inherit;z-index:10;background:#0000000f;width:100%;height:100%;position:absolute;top:0;left:0}.wz-button--text{color:var(--wz-primary-color,#22c94d);box-shadow:none;background:0 0;border:none;height:auto;padding:0 8px;transition:color .2s}.wz-button--text:active{color:var(--wz-primary-color-dark,#179a38);background:var(--wz-bg-color-base,#f5f7f9)}.wz-button--disabled.wz-button--text{color:var(--wz-disabled-color,#c0c4cc);opacity:.4;background:0 0}