@kigi/components 1.62.0 → 1.62.1-beta.1

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.62.0",
3
+ "version": "1.62.1-beta.1",
4
4
  "description": "@kigi/components",
5
5
  "main": "src/components/index.ts",
6
6
  "scripts": {
@@ -15,7 +15,7 @@ class MbgInputTextController {
15
15
  private focusableElements
16
16
  private nextIndex
17
17
  private onlyNumbers = false
18
-
18
+ private onlyDigits = false
19
19
 
20
20
  constructor(public $scope, public $element, public $attrs) {
21
21
  if ($attrs.ngRequired === '') {
@@ -46,8 +46,15 @@ class MbgInputTextController {
46
46
 
47
47
  onChange($event) {
48
48
  if (this.onlyNumbers && this.ngModel) {
49
- this.ngModel = String(this.ngModel).replace(/[^0-9]/g, '').replace(/^0+(\d)/, '$1');
49
+ this.ngModel = String(this.ngModel)
50
+ .replace(/[^0-9]/g, '')
51
+ .replace(/^0+(\d)/, '$1')
52
+ }
53
+
54
+ if (this.onlyDigits && this.ngModel) {
55
+ this.ngModel = String(this.ngModel).replace(/[^0-9]/g, '')
50
56
  }
57
+
51
58
  if (this.capitalize) {
52
59
  this.ngModel = this.capitalizeBool(this.ngModel)
53
60
  }
@@ -93,7 +100,8 @@ const mbgInputText = {
93
100
  ngKeydown: '&?',
94
101
  capitalize: '=?',
95
102
  maxLength: '@?',
96
- onlyNumbers: '<?'
103
+ onlyNumbers: '<?',
104
+ onlyDigits: '<?',
97
105
  },
98
106
  template,
99
107
  controller: MbgInputTextController,