vueless 0.0.746 → 0.0.748

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.
Files changed (57) hide show
  1. package/package.json +1 -1
  2. package/ui.button-toggle/UToggle.vue +3 -6
  3. package/ui.button-toggle/storybook/stories.ts +5 -5
  4. package/ui.container-accordion/UAccordion.vue +2 -1
  5. package/ui.container-card/UCard.vue +2 -1
  6. package/ui.container-col/UCol.vue +2 -2
  7. package/ui.container-divider/UDivider.vue +5 -2
  8. package/ui.container-group/UGroup.vue +2 -1
  9. package/ui.container-groups/UGroups.vue +2 -2
  10. package/ui.container-modal/UModal.vue +3 -2
  11. package/ui.container-modal-confirm/UModalConfirm.vue +10 -5
  12. package/ui.container-page/UPage.vue +2 -1
  13. package/ui.container-row/URow.vue +2 -2
  14. package/ui.data-list/UDataList.vue +7 -6
  15. package/ui.data-table/UTable.vue +8 -7
  16. package/ui.data-table/UTableRow.vue +11 -5
  17. package/ui.dropdown-badge/UDropdownBadge.vue +11 -5
  18. package/ui.dropdown-button/UDropdownButton.vue +11 -5
  19. package/ui.dropdown-list/UDropdownList.vue +5 -4
  20. package/ui.form-checkbox/UCheckbox.vue +10 -4
  21. package/ui.form-checkbox-group/UCheckboxGroup.vue +4 -3
  22. package/ui.form-input/UInput.vue +3 -2
  23. package/ui.form-input/storybook/stories.ts +2 -5
  24. package/ui.form-input-file/UInputFile.vue +3 -2
  25. package/ui.form-input-money/UInputMoney.vue +2 -2
  26. package/ui.form-input-money/storybook/stories.ts +1 -4
  27. package/ui.form-input-number/UInputNumber.vue +4 -3
  28. package/ui.form-input-rating/UInputRating.vue +3 -3
  29. package/ui.form-input-search/UInputSearch.vue +5 -4
  30. package/ui.form-input-search/storybook/stories.ts +2 -5
  31. package/ui.form-label/ULabel.vue +15 -10
  32. package/ui.form-radio/URadio.vue +3 -3
  33. package/ui.form-radio-group/URadioGroup.vue +3 -3
  34. package/ui.form-select/storybook/stories.ts +2 -4
  35. package/ui.form-switch/USwitch.vue +2 -1
  36. package/ui.form-textarea/UTextarea.vue +10 -4
  37. package/ui.form-textarea/storybook/stories.ts +2 -4
  38. package/ui.image-avatar/UAvatar.vue +2 -2
  39. package/ui.loader/ULoader.vue +2 -2
  40. package/ui.loader-overlay/ULoaderOverlay.vue +2 -2
  41. package/ui.loader-progress/ULoaderProgress.vue +2 -2
  42. package/ui.navigation-breadcrumbs/UBreadcrumbs.vue +9 -3
  43. package/ui.navigation-pagination/UPagination.vue +7 -6
  44. package/ui.navigation-progress/UProgress.vue +10 -3
  45. package/ui.navigation-tab/UTab.vue +5 -2
  46. package/ui.navigation-tabs/UTabs.vue +3 -2
  47. package/ui.other-dot/UDot.vue +2 -2
  48. package/ui.text-alert/UAlert.vue +3 -2
  49. package/ui.text-badge/UBadge.vue +3 -5
  50. package/ui.text-block/UText.vue +2 -2
  51. package/ui.text-empty/UEmpty.vue +2 -1
  52. package/ui.text-file/UFile.vue +3 -2
  53. package/ui.text-files/UFiles.vue +2 -2
  54. package/ui.text-header/UHeader.vue +2 -2
  55. package/ui.text-money/UMoney.vue +2 -2
  56. package/ui.text-notify/UNotify.vue +3 -2
  57. package/ui.text-number/UNumber.vue +2 -2
@@ -237,6 +237,7 @@ const mutatedProps = computed(() => ({
237
237
  }));
238
238
 
