vueless 0.0.285 → 0.0.287
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/directive.tooltip/index.js +2 -0
- package/package.json +2 -2
- package/ui.button/configs/default.config.js +14 -17
- package/ui.button/index.stories.js +6 -2
- package/ui.button/index.vue +97 -75
- package/ui.button-link/index.vue +4 -4
- package/ui.button-toggle/configs/default.config.js +1 -1
- package/ui.button-toggle/index.stories.js +4 -4
- package/ui.button-toggle/index.vue +7 -7
- package/ui.button-toggle-item/configs/default.config.js +1 -1
- package/ui.button-toggle-item/index.vue +4 -4
- package/ui.container-accordion/index.vue +3 -3
- package/ui.container-card/index.stories.js +2 -2
- package/ui.container-card/index.vue +3 -3
- package/ui.container-col/index.vue +3 -3
- package/ui.container-divider/index.vue +3 -3
- package/ui.container-group/index.vue +3 -3
- package/ui.container-modal/index.vue +4 -4
- package/ui.container-modal-confirm/index.vue +5 -5
- package/ui.container-page/index.vue +3 -3
- package/ui.container-row/index.vue +3 -3
- package/ui.data-list/index.vue +8 -8
- package/ui.data-table/components/TableRow.vue +5 -5
- package/ui.data-table/index.vue +8 -8
- package/ui.dropdown-badge/index.vue +5 -5
- package/ui.dropdown-button/configs/default.config.js +1 -1
- package/ui.dropdown-button/index.vue +8 -8
- package/ui.dropdown-item/index.vue +3 -3
- package/ui.dropdown-link/index.vue +5 -5
- package/ui.dropdown-list/index.vue +1 -1
- package/ui.form-calendar/index.vue +2 -2
- package/ui.form-checkbox/index.vue +4 -4
- package/ui.form-checkbox-group/index.vue +4 -4
- package/ui.form-checkbox-multi-state/index.vue +2 -2
- package/ui.form-color-picker/index.vue +3 -3
- package/ui.form-date-picker/index.stories.js +22 -15
- package/ui.form-date-picker/index.vue +25 -2
- package/ui.form-date-picker-range/index.stories.js +47 -7
- package/ui.form-date-picker-range/index.vue +28 -2
- package/ui.form-input/configs/default.config.js +2 -2
- package/ui.form-input/index.vue +4 -4
- package/ui.form-input-file/index.vue +7 -7
- package/ui.form-input-money/index.stories.js +55 -1
- package/ui.form-input-money/index.vue +30 -7
- package/ui.form-input-number/index.vue +7 -7
- package/ui.form-input-rating/index.vue +4 -4
- package/ui.form-input-search/index.stories.js +48 -10
- package/ui.form-input-search/index.vue +24 -7
- package/ui.form-label/index.vue +8 -8
- package/ui.form-radio/index.vue +4 -4
- package/ui.form-radio-group/index.vue +4 -4
- package/ui.form-select/index.vue +3 -3
- package/ui.form-switch/index.vue +3 -3
- package/ui.form-textarea/index.vue +4 -4
- package/ui.image-avatar/index.vue +3 -3
- package/ui.image-icon/configs/default.config.js +17 -17
- package/ui.image-icon/index.stories.js +2 -2
- package/ui.image-icon/index.vue +6 -6
- package/ui.navigation-pagination/index.vue +7 -7
- package/ui.navigation-progress/components/StepperProgress.vue +1 -1
- package/ui.navigation-progress/index.vue +3 -3
- package/ui.navigation-tab/index.vue +3 -3
- package/ui.navigation-tabs/index.vue +4 -4
- package/ui.other-dot/index.vue +3 -3
- package/ui.text-alert/index.vue +4 -4
- package/ui.text-badge/index.vue +3 -3
- package/ui.text-block/index.vue +3 -3
- package/ui.text-empty/index.stories.js +1 -1
- package/ui.text-empty/index.vue +4 -4
- package/ui.text-file/index.vue +3 -3
- package/ui.text-files/index.vue +3 -3
- package/ui.text-header/index.vue +3 -3
- package/ui.text-money/index.vue +3 -3
- package/ui.text-notify/index.vue +3 -3
- package/web-types.json +249 -135
|
@@ -2,6 +2,8 @@ import { getArgTypes, getSlotNames, getSlotsFragment } from "../service.storyboo
|
|
|
2
2
|
|
|
3
3
|
import UDatePickerRange from "../ui.form-date-picker-range";
|
|
4
4
|
import URow from "../ui.container-row";
|
|
5
|
+
import UIcon from "../ui.image-icon";
|
|
6
|
+
import UButton from "../ui.button";
|
|
5
7
|
|
|
6
8
|
import { addDays } from "../ui.form-calendar/services/date.service";
|
|
7
9
|
|
|
@@ -31,7 +33,7 @@ export default {
|
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
const DefaultTemplate = (args) => ({
|
|
34
|
-
components: { UDatePickerRange },
|
|
36
|
+
components: { UDatePickerRange, UIcon, UButton },
|
|
35
37
|
setup() {
|
|
36
38
|
const slots = getSlotNames(UDatePickerRange.name);
|
|
37
39
|
|
|
@@ -165,22 +167,60 @@ customRangeButton.args = {
|
|
|
165
167
|
value: { from: null, to: null },
|
|
166
168
|
};
|
|
167
169
|
|
|
168
|
-
export const
|
|
169
|
-
|
|
170
|
+
export const leftIcon = DefaultTemplate.bind({});
|
|
171
|
+
leftIcon.args = {
|
|
172
|
+
leftIcon: "star",
|
|
173
|
+
variant: "input",
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export const rightIcon = DefaultTemplate.bind({});
|
|
177
|
+
rightIcon.args = {
|
|
178
|
+
rightIcon: "star",
|
|
179
|
+
variant: "input",
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
export const leftIconSlot = DefaultTemplate.bind({});
|
|
183
|
+
leftIconSlot.args = {
|
|
184
|
+
variant: "input",
|
|
185
|
+
slotTemplate: `
|
|
186
|
+
<template #left-icon>
|
|
187
|
+
<UIcon
|
|
188
|
+
name="archive"
|
|
189
|
+
color="red"
|
|
190
|
+
/>
|
|
191
|
+
</template>
|
|
192
|
+
`,
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
export const rightIconSlot = DefaultTemplate.bind({});
|
|
196
|
+
rightIconSlot.args = {
|
|
197
|
+
variant: "input",
|
|
198
|
+
slotTemplate: `
|
|
199
|
+
<template #right-icon>
|
|
200
|
+
<UIcon
|
|
201
|
+
name="archive"
|
|
202
|
+
color="red"
|
|
203
|
+
/>
|
|
204
|
+
</template>
|
|
205
|
+
`,
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
export const leftSlot = DefaultTemplate.bind({});
|
|
209
|
+
leftSlot.args = {
|
|
170
210
|
variant: "input",
|
|
171
211
|
slotTemplate: `
|
|
172
212
|
<template #left>
|
|
173
|
-
|
|
213
|
+
<UButton variant="thirdary" filled square label="Filter" class="rounded-r-none h-full" />
|
|
174
214
|
</template>
|
|
175
215
|
`,
|
|
176
216
|
};
|
|
177
217
|
|
|
178
|
-
export const
|
|
179
|
-
|
|
218
|
+
export const rightSlot = DefaultTemplate.bind({});
|
|
219
|
+
rightSlot.args = {
|
|
180
220
|
variant: "input",
|
|
181
221
|
slotTemplate: `
|
|
182
222
|
<template #right>
|
|
183
|
-
|
|
223
|
+
<UButton variant="thirdary" filled square label="Filter" class="rounded-l-none" />
|
|
184
224
|
</template>
|
|
185
225
|
`,
|
|
186
226
|
};
|
|
@@ -12,18 +12,28 @@
|
|
|
12
12
|
:description="description"
|
|
13
13
|
:error="error"
|
|
14
14
|
readonly
|
|
15
|
+
:left-icon="leftIcon"
|
|
16
|
+
:right-icon="rightIcon"
|
|
15
17
|
v-bind="inputAttrs"
|
|
16
18
|
@focus="activate"
|
|
17
19
|
>
|
|
18
20
|
<template #left>
|
|
21
|
+
<!-- @slot Use it to add something before the date. -->
|
|
19
22
|
<slot name="left" />
|
|
20
23
|
</template>
|
|
21
24
|
|
|
25
|
+
<template #left-icon>
|
|
26
|
+
<!-- @slot Use it to add icon before the date. -->
|
|
27
|
+
<slot name="left-icon" />
|
|
28
|
+
</template>
|
|
29
|
+
|
|
22
30
|
<template #right-icon>
|
|
31
|
+
<!-- @slot Use it to add icon after the date. -->
|
|
23
32
|
<slot name="right-icon" />
|
|
24
33
|
</template>
|
|
25
34
|
|
|
26
35
|
<template #right>
|
|
36
|
+
<!-- @slot Use it to add something after the date. -->
|
|
27
37
|
<slot name="right" />
|
|
28
38
|
</template>
|
|
29
39
|
</UInput>
|
|
@@ -349,6 +359,22 @@ const props = defineProps({
|
|
|
349
359
|
default: getDefault(defaultConfig, UDatePickerRange).size,
|
|
350
360
|
},
|
|
351
361
|
|
|
362
|
+
/**
|
|
363
|
+
* Left side icon name.
|
|
364
|
+
*/
|
|
365
|
+
leftIcon: {
|
|
366
|
+
type: String,
|
|
367
|
+
default: "",
|
|
368
|
+
},
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Right side icon name.
|
|
372
|
+
*/
|
|
373
|
+
rightIcon: {
|
|
374
|
+
type: String,
|
|
375
|
+
default: "",
|
|
376
|
+
},
|
|
377
|
+
|
|
352
378
|
/**
|
|
353
379
|
* Label text for input type.
|
|
354
380
|
*/
|
|
@@ -415,9 +441,9 @@ const props = defineProps({
|
|
|
415
441
|
},
|
|
416
442
|
|
|
417
443
|
/**
|
|
418
|
-
* Data-
|
|
444
|
+
* Data-test attribute for automated testing.
|
|
419
445
|
*/
|
|
420
|
-
|
|
446
|
+
dataTest: {
|
|
421
447
|
type: String,
|
|
422
448
|
default: "",
|
|
423
449
|
},
|
|
@@ -43,8 +43,8 @@ export default /*tw*/ {
|
|
|
43
43
|
},
|
|
44
44
|
error: {
|
|
45
45
|
true: `
|
|
46
|
-
bg-red-50 hover:border-red-400 focus:border-red-500 focus:ring-red-
|
|
47
|
-
focus-within:border-red-500 focus-within:ring-red-
|
|
46
|
+
bg-red-50 hover:border-red-400 focus:border-red-500 focus:ring-red-700/15
|
|
47
|
+
focus-within:border-red-500 focus-within:ring-red-700/15
|
|
48
48
|
`,
|
|
49
49
|
},
|
|
50
50
|
},
|
package/ui.form-input/index.vue
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
:disabled="disabled"
|
|
50
50
|
:maxlength="maxLength"
|
|
51
51
|
:inputmode="inputmode"
|
|
52
|
-
:data-
|
|
52
|
+
:data-test="dataTest"
|
|
53
53
|
v-bind="inputAttrs"
|
|
54
54
|
@focus="onFocus"
|
|
55
55
|
@blur="onBlur"
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
color="gray"
|
|
68
68
|
interactive
|
|
69
69
|
internal
|
|
70
|
-
:data-
|
|
70
|
+
:data-test="`${dataTest}-show-password`"
|
|
71
71
|
v-bind="passwordIconAttrs"
|
|
72
72
|
@click="onClickShowPassword"
|
|
73
73
|
/>
|
|
@@ -315,9 +315,9 @@ const props = defineProps({
|
|
|
315
315
|
},
|
|
316
316
|
|
|
317
317
|
/**
|
|
318
|
-
* Data-
|
|
318
|
+
* Data-test attribute for automated testing.
|
|
319
319
|
*/
|
|
320
|
-
|
|
320
|
+
dataTest: {
|
|
321
321
|
type: String,
|
|
322
322
|
default: "",
|
|
323
323
|
},
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
<template #right="{ file }">
|
|
26
26
|
<UIcon
|
|
27
27
|
v-if="props.multiple && !disabled"
|
|
28
|
-
|
|
28
|
+
round
|
|
29
29
|
internal
|
|
30
30
|
interactive
|
|
31
31
|
color="brand"
|
|
32
32
|
:size="removeItemIconSize"
|
|
33
33
|
:name="config.removeItemIconName"
|
|
34
|
-
:data-
|
|
34
|
+
:data-test="`${dataTest}-remove-item`"
|
|
35
35
|
v-bind="removeItemIconAttrs"
|
|
36
36
|
@click.stop.prevent="onClickRemoveItem(file.id)"
|
|
37
37
|
/>
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
:label="currentLocale.uploadFile"
|
|
52
52
|
:disabled="disabled"
|
|
53
53
|
v-bind="chooseFileButtonAttrs"
|
|
54
|
-
:data-
|
|
54
|
+
:data-test="`${dataTest}-upload`"
|
|
55
55
|
/>
|
|
56
56
|
|
|
57
57
|
<input
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
|
|
68
68
|
<UButton
|
|
69
69
|
v-if="isValue && !disabled"
|
|
70
|
-
|
|
70
|
+
round
|
|
71
71
|
square
|
|
72
72
|
filled
|
|
73
73
|
no-ring
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
:disabled="disabled"
|
|
77
77
|
:left-icon="config.clearIconName"
|
|
78
78
|
v-bind="clearButtonAttrs"
|
|
79
|
-
:data-
|
|
79
|
+
:data-test="`${dataTest}-clear`"
|
|
80
80
|
@click="onClickResetFiles"
|
|
81
81
|
/>
|
|
82
82
|
</div>
|
|
@@ -209,9 +209,9 @@ const props = defineProps({
|
|
|
209
209
|
},
|
|
210
210
|
|
|
211
211
|
/**
|
|
212
|
-
* Data-
|
|
212
|
+
* Data-test attribute for automated testing.
|
|
213
213
|
*/
|
|
214
|
-
|
|
214
|
+
dataTest: {
|
|
215
215
|
type: String,
|
|
216
216
|
default: "",
|
|
217
217
|
},
|
|
@@ -2,6 +2,8 @@ import { getArgTypes, getSlotNames, getSlotsFragment } from "../service.storyboo
|
|
|
2
2
|
|
|
3
3
|
import UInputMoney from "../ui.form-input-money";
|
|
4
4
|
import UCol from "../ui.container-col";
|
|
5
|
+
import UIcon from "../ui.image-icon";
|
|
6
|
+
import UButton from "../ui.button";
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* The `UInputMoney` component. | [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/ui.form-input-money)
|
|
@@ -20,7 +22,7 @@ export default {
|
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
const DefaultTemplate = (args) => ({
|
|
23
|
-
components: { UInputMoney },
|
|
25
|
+
components: { UInputMoney, UIcon, UButton },
|
|
24
26
|
setup() {
|
|
25
27
|
const slots = getSlotNames(UInputMoney.name);
|
|
26
28
|
|
|
@@ -101,3 +103,55 @@ readOnly.args = { readOnly: true };
|
|
|
101
103
|
|
|
102
104
|
export const disabled = DefaultTemplate.bind({});
|
|
103
105
|
disabled.args = { disabled: true };
|
|
106
|
+
|
|
107
|
+
export const leftIcon = DefaultTemplate.bind({});
|
|
108
|
+
leftIcon.args = {
|
|
109
|
+
leftIcon: "star",
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export const rightIcon = DefaultTemplate.bind({});
|
|
113
|
+
rightIcon.args = {
|
|
114
|
+
rightIcon: "star",
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export const leftIconSlot = DefaultTemplate.bind({});
|
|
118
|
+
leftIconSlot.args = {
|
|
119
|
+
slotTemplate: `
|
|
120
|
+
<template #left-icon>
|
|
121
|
+
<UIcon
|
|
122
|
+
name="archive"
|
|
123
|
+
color="red"
|
|
124
|
+
/>
|
|
125
|
+
</template>
|
|
126
|
+
`,
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export const rightIconSlot = DefaultTemplate.bind({});
|
|
130
|
+
rightIconSlot.args = {
|
|
131
|
+
slotTemplate: `
|
|
132
|
+
<template #right-icon>
|
|
133
|
+
<UIcon
|
|
134
|
+
name="archive"
|
|
135
|
+
color="red"
|
|
136
|
+
/>
|
|
137
|
+
</template>
|
|
138
|
+
`,
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export const leftSlot = DefaultTemplate.bind({});
|
|
142
|
+
leftSlot.args = {
|
|
143
|
+
slotTemplate: `
|
|
144
|
+
<template #left>
|
|
145
|
+
<UButton variant="thirdary" filled square label="Filter" class="rounded-r-none h-full" />
|
|
146
|
+
</template>
|
|
147
|
+
`,
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export const rightSlot = DefaultTemplate.bind({});
|
|
151
|
+
rightSlot.args = {
|
|
152
|
+
slotTemplate: `
|
|
153
|
+
<template #right>
|
|
154
|
+
<UButton variant="thirdary" filled square label="Filter" class="rounded-l-none" />
|
|
155
|
+
</template>
|
|
156
|
+
`,
|
|
157
|
+
};
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
:error="error"
|
|
12
12
|
:disabled="disabled"
|
|
13
13
|
inputmode="decimal"
|
|
14
|
-
:data-
|
|
14
|
+
:data-test="`${dataTest}-base-currency`"
|
|
15
|
+
:left-icon="leftIcon"
|
|
16
|
+
:right-icon="rightIcon"
|
|
15
17
|
v-bind="inputAttrs"
|
|
16
18
|
@keyup="onKeyup"
|
|
17
19
|
@blur="onBlur"
|
|
@@ -22,15 +24,20 @@
|
|
|
22
24
|
<slot name="left" />
|
|
23
25
|
</template>
|
|
24
26
|
|
|
25
|
-
<template #
|
|
26
|
-
<!-- @slot Use it to add
|
|
27
|
-
<slot name="
|
|
27
|
+
<template #left-icon>
|
|
28
|
+
<!-- @slot Use it to add icon before the text. -->
|
|
29
|
+
<slot name="left-icon" />
|
|
28
30
|
</template>
|
|
29
31
|
|
|
30
32
|
<template #right-icon>
|
|
31
|
-
<!-- @slot Use it to add
|
|
33
|
+
<!-- @slot Use it to add icon after the text. -->
|
|
32
34
|
<slot name="right-icon" />
|
|
33
35
|
</template>
|
|
36
|
+
|
|
37
|
+
<template #right>
|
|
38
|
+
<!-- @slot Use it to add something right. -->
|
|
39
|
+
<slot name="right" />
|
|
40
|
+
</template>
|
|
34
41
|
</UInput>
|
|
35
42
|
</template>
|
|
36
43
|
|
|
@@ -116,6 +123,22 @@ const props = defineProps({
|
|
|
116
123
|
default: getDefault(defaultConfig, UInputMoney).size,
|
|
117
124
|
},
|
|
118
125
|
|
|
126
|
+
/**
|
|
127
|
+
* Left side icon name.
|
|
128
|
+
*/
|
|
129
|
+
leftIcon: {
|
|
130
|
+
type: String,
|
|
131
|
+
default: "",
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Right side icon name.
|
|
136
|
+
*/
|
|
137
|
+
rightIcon: {
|
|
138
|
+
type: String,
|
|
139
|
+
default: "",
|
|
140
|
+
},
|
|
141
|
+
|
|
119
142
|
/**
|
|
120
143
|
* Number of signs after the comma.
|
|
121
144
|
*/
|
|
@@ -198,9 +221,9 @@ const props = defineProps({
|
|
|
198
221
|
},
|
|
199
222
|
|
|
200
223
|
/**
|
|
201
|
-
* Data-
|
|
224
|
+
* Data-test attribute for automated testing.
|
|
202
225
|
*/
|
|
203
|
-
|
|
226
|
+
dataTest: {
|
|
204
227
|
type: String,
|
|
205
228
|
default: "",
|
|
206
229
|
},
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :data-
|
|
2
|
+
<div :data-test="dataTest" v-bind="wrapperAttrs">
|
|
3
3
|
<UButton
|
|
4
4
|
variant="thirdary"
|
|
5
5
|
size="sm"
|
|
6
6
|
filled
|
|
7
7
|
square
|
|
8
|
-
|
|
8
|
+
round
|
|
9
9
|
:disabled="isRemoveButtonDisabled"
|
|
10
10
|
v-bind="removeButtonAttrs"
|
|
11
11
|
@click="onClickRemove"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
:size="size"
|
|
16
16
|
:name="config.removeIconName"
|
|
17
17
|
:color="isRemoveButtonDisabled ? 'gray' : 'grayscale'"
|
|
18
|
-
:data-
|
|
18
|
+
:data-test="`${dataTest}-remove`"
|
|
19
19
|
v-bind="removeIconAttrs"
|
|
20
20
|
/>
|
|
21
21
|
</UButton>
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
size="sm"
|
|
31
31
|
filled
|
|
32
32
|
square
|
|
33
|
-
|
|
33
|
+
round
|
|
34
34
|
:disabled="isAddButtonDisabled"
|
|
35
35
|
v-bind="addButtonAttrs"
|
|
36
36
|
@click="onClickAdd"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
:size="size"
|
|
41
41
|
:name="config.addIconName"
|
|
42
42
|
:color="isAddButtonDisabled ? 'gray' : 'grayscale'"
|
|
43
|
-
:data-
|
|
43
|
+
:data-test="`${dataTest}-add`"
|
|
44
44
|
v-bind="addIconAttrs"
|
|
45
45
|
/>
|
|
46
46
|
</UButton>
|
|
@@ -120,9 +120,9 @@ const props = defineProps({
|
|
|
120
120
|
},
|
|
121
121
|
|
|
122
122
|
/**
|
|
123
|
-
* Data-
|
|
123
|
+
* Data-test attribute for automated testing.
|
|
124
124
|
*/
|
|
125
|
-
|
|
125
|
+
dataTest: {
|
|
126
126
|
type: String,
|
|
127
127
|
default: "",
|
|
128
128
|
},
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
:align="labelAlign"
|
|
7
7
|
:description="description"
|
|
8
8
|
v-bind="labelAttrs"
|
|
9
|
-
:data-
|
|
9
|
+
:data-test="dataTest"
|
|
10
10
|
>
|
|
11
11
|
<div v-bind="wrapperAttrs">
|
|
12
12
|
<div v-if="counter || hasSlotContent($slots['counter'])" v-bind="counterAttrs">
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
:interactive="selectable"
|
|
31
31
|
:name="star <= counterValue ? config.selectedIconName : config.unselectedIconName"
|
|
32
32
|
v-bind="starAttrs"
|
|
33
|
-
:data-
|
|
33
|
+
:data-test="`${dataTest}-rating-star-${star}`"
|
|
34
34
|
@click="onClickStar(star)"
|
|
35
35
|
@mouseleave="onMouseHover()"
|
|
36
36
|
@mouseover="onMouseHover(star)"
|
|
@@ -155,9 +155,9 @@ const props = defineProps({
|
|
|
155
155
|
},
|
|
156
156
|
|
|
157
157
|
/**
|
|
158
|
-
* Data-
|
|
158
|
+
* Data-test attribute for automated testing.
|
|
159
159
|
*/
|
|
160
|
-
|
|
160
|
+
dataTest: {
|
|
161
161
|
type: String,
|
|
162
162
|
default: "",
|
|
163
163
|
},
|
|
@@ -2,6 +2,7 @@ import { getArgTypes, getSlotNames, getSlotsFragment } from "../service.storyboo
|
|
|
2
2
|
|
|
3
3
|
import UInputSearch from "../ui.form-input-search";
|
|
4
4
|
import UButton from "../ui.button";
|
|
5
|
+
import UIcon from "../ui.image-icon";
|
|
5
6
|
import URow from "../ui.container-row";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -17,7 +18,7 @@ export default {
|
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
const DefaultTemplate = (args) => ({
|
|
20
|
-
components: { UInputSearch, UButton },
|
|
21
|
+
components: { UInputSearch, UButton, UIcon },
|
|
21
22
|
setup() {
|
|
22
23
|
const slots = getSlotNames(UInputSearch.name);
|
|
23
24
|
|
|
@@ -61,17 +62,54 @@ searchButton.args = { searchButtonLabel: "Search" };
|
|
|
61
62
|
export const sizes = EnumVariantTemplate.bind({});
|
|
62
63
|
sizes.args = { enum: "size" };
|
|
63
64
|
|
|
64
|
-
export const
|
|
65
|
-
|
|
65
|
+
export const leftIcon = DefaultTemplate.bind({});
|
|
66
|
+
leftIcon.args = {
|
|
67
|
+
leftIcon: "star",
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const rightIcon = DefaultTemplate.bind({});
|
|
71
|
+
rightIcon.args = {
|
|
72
|
+
rightIcon: "star",
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const leftIconSlot = DefaultTemplate.bind({});
|
|
76
|
+
leftIconSlot.args = {
|
|
66
77
|
slotTemplate: `
|
|
67
|
-
<template #left>
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
78
|
+
<template #left-icon>
|
|
79
|
+
<UIcon
|
|
80
|
+
name="archive"
|
|
81
|
+
color="red"
|
|
82
|
+
/>
|
|
83
|
+
</template>
|
|
84
|
+
`,
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const rightIconSlot = DefaultTemplate.bind({});
|
|
88
|
+
rightIconSlot.args = {
|
|
89
|
+
slotTemplate: `
|
|
90
|
+
<template #right-icon>
|
|
91
|
+
<UIcon
|
|
92
|
+
name="archive"
|
|
93
|
+
color="red"
|
|
74
94
|
/>
|
|
75
95
|
</template>
|
|
76
96
|
`,
|
|
77
97
|
};
|
|
98
|
+
|
|
99
|
+
export const leftSlot = DefaultTemplate.bind({});
|
|
100
|
+
leftSlot.args = {
|
|
101
|
+
slotTemplate: `
|
|
102
|
+
<template #left>
|
|
103
|
+
<UButton variant="thirdary" filled square label="Filter" class="rounded-r-none h-full" />
|
|
104
|
+
</template>
|
|
105
|
+
`,
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export const rightSlot = DefaultTemplate.bind({});
|
|
109
|
+
rightSlot.args = {
|
|
110
|
+
slotTemplate: `
|
|
111
|
+
<template #right>
|
|
112
|
+
<UButton variant="thirdary" filled square label="Filter" class="rounded-l-none" />
|
|
113
|
+
</template>
|
|
114
|
+
`,
|
|
115
|
+
};
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
:description="description"
|
|
13
13
|
:placeholder="placeholder"
|
|
14
14
|
inputmode="search"
|
|
15
|
-
:data-
|
|
15
|
+
:data-test="dataTest"
|
|
16
|
+
:left-icon="leftIcon"
|
|
16
17
|
v-bind="inputAttrs"
|
|
17
18
|
@keyup.enter="onClickSearch"
|
|
18
19
|
>
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
interactive
|
|
34
35
|
color="gray"
|
|
35
36
|
:name="config.clearIconName"
|
|
36
|
-
:data-
|
|
37
|
+
:data-test="`${dataTest}-close`"
|
|
37
38
|
:size="iconSize"
|
|
38
39
|
v-bind="clearIconAttrs"
|
|
39
40
|
@click="onClickClear"
|
|
@@ -51,8 +52,8 @@
|
|
|
51
52
|
internal
|
|
52
53
|
interactive
|
|
53
54
|
:size="iconSize"
|
|
54
|
-
:name="config.searchIconName"
|
|
55
|
-
:data-
|
|
55
|
+
:name="rightIcon || config.searchIconName"
|
|
56
|
+
:data-test="`${dataTest}-search`"
|
|
56
57
|
v-bind="searchIconAttrs"
|
|
57
58
|
@click="onClickSearch"
|
|
58
59
|
/>
|
|
@@ -68,7 +69,7 @@
|
|
|
68
69
|
:size="buttonSize"
|
|
69
70
|
no-ring
|
|
70
71
|
v-bind="buttonAttrs"
|
|
71
|
-
:data-
|
|
72
|
+
:data-test="`${dataTest}-right`"
|
|
72
73
|
@click="onClickSearch"
|
|
73
74
|
/>
|
|
74
75
|
</slot>
|
|
@@ -110,6 +111,22 @@ const props = defineProps({
|
|
|
110
111
|
default: getDefault(defaultConfig, UInputSearch).size,
|
|
111
112
|
},
|
|
112
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Left side icon name.
|
|
116
|
+
*/
|
|
117
|
+
leftIcon: {
|
|
118
|
+
type: String,
|
|
119
|
+
default: "",
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Right side icon name.
|
|
124
|
+
*/
|
|
125
|
+
rightIcon: {
|
|
126
|
+
type: String,
|
|
127
|
+
default: "",
|
|
128
|
+
},
|
|
129
|
+
|
|
113
130
|
/**
|
|
114
131
|
* Input placeholder.
|
|
115
132
|
*/
|
|
@@ -198,9 +215,9 @@ const props = defineProps({
|
|
|
198
215
|
},
|
|
199
216
|
|
|
200
217
|
/**
|
|
201
|
-
* Data-
|
|
218
|
+
* Data-test attribute for automated testing.
|
|
202
219
|
*/
|
|
203
|
-
|
|
220
|
+
dataTest: {
|
|
204
221
|
type: String,
|
|
205
222
|
default: "",
|
|
206
223
|
},
|
package/ui.form-label/index.vue
CHANGED
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
<label
|
|
15
15
|
v-if="label"
|
|
16
16
|
:for="props.for"
|
|
17
|
-
:data-
|
|
17
|
+
:data-test="`${dataTest}-label`"
|
|
18
18
|
v-bind="labelAttrs"
|
|
19
19
|
v-text="label"
|
|
20
20
|
/>
|
|
21
21
|
|
|
22
|
-
<div v-if="error" :data-
|
|
22
|
+
<div v-if="error" :data-test="`${dataTest}-error`" v-bind="descriptionAttrs" v-text="error" />
|
|
23
23
|
|
|
24
24
|
<div
|
|
25
25
|
v-if="description && !error"
|
|
26
|
-
:data-
|
|
26
|
+
:data-test="`${dataTest}-description`"
|
|
27
27
|
v-bind="descriptionAttrs"
|
|
28
28
|
v-text="description"
|
|
29
29
|
/>
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
v-if="label"
|
|
39
39
|
ref="labelRef"
|
|
40
40
|
:for="props.for"
|
|
41
|
-
:data-
|
|
41
|
+
:data-test="`${dataTest}-label`"
|
|
42
42
|
v-bind="labelAttrs"
|
|
43
43
|
v-text="label"
|
|
44
44
|
/>
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
<!-- @slot Use it to wrap something into the label. -->
|
|
47
47
|
<slot />
|
|
48
48
|
|
|
49
|
-
<div v-if="error" :data-
|
|
49
|
+
<div v-if="error" :data-test="`${dataTest}-error`" v-bind="descriptionAttrs" v-text="error" />
|
|
50
50
|
|
|
51
51
|
<div
|
|
52
52
|
v-if="description && !error"
|
|
53
|
-
:data-
|
|
53
|
+
:data-test="`${dataTest}-description`"
|
|
54
54
|
v-bind="descriptionAttrs"
|
|
55
55
|
v-text="description"
|
|
56
56
|
/>
|
|
@@ -156,9 +156,9 @@ const props = defineProps({
|
|
|
156
156
|
},
|
|
157
157
|
|
|
158
158
|
/**
|
|
159
|
-
*
|
|
159
|
+
* Data-test attribute for automated testing.
|
|
160
160
|
*/
|
|
161
|
-
|
|
161
|
+
dataTest: {
|
|
162
162
|
type: String,
|
|
163
163
|
default: "",
|
|
164
164
|
},
|