'use strict';

Liferay.Loader.define("frontend-taglib-clay$clay-card@2.24.1/lib/ClayFileCard", ['module', 'exports', 'require', 'frontend-taglib-clay$clay-icon', 'frontend-taglib-clay$clay-sticker', './ClayCardBase', 'frontend-taglib-clay$clay-component', 'frontend-js-metal-web$metal-web-component', 'frontend-js-metal-web$metal-soy', 'frontend-js-metal-web$metal-state', './action_items_validator', './ClayFileCard.soy'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.ClayFileCard = undefined;

    var _createClass = function () {
      function defineProperties(target, props) {
        for (var i = 0; i < props.length; i++) {
          var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
        }
      }return function (Constructor, protoProps, staticProps) {
        if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
      };
    }();

    require("frontend-taglib-clay$clay-icon");

    require("frontend-taglib-clay$clay-sticker");

    require('./ClayCardBase');

    var _clayComponent = require("frontend-taglib-clay$clay-component");

    var _clayComponent2 = _interopRequireDefault(_clayComponent);

    var _metalWebComponent = require("frontend-js-metal-web$metal-web-component");

    var _metalWebComponent2 = _interopRequireDefault(_metalWebComponent);

    var _metalSoy = require("frontend-js-metal-web$metal-soy");

    var _metalSoy2 = _interopRequireDefault(_metalSoy);

    var _metalState = require("frontend-js-metal-web$metal-state");

    var _action_items_validator = require('./action_items_validator');

    var _action_items_validator2 = _interopRequireDefault(_action_items_validator);

    var _ClayFileCardSoy = require("./ClayFileCard.soy");

    var _ClayFileCardSoy2 = _interopRequireDefault(_ClayFileCardSoy);

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

    function _classCallCheck(instance, Constructor) {
      if (!(instance instanceof Constructor)) {
        throw new TypeError("Cannot call a class as a function");
      }
    }

    function _possibleConstructorReturn(self, call) {
      if (!self) {
        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      }return call && (typeof call === "object" || typeof call === "function") ? call : self;
    }

    function _inherits(subClass, superClass) {
      if (typeof superClass !== "function" && superClass !== null) {
        throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
      }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
    }

    /**
     * Metal ClayFileCard component.
     * @extends ClayComponent
     */
    var ClayFileCard = function (_ClayComponent) {
      _inherits(ClayFileCard, _ClayComponent);

      function ClayFileCard() {
        _classCallCheck(this, ClayFileCard);

        return _possibleConstructorReturn(this, (ClayFileCard.__proto__ || Object.getPrototypeOf(ClayFileCard)).apply(this, arguments));
      }

      _createClass(ClayFileCard, [{
        key: '_handleActionItemClicked',

        /**
         * Continues the propagation of the dropdown action item click event
         * @param {!Event} event
         * @private
         * @return {Boolean} If the event has been prevented or not.
         */
        value: function _handleActionItemClicked(event) {
          return !this.emit('itemClicked', event);
        }

        /**
         * Continues the propagation of the checkbox changed event
         * @param {!Event} event
         * @private
         */

      }, {
        key: '_handleItemToggled',
        value: function _handleItemToggled(event) {
          this.emit('itemToggled', event);
        }
      }]);

      return ClayFileCard;
    }(_clayComponent2.default);

    /**
     * State definition.
     * @static
     * @type {!Object}
     */

    ClayFileCard.STATE = {
      /**
       * Aria label attribute for the action element.
       * @default undefined
       * @instance
       * @memberof ClayFileCard
       * @type {?(string|undefined)}
       */
      actionAriaLabel: _metalState.Config.string(),

      /**
       * List of items to display in the actions menu.
       * @default undefined
       * @instance
       * @memberof ClayFileCard
       * @type {?(array|undefined)}
       */
      actionItems: _action_items_validator2.default,

      /**
       * Data to add to the element.
       * @default undefined
       * @instance
       * @memberof ClayFileCard
       * @type {?object}
       */
      data: _metalState.Config.object(),

      /**
       * Object that wires events with default listeners
       * @default undefined
       * @instance
       * @memberof ClayFileCard
       * @review
       * @type {?(object|undefined)}
       */
      defaultEventHandler: _metalState.Config.object(),

      /**
       * Flag to indicate if the card is disabled or not.
       * @default false
       * @instance
       * @memberof ClayFileCard
       * @type {?bool}
       */
      disabled: _metalState.Config.bool().value(false),

      /**
       * CSS classes to be applied to the element.
       * @default undefined
       * @instance
       * @memberof ClayFileCard
       * @type {?(string|undefined)}
       */
      elementClasses: _metalState.Config.string(),

      /**
       * Url to be applied to the title of the card.
       * @default undefined
       * @instance
       * @memberof ClayFileCard
       * @type {?(string|undefined)}
       */
      href: _metalState.Config.string(),

      /**
       * Icon to be rendered in the visual area of the card.
       * @default documents-and-media
       * @instance
       * @memberof ClayFileCard
       * @type {?string}
       */
      icon: _metalState.Config.string().value('documents-and-media'),

      /**
       * Id to be applied to the element.
       * @default undefined
       * @instance
       * @memberof ClayFileCard
       * @type {?(string|undefined)}
       */
      id: _metalState.Config.string(),

      /**
       * Name to be applied to the input element.
       * @instance
       * @memberof ClayFileCard
       * @type {?(string|undefined)}
       * @default undefined
       */
      inputName: _metalState.Config.string(),

      /**
       * Value to be applied to the input element.
       * @default undefined
       * @instance
       * @memberof ClayFileCard
       * @type {?(string|undefined)}
       */
      inputValue: _metalState.Config.string(),

      /**
       * Labels of the card.
       * @default undefined
       * @instance
       * @memberof ClayFileCard
       * @type {?(array|undefined)}
       */
      labels: _metalState.Config.arrayOf(_metalState.Config.oneOfType([_metalState.Config.string(), _metalState.Config.shapeOf({
        label: _metalState.Config.string(),
        style: _metalState.Config.oneOf(['danger', 'info', 'secondary', 'success', 'warning']).value('secondary')
      })])),

      /**
       * Object that maps specific label values with desired styles.
       * @default undefined
       * @instance
       * @memberof ClayCardBase
       * @type {?(object|undefined)}
       */
      labelStylesMap: _metalState.Config.object(),

      /**
       * Flag to indicate if the card is selectable or not.
       * @default false
       * @instance
       * @memberof ClayFileCard
       * @type {?bool}
       */
      selectable: _metalState.Config.bool().value(false),

      /**
       * Flag to indicate if the card is selected or not.
       * @default false
       * @instance
       * @memberof ClayFileCard
       * @type {?bool}
       */
      selected: _metalState.Config.bool().value(false),

      /**
       * The path to the SVG spritemap file containing the icons.
       * @default undefined
       * @instance
       * @memberof ClayFileCard
       * @type {!string}
       */
      spritemap: _metalState.Config.string().required(),

      /**
       * CSS classes for the inside the sticker.
       * @default undefined
       * @instance
       * @memberof ClayFileCard
       * @type {?(string|undefined)}
       */
      stickerClasses: _metalState.Config.string(),

      /**
       * Icon to be renderer inside the sticker.
       * @default undefined
       * @instance
       * @memberof ClayFileCard
       * @type {?(string|undefined)}
       */
      stickerIcon: _metalState.Config.string(),

      /**
       * Alternate text of the image to be renderer inside the sticker.
       * @default undefined
       * @instance
       * @memberof ClayFileCard
       * @type {?(string|undefined)}
       */
      stickerImageAlt: _metalState.Config.string(),

      /**
       * Source of the image to be rendered inside the sticker.
       * @default undefined
       * @instance
       * @memberof ClayFileCard
       * @type {?(string|undefined)}
       */
      stickerImageSrc: _metalState.Config.string(),

      /**
       * Label for the sticker represented in the card.
       * @default undefined
       * @instance
       * @memberof ClayFileCard
       * @type {?(string|undefined)}
       */
      stickerLabel: _metalState.Config.string(),

      /**
       * Shape for the sticker represented in the card.
       * @default rounded
       * @instance
       * @memberof ClayFileCard
       * @type {?string}
       */
      stickerShape: _metalState.Config.oneOf(['circle', 'rounded']).value('rounded'),

      /**
       * Style of sticker represented in the card.
       * @default primary
       * @instance
       * @memberof ClayFileCard
       * @type {?string}
       */
      stickerStyle: _metalState.Config.oneOf(['danger', 'dark', 'info', 'light', 'primary', 'secondary', 'success', 'warning']).value('primary'),

      /**
       * Subtitle of the card.
       * @default undefined
       * @instance
       * @memberof ClayFileCard
       * @type {?(string|undefined)}
       */
      subtitle: _metalState.Config.string(),

      /**
       * Title of the card.
       * @default undefined
       * @instance
       * @memberof ClayFileCard
       * @type {!string}
       */
      title: _metalState.Config.string().required()
    };

    (0, _metalWebComponent2.default)('clay-file-card', ClayFileCard);

    _metalSoy2.default.register(ClayFileCard, _ClayFileCardSoy2.default);

    exports.ClayFileCard = ClayFileCard;
    exports.default = ClayFileCard;
    //# sourceMappingURL=ClayFileCard.js.map
  }
});
//# sourceMappingURL=ClayFileCard.js.map