@vcita/design-system 1.3.2 → 1.3.3

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.
@@ -138,4 +138,32 @@ describe("VcRadioGroup.vue", () => {
138
138
  expect(customDataQaEl).toBeInTheDocument();
139
139
  });
140
140
 
141
+ it("passing disabled prop transfers to radio", async () => {
142
+ const {container, getByTestId } = renderWithVuetify(VcRadioGroup, {
143
+ props: {
144
+ dataQa: 'vc-radio-group',
145
+ items: generalItems,
146
+ value: 'all_of_em',
147
+ disabled: true
148
+ }
149
+ })
150
+
151
+ const currentSelected = getByTestId('radio-all_of_em');
152
+ expect(currentSelected.parentElement.parentElement).toHaveClass("v-radio--is-disabled")
153
+ });
154
+
155
+ it("renders as horizontal", async () => {
156
+ const {container, getByTestId } = renderWithVuetify(VcRadioGroup, {
157
+ props: {
158
+ dataQa: 'vc-radio-group',
159
+ items: generalItems,
160
+ value: 'all_of_em',
161
+ isHorizontal: true,
162
+ }
163
+ })
164
+
165
+ const VcRadioGroupCmp = container.querySelector('.vc-radio-buttons');
166
+ expect(VcRadioGroupCmp).toHaveClass('v-input--radio-group--row');
167
+ });
168
+
141
169
  });
@@ -54,6 +54,7 @@ const GeneralTemplate = (args, {argTypes}) => ({
54
54
  :data-qa="dataQa"
55
55
  @change="onChange"
56
56
  :disabled="disabled"
57
+ :is-horizontal="isHorizontal"
57
58
  >
58
59
  <template v-slot:label-custom>
59
60
  custom label by using a slot!
@@ -72,7 +73,8 @@ Playground.args = {
72
73
  items: generalItems,
73
74
  dataQa: 'VcRadioGroup',
74
75
  title: 'radio group title',
75
- disabled: false
76
+ disabled: false,
77
+ isHorizontal: false
76
78
  }
77
79
 
78
80
  export default {
@@ -7,7 +7,8 @@
7
7
  :value="value"
8
8
  @change="val => $emit('change', val)"
9
9
  hide-details="auto"
10
- class="vc-radio-buttons">
10
+ class="vc-radio-buttons"
11
+ :row="isHorizontal">
11
12
  <VcRadio v-bind="item" v-for="item in items" :key="item.value" :disabled="disabled">
12
13
  <template v-slot:label>
13
14
  <slot :name="`label-${item.value}`"></slot>
@@ -56,6 +57,10 @@ export default {
56
57
  disabled: {
57
58
  type: Boolean,
58
59
  default: false
60
+ },
61
+ isHorizontal: {
62
+ type: Boolean,
63
+ default: false
59
64
  }
60
65
  },
61
66
 
@@ -274,4 +274,17 @@ describe("VcTextField.vue", () => {
274
274
  userEvent.click(textField);
275
275
  expect(emitted().click.length).toBe(1);
276
276
  });
277
+
278
+ it("emitted onKeydownEnter event", () => {
279
+ const {getByTestId, emitted} = renderWithVuetify(VcTextField, {
280
+
281
+ props: {
282
+ label: "labelText"
283
+ }
284
+ });
285
+
286
+ const textField = getByTestId('vc-text-field');
287
+ userEvent.type(textField, '{enter}');
288
+ expect(emitted().onKeydownEnter.length).toBe(1);
289
+ });
277
290
  });
@@ -64,7 +64,8 @@ const TextFieldTemplate = (args, {argTypes}) => ({
64
64
  :google-address-country-options="googleAddressCountryOptions"
65
65
  @click="onClick"
66
66
  @input="onInput"
67
- @onPlaceSelected="onPlaceSelected"/>
67
+ @onPlaceSelected="onPlaceSelected"
68
+ @onKeydownEnter="onKeydownEnter"/>
68
69
  </v-layout>`,
69
70
  })
70
71
 
@@ -20,7 +20,9 @@
20
20
  :single-line="singleLine"
21
21
  :hide-details="hideDetails"
22
22
  :readonly="readonly"
23
+ :autofocus="autofocus"
23
24
  @click="$emit('click')"
25
+ @keydown.enter="onKeydownEnter"
24
26
  @input="(data) => $emit('input',data)">
25
27
  <template v-slot:prepend-inner>
26
28
  <slot name="prepend-inner">
@@ -138,6 +140,10 @@ export default {
138
140
  type: Boolean,
139
141
  default: false
140
142
  },
143
+ autofocus: {
144
+ type: Boolean,
145
+ default: false
146
+ },
141
147
  },
142
148
  mounted() {
143
149
  if (this.googleAddressAutoComplete) {
@@ -211,6 +217,10 @@ export default {
211
217
  }
212
218
  }
213
219
  this.$emit('onPlaceSelected', {...selectedPlace, googlePlace})
220
+ },
221
+ onKeydownEnter(event) {
222
+ event.preventDefault();
223
+ this.$emit('onKeydownEnter');
214
224
  }
215
225
  }
216
226
  }
@@ -18,6 +18,7 @@ const baseProps = {
18
18
  disabled: false,
19
19
  dataQa: 'VcTooltip',
20
20
  defaultSlot: `<v-icon>$info</v-icon>`,
21
+ closeDelay: 0,
21
22
  };
22
23
 
23
24
  const GeneralTemplate = (args, {argTypes}) => ({
@@ -41,7 +42,8 @@ const GeneralTemplate = (args, {argTypes}) => ({
41
42
  :flavor="flavor"
42
43
  :dark="dark"
43
44
  :disabled="disabled"
44
- :data-qa="dataQa">
45
+ :data-qa="dataQa"
46
+ :close-delay="closeDelay">
45
47
  <template>
46
48
  ${args.defaultSlot}
47
49
  </template>
@@ -9,7 +9,8 @@
9
9
  :nudge-left="nudgeLeft"
10
10
  :nudge-right="nudgeRight"
11
11
  :disabled="disabled"
12
- :data-qa="dataQa">
12
+ :data-qa="dataQa"
13
+ :close-delay="closeDelay">
13
14
 
14
15
  <template v-slot:activator="{ on, attrs }">
15
16
  <span v-bind="attrs"
@@ -97,6 +98,10 @@ export default {
97
98
  type: String,
98
99
  default: 'vc-tooltip'
99
100
  },
101
+ closeDelay: {
102
+ type: Number,
103
+ default: 0
104
+ },
100
105
  },
101
106
  computed: {
102
107
  enableHeader() {