@kelvininc/ui-components
Version:
Kelvin UI Components
80 lines (75 loc) • 3.47 kB
JavaScript
import { H as proxyCustomElement, I as H, J as createEvent, K as h, L as Host } from './p-BP5CxQcH.js';
import { d as defineCustomElement$6 } from './p-E4GiU6Fx.js';
import { d as defineCustomElement$5 } from './p-DQ7v6WT-.js';
import { d as defineCustomElement$4 } from './p-DSpDHkW6.js';
import { d as defineCustomElement$3 } from './p-s9JMr6UQ.js';
import { d as defineCustomElement$2 } from './p-BtfKzZKx.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$1 = /*@__PURE__*/ proxyCustomElement(class KvRadioList extends H {
constructor() {
super();
this.__registerHost();
this.__attachShadow();
this.optionSelected = createEvent(this, "optionSelected", 7);
/** @inheritdoc */
this.required = false;
this.onOptionClick = ({ detail }) => {
this.optionSelected.emit(detail);
};
}
render() {
return (h(Host, { key: 'e79d68404d65dc53382a6ba57eec123e817fd6ed' }, this.label && h("kv-form-label", { key: '2aacc1a83fc04dfb35d14c1308eee1576aef9968', label: this.label, required: this.required }), h("div", { key: '69d019f1bd664201f5c3f58e0e58443b82cb1fb5', 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 })));
}))));
}
static get style() { return radioListCss; }
}, [257, "kv-radio-list", {
"label": [513],
"options": [16],
"selectedOption": [520, "selected-option"],
"disabledOptions": [16, "disabled-options"],
"required": [516]
}]);
function defineCustomElement$1() {
if (typeof customElements === "undefined") {
return;
}
const components = ["kv-radio-list", "kv-form-label", "kv-icon", "kv-link", "kv-radio", "kv-radio-list-item"];
components.forEach(tagName => { switch (tagName) {
case "kv-radio-list":
if (!customElements.get(tagName)) {
customElements.define(tagName, KvRadioList$1);
}
break;
case "kv-form-label":
if (!customElements.get(tagName)) {
defineCustomElement$6();
}
break;
case "kv-icon":
if (!customElements.get(tagName)) {
defineCustomElement$5();
}
break;
case "kv-link":
if (!customElements.get(tagName)) {
defineCustomElement$4();
}
break;
case "kv-radio":
if (!customElements.get(tagName)) {
defineCustomElement$3();
}
break;
case "kv-radio-list-item":
if (!customElements.get(tagName)) {
defineCustomElement$2();
}
break;
} });
}
defineCustomElement$1();
const KvRadioList = KvRadioList$1;
const defineCustomElement = defineCustomElement$1;
export { KvRadioList, defineCustomElement };