@farm-investimentos/front-mfe-components 14.1.6 → 14.2.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": "@farm-investimentos/front-mfe-components",
3
- "version": "14.1.6",
3
+ "version": "14.2.0",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -10,6 +10,7 @@
10
10
  }
11
11
 
12
12
  .farm-icon {
13
+ transition: transform .8s ease-in-out;
13
14
  &.farm-icon--asc {
14
15
  transform: rotateX(180deg);
15
16
  }
@@ -19,13 +20,19 @@
19
20
  th.sortable {
20
21
  cursor: pointer;
21
22
 
23
+
22
24
  &:not(.active) {
23
25
  &:hover {
24
- .farm-icon {
25
- opacity: 0.5 !important;
26
+ .farm-icon::before {
27
+ color: var(--farm-gray-base) !important;
26
28
  }
27
29
  }
28
30
  }
31
+
32
+ .header-text {
33
+ transition: color 0.5s ease;
34
+ }
35
+
29
36
  }
30
37
 
31
38
  th span.span-checkbox {
@@ -47,7 +54,7 @@ th {
47
54
  }
48
55
 
49
56
  :deep(.mdi-sort-descending)::before {
50
- color: var(--farm-gray-base);
57
+ color: var(--farm-secondary-base);
51
58
  font-size: 12px;
52
59
  font-weight: 900;
53
60
  }
@@ -55,4 +62,4 @@ th {
55
62
  .farm-icon--desc,
56
63
  .farm-icon--asc {
57
64
  margin-top: 3.5px;
58
- }
65
+ }
@@ -90,13 +90,14 @@ const headers = [
90
90
  sortable: true,
91
91
  value: 'name',
92
92
  align: 'left',
93
+ width: 120,
93
94
  },
94
95
  {
95
96
  text: 'Aprovado',
96
97
  sortable: true,
97
98
  value: 'approvedAmount',
98
99
  align: 'center',
99
- width: 320,
100
+ width: 160,
100
101
  },
101
102
  {
102
103
  text: 'Disponível',
@@ -118,10 +118,13 @@ export default Vue.extend({
118
118
  return value ? 'DESC' : 'ASC';
119
119
  },
120
120
  clickSort(value, index) {
121
+ const isClicked = this.sortClick[index].clicked;
121
122
  this.removeClicked();
122
123
  this.sortClick[index].clicked = true;
123
124
  this.sortClick[index].show = true;
124
- this.sortClick[index][value] = !this.sortClick[index][value];
125
+ if (isClicked) {
126
+ this.sortClick[index][value] = !this.sortClick[index][value];
127
+ }
125
128
  this.sortClick[index].descending = this.getTypeSort(this.sortClick[index][value]);
126
129
  this.$emit('onClickSort', this.sortClick[index]);
127
130
  },
@@ -167,7 +170,10 @@ export default Vue.extend({
167
170
  created() {
168
171
  for (let i = 0; i < this.headers.length; i += 1) {
169
172
  this.sortClick.push({
170
- [this.headers[i].value]: this.firstSelected && i === this.selectedIndex && this.headers[i].order === 'DESC',
173
+ [this.headers[i].value]:
174
+ this.firstSelected &&
175
+ i === this.selectedIndex &&
176
+ this.headers[i].order === 'DESC',
171
177
  descending: this.headers[i].order || 'ASC',
172
178
  field: this.headers[i].value,
173
179
  clicked: this.checkFirstSelected(i),
@@ -14,11 +14,11 @@ $radius: 5px;
14
14
 
15
15
  @each $color in $colors {
16
16
  &#{'.farm-progressbar--' + $color} {
17
- background-color: var(--v-#{$color}-base);
17
+ background-color: var(--farm-#{$color}-base);
18
18
  }
19
19
 
20
20
  &#{'.farm-progressbar--value-' + $color}>div {
21
- background-color: var(--v-#{$color}-base);
21
+ background-color: var(--farm-#{$color}-base);
22
22
  }
23
23
  }
24
24
 
@@ -14,7 +14,8 @@ export default {
14
14
  docs: {
15
15
  description: {
16
16
  component: `ProgressBar<br />
17
- selector: <em>farm-progressbar</em>`,
17
+ selector: <em>farm-progressbar</em><br />
18
+ <span style="color: var(--farm-primary-base);">ready for use</span>`,
18
19
  },
19
20
  },
20
21
  },
@@ -35,7 +36,7 @@ export const CustomColors = () => ({
35
36
  val: 35,
36
37
  };
37
38
  },
38
- template: '<farm-progressbar :value="val" backgroundColor="accent" valueColor="secondary" />',
39
+ template: '<farm-progressbar :value="val" background-color="info" value-color="secondary" />',
39
40
  });
40
41
 
41
42
  export const CustomHexaColors = () => ({
@@ -44,5 +45,5 @@ export const CustomHexaColors = () => ({
44
45
  val: 35,
45
46
  };
46
47
  },
47
- template: '<farm-progressbar :value="val" backgroundColor="#FFFF00" valueColor="#00FF00" />',
48
+ template: '<farm-progressbar :value="val" background-color="#FFFF00" value-color="#00FF00" />',
48
49
  });
@@ -4,7 +4,7 @@
4
4
  </div>
5
5
  </template>
6
6
  <script lang="ts">
7
- import Vue from 'vue';
7
+ import Vue, { PropType } from 'vue';
8
8
 
9
9
  export default Vue.extend({
10
10
  name: 'farm-progressbar',
@@ -12,11 +12,39 @@ export default Vue.extend({
12
12
  /**
13
13
  * backgroundColor
14
14
  */
15
- backgroundColor: { type: String, default: 'secondary' },
15
+ backgroundColor: {
16
+ type: String as PropType<
17
+ | 'primary'
18
+ | 'secondary'
19
+ | 'neutral'
20
+ | 'info'
21
+ | 'success'
22
+ | 'error'
23
+ | 'warning'
24
+ | 'extra-1'
25
+ | 'extra-2'
26
+ | any
27
+ >,
28
+ default: 'primary',
29
+ },
16
30
  /**
17
31
  * color
18
32
  */
19
- valueColor: { type: String, default: 'error' },
33
+ valueColor: {
34
+ type: String as PropType<
35
+ | 'primary'
36
+ | 'secondary'
37
+ | 'neutral'
38
+ | 'info'
39
+ | 'success'
40
+ | 'error'
41
+ | 'warning'
42
+ | 'extra-1'
43
+ | 'extra-2'
44
+ | any
45
+ >,
46
+ default: 'error',
47
+ },
20
48
  /**
21
49
  * Value (form 0 to 100)
22
50
  */
@@ -3,11 +3,13 @@ import ProgressBar from '../ProgressBar';
3
3
 
4
4
  describe('ProgressBar component', () => {
5
5
  let wrapper;
6
+ let component;
6
7
 
7
8
  beforeEach(() => {
8
9
  wrapper = shallowMount(ProgressBar, {
9
10
  propsData: { value: 40 },
10
11
  });
12
+ component = wrapper.vm;
11
13
  });
12
14
 
13
15
  test('Created hook', () => {
@@ -19,4 +21,11 @@ describe('ProgressBar component', () => {
19
21
  expect(wrapper.element).toMatchSnapshot();
20
22
  });
21
23
  });
24
+
25
+ describe('computed properties', () => {
26
+ it('classes', () => {
27
+ expect(component.classes).toBeDefined();
28
+ expect(component.classes).toHaveProperty('farm-progressbar');
29
+ });
30
+ });
22
31
  });