@limetech/lime-elements
Version:
40 lines (35 loc) • 1.29 kB
JavaScript
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const index = require('./index-174a078a.js');
const RadioButtonGroup = class {
constructor(hostRef) {
index.registerInstance(this, hostRef);
this.change = index.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 (index.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 });
});
}
};
exports.limel_radio_button_group = RadioButtonGroup;
//# sourceMappingURL=limel-radio-button-group.cjs.entry.js.map