'use strict';

Liferay.Loader.define("frontend-taglib-clay$clay-list@2.24.1/lib/ClayList", ['module', 'exports', 'require', 'frontend-taglib-clay$clay-checkbox', 'frontend-taglib-clay$clay-dropdown', 'frontend-taglib-clay$clay-icon', 'frontend-taglib-clay$clay-label', 'frontend-taglib-clay$clay-link', 'frontend-taglib-clay$clay-sticker', 'frontend-js-metal-web$metal-state', 'frontend-taglib-clay$clay-component', 'frontend-js-metal-web$metal-web-component', 'frontend-js-metal-web$metal-soy', './ClayList.soy'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.ClayList = 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-checkbox");

    var _clayDropdown = require("frontend-taglib-clay$clay-dropdown");

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

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

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

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

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

    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 _ClayListSoy = require("./ClayList.soy");

    var _ClayListSoy2 = _interopRequireDefault(_ClayListSoy);

    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;
    }
    // eslint-disable-next-line


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

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

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

      _createClass(ClayList, [{
        key: '_handleItemToggled',

        /**
         * Continues the propagation of the checkbox changed event
         * @param {!Event} event
         * @private
         */
        value: function _handleItemToggled(event) {
          this.emit('itemToggled', event);
        }
      }]);

      return ClayList;
    }(_clayComponent2.default);

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

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

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

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

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

      /**
       * List of items.
       * @default undefined
       * @instance
       * @memberof ClayList
       * @type {?(array|undefined)}
       */
      items: _metalState.Config.array(),

      /**
       * Flag to indicate if the list group items are selectable.
       * @default false
       * @instance
       * @memberof ClayList
       * @type {?(bool|undefined)}
       */
      selectable: _metalState.Config.bool().value(false),

      /**
       * Schema mapping list item fields with item data properties.
       * @default undefined
       * @instance
       * @memberof ClayList
       * @type {!object}
       */
      schema: _metalState.Config.shapeOf({
        fields: _metalState.Config.arrayOf(_metalState.Config.shapeOf({
          contentRenderer: _metalState.Config.string(),
          contentRendererMap: _metalState.Config.object(),
          fieldName: _metalState.Config.string(),
          fieldsMap: _metalState.Config.object(),
          iconsMap: _metalState.Config.object(),
          iconShapesMap: _metalState.Config.object(),
          labelStylesMap: _metalState.Config.object()
        })),
        inputNameField: _metalState.Config.string(),
        inputNamesMap: _metalState.Config.object(),
        inputValueField: _metalState.Config.string()
      }).required(),

      /**
       * The path to the SVG spritemap file containing the icons.
       * @default undefined
       * @instance
       * @memberof ClayList
       * @type {?(string|undefined)}
       */
      spritemap: _metalState.Config.string()
    };

    (0, _metalWebComponent2.default)('clay-list', ClayList);

    _metalSoy2.default.register(ClayList, _ClayListSoy2.default);

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