UNPKG

@railzai/railz-visualizations

Version:
136 lines 4.21 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 Translations from '../../config/translations/en.json'; import { Error202, Error204, Error404, Error500 } from './images'; export class ErrorImage { constructor() { /** * Fill color of the svg image representing a status code */ this.fillColor = '#949494'; } render() { switch (this.statusCode) { case 202: return (h("div", null, h(Error202, { fillColor: this.fillColor, width: this.width, height: this.height }), h("p", { class: "rv-error-title", style: this.textStyle }, Translations.RV_ERROR_202_TITLE))); case 204: return (h("div", null, h(Error204, { fillColor: this.fillColor, width: this.width, height: this.height }), h("p", { class: "rv-error-title", style: this.textStyle }, Translations.RV_ERROR_204_TITLE))); case 404: return (h("div", null, h(Error404, { fillColor: this.fillColor, width: this.width, height: this.height }), h("p", { class: "rv-error-title", style: this.textStyle }, Translations.DASHBOARD_FINANCIAL_SUMMARY_CHART_ERROR_ASP_NOT_SUPPORTED))); case 422: return (h("div", null, h(Error204, { fillColor: this.fillColor, width: this.width, height: this.height }), h("p", { class: "rv-error-title", style: this.textStyle }, Translations.RV_ERROR_422_TITLE))); default: return (h("div", null, h(Error500, { fillColor: this.fillColor, width: this.width, height: this.height }), h("p", { class: "rv-error-title", style: this.textStyle }, Translations.RV_ERROR_500_TITLE))); } } static get is() { return "railz-error-image"; } static get encapsulation() { return "shadow"; } static get originalStyleUrls() { return { "$": ["./error-image.scss"] }; } static get styleUrls() { return { "$": ["error-image.css"] }; } static get properties() { return { "statusCode": { "type": "number", "mutable": false, "complexType": { "original": "number", "resolved": "number", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "Status code based on HTTP Response codes" }, "attribute": "status-code", "reflect": false }, "fillColor": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "Fill color of the svg image representing a status code" }, "attribute": "fill-color", "reflect": false, "defaultValue": "'#949494'" }, "width": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "Width of the SVG Error Indicator" }, "attribute": "width", "reflect": false }, "height": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "Height of the SVG Error Indicator" }, "attribute": "height", "reflect": false }, "textStyle": { "type": "unknown", "mutable": false, "complexType": { "original": "{ [key: string]: any }", "resolved": "{ [key: string]: any; }", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "Style of the image text" } } }; } } //# sourceMappingURL=error-image.js.map