@farm-investimentos/front-mfe-components-vue3 0.0.8 → 0.0.9

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.0.8",
3
+ "version": "0.0.9",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -78,7 +78,7 @@
78
78
  "react-dom": "^18.2.0",
79
79
  "sass": "~1.32.0",
80
80
  "sass-loader": "10.4.1",
81
- "storybook": "7.5.0",
81
+ "storybook": "^7.5.0",
82
82
  "ts-jest": "^29.0.0",
83
83
  "typescript": "~4.1.5",
84
84
  "vite": "^4.4.9",
@@ -3,15 +3,15 @@
3
3
  .farm-dialog-header__close {
4
4
  position: absolute;
5
5
  margin-top: 0;
6
+ right: 4px;
6
7
  font-size: 16px;
7
8
  transition: all 0.4s;
8
- right: 0;
9
9
  &:hover {
10
10
  opacity: 0.8;
11
11
  }
12
12
  }
13
13
 
14
- header {
14
+ header.farm-dialog-header {
15
15
  font-size: 12px;
16
16
  padding: 6px 16px;
17
17
  background-color: #fff;
@@ -1,7 +1,16 @@
1
1
  <template>
2
- <header>
3
- <farm-icon v-if="iconTitle" size="16px" color="primary" class="mr-2">{{ iconTitle }}</farm-icon>
4
- <farm-caption v-if="title" variation="semiBold">
2
+ <header class="farm-dialog-header">
3
+ <farm-icon
4
+ v-if="iconTitle"
5
+ size="16px"
6
+ color="primary"
7
+ class="mr-2"
8
+ >{{ iconTitle }}</farm-icon
9
+ >
10
+ <farm-caption
11
+ v-if="title"
12
+ variation="semiBold"
13
+ >
5
14
  {{ title }}
6
15
  </farm-caption>
7
16
 
@@ -15,12 +24,16 @@
15
24
  title="Fechar"
16
25
  @click="onClose"
17
26
  >
18
- <farm-icon role="button" size="24px"> window-close </farm-icon>
27
+ <farm-icon
28
+ role="button"
29
+ size="24px"
30
+ >
31
+ window-close
32
+ </farm-icon>
19
33
  </farm-btn>
20
34
  </header>
21
35
  </template>
22
36
  <script lang="ts">
23
-
24
37
  /**
25
38
  * Header de dialog/modal
26
39
  */
@@ -49,10 +62,13 @@ export default {
49
62
  default: true,
50
63
  },
51
64
  },
52
- methods: {
53
- onClose() {
54
- this.$emit('onClose', {});
55
- },
65
+ setup(_, { emit }) {
66
+ const onClose = () => {
67
+ emit('onClose', {});
68
+ };
69
+ return {
70
+ onClose,
71
+ };
56
72
  },
57
73
  };
58
74
  </script>
@@ -8,8 +8,8 @@ describe('DialogHeader component', () => {
8
8
  beforeEach(() => {
9
9
  wrapper = shallowMount(DialogHeader, {
10
10
  propsData: {
11
- title: ''
12
- }
11
+ title: '',
12
+ },
13
13
  });
14
14
  });
15
15
 
@@ -22,4 +22,11 @@ describe('DialogHeader component', () => {
22
22
  expect(wrapper.element).toBeDefined();
23
23
  });
24
24
  });
25
+
26
+ describe('methods', () => {
27
+ it('should handle close', () => {
28
+ wrapper.vm.onClose();
29
+ expect(wrapper.emitted().onClose).toBeDefined();
30
+ });
31
+ });
25
32
  });