/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { getShadowElement, toggleClass } from '@tylertech/forge-core';
import { BaseAdapter } from '../core/base/base-adapter';
import { OPEN_ICON_CONSTANTS } from './open-icon-constants';
import { ICON_CONSTANTS } from '../icon';
export class OpenIconAdapter extends BaseAdapter {
    constructor(component) {
        super(component);
        this._openIcon = getShadowElement(component, `.${OPEN_ICON_CONSTANTS.classes.ICON}`);
        this._iconElement = getShadowElement(component, ICON_CONSTANTS.elementName);
    }
    setOrientation(orientation) {
        if (orientation === OPEN_ICON_CONSTANTS.strings.ORIENTATION_HORIZONTAL) {
            this._iconElement.name = 'keyboard_arrow_right';
        }
        else {
            this._iconElement.name = 'keyboard_arrow_down';
        }
    }
    setOpenState(open) {
        toggleClass(this._openIcon, open, OPEN_ICON_CONSTANTS.classes.ICON_OPEN);
    }
}
