UNPKG

@railzai/railz-visualizations

Version:
95 lines 3.12 kB
/*! * Accounting Data as a Service™ is the solution that makes sense of your business customers' financial data. * Built with Stencil * Copyright (c) FIS. */ /* eslint-disable max-len, @typescript-eslint/no-unused-vars */ import { Component, h, Prop } from '@stencil/core'; import { isEmpty } from 'lodash-es'; import { RAILZ_TOOLTIP_COLOR } from '../../types'; import { TooltipImage } from './tooltip-image'; export class Tooltip { constructor() { /** * Question mark with a tooltip text */ this.text = ''; /** * Position of the Tooltip text when hovered */ this.tooltipStyle = { position: 'bottom-center' }; } render() { var _a, _b, _c, _d, _e; return (!isEmpty(this.tooltipText) && (h("div", { class: "rv-tooltip", style: Object.assign({ color: ((_a = this.tooltipStyle) === null || _a === void 0 ? void 0 : _a.fillColor) || RAILZ_TOOLTIP_COLOR }, (_b = this.tooltipStyle) === null || _b === void 0 ? void 0 : _b.style) }, h("div", { class: "rv-tooltip-image", style: Object.assign({}, (_c = this.tooltipStyle) === null || _c === void 0 ? void 0 : _c.textStyle) }, isEmpty(this.text) ? h(TooltipImage, Object.assign({}, this.tooltipStyle)) : this.text), h("span", { class: `rv-tooltiptext rv-${(_d = this.tooltipStyle) === null || _d === void 0 ? void 0 : _d.position}`, style: (_e = this.tooltipStyle) === null || _e === void 0 ? void 0 : _e.tooltipTextStyle }, this.tooltipText)))); } static get is() { return "railz-tooltip"; } static get encapsulation() { return "shadow"; } static get originalStyleUrls() { return { "$": ["tooltip.scss"] }; } static get styleUrls() { return { "$": ["tooltip.css"] }; } static get properties() { return { "text": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "Question mark with a tooltip text" }, "attribute": "text", "reflect": false, "defaultValue": "''" }, "tooltipText": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": true, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "tooltip-text", "reflect": false }, "tooltipStyle": { "type": "unknown", "mutable": false, "complexType": { "original": "RVTooltipIndicatorStyle", "resolved": "RVTooltipIndicatorStyle", "references": { "RVTooltipIndicatorStyle": { "location": "import", "path": "../../types" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "Position of the Tooltip text when hovered" }, "defaultValue": "{ position: 'bottom-center' }" } }; } } //# sourceMappingURL=tooltip.js.map