Budibase is an open-source low-code platform for creating internal apps in minutes. Supports PostgreSQL, MySQL, MSSQL, MongoDB, Rest API, Docker, K8s 🚀
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

63 lines
1.2 KiB

<script>
import getIcon from "./icon";
export let size = 18;
export let icon = "";
export let style = "";
export let color = "var(--secondary100)";
export let hoverColor = "var(--secondary75)";
export let attributes = {};
let currentAttributes = [];
const addAttributes = (node, attributes) => {
const add = (_attributes) => {
const attrs = [];
for(let attr in _attributes) {
node.setAttribute(attr, _attributes[attr]);
attrs.push("uk-toggle")
}
currentAttributes = attrs;
}
add(attributes);
return {
// should implement update method
update(attributes) {
for(let attr of currentAttributes) {
node.removeAttribute(attr)
}
add(attributes);
},
destroy() {}
}
}
</script>
<button style="{style}{style ? ";" : ""} color:{color}; --hovercolor:{hoverColor}"
on:click
use:addAttributes={attributes}>
{@html getIcon(icon, size)}
</button>
<style>
button {
border-style: none;
background-color: rgba(0,0,0,0);
cursor: pointer;
outline:none;
}
button:hover {
color: var(--hovercolor);
}
button:active {
outline:none;
}
</style>