/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { __decorate } from "tslib";
import { CustomElement, FoundationProperty, attachShadowTemplate, coerceBoolean } from '@tylertech/forge-core';
import { SelectDropdownFoundation } from './select-dropdown-foundation';
import { SELECT_DROPDOWN_CONSTANTS } from './select-dropdown-constants';
import { BaseSelectComponent } from '../core/base-select';
import { BASE_SELECT_CONSTANTS } from '../core/base-select-constants';
import { SelectDropdownAdapter } from './select-dropdown-adapter';
import { OptionComponent } from '../option';
import { OptionGroupComponent } from '../option-group';
import { PopupComponent } from '../../popup';
import { ListComponent, ListItemComponent } from '../../list';
import { CircularProgressComponent } from '../../circular-progress';
import { ScaffoldComponent } from '../../scaffold';
import { ToolbarComponent } from '../../toolbar';
import { IconButtonComponent } from '../../icon-button';
const template = '<template></template>';
const styles = ':host{display:none}';
/**
 * The web component class behind the `<forge-select-dropdown>` custom element.
 *
 * @tag forge-select-dropdown
 */
let SelectDropdownComponent = class SelectDropdownComponent extends BaseSelectComponent {
    static get observedAttributes() {
        return [
            SELECT_DROPDOWN_CONSTANTS.attributes.TARGET,
            SELECT_DROPDOWN_CONSTANTS.attributes.SELECTED_TEXT_TARGET,
            SELECT_DROPDOWN_CONSTANTS.attributes.SYNC_SELECTED_TEXT,
            BASE_SELECT_CONSTANTS.attributes.VALUE,
            BASE_SELECT_CONSTANTS.attributes.MULTIPLE,
            BASE_SELECT_CONSTANTS.attributes.OBSERVE_SCROLL,
            BASE_SELECT_CONSTANTS.attributes.OBSERVE_SCROLL_THRESHOLD,
            BASE_SELECT_CONSTANTS.attributes.POPUP_CLASSES,
            BASE_SELECT_CONSTANTS.attributes.OPTION_LIMIT,
            BASE_SELECT_CONSTANTS.attributes.SYNC_POPUP_WIDTH
        ];
    }
    constructor() {
        super();
        attachShadowTemplate(this, template, styles);
        this._foundation = new SelectDropdownFoundation(new SelectDropdownAdapter(this));
    }
    attributeChangedCallback(name, oldValue, newValue) {
        switch (name) {
            case SELECT_DROPDOWN_CONSTANTS.attributes.TARGET:
                this.target = newValue;
                return;
            case SELECT_DROPDOWN_CONSTANTS.attributes.SELECTED_TEXT_TARGET:
                this.selectedTextTarget = newValue;
                return;
            case SELECT_DROPDOWN_CONSTANTS.attributes.SYNC_SELECTED_TEXT:
                this.syncSelectedText = coerceBoolean(newValue);
                return;
        }
        super.attributeChangedCallback(name, oldValue, newValue);
    }
};
__decorate([
    FoundationProperty()
], SelectDropdownComponent.prototype, "target", void 0);
__decorate([
    FoundationProperty()
], SelectDropdownComponent.prototype, "selectedTextTarget", void 0);
__decorate([
    FoundationProperty()
], SelectDropdownComponent.prototype, "syncSelectedText", void 0);
SelectDropdownComponent = __decorate([
    CustomElement({
        name: SELECT_DROPDOWN_CONSTANTS.elementName,
        dependencies: [
            OptionComponent,
            OptionGroupComponent,
            PopupComponent,
            ListComponent,
            ListItemComponent,
            CircularProgressComponent,
            ScaffoldComponent,
            ToolbarComponent,
            IconButtonComponent
        ]
    })
], SelectDropdownComponent);
export { SelectDropdownComponent };
