1 | import _extends from 'babel-runtime/helpers/extends';
|
2 | import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
3 | import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
4 | import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
5 | import _inherits from 'babel-runtime/helpers/inherits';
|
6 | import classNames from 'classnames';
|
7 | import React from 'react';
|
8 | import PropTypes from 'prop-types';
|
9 |
|
10 | import { bsClass, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils';
|
11 |
|
12 | var propTypes = {
|
13 | |
14 |
|
15 |
|
16 | glyph: PropTypes.string.isRequired
|
17 | };
|
18 |
|
19 | var Glyphicon = function (_React$Component) {
|
20 | _inherits(Glyphicon, _React$Component);
|
21 |
|
22 | function Glyphicon() {
|
23 | _classCallCheck(this, Glyphicon);
|
24 |
|
25 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
26 | }
|
27 |
|
28 | Glyphicon.prototype.render = function render() {
|
29 | var _extends2;
|
30 |
|
31 | var _props = this.props,
|
32 | glyph = _props.glyph,
|
33 | className = _props.className,
|
34 | props = _objectWithoutProperties(_props, ['glyph', 'className']);
|
35 |
|
36 | var _splitBsProps = splitBsProps(props),
|
37 | bsProps = _splitBsProps[0],
|
38 | elementProps = _splitBsProps[1];
|
39 |
|
40 | var classes = _extends({}, getClassSet(bsProps), (_extends2 = {}, _extends2[prefix(bsProps, glyph)] = true, _extends2));
|
41 |
|
42 | return React.createElement('span', _extends({}, elementProps, { className: classNames(className, classes) }));
|
43 | };
|
44 |
|
45 | return Glyphicon;
|
46 | }(React.Component);
|
47 |
|
48 | Glyphicon.propTypes = propTypes;
|
49 |
|
50 | export default bsClass('glyphicon', Glyphicon); |
\ | No newline at end of file |