@farm-investimentos/front-mfe-components 11.4.2 → 11.4.4

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.4.2",
3
+ "version": "11.4.4",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -1,5 +1,10 @@
1
1
  <template>
2
- <div>alertbox</div>
2
+ <div>
3
+ <!--
4
+ @slot Use this slot for the content
5
+ -->
6
+ <slot></slot>
7
+ </div>
3
8
  </template>
4
9
 
5
10
  <script lang="ts">
@@ -13,7 +13,7 @@
13
13
  </farm-typography>
14
14
  </div>
15
15
  <div class="collapsible__icon collapsible__icon--arrow">
16
- <farm-icon size="md" color="primary">
16
+ <farm-icon size="md" color="secondary">
17
17
  {{ arrowIcon }}
18
18
  </farm-icon>
19
19
  </div>
@@ -42,12 +42,16 @@ export default Vue.extend({
42
42
  required: true,
43
43
  },
44
44
  /**
45
- * Icon
45
+ * Icon (from Material Icons)
46
+ * Example: chart-bar
46
47
  */
47
48
  icon: {
48
49
  type: String,
49
50
  default: '',
50
51
  },
52
+ /**
53
+ * Is open?
54
+ */
51
55
  open: {
52
56
  type: Boolean,
53
57
  default: false,
@@ -29,7 +29,8 @@ export default Vue.extend({
29
29
  name: 'farm-idcaption',
30
30
  props: {
31
31
  /**
32
- * Icon
32
+ * Icon (from Material Icons)
33
+ * Example: chart-bar
33
34
  */
34
35
  icon: {
35
36
  type: String,
@@ -27,6 +27,10 @@
27
27
 
28
28
  color: var(--farm-text-primary);
29
29
 
30
+ &--lighten {
31
+ color: var(--farm-text-secondary);
32
+ }
33
+
30
34
  @each $k in $theme-colors-list {
31
35
  &#{'[color=' + $k + ']'} {
32
36
  color: var(--farm-#{$k}-base);
@@ -108,7 +108,7 @@ export const Colors = () => ({
108
108
  export const ColorsLighten = () => ({
109
109
  data() {
110
110
  return {
111
- colors: [ ...colors, 'white'],
111
+ colors: ['default', ...colors, 'white'],
112
112
  };
113
113
  },
114
114
  template: `<div>
@@ -6,6 +6,7 @@
6
6
  flex-basis: 0;
7
7
  flex-grow: 1;
8
8
  max-width: 100%;
9
+ width: 100;
9
10
 
10
11
  &--no-gutters {
11
12
  padding: 0;
@@ -13,11 +14,18 @@
13
14
 
14
15
  @each $k in $aligns {
15
16
  &#{'--align-' + $k} {
16
- align-self: $k!important;
17
+ align-self: $k !important;
17
18
  }
18
19
  }
19
20
  }
20
21
 
22
+ @for $i from 1 through 12 {
23
+ .farm-col--cols-#{$i * 1} {
24
+ flex: 0 0 (100/12 * $i)+#{"%"};
25
+ max-width: (100/12 * $i)+#{"%"};
26
+ }
27
+ }
28
+
21
29
  @for $i from 1 through 12 {
22
30
  .farm-col--xs-#{$i * 1} {
23
31
  flex: 0 0 (100/12 * $i)+#{"%"};
@@ -22,51 +22,64 @@ const style = {
22
22
  backgroundColor: 'var(--farm-extra-1-lighten)',
23
23
  };
24
24
 
25
+ const items = Array.from(Array(12).keys());
26
+
25
27
  export const Primary = () => ({
26
28
  data() {
27
29
  return {
28
30
  style,
29
31
  };
30
32
  },
31
- template: '<farm-col :style="style">col</farm-col>',
33
+ template: `<farm-col>
34
+ <farm-col :style="style">col</farm-col>
35
+ </farm-col>`,
32
36
  });
33
- export const Xl = () => ({
37
+
38
+ export const Cols = () => ({
34
39
  data() {
35
40
  return {
36
41
  style,
42
+ items
37
43
  };
38
44
  },
39
45
  template: `<farm-row>
40
- <farm-col xl="4" :style="style">4</farm-col>
41
- <farm-col xl="6" :style="style">6</farm-col>
42
- <farm-col xl="12" :style="style">12</farm-col>
43
- <farm-col xl="2" :style="style">2</farm-col>
46
+ <farm-col v-for="item in items" :key="'col_' + item" :cols="item + 1" :style="style">{{item + 1}}</farm-col>
44
47
  </farm-row>`,
45
48
  });
49
+
50
+ export const Xl = () => ({
51
+ data() {
52
+ return {
53
+ style,
54
+ items
55
+ };
56
+ },
57
+ template: `<farm-row>
58
+ <farm-col v-for="item in items" :key="'xl_' + item" :xl="item + 1" :style="style">{{item + 1}}</farm-col>
59
+ </farm-row>`,
60
+ });
61
+
46
62
  export const Lg = () => ({
47
63
  data() {
48
64
  return {
49
65
  style,
66
+ items
50
67
  };
51
68
  },
52
69
  template: `<farm-row>
53
- <farm-col lg="4" :style="style">4</farm-col>
54
- <farm-col lg="6" :style="style">6</farm-col>
55
- <farm-col lg="12" :style="style">12</farm-col>
56
- <farm-col lg="2" :style="style">2</farm-col>
57
- </farm-row>`,
70
+ <farm-col v-for="item in items" :key="'lg_' + item" :lg="item + 1" :style="style">{{item + 1}}</farm-col>
71
+ </farm-row>`,
58
72
  });
73
+
59
74
  export const Md = () => ({
60
75
  data() {
61
76
  return {
62
77
  style,
78
+ items
63
79
  };
64
80
  },
65
81
  template: `<farm-row>
66
- <farm-col md="4" :style="style">4</farm-col>
67
- <farm-col md="6" :style="style">6</farm-col>
68
- <farm-col md="12" :style="style">12</farm-col>
69
- <farm-col md="2" :style="style">2</farm-col>
82
+ <farm-col v-for="item in items" :key="'md_' + item" :md="item + 1" :style="style">{{item + 1}}</farm-col>
70
83
  </farm-row>`,
71
84
  });
72
85
 
@@ -74,13 +87,11 @@ export const Sm = () => ({
74
87
  data() {
75
88
  return {
76
89
  style,
90
+ items
77
91
  };
78
92
  },
79
93
  template: `<farm-row>
80
- <farm-col sm="4" :style="style">4</farm-col>
81
- <farm-col sm="6" :style="style">6</farm-col>
82
- <farm-col sm="12" :style="style">12</farm-col>
83
- <farm-col sm="2" :style="style">2</farm-col>
94
+ <farm-col v-for="item in items" :key="'sm_' + item" :sm="item + 1" :style="style">{{item + 1}}</farm-col>
84
95
  </farm-row>`,
85
96
  });
86
97
 
@@ -88,14 +99,12 @@ export const Xs = () => ({
88
99
  data() {
89
100
  return {
90
101
  style,
102
+ items
91
103
  };
92
104
  },
93
105
  template: `<farm-row>
94
- <farm-col xs="4" :style="style">4</farm-col>
95
- <farm-col xs="6" :style="style">6</farm-col>
96
- <farm-col xs="12" :style="style">12</farm-col>
97
- <farm-col xs="2" :style="style">2</farm-col>
98
- </farm-row>`,
106
+ <farm-col v-for="item in items" :key="'xs_' + item" :xs="item + 1" :style="style">{{item + 1}}</farm-col>
107
+ </farm-row>`,
99
108
  });
100
109
 
101
110
  export const Combination = () => ({
@@ -105,7 +114,7 @@ export const Combination = () => ({
105
114
  };
106
115
  },
107
116
  template: `<div>
108
- <farm-col lg="5" md="4" sm="3" :style="style">lg: 5 - md: 4 - sm: 3</farm-col>
117
+ <farm-col cols="9" lg="5" md="4" sm="3" :style="style">lg: 5 - md: 4 - sm: 3</farm-col>
109
118
  </div>`,
110
119
  });
111
120
  export const TagP = () => ({
@@ -9,6 +9,7 @@
9
9
  [`farm-col--md-${md}`]: md,
10
10
  [`farm-col--sm-${sm}`]: sm,
11
11
  [`farm-col--xs-${xs}`]: xs,
12
+ [`farm-col--cols-${cols}`]: cols,
12
13
  'farm-col--no-gutters': noGutters,
13
14
  }"
14
15
  >
@@ -25,6 +26,13 @@ export default Vue.extend({
25
26
  * Html tag
26
27
  */
27
28
  tag: { type: String, default: 'div' },
29
+ /**
30
+ * Sets the default number of columns the component extends
31
+ */
32
+ cols: {
33
+ type: [String, Number] as PropType<1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12>,
34
+ default: null,
35
+ },
28
36
  /**
29
37
  * Extra-large breakpoint
30
38
  */