@saltcorn/markup
Advanced tools
Comparing version 0.5.1 to 0.5.2-beta.0
37
form.js
@@ -36,3 +36,2 @@ const { | ||
const isCheck = (hdr) => hdr.type && hdr.type.name === "Bool"; | ||
const isHoriz = (formStyle) => formStyle === "horiz"; | ||
@@ -47,33 +46,13 @@ const formRowWrap = (hdr, inner, error = "", fStyle, labelCols) => | ||
}, | ||
isCheck(hdr) | ||
? div( | ||
{ | ||
class: | ||
isHoriz(fStyle) && | ||
`col-sm-${12 - labelCols} offset-md-${labelCols}`, | ||
}, | ||
hdr.input_type === "section_header" | ||
? div({ class: `col-sm-12` }, h5(text(hdr.label))) | ||
: [ | ||
div( | ||
{ class: "form-check" }, | ||
inner, | ||
{ class: isHoriz(fStyle) && `col-sm-${labelCols}` }, | ||
label( | ||
{ | ||
for: `input${text_attr(hdr.form_name)}`, | ||
class: "form-check-label", | ||
for: `input${text_attr(hdr.form_name)}`, | ||
}, | ||
text(hdr.label) | ||
), | ||
hdr.sublabel && " — " + i(text(hdr.sublabel)), | ||
text(error) | ||
) | ||
) | ||
: hdr.input_type === "section_header" | ||
? div({ class: `col-sm-12` }, h5(text(hdr.label))) | ||
: [ | ||
label( | ||
{ | ||
for: `input${text_attr(hdr.form_name)}`, | ||
class: isHoriz(fStyle) && `col-sm-${labelCols} col-form-label`, | ||
}, | ||
text(hdr.label) | ||
) | ||
), | ||
@@ -129,3 +108,5 @@ div( | ||
case "code": | ||
return `<textarea mode="${(hdr.attributes||{}).mode||""}" class="to-code form-control ${validClass} ${ | ||
return `<textarea mode="${ | ||
(hdr.attributes || {}).mode || "" | ||
}" class="to-code form-control ${validClass} ${ | ||
hdr.class || "" | ||
@@ -132,0 +113,0 @@ }"${maybe_disabled} data-fieldname="${text_attr( |
@@ -29,3 +29,3 @@ const { a, input, div, ul, text, text_attr } = require("./tags"); | ||
<input type="hidden" name="_csrf" value=""><div class="form-group"> | ||
<label for="inputname" >Name</label> | ||
<div><label for="inputname">Name</label></div> | ||
<div><input type="text" class="form-control " data-fieldname="name" name="name" id="inputname" > | ||
@@ -89,3 +89,3 @@ </div></div><div class="form-group row"> | ||
<input type="hidden" name="_csrf" value=""><div class="form-group"> | ||
<label for="inputname" >Name</label> | ||
<div><label for="inputname">Name</label></div> | ||
<div><input type="text" class="form-control is-invalid " data-fieldname="name" name="name" id="inputname" value="Bar"><div>Not a foo</div> | ||
@@ -92,0 +92,0 @@ </div></div><div class="form-group row"> |
{ | ||
"name": "@saltcorn/markup", | ||
"version": "0.5.1", | ||
"version": "0.5.2-beta.0", | ||
"description": "Markup for Saltcorn, open-source no-code platform", | ||
@@ -5,0 +5,0 @@ "homepage": "https://saltcorn.com", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58512
1985