@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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "1.15.283",
4
+ "version": "1.15.285",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Bagel Studio",
@@ -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
- <input
178
- v-if="!autoheight && inputRows < 2" :id ref="input" v-model.trim="inputVal"
179
- :name :title :autocomplete :type :rows="1"
180
- :placeholder="underlined ? ' ' : (resolveI18n(placeholder) || resolveI18n(label))"
181
- :disabled :required v-bind="nativeInputAttrs" :pattern="normalizedPattern" @focusout="onFocusout"
182
- @focus="onFocus" @input="updateInputVal"
183
- >
184
- <textarea
185
- v-else :id ref="input" v-model="inputVal" :name :title :type :rows="inputRows"
186
- :placeholder="underlined ? ' ' : (resolveI18n(placeholder) || resolveI18n(label))" :disabled :required
187
- v-bind="nativeInputAttrs" :pattern="normalizedPattern" @input="updateInputVal" @focusout="onFocusout"
188
- />
189
- <Icon v-if="iconStart" :class="{ ' -top-025 line-height-0 ': underlined }" class="iconStart" :icon="iconStart" />
190
- <Icon v-if="icon" :class="{ ' -top-025 line-height-0 ': underlined }" :icon />
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
- /* Icon centering.
273
- The icon is absolutely positioned inside the <label>, whose only positioned ancestor
274
- is `.bagel-input`. In the DEFAULT variant the label text is in normal flow and pushes
275
- the input DOWN, but the old `top: input-height/2` was measured from the component top —
276
- so with a label the icon rode up onto the label text (the misalignment).
277
-
278
- Fix: make the <label> the containing block and anchor the icon into a band the height
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);