@kigi/components 1.46.0-beta.5 → 1.46.0-beta.6

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-beta.5",
3
+ "version": "1.46.0-beta.6",
4
4
  "description": "@kigi/components",
5
5
  "main": "src/components/index.ts",
6
6
  "scripts": {
@@ -1,76 +1,74 @@
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
- <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>
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>
76
74
  </div>
@@ -7,13 +7,6 @@
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
- }
17
10
  .mbg-date-between {
18
11
  display: flex;
19
12
  width: 100%;
@@ -17,7 +17,7 @@ class MbgInputDateController {
17
17
  public betweenText: string
18
18
  public filterDate: Function
19
19
  public onlyMonthYear: boolean
20
- private nameOfTheDay
20
+
21
21
 
22
22
  constructor(public $scope, public $element, public $attrs, public $timeout) {
23
23
  if ($attrs.ngRequired === '') {
@@ -47,10 +47,6 @@ class MbgInputDateController {
47
47
  }
48
48
  }
49
49
 
50
- changeDay() {
51
- return new Intl.DateTimeFormat('pt-BR', { weekday: 'long' }).format(this.ngModel)
52
- }
53
-
54
50
  onChange() {
55
51
  if (this.ngChange) {
56
52
  this.ngChange({})
@@ -137,7 +133,6 @@ const mbgInputDate = {
137
133
  filterDate: '&?',
138
134
  onlyMonthYear: '=?',
139
135
  titleMode: '=?',
140
- nameOfTheDay: '=?',
141
136
  },
142
137
  template,
143
138
  controller: MbgInputDateController,
@@ -20,7 +20,6 @@ class MbgInputPasswordController {
20
20
  }
21
21
  }
22
22
  onChange() {
23
- console.log('this.ngChange', this.ngChange)
24
23
  if (this.ngChange) {
25
24
  this.ngChange({})
26
25
  }
@@ -48,9 +48,6 @@ 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
54
51
 
55
52
  constructor(
56
53
  public $scope,
@@ -245,23 +242,15 @@ class MbgSelectController {
245
242
  }
246
243
  }
247
244
 
248
- onInputBlur(viewFavorite) {
245
+ onInputBlur() {
249
246
  this.$timeout(() => {
250
247
  this.hasFocus = false
251
248
  this.data = []
252
249
  this.checkPosition()
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
250
+ if (!this.ngModel && this.cacheNgModel) {
261
251
  this.ngModel = this.cacheNgModel
262
252
  }
263
253
  })
264
-
265
254
  if (this.ngBlur) {
266
255
  this.ngBlur()
267
256
  }
@@ -430,7 +419,6 @@ class MbgSelectController {
430
419
  } else {
431
420
  await this.updateModelValue(this.inputValue)
432
421
  }
433
-
434
422
  this.executeCallback()
435
423
  if (this.onSelect) {
436
424
  this.onSelect({ value: this.ngModel })
@@ -610,7 +598,7 @@ class MbgSelectController {
610
598
  }
611
599
  if (!this.ngModel) {
612
600
  delete this.inputValue
613
- this.inputNgValue = ''
601
+ delete this.inputNgValue
614
602
  }
615
603
  }
616
604
  }
@@ -622,34 +610,15 @@ class MbgSelectController {
622
610
  }
623
611
 
624
612
  checkFavorite() {
625
- let favorite = null
613
+ let favorite
626
614
  this.$timeout(() => {
627
615
  favorite = MbgCookie.get(this.getFavoriteKey())
628
616
  if (favorite && this.enableFavorite && !this.ngModel) {
629
617
  this.selectOption(favorite)
630
-
631
- if (this.callBackFavorite) {
632
- this.callBackFavorite({ value: favorite })
633
- }
634
-
635
618
  if (this.executeAfterOnInit) {
636
619
  this.executeAfterOnInit()
637
620
  }
638
621
  }
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)
653
622
  }, 300)
654
623
  }
655
624
 
@@ -671,7 +640,6 @@ class MbgSelectController {
671
640
  }
672
641
  } else {
673
642
  MbgCookie.set(this.getFavoriteKey(), item)
674
- this.getCheckFavoriteModel(true)
675
643
  }
676
644
  }
677
645
 
@@ -715,7 +683,7 @@ class MbgSelectController {
715
683
  }
716
684
  }
717
685
 
718
- MbgSelectController['$inject'] = [
686
+ MbgSelectController.$inject = [
719
687
  '$scope',
720
688
  '$element',
721
689
  '$attrs',
@@ -749,8 +717,6 @@ const mbgSelect = {
749
717
  manyFavorite: '=?',
750
718
  executeAfterOnInit: '&?',
751
719
  mountValue: '&?',
752
- callBackFavorite: '&?',
753
- productKitList: '=?',
754
720
  },
755
721
  controller: MbgSelectController,
756
722
  template,
@@ -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' }}">{{