UNPKG

1.68 kBJavaScriptView Raw
1import _extends from 'babel-runtime/helpers/extends';
2import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
3import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
4import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
5import _inherits from 'babel-runtime/helpers/inherits';
6
7var _class, _temp;
8
9import React, { Component } from 'react';
10import PropTypes from 'prop-types';
11import classNames from 'classnames';
12import ConfigProvider from '../config-provider';
13
14/**
15 * Card.Actions
16 * @order 5
17 */
18var CardActions = (_temp = _class = function (_Component) {
19 _inherits(CardActions, _Component);
20
21 function CardActions() {
22 _classCallCheck(this, CardActions);
23
24 return _possibleConstructorReturn(this, _Component.apply(this, arguments));
25 }
26
27 CardActions.prototype.render = function render() {
28 var _props = this.props,
29 prefix = _props.prefix,
30 Component = _props.component,
31 className = _props.className,
32 others = _objectWithoutProperties(_props, ['prefix', 'component', 'className']);
33
34 return React.createElement(Component, _extends({}, others, {
35 className: classNames(prefix + 'card-actions', className)
36 }));
37 };
38
39 return CardActions;
40}(Component), _class.propTypes = {
41 prefix: PropTypes.string,
42 /**
43 * 设置标签类型
44 */
45 component: PropTypes.elementType,
46 className: PropTypes.string
47}, _class.defaultProps = {
48 prefix: 'next-',
49 component: 'div'
50}, _temp);
51CardActions.displayName = 'CardActions';
52
53
54export default ConfigProvider.config(CardActions);
\No newline at end of file