File tree Expand file tree Collapse file tree
src/components/blipInputDpr Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ const BLIP_INPUT_PREFIX = 'blip-input-dpr';
2424 * @param {string } type - the input type is necessary for validation. If not specified, takes value 'text'
2525 * @param {string } inputAutocomplete - the input autocomplete field for undesired browser autompletes
2626 * @param {string } unmaskablePassword - the expression that defines if input of type password will be unmaskable
27+ * @param {expression } invalid - the input is invalid
2728 */
2829
2930class BlipInputDprController extends ComponentController {
@@ -33,6 +34,7 @@ class BlipInputDprController extends ComponentController {
3334 passwordUnmasked : boolean = false ;
3435 onChange : ( $val ) => { } ;
3536 disabled : boolean ;
37+ invalid : boolean ;
3638
3739 constructor (
3840 private $element ,
@@ -91,6 +93,7 @@ export const BlipInputDprComponent = angular
9193 fieldId : '@?' ,
9294 showPasswordStrength : '<?' ,
9395 unmaskablePassword : '<?' ,
96+ invalid : '<?'
9497 } ,
9598 require : {
9699 ngModel : 'ngModel' ,
Original file line number Diff line number Diff line change 22 ng-class ="{
33 'bp-input-wrapper--focus': focused,
44 'bp-input-wrapper--valid': focused && $ctrl.parentForm[$ctrl.fieldName].$viewValue && $ctrl.parentForm[$ctrl.fieldName].$valid,
5- 'bp-input-wrapper--invalid': !$ctrl.disabled && !$ctrl.parentForm[$ctrl.fieldName].$pristine && $ctrl.parentForm[$ctrl.fieldName].$invalid,
5+ 'bp-input-wrapper--invalid': $ctrl.invalid || ( !$ctrl.disabled && !$ctrl.parentForm[$ctrl.fieldName].$pristine && $ctrl.parentForm[$ctrl.fieldName].$invalid) ,
66 'bp-input-wrapper--disabled': $ctrl.disabled } "
77 ng-click ="$ctrl.focus() "
88 id ="{{$ctrl.elementId}} ">
1111 'bp-c-rooftop': !focused,
1212 'bp-c-blip-dark': focused,
1313 'bp-c-true': focused && $ctrl.parentForm[$ctrl.fieldName].$viewValue && $ctrl.parentForm[$ctrl.fieldName].$valid,
14- 'bp-c-warning': !$ctrl.parentForm[$ctrl.fieldName].$pristine && $ctrl.parentForm[$ctrl.fieldName].$invalid } "> {{$ctrl.label}}</ label >
14+ 'bp-c-warning': $ctrl.invalid || ( !$ctrl.parentForm[$ctrl.fieldName].$pristine && $ctrl.parentForm[$ctrl.fieldName].$invalid) } "> {{$ctrl.label}}</ label >
1515
1616 < password-strength ng-if ="$ctrl.showPasswordStrength && $ctrl.type === 'password' " ng-model ="$ctrl.model "> </ password-strength >
1717
You can’t perform that action at this time.
0 commit comments