@farm-investimentos/front-mfe-components-vue3 0.5.0 → 0.5.2

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-vue3",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,20 +35,22 @@
35
35
  "text-mask-addons": "^3.8.0",
36
36
  "v-mask": "2.3.0",
37
37
  "v-money3": "^3.24.0",
38
- "vuetify": "3.4.0",
38
+ "vuetify": "3.5.7",
39
39
  "webpack": "5.89.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@babel/core": "7.17.9",
43
43
  "@babel/generator": "7.17.9",
44
44
  "@farm-investimentos/front-mfe-libs-ts": "3.0.5",
45
- "@storybook/addon-essentials": "7.6.3",
46
- "@storybook/addon-interactions": "7.6.3",
47
- "@storybook/addon-links": "7.6.3",
48
- "@storybook/blocks": "7.6.3",
45
+ "@storybook/addon-essentials": "7.6.17",
46
+ "@storybook/addon-interactions": "7.6.17",
47
+ "@storybook/addon-links": "7.6.17",
48
+ "@storybook/blocks": "7.6.17",
49
+ "@storybook/manager-api": "^7.6.17",
49
50
  "@storybook/testing-library": "^0.2.2",
50
- "@storybook/vue3": "7.6.3",
51
- "@storybook/vue3-vite": "7.6.3",
51
+ "@storybook/theming": "^7.6.17",
52
+ "@storybook/vue3": "7.6.17",
53
+ "@storybook/vue3-vite": "7.6.17",
52
54
  "@tsconfig/node18": "^18.2.2",
53
55
  "@types/jest": "^29.0.0",
54
56
  "@types/node": "^18.17.17",
@@ -78,18 +80,18 @@
78
80
  "react-dom": "^18.2.0",
79
81
  "sass": "~1.32.0",
80
82
  "sass-loader": "10.4.1",
81
- "storybook": "^7.6.3",
83
+ "storybook": "^7.6.17",
82
84
  "style-loader": "^3.3.3",
83
85
  "ts-jest": "^29.0.0",
84
86
  "typescript": "~4.1.5",
85
87
  "vite": "^4.4.9",
86
- "vue": "3.4.10",
88
+ "vue": "3.4.21",
87
89
  "vue-loader": "^16.8.3",
88
90
  "vue-tsc": "^1.8.11",
89
91
  "webpack-cli": "^5.1.4"
90
92
  },
91
93
  "engines": {
92
- "node": ">20.0.0"
94
+ "node": "~20"
93
95
  },
