@farm-investimentos/front-mfe-components 3.4.8 → 3.4.9

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": "3.4.8",
3
+ "version": "3.4.9",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -26,4 +26,26 @@ export const Primary = () => ({
26
26
  </div>`,
27
27
  });
28
28
 
29
- Primary.storyName = 'Básico';
29
+ export const InitialValue = () => ({
30
+ components: { SelectModalOptions },
31
+ data() {
32
+ return {
33
+ items: [
34
+ { id: 1, name: 'name 1' },
35
+ { id: 2, name: 'name 2' },
36
+ ],
37
+ selectedValue: 23123,
38
+ };
39
+ },
40
+ template: `<div>
41
+ <SelectModalOptions
42
+ :items="items"
43
+ v-model="selectedValue"
44
+ label="label"
45
+ inputId="some-id" />
46
+ <br />selected value: {{ selectedValue }}
47
+ </div>`,
48
+ });
49
+
50
+ Primary.storyName = 'Basic';
51
+ InitialValue.storyName = 'Initial value';
@@ -13,7 +13,7 @@
13
13
  :id="inputId"
14
14
  :value="selectedValueText"
15
15
  @click="openModal"
16
- ></v-text-field>
16
+ />
17
17
 
18
18
  <v-dialog content-class="modal-default modal-default-small" v-model="showModal">
19
19
  <DialogHeader class="dialog-header" :title="modalTitle" @onClose="closeModal" />
@@ -229,6 +229,9 @@ export default Vue.extend({
229
229
  this.pagination.pages = Math.ceil(newValue.length / 10);
230
230
  },
231
231
  },
232
+ mounted() {
233
+ this.selectedItem = { [this.itemLabelFormatter]: this.value };
234
+ },
232
235
  methods: {
233
236
  handlePagination(tablePagination) {
234
237
  if (
@@ -23,6 +23,7 @@ describe('SelectModalOptions component', () => {
23
23
 
24
24
  test('SelectModalOptions created', () => {
25
25
  expect(wrapper).toBeDefined();
26
+ expect(component.selectedValueText).toEqual(1);
26
27
  });
27
28
 
28
29
  describe('Methods', () => {