/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { __decorate } from "tslib";
import { coerceBoolean, FoundationProperty } from '@tylertech/forge-core';
import { BASE_SELECT_CONSTANTS } from './base-select-constants';
import { ListDropdownAware } from '../../list-dropdown/list-dropdown-aware';
export class BaseSelectComponent extends ListDropdownAware {
    constructor() {
        super();
    }
    attributeChangedCallback(name, oldValue, newValue) {
        super.attributeChangedCallback(name, oldValue, newValue);
        switch (name) {
            case BASE_SELECT_CONSTANTS.attributes.MULTIPLE:
                this.multiple = coerceBoolean(newValue);
                break;
            case BASE_SELECT_CONSTANTS.attributes.VALUE:
                this.value = newValue;
                break;
        }
    }
    appendOptions(options) {
        this._foundation.appendOptions(options);
    }
    selectAll() {
        this._foundation.selectAll();
    }
    deselectAll() {
        this._foundation.deselectAll();
    }
    connectedCallback() {
        this._foundation.initialize();
    }
    disconnectedCallback() {
        this._foundation.disconnect();
    }
}
__decorate([
    FoundationProperty()
], BaseSelectComponent.prototype, "value", void 0);
__decorate([
    FoundationProperty()
], BaseSelectComponent.prototype, "selectedIndex", void 0);
__decorate([
    FoundationProperty()
], BaseSelectComponent.prototype, "options", void 0);
__decorate([
    FoundationProperty()
], BaseSelectComponent.prototype, "multiple", void 0);
__decorate([
    FoundationProperty()
], BaseSelectComponent.prototype, "open", void 0);
__decorate([
    FoundationProperty()
], BaseSelectComponent.prototype, "optionBuilder", void 0);
__decorate([
    FoundationProperty()
], BaseSelectComponent.prototype, "selectedTextBuilder", void 0);
__decorate([
    FoundationProperty()
], BaseSelectComponent.prototype, "beforeValueChange", void 0);
__decorate([
    FoundationProperty({ set: false })
], BaseSelectComponent.prototype, "popupElement", void 0);
