@farm-investimentos/front-mfe-components 11.5.2 → 11.5.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.5.2",
3
+ "version": "11.5.4",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -84,7 +84,6 @@ export default Vue.extend({
84
84
  }
85
85
  window.addEventListener('click', outClick);
86
86
  window.addEventListener('resize', resizeWindowHandler);
87
-
88
87
  calculatePosition();
89
88
  } else {
90
89
  window.removeEventListener('click', outClick);
@@ -105,17 +104,23 @@ export default Vue.extend({
105
104
 
106
105
  let offsetLeft = activatorBoundingClientRect.left;
107
106
  if (popupClientRect.width > activatorBoundingClientRect.width) {
107
+ const w = popupClientRect.width < 96 ? 96 : popupClientRect.width;
108
108
  offsetLeft =
109
- offsetLeft + activatorBoundingClientRect.width / 2 - popupClientRect.width / 2;
109
+ activatorBoundingClientRect.left +
110
+ activatorBoundingClientRect.width / 2 -
111
+ w / 2;
110
112
  }
113
+
111
114
  styles.minWidth =
112
115
  (activatorBoundingClientRect.width > 96
113
116
  ? parseInt(activatorBoundingClientRect.width)
114
117
  : 96) + 'px';
115
118
 
116
119
  //Do not allow to open outside window
120
+
117
121
  const rightEdge = offsetLeft + popupClientRect.width;
118
122
  const clientWidth = document.documentElement.clientWidth;
123
+
119
124
  if (rightEdge > clientWidth - 12) {
120
125
  offsetLeft = clientWidth - 12 - popupClientRect.width;
121
126
  }
@@ -126,6 +131,7 @@ export default Vue.extend({
126
131
  offsetTop -= bottomEdge - window.scrollY - clientHeight + 12;
127
132
  }
128
133
 
134
+
129
135
  styles.top = `${offsetTop}px`;
130
136
  styles.left = `${offsetLeft}px`;
131
137
  styles.zIndex = calculateMainZindex();
@@ -9,7 +9,8 @@ export default {
9
9
  docs: {
10
10
  description: {
11
11
  component: `CopyToClipboard<br />
12
- selector: <em>farm-copytobclipboard</em>
12
+ selector: <em>farm-copytobclipboard</em><br />
13
+ <span style="color: var(--farm-primary-base);">ready for use</span>
13
14
  `,
14
15
  },
15
16
  },
@@ -30,3 +31,10 @@ export const NoIcon = () => ({
30
31
  <farm-copytoclipboard toCopy="To be copied" :isIcon="false" />
31
32
  </div>`,
32
33
  });
34
+
35
+ export const CustomSuccessMessage = () => ({
36
+ components: { 'farm-copytoclipboard': CopyToClipboard },
37
+ template: `<div style="max-width: 480px; padding-top: 80px; padding-left: 80px;">
38
+ <farm-copytoclipboard toCopy="To be copied" success-message="Custom Succes Message" />
39
+ </div>`,
40
+ });
@@ -28,18 +28,25 @@ export default Vue.extend({
28
28
  * Is button with icon?
29
29
  */
30
30
  isIcon: { type: Boolean, default: true },
31
+ /**
32
+ * Success message content after copy
33
+ */
34
+ successMessage: {
35
+ type: String,
36
+ default: 'Conteúdo copiado para a área de trabalho',
37
+ },
31
38
  },
32
39
  setup(props) {
33
40
  const show = ref(false);
34
41
  const feedbackMessage = ref('');
35
42
  const disabled = ref(false);
36
- const { toCopy, isIcon } = toRefs(props);
43
+ const { toCopy, isIcon, successMessage } = toRefs(props);
37
44
 
38
45
  const onClick = async () => {
39
46
  disabled.value = true;
40
47
  try {
41
48
  await toClipboard(toCopy.value);
42
- feedbackMessage.value = 'Conteúdo copiado para a área de trabalhado';
49
+ feedbackMessage.value = successMessage.value;
43
50
  } catch (e) {
44
51
  feedbackMessage.value = 'Ocorreu um erro: ' + e;
45
52
  }
@@ -48,7 +55,7 @@ export default Vue.extend({
48
55
  setTimeout(() => {
49
56
  show.value = false;
50
57
  disabled.value = false;
51
- }, 1000);
58
+ }, 2000);
52
59
  };
53
60
 
54
61
  return {
@@ -2,7 +2,7 @@
2
2
  @import '../../configurations/mixins';
3
3
 
4
4
  .farm-dialog__footer {
5
- border-top: 1px solid var(--v-gray-lighten2);
5
+ border-top: 1px solid var(--farm-stroke-base);
6
6
  padding: gutter('md');
7
7
  display: flex;
8
8
  flex-direction: row;
@@ -10,7 +10,7 @@
10
10
  }
11
11
 
12
12
  .farm-btn {
13
- margin-left: gutter();
13
+ margin-left: gutter('sm');
14
14
  margin-top: 0;
15
15
 
16
16
  .farm-icon {
@@ -234,4 +234,60 @@ export const DatePickers = () => ({
234
234
  </div>
235
235
  </farm-form>
236
236
  `,
237
+ });
238
+
239
+ export const Grid = () => ({
240
+ data() {
241
+ return {
242
+
243
+ };
244
+ },
245
+ template: `
246
+ <farm-container>
247
+ <farm-form ref="form">
248
+
249
+ <farm-row>
250
+ <farm-col cols="12" md="3">
251
+ <farm-label>Label 1</farm-label>
252
+ <farm-textfield />
253
+ </farm-col>
254
+ <farm-col cols="12" md="3">
255
+ <farm-label>Label 2</farm-label>
256
+ <farm-textfield />
257
+ </farm-col>
258
+ <farm-col cols="12" md="3">
259
+ <farm-label>Label 3</farm-label>
260
+ <farm-textfield />
261
+ </farm-col>
262
+ <farm-col cols="12" md="3">
263
+ <farm-label>Label 4</farm-label>
264
+ <farm-textfield />
265
+ </farm-col>
266
+ <farm-col cols="12" md="6">
267
+ <farm-label>Label 6</farm-label>
268
+ <farm-textfield />
269
+ </farm-col>
270
+ <farm-col cols="12" md="2">
271
+ <farm-label>Label 7</farm-label>
272
+ <farm-textfield />
273
+ </farm-col>
274
+ <farm-col cols="12" md="4">
275
+ <farm-label>Label 4</farm-label>
276
+ <farm-textfield />
277
+ </farm-col>
278
+ </farm-row>
279
+
280
+ <farm-row extra-decrease>
281
+ <farm-container-footer>
282
+ <farm-row>
283
+ <farm-col align="right">
284
+ <farm-btn color="secondary" outlined @click="$refs.form.reset()" class="mr-2">Reset</farm-btn>
285
+ <farm-btn>Salvar</farm-btn>
286
+ </farm-col>
287
+ </farm-row>
288
+ </farm-container-footer>
289
+ </farm-row>
290
+ </farm-form>
291
+ </farm-container>
292
+ `,
237
293
  });
@@ -73,10 +73,8 @@ export const Validate = () => ({
73
73
  v2: '',
74
74
  v3: '',
75
75
  v4: '',
76
- v5: '',
77
76
  rules: {
78
77
  required: value => !!value || 'Required field',
79
- requiredNoMessage: value => !!value || '',
80
78
  email: v =>
81
79
  !v ||
82
80
  /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(v) ||
@@ -88,9 +86,6 @@ export const Validate = () => ({
88
86
  <farm-label required>Required field</farm-label>
89
87
  <farm-textfield-v2 v-model="v1" :rules="[rules.required]" />
90
88
 
91
- <farm-label required>Required field no message</farm-label>
92
- <farm-textfield-v2 v-model="v5" :rules="[rules.requiredNoMessage]" />
93
-
94
89
  <farm-label>E-mail</farm-label>
95
90
  <farm-textfield-v2 v-model="v2" :rules="[rules.email]" />
96
91
 
@@ -208,11 +203,11 @@ export const Mask = () => ({
208
203
  },
209
204
  template: `<div style="width: 480px">
210
205
  <farm-label>CPF Mask ({{ mask }})</farm-label>
211
- <farm-textfield-v2 v-model="v" :v-mask="mask" />
206
+ <farm-textfield-v2 v-model="v" :mask="mask" />
212
207
  v-model: {{ v }}
213
208
 
214
209
  <farm-label>Number Mask (R$ ##.###.###,##)</farm-label>
215
- <farm-textfield-v2 v-model="v2" :v-mask="currencyMask" />
210
+ <farm-textfield-v2 v-model="v2" :mask="currencyMask" />
216
211
  v-model: {{ v2 }}
217
212
 
218
213
  </div>`,
@@ -10,19 +10,27 @@
10
10
  }"
11
11
  >
12
12
  <div class="farm-textfield--input">
13
- <button type="button" v-if="icon && iconPosition === 'left'" @click="$emit('onClickIcon')">
13
+ <button
14
+ type="button"
15
+ v-if="icon && iconPosition === 'left'"
16
+ @click="$emit('onClickIcon')"
17
+ >
14
18
  <farm-icon color="gray" size="20px">{{ icon }}</farm-icon>
15
19
  </button>
16
20
  <input
17
21
  v-bind="$attrs"
18
22
  v-model="innerValue"
19
- v-mask="$props.vMask"
23
+ v-mask="mask"
20
24
  :disabled="disabled"
21
25
  :readonly="readonly"
22
26
  @keyup="onKeyUp"
23
27
  @blur="onBlur"
24
28
  />
25
- <button type="button" v-if="icon && iconPosition === 'right'" @click="$emit('onClickIcon')">
29
+ <button
30
+ type="button"
31
+ v-if="icon && iconPosition === 'right'"
32
+ @click="$emit('onClickIcon')"
33
+ >
26
34
  <farm-icon color="gray" size="20px">{{ icon }}</farm-icon>
27
35
  </button>
28
36
  </div>
@@ -95,7 +103,7 @@ export default Vue.extend({
95
103
  /**
96
104
  * Mask
97
105
  */
98
- vMask: {
106
+ mask: {
99
107
  default: '',
100
108
  type: [String, Function],
101
109
  },
@@ -1,7 +1,7 @@
1
1
  .farm-line {
2
2
  width: 100%;
3
3
  border: none;
4
- border-bottom: 1px solid var(--v-gray-lighten2);
4
+ border-bottom: 1px solid var(--farm-stroke-base);
5
5
  height: 1px;
6
6
  margin-top: 0;
7
7
  &--spacing {
@@ -10,7 +10,7 @@
10
10
  }
11
11
 
12
12
  &.v-input {
13
- &.v-input--dense.v-text-field.v-text-field--outlined {
13
+ &.v-text-field.v-text-field--outlined {
14
14
  .v-input__slot {
15
15
  min-height: 36px !important;
16
16
  height: 36px;
@@ -22,6 +22,15 @@
22
22
  .v-select__selection {
23
23
  font-size: 0.75rem;
24
24
  }
25
+ .v-input__append-inner {
26
+ margin-top: 8px;
27
+ }
28
+ .v-input__prepend-inner {
29
+ margin-top: 8px;
30
+ }
31
+ }
32
+ .v-input__prepend-outer {
33
+ margin-top: 8px;
25
34
  }
26
35
  &.v-input--is-label-active.v-input--is-focused {
27
36
  .v-input__slot fieldset {
@@ -154,3 +163,43 @@
154
163
  }
155
164
  }
156
165
  }
166
+
167
+
168
+ //temporary solution for v-data-table checkboxes
169
+ .v-data-table__checkbox.v-simple-checkbox {
170
+ .v-icon.v-icon {
171
+ font-size: 22px;
172
+ color: var(--farm-neutral-darken);
173
+ &.mdi-checkbox-marked,
174
+ &.mdi-minus-box {
175
+ color: var(--farm-primary-base);
176
+ }
177
+ }
178
+ .v-input--selection-controls__ripple {
179
+ display: none;
180
+ }
181
+ }
182
+
183
+ .v-list.v-select-list.v-sheet.theme--light.v-list--dense.theme--light {
184
+
185
+ .v-list-item.v-list-item--link {
186
+ padding: 8px 12px;
187
+ height: 36px;
188
+ border-bottom: none;
189
+ &:hover {
190
+ background-color: var(--farm-primary-lighten);
191
+ }
192
+ }
193
+ .v-list-item .v-list-item__content {
194
+ padding: 0;
195
+ }
196
+ .v-list-item__title {
197
+ font-weight: 700;
198
+ font-size: 12px;
199
+ color: var(--farm-text-primary);
200
+ line-height: 12px;
201
+ }
202
+ .v-list-item__action:first-child {
203
+ margin-right: 16px;
204
+ }
205
+ }