@farm-investimentos/front-mfe-components 3.2.1 → 3.3.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": "3.2.1",
3
+ "version": "3.3.0",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -0,0 +1,17 @@
1
+ .v-btn.v-btn--import {
2
+ background: var(--v-extra-lighten2);
3
+ color: var(--v-gray-lighten5);
4
+ .v-icon {
5
+ margin-right: 1rem;
6
+ }
7
+ }
8
+
9
+ .v-list-item {
10
+ border-bottom: 1px solid var(--v-gray-lighten2);
11
+ &:last-child {
12
+ border-bottom: none;
13
+ }
14
+ }
15
+ .v-list-item--link {
16
+ font-size: 0.875rem;
17
+ }
@@ -0,0 +1,19 @@
1
+ import MultiImport from './MultiImportButton.vue';
2
+
3
+ export default {
4
+ title: 'Example/Buttons/MultiImport',
5
+ component: MultiImport,
6
+ };
7
+
8
+ export const Primary = () => ({
9
+ components: { MultiImport },
10
+ template: '<MultiImport />',
11
+ });
12
+
13
+ export const List = () => ({
14
+ components: { MultiImport },
15
+ template: `<MultiImport :optionsList="[{ listenerKey: 1, title: 'XLS teste'}, { listenerKey: 2, title: 'CSV teste novo'}]" />`,
16
+ });
17
+
18
+ Primary.storyName = 'Básico';
19
+ List.storyName = 'Lista';
@@ -0,0 +1,78 @@
1
+ <template>
2
+ <v-menu
3
+ content-class="elevation-1"
4
+ v-model="togglePopover"
5
+ :offset-y="true"
6
+ :rounded="'b t-0'"
7
+ >
8
+ <template v-slot:activator="{ on, attrs }">
9
+ <v-btn
10
+ v-bind="attrs"
11
+ v-on="on"
12
+ dense
13
+ @onClick="togglePopover = true"
14
+ class="v-btn--responsive v-btn--import"
15
+ outlined
16
+ title="Importar"
17
+ >
18
+ Importar
19
+ <v-icon class="ml-2 mr-0">
20
+ {{ togglePopover ? 'mdi-chevron-up' : 'mdi-chevron-down' }}
21
+ </v-icon>
22
+ </v-btn>
23
+ </template>
24
+
25
+ <v-list dense class="pa-0">
26
+ <v-list-item
27
+ v-for="option in optionsList"
28
+ :key="option.listenerKey"
29
+ link
30
+ :title="option.title"
31
+ @click="$emit('onClick', option.listenerKey)"
32
+ >
33
+ <v-list-item-content>
34
+ <v-list-item-title>{{ option.title }}</v-list-item-title>
35
+ </v-list-item-content>
36
+ </v-list-item>
37
+ </v-list>
38
+ </v-menu>
39
+ </template>
40
+ <script>
41
+ import Vue from 'vue';
42
+ import VBtn from 'vuetify/lib/components/VBtn';
43
+ import VIcon from 'vuetify/lib/components/VIcon';
44
+ import VList from 'vuetify/lib/components/VList/VList';
45
+ import VMenu from 'vuetify/lib/components/VMenu';
46
+ import VListItem from 'vuetify/lib/components/VList/VListItem';
47
+ import { VListItemContent, VListItemTitle } from 'vuetify/lib';
48
+
49
+ export default Vue.extend({
50
+ name: 'farm-btn-multipleimport',
51
+ components: {
52
+ VBtn,
53
+ VIcon,
54
+ VList,
55
+ VListItem,
56
+ VMenu,
57
+ VListItemContent,
58
+ VListItemTitle,
59
+ },
60
+ props: {
61
+ /**
62
+ * Lista de opções para o menu dropdown
63
+ */
64
+ optionsList: {
65
+ type: Array,
66
+ default: () => [],
67
+ },
68
+ },
69
+ data() {
70
+ return {
71
+ togglePopover: false,
72
+ };
73
+ },
74
+ });
75
+ </script>
76
+ <style scoped lang="scss">
77
+ @import './MultiImportButton.scss';
78
+ </style>
@@ -0,0 +1,16 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import MultiImportButton from '../MultiImportButton';
3
+
4
+ describe('MultiImportButton component', () => {
5
+ let wrapper;
6
+ let component;
7
+
8
+ beforeEach(() => {
9
+ wrapper = shallowMount(MultiImportButton);
10
+ component = wrapper.vm;
11
+ });
12
+
13
+ test('Created hook', () => {
14
+ expect(wrapper).toBeDefined();
15
+ });
16
+ });
@@ -0,0 +1,4 @@
1
+ import MultiImportButton from './MultiImportButton';
2
+
3
+ export { MultiImportButton };
4
+ export default MultiImportButton;
package/src/main.js CHANGED
@@ -51,6 +51,7 @@ export * from './components/Buttons/ExportButton/';
51
51
  export * from './components/Buttons/ImportButton/';
52
52
  export * from './components/Buttons/ToggleButton/';
53
53
  export * from './components/Buttons/RemoveButton/';
54
+ export * from './components/Buttons/MultiImportButton/';
54
55
  export * from './components/Logos/ProductLogo/';
55
56
  export * from './components/Logos/OriginatorLogo/';
56
57
  export * from './components/ResetTableRowSelection/';