vueless 0.0.411 → 0.0.413
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 +1 -1
- package/ui.data-table/UTable.vue +3 -3
- package/ui.data-table/UTableRow.vue +10 -1
- package/ui.form-checkbox/UCheckbox.vue +3 -2
- package/ui.form-checkbox-group/UCheckboxGroup.vue +1 -0
- package/ui.form-checkbox-multi-state/UCheckboxMultiState.vue +2 -2
- package/ui.form-checkbox-multi-state/config.js +1 -1
- package/ui.form-checkbox-multi-state/useAttrs.js +1 -1
- package/ui.form-color-picker/UColorPicker.vue +4 -4
- package/ui.form-color-picker/config.js +2 -2
- package/ui.form-date-picker/UDatePicker.vue +1 -1
- package/ui.form-input/UInput.vue +1 -1
- package/ui.form-input-file/UInputFile.vue +41 -41
- package/ui.form-input-file/config.js +6 -6
- package/ui.form-input-money/UInputMoney.vue +3 -3
- package/ui.form-input-money/config.js +1 -1
- package/ui.form-input-number/UInputNumber.vue +37 -4
- package/ui.form-input-number/config.js +1 -1
- package/ui.form-input-rating/UInputRating.vue +2 -2
- package/ui.form-input-rating/config.js +1 -1
- package/ui.form-input-search/UInputSearch.vue +30 -26
- package/ui.form-input-search/config.js +2 -2
- package/ui.form-label/ULabel.vue +42 -36
- package/ui.form-radio/URadio.vue +4 -3
- package/ui.form-radio-group/URadioGroup.vue +2 -1
- package/ui.form-select/USelect.vue +1 -1
- package/ui.form-switch/USwitch.vue +8 -8
- package/ui.form-textarea/UTextarea.vue +1 -1
- package/utils/utilStorybook.js +7 -0
- package/web-types.json +149 -107
package/package.json
CHANGED
package/ui.data-table/UTable.vue
CHANGED
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
:columns="columns"
|
|
191
191
|
:config="config"
|
|
192
192
|
:attrs="keysAttrs"
|
|
193
|
-
v-bind="getRowAttrs(row)"
|
|
193
|
+
v-bind="getRowAttrs(row.id)"
|
|
194
194
|
:class="cx([getRowAttrs(row.id).class, getRowClasses(row)])"
|
|
195
195
|
@click="onClickRow"
|
|
196
196
|
@toggle-row-visibility="onToggleRowVisibility"
|
|
@@ -331,7 +331,7 @@ const props = defineProps({
|
|
|
331
331
|
* Show date divider line between dates.
|
|
332
332
|
*/
|
|
333
333
|
dateDivider: {
|
|
334
|
-
type: [
|
|
334
|
+
type: [Boolean, Array],
|
|
335
335
|
default: getDefault(defaultConfig, UTable).dateDivider,
|
|
336
336
|
},
|
|
337
337
|
|
|
@@ -610,7 +610,7 @@ function shouldDisplayDateSeparator(rowIndex) {
|
|
|
610
610
|
}
|
|
611
611
|
|
|
612
612
|
function getRowAttrs(rowId) {
|
|
613
|
-
return selectedRows.value.includes(rowId) ? bodyRowCheckedAttrs : bodyRowAttrs;
|
|
613
|
+
return selectedRows.value.includes(rowId) ? bodyRowCheckedAttrs.value : bodyRowAttrs.value;
|
|
614
614
|
}
|
|
615
615
|
|
|
616
616
|
function getRowClasses(row) {
|
|
@@ -36,7 +36,10 @@
|
|
|
36
36
|
/>
|
|
37
37
|
</div>
|
|
38
38
|
|
|
39
|
-
<div
|
|
39
|
+
<div
|
|
40
|
+
v-if="isCellObject(value)"
|
|
41
|
+
:class="cx([bodyCellPrimaryAttrs.class, getCellContentClasses(row, key)])"
|
|
42
|
+
>
|
|
40
43
|
<slot :name="`cell-${key}`" :value="value" :row="row">
|
|
41
44
|
<div v-bind="bodyCellPrimaryAttrs" ref="cellRef" :data-test="`${dataTest}-${key}-cell`">
|
|
42
45
|
{{ getCellPrimaryContent(value) }}
|
|
@@ -196,6 +199,12 @@ function getCellClasses(row, key) {
|
|
|
196
199
|
return typeof cellClasses === "function" ? cellClasses(row[key].value, row) : cellClasses;
|
|
197
200
|
}
|
|
198
201
|
|
|
202
|
+
function getCellContentClasses(row, key) {
|
|
203
|
+
const cellClasses = row[key]?.contentClasses || "";
|
|
204
|
+
|
|
205
|
+
return typeof cellClasses === "function" ? cellClasses(row[key].value, row) : cellClasses;
|
|
206
|
+
}
|
|
207
|
+
|
|
199
208
|
function isCellObject(value) {
|
|
200
209
|
return typeof value === "object" && value !== null && ("primary" in value || "value" in value);
|
|
201
210
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
:size="size"
|
|
8
8
|
:color="color"
|
|
9
9
|
:placement="placement"
|
|
10
|
-
v-bind="
|
|
10
|
+
v-bind="multiStateCheckboxAttrs"
|
|
11
11
|
@input="onClickCheckbox"
|
|
12
12
|
/>
|
|
13
13
|
</template>
|
|
@@ -114,7 +114,7 @@ const isChecked = ref(false);
|
|
|
114
114
|
|
|
115
115
|
const selected = computed(() => props.options[index.value]);
|
|
116
116
|
|
|
117
|
-
const {
|
|
117
|
+
const { multiStateCheckboxAttrs } = useAttrs(props, { selected });
|
|
118
118
|
|
|
119
119
|
watchEffect(setIndex);
|
|
120
120
|
|
|
@@ -8,7 +8,7 @@ export default function useAttrs(props, { selected }) {
|
|
|
8
8
|
|
|
9
9
|
const keysAttrs = getKeysAttrs();
|
|
10
10
|
|
|
11
|
-
const { checkboxAttrs } = keysAttrs;
|
|
11
|
+
const { multiStateCheckboxAttrs: checkboxAttrs } = keysAttrs;
|
|
12
12
|
|
|
13
13
|
keysAttrs.checkboxAttrs = computed(() => {
|
|
14
14
|
if (selected.value.icon) {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
color="gray"
|
|
19
19
|
:checked="selectedItem === ''"
|
|
20
20
|
:disabled="disabled"
|
|
21
|
-
v-bind="
|
|
21
|
+
v-bind="unselectedColorPickerRadioAttrs"
|
|
22
22
|
@update:model-value="onUpdateValue('')"
|
|
23
23
|
/>
|
|
24
24
|
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
:color="color"
|
|
44
44
|
:checked="selectedItem === color"
|
|
45
45
|
:disabled="disabled"
|
|
46
|
-
v-bind="
|
|
46
|
+
v-bind="colorPickerRadioAttrs"
|
|
47
47
|
@update:model-value="onUpdateValue(color)"
|
|
48
48
|
/>
|
|
49
49
|
</div>
|
|
@@ -169,10 +169,10 @@ const {
|
|
|
169
169
|
config,
|
|
170
170
|
colorPickerLabelAttrs,
|
|
171
171
|
listAttrs,
|
|
172
|
-
|
|
172
|
+
colorPickerRadioAttrs,
|
|
173
|
+
unselectedColorPickerRadioAttrs,
|
|
173
174
|
unselectedIconAttrs,
|
|
174
175
|
unselectedAttrs,
|
|
175
|
-
unselectedRadioAttrs,
|
|
176
176
|
} = useAttrs(props);
|
|
177
177
|
|
|
178
178
|
const selectedItem = computed({
|
|
@@ -12,11 +12,11 @@ export default /*tw*/ {
|
|
|
12
12
|
},
|
|
13
13
|
unselected: "relative flex",
|
|
14
14
|
unselectedIcon: "{UIcon} absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",
|
|
15
|
-
|
|
15
|
+
unselectedColorPickerRadio: {
|
|
16
16
|
component: "{URadio}",
|
|
17
17
|
radio: "checked:text-white !border-gray-300",
|
|
18
18
|
},
|
|
19
|
-
|
|
19
|
+
colorPickerRadio: {
|
|
20
20
|
component: "{URadio}",
|
|
21
21
|
radio: `
|
|
22
22
|
bg-{color}-600 border-{color}-600 hover:border-{color}-600 active:bg-{color}-800
|
package/ui.form-input/UInput.vue
CHANGED
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
:description="description"
|
|
10
10
|
v-bind="inputLabelAttrs"
|
|
11
11
|
>
|
|
12
|
-
<div ref="dropZoneRef" :ondrop="onDrop" v-bind="
|
|
12
|
+
<div ref="dropZoneRef" :ondrop="onDrop" v-bind="dropzoneAttrs">
|
|
13
13
|
<UText v-if="hasSlotContent($slots['top'])" :size="size" v-bind="descriptionTopAttrs">
|
|
14
|
-
<!-- @slot Use it to add something
|
|
14
|
+
<!-- @slot Use it to add something above the component content. -->
|
|
15
15
|
<slot name="top" />
|
|
16
16
|
</UText>
|
|
17
17
|
|
|
18
|
-
<div v-bind="
|
|
18
|
+
<div v-bind="contentAttrs">
|
|
19
19
|
<!-- @slot Use it to add something before the placeholder. -->
|
|
20
20
|
<slot name="left" />
|
|
21
21
|
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
</template>
|
|
41
41
|
</UFiles>
|
|
42
42
|
|
|
43
|
-
<div v-bind="
|
|
43
|
+
<div v-bind="buttonsAttrs">
|
|
44
44
|
<template v-if="Array.isArray(currentFiles) || !currentFiles">
|
|
45
45
|
<UButton
|
|
46
46
|
filled
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
</div>
|
|
87
87
|
|
|
88
88
|
<UText v-if="hasSlotContent($slots['bottom'])" :size="size" v-bind="descriptionBottomAttrs">
|
|
89
|
-
<!-- @slot Use it to add something
|
|
89
|
+
<!-- @slot Use it to add something below the component content. -->
|
|
90
90
|
<slot name="bottom" />
|
|
91
91
|
</UText>
|
|
92
92
|
</div>
|
|
@@ -115,7 +115,15 @@ defineOptions({ inheritAttrs: false });
|
|
|
115
115
|
|
|
116
116
|
const props = defineProps({
|
|
117
117
|
/**
|
|
118
|
-
*
|
|
118
|
+
* Input value.
|
|
119
|
+
*/
|
|
120
|
+
modelValue: {
|
|
121
|
+
type: [Array, File],
|
|
122
|
+
default: null,
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Input label.
|
|
119
127
|
*/
|
|
120
128
|
label: {
|
|
121
129
|
type: String,
|
|
@@ -123,7 +131,7 @@ const props = defineProps({
|
|
|
123
131
|
},
|
|
124
132
|
|
|
125
133
|
/**
|
|
126
|
-
*
|
|
134
|
+
* Input description.
|
|
127
135
|
*/
|
|
128
136
|
description: {
|
|
129
137
|
type: String,
|
|
@@ -131,7 +139,15 @@ const props = defineProps({
|
|
|
131
139
|
},
|
|
132
140
|
|
|
133
141
|
/**
|
|
134
|
-
*
|
|
142
|
+
* Error message.
|
|
143
|
+
*/
|
|
144
|
+
error: {
|
|
145
|
+
type: String,
|
|
146
|
+
default: "",
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Label placement.
|
|
135
151
|
* @values top, topInside, topWithDesc
|
|
136
152
|
*/
|
|
137
153
|
labelAlign: {
|
|
@@ -139,21 +155,17 @@ const props = defineProps({
|
|
|
139
155
|
default: getDefault(defaultConfig, UInputFile).labelAlign,
|
|
140
156
|
},
|
|
141
157
|
|
|
142
|
-
modelValue: {
|
|
143
|
-
type: [Array, File],
|
|
144
|
-
default: null,
|
|
145
|
-
},
|
|
146
|
-
|
|
147
158
|
/**
|
|
148
|
-
*
|
|
159
|
+
* Input size.
|
|
160
|
+
* @values sm, md, lg
|
|
149
161
|
*/
|
|
150
|
-
|
|
151
|
-
type:
|
|
152
|
-
default: getDefault(defaultConfig, UInputFile).
|
|
162
|
+
size: {
|
|
163
|
+
type: String,
|
|
164
|
+
default: getDefault(defaultConfig, UInputFile).size,
|
|
153
165
|
},
|
|
154
166
|
|
|
155
167
|
/**
|
|
156
|
-
*
|
|
168
|
+
* Max file size in megabytes.
|
|
157
169
|
*/
|
|
158
170
|
maxFileSize: {
|
|
159
171
|
type: Number,
|
|
@@ -161,7 +173,7 @@ const props = defineProps({
|
|
|
161
173
|
},
|
|
162
174
|
|
|
163
175
|
/**
|
|
164
|
-
*
|
|
176
|
+
* Allowed file types.
|
|
165
177
|
*/
|
|
166
178
|
allowedFileTypes: {
|
|
167
179
|
type: Array,
|
|
@@ -169,20 +181,11 @@ const props = defineProps({
|
|
|
169
181
|
},
|
|
170
182
|
|
|
171
183
|
/**
|
|
172
|
-
*
|
|
173
|
-
* @values sm, md, lg
|
|
174
|
-
*/
|
|
175
|
-
size: {
|
|
176
|
-
type: String,
|
|
177
|
-
default: getDefault(defaultConfig, UInputFile).size,
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Set error text for component.
|
|
184
|
+
* Allow selecting multiple files.
|
|
182
185
|
*/
|
|
183
|
-
|
|
184
|
-
type:
|
|
185
|
-
default:
|
|
186
|
+
multiple: {
|
|
187
|
+
type: Boolean,
|
|
188
|
+
default: getDefault(defaultConfig, UInputFile).multiple,
|
|
186
189
|
},
|
|
187
190
|
|
|
188
191
|
/**
|
|
@@ -242,15 +245,15 @@ const {
|
|
|
242
245
|
config,
|
|
243
246
|
inputLabelAttrs,
|
|
244
247
|
chooseFileButtonAttrs,
|
|
245
|
-
|
|
248
|
+
dropzoneAttrs,
|
|
246
249
|
descriptionTopAttrs,
|
|
247
250
|
descriptionBottomAttrs,
|
|
248
|
-
|
|
251
|
+
contentAttrs,
|
|
249
252
|
clearButtonAttrs,
|
|
250
253
|
placeholderAttrs,
|
|
251
254
|
inputAttrs,
|
|
252
255
|
fileListAttrs,
|
|
253
|
-
|
|
256
|
+
buttonsAttrs,
|
|
254
257
|
removeItemButtonAttrs,
|
|
255
258
|
hasSlotContent,
|
|
256
259
|
} = useAttrs(props);
|
|
@@ -285,10 +288,7 @@ const accept = computed(() => {
|
|
|
285
288
|
});
|
|
286
289
|
|
|
287
290
|
const isValue = computed(() => {
|
|
288
|
-
return (
|
|
289
|
-
(Array.isArray(currentFiles.value) && currentFiles.value?.length) ||
|
|
290
|
-
(!Array.isArray(currentFiles.value) && currentFiles.value)
|
|
291
|
-
);
|
|
291
|
+
return Array.isArray(currentFiles.value) ? !!currentFiles.value?.length : !!currentFiles.value;
|
|
292
292
|
});
|
|
293
293
|
|
|
294
294
|
const fileList = computed(() => {
|
|
@@ -389,13 +389,13 @@ function onClickResetFiles() {
|
|
|
389
389
|
function onDragOver(event) {
|
|
390
390
|
event.preventDefault();
|
|
391
391
|
|
|
392
|
-
dropZoneRef.value.classList.add(...config.value.
|
|
392
|
+
dropZoneRef.value.classList.add(...config.value.dropzoneHover.split(" "));
|
|
393
393
|
}
|
|
394
394
|
|
|
395
395
|
function onDragLeave(event) {
|
|
396
396
|
event.preventDefault();
|
|
397
397
|
|
|
398
|
-
dropZoneRef.value.classList.remove(...config.value.
|
|
398
|
+
dropZoneRef.value.classList.remove(...config.value.dropzoneHover.split(" "));
|
|
399
399
|
}
|
|
400
400
|
|
|
401
401
|
function onDrop(event) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
2
|
inputLabel: "{ULabel} w-full",
|
|
3
|
-
|
|
3
|
+
dropzone: {
|
|
4
4
|
base: `
|
|
5
5
|
p-3 size-auto w-full bg-white transition
|
|
6
6
|
rounded-dynamic border border-solid border-gray-300
|
|
@@ -21,9 +21,11 @@ export default /*tw*/ {
|
|
|
21
21
|
{ labelAlign: "topInside", label: true, size: "lg", class: "pt-9" },
|
|
22
22
|
],
|
|
23
23
|
},
|
|
24
|
+
dropzoneHover: "border-gray-400 border-dashed",
|
|
25
|
+
dropzoneError: "hover:border-red-400 border-dashed border-red-300",
|
|
24
26
|
descriptionTop: "{UText} text-gray-700 mb-2",
|
|
25
27
|
descriptionBottom: "{UText} text-gray-700 mt-2",
|
|
26
|
-
|
|
28
|
+
content: {
|
|
27
29
|
base: "p-3 gap-6 flex justify-between items-start relative w-full rounded-dynamic bg-brand-50",
|
|
28
30
|
variants: {
|
|
29
31
|
multiple: {
|
|
@@ -47,6 +49,8 @@ export default /*tw*/ {
|
|
|
47
49
|
},
|
|
48
50
|
},
|
|
49
51
|
},
|
|
52
|
+
fileList: "{UFiles} w-full",
|
|
53
|
+
buttons: "flex gap-3 items-center",
|
|
50
54
|
chooseFileButton: {
|
|
51
55
|
component: "{UButton}",
|
|
52
56
|
variants: {
|
|
@@ -57,11 +61,7 @@ export default /*tw*/ {
|
|
|
57
61
|
},
|
|
58
62
|
clearButton: "{UButton}",
|
|
59
63
|
removeItemButton: "{UButton} ml-2",
|
|
60
|
-
dropzoneWrapperHover: "border-gray-400 border-dashed",
|
|
61
|
-
dropzoneWrapperError: "hover:border-red-400 border-dashed border-red-300",
|
|
62
64
|
input: "sr-only",
|
|
63
|
-
buttonWrapper: "flex gap-3 items-center",
|
|
64
|
-
fileList: "{UFiles} w-full",
|
|
65
65
|
i18n: {
|
|
66
66
|
sizeError: "File size is too big.",
|
|
67
67
|
formatError: "Format is not supported.",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
:data-test="`${dataTest}-base-currency`"
|
|
15
15
|
:left-icon="leftIcon"
|
|
16
16
|
:right-icon="rightIcon"
|
|
17
|
-
v-bind="
|
|
17
|
+
v-bind="moneyInputAttrs"
|
|
18
18
|
@keyup="onKeyup"
|
|
19
19
|
@blur="onBlur"
|
|
20
20
|
@input="onInput"
|
|
@@ -72,7 +72,7 @@ const props = defineProps({
|
|
|
72
72
|
},
|
|
73
73
|
|
|
74
74
|
/**
|
|
75
|
-
*
|
|
75
|
+
* Label placement.
|
|
76
76
|
* @values top, topInside, topWithDesc, left, right
|
|
77
77
|
*/
|
|
78
78
|
labelAlign: {
|
|
@@ -232,7 +232,7 @@ const moneyInputRef = ref(null);
|
|
|
232
232
|
|
|
233
233
|
const elementId = props.id || useId();
|
|
234
234
|
|
|
235
|
-
const {
|
|
235
|
+
const { moneyInputAttrs } = useAttrs(props);
|
|
236
236
|
|
|
237
237
|
const { formattedValue, rawValue, setValue } = useFormatCurrency(`#${elementId}`, () => ({
|
|
238
238
|
minFractionDigits: props.minFractionDigits,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
filled
|
|
7
7
|
square
|
|
8
8
|
round
|
|
9
|
-
:disabled="isRemoveButtonDisabled"
|
|
9
|
+
:disabled="isRemoveButtonDisabled || disabled"
|
|
10
10
|
v-bind="removeButtonAttrs"
|
|
11
11
|
@click="onClickRemove"
|
|
12
12
|
>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
<div v-bind="numberAttrs">
|
|
24
24
|
<div v-bind="valueAttrs" v-text="count" />
|
|
25
|
-
<div v-bind="
|
|
25
|
+
<div v-bind="labelAttrs" v-text="label" />
|
|
26
26
|
</div>
|
|
27
27
|
|
|
28
28
|
<UButton
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
filled
|
|
32
32
|
square
|
|
33
33
|
round
|
|
34
|
-
:disabled="isAddButtonDisabled"
|
|
34
|
+
:disabled="isAddButtonDisabled || disabled"
|
|
35
35
|
v-bind="addButtonAttrs"
|
|
36
36
|
@click="onClickAdd"
|
|
37
37
|
>
|
|
@@ -101,6 +101,31 @@ const props = defineProps({
|
|
|
101
101
|
default: "",
|
|
102
102
|
},
|
|
103
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Label placement.
|
|
106
|
+
* @values top, topWithDesc, left, right
|
|
107
|
+
*/
|
|
108
|
+
labelAlign: {
|
|
109
|
+
type: String,
|
|
110
|
+
default: getDefault(defaultConfig, UInputNumber).labelAlign,
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Input description.
|
|
115
|
+
*/
|
|
116
|
+
description: {
|
|
117
|
+
type: String,
|
|
118
|
+
default: "",
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Error message.
|
|
123
|
+
*/
|
|
124
|
+
error: {
|
|
125
|
+
type: String,
|
|
126
|
+
default: "",
|
|
127
|
+
},
|
|
128
|
+
|
|
104
129
|
/**
|
|
105
130
|
* Input size.
|
|
106
131
|
* @values sm, md, lg
|
|
@@ -110,6 +135,14 @@ const props = defineProps({
|
|
|
110
135
|
default: getDefault(defaultConfig, UInputNumber).size,
|
|
111
136
|
},
|
|
112
137
|
|
|
138
|
+
/**
|
|
139
|
+
* Disable the input.
|
|
140
|
+
*/
|
|
141
|
+
disabled: {
|
|
142
|
+
type: Boolean,
|
|
143
|
+
default: getDefault(defaultConfig, UInputNumber).disabled,
|
|
144
|
+
},
|
|
145
|
+
|
|
113
146
|
/**
|
|
114
147
|
* Component config object.
|
|
115
148
|
*/
|
|
@@ -138,7 +171,7 @@ const emit = defineEmits([
|
|
|
138
171
|
const {
|
|
139
172
|
config,
|
|
140
173
|
valueAttrs,
|
|
141
|
-
|
|
174
|
+
labelAttrs,
|
|
142
175
|
removeButtonAttrs,
|
|
143
176
|
removeIconAttrs,
|
|
144
177
|
addButtonAttrs,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
v-bind="inputLabelAttrs"
|
|
9
9
|
:data-test="dataTest"
|
|
10
10
|
>
|
|
11
|
-
<div v-bind="
|
|
11
|
+
<div v-bind="containerAttrs">
|
|
12
12
|
<div v-if="counter || hasSlotContent($slots['counter'])" v-bind="counterAttrs">
|
|
13
13
|
<!--
|
|
14
14
|
@slot Use it to customise counter.
|
|
@@ -177,7 +177,7 @@ const hovered = ref(null);
|
|
|
177
177
|
const {
|
|
178
178
|
config,
|
|
179
179
|
inputLabelAttrs,
|
|
180
|
-
|
|
180
|
+
containerAttrs,
|
|
181
181
|
counterAttrs,
|
|
182
182
|
totalAttrs,
|
|
183
183
|
starsAttrs,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
:placeholder="placeholder"
|
|
14
14
|
inputmode="search"
|
|
15
15
|
:left-icon="leftIcon"
|
|
16
|
-
v-bind="
|
|
16
|
+
v-bind="searchInputAttrs"
|
|
17
17
|
:data-test="dataTest"
|
|
18
18
|
@update:model-value="onUpdateValue"
|
|
19
19
|
@keyup.enter="onKeyupEnter"
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
:label="searchButtonLabel"
|
|
70
70
|
:size="buttonSize"
|
|
71
71
|
no-ring
|
|
72
|
-
v-bind="
|
|
72
|
+
v-bind="searchButtonAttrs"
|
|
73
73
|
:data-test="`${dataTest}-search-button`"
|
|
74
74
|
@click="onClickSearch"
|
|
75
75
|
/>
|
|
@@ -111,22 +111,6 @@ const props = defineProps({
|
|
|
111
111
|
default: getDefault(defaultConfig, UInputSearch).size,
|
|
112
112
|
},
|
|
113
113
|
|
|
114
|
-
/**
|
|
115
|
-
* Left icon name.
|
|
116
|
-
*/
|
|
117
|
-
leftIcon: {
|
|
118
|
-
type: String,
|
|
119
|
-
default: "",
|
|
120
|
-
},
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Right icon name.
|
|
124
|
-
*/
|
|
125
|
-
rightIcon: {
|
|
126
|
-
type: String,
|
|
127
|
-
default: "",
|
|
128
|
-
},
|
|
129
|
-
|
|
130
114
|
/**
|
|
131
115
|
* Input placeholder.
|
|
132
116
|
*/
|
|
@@ -185,7 +169,31 @@ const props = defineProps({
|
|
|
185
169
|
},
|
|
186
170
|
|
|
187
171
|
/**
|
|
188
|
-
*
|
|
172
|
+
* Time in milliseconds before value emit.
|
|
173
|
+
*/
|
|
174
|
+
debounce: {
|
|
175
|
+
type: [Number, String],
|
|
176
|
+
default: getDefault(defaultConfig, UInputSearch).debounce,
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Left icon name.
|
|
181
|
+
*/
|
|
182
|
+
leftIcon: {
|
|
183
|
+
type: String,
|
|
184
|
+
default: "",
|
|
185
|
+
},
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Right icon name.
|
|
189
|
+
*/
|
|
190
|
+
rightIcon: {
|
|
191
|
+
type: String,
|
|
192
|
+
default: "",
|
|
193
|
+
},
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Make input read-only.
|
|
189
197
|
*/
|
|
190
198
|
readonly: {
|
|
191
199
|
type: Boolean,
|
|
@@ -193,7 +201,7 @@ const props = defineProps({
|
|
|
193
201
|
},
|
|
194
202
|
|
|
195
203
|
/**
|
|
196
|
-
*
|
|
204
|
+
* Make input disabled.
|
|
197
205
|
*/
|
|
198
206
|
disabled: {
|
|
199
207
|
type: Boolean,
|
|
@@ -208,11 +216,6 @@ const props = defineProps({
|
|
|
208
216
|
default: "",
|
|
209
217
|
},
|
|
210
218
|
|
|
211
|
-
debounce: {
|
|
212
|
-
type: [Number, String],
|
|
213
|
-
default: getDefault(defaultConfig, UInputSearch).debounce,
|
|
214
|
-
},
|
|
215
|
-
|
|
216
219
|
/**
|
|
217
220
|
* Component config object.
|
|
218
221
|
*/
|
|
@@ -260,7 +263,8 @@ defineExpose({ inputRef });
|
|
|
260
263
|
|
|
261
264
|
const elementId = props.id || useId();
|
|
262
265
|
|
|
263
|
-
const { config,
|
|
266
|
+
const { config, searchInputAttrs, searchIconAttrs, clearIconAttrs, searchButtonAttrs } =
|
|
267
|
+
useAttrs(props);
|
|
264
268
|
|
|
265
269
|
const iconSize = computed(() => {
|
|
266
270
|
const sizes = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
|
-
|
|
2
|
+
searchInput: "{UInput}",
|
|
3
3
|
clearIcon: "{UIcon}",
|
|
4
4
|
searchIcon: "{UIcon}",
|
|
5
|
-
|
|
5
|
+
searchButton: "{UButton} rounded-l-none ml-1 outline outline-1 outline-gray-900",
|
|
6
6
|
defaults: {
|
|
7
7
|
size: "md",
|
|
8
8
|
labelAlign: "topInside",
|