@uiw/react-card
Advanced tools
Comparing version 4.9.6 to 4.9.7
@@ -7,8 +7,10 @@ "use strict"; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); | ||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose")); | ||
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); | ||
@@ -37,24 +39,24 @@ var _react = _interopRequireWildcard(require("react")); | ||
children = props.children, | ||
resetProps = (0, _objectWithoutPropertiesLoose2["default"])(props, _excluded); | ||
resetProps = (0, _objectWithoutProperties2["default"])(props, _excluded); | ||
var cls = (0, _react.useMemo)(function () { | ||
return [prefixCls, className, bordered ? prefixCls + "-bordered" : null, noHover ? prefixCls + "-no-hover" : null, active ? 'active' : null].filter(Boolean).join(' ').trim(); | ||
return [prefixCls, className, bordered ? "".concat(prefixCls, "-bordered") : null, noHover ? "".concat(prefixCls, "-no-hover") : null, active ? 'active' : null].filter(Boolean).join(' ').trim(); | ||
}, [prefixCls, className, bordered, noHover]); | ||
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _extends2["default"])({}, resetProps, { | ||
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, resetProps), {}, { | ||
className: cls, | ||
ref: ref, | ||
children: [(title || extra) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", { | ||
className: prefixCls + "-head", | ||
className: "".concat(prefixCls, "-head"), | ||
children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", { | ||
className: prefixCls + "-head-title", | ||
className: "".concat(prefixCls, "-head-title"), | ||
children: title | ||
}), extra && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", { | ||
className: prefixCls + "-extra", | ||
className: "".concat(prefixCls, "-extra"), | ||
children: extra | ||
})] | ||
}), children && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", { | ||
className: [prefixCls + "-body", bodyClassName].filter(Boolean).join(' ').trim(), | ||
className: ["".concat(prefixCls, "-body"), bodyClassName].filter(Boolean).join(' ').trim(), | ||
style: bodyStyle, | ||
children: children | ||
}), footer && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", { | ||
className: prefixCls + "-footer", | ||
className: "".concat(prefixCls, "-footer"), | ||
children: footer | ||
@@ -61,0 +63,0 @@ })] |
@@ -1,3 +0,3 @@ | ||
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | ||
import _extends from "@babel/runtime/helpers/extends"; | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose"; | ||
var _excluded = ["prefixCls", "className", "title", "extra", "footer", "bordered", "noHover", "active", "bodyStyle", "bodyClassName", "children"]; | ||
@@ -8,23 +8,19 @@ import React, { useMemo } from 'react'; | ||
import { jsxs as _jsxs } from "react/jsx-runtime"; | ||
export default /*#__PURE__*/React.forwardRef(function (props, ref) { | ||
var _props$prefixCls = props.prefixCls, | ||
prefixCls = _props$prefixCls === void 0 ? 'w-card' : _props$prefixCls, | ||
className = props.className, | ||
title = props.title, | ||
extra = props.extra, | ||
footer = props.footer, | ||
_props$bordered = props.bordered, | ||
bordered = _props$bordered === void 0 ? true : _props$bordered, | ||
_props$noHover = props.noHover, | ||
noHover = _props$noHover === void 0 ? false : _props$noHover, | ||
_props$active = props.active, | ||
active = _props$active === void 0 ? false : _props$active, | ||
bodyStyle = props.bodyStyle, | ||
bodyClassName = props.bodyClassName, | ||
children = props.children, | ||
export default /*#__PURE__*/React.forwardRef((props, ref) => { | ||
var { | ||
prefixCls = 'w-card', | ||
className, | ||
title, | ||
extra, | ||
footer, | ||
bordered = true, | ||
noHover = false, | ||
active = false, | ||
bodyStyle, | ||
bodyClassName, | ||
children | ||
} = props, | ||
resetProps = _objectWithoutPropertiesLoose(props, _excluded); | ||
var cls = useMemo(function () { | ||
return [prefixCls, className, bordered ? prefixCls + "-bordered" : null, noHover ? prefixCls + "-no-hover" : null, active ? 'active' : null].filter(Boolean).join(' ').trim(); | ||
}, [prefixCls, className, bordered, noHover]); | ||
var cls = useMemo(() => [prefixCls, className, bordered ? prefixCls + "-bordered" : null, noHover ? prefixCls + "-no-hover" : null, active ? 'active' : null].filter(Boolean).join(' ').trim(), [prefixCls, className, bordered, noHover]); | ||
return /*#__PURE__*/_jsxs("div", _extends({}, resetProps, { | ||
@@ -31,0 +27,0 @@ className: cls, |
{ | ||
"name": "@uiw/react-card", | ||
"version": "4.9.6", | ||
"version": "4.9.7", | ||
"description": "Card component", | ||
@@ -47,7 +47,7 @@ "author": "Kenny Wong <wowohoo@qq.com>", | ||
"dependencies": { | ||
"@uiw/utils": "^4.9.6" | ||
"@uiw/utils": "^4.9.7" | ||
}, | ||
"devDependencies": { | ||
"@babel/runtime": "7.15.3", | ||
"@types/react": "17.0.19", | ||
"@babel/runtime": "7.15.4", | ||
"@types/react": "17.0.20", | ||
"@types/react-dom": "17.0.9", | ||
@@ -54,0 +54,0 @@ "react": "17.0.2", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
24810
302
Updated@uiw/utils@^4.9.7