@saltcorn/markup
Advanced tools
Comparing version 0.7.0-beta.2 to 0.7.0-beta.3
@@ -47,2 +47,3 @@ "use strict"; | ||
...(hdr.showIf && { | ||
style: "display: none;", | ||
"data-show-if": mkShowIf(hdr.showIf), | ||
@@ -214,5 +215,17 @@ }), | ||
if (segment.sourceURL) | ||
return div({ "data-source-url": segment.sourceURL }, "join data"); | ||
return div({ "data-source-url": segment.sourceURL }); | ||
return ""; | ||
}, | ||
tabs(segment, go) { | ||
if (segment.tabsStyle !== "Value switch") | ||
return false; | ||
return segment.titles | ||
.map((t, ix) => div({ | ||
style: "display: none;", | ||
"data-show-if": mkShowIf({ | ||
[segment.field]: typeof t.value === "undefined" ? t : t.value, | ||
}), | ||
}, go(segment.contents[ix]))) | ||
.join(""); | ||
}, | ||
field(segment) { | ||
@@ -219,0 +232,0 @@ const field0 = form.fields.find((f) => f.name === segment.field_name); |
@@ -174,3 +174,6 @@ "use strict"; | ||
if (segment.type && blockDispatch && blockDispatch[segment.type]) { | ||
return wrap(segment, isTop, ix, blockDispatch[segment.type](segment, go)); | ||
const resp = blockDispatch[segment.type](segment, go); | ||
if (resp !== false) | ||
return wrap(segment, isTop, ix, resp); | ||
//else continue below | ||
} | ||
@@ -198,2 +201,23 @@ if (segment.type === "blank") { | ||
} | ||
if (segment.type === "dropdown_menu") { | ||
const rndid = `actiondd${Math.floor(Math.random() * 16777215).toString(16)}`; | ||
let style = segment.action_style === "btn-custom-color" | ||
? `background-color: ${segment.action_bgcol || "#000000"};border-color: ${segment.action_bordercol || "#000000"}; color: ${segment.action_textcol || "#000000"}` | ||
: null; | ||
return div({ class: "dropdown" }, button({ | ||
class: segment.action_style === "btn-link" | ||
? "" | ||
: `btn ${segment.action_style || "btn-primary"} ${segment.action_size || ""} dropdown-toggle`, | ||
"data-boundary": "viewport", | ||
type: "button", | ||
id: rndid, | ||
"data-bs-toggle": "dropdown", | ||
"aria-haspopup": "true", | ||
"aria-expanded": "false", | ||
style, | ||
}, segment.label || "Actions"), div({ | ||
class: "dropdown-menu dropdown-menu-end", | ||
"aria-labelledby": rndid, | ||
}, div({ class: "d-flex flex-column px-2" }, go(segment.contents)))); | ||
} | ||
if (segment.type === "link") { | ||
@@ -200,0 +224,0 @@ let style = segment.link_style === "btn btn-custom-color" |
{ | ||
"name": "@saltcorn/markup", | ||
"version": "0.7.0-beta.2", | ||
"version": "0.7.0-beta.3", | ||
"description": "Markup for Saltcorn, open-source no-code platform", | ||
@@ -35,3 +35,3 @@ "homepage": "https://saltcorn.com", | ||
"devDependencies": { | ||
"@saltcorn/types": "0.7.0-beta.2", | ||
"@saltcorn/types": "0.7.0-beta.3", | ||
"@types/escape-html": "^1.0.1", | ||
@@ -38,0 +38,0 @@ "@types/jest": "^27.0.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
207785
2461