import { h } from "@stencil/core";
import classNames from "classnames";
import { DataTestIdsEnum } from "../../../constants/dataTestIds.enum";
export class FormatAmount {
    constructor() {
        this.showLabel = true;
    }
    render() {
        return this.isValid ? this.renderValid() : this.renderInvalid();
    }
    renderInvalid() {
        var _a;
        return (h("span", { "data-testid": (_a = this.dataTestId) !== null && _a !== void 0 ? _a : DataTestIdsEnum.formatAmountComponent, class: this.class }, h("span", { class: "int-amount", "data-testid": DataTestIdsEnum.formatAmountInt }, "...")));
    }
    renderValid() {
        return (h("span", { "data-testid": this.dataTestId, class: classNames(this.class, 'format-amount') }, h("span", { class: "int-amount", "data-testid": DataTestIdsEnum.formatAmountInt }, this.valueInteger), this.valueDecimal && (h("span", { class: "decimals", "data-testid": DataTestIdsEnum.formatAmountDecimals }, this.valueDecimal)), this.showLabel && this.label && (h("span", { class: {
                symbol: true,
                [this.labelClass]: Boolean(this.labelClass),
            }, "data-testid": DataTestIdsEnum.formatAmountSymbol }, this.label))));
    }
    static get is() { return "mvx-format-amount"; }
    static get originalStyleUrls() {
        return {
            "$": ["format-amount.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["format-amount.css"]
        };
    }
    static get properties() {
        return {
            "class": {
                "type": "string",
                "attribute": "class",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "dataTestId": {
                "type": "string",
                "attribute": "data-test-id",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "isValid": {
                "type": "boolean",
                "attribute": "is-valid",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "label": {
                "type": "string",
                "attribute": "label",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "labelClass": {
                "type": "string",
                "attribute": "label-class",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "showLabel": {
                "type": "boolean",
                "attribute": "show-label",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "true"
            },
            "valueDecimal": {
                "type": "string",
                "attribute": "value-decimal",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "valueInteger": {
                "type": "string",
                "attribute": "value-integer",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            }
        };
    }
}
//# sourceMappingURL=format-amount.js.map
