Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@bmc/react-common / dist / prop / PropertyList.js
Size: Mime:
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import React, { Component } from 'react';
import { isString } from 'lodash';
import './PropertyList.css';

var PropertyList =
/*#__PURE__*/
function (_Component) {
  _inherits(PropertyList, _Component);

  function PropertyList(props) {
    var _this;

    _classCallCheck(this, PropertyList);

    _this = _possibleConstructorReturn(this, _getPrototypeOf(PropertyList).call(this, props));
    _this.state = {
      data: props.data
    };
    return _this;
  }

  _createClass(PropertyList, [{
    key: "renderHeading",
    value: function renderHeading(props) {
      var title = props.title;
      var subtitle = props.subtitle;
      return React.createElement("div", {
        className: "heading"
      }, isString(title) && React.createElement("h3", {
        className: "title"
      }, title, isString(subtitle) && React.createElement("small", {
        className: "subtitle"
      }, subtitle)));
    }
  }, {
    key: "renderChildren",
    value: function renderChildren(props) {
      return React.Children.map(props.children, function (child) {
        if (child == null) {
          return null;
        }

        return React.cloneElement(child, {
          data: props.data
        });
      });
    }
  }, {
    key: "render",
    value: function render() {
      return React.createElement("div", {
        className: "propertyList"
      }, this.renderHeading(this.props), React.createElement("dl", {
        className: "propertyList dl-horizontal"
      }, this.renderChildren(this.props)));
    }
  }]);

  return PropertyList;
}(Component);

export default PropertyList;
//# sourceMappingURL=PropertyList.js.map