@farm-investimentos/front-mfe-components 11.1.1 → 11.2.1

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.
Files changed (31) hide show
  1. package/dist/front-mfe-components.common.js +497 -475
  2. package/dist/front-mfe-components.common.js.map +1 -1
  3. package/dist/front-mfe-components.css +2 -2
  4. package/dist/front-mfe-components.umd.js +497 -475
  5. package/dist/front-mfe-components.umd.js.map +1 -1
  6. package/dist/front-mfe-components.umd.min.js +1 -1
  7. package/dist/front-mfe-components.umd.min.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/components/Buttons/ExportButton/ExportButton.stories.js +11 -4
  10. package/src/components/Buttons/ExportButton/ExportButton.vue +29 -70
  11. package/src/components/Card/Card.scss +2 -2
  12. package/src/components/Card/Card.stories.js +0 -1
  13. package/src/components/Card/Card.vue +4 -1
  14. package/src/components/Card/CardComposition.stories.ts +1 -2
  15. package/src/components/Card/CardContent/CardContent.stories.js +13 -2
  16. package/src/components/Card/CardContent/CardContent.vue +6 -3
  17. package/src/components/ContextMenu/ContextMenu.vue +18 -8
  18. package/src/components/DataTableHeader/DataTableHeader.scss +1 -1
  19. package/src/components/DataTablePaginator/DataTablePaginator.scss +27 -7
  20. package/src/components/DataTablePaginator/DataTablePaginator.vue +45 -11
  21. package/src/components/Form/Form.stories.js +11 -0
  22. package/src/components/IconBox/IconBox.scss +8 -0
  23. package/src/components/Loader/Loader.stories.ts +1 -1
  24. package/src/components/Loader/Loader.vue +50 -58
  25. package/src/components/Modal/Modal.scss +0 -1
  26. package/src/components/Modal/Modal.vue +13 -4
  27. package/src/components/TableContextMenu/TableContextMenu.stories.js +15 -0
  28. package/src/components/Typography/Typography.scss +2 -1
  29. package/src/helpers/calculateMainZindex.js +10 -0
  30. package/src/helpers/date.js +1 -1
  31. package/src/helpers/index.js +1 -0
@@ -1,60 +1,58 @@
1
1
  <template>
2
- <div>
3
- <div class="farm-loader__overlay" v-if="mode === 'overlay'" :style="styleObject">
4
- <div
5
- role="progressbar"
6
- aria-valuemin="0"
7
- aria-valuemax="100"
8
- class="farm-loader farm-loader--big farm-loader--visible farm-loader--indeterminate"
2
+ <div class="farm-loader__overlay" v-if="mode === 'overlay'" :style="styleObject">
3
+ <div
4
+ role="progressbar"
5
+ aria-valuemin="0"
6
+ aria-valuemax="100"
7
+ class="farm-loader farm-loader--big farm-loader--visible farm-loader--indeterminate"
8
+ >
9
+ <svg
10
+ xmlns="http://www.w3.org/2000/svg"
11
+ viewBox="22.857142857142858 22.857142857142858 45.714285714285715 45.714285714285715"
12
+ style="transform: rotate(0deg)"
9
13
  >
10
- <svg
11
- xmlns="http://www.w3.org/2000/svg"
12
- viewBox="22.857142857142858 22.857142857142858 45.714285714285715 45.714285714285715"
13
- style="transform: rotate(0deg)"
14
- >
15
- <circle
16
- fill="transparent"
17
- cx="45.714285714285715"
18
- cy="45.714285714285715"
19
- r="20"
20
- stroke-dasharray="125.664"
21
- stroke-dashoffset="125.66370614359172px"
22
- class="farm-loader__overlay"
23
- ></circle>
24
- </svg>
25
- <div class="farm-loader__info"></div>
26
- </div>
27
- </div>
28
- <div v-else>
29
- <div
30
- role="progressbar"
31
- aria-valuemin="0"
32
- aria-valuemax="100"
33
- class="farm-loader farm-loader--visible farm-loader--indeterminate"
34
- :class="calculateSize"
35
- >
36
- <svg
37
- xmlns="http://www.w3.org/2000/svg"
38
- viewBox="22.857142857142858 22.857142857142858 45.714285714285715 45.714285714285715"
39
- style="transform: rotate(0deg)"
40
- >
41
- <circle
42
- fill="transparent"
43
- cx="45.714285714285715"
44
- cy="45.714285714285715"
45
- r="20"
46
- stroke-dasharray="125.664"
47
- stroke-dashoffset="125.66370614359172px"
48
- class="farm-loader__overlay"
49
- ></circle>
50
- </svg>
51
- <div class="farm-loader__info"></div>
52
- </div>
14
+ <circle
15
+ fill="transparent"
16
+ cx="45.714285714285715"
17
+ cy="45.714285714285715"
18
+ r="20"
19
+ stroke-dasharray="125.664"
20
+ stroke-dashoffset="125.66370614359172px"
21
+ class="farm-loader__overlay"
22
+ ></circle>
23
+ </svg>
24
+ <div class="farm-loader__info"></div>
53
25
  </div>
54
26
  </div>
27
+ <div
28
+ v-else
29
+ role="progressbar"
30
+ aria-valuemin="0"
31
+ aria-valuemax="100"
32
+ class="farm-loader farm-loader--visible farm-loader--indeterminate"
33
+ :class="calculateSize"
34
+ >
35
+ <svg
36
+ xmlns="http://www.w3.org/2000/svg"
37
+ viewBox="22.857142857142858 22.857142857142858 45.714285714285715 45.714285714285715"
38
+ style="transform: rotate(0deg)"
39
+ >
40
+ <circle
41
+ fill="transparent"
42
+ cx="45.714285714285715"
43
+ cy="45.714285714285715"
44
+ r="20"
45
+ stroke-dasharray="125.664"
46
+ stroke-dashoffset="125.66370614359172px"
47
+ class="farm-loader__overlay"
48
+ ></circle>
49
+ </svg>
50
+ <div class="farm-loader__info"></div>
51
+ </div>
55
52
  </template>
