vueless 0.0.675 → 0.0.677

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 (89) hide show
  1. package/composables/useUI.ts +12 -1
  2. package/constants.js +1 -0
  3. package/package.json +1 -1
  4. package/types.ts +1 -1
  5. package/ui.boilerplate/types.ts +1 -1
  6. package/ui.button/UButton.vue +9 -6
  7. package/ui.button/types.ts +1 -1
  8. package/ui.button-link/ULink.vue +37 -62
  9. package/ui.button-link/config.ts +8 -35
  10. package/ui.button-link/storybook/stories.ts +0 -22
  11. package/ui.button-link/types.ts +1 -11
  12. package/ui.button-toggle/types.ts +1 -1
  13. package/ui.button-toggle-item/types.ts +1 -1
  14. package/ui.container-accordion/types.ts +1 -1
  15. package/ui.container-card/types.ts +1 -1
  16. package/ui.container-col/types.ts +1 -1
  17. package/ui.container-divider/types.ts +1 -1
  18. package/ui.container-group/types.ts +1 -1
  19. package/ui.container-groups/types.ts +1 -1
  20. package/ui.container-modal/UModal.vue +21 -20
  21. package/ui.container-modal/config.ts +3 -2
  22. package/ui.container-modal/types.ts +1 -1
  23. package/ui.container-modal-confirm/types.ts +1 -1
  24. package/ui.container-page/UPage.vue +31 -19
  25. package/ui.container-page/config.ts +1 -0
  26. package/ui.container-page/types.ts +1 -1
  27. package/ui.container-row/types.ts +1 -1
  28. package/ui.data-list/types.ts +1 -1
  29. package/ui.data-table/types.ts +1 -1
  30. package/ui.dropdown-badge/types.ts +1 -1
  31. package/ui.dropdown-button/types.ts +1 -1
  32. package/ui.dropdown-link/UDropdownLink.vue +29 -33
  33. package/ui.dropdown-link/config.ts +3 -3
  34. package/ui.dropdown-link/types.ts +1 -1
  35. package/ui.dropdown-list/types.ts +1 -1
  36. package/ui.form-calendar/types.ts +1 -1
  37. package/ui.form-checkbox/types.ts +1 -1
  38. package/ui.form-checkbox-group/types.ts +1 -1
  39. package/ui.form-checkbox-multi-state/types.ts +1 -1
  40. package/ui.form-color-picker/UColorPicker.vue +68 -0
  41. package/ui.form-color-picker/config.ts +29 -0
  42. package/ui.form-color-picker/constants.ts +5 -0
  43. package/ui.form-color-picker/storybook/docs.mdx +16 -0
  44. package/ui.form-color-picker/storybook/stories.ts +97 -0
  45. package/ui.form-color-picker/types.ts +42 -0
  46. package/ui.form-date-picker/types.ts +1 -1
  47. package/ui.form-date-picker-range/types.ts +1 -1
  48. package/ui.form-input/types.ts +1 -1
  49. package/ui.form-input-file/storybook/stories.ts +1 -1
  50. package/ui.form-input-file/types.ts +1 -1
  51. package/ui.form-input-money/types.ts +1 -1
  52. package/ui.form-input-number/types.ts +1 -1
  53. package/ui.form-input-rating/types.ts +1 -1
  54. package/ui.form-input-search/types.ts +1 -1
  55. package/ui.form-label/storybook/stories.ts +1 -1
  56. package/ui.form-label/types.ts +1 -1
  57. package/ui.form-radio/types.ts +1 -1
  58. package/ui.form-radio-group/types.ts +1 -1
  59. package/ui.form-select/USelect.vue +8 -6
  60. package/ui.form-select/types.ts +1 -1
  61. package/ui.form-switch/types.ts +1 -1
  62. package/ui.form-textarea/types.ts +1 -1
  63. package/ui.image-avatar/types.ts +1 -1
  64. package/ui.image-icon/UIcon.vue +2 -18
  65. package/ui.image-icon/storybook/stories.ts +0 -3
  66. package/ui.image-icon/types.ts +1 -13
  67. package/ui.loader/types.ts +1 -1
  68. package/ui.loader-overlay/types.ts +1 -1
  69. package/ui.loader-progress/types.ts +1 -1
  70. package/ui.navigation-pagination/types.ts +1 -1
  71. package/ui.navigation-progress/types.ts +2 -2
  72. package/ui.navigation-tab/types.ts +1 -1
  73. package/ui.navigation-tabs/types.ts +1 -1
  74. package/ui.other-dot/types.ts +1 -1
  75. package/ui.other-theme-color-toggle/UThemeColorToggle.vue +44 -70
  76. package/ui.other-theme-color-toggle/config.ts +2 -23
  77. package/ui.other-theme-color-toggle/storybook/stories.ts +6 -5
  78. package/ui.other-theme-color-toggle/types.ts +8 -3
  79. package/ui.text-alert/types.ts +1 -1
  80. package/ui.text-badge/types.ts +1 -1
  81. package/ui.text-block/types.ts +1 -1
  82. package/ui.text-empty/types.ts +1 -1
  83. package/ui.text-file/types.ts +1 -1
  84. package/ui.text-files/types.ts +1 -1
  85. package/ui.text-header/types.ts +1 -1
  86. package/ui.text-money/types.ts +1 -1
  87. package/ui.text-notify/types.ts +1 -1
  88. package/ui.text-number/types.ts +1 -1
  89. package/utils/theme.ts +8 -4
