@saltcorn/markup
Advanced tools
Comparing version 0.3.2-beta.1 to 0.3.2-beta.2
@@ -68,7 +68,19 @@ const { a, text, div, input, text_attr, ul, li, span } = require("./tags"); | ||
v, | ||
{ onClick, placeHolder } = {} | ||
) => `<div class="input-group"> | ||
<input type="text" class="form-control bg-light search-bar" placeholder="${ | ||
placeHolder || "Search for..." | ||
{ onClick, placeHolder, has_dropdown, contents, badges } = {} | ||
) => { | ||
const rndid = Math.floor(Math.random() * 16777215).toString(16); | ||
return `<div class="input-group search-bar"> | ||
<div class="input-group-prepend"> | ||
<button class="btn btn-outline-secondary" ${ | ||
onClick ? `onClick="${onClick}"` : "" | ||
} type="submit" id="button-search-submit"> | ||
<i class="fas fa-search"></i> | ||
</button> | ||
</div> | ||
<input type="text" class="form-control search-bar ${ | ||
badges && badges.length > 0 ? "br-none" : "" | ||
}" placeholder="${placeHolder || "Search for..."}" | ||
}" | ||
}" | ||
id="input${text_attr(name)}" name="${name}" | ||
@@ -80,9 +92,32 @@ ${onClick ? `onChange="${onClick}"` : ""} | ||
<div class="input-group-append"> | ||
<button class="btn btn-primary" ${ | ||
onClick ? `onClick="${onClick}"` : "" | ||
} btype="submit" id="button-search-submit"> | ||
<i class="fas fa-search"></i> | ||
</button> | ||
${ | ||
badges && badges.length > 0 | ||
? `<div class="input-group-text">${badges | ||
.map( | ||
(b) => | ||
`<span class="badge badge-primary">${b.text}${ | ||
b.onclick | ||
? `<a href="javascript:${b.onclick}"><i class="ml-1 fas fa-lg fa-times"></i></a> ` | ||
: "" | ||
}</span>` | ||
) | ||
.join(" ")} | ||
</div>` | ||
: "" | ||
} | ||
${ | ||
has_dropdown | ||
? `<button class="btn btn-outline-secondary dropdown-toggle" id="dd${rndid}" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" onclick="align_dropdown('${rndid}')"></button>` | ||
: "" | ||
} | ||
${ | ||
has_dropdown | ||
? `<div class="dropdown-menu search-bar p-2" id="dm${rndid}" aria-labelledby="dd${rndid}"> | ||
${contents} | ||
</div>` | ||
: "" | ||
} | ||
</div> | ||
</div>`; | ||
}; | ||
@@ -89,0 +124,0 @@ const search_bar_form = () => `<form action="/search" method="get"> |
{ | ||
"name": "@saltcorn/markup", | ||
"version": "0.3.2-beta.1", | ||
"version": "0.3.2-beta.2", | ||
"description": "Markup for Saltcorn, open-source no-code platform", | ||
@@ -27,3 +27,3 @@ "homepage": "https://saltcorn.com", | ||
}, | ||
"gitHead": "25ac380a46a3c2a90daa30f83bc69836cdee257f" | ||
"gitHead": "d520cc9f2bfce236879dee252733c8206ecedbba" | ||
} |
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
48556
1654