UNPKG

@kelvininc/ui-components

Version:
27 lines (22 loc) 1.46 kB
'use strict'; var index = require('./index-DpuMIXDY.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) { index.registerInstance(this, hostRef); this.optionSelected = index.createEvent(this, "optionSelected", 7); /** @inheritdoc */ this.required = false; this.onOptionClick = ({ detail }) => { this.optionSelected.emit(detail); }; } render() { return (index.h(index.Host, { key: 'a1c116292927c25024ac010bd4b5f097536a7b8a' }, this.label && index.h("kv-form-label", { key: 'baaede48249a578f19e5ecb8c9e3fe514f15ff99', label: this.label, required: this.required }), index.h("div", { key: 'c34908db8e00a466a8ce62a5cc1d53986f1578c4', class: "radio-list-items", part: "items-container" }, this.options.map(item => { var _a; return (index.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; exports.kv_radio_list = KvRadioList;