@bagelink/vue 1.15.283 → 1.15.285
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/dist/components/form/inputs/TextInput.vue.d.ts +1 -0
- package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
- package/dist/index.cjs +22 -22
- package/dist/index.mjs +1601 -1590
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/form/inputs/TextInput.vue +38 -27
package/package.json
CHANGED
|
@@ -31,6 +31,7 @@ export interface TextInputProps extends ValidateInputBaseT, BagelInputShellProps
|
|
|
31
31
|
nativeInputAttrs?: { [key: string]: any }
|
|
32
32
|
icon?: IconType
|
|
33
33
|
iconStart?: IconType
|
|
34
|
+
iconColor?: string
|
|
34
35
|
multiline?: boolean
|
|
35
36
|
autoheight?: boolean
|
|
36
37
|
code?: boolean
|
|
@@ -166,6 +167,7 @@ onMounted(async () => {
|
|
|
166
167
|
underlined,
|
|
167
168
|
'textInputIconWrap': icon,
|
|
168
169
|
'txtInputIconStart': iconStart,
|
|
170
|
+
'multiline-field': autoheight || inputRows >= 2,
|
|
169
171
|
'has-error': !!error,
|
|
170
172
|
'has-value': hasValue,
|
|
171
173
|
},
|
|
@@ -173,21 +175,22 @@ onMounted(async () => {
|
|
|
173
175
|
>
|
|
174
176
|
<label :for="id">
|
|
175
177
|
<span v-if="label || (underlined && placeholder)" class="label-text">{{ resolveI18n(label) || resolveI18n(placeholder) }}<span v-if="required"> *</span></span>
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
178
|
+
<span class="input-field">
|
|
179
|
+
<input
|
|
180
|
+
v-if="!autoheight && inputRows < 2" :id ref="input" v-model.trim="inputVal"
|
|
181
|
+
:name :title :autocomplete :type :rows="1"
|
|
182
|
+
:placeholder="underlined ? ' ' : (resolveI18n(placeholder) || resolveI18n(label))"
|
|
183
|
+
:disabled :required v-bind="nativeInputAttrs" :pattern="normalizedPattern" @focusout="onFocusout"
|
|
184
|
+
@focus="onFocus" @input="updateInputVal"
|
|
185
|
+
>
|
|
186
|
+
<textarea
|
|
187
|
+
v-else :id ref="input" v-model="inputVal" :name :title :type :rows="inputRows"
|
|
188
|
+
:placeholder="underlined ? ' ' : (resolveI18n(placeholder) || resolveI18n(label))" :disabled :required
|
|
189
|
+
v-bind="nativeInputAttrs" :pattern="normalizedPattern" @input="updateInputVal" @focusout="onFocusout"
|
|
190
|
+
/>
|
|
191
|
+
<Icon v-if="iconStart" :class="{ ' -top-025 line-height-0 ': underlined }" class="iconStart" :icon="iconStart" :color="iconColor" />
|
|
192
|
+
<Icon v-if="icon" :class="{ ' -top-025 line-height-0 ': underlined }" :icon :color="iconColor" />
|
|
193
|
+
</span>
|
|
191
194
|
</label>
|
|
192
195
|
<p v-if="helptext" class="helptext">{{ helptext }}</p>
|
|
193
196
|
<div v-if="error" class="error-message">
|
|
@@ -269,20 +272,15 @@ gap: 0.5rem;
|
|
|
269
272
|
background: var(--input-disabled-bg);
|
|
270
273
|
}
|
|
271
274
|
|
|
272
|
-
/*
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
of the input row pinned to the BOTTOM of the label (the input is the last row), then
|
|
280
|
-
flex-center it. Bottom-anchored + fixed band height ⇒ centered on the input regardless
|
|
281
|
-
of a label above, and in dense/small modes. Scoped to :not(.underlined) because the
|
|
282
|
-
underlined variant floats its label as an overlay (input isn't pushed down). */
|
|
275
|
+
/* Keep icon positioning relative to the native field, not the optional label. */
|
|
276
|
+
.input-field {
|
|
277
|
+
position: relative;
|
|
278
|
+
display: block;
|
|
279
|
+
width: 100%;
|
|
280
|
+
}
|
|
281
|
+
|
|
283
282
|
.bagel-input:not(.underlined).textInputIconWrap > label,
|
|
284
283
|
.bagel-input:not(.underlined).txtInputIconStart > label {
|
|
285
|
-
position: relative;
|
|
286
284
|
display: block;
|
|
287
285
|
}
|
|
288
286
|
|
|
@@ -293,6 +291,14 @@ bottom: calc(var(--bgl-input-height) / 2);
|
|
|
293
291
|
transform: translateY(50%);
|
|
294
292
|
}
|
|
295
293
|
|
|
294
|
+
/* In a textarea, align icons with the first line instead of the field's bottom. */
|
|
295
|
+
.bagel-input.multiline-field:not(.underlined).textInputIconWrap .bgl_icon-font,
|
|
296
|
+
.bagel-input.multiline-field:not(.underlined).txtInputIconStart .iconStart {
|
|
297
|
+
top: calc(0.7rem + var(--bgl-input-font-size) / 2);
|
|
298
|
+
bottom: auto;
|
|
299
|
+
transform: translateY(-50%);
|
|
300
|
+
}
|
|
301
|
+
|
|
296
302
|
/* underlined: label floats as an overlay, so the original top-center is correct */
|
|
297
303
|
.underlined.textInputIconWrap .bgl_icon-font,
|
|
298
304
|
.underlined.txtInputIconStart .iconStart {
|
|
@@ -300,6 +306,11 @@ top: calc(var(--bgl-input-height) / 2);
|
|
|
300
306
|
transform: translateY(-50%);
|
|
301
307
|
}
|
|
302
308
|
|
|
309
|
+
.underlined.multiline-field.textInputIconWrap .bgl_icon-font,
|
|
310
|
+
.underlined.multiline-field.txtInputIconStart .iconStart {
|
|
311
|
+
top: calc(1.4rem + var(--bgl-input-font-size) / 2);
|
|
312
|
+
}
|
|
313
|
+
|
|
303
314
|
.textInputIconWrap .bgl_icon-font,
|
|
304
315
|
.txtInputIconStart .iconStart {
|
|
305
316
|
color: var(--bgl-input-color);
|