@kelvininc/ui-components
Version:
Kelvin UI Components
28 lines (23 loc) • 1.55 kB
JavaScript
'use strict';
var index = require('./index-rNNWWpit.js');
require('./wizard.types-C9Yhv1tt.js');
const radioListCss = "@property --rotation{syntax:\"<angle>\";initial-value:0deg;inherits:false}@keyframes rotate-border{to{--rotation:360deg}}kv-dropdown-base:not(.hydrated)>[slot=list]{display:none}.radio-list-items{display:flex;flex-direction:column;gap:var(--spacing-md)}";
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: 'e79d68404d65dc53382a6ba57eec123e817fd6ed' }, this.label && index.h("kv-form-label", { key: '2aacc1a83fc04dfb35d14c1308eee1576aef9968', label: this.label, required: this.required }), index.h("div", { key: '69d019f1bd664201f5c3f58e0e58443b82cb1fb5', 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;