@kigi/components 1.46.0 → 1.47.0

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.46.0",
3
+ "version": "1.47.0",
4
4
  "description": "@kigi/components",
5
5
  "main": "src/components/index.ts",
6
6
  "scripts": {
@@ -1,74 +1,76 @@
1
1
  <div class="mbg-input-wrapper mb-input-date-wrapper"
2
2
  ng-if="$ctrl.props">
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
- ng-class="{'input-date':$ctrl.titleMode}"
34
- mbg-datepicker />
35
- <!-- between dates -->
36
- <div class="mbg-date-between"
37
- ng-if="$ctrl.between">
38
- <input type="text"
39
- class="mbg-date-between-start"
40
- ng-model="$ctrl.ngModel.start"
41
- ng-change="$ctrl.onChange()"
42
- placeholder="{{ $ctrl.props.placeholderStart }}"
43
- ng-required="$ctrl.ngRequired"
44
- ng-disabled="$ctrl.ngDisabled"
45
- ng-blur="$ctrl.handleBlur({ $event })"
46
- ng-focus="$ctrl.handleFocus({ $event })"
47
- ng-keyup="$ctrl.ngKeyup({ $event })"
48
- ng-keypress="$ctrl.ngKeypress({ $event })"
49
- ng-keydown="$ctrl.ngKeydown({ $event })"
50
- ui-date-mask="{{ $ctrl.format }}"
51
- on-select="$ctrl.onSelectStart()"
52
- only-month-year="$ctrl.onlyMonthYear"
53
- mbg-datepicker />
54
- <div class="mbg-date-between-space">
55
- {{ $ctrl.betweenText == undefined ? 'Até' : $ctrl.betweenText }}
56
- </div>
57
- <input type="text"
58
- class="mbg-date-between-end"
59
- ng-model="$ctrl.ngModel.end"
60
- ng-change="$ctrl.onChangeEndDate()"
61
- placeholder="{{ $ctrl.props.placeholderEnd }}"
62
- ng-required="$ctrl.ngRequired"
63
- ng-disabled="$ctrl.ngDisabled"
64
- ng-blur="$ctrl.handleBlur({ $event })"
65
- ng-focus="$ctrl.handleFocus({ $event })"
66
- ng-keyup="$ctrl.ngKeyup({ $event })"
67
- ng-keypress="$ctrl.ngKeypress({ $event })"
68
- ng-keydown="$ctrl.ngKeydown({ $event })"
69
- ui-date-mask="{{ $ctrl.format }}"
70
- on-select="$ctrl.onSelectEnd()"
71
- only-month-year="$ctrl.onlyMonthYear"
72
- mbg-datepicker />
73
- </div>
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
+ <label class="labelDayOfWeek"
18
+ ng-if="$ctrl.nameOfTheDay">{{$ctrl.changeDay()}}</label>
19
+ <!-- with calendar -->
20
+ <input type="text"
21
+ class="input-with-calendar"
22
+ ng-if="$ctrl.calendar && !$ctrl.between"
23
+ ng-model="$ctrl.ngModel"
24
+ ng-change="$ctrl.onChange()"
25
+ placeholder="{{ $ctrl.placeholder }}"
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-date-mask="{{ $ctrl.format }}"
34
+ only-month-year="$ctrl.onlyMonthYear"
35
+ ng-class="{'input-date':$ctrl.titleMode}"
36
+ mbg-datepicker />
37
+ <!-- between dates -->
38
+ <div class="mbg-date-between"
39
+ ng-if="$ctrl.between">
40
+ <input type="text"
41
+ class="mbg-date-between-start"
42
+ ng-model="$ctrl.ngModel.start"
43
+ ng-change="$ctrl.onChange()"
44
+ placeholder="{{ $ctrl.props.placeholderStart }}"
45
+ ng-required="$ctrl.ngRequired"
46
+ ng-disabled="$ctrl.ngDisabled"
47
+ ng-blur="$ctrl.handleBlur({ $event })"
48
+ ng-focus="$ctrl.handleFocus({ $event })"
49
+ ng-keyup="$ctrl.ngKeyup({ $event })"
50
+ ng-keypress="$ctrl.ngKeypress({ $event })"
51
+ ng-keydown="$ctrl.ngKeydown({ $event })"
52
+ ui-date-mask="{{ $ctrl.format }}"
53
+ on-select="$ctrl.onSelectStart()"
54
+ only-month-year="$ctrl.onlyMonthYear"
55
+ mbg-datepicker />
56
+ <div class="mbg-date-between-space">
57
+ {{ $ctrl.betweenText == undefined ? 'Até' : $ctrl.betweenText }}
58
+ </div>
59
+ <input type="text"
60
+ class="mbg-date-between-end"
61
+ ng-model="$ctrl.ngModel.end"
62
+ ng-change="$ctrl.onChangeEndDate()"
63
+ placeholder="{{ $ctrl.props.placeholderEnd }}"
64
+ ng-required="$ctrl.ngRequired"
65
+ ng-disabled="$ctrl.ngDisabled"
66
+ ng-blur="$ctrl.handleBlur({ $event })"
67
+ ng-focus="$ctrl.handleFocus({ $event })"
68
+ ng-keyup="$ctrl.ngKeyup({ $event })"
69
+ ng-keypress="$ctrl.ngKeypress({ $event })"
70
+ ng-keydown="$ctrl.ngKeydown({ $event })"
71
+ ui-date-mask="{{ $ctrl.format }}"
72
+ on-select="$ctrl.onSelectEnd()"
73
+ only-month-year="$ctrl.onlyMonthYear"
74
+ mbg-datepicker />
75
+ </div>
74
76
  </div>
@@ -7,6 +7,13 @@
7
7
  input {
8
8
  width: 100%;
9
9
  }
10
+ .labelDayOfWeek{
11
+ margin-left: 4px;
12
+ margin-top: 4px;
13
+ padding: 6px;
14
+ width: 116px;
15
+ word-break: break-word;
16
+ }
10
17
  .mbg-date-between {
11
18
  display: flex;
12
19
  width: 100%;
@@ -17,7 +17,7 @@ class MbgInputDateController {
17
17
  public betweenText: string
18
18
  public filterDate: Function
19
19
  public onlyMonthYear: boolean
20
-
20
+ private nameOfTheDay
21
21
 
22
22
  constructor(public $scope, public $element, public $attrs, public $timeout) {
23
23
  if ($attrs.ngRequired === '') {
@@ -47,6 +47,10 @@ class MbgInputDateController {
47
47
  }
48
48
  }
49
49
 
50
+ changeDay() {
51
+ return new Intl.DateTimeFormat('pt-BR', { weekday: 'long' }).format(this.ngModel)
52
+ }
53
+
50
54
  onChange() {
51
55
  if (this.ngChange) {
52
56
  this.ngChange({})
@@ -133,6 +137,7 @@ const mbgInputDate = {
133
137
  filterDate: '&?',
134
138
  onlyMonthYear: '=?',
135
139
  titleMode: '=?',
140
+ nameOfTheDay: '=?',
136
141
  },
137
142
  template,
138
143
  controller: MbgInputDateController,
@@ -20,6 +20,7 @@ class MbgInputPasswordController {
20
20
  }
21
21
  }
22
22
  onChange() {
23
+ console.log('this.ngChange', this.ngChange)
23
24
  if (this.ngChange) {
24
25
  this.ngChange({})
25
26
  }
@@ -48,6 +48,9 @@ class MbgSelectController {
48
48
  private executeAfterOnInit: Function
49
49
  private mountValue
50
50
  private strMountValue
51
+ private callBackFavorite: Function
52
+ private favoriteModel
53
+ private productKitList: boolean
51
54
 
52
55
  constructor(
53
56
  public $scope,
@@ -242,15 +245,23 @@ class MbgSelectController {
242
245
  }
243
246
  }
244
247
 
245
- onInputBlur() {
248
+ onInputBlur(viewFavorite) {
246
249
  this.$timeout(() => {
247
250
  this.hasFocus = false
248
251
  this.data = []
249
252
  this.checkPosition()
250
- if (!this.ngModel && this.cacheNgModel) {
253
+ if (!viewFavorite) {
254
+ this.favoriteModel = null
255
+ }
256
+
257
+ if (!this.ngModel && this.cacheNgModel && !this.favoriteModel) {
258
+ this.ngModel = this.cacheNgModel
259
+ } else if (this.favoriteModel && this.favoriteModel.key) {
260
+ this.cacheNgModel = this.favoriteModel.key
251
261
  this.ngModel = this.cacheNgModel
252
262
  }
253
263
  })
264
+
254
265
  if (this.ngBlur) {
255
266
  this.ngBlur()
256
267
  }
@@ -419,6 +430,7 @@ class MbgSelectController {
419
430
  } else {
420
431
  await this.updateModelValue(this.inputValue)
421
432
  }
433
+
422
434
  this.executeCallback()
423
435
  if (this.onSelect) {
424
436
  this.onSelect({ value: this.ngModel })
@@ -598,7 +610,7 @@ class MbgSelectController {
598
610
  }
599
611
  if (!this.ngModel) {
600
612
  delete this.inputValue
601
- delete this.inputNgValue
613
+ this.inputNgValue = ''
602
614
  }
603
615
  }
604
616
  }
@@ -610,15 +622,34 @@ class MbgSelectController {
610
622
  }
611
623
 
612
624
  checkFavorite() {
613
- let favorite
625
+ let favorite = null
614
626
  this.$timeout(() => {
615
627
  favorite = MbgCookie.get(this.getFavoriteKey())
616
628
  if (favorite && this.enableFavorite && !this.ngModel) {
617
629
  this.selectOption(favorite)
630
+
631
+ if (this.callBackFavorite) {
632
+ this.callBackFavorite({ value: favorite })
633
+ }
634
+
618
635
  if (this.executeAfterOnInit) {
619
636
  this.executeAfterOnInit()
620
637
  }
621
638
  }
639
+ if (this.callBackFavorite) {
640
+ this.callBackFavorite({ value: favorite })
641
+ }
642
+ }, 300)
643
+ }
644
+
645
+ getCheckFavoriteModel(viewFavorite) {
646
+ this.$timeout(() => {
647
+ if (!this.productKitList) return
648
+ this.favoriteModel = MbgCookie.get(this.getFavoriteKey())
649
+ if (this.callBackFavorite && this.favoriteModel) {
650
+ this.callBackFavorite({ value: this.favoriteModel })
651
+ }
652
+ this.onInputBlur(viewFavorite)
622
653
  }, 300)
623
654
  }
624
655
 
@@ -640,6 +671,7 @@ class MbgSelectController {
640
671
  }
641
672
  } else {
642
673
  MbgCookie.set(this.getFavoriteKey(), item)
674
+ this.getCheckFavoriteModel(true)
643
675
  }
644
676
  }
645
677
 
@@ -683,7 +715,7 @@ class MbgSelectController {
683
715
  }
684
716
  }
685
717
 
686
- MbgSelectController.$inject = [
718
+ MbgSelectController['$inject'] = [
687
719
  '$scope',
688
720
  '$element',
689
721
  '$attrs',
@@ -717,6 +749,8 @@ const mbgSelect = {
717
749
  manyFavorite: '=?',
718
750
  executeAfterOnInit: '&?',
719
751
  mountValue: '&?',
752
+ callBackFavorite: '&?',
753
+ productKitList: '=?',
720
754
  },
721
755
  controller: MbgSelectController,
722
756
  template,
@@ -39,7 +39,7 @@
39
39
  ng-repeat="item in $ctrl.oneMonthInterval">
40
40
  <div class="segment-item">
41
41
  <span class="rank">{{ $index + 1 }}°</span>
42
- <span class="name"
42
+ <span class="description-top-selling-name"
43
43
  ng-if="$ctrl.hideValue && !$ctrl.isBlockValuesTopSellingsProducts"
44
44
  uib-tooltip="{{ item.reference }} - {{ item.nameProduct }}"
45
45
  tooltip-placement="{{$index === 0 || $index === 1 || item.nameProduct.length > 30 ? 'bottom' :'top' }}">{{
@@ -77,7 +77,7 @@
77
77
  ng-repeat="item in $ctrl.threeMonthInterval">
78
78
  <div class="segment-item">
79
79
  <span class="rank">{{ $index + 1 }}°</span>
80
- <span class="name"
80
+ <span class="description-top-selling-name"
81
81
  ng-if="$ctrl.hideValue && !$ctrl.isBlockValuesTopSellingsProducts"
82
82
  uib-tooltip="{{ item.reference }} - {{ item.nameProduct }}"
83
83
  tooltip-placement="{{$index === 0 || $index === 1 || item.nameProduct.length > 30 ? 'bottom' :'top' }}">{{
@@ -115,7 +115,7 @@
115
115
  ng-repeat="item in $ctrl.oneYearInterval">
116
116
  <div class="segment-item">
117
117
  <span class="rank">{{ $index + 1 }}°</span>
118
- <span class="name"
118
+ <span class="description-top-selling-name"
119
119
  ng-if="$ctrl.hideValue && !$ctrl.isBlockValuesTopSellingsProducts"
120
120
  uib-tooltip="{{ item.reference }} - {{ item.nameProduct }}"
121
121
  tooltip-placement="{{$index === 0 || $index === 1 || item.nameProduct.length > 30 ? 'bottom' :'top' }}">{{
@@ -1,8 +1,8 @@
1
1
  mbg-top-sellings-products {
2
- display: block;
3
- width: 100%;
4
- height: 100%;
5
- flex-grow: 1;
2
+ display: block;
3
+ width: 100%;
4
+ height: 100%;
5
+ flex-grow: 1;
6
6
  box-sizing: border-box;
7
7
  // padding: 0px 16px;
8
8
  }
@@ -14,19 +14,19 @@ mbg-top-sellings-products {
14
14
  color: #FFFFFF;
15
15
  }
16
16
  }
17
-
17
+
18
18
  .loading-chart{
19
19
  padding: 0;
20
20
  }
21
-
21
+
22
22
  .top-sellings-products-wrapper{
23
23
  padding: 0px 16px;
24
24
  }
25
-
25
+
26
26
  .top-selling {
27
27
  padding: 0px 16px;
28
28
  }
29
-
29
+
30
30
  .description-container-dash {
31
31
  flex-grow: 1;
32
32
  color: var(--titleColor);
@@ -34,17 +34,17 @@ mbg-top-sellings-products {
34
34
  justify-content: space-between;
35
35
  width: 100%;
36
36
  font-weight: 600;
37
- font-size: 14px;
37
+ font-size: 14px;
38
38
  align-items: center;
39
39
  padding: 8px 0 5px 0;
40
-
40
+
41
41
  .mbg-h-c-tone-s-icon-dash {
42
42
  transition: opacity 500ms ease;
43
43
  opacity: 0.9;
44
44
  }
45
45
  }
46
-
47
-
46
+
47
+
48
48
  .loading-indicator-top {
49
49
  position: absolute;
50
50
  top: 97%;
@@ -53,11 +53,11 @@ mbg-top-sellings-products {
53
53
  width: 40px;
54
54
  height: 40px;
55
55
  }
56
-
56
+
57
57
  #loading-circle-top {
58
58
  position: absolute;
59
59
  }
60
-
60
+
61
61
  .active-index-top {
62
62
  display: flex;
63
63
  position: relative;
@@ -65,13 +65,13 @@ mbg-top-sellings-products {
65
65
  justify-content: center;
66
66
  color: #5f5b5b;
67
67
  }
68
-
69
-
68
+
69
+
70
70
  .opacity-dash{
71
71
  opacity: 0.6;
72
72
  }
73
-
74
-
73
+
74
+
75
75
  .description-header {
76
76
  flex-direction: column;
77
77
  width: 100%;
@@ -81,8 +81,8 @@ mbg-top-sellings-products {
81
81
  height: 400px;
82
82
  padding: 16px 0px;
83
83
  }
84
-
85
-
84
+
85
+
86
86
  .product-header {
87
87
  display: flex;
88
88
  justify-content: end;
@@ -90,37 +90,37 @@ mbg-top-sellings-products {
90
90
  width: 100%;
91
91
  // padding: 0px 24px;
92
92
  }
93
-
93
+
94
94
  .product-header span {
95
95
  color: #555;
96
96
  }
97
-
98
-
97
+
98
+
99
99
  .header-sales {
100
100
  width: 40%;
101
101
  text-align: right;
102
102
  }
103
-
103
+
104
104
  .header-stock {
105
105
  width: 20%;
106
106
  text-align: right;
107
107
  }
108
-
108
+
109
109
  .product-list {
110
-
110
+
111
111
  width: 100%;
112
112
  }
113
-
113
+
114
114
  .product-item {
115
115
  display: block;
116
116
  padding: 0;
117
117
  padding: 0px 23px 0px 0px;
118
-
118
+
119
119
  }
120
-
120
+
121
121
  .fake-chart {
122
- width: 100%;
123
- height: 100%;
122
+ width: 100%;
123
+ height: 100%;
124
124
  position: relative;
125
125
  border-radius: 10px;
126
126
  padding: 0px;
@@ -130,41 +130,41 @@ mbg-top-sellings-products {
130
130
  flex: 1;
131
131
  display: flex;
132
132
  }
133
-
133
+
134
134
  .swiper-container {
135
135
  width: 100%;
136
136
  overflow: hidden;
137
137
  height: 350px;
138
138
  position: relative;
139
-
139
+
140
140
  }
141
-
141
+
142
142
  .swiper-pagination {
143
143
  display: flex;
144
144
  gap: 5px;
145
145
  }
146
-
146
+
147
147
  .swiper-pagination-bullet {
148
148
  width: 10px;
149
149
  height: 10px;
150
- background-color: #606A90;
150
+ background-color: #606A90;
151
151
  border-radius: 50%;
152
152
  opacity: 0.5;
153
153
  }
154
-
154
+
155
155
  .swiper-pagination-bullet-active {
156
- background-color: #0EBCBD;
156
+ background-color: #0EBCBD;
157
157
  opacity: 1;
158
158
  }
159
-
160
-
159
+
160
+
161
161
  .segment-item {
162
162
  display: flex;
163
163
  justify-content: space-between;
164
164
  padding: 6px 0;
165
165
  }
166
-
167
- .name {
166
+
167
+ .description-top-selling-name {
168
168
  width: 70%;
169
169
  max-width: 50%;
170
170
  white-space: nowrap;
@@ -174,9 +174,9 @@ mbg-top-sellings-products {
174
174
  font-size: 14px;
175
175
  color: #5f5b5b;
176
176
  }
177
-
178
177
 
179
-
178
+
179
+
180
180
  .line-block-top{
181
181
  height: 1px;
182
182
  background: black;
@@ -186,7 +186,7 @@ mbg-top-sellings-products {
186
186
  opacity: 0.3;
187
187
  top: 8px;
188
188
  }
189
-
189
+
190
190
  .sales {
191
191
  width: 20%;
192
192
  text-align: right;
@@ -195,7 +195,7 @@ mbg-top-sellings-products {
195
195
  position: relative;
196
196
  right: 18px;
197
197
  }
198
-
198
+
199
199
  .stock {
200
200
  width: 20%;
201
201
  text-align: right;
@@ -203,7 +203,7 @@ mbg-top-sellings-products {
203
203
  color: #5f5b5b;
204
204
  position: relative;
205
205
  }
206
-
206
+
207
207
  .show-slides-not-data{
208
208
  display: flex;
209
209
  justify-content: center;
@@ -213,7 +213,7 @@ mbg-top-sellings-products {
213
213
  font-size: 14px;
214
214
  color: #5f5b5b;
215
215
  }
216
-
216
+
217
217
 
218
218
 
219
219