@kigi/components 1.38.0 → 1.40.0-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
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
class="store-goal-wrapper"
|
|
3
3
|
ng-show="$ctrl.showDashboard">
|
|
4
4
|
<div class="description-container-dash">
|
|
5
|
-
<p class="description-dash"
|
|
6
|
-
|
|
5
|
+
<p class="description-dash">
|
|
6
|
+
Meta do mês / {{$ctrl.currentMonthName}}
|
|
7
7
|
<i class="fa fa-exclamation-circle"
|
|
8
|
-
uib-tooltip="{{$ctrl.
|
|
8
|
+
uib-tooltip="{{$ctrl.percentageEstimatedMessage}}"
|
|
9
9
|
tooltip-placement="top"
|
|
10
|
-
class="link-store"
|
|
11
10
|
ng-show="$ctrl.estimatedPercentageGreaterThanTarget"
|
|
12
11
|
aria-hidden="true"></i>
|
|
13
|
-
Meta do mês / {{$ctrl.currentMonthName}}
|
|
14
12
|
</p>
|
|
15
13
|
<div class="mbg-h-c-tone-s-icon-dash"
|
|
16
14
|
ng-click="$ctrl.toggleShowValueStoreGoal(false)">
|
|
@@ -28,34 +26,73 @@
|
|
|
28
26
|
|
|
29
27
|
</div>
|
|
30
28
|
</div>
|
|
31
|
-
<div class="line-pay"></div>
|
|
32
|
-
<div class="goal-target">
|
|
33
|
-
<p ng-if="$ctrl.hideValue">Meta: <strong>{{$ctrl.goalStoreTarget }}</strong></p>
|
|
34
|
-
<p ng-if="!$ctrl.hideValue">Meta: <i class="fa fa-lock"
|
|
35
|
-
aria-hidden="true"
|
|
36
|
-
uib-tooltip="Sem permissão para visualizar"></i></p>
|
|
37
|
-
</div>
|
|
38
|
-
<div class="goal-day">
|
|
39
|
-
<p class="estimate-goal"
|
|
40
|
-
ng-if="!$ctrl.hideValue">Estimativa da meta: <i class="fa fa-lock"
|
|
41
|
-
aria-hidden="true"
|
|
42
|
-
uib-tooltip="Sem permissão para visualizar"></i>
|
|
43
|
-
</p>
|
|
44
|
-
<p class="estimate-goal-store"
|
|
45
|
-
ng-if="$ctrl.hideValue">Estimativa da meta: <strong>{{$ctrl.estimatedGoal }}</strong>
|
|
46
29
|
|
|
47
|
-
|
|
48
|
-
ng-if="$ctrl.hideValue"
|
|
49
|
-
tooltip-placement="right"
|
|
50
|
-
class="estimated"
|
|
51
|
-
uib-tooltip-html="$ctrl.messageTooltip"
|
|
52
|
-
aria-hidden="true"></i>
|
|
53
|
-
</p>
|
|
54
|
-
</div>
|
|
30
|
+
<div class="line-goal"></div>
|
|
55
31
|
|
|
56
32
|
<div class="dashboard-wrapper">
|
|
57
33
|
<div class="chart-container"
|
|
58
34
|
id="container-speed"></div>
|
|
35
|
+
<div class="dashboard-goal">
|
|
36
|
+
<div class="dashboard-estimated">
|
|
37
|
+
<p ng-if="$ctrl.hideValue">Meta: <strong>{{$ctrl.goalDataForTheMonth.target | currency: 'R$ ' }}</strong>
|
|
38
|
+
</p>
|
|
39
|
+
<p ng-if="!$ctrl.hideValue">Meta: <i class="fa fa-lock"
|
|
40
|
+
aria-hidden="true"
|
|
41
|
+
uib-tooltip="Sem permissão para visualizar"></i>
|
|
42
|
+
</p>
|
|
43
|
+
<p ng-if="!$ctrl.hideValue">Venda atual: <i class="fa fa-lock"
|
|
44
|
+
aria-hidden="true"
|
|
45
|
+
uib-tooltip="Sem permissão para visualizar"></i>
|
|
46
|
+
</p>
|
|
47
|
+
<p class="estimate-goal-store"
|
|
48
|
+
ng-if="$ctrl.hideValue">Venda atual: <strong>{{$ctrl.goalDataForTheMonth.sales | currency: 'R$ '
|
|
49
|
+
}}</strong>
|
|
50
|
+
</p>
|
|
51
|
+
<p ng-if="!$ctrl.hideValue">Restante: <i class="fa fa-lock"
|
|
52
|
+
aria-hidden="true"
|
|
53
|
+
uib-tooltip="Sem permissão para visualizar"></i>
|
|
54
|
+
</p>
|
|
55
|
+
<p class="estimate-goal-store"
|
|
56
|
+
ng-if="$ctrl.hideValue">Restante: <strong>{{$ctrl.goalDataForTheMonth.remaining | currency: 'R$ ' }} =
|
|
57
|
+
({{$ctrl.goalDataForTheMonth.remainingPercentage}}%)</strong>
|
|
58
|
+
</p>
|
|
59
|
+
<p ng-if="!$ctrl.hideValue">Estimativa: <i class="fa fa-lock"
|
|
60
|
+
aria-hidden="true"
|
|
61
|
+
uib-tooltip="Sem permissão para visualizar"></i>
|
|
62
|
+
</p>
|
|
63
|
+
<p class="estimate-goal-store"
|
|
64
|
+
ng-if="$ctrl.hideValue">Estimativa: <strong>{{$ctrl.goalDataForTheMonth.estimate | currency: 'R$
|
|
65
|
+
'}} =
|
|
66
|
+
({{$ctrl.goalDataForTheMonth.estimatePercentage}}%)</strong>
|
|
67
|
+
</p>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<div class="dashboard-estimated-store">
|
|
71
|
+
<p ng-if="$ctrl.hideValue">Meta diária: <strong>{{$ctrl.goalDataForTheMonth.dailyTarget | currency: 'R$ '
|
|
72
|
+
}}</strong></p>
|
|
73
|
+
<p ng-if="!$ctrl.hideValue">Meta diária: <i class="fa fa-lock"
|
|
74
|
+
aria-hidden="true"
|
|
75
|
+
uib-tooltip="Sem permissão para visualizar"></i>
|
|
76
|
+
</p>
|
|
77
|
+
<p ng-if="!$ctrl.hideValue">Realizado/dia: <i class="fa fa-lock"
|
|
78
|
+
aria-hidden="true"
|
|
79
|
+
uib-tooltip="Sem permissão para visualizar"></i>
|
|
80
|
+
</p>
|
|
81
|
+
<p class="estimate-goal-store"
|
|
82
|
+
ng-if="$ctrl.hideValue">Realizado/dia: <strong>{{$ctrl.goalDataForTheMonth.realityPerDay | currency: 'R$
|
|
83
|
+
' }}</strong>
|
|
84
|
+
</p>
|
|
85
|
+
<p ng-if="!$ctrl.hideValue">Necessidade/dia: <i class="fa fa-lock"
|
|
86
|
+
aria-hidden="true"
|
|
87
|
+
uib-tooltip="Sem permissão para visualizar"></i>
|
|
88
|
+
</p>
|
|
89
|
+
<p class="estimate-goal-store"
|
|
90
|
+
ng-if="$ctrl.hideValue">Necessidade/dia: <strong>{{$ctrl.goalDataForTheMonth.neededPerDay | currency: 'R$
|
|
91
|
+
' }}</strong>
|
|
92
|
+
</p>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
59
96
|
</div>
|
|
60
97
|
</div>
|
|
61
98
|
|
|
@@ -1,10 +1,46 @@
|
|
|
1
1
|
.store-goal-wrapper{
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
.line-goal{
|
|
5
|
+
width: 100%;
|
|
6
|
+
background: #737373;
|
|
7
|
+
height: 1px;
|
|
8
|
+
opacity: 0.3;
|
|
9
|
+
|
|
10
|
+
}
|
|
2
11
|
.dashboard-wrapper {
|
|
3
12
|
display: flex;
|
|
4
|
-
justify-content:
|
|
5
|
-
align-items:
|
|
13
|
+
justify-content: start;
|
|
14
|
+
align-items: start;
|
|
6
15
|
height: 100%;
|
|
7
16
|
width: 100%;
|
|
17
|
+
position: relative;
|
|
18
|
+
left: -22px;
|
|
19
|
+
|
|
20
|
+
.dashboard-goal{
|
|
21
|
+
width: 100%;
|
|
22
|
+
position: absolute;
|
|
23
|
+
|
|
24
|
+
.dashboard-estimated{
|
|
25
|
+
position: relative;
|
|
26
|
+
top: 10px;
|
|
27
|
+
left: 230px;
|
|
28
|
+
height: 115px;
|
|
29
|
+
font-size: 14px;
|
|
30
|
+
color: #5f5b5b;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.dashboard-estimated-store{
|
|
34
|
+
position: relative;
|
|
35
|
+
top: -104px;
|
|
36
|
+
left: 492px;
|
|
37
|
+
height: 115px;
|
|
38
|
+
font-size: 14px;
|
|
39
|
+
color: #5f5b5b;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
8
44
|
}
|
|
9
45
|
|
|
10
46
|
.chart-container {
|
|
@@ -14,8 +50,8 @@
|
|
|
14
50
|
width: 300px;
|
|
15
51
|
height: auto;
|
|
16
52
|
position: relative;
|
|
17
|
-
left:
|
|
18
|
-
bottom:
|
|
53
|
+
left: -1%;
|
|
54
|
+
bottom: 195px;
|
|
19
55
|
}
|
|
20
56
|
|
|
21
57
|
.opacity-dash-goal{
|
|
@@ -91,14 +127,12 @@
|
|
|
91
127
|
.lock-dash-store{
|
|
92
128
|
position: relative;
|
|
93
129
|
right: -20px;
|
|
94
|
-
top: -10px;
|
|
95
130
|
}
|
|
96
131
|
|
|
97
132
|
.show-tooltip{
|
|
98
133
|
font-size: 20px;
|
|
99
134
|
color: #5f5b5b;
|
|
100
|
-
|
|
101
|
-
left: 0px;
|
|
135
|
+
z-index: 9999;
|
|
102
136
|
}
|
|
103
137
|
}
|
|
104
138
|
|
|
@@ -117,14 +151,12 @@
|
|
|
117
151
|
.description-dash {
|
|
118
152
|
font-size: 20px;
|
|
119
153
|
color: #5f5b5b;
|
|
120
|
-
position: relative;
|
|
121
|
-
left: -24px;
|
|
122
154
|
|
|
123
155
|
i{
|
|
124
156
|
animation: blink 1s infinite;
|
|
125
157
|
color: #ff8c00;
|
|
126
158
|
position: relative;
|
|
127
|
-
|
|
159
|
+
z-index: 9999;
|
|
128
160
|
}
|
|
129
161
|
|
|
130
162
|
.tooltip-inner {
|
|
@@ -133,6 +165,28 @@
|
|
|
133
165
|
width: 300px;
|
|
134
166
|
}
|
|
135
167
|
}
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
@media screen and (max-width: 1440px) {
|
|
171
|
+
.dashboard-goal{
|
|
172
|
+
display: none;
|
|
173
|
+
}
|
|
174
|
+
.dashboard-wrapper{
|
|
175
|
+
position: relative;
|
|
176
|
+
left: 74px;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
@media screen and (max-width: 1024px) {
|
|
182
|
+
.dashboard-goal{
|
|
183
|
+
display: none;
|
|
184
|
+
}
|
|
185
|
+
.dashboard-wrapper{
|
|
186
|
+
position: relative;
|
|
187
|
+
left: 74px;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
136
190
|
|
|
137
191
|
}
|
|
138
192
|
.hide-goal{
|
|
@@ -15,23 +15,16 @@ ExportData(Highcharts)
|
|
|
15
15
|
Accessibility(Highcharts)
|
|
16
16
|
|
|
17
17
|
class MbgStoreGoalController {
|
|
18
|
-
private status: string
|
|
19
|
-
private cappedPercentage
|
|
20
|
-
private percentageAchieved
|
|
21
18
|
private allowedToSee: boolean
|
|
22
19
|
private allowedCallBack: Function
|
|
23
|
-
private randomEmoji: string
|
|
24
20
|
private hideValue: boolean = false
|
|
25
21
|
private allowDashBoardAutoValues
|
|
26
22
|
private isPermissionStoreGoal
|
|
27
|
-
private
|
|
28
|
-
private storeGoalDashboard
|
|
23
|
+
private goalDataForTheMonth
|
|
29
24
|
private currentMonthName
|
|
30
|
-
private percentageEstimatedStoreGoal
|
|
31
25
|
private estimatedPercentageGreaterThanTarget: boolean = false
|
|
32
|
-
private goalStoreTarget
|
|
33
26
|
private messageTooltip: string = ''
|
|
34
|
-
private
|
|
27
|
+
private percentageEstimatedMessage
|
|
35
28
|
private showDashboard: boolean = false
|
|
36
29
|
|
|
37
30
|
constructor(
|
|
@@ -45,9 +38,8 @@ class MbgStoreGoalController {
|
|
|
45
38
|
|
|
46
39
|
async $onInit() {
|
|
47
40
|
this.initialize()
|
|
48
|
-
this.randomEmoji = this.generateRandomEmoji()
|
|
49
41
|
this.$scope.$watch(
|
|
50
|
-
'$ctrl.
|
|
42
|
+
'$ctrl.goalDataForTheMonth',
|
|
51
43
|
(data) => {
|
|
52
44
|
if (data) {
|
|
53
45
|
this.configSolidGauge()
|
|
@@ -59,31 +51,25 @@ class MbgStoreGoalController {
|
|
|
59
51
|
const currentDate = new Date()
|
|
60
52
|
const currentMonth = currentDate.toLocaleString('default', { month: 'short' })
|
|
61
53
|
this.currentMonthName = currentMonth.charAt(0).toUpperCase() + currentMonth.slice(1)
|
|
62
|
-
this.message()
|
|
63
54
|
}
|
|
64
55
|
|
|
65
|
-
|
|
66
|
-
this.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<label>Projeção final: (Média Diária * Dias passados do mês) </label><br>
|
|
70
|
-
<label>Estimativa: (Projeção final / Meta do mês) * 100</label>
|
|
71
|
-
</div>`
|
|
56
|
+
goalDataForTheMonthConfig() {
|
|
57
|
+
this.goalDataForTheMonth.remainingPercentage = this.goalDataForTheMonth.remainingPercentage
|
|
58
|
+
this.goalDataForTheMonth.targetMonth = Number(this.goalDataForTheMonth.targetMonth).toFixed(2)
|
|
59
|
+
this.goalDataForTheMonth.estimatePercentage = this.goalDataForTheMonth.estimatePercentage
|
|
72
60
|
}
|
|
73
61
|
|
|
74
62
|
async configSolidGauge() {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
this.
|
|
78
|
-
const percentageTarget = this.percentageEstimatedStoreGoal.percentageTarget.toFixed(2)
|
|
79
|
-
const showPercentage = this.hideValue ? `${percentageTarget}%` : '****'
|
|
80
|
-
this.percentageEstimated = `Alerta: Você atingirá aproximadamente ${showPercentage} da sua meta se continuar no ritmo atual.`
|
|
81
|
-
const goal = this.percentageEstimatedStoreGoal.target
|
|
63
|
+
this.goalDataForTheMonthConfig()
|
|
64
|
+
|
|
65
|
+
const storeGoalPercentage = this.hideValue ? Number(this.goalDataForTheMonth.targetMonth) : 0
|
|
82
66
|
|
|
83
|
-
this.
|
|
84
|
-
|
|
67
|
+
this.showDashboard = this.goalDataForTheMonth.sales > 0
|
|
68
|
+
const percentageTarget = this.goalDataForTheMonth.estimatePercentage
|
|
69
|
+
const showPercentage = this.hideValue ? `${percentageTarget}%` : '****'
|
|
70
|
+
this.percentageEstimatedMessage = `Alerta: Você atingirá aproximadamente ${showPercentage} da sua meta se continuar no ritmo atual.`
|
|
85
71
|
|
|
86
|
-
if (
|
|
72
|
+
if (this.goalDataForTheMonth.estimate < this.goalDataForTheMonth.target) {
|
|
87
73
|
this.estimatedPercentageGreaterThanTarget = true
|
|
88
74
|
} else {
|
|
89
75
|
this.estimatedPercentageGreaterThanTarget = false
|
|
@@ -106,7 +92,7 @@ class MbgStoreGoalController {
|
|
|
106
92
|
series: [
|
|
107
93
|
{
|
|
108
94
|
name: 'Speed',
|
|
109
|
-
data: [storeGoalPercentage],
|
|
95
|
+
data: [storeGoalPercentage.toFixed(2)],
|
|
110
96
|
dataLabels: {
|
|
111
97
|
format: this.hideValue
|
|
112
98
|
? '<div style="display: flex;justify-content: center;align-items: center;margin-top: -20px;">' +
|
|
@@ -140,8 +126,8 @@ class MbgStoreGoalController {
|
|
|
140
126
|
|
|
141
127
|
title: null,
|
|
142
128
|
pane: {
|
|
143
|
-
center: ['
|
|
144
|
-
size: '
|
|
129
|
+
center: ['40%', '75%'],
|
|
130
|
+
size: '65%',
|
|
145
131
|
startAngle: -90,
|
|
146
132
|
endAngle: 90,
|
|
147
133
|
background: {
|
|
@@ -230,7 +216,6 @@ class MbgStoreGoalController {
|
|
|
230
216
|
}
|
|
231
217
|
|
|
232
218
|
this.hideValue = !this.hideValue
|
|
233
|
-
this.randomEmoji = this.generateRandomEmoji()
|
|
234
219
|
this.configSolidGauge()
|
|
235
220
|
}
|
|
236
221
|
}
|
|
@@ -247,8 +232,7 @@ const mbgStoreGoal = {
|
|
|
247
232
|
bindings: {
|
|
248
233
|
allowedToSee: '=?',
|
|
249
234
|
allowedCallBack: '&?',
|
|
250
|
-
|
|
251
|
-
percentageEstimatedStoreGoal: '=?',
|
|
235
|
+
goalDataForTheMonth: '=?',
|
|
252
236
|
isPermissionStoreGoal: '=?',
|
|
253
237
|
allowDashBoardAutoValues: '=?',
|
|
254
238
|
},
|