'use strict';

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _react3 = require('@storybook/react');

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

var _addonActions = require('@storybook/addon-actions');

var _index = require('./index');

var _index2 = _interopRequireDefault(_index);

var _InputTextFuzzy = require('./InputTextFuzzy.md');

var _InputTextFuzzy2 = _interopRequireDefault(_InputTextFuzzy);

var _InputTextFuzzyKnobs = require('./InputTextFuzzy.knobs.options');

var _InputTextFuzzyKnobs2 = _interopRequireDefault(_InputTextFuzzyKnobs);

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

(0, _react3.storiesOf)('forms|atoms', module).addDecorator((0, _addonKnobs.withKnobs)({ escapeHTML: false })).add('InputTextFuzzy', function () {
  var props = {
    boxed: (0, _addonKnobs.boolean)('boxed', false),
    disabled: (0, _addonKnobs.boolean)('disabled', false),
    label: (0, _addonKnobs.text)('label', 'State Organization'),
    keys: (0, _addonKnobs.array)('keys', ['text']),
    options: _InputTextFuzzyKnobs2.default.options.orgSelector.filter(function (option) {
      return option.text !== '';
    }),
    placeholder: (0, _addonKnobs.text)('placeholder', 'All Organizations'),
    id: (0, _addonKnobs.text)('id', 'org-typeahead'),
    inputId: (0, _addonKnobs.text)('inputId', 'input-org-typeahead'),
    selected: (0, _addonKnobs.select)('selected', _InputTextFuzzyKnobs2.default.options.orgSelector.map(function (option) {
      return option.text;
    }), ''),
    fuseOptions: (0, _addonKnobs.object)('fuseOptions', {
      shouldSort: true,
      findAllMatches: true,
      includeMatches: true,
      threshold: 0.3,
      minMatchCharLength: 1,
      maxPatternLength: 300
    }),
    onKeyDown: (0, _addonActions.action)('onKeyDown event'),
    onKeyUp: (0, _addonActions.action)('onKeyUp event'),
    onChange: (0, _addonActions.action)('onChange event'),
    onFocus: (0, _addonActions.action)('onFocus event'),
    onBlur: (0, _addonActions.action)('onBlur event'),
    onSuggestionClick: (0, _addonActions.action)('onSuggestionClick called'),
    renderDefaultSuggestion: (0, _addonKnobs.boolean)('fuzzy renderDefaultSuggestion', true)
  };
  return _react2.default.createElement(_index2.default, props);
}, { info: _InputTextFuzzy2.default });