@farm-investimentos/front-mfe-components 11.11.0 → 11.11.2

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": "11.11.0",
3
+ "version": "11.11.2",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -68,7 +68,7 @@ ul.farm-paginator {
68
68
  }
69
69
  }
70
70
 
71
- .v-data-table-custom-footer {
71
+ .farm-paginator-footer{
72
72
  display: flex;
73
73
  flex-direction: row;
74
74
  justify-content: space-between;
@@ -23,28 +23,27 @@ export default {
23
23
  };
24
24
 
25
25
  export const Primary = () => ({
26
- data() {
27
- return {
28
- totalPages: 8,
29
- };
30
- },
31
- template: '<farm-datatable-paginator :totalPages="totalPages" :page="1" />',
32
- mounted() {
33
- setTimeout(() => {
34
- this.totalPages = 2;
35
- }, 1000);
36
- },
26
+ template: '<farm-datatable-paginator :totalPages="190000" :page="1" />',
37
27
  });
38
28
 
39
- export const Secondary = () => ({
29
+ export const HidePerPageOptions = () => ({
40
30
  template: '<farm-datatable-paginator :hidePerPageOptions="true" :totalPages="190000" :page="1" />',
41
31
  });
42
32
 
43
33
  export const Disabled = () => ({
44
- template: '<farm-datatable-paginator :disabled="true":totalPages="19" :page="1" />',
34
+ template: '<farm-datatable-paginator :disabled="true" :totalPages="19" :page="1" />',
45
35
  });
46
36
 
47
37
  export const CustomPerPage = () => ({
48
38
  template:
49
- '<farm-datatable-paginator :perPageOptions="[1, 2, 4, 12, 27]" :totalPages="19" :page="1" />',
39
+ '<farm-datatable-paginator :perPageOptions="[1, 2, 4, 12, 27]" :initialLimitPerPage="2" :totalPages="19" :page="1" />',
40
+ });
41
+
42
+ export const OnChangeLimitPerPage = () => ({
43
+ methods: {
44
+ onChangeLimitPerPage: (newValue) => {
45
+ alert(newValue);
46
+ }
47
+ },
48
+ template: '<farm-datatable-paginator :totalPages="19" :page="1" @onChangeLimitPerPage="onChangeLimitPerPage" />',
50
49
  });
@@ -1,19 +1,17 @@
1
1
  <template>
2
2
  <section
3
3
  :class="{
4
- 'v-data-table-custom-footer': true,
4
+ 'farm-paginator-footer': true,
5
5
  'hidden-perpageoptions': hidePerPageOptions,
6
6
  'farm-paginator--gutter': hasGutter,
7
7
  }"
8
8
  >
9
9
  <div v-if="!hidePerPageOptions">
10
- <v-select
11
- outlined
10
+ <farm-select
12
11
  v-model="selectedLimit"
13
- :disabled="!totalPages || totalPages < 1"
12
+ :disabled="disabled || !totalPages || totalPages < 1"
14
13
  :items="perPageBuiltItems"
15
- dense
16
- ></v-select>
14
+ />
17
15
  </div>
18
16
 
19
17
  <ul
@@ -61,7 +59,6 @@
61
59
  </template>
62
60
  <script lang="ts">
63
61
  import Vue from 'vue';
64
- import { VSelect } from 'vuetify/lib/components/VSelect';
65
62
 
66
63
  /**
67
64
  * Componente de paginação usado em tabelas e listas
@@ -69,49 +66,49 @@ import { VSelect } from 'vuetify/lib/components/VSelect';
69
66
  */
70
67
  export default Vue.extend({
71
68
  name: 'farm-datatable-paginator',
72
- components: {
73
- VSelect,
74
- },
75
69
  props: {
76
70
  /**
77
- * Lista de opções para o controle de registros por página
71
+ * Ietms per page list
78
72
  */
79
73
  perPageOptions: {
80
74
  type: Array,
81
75
  default: () => [5, 10, 20, 50, 100],
82
76
  },
83
77
  /**
84
- * Páginas atual
78
+ * Current page
85
79
  */
86
80
  page: null,
87
81
  /**
88
- * Total de páginas
82
+ * Total pages
89
83
  */
90
84
  totalPages: {
91
85
  type: Number,
92
86
  default: null,
93
87
  },
94
88
  /**
95
- * Desabilita controles
89
+ * DDisable controls
96
90
  */
97
91
  disabled: {
98
92
  type: Boolean,
99
93
  default: false,
100
94
  },
101
95
  /**
102
- * Esconde controle de registros por página
96
+ * Hide items per page select
103
97
  */
104
98
  hidePerPageOptions: {
105
99
  type: Boolean,
106
100
  default: false,
107
101
  },
108
102
  /**
109
- * Valor inicial de limite por página
103
+ * Items per page initial value
110
104
  */
111
105
  initialLimitPerPage: {
112
106
  type: Number,
113
107
  default: 10,
114
108
  },
109
+ /**
110
+ * Toggle gutters
111
+ */
115
112
  hasGutter: {
116
113
  type: Boolean,
117
114
  default: true,
@@ -213,7 +210,6 @@ export default Vue.extend({
213
210
  this.selectedLimit = newValue;
214
211
  },
215
212
  },
216
-
217
213
  });
218
214
  </script>
219
215
 
@@ -1,6 +1,6 @@
1
1
  .idcaption {
2
2
  display: flex;
3
-
3
+ min-height: 48px;
4
4
  .farm-icon-box {
5
5
  margin-right: 8px;
6
6
  }
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="idcaption">
2
+ <div class="idcaption farm-idcaption">
3
3
  <farm-icon-box v-if="icon" :icon="icon" :color="iconBoxColor" size="md" />
4
4
  <div
5
5
  :class="{ idcaption__body: true, 'idcaption__body--single': !hasTitle || !hasSubtitle }"
@@ -4,6 +4,7 @@ interface ILoggerItem {
4
4
  formattedDate: string;
5
5
  message: string;
6
6
  status: string;
7
+ extraMessage?: string;
7
8
  details: Function;
8
9
  }
9
10
 
@@ -56,7 +56,8 @@
56
56
  }
57
57
 
58
58
  .logger__date,
59
- .logger__username {
59
+ .logger__username,
60
+ .logger__extramessage {
60
61
  font-size: 10px;
61
62
  font-weight: 400;
62
63
  }
@@ -74,6 +74,20 @@ export const Info = () => ({
74
74
  template: `<farm-logger-item :item="item" />`,
75
75
  });
76
76
 
77
+ export const ExtraMessage = () => ({
78
+ data() {
79
+ return {
80
+ item: {
81
+ message: 'Recusado entre as pré elegíveis',
82
+ extraMessage: 'More text',
83
+ formattedDate: '13/06/2022 20:40',
84
+ status: 'info',
85
+ },
86
+ };
87
+ },
88
+ template: `<farm-logger-item :item="item" />`,
89
+ });
90
+
77
91
  export const CustomIcon = () => ({
78
92
  data() {
79
93
  return {
@@ -13,10 +13,13 @@
13
13
  <span class="logger__message">
14
14
  {{ item.message }}
15
15
  </span>
16
- <span class="logger__username">
16
+ <span v-if="item.userName" class="logger__username">
17
17
  <i class="mdi mdi-account-circle" />
18
18
  {{ item.userName }}
19
19
  </span>
20
+ <span class="logger__extramessage">
21
+ {{ item.extraMessage }}
22
+ </span>
20
23
  </div>
21
24
  <farm-btn
22
25
  v-if="hasDetails"
@@ -32,6 +35,7 @@
32
35
  <script lang="ts">
33
36
  import Vue, { PropType } from 'vue';
34
37
  import ILoggerItem from './ILoggerItem';
38
+ import mappingIconKeys from './mappingIconKeys';
35
39
 
36
40
  export default Vue.extend({
37
41
  name: 'farm-logger-item',
@@ -40,6 +44,7 @@ export default Vue.extend({
40
44
  * Logger item
41
45
  */
42
46
  item: { required: true, type: Object as PropType<ILoggerItem> },
47
+ customIcon: { type: String, required: false },
43
48
  },
44
49
  methods: {
45
50
  callDetails(): void {
@@ -54,7 +59,8 @@ export default Vue.extend({
54
59
  if (!this.item.status) {
55
60
  return '';
56
61
  }
57
- return `${this.item.status === 'success' ? 'check' : 'close'}`;
62
+
63
+ return this.item.status ? mappingIconKeys[this.item.status] : 'error';
58
64
  },
59
65
  buttonColor(): string {
60
66
  if (this.item.status === 'success') {
@@ -0,0 +1,5 @@
1
+ export default {
2
+ success: 'check',
3
+ info: 'timer-sand',
4
+ error: 'close',
5
+ };
@@ -28,6 +28,10 @@ export const CustomLabel = () => ({
28
28
  template: '<farm-form-mainfilter label="Custom" />',
29
29
  });
30
30
 
31
+ export const WithSlot = () => ({
32
+ template: '<farm-form-mainfilter>With Slot</farm-form-mainfilter>',
33
+ });
34
+
31
35
  export const MainFilters = () => ({
32
36
  data() {
33
37
  return {
@@ -2,7 +2,8 @@
2
2
  <section :class="{ 'justify-end': justifyEnd === true }">
3
3
  <fieldset v-if="hasInitialInput">
4
4
  <farm-label :for="elementId">
5
- {{ label }}
5
+ {{ !hasSlotData ? label : '' }}
6
+ <slot v-if="hasSlotData"></slot>
6
7
  <farm-tooltip v-if="tooltip">
7
8
  <farm-caption color="white">
8
9
  {{ tooltip }}
@@ -86,6 +87,9 @@ export default Vue.extend({
86
87
  },
87
88
  },
88
89
  computed: {
90
+ hasSlotData() {
91
+ return this.$slots.default;
92
+ },
89
93
  extraFiltersBtnLabel() {
90
94
  return `${this.showFilters ? 'Esconder' : 'Ver'} Filtros`;
91
95
  },
@@ -1,4 +1,4 @@
1
- .farm-subtitle {
1
+ .farm-bodytext {
2
2
  &--1 {
3
3
  letter-spacing: 0.5px;
4
4
  }
@@ -3,7 +3,7 @@
3
3
  :weight="weight"
4
4
  :size="size"
5
5
  :key="key"
6
- :class="{ [`farm-subtitle--${type}`]: true, [`farm-subtitle--${variation}`]: true }"
6
+ :class="{ [`farm-bodytext--${type}`]: true, [`farm-bodytext--${variation}`]: true }"
7
7
  v-bind="$attrs"
8
8
  >
9
9
  <slot></slot>
@@ -35,7 +35,7 @@ export const Structure = () => ({
35
35
  <farm-row>
36
36
  <farm-col md="6" lg="3">
37
37
  coluna 1
38
- </farm-col>›
38
+ </farm-col>
39
39
  <farm-col md="6" lg="3">
40
40
  coluna 2
41
41
  </farm-col>
@@ -46,6 +46,28 @@ export const Structure = () => ({
46
46
  coluna 4
47
47
  </farm-col>
48
48
  </farm-row>
49
+
50
+ <farm-row>
51
+ <farm-col lg="2">
52
+ coluna 1
53
+ </farm-col>
54
+ <farm-col lg="2">
55
+ coluna 2
56
+ </farm-col>
57
+ <farm-col lg="2">
58
+ coluna 3
59
+ </farm-col>
60
+ <farm-col lg="2">
61
+ coluna 4
62
+ </farm-col>
63
+ <farm-col lg="2">
64
+ coluna 5
65
+ </farm-col>
66
+ <farm-col lg="2">
67
+ coluna 6
68
+ </farm-col>
69
+ </farm-row>
70
+
49
71
  <farm-row :extra-decrease="true">
50
72
  <farm-container-footer>
51
73
  Footer content