@bagelink/vue 1.5.13 → 1.5.15
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
|
@@ -72,7 +72,7 @@ function autoResizeTextarea() {
|
|
|
72
72
|
|
|
73
73
|
const textarea = input as HTMLTextAreaElement
|
|
74
74
|
textarea.style.height = 'auto'
|
|
75
|
-
textarea.style.height =
|
|
75
|
+
textarea.style.height = `${textarea.scrollHeight + 1}px`
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
function updateInputVal() {
|
|
@@ -81,17 +81,17 @@ function updateInputVal() {
|
|
|
81
81
|
debouncedEmit()
|
|
82
82
|
|
|
83
83
|
if (props.autoheight) {
|
|
84
|
-
nextTick(() => autoResizeTextarea())
|
|
84
|
+
nextTick(() => { autoResizeTextarea() })
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
watch(
|
|
89
89
|
() => props.modelValue,
|
|
90
|
-
newVal => {
|
|
90
|
+
(newVal) => {
|
|
91
91
|
if (newVal !== inputVal) {
|
|
92
92
|
inputVal = newVal
|
|
93
93
|
if (props.autoheight) {
|
|
94
|
-
nextTick(() => autoResizeTextarea())
|
|
94
|
+
nextTick(() => { autoResizeTextarea() })
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
},
|
|
@@ -119,55 +119,27 @@ onMounted(async () => {
|
|
|
119
119
|
|
|
120
120
|
<template>
|
|
121
121
|
<div
|
|
122
|
-
class="bagel-input text-input"
|
|
123
|
-
:class="{
|
|
122
|
+
class="bagel-input text-input" :class="{
|
|
124
123
|
dense,
|
|
125
124
|
small,
|
|
126
125
|
shrink,
|
|
127
126
|
code,
|
|
128
127
|
textInputIconWrap: icon,
|
|
129
128
|
txtInputIconStart: iconStart,
|
|
130
|
-
}"
|
|
131
|
-
:title="title"
|
|
129
|
+
}" :title="title"
|
|
132
130
|
>
|
|
133
131
|
<label :for="id">
|
|
134
132
|
{{ label }} <span v-if="required && label">*</span>
|
|
135
133
|
|
|
136
134
|
<input
|
|
137
|
-
v-if="!multiline && !autoheight && !code && inputRows < 2"
|
|
138
|
-
:
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
:name
|
|
142
|
-
:title
|
|
143
|
-
:autocomplete
|
|
144
|
-
:type
|
|
145
|
-
:rows="1"
|
|
146
|
-
:placeholder="placeholder || label"
|
|
147
|
-
:disabled
|
|
148
|
-
:required
|
|
149
|
-
:pattern
|
|
150
|
-
v-bind="nativeInputAttrs"
|
|
151
|
-
@focusout="onFocusout"
|
|
152
|
-
@focus="onFocus"
|
|
153
|
-
@input="updateInputVal"
|
|
154
|
-
/>
|
|
135
|
+
v-if="!multiline && !autoheight && !code && inputRows < 2" :id ref="input" v-model.trim="inputVal"
|
|
136
|
+
:name :title :autocomplete :type :rows="1" :placeholder="placeholder || label" :disabled :required
|
|
137
|
+
:pattern v-bind="nativeInputAttrs" @focusout="onFocusout" @focus="onFocus" @input="updateInputVal"
|
|
138
|
+
>
|
|
155
139
|
<textarea
|
|
156
|
-
v-else
|
|
157
|
-
:
|
|
158
|
-
|
|
159
|
-
v-model="inputVal"
|
|
160
|
-
:name
|
|
161
|
-
:title
|
|
162
|
-
:type
|
|
163
|
-
:rows="inputRows"
|
|
164
|
-
:placeholder="placeholder || label"
|
|
165
|
-
:disabled
|
|
166
|
-
:required
|
|
167
|
-
:pattern
|
|
168
|
-
v-bind="nativeInputAttrs"
|
|
169
|
-
@input="updateInputVal"
|
|
170
|
-
@focusout="onFocusout"
|
|
140
|
+
v-else :id ref="input" v-model="inputVal" :name :title :type :rows="inputRows"
|
|
141
|
+
:placeholder="placeholder || label" :disabled :required :pattern v-bind="nativeInputAttrs"
|
|
142
|
+
@input="updateInputVal" @focusout="onFocusout"
|
|
171
143
|
/>
|
|
172
144
|
<p v-if="helptext" class="opacity-7 light">{{ helptext }}</p>
|
|
173
145
|
<Icon v-if="iconStart" class="iconStart" :icon="iconStart" />
|
|
@@ -236,7 +208,8 @@ onMounted(async () => {
|
|
|
236
208
|
line-height: 0;
|
|
237
209
|
}
|
|
238
210
|
|
|
239
|
-
.textInputIconWrap input
|
|
211
|
+
.textInputIconWrap input,
|
|
212
|
+
.textInputIconWrap textarea {
|
|
240
213
|
padding-inline-end: calc(var(--input-height) / 3 + 1.5rem);
|
|
241
214
|
}
|
|
242
215
|
|