@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 +1 -1
- package/src/components/mbg-input-password/mbg-input-password.html +18 -13
- package/src/components/mbg-input-password/mbg-input-password.scss +14 -3
- package/src/components/mbg-input-password/mbg-input-password.ts +34 -29
- package/src/components/mbg-input-text/mbg-input-text.html +8 -9
- package/src/components/mbg-input-text/mbg-input-text.ts +0 -1
package/package.json
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
<div class="mbg-input-wrapper mb-input-password-wrapper"
|
|
2
2
|
ng-if="$ctrl.props">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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>
|
|
@@ -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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
private ngChange
|
|
6
|
+
private ngModel
|
|
7
|
+
private ngRequired
|
|
8
|
+
private ngDisabled
|
|
9
|
+
private props
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
19
|
-
|
|
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
|
|
28
|
+
MbgInputPasswordController['$inject'] = ['$scope', '$element', '$attrs']
|
|
25
29
|
|
|
26
30
|
const mbgInputPassword = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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>
|