1 | import _extends from "@babel/runtime-corejs2/helpers/esm/extends";
|
2 | import _objectWithoutPropertiesLoose from "@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose";
|
3 | import _inheritsLoose from "@babel/runtime-corejs2/helpers/esm/inheritsLoose";
|
4 | import classNames from 'classnames';
|
5 | import React from 'react';
|
6 | import PropTypes from 'prop-types';
|
7 | import SafeAnchor from './SafeAnchor';
|
8 | var propTypes = {
|
9 | |
10 |
|
11 |
|
12 | active: PropTypes.bool,
|
13 |
|
14 | |
15 |
|
16 |
|
17 | href: PropTypes.string,
|
18 |
|
19 | |
20 |
|
21 |
|
22 | title: PropTypes.node,
|
23 |
|
24 | |
25 |
|
26 |
|
27 | target: PropTypes.string
|
28 | };
|
29 | var defaultProps = {
|
30 | active: false
|
31 | };
|
32 |
|
33 | var BreadcrumbItem =
|
34 |
|
35 | function (_React$Component) {
|
36 | _inheritsLoose(BreadcrumbItem, _React$Component);
|
37 |
|
38 | function BreadcrumbItem() {
|
39 | return _React$Component.apply(this, arguments) || this;
|
40 | }
|
41 |
|
42 | var _proto = BreadcrumbItem.prototype;
|
43 |
|
44 | _proto.render = function render() {
|
45 | var _this$props = this.props,
|
46 | active = _this$props.active,
|
47 | href = _this$props.href,
|
48 | title = _this$props.title,
|
49 | target = _this$props.target,
|
50 | className = _this$props.className,
|
51 | props = _objectWithoutPropertiesLoose(_this$props, ["active", "href", "title", "target", "className"]);
|
52 |
|
53 |
|
54 | var linkProps = {
|
55 | href: href,
|
56 | title: title,
|
57 | target: target
|
58 | };
|
59 | return React.createElement("li", {
|
60 | className: classNames(className, {
|
61 | active: active
|
62 | })
|
63 | }, active ? React.createElement("span", props) : React.createElement(SafeAnchor, _extends({}, props, linkProps)));
|
64 | };
|
65 |
|
66 | return BreadcrumbItem;
|
67 | }(React.Component);
|
68 |
|
69 | BreadcrumbItem.propTypes = propTypes;
|
70 | BreadcrumbItem.defaultProps = defaultProps;
|
71 | export default BreadcrumbItem; |
\ | No newline at end of file |