UNPKG

@scania/tegel

Version:
45 lines (41 loc) 2.47 kB
import { r as registerInstance, h, H as Host, g as getElement } from './index-51d04e39.js'; import { i as inheritAttributes } from './inheritAttributes-d21e267b.js'; const popoverCanvasCss = ".tds-popover-canvas.sc-tds-popover-canvas{box-sizing:border-box;display:inline-block;color:var(--tds-popover-canvas-color);background-color:var(--tds-popover-canvas-background);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-canvas.sc-tds-popover-canvas *.sc-tds-popover-canvas{box-sizing:border-box}"; const TdsPopoverCanvasStyle0 = popoverCanvasCss; const TdsPopoverCanvas = class { constructor(hostRef) { registerInstance(this, hostRef); this.inheritedAttributes = []; this.selector = undefined; this.referenceEl = undefined; this.defaultShow = false; this.show = null; this.placement = 'auto'; this.offsetSkidding = 0; this.animation = 'none'; this.offsetDistance = 8; this.modifiers = []; this.tdsAlertDialog = 'dialog'; 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(this.host, ['style', 'class']); } render() { var _a; return (h(Host, { key: '58db11b606cb1211fc569e0868a602ed935b46fa' }, h("tds-popover-core", Object.assign({ key: 'be884f4ea53cbb76e2c07cd87fba10c66cb18618', role: this.tdsAlertDialog }, this.inheritedAttributes, { class: { 'tds-popover-canvas': true, [(_a = this.inheritedAttributes.class) !== null && _a !== void 0 ? _a : '']: true, }, selector: this.selector, referenceEl: this.referenceEl, show: this.show, placement: this.placement, offsetSkidding: this.offsetSkidding, offsetDistance: this.offsetDistance, modifiers: this.modifiers, trigger: 'click', ref: (el) => { this.childRef = el; }, defaultShow: this.defaultShow, animation: this.animation }), h("div", { key: 'b7436bdce7bb19745ac25dfc5a9db16f308db41c' }, h("slot", { key: '6436d57046cde0d03359899690be4af1b17fe506' }))))); } get host() { return getElement(this); } }; TdsPopoverCanvas.style = TdsPopoverCanvasStyle0; export { TdsPopoverCanvas as tds_popover_canvas };