@limetech/lime-elements
Version:
36 lines (33 loc) • 1.23 kB
JavaScript
import { r as registerInstance, c as createEvent, h } from './index-2714248e.js';
const RadioButtonGroup = class {
constructor(hostRef) {
registerInstance(this, hostRef);
this.change = createEvent(this, "change", 7);
this.handleChange = (event) => {
event.stopPropagation();
if (this.disabled) {
return;
}
this.change.emit(event.detail);
};
this.items = undefined;
this.selectedItem = undefined;
this.disabled = false;
this.badgeIcons = undefined;
this.maxLinesSecondaryText = 3;
}
render() {
return (h("limel-list", { 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 });
});
}
};
export { RadioButtonGroup as limel_radio_button_group };
//# sourceMappingURL=limel-radio-button-group.entry.js.map