@kigi/components 1.11.3 → 1.11.4

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.11.3",
3
+ "version": "1.11.4",
4
4
  "description": "@kigi/components",
5
5
  "main": "src/components/index.ts",
6
6
  "scripts": {
@@ -1,7 +1,7 @@
1
1
  <div class="mbg-input-wrapper mbg-input-name-wrapper"
2
2
  ng-if="$ctrl.props">
3
3
  <input type="text"
4
- ng-if="$ctrl.state == 'TO' || $ctrl.state == 'MT' || $ctrl.state == 'AL'"
4
+ ng-if="$ctrl.state == 'TO' || $ctrl.state == 'MT' || $ctrl.state == 'AL' || $ctrl.state == 'GO'"
5
5
  mbg-mask-ie
6
6
  ng-model="$ctrl.ngModel"
7
7
  name="{{$ctrl.name}}"
@@ -17,7 +17,7 @@
17
17
  placeholder="{{ $ctrl.props.placeholder }}" />
18
18
 
19
19
  <input type="text"
20
- ng-if="!$ctrl.state || ($ctrl.state != 'TO' && $ctrl.state != 'MT' && $ctrl.state != 'AL')"
20
+ ng-if="!$ctrl.state || ($ctrl.state != 'TO' && $ctrl.state != 'MT' && $ctrl.state != 'AL' && $ctrl.state != 'GO')"
21
21
  ng-model="$ctrl.ngModel"
22
22
  name="{{$ctrl.name}}"
23
23
  ng-init="$ctrl.onInit()"
@@ -8,7 +8,13 @@ class MbgInputNumberController {
8
8
  private ngDisabled
9
9
  private props
10
10
 
11
- constructor(public $scope, public $element, public $attrs, public $compile, public $timeout) {}
11
+ constructor(
12
+ public $scope,
13
+ public $element,
14
+ public $attrs,
15
+ public $compile,
16
+ public $timeout
17
+ ) { }
12
18
 
13
19
  $onInit() {
14
20
  this.$timeout(() => {
@@ -22,7 +28,7 @@ class MbgInputNumberController {
22
28
  placeholder: this.$attrs.placeholder || '',
23
29
  precision: this.$attrs.precision || 0,
24
30
  allowNegative: this.$attrs.allowNegative ? JSON.parse(this.$attrs.allowNegative) : false,
25
- uiHideGroupSep: typeof this.$attrs.uiHideGroupSep !== undefined ? true : undefined,
31
+ uiHideGroupSep: typeof this.$attrs.uiHideGroupSep !== undefined ? true : undefined
26
32
  }
27
33
  if (this.$attrs.min) {
28
34
  this.props.min = this.$attrs.min
@@ -47,12 +53,19 @@ class MbgInputNumberController {
47
53
 
48
54
  onChange() {
49
55
  if (this.ngChange) {
50
- this.ngChange({ newCount: this.ngModel })
56
+ this.ngChange({})
51
57
  }
52
58
  }
59
+
53
60
  }
54
61
 
55
- MbgInputNumberController.$inject = ['$scope', '$element', '$attrs', '$compile', '$timeout']
62
+ MbgInputNumberController.$inject = [
63
+ '$scope',
64
+ '$element',
65
+ '$attrs',
66
+ '$compile',
67
+ '$timeout'
68
+ ]
56
69
 
57
70
  const mbgInputNumber = {
58
71
  bindings: {
@@ -63,7 +76,7 @@ const mbgInputNumber = {
63
76
  ngBlur: '&?',
64
77
  ngFocus: '&?',
65
78
  positive: '=?',
66
- ngModelOptions: '=?',
79
+ ngModelOptions: '=?'
67
80
  },
68
81
  template,
69
82
  controller: MbgInputNumberController,
@@ -1,7 +1,7 @@
1
1
  export interface ApplyFields {
2
2
  label: string
3
3
  type: string
4
- inputType?: 'SELECT' | 'TEXT' | 'NUMBER' | 'MONEY' | 'PERCENTAGE' | 'BOOLEAN'
4
+ inputType?: 'SELECT' | 'TEXT' | 'NUMBER' | 'MONEY' | 'PERCENTAGE'
5
5
  numberPrecision?: number
6
6
  search?: Function
7
7
  }
@@ -98,12 +98,6 @@
98
98
  ng-disabled="!item.field"
99
99
  label="label"
100
100
  fetch="item.field.search(query)"></mbg-select>
101
- <switch ng-if="item.field.inputType == 'BOOLEAN'"
102
- name="item.field.inputType"
103
- ng-model="item.selected"
104
- class="green active-m"
105
- ng-change="$ctrl.handleNgModel()">
106
- </switch>
107
101
  </div>
108
102
  <div class="col-md-3">
109
103
  <div class="options-action">
@@ -78,6 +78,8 @@ export class NgMaskIe {
78
78
  return this.validateMT(ngModel)
79
79
  case 'AL':
80
80
  return this.validateAL(ngModel)
81
+ case 'GO':
82
+ return this.validateGO(ngModel)
81
83
  }
82
84
  }
83
85
 
@@ -153,6 +155,32 @@ export class NgMaskIe {
153
155
  return dig == nro[10]
154
156
  }
155
157
 
158
+ validateGO(ie) {
159
+ if (ie.length == 9) {
160
+ let initialValid = ['10', '11', '20', '29']
161
+ let ieArr = [...ie]
162
+ let weights = [9, 8, 7, 6, 5, 4, 3, 2]
163
+ let results = []
164
+ let dig = Number(ieArr[8])
165
+ if (!initialValid.includes(ie.slice(0, 2))) {
166
+ return false
167
+ }
168
+ for (let i = 0; i < weights.length; i++) {
169
+ results.push(weights[i] * Number(ieArr[i]))
170
+ }
171
+
172
+ let sum = results.reduce((acc, value) => acc + value, 0)
173
+ let mod = sum % 11
174
+
175
+ if ((mod == 0 || mod == 1) && dig !== 0) {
176
+ return false
177
+ } else if (dig !== 11 - mod) {
178
+ return false
179
+ }
180
+ return true
181
+ }
182
+ }
183
+
156
184
  setIeValidate(elm, valid) {
157
185
  const form = elm.closest('form')
158
186
  const formName = form.attr('name')