@kelvininc/ui-components
Version:
Kelvin UI Components
74 lines (69 loc) • 3.19 kB
JavaScript
import { p as proxyCustomElement, H, d as createEvent, h, e as Host } from './p-D6GMjtmE.js';
import { d as defineCustomElement$5 } from './p-Bu3_3dFw.js';
import { d as defineCustomElement$4 } from './p-D3eUowCJ.js';
import { d as defineCustomElement$3 } from './p-BeCwHLdO.js';
import { d as defineCustomElement$2 } from './p-ALL1W_6x.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$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: '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 })));
}))));
}
static get style() { return radioListCss; }
}, [1, "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-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$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 };