@kigi/components 1.4.3 → 1.4.7

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.4.3",
3
+ "version": "1.4.7",
4
4
  "description": "@kigi/components",
5
5
  "main": "src/components/index.ts",
6
6
  "scripts": {
@@ -31,6 +31,10 @@
31
31
  <div class="mbg-input-wrapper input-cep-wrapper">
32
32
  <input autocomplete="{{ $ctrl.autocompleteValue }}"
33
33
  autocorrect="{{ $ctrl.autocompleteValue }}"
34
+ ng-class="{'mbg-error': !$ctrl.entity.zipCode && $ctrl.inputErrors}"
35
+ mbg-error="!$ctrl.entity.zipCode"
36
+ mbg-error-when="$ctrl.inputErrors"
37
+ mbg-error-message="É necessário informar o CEP"
34
38
  spellcheck="false"
35
39
  type="text"
36
40
  ng-change="$ctrl.onChangeCep()"
@@ -91,7 +95,7 @@
91
95
  <div class="content-confirm-upload">
92
96
  <mbg-btn-form label="Salvar"
93
97
  loading="$ctrl.loading"
94
- ng-click="$ctrl.finish()"></mbg-btn-form>
98
+ ng-click="$ctrl.finish(manualAddress.$valid)"></mbg-btn-form>
95
99
  <a class="btn-cancel"
96
100
  ng-click="$ctrl.dismiss()">Cancelar</a>
97
101
  </div>
@@ -26,6 +26,7 @@ class MbgAddressManualController {
26
26
  public navigatorData
27
27
  public entity: any = {}
28
28
  public countries: any[]
29
+ public inputErrors: boolean = false
29
30
 
30
31
  constructor(
31
32
  public $scope,
@@ -149,7 +150,11 @@ class MbgAddressManualController {
149
150
  })
150
151
  }
151
152
 
152
- finish() {
153
+ finish(valid) {
154
+ this.inputErrors = true
155
+ if (!valid) {
156
+ return
157
+ }
153
158
  this.$uibModalInstance.close(this.entity)
154
159
  }
155
160
  }
@@ -72,7 +72,6 @@
72
72
  ng-model="$ctrl.gridValues[$index][$parent.$index].stock"
73
73
  placeholder="0"
74
74
  ng-keydown="$ctrl.onKeydown($event)"
75
- positive-number="true"
76
75
  ng-class="{ 'grid-disable': $ctrl.activeAddOrRemove && !$ctrl.gridValues[$index][$parent.$index].enable }"
77
76
  ng-change="$ctrl.handleGridValues()"
78
77
  ng-model-options="{ debounce: 500 }"
@@ -92,4 +91,4 @@
92
91
  </tr>
93
92
  </tbody>
94
93
  </table>
95
- </div>
94
+ </div>
@@ -53,7 +53,6 @@
53
53
  ng-model="item.stock"
54
54
  ng-keydown="$ctrl.onKeydown($event)"
55
55
  placeholder="0"
56
- positive-number="true"
57
56
  placeholder="Estoque"
58
57
  ng-model-options="{ debounce: 500 }"
59
58
  class="inline-product-stock" />
@@ -72,4 +71,4 @@
72
71
  </div>
73
72
  </div>
74
73
  </div>
75
- </div>
74
+ </div>
@@ -1,8 +1,8 @@
1
1
  export interface ConditionFields {
2
2
  label: string
3
3
  type: string
4
- search: Function
4
+ search?: Function
5
5
  operators: Array<
6
- 'EQUAL' | 'GT' | 'LT' | 'GEQ' | 'LEQ' | 'NOT_EQUAL' | 'CONTAINING' | 'STARTS_WITH'
6
+ 'EQUAL' | 'GT' | 'LT' | 'GEQ' | 'LEQ' | 'NOT_EQUAL' | 'CONTAINING' | 'STARTS_WITH' | 'BETWEEN'
7
7
  >
8
8
  }
@@ -8,7 +8,7 @@
8
8
  <label>Comparação</label>
9
9
  </div>
10
10
  <div class="col-md-3">
11
- <label>Pesquisa</label>
11
+ <label>Valor</label>
12
12
  </div>
13
13
  </div>
14
14
  <div class="condition-content">
@@ -26,7 +26,8 @@
26
26
  label="operator"
27
27
  fetch="$ctrl.searchOperators(item)"></mbg-select>
28
28
  </div>
29
- <div class="col-md-3">
29
+ <div class="col-md-3"
30
+ ng-if="(item.operator && item.operator.name !== 'BETWEEN') || !item.operator">
30
31
  <mbg-select ng-model="item.selected"
31
32
  ng-disabled="!item.field"
32
33
  label="label"
@@ -34,7 +35,15 @@
34
35
  on-unselect="$ctrl.handleNgModel()"
35
36
  fetch="item.field.search(query)"></mbg-select>
36
37
  </div>
37
- <div class="col-md-3">
38
+ <div class="col-md-4"
39
+ ng-if="item.operator && item.operator.name == 'BETWEEN'">
40
+ <mbg-input-date ng-model="item.selected"
41
+ placeholder-start="Data início"
42
+ placeholder-end="Data fim"
43
+ calendar="true"
44
+ between="true"></mbg-input-date>
45
+ </div>
46
+ <div class="col-md-2">
38
47
  <div class="options-action">
39
48
  <label class="add"
40
49
  ng-click="$ctrl.addCondition()"
@@ -102,4 +111,4 @@
102
111
  </div>
103
112
  </div>
104
113
  </div>
105
- </div>
114
+ </div>
@@ -25,7 +25,6 @@
25
25
  .apply-item {
26
26
  margin-bottom: 8px;
27
27
  }
28
-
29
28
  }
