vunor 0.0.2 → 0.0.4
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
CHANGED
|
@@ -47,6 +47,8 @@ function focusInput(event: MouseEvent) {
|
|
|
47
47
|
input.focus()
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
+
|
|
51
|
+
const hasValue = computed(() => (modelValue.value ? '' : undefined))
|
|
50
52
|
</script>
|
|
51
53
|
|
|
52
54
|
<template>
|
|
@@ -60,6 +62,7 @@ function focusInput(event: MouseEvent) {
|
|
|
60
62
|
'segmented': groupItem,
|
|
61
63
|
}"
|
|
62
64
|
v-bind="attrs"
|
|
65
|
+
:data-has-value="hasValue"
|
|
63
66
|
:data-active="focused || active"
|
|
64
67
|
>
|
|
65
68
|
<span class="i8-underline" />
|
|
@@ -74,7 +77,7 @@ function focusInput(event: MouseEvent) {
|
|
|
74
77
|
'i8-icon-clickable': !!onPrependClick,
|
|
75
78
|
}"
|
|
76
79
|
>
|
|
77
|
-
<slot name="prepend" v-bind="attrs">
|
|
80
|
+
<slot name="prepend" v-bind="attrs" :data-has-value="hasValue">
|
|
78
81
|
<VuIcon :name="iconPrepend!" @click="emit('prependClick', $event)" />
|
|
79
82
|
</slot>
|
|
80
83
|
</div>
|
|
@@ -123,6 +126,7 @@ function focusInput(event: MouseEvent) {
|
|
|
123
126
|
<slot
|
|
124
127
|
name="append"
|
|
125
128
|
v-bind="attrs"
|
|
129
|
+
:data-has-value="hasValue"
|
|
126
130
|
:emitClick="(event: MouseEvent) => emit('appendClick', event)"
|
|
127
131
|
:iconAppend
|
|
128
132
|
>
|
|
@@ -94,14 +94,11 @@ export function useInputDataAttrs() {
|
|
|
94
94
|
const instance = getCurrentInstance() as unknown as
|
|
95
95
|
| {
|
|
96
96
|
props: TInputProps
|
|
97
|
-
setupState?: { modelValue: string | number | undefined }
|
|
98
97
|
}
|
|
99
98
|
| undefined
|
|
100
99
|
return computed(() => ({
|
|
101
100
|
'data-has-label': instance?.props.label ? '' : undefined,
|
|
102
101
|
'data-has-placeholder': instance?.props.placeholder ? '' : undefined,
|
|
103
|
-
'data-has-value':
|
|
104
|
-
instance?.setupState?.modelValue || instance?.setupState?.modelValue === 0 ? '' : undefined,
|
|
105
102
|
'data-type': instance?.props.type ?? 'text',
|
|
106
103
|
'aria-disabled': instance?.props.disabled ? true : undefined,
|
|
107
104
|
}))
|