@@ -68,12 +68,18 @@ const mutatedProps = computed(() => ({
68
68
  opened: isShownOptions.value,
69
69
  }));
70
70
 
71
- const { config, wrapperAttrs, dropdownLinkAttrs, dropdownListAttrs, dropdownIconAttrs } =
71
+ const { config, getDataTest, wrapperAttrs, dropdownLinkAttrs, dropdownListAttrs, toggleIconAttrs } =
72
72
  useUI<Config>(defaultConfig, mutatedProps);
73
73
  </script>
74
74
 
75
75
  <template>
76
76
  <div v-click-outside="hideOptions" v-bind="wrapperAttrs">
77
+ <!--
78
+ @slot Use it to add something before the label.
79
+ @binding {boolean} opened
80
+ -->
81
+ <slot name="left" :opened="isShownOptions" />
82
+
77
83
  <ULink
78
84
  :id="elementId"
79
85
  :ring="ring"
@@ -84,48 +90,38 @@ const { config, wrapperAttrs, dropdownLinkAttrs, dropdownListAttrs, dropdownIcon
84
90
  :disabled="disabled"
85
91
  :underlined="underlined"
86
92
  v-bind="dropdownLinkAttrs"
87
- :data-test="dataTest"
93
+ :data-test="getDataTest()"
88
94
  @click="onClickLink"
89
95
  @keydown.enter="onClickLink"
90
96
  @keydown.space.prevent="onClickLink"
91
97
  >
92
- <template #left>
98
+ <template #default>
93
99
  <!--
94
- @slot Use it to add something before the label.
100
+ @slot Use it to add something instead of the default label.
101
+ @binding {string} label
95
102
  @binding {boolean} opened
96
103
  -->
97
- <slot name="left" :opened="isShownOptions" />
98
- </template>
99
-
100
- <template #default>
101
- <!--
102
- @slot Use it to add something instead of the default label.
103
- @binding {string} label
104
- @binding {boolean} opened
105
- -->
106
104
  <slot :label="label" :opened="isShownOptions" />
107
105
  </template>
108
-
109
- <template #right>
110
- <!--
111
- @slot Use it to add something after the label.
112
- @binding {boolean} opened
113
- -->
114
- <slot name="right" :opened="isShownOptions">
115
- <UIcon
116
- v-if="!noIcon"
117
- internal
118
- interactive
119
- :color="color"
120
- :name="config.defaults.dropdownIcon"
121
- v-bind="dropdownIconAttrs"
122
- :data-test="`${dataTest}-dropdown`"
123
- @click="onClickLink"
124
- />
125
- </slot>
126
- </template>
127
106
  </ULink>
128
107
 
108
+ <!--
109
+ @slot Use it to add something after the label.
110
+ @binding {boolean} opened
111
+ -->
112
+ <slot name="right" :opened="isShownOptions">
113
+ <UIcon
114
+ v-if="!noIcon"
115
+ internal
116
+ interactive
117
+ :color="color"
118
+ :name="config.defaults.toggleIcon"
119
+ v-bind="toggleIconAttrs"
120
+ :data-test="getDataTest('toggle')"
121
+ @click="onClickLink"
122
+ />
123
+ </slot>
124
+
129
125
  <UDropdownList
130
126
  v-if="isShownOptions"
131
127
  ref="dropdown-list"
@@ -133,7 +129,7 @@ const { config, wrapperAttrs, dropdownLinkAttrs, dropdownListAttrs, dropdownIcon
133
129
  :options="options"
134
130
  :label-key="labelKey"
135
131
  v-bind="dropdownListAttrs"
136
- :data-test="`${dataTest}-list`"
132
+ :data-test="getDataTest('list')"
137
133
  @click-option="onClickOption"
138
134
  />
139
135
  </div>
@@ -1,6 +1,6 @@
1
1
  export default /*tw*/ {
2
2
  wrapper: {
3
- base: "relative inline-block",
3
+ base: "relative inline-flex",
4
4
  variants: {
5
5
  opened: {
6
6
  true: "group",
@@ -8,7 +8,7 @@ export default /*tw*/ {
8
8
  },
9
9
  },
10
10
  dropdownLink: "{ULink}",
11
- dropdownIcon: {
11
+ toggleIcon: {
12
12
  base: "{UIcon} block transition duration-300 group-[]:rotate-180",
13
13
  defaults: {
14
14
  size: {
@@ -43,6 +43,6 @@ export default /*tw*/ {
43
43
  noIcon: false,
44
44
  disabled: false,
45
45
  /* icons */
46
- dropdownIcon: "keyboard_arrow_down",
46
+ toggleIcon: "keyboard_arrow_down",
47
47
  },
48
48
  };
@@ -100,5 +100,5 @@ export interface Props {
100
100
  /**
101
101
  * Data-test attribute for automated testing.
102
102
  */
103
- dataTest?: string;
103
+ dataTest?: string | null;
104
104
  }
@@ -70,5 +70,5 @@ export interface Props {
70
70
  /**
71
71
  * Data-test attribute for automated testing.
72
72
  */
73
- dataTest?: string;
73
+ dataTest?: string | null;
74
74
  }
@@ -80,7 +80,7 @@ export interface UCalendarProps<TModelValue extends DateValue> {
80
80
  /**
81
81
  * Data-test attribute for automated testing.
82
82
  */
83
- dataTest?: string;
83
+ dataTest?: string | null;
84
84
  }
85
85
 
86
86
  export interface UCalendarViewProps {
@@ -113,5 +113,5 @@ export interface Props {
113
113
  /**
114
114
  * Data-test attribute for automated testing.
115
115
  */
116
- dataTest?: string;
116
+ dataTest?: string | null;
117
117
  }
@@ -79,5 +79,5 @@ export interface Props {
79
79
  /**
80
80
  * Data-test attribute for automated testing.
81
81
  */
82
- dataTest?: string;
82
+ dataTest?: string | null;
83
83
  }
@@ -69,5 +69,5 @@ export interface Props {
69
69
  /**
70
70
  * Data-test attribute for automated testing.
71
71
  */
72
- dataTest?: string;
72
+ dataTest?: string | null;
73
73
  }
@@ -0,0 +1,68 @@
1
+ <script setup lang="ts">
2
+ import { computed, useId } from "vue";
3
+
4
+ import { vTooltip } from "../directives";
5
+ import useUI from "../composables/useUI.ts";
6
+ import { getDefaults } from "../utils/ui.ts";
7
+
8
+ import UButton from "../ui.button/UButton.vue";
9
+
10
+ import { COMPONENT_NAME } from "./constants.ts";
11
+ import defaultConfig from "./config.ts";
12
+
13
+ import type { Props, Config } from "./types.ts";
14
+
15
+ defineOptions({ inheritAttrs: false });
16
+
17
+ const props = withDefaults(defineProps<Props>(), {
18
+ ...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
19
+ modelValue: "",
20
+ colors: () => ({}),
21
+ labels: () => ({}),
22
+ });
23
+
24
+ const emit = defineEmits([
25
+ /**
26
+ * Triggers when color value changes.
27
+ * @property {string} value
28
+ */
29
+ "update:modelValue",
30
+ ]);
31
+
32
+ const elementId = props.id || useId();
33
+
34
+ const selectedItem = computed({
35
+ get: () => props.modelValue,
36
+ set: (value) => emit("update:modelValue", value),
37
+ });
38
+
39
+ function onClickColor(color: string) {
40
+ selectedItem.value = color;
41
+ }
42
+
43
+ /**
44
+ * Get element / nested component attributes for each config token ✨
45
+ * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
46
+ */
47
+ const { listAttrs, colorButtonAttrs, circleAttrs } = useUI<Config>(defaultConfig);
48
+ </script>
49
+
50
+ <template>
51
+ <div :id="elementId" v-bind="listAttrs">
52
+ <UButton
53
+ v-for="(colorClass, color) in colors"
54
+ :key="color"
55
+ v-tooltip="labels?.[color] || color"
56
+ square
57
+ size="xs"
58
+ :ring="false"
59
+ color="grayscale"
60
+ variant="thirdary"
61
+ :filled="selectedItem === color"
62
+ v-bind="colorButtonAttrs"
63
+ @click="onClickColor(color)"
64
+ >
65
+ <div :class="colorClass" v-bind="circleAttrs" />
66
+ </UButton>
67
+ </div>
68
+ </template>
@@ -0,0 +1,29 @@
1
+ export default /*tw*/ {
2
+ list: "flex flex-wrap gap-0.5",
3
+ colorButton: {
4
+ base: "{UButton}",
5
+ button: {
6
+ compoundVariants: [
7
+ {
8
+ filled: true,
9
+ variant: "thirdary",
10
+ color: "grayscale",
11
+ class: "focus:bg-gray-800/10 bg-gray-800/10 dark:focus:bg-gray-200/10 dark:bg-gray-200/10",
12
+ },
13
+ ],
14
+ },
15
+ },
16
+ circle: {
17
+ base: "rounded-full",
18
+ variants: {
19
+ size: {
20
+ sm: "size-4",
21
+ md: "size-5",
22
+ lg: "size-6",
23
+ },
24
+ },
25
+ },
26
+ defaults: {
27
+ size: "md",
28
+ },
29
+ };
@@ -0,0 +1,5 @@
1
+ /*
2
+ This const is needed to prevent the issue in script setup:
3
+ `defineProps` is referencing locally declared variables. (vue/valid-define-props)
4
+ */
5
+ export const COMPONENT_NAME = "UColorPicker";
@@ -0,0 +1,16 @@
1
+ import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
2
+ import { getSource } from "../../utils/storybook.ts";
3
+
4
+ import * as stories from "./stories.ts";
5
+ import defaultConfig from "../config.ts?raw"
6
+
7
+ <Meta of={stories} />
8
+ <Title of={stories} />
9
+ <Subtitle of={stories} />
10
+ <Description of={stories} />
11
+ <Primary of={stories} />
12
+ <Controls of={stories.Default} />
13
+ <Stories of={stories} />
14
+
15
+ ## Default config
16
+ <Source code={getSource(defaultConfig)} language="jsx" dark />
@@ -0,0 +1,97 @@
1
+ import {
2
+ getArgTypes,
3
+ getSlotNames,
4
+ getSlotsFragment,
5
+ getDocsDescription,
6
+ } from "../../utils/storybook.ts";
7
+
8
+ import UColorPicker from "../UColorPicker.vue";
9
+ import UCol from "../../ui.container-col/UCol.vue";
10
+ import UButton from "../../ui.button/UButton.vue";
11
+
12
+ import type { Meta, StoryFn } from "@storybook/vue3";
13
+ import type { Props } from "../types.ts";
14
+
15
+ interface UColorPickerArgs extends Props {
16
+ slotTemplate?: string;
17
+ enum: "size";
18
+ }
19
+
20
+ export default {
21
+ id: "3190",
22
+ title: "Form Inputs & Controls / Color Picker",
23
+ component: UColorPicker,
24
+ args: {
25
+ modelValue: "",
26
+ colors: {
27
+ grayscale: "bg-gray-900",
28
+ gray: "bg-gray-600",
29
+ red: "bg-red-600",
30
+ orange: "bg-orange-600",
31
+ amber: "bg-amber-600",
32
+ yellow: "bg-yellow-600",
33
+ lime: "bg-lime-600",
34
+ green: "bg-green-600",
35
+ emerald: "bg-emerald-600",
36
+ teal: "bg-teal-600",
37
+ cyan: "bg-cyan-600",
38
+ sky: "bg-sky-600",
39
+ blue: "bg-blue-600",
40
+ indigo: "bg-indigo-600",
41
+ violet: "bg-violet-600",
42
+ purple: "bg-purple-600",
43
+ fuchsia: "bg-fuchsia-600",
44
+ pink: "bg-pink-600",
45
+ rose: "bg-rose-600",
46
+ },
47
+ },
48
+ argTypes: {
49
+ ...getArgTypes(UColorPicker.__name),
50
+ },
51
+ parameters: {
52
+ docs: {
53
+ ...getDocsDescription(UColorPicker.__name),
54
+ },
55
+ },
56
+ } as Meta;
57
+
58
+ const DefaultTemplate: StoryFn<UColorPickerArgs> = (args: UColorPickerArgs) => ({
59
+ components: { UColorPicker, UButton, UCol },
60
+ setup() {
61
+ const slots = getSlotNames(UColorPicker.__name);
62
+
63
+ return { args, slots };
64
+ },
65
+ template: `
66
+ <UColorPicker v-bind="args" v-model="args.modelValue">
67
+ ${args.slotTemplate || getSlotsFragment("")}
68
+ </UColorPicker>
69
+ `,
70
+ });
71
+
72
+ const EnumVariantTemplate: StoryFn<UColorPickerArgs> = (args: UColorPickerArgs, { argTypes }) => ({
73
+ components: { UCol, UColorPicker },
74
+ setup() {
75
+ return {
76
+ args,
77
+ options: argTypes?.[args.enum]?.options,
78
+ };
79
+ },
80
+ template: `
81
+ <UCol>
82
+ <UColorPicker
83
+ v-for="(option, index) in options"
84
+ :key="index"
85
+ v-bind="args"
86
+ v-model="args.modelValue"
87
+ :[args.enum]="option"
88
+ />
89
+ </UCol>
90
+ `,
91
+ });
92
+
93
+ export const Default = DefaultTemplate.bind({});
94
+ Default.args = {};
95
+
96
+ export const Sizes = EnumVariantTemplate.bind({});
97
+ Sizes.args = { enum: "size" };
@@ -0,0 +1,42 @@
1
+ import defaultConfig from "./config.ts";
2
+
3
+ import type { BrandColors, GrayColors, ComponentConfig } from "../types.ts";
4
+
5
+ export type Config = typeof defaultConfig;
6
+
7
+ export interface Props {
8
+ /**
9
+ * Selected values.
10
+ */
11
+ modelValue: string;
12
+
13
+ /**
14
+ * Component size.
15
+ */
16
+ size?: "sm" | "md" | "lg";
17
+
18
+ /**
19
+ * Color list.
20
+ */
21
+ colors?: Record<BrandColors, string>;
22
+
23
+ /**
24
+ * Color labels.
25
+ */
26
+ labels?: Record<GrayColors, string>;
27
+
28
+ /**
29
+ * Unique element id.
30
+ */
31
+ id?: string;
32
+
33
+ /**
34
+ * Component config object.
35
+ */
36
+ config?: ComponentConfig<Config>;
37
+
38
+ /**
39
+ * Data-test attribute for automated testing.
40
+ */
41
+ dataTest?: string | null;
42
+ }
@@ -116,5 +116,5 @@ export interface Props<TModelValue> {
116
116
  /**
117
117
  * Data-test attribute for automated testing.
118
118
  */
119
- dataTest?: string;
119
+ dataTest?: string | null;
120
120
  }
@@ -189,5 +189,5 @@ export interface UDatePickerRangeProps<TModelValue> {
189
189
  /**
190
190
  * Data-test attribute for automated testing.
191
191
  */
192
- dataTest?: string;
192
+ dataTest?: string | null;
193
193
  }
@@ -99,5 +99,5 @@ export interface Props {
99
99
  /**
100
100
  * Data-test attribute for automated testing.
101
101
  */
102
- dataTest?: string;
102
+ dataTest?: string | null;
103
103
  }
@@ -17,7 +17,7 @@ interface UInputFileArgs extends Props {
17
17
  }
18
18
 
19
19
  export default {
20
- id: "30232",
20
+ id: "3200",
21
21
  title: "Form Inputs & Controls / Input File",
22
22
  component: UInputFile,
23
23
  args: {
@@ -68,5 +68,5 @@ export interface Props {
68
68
  /**
69
69
  * Data-test attribute for automated testing.
70
70
  */
71
- dataTest?: string;
71
+ dataTest?: string | null;
72
72
  }
@@ -116,5 +116,5 @@ export interface Props {
116
116
  /**
117
117
  * Data-test attribute for automated testing.
118
118
  */
119
- dataTest?: string;
119
+ dataTest?: string | null;
120
120
  }
@@ -63,5 +63,5 @@ export interface UInputNumberProps {
63
63
  /**
64
64
  * Data-test attribute for automated testing.
65
65
  */
66
- dataTest?: string;
66
+ dataTest?: string | null;
67
67
  }
@@ -63,5 +63,5 @@ export interface Props {
63
63
  /**
64
64
  * Data-test attribute for automated testing.
65
65
  */
66
- dataTest?: string;
66
+ dataTest?: string | null;
67
67
  }
@@ -88,5 +88,5 @@ export interface Props {
88
88
  /**
89
89
  * Data-test attribute for automated testing.
90
90
  */
91
- dataTest?: string;
91
+ dataTest?: string | null;
92
92
  }
@@ -20,7 +20,7 @@ interface ULabelArgs extends Props {
20
20
  }
21
21
 
22
22
  export default {
23
- id: "3240",
23
+ id: "3210",
24
24
  title: "Form Inputs & Controls / Label",
25
25
  component: ULabel,
26
26
  args: {
@@ -58,5 +58,5 @@ export interface Props {
58
58
  /**
59
59
  * Data-test attribute for automated testing.
60
60
  */
61
- dataTest?: string;
61
+ dataTest?: string | null;
62
62
  }
@@ -95,5 +95,5 @@ export interface Props {
95
95
  /**
96
96
  * Data-test attribute for automated testing.
97
97
  */
98
- dataTest?: string;
98
+ dataTest?: string | null;
99
99
  }
@@ -88,5 +88,5 @@ export interface Props {
88
88
  /**
89
89
  * Data-test attribute for automated testing.
90
90
  */
91
- dataTest?: string;
91
+ dataTest?: string | null;
92
92
  }
@@ -416,6 +416,7 @@ const mutatedProps = computed(() => ({
416
416
 
417
417
  const {
418
418
  config,
419
+ getDataTest,
419
420
  selectLabelAttrs,
420
421
  wrapperAttrs,
421
422
  innerWrapperAttrs,
@@ -453,7 +454,7 @@ const {
453
454
  centred
454
455
  interactive
455
456
  v-bind="selectLabelAttrs"
456
- :data-test="dataTest"
457
+ :data-test="getDataTest()"
457
458
  :tabindex="-1"
458
459
  >
459
460
  <template #label>
@@ -503,6 +504,7 @@ const {
503
504
  v-show="!multiple || (!isLocalValue && multiple)"
504
505
  v-bind="toggleWrapperAttrs"
505
506
  :tabindex="-1"
507
+ :data-test="getDataTest('toggle')"
506
508
  @mousedown.prevent.stop="toggle"
507
509
  >
508
510
  <!--
@@ -517,7 +519,6 @@ const {
517
519
  color="gray"
518
520
  :name="config.defaults.dropdownIcon"
519
521
  v-bind="toggleIconAttrs"
520
- :data-test="`${dataTest}-toggle`"
521
522
  :tabindex="-1"
522
523
  />
523
524
  </slot>
@@ -526,6 +527,7 @@ const {
526
527
  <div
527
528
  v-if="isLocalValue && clearable && !disabled && !multiple"
528
529
  v-bind="clearAttrs"
530
+ :data-test="getDataTest('clear')"
529
531
  @mousedown="onMouseDownClear"
530
532
  >
531
533
  <!--
@@ -539,7 +541,6 @@ const {
539
541
  color="gray"
540
542
  :name="config.defaults.clearIcon"
541
543
  v-bind="clearIconAttrs"
542
- :data-test="`${dataTest}-clear`"
543
544
  />
544
545
  </slot>
545
546
  </div>
@@ -599,6 +600,7 @@ const {
599
600
  <div
600
601
  v-if="!disabled"
601
602
  v-bind="clearMultipleAttrs"
603
+ :data-test="getDataTest('clear-item')"
602
604
  @mousedown.prevent.capture
603
605
  @click.prevent.capture
604
606
  @mousedown="onMouseDownClearItem($event, item)"
@@ -614,7 +616,6 @@ const {
614
616
  color="gray"
615
617
  :name="config.defaults.clearMultipleIcon"
616
618
  v-bind="clearMultipleIconAttrs"
617
- :data-test="`${dataTest}-clear-all`"
618
619
  />
619
620
  </slot>
620
621
  </div>
@@ -634,7 +635,7 @@ const {
634
635
  :disabled="disabled"
635
636
  :aria-controls="'listbox-' + elementId"
636
637
  v-bind="searchInputAttrs"
637
- :data-test="`${dataTest}-search`"
638
+ :data-test="getDataTest('search')"
638
639
  @focus="activate"
639
640
  @blur.prevent="deactivate"
640
641
  @keyup.esc="deactivate"
@@ -674,6 +675,7 @@ const {
674
675
  <div
675
676
  v-if="isLocalValue && clearable && !disabled && multiple"
676
677
  v-bind="clearMultipleTextAttrs"
678
+ :data-test="getDataTest('clear-all')"
677
679
  @mousedown.prevent.capture="onMouseDownClear"
678
680
  @click.prevent.capture
679
681
  v-text="currentLocale.clear"
@@ -693,7 +695,7 @@ const {
693
695
  :add-option="addOption"
694
696
  tabindex="-1"
695
697
  v-bind="dropdownListAttrs as KeyAttrsWithConfig<UDropdownListConfig>"
696
- :data-test="dataTest"
698
+ :data-test="getDataTest()"
697
699
  @add="onAddOption"
698
700
  @focus="activate"
699
701
  @mousedown.prevent.capture
@@ -130,5 +130,5 @@ export interface Props {
130
130
  /**
131
131
  * Data-test attribute for automated testing.
132
132
  */
133
- dataTest?: string;
133
+ dataTest?: string | null;
134
134
  }
@@ -84,5 +84,5 @@ export interface Props {
84
84
  /**
85
85
  * Data-test attribute for automated testing.
86
86
  */
87
- dataTest?: string;
87
+ dataTest?: string | null;
88
88
  }
@@ -83,5 +83,5 @@ export interface Props {
83
83
  /**
84
84
  * Data-test attribute for automated testing.
85
85
  */
86
- dataTest?: string;
86
+ dataTest?: string | null;
87
87
  }
@@ -69,5 +69,5 @@ export interface UAvatarProps {
69
69
  /**
70
70
  * Data-test attribute for automated testing.
71
71
  */
72
- dataTest?: string;
72
+ dataTest?: string | null;
73
73
  }