@farm-investimentos/front-mfe-components 3.4.12 → 3.4.13

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.4.12",
3
+ "version": "3.4.13",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -25,7 +25,8 @@
25
25
  "sass": "1.32.13",
26
26
  "sass-loader": "^10.1.1",
27
27
  "vue": "^2.6.11",
28
- "vuetify": "^2.5.7"
28
+ "vuetify": "^2.5.7",
29
+ "vuetify-dialog": "^2.0.16"
29
30
  },
30
31
  "devDependencies": {
31
32
  "@socheatsok78/storybook-addon-vuetify": "^0.1.8",
@@ -4,6 +4,11 @@
4
4
  background: #ffffff;
5
5
  box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.16);
6
6
  border-radius: 5px;
7
+
8
+ &.card-context--outlined {
9
+ box-shadow: none;
10
+ border: 1px solid var(--v-gray-lighten2);
11
+ }
7
12
  }
8
13
 
9
14
  .card-context.height-full {
@@ -1,6 +1,12 @@
1
1
  <template>
2
- <div :class="isHeightFull">
3
- <div class="card-context-header" v-if="isSuccess">
2
+ <div
3
+ :class="{
4
+ 'card-context': true,
5
+ 'height-full': this.full,
6
+ 'card-context--outlined': this.outlined,
7
+ }"
8
+ >
9
+ <div class="card-context-header" v-if="isSuccess && title">
4
10
  <IconBox :icon="icon" v-if="icon" />
5
11
  <div class="card-context-content">
6
12
  <p :class="{ 'card-context-title': true, 'card-context-content--bold': bold }">
@@ -86,11 +92,15 @@ export default Vue.extend({
86
92
  type: Boolean,
87
93
  default: false,
88
94
  },
95
+ /**
96
+ * Is outlined
97
+ */
98
+ outlined: {
99
+ type: Boolean,
100
+ default: false,
101
+ },
89
102
  },
90
103
  computed: {
91
- isHeightFull() {
92
- return this.full ? 'card-context height-full' : 'card-context';
93
- },
94
104
  isSuccess() {
95
105
  return !this.isLoading && !this.isError;
96
106
  },
@@ -22,17 +22,6 @@ describe('CardContext component', () => {
22
22
 
23
23
  describe('Computed properties', () => {
24
24
 
25
- it('Should compute isHeightFull for false', () => {
26
- expect(component.isHeightFull).toEqual('card-context');
27
- });
28
-
29
- it('Should compute isHeightFull for true', async () => {
30
- await wrapper.setProps({
31
- full: true,
32
- });
33
- expect(component.isHeightFull).toEqual('card-context height-full');
34
- });
35
-
36
25
  it('Should compute isLargeLoading for false', () => {
37
26
  expect(component.isLargeLoading).toEqual('small');
38
27
  });
@@ -0,0 +1,51 @@
1
+ import { withDesign } from 'storybook-addon-designs';
2
+ import { ConfirmButton } from '../main';
3
+
4
+ export default {
5
+ title: 'Examples/ConfirmDialog',
6
+ decorators: [withDesign],
7
+ parameters: {
8
+ viewMode: 'docs',
9
+ docs: {
10
+ description: {
11
+ component: `ConfirmDialog created by vuetify-dialog`,
12
+ },
13
+ },
14
+ },
15
+ };
16
+
17
+ export const ConfirmDialog = () => ({
18
+ components: {
19
+ ConfirmButton,
20
+ },
21
+ methods: {
22
+ openDialog() {
23
+ this.$dialog.confirm({
24
+ text: `Deseja realmente sair?`,
25
+ title: 'Sair',
26
+ actions: {
27
+ false: {
28
+ text: 'Cancelar',
29
+ color: 'primary',
30
+ },
31
+ true: {
32
+ text: 'Sim',
33
+ color: 'secondary',
34
+ handle: () => {
35
+ this.$emit('onLogout');
36
+ },
37
+ },
38
+ },
39
+ });
40
+ },
41
+ },
42
+ template: `<div style="display: flex; flex-direction: column; max-width: 160px; width: 100%;">
43
+ <ConfirmButton @click="openDialog">
44
+ Open
45
+ </ConfirmButton>
46
+ </div>`,
47
+ });
48
+
49
+ ConfirmDialog.story = {
50
+ name: 'ConfirmDialog',
51
+ };