@farm-investimentos/front-mfe-components 11.8.0 → 11.8.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.
@@ -18,7 +18,7 @@
18
18
  clickable
19
19
  hoverColorVariation="lighten"
20
20
  hover-color="primary"
21
- :key="'contextmenu_item_' + item.text"
21
+ :key="'contextmenu_item_' + item[itemText]"
22
22
  :class="{ 'farm-listitem--selected': item[itemValue] === innerValue }"
23
23
  @click="selectItem(item)"
24
24
  >
@@ -165,6 +165,7 @@ export default Vue.extend({
165
165
 
166
166
  onBeforeMount(() => {
167
167
  validate(innerValue.value);
168
+
168
169
  const selectedItem = items.value.find(
169
170
  item => item[itemValue.value] === innerValue.value
170
171
  );
@@ -31,5 +31,10 @@ describe('Select component', () => {
31
31
  component.onBlur();
32
32
  expect(component.isBlured).toBeTruthy();
33
33
  });
34
+
35
+ it('clickInput', () => {
36
+ component.clickInput();
37
+ expect(component.isTouched).toBeTruthy();
38
+ });
34
39
  });
35
40
  });
@@ -1,17 +1,7 @@
1
- .v-list-item.v-list-item--link {
2
- border-bottom: 1px solid var(--farm-stroke-base);
3
- }
4
-
5
- .v-list-item__title {
6
- display: flex;
7
- align-items: center;
8
-
9
-
10
- }
11
-
12
- ::v-deep .v-application--wrap {
13
- min-height: auto;
14
- font-family: 'Montserrat', sans-serif !important;
1
+ .farm-context-menu {
2
+ &--disabled {
3
+ pointer-events: none;
4
+ }
15
5
  }
16
6
 
17
7
  .farm-listitem {
@@ -21,4 +11,4 @@
21
11
  vertical-align: sub;
22
12
  margin-right: 8px;
23
13
  }
24
- }
14
+ }
@@ -28,6 +28,12 @@ export const Primary = () => ({
28
28
  </div>`,
29
29
  });
30
30
 
31
+ export const Disabled = () => ({
32
+ template: `<div style="padding-left: 80px">
33
+ <farm-context-menu disabled :items="[{ label: 'Remover', icon: { color: 'error', type: 'open-in-new' } }]" />
34
+ </div>`,
35
+ });
36
+
31
37
  export const Icons = () => ({
32
38
  template: `<div style="padding-left: 80px">
33
39
  <farm-context-menu
@@ -70,7 +76,10 @@ export const OnRightSide = () => ({
70
76
  return {
71
77
  items: [
72
78
  { label: 'Novo', icon: { type: 'open-in-new' } },
73
- { label: 'Nome bem longo sem quebrar linha', icon: { color: 'secondary', type: 'open-in-new' } },
79
+ {
80
+ label: 'Nome bem longo sem quebrar linha',
81
+ icon: { color: 'secondary', type: 'open-in-new' },
82
+ },
74
83
  { label: 'Remover', icon: { color: 'error', type: 'delete' } },
75
84
  ],
76
85
  };
@@ -78,4 +87,4 @@ export const OnRightSide = () => ({
78
87
  template: `<div style="padding-left: 80px; display: flex; justify-content: end;">
79
88
  <farm-context-menu ref="multi" :items="items" />
80
89
  </div>`,
81
- });
90
+ });
@@ -1,7 +1,16 @@
1
1
  <template>
2
- <farm-contextmenu v-model="value">
3
- <template v-slot:activator="{}">
4
- <farm-btn icon @click="toggleValue" title="Abrir opções" color="secondary">
2
+ <farm-contextmenu
3
+ :class="{ 'farm-context-menu': true, 'farm-context-menu--disabled': disabled }"
4
+ v-model="value"
5
+ >
6
+ <template v-slot:activator>
7
+ <farm-btn
8
+ icon
9
+ title="Abrir opções"
10
+ color="secondary"
11
+ :disabled="disabled"
12
+ @click="toggleValue"
13
+ >
5
14
  <farm-icon size="md">dots-horizontal</farm-icon>
6
15
  </farm-btn>
7
16
  </template>
@@ -47,6 +56,13 @@ export default Vue.extend({
47
56
  type: Array as PropType<Array<IContextMenuOption>>,
48
57
  required: true,
49
58
  },
59
+ /**
60
+ * Is disabled?
61
+ */
62
+ disabled: {
63
+ type: Boolean,
64
+ default: false,
65
+ },
50
66
  },
51
67
  data() {
52
68
  return {
@@ -22,6 +22,11 @@
22
22
  color: var(--farm-text-primary);
23
23
  font-size: 12px;
24
24
  font-weight: 400;
25
+ max-width: 100%;
26
+ }
27
+
28
+ &--iconed>input {
29
+ max-width: calc(100% - 32px);
25
30
  }
26
31
 
27
32
  width: 100%;
@@ -10,7 +10,10 @@
10
10
  'farm-textfield--disabled': disabled,
11
11
  }"
12
12
  >
13
- <div class="farm-textfield--input">
13
+ <div :class="{
14
+ 'farm-textfield--input': true,
15
+ 'farm-textfield--input--iconed': icon
16
+ }">
14
17
  <button
15
18
  type="button"
16
19
  v-if="icon && iconPosition === 'left'"