UNPKG

@scania/tegel

Version:
49 lines (43 loc) 2.62 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const index = require('./index-ca8040ad.js'); const inheritAttributes = require('./inheritAttributes-ff9ad737.js'); const popoverMenuCss = ".tds-popover-menu.sc-tds-popover-menu{box-sizing:border-box;overflow:hidden;width:160px;background-color:var(--tds-popover-menu-background);padding:16px 6px;box-shadow:0 3px 3px rgba(0, 0, 0, 0.15), 0 -1px 1px rgba(0, 0, 0, 0.1);border-radius:4px;z-index:900}.tds-popover-menu.sc-tds-popover-menu *.sc-tds-popover-menu{box-sizing:border-box}.tds-popover-menu.fluid-width.sc-tds-popover-menu{width:unset}tds-popover-core.sc-tds-popover-menu{padding:6px 0 !important}.sc-tds-popover-menu-s>tds-divider{display:block;padding:6px !important}"; const TdsPopoverMenuStyle0 = popoverMenuCss; const TdsPopoverMenu = class { constructor(hostRef) { index.registerInstance(this, hostRef); this.inheritedAttributes = []; this.selector = undefined; this.referenceEl = undefined; this.show = null; this.defaultShow = false; this.placement = 'auto'; this.animation = 'none'; this.offsetSkidding = 0; this.offsetDistance = 8; this.fluidWidth = false; this.childRef = undefined; } /** Property for closing popover programmatically */ async close() { var _a; (_a = this.childRef) === null || _a === void 0 ? void 0 : _a.close(); } componentWillLoad() { this.inheritedAttributes = inheritAttributes.inheritAttributes(this.host, ['style', 'class']); } render() { var _a; return (index.h(index.Host, { key: '4f285ba1fb6b12ad66c09bbf3d109aa4cdff82cf' }, index.h("tds-popover-core", { key: 'bd1fb62cbeb25ec8a0a5bfa580cef36c950e0fa3', class: { 'tds-popover-menu': true, [(_a = this.inheritedAttributes.class) !== null && _a !== void 0 ? _a : '']: true, 'fluid-width': this.fluidWidth, }, selector: this.selector, referenceEl: this.referenceEl, show: this.show, placement: this.placement, offsetSkidding: this.offsetSkidding, offsetDistance: this.offsetDistance, ref: (el) => { this.childRef = el; }, defaultShow: this.defaultShow, animation: this.animation }, index.h("div", { key: 'c79034c0d9f06bc429d30c51e6c5b70edd404052', role: "menu" }, index.h("slot", { key: '7e10d182c7529d716734317a5cca5087f30c1a9b' }))))); } get host() { return index.getElement(this); } }; TdsPopoverMenu.style = TdsPopoverMenuStyle0; exports.tds_popover_menu = TdsPopoverMenu;