@farm-investimentos/front-mfe-components 14.1.6 → 14.2.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farm-investimentos/front-mfe-components",
3
- "version": "14.1.6",
3
+ "version": "14.2.1",
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
  }
@@ -18,20 +19,24 @@
18
19
 
19
20
  th.sortable {
20
21
  cursor: pointer;
21
-
22
22
  &:not(.active) {
23
23
  &:hover {
24
- .farm-icon {
25
- opacity: 0.5 !important;
24
+ .farm-icon::before {
25
+ color: var(--farm-gray-base) !important;
26
26
  }
27
27
  }
28
28
  }
29
+
30
+ .header-text {
31
+ transition: color 0.5s ease;
32
+ }
33
+
29
34
  }
30
35
 
31
36
  th span.span-checkbox {
32
37
  display: flex;
33
38
  justify-content: flex-start;
34
- padding-left: 4px;
39
+ padding-left: 0;
35
40
  }
36
41
 
37
42
  thead {
@@ -44,10 +49,14 @@ th {
44
49
  font-weight: 700;
45
50
  text-transform: uppercase;
46
51
  box-shadow: 0px -1px 0px var(--farm-gray-lighten), 0px 1px 0px var(--farm-gray-lighten);
52
+ &.checkbox-container {
53
+ width: 60px !important;
54
+ min-width: 60px !important;
55
+ }
47
56
  }
48
57
 
49
58
  :deep(.mdi-sort-descending)::before {
50
- color: var(--farm-gray-base);
59
+ color: var(--farm-secondary-base);
51
60
  font-size: 12px;
52
61
  font-weight: 900;
53
62
  }
@@ -55,4 +64,4 @@ th {
55
64
  .farm-icon--desc,
56
65
  .farm-icon--asc {
57
66
  margin-top: 3.5px;
58
- }
67
+ }
@@ -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',
@@ -8,6 +8,7 @@
8
8
  item.sortable ? 'sortable' : '',
9
9
  sortClick[$index].clicked ? 'active' : '',
10
10
  item.sortable ? (sortClick[$index].descending === 'DESC' ? 'DESC' : 'ASC') : '',
11
+ showCheckbox && $index == 0 ? 'checkbox-container' : ''
11
12
  ]"
12
13
  v-bind:style="{
13
14
  textAlign: item.align ? item.align : '',
@@ -36,7 +37,7 @@
36
37
 
37
38
  <span v-if="isTHDataTableSelect(item) && showCheckbox" class="span-checkbox">
38
39
  <farm-checkbox
39
- size="md"
40
+ size="sm"
40
41
  v-model="inputVal"
41
42
  :value="true"
42
43
  :indeterminate="headerProps.someItems && !headerProps.everyItem"
@@ -118,10 +119,13 @@ export default Vue.extend({
118
119
  return value ? 'DESC' : 'ASC';
119
120
  },
120
121
  clickSort(value, index) {
122
+ const isClicked = this.sortClick[index].clicked;
121
123
  this.removeClicked();
122
124
  this.sortClick[index].clicked = true;
123
125
  this.sortClick[index].show = true;
124
- this.sortClick[index][value] = !this.sortClick[index][value];
126
+ if (isClicked) {
127
+ this.sortClick[index][value] = !this.sortClick[index][value];
128
+ }
125
129
  this.sortClick[index].descending = this.getTypeSort(this.sortClick[index][value]);
126
130
  this.$emit('onClickSort', this.sortClick[index]);
127
131
  },
@@ -167,7 +171,10 @@ export default Vue.extend({
167
171
  created() {
168
172
  for (let i = 0; i < this.headers.length; i += 1) {
169
173
  this.sortClick.push({
170
- [this.headers[i].value]: this.firstSelected && i === this.selectedIndex && this.headers[i].order === 'DESC',
174
+ [this.headers[i].value]:
175
+ this.firstSelected &&
176
+ i === this.selectedIndex &&
177
+ this.headers[i].order === 'DESC',
171
178
  descending: this.headers[i].order || 'ASC',
172
179
  field: this.headers[i].value,
173
180
  clicked: this.checkFirstSelected(i),
@@ -23,7 +23,9 @@ export default {
23
23
  };
24
24
 
25
25
  export const Primary = () => ({
26
- template: '<farm-listitem>aaa</farm-listitem>',
26
+ template: `<farm-listitem>
27
+ Item
28
+ </farm-listitem>`,
27
29
  });
28
30
 
29
31
  export const HoverColors = () => ({
@@ -33,8 +35,16 @@ export const HoverColors = () => ({
33
35
  variations,
34
36
  };
35
37
  },
36
- template: `<div style="display: flex; flex-direction: row; flex-wrap: wrap;">
37
- <div class="chips-container" v-for="color in colors" :key="color" style="width: 33.3%; margin-bottom: 32px;">
38
+ methods: {
39
+ getIconVariation(variation) {
40
+ if (variation === 'base' || variation === 'lighten') {
41
+ return 'darken';
42
+ }
43
+ return 'base';
44
+ },
45
+ },
46
+ template: `<farm-row>
47
+ <farm-col v-for="color in colors" :key="color" cols="12" md="4" class="mb-4">
38
48
  <h4>{{ color }}</h4>
39
49
  <farm-listitem
40
50
  v-for="variation in variations"
@@ -42,24 +52,25 @@ export const HoverColors = () => ({
42
52
  :hoverColor="color"
43
53
  :hoverColorVariation="variation"
44
54
  >
55
+ <farm-icon
56
+ :color="color"
57
+ :variation="getIconVariation(variation)"
58
+ >
59
+ book
60
+ </farm-icon>
45
61
  {{ color }} {{ variation }}
46
62
  </farm-listitem>
47
- </div>
48
- </div>`,
63
+ </farm-col>
64
+ </farm-row>`,
49
65
  });
50
66
 
51
- export const ClickableCursor = () => ({
52
- template: '<farm-listitem clickable>Clickable cursor</farm-listitem>',
53
- });
54
-
55
- export const ClickListener = () => ({
67
+ export const Clickable = () => ({
56
68
  methods: {
57
69
  onClick() {
58
70
  alert('Clicked');
59
- }
71
+ },
60
72
  },
61
- template:
62
- `<farm-listitem
73
+ template: `<farm-listitem
63
74
  clickable
64
75
  hoverColor="error"
65
76
  hoverColorVariation="lighten"
@@ -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
  });
@@ -30,6 +30,11 @@ $defaultLefts: 0, 4rem, 4rem;
30
30
  }
31
31
  }
32
32
 
33
+ &.v-data-table > .v-data-table__wrapper > table > tbody > tr > td:first-child,
34
+ &.v-data-table > .v-data-table__wrapper > table > thead > tr > th:first-child {
35
+ padding-left: 24px;
36
+ }
37
+
33
38
  @if $columns > 0 {
34
39
  @for $i from 1 through $columns {
35
40
  tr td:nth-child(#{$i}),
@@ -81,6 +86,7 @@ $defaultLefts: 0, 4rem, 4rem;
81
86
 
82
87
  th[role='columnheader']:has(> .v-data-table__checkbox) {
83
88
  max-width: 71px !important;
89
+ padding-left: 24px;
84
90
  }
85
91
 
86
92
  .v-data-table-header tr th {
@@ -95,8 +101,15 @@ $defaultLefts: 0, 4rem, 4rem;
95
101
  }
96
102
 
97
103
  .v-data-table__checkbox .mdi {
98
- margin-left: 18px;
99
- font-size: 24px;
104
+ margin-left: 0;
105
+ font-size: 20px;
106
+ margin-left: -2px;
107
+ }
108
+
109
+ .v-input--selection-controls__input {
110
+ width: 20px;
111
+ height: 20px;
112
+ margin-right: 0 !important;
100
113
  }
101
114
  }
102
115
  }