@uiw/react-card
Advanced tools
Comparing version 4.1.2 to 4.2.1
import React from 'react'; | ||
import { IProps, HTMLDivProps } from '@uiw/utils'; | ||
import './style/index.less'; | ||
export interface ICardProps extends IProps, Omit<HTMLDivProps, 'title'> { | ||
export interface CardProps extends IProps, Omit<HTMLDivProps, 'title'> { | ||
active?: boolean; | ||
@@ -14,5 +14,3 @@ bordered?: boolean; | ||
} | ||
export default class Card extends React.Component<ICardProps, {}> { | ||
static defaultProps: ICardProps; | ||
render(): JSX.Element; | ||
} | ||
declare const _default: (props?: CardProps) => JSX.Element; | ||
export default _default; |
"use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
@@ -16,76 +18,47 @@ | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _react = _interopRequireWildcard(require("react")); | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _classnames2 = _interopRequireDefault(require("classnames")); | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } | ||
var _default = function _default() { | ||
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
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, | ||
resetProps = (0, _objectWithoutProperties2.default)(props, ["prefixCls", "className", "title", "extra", "footer", "bordered", "noHover", "active", "bodyStyle", "bodyClassName", "children"]); | ||
var cls = (0, _react.useMemo)(function () { | ||
var _classnames; | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
return (0, _classnames2.default)(prefixCls, className, (_classnames = {}, (0, _defineProperty2.default)(_classnames, "".concat(prefixCls, "-bordered"), bordered), (0, _defineProperty2.default)(_classnames, "".concat(prefixCls, "-no-hover"), noHover), (0, _defineProperty2.default)(_classnames, "active", active), _classnames)); | ||
}, [prefixCls, className, bordered, noHover]); | ||
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, resetProps, { | ||
className: cls | ||
}), (title || extra) && /*#__PURE__*/_react.default.createElement("div", { | ||
className: "".concat(prefixCls, "-head") | ||
}, title && /*#__PURE__*/_react.default.createElement("div", { | ||
className: "".concat(prefixCls, "-head-title") | ||
}, title), extra && /*#__PURE__*/_react.default.createElement("div", { | ||
className: "".concat(prefixCls, "-extra") | ||
}, extra)), children && /*#__PURE__*/_react.default.createElement("div", { | ||
className: (0, _classnames2.default)("".concat(prefixCls, "-body"), bodyClassName), | ||
style: bodyStyle | ||
}, children), footer && /*#__PURE__*/_react.default.createElement("div", { | ||
className: "".concat(prefixCls, "-footer") | ||
}, footer)); | ||
}; | ||
var Card = /*#__PURE__*/function (_React$Component) { | ||
(0, _inherits2.default)(Card, _React$Component); | ||
var _super = _createSuper(Card); | ||
function Card() { | ||
(0, _classCallCheck2.default)(this, Card); | ||
return _super.apply(this, arguments); | ||
} | ||
(0, _createClass2.default)(Card, [{ | ||
key: "render", | ||
value: function render() { | ||
var _classnames; | ||
var _this$props = this.props, | ||
prefixCls = _this$props.prefixCls, | ||
className = _this$props.className, | ||
title = _this$props.title, | ||
extra = _this$props.extra, | ||
footer = _this$props.footer, | ||
bordered = _this$props.bordered, | ||
noHover = _this$props.noHover, | ||
active = _this$props.active, | ||
bodyStyle = _this$props.bodyStyle, | ||
bodyClassName = _this$props.bodyClassName, | ||
children = _this$props.children, | ||
resetProps = (0, _objectWithoutProperties2.default)(_this$props, ["prefixCls", "className", "title", "extra", "footer", "bordered", "noHover", "active", "bodyStyle", "bodyClassName", "children"]); | ||
var cls = (0, _classnames2.default)(prefixCls, className, (_classnames = {}, (0, _defineProperty2.default)(_classnames, "".concat(prefixCls, "-bordered"), bordered), (0, _defineProperty2.default)(_classnames, "".concat(prefixCls, "-no-hover"), noHover), (0, _defineProperty2.default)(_classnames, "active", active), _classnames)); | ||
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, resetProps, { | ||
className: cls | ||
}), (title || extra) && /*#__PURE__*/_react.default.createElement("div", { | ||
className: "".concat(prefixCls, "-head") | ||
}, title && /*#__PURE__*/_react.default.createElement("div", { | ||
className: "".concat(prefixCls, "-head-title") | ||
}, title), extra && /*#__PURE__*/_react.default.createElement("div", { | ||
className: "".concat(prefixCls, "-extra") | ||
}, extra)), children && /*#__PURE__*/_react.default.createElement("div", { | ||
className: (0, _classnames2.default)("".concat(prefixCls, "-body"), bodyClassName), | ||
style: bodyStyle | ||
}, children), footer && /*#__PURE__*/_react.default.createElement("div", { | ||
className: "".concat(prefixCls, "-footer") | ||
}, footer)); | ||
} | ||
}]); | ||
return Card; | ||
}(_react.default.Component); | ||
exports.default = Card; | ||
Card.defaultProps = { | ||
prefixCls: 'w-card', | ||
bordered: true, | ||
noHover: false, | ||
active: false | ||
}; | ||
exports.default = _default; | ||
module.exports = exports.default; | ||
//# sourceMappingURL=index.js.map |
import React from 'react'; | ||
import { IProps, HTMLDivProps } from '@uiw/utils'; | ||
import './style/index.less'; | ||
export interface ICardProps extends IProps, Omit<HTMLDivProps, 'title'> { | ||
export interface CardProps extends IProps, Omit<HTMLDivProps, 'title'> { | ||
active?: boolean; | ||
@@ -14,5 +14,3 @@ bordered?: boolean; | ||
} | ||
export default class Card extends React.Component<ICardProps, {}> { | ||
static defaultProps: ICardProps; | ||
render(): JSX.Element; | ||
} | ||
declare const _default: (props?: CardProps) => JSX.Element; | ||
export default _default; |
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
import _createClass from "@babel/runtime/helpers/esm/createClass"; | ||
import _inherits from "@babel/runtime/helpers/esm/inherits"; | ||
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; | ||
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
import React from 'react'; | ||
import React, { useMemo } from 'react'; | ||
import classnames from 'classnames'; | ||
import "./style/index.css"; | ||
export default (function () { | ||
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var Card = /*#__PURE__*/function (_React$Component) { | ||
_inherits(Card, _React$Component); | ||
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, | ||
resetProps = _objectWithoutProperties(props, ["prefixCls", "className", "title", "extra", "footer", "bordered", "noHover", "active", "bodyStyle", "bodyClassName", "children"]); | ||
var _super = _createSuper(Card); | ||
var cls = useMemo(function () { | ||
var _classnames; | ||
function Card() { | ||
_classCallCheck(this, Card); | ||
return _super.apply(this, arguments); | ||
} | ||
_createClass(Card, [{ | ||
key: "render", | ||
value: function render() { | ||
var _classnames; | ||
var _this$props = this.props, | ||
prefixCls = _this$props.prefixCls, | ||
className = _this$props.className, | ||
title = _this$props.title, | ||
extra = _this$props.extra, | ||
footer = _this$props.footer, | ||
bordered = _this$props.bordered, | ||
noHover = _this$props.noHover, | ||
active = _this$props.active, | ||
bodyStyle = _this$props.bodyStyle, | ||
bodyClassName = _this$props.bodyClassName, | ||
children = _this$props.children, | ||
resetProps = _objectWithoutProperties(_this$props, ["prefixCls", "className", "title", "extra", "footer", "bordered", "noHover", "active", "bodyStyle", "bodyClassName", "children"]); | ||
var cls = classnames(prefixCls, className, (_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-bordered"), bordered), _defineProperty(_classnames, "".concat(prefixCls, "-no-hover"), noHover), _defineProperty(_classnames, "active", active), _classnames)); | ||
return /*#__PURE__*/React.createElement("div", _extends({}, resetProps, { | ||
className: cls | ||
}), (title || extra) && /*#__PURE__*/React.createElement("div", { | ||
className: "".concat(prefixCls, "-head") | ||
}, title && /*#__PURE__*/React.createElement("div", { | ||
className: "".concat(prefixCls, "-head-title") | ||
}, title), extra && /*#__PURE__*/React.createElement("div", { | ||
className: "".concat(prefixCls, "-extra") | ||
}, extra)), children && /*#__PURE__*/React.createElement("div", { | ||
className: classnames("".concat(prefixCls, "-body"), bodyClassName), | ||
style: bodyStyle | ||
}, children), footer && /*#__PURE__*/React.createElement("div", { | ||
className: "".concat(prefixCls, "-footer") | ||
}, footer)); | ||
} | ||
}]); | ||
return Card; | ||
}(React.Component); | ||
Card.defaultProps = { | ||
prefixCls: 'w-card', | ||
bordered: true, | ||
noHover: false, | ||
active: false | ||
}; | ||
export { Card as default }; | ||
return classnames(prefixCls, className, (_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-bordered"), bordered), _defineProperty(_classnames, "".concat(prefixCls, "-no-hover"), noHover), _defineProperty(_classnames, "active", active), _classnames)); | ||
}, [prefixCls, className, bordered, noHover]); | ||
return /*#__PURE__*/React.createElement("div", _extends({}, resetProps, { | ||
className: cls | ||
}), (title || extra) && /*#__PURE__*/React.createElement("div", { | ||
className: "".concat(prefixCls, "-head") | ||
}, title && /*#__PURE__*/React.createElement("div", { | ||
className: "".concat(prefixCls, "-head-title") | ||
}, title), extra && /*#__PURE__*/React.createElement("div", { | ||
className: "".concat(prefixCls, "-extra") | ||
}, extra)), children && /*#__PURE__*/React.createElement("div", { | ||
className: classnames("".concat(prefixCls, "-body"), bodyClassName), | ||
style: bodyStyle | ||
}, children), footer && /*#__PURE__*/React.createElement("div", { | ||
className: "".concat(prefixCls, "-footer") | ||
}, footer)); | ||
}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@uiw/react-card", | ||
"version": "4.1.2", | ||
"version": "4.2.1", | ||
"description": "Card component", | ||
@@ -47,3 +47,3 @@ "author": "Kenny Wong <wowohoo@qq.com>", | ||
"@uiw/utils": "^4.1.2", | ||
"classnames": "^2.2.6" | ||
"classnames": "2.2.6" | ||
}, | ||
@@ -58,3 +58,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "caafb4b0a1360c2a2bd46903932e4531860ce608" | ||
"gitHead": "f8a4dd106ada12727527eb2a0588be01980be86c" | ||
} |
Sorry, the diff of this file is not supported yet
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
23886
211
+ Addedclassnames@2.2.6(transitive)
- Removedclassnames@2.5.1(transitive)
Updatedclassnames@2.2.6