UNPKG

@duetds/components

Version:

This package includes Duet Core Components and related tools.

43 lines (38 loc) 1.75 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const core = require('./core-e5cda7d4.js'); const DuetToggle = class { constructor(hostRef) { core.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. */ componentWillLoad() { if (this.theme !== "default" && document.documentElement.classList.contains("duet-theme-turva")) { this.theme = "turva"; } } /** * render() function * Always the last one in the class. */ render() { return (core.h("div", { class: { "duet-m-0": this.margin === "none", "duet-divider": true, "duet-theme-turva": this.theme === "turva", } })); } get element() { return core.getElement(this); } static get style() { 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}"; } }; exports.duet_divider = DuetToggle;