@scania/tegel
Version:
Tegel Design System
49 lines (43 loc) • 2.56 kB
JavaScript
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const index = require('./index-ca8040ad.js');
const inheritAttributes = require('./inheritAttributes-ff9ad737.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) {
index.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.inheritAttributes(this.host, ['style', 'class']);
}
render() {
var _a;
return (index.h(index.Host, { key: '58db11b606cb1211fc569e0868a602ed935b46fa' }, index.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 }), index.h("div", { key: 'b7436bdce7bb19745ac25dfc5a9db16f308db41c' }, index.h("slot", { key: '6436d57046cde0d03359899690be4af1b17fe506' })))));
}
get host() { return index.getElement(this); }
};
TdsPopoverCanvas.style = TdsPopoverCanvasStyle0;
exports.tds_popover_canvas = TdsPopoverCanvas;