@farm-investimentos/front-mfe-components 13.0.3 → 13.0.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": "13.0.3",
3
+ "version": "13.0.5",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -14,7 +14,8 @@
14
14
  "storybook": "start-storybook -p 6006",
15
15
  "build-storybook": "build-storybook",
16
16
  "test:unit": "jest --updateSnapshot",
17
- "test:coverage": "jest --updateSnapshot --coverage"
17
+ "test:coverage": "jest --updateSnapshot --coverage",
18
+ "prepare": "husky install"
18
19
  },
19
20
  "files": [
20
21
  "dist/*",
@@ -52,7 +53,8 @@
52
53
  "text-mask-addons": "^3.8.0",
53
54
  "typescript": "~4.1.5",
54
55
  "v-mask": "2.3.0",
55
- "vue-template-compiler": "2.7.10"
56
+ "vue-template-compiler": "2.7.10",
57
+ "husky": "^8.0.0"
56
58
  },
57
59
  "browserslist": [
58
60
  "> 1%",
@@ -11,8 +11,9 @@
11
11
  variation="darken"
12
12
  size="md"
13
13
  :color="color"
14
- >{{ icon }}</farm-icon
15
14
  >
15
+ {{ icon }}
16
+ </farm-icon>
16
17
  <div
17
18
  :class="{
18
19
  'farm-alert-box__content': true,
@@ -22,9 +23,11 @@
22
23
  <farm-bodytext
23
24
  variation="regular"
24
25
  color-variation="darken"
26
+ :tag="tag"
25
27
  :type="1"
26
28
  :color="color"
27
29
  >
30
+ <!-- @slot default -->
28
31
  <slot></slot>
29
32
  </farm-bodytext>
30
33
  </div>
@@ -92,6 +95,13 @@ export default Vue.extend({
92
95
  type: Boolean,
93
96
  default: true,
94
97
  },
98
+ /**
99
+ * Html tag (will be forwarded to farm-typography)
100
+ */
101
+ tag: {
102
+ type: String,
103
+ default: 'p',
104
+ },
95
105
  },
96
106
  setup(props, { emit }) {
97
107
  const visible = ref(true);
@@ -109,8 +119,6 @@ export default Vue.extend({
109
119
  };
110
120
  },
111
121
  });
112
-
113
-
114
122
  </script>
115
123
  <style lang="scss" scoped>
116
124
  @import './AlertBox';
@@ -17,7 +17,7 @@
17
17
  }
18
18
 
19
19
  &.logger__divider--info-to-info {
20
- background: var(--farm-error-base);
20
+ background: var(--farm-info-base);
21
21
  }
22
22
 
23
23
  &.logger__divider--success-to-error {
@@ -54,7 +54,7 @@ export const Primary = () => ({
54
54
  message: 'Recusado entre as pré elegíveis',
55
55
  userName: 'Cleyton Rasta',
56
56
  formattedDate: '13/06/2022 20:40',
57
- status: 'success',
57
+ status: 'info',
58
58
  },
59
59
  {
60
60
  message: 'Info',
@@ -176,7 +176,7 @@ export default Vue.extend({
176
176
  change: {
177
177
  type: Function,
178
178
  // eslint-disable-next-line
179
- default: (value: [String, Number, Array<any>]) => {},
179
+ default: (value: [String, Number, Array<any>]) => {},
180
180
  },
181
181
  /**
182
182
  * Emitted when any key is pressed<br />
@@ -248,7 +248,6 @@ export default Vue.extend({
248
248
  isBlured.value = true;
249
249
  validate(innerValue.value);
250
250
  emit('input', innerValue.value);
251
- emit('change', innerValue.value);
252
251
  }
253
252
  );
254
253
 
@@ -309,6 +308,9 @@ export default Vue.extend({
309
308
 
310
309
  innerValue.value = item[itemValue.value];
311
310
  isVisible.value = false;
311
+ setTimeout(() => {
312
+ emit('change', innerValue.value);
313
+ }, 100);
312
314
  };
313
315
 
314
316
  const clickInput = () => {
@@ -145,6 +145,15 @@ export default Vue.extend({
145
145
  type: Boolean,
146
146
  default: false,
147
147
  },
148
+ /**
149
+ * Emitted when any key is pressed<br />
150
+ * _event_
151
+ */
152
+ keyup: {
153
+ type: Function,
154
+ // eslint-disable-next-line
155
+ default: (event: Event) => {},
156
+ },
148
157
  },
149
158
  setup(props, { emit }) {
150
159
  const { rules } = toRefs(props);
@@ -176,7 +185,6 @@ export default Vue.extend({
176
185
  () => innerValue.value,
177
186
  () => {
178
187
  emit('input', innerValue.value);
179
- emit('change', innerValue.value);
180
188
  }
181
189
  );
182
190
 
@@ -199,6 +207,10 @@ export default Vue.extend({
199
207
  const onKeyUp = (event: Event) => {
200
208
  isTouched.value = true;
201
209
  emit('keyup', event);
210
+
211
+ setTimeout(() => {
212
+ emit('change', innerValue.value);
213
+ }, 100);
202
214
  };
203
215
 
204
216
  const onBlur = (event: Event) => {
@@ -29,7 +29,18 @@ export default Vue.extend({
29
29
  */
30
30
  tag: {
31
31
  type: String as PropType<
32
- 'p' | 'span' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'legend' | 'label' | 'li'
32
+ | 'p'
33
+ | 'span'
34
+ | 'h1'
35
+ | 'h2'
36
+ | 'h3'
37
+ | 'h4'
38
+ | 'h5'
39
+ | 'h6'
40
+ | 'legend'
41
+ | 'label'
42
+ | 'li'
43
+ | 'div'
33
44
  >,
34
45
  default: 'p',
35
46
  },
@@ -51,7 +51,7 @@ describe('Typography component', () => {
51
51
  it('Should not allow invalid html tag', async () => {
52
52
  const wrapperTest = shallowMount(Typography, {
53
53
  propsData: {
54
- tag: 'div',
54
+ tag: 'section',
55
55
  },
56
56
  });
57
57
  expect(wrapperTest.vm.tag).toEqual('p');
@@ -1 +1 @@
1
- export default ['p', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'legend', 'label', 'li'];
1
+ export default ['p', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'legend', 'label', 'li', 'div'];