239
239
  const {
240
+ getDataTest,
240
241
  config,
241
242
  inputAttrs,
242
243
  wrapperAttrs,
@@ -298,7 +299,7 @@ const {
298
299
  :maxlength="maxLength"
299
300
  :inputmode="inputmode"
300
301
  v-bind="inputAttrs"
301
- :data-test="dataTest"
302
+ :data-test="getDataTest()"
302
303
  @focus="onFocus"
303
304
  @blur="onBlur"
304
305
  @input="onInput"
@@ -317,7 +318,7 @@ const {
317
318
  interactive
318
319
  internal
319
320
  v-bind="passwordIconAttrs"
320
- :data-test="`${dataTest}-password-icon`"
321
+ :data-test="getDataTest('password-icon')"
321
322
  @click="onClickShowPassword"
322
323
  />
323
324
  </label>
@@ -1,4 +1,3 @@
1
- import { computed } from "vue";
2
1
  import {
3
2
  getArgTypes,
4
3
  getSlotNames,
@@ -43,15 +42,13 @@ const DefaultTemplate: StoryFn<UInputArgs> = (args: UInputArgs) => ({
43
42
  components: { UInput, UIcon },
44
43
  setup() {
45
44
  const slots = getSlotNames(UInput.__name);
46
- const errorMessage = computed(() => (args.modelValue === "" ? args.error : ""));
47
45
 
48
- return { args, slots, errorMessage };
46
+ return { args, slots };
49
47
  },
50
48
  template: `
51
49
  <UInput
52
50
  v-bind="args"
53
51
  v-model="args.modelValue"
54
- :error="errorMessage"
55
52
  class="max-w-96"
56
53
  >
57
54
  ${args.slotTemplate || getSlotsFragment("")}
@@ -129,7 +126,7 @@ export const Description = DefaultTemplate.bind({});
129
126
  Description.args = { description: "Provide additional details if necessary." };
130
127
 
131
128
  export const Error = DefaultTemplate.bind({});
132
- Error.args = { error: "This field is required. Please enter a value." };
129
+ Error.args = { error: "This field is required. Please enter a value.", modelValue: "" };
133
130
 
134
131
  export const Readonly = DefaultTemplate.bind({});
135
132
  Readonly.args = {
@@ -247,6 +247,7 @@ const mutatedProps = computed(() => ({
247
247
  }));
248
248
 
249
249
  const {
250
+ getDataTest,
250
251
  config,
251
252
  inputLabelAttrs,
252
253
  chooseFileButtonAttrs,
@@ -320,7 +321,7 @@ const {
320
321
  :label="currentLocale.uploadFile"
321
322
  :disabled="disabled"
322
323
  v-bind="chooseFileButtonAttrs"
323
- :data-test="`${dataTest}-upload`"
324
+ :data-test="getDataTest('upload')"
324
325
  />
325
326
 
326
327
  <input
@@ -345,7 +346,7 @@ const {
345
346
  :color="error ? 'red' : 'brand'"
346
347
  :left-icon="config.defaults.clearIcon"
347
348
  v-bind="clearButtonAttrs"
348
- :data-test="`${dataTest}-clear`"
349
+ :data-test="getDataTest('clear')"
349
350
  @click="onClickResetFiles"
350
351
  />
351
352
  </div>
@@ -105,7 +105,7 @@ defineExpose({
105
105
  * Get element / nested component attributes for each config token ✨
106
106
  * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
107
107
  */
108
- const { moneyInputAttrs } = useUI<Config>(defaultConfig);
108
+ const { getDataTest, moneyInputAttrs } = useUI<Config>(defaultConfig);
109
109
  </script>
110
110
 
111
111
  <template>
@@ -125,7 +125,7 @@ const { moneyInputAttrs } = useUI<Config>(defaultConfig);
125
125
  :left-icon="leftIcon"
126
126
  :right-icon="rightIcon"
127
127
  v-bind="moneyInputAttrs"
128
- :data-test="`${dataTest}-base-currency`"
128
+ :data-test="getDataTest('base-currency')"
129
129
  @keyup="onKeyup"
130
130
  @blur="onBlur"
131
131
  @input="onInput"
@@ -1,4 +1,3 @@
1
- import { computed } from "vue";
2
1
  import {
3
2
  getArgTypes,
4
3
  getSlotNames,
@@ -43,15 +42,13 @@ const DefaultTemplate: StoryFn<UInputMoneyArgs> = (args: UInputMoneyArgs) => ({
43
42
  components: { UInputMoney, UIcon, UButton },
44
43
  setup() {
45
44
  const slots = getSlotNames(UInputMoney.__name);
46
- const errorMessage = computed(() => (Number(args.modelValue) > 0 ? "" : args.error));
47
45
 
48
- return { args, slots, errorMessage };
46
+ return { args, slots };
49
47
  },
50
48
  template: `
51
49
  <UInputMoney
52
50
  v-bind="args"
53
51
  v-model="args.modelValue"
54
- :error="errorMessage"
55
52
  class="max-w-96"
56
53
  >
57
54
  ${args.slotTemplate || getSlotsFragment("")}
@@ -53,6 +53,7 @@ function onClickAdd() {
53
53
  * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
54
54
  */
55
55
  const {
56
+ getDataTest,
56
57
  config,
57
58
  valueAttrs,
58
59
  labelAttrs,
@@ -74,7 +75,7 @@ const {
74
75
  :align="labelAlign"
75
76
  centred
76
77
  v-bind="labelAttrs"
77
- :data-test="dataTest"
78
+ :data-test="getDataTest()"
78
79
  >
79
80
  <template #label>
80
81
  <!--
@@ -92,7 +93,7 @@ const {
92
93
  round
93
94
  :disabled="isRemoveButtonDisabled || disabled"
94
95
  v-bind="removeButtonAttrs"
95
- :data-test="`${dataTest}-remove`"
96
+ :data-test="getDataTest('remove')"
96
97
  @click="onClickRemove"
97
98
  >
98
99
  <UIcon
@@ -116,7 +117,7 @@ const {
116
117
  round
117
118
  :disabled="isAddButtonDisabled || disabled"
118
119
  v-bind="addButtonAttrs"
119
- :data-test="`${dataTest}-add`"
120
+ :data-test="getDataTest('add')"
120
121
  @click="onClickAdd"
121
122
  >
122
123
  <UIcon
@@ -59,7 +59,7 @@ function onMouseHover(overStar: number | null = null) {
59
59
  * Get element / nested component attributes for each config token ✨
60
60
  * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
61
61
  */
62
- const { config, containerAttrs, counterAttrs, totalAttrs, starsAttrs, starAttrs } =
62
+ const { getDataTest, config, containerAttrs, counterAttrs, totalAttrs, starsAttrs, starAttrs } =
63
63
  useUI<Config>(defaultConfig);
64
64
  </script>
65
65
 
@@ -81,11 +81,11 @@ const { config, containerAttrs, counterAttrs, totalAttrs, starsAttrs, starAttrs
81
81
  v-for="star in stars"
82
82
  :key="star"
83
83
  internal
84
- :color="error ? 'red' : 'brand'"
84
+ color="inherit"
85
85
  :interactive="selectable"
86
86
  :name="starIcon(star)"
87
87
  v-bind="starAttrs"
88
- :data-test="`${dataTest}-rating-star-${star}`"
88
+ :data-test="getDataTest(`star-${star}`)"
89
89
  @click="onClickStar(star)"
90
90
  @mouseleave="onMouseHover()"
91
91
  @mouseover="onMouseHover(star)"
@@ -109,6 +109,7 @@ defineExpose({
109
109
  * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
110
110
  */
111
111
  const {
112
+ getDataTest,
112
113
  config,
113
114
  searchInputAttrs,
114
115
  searchInputWithButtonAttrs,
@@ -134,7 +135,7 @@ const {
134
135
  inputmode="search"
135
136
  :left-icon="leftIcon"
136
137
  v-bind="searchButtonLabel ? searchInputWithButtonAttrs : searchInputAttrs"
137
- :data-test="dataTest"
138
+ :data-test="getDataTest()"
138
139
  @update:model-value="onUpdateValue"
139
140
  @keyup.enter="onKeyupEnter"
140
141
  >
@@ -151,7 +152,7 @@ const {
151
152
  color="gray"
152
153
  :name="config.defaults.clearIcon"
153
154
  v-bind="clearIconAttrs"
154
- :data-test="`${dataTest}-clear`"
155
+ :data-test="getDataTest('clear')"
155
156
  @click="onClickClear"
156
157
  />
157
158
 
@@ -171,7 +172,7 @@ const {
171
172
  color="gray"
172
173
  :name="rightIcon || config.defaults.searchIcon"
173
174
  v-bind="searchIconAttrs"
174
- :data-test="`${dataTest}-search-icon`"
175
+ :data-test="getDataTest('search-icon')"
175
176
  @click="onClickSearch"
176
177
  />
177
178
 
@@ -179,7 +180,7 @@ const {
179
180
  v-if="searchButtonLabel"
180
181
  :label="searchButtonLabel"
181
182
  v-bind="searchButtonAttrs"
182
- :data-test="`${dataTest}-search-button`"
183
+ :data-test="getDataTest('search-button')"
183
184
  @click="onClickSearch"
184
185
  />
185
186
  </slot>
@@ -1,4 +1,3 @@
1
- import { computed } from "vue";
2
1
  import {
3
2
  getArgTypes,
4
3
  getSlotNames,
@@ -43,15 +42,13 @@ const DefaultTemplate: StoryFn<UInputSearchArgs> = (args: UInputSearchArgs) => (
43
42
  components: { UInputSearch, UButton, UIcon },
44
43
  setup() {
45
44
  const slots = getSlotNames(UInputSearch.__name);
46
- const errorMessage = computed(() => (args.modelValue === "" ? args.error : ""));
47
45
 
48
- return { args, slots, errorMessage };
46
+ return { args, slots };
49
47
  },
50
48
  template: `
51
49
  <UInputSearch
52
50
  v-bind="args"
53
51
  v-model="args.modelValue"
54
- :error="errorMessage"
55
52
  class="max-w-96"
56
53
  >
57
54
  ${args.slotTemplate || getSlotsFragment("")}
@@ -104,7 +101,7 @@ export const Description = DefaultTemplate.bind({});
104
101
  Description.args = { description: "Search for additional details." };
105
102
 
106
103
  export const Error = DefaultTemplate.bind({});
107
- Error.args = { error: "This field is required. Please enter a value." };
104
+ Error.args = { error: "This field is required. Please enter a value.", modelValue: "" };
108
105
 
109
106
  export const Disabled = DefaultTemplate.bind({});
110
107
  Disabled.args = { disabled: true };
@@ -69,7 +69,7 @@ const mutatedProps = computed(() => ({
69
69
  error: Boolean(props.error),
70
70
  }));
71
71
 
72
- const { wrapperAttrs, contentAttrs, labelAttrs, descriptionAttrs } = useUI<Config>(
72
+ const { getDataTest, wrapperAttrs, contentAttrs, labelAttrs, descriptionAttrs } = useUI<Config>(
73
73
  defaultConfig,
74
74
  mutatedProps,
75
75
  );
@@ -80,10 +80,10 @@ const { wrapperAttrs, contentAttrs, labelAttrs, descriptionAttrs } = useUI<Confi
80
80
  v-if="isHorizontalPlacement || isTopWithDescPlacement"
81
81
  ref="wrapperRef"
82
82
  v-bind="wrapperAttrs"
83
- :data-test="dataTest"
83
+ :data-test="getDataTest()"
84
84
  @click="onClick"
85
85
  >
86
- <div v-bind="contentAttrs" :data-test="`${dataTest}-content`">
86
+ <div v-bind="contentAttrs" :data-test="getDataTest('content')">
87
87
  <!-- @slot Use it to add label content. -->
88
88
  <slot />
89
89
  </div>
@@ -95,7 +95,7 @@ const { wrapperAttrs, contentAttrs, labelAttrs, descriptionAttrs } = useUI<Confi
95
95
  ref="labelRef"
96
96
  :for="props.for"
97
97
  v-bind="labelAttrs"
98
- :data-test="`${dataTest}-label`"
98
+ :data-test="getDataTest('label')"
99
99
  >
100
100
  <!--
101
101
  @slot Use this to add custom content instead of the label.
@@ -106,12 +106,17 @@ const { wrapperAttrs, contentAttrs, labelAttrs, descriptionAttrs } = useUI<Confi
106
106
  </slot>
107
107
  </label>
108
108
 
109
- <div v-if="error" v-bind="descriptionAttrs" :data-test="`${dataTest}-error`" v-text="error" />
109
+ <div
110
+ v-if="error"
111
+ v-bind="descriptionAttrs"
112
+ :data-test="getDataTest('error')"
113
+ v-text="error"
114
+ />
110
115
 
111
116
  <div
112
117
  v-if="description && !error"
113
118
  v-bind="descriptionAttrs"
114
- :data-test="`${dataTest}-description`"
119
+ :data-test="getDataTest('description')"
115
120
  v-text="description"
116
121
  />
117
122
 
@@ -126,7 +131,7 @@ const { wrapperAttrs, contentAttrs, labelAttrs, descriptionAttrs } = useUI<Confi
126
131
  v-bind="labelAttrs"
127
132
  ref="labelRef"
128
133
  :for="props.for"
129
- :data-test="`${dataTest}-label`"
134
+ :data-test="getDataTest('label')"
130
135
  >
131
136
  <!--
132
137
  @slot Use this to add custom content instead of the label.
@@ -137,17 +142,17 @@ const { wrapperAttrs, contentAttrs, labelAttrs, descriptionAttrs } = useUI<Confi
137
142
  </slot>
138
143
  </label>
139
144
 
140
- <div v-bind="contentAttrs" :data-test="`${dataTest}-content`">
145
+ <div v-bind="contentAttrs" :data-test="getDataTest('content')">
141
146
  <!-- @slot Use it to add label content. -->
142
147
  <slot />
143
148
  </div>
144
149
 
145
- <div v-if="error" v-bind="descriptionAttrs" :data-test="`${dataTest}-error`" v-text="error" />
150
+ <div v-if="error" v-bind="descriptionAttrs" :data-test="getDataTest('error')" v-text="error" />
146
151
 
147
152
  <div
148
153
  v-if="description && !error"
149
154
  v-bind="descriptionAttrs"
150
- :data-test="`${dataTest}-description`"
155
+ :data-test="getDataTest('description')"
151
156
  v-text="description"
152
157
  />
153
158
 
@@ -94,7 +94,7 @@ const mutatedProps = computed(() => ({
94
94
  error: Boolean(props.error),
95
95
  }));
96
96
 
97
- const { radioAttrs, radioLabelAttrs } = useUI<Config>(defaultConfig, mutatedProps);
97
+ const { getDataTest, radioAttrs, radioLabelAttrs } = useUI<Config>(defaultConfig, mutatedProps);
98
98
  </script>
99
99
 
100
100
  <template>
@@ -108,7 +108,7 @@ const { radioAttrs, radioLabelAttrs } = useUI<Config>(defaultConfig, mutatedProp
108
108
  :description="description"
109
109
  interactive
110
110
  v-bind="radioLabelAttrs"
111
- :data-test="`${dataTest}-label`"
111
+ :data-test="getDataTest('label')"
112
112
  >
113
113
  <template #label>
114
114
  <!--
@@ -126,7 +126,7 @@ const { radioAttrs, radioLabelAttrs } = useUI<Config>(defaultConfig, mutatedProp
126
126
  :checked="checked || isChecked"
127
127
  :disabled="radioDisabled"
128
128
  v-bind="radioAttrs"
129
- :data-test="dataTest"
129
+ :data-test="getDataTest()"
130
130
  @change="onChange"
131
131
  />
132
132
 
@@ -47,7 +47,7 @@ provide("getRadioGroupDisabled", () => props.disabled);
47
47
  * Get element / nested component attributes for each config token ✨
48
48
  * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
49
49
  */
50
- const { groupLabelAttrs, listAttrs, groupRadioAttrs } = useUI<Config>(defaultConfig);
50
+ const { getDataTest, groupLabelAttrs, listAttrs, groupRadioAttrs } = useUI<Config>(defaultConfig);
51
51
  </script>
52
52
 
53
53
  <template>
@@ -59,7 +59,7 @@ const { groupLabelAttrs, listAttrs, groupRadioAttrs } = useUI<Config>(defaultCon
59
59
  :disabled="disabled"
60
60
  align="topWithDesc"
61
61
  v-bind="groupLabelAttrs"
62
- :data-test="dataTest"
62
+ :data-test="getDataTest()"
63
63
  >
64
64
  <template #label>
65
65
  <!--
@@ -81,7 +81,7 @@ const { groupLabelAttrs, listAttrs, groupRadioAttrs } = useUI<Config>(defaultCon
81
81
  :description="option.description"
82
82
  :disabled="disabled"
83
83
  v-bind="groupRadioAttrs"
84
- :data-test="`${dataTest}-item-${index}`"
84
+ :data-test="getDataTest(`item-${index}`)"
85
85
  />
86
86
  </slot>
87
87
  </div>
@@ -1,4 +1,4 @@
1
- import { ref, computed } from "vue";
1
+ import { ref } from "vue";
2
2
  import {
3
3
  getArgTypes,
4
4
  getSlotNames,
@@ -64,16 +64,14 @@ const DefaultTemplate: StoryFn<USelectArgs> = (args: USelectArgs) => ({
64
64
  }
65
65
 
66
66
  const slots = getSlotNames(USelect.__name);
67
- const errorMessage = computed(() => (!args.modelValue ? args.error : ""));
68
67
  const showAlert = (message: string) => alert(message);
69
68
 
70
- return { args, slots, getSelectedBadge, errorMessage, showAlert };
69
+ return { args, slots, getSelectedBadge, showAlert };
71
70
  },
72
71
  template: `
73
72
  <USelect
74
73
  v-bind="args"
75
74
  v-model="args.modelValue"
76
- :error="errorMessage"
77
75
  class="max-w-96"
78
76
  @add="showAlert('You triggered the add action!')"
79
77
  >
@@ -77,6 +77,7 @@ const mutatedProps = computed(() => ({
77
77
  }));
78
78
 
79
79
  const {
80
+ getDataTest,
80
81
  config,
81
82
  toggleIconAttrs,
82
83
  switchLabelAttrs,
@@ -97,7 +98,7 @@ const {
97
98
  :disabled="disabled"
98
99
  interactive
99
100
  v-bind="switchLabelAttrs"
100
- :data-test="dataTest"
101
+ :data-test="getDataTest()"
101
102
  @click="onClickToggle"
102
103
  >
103
104
  <template #label>
@@ -190,8 +190,14 @@ const mutatedProps = computed(() => ({
190
190
  label: Boolean(props.label),
191
191
  }));
192
192
 
193
- const { textareaAttrs, textareaLabelAttrs, wrapperAttrs, leftSlotAttrs, rightSlotAttrs } =
194
- useUI<Config>(defaultConfig, mutatedProps);
193
+ const {
194
+ getDataTest,
195
+ textareaAttrs,
196
+ textareaLabelAttrs,
197
+ wrapperAttrs,
198
+ leftSlotAttrs,
199
+ rightSlotAttrs,
200
+ } = useUI<Config>(defaultConfig, mutatedProps);
195
201
  </script>
196
202
 
197
203
  <template>
@@ -206,7 +212,7 @@ const { textareaAttrs, textareaLabelAttrs, wrapperAttrs, leftSlotAttrs, rightSlo
206
212
  :align="labelAlign"
207
213
  interactive
208
214
  v-bind="textareaLabelAttrs"
209
- :data-test="dataTest"
215
+ :data-test="getDataTest('label')"
210
216
  >
211
217
  <template #label>
212
218
  <!--
@@ -237,7 +243,7 @@ const { textareaAttrs, textareaLabelAttrs, wrapperAttrs, leftSlotAttrs, rightSlo
237
243
  :rows="currentRows"
238
244
  :inputmode="inputmode"
239
245
  v-bind="textareaAttrs"
240
- :data-test="dataTest"
246
+ :data-test="getDataTest()"
241
247
  @focus="onFocus"
242
248
  @blur="onBlur"
243
249
  @change="onChange"
@@ -1,4 +1,4 @@
1
- import { ref, computed } from "vue";
1
+ import { ref } from "vue";
2
2
  import {
3
3
  getArgTypes,
4
4
  getSlotNames,
@@ -44,15 +44,13 @@ const DefaultTemplate: StoryFn<UTextareaArgs> = (args: UTextareaArgs) => ({
44
44
  components: { UTextarea, UIcon },
45
45
  setup() {
46
46
  const slots = getSlotNames(UTextarea.__name);
47
- const errorMessage = computed(() => (args.modelValue === "" ? args.error : ""));
48
47
 
49
- return { args, slots, errorMessage };
48
+ return { args, slots };
50
49
  },
51
50
  template: `
52
51
  <UTextarea
53
52
  v-bind="args"
54
53
  v-model="args.modelValue"
55
- :error="errorMessage"
56
54
  class="max-w-96"
57
55
  >
58
56
  ${args.slotTemplate || getSlotsFragment("")}
@@ -55,7 +55,7 @@ function onClick(event: MouseEvent) {
55
55
  * Get element / nested component attributes for each config token ✨
56
56
  * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
57
57
  */
58
- const { config, avatarAttrs, placeholderIconAttrs } = useUI<Config>(defaultConfig);
58
+ const { getDataTest, config, avatarAttrs, placeholderIconAttrs } = useUI<Config>(defaultConfig);
59
59
  </script>
60
60
 
61
61
  <template>
@@ -63,7 +63,7 @@ const { config, avatarAttrs, placeholderIconAttrs } = useUI<Config>(defaultConfi
63
63
  :title="label"
64
64
  :style="backgroundImage"
65
65
  v-bind="avatarAttrs"
66
- :data-test="dataTest"
66
+ :data-test="getDataTest()"
67
67
  @click="onClick"
68
68
  >
69
69
  <template v-if="!backgroundImage">
@@ -17,12 +17,12 @@ withDefaults(defineProps<Props>(), {
17
17
  * Get element / nested component attributes for each config token ✨
18
18
  * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
19
19
  */
20
- const { config, loaderAttrs, ellipseAttrs } = useUI<Config>(defaultConfig);
20
+ const { getDataTest, config, loaderAttrs, ellipseAttrs } = useUI<Config>(defaultConfig);
21
21
  </script>
22
22
 
23
23
  <template>
24
24
  <Transition v-bind="config.transition">
25
- <div v-if="loading" v-bind="loaderAttrs" :data-test="dataTest">
25
+ <div v-if="loading" v-bind="loaderAttrs" :data-test="getDataTest()">
26
26
  <!-- @slot Use it to add something instead of the default loader. -->
27
27
  <slot>
28
28
  <div v-for="ellipse in ELLIPSES_AMOUNT" :key="ellipse" v-bind="ellipseAttrs" />
@@ -47,12 +47,12 @@ const showLoader = computed(() => {
47
47
  * Get element / nested component attributes for each config token ✨
48
48
  * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
49
49
  */
50
- const { config, overlayAttrs, nestedLoaderAttrs } = useUI<Config>(defaultConfig);
50
+ const { getDataTest, config, overlayAttrs, nestedLoaderAttrs } = useUI<Config>(defaultConfig);
51
51
  </script>
52
52
 
53
53
  <template>
54
54
  <Transition v-bind="config.transition">
55
- <div v-if="showLoader" v-bind="overlayAttrs" :data-test="dataTest">
55
+ <div v-if="showLoader" v-bind="overlayAttrs" :data-test="getDataTest()">
56
56
  <!-- @slot Use it to add something instead of the default loader. -->
57
57
  <slot>
58
58
  <ULoader :loading="showLoader" size="lg" :color="loaderColor" v-bind="nestedLoaderAttrs" />
@@ -191,11 +191,11 @@ defineExpose({
191
191
  * Get element / nested component attributes for each config token ✨
192
192
  * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
193
193
  */
194
- const { stripeAttrs } = useUI<Config>(defaultConfig);
194
+ const { getDataTest, stripeAttrs } = useUI<Config>(defaultConfig);
195
195
  </script>
196
196
 
197
197
  <template>
198
198
  <Transition :css="false" @before-enter="beforeEnter" @enter="enter" @after-enter="afterEnter">
199
- <div v-if="show" v-bind="stripeAttrs" :data-test="dataTest" :style="barStyle" />
199
+ <div v-if="show" v-bind="stripeAttrs" :data-test="getDataTest()" :style="barStyle" />
200
200
  </Transition>
201
201
  </template>
@@ -40,8 +40,14 @@ function onClickLink(link: UBreadcrumb) {
40
40
  * Get element / nested component attributes for each config token ✨
41
41
  * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
42
42
  */
43
- const { config, breadcrumbsAttrs, breadcrumbLinkAttrs, breadcrumbIconAttrs, dividerIconAttrs } =
44
- useUI<Config>(defaultConfig);
43
+ const {
44
+ getDataTest,
45
+ config,
46
+ breadcrumbsAttrs,
47
+ breadcrumbLinkAttrs,
48
+ breadcrumbIconAttrs,
49
+ dividerIconAttrs,
50
+ } = useUI<Config>(defaultConfig);
45
51
  </script>
46
52
 
47
53
  <template>
@@ -77,7 +83,7 @@ const { config, breadcrumbsAttrs, breadcrumbLinkAttrs, breadcrumbIconAttrs, divi
77
83
  :dashed="dashed"
78
84
  :disabled="link.disabled || (!link.to && !link.href)"
79
85
  v-bind="breadcrumbLinkAttrs"
80
- :data-test="dataTest"
86
+ :data-test="getDataTest()"
81
87
  @click="onClickLink(link)"
82
88
  >
83
89
  <template #default="slotProps">
@@ -105,6 +105,7 @@ function goToLastPage() {
105
105
  * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
106
106
  */
107
107
  const {
108
+ getDataTest,
108
109
  config,
109
110
  paginationAttrs,
110
111
  firstButtonAttrs,
@@ -129,7 +130,7 @@ const {
129
130
  :square="!firstLabel"
130
131
  :disabled="prevIsDisabled"
131
132
  v-bind="firstButtonAttrs"
132
- :data-test="`${dataTest}-first`"
133
+ :data-test="getDataTest('first')"
133
134
  @click="goToFirstPage"
134
135
  >
135
136
  <!-- @slot Use it to add something instead of the "first" label. -->
@@ -150,7 +151,7 @@ const {
150
151
  :square="!prevLabel"
151
152
  :disabled="prevIsDisabled"
152
153
  v-bind="prevButtonAttrs"
153
- :data-test="`${dataTest}-prev`"
154
+ :data-test="getDataTest('prev')"
154
155
  @click="goToPrevPage"
155
156
  >
156
157
  <!-- @slot Use it to add something instead of the "prev" label. -->
@@ -184,7 +185,7 @@ const {
184
185
  :label="String(page.number)"
185
186
  :disabled="disabled"
186
187
  v-bind="activeButtonAttrs"
187
- :data-test="`${dataTest}-active`"
188
+ :data-test="getDataTest('active')"
188
189
  />
189
190
 
190
191
  <UButton
@@ -193,7 +194,7 @@ const {
193
194
  :label="String(page.number)"
194
195
  :disabled="disabled"
195
196
  v-bind="inactiveButtonAttrs"
196
- :data-test="`${dataTest}-inactive`"
197
+ :data-test="getDataTest('inactive')"
197
198
  @click="selectPage(page.number)"
198
199
  />
199
200
  </template>
@@ -204,7 +205,7 @@ const {
204
205
  :square="!nextLabel"
205
206
  :disabled="nextIsDisabled"
206
207
  v-bind="nextButtonAttrs"
207
- :data-test="`${dataTest}-next`"
208
+ :data-test="getDataTest('next')"
208
209
  @click="goToNextPage"
209
210
  >
210
211
  <!-- @slot Use it to add something instead of the "next" label. -->
@@ -226,7 +227,7 @@ const {
226
227
  :square="!lastLabel"
227
228
  :disabled="nextIsDisabled"
228
229
  v-bind="lastButtonAttrs"
229
- :data-test="`${dataTest}-last`"
230
+ :data-test="getDataTest('last')"
230
231
  @click="goToLastPage"
231
232
  >
232
233
  <!-- @slot Use it to add something instead of the "last" label. -->