'use client';
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var tslib = require('tslib');
var lit = require('lit');
var decorators_js = require('lit/decorators.js');
var optionElement = require('../../base/option-element.cjs.js');
var sgdsCheckbox = require('../Checkbox/sgds-checkbox.cjs.js');
var sgdsIcon = require('../Icon/sgds-icon.cjs.js');

/**
 * @summary ComboBoxOption is the option of the Combobox
 *
 * @slot default - The label of the option
 */
class SgdsComboBoxOption extends optionElement.OptionElement {
    constructor() {
        super(...arguments);
        /**
         * @internal If true, this item is rendered as a checkbox item.
         * This property is controlled by its combo box parent
         */
        this.checkbox = false;
        this._renderItemContent = () => {
            return this.checkbox
                ? lit.html `
          <sgds-checkbox .checked=${this.active} .disabled=${this.disabled}>
            <slot></slot>
          </sgds-checkbox>
        `
                : lit.html `
          <div class="normal-item-content">
            <slot></slot>
            ${this.active ? lit.html ` <sgds-icon name="check"></sgds-icon> ` : lit.nothing}
          </div>
        `;
        };
    }
    connectedCallback() {
        super.connectedCallback();
    }
    firstUpdated(changedProperties) {
        super.firstUpdated(changedProperties);
        const parent = this.parentElement;
        if (parent === null || parent === void 0 ? void 0 : parent.multiSelect) {
            this.checkbox = true;
        }
    }
}
/** @internal */
SgdsComboBoxOption.dependencies = {
    "sgds-icon": sgdsIcon.SgdsIcon,
    "sgds-checkbox": sgdsCheckbox.SgdsCheckbox
};
tslib.__decorate([
    decorators_js.property({ type: Boolean, reflect: true })
], SgdsComboBoxOption.prototype, "checkbox", void 0);

exports.SgdsComboBoxOption = SgdsComboBoxOption;
exports["default"] = SgdsComboBoxOption;
//# sourceMappingURL=sgds-combo-box-option.cjs.js.map
