wz-h5-design 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button/index.js +23 -7
- package/dist/Button/index.umd.cjs +1 -1
- package/dist/Button/style/index.css +1 -1
- package/dist/Button/style.css +1 -1
- package/dist/ButtonGroup/index.js +34 -0
- package/dist/ButtonGroup/index.umd.cjs +1 -0
- package/dist/ButtonGroup/style/index.css +1 -0
- package/dist/ButtonGroup/style/index.js +1 -0
- package/dist/ButtonGroup/style.css +1 -0
- package/dist/Cell/index.js +29 -2
- package/dist/Cell/index.umd.cjs +2 -2
- package/dist/Cell/style/index.css +1 -1
- package/dist/Cell/style.css +1 -1
- package/dist/CheckList/index.js +28 -1
- package/dist/CheckList/index.umd.cjs +1 -1
- package/dist/CheckList/style.css +1 -1
- package/dist/Checkbox/index.js +34 -2
- package/dist/Checkbox/index.umd.cjs +1 -1
- package/dist/Checkbox/style/index.css +1 -1
- package/dist/Checkbox/style.css +1 -1
- package/dist/DatePicker/style/index.css +1 -1
- package/dist/DatePicker/style.css +1 -1
- package/dist/DateRangePicker/index.js +65 -9
- package/dist/DateRangePicker/index.umd.cjs +1 -1
- package/dist/DateRangePicker/style/index.css +1 -1
- package/dist/DateRangePicker/style.css +1 -1
- package/dist/Dialog/index.js +23 -7
- package/dist/Dialog/index.umd.cjs +1 -1
- package/dist/Dialog/style.css +1 -1
- package/dist/Divider/index.js +13 -4
- package/dist/Divider/index.umd.cjs +1 -1
- package/dist/Divider/style/index.css +1 -1
- package/dist/Divider/style.css +1 -1
- package/dist/GridView/index.js +26 -2
- package/dist/GridView/index.umd.cjs +1 -1
- package/dist/GridView/style/index.css +1 -1
- package/dist/GridView/style.css +1 -1
- package/dist/Input/index.js +47 -5
- package/dist/Input/index.umd.cjs +1 -1
- package/dist/Input/style/index.css +1 -1
- package/dist/Input/style.css +1 -1
- package/dist/Popup/style/index.css +1 -1
- package/dist/Popup/style.css +1 -1
- package/dist/Radio/index.js +34 -2
- package/dist/Radio/index.umd.cjs +1 -1
- package/dist/Radio/style/index.css +1 -1
- package/dist/Radio/style.css +1 -1
- package/dist/Search/index.js +10 -2
- package/dist/Search/index.umd.cjs +1 -1
- package/dist/Search/style/index.css +1 -1
- package/dist/Search/style.css +1 -1
- package/dist/Switch/index.js +10 -3
- package/dist/Switch/index.umd.cjs +1 -1
- package/dist/Switch/style/index.css +1 -1
- package/dist/Switch/style.css +1 -1
- package/dist/Tabbar/index.js +6 -3
- package/dist/Tabbar/index.umd.cjs +1 -1
- package/dist/Tabbar/style/index.css +1 -1
- package/dist/Tabbar/style.css +1 -1
- package/dist/Tabs/index.js +57 -17
- package/dist/Tabs/index.umd.cjs +1 -1
- package/dist/Tabs/style/index.css +1 -1
- package/dist/Tabs/style.css +1 -1
- package/dist/TimePicker/style/index.css +1 -1
- package/dist/TimePicker/style.css +1 -1
- package/dist/Tip/index.js +28 -5
- package/dist/Tip/index.umd.cjs +2 -2
- package/dist/Tip/style/index.css +1 -1
- package/dist/Tip/style.css +1 -1
- package/dist/Tooltip/index.js +59 -14
- package/dist/Tooltip/index.umd.cjs +2 -2
- package/dist/Tooltip/style/index.css +1 -1
- package/dist/Tooltip/style.css +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/Button/Button.d.ts +3 -0
- package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +20 -0
- package/dist/types/components/ButtonGroup/index.d.ts +5 -0
- package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +6 -0
- package/dist/types/components/Divider/Divider.d.ts +2 -0
- package/dist/types/components/GridView/GridView.d.ts +8 -0
- package/dist/types/components/Input/Input.d.ts +11 -1
- package/dist/types/components/Search/Search.d.ts +1 -0
- package/dist/types/components/Tabbar/Tabbar.d.ts +2 -0
- package/dist/types/components/Tabs/Tabs.d.ts +4 -1
- package/dist/types/components/Tip/Tip.d.ts +21 -2
- package/dist/types/components/Tooltip/Tooltip.d.ts +6 -2
- package/dist/types/components/index.d.ts +2 -1
- package/dist/wz-h5-design.es.js +357 -99
- package/dist/wz-h5-design.umd.js +2 -2
- package/package.json +1 -1
package/dist/Search/index.js
CHANGED
|
@@ -39,6 +39,7 @@ const Search = forwardRef(
|
|
|
39
39
|
suffix,
|
|
40
40
|
leftIcon = /* @__PURE__ */ jsx(Icon, { name: "search", size: 16 }),
|
|
41
41
|
actionText = "搜索",
|
|
42
|
+
actionColor,
|
|
42
43
|
showCancel = false,
|
|
43
44
|
cancelText = "返回",
|
|
44
45
|
background,
|
|
@@ -135,13 +136,20 @@ const Search = forwardRef(
|
|
|
135
136
|
...props
|
|
136
137
|
}
|
|
137
138
|
),
|
|
138
|
-
showClear && /* @__PURE__ */ jsx("div", { className: "wz-search-clear", onMouseDown: handleClear, children: /* @__PURE__ */ jsx(Icon, { name: "close", size: 16, color: "#
|
|
139
|
+
showClear && /* @__PURE__ */ jsx("div", { className: "wz-search-clear", onMouseDown: handleClear, children: /* @__PURE__ */ jsx(Icon, { name: "close", size: 16, color: "#CCCCCC" }) })
|
|
139
140
|
]
|
|
140
141
|
}
|
|
141
142
|
),
|
|
142
143
|
actionText && /* @__PURE__ */ jsxs("div", { className: "wz-search-action", onClick: handleSearch, children: [
|
|
143
144
|
/* @__PURE__ */ jsx("div", { className: "wz-search-divider" }),
|
|
144
|
-
/* @__PURE__ */ jsx(
|
|
145
|
+
/* @__PURE__ */ jsx(
|
|
146
|
+
"div",
|
|
147
|
+
{
|
|
148
|
+
className: "wz-search-action-text",
|
|
149
|
+
style: actionColor ? { color: actionColor } : void 0,
|
|
150
|
+
children: actionText
|
|
151
|
+
}
|
|
152
|
+
)
|
|
145
153
|
] })
|
|
146
154
|
]
|
|
147
155
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s(require("react/jsx-runtime"),require("react")):"function"==typeof define&&define.amd?define(["react/jsx-runtime","react"],s):(e="undefined"!=typeof globalThis?globalThis:e||self).Search=s(e.jsxRuntime,e.React)}(this,(function(e,s){"use strict";const a=({name:s,size:a=24,color:n="currentColor",className:c="",style:l,onClick:r,type:
|
|
1
|
+
!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s(require("react/jsx-runtime"),require("react")):"function"==typeof define&&define.amd?define(["react/jsx-runtime","react"],s):(e="undefined"!=typeof globalThis?globalThis:e||self).Search=s(e.jsxRuntime,e.React)}(this,(function(e,s){"use strict";const a=({name:s,size:a=24,color:n="currentColor",className:c="",style:l,onClick:r,type:o="yunying"})=>{const i={fontSize:"number"==typeof a?`${a}px`:a,color:n,...l},t=`iconfont-${o}`,u=`icon-${s}`;return e.jsx("i",{className:`wz-icon ${t} ${u} ${c}`,style:i,onClick:r})},n=s.forwardRef((({value:n,defaultValue:c,placeholder:l="输入关键词搜索",shape:r="round",clearable:o=!0,disabled:i=!1,prefix:t,suffix:u,leftIcon:d=e.jsx(a,{name:"search",size:16}),actionText:h="搜索",actionColor:f,showCancel:x=!1,cancelText:m="返回",background:p,style:w,className:v="",onSearch:z,onClear:j,onChange:C,onFocus:y,onBlur:N,onCancel:b,...$},g)=>{const k=void 0!==n,[S,R]=s.useState(c||""),[T,D]=s.useState(!1),q=s.useRef(null);s.useImperativeHandle(g,(()=>q.current));const B=k?n:S,F=o&&B&&T&&!i,I=()=>{var e;i||(null==(e=q.current)||e.blur(),null==z||z(B))},E=()=>{D(!1),null==b||b()},H={...w,backgroundColor:p};return e.jsxs("div",{className:`wz-search ${T?"wz-search-focused":""} ${v}`,style:H,children:[t&&e.jsx("div",{className:"wz-search-prefix",children:t}),!t&&x&&T?e.jsx("div",{className:"wz-search-cancel",onClick:E,children:m}):null,e.jsxs("div",{className:`wz-search-content wz-search-shape-${r} ${i?"wz-search-disabled":""}`,children:[e.jsxs("div",{className:"wz-search-input-wrapper "+(F?"wz-search-input-wrapper--with-clear":""),children:[d&&e.jsx("div",{className:"wz-search-left-icon",children:d}),e.jsx("input",{ref:q,className:"wz-search-input",value:B,onChange:e=>{const s=e.target.value;k||R(s),null==C||C(s)},onFocus:e=>{D(!0),null==y||y(e)},onBlur:e=>{D(!1),null==N||N(e)},onKeyDown:e=>{"Enter"!==e.key||i||I()},placeholder:l,disabled:i,...$}),F&&e.jsx("div",{className:"wz-search-clear",onMouseDown:e=>{var s;e.preventDefault(),k||R(""),null==C||C(""),null==j||j(),null==(s=q.current)||s.focus()},children:e.jsx(a,{name:"close",size:16,color:"#CCCCCC"})})]}),h&&e.jsxs("div",{className:"wz-search-action",onClick:I,children:[e.jsx("div",{className:"wz-search-divider"}),e.jsx("div",{className:"wz-search-action-text",style:f?{color:f}:void 0,children:h})]})]}),u&&e.jsx("div",{className:"wz-search-suffix",children:u})]})}));return n.displayName="Search",n}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--wz-search-height:48px;--wz-search-radius:8px;--wz-search-bg:var(--wz-bg-color-base,#f5f5f5);--wz-search-active-bg:#f0f0f0;--wz-search-border:var(--wz-border-color-lighter,#ebebeb);--wz-search-shadow:0 2px 8px #00000008;--wz-search-font-size:16px;--wz-search-placeholder-color:var(--wz-text-color-placeholder,#c0c4cc);--wz-search-text-color:var(--wz-text-color-primary,#333);--wz-search-divider-color:var(--wz-border-color-lighter,#ebebeb);--wz-search-btn-color:var(--wz-info-color,#1890ff);--wz-search-btn-active-color:#096dd9;--wz-search-btn-text:"搜索";--wz-search-padding:12px;--wz-search-inner-padding:0 16px;--wz-search-disabled-opacity:.5}.wz-search{background-color:var(--wz-bg-color-base,#f7f8fa);box-sizing:border-box;align-items:center;width:100%;padding:
|
|
1
|
+
:root{--wz-search-height:48px;--wz-search-radius:8px;--wz-search-bg:var(--wz-bg-color-base,#f5f5f5);--wz-search-active-bg:#f0f0f0;--wz-search-border:var(--wz-border-color-lighter,#ebebeb);--wz-search-shadow:0 2px 8px #00000008;--wz-search-font-size:16px;--wz-search-placeholder-color:var(--wz-text-color-placeholder,#c0c4cc);--wz-search-text-color:var(--wz-text-color-primary,#333);--wz-search-divider-color:var(--wz-border-color-lighter,#ebebeb);--wz-search-btn-color:var(--wz-info-color,#1890ff);--wz-search-btn-active-color:#096dd9;--wz-search-btn-text:"搜索";--wz-search-padding:12px;--wz-search-inner-padding:0 16px;--wz-search-disabled-opacity:.5}.wz-search{background-color:var(--wz-bg-color-base,#f7f8fa);box-sizing:border-box;align-items:center;width:100%;padding:4px 14px;display:flex}.wz-search-cancel{color:var(--wz-primary-color,#22c94d);cursor:pointer;white-space:nowrap;padding-right:12px;font-size:14px}.wz-search-prefix{flex-shrink:0;align-items:center;padding-right:12px;display:flex}.wz-search-content{background-color:var(--wz-bg-color-white,#fff);flex:1;align-items:center;min-width:0;padding:5px 14px;transition:all .2s;display:flex}.wz-search-content.wz-search-shape-round{border-radius:35px}.wz-search-content.wz-search-shape-square{border-radius:4px}.wz-search-content.wz-search-disabled{background-color:var(--wz-disabled-bg,#f2f3f5);opacity:.6;cursor:not-allowed}.wz-search-focused .wz-search.wz-search-content{border:1px solid var(--wz-primary-color,#22c94d);padding:5px 11px}.wz-search-input-wrapper{flex:1;align-items:center;min-width:0;display:flex;position:relative}.wz-search-left-icon{color:var(--wz-text-color-secondary,#999);align-items:center;margin-right:6px;display:flex}.wz-search-input{color:var(--wz-text-color-primary,#333);text-overflow:ellipsis;white-space:nowrap;caret-color:var(--wz-primary-color,#22c94d);background:0 0;border:none;outline:none;flex:1;padding:0;font-size:14px;line-height:1.5;overflow:hidden}.wz-search-input-wrapper--with-clear .wz-search-input{padding-right:22px}.wz-search-input::placeholder{color:var(--wz-text-color-placeholder,#b3b3b3)}.wz-search-clear{cursor:pointer;align-items:center;display:flex;position:absolute;top:50%;right:0;transform:translateY(-50%)}.wz-search-action{cursor:pointer;align-items:center;display:flex}.wz-search-divider{background-color:var(--wz-border-color-light,#e0e0e0);width:1px;height:16px;margin:0 12px}.wz-search-action-text{color:var(--wz-primary-color,#22c94d);white-space:nowrap;font-size:14px}.wz-search-suffix{cursor:pointer;white-space:nowrap;flex-shrink:0;align-items:center;padding-left:12px;display:flex}
|
package/dist/Search/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.wz-icon{justify-content:center;align-items:center;transition:color .2s ease-in-out;display:inline-flex}.wz-icon-home:before{content:""}.wz-icon-search:before{content:""}.wz-icon-person:before{content:""}.wz-icon-settings:before{content:""}.wz-icon-notifications:before{content:""}.wz-icon-message:before{content:""}.wz-icon-favorite:before{content:""}.wz-icon-star:before{content:""}.wz-icon-close:before{content:""}.wz-icon-check:before{content:""}.wz-icon-arrow-back:before{content:""}.wz-icon-arrow-forward:before{content:""}.wz-icon-menu:before{content:""}.wz-icon-more:before{content:""}.wz-icon-add:before{content:""}.wz-icon-edit:before{content:""}.wz-icon-delete:before{content:""}.wz-icon-share:before{content:""}.wz-icon-download:before{content:""}.wz-icon-upload:before{content:""}.wz-icon-refresh:before{content:""}.wz-icon-help:before{content:""}.wz-icon-info:before{content:""}.wz-icon-warning:before{content:""}.wz-icon-error:before{content:""}.wz-icon-success:before{content:""}:root{--wz-search-height:48px;--wz-search-radius:8px;--wz-search-bg:var(--wz-bg-color-base,#f5f5f5);--wz-search-active-bg:#f0f0f0;--wz-search-border:var(--wz-border-color-lighter,#ebebeb);--wz-search-shadow:0 2px 8px #00000008;--wz-search-font-size:16px;--wz-search-placeholder-color:var(--wz-text-color-placeholder,#c0c4cc);--wz-search-text-color:var(--wz-text-color-primary,#333);--wz-search-divider-color:var(--wz-border-color-lighter,#ebebeb);--wz-search-btn-color:var(--wz-info-color,#1890ff);--wz-search-btn-active-color:#096dd9;--wz-search-btn-text:"搜索";--wz-search-padding:12px;--wz-search-inner-padding:0 16px;--wz-search-disabled-opacity:.5}.wz-search{background-color:var(--wz-bg-color-base,#f7f8fa);box-sizing:border-box;align-items:center;width:100%;padding:
|
|
1
|
+
.wz-icon{justify-content:center;align-items:center;transition:color .2s ease-in-out;display:inline-flex}.wz-icon-home:before{content:""}.wz-icon-search:before{content:""}.wz-icon-person:before{content:""}.wz-icon-settings:before{content:""}.wz-icon-notifications:before{content:""}.wz-icon-message:before{content:""}.wz-icon-favorite:before{content:""}.wz-icon-star:before{content:""}.wz-icon-close:before{content:""}.wz-icon-check:before{content:""}.wz-icon-arrow-back:before{content:""}.wz-icon-arrow-forward:before{content:""}.wz-icon-menu:before{content:""}.wz-icon-more:before{content:""}.wz-icon-add:before{content:""}.wz-icon-edit:before{content:""}.wz-icon-delete:before{content:""}.wz-icon-share:before{content:""}.wz-icon-download:before{content:""}.wz-icon-upload:before{content:""}.wz-icon-refresh:before{content:""}.wz-icon-help:before{content:""}.wz-icon-info:before{content:""}.wz-icon-warning:before{content:""}.wz-icon-error:before{content:""}.wz-icon-success:before{content:""}:root{--wz-search-height:48px;--wz-search-radius:8px;--wz-search-bg:var(--wz-bg-color-base,#f5f5f5);--wz-search-active-bg:#f0f0f0;--wz-search-border:var(--wz-border-color-lighter,#ebebeb);--wz-search-shadow:0 2px 8px #00000008;--wz-search-font-size:16px;--wz-search-placeholder-color:var(--wz-text-color-placeholder,#c0c4cc);--wz-search-text-color:var(--wz-text-color-primary,#333);--wz-search-divider-color:var(--wz-border-color-lighter,#ebebeb);--wz-search-btn-color:var(--wz-info-color,#1890ff);--wz-search-btn-active-color:#096dd9;--wz-search-btn-text:"搜索";--wz-search-padding:12px;--wz-search-inner-padding:0 16px;--wz-search-disabled-opacity:.5}.wz-search{background-color:var(--wz-bg-color-base,#f7f8fa);box-sizing:border-box;align-items:center;width:100%;padding:4px 14px;display:flex}.wz-search-cancel{color:var(--wz-primary-color,#22c94d);cursor:pointer;white-space:nowrap;padding-right:12px;font-size:14px}.wz-search-prefix{flex-shrink:0;align-items:center;padding-right:12px;display:flex}.wz-search-content{background-color:var(--wz-bg-color-white,#fff);flex:1;align-items:center;min-width:0;padding:5px 14px;transition:all .2s;display:flex}.wz-search-content.wz-search-shape-round{border-radius:35px}.wz-search-content.wz-search-shape-square{border-radius:4px}.wz-search-content.wz-search-disabled{background-color:var(--wz-disabled-bg,#f2f3f5);opacity:.6;cursor:not-allowed}.wz-search-focused .wz-search.wz-search-content{border:1px solid var(--wz-primary-color,#22c94d);padding:5px 11px}.wz-search-input-wrapper{flex:1;align-items:center;min-width:0;display:flex;position:relative}.wz-search-left-icon{color:var(--wz-text-color-secondary,#999);align-items:center;margin-right:6px;display:flex}.wz-search-input{color:var(--wz-text-color-primary,#333);text-overflow:ellipsis;white-space:nowrap;caret-color:var(--wz-primary-color,#22c94d);background:0 0;border:none;outline:none;flex:1;padding:0;font-size:14px;line-height:1.5;overflow:hidden}.wz-search-input-wrapper--with-clear .wz-search-input{padding-right:22px}.wz-search-input::placeholder{color:var(--wz-text-color-placeholder,#b3b3b3)}.wz-search-clear{cursor:pointer;align-items:center;display:flex;position:absolute;top:50%;right:0;transform:translateY(-50%)}.wz-search-action{cursor:pointer;align-items:center;display:flex}.wz-search-divider{background-color:var(--wz-border-color-light,#e0e0e0);width:1px;height:16px;margin:0 12px}.wz-search-action-text{color:var(--wz-primary-color,#22c94d);white-space:nowrap;font-size:14px}.wz-search-suffix{cursor:pointer;white-space:nowrap;flex-shrink:0;align-items:center;padding-left:12px;display:flex}
|
package/dist/Switch/index.js
CHANGED
|
@@ -18,11 +18,17 @@ const Switch = ({
|
|
|
18
18
|
const [innerValue, setInnerValue] = useState(defaultValue);
|
|
19
19
|
const isControlled = value !== void 0;
|
|
20
20
|
const checked = isControlled ? value : innerValue;
|
|
21
|
-
const
|
|
21
|
+
const activeTextDisplay = activeText || DEFAULT_ACTIVE_TEXT;
|
|
22
|
+
const inactiveTextDisplay = inactiveText || DEFAULT_INACTIVE_TEXT;
|
|
23
|
+
const text = checked ? activeTextDisplay : inactiveTextDisplay;
|
|
22
24
|
const textWidth = showText ? `${text.length * 12 + 8}px` : "0px";
|
|
25
|
+
const maxTextLen = Math.max(activeTextDisplay.length, inactiveTextDisplay.length);
|
|
23
26
|
const baseWidth = size === "large" ? 62 : 60;
|
|
24
|
-
const
|
|
27
|
+
const calculatedWidth = showText ? maxTextLen * 12 + 40 : baseWidth;
|
|
28
|
+
const switchWidthNum = Math.max(calculatedWidth, baseWidth);
|
|
25
29
|
const switchWidth = `${switchWidthNum}px`;
|
|
30
|
+
const sliderSize = size === "large" ? 24 : 22;
|
|
31
|
+
const sliderTranslateX = checked ? switchWidthNum - sliderSize - 4 : 0;
|
|
26
32
|
const onBg = activeColor ? activeColor.includes("gradient") ? activeColor : activeColor : void 0;
|
|
27
33
|
const handleClick = () => {
|
|
28
34
|
if (disabled) return;
|
|
@@ -41,7 +47,8 @@ const Switch = ({
|
|
|
41
47
|
/* @__PURE__ */ jsx(
|
|
42
48
|
"div",
|
|
43
49
|
{
|
|
44
|
-
className: `wz-switch-slider ${checked ? "wz-switch-slider-on" : "wz-switch-slider-off"}
|
|
50
|
+
className: `wz-switch-slider ${checked ? "wz-switch-slider-on" : "wz-switch-slider-off"}`,
|
|
51
|
+
style: { transform: `translateX(${sliderTranslateX}px)` }
|
|
45
52
|
}
|
|
46
53
|
)
|
|
47
54
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react/jsx-runtime"),require("react")):"function"==typeof define&&define.amd?define(["react/jsx-runtime","react"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).Switch=t(e.jsxRuntime,e.React)}(this,(function(e,t){"use strict";return({value:i,defaultValue:s=!1,onChange:
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react/jsx-runtime"),require("react")):"function"==typeof define&&define.amd?define(["react/jsx-runtime","react"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).Switch=t(e.jsxRuntime,e.React)}(this,(function(e,t){"use strict";return({value:i,defaultValue:s=!1,onChange:a,disabled:n=!1,showText:l=!0,activeText:c="",inactiveText:d="",style:r,className:o="",size:h="default",activeColor:u})=>{const[w,f]=t.useState(s),x=void 0!==i,m=x?i:w,p=c||"开启",g=d||"关闭",z=m?p:g,v=l?12*z.length+8+"px":"0px",y=Math.max(p.length,g.length),b="large"===h?62:60,j=l?12*y+40:b,$=Math.max(j,b),T=`${$}px`,N=m?$-("large"===h?24:22)-4:0,C=u?(u.includes("gradient"),u):void 0,k=m&&u?{background:C}:{};return e.jsxs("div",{className:`wz-switch-bg ${m?"wz-switch-on":"wz-switch-off"}${n?" wz-switch-disabled":""}${o?" "+o:""} wz-switch-${h}`,style:{width:T,minWidth:`${b}px`,...r,...k},onClick:()=>{n||(x||f(!m),null==a||a(!m))},children:[l&&e.jsx("span",{className:"wz-switch-text",style:{width:v},children:z}),e.jsx("div",{className:"wz-switch-slider "+(m?"wz-switch-slider-on":"wz-switch-slider-off"),style:{transform:`translateX(${N}px)`}})]})}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.wz-switch-bg{cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;outline:none;align-items:center;transition:background .
|
|
1
|
+
.wz-switch-bg{cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;outline:none;align-items:center;transition:background-color .3s,box-shadow .3s;display:flex;position:relative;box-shadow:0 1px 3px #00000014}.wz-switch-default{border-radius:26px;height:26px}.wz-switch-default .wz-switch-slider{width:22px;height:22px;top:2px}.wz-switch-default .wz-switch-text{top:5px}.wz-switch-large{border-radius:28px;height:28px}.wz-switch-large .wz-switch-slider{width:24px;height:24px}.wz-switch-large .wz-switch-text{top:6px}.wz-switch-off{background:var(--wz-disabled-color,#ccc);box-shadow:inset 0 0 2px #0000001a}.wz-switch-on{background:var(--wz-primary-color,#22c94d);box-shadow:inset 0 0 2px #0eb54999}.wz-switch-text{text-align:center;color:var(--wz-text-color-white,#fff);z-index:2;pointer-events:none;height:16px;font-family:"Alibaba PuHuiTi 2.0",Alibaba-PuHuiTi-Regular,PingFang SC,Microsoft YaHei,Arial,sans-serif;font-size:12px;font-weight:600;line-height:16px;transition:left .3s cubic-bezier(.4,0,.2,1),opacity .2s;position:absolute;left:29px}.wz-switch-on .wz-switch-text{color:var(--wz-text-color-white,#fff);left:8px}.wz-switch-slider{z-index:3;background:#fff;border-radius:50%;width:22px;height:22px;transition:transform .3s cubic-bezier(.4,0,.2,1);position:absolute;top:2px;left:2px;box-shadow:0 1px 3px #00000014}.wz-switch-disabled{opacity:.6;cursor:not-allowed}
|
package/dist/Switch/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.wz-switch-bg{cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;outline:none;align-items:center;transition:background .
|
|
1
|
+
.wz-switch-bg{cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;outline:none;align-items:center;transition:background-color .3s,box-shadow .3s;display:flex;position:relative;box-shadow:0 1px 3px #00000014}.wz-switch-default{border-radius:26px;height:26px}.wz-switch-default .wz-switch-slider{width:22px;height:22px;top:2px}.wz-switch-default .wz-switch-text{top:5px}.wz-switch-large{border-radius:28px;height:28px}.wz-switch-large .wz-switch-slider{width:24px;height:24px}.wz-switch-large .wz-switch-text{top:6px}.wz-switch-off{background:var(--wz-disabled-color,#ccc);box-shadow:inset 0 0 2px #0000001a}.wz-switch-on{background:var(--wz-primary-color,#22c94d);box-shadow:inset 0 0 2px #0eb54999}.wz-switch-text{text-align:center;color:var(--wz-text-color-white,#fff);z-index:2;pointer-events:none;height:16px;font-family:"Alibaba PuHuiTi 2.0",Alibaba-PuHuiTi-Regular,PingFang SC,Microsoft YaHei,Arial,sans-serif;font-size:12px;font-weight:600;line-height:16px;transition:left .3s cubic-bezier(.4,0,.2,1),opacity .2s;position:absolute;left:29px}.wz-switch-on .wz-switch-text{color:var(--wz-text-color-white,#fff);left:8px}.wz-switch-slider{z-index:3;background:#fff;border-radius:50%;width:22px;height:22px;transition:transform .3s cubic-bezier(.4,0,.2,1);position:absolute;top:2px;left:2px;box-shadow:0 1px 3px #00000014}.wz-switch-disabled{opacity:.6;cursor:not-allowed}
|
package/dist/Tabbar/index.js
CHANGED
|
@@ -79,14 +79,17 @@ const Icon = ({
|
|
|
79
79
|
);
|
|
80
80
|
};
|
|
81
81
|
const TabbarItem = (props) => {
|
|
82
|
-
const { title, icon, activeIcon, badge, badgeAsBubble, hump, active, onItemClick, onClick, activeColor } = props;
|
|
82
|
+
const { title, icon, activeIcon, badge, badgeAsBubble, dot, hump, active, onItemClick, onClick, activeColor } = props;
|
|
83
83
|
const renderIcon = (iconSource) => {
|
|
84
84
|
if (typeof iconSource === "string") {
|
|
85
|
-
return /* @__PURE__ */ jsx(Icon, { name: iconSource });
|
|
85
|
+
return /* @__PURE__ */ jsx(Icon, { size: 22, name: iconSource });
|
|
86
86
|
}
|
|
87
87
|
return iconSource;
|
|
88
88
|
};
|
|
89
89
|
const renderBadge = () => {
|
|
90
|
+
if (dot) {
|
|
91
|
+
return /* @__PURE__ */ jsx("div", { className: "wz-tabbar-item-dot" });
|
|
92
|
+
}
|
|
90
93
|
if (!badge) return null;
|
|
91
94
|
if (badgeAsBubble) {
|
|
92
95
|
return /* @__PURE__ */ jsx("div", { className: "wz-tabbar-item-badge-custom", children: /* @__PURE__ */ jsxs("div", { className: "wz-tabbar-item-badge-bubble", children: [
|
|
@@ -115,7 +118,7 @@ const TabbarItem = (props) => {
|
|
|
115
118
|
active ? renderIcon(activeIcon || icon) : renderIcon(icon),
|
|
116
119
|
renderBadge()
|
|
117
120
|
] }),
|
|
118
|
-
/* @__PURE__ */ jsx("div", { className: "wz-tabbar-item-title", children: title })
|
|
121
|
+
!hump && /* @__PURE__ */ jsx("div", { className: "wz-tabbar-item-title", children: title })
|
|
119
122
|
] });
|
|
120
123
|
};
|
|
121
124
|
const Tabbar = (props) => {
|
|
@@ -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=r,function(){var e={}.hasOwnProperty;function t(){for(var a=[],i=0;i<arguments.length;i++){var r=arguments[i];if(r){var
|
|
6
|
+
*/i=r,function(){var e={}.hasOwnProperty;function t(){for(var a=[],i=0;i<arguments.length;i++){var r=arguments[i];if(r){var s=typeof r;if("string"===s||"number"===s)a.push(r);else if(Array.isArray(r)){if(r.length){var n=t.apply(null,r);n&&a.push(n)}}else if("object"===s){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){a.push(r.toString());continue}for(var o in r)e.call(r,o)&&r[o]&&a.push(o)}}}return a.join(" ")}i.exports?(t.default=t,i.exports=t):window.classNames=t}();const s=a(r.exports),n=({name:t,size:a=24,color:i="currentColor",className:r="",style:s,onClick:n,type:o="yunying"})=>{const l={fontSize:"number"==typeof a?`${a}px`:a,color:i,...s},c=`iconfont-${o}`,u=`icon-${t}`;return e.jsx("i",{className:`wz-icon ${c} ${u} ${r}`,style:l,onClick:n})},o=a=>{const{title:i,icon:r,activeIcon:o,badge:l,badgeAsBubble:c,dot:u,hump:d,active:b,onItemClick:m,onClick:f,activeColor:v}=a,p=t=>"string"==typeof t?e.jsx(n,{size:22,name:t}):t,y=s("wz-tabbar-item",{"wz-tabbar-item-active":!d&&b,"wz-tabbar-item-hump":d}),x=t.useMemo((()=>{const e={};return b&&v&&(e.color=v),e}),[b,v]);return e.jsxs("div",{className:y,style:x,onClick:d?f:m,children:[e.jsxs("div",{className:"wz-tabbar-item-icon",children:[p(b&&o||r),u?e.jsx("div",{className:"wz-tabbar-item-dot"}):l?c?e.jsx("div",{className:"wz-tabbar-item-badge-custom",children:e.jsxs("div",{className:"wz-tabbar-item-badge-bubble",children:[l,e.jsx("div",{className:"wz-tabbar-item-badge-bubble-arrow"})]})}):t.isValidElement(l)?e.jsx("div",{className:"wz-tabbar-item-badge-custom",children:l}):e.jsx("div",{className:"wz-tabbar-item-badge",children:l}):null]}),!d&&e.jsx("div",{className:"wz-tabbar-item-title",children:i})]})};return a=>{var i;const{activeKey:r,defaultActiveKey:n,onChange:l,items:c,fixed:u=!0,className:d,style:b}=a,[m,f]=t.useState(r??n??(null==(i=null==c?void 0:c[0])?void 0:i.key));t.useEffect((()=>{void 0!==r&&f(r)}),[r]);const v=s("wz-tabbar",{"wz-tabbar-fixed":u},d);return e.jsx("div",{className:v,style:b,children:c.map((e=>t.createElement(o,{...e,key:e.key,active:!e.hump&&m===e.key,onItemClick:()=>{return t=e.key,void 0===r&&f(t),void(null==l||l(t));var t}})))})}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--wz-tabbar-height:52px;--wz-tabbar-bg-color:var(--wz-bg-color-white,#fff);--wz-tabbar-border-color:var(--wz-border-color-lighter,#f0f0f0);--wz-tabbar-item-text-color:var(--wz-text-color-regular,#666);--wz-tabbar-item-active-text-color:var(--wz-primary-color,#0eb549);--wz-tabbar-item-icon-size:
|
|
1
|
+
:root{--wz-tabbar-height:52px;--wz-tabbar-bg-color:var(--wz-bg-color-white,#fff);--wz-tabbar-border-color:var(--wz-border-color-lighter,#f0f0f0);--wz-tabbar-item-text-color:var(--wz-text-color-regular,#666);--wz-tabbar-item-active-text-color:var(--wz-primary-color,#0eb549);--wz-tabbar-item-icon-size:22px;--wz-tabbar-item-text-font-size:10px;--wz-tabbar-badge-bg-color:var(--wz-danger-color,#ff4d4f);--wz-tabbar-badge-color:var(--wz-text-color-white,#fff);--wz-tabbar-badge-font-size:12px}.wz-tabbar{height:var(--wz-tabbar-height);background-color:var(--wz-tabbar-bg-color);border-top:1px solid var(--wz-tabbar-border-color);box-sizing:border-box;width:100%;display:flex}.wz-tabbar.wz-tabbar-fixed{z-index:999;position:fixed;bottom:0;left:0;right:0}body:has(.wz-tabbar-fixed){padding-bottom:var(--wz-tabbar-height)}.wz-tabbar-item{color:var(--wz-tabbar-item-text-color);cursor:pointer;-webkit-tap-highlight-color:transparent;outline:none;flex-direction:column;flex:1;justify-content:center;align-items:center;display:flex}.wz-tabbar-item .wz-tabbar-item-icon{font-size:var(--wz-tabbar-item-icon-size);margin-bottom:4px;position:relative}.wz-tabbar-item .wz-tabbar-item-icon .wz-tabbar-item-badge{background-color:var(--wz-tabbar-badge-bg-color);color:var(--wz-tabbar-badge-color);font-size:var(--wz-tabbar-badge-font-size);text-align:center;box-sizing:border-box;border-radius:10px;min-width:16px;height:16px;padding:0 4px;line-height:16px;position:absolute;top:0;right:-3px;transform:translate(50%,-10%)}.wz-tabbar-item .wz-tabbar-item-icon .wz-tabbar-item-dot{background-color:var(--wz-tabbar-badge-bg-color);border:1.5px solid #fff;border-radius:50%;width:12px;height:12px;position:absolute;top:5px;right:0;transform:translate(50%,-50%)}.wz-tabbar-item .wz-tabbar-item-icon .wz-tabbar-item-badge-custom{z-index:1;position:absolute;top:-22px;left:50%;transform:translate(-50%)}.wz-tabbar-item .wz-tabbar-item-badge-bubble{background:var(--wz-warning-color,linear-gradient(135deg,#ff9c38,#fd631a));color:var(--wz-text-color-white,#fff);white-space:nowrap;border-radius:9px;padding:4px 8px;font-size:10px;position:relative}.wz-tabbar-item .wz-tabbar-item-badge-bubble-arrow{content:"";border-top:4px solid #fe7f36;border-left:4px solid #0000;border-right:4px solid #0000;width:0;height:0;margin-left:-4px;position:absolute;bottom:-4px;left:50%}.wz-tabbar-item .wz-tabbar-item-title{font-size:var(--wz-tabbar-item-text-font-size)}.wz-tabbar-item.wz-tabbar-item-active{color:var(--wz-tabbar-item-active-text-color)}.wz-tabbar-item.wz-tabbar-item-hump{position:relative}.wz-tabbar-item.wz-tabbar-item-hump .wz-tabbar-item-icon{background:var(--wz-primary-gradient,linear-gradient(90deg,#77c708 -4%,#34b834 100%));color:var(--wz-text-color-white,#fff);box-sizing:border-box;border:5px solid #fff;border-radius:50%;justify-content:center;align-items:center;width:64px;height:64px;margin:0;display:flex;position:absolute;top:-13px;left:50%;transform:translate(-50%);box-shadow:0 0 0 1px #00000014}
|
package/dist/Tabbar/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.wz-icon{justify-content:center;align-items:center;transition:color .2s ease-in-out;display:inline-flex}.wz-icon-home:before{content:""}.wz-icon-search:before{content:""}.wz-icon-person:before{content:""}.wz-icon-settings:before{content:""}.wz-icon-notifications:before{content:""}.wz-icon-message:before{content:""}.wz-icon-favorite:before{content:""}.wz-icon-star:before{content:""}.wz-icon-close:before{content:""}.wz-icon-check:before{content:""}.wz-icon-arrow-back:before{content:""}.wz-icon-arrow-forward:before{content:""}.wz-icon-menu:before{content:""}.wz-icon-more:before{content:""}.wz-icon-add:before{content:""}.wz-icon-edit:before{content:""}.wz-icon-delete:before{content:""}.wz-icon-share:before{content:""}.wz-icon-download:before{content:""}.wz-icon-upload:before{content:""}.wz-icon-refresh:before{content:""}.wz-icon-help:before{content:""}.wz-icon-info:before{content:""}.wz-icon-warning:before{content:""}.wz-icon-error:before{content:""}.wz-icon-success:before{content:""}:root{--wz-tabbar-height:52px;--wz-tabbar-bg-color:var(--wz-bg-color-white,#fff);--wz-tabbar-border-color:var(--wz-border-color-lighter,#f0f0f0);--wz-tabbar-item-text-color:var(--wz-text-color-regular,#666);--wz-tabbar-item-active-text-color:var(--wz-primary-color,#0eb549);--wz-tabbar-item-icon-size:
|
|
1
|
+
.wz-icon{justify-content:center;align-items:center;transition:color .2s ease-in-out;display:inline-flex}.wz-icon-home:before{content:""}.wz-icon-search:before{content:""}.wz-icon-person:before{content:""}.wz-icon-settings:before{content:""}.wz-icon-notifications:before{content:""}.wz-icon-message:before{content:""}.wz-icon-favorite:before{content:""}.wz-icon-star:before{content:""}.wz-icon-close:before{content:""}.wz-icon-check:before{content:""}.wz-icon-arrow-back:before{content:""}.wz-icon-arrow-forward:before{content:""}.wz-icon-menu:before{content:""}.wz-icon-more:before{content:""}.wz-icon-add:before{content:""}.wz-icon-edit:before{content:""}.wz-icon-delete:before{content:""}.wz-icon-share:before{content:""}.wz-icon-download:before{content:""}.wz-icon-upload:before{content:""}.wz-icon-refresh:before{content:""}.wz-icon-help:before{content:""}.wz-icon-info:before{content:""}.wz-icon-warning:before{content:""}.wz-icon-error:before{content:""}.wz-icon-success:before{content:""}:root{--wz-tabbar-height:52px;--wz-tabbar-bg-color:var(--wz-bg-color-white,#fff);--wz-tabbar-border-color:var(--wz-border-color-lighter,#f0f0f0);--wz-tabbar-item-text-color:var(--wz-text-color-regular,#666);--wz-tabbar-item-active-text-color:var(--wz-primary-color,#0eb549);--wz-tabbar-item-icon-size:22px;--wz-tabbar-item-text-font-size:10px;--wz-tabbar-badge-bg-color:var(--wz-danger-color,#ff4d4f);--wz-tabbar-badge-color:var(--wz-text-color-white,#fff);--wz-tabbar-badge-font-size:12px}.wz-tabbar{height:var(--wz-tabbar-height);background-color:var(--wz-tabbar-bg-color);border-top:1px solid var(--wz-tabbar-border-color);box-sizing:border-box;width:100%;display:flex}.wz-tabbar.wz-tabbar-fixed{z-index:999;position:fixed;bottom:0;left:0;right:0}body:has(.wz-tabbar-fixed){padding-bottom:var(--wz-tabbar-height)}.wz-tabbar-item{color:var(--wz-tabbar-item-text-color);cursor:pointer;-webkit-tap-highlight-color:transparent;outline:none;flex-direction:column;flex:1;justify-content:center;align-items:center;display:flex}.wz-tabbar-item .wz-tabbar-item-icon{font-size:var(--wz-tabbar-item-icon-size);margin-bottom:4px;position:relative}.wz-tabbar-item .wz-tabbar-item-icon .wz-tabbar-item-badge{background-color:var(--wz-tabbar-badge-bg-color);color:var(--wz-tabbar-badge-color);font-size:var(--wz-tabbar-badge-font-size);text-align:center;box-sizing:border-box;border-radius:10px;min-width:16px;height:16px;padding:0 4px;line-height:16px;position:absolute;top:0;right:-3px;transform:translate(50%,-10%)}.wz-tabbar-item .wz-tabbar-item-icon .wz-tabbar-item-dot{background-color:var(--wz-tabbar-badge-bg-color);border:1.5px solid #fff;border-radius:50%;width:12px;height:12px;position:absolute;top:5px;right:0;transform:translate(50%,-50%)}.wz-tabbar-item .wz-tabbar-item-icon .wz-tabbar-item-badge-custom{z-index:1;position:absolute;top:-22px;left:50%;transform:translate(-50%)}.wz-tabbar-item .wz-tabbar-item-badge-bubble{background:var(--wz-warning-color,linear-gradient(135deg,#ff9c38,#fd631a));color:var(--wz-text-color-white,#fff);white-space:nowrap;border-radius:9px;padding:4px 8px;font-size:10px;position:relative}.wz-tabbar-item .wz-tabbar-item-badge-bubble-arrow{content:"";border-top:4px solid #fe7f36;border-left:4px solid #0000;border-right:4px solid #0000;width:0;height:0;margin-left:-4px;position:absolute;bottom:-4px;left:50%}.wz-tabbar-item .wz-tabbar-item-title{font-size:var(--wz-tabbar-item-text-font-size)}.wz-tabbar-item.wz-tabbar-item-active{color:var(--wz-tabbar-item-active-text-color)}.wz-tabbar-item.wz-tabbar-item-hump{position:relative}.wz-tabbar-item.wz-tabbar-item-hump .wz-tabbar-item-icon{background:var(--wz-primary-gradient,linear-gradient(90deg,#77c708 -4%,#34b834 100%));color:var(--wz-text-color-white,#fff);box-sizing:border-box;border:5px solid #fff;border-radius:50%;justify-content:center;align-items:center;width:64px;height:64px;margin:0;display:flex;position:absolute;top:-13px;left:50%;transform:translate(-50%);box-shadow:0 0 0 1px #00000014}
|
package/dist/Tabs/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState, Children } from "react";
|
|
2
|
+
import { useState, useRef, useCallback, Children } from "react";
|
|
3
3
|
const TabPane = ({ children }) => {
|
|
4
4
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
5
5
|
};
|
|
6
6
|
const Tabs = ({
|
|
7
7
|
type = "line",
|
|
8
|
+
align = "center",
|
|
8
9
|
value,
|
|
9
10
|
defaultValue = 0,
|
|
10
11
|
onChange,
|
|
@@ -14,33 +15,72 @@ const Tabs = ({
|
|
|
14
15
|
headerStyle,
|
|
15
16
|
contentClassName = "",
|
|
16
17
|
contentStyle,
|
|
17
|
-
children
|
|
18
|
+
children,
|
|
19
|
+
maxTabs = 5
|
|
18
20
|
}) => {
|
|
19
21
|
const isControlled = value !== void 0;
|
|
20
22
|
const [innerValue, setInnerValue] = useState(defaultValue);
|
|
21
23
|
const activeIndex = isControlled ? value : innerValue;
|
|
22
|
-
const
|
|
24
|
+
const headerRef = useRef(null);
|
|
25
|
+
const isDragging = useRef(false);
|
|
26
|
+
const startX = useRef(0);
|
|
27
|
+
const scrollLeft = useRef(0);
|
|
28
|
+
const handleMouseDown = useCallback((e) => {
|
|
29
|
+
if (align !== "left" || !headerRef.current) return;
|
|
30
|
+
isDragging.current = true;
|
|
31
|
+
startX.current = e.pageX - headerRef.current.offsetLeft;
|
|
32
|
+
scrollLeft.current = headerRef.current.scrollLeft;
|
|
33
|
+
}, [align]);
|
|
34
|
+
const handleMouseMove = useCallback((e) => {
|
|
35
|
+
if (!isDragging.current || !headerRef.current) return;
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
const x = e.pageX - headerRef.current.offsetLeft;
|
|
38
|
+
const walk = (x - startX.current) * 1.5;
|
|
39
|
+
headerRef.current.scrollLeft = scrollLeft.current - walk;
|
|
40
|
+
}, []);
|
|
41
|
+
const handleMouseUp = useCallback(() => {
|
|
42
|
+
isDragging.current = false;
|
|
43
|
+
}, []);
|
|
44
|
+
const handleMouseLeave = useCallback(() => {
|
|
45
|
+
isDragging.current = false;
|
|
46
|
+
}, []);
|
|
47
|
+
const allPanes = Children.toArray(children).filter(Boolean);
|
|
48
|
+
const panes = allPanes.slice(0, maxTabs);
|
|
23
49
|
const handleTabClick = (idx, disabled) => {
|
|
24
50
|
if (disabled) return;
|
|
25
51
|
if (!isControlled) setInnerValue(idx);
|
|
26
52
|
onChange == null ? void 0 : onChange(idx);
|
|
27
53
|
};
|
|
28
|
-
|
|
29
|
-
|
|
54
|
+
const cardTabStyle = type === "card" ? {
|
|
55
|
+
flex: panes.length > 3 ? "0 0 calc((100% - 28px) / 3)" : "1"
|
|
56
|
+
} : void 0;
|
|
57
|
+
return /* @__PURE__ */ jsxs("div", { className: `wz-tabs wz-tabs-${type}${align === "left" ? " wz-tabs-align-left" : ""} ${className}`, style, children: [
|
|
58
|
+
/* @__PURE__ */ jsx(
|
|
30
59
|
"div",
|
|
31
60
|
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
61
|
+
ref: headerRef,
|
|
62
|
+
className: `wz-tabs-header ${headerClassName}`,
|
|
63
|
+
style: headerStyle,
|
|
64
|
+
onMouseDown: handleMouseDown,
|
|
65
|
+
onMouseMove: handleMouseMove,
|
|
66
|
+
onMouseUp: handleMouseUp,
|
|
67
|
+
onMouseLeave: handleMouseLeave,
|
|
68
|
+
children: panes.map((pane, idx) => /* @__PURE__ */ jsx(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
className: `wz-tabs-tab${idx === activeIndex ? " wz-tabs-tab-active" : ""}${pane.props.disabled ? " wz-tabs-tab-disabled" : ""}`,
|
|
72
|
+
style: cardTabStyle,
|
|
73
|
+
onClick: () => handleTabClick(idx, pane.props.disabled),
|
|
74
|
+
children: /* @__PURE__ */ jsxs("div", { className: "wz-tabs-tab-text", children: [
|
|
75
|
+
pane.props.title,
|
|
76
|
+
pane.props.badge && /* @__PURE__ */ jsx("div", { className: "wz-tabs-badge", children: pane.props.badge }),
|
|
77
|
+
idx === activeIndex && type === "line" && /* @__PURE__ */ jsx("div", { className: "wz-tabs-underline" })
|
|
78
|
+
] })
|
|
79
|
+
},
|
|
80
|
+
idx
|
|
81
|
+
))
|
|
82
|
+
}
|
|
83
|
+
),
|
|
44
84
|
/* @__PURE__ */ jsx("div", { className: `wz-tabs-content ${contentClassName}`, style: contentStyle, children: panes[activeIndex] })
|
|
45
85
|
] });
|
|
46
86
|
};
|
package/dist/Tabs/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react/jsx-runtime"),require("react")):"function"==typeof define&&define.amd?define(["react/jsx-runtime","react"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).Tabs=t(e.jsxRuntime,e.React)}(this,(function(e,t){"use strict";const s=({type:s="line",align:a="center",value:r,defaultValue:n=0,onChange:l,className:c="",style:i,headerClassName:u="",headerStyle:o,contentClassName:d="",contentStyle:f,children:b,maxTabs:p=5})=>{const m=void 0!==r,[h,x]=t.useState(n),v=m?r:h,y=t.useRef(null),g=t.useRef(!1),j=t.useRef(0),w=t.useRef(0),z=t.useCallback((e=>{"left"===a&&y.current&&(g.current=!0,j.current=e.pageX-y.current.offsetLeft,w.current=y.current.scrollLeft)}),[a]),N=t.useCallback((e=>{if(!g.current||!y.current)return;e.preventDefault();const t=1.5*(e.pageX-y.current.offsetLeft-j.current);y.current.scrollLeft=w.current-t}),[]),C=t.useCallback((()=>{g.current=!1}),[]),$=t.useCallback((()=>{g.current=!1}),[]),R=t.Children.toArray(b).filter(Boolean).slice(0,p),k="card"===s?{flex:R.length>3?"0 0 calc((100% - 28px) / 3)":"1"}:void 0;return e.jsxs("div",{className:`wz-tabs wz-tabs-${s}${"left"===a?" wz-tabs-align-left":""} ${c}`,style:i,children:[e.jsx("div",{ref:y,className:`wz-tabs-header ${u}`,style:o,onMouseDown:z,onMouseMove:N,onMouseUp:C,onMouseLeave:$,children:R.map(((t,a)=>e.jsx("div",{className:`wz-tabs-tab${a===v?" wz-tabs-tab-active":""}${t.props.disabled?" wz-tabs-tab-disabled":""}`,style:k,onClick:()=>((e,t)=>{t||(m||x(e),null==l||l(e))})(a,t.props.disabled),children:e.jsxs("div",{className:"wz-tabs-tab-text",children:[t.props.title,t.props.badge&&e.jsx("div",{className:"wz-tabs-badge",children:t.props.badge}),a===v&&"line"===s&&e.jsx("div",{className:"wz-tabs-underline"})]})},a)))}),e.jsx("div",{className:`wz-tabs-content ${d}`,style:f,children:R[v]})]})};return s.TabPane=({children:t})=>e.jsx(e.Fragment,{children:t}),s}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.wz-tabs{background:var(--wz-bg-color-white,#fff);box-sizing:border-box;width:100%}.wz-tabs-header{
|
|
1
|
+
.wz-tabs{background:var(--wz-bg-color-white,#fff);box-sizing:border-box;width:100%}.wz-tabs-header{background:var(--wz-bg-color-white,#fff);z-index:1;padding:9px 14px;display:flex;position:relative}.wz-tabs-tab{text-align:center;color:var(--wz-text-color-regular,#666);cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;background:0 0;outline:none;flex:1;height:22px;font-size:14px;transition:color .2s ease-in-out;position:relative}.wz-tabs-tab-active{color:var(--wz-primary-color,#22c94d);font-weight:600}.wz-tabs-tab-disabled{color:var(--wz-disabled-color,#c0c4cc);cursor:not-allowed;opacity:.5}.wz-tabs-tab-text{padding-bottom:8px;display:inline-block;position:relative}.wz-tabs-tab .wz-tabs-badge{background-color:var(--wz-danger-color,#ff4d4f);color:var(--wz-text-color-white,#fff);white-space:nowrap;z-index:1;box-sizing:border-box;text-align:center;border-radius:16px;min-width:16px;height:16px;padding:0 4px;font-size:12px;line-height:16px;position:absolute;top:0;right:-25%;transform:translate(50%,-50%)}.wz-tabs-underline{background:var(--wz-primary-color,#22c94d);border-radius:2px;width:100%;height:2px;transition:all .2s ease-in-out;position:absolute;bottom:0;left:50%;transform:translate(-50%)}.wz-tabs-content{color:var(--wz-text-color-regular,#666);background:var(--wz-bg-color-white,#fff);padding:12px;font-size:14px}.wz-tabs-align-left .wz-tabs-header{-webkit-overflow-scrolling:touch;scrollbar-width:none;-ms-overflow-style:none;justify-content:flex-start;padding:9px 0 9px 20px;overflow:auto hidden}.wz-tabs-align-left .wz-tabs-header::-webkit-scrollbar{display:none}.wz-tabs-align-left .wz-tabs-tab{white-space:nowrap;flex:none;margin-right:30px}.wz-tabs-align-left .wz-tabs-tab:last-child{margin-right:20px}.wz-tabs-card .wz-tabs-header{background-color:#0000;border-bottom:none;flex-wrap:wrap;gap:14px;padding:2px 14px}.wz-tabs-card .wz-tabs-tab{background-color:var(--wz-bg-color-base,#f5f5f5);color:var(--wz-text-color-primary,#333);box-sizing:border-box;border:none;border-radius:16px;flex:1;min-width:0;height:32px;margin:0;padding:6px 30px;font-size:13px;font-weight:600;transition:all .3s}.wz-tabs-card .wz-tabs-tab-active{background-color:var(--wz-primary-color,#22c94d);color:var(--wz-text-color-white,#fff);font-weight:700}.wz-tabs-card .wz-tabs-tab-disabled{background-color:var(--wz-bg-color-base,#f5f5f5);color:var(--wz-disabled-color,#ccc);cursor:not-allowed}.wz-tabs-card .wz-tabs-content{padding-top:10px}.wz-tabs-text .wz-tabs-header{justify-content:flex-start;gap:24px;padding:12px 16px}.wz-tabs-text .wz-tabs-tab{color:var(--wz-text-color-primary,#333);flex:none;font-size:14px;font-weight:500;line-height:22px;transition:all .2s ease-in-out}.wz-tabs-text .wz-tabs-tab-text{padding-bottom:0}.wz-tabs-text .wz-tabs-tab-active{color:#000000d9;font-size:18px;font-weight:500;line-height:26px}.wz-tabs-text .wz-tabs-tab-disabled{color:var(--wz-disabled-color,#ccc);cursor:not-allowed}
|
package/dist/Tabs/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.wz-tabs{background:var(--wz-bg-color-white,#fff);box-sizing:border-box;width:100%}.wz-tabs-header{
|
|
1
|
+
.wz-tabs{background:var(--wz-bg-color-white,#fff);box-sizing:border-box;width:100%}.wz-tabs-header{background:var(--wz-bg-color-white,#fff);z-index:1;padding:9px 14px;display:flex;position:relative}.wz-tabs-tab{text-align:center;color:var(--wz-text-color-regular,#666);cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;background:0 0;outline:none;flex:1;height:22px;font-size:14px;transition:color .2s ease-in-out;position:relative}.wz-tabs-tab-active{color:var(--wz-primary-color,#22c94d);font-weight:600}.wz-tabs-tab-disabled{color:var(--wz-disabled-color,#c0c4cc);cursor:not-allowed;opacity:.5}.wz-tabs-tab-text{padding-bottom:8px;display:inline-block;position:relative}.wz-tabs-tab .wz-tabs-badge{background-color:var(--wz-danger-color,#ff4d4f);color:var(--wz-text-color-white,#fff);white-space:nowrap;z-index:1;box-sizing:border-box;text-align:center;border-radius:16px;min-width:16px;height:16px;padding:0 4px;font-size:12px;line-height:16px;position:absolute;top:0;right:-25%;transform:translate(50%,-50%)}.wz-tabs-underline{background:var(--wz-primary-color,#22c94d);border-radius:2px;width:100%;height:2px;transition:all .2s ease-in-out;position:absolute;bottom:0;left:50%;transform:translate(-50%)}.wz-tabs-content{color:var(--wz-text-color-regular,#666);background:var(--wz-bg-color-white,#fff);padding:12px;font-size:14px}.wz-tabs-align-left .wz-tabs-header{-webkit-overflow-scrolling:touch;scrollbar-width:none;-ms-overflow-style:none;justify-content:flex-start;padding:9px 0 9px 20px;overflow:auto hidden}.wz-tabs-align-left .wz-tabs-header::-webkit-scrollbar{display:none}.wz-tabs-align-left .wz-tabs-tab{white-space:nowrap;flex:none;margin-right:30px}.wz-tabs-align-left .wz-tabs-tab:last-child{margin-right:20px}.wz-tabs-card .wz-tabs-header{background-color:#0000;border-bottom:none;flex-wrap:wrap;gap:14px;padding:2px 14px}.wz-tabs-card .wz-tabs-tab{background-color:var(--wz-bg-color-base,#f5f5f5);color:var(--wz-text-color-primary,#333);box-sizing:border-box;border:none;border-radius:16px;flex:1;min-width:0;height:32px;margin:0;padding:6px 30px;font-size:13px;font-weight:600;transition:all .3s}.wz-tabs-card .wz-tabs-tab-active{background-color:var(--wz-primary-color,#22c94d);color:var(--wz-text-color-white,#fff);font-weight:700}.wz-tabs-card .wz-tabs-tab-disabled{background-color:var(--wz-bg-color-base,#f5f5f5);color:var(--wz-disabled-color,#ccc);cursor:not-allowed}.wz-tabs-card .wz-tabs-content{padding-top:10px}.wz-tabs-text .wz-tabs-header{justify-content:flex-start;gap:24px;padding:12px 16px}.wz-tabs-text .wz-tabs-tab{color:var(--wz-text-color-primary,#333);flex:none;font-size:14px;font-weight:500;line-height:22px;transition:all .2s ease-in-out}.wz-tabs-text .wz-tabs-tab-text{padding-bottom:0}.wz-tabs-text .wz-tabs-tab-active{color:#000000d9;font-size:18px;font-weight:500;line-height:26px}.wz-tabs-text .wz-tabs-tab-disabled{color:var(--wz-disabled-color,#ccc);cursor:not-allowed}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.wz-time-picker{background:var(--wz-time-picker-bg,#f5f5f5);-webkit-user-select:none;user-select:none;touch-action:pan-y;width:100%;position:relative;overflow:hidden}.wz-time-picker-list{-webkit-overflow-scrolling:touch;scrollbar-width:none;z-index:2;position:relative;overflow-y:scroll}.wz-time-picker-list::-webkit-scrollbar{display:none}.wz-time-picker-item{font-size:var(--wz-time-picker-font-size,22px);color:var(--wz-time-picker-item-color,#bbb);background:0 0;justify-content:center;align-items:center;font-weight:600;transition:color .2s;display:flex}.wz-time-picker-item.active{color:var(--wz-time-picker-active-color,#111)}.wz-time-picker-mask{z-index:3;pointer-events:none;position:absolute;left:0;right:0}.wz-time-picker-mask-top{background:linear-gradient(to bottom,var(--wz-time-picker-bg,#f5f5f5)20%,#f5f5f500);top:0}.wz-time-picker-mask-bottom{background:linear-gradient(to top,var(--wz-time-picker-bg,#f5f5f5)20%,#f5f5f500);bottom:0}.wz-time-picker-indicator{z-index:1;pointer-events:none;background:var(--wz-time-picker-active-bg,#fff);border-radius:10px;position:absolute;top:50%;left:
|
|
1
|
+
.wz-time-picker{background:var(--wz-time-picker-bg,#f5f5f5);-webkit-user-select:none;user-select:none;touch-action:pan-y;width:100%;position:relative;overflow:hidden}.wz-time-picker-list{-webkit-overflow-scrolling:touch;scrollbar-width:none;z-index:2;position:relative;overflow-y:scroll}.wz-time-picker-list::-webkit-scrollbar{display:none}.wz-time-picker-item{font-size:var(--wz-time-picker-font-size,22px);color:var(--wz-time-picker-item-color,#bbb);background:0 0;justify-content:center;align-items:center;font-weight:600;transition:color .2s;display:flex}.wz-time-picker-item.active{color:var(--wz-time-picker-active-color,#111)}.wz-time-picker-mask{z-index:3;pointer-events:none;position:absolute;left:0;right:0}.wz-time-picker-mask-top{background:linear-gradient(to bottom,var(--wz-time-picker-bg,#f5f5f5)20%,#f5f5f500);top:0}.wz-time-picker-mask-bottom{background:linear-gradient(to top,var(--wz-time-picker-bg,#f5f5f5)20%,#f5f5f500);bottom:0}.wz-time-picker-indicator{z-index:1;pointer-events:none;background:var(--wz-time-picker-active-bg,#fff);border-radius:10px;position:absolute;top:50%;left:0;right:0;transform:translateY(-50%)}.wz-time-picker-list:after{content:"";z-index:-1;pointer-events:none;display:block;position:absolute;top:33.33%;bottom:33.33%;left:0;right:0}.wz-time-picker-item:nth-child(n+2):nth-child(-n+99):nth-child(2n){color:var(--wz-time-picker-active-color,#111)}.wz-time-picker-double-columns{flex-direction:row;width:100%;height:100%;display:flex}.wz-time-picker-list{flex:1 1 0;min-width:0}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.wz-time-picker{background:var(--wz-time-picker-bg,#f5f5f5);-webkit-user-select:none;user-select:none;touch-action:pan-y;width:100%;position:relative;overflow:hidden}.wz-time-picker-list{-webkit-overflow-scrolling:touch;scrollbar-width:none;z-index:2;position:relative;overflow-y:scroll}.wz-time-picker-list::-webkit-scrollbar{display:none}.wz-time-picker-item{font-size:var(--wz-time-picker-font-size,22px);color:var(--wz-time-picker-item-color,#bbb);background:0 0;justify-content:center;align-items:center;font-weight:600;transition:color .2s;display:flex}.wz-time-picker-item.active{color:var(--wz-time-picker-active-color,#111)}.wz-time-picker-mask{z-index:3;pointer-events:none;position:absolute;left:0;right:0}.wz-time-picker-mask-top{background:linear-gradient(to bottom,var(--wz-time-picker-bg,#f5f5f5)20%,#f5f5f500);top:0}.wz-time-picker-mask-bottom{background:linear-gradient(to top,var(--wz-time-picker-bg,#f5f5f5)20%,#f5f5f500);bottom:0}.wz-time-picker-indicator{z-index:1;pointer-events:none;background:var(--wz-time-picker-active-bg,#fff);border-radius:10px;position:absolute;top:50%;left:
|
|
1
|
+
.wz-time-picker{background:var(--wz-time-picker-bg,#f5f5f5);-webkit-user-select:none;user-select:none;touch-action:pan-y;width:100%;position:relative;overflow:hidden}.wz-time-picker-list{-webkit-overflow-scrolling:touch;scrollbar-width:none;z-index:2;position:relative;overflow-y:scroll}.wz-time-picker-list::-webkit-scrollbar{display:none}.wz-time-picker-item{font-size:var(--wz-time-picker-font-size,22px);color:var(--wz-time-picker-item-color,#bbb);background:0 0;justify-content:center;align-items:center;font-weight:600;transition:color .2s;display:flex}.wz-time-picker-item.active{color:var(--wz-time-picker-active-color,#111)}.wz-time-picker-mask{z-index:3;pointer-events:none;position:absolute;left:0;right:0}.wz-time-picker-mask-top{background:linear-gradient(to bottom,var(--wz-time-picker-bg,#f5f5f5)20%,#f5f5f500);top:0}.wz-time-picker-mask-bottom{background:linear-gradient(to top,var(--wz-time-picker-bg,#f5f5f5)20%,#f5f5f500);bottom:0}.wz-time-picker-indicator{z-index:1;pointer-events:none;background:var(--wz-time-picker-active-bg,#fff);border-radius:10px;position:absolute;top:50%;left:0;right:0;transform:translateY(-50%)}.wz-time-picker-list:after{content:"";z-index:-1;pointer-events:none;display:block;position:absolute;top:33.33%;bottom:33.33%;left:0;right:0}.wz-time-picker-item:nth-child(n+2):nth-child(-n+99):nth-child(2n){color:var(--wz-time-picker-active-color,#111)}.wz-time-picker-double-columns{flex-direction:row;width:100%;height:100%;display:flex}.wz-time-picker-list{flex:1 1 0;min-width:0}
|
package/dist/Tip/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState, useEffect } from "react";
|
|
2
3
|
function getDefaultExportFromCjs(x) {
|
|
3
4
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
4
5
|
}
|
|
@@ -82,20 +83,42 @@ const Tip = ({
|
|
|
82
83
|
className,
|
|
83
84
|
visible = true,
|
|
84
85
|
onClose,
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
marquee = false,
|
|
87
|
+
bold = false,
|
|
88
|
+
icon,
|
|
89
|
+
showAction = false,
|
|
90
|
+
actionText = "查看",
|
|
91
|
+
onAction
|
|
87
92
|
}) => {
|
|
93
|
+
const contentRef = useRef(null);
|
|
94
|
+
const [isMultiLine, setIsMultiLine] = useState(false);
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
if (contentRef.current && !marquee) {
|
|
97
|
+
const el = contentRef.current;
|
|
98
|
+
const lineHeight = parseFloat(getComputedStyle(el).lineHeight) || 20;
|
|
99
|
+
setIsMultiLine(el.scrollHeight > lineHeight * 1.5);
|
|
100
|
+
}
|
|
101
|
+
}, [content, marquee]);
|
|
88
102
|
if (!visible) {
|
|
89
103
|
return null;
|
|
90
104
|
}
|
|
91
105
|
const baseClass = "wz-tip";
|
|
106
|
+
const hasRightArea = showAction || onClose;
|
|
92
107
|
const tipClass = classnames(baseClass, className, {
|
|
93
|
-
[`${baseClass}--marquee`]: marquee
|
|
108
|
+
[`${baseClass}--marquee`]: marquee,
|
|
109
|
+
[`${baseClass}--bold`]: bold,
|
|
110
|
+
[`${baseClass}--center`]: !marquee && !isMultiLine,
|
|
111
|
+
[`${baseClass}--left`]: !marquee && isMultiLine,
|
|
112
|
+
[`${baseClass}--has-icon`]: !!icon,
|
|
113
|
+
[`${baseClass}--has-right`]: hasRightArea
|
|
94
114
|
});
|
|
95
115
|
const contentNode = marquee ? /* @__PURE__ */ jsx("div", { className: `${baseClass}-marquee-box`, children: /* @__PURE__ */ jsx("span", { children: content }) }) : content;
|
|
96
116
|
return /* @__PURE__ */ jsxs("div", { className: tipClass, children: [
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
|
|
117
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}-content`, ref: contentRef, children: [
|
|
118
|
+
icon && /* @__PURE__ */ jsx("span", { className: `${baseClass}-icon`, children: /* @__PURE__ */ jsx(Icon, { name: icon, size: 16 }) }),
|
|
119
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}-text`, children: contentNode })
|
|
120
|
+
] }),
|
|
121
|
+
showAction && /* @__PURE__ */ jsx("div", { className: `${baseClass}-action`, onClick: onAction, children: actionText }),
|
|
99
122
|
onClose && /* @__PURE__ */ jsx("div", { className: `${baseClass}-close`, onClick: onClose, children: /* @__PURE__ */ jsx(Icon, { name: "close", size: 16 }) })
|
|
100
123
|
] });
|
|
101
124
|
};
|
package/dist/Tip/index.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
!function(e,
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react/jsx-runtime"),require("react")):"function"==typeof define&&define.amd?define(["react/jsx-runtime","react"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).Tip=t(e.jsxRuntime,e.React)}(this,(function(e,t){"use strict";function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s,o={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
|
-
*/
|
|
6
|
+
*/s=o,function(){var e={}.hasOwnProperty;function t(){for(var n=[],s=0;s<arguments.length;s++){var o=arguments[s];if(o){var i=typeof o;if("string"===i||"number"===i)n.push(o);else if(Array.isArray(o)){if(o.length){var r=t.apply(null,o);r&&n.push(r)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){n.push(o.toString());continue}for(var c in o)e.call(o,c)&&o[c]&&n.push(c)}}}return n.join(" ")}s.exports?(t.default=t,s.exports=t):window.classNames=t}();const i=n(o.exports),r=({name:t,size:n=24,color:s="currentColor",className:o="",style:i,onClick:r,type:c="yunying"})=>{const l={fontSize:"number"==typeof n?`${n}px`:n,color:s,...i},a=`iconfont-${c}`,u=`icon-${t}`;return e.jsx("i",{className:`wz-icon ${a} ${u} ${o}`,style:l,onClick:r})};return({content:n,className:s,visible:o=!0,onClose:c,marquee:l=!1,bold:a=!1,icon:u,showAction:f=!1,actionText:d="查看",onAction:p})=>{const m=t.useRef(null),[h,x]=t.useState(!1);if(t.useEffect((()=>{if(m.current&&!l){const e=m.current,t=parseFloat(getComputedStyle(e).lineHeight)||20;x(e.scrollHeight>1.5*t)}}),[n,l]),!o)return null;const j="wz-tip",y=f||c,$=i(j,s,{[`${j}--marquee`]:l,[`${j}--bold`]:a,[`${j}--center`]:!l&&!h,[`${j}--left`]:!l&&h,[`${j}--has-icon`]:!!u,[`${j}--has-right`]:y}),g=l?e.jsx("div",{className:`${j}-marquee-box`,children:e.jsx("span",{children:n})}):n;return e.jsxs("div",{className:$,children:[e.jsxs("div",{className:`${j}-content`,ref:m,children:[u&&e.jsx("span",{className:`${j}-icon`,children:e.jsx(r,{name:u,size:16})}),e.jsx("span",{className:`${j}-text`,children:g})]}),f&&e.jsx("div",{className:`${j}-action`,onClick:p,children:d}),c&&e.jsx("div",{className:`${j}-close`,onClick:c,children:e.jsx(r,{name:"close",size:16})})]})}}));
|
package/dist/Tip/style/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.wz-tip{color:var(--wz-danger-color,#ff4d4f);background-color:#ff4d4f1f;align-items:center;padding:6px 12px;font-size:13px;display:flex}.wz-tip-content{flex:1}.wz-tip-close{cursor:pointer;margin-left:8px}.wz-tip-action{margin-left:8px}.wz-tip--marquee .wz-tip-content{white-space:nowrap;overflow:hidden}.wz-tip--marquee .wz-tip-marquee-box{padding-left:100%;animation:10s linear infinite marquee;display:inline-block}.wz-tip--marquee .wz-tip-marquee-box span{padding-right:1.5em}@keyframes marquee{to{transform:translate(-100%)}}
|
|
1
|
+
.wz-tip{color:var(--wz-danger-color,#ff4d4f);background-color:#ff4d4f1f;align-items:center;padding:6px 12px;font-size:13px;display:flex}.wz-tip-icon{flex-shrink:0;align-items:center;margin-right:4px;display:inline-flex}.wz-tip-content{flex:1;justify-content:center;align-items:center;display:flex}.wz-tip-text{text-align:center}.wz-tip-close{cursor:pointer;color:#999;flex-shrink:0;align-items:center;margin-left:8px;display:flex}.wz-tip-action{cursor:pointer;border:1px solid #ff4d4f;border-radius:16px;flex-shrink:0;margin-left:8px;padding:2px 14px;font-family:PingFang SC;font-size:13px;font-weight:400}.wz-tip--bold .wz-tip-text{font-weight:600}.wz-tip--left .wz-tip-content{justify-content:flex-start}.wz-tip--left .wz-tip-text{text-align:left}.wz-tip--marquee .wz-tip-content{white-space:nowrap;overflow:hidden}.wz-tip--marquee .wz-tip-marquee-box{padding-left:100%;animation:10s linear infinite marquee;display:inline-block}.wz-tip--marquee .wz-tip-marquee-box span{padding-right:1.5em}@keyframes marquee{to{transform:translate(-100%)}}
|
package/dist/Tip/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.wz-tip{color:var(--wz-danger-color,#ff4d4f);background-color:#ff4d4f1f;align-items:center;padding:6px 12px;font-size:13px;display:flex}.wz-tip-content{flex:1}.wz-tip-close{cursor:pointer;margin-left:8px}.wz-tip-action{margin-left:8px}.wz-tip--marquee .wz-tip-content{white-space:nowrap;overflow:hidden}.wz-tip--marquee .wz-tip-marquee-box{padding-left:100%;animation:10s linear infinite marquee;display:inline-block}.wz-tip--marquee .wz-tip-marquee-box span{padding-right:1.5em}@keyframes marquee{to{transform:translate(-100%)}}.wz-icon{justify-content:center;align-items:center;transition:color .2s ease-in-out;display:inline-flex}.wz-icon-home:before{content:""}.wz-icon-search:before{content:""}.wz-icon-person:before{content:""}.wz-icon-settings:before{content:""}.wz-icon-notifications:before{content:""}.wz-icon-message:before{content:""}.wz-icon-favorite:before{content:""}.wz-icon-star:before{content:""}.wz-icon-close:before{content:""}.wz-icon-check:before{content:""}.wz-icon-arrow-back:before{content:""}.wz-icon-arrow-forward:before{content:""}.wz-icon-menu:before{content:""}.wz-icon-more:before{content:""}.wz-icon-add:before{content:""}.wz-icon-edit:before{content:""}.wz-icon-delete:before{content:""}.wz-icon-share:before{content:""}.wz-icon-download:before{content:""}.wz-icon-upload:before{content:""}.wz-icon-refresh:before{content:""}.wz-icon-help:before{content:""}.wz-icon-info:before{content:""}.wz-icon-warning:before{content:""}.wz-icon-error:before{content:""}.wz-icon-success:before{content:""}
|
|
1
|
+
.wz-tip{color:var(--wz-danger-color,#ff4d4f);background-color:#ff4d4f1f;align-items:center;padding:6px 12px;font-size:13px;display:flex}.wz-tip-icon{flex-shrink:0;align-items:center;margin-right:4px;display:inline-flex}.wz-tip-content{flex:1;justify-content:center;align-items:center;display:flex}.wz-tip-text{text-align:center}.wz-tip-close{cursor:pointer;color:#999;flex-shrink:0;align-items:center;margin-left:8px;display:flex}.wz-tip-action{cursor:pointer;border:1px solid #ff4d4f;border-radius:16px;flex-shrink:0;margin-left:8px;padding:2px 14px;font-family:PingFang SC;font-size:13px;font-weight:400}.wz-tip--bold .wz-tip-text{font-weight:600}.wz-tip--left .wz-tip-content{justify-content:flex-start}.wz-tip--left .wz-tip-text{text-align:left}.wz-tip--marquee .wz-tip-content{white-space:nowrap;overflow:hidden}.wz-tip--marquee .wz-tip-marquee-box{padding-left:100%;animation:10s linear infinite marquee;display:inline-block}.wz-tip--marquee .wz-tip-marquee-box span{padding-right:1.5em}@keyframes marquee{to{transform:translate(-100%)}}.wz-icon{justify-content:center;align-items:center;transition:color .2s ease-in-out;display:inline-flex}.wz-icon-home:before{content:""}.wz-icon-search:before{content:""}.wz-icon-person:before{content:""}.wz-icon-settings:before{content:""}.wz-icon-notifications:before{content:""}.wz-icon-message:before{content:""}.wz-icon-favorite:before{content:""}.wz-icon-star:before{content:""}.wz-icon-close:before{content:""}.wz-icon-check:before{content:""}.wz-icon-arrow-back:before{content:""}.wz-icon-arrow-forward:before{content:""}.wz-icon-menu:before{content:""}.wz-icon-more:before{content:""}.wz-icon-add:before{content:""}.wz-icon-edit:before{content:""}.wz-icon-delete:before{content:""}.wz-icon-share:before{content:""}.wz-icon-download:before{content:""}.wz-icon-upload:before{content:""}.wz-icon-refresh:before{content:""}.wz-icon-help:before{content:""}.wz-icon-info:before{content:""}.wz-icon-warning:before{content:""}.wz-icon-error:before{content:""}.wz-icon-success:before{content:""}
|