wz-h5-design 1.0.7 → 1.0.8
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/style/index.css +1 -1
- package/dist/Button/style.css +1 -1
- package/dist/Dialog/style.css +1 -1
- package/dist/Divider/index.js +2 -2
- package/dist/Divider/index.umd.cjs +1 -1
- package/dist/Stepper/style/index.css +1 -1
- package/dist/Stepper/style.css +1 -1
- package/dist/Tag/index.js +17 -4
- package/dist/Tag/index.umd.cjs +2 -2
- package/dist/Tag/style/index.css +1 -1
- package/dist/Tag/style.css +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/Tag/Tag.d.ts +8 -0
- package/dist/wz-h5-design.es.js +19 -6
- package/dist/wz-h5-design.umd.js +2 -2
- package/package.json +1 -1
|
@@ -19,6 +19,14 @@ export interface TagProps {
|
|
|
19
19
|
* @description 背景颜色,type='solid' 时生效
|
|
20
20
|
*/
|
|
21
21
|
bgColor?: string;
|
|
22
|
+
/**
|
|
23
|
+
* @description 边框颜色,type='line' 时生效
|
|
24
|
+
*/
|
|
25
|
+
borderColor?: string;
|
|
26
|
+
/**
|
|
27
|
+
* @description 圆角大小
|
|
28
|
+
*/
|
|
29
|
+
borderRadius?: number | string;
|
|
22
30
|
/**
|
|
23
31
|
* @description 字体粗细
|
|
24
32
|
*/
|
package/dist/wz-h5-design.es.js
CHANGED
|
@@ -1327,8 +1327,8 @@ const Divider = ({
|
|
|
1327
1327
|
className: `wz-divider wz-divider--${direction} ${className}`,
|
|
1328
1328
|
style: {
|
|
1329
1329
|
background: color || defaultColor,
|
|
1330
|
-
width: isVertical ?
|
|
1331
|
-
height: isVertical ? length ||
|
|
1330
|
+
width: isVertical ? 1 : length || "100%",
|
|
1331
|
+
height: isVertical ? length || 16 : 2,
|
|
1332
1332
|
margin,
|
|
1333
1333
|
...style
|
|
1334
1334
|
}
|
|
@@ -2198,28 +2198,41 @@ const Tag = (props) => {
|
|
|
2198
2198
|
size = "large",
|
|
2199
2199
|
color,
|
|
2200
2200
|
bgColor,
|
|
2201
|
+
borderColor,
|
|
2202
|
+
borderRadius,
|
|
2201
2203
|
fontWeight,
|
|
2202
2204
|
className,
|
|
2203
2205
|
style,
|
|
2204
2206
|
children
|
|
2205
2207
|
} = props;
|
|
2206
|
-
const classes = classNames(
|
|
2208
|
+
const classes = classNames(
|
|
2209
|
+
"wz-tag",
|
|
2210
|
+
`wz-tag-${type}`,
|
|
2211
|
+
`wz-tag-${size}`,
|
|
2212
|
+
className
|
|
2213
|
+
);
|
|
2207
2214
|
const tagStyle = useMemo(() => {
|
|
2208
2215
|
const newStyle = { ...style };
|
|
2209
2216
|
if (color) {
|
|
2210
2217
|
newStyle.color = color;
|
|
2211
|
-
if (type === "line") {
|
|
2218
|
+
if (type === "line" && !borderColor) {
|
|
2212
2219
|
newStyle.borderColor = hexToRgba(color, 0.5);
|
|
2213
2220
|
}
|
|
2214
2221
|
}
|
|
2215
|
-
if (
|
|
2222
|
+
if (borderColor && type === "line") {
|
|
2223
|
+
newStyle.borderColor = borderColor;
|
|
2224
|
+
}
|
|
2225
|
+
if (bgColor) {
|
|
2216
2226
|
newStyle.backgroundColor = bgColor;
|
|
2217
2227
|
}
|
|
2228
|
+
if (borderRadius !== void 0) {
|
|
2229
|
+
newStyle.borderRadius = typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius;
|
|
2230
|
+
}
|
|
2218
2231
|
if (fontWeight) {
|
|
2219
2232
|
newStyle.fontWeight = fontWeight;
|
|
2220
2233
|
}
|
|
2221
2234
|
return newStyle;
|
|
2222
|
-
}, [type, color, bgColor, fontWeight, style]);
|
|
2235
|
+
}, [type, color, bgColor, borderColor, borderRadius, fontWeight, style]);
|
|
2223
2236
|
return /* @__PURE__ */ jsx("div", { className: classes, style: tagStyle, children });
|
|
2224
2237
|
};
|
|
2225
2238
|
const Tip = ({
|