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>
64 lines (63 loc) • 2.41 kB
JavaScript
import { isVNode as f, defineComponent as v, useAttrs as h, createVNode as y, mergeProps as C } from "vue";
import { ElCheckboxGroup as k } 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 { checkboxProps as p, CHECKBOX_FILTER_PROPS as x } from "./props.mjs";
import { useVModel as V } from "../../../hooks/useVModel.mjs";
import { useFormSize as g } from "../../../hooks/useFormSize.mjs";
import z from "../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/omit.mjs";
import { resolveDynamicComponent as N } from "../../../shared/resolveDynamicComponent.mjs";
import { isValid as O } from "../../../utils/is.mjs";
import l 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]" && !f(e);
}
const H = /* @__PURE__ */ v({
name: "ZCheckbox",
inheritAttrs: !1,
props: p,
emits: ["input", "update:modelValue"],
setup: (e, {
emit: s
}) => {
const {
vModelVal: a
} = V(e, s), o = g(), d = h(), n = (r) => !r.type && e.type ? `el-${e.type}` : r.type === "checkbox" || r.type === "checkbox-button" ? `el-${r.type}` : "el-checkbox";
return () => {
let r;
return y(k, C({
...d,
...z(e, x)
}, {
size: o.value,
modelValue: a.value,
"onUpdate:modelValue": (t) => a.value = t
}), P(r = e.options.map((t) => {
var m, i, u;
const b = n(t);
return N({
name: b,
attrs: {
size: o.value,
...t,
border: O(t.border) ? t.border : e.border,
value: l(t, ((m = e.alias) == null ? void 0 : m.value) || "value", ""),
disabled: l(t, ((i = e.alias) == null ? void 0 : i.disabled) || "disabled", !1),
key: l(t, ((u = e.alias) == null ? void 0 : u.value) || "value", "")
},
content: () => {
var c;
return l(t, ((c = e.alias) == null ? void 0 : c.label) || "label", "");
}
});
})) ? r : {
default: () => [r]
});
};
}
});
export {
H as default
};
//# sourceMappingURL=index.mjs.map