'use strict';

var _extends = require('@babel/runtime/helpers/extends');
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
require('core-js/modules/es.symbol.js');
require('core-js/modules/es.array.filter.js');
require('core-js/modules/es.array.iterator.js');
require('core-js/modules/es.object.get-own-property-descriptor.js');
require('core-js/modules/es.object.get-own-property-descriptors.js');
require('core-js/modules/es.object.keys.js');
require('core-js/modules/es.object.to-string.js');
require('core-js/modules/web.dom-collections.for-each.js');
require('core-js/modules/web.dom-collections.iterator.js');
var React = require('react');
var LayoutConstants = require('../../constants/LayoutConstants.js');
var CardPropTypes = require('../../constants/CardPropTypes.js');
var Card = require('../Card/Card.js');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var _extends__default = /*#__PURE__*/_interopDefault(_extends);
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefault(_objectWithoutProperties);
var _defineProperty__default = /*#__PURE__*/_interopDefault(_defineProperty);
var React__default = /*#__PURE__*/_interopDefault(React);

var _excluded = ["title", "content", "values", "size", "breakpoint", "footerContent", "locale", "isExpanded", "isLoading", "testId", "i18n"];
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty__default.default(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var propTypes = _objectSpread(_objectSpread({}, CardPropTypes.CardPropTypes), CardPropTypes.MeterChartCardPropTypes);
var defaultProps = {
  size: LayoutConstants.CARD_SIZES.MEDIUMWIDE,
  title: '',
  content: {
    peak: null,
    meterTotal: 100,
    meterUnit: 'Unit',
    legendPosition: 'bottom',
    color: {
      pairing: {
        option: 2
      }
    }
  },
  footerContent: null,
  locale: 'en',
  values: []
};
var MeterChartCard = function MeterChartCard(_ref) {
  var title = _ref.title,
    content = _ref.content,
    values = _ref.values,
    size = _ref.size,
    breakpoint = _ref.breakpoint,
    footerContent = _ref.footerContent,
    locale = _ref.locale,
    isExpanded = _ref.isExpanded,
    isLoading = _ref.isLoading,
    testId = _ref.testId,
    i18n = _ref.i18n,
    others = _objectWithoutProperties__default.default(_ref, _excluded);
  return /*#__PURE__*/React__default.default.createElement(Card.default, _extends__default.default({
    title: title,
    size: size,
    breakpoint: breakpoint,
    locale: locale,
    isExpanded: isExpanded,
    isLoading: isLoading,
    testId: testId,
    footerContent: !isExpanded ? footerContent : null,
    i18n: i18n,
    data: values,
    type: LayoutConstants.CARD_TYPES.METER_CHART,
    content: content
  }, others));
};
MeterChartCard.propTypes = propTypes;
MeterChartCard.defaultProps = defaultProps;
MeterChartCard.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "MeterChartCard",
  "props": {
    "size": {
      "defaultValue": {
        "value": "CARD_SIZES.MEDIUMWIDE",
        "computed": true
      },
      "required": false
    },
    "title": {
      "defaultValue": {
        "value": "''",
        "computed": false
      },
      "required": false
    },
    "content": {
      "defaultValue": {
        "value": "{\n  peak: null,\n  meterTotal: 100,\n  meterUnit: 'Unit',\n  legendPosition: 'bottom',\n  color: {\n    pairing: {\n      option: 2,\n    },\n  },\n}",
        "computed": false
      },
      "required": false
    },
    "footerContent": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "required": false
    },
    "locale": {
      "defaultValue": {
        "value": "'en'",
        "computed": false
      },
      "required": false
    },
    "values": {
      "defaultValue": {
        "value": "[]",
        "computed": false
      },
      "required": false
    }
  },
  "composes": ["../../constants/CardPropTypes"]
};
var MeterChartCard$1 = MeterChartCard;

module.exports = MeterChartCard$1;
