@farm-investimentos/front-mfe-components 9.2.4 → 9.2.5

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": "9.2.4",
3
+ "version": "9.2.5",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -131,6 +131,33 @@ export const HeaderAndBottom = () => ({
131
131
  </div>`,
132
132
  });
133
133
 
134
+ <<<<<<< HEAD
135
+ export const Persistent = () => ({
136
+ data() {
137
+ return {
138
+ value: false,
139
+ text,
140
+ };
141
+ },
142
+ template: `<div>
143
+ <farm-btn color="secondary" @click="value = true">abrir</farm-btn>
144
+ <farm-modal v-model="value" :offsetTop="48" :offsetBottom="64" :persistent="true">
145
+ <template v-slot:header>
146
+ <farm-dialog-header title="Título" @onClose="() => value = false" />
147
+ </template>
148
+ <template v-slot:content>
149
+ <br />persistent modal<br />
150
+ </template>
151
+
152
+ <template v-slot:footer>
153
+ <farm-dialog-footer @onConfirm="() => value = false" @onClose="() => value = false" />
154
+ </template>
155
+ </farm-modal>
156
+ </div>`,
157
+ });
158
+
159
+ =======
160
+ >>>>>>> develop
134
161
  const text = `inicio!<br />
135
162
  teste!<br />
136
163
  teste!<br />
@@ -61,6 +61,7 @@ export default Vue.extend({
61
61
  if (persistent.value) {
62
62
  return false;
63
63
  }
64
+ window.removeEventListener('keyup', escHandler);
64
65
  inputValue.value = false;
65
66
  emit('input', false);
66
67
  };
@@ -69,14 +70,23 @@ export default Vue.extend({
69
70
  () => props.value,
70
71
  newValue => {
71
72
  inputValue.value = newValue;
73
+ if (newValue) {
74
+ window.addEventListener('keyup', escHandler);
75
+ }
72
76
  }
73
77
  );
74
78
 
79
+ const escHandler = event => {
80
+ if (event.key === 'Escape') {
81
+ close();
82
+ }
83
+ };
84
+
75
85
  return {
76
86
  inputValue,
77
87
  styles,
78
- close,
79
88
  size,
89
+ close,
80
90
  };
81
91
  },
82
92
  });
@@ -4,7 +4,6 @@ import Modal from '../index';
4
4
 
5
5
  describe('Modal component', () => {
6
6
  let wrapper;
7
- let component;
8
7
 
9
8
  beforeEach(() => {
10
9
  wrapper = shallowMount(Modal, {
@@ -12,7 +11,6 @@ describe('Modal component', () => {
12
11
  value: false,
13
12
  },
14
13
  });
15
- component = wrapper.vm;
16
14
  });
17
15
 
18
16
  test('Modal created', () => {