import { text, boolean, number, object, select } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';

export default {
  hiddenLabel: function hiddenLabel() {
    return boolean('hiddenLabel', false);
  },
  labelText: function labelText() {
    return text('labelText', 'Currency Input');
  },
  required: function required() {
    return boolean('required', false);
  },
  inline: function inline() {
    return boolean('inline', false);
  },
  disabled: function disabled() {
    return boolean('disabled', false);
  },
  id: function id() {
    return text('id', 'currency-input');
  },
  name: function name() {
    return text('name', 'currency-input');
  },
  width: function width() {
    return number('width', 0);
  },
  maxlength: function maxlength() {
    return number('maxlength', 20);
  },
  placeholder: function placeholder() {
    return text('placeholder', '$0.00');
  },
  errorMsg: function errorMsg() {
    return text('errorMsg', 'you did not type something');
  },
  defaultValue: function defaultValue() {
    return text('defaultValue', null);
  },
  max: function max() {
    return number('max', 1000);
  },
  min: function min() {
    return number('min', 0);
  },
  step: function step() {
    return number('step', 0.01);
  },
  format: function format() {
    return object('format', {
      mantissa: 2,
      trimMantissa: false,
      thousandSeparated: true,
      negative: 'parenthesis'
    });
  },
  showButtons: function showButtons() {
    return boolean('showButtons', true);
  },
  onChange: function onChange() {
    return action('onChange');
  },
  onBlur: function onBlur() {
    return action('onBlur');
  },
  language: function language() {
    return select('language', ['English', 'Chinese', 'French', 'Russian'], 'English');
  }
};