@kigi/components 1.18.0-beta.2 → 1.18.0-beta.3
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-address/mbg-address.ts +10 -12
- package/src/components/mbg-address/modals/mbg-address-manual/mbg-address-manual.html +61 -25
- package/src/components/mbg-address/modals/mbg-address-manual/mbg-address-manual.ts +1 -1
- package/src/components/mbg-multi-select/mbg-multi-select.html +2 -2
- package/src/components/mbg-multi-select/mbg-multi-select.scss +13 -21
- package/src/components/mbg-multi-select/mbg-multi-select.ts +4 -15
package/package.json
CHANGED
|
@@ -50,7 +50,7 @@ class MbgAddressController {
|
|
|
50
50
|
public $timeout,
|
|
51
51
|
public mbgAddressService: MbgAddressService,
|
|
52
52
|
public $uibModal,
|
|
53
|
-
) {}
|
|
53
|
+
) { }
|
|
54
54
|
|
|
55
55
|
$onInit() {
|
|
56
56
|
if (this.capitalize && this.address) {
|
|
@@ -93,8 +93,8 @@ class MbgAddressController {
|
|
|
93
93
|
state: this.address.state
|
|
94
94
|
? this.address.state
|
|
95
95
|
: this.address.uf && this.address.uf.initial
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
? this.address.uf.initial
|
|
97
|
+
: '',
|
|
98
98
|
}
|
|
99
99
|
if (this.ngModel) {
|
|
100
100
|
this.ngModel.EX = (this.ngModel.country || '').toLowerCase() !== 'brasil'
|
|
@@ -236,13 +236,10 @@ class MbgAddressController {
|
|
|
236
236
|
|
|
237
237
|
createFullName() {
|
|
238
238
|
if (this.address.premisse) {
|
|
239
|
-
this.fullAddress = `${
|
|
240
|
-
this.address.
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}, ${this.address.localization ? this.address.localization : this.ngModel.localization} - ${
|
|
244
|
-
this.ngModel.state
|
|
245
|
-
}, ${this.ngModel.country}`
|
|
239
|
+
this.fullAddress = `${this.address.premisse ? this.address.premisse : this.ngModel.premisse
|
|
240
|
+
} - ${this.address.neighbourhood ? this.address.neighbourhood : this.ngModel.neighbourhood
|
|
241
|
+
}, ${this.address.localization ? this.address.localization : this.ngModel.localization} - ${this.ngModel.state
|
|
242
|
+
}, ${this.ngModel.country}`
|
|
246
243
|
}
|
|
247
244
|
}
|
|
248
245
|
|
|
@@ -289,8 +286,8 @@ class MbgAddressController {
|
|
|
289
286
|
countryCode: this.ngModel.countryCode,
|
|
290
287
|
zipCode: this.address.zipCode ? this.address.zipCode : this.ngModel.zipCode.replace('-', ''),
|
|
291
288
|
neighbourhood: this.address.neighbourhood
|
|
292
|
-
? this.
|
|
293
|
-
: this.
|
|
289
|
+
? this.ngModel.neighbourhood
|
|
290
|
+
: this.address.neighbourhood,
|
|
294
291
|
localization: this.ngModel.localization,
|
|
295
292
|
premisse: this.address.premisse
|
|
296
293
|
? this.address.premisse
|
|
@@ -575,6 +572,7 @@ class MbgAddressController {
|
|
|
575
572
|
response.zipCode = response.zipCode || ''
|
|
576
573
|
this.address.country = response.country || 'Brasil'
|
|
577
574
|
this.address.premisse = response.premisse || this.address.premisse
|
|
575
|
+
this.address.neighbourhood = response.neighbourhood || 'Centro'
|
|
578
576
|
this.ngModel = response
|
|
579
577
|
if (!EX) {
|
|
580
578
|
this.$timeout(() => this.searchAddressInfo(JSON.parse(JSON.stringify(response))))
|
|
@@ -1,76 +1,112 @@
|
|
|
1
1
|
<div class="mbg-address-manual-wrapper">
|
|
2
2
|
|
|
3
3
|
<form name="manualAddress">
|
|
4
|
-
<div class="row"
|
|
4
|
+
<div class="row"
|
|
5
|
+
ng-if="$ctrl.EX">
|
|
5
6
|
<div class="col-md-6">
|
|
6
7
|
<label>País</label>
|
|
7
|
-
<mbg-select ng-model="$ctrl.entity.country"
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
<mbg-select ng-model="$ctrl.entity.country"
|
|
9
|
+
placeholder="Brasil"
|
|
10
|
+
ng-if="$ctrl.countries"
|
|
11
|
+
on-select="$ctrl.selectCountry(value)"
|
|
12
|
+
on-unselect="$ctrl.unselectCountry()"
|
|
13
|
+
label="label"
|
|
14
|
+
ng-value="label"
|
|
15
|
+
fetch="$ctrl.countries"></mbg-select>
|
|
10
16
|
</div>
|
|
11
17
|
<div class="col-md-6">
|
|
12
18
|
<label>CEP</label>
|
|
13
19
|
<div class="mbg-input-wrapper input-cep-wrapper">
|
|
14
|
-
<input type="text"
|
|
15
|
-
|
|
20
|
+
<input type="text"
|
|
21
|
+
ng-model="$ctrl.entity.zipCode"
|
|
22
|
+
ng-change="$ctrl.validateLenth($event)"
|
|
23
|
+
placeholder="99999" />
|
|
16
24
|
</div>
|
|
17
25
|
</div>
|
|
18
26
|
</div>
|
|
19
27
|
<div class="row">
|
|
20
|
-
<div class="col-md-4"
|
|
28
|
+
<div class="col-md-4"
|
|
29
|
+
ng-if="!$ctrl.EX">
|
|
21
30
|
<label>CEP</label>
|
|
22
31
|
<div class="mbg-input-wrapper input-cep-wrapper">
|
|
23
|
-
<input autocomplete="{{ $ctrl.autocompleteValue }}"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
<input autocomplete="{{ $ctrl.autocompleteValue }}"
|
|
33
|
+
autocorrect="{{ $ctrl.autocompleteValue }}"
|
|
34
|
+
ng-class="{'mbg-error': (!$ctrl.entity.zipCode && $ctrl.inputErrors) || $ctrl.notFoundCep}"
|
|
35
|
+
mbg-error="!$ctrl.entity.zipCode || $ctrl.notFoundCep"
|
|
36
|
+
mbg-error-when="$ctrl.inputErrors"
|
|
37
|
+
mbg-error-message="É necessário informar o CEP"
|
|
38
|
+
spellcheck="false"
|
|
39
|
+
type="text"
|
|
40
|
+
ng-change="$ctrl.onChangeCep()"
|
|
41
|
+
ng-model="$ctrl.entity.zipCode"
|
|
42
|
+
placeholder="99999-999"
|
|
43
|
+
ui-br-cep-mask />
|
|
28
44
|
</div>
|
|
29
45
|
</div>
|
|
30
46
|
<div ng-class="$ctrl.EX ? 'col-md-12' : 'col-md-8'">
|
|
31
|
-
<label>
|
|
32
|
-
<mbg-input-text capitalize="true"
|
|
47
|
+
<label>Logradouros</label>
|
|
48
|
+
<mbg-input-text capitalize="true"
|
|
49
|
+
ng-model="$ctrl.entity.premisse"
|
|
50
|
+
placeholder="Ex. Av Duque de Caxias">
|
|
33
51
|
</mbg-input-text>
|
|
34
52
|
</div>
|
|
35
53
|
</div>
|
|
36
54
|
<div class="row">
|
|
37
55
|
<div class="col-md-12">
|
|
38
56
|
<label>Bairro</label>
|
|
39
|
-
<mbg-input-text capitalize="true"
|
|
57
|
+
<mbg-input-text capitalize="true"
|
|
58
|
+
ng-model="$ctrl.entity.neighbourhood"
|
|
59
|
+
placeholder="Ex. Jardim América">
|
|
40
60
|
</mbg-input-text>
|
|
41
61
|
</div>
|
|
42
62
|
</div>
|
|
43
63
|
<div class="row">
|
|
44
|
-
<div class="col-md-6"
|
|
64
|
+
<div class="col-md-6"
|
|
65
|
+
ng-if="!$ctrl.EX">
|
|
45
66
|
<label>Estado</label>
|
|
46
|
-
<mbg-select capitalize="true"
|
|
47
|
-
|
|
67
|
+
<mbg-select capitalize="true"
|
|
68
|
+
ng-model="$ctrl.entity.state"
|
|
69
|
+
fetch="$ctrl.searchState(query)"
|
|
70
|
+
label="name"
|
|
71
|
+
ng-value="shortName"
|
|
72
|
+
placeholder="Ex. Paraná"></mbg-select>
|
|
48
73
|
</div>
|
|
49
|
-
<div class="col-md-6"
|
|
74
|
+
<div class="col-md-6"
|
|
75
|
+
ng-if="$ctrl.EX">
|
|
50
76
|
<label>Estado</label>
|
|
51
|
-
<mbg-input-text capitalize="true"
|
|
77
|
+
<mbg-input-text capitalize="true"
|
|
78
|
+
ng-model="$ctrl.entity.state"
|
|
79
|
+
placeholder="Ex. Maringá"></mbg-input-text>
|
|
52
80
|
</div>
|
|
53
81
|
<div class="col-md-6">
|
|
54
82
|
<label>Cidade</label>
|
|
55
|
-
<mbg-input-text capitalize="true"
|
|
83
|
+
<mbg-input-text capitalize="true"
|
|
84
|
+
ng-model="$ctrl.entity.localization"
|
|
85
|
+
placeholder="Ex. Maringá">
|
|
56
86
|
</mbg-input-text>
|
|
57
87
|
</div>
|
|
58
88
|
</div>
|
|
59
89
|
<div class="row">
|
|
60
90
|
<div class="col-md-4">
|
|
61
91
|
<label>Número</label>
|
|
62
|
-
<mbg-input-text ng-model="$ctrl.entity.number"
|
|
92
|
+
<mbg-input-text ng-model="$ctrl.entity.number"
|
|
93
|
+
placeholder="Ex. 36"></mbg-input-text>
|
|
63
94
|
</div>
|
|
64
95
|
<div class="col-md-8">
|
|
65
96
|
<label>Complemento</label>
|
|
66
|
-
<mbg-input-text capitalize="true"
|
|
97
|
+
<mbg-input-text capitalize="true"
|
|
98
|
+
ng-model="$ctrl.entity.information"
|
|
99
|
+
placeholder="Ex. Restaurante X">
|
|
67
100
|
</mbg-input-text>
|
|
68
101
|
</div>
|
|
69
102
|
</div>
|
|
70
103
|
</form>
|
|
71
104
|
|
|
72
105
|
<div class="content-confirm-upload">
|
|
73
|
-
<mbg-btn-form label="Salvar"
|
|
74
|
-
|
|
106
|
+
<mbg-btn-form label="Salvar"
|
|
107
|
+
loading="$ctrl.loading"
|
|
108
|
+
ng-click="$ctrl.finish(manualAddress.$valid)"></mbg-btn-form>
|
|
109
|
+
<a class="btn-cancel"
|
|
110
|
+
ng-click="$ctrl.dismiss()">Cancelar</a>
|
|
75
111
|
</div>
|
|
76
112
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div class="mbg-multi-select-wrapper">
|
|
2
|
-
<span ng-if="$ctrl.showScrollArrows" class="arrow-left" ng-click="$ctrl.scrollToLeft()">
|
|
2
|
+
<span ng-if="$ctrl.showScrollArrows" class="arrow-left visibility" ng-click="$ctrl.scrollToLeft()">
|
|
3
3
|
<i class="fas fa-chevron-circle-left"></i>
|
|
4
4
|
</span>
|
|
5
5
|
<div class="mbg-multi-select-scroll"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
label="{{ $ctrl.label }}"></mbg-select>
|
|
38
38
|
</div>
|
|
39
39
|
</div>
|
|
40
|
-
<span ng-if="$ctrl.showScrollArrows" class="arrow-right" ng-click="$ctrl.scrollToRight()">
|
|
40
|
+
<span ng-if="$ctrl.showScrollArrows" class="arrow-right visibility" ng-click="$ctrl.scrollToRight()">
|
|
41
41
|
<i class="fas fa-chevron-circle-right"></i>
|
|
42
42
|
</span>
|
|
43
43
|
</div>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
position: absolute;
|
|
10
10
|
font-size: 20px;
|
|
11
11
|
|
|
12
|
-
z-index: 10;
|
|
13
|
-
|
|
14
12
|
background: white;
|
|
15
13
|
overflow: hidden;
|
|
16
14
|
height: 20px;
|
|
@@ -23,28 +21,22 @@
|
|
|
23
21
|
}
|
|
24
22
|
}
|
|
25
23
|
|
|
26
|
-
.
|
|
27
|
-
|
|
28
|
-
transition: transform .5s;
|
|
29
|
-
transform: translateX(-40px);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.arrow-right {
|
|
33
|
-
right: 0px;
|
|
34
|
-
transition: transform .5s;
|
|
35
|
-
transform: translateX(40px);
|
|
24
|
+
.visibility {
|
|
25
|
+
display: none;
|
|
36
26
|
}
|
|
37
|
-
|
|
38
27
|
|
|
39
28
|
&:hover {
|
|
40
|
-
.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
29
|
+
.visibility {
|
|
30
|
+
display: block;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.arrow-left {
|
|
35
|
+
left: 8px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.arrow-right {
|
|
39
|
+
right: 8px;
|
|
48
40
|
}
|
|
49
41
|
|
|
50
42
|
.mbg-multi-select-scroll {
|
|
@@ -22,8 +22,6 @@ class MbgMultiSelectController {
|
|
|
22
22
|
private enableFavorite: boolean
|
|
23
23
|
private stepScrollSize: any
|
|
24
24
|
private showScrollArrows: boolean
|
|
25
|
-
private onRemoveItem: Function
|
|
26
|
-
private index
|
|
27
25
|
|
|
28
26
|
constructor(public $scope, public $element, public $attrs, public $timeout) {}
|
|
29
27
|
|
|
@@ -32,8 +30,6 @@ class MbgMultiSelectController {
|
|
|
32
30
|
this.stepScrollSize = 200
|
|
33
31
|
}
|
|
34
32
|
|
|
35
|
-
this.index = this.index || 0
|
|
36
|
-
|
|
37
33
|
this.widthEllipsis = this.widthEllipsis || '154px'
|
|
38
34
|
this.$scope.$watch(
|
|
39
35
|
'$ctrl.ngModel',
|
|
@@ -57,7 +53,7 @@ class MbgMultiSelectController {
|
|
|
57
53
|
|
|
58
54
|
verifyScroll() {
|
|
59
55
|
this.$timeout(() => {
|
|
60
|
-
const elm = angular.element(`.mbg-multi-select-scroll`)[
|
|
56
|
+
const elm = angular.element(`.mbg-multi-select-scroll`)[0]
|
|
61
57
|
this.$timeout(() => {
|
|
62
58
|
ScrollAnimate.scrollLeftTo(elm, elm.scrollWidth, 350)
|
|
63
59
|
}, 100)
|
|
@@ -66,7 +62,7 @@ class MbgMultiSelectController {
|
|
|
66
62
|
|
|
67
63
|
scrollToLeft() {
|
|
68
64
|
this.$timeout(() => {
|
|
69
|
-
const elm: Element = angular.element(`.mbg-multi-select-scroll`)[
|
|
65
|
+
const elm: Element = angular.element(`.mbg-multi-select-scroll`)[0]
|
|
70
66
|
this.$timeout(() => {
|
|
71
67
|
const value = +elm.scrollLeft - this.stepScrollSize
|
|
72
68
|
elm.scroll({
|
|
@@ -79,7 +75,8 @@ class MbgMultiSelectController {
|
|
|
79
75
|
|
|
80
76
|
scrollToRight() {
|
|
81
77
|
this.$timeout(() => {
|
|
82
|
-
const elm = angular.element(`.mbg-multi-select-scroll`)[
|
|
78
|
+
const elm = angular.element(`.mbg-multi-select-scroll`)[0]
|
|
79
|
+
|
|
83
80
|
this.$timeout(() => {
|
|
84
81
|
const value = +elm.scrollLeft + this.stepScrollSize
|
|
85
82
|
elm.scroll({
|
|
@@ -122,8 +119,6 @@ class MbgMultiSelectController {
|
|
|
122
119
|
}
|
|
123
120
|
|
|
124
121
|
remoteItem(index) {
|
|
125
|
-
const item = this.ngModel[index]
|
|
126
|
-
|
|
127
122
|
this.ngModel.splice(index, 1)
|
|
128
123
|
this.verifyScroll()
|
|
129
124
|
this.$timeout(() => {
|
|
@@ -131,10 +126,6 @@ class MbgMultiSelectController {
|
|
|
131
126
|
this.ngChange()
|
|
132
127
|
}
|
|
133
128
|
})
|
|
134
|
-
|
|
135
|
-
if (this.onRemoveItem) {
|
|
136
|
-
this.onRemoveItem({ item, index })
|
|
137
|
-
}
|
|
138
129
|
}
|
|
139
130
|
|
|
140
131
|
stopDragEvents() {
|
|
@@ -288,8 +279,6 @@ const mbgMultiSelect = {
|
|
|
288
279
|
enableFavorite: '=?',
|
|
289
280
|
stepScrollSize: '=?',
|
|
290
281
|
showScrollArrows: '=?',
|
|
291
|
-
onRemoveItem: '&?',
|
|
292
|
-
index: '=?',
|
|
293
282
|
},
|
|
294
283
|
template,
|
|
295
284
|
controller: MbgMultiSelectController,
|