/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { __decorate } from "tslib";
import { CustomElement, attachShadowTemplate, coerceBoolean, FoundationProperty } from '@tylertech/forge-core';
import { LabelValueAdapter } from './label-value-adapter';
import { LabelValueFoundation } from './label-value-foundation';
import { LABEL_VALUE_CONSTANTS } from './label-value-constants';
import { BaseComponent } from '../core/base/base-component';
const template = '<template><div class=\"forge-label-value\" part=\"root\"><div class=\"forge-label-value__icon-container\" part=\"icon-container\"><slot name=\"icon\"></slot></div><div class=\"forge-label-value__container\" part=\"container\"><div class=\"forge-label-value__label\" part=\"label-container\"><slot name=\"label\"></slot></div><div class=\"forge-label-value__value\" part=\"value-container\"><slot name=\"value\"></slot></div></div></div></template>';
const styles = ':host{display:block;min-width:0}:host([hidden]){display:none}.forge-label-value{display:-webkit-box;display:flex;min-height:3rem}.forge-label-value__container{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-flex:1;flex:1}.forge-label-value__icon-container{display:-webkit-box;display:flex;-webkit-box-align:start;align-items:flex-start}.forge-label-value__icon-container ::slotted([slot=icon]){color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));font-size:1.25rem!important;margin-right:8px;margin-top:4px}.forge-label-value--align-center .forge-label-value__container{-webkit-box-align:center;align-items:center}.forge-label-value--align-right .forge-label-value__container{-webkit-box-align:end;align-items:flex-end}.forge-label-value__label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.8125rem;height:.8125rem;line-height:.8125rem;margin-top:.5rem}.forge-label-value__value{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-body1-font-size, 1rem);line-height:1.5rem;line-height:var(--mdc-typography-body1-line-height, 1.5rem);font-weight:400;font-weight:var(--mdc-typography-body1-font-weight,400);letter-spacing:.03125em;letter-spacing:var(--mdc-typography-body1-letter-spacing, .03125em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body1-text-transform,inherit);line-height:1rem;margin-top:.375rem}.forge-label-value--roomy{min-height:3.5rem}.forge-label-value--roomy .forge-label-value__label{margin-top:.625rem}.forge-label-value--roomy .forge-label-value__value{margin-top:.5rem}.forge-label-value--roomy ::slotted([slot=icon]){margin-top:6px}.forge-label-value--dense{min-height:1.5rem}.forge-label-value--dense .forge-label-value__container{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center}.forge-label-value--dense .forge-label-value__container .forge-label-value__label{margin-top:0;margin-right:8px}.forge-label-value--dense .forge-label-value__container .forge-label-value__value{margin-top:0;font-size:.875rem}.forge-label-value--dense ::slotted([slot=icon]){margin-top:2px}.forge-label-value--empty .forge-label-value__value{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-style:italic}.forge-label-value--ellipsis .forge-label-value__container{overflow:hidden}.forge-label-value--ellipsis .forge-label-value__container .forge-label-value__label,.forge-label-value--ellipsis .forge-label-value__container .forge-label-value__value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}';
/**
 * The web component class behind the `<forge-label-value>` custom element.
 *
 * @tag forge-label-value
 */
let LabelValueComponent = class LabelValueComponent extends BaseComponent {
    constructor() {
        super();
        attachShadowTemplate(this, template, styles);
        this._foundation = new LabelValueFoundation(new LabelValueAdapter(this));
    }
    static get observedAttributes() {
        return [
            LABEL_VALUE_CONSTANTS.attributes.EMPTY,
            LABEL_VALUE_CONSTANTS.attributes.ELLIPSIS,
            LABEL_VALUE_CONSTANTS.attributes.DENSITY,
            LABEL_VALUE_CONSTANTS.attributes.ALIGN
        ];
    }
    connectedCallback() {
        this._foundation.initialize();
    }
    attributeChangedCallback(name, oldValue, newValue) {
        switch (name) {
            case LABEL_VALUE_CONSTANTS.attributes.EMPTY:
                this.empty = coerceBoolean(newValue);
                break;
            case LABEL_VALUE_CONSTANTS.attributes.ELLIPSIS:
                this.ellipsis = coerceBoolean(newValue);
                break;
            case LABEL_VALUE_CONSTANTS.attributes.DENSITY:
                this.density = newValue;
                break;
            case LABEL_VALUE_CONSTANTS.attributes.ALIGN:
                this.align = newValue;
                break;
        }
    }
};
__decorate([
    FoundationProperty()
], LabelValueComponent.prototype, "empty", void 0);
__decorate([
    FoundationProperty()
], LabelValueComponent.prototype, "ellipsis", void 0);
__decorate([
    FoundationProperty()
], LabelValueComponent.prototype, "density", void 0);
__decorate([
    FoundationProperty()
], LabelValueComponent.prototype, "align", void 0);
LabelValueComponent = __decorate([
    CustomElement({
        name: LABEL_VALUE_CONSTANTS.elementName
    })
], LabelValueComponent);
export { LabelValueComponent };
