Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
ui-component-library / src / forms / input / _fixture.ts
Size: Mime:
// CONSTANT_CAPS :-P
export const toggleTypes = Object.freeze(['checkbox', 'radio', 'toggle'])

export const validTypes = Object.freeze([
  'number',
  'text',
  'tel',
  'password',
  'email',
  'range',
  'search',
  'date',
  'color',
  'url',
])

/**
 * @todo - should add .toObj like we did in oneproduct
 */
export const types = {
  // @alias - name
  // identifier: '',
  _identifier: undefined,
  identity: 'name',
  // for radios, this needs to be value!!!
  // name: '',

  // confusing conflicts
  name: undefined,
  // @depreciate
  // vvvvvvv remove these eventually
  label: undefined,
  placeholderText: undefined,
  shouldAlignRight: undefined,
  labelText: undefined,
  // wow
  // classes: undefined,
  className: undefined,
  // classlist: undefined,
  // wrapperClassName: undefined,
  // checkBoxClass: undefined,
  // labelClass: undefined,
  // eh
  errorMessage: undefined,
  errorMessageFor: undefined,
  maxLength: Infinity,
  animatePlaceholder: undefined,

  value: '',

  isEnabled: true,
  isFocused: false,
  isSelected: false,
  isValidInput: true,

  // meh
  validationType: '',
  type: 'text',

  // @todo @name fieldset
  elementList: [],

  // 0.0
  // are object assigned
  // hasValidationError: false,
  // onValueChange: undefined,
}

/**
 * @todo - Object.freeze if not changing
 * @todo - lint type if it is not in here
 * @name inputTypeMap
 */
export const inputTypes = {
  // basic
  // textBox: 'text',
  // textArea: 'textarea',
  // password
  // password: 'password',
  // confirmPassword: 'confirmPassword',
  // builtin / text+
  // email: 'email',
  // telephone: 'telephone',
  // radio-like
  // checkBox: 'checkbox',
  // radioButton: 'radioGroup',
  // radioGroup: 'radioGroup',
  // button
  // button: 'button',
  // label: 'label',
  // flatButton: 'flatButton',
  // multi/special
  groupElement: 'groupElements',
  // googleAutoSugggest: 'googleAutoSugggest',
  // select: 'select',
  // selectBoxWithHeading: 'selectBoxWithHeading',
}

export const defaultProps = {
  className: '',
  classList: {
    wrap: '',
    input: '',
  },

  placeholderText: '',
  state: undefined,
  type: 'text',
}