@kigi/components 1.27.8-alpha → 1.28.0-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-date/mbg-input-date.html +70 -70
- package/src/components/mbg-input-date/mbg-input-date.scss +4 -0
- package/src/components/mbg-input-date/mbg-input-date.ts +1 -1
- package/src/components/mbg-multi-select/mbg-multi-select.ts +1 -1
- package/src/components/mbg-range-value/index.ts +8 -0
- package/src/components/mbg-range-value/mbg-range-value.html +35 -0
- package/src/components/mbg-range-value/mbg-range-value.scss +20 -0
- package/src/components/mbg-range-value/mbg-range-value.ts +100 -0
- package/src/components/mbg-status-label/mbg-status-label.ts +7 -3
package/package.json
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
1
|
<div class="mbg-input-wrapper mb-input-date-wrapper"
|
|
2
2
|
ng-if="$ctrl.props">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
3
|
+
<!-- only mask -->
|
|
4
|
+
<input type="text"
|
|
5
|
+
ng-if="!$ctrl.calendar && !$ctrl.between"
|
|
6
|
+
ng-model="$ctrl.ngModel"
|
|
7
|
+
ng-change="$ctrl.onChange()"
|
|
8
|
+
placeholder="{{ $ctrl.placeholder }}"
|
|
9
|
+
ng-required="$ctrl.ngRequired"
|
|
10
|
+
ng-disabled="$ctrl.ngDisabled"
|
|
11
|
+
ng-blur="$ctrl.ngBlur({ $event })"
|
|
12
|
+
ng-focus="$ctrl.ngFocus({ $event })"
|
|
13
|
+
ng-keyup="$ctrl.ngKeyup({ $event })"
|
|
14
|
+
ng-keypress="$ctrl.ngKeypress({ $event })"
|
|
15
|
+
ng-keydown="$ctrl.ngKeydown({ $event })"
|
|
16
|
+
ui-date-mask="{{ $ctrl.format }}" />
|
|
17
|
+
<!-- with calendar -->
|
|
18
|
+
<input type="text"
|
|
19
|
+
class="input-with-calendar"
|
|
20
|
+
ng-if="$ctrl.calendar && !$ctrl.between"
|
|
21
|
+
ng-model="$ctrl.ngModel"
|
|
22
|
+
ng-change="$ctrl.onChange()"
|
|
23
|
+
placeholder="{{ $ctrl.placeholder }}"
|
|
24
|
+
ng-required="$ctrl.ngRequired"
|
|
25
|
+
ng-disabled="$ctrl.ngDisabled"
|
|
26
|
+
ng-blur="$ctrl.handleBlur({ $event })"
|
|
27
|
+
ng-focus="$ctrl.handleFocus({ $event })"
|
|
28
|
+
ng-keyup="$ctrl.ngKeyup({ $event })"
|
|
29
|
+
ng-keypress="$ctrl.ngKeypress({ $event })"
|
|
30
|
+
ng-keydown="$ctrl.ngKeydown({ $event })"
|
|
31
|
+
ui-date-mask="{{ $ctrl.format }}"
|
|
32
|
+
only-month-year="$ctrl.onlyMonthYear"
|
|
33
|
+
mbg-datepicker />
|
|
34
|
+
<!-- between dates -->
|
|
35
|
+
<div class="mbg-date-between"
|
|
36
|
+
ng-if="$ctrl.between">
|
|
37
|
+
<input type="text"
|
|
38
|
+
class="mbg-date-between-start"
|
|
39
|
+
ng-model="$ctrl.ngModel.start"
|
|
40
|
+
ng-change="$ctrl.onChange()"
|
|
41
|
+
placeholder="{{ $ctrl.props.placeholderStart }}"
|
|
42
|
+
ng-required="$ctrl.ngRequired"
|
|
43
|
+
ng-disabled="$ctrl.ngDisabled"
|
|
44
|
+
ng-blur="$ctrl.handleBlur({ $event })"
|
|
45
|
+
ng-focus="$ctrl.handleFocus({ $event })"
|
|
46
|
+
ng-keyup="$ctrl.ngKeyup({ $event })"
|
|
47
|
+
ng-keypress="$ctrl.ngKeypress({ $event })"
|
|
48
|
+
ng-keydown="$ctrl.ngKeydown({ $event })"
|
|
49
|
+
ui-date-mask="{{ $ctrl.format }}"
|
|
50
|
+
on-select="$ctrl.onSelectStart()"
|
|
51
|
+
only-month-year="$ctrl.onlyMonthYear"
|
|
52
|
+
mbg-datepicker />
|
|
53
|
+
<div class="mbg-date-between-space">
|
|
54
|
+
{{ $ctrl.betweenText == undefined ? 'Até' : $ctrl.betweenText }}
|
|
55
|
+
</div>
|
|
56
|
+
<input type="text"
|
|
57
|
+
class="mbg-date-between-end"
|
|
58
|
+
ng-model="$ctrl.ngModel.end"
|
|
59
|
+
ng-change="$ctrl.onChangeEndDate()"
|
|
60
|
+
placeholder="{{ $ctrl.props.placeholderEnd }}"
|
|
61
|
+
ng-required="$ctrl.ngRequired"
|
|
62
|
+
ng-disabled="$ctrl.ngDisabled"
|
|
63
|
+
ng-blur="$ctrl.handleBlur({ $event })"
|
|
64
|
+
ng-focus="$ctrl.handleFocus({ $event })"
|
|
65
|
+
ng-keyup="$ctrl.ngKeyup({ $event })"
|
|
66
|
+
ng-keypress="$ctrl.ngKeypress({ $event })"
|
|
67
|
+
ng-keydown="$ctrl.ngKeydown({ $event })"
|
|
68
|
+
ui-date-mask="{{ $ctrl.format }}"
|
|
69
|
+
on-select="$ctrl.onSelectEnd()"
|
|
70
|
+
only-month-year="$ctrl.onlyMonthYear"
|
|
71
|
+
mbg-datepicker />
|
|
72
|
+
</div>
|
|
73
73
|
</div>
|
|
@@ -111,7 +111,7 @@ class MbgInputDateController {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
MbgInputDateController
|
|
114
|
+
MbgInputDateController['$inject'] = ['$scope', '$element', '$attrs', '$timeout']
|
|
115
115
|
|
|
116
116
|
const mbgInputDate = {
|
|
117
117
|
bindings: {
|
|
@@ -273,7 +273,7 @@ class MbgMultiSelectController {
|
|
|
273
273
|
})
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
-
MbgMultiSelectController
|
|
276
|
+
MbgMultiSelectController['$inject'] = ['$scope', '$element', '$attrs', '$timeout']
|
|
277
277
|
|
|
278
278
|
const mbgMultiSelect = {
|
|
279
279
|
bindings: {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<div class="mbg-value-between">
|
|
2
|
+
<input type="text"
|
|
3
|
+
class="mbg-value-between-startValue"
|
|
4
|
+
ng-model="$ctrl.ngModel.startValue"
|
|
5
|
+
ng-change="$ctrl.onChangeStart()"
|
|
6
|
+
ng-model-options="$ctrl.ngModelOptions"
|
|
7
|
+
placeholder="{{ $ctrl.props.placeholderStart }}"
|
|
8
|
+
ng-required="$ctrl.ngRequired"
|
|
9
|
+
ng-disabled="$ctrl.ngDisabled"
|
|
10
|
+
ng-blur="$ctrl.handleBlur({ $event })"
|
|
11
|
+
ng-focus="$ctrl.handleFocus({ $event })"
|
|
12
|
+
ng-keyup="$ctrl.ngKeyup({ $event })"
|
|
13
|
+
ng-keypress="$ctrl.ngKeypress({ $event })"
|
|
14
|
+
ng-keydown="$ctrl.ngKeydown({ $event })"
|
|
15
|
+
ui-money-mask="{{ $ctrl.props.precision }}"
|
|
16
|
+
on-select="$ctrl.onSelectStart()" />
|
|
17
|
+
<div class="mbg-value-between-space">
|
|
18
|
+
{{ $ctrl.betweenText == undefined ? 'Até' : $ctrl.betweenText }}
|
|
19
|
+
</div>
|
|
20
|
+
<input type="text"
|
|
21
|
+
class="mbg-value-between-endValue"
|
|
22
|
+
ng-model="$ctrl.ngModel.endValue"
|
|
23
|
+
ng-change="$ctrl.onChangeEnd()"
|
|
24
|
+
ng-model-options="$ctrl.ngModelOptions"
|
|
25
|
+
placeholder="{{ $ctrl.props.placeholderEnd }}"
|
|
26
|
+
ng-required="$ctrl.ngRequired"
|
|
27
|
+
ng-disabled="$ctrl.ngDisabled"
|
|
28
|
+
ng-blur="$ctrl.handleBlur({ $event })"
|
|
29
|
+
ng-focus="$ctrl.handleFocus({ $event })"
|
|
30
|
+
ng-keyup="$ctrl.ngKeyup({ $event })"
|
|
31
|
+
ng-keypress="$ctrl.ngKeypress({ $event })"
|
|
32
|
+
ng-keydown="$ctrl.ngKeydown({ $event })"
|
|
33
|
+
ui-money-mask="{{ $ctrl.props.precision }}"
|
|
34
|
+
on-select="$ctrl.onSelectEnd()" />
|
|
35
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.mbg-value-between {
|
|
2
|
+
display: flex;
|
|
3
|
+
|
|
4
|
+
input {
|
|
5
|
+
border: 1px solid #ddd;
|
|
6
|
+
border-radius: 5px;
|
|
7
|
+
padding: 8px 14px;
|
|
8
|
+
flex: 1;
|
|
9
|
+
outline: none;
|
|
10
|
+
height: 44px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.mbg-value-between-space {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
padding: 0 8px;
|
|
20
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import './mbg-range-value.scss'
|
|
2
|
+
import template from './mbg-range-value.html'
|
|
3
|
+
declare let $
|
|
4
|
+
|
|
5
|
+
class MbgRangeValueController {
|
|
6
|
+
public ngChange
|
|
7
|
+
public ngModel
|
|
8
|
+
public ngFocus
|
|
9
|
+
public ngBlur
|
|
10
|
+
public ngRequired
|
|
11
|
+
public ngDisabled
|
|
12
|
+
public props
|
|
13
|
+
public betweenText: string
|
|
14
|
+
|
|
15
|
+
constructor(public $scope, public $element, public $attrs, public $timeout) {
|
|
16
|
+
if ($attrs.ngRequired === '') {
|
|
17
|
+
this.ngRequired = true
|
|
18
|
+
}
|
|
19
|
+
if ($attrs.ngDisabled === '') {
|
|
20
|
+
this.ngDisabled = true
|
|
21
|
+
}
|
|
22
|
+
this.props = {
|
|
23
|
+
placeholder: $attrs.placeholder || '',
|
|
24
|
+
placeholderStart: $attrs.placeholderStart || '',
|
|
25
|
+
placeholderEnd: $attrs.placeholderEnd || '',
|
|
26
|
+
prefix: $attrs.prefix || 'R$ ',
|
|
27
|
+
decimal: $attrs.decimal || ',',
|
|
28
|
+
thousands: $attrs.decimal || '.',
|
|
29
|
+
precision: this.$scope.$parent.$eval($attrs.precision) || 2,
|
|
30
|
+
allowNegative: $attrs.allowNegative ? JSON.parse($attrs.allowNegative) : true,
|
|
31
|
+
allowZero: $attrs.allowZero ? JSON.parse($attrs.allowZero) : false,
|
|
32
|
+
allowEmpty: $attrs.allowEmpty ? JSON.parse($attrs.allowEmpty) : false,
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
$onInit() {}
|
|
37
|
+
|
|
38
|
+
onChangeStart() {
|
|
39
|
+
if (this.ngChange) {
|
|
40
|
+
this.ngChange({})
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
onChangeEnd(a) {
|
|
45
|
+
if (this.ngChange) {
|
|
46
|
+
this.ngChange({})
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
handleFocus(props) {
|
|
51
|
+
if (this.ngFocus) {
|
|
52
|
+
this.ngFocus(props)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
handleBlur(props) {
|
|
57
|
+
if (this.ngBlur) {
|
|
58
|
+
this.ngBlur(props)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
onSelectStart = () => {
|
|
63
|
+
this.$timeout(() => {
|
|
64
|
+
if (!this.ngModel.endValue) {
|
|
65
|
+
this.$element.find(`.mbg-value-between-endValue`).focus()
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
onSelectEnd = () => {
|
|
71
|
+
this.$timeout(() => {
|
|
72
|
+
if (!this.ngModel.startValue) {
|
|
73
|
+
this.$element.find(`.mbg-value-between-startValue`).focus()
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
MbgRangeValueController['$inject'] = ['$scope', '$element', '$attrs', '$timeout']
|
|
80
|
+
|
|
81
|
+
const mbgRangeValue = {
|
|
82
|
+
bindings: {
|
|
83
|
+
ngModel: '=',
|
|
84
|
+
ngChange: '&?',
|
|
85
|
+
ngRequired: '=?',
|
|
86
|
+
ngDisabled: '=?',
|
|
87
|
+
ngBlur: '&?',
|
|
88
|
+
ngFocus: '&?',
|
|
89
|
+
ngKeyup: '&?',
|
|
90
|
+
ngKeypress: '&?',
|
|
91
|
+
ngKeydown: '&?',
|
|
92
|
+
betweenText: '@?',
|
|
93
|
+
placeholder: '@?',
|
|
94
|
+
ngModelOptions: '=?',
|
|
95
|
+
},
|
|
96
|
+
template,
|
|
97
|
+
controller: MbgRangeValueController,
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export { mbgRangeValue }
|
|
@@ -6,7 +6,7 @@ class MbgStatusLabelController {
|
|
|
6
6
|
private label: string
|
|
7
7
|
private labelClass: string
|
|
8
8
|
|
|
9
|
-
constructor(public $scope, public $element, public $attrs, public $timeout) {
|
|
9
|
+
constructor(public $scope, public $element, public $attrs, public $timeout) {}
|
|
10
10
|
|
|
11
11
|
$onInit() {
|
|
12
12
|
this.$scope.$watch('$ctrl.status', (data) => {
|
|
@@ -52,10 +52,12 @@ class MbgStatusLabelController {
|
|
|
52
52
|
this.label = 'Cancelada'
|
|
53
53
|
break
|
|
54
54
|
case 'REJEITADA':
|
|
55
|
-
case 'PENDING_REJECT':
|
|
56
55
|
case 'REJECTED':
|
|
57
56
|
this.label = 'Rejeitada'
|
|
58
57
|
break
|
|
58
|
+
case 'PENDING_REJECT':
|
|
59
|
+
this.label = 'Aguardando recusa'
|
|
60
|
+
break
|
|
59
61
|
case 'DENEGADA':
|
|
60
62
|
this.label = 'Denegada'
|
|
61
63
|
break
|
|
@@ -101,13 +103,15 @@ class MbgStatusLabelController {
|
|
|
101
103
|
case 'RETURNED':
|
|
102
104
|
case 'CANCELADA':
|
|
103
105
|
case 'REJEITADA':
|
|
104
|
-
case 'PENDING_REJECT':
|
|
105
106
|
case 'REJECTED':
|
|
106
107
|
case 'CANCELLED':
|
|
107
108
|
case 'CANCELED':
|
|
108
109
|
case 'NOT_PROCESSED':
|
|
109
110
|
this.labelClass = 'error'
|
|
110
111
|
break
|
|
112
|
+
case 'PENDING_REJECT':
|
|
113
|
+
this.labelClass = 'warn'
|
|
114
|
+
break
|
|
111
115
|
case 'PASSED_ALONG':
|
|
112
116
|
case 'ENVIADA':
|
|
113
117
|
case 'NAO_ENVIADA':
|