mirror of
https://github.com/Lissy93/dashy.git
synced 2025-07-27 07:34:43 +02:00
📎 Adds option for description by input
This commit is contained in:
parent
36cea32ee5
commit
716bb7419a
@ -1,6 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="`input-container ${layout}`">
|
<div :class="`input-container ${layout}`">
|
||||||
<label v-if="label" for="name">{{label}}</label>
|
<label
|
||||||
|
v-if="label"
|
||||||
|
for="name"
|
||||||
|
class="input-label"
|
||||||
|
>
|
||||||
|
{{label}}
|
||||||
|
</label>
|
||||||
<input
|
<input
|
||||||
:type="type"
|
:type="type"
|
||||||
:value="value"
|
:value="value"
|
||||||
@ -8,7 +14,14 @@
|
|||||||
:name="name"
|
:name="name"
|
||||||
:id="name"
|
:id="name"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
|
class="input-field"
|
||||||
/>
|
/>
|
||||||
|
<p
|
||||||
|
v-if="description"
|
||||||
|
class="input-description"
|
||||||
|
>
|
||||||
|
{{ description }}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -21,6 +34,7 @@ export default {
|
|||||||
label: String, // An optional label to display above
|
label: String, // An optional label to display above
|
||||||
name: String, // Required unique ID value, for accessibility
|
name: String, // Required unique ID value, for accessibility
|
||||||
placeholder: String, // Optional placeholder value
|
placeholder: String, // Optional placeholder value
|
||||||
|
description: String, // Optional info paragraph
|
||||||
type: {
|
type: {
|
||||||
default: 'text', // Input type, e.g. text, password, number
|
default: 'text', // Input type, e.g. text, password, number
|
||||||
type: String,
|
type: String,
|
||||||
@ -50,10 +64,19 @@ div.input-container {
|
|||||||
&.horizontal {
|
&.horizontal {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
label { margin-right: 0.25rem; }
|
align-items: center;
|
||||||
|
label.input-label,
|
||||||
|
input.input-field,
|
||||||
|
p.input-description {
|
||||||
|
margin: 0.25rem;
|
||||||
|
flex-basis: 8rem;
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
input.input-field { flex-grow: 2; }
|
||||||
|
p.input-description { flex-grow: 3; }
|
||||||
}
|
}
|
||||||
|
|
||||||
input {
|
input.input-field {
|
||||||
min-width: 10rem;
|
min-width: 10rem;
|
||||||
padding: 0.5rem 0.75rem;
|
padding: 0.5rem 0.75rem;
|
||||||
margin: 0.5rem auto;
|
margin: 0.5rem auto;
|
||||||
@ -68,6 +91,14 @@ div.input-container {
|
|||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
label.input-label {
|
||||||
|
text-transform: capitalize;
|
||||||
|
}
|
||||||
|
|
||||||
|
p.input-description {
|
||||||
|
opacity: var(--dimming-factor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user