@duetds/components
Version:
This package includes Duet Core Components and related tools.
46 lines (45 loc) • 2.05 kB
JavaScript
import { r as registerInstance, h, c as getElement } from './core-12b6bfe8.js';
var DuetToggle = /** @class */ (function () {
function DuetToggle(hostRef) {
registerInstance(this, hostRef);
/**
* Theme of the divider. Can be one of: "default", "turva".
*/
this.theme = "";
/**
* Controls the margin of the component. Can be one of: "auto", "none".
*/
this.margin = "auto";
}
/**
* Component lifecycle events.
*/
DuetToggle.prototype.componentWillLoad = function () {
if (this.theme !== "default" && document.documentElement.classList.contains("duet-theme-turva")) {
this.theme = "turva";
}
};
/**
* render() function
* Always the last one in the class.
*/
DuetToggle.prototype.render = function () {
return (h("div", { class: {
"duet-m-0": this.margin === "none",
"duet-divider": true,
"duet-theme-turva": this.theme === "turva",
} }));
};
Object.defineProperty(DuetToggle.prototype, "element", {
get: function () { return getElement(this); },
enumerable: true,
configurable: true
});
Object.defineProperty(DuetToggle, "style", {
get: function () { return ":host{background:transparent}.duet-divider,:host{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box;border:0;padding:0;margin:0;display:block;width:100%}.duet-divider{background:transparent;margin-bottom:36px!important;margin-top:28px!important;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:#cfd2d4;height:1px}.duet-divider.duet-p-0{padding:0!important}.duet-divider.duet-m-0{margin:0!important}.duet-divider.duet-theme-turva,.duet-theme-turva .duet-divider{background:#d1d1d1}"; },
enumerable: true,
configurable: true
});
return DuetToggle;
}());
export { DuetToggle as duet_divider };