56
53
  <script lang="ts">
57
54
  import Vue from 'vue';
55
+ import { calculateMainZindex } from '../../helpers';
58
56
 
59
57
  export default Vue.extend({
60
58
  name: 'farm-loader',
@@ -69,15 +67,9 @@ export default Vue.extend({
69
67
  },
70
68
  },
71
69
  data() {
72
- const zIndex = Math.max(
73
- ...Array.from(document.querySelectorAll('body *'), el =>
74
- parseFloat(window.getComputedStyle(el).zIndex)
75
- ).filter(zIndex => !Number.isNaN(zIndex)),
76
- 0
77
- );
78
70
  return {
79
71
  styleObject: {
80
- zIndex,
72
+ zIndex: calculateMainZindex(),
81
73
  },
82
74
  };
83
75
  },
@@ -90,5 +82,5 @@ export default Vue.extend({
90
82
  });
91
83
  </script>
92
84
  <style lang="scss" scoped>
93
- @import 'Loader.scss';
85
+ @import 'Loader';
94
86
  </style>
@@ -6,7 +6,6 @@
6
6
  left: 0;
7
7
  width: 100vw;
8
8
  height: 100vh;
9
- z-index: 100;
10
9
  align-items: center;
11
10
  display: flex;
12
11
  justify-content: center;
@@ -1,7 +1,11 @@
1
1
  <template>
2
2
  <transition name="fade">
3
- <div :class="{ 'farm-modal': true, ['farm-modal--size-' + size]: true }" v-if="inputValue">
4
- <div class="farm-modal--container">
3
+ <div
4
+ v-if="inputValue"
5
+ :class="{ 'farm-modal': true, ['farm-modal--size-' + size]: true }"
6
+ :style="styleObject"
7
+ >
8
+ <div class="farm-modal--container teste">
5
9
  <div class="farm-modal--header">
6
10
  <!-- @slot header -->
7
11
  <slot name="header"></slot>
@@ -21,8 +25,10 @@
21
25
  </div>
22
26
  </transition>
23
27
  </template>
28
+
24
29
  <script lang="ts">
25
- import Vue, { PropType, ref, toRefs, watch } from 'vue';
30
+ import Vue, { PropType, reactive, ref, toRefs, watch } from 'vue';
31
+ import { calculateMainZindex } from '../../helpers';
26
32
 
27
33
  export default Vue.extend({
28
34
  name: 'farm-modal',
@@ -57,6 +63,7 @@ export default Vue.extend({
57
63
  setup(props, { emit }) {
58
64
  const { offsetTop, offsetBottom, persistent, size } = toRefs(props);
59
65
  const inputValue = ref(props.value);
66
+ const styleObject = reactive({ zIndex: 1 });
60
67
  const styles = {
61
68
  marginTop: offsetTop.value + 'px',
62
69
  marginBottom: offsetBottom.value + 'px',
@@ -77,7 +84,8 @@ export default Vue.extend({
77
84
  newValue => {
78
85
  inputValue.value = newValue;
79
86
  if (newValue) {
80
- window.addEventListener('keyup', escHandler);
87
+ (styleObject.zIndex = calculateMainZindex()),
88
+ window.addEventListener('keyup', escHandler);
81
89
  }
82
90
  }
83
91
  );
@@ -91,6 +99,7 @@ export default Vue.extend({
91
99
  return {
92
100
  inputValue,
93
101
  styles,
102
+ styleObject,
94
103
  size,
95
104
  close,
96
105
  };
@@ -64,3 +64,18 @@ export const ClickHandler = () => ({
64
64
  <farm-context-menu :items="[{ label: 'Click me', icon: { type: 'open-in-new' }, handler: 'edit' }]" @edit="editItem()" />
65
65
  </div>`,
66
66
  });
67
+
68
+ export const OnRightSide = () => ({
69
+ data() {
70
+ return {
71
+ items: [
72
+ { label: 'Novo', icon: { type: 'open-in-new' } },
73
+ { label: 'Nome bem longo sem quebrar linha', icon: { color: 'secondary', type: 'open-in-new' } },
74
+ { label: 'Remover', icon: { color: 'error', type: 'delete' } },
75
+ ],
76
+ };
77
+ },
78
+ template: `<div style="padding-left: 80px; display: flex; justify-content: end;">
79
+ <farm-context-menu ref="multi" :items="items" />
80
+ </div>`,
81
+ });
@@ -59,4 +59,5 @@
59
59
  font-size: calc(#{$val} - 2px);
60
60
  }
61
61
  }
62
- }
62
+ }
63
+
@@ -0,0 +1,10 @@
1
+ export default () => {
2
+ const zIndex = Math.max(
3
+ ...Array.from(document.querySelectorAll('body *'), el =>
4
+ parseFloat(window.getComputedStyle(el).zIndex)
5
+ ).filter(zIndex => !Number.isNaN(zIndex)),
6
+ 0
7
+ );
8
+
9
+ return zIndex;
10
+ };
@@ -7,7 +7,7 @@ export const defaultFormat = (data, UTCTimeZone = true) => {
7
7
 
8
8
  export const convertDate = (data) => {
9
9
  if(!data) {
10
- return null;
10
+ return '';
11
11
  }
12
12
  let newdate = data.split("/").reverse().join("-");
13
13
  return newdate;
@@ -0,0 +1 @@
1
+ export { default as calculateMainZindex } from './calculateMainZindex';