@duetds/components
Version:
This package includes Duet Core Components and related tools.
51 lines (50 loc) • 2.7 kB
JavaScript
import { r as registerInstance, h, H as Host } from './core-12b6bfe8.js';
var DuetCaption = /** @class */ (function () {
function DuetCaption(hostRef) {
registerInstance(this, hostRef);
/**
* Theme of the caption. Can be one of: "default", "turva".
*/
this.theme = "";
/**
* Controls the margin of the component. Can be one of: "auto", "none".
*/
this.margin = "auto";
/**
* Selected state of the caption. Used inside Choice component.
*/
this.selected = false;
/**
* Controls the size of the caption. Can be one of: "medium", "small".
*/
this.size = "medium";
}
/**
* Component lifecycle events.
*/
DuetCaption.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.
*/
DuetCaption.prototype.render = function () {
return (h(Host, { class: {
"duet-caption": true,
"duet-caption-selected": this.selected,
"duet-caption-small": this.size === "small",
"duet-theme-turva": this.theme === "turva",
"duet-m-0": this.margin === "none",
} }, h("slot", null)));
};
Object.defineProperty(DuetCaption, "style", {
get: function () { return ":host{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box;background:transparent;border:0;padding:0;margin:0;margin-bottom:16px!important;display:-ms-flexbox;display:flex;-ms-flex:0 0 100%;flex:0 0 100%;vertical-align:top;width:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:localtapiola-sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-weight:400;font-size:1rem;line-height:1.25;color:#657787}:host.duet-p-0{padding:0!important}:host.duet-m-0{margin:0!important}:host(.duet-caption-small){font-size:.875rem}:host(.duet-theme-turva){font-family:turva-sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;color:#757575}:host(.duet-caption-selected){color:#0077b3}:host(.duet-caption-selected.duet-theme-turva){color:#111}:host(.duet-m-0){margin:0!important}"; },
enumerable: true,
configurable: true
});
return DuetCaption;
}());
export { DuetCaption as duet_caption };