0.0.7 • Published 6 years ago

@rei-co-op/cedar-input v0.0.7

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

NOTE: v-model is required.

Events

NameTypeDescription
inputStringCurrent input value. Fires while typing.
changeStringNew input value (if changed). Fires on blur.
blurEventFires when input loses focus.
focusEventFires when input gains focus.
pasteEventFires when text is pasted into input.

Examples

Single line with feedback icons, error messages, and a debounced validation rule

// Stuff for demo
var debounce = '';
function validateFn(inputText) {
  var obj = {};
  if (inputText === 'hi') {
    obj.state = 'valid';
  } else if (inputText === '') {
    obj.state = 'warn';
    obj.message = 'Warning Empty';
  } else if (!isNaN(inputText) && inputText !== '') {
    obj.state = 'error';
    obj.message = 'Error: needs to be letters';
  } else {
    obj.state = 'error';
    obj.message = 'Error Message';
  }
  return obj;
}

//Component usages
<cdr-input v-model="debounce"
  label="Enter hi"
  id="testing"
  placeholder="Enter hi"
  feedback
  :rules="[validateFn]"
  debounce
  data-backstop="text-input"
  ></cdr-input>

Normal multiline input

var multi = '';

<cdr-input v-model="multi"
      label="Multiline"
      multi-line
      ></cdr-input>
0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago