UNPKG

antd-mobile

Version:

基于 React 的移动设计规范实现

87 lines (56 loc) 2.96 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _extends2 = require('babel-runtime/helpers/extends'); var _extends3 = _interopRequireDefault(_extends2); var _defineProperty2 = require('babel-runtime/helpers/defineProperty'); var _defineProperty3 = _interopRequireDefault(_defineProperty2); var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = require('babel-runtime/helpers/createClass'); var _createClass3 = _interopRequireDefault(_createClass2); var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = require('babel-runtime/helpers/inherits'); var _inherits3 = _interopRequireDefault(_inherits2); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames); var _Checkbox = require('./Checkbox.web'); var _Checkbox2 = _interopRequireDefault(_Checkbox); var _getDataAttr = require('../_util/getDataAttr'); var _getDataAttr2 = _interopRequireDefault(_getDataAttr); var _omit = require('omit.js'); var _omit2 = _interopRequireDefault(_omit); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var AgreeItem = function (_React$Component) { (0, _inherits3['default'])(AgreeItem, _React$Component); function AgreeItem() { (0, _classCallCheck3['default'])(this, AgreeItem); return (0, _possibleConstructorReturn3['default'])(this, (AgreeItem.__proto__ || Object.getPrototypeOf(AgreeItem)).apply(this, arguments)); } (0, _createClass3['default'])(AgreeItem, [{ key: 'render', value: function render() { var _classNames; var _props = this.props, prefixCls = _props.prefixCls, style = _props.style, className = _props.className; var wrapCls = (0, _classnames2['default'])((_classNames = {}, (0, _defineProperty3['default'])(_classNames, prefixCls + '-agree', true), (0, _defineProperty3['default'])(_classNames, className, className), _classNames)); return _react2['default'].createElement( 'div', (0, _extends3['default'])({}, (0, _getDataAttr2['default'])(this.props), { className: wrapCls, style: style }), _react2['default'].createElement(_Checkbox2['default'], (0, _extends3['default'])({}, (0, _omit2['default'])(this.props, ['style']), { className: prefixCls + '-agree-label' })) ); } }]); return AgreeItem; }(_react2['default'].Component); exports['default'] = AgreeItem; AgreeItem.defaultProps = { prefixCls: 'am-checkbox' }; module.exports = exports['default'];