@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.
- package/dist/front-mfe-components.common.js +443 -264
- package/dist/front-mfe-components.common.js.map +1 -1
- package/dist/front-mfe-components.css +2 -2
- package/dist/front-mfe-components.umd.js +443 -264
- package/dist/front-mfe-components.umd.js.map +1 -1
- package/dist/front-mfe-components.umd.min.js +1 -1
- package/dist/front-mfe-components.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Collapsible/Collapsible.vue +1 -1
- package/src/components/ContextMenu/ContextMenu.scss +32 -0
- package/src/components/ContextMenu/ContextMenu.stories.js +104 -0
- package/src/components/ContextMenu/ContextMenu.vue +129 -0
- package/src/components/ContextMenu/__tests__/ContextMenu.spec.js +20 -0
- package/src/components/ContextMenu/index.ts +5 -0
- package/src/components/DataTablePaginator/DataTablePaginator.scss +5 -4
- package/src/components/DataTablePaginator/DataTablePaginator.stories.js +5 -5
- package/src/components/FilePicker/FilePicker.vue +1 -2
- package/src/components/Icon/Icon.scss +9 -4
- package/src/components/Icon/Icon.stories.js +4 -3
- package/src/components/Icon/Icon.vue +6 -5
- package/src/components/IconBox/IconBox.scss +5 -4
- package/src/components/IconBox/IconBox.stories.js +2 -1
- package/src/components/IconBox/IconBox.vue +15 -5
- package/src/components/IconBox/__tests__/IconBox.spec.js +1 -1
- package/src/components/IdCaption/IdCaption.vue +1 -1
- package/src/components/TableContextMenu/TableContextMenu.scss +16 -2
- package/src/components/TableContextMenu/TableContextMenu.stories.js +17 -4
- package/src/components/TableContextMenu/TableContextMenu.vue +39 -36
- package/src/main.ts +1 -0
|
@@ -1,62 +1,65 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-
|
|
3
|
-
<template v-slot:activator="{
|
|
4
|
-
<farm-btn icon
|
|
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
|
-
|
|
10
|
-
<v-list-item
|
|
8
|
+
<farm-list>
|
|
9
|
+
<farm-listitem
|
|
11
10
|
v-for="item in items"
|
|
12
|
-
|
|
13
|
-
|
|
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-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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';
|