@farm-investimentos/front-mfe-components-vue3 0.0.9 → 0.0.11

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-vue3",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,7 +32,7 @@ $butonSizes: (
32
32
  height: 36px;
33
33
  min-width: 64px;
34
34
  padding: 0 16px;
35
-
35
+ cursor: pointer;
36
36
  &.farm-btn--full {
37
37
  width: 100%;
38
38
  }
@@ -96,7 +96,7 @@ export default {
96
96
  }) && stayOpen.value;
97
97
 
98
98
  if (activator && !activator.value.contains(event.target) && !isInside) {
99
- emit('input', false);
99
+ emit('update:modelValue', false);
100
100
  inputValue.value = false;
101
101
  }
102
102
  };
@@ -94,7 +94,7 @@ export default {
94
94
  /**
95
95
  * v-model for data-table-select
96
96
  */
97
- value: {
97
+ modelValue: {
98
98
  default: false,
99
99
  },
100
100
  /**
@@ -114,10 +114,10 @@ export default {
114
114
  computed: {
115
115
  inputVal: {
116
116
  get() {
117
- return this.value;
117
+ return this.modelValue;
118
118
  },
119
119
  set(val) {
120
- this.$emit('input', val);
120
+ this.$emit('update:modelValue', val);
121
121
  },
122
122
  },
123
123
  },
@@ -24,7 +24,7 @@ export default {
24
24
  /**
25
25
  * v-model
26
26
  */
27
- value: {
27
+ modelValue: {
28
28
  required: true,
29
29
  },
30
30
  errorMessage: String,
@@ -38,7 +38,7 @@ export default {
38
38
  },
39
39
  setup(props, { emit }) {
40
40
  const { rules } = toRefs(props);
41
- const innerValue = ref(props.value);
41
+ const innerValue = ref(props.modelValue);
42
42
  const { errorBucket, valid, validatable } = validateFormStateBuilder();
43
43
  const isTouched = ref(false);
44
44
 
@@ -51,10 +51,10 @@ export default {
51
51
  const showErrorText = computed(() => hasError.value && isTouched.value);
52
52
 
53
53
  watch(
54
- () => props.value,
54
+ () => props.modelValue,
55
55
  () => {
56
56
  isTouched.value = true;
57
- innerValue.value = props.value;
57
+ innerValue.value = props.modelValue;
58
58
  validate(innerValue.value);
59
59
  }
60
60
  );
@@ -73,7 +73,7 @@ export default {
73
73
 
74
74
  const reset = () => {
75
75
  innerValue.value = null;
76
- emit('input', innerValue.value);
76
+ emit('update:modelValue', innerValue.value);
77
77
  };
78
78
 
79
79
  onBeforeMount(() => {
@@ -103,7 +103,7 @@ export default defineComponent({
103
103
  /**
104
104
  * v-model binding
105
105
  */
106
- value: { type: [String, Number, Array], default: '' },
106
+ modelValue: { type: [String, Number, Array], default: '' },
107
107
  hint: {
108
108
  type: String,
109
109
  default: null,
@@ -280,7 +280,7 @@ export default defineComponent({
280
280
  });
281
281
 
282
282
  watch(
283
- () => props.value,
283
+ () => props.modelValue,
284
284
  newValue => {
285
285
  innerValue.value = newValue;
286
286
  errorBucket.value = [];
@@ -296,7 +296,7 @@ export default defineComponent({
296
296
  }
297
297
  validate(newValue);
298
298
  updateSelectedTextValue();
299
- emit('input', newValue);
299
+ emit('update:modelValue', newValue);
300
300
  }
301
301
  );
302
302
 
@@ -315,7 +315,7 @@ export default defineComponent({
315
315
  isTouched.value = true;
316
316
  isBlured.value = true;
317
317
  validate(innerValue.value);
318
- emit('input', innerValue.value);
318
+ emit('update:modelValue', innerValue.value);
319
319
  }
320
320
  );
321
321
 
@@ -356,7 +356,7 @@ export default defineComponent({
356
356
  innerValue.value = [];
357
357
  return;
358
358
  }
359
- emit('input', innerValue.value);
359
+ emit('update:modelValue', innerValue.value);
360
360
  };
361
361
 
362
362
  const onBlur = (event: Event) => {
@@ -89,7 +89,7 @@ describe('SelectAutoComplet component', () => {
89
89
  { value: 2, text: 'value 2' },
90
90
  { value: 3, text: 'value 3' },
91
91
  ],
92
- value: [0],
92
+ modelValue: [0],
93
93
  });
94
94
 
95
95
  component.addLabelToMultiple();
@@ -104,7 +104,7 @@ describe('SelectAutoComplet component', () => {
104
104
  { value: 2, text: 'value 2' },
105
105
  { value: 3, text: 'value 3' },
106
106
  ],
107
- value: [0, 1],
107
+ modelValue: [0, 1],
108
108
  });
109
109
 
110
110
  component.addLabelToMultiple();
@@ -120,7 +120,7 @@ describe('SelectAutoComplet component', () => {
120
120
  { value: 2, text: 'value 2' },
121
121
  { value: 3, text: 'value 3' },
122
122
  ],
123
- value: [0, 1, 2],
123
+ modelValue: [0, 1, 2],
124
124
  });
125
125
 
126
126
  component.addLabelToMultiple();
@@ -6,12 +6,18 @@
6
6
  @click="toggle"
7
7
  @keydown.space.prevent="toggle"
8
8
  >
9
- <span class="farm-switch__background" :class="backgroundStyles" />
10
- <span class="farm-switch__indicator" :style="indicatorStyles" />
9
+ <span
10
+ class="farm-switch__background"
11
+ :class="backgroundStyles"
12
+ />
13
+ <span
14
+ class="farm-switch__indicator"
15
+ :style="indicatorStyles"
16
+ />
11
17
  </div>
12
18
  </template>
13
19
  <script lang="ts">
14
- import { PropType, computed, ref, watch } from 'vue';
20
+ import { PropType, computed, ref, watch } from 'vue';
15
21
 
16
22
  export default {
17
23
  name: 'farm-switcher',
@@ -39,7 +45,7 @@ export default {
39
45
  /**
40
46
  * v-model binding
41
47
  */
42
- value: {
48
+ modelValue: {
43
49
  type: Boolean,
44
50
  required: true,
45
51
  },
@@ -61,14 +67,14 @@ export default {
61
67
  const isDisabled = ref(props.disabled);
62
68
 
63
69
  const backgroundStyles = computed(() => ({
64
- 'farm-switch--selected': props.value && !isDisabled.value,
65
- 'farm-switch--idle': !props.value && !isDisabled.value,
66
- 'farm-switch--disabled-on': props.value && isDisabled.value,
67
- 'farm-switch--disabled-off': !props.value && isDisabled.value,
70
+ 'farm-switch--selected': props.modelValue && !isDisabled.value,
71
+ 'farm-switch--idle': !props.modelValue && !isDisabled.value,
72
+ 'farm-switch--disabled-on': props.modelValue && isDisabled.value,
73
+ 'farm-switch--disabled-off': !props.modelValue && isDisabled.value,
68
74
  }));
69
75
 
70
76
  const indicatorStyles = computed(() => ({
71
- transform: props.value ? 'translateX(16px)' : 'translateX(0)',
77
+ transform: props.modelValue ? 'translateX(16px)' : 'translateX(0)',
72
78
  }));
73
79
 
74
80
  watch(
@@ -82,7 +88,7 @@ export default {
82
88
  if (isDisabled.value) {
83
89
  return false;
84
90
  }
85
- emit('input', !props.value);
91
+ emit('update:modelValue', !props.modelValue);
86
92
  };
87
93
 
88
94
  return { isDisabled, backgroundStyles, indicatorStyles, toggle };
@@ -74,7 +74,7 @@ export const NoFooter = () => ({
74
74
  methods: {
75
75
  openDialog() {
76
76
  this.$dialog
77
- .confirm(
77
+ .alert(
78
78
  {
79
79
  title: 'Dialog title - No footer',
80
80
  body: 'Dialog content for notifications without footer (must be closed programmatically)',
@@ -4,7 +4,7 @@ export default function (modal: HTMLElement, options: IDialogPromptOptions) {
4
4
  const style = options.alert ? 'color: var(--farm-error-base)!important' : '';
5
5
  const header = document.createElement('div');
6
6
  header.className = 'farm-modal--header';
7
- header.innerHTML = `<header>
7
+ header.innerHTML = `<header class="farm-dialog-header">
8
8
  <p class="farm-typography farm-typography--sm farm-typography--weight-600 farm-caption farm-caption--semiBold" style="${style}">
9
9
  ${options.title}
10
10
  </p>