'use strict';

var index = require('./index-BjHIBY-I.js');

const RadioButtonGroup = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.change = index.createEvent(this, "change");
        /**
         * Disables all radio buttons when `true`
         */
        this.disabled = false;
        /**
         * By default, lists will display 3 lines of text, and then truncate the rest.
         * Consumers can increase or decrease this number by specifying
         * `maxLinesSecondaryText`. If consumer enters zero or negative
         * numbers we default to 1; and if they type decimals we round up.
         */
        this.maxLinesSecondaryText = 3;
        this.handleChange = (event) => {
            event.stopPropagation();
            if (this.disabled) {
                return;
            }
            this.change.emit(event.detail);
        };
    }
    render() {
        return (index.h("limel-list", { key: '591ebaf4100003058cf2c38202b9f7befa32d398', items: this.createItems(), type: "radio", badgeIcons: this.badgeIcons, maxLinesSecondaryText: this.maxLinesSecondaryText, onChange: this.handleChange }));
    }
    createItems() {
        return this.items.map((option) => {
            var _a;
            if ('separator' in option) {
                return option;
            }
            return Object.assign(Object.assign({}, option), { selected: option.value === ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.value), disabled: this.disabled || option.disabled });
        });
    }
};

exports.limel_radio_button_group = RadioButtonGroup;
