@farm-investimentos/front-mfe-components 11.0.2 → 11.1.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.
Files changed (29) hide show
  1. package/dist/front-mfe-components.common.js +443 -264
  2. package/dist/front-mfe-components.common.js.map +1 -1
  3. package/dist/front-mfe-components.css +2 -2
  4. package/dist/front-mfe-components.umd.js +443 -264
  5. package/dist/front-mfe-components.umd.js.map +1 -1
  6. package/dist/front-mfe-components.umd.min.js +1 -1
  7. package/dist/front-mfe-components.umd.min.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/components/Collapsible/Collapsible.vue +1 -1
  10. package/src/components/ContextMenu/ContextMenu.scss +32 -0
  11. package/src/components/ContextMenu/ContextMenu.stories.js +104 -0
  12. package/src/components/ContextMenu/ContextMenu.vue +129 -0
  13. package/src/components/ContextMenu/__tests__/ContextMenu.spec.js +20 -0
  14. package/src/components/ContextMenu/index.ts +5 -0
  15. package/src/components/DataTablePaginator/DataTablePaginator.scss +5 -4
  16. package/src/components/DataTablePaginator/DataTablePaginator.stories.js +5 -5
  17. package/src/components/FilePicker/FilePicker.vue +1 -2
  18. package/src/components/Icon/Icon.scss +9 -4
  19. package/src/components/Icon/Icon.stories.js +4 -3
  20. package/src/components/Icon/Icon.vue +6 -5
  21. package/src/components/IconBox/IconBox.scss +5 -4
  22. package/src/components/IconBox/IconBox.stories.js +2 -1
  23. package/src/components/IconBox/IconBox.vue +15 -5
  24. package/src/components/IconBox/__tests__/IconBox.spec.js +1 -1
  25. package/src/components/IdCaption/IdCaption.vue +1 -1
  26. package/src/components/TableContextMenu/TableContextMenu.scss +16 -2
  27. package/src/components/TableContextMenu/TableContextMenu.stories.js +17 -4
  28. package/src/components/TableContextMenu/TableContextMenu.vue +39 -36
  29. package/src/main.ts +1 -0
@@ -1,62 +1,65 @@
1
1
  <template>
2
- <v-menu>
3
- <template v-slot:activator="{ on, attrs }">
4
- <farm-btn icon v-bind="attrs" v-on="on" title="Abrir opções" color="secondary">
2
+ <farm-contextmenu v-model="value">
3
+ <template v-slot:activator="{}">
4
+ <farm-btn icon @click="toggleValue" title="Abrir opções" color="secondary">
5
5
  <farm-icon size="md">dots-horizontal</farm-icon>
6
6
  </farm-btn>
7
7
  </template>
8
-
9
- <v-list dense class="pa-0">
10
- <v-list-item
8
+ <farm-list>
9
+ <farm-listitem
11
10
  v-for="item in items"
12
- :key="item.label"
13
- :title="item.label"
11
+ clickable
12
+ hoverColorVariation="lighten"
13
+ :key="'tablecontextmenu_item_' + item.label"
14
+ :hoverColor="item.icon.color || 'primary'"
14
15
  @click="onClick(item.handler)"
15
16
  >
16
- <v-list-item-content>
17
- <v-list-item-title>
18
- <farm-icon
19
- v-if="item.icon"
20
- size="md"
21
- :color="item.icon.color || 'secondary'"
22
- >
23
- {{ item.icon.type }}
24
- </farm-icon>
25
- {{ item.label }}
26
- </v-list-item-title>
27
- </v-list-item-content>
28
- </v-list-item>
29
- </v-list>
30
- </v-menu>
17
+ <farm-icon v-if="item.icon" size="sm" :color="item.icon.color || 'primary'">
18
+ {{ item.icon.type }}
19
+ </farm-icon>
20
+ <farm-caption bold tag="span">{{ item.label }}</farm-caption>
21
+ </farm-listitem>
22
+ </farm-list>
23
+ </farm-contextmenu>
31
24
  </template>
32
25
  <script lang="ts">
33
- import Vue from 'vue';
34
- import { VMenu } from 'vuetify/lib/components/VMenu';
35
- import { VList } from 'vuetify/lib/components/VList';
36
- import VListItem from 'vuetify/lib/components/VList/VListItem';
37
- import { VListItemContent, VListItemTitle } from 'vuetify/lib';
26
+ import Vue, { PropType } from 'vue';
27
+
28
+ export interface IContextMenuOption {
29
+ label: string;
30
+ handler: string;
31
+ icon: IContextMenuOptionIcon;
32
+ }
33
+
34
+ export interface IContextMenuOptionIcon {
35
+ color?: string;
36
+ type: string;
37
+ }
38
38
 
39
39
  export default Vue.extend({
40
40
  name: 'farm-context-menu',
41
- components: {
42
- VMenu,
43
- VList,
44
- VListItem,
45
- VListItemContent,
46
- VListItemTitle,
47
- },
41
+ components: {},
48
42
  props: {
49
43
  items: {
50
- type: Array,
44
+ type: Array as PropType<Array<IContextMenuOption>>,
51
45
  required: true,
52
46
  },
53
47
  },
48
+ data() {
49
+ return {
50
+ value: false,
51
+ };
52
+ },
54
53
  methods: {
55
54
  onClick(handler) {
56
55
  if (handler !== undefined) {
57
56
  this.$emit(handler);
57
+ // handler();
58
58
  }
59
59
  },
60
+ toggleValue() {
61
+ this.value = !this.value;
62
+ },
60
63
  },
61
64
  });
62
65
  </script>
package/src/main.ts CHANGED
@@ -62,6 +62,7 @@ export * from './components/Buttons/MultiImportButton';
62
62
  export * from './components/Card';
63
63
  export * from './components/Checkbox';
64
64
  export * from './components/Chip';
65
+ export * from './components/ContextMenu';
65
66
  export * from './components/CopyToClipboard';
66
67
  export * from './components/Logos/ProductLogo';
67
68
  export * from './components/Logos/OriginatorLogo';