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

Commit bcb7d22

Browse files
committed
Merge remote-tracking branch 'origin/master' into feature/vue_press_docs
2 parents f037631 + 7ef4cc9 commit bcb7d22

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

dev/App.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import {
5151
required,
5252
email,
5353
pattern,
54+
maxLength,
5455
/* } from '../dist/as-dynamic-forms.common'; */
5556
} from '../src/main';
5657
@@ -97,8 +98,16 @@ const data = () => ({
9798
label: 'Bio',
9899
name: 'bio',
99100
cols: 30,
100-
rows: 5,
101+
rows: 10,
101102
customClass: 'col-12',
103+
value:
104+
'Prism whatever occupy, stumptown polaroid butcher activated charcoal seitan cornhole direct trade coloring book offal sriracha. 8-bit pitchfork kitsch crucifix chartreuse, tumblr adaptogen brunch stumptown. Drinking vinegar yuccie echo park lo-fi, poutine unicorn raclette adaptogen kale chips chia. Deep v austin fam organic kickstarter hexagon hell of wolf pour-over YOLO. 8-bit glossier lyft authentic, selfies aesthetic kinfolk prism tattooed irony quinoa distillery pug slow-carb post-ironic.',
105+
validations: [
106+
new FormValidation(
107+
maxLength(100),
108+
`This field should be less than 100 characters`,
109+
),
110+
],
102111
}),
103112
new FormField({
104113
type: 'select',

src/components/input-textarea/InputTextarea.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
class="form-control"
77
:cols="formControl.cols"
88
:rows="formControl.rows"
9+
@change="valueChange()"
10+
@focus="onFocus()"
11+
@blur="onBlur()"
912
></textarea>
1013
</template>
1114
<script src="./InputTextarea.js"></script>

src/core/utils/form-control.model.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ export function FormControl({
77
customClass = null,
88
options = [],
99
placeholder = null,
10+
rows = null,
11+
cols = null,
1012
errors = {},
1113
valid = true,
1214
touched = false,
@@ -24,6 +26,8 @@ export function FormControl({
2426
this.valid = valid;
2527
this.touched = touched;
2628
this.dirty = dirty;
29+
this.rows = rows;
30+
this.cols = cols;
2731
}
2832

2933
export function FormField({
@@ -37,6 +41,8 @@ export function FormField({
3741
options = [],
3842
placeholder = null,
3943
inline = false,
44+
rows = null,
45+
cols = null,
4046
}) {
4147
this.type = type;
4248
this.value = value;
@@ -48,6 +54,8 @@ export function FormField({
4854
this.options = options;
4955
this.placeholder = placeholder;
5056
this.inline = inline;
57+
this.rows = rows;
58+
this.cols = cols;
5159
}
5260

5361
export function FormValidation(

src/styles/themes/default.scss

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,16 @@ $input-error-color: #dc3545;
5555
padding: $input-padding-y $input-padding-x;
5656
font-family: $font-family;
5757
font-size: $font-size;
58-
height: calc(
59-
#{$line-height * 1em} + #{$input-padding-y * 2} + #{$input-border-width * 2}
60-
);
6158
border: $input-border-width solid $input-border-color;
6259
border-radius: $input-border-radius;
6360

61+
&:not(textarea) {
62+
height: calc(
63+
#{$line-height * 1em} + #{$input-padding-y * 2} + #{$input-border-width *
64+
2}
65+
);
66+
}
67+
6468
// Placeholder
6569
&::placeholder {
6670
color: $input-border-color;

0 commit comments

Comments
 (0)