ideaz-element
Version:
<p align="center"> <a href="" target="_blank" rel="noopener noreferrer"> <img src="./docs/public/logo.svg" alt="Ideaz Element" width="180" style="width: 180px;" /> </a> </p>
65 lines (64 loc) • 2.54 kB
JavaScript
import { isVNode as v, defineComponent as b, useAttrs as y, createVNode as C, mergeProps as V } from "vue";
import { ElRadioGroup as R } from "element-plus";
import "../../../shared/index.mjs";
import "../../../utils/index.mjs";
import "../../../node_modules/.pnpm/lodash-unified@1.0.3_@types_lodash-es@4.17.12_lodash-es@4.17.21_lodash@4.17.21/node_modules/lodash-unified/import.mjs";
import { radioProps as g, FILTER_RADIO_PROPS as k } from "./props.mjs";
import { useVModel as N } from "../../../hooks/useVModel.mjs";
import { useFormSize as O } from "../../../hooks/useFormSize.mjs";
import P from "../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/omit.mjs";
import { resolveDynamicComponent as S } from "../../../shared/resolveDynamicComponent.mjs";
import { isValid as _, isFunction as j } from "../../../utils/is.mjs";
import i from "../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/get.mjs";
function p(e) {
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !v(e);
}
const T = /* @__PURE__ */ b({
name: "ZRadio",
props: g,
emits: ["input", "update:modelValue"],
setup(e, {
emit: d
}) {
const {
vModelVal: l
} = N(e, d), n = O(), s = y(), f = (a) => !a.type && e.type ? `el-${e.type}` : a.type === "radio" || a.type === "radio-button" ? `el-${a.type}` : "el-radio";
return () => {
let a;
return C(R, V({
...s,
...P(e, k)
}, {
modelValue: l.value,
size: n.value,
"onUpdate:modelValue": (t) => l.value = t
}), p(a = e.options.map((t) => {
var o, m, u;
const c = f(t);
return S({
name: c,
attrs: {
...t,
border: _(t.border) ? t.border : e.border,
value: i(t, ((o = e.alias) == null ? void 0 : o.value) || "value", ""),
disabled: i(t, ((m = e.alias) == null ? void 0 : m.disabled) || "disabled", !1),
key: i(t, ((u = e.alias) == null ? void 0 : u.value) || "value", ""),
onClick: (r) => {
e.isCancel && (r.preventDefault(), l.value === t.value ? l.value = "" : l.value = t.value), j(t.onClick) && t.onClick(r);
}
},
content: () => {
var r;
return i(t, ((r = e.alias) == null ? void 0 : r.label) || "label", "");
}
});
})) ? a : {
default: () => [a]
});
};
}
});
export {
T as default
};
//# sourceMappingURL=index.mjs.map