@kelvininc/ui-components
Version:
Kelvin UI Components
25 lines (21 loc) • 1.46 kB
JavaScript
import { r as registerInstance, c as createEvent, h, H as Host } from './index-D-JVwta2.js';
const radioListCss = "@property --rotation{syntax:\"<angle>\";initial-value:0deg;inherits:false}@keyframes rotate-border{to{--rotation:360deg}}.radio-list-items{display:flex;flex-direction:column;gap:var(--kv-spacing-2x, 8px)}";
const KvRadioList = class {
constructor(hostRef) {
registerInstance(this, hostRef);
this.optionSelected = createEvent(this, "optionSelected", 7);
/** @inheritdoc */
this.required = false;
this.onOptionClick = ({ detail }) => {
this.optionSelected.emit(detail);
};
}
render() {
return (h(Host, { key: 'a1c116292927c25024ac010bd4b5f097536a7b8a' }, this.label && h("kv-form-label", { key: 'baaede48249a578f19e5ecb8c9e3fe514f15ff99', label: this.label, required: this.required }), h("div", { key: 'c34908db8e00a466a8ce62a5cc1d53986f1578c4', class: "radio-list-items", part: "items-container" }, this.options.map(item => {
var _a;
return (h("kv-radio-list-item", Object.assign({}, item, { key: item.optionId, checked: this.selectedOption === item.optionId, disabled: item.disabled || ((_a = this.disabledOptions) === null || _a === void 0 ? void 0 : _a[item.optionId]), class: "radio-list-item", onOptionClick: this.onOptionClick })));
}))));
}
};
KvRadioList.style = radioListCss;
export { KvRadioList as kv_radio_list };