30
29
 
31
30
  .options-action {
@@ -24,6 +24,7 @@ class MbgRepasseController {
24
24
  { name: 'NOT_EQUAL', operator: 'diferente de' },
25
25
  { name: 'CONTAINING', operator: 'contém' },
26
26
  { name: 'STARTS_WITH', operator: 'começa com' },
27
+ { name: 'BETWEEN', operator: 'entre' },
27
28
  ]
28
29
  this.$scope.$watch('$ctrl.ngModel', (data) => {
29
30
  if (!data || Object.keys(data).length === 0) {
@@ -1,14 +1,14 @@
1
- <div class="mbg-text-wrapper mb-text-area-wrapper">
1
+ <div class="mbg-text-area-wrapper mb-text-area-wrapper">
2
2
  <textarea type="text"
3
- ng-model="$ctrl.ngModel"
4
- ng-change="$ctrl.onChange()"
5
- ng-required="$ctrl.ngRequired"
6
- ng-disabled="$ctrl.ngDisabled"
7
- ng-blur="$ctrl.ngBlur({ $event })"
8
- ng-focus="$ctrl.ngFocus({ $event })"
9
- ng-keyup="$ctrl.ngKeyup({ $event })"
10
- ng-keypress="$ctrl.ngKeypress({ $event })"
11
- ng-keydown="$ctrl.ngKeydown({ $event })"
12
- placeholder="{{ $ctrl.placeholder }}" >
3
+ ng-model="$ctrl.ngModel"
4
+ ng-change="$ctrl.onChange()"
5
+ ng-required="$ctrl.ngRequired"
6
+ ng-disabled="$ctrl.ngDisabled"
7
+ ng-blur="$ctrl.ngBlur({ $event })"
8
+ ng-focus="$ctrl.ngFocus({ $event })"
9
+ ng-keyup="$ctrl.ngKeyup({ $event })"
10
+ ng-keypress="$ctrl.ngKeypress({ $event })"
11
+ ng-keydown="$ctrl.ngKeydown({ $event })"
12
+ placeholder="{{ $ctrl.placeholder }}">
13
13
  </textarea>
14
14
  </div>
@@ -1,3 +1,23 @@
1
- // .mbg-text-area-wrapper {
2
-
3
- // }
1
+ .mbg-text-area-wrapper {
2
+ width: 100%;
3
+ margin: 0;
4
+ padding: 0;
5
+ display: flex;
6
+ height: 74px;
7
+ background: #fff;
8
+ border: 1px solid #ddd;
9
+ border-radius: 5px;
10
+
11
+ textarea {
12
+ border: none;
13
+ padding: 8px 14px;
14
+ flex: 1;
15
+ background: transparent;
16
+ outline: none;
17
+ width: 500px;
18
+ &[disabled="disabled"] {
19
+ background: #f5f5f5;
20
+ }
21
+ font-weight: 500;
22
+ }
23
+ }
@@ -4,4 +4,4 @@
4
4
  placeholder="{{ $ctrl.placeholder }}"
5
5
  id="editor-{{$ctrl.uid}}"
6
6
  name="editor-{{$ctrl.uid}}"></textarea>
7
- </div>
7
+ </div>
@@ -78,6 +78,8 @@ export class MbgError {
78
78
  return currentInput.length === 0
79
79
  ? elm[0].nodeName === 'MBG-SELECT' || elm[0].nodeName === 'MBG-MULTI-SELECT'
80
80
  ? angular.element(document.querySelector(`.mbg-select-list[uid="${selectUid}"] input`))
81
+ : elm[0].nodeName === 'MBG-TEXT-AREA'
82
+ ? elm.find('textarea')
81
83
  : elm.find('input')
82
84
  : elm.find('input')
83
85
  }
@@ -127,6 +129,11 @@ export class MbgError {
127
129
  element = elm.find('.mbg-select-input-fake')
128
130
  handleClassError(element, type)
129
131
  break
132
+
133
+ case 'MBG-TEXT-AREA':
134
+ element = elm.find('.mbg-text-area-wrapper')
135
+ handleClassError(element, type)
136
+ break
130
137
  case 'MBG-INPUT-STEP':
131
138
  element = elm.find('.mb-input-step-wrapper')
132
139
  handleClassError(element, type)
@@ -169,4 +176,4 @@ export class MbgError {
169
176
  }
170
177
  }
171
178
 
172
- MbgError.$inject = ['$timeout']
179
+ MbgError['$inject'] = ['$timeout']