@farm-investimentos/front-mfe-components 9.2.2 → 9.2.3

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.2",
3
+ "version": "9.2.3",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -12,6 +12,12 @@
12
12
  text-align: center;
13
13
  align-items: center;
14
14
  color: white;
15
+ width: 100%;
16
+
17
+ &--dense {
18
+ min-width: auto;
19
+ width: max-content;
20
+ }
15
21
 
16
22
  .farm-typography {
17
23
  width: 100%;
@@ -10,8 +10,15 @@ export default {
10
10
  };
11
11
 
12
12
  export const Primary = () => ({
13
- template: `<div>
14
- <farm-chip color="info">Chip</farm-chip>
13
+ template: `<div class="chips-container">
14
+ <farm-chip color="info">Chip (100% width)</farm-chip>
15
+ </div>`,
16
+ });
17
+
18
+ export const Dense = () => ({
19
+ template: `<div class="chips-container">
20
+ <farm-chip color="info" :dense="true">prop</farm-chip>
21
+ <farm-chip color="secondary" dense>attribute</farm-chip>
15
22
  </div>`,
16
23
  });
17
24
 
@@ -1,7 +1,7 @@
1
1
  .chips-container {
2
2
  display: flex;
3
3
  flex-direction: column;
4
- max-width: 160px;
4
+ max-width: 320px;
5
5
 
6
6
  > .farm-chip {
7
7
  margin-bottom: 16px;
@@ -1,8 +1,6 @@
1
1
  <template>
2
- <span :class="{ 'farm-chip': true }">
3
- <farm-typography tag="span" size="sm">
4
- <slot></slot>
5
- </farm-typography>
2
+ <span :class="{ 'farm-chip': true, 'farm-chip--dense': dense }">
3
+ <farm-typography tag="span" size="sm"> <slot></slot> </farm-typography>
6
4
  </span>
7
5
  </template>
8
6
  <script lang="ts">
@@ -11,6 +9,15 @@ import Vue from 'vue';
11
9
  export default Vue.extend({
12
10
  name: 'farm-chip',
13
11
  inheritAttrs: true,
12
+ props: {
13
+ /**
14
+ * Is dense (not 100% width)?
15
+ */
16
+ dense: {
17
+ type: Boolean,
18
+ default: false,
19
+ },
20
+ },
14
21
  });
15
22
  </script>
16
23
  <style lang="scss" scoped>
@@ -25,13 +25,13 @@ export const Primary = () => ({
25
25
  components: { DataTablePaginator },
26
26
  data() {
27
27
  return {
28
- totalPages: null
28
+ totalPages: 8
29
29
  };
30
30
  },
31
31
  template: '<DataTablePaginator :totalPages="totalPages" :page="1" />',
32
32
  mounted() {
33
33
  setTimeout(() => {
34
- this.totalPages = 2;
34
+ this.totalPages = 0;
35
35
  }, 1000);
36
36
  }
37
37
  });
@@ -16,9 +16,9 @@
16
16
  ></v-select>
17
17
  </div>
18
18
 
19
- <ul :class="{ 'farm-paginator': true, 'farm-paginator--disabled': disabled }">
19
+ <ul :class="{ 'farm-paginator': true, 'farm-paginator--disabled': disabled || totalPages == null }">
20
20
  <li>
21
- <button :disabled="currentPage === 1 || disabled" @click="previousPage">
21
+ <button :disabled="currentPage === 1 || disabled || totalPages == null" @click="previousPage">
22
22
  <farm-icon color="gray" size="sm">chevron-left</farm-icon>
23
23
  </button>
24
24
  </li>
@@ -37,7 +37,7 @@
37
37
  </li>
38
38
 
39
39
  <li>
40
- <button :disabled="currentPage === totalPages || disabled" @click="nextPage">
40
+ <button :disabled="currentPage === totalPages || disabled || totalPages == null || totalPages === 0" @click="nextPage">
41
41
  <farm-icon color="gray" size="sm">chevron-right</farm-icon>
42
42
  </button>
43
43
  </li>
@@ -70,7 +70,10 @@ export default Vue.extend({
70
70
  /**
71
71
  * Total de páginas
72
72
  */
73
- totalPages: null,
73
+ totalPages: {
74
+ type: Number,
75
+ default: null,
76
+ },
74
77
  /**
75
78
  * Desabilita controles
76
79
  */