| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- var _ = Object.defineProperty;
- var s = Object.getOwnPropertySymbols;
- var S = Object.prototype.hasOwnProperty, g = Object.prototype.propertyIsEnumerable;
- var c = (n, t, o) => t in n ? _(n, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[t] = o, a = (n, t) => {
- for (var o in t || (t = {}))
- S.call(t, o) && c(n, o, t[o]);
- if (s)
- for (var o of s(t))
- g.call(t, o) && c(n, o, t[o]);
- return n;
- };
- import { useAttrs as y, computed as u, openBlock as i, createElementBlock as d, createVNode as w, mergeProps as C, withCtx as B, renderSlot as m, createCommentVNode as O } from "vue";
- import { _ as k } from "./index4.js";
- const A = { class: "s-form-item" }, x = {
- key: 0,
- class: "label"
- }, D = {
- __name: "SFormItem",
- props: {
- label: {
- type: String,
- default: ""
- },
- labelWidth: {
- type: [Number, String],
- default: "100%"
- },
- name: {
- type: String,
- default: ""
- }
- },
- setup(n) {
- const t = y(), o = n, f = /* @__PURE__ */ new Set([
- "disabled",
- "allowClear",
- "clearable",
- "showSearch",
- "multiple",
- "readonly",
- "autofocus",
- "bordered",
- "checked",
- "open",
- "autoClearSearchValue",
- "noDrag",
- "isManual",
- "expandAll",
- "recursionChildren",
- "treeCheckable",
- "showOnlyOrganization",
- "isDataScopeFilter"
- ]), p = (e) => typeof e == "boolean" ? e : e === "" || e === null || e === void 0 ? e === "" ? !0 : e : typeof e == "string" ? !(e === "false" || e === "0") : !!e, b = u(() => {
- const e = {};
- return Object.keys(t || {}).forEach((l) => {
- const r = t[l];
- e[l] = f.has(l) ? p(r) : r;
- }), e;
- }), h = u(() => {
- const e = o.labelWidth + "";
- return {
- labelCol: {
- style: {
- width: e.includes("px") ? e : e + "px"
- }
- }
- };
- });
- return (e, l) => {
- const r = k;
- return i(), d("div", A, [
- w(r, C({
- label: n.label,
- name: n.name
- }, a(a({}, h.value), b.value), { class: "s-form-item" }), {
- default: B(() => [
- e.$slots.label ? (i(), d("div", x, [
- m(e.$slots, "label")
- ])) : O("", !0),
- m(e.$slots, "default")
- ]),
- _: 3
- }, 16, ["label", "name"])
- ]);
- };
- }
- };
- export {
- D as default
- };
|