How to use the ember-bootstrap/utils/cp/form-validation-class function in ember-bootstrap

To help you get started, we’ve selected a few ember-bootstrap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kaliber5 / ember-bootstrap / addon / components / bs4 / bs-form / element / control / input.js View on Github external
import { classNameBindings } from '@ember-decorators/component';
import BaseFormElementControlInput from 'ember-bootstrap/components/base/bs-form/element/control/input';
import formValidationClass from 'ember-bootstrap/utils/cp/form-validation-class';
import sizeClass from 'ember-bootstrap/utils/cp/size-class';

@classNameBindings('formValidationClass', 'sizeClass')
export default class FormElementControlInput extends BaseFormElementControlInput {
  @formValidationClass('validationType')
  formValidationClass;

  /**
   * Property for size styling, set to 'lg', 'sm' or 'xs'
   *
   * Also see the [Bootstrap docs](https://getbootstrap.com/docs/4.3/components/forms/#sizing)
   *
   * @property size
   * @type String
   * @public
   */
  size = null;

  @sizeClass('form-control', 'size')
  sizeClass;
}
github kaliber5 / ember-bootstrap / addon / components / bs4 / bs-form / element / control / textarea.js View on Github external
import FormElementControlTextarea from 'ember-bootstrap/components/base/bs-form/element/control/textarea';
import formValidationClass from 'ember-bootstrap/utils/cp/form-validation-class';

export default FormElementControlTextarea.extend({
  classNameBindings: ['formValidationClass'],
  formValidationClass: formValidationClass('validationType')
});
github kaliber5 / ember-bootstrap / addon / components / bs4 / bs-form / element / control / checkbox.js View on Github external
import FormElementControlCheckbox from 'ember-bootstrap/components/base/bs-form/element/control/checkbox';
import formValidationClass from 'ember-bootstrap/utils/cp/form-validation-class';

export default FormElementControlCheckbox.extend({
  classNames: ['form-check-input'],
  classNameBindings: ['formValidationClass'],
  formValidationClass: formValidationClass('validationType')
});