@railzai/railz-visualizations
Version:
Railz.ai Visualizations
78 lines • 2.19 kB
JavaScript
/*!
* 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 { isNull } from 'lodash-es';
export class Percentage {
constructor() {
/**
* Percentage to show
*/
this.percentage = 0;
}
render() {
var _a, _b;
if (isNull(this.percentage) || this.percentage === 0) {
return null;
}
return (h("div", { class: "rv-percentage" }, this.percentage > 0 ? (h("div", { class: "rv-positive", style: (_a = this.percentageStyle) === null || _a === void 0 ? void 0 : _a.positive },
"\u25B2 ",
this.percentage,
"%")) : (h("div", { class: "rv-negative", style: (_b = this.percentageStyle) === null || _b === void 0 ? void 0 : _b.negative },
"\u25BC ",
this.percentage,
"%"))));
}
static get is() { return "railz-percentage"; }
static get encapsulation() { return "shadow"; }
static get originalStyleUrls() { return {
"$": ["percentage.scss"]
}; }
static get styleUrls() { return {
"$": ["percentage.css"]
}; }
static get properties() { return {
"percentage": {
"type": "number",
"mutable": false,
"complexType": {
"original": "number",
"resolved": "number",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Percentage to show"
},
"attribute": "percentage",
"reflect": false,
"defaultValue": "0"
},
"percentageStyle": {
"type": "unknown",
"mutable": false,
"complexType": {
"original": "RVOptionsPercentageStyle",
"resolved": "RVOptionsPercentageStyle",
"references": {
"RVOptionsPercentageStyle": {
"location": "import",
"path": "../../types"
}
}
},
"required": false,
"optional": true,
"docs": {
"tags": [],
"text": ""
}
}
}; }
}
//# sourceMappingURL=percentage.js.map