94
96
  "publishConfig": {
95
97
  "@farm-investimentos:registry": "https://registry.npmjs.org"
@@ -1,6 +1,6 @@
1
1
  @import '../../configurations/mixins';
2
2
 
3
- .farm-input-money {
3
+ .farm-input-decimal-formatter {
4
4
  height: 64px;
5
5
 
6
6
  &--hiddendetails {
@@ -39,7 +39,7 @@
39
39
  width: 100%;
40
40
  }
41
41
 
42
- &--focused .farm-input-money--input {
42
+ &--focused .farm-input-decimal-formatter--input {
43
43
  border-color: var(--farm-bw-black-30);
44
44
  }
45
45
 
@@ -63,9 +63,9 @@
63
63
  }
64
64
  }
65
65
 
66
- .farm-input-money--touched.farm-input-money--blured.farm-input-money--validatable {
67
- &.farm-input-money--error {
68
- .farm-input-money {
66
+ .farm-input-decimal-formatter--touched.farm-input-decimal-formatter--blured.farm-input-decimal-formatter--validatable {
67
+ &.farm-input-decimal-formatter--error {
68
+ .farm-input-decimal-formatter {
69
69
  &--input {
70
70
  border-color: var(--farm-error-base);
71
71
 
@@ -81,8 +81,8 @@
81
81
  }
82
82
  }
83
83
 
84
- .farm-input-money--blured.farm-input-money--validatable:not(.farm-input-money--error) {
85
- .farm-input-money--input {
84
+ .farm-input-decimal-formatter--blured.farm-input-decimal-formatter--validatable:not(.farm-input-decimal-formatter--error) {
85
+ .farm-input-decimal-formatter--input {
86
86
  border-color: var(--farm-primary-base);
87
87
 
88
88
  &>input {
@@ -1,16 +1,16 @@
1
1
 
2
- import InputMoney from './InputMoney.vue';
2
+ import InputDecimalFormatter from './InputDecimalFormatter.vue';
3
3
 
4
4
 
5
5
  export default {
6
- title: 'Form/InputMoney',
7
- component: InputMoney,
6
+ title: 'Form/InputDecimalFormatter',
7
+ component: InputDecimalFormatter,
8
8
  // decorators: [withDesign],
9
9
  parameters: {
10
10
  docs: {
11
11
  description: {
12
12
  component: `Input Money<br />
13
- selector: <em>farm-input-money</em><br />
13
+ selector: <em>farm-input-decimal-formatter</em><br />
14
14
  <span style="color: var(--farm-primary-base);">ready for use</span>
15
15
  `,
16
16
  },
@@ -33,7 +33,7 @@ export const Default = () => ({
33
33
  <farm-label for="input-money">
34
34
  label
35
35
  </farm-label>
36
- <farm-input-money id="input-money-default" v-model="v" />
36
+ <farm-input-decimal-formatter id="input-money-default" v-model="v" />
37
37
  <span>{{v}}</span>
38
38
  </div>`,
39
39
  });
@@ -49,7 +49,7 @@ export const Prefix = () => ({
49
49
  <farm-label for="input-money">
50
50
  label
51
51
  </farm-label>
52
- <farm-input-money prefix="R$ " id="input-money-prefix" v-model="v" />
52
+ <farm-input-decimal-formatter prefix="R$ " id="input-money-prefix" v-model="v" />
53
53
  <span>{{v}}</span>
54
54
  </div>`,
55
55
  });
@@ -65,7 +65,7 @@ export const Sufix = () => ({
65
65
  <farm-label for="input-money">
66
66
  label
67
67
  </farm-label>
68
- <farm-input-money suffix="%" id="input-money-prefix" v-model="v" />
68
+ <farm-input-decimal-formatter suffix="%" id="input-money-prefix" v-model="v" />
69
69
  <span>{{v}}</span>
70
70
  </div>`,
71
71
  });
@@ -81,7 +81,7 @@ export const Precision = () => ({
81
81
  <farm-label for="input-money">
82
82
  label
83
83
  </farm-label>
84
- <farm-input-money :precision="20" id="input-money-prefix" v-model="v" />
84
+ <farm-input-decimal-formatter :precision="20" id="input-money-prefix" v-model="v" />
85
85
  <span>{{v}}</span>
86
86
  </div>`,
87
87
  });
@@ -97,7 +97,7 @@ export const Icon = () => ({
97
97
  <farm-label for="input-money">
98
98
  label
99
99
  </farm-label>
100
- <farm-input-money id="input-money" v-model="v" icon="currency-usd" />
100
+ <farm-input-decimal-formatter id="input-money" v-model="v" icon="currency-usd" />
101
101
  <span>{{v}}</span>
102
102
  </div>`,
103
103
  });
@@ -116,7 +116,7 @@ export const Required = () => ({
116
116
  <farm-label for="input-money">
117
117
  label
118
118
  </farm-label>
119
- <farm-input-money id="input-money" v-model="v" :rules="[rules.required]" />
119
+ <farm-input-decimal-formatter id="input-money" v-model="v" :rules="[rules.required]" />
120
120
  <span>{{v}}</span>
121
121
  </div>`,
122
122
  });
@@ -1,22 +1,22 @@
1
1
  <template>
2
2
  <div
3
- class="farm-input-money"
3
+ class="farm-input-decimal-formatter"
4
4
  :class="{
5
- 'farm-input-money': true,
6
- 'farm-input-money--validatable': rules.length > 0,
7
- 'farm-input-money--touched': isTouched,
8
- 'farm-input-money--blured': isBlured,
9
- 'farm-input-money--error': hasError,
10
- 'farm-input-money--focused': isFocus && !readonly,
11
- 'farm-input-money--disabled': disabled,
12
- 'farm-input-money--hiddendetails': hideDetails,
5
+ 'farm-input-decimal-formatter': true,
6
+ 'farm-input-decimal-formatter--validatable': rules.length > 0,
7
+ 'farm-input-decimal-formatter--touched': isTouched,
8
+ 'farm-input-decimal-formatter--blured': isBlured,
9
+ 'farm-input-decimal-formatter--error': hasError,
10
+ 'farm-input-decimal-formatter--focused': isFocus && !readonly,
11
+ 'farm-input-decimal-formatter--disabled': disabled,
12
+ 'farm-input-decimal-formatter--hiddendetails': hideDetails,
13
13
  }"
14
14
  :id="customId"
15
15
  >
16
16
  <div
17
17
  :class="{
18
- 'farm-input-money--input': true,
19
- 'farm-input-money--input--iconed': icon,
18
+ 'farm-input-decimal-formatter--input': true,
19
+ 'farm-input-decimal-formatter--input--iconed': icon,
20
20
  }"
21
21
  >
22
22
  <button
@@ -72,9 +72,9 @@
72
72
  </farm-caption>
73
73
  <farm-caption
74
74
  v-if="!hideDetails && hint && !showErrorText"
75
- class="farm-input-money__hint-text"
75
+ class="farm-input-decimal-formatter__hint-text"
76
76
  :class="{
77
- 'farm-input-money__hint-text--show': persistentHint || isFocus,
77
+ 'farm-input-decimal-formatter__hint-text--show': persistentHint || isFocus,
78
78
  }"
79
79
  color="gray"
80
80
  variation="regular"
@@ -94,7 +94,7 @@ import validateFormStateBuilder from '../../composition/validateFormStateBuilder
94
94
  import randomId from '../../helpers/randomId';
95
95
 
96
96
  export default {
97
- name: 'farm-input-money',
97
+ name: 'farm-input-decimal-formatter',
98
98
  inheritAttrs: false,
99
99
  props: {
100
100
  /**
@@ -225,7 +225,7 @@ export default {
225
225
  const hasError = computed(() => {
226
226
  return errorBucket.value.length > 0;
227
227
  });
228
- const customId = 'farm-input-money-' + (props.id || randomId(2));
228
+ const customId = 'farm-input-decimal-formatter-' + (props.id || randomId(2));
229
229
 
230
230
  const showErrorText = computed(() => hasError.value && isTouched.value && isBlured.value);
231
231
 
@@ -312,5 +312,5 @@ export default {
312
312
  };
313
313
  </script>
314
314
  <style lang="scss" scoped>
315
- @import 'InputMoney';
315
+ @import 'InputDecimalFormatter';
316
316
  </style>
@@ -1,13 +1,13 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
2
 
3
- import InputMoney from '../InputMoney';
3
+ import InputDecimalFormatter from '../InputDecimalFormatter';
4
4
 
5
- describe('InputMoney component', () => {
5
+ describe('InputDecimalFormatter component', () => {
6
6
  let wrapper;
7
7
  let component;
8
8
 
9
9
  beforeEach(() => {
10
- wrapper = shallowMount(InputMoney, {
10
+ wrapper = shallowMount(InputDecimalFormatter, {
11
11
  directives: {
12
12
  mask: () => { },
13
13
  },
@@ -0,0 +1,4 @@
1
+ import InputDecimalFormatter from './InputDecimalFormatter.vue';
2
+
3
+ export { InputDecimalFormatter };
4
+ export default InputDecimalFormatter;
@@ -162,7 +162,21 @@ export const TableSampleDataWithFarmCheckbox = () => ({
162
162
  components: { 'v-data-table': VDataTable },
163
163
  data() {
164
164
  return {
165
- headers,
165
+ headers: [
166
+ {
167
+ title: 'ID',
168
+ sortable: false,
169
+ key: 'id',
170
+ width: 80,
171
+ align: 'center',
172
+ },
173
+ {
174
+ title: 'Name',
175
+ sortable: false,
176
+ key: 'name',
177
+ align: 'end',
178
+ },
179
+ ],
166
180
  items: [
167
181
  { id: 1, name: 'name 1' },
168
182
  { id: 2, name: 'name 2' },
@@ -173,7 +187,6 @@ export const TableSampleDataWithFarmCheckbox = () => ({
173
187
  },
174
188
  methods: {
175
189
  onSelect({ item }) {
176
- console.log(item);
177
190
  if (item.id === 2)
178
191
  this.selectedItems = [...this.selectedItems].filter(
179
192
  innerItem => innerItem.id !== 2
@@ -197,7 +210,6 @@ export const TableSampleDataWithFarmCheckbox = () => ({
197
210
  show-select
198
211
  id="v-data-table--default"
199
212
  v-model="selectedItems"
200
-
201
213
  :headers="headers"
202
214
  :items="items"
203
215
  @item-selected="onSelect"
package/src/main.ts CHANGED
@@ -78,7 +78,7 @@ export * from './components/Switcher';
78
78
  export * from './components/Tabs';
79
79
  export * from './components/TextArea';
80
80
  export * from './components/TextFieldV2';
81
- export * from './components/InputMoney';
81
+ export * from './components/InputDecimalFormatter';
82
82
  export * from './components/Tooltip';
83
83
  export * from './components/Typography';
84
84
  export * from './components/ValueCaption';
@@ -84,10 +84,13 @@ $defaultLefts: 0, 4rem, 4rem;
84
84
  thead {
85
85
  height: 51px;
86
86
  }
87
-
88
- th[role='columnheader']:has(> .v-data-table__checkbox) {
89
- max-width: 71px !important;
90
- padding-left: 24px;
87
+ &.v-data-table--show-select {
88
+ th:first-child, td:first-child {
89
+ padding-left: 0;
90
+ }
91
+ td:first-child .farm-checkbox__container {
92
+ margin-left: 12px;
93
+ }
91
94
  }
92
95
 
93
96
  .v-data-table-header__icon {
@@ -33,11 +33,11 @@ body.body--has-footer {
33
33
  }
34
34
 
35
35
  //temporary solution for v-data-table checkboxes
36
- .v-data-table__checkbox.v-simple-checkbox {
36
+ .v-selection-control.v-checkbox-btn {
37
37
  .v-icon.v-icon {
38
38
  font-size: 22px;
39
- color: var(--farm-neutral-farken);
40
- ;
39
+ color: var(--farm-neutral-darken);
40
+ opacity: 1;
41
41
 
42
42
  &.mdi-checkbox-marked,
43
43
  &.mdi-minus-box {
@@ -45,7 +45,7 @@ body.body--has-footer {
45
45
  }
46
46
  }
47
47
 
48
- .v-input--selection-controls__ripple {
48
+ .v-ripple__container {
49
49
  display: none;
50
50
  }
51
51
  }
@@ -1,4 +0,0 @@
1
- import InputMoney from './InputMoney.vue';
2
-
3
- export { InputMoney };
4
- export default InputMoney;