@kigi/components 1.27.2-alpha → 1.27.4-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kigi/components",
3
- "version": "1.27.2-alpha",
3
+ "version": "1.27.4-alpha",
4
4
  "description": "@kigi/components",
5
5
  "main": "src/components/index.ts",
6
6
  "scripts": {
@@ -1,16 +1,21 @@
1
1
  <div class="mbg-input-wrapper mb-input-password-wrapper"
2
2
  ng-if="$ctrl.props">
3
- <input type="password"
4
- autocomplete="new-password"
5
- autocorrect="new-password"
6
- ng-model="$ctrl.ngModel"
7
- ng-change="$ctrl.onChange()"
8
- ng-required="$ctrl.ngRequired"
9
- ng-disabled="$ctrl.ngDisabled"
10
- ng-blur="$ctrl.ngBlur({ $event })"
11
- ng-focus="$ctrl.ngFocus({ $event })"
12
- ng-keyup="$ctrl.ngKeyup({ $event })"
13
- ng-keypress="$ctrl.ngKeypress({ $event })"
14
- ng-keydown="$ctrl.ngKeydown({ $event })"
15
- placeholder="{{ $ctrl.props.placeholder }}" />
3
+ <input type="{{$ctrl.show ? 'text' : 'password' }}"
4
+ autocomplete="new-password"
5
+ autocorrect="new-password"
6
+ ng-model="$ctrl.ngModel"
7
+ ng-change="$ctrl.onChange()"
8
+ ng-required="$ctrl.ngRequired"
9
+ ng-disabled="$ctrl.ngDisabled"
10
+ ng-blur="$ctrl.ngBlur({ $event })"
11
+ ng-focus="$ctrl.ngFocus({ $event })"
12
+ ng-keyup="$ctrl.ngKeyup({ $event })"
13
+ ng-keypress="$ctrl.ngKeypress({ $event })"
14
+ ng-keydown="$ctrl.ngKeydown({ $event })"
15
+ ng-class="{'has-btn-toggle-password' : $ctrl.showBtnPassword}"
16
+ placeholder="{{ $ctrl.props.placeholder }}" />
17
+ <a ng-click="$ctrl.show = !$ctrl.show"
18
+ ng-if="$ctrl.showBtnPassword">
19
+ <i class="fas {{$ctrl.show ? 'fa-eye' : 'fa-eye-slash' }}"></i>
20
+ </a>
16
21
  </div>
@@ -1,3 +1,14 @@
1
- // .mbg-input-password-wrapper {
2
-
3
- // }
1
+ .mbg-input-wrapper {
2
+ position: relative;
3
+ input {
4
+ &.has-btn-toggle-password {
5
+ padding-right: 30px;
6
+
7
+ }
8
+ }
9
+ a {
10
+ position: absolute;
11
+ right: 0;
12
+ padding: 13px 10px;
13
+ }
14
+ }
@@ -2,41 +2,46 @@ import './mbg-input-password.scss'
2
2
  import template from './mbg-input-password.html'
3
3
 
4
4
  class MbgInputPasswordController {
5
- private ngChange
6
- private ngModel
7
- private ngRequired
8
- private ngDisabled
9
- private props
5
+ private ngChange
6
+ private ngModel
7
+ private ngRequired
8
+ private ngDisabled
9
+ private props
10
10
 
11
- constructor(public $scope, public $element, public $attrs) {
12
- if ($attrs.ngRequired === '') { this.ngRequired = true }
13
- if ($attrs.ngDisabled === '') { this.ngDisabled = true }
14
- this.props = {
15
- placeholder: $attrs.placeholder || '',
16
- }
11
+ constructor(public $scope, public $element, public $attrs) {
12
+ if ($attrs.ngRequired === '') {
13
+ this.ngRequired = true
17
14
  }
18
- onChange() {
19
- if (this.ngChange) {
20
- this.ngChange({})
21
- }
15
+ if ($attrs.ngDisabled === '') {
16
+ this.ngDisabled = true
22
17
  }
18
+ this.props = {
19
+ placeholder: $attrs.placeholder || '',
20
+ }
21
+ }
22
+ onChange() {
23
+ if (this.ngChange) {
24
+ this.ngChange({})
25
+ }
26
+ }
23
27
  }
24
- MbgInputPasswordController.$inject = ['$scope', '$element', '$attrs']
28
+ MbgInputPasswordController['$inject'] = ['$scope', '$element', '$attrs']
25
29
 
26
30
  const mbgInputPassword = {
27
- bindings: {
28
- ngModel: '=',
29
- ngChange: '&?',
30
- ngRequired: '=?',
31
- ngDisabled: '=?',
32
- ngBlur: '&?',
33
- ngFocus: '&?',
34
- ngKeyup: '&?',
35
- ngKeypress: '&?',
36
- ngKeydown: '&?',
37
- },
38
- template,
39
- controller: MbgInputPasswordController,
31
+ bindings: {
32
+ ngModel: '=',
33
+ ngChange: '&?',
34
+ ngRequired: '=?',
35
+ ngDisabled: '=?',
36
+ ngBlur: '&?',
37
+ ngFocus: '&?',
38
+ ngKeyup: '&?',
39
+ ngKeypress: '&?',
40
+ ngKeydown: '&?',
41
+ showBtnPassword: '=?',
42
+ },
43
+ template,
44
+ controller: MbgInputPasswordController,
40
45
  }
41
46
 
42
47
  export { mbgInputPassword }
@@ -1,12 +1,11 @@
1
1
  <div class="mbg-input-wrapper mb-input-text-wrapper"
2
2
  ng-if="$ctrl.props">
3
- <input type="text"
4
- ng-model="$ctrl.ngModel"
5
- ng-change="$ctrl.onChange($event)"
6
- ng-required="$ctrl.ngRequired"
7
- ng-disabled="$ctrl.ngDisabled"
8
- ng-blur="$ctrl.ngBlur({ $event })"
9
- ng-focus="$ctrl.ngFocus({ $event })"
10
- placeholder="{{ $ctrl.placeholder }}"
11
- maxlength="{{$ctrl.maxLength}}" />
3
+ <input type="text"
4
+ ng-model="$ctrl.ngModel"
5
+ ng-change="$ctrl.onChange($event)"
6
+ ng-required="$ctrl.ngRequired"
7
+ ng-disabled="$ctrl.ngDisabled"
8
+ ng-blur="$ctrl.ngBlur({ $event })"
9
+ ng-focus="$ctrl.ngFocus({ $event })"
10
+ placeholder="{{ $ctrl.placeholder }}" />
12
11
  </div>
@@ -72,7 +72,6 @@ const mbgInputText = {
72
72
  ngKeypress: '&?',
73
73
  ngKeydown: '&?',
74
74
  capitalize: '=?',
75
- maxLength: '@?',
76
75
  },
77
76
  template,
78
77
  controller: MbgInputTextController,