shx-3d-render

main
Jan Umbach 2024-06-13 16:37:57 +02:00
parent 47affe4f43
commit 0b53da12e9
1 changed files with 33 additions and 6 deletions

View File

@ -39,20 +39,47 @@
let globalInputFormsObjValues = {
"test1": {
"text1": "test"
},
"test2": {
"text1": "test1",
"text2": "test2"
}
};
let genTextInput(inputID, labelText, inputName, inputVal) {
return `
<label class="form__label custom" for="${inputID}-label">${labelText}</label>
<div class="field custom">
<input class="field__input" form="{{ 'product-form-' | append: section.id }}" type="text" id="${inputID}" name="properties[${inputName}]" value="${inputVal}">
</div>
`;
}
let globalInputFormsObj = {
"test1": {
"renderHTML": () => {
console.log(this);
return `
<style>.custom.form__label{margin-bottom: 0.6rem}.field.custom{margin-top:0}.custom .field__input{padding-top:0.8rem}</style>
<label class="form__label custom" for="your-label">Dein Text</label>
<div class="field custom">
<input class="field__input" form="{{ 'product-form-' | append: section.id }}" type="text" id="your-label" name="properties[Your label]" value="${globalInputFormsObjValues.test1.text1}">
</div>
let html = `
<style>.custom.form__label{margin-bottom: 0.6rem}.field.custom{margin-top:0}.custom .field__input{padding-top:0.8rem}</style>
`;
html += genTextInput('custom-text-1', 'Custom Text 1', 'Custom Text 1', globalInputFormsObjValues['test1']['text1']);
return ;
}
},"test2": {
"renderHTML": () => {
console.log(this);
let html = `
<style>.custom.form__label{margin-bottom: 0.6rem}.field.custom{margin-top:0}.custom .field__input{padding-top:0.8rem}</style>
`;
html += genTextInput('custom-text-1', 'Custom Text 1', 'Custom Text 1', globalInputFormsObjValues['test2']['text1']);
html += genTextInput('custom-text-2', 'Custom Text 2', 'Custom Text 2', globalInputFormsObjValues['test2']['text2']);
return ;
}
}
};