"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.SelectableItemDecorator = exports.SelectableItemBase = exports.SelectableItem = exports.default = void 0;

var _kind = _interopRequireDefault(require("@enact/core/kind"));

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _ToggleItem = require("../ToggleItem");

var _SelectableIcon = _interopRequireDefault(require("./SelectableIcon"));

var _SelectableItem = _interopRequireDefault(require("./SelectableItem.less"));

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

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

/**
 * Renders an [Item]{@link moonstone/Item} with a circle icon, by default.
 *
 * @class SelectableItem
 * @memberof moonstone/SelectableItem
 * @extends moonstone/ToggleItem.ToggleItemBase
 * @ui
 * @public
 */
var SelectableItemBase = (0, _kind.default)({
  name: 'SelectableItem',
  propTypes:
  /** @lends moonstone/SelectableItem.SelectableItem.prototype */
  {
    /**
     * Customizes the component by mapping the supplied collection of CSS class names to the
     * corresponding internal Elements and states of this component.
     *
     * The following classes are supported:
     *
     * * `selectableItem` - The root class name
     *
     * @type {Object}
     * @public
     */
    css: _propTypes.default.object
  },
  styles: {
    css: _SelectableItem.default,
    className: 'selectableItem',
    publicClassNames: ['selectableItem']
  },
  render: function render(props) {
    return _react.default.createElement(_ToggleItem.ToggleItemBase, _extends({
      "data-webos-voice-intent": "SelectCheckItem"
    }, props, {
      css: props.css,
      iconComponent: _SelectableIcon.default
    }));
  }
});
/**
 * Adds interactive toggle functionality to `SelectableItemBase`.
 *
 * @class SelectableItemDecorator
 * @memberof moonstone/SelectableItem
 * @mixes moonstone/ToggleItem.ToggleItemDecorator
 * @hoc
 * @public
 */

exports.SelectableItemBase = SelectableItemBase;
var SelectableItemDecorator = (0, _ToggleItem.ToggleItemDecorator)({
  invalidateProps: ['inline', 'selected']
});
/**
 * A Moonstone-styled item with a toggle icon, marqueed text, and `Spotlight` focus.
 *
 * @class SelectableItem
 * @memberof moonstone/SelectableItem
 * @extends moonstone/SelectableItem.SelectableItemBase
 * @mixes moonstone/SelectableItem.SelectableItemDecorator
 * @ui
 * @public
 */

exports.SelectableItemDecorator = SelectableItemDecorator;
var SelectableItem = SelectableItemDecorator(SelectableItemBase);
exports.SelectableItem = SelectableItem;
var _default = SelectableItem;
exports.default = _default;