'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.SlidingPanelDropdown = exports.SlidingPanel = exports.SlidingPanelSection = exports.SlidingPanelHeader = exports.ToggleIcon = undefined;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _classnames = require('classnames');

var _classnames2 = _interopRequireDefault(_classnames);

require('./SlidingPanel.css');

var _FilterIcon = require('mdi-react/FilterIcon');

var _FilterIcon2 = _interopRequireDefault(_FilterIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ToggleIcon = exports.ToggleIcon = function ToggleIcon(_ref) {
  var onClick = _ref.onClick,
      hoverText = _ref.hoverText,
      toggleIconState = _ref.toggleIconState;

  var iconState = toggleIconState ? ' active' : '';
  return _react2.default.createElement(
    'a',
    { className: 'sliding-panel-toggle-icon' + iconState, onClick: onClick, title: hoverText },
    _react2.default.createElement(
      'div',
      { className: 'filter-icn-btn' },
      _react2.default.createElement(_FilterIcon2.default, { className: 'filterIcon' }),
      _react2.default.createElement(
        'span',
        null,
        'Show Filters'
      )
    )
  );
};
ToggleIcon.propTypes = {
  onClick: _propTypes2.default.func.isRequired
};

var SlidingPanelHeader = exports.SlidingPanelHeader = function SlidingPanelHeader(_ref2) {
  var children = _ref2.children;

  return _react2.default.createElement(
    'li',
    { className: 'sliding-panel-header' },
    children
  );
};

var SlidingPanelSection = exports.SlidingPanelSection = function SlidingPanelSection(_ref3) {
  var children = _ref3.children;

  return _react2.default.createElement(
    'li',
    { className: 'sliding-panel-section' },
    children
  );
};

var SlidingPanel = exports.SlidingPanel = function SlidingPanel(_ref4) {
  var children = _ref4.children,
      active = _ref4.active;

  return _react2.default.createElement(
    'div',
    { className: (0, _classnames2.default)('sliding-panel', { active: active }) },
    _react2.default.createElement(
      'ul',
      null,
      children
    )
  );
};

var SlidingPanelDropdown = exports.SlidingPanelDropdown = function SlidingPanelDropdown(_ref5) {
  var label = _ref5.label,
      children = _ref5.children,
      onClick = _ref5.onClick,
      expanded = _ref5.expanded;

  var containerClasses = (0, _classnames2.default)('filter-container', { expanded: expanded });
  var optionsClasses = (0, _classnames2.default)('filter-options', { expanded: expanded });
  return _react2.default.createElement(
    'ul',
    { className: containerClasses },
    _react2.default.createElement(
      'a',
      { className: 'filter-container-label', onClick: onClick },
      _react2.default.createElement(
        'div',
        null,
        label
      ),
      _react2.default.createElement('i', { className: 'fa fa-chevron-right' })
    ),
    _react2.default.createElement(
      'ul',
      null,
      _react2.default.createElement(
        'div',
        { className: optionsClasses },
        children
      )
    )
  );
};

SlidingPanel.propTypes = {
  active: _propTypes2.default.bool
};