'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 Card = require('../Card/Card.js');
var LayoutConstants = require('../../constants/LayoutConstants.js');
var CardPropTypes = require('../../constants/CardPropTypes.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", "values", "content", "size", "breakpoint", "locale", "isLoading", "testId", "footerContent", "isExpanded", "i18n", "style"];
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.SparklineChartCardPropTypes);
var defaultProps = {
  size: LayoutConstants.CARD_SIZES.MEDIUMWIDE,
  title: null,
  content: {
    xLabel: 'x label',
    yLabel: 'y label'
  },
  footerContent: null,
  locale: 'en',
  values: []
};
var SparklineChartCard = function SparklineChartCard(_ref) {
  var title = _ref.title,
    values = _ref.values,
    content = _ref.content,
    size = _ref.size,
    breakpoint = _ref.breakpoint,
    locale = _ref.locale,
    isLoading = _ref.isLoading,
    testId = _ref.testId,
    footerContent = _ref.footerContent,
    isExpanded = _ref.isExpanded,
    i18n = _ref.i18n;
    _ref.style;
    var 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.SPARKLINE_CHART,
    content: content
  }, others));
};
SparklineChartCard.propTypes = propTypes;
SparklineChartCard.defaultProps = defaultProps;
SparklineChartCard.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "SparklineChartCard",
  "props": {
    "size": {
      "defaultValue": {
        "value": "CARD_SIZES.MEDIUMWIDE",
        "computed": true
      },
      "required": false
    },
    "title": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "required": false
    },
    "content": {
      "defaultValue": {
        "value": "{\n  xLabel: 'x label',\n  yLabel: 'y label',\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 SparklineChartCard$1 = SparklineChartCard;

module.exports = SparklineChartCard$1;
