Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit 4bd5e49

Browse files
committed
Corrected Material Theme
1 parent 2463ec7 commit 4bd5e49

File tree

5 files changed

+29
-8
lines changed

5 files changed

+29
-8
lines changed

src/components/dynamic-input/DynamicInput.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
<template>
22
<div :class="getClasses">
3-
<label
4-
class="form-label"
5-
:for="formControl.name"
6-
v-if="formControl.type !== 'checkbox'"
7-
>
8-
{{ formControl.label }}
9-
</label>
103
<input-text
114
v-if="
125
formControl.type === 'text' ||
@@ -46,6 +39,14 @@
4639
:onFocus="onFocus"
4740
:onBlur="onBlur"
4841
/>
42+
<label
43+
class="form-label"
44+
:for="formControl.name"
45+
v-if="formControl.type !== 'checkbox'"
46+
>
47+
{{ formControl.label }}
48+
</label>
49+
<span class="form-bar"></span>
4950
<p class="form-hint" v-if="formControl.helper">
5051
{{ formControl.helper }}
5152
</p>

src/components/input-textarea/InputTextarea.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ const props = {
77
},
88
};
99

10+
const computed = {
11+
hasValue() {
12+
const { value } = this.formControl;
13+
return value !== null && value !== undefined;
14+
},
15+
};
16+
1017
const methods = {
1118
valueChange() {
1219
this.$emit('change', this.formControl.value);
@@ -22,6 +29,7 @@ const methods = {
2229

2330
const InputTextarea = {
2431
name: 'asInputTextarea',
32+
computed,
2533
props,
2634
methods,
2735
};

src/components/input-textarea/InputTextarea.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
v-model="formControl.value"
55
:name="formControl.name"
66
class="form-control"
7+
:data-text="hasValue"
8+
:class="{ 'form-control--value': hasValue }"
79
:cols="formControl.cols"
810
:rows="formControl.rows"
911
@change="valueChange()"

src/styles/themes/default.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ $input-error-color: #dc3545 !default;
4343
display: inline-block;
4444
margin-bottom: 0.5rem;
4545
order: 1;
46+
47+
&--material {
48+
display: none;
49+
}
4650
}
4751

4852
.form-hint {
@@ -79,6 +83,7 @@ $input-error-color: #dc3545 !default;
7983

8084
.form-control {
8185
display: block;
86+
order: 2;
8287
width: 100%;
8388
background-color: $input-bg;
8489
color: $input-color;

src/styles/themes/material.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ $input-error-color: #dc3545;
3535
pointer-events: none;
3636
color: $base-color;
3737
transition: 0.2s ease all;
38+
order: 1;
39+
40+
/* &--default {
41+
display: none;
42+
} */
3843
}
3944

4045
.form-bar {
@@ -306,7 +311,7 @@ select.form-control ~ .form-label,
306311
display: inline-block;
307312
min-height: 20px;
308313
position: relative;
309-
padding: 0 (20px + 10px);
314+
padding: 0 30px 10px;
310315
margin-bottom: 0;
311316
cursor: pointer;
312317
vertical-align: bottom;

0 commit comments

Comments
 (0)