form input class

This commit is contained in:
Sebastian Frank
2017-12-13 16:27:42 +01:00
parent bf6dc2c944
commit 667e14999d
5 changed files with 56 additions and 10 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -105,7 +105,7 @@ input, textarea, select {
} }
textarea {padding:10px; height:auto;} textarea {padding:10px; height:auto;}
input:focus, textarea:focus, select:focus {background:#FFF; border-color: @cms_brand_primary;} input:focus, textarea:focus, select:focus {background:#FFF; border-color: @cms_brand_primary;}
label {font-weight:600; color: @text_color;} label {font-weight:600; color: @text_color; overflow: hidden; text-overflow: ellipsis;}
.checkbox_holder { .checkbox_holder {
position: relative; position: relative;
@@ -191,14 +191,14 @@ button{
/*-------------------------------------------------------------- /*--------------------------------------------------------------
# CMS CONTENT FORM # CMS CONTENT FORM
--------------------------------------------------------------*/ --------------------------------------------------------------*/
/*.cms_content_form {} .cms_content_form {}
.cms_content_form_sidebar {background:#FFF; padding:25px; border:solid 1px #CCC;} .cms_content_form_sidebar {background:#FFF; padding:25px; border:solid 1px #CCC;}
.cms_fieldgroup {background:#f0f0f0; border:solid 1px #CCC; margin-bottom:20px;} .cms_fieldgroup {background:#f0f0f0; border:solid 1px #CCC; margin-bottom:20px;}
.cms_fieldgroup_header {position:relative; color:#333; border-bottom:solid 1px #CCC; height:40px; line-height:40px; padding:0px 25px; font-weight:600;} .cms_fieldgroup_header {position:relative; color:#333; border-bottom:solid 1px #CCC; height:40px; line-height:40px; padding:0px 25px; font-weight:600;}
.cms_fieldgroup_content {padding:25px; display:none;} .cms_fieldgroup_content {padding:25px; display:none;}
.cms_fieldgroup_trigger {position:absolute; top:0px; width:100px; right:0px; padding-right:25px; cursor:pointer; height:40px; line-height:40px; text-align:right;} .cms_fieldgroup_trigger {position:absolute; top:0px; width:100px; right:0px; padding-right:25px; cursor:pointer; height:40px; line-height:40px; text-align:right;}
.cms_fieldgroup_trigger i {color:#333; font-size:18px;} .cms_fieldgroup_trigger i {color:#333; font-size:18px;}
.fieldgroup_open .cms_fieldgroup_content {display:block;}*/ .fieldgroup_open .cms_fieldgroup_content {display:block;}
/*-------------------------------------------------------------- /*--------------------------------------------------------------

View File

@@ -36,6 +36,10 @@ export default {
let n = el.name ? el.name : el.key; let n = el.name ? el.name : el.key;
switch (el.element) { switch (el.element) {
case "my-input": case "my-input":
var inputClass = { };
if (el.class) {
inputClass = el.class;
}
formEl.push(createElement(MyInput, { formEl.push(createElement(MyInput, {
props: { props: {
name: n, name: n,
@@ -45,6 +49,7 @@ export default {
value: formData[n], value: formData[n],
validate: el.validate validate: el.validate
}, },
class: inputClass,
on: { on: {
input(val) { input(val) {
formData[n] = val; formData[n] = val;
@@ -56,15 +61,55 @@ export default {
})); }));
break; break;
case "section": case "section":
formEl.push(createElement("h3", el.label)); // formEl.push(createElement("h3", el.label));
if (!formData[n]) { if (!formData[n]) {
formData[n] = { }; formData[n] = { };
} }
formEl.push(createElement("div", _cElCall(el.subElements, formData[n]))); formEl.push(
createElement("div", {
class: {
cms_fieldgroup: true,
fieldgroup_open: true,
clear: true
}
}, [
createElement("header", {
class: {
cms_fieldgroup_header: true
}
}, [
el.label,
createElement("div", {
class: {
cms_fieldgroup_trigger: true
}
} [
createElement("i", {
class: {
"ion-chevron-down": true
}
})
])
]),
createElement("div", {
class: {
cms_fieldgroup_content: true,
clear: true
}
},
_cElCall(el.subElements, formData[n])
)
])
); //));
break; break;
} }
}); });
formEl.push(createElement("div", {
class: {
clear: true
}
})); // clearer as last element in group
return formEl; return formEl;
} }

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="input_holder"> <div class="input_holder">
<div class="input_header" v-if="label || description"> <div class="input_header" v-if="label || description">
<label :for="name" v-if="label">{{ label }}</label> <label :for="name" v-if="label && props.type != 'checkbox'">{{ label }}<span v-if="validate && validate.required">*</span></label>
<div class="input_description" v-if="description">{{ description }}</div> <div class="input_description" v-if="description">{{ description }}</div>
</div> </div>
@@ -43,6 +43,7 @@
@change="handleChange" @change="handleChange"
> >
<div class="check_checkbox"></div> <div class="check_checkbox"></div>
<label :for="name" style="margin-left: 25px; width: 99%;" :title="label">{{ label }}<span v-if="validate && validate.required">*</span></label>
</div> </div>
<div v-if="invalid && validatorMessage">{{ validatorMessage }}</div> <div v-if="invalid && validatorMessage">{{ validatorMessage }}</div>