@kigi/components 1.45.0-beta.2 → 1.45.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kigi/components",
3
- "version": "1.45.0-beta.2",
3
+ "version": "1.45.0-beta.3",
4
4
  "description": "@kigi/components",
5
5
  "main": "src/components/index.ts",
6
6
  "scripts": {
@@ -1,5 +1,6 @@
1
- <div class="average-customer-time-wrapper">
2
- <div class="row">
1
+ <div class="average-customer-time-wrapper"
2
+ ng-if="!$ctrl.loadingChartCustomer">
3
+ <div class="row customer-average">
3
4
  <div class="description-container-dash"
4
5
  ng-show="$ctrl.percentagesReturnCustomerTime.length">
5
6
  <span class="description-dash">Tempo médio de retorno do cliente</span>
@@ -29,4 +30,9 @@
29
30
  id="container">
30
31
  </div>
31
32
  </div>
33
+ </div>
34
+
35
+ <div class="fake-chart"
36
+ ng-if="$ctrl.loadingChartCustomer">
37
+ <mbg-skeleton></mbg-skeleton>
32
38
  </div>
@@ -4,9 +4,23 @@ mbg-average-customer-time {
4
4
  height: 100%;
5
5
  flex-grow: 1;
6
6
  box-sizing: border-box;
7
- padding: 0px 16px;
8
7
  }
9
8
 
9
+ .customer-average {
10
+ padding: 0px 32px;
11
+ }
12
+
13
+ .fake-chart {
14
+ width: 100%;
15
+ height: 100%;
16
+ position: relative;
17
+ border-radius: 15px;
18
+ padding: 0px;
19
+ margin: 0px;
20
+ box-shadow: 0px 2px 20px rgba(0, 0, 0, 0.05);
21
+ overflow: hidden;
22
+ flex: 1;
23
+ }
10
24
 
11
25
  .opacity-dash{
12
26
  opacity: 0.6;
@@ -17,6 +17,7 @@ class MbgAverageCustomerTimeController {
17
17
  private boundAdjustContainerWidth
18
18
  private allowDashBoardAutoValues
19
19
  private callBackInstanceZapi: Function
20
+ private loadingChartCustomer: boolean
20
21
 
21
22
  constructor(
22
23
  public $scope,
@@ -28,6 +29,7 @@ class MbgAverageCustomerTimeController {
28
29
  ) {}
29
30
 
30
31
  async $onInit() {
32
+ this.loadingChartCustomer = true
31
33
  this.isBlockValuesDashboarReturnCustomer =
32
34
  !this.allowedToSee || !this.isPermissionAverageCustomerReturnTime
33
35
  this.initialize()
@@ -125,6 +127,8 @@ class MbgAverageCustomerTimeController {
125
127
  }
126
128
  })
127
129
 
130
+ this.loadingChartCustomer = false
131
+
128
132
  Highcharts.chart('container', {
129
133
  chart: {
130
134
  type: 'pie',
@@ -266,6 +270,7 @@ const mbgAverageCustomerTime = {
266
270
  isBlockValuesDashboarReturnCustomer: '=?',
267
271
  allowDashBoardAutoValues: '=?',
268
272
  callBackInstanceZapi: '&?',
273
+ loading: '=?',
269
274
  },
270
275
  template,
271
276
  controller: MbgAverageCustomerTimeController,
@@ -1,6 +1,6 @@
1
1
  <div class="store-goal-wrapper"
2
2
  ng-class="{'opacity-dash-goal': $ctrl.blockStoreGoal}"
3
- ng-show="$ctrl.showDashboard">
3
+ ng-if="!$ctrl.loading || $ctrl.showDashboard ">
4
4
  <div class="description-container-dash">
5
5
  <span class="description-dash">
6
6
  Meta do mês / {{$ctrl.currentMonthName}}
@@ -28,11 +28,6 @@
28
28
 
29
29
  </div>
30
30
  </div>
31
- <!-- <div class="active-index"
32
- ng-if="$ctrl.indexActiveSlide">
33
- <label>{{$ctrl.indexActiveSlide}}</label>
34
- </div> -->
35
-
36
31
  <div class="line-goal"></div>
37
32
  <div class="dashboard-wrapper">
38
33
  <div class="swiper">
@@ -154,8 +149,13 @@
154
149
  </div>
155
150
  </div>
156
151
 
157
- <div ng-show="!$ctrl.showDashboard"
152
+ <div ng-show="!$ctrl.showDashboard && !$ctrl.loading"
158
153
  class="hide-goal">
159
154
  <label for="">Sem meta cadastrada. Defina sua meta hoje. <a class="state-goal"
160
155
  ng-click="$ctrl.stateGoNewGoal()">Clique aqui</a> </label>
156
+ </div>
157
+
158
+ <div class="fake-chart"
159
+ ng-if="$ctrl.loading">
160
+ <mbg-skeleton></mbg-skeleton>
161
161
  </div>
@@ -2,6 +2,7 @@
2
2
  width: 100%;
3
3
  max-width: 100%;
4
4
  overflow: hidden;
5
+ padding: 0px 16px;
5
6
 
6
7
  .loading-indicator {
7
8
  position: absolute;
@@ -243,6 +244,19 @@
243
244
  opacity: 0.6;
244
245
  }
245
246
 
247
+ .fake-chart {
248
+ width: 100%;
249
+ height: 100%;
250
+ position: relative;
251
+ border-radius: 10px;
252
+ padding: 0px;
253
+ margin: 0px;
254
+ box-shadow: 0px 2px 20px rgba(0, 0, 0, 0.05);
255
+ overflow: hidden;
256
+ flex: 1;
257
+ display: flex;
258
+ }
259
+
246
260
  .hide-goal {
247
261
  display: flex;
248
262
  justify-content: center;
@@ -308,6 +308,7 @@ const mbgStoreGoal = {
308
308
  goalDataForTheMonth: '=?',
309
309
  isPermissionStoreGoal: '=?',
310
310
  allowDashBoardAutoValues: '=?',
311
+ loading: '=?',
311
312
  },
312
313
  template,
313
314
  controller: MbgStoreGoalController,
@@ -1,7 +1,8 @@
1
1
  <div class="top-sellings-products-wrapper "
2
- ng-class="{'opacity-dash': $ctrl.isBlockValuesTopSellingsProducts}">
2
+ ng-if="!$ctrl.loadingChart"
3
+ ng-class="{'opacity-dash': $ctrl.isBlockValuesTopSellingsProducts, 'loading-chart': $ctrl.loadingChart }">
3
4
  <div class="row top-selling"
4
- ng-show="!$ctrl.isProductsTopSellings">
5
+ ng-show="!$ctrl.isProductsTopSellings && !$ctrl.loadingChart">
5
6
  <div class="description-container-dash">
6
7
  <span class="description-dash">10 Produtos mais vendidos</span>
7
8
  <div class="mbg-h-c-tone-s-icon-dash"
@@ -23,7 +24,7 @@
23
24
 
24
25
 
25
26
  <div class="description-header"
26
- ng-show="!$ctrl.isProductsTopSellings">
27
+ ng-show="!$ctrl.isProductsTopSellings && !$ctrl.loadingChart">
27
28
  <div class="product-list">
28
29
  <div class="product-header">
29
30
  <span class="header-sales">Itens vendidos</span>
@@ -179,16 +180,19 @@
179
180
  </svg>
180
181
  </div>
181
182
  </div>
182
-
183
183
  </div>
184
184
  </div>
185
185
 
186
186
 
187
187
  <div class="show-slides-not-data"
188
- ng-if="$ctrl.isProductsTopSellings">
188
+ ng-if="$ctrl.isProductsTopSellings && !$ctrl.loadingChart">
189
189
  <label>
190
190
  Atualmente, a empresa não possui vendas registradas.
191
191
  </label>
192
192
  </div>
193
+ </div>
193
194
 
195
+ <div class="fake-chart"
196
+ ng-if="$ctrl.loadingChart">
197
+ <mbg-skeleton></mbg-skeleton>
194
198
  </div>
@@ -1,194 +1,216 @@
1
1
  mbg-top-sellings-products {
2
- display: block;
3
- width: 100%;
4
- height: 100%;
5
- flex-grow: 1;
6
- box-sizing: border-box;
7
- padding: 0px 16px;
8
- }
9
-
10
- .top-selling {
11
- padding: 0px 16px;
12
- }
13
-
14
- .description-container-dash {
15
- flex-grow: 1;
16
- color: var(--titleColor);
17
- display: flex;
18
- justify-content: space-between;
19
- width: 100%;
20
- font-weight: 600;
21
- font-size: 14px;
22
- align-items: center;
23
- padding: 8px 0 5px 0;
2
+ display: block;
3
+ width: 100%;
4
+ height: 100%;
5
+ flex-grow: 1;
6
+ box-sizing: border-box;
7
+ // padding: 0px 16px;
8
+ }
9
+
10
+ .loading-chart{
11
+ padding: 0;
12
+ }
13
+
14
+ .top-sellings-products-wrapper{
15
+ padding: 0px 16px;
16
+ }
17
+
18
+ .top-selling {
19
+ padding: 0px 16px;
20
+ }
21
+
22
+ .description-container-dash {
23
+ flex-grow: 1;
24
+ color: var(--titleColor);
25
+ display: flex;
26
+ justify-content: space-between;
27
+ width: 100%;
28
+ font-weight: 600;
29
+ font-size: 14px;
30
+ align-items: center;
31
+ padding: 8px 0 5px 0;
32
+
33
+ .mbg-h-c-tone-s-icon-dash {
34
+ transition: opacity 500ms ease;
35
+ opacity: 0.9;
36
+ }
37
+ }
38
+
39
+
40
+ .loading-indicator-top {
41
+ position: absolute;
42
+ top: 97%;
43
+ left: 97%;
44
+ transform: translate(-50%, -50%);
45
+ width: 40px;
46
+ height: 40px;
47
+ }
48
+
49
+ #loading-circle-top {
50
+ position: absolute;
51
+ }
52
+
53
+ .active-index-top {
54
+ display: flex;
55
+ position: relative;
56
+ top: -24px;
57
+ justify-content: center;
58
+ color: #5f5b5b;
59
+ }
60
+
61
+
62
+ .opacity-dash{
63
+ opacity: 0.6;
64
+ }
65
+
66
+
67
+ .description-header {
68
+ flex-direction: column;
69
+ width: 100%;
70
+ display: flex;
71
+ justify-content: center;
72
+ align-items: center;
73
+ height: 400px;
74
+ padding: 16px 0px;
75
+ }
76
+
77
+
78
+ .product-header {
79
+ display: flex;
80
+ justify-content: end;
81
+ font-weight: bold;
82
+ width: 100%;
83
+ // padding: 0px 24px;
84
+ }
24
85
 
25
- .mbg-h-c-tone-s-icon-dash {
26
- transition: opacity 500ms ease;
27
- opacity: 0.9;
28
- }
86
+ .product-header span {
87
+ color: #555;
29
88
  }
30
-
31
-
32
- .loading-indicator-top {
33
- position: absolute;
34
- top: 97%;
35
- left: 97%;
36
- transform: translate(-50%, -50%);
37
- width: 40px;
38
- height: 40px;
89
+
90
+
91
+ .header-sales {
92
+ width: 40%;
93
+ text-align: right;
39
94
  }
40
-
41
- #loading-circle-top {
42
- position: absolute;
95
+
96
+ .header-stock {
97
+ width: 20%;
98
+ text-align: right;
43
99
  }
44
-
45
- .active-index-top {
46
- display: flex;
47
- position: relative;
48
- top: -24px;
49
- justify-content: center;
50
- color: #5f5b5b;
100
+
101
+ .product-list {
102
+
103
+ width: 100%;
51
104
  }
52
-
53
-
54
- .opacity-dash{
55
- opacity: 0.6;
105
+
106
+ .product-item {
107
+ display: block;
108
+ padding: 0;
109
+ padding: 0px 23px 0px 0px;
110
+
56
111
  }
57
-
58
-
59
- .description-header {
60
- flex-direction: column;
61
- width: 100%;
62
- display: flex;
63
- justify-content: center;
64
- align-items: center;
65
- height: 400px;
66
- padding: 16px 0px;
67
- }
68
-
69
112
 
70
- .product-header {
113
+ .fake-chart {
114
+ width: 100%;
115
+ height: 100%;
116
+ position: relative;
117
+ border-radius: 10px;
118
+ padding: 0px;
119
+ margin: 0px;
120
+ box-shadow: 0px 2px 20px rgba(0, 0, 0, 0.05);
121
+ overflow: hidden;
122
+ flex: 1;
71
123
  display: flex;
72
- justify-content: end;
73
- font-weight: bold;
74
- width: 100%;
75
- // padding: 0px 24px;
76
- }
124
+ }
125
+
126
+ .swiper-container {
127
+ width: 100%;
128
+ overflow: hidden;
129
+ height: 350px;
130
+ position: relative;
77
131
 
78
- .product-header span {
79
- color: #555;
80
- }
81
-
132
+ }
82
133
 
83
- .header-sales {
84
- width: 40%;
85
- text-align: right;
134
+ .swiper-pagination {
135
+ display: flex;
136
+ gap: 5px;
86
137
  }
87
138
 
88
- .header-stock {
89
- width: 20%;
90
- text-align: right;
139
+ .swiper-pagination-bullet {
140
+ width: 10px;
141
+ height: 10px;
142
+ background-color: #606A90;
143
+ border-radius: 50%;
144
+ opacity: 0.5;
91
145
  }
92
146
 
93
- .product-list {
94
-
95
- width: 100%;
147
+ .swiper-pagination-bullet-active {
148
+ background-color: #0EBCBD;
149
+ opacity: 1;
96
150
  }
97
151
 
98
- .product-item {
99
- display: block;
100
- padding: 0;
101
- padding: 0px 23px 0px 0px;
102
-
103
- }
152
+
153
+ .segment-item {
154
+ display: flex;
155
+ justify-content: space-between;
156
+ padding: 6px 0;
157
+ }
158
+
159
+ .name {
160
+ width: 70%;
161
+ max-width: 50%;
162
+ white-space: nowrap;
163
+ overflow: hidden;
164
+ text-overflow: ellipsis;
165
+ position: relative;
166
+ font-size: 14px;
167
+ color: #5f5b5b;
168
+ }
104
169
 
105
- .swiper-container {
106
- width: 100%;
107
- overflow: hidden;
108
- height: 350px;
109
- position: relative;
110
-
111
- }
112
-
113
- .swiper-pagination {
114
- display: flex;
115
- gap: 5px;
116
- }
117
-
118
- .swiper-pagination-bullet {
119
- width: 10px;
120
- height: 10px;
121
- background-color: #606A90;
122
- border-radius: 50%;
123
- opacity: 0.5;
124
- }
125
-
126
- .swiper-pagination-bullet-active {
127
- background-color: #0EBCBD;
128
- opacity: 1;
129
- }
130
-
131
-
132
- .segment-item {
133
- display: flex;
134
- justify-content: space-between;
135
- padding: 6px 0;
170
+ .tooltip-inner {
171
+ background: #0EBCBD !important;
172
+ font-weight: bold;
173
+ color: #FFFFFF;
136
174
  }
175
+
176
+ .line-block-top{
177
+ height: 1px;
178
+ background: black;
179
+ width: 60%;
180
+ position: relative;
181
+ left: 10px;
182
+ opacity: 0.3;
183
+ top: 8px;
184
+ }
137
185
 
138
- .name {
139
- width: 70%;
140
- max-width: 50%;
141
- white-space: nowrap;
142
- overflow: hidden;
143
- text-overflow: ellipsis;
144
- position: relative;
145
- font-size: 14px;
146
- color: #5f5b5b;
147
- }
148
-
149
- .tooltip-inner {
150
- background: #0EBCBD !important;
151
- font-weight: bold;
152
- color: #FFFFFF;
153
- }
154
-
155
- .line-block-top{
156
- height: 1px;
157
- background: black;
158
- width: 60%;
159
- position: relative;
160
- left: 10px;
161
- opacity: 0.3;
162
- top: 8px;
163
- }
186
+ .sales {
187
+ width: 20%;
188
+ text-align: right;
189
+ font-size: 14px;
190
+ color: #5f5b5b;
191
+ position: relative;
192
+ right: 18px;
193
+ }
194
+
195
+ .stock {
196
+ width: 20%;
197
+ text-align: right;
198
+ font-size: 14px;
199
+ color: #5f5b5b;
200
+ position: relative;
201
+ }
164
202
 
165
- .sales {
166
- width: 20%;
167
- text-align: right;
168
- font-size: 14px;
169
- color: #5f5b5b;
170
- position: relative;
171
- right: 18px;
172
- }
203
+ .show-slides-not-data{
204
+ display: flex;
205
+ justify-content: center;
206
+ align-items: center;
207
+ width: 444px;
208
+ height: 100%;
209
+ font-size: 14px;
210
+ color: #5f5b5b;
211
+ }
173
212
 
174
- .stock {
175
- width: 20%;
176
- text-align: right;
177
- font-size: 14px;
178
- color: #5f5b5b;
179
- position: relative;
180
- }
181
-
182
- .show-slides-not-data{
183
- display: flex;
184
- justify-content: center;
185
- align-items: center;
186
- width: 444px;
187
- height: 100%;
188
- font-size: 14px;
189
- color: #5f5b5b;
190
- }
191
-
192
-
193
-
194
-
213
+
214
+
215
+
216
+
@@ -16,6 +16,7 @@ class MbgTopSellingsProducts {
16
16
  private oneMonthInterval
17
17
  private threeMonthInterval
18
18
  private oneYearInterval
19
+ private loadingChart: boolean
19
20
 
20
21
  constructor(
21
22
  public $scope,
@@ -27,6 +28,7 @@ class MbgTopSellingsProducts {
27
28
  ) {}
28
29
 
29
30
  async $onInit() {
31
+ this.loadingChart = true
30
32
  this.isBlockValuesTopSellingsProducts =
31
33
  !this.allowedToSee || !this.isPermissionTopSellingsProducts
32
34
  this.$scope.$watch(
@@ -65,6 +67,8 @@ class MbgTopSellingsProducts {
65
67
  this.transformeParseFloat(this.oneMonthInterval)
66
68
  this.transformeParseFloat(this.threeMonthInterval)
67
69
  this.transformeParseFloat(this.oneYearInterval)
70
+
71
+ this.loadingChart = false
68
72
  }
69
73
 
70
74
  transformeParseFloat(array) {
@@ -171,6 +175,7 @@ const mbgTopSellingsProducts = {
171
175
  isPermissionTopSellingsProducts: '=?',
172
176
  isBlockValuesTopSellingsProducts: '=?',
173
177
  isProductsTopSellings: '=?',
178
+ loading: '=?',
174
179
  },
175
180
  template,
176
181
  controller: MbgTopSellingsProducts,