"use strict";

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

var _react2 = require("@storybook/react");

var _addonKnobs = require("@storybook/addon-knobs");

var _utils = require("../../../../storybook/utils");

var _component = _interopRequireDefault(require("./component"));

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

var props = function props() {
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
      _ref$isFormVariant = _ref.isFormVariant,
      isFormVariant = _ref$isFormVariant === void 0 ? undefined : _ref$isFormVariant,
      _ref$isFloatErrorVari = _ref.isFloatErrorVariant,
      isFloatErrorVariant = _ref$isFloatErrorVari === void 0 ? undefined : _ref$isFloatErrorVari,
      _ref$isClick = _ref.isClick,
      isClick = _ref$isClick === void 0 ? undefined : _ref$isClick,
      _ref$isDisabled = _ref.isDisabled,
      isDisabled = _ref$isDisabled === void 0 ? undefined : _ref$isDisabled,
      _ref$isHeaderStretchW = _ref.isHeaderStretchWidth,
      isHeaderStretchWidth = _ref$isHeaderStretchW === void 0 ? undefined : _ref$isHeaderStretchW,
      _ref$isMenuHeaderWidt = _ref.isMenuHeaderWidth,
      isMenuHeaderWidth = _ref$isMenuHeaderWidt === void 0 ? undefined : _ref$isMenuHeaderWidt,
      _ref$isMenuHeaderWidt2 = _ref.isMenuHeaderWidthMin,
      isMenuHeaderWidthMin = _ref$isMenuHeaderWidt2 === void 0 ? undefined : _ref$isMenuHeaderWidt2,
      _ref$isIcon = _ref.isIcon,
      isIcon = _ref$isIcon === void 0 ? undefined : _ref$isIcon,
      _ref$isCloseOnSelect = _ref.isCloseOnSelect,
      isCloseOnSelect = _ref$isCloseOnSelect === void 0 ? undefined : _ref$isCloseOnSelect,
      _ref$isInWidget = _ref.isInWidget,
      isInWidget = _ref$isInWidget === void 0 ? undefined : _ref$isInWidget,
      _ref$infoMessage = _ref.infoMessage,
      infoMessage = _ref$infoMessage === void 0 ? undefined : _ref$infoMessage,
      _ref$tooltipPosition = _ref.tooltipPosition,
      tooltipPosition = _ref$tooltipPosition === void 0 ? undefined : _ref$tooltipPosition,
      _ref$domScrollSelecto = _ref.domScrollSelector,
      domScrollSelector = _ref$domScrollSelecto === void 0 ? undefined : _ref$domScrollSelecto,
      _ref$placeholder = _ref.placeholder,
      placeholder = _ref$placeholder === void 0 ? undefined : _ref$placeholder,
      _ref$list = _ref.list,
      list = _ref$list === void 0 ? undefined : _ref$list,
      _ref$itemKey = _ref.itemKey,
      itemKey = _ref$itemKey === void 0 ? undefined : _ref$itemKey,
      _ref$activeItem = _ref.activeItem,
      activeItem = _ref$activeItem === void 0 ? 2 : _ref$activeItem,
      _ref$activeItems = _ref.activeItems,
      activeItems = _ref$activeItems === void 0 ? undefined : _ref$activeItems,
      _ref$activeItemRaw = _ref.activeItemRaw,
      activeItemRaw = _ref$activeItemRaw === void 0 ? undefined : _ref$activeItemRaw,
      _ref$fieldName = _ref.fieldName,
      fieldName = _ref$fieldName === void 0 ? undefined : _ref$fieldName,
      _ref$onItemClick = _ref.onItemClick,
      onItemClick = _ref$onItemClick === void 0 ? undefined : _ref$onItemClick,
      _ref$asyncStatus = _ref.asyncStatus,
      asyncStatus = _ref$asyncStatus === void 0 ? undefined : _ref$asyncStatus,
      _ref$asyncStatusList = _ref.asyncStatusList,
      asyncStatusList = _ref$asyncStatusList === void 0 ? undefined : _ref$asyncStatusList;

  return {
    isFormVariant: (0, _addonKnobs.boolean)('isFormVariant', isFormVariant),
    isFloatErrorVariant: (0, _addonKnobs.boolean)('isFloatErrorVariant', isFloatErrorVariant),
    isClick: (0, _addonKnobs.boolean)('isClick', isClick),
    isDisabled: (0, _addonKnobs.boolean)('isDisabled', isDisabled),
    isHeaderStretchWidth: (0, _addonKnobs.boolean)('isHeaderStretchWidth', isHeaderStretchWidth),
    isMenuHeaderWidth: (0, _addonKnobs.boolean)('isMenuHeaderWidth', isMenuHeaderWidth),
    isMenuHeaderWidthMin: (0, _addonKnobs.boolean)('isMenuHeaderWidthMin', isMenuHeaderWidthMin),
    isIcon: (0, _addonKnobs.boolean)('isIcon', isIcon),
    isCloseOnSelect: (0, _addonKnobs.boolean)('isCloseOnSelect', isCloseOnSelect),
    isInWidget: (0, _addonKnobs.boolean)('isInWidget', isInWidget),
    infoMessage: (0, _addonKnobs.text)('infoMessage', infoMessage),
    tooltipPosition: (0, _addonKnobs.radios)('tooltip position', _utils.tooltipPositions, tooltipPosition),
    domScrollSelector: (0, _addonKnobs.text)('domScrollSelector', domScrollSelector),
    placeholder: (0, _addonKnobs.text)('placeholder', placeholder),
    list: (0, _addonKnobs.array)('list', [1, 2, 3, 4]),
    itemKey: (0, _addonKnobs.text)('itemKey', itemKey),
    activeItem: (0, _addonKnobs.text)('activeItem', activeItem),
    // activeItems,
    activeItemRaw: (0, _addonKnobs.text)('activeItemRaw', activeItemRaw),
    fieldName: (0, _addonKnobs.text)('fieldName', fieldName),
    // onItemClick
    asyncStatus: (0, _addonKnobs.select)('async status', (0, _utils.asyncStates)({
      isList: false
    }), asyncStatus),
    asyncStatusList: (0, _addonKnobs.select)('async status list', (0, _utils.asyncStates)({
      isList: true
    }), asyncStatusList)
  };
};

(0, _react2.storiesOf)('Web|Dropdown', module).add('Simple', function () {
  return _react.default.createElement(_component.default, props());
}).add('Simple stretch', function () {
  return _react.default.createElement(_component.default, props({
    isHeaderStretchWidth: true,
    isMenuHeaderWidth: true
  }));
}).add('Simple form variant', function () {
  return _react.default.createElement(_component.default, props({
    isFormVariant: true,
    isHeaderStretchWidth: true,
    isMenuHeaderWidth: true
  }));
});