UNPKG

@form-create/tdesign

Version:

TDesign 版本低代码表单 | FormCreate 是一个可以通过 JSON 生成具有动态渲染、数据收集、验证和提交功能的低代码表单生成组件。

1,471 lines (1,469 loc) 169 kB
/*! * FormCreate 低代码表单渲染器 * @form-create/tdesign v3.3.0 * (c) 2018-2026 xaboy * Github https://github.com/xaboy/form-create * Site https://form-create.com/ * Released under the MIT License. */ (function(){"use strict";try{if(typeof document!="undefined"){var r=document.createElement("style");r.appendChild(document.createTextNode('._fc-frame ._fc-files img{width:100%;height:100%;display:inline-block;vertical-align:top}._fc-frame ._fc-upload-cover{opacity:0;position:absolute;inset:0;background:#0009;transition:opacity .3s}._fc-frame ._fc-upload-cover ._fc-frame-icon{color:#fff;font-size:20px;margin:0 2px}._fc-frame ._fc-files:hover ._fc-upload-cover{opacity:1}._fc-frame .t-upload{display:block}._fc-frame ._fc-upload-btn,._fc-frame ._fc-frame-icon{cursor:pointer;font-size:20px;width:20px}._fc-frame._fc-disabled ._fc-upload-btn,._fc-frame._fc-disabled ._fc-frame-icon{cursor:not-allowed!important;color:#999}._fc-frame .t-input-adornment__append ._fc-frame-icon{margin:5px 12px 0}._fc-frame ._fc-upload-btn,._fc-files{display:inline-block;width:112px;height:112px;text-align:center;line-height:112px;border:1px solid #c0ccda;overflow:hidden;background:#fff;position:relative;box-shadow:2px 2px 5px #0000001a;margin-right:4px;box-sizing:border-box}._fc-group{display:flex;min-height:38px;justify-content:center;flex-direction:column;width:100%}._fc-group-disabled ._fc-group-btn,._fc-group-disabled ._fc-group-add{cursor:not-allowed}._fc-group-handle{display:flex;flex-direction:row;position:absolute;bottom:-15px;right:30px;border-radius:15px;border:1px dashed #d9d9d9;padding:3px 8px;background-color:#fff}._fc-group-btn{cursor:pointer}._fc-group-idx{position:absolute;bottom:-15px;left:10px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;background:#eee;border-radius:15px;font-weight:700}._fc-group-handle ._fc-group-btn+._fc-group-btn{margin-left:7px}._fc-group-container{position:relative;display:flex;flex-direction:column;border:1px dashed #d9d9d9;border-radius:5px;margin:5px 5px 25px;padding:20px 20px 25px}._fc-group-arrow{position:relative;width:20px;height:20px}._fc-group-arrow:before{content:"";position:absolute;top:8px;left:5px;width:9px;height:9px;border-left:2px solid #999;border-top:2px solid #999}._fc-group-arrow:before{transform:rotate(45deg)}._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group-plus-minus{width:20px;height:20px;position:relative;cursor:pointer}._fc-group-plus-minus:before,._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:60%;height:2px;background-color:#409eff;transform:translate(-50%,-50%)}._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group-plus-minus._fc-group-minus:after{background-color:#f56c6c}._fc-group-add{cursor:pointer;width:25px;height:25px;border:1px solid rgb(64 158 255 / 50%);border-radius:15px}._fc-group-add._fc-group-plus-minus:before,._fc-group-add._fc-group-plus-minus:after{width:50%}._fc-group._fc-group-card{display:flex;flex-direction:column;width:100%;gap:16px}._fc-group._fc-group-card._fc-group-disabled ._fc-group-btn,._fc-group._fc-group-card._fc-group-disabled ._fc-group-add{cursor:not-allowed;opacity:.5}._fc-group._fc-group-card ._fc-group-container{position:relative;background:#fff;border:1px solid #f0f0f0;border-radius:6px;overflow:hidden;display:flex;flex-direction:column;padding:0;margin:0}._fc-group._fc-group-card ._fc-group-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px 12px;border-bottom:1px solid #f0f0f0;background:#fafafa}._fc-group._fc-group-card ._fc-group-idx{display:flex;align-items:center;justify-content:center;width:24px;height:24px;background:#f0f0f0;color:#666;border-radius:6px;font-size:12px;font-weight:500;margin-right:12px;flex-shrink:0;position:static;border:1px solid #e0e0e0}._fc-group._fc-group-card ._fc-group-title{flex:1;font-size:14px;font-weight:500;color:#000000d9;line-height:1.5715}._fc-group._fc-group-card ._fc-group-handle{display:flex;align-items:center;gap:4px;margin-left:12px;flex-shrink:0;position:static;bottom:auto;right:auto;border-radius:0;border:none;padding:0;background-color:transparent;flex-direction:row}._fc-group._fc-group-card ._fc-group-btn{cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:4px;border:1px solid #d9d9d9;background:#fff;color:#00000073;position:relative}._fc-group._fc-group-card ._fc-group-btn:hover{color:#1890ff;border-color:#1890ff;background:#f0f8ff}._fc-group._fc-group-card ._fc-group-btn:active{color:#096dd9;border-color:#096dd9}._fc-group._fc-group-card ._fc-group-arrow{position:relative}._fc-group._fc-group-card ._fc-group-arrow:before{content:"";position:absolute;top:50%;left:50%;width:5px;height:5px;border-left:1px solid currentColor;border-top:1px solid currentColor;transform:translate(-50%,-50%) rotate(45deg)}._fc-group._fc-group-card ._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group._fc-group-card ._fc-group-sort{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;height:24px}._fc-group._fc-group-card ._fc-group-sort:before,._fc-group._fc-group-card ._fc-group-sort:after{content:"";position:absolute;left:50%;width:4px;height:4px;border-left:1px solid currentColor;border-top:1px solid currentColor;transform:translate(-50%)}._fc-group._fc-group-card ._fc-group-sort:before{top:6px;transform:translate(-50%) rotate(45deg)}._fc-group._fc-group-card ._fc-group-sort:after{bottom:6px;transform:translate(-50%) rotate(225deg)}._fc-group._fc-group-card ._fc-group-sort-up,._fc-group._fc-group-card ._fc-group-sort-down{position:absolute;left:0;right:0;height:12px;cursor:pointer;z-index:1}._fc-group._fc-group-card ._fc-group-sort-up{top:0}._fc-group._fc-group-card ._fc-group-sort-down{bottom:0}._fc-group._fc-group-card ._fc-group-sort-up:hover,._fc-group._fc-group-card ._fc-group-sort-down:hover{background:#1890ff1a}._fc-group._fc-group-card ._fc-group-plus-minus{position:relative;background:#409eff;border-color:#409eff;color:#fff;width:24px;height:24px}._fc-group._fc-group-card ._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-plus-minus:before,._fc-group._fc-group-card ._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:8px;height:1px;background-color:currentColor;transform:translate(-50%,-50%)}._fc-group._fc-group-card ._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus{background:#f56c6c;border-color:#f56c6c}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:hover{background:#f78989;border-color:#f78989}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group._fc-group-card ._fc-group-content{padding:20px}._fc-group._fc-group-card ._fc-group-add{cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:4px;border:1px solid #d9d9d9;background:#fff;color:#00000073;position:relative}._fc-group._fc-group-card ._fc-group-add:hover{color:#409eff;border-color:#409eff;background:#f0f8ff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus{width:24px;height:24px;background:#409eff;border-color:#409eff;color:#fff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before,._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:after{content:"";position:absolute;top:50%;left:50%;width:8px;height:1px;background-color:currentColor;transform:translate(-50%,-50%)}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group._fc-group-card ._fc-group-empty{text-align:center;padding:40px 20px;color:#00000073;font-size:14px}@media (max-width: 768px){._fc-group._fc-group-card ._fc-group-container{margin:0 -8px;border-radius:0;border-left:none;border-right:none}._fc-group._fc-group-card ._fc-group-header{padding:12px 16px 8px}._fc-group._fc-group-card ._fc-group-content{padding:16px}._fc-group._fc-group-card ._fc-group-handle{gap:2px}._fc-group._fc-group-card ._fc-group-btn{width:22px;height:22px}}.form-create{width:100%}.form-create .t-tree .t-tree__icon{line-height:inherit}.form-create.t-form:not(.t-form-inline) .t-form__item:last-of-type{margin-bottom:24px}.form-create .form-create .t-is-error .t-input__extra{color:var(--td-error-color)}.form-create .form-create .t-is-warning .t-input__extra{color:var(--td-warning-color)}.form-create.is-preview .fc-clock,.form-create .fc-none,.form-create.is-preview .t-form__label--required>label:before{display:none!important}.fc-form-footer{margin-top:12px}')),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})(); var ur = Object.defineProperty, fr = Object.defineProperties; var cr = Object.getOwnPropertyDescriptors; var ft = Object.getOwnPropertySymbols; var hr = Object.prototype.hasOwnProperty, dr = Object.prototype.propertyIsEnumerable; var ct = (t, e, r) => e in t ? ur(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, v = (t, e) => { for (var r in e || (e = {})) hr.call(e, r) && ct(t, r, e[r]); if (ft) for (var r of ft(e)) dr.call(e, r) && ct(t, r, e[r]); return t; }, M = (t, e) => fr(t, cr(e)); import { openBlock as Le, createElementBlock as Me, createElementVNode as $e, defineComponent as ge, h as Ce, nextTick as A, createVNode as w, resolveComponent as x, mergeProps as Ie, Fragment as pr, markRaw as se, reactive as K, isVNode as mr, getCurrentInstance as Xe, provide as gr, inject as yr, toRefs as ht, onBeforeMount as br, watchEffect as $r, onMounted as vr, onBeforeUnmount as _r, onUpdated as Cr, watch as q, computed as be, toRef as Be, withDirectives as wr, resolveDirective as Sr, ref as Fr, createApp as Or } from "vue"; function z(t) { return Array.isArray(t) ? t : [null, void 0, ""].indexOf(t) > -1 ? [] : [t]; } function Et(t) { t = t || /* @__PURE__ */ new Map(); const e = { $on(r, n) { const s = t.get(r); s && s.push(n) || t.set(r, [n]); }, $once(r, n) { n._once = !0, e.$on(r, n); }, $off(r, n) { const s = t.get(r); s && s.splice(s.indexOf(n) >>> 0, 1); }, $emit(r, ...n) { (t.get(r) || []).slice().map((s) => { s._once && (e.$off(r, s), delete s._once), s(...n); }), (t.get("*") || []).slice().map((s) => { s(r, n); }); } }; return e; } const Ne = (t, e) => { const r = t.__vccOpts || t; for (const [n, s] of e) r[n] = s; return r; }, Rr = { name: "IconFolder" }, Vr = { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }; function Er(t, e, r, n, s, i) { return Le(), Me("svg", Vr, [...e[0] || (e[0] = [ $e("path", { d: "M26 20h-2v4h-4v2h4v4h2v-4h4v-2h-4z", fill: "currentColor" }, null, -1), $e("path", { d: "M28 8H16l-3.4-3.4c-.4-.4-.9-.6-1.4-.6H4c-1.1 0-2 .9-2 2v20c0 1.1.9 2 2 2h14v-2H4V6h7.2l3.4 3.4l.6.6H28v8h2v-8c0-1.1-.9-2-2-2z", fill: "currentColor" }, null, -1) ])]); } const kr = /* @__PURE__ */ Ne(Rr, [["render", Er]]), Dr = ge({ name: "IconFile", render() { return Ce( "svg", { style: { width: "20px", fontSize: "20px" }, viewBox: "0 0 24 24", version: "1.1", xmlns: "http://www.w3.org/2000/svg" }, Ce( "g", { fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, Ce("path", { d: "M14 3v4a1 1 0 0 0 1 1h4" }), Ce("path", { d: "M17 21H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7l5 5v11a2 2 0 0 1-2 2z" }) ) ); } }), jr = { name: "DeleteOutlined" }, Ar = { height: "1em", width: "1em", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }; function Pr(t, e, r, n, s, i) { return Le(), Me("svg", Ar, [...e[0] || (e[0] = [ $e("path", { d: "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z", fill: "currentColor" }, null, -1) ])]); } const Ir = /* @__PURE__ */ Ne(jr, [["render", Pr]]), Br = { name: "EyeOutlined" }, Tr = { height: "1em", width: "1em", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }; function Lr(t, e, r, n, s, i) { return Le(), Me("svg", Tr, [...e[0] || (e[0] = [ $e("path", { d: "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 0 0 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3c7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176s176-78.8 176-176s-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112s112 50.1 112 112s-50.1 112-112 112z", fill: "currentColor" }, null, -1) ])]); } const Mr = /* @__PURE__ */ Ne(Br, [["render", Lr]]), Nr = "fcFrame", Ur = /* @__PURE__ */ ge({ name: Nr, props: { type: { type: String, default: "input" }, field: String, helper: { type: Boolean, default: !0 }, disabled: { type: Boolean, default: !1 }, src: { type: String, required: !0 }, icon: { type: String, default: "icon-folder" }, width: { type: [Number, String], default: "500px" }, height: { type: [Number, String], default: "370px" }, maxLength: { type: Number, default: 0 }, okBtnText: { type: String, default: "" }, closeBtnText: { type: String, default: "" }, modalTitle: String, handleIcon: { type: [String, Boolean], default: void 0 }, title: String, allowRemove: { type: Boolean, default: !0 }, onOpen: { type: Function, default: () => { } }, onOk: { type: Function, default: () => { } }, onCancel: { type: Function, default: () => { } }, onLoad: { type: Function, default: () => { } }, onBeforeRemove: { type: Function, default: () => { } }, onRemove: { type: Function, default: () => { } }, onHandle: Function, modal: { type: Object, default: () => ({}) }, srcKey: [String, Number], modelValue: [Array, String, Number, Object], previewMask: void 0, footer: { type: Boolean, default: !0 }, reload: { type: Boolean, default: !0 }, closeBtn: { type: Boolean, default: !0 }, okBtn: { type: Boolean, default: !0 }, formCreateInject: Object }, emits: ["update:modelValue", "change"], components: { IconFolder: kr, EyeOutlined: Mr }, data() { return { fileList: z(this.modelValue), previewVisible: !1, frameVisible: !1, previewImage: "", bus: new Et() }; }, watch: { modelValue(t) { this.fileList = z(t); } }, methods: { key(t) { return t; }, close() { this.closeModal(!0); }, closeModal(t) { this.bus.$emit(t ? "$close" : "$ok"), this.reload && (this.bus.$off("$ok"), this.bus.$off("$close")), this.frameVisible = !1; }, handleCancel() { this.previewVisible = !1; }, showModal() { this.disabled || this.onOpen() === !1 || (this.frameVisible = !0); }, input() { const t = this.fileList, e = this.maxLength === 1 ? t[0] || "" : t; this.$emit("update:modelValue", e), this.$emit("change", e); }, makeInput() { const t = x(this.icon); return w(x("t-input-adornment"), { append: () => w(t, { onClick: this.showModal, class: "_fc-frame-icon" }, null) }, { default: () => [w(x("TInput"), { readonly: !0, clearable: !this.disabled, showClearIconOnEmpty: !this.disabled, value: this.fileList.map((e) => this.getSrc(e)).toString(), onClear: () => { this.fileList = [], this.input(); }, key: 1 }, null)] }); }, makeGroup(t) { return (!this.maxLength || this.fileList.length < this.maxLength) && t.push(this.makeBtn()), w("div", { key: 2 }, [t]); }, makeItem(t, e) { return w("div", { class: "_fc-files", key: "3" + t }, [e]); }, valid(t) { const e = this.formCreateInject.field || this.field; if (e && t !== e) throw new Error("[frame]无效的字段值"); }, makeIcons(t, e) { if (this.handleIcon !== !1 || this.allowRemove === !0) { const r = []; return (this.type !== "file" && this.handleIcon !== !1 || this.type === "file" && this.handleIcon) && r.push(this.makeHandleIcon(t, e)), this.allowRemove && r.push(this.makeRemoveIcon(t, e)), w("div", { class: "_fc-upload-cover", key: 4 }, [r]); } }, makeHandleIcon(t, e) { const r = x(this.handleIcon === !0 || this.handleIcon === void 0 ? "EyeOutlined" : this.handleIcon); return w(r, { class: "_fc-frame-icon", onClick: () => this.handleClick(t), key: "5" + e }, null); }, makeRemoveIcon(t, e) { return w(Ir, { class: "_fc-frame-icon", onClick: () => this.handleRemove(t), key: "6" + e }, null); }, makeFiles() { return this.makeGroup(this.fileList.map((t, e) => this.makeItem(e, [w(Dr, { size: "20", onClick: () => this.handleClick(t) }, null), this.makeIcons(t, e)]))); }, makeImages() { return this.makeGroup(this.fileList.map((t, e) => this.makeItem(e, [w("img", { src: this.getSrc(t) }, null), this.makeIcons(t, e)]))); }, makeBtn() { const t = x(this.icon); return w("div", { class: "_fc-upload-btn", onClick: () => this.showModal(), key: 7 }, [w(t, { class: "_fc-frame-icon" }, null)]); }, handleClick(t) { if (this.onHandle) return this.onHandle(t); this.previewImage = this.getSrc(t), this.previewVisible = !0; }, handleRemove(t) { this.disabled || this.onBeforeRemove(t) !== !1 && (this.fileList.splice(this.fileList.indexOf(t), 1), this.input(), this.onRemove(t)); }, getSrc(t) { return this.srcKey ? t[this.srcKey] : t; }, frameLoad(t) { this.onLoad(t); try { this.helper === !0 && (t.form_create_helper = { api: this.formCreateInject.api, close: (e) => { this.valid(e), this.closeModal(); }, set: (e, r) => { this.valid(e), this.disabled || (this.$emit("update:modelValue", r), this.$emit("change", r)); }, get: (e) => (this.valid(e), this.modelValue), onOk: (e) => this.bus.$on("$ok", e), onClose: (e) => this.bus.$on("$close", e) }); } catch (e) { console.error(e); } }, makeFooter() { const { okBtnText: t, closeBtnText: e, closeBtn: r, okBtn: n, footer: s } = this.$props, i = []; return s && (r && i.push(w(x("TButton"), { onClick: () => this.onCancel() !== !1 && this.closeModal(!0) }, { default: () => [e || this.formCreateInject.t("close") || "关闭"] })), n && i.push(w(x("TButton"), { theme: "primary", onClick: () => this.onOk() !== !1 && this.closeModal() }, { default: () => [t || this.formCreateInject.t("ok") || "确定"] }))), i; } }, render() { const t = this.type; let e; t === "input" ? e = this.makeInput() : t === "image" ? e = this.makeImages() : e = this.makeFiles(); const { width: r = "30%", height: n, src: s, title: i, modalTitle: o } = this.$props; return A(() => { this.$refs.frame && this.frameLoad(this.$refs.frame.contentWindow || {}); }), w("div", { class: { "_fc-frame": !0, "_fc-disabled": this.disabled } }, [e, w(x("TDialog"), { mask: this.previewMask, header: o, visible: this.previewVisible, style: "width: 600px;", attach: "body", "onUpdate:visible": (a) => this.previewVisible = a, footer: !1 }, { default: () => [w("img", { style: "width: 100%", src: this.previewImage, key: 1 }, null)] }), w(x("TDialog"), Ie(v({ width: r, header: i }, this.modal), { visible: this.frameVisible, attach: "body", style: { width: r }, onClose: () => this.frameVisible = !1, onConfirm: () => this.closeModal(!0), key: 2 }), { default: () => [this.frameVisible || !this.reload ? w("iframe", { ref: "frame", src: s, frameborder: "0", style: { height: n, border: "0 none", width: "100%" } }, null) : null], action: () => this.makeFooter() })]); }, beforeMount() { const { name: t, field: e, api: r } = this.formCreateInject; t && r.on("fc:closeModal:" + t, this.close), e && r.on("fc:closeModal:" + e, this.close); }, beforeUnmount() { const { name: t, field: e, api: r } = this.formCreateInject; t && r.off("fc:closeModal:" + t, this.close), e && r.off("fc:closeModal:" + e, this.close); } }), qr = "fcUpload"; function dt(t, e) { return typeof t == "object" ? t : { url: t, is_string: !0, name: Hr(t), status: "success", uid: e }; } function pt(t) { return M(v({}, t), { file: t, value: t }); } function Hr(t) { return ("" + t).split("/").pop(); } const Gr = /* @__PURE__ */ ge({ name: qr, inheritAttrs: !1, formCreateParser: { toFormValue(t) { return z(t); }, toValue(t, e) { return e.prop.props.limit === 1 ? t[0] || "" : t; } }, props: { limit: { type: Number, default: 0 }, formCreateInject: Object, modelValue: { type: [Array, String, Object], default: [] }, onSuccess: { type: Function }, onRemove: { type: Function }, name: String, requestMethod: Function }, emits: ["update:modelValue", "fc.el"], data() { return { uploadList: z(this.modelValue).map(dt).map(pt) }; }, watch: { modelValue(t) { this.uploadList = z(t).map(dt).map(pt); } }, methods: { handleRemove({ index: t }) { this.uploadList.splice(t, 1), this.onRemove && this.onRemove(...arguments), this.input(); }, handleSuccess({ file: t, fileList: e }) { this.uploadList = e, t.status === "success" && this.onSuccess && this.onSuccess(...arguments), this.input(); }, input() { this.$emit("update:modelValue", this.uploadList.map((t) => t.is_string ? t.url : t.value || t.url).filter((t) => t !== void 0)); }, doRequestMethod(t) { const e = this.requestMethod; if (e) return e(t); const r = Array.isArray(t) ? t[0] : t, n = (r == null ? void 0 : r.raw) || (r == null ? void 0 : r.file) || r; return new Promise((s, i) => { var a; const o = { method: ((a = this.$attrs) == null ? void 0 : a.method) || "post", file: n, filename: this.name || "file", source: "upload", onSuccess: (l) => s({ status: "success", response: l }), onError: (l) => i(l) }; this.formCreateInject.api.fetch(o); }); } }, render() { const { uploadList: t, handleSuccess: e, handleRemove: r, $slots: n } = this; return w(pr, null, [w(x("t-upload"), Ie({ max: this.limit, theme: "image", accept: "image/*", modelValue: t, name: this.name }, this.$attrs, { requestMethod: this.doRequestMethod, onSuccess: e, onRemove: r, ref: "el" }), n)]); }, mounted() { this.$emit("fc.el", this.$refs.el); } }), m = { type(t, e) { return Object.prototype.toString.call(t) === "[object " + e + "]"; }, Undef(t) { return t == null; }, Element(t) { return typeof t == "object" && t !== null && t.nodeType === 1 && !m.Object(t); }, trueArray(t) { return Array.isArray(t) && t.length > 0; }, Function(t) { const e = this.getType(t); return e === "Function" || e === "AsyncFunction"; }, getType(t) { const e = Object.prototype.toString.call(t); return /^\[object (.*)\]$/.exec(e)[1]; }, empty(t) { return t == null || Array.isArray(t) && Array.isArray(t) && !t.length ? !0 : typeof t == "string" && !t; } }; ["Date", "Object", "String", "Boolean", "Array", "Number"].forEach((t) => { m[t] = function(e) { return m.type(e, t); }; }); function k(t, e) { return {}.hasOwnProperty.call(t, e); } function H(t, e, r) { t[e] = r; } function pe(t, e) { delete t[e]; } function Oe(t, e = {}, r) { let n = !1; for (let s in e) if (Object.prototype.hasOwnProperty.call(e, s)) { let i = e[s]; if ((n = Array.isArray(i)) || m.Object(i)) { let o = t[s] === void 0; if (n) n = !1, o && H(t, s, []); else if (i._clone && r !== void 0) if (r) i = i.getRule(), o && H(t, s, {}); else { H(t, s, i._clone()); continue; } else o && H(t, s, {}); t[s] = Oe(t[s], i, r); } else H(t, s, i), m.Undef(i) || (m.Undef(i.__json) || (t[s].__json = i.__json), m.Undef(i.__origin) || (t[s].__origin = i.__origin)); } return r !== void 0 && Array.isArray(t) ? t.filter((s) => !s || !s.__ctrl) : t; } function X(t) { return Oe({}, { value: t }).value; } const xr = Object.assign || function(t) { for (let e, r = 1; r < arguments.length; r++) for (let n in e = arguments[r], e) Object.prototype.hasOwnProperty.call(e, n) && H(t, n, e[n]); return t; }; function C() { return xr.apply(this, arguments); } function Qe(t) { return typeof t != "object" || t === null ? t : t instanceof Array ? [...t] : v({}, t); } function oe(t, e) { var r = null; return function(...n) { r !== null && clearTimeout(r), r = setTimeout(() => t.call(this, ...n), e); }; } function kt(t) { return t == null ? "" : typeof t == "object" ? JSON.stringify(t, null, 2) : String(t); } function zr(t) { return t && typeof t == "object" && typeof t.then == "function"; } function Te(t) { return zr(t) ? t : Promise.resolve(t); } function Se(t) { let e = t.replace(/([A-Z])/g, "-$1").toLocaleLowerCase(); return e.indexOf("-") === 0 && (e = e.substr(1)), e; } function Dt(t) { return t.replace(t[0], t[0].toLocaleUpperCase()); } function jt(t, e, r) { return `[form-create ${t}]: ${e}`; } function tt(t, e) { console.error(jt("err", t)); } function Jr(t) { tt(t.toString()), console.error(t); } const Ze = "[[FORM-CREATE-PREFIX-", Ye = "-FORM-CREATE-SUFFIX]]"; function Fe(t, e) { return JSON.stringify(Oe(Array.isArray(t) ? [] : {}, t, !0), function(r, n) { if (!(n && n._isVue === !0)) { if (typeof n != "function") return n; if (n.__json) return n.__json; if (n.__origin && (n = n.__origin), !n.__emit) return Ze + n + Ye; } }, e); } function xe(t) { return new Function("return " + t)(); } function Q(t, e) { if (t && m.String(t) && t.length > 4) { let r = t.trim(), n = !1; try { if (r.indexOf(Ye) > 0 && r.indexOf(Ze) === 0) r = r.replace(Ye, "").replace(Ze, ""), n = !0; else if (r.indexOf("$FN:") === 0) r = r.substring(4), n = !0; else if (r.indexOf("$EXEC:") === 0) r = r.substring(6), n = !0; else if (r.indexOf("$GLOBAL:") === 0) { const i = r.substring(8); return r = function(...o) { const a = o[0].api.getGlobalEvent(i); if (a) return a.call(this, ...o); }, r.__json = t, r.__inject = !0, r; } else { if (r.indexOf("$FNX:") === 0) return r = xe(`function($inject){ ` + r.substring(5) + ` }`), r.__json = t, r.__inject = !0, r; (!e && r.indexOf("function ") === 0 && r !== "function " || !e && r.indexOf("function(") === 0 && r !== "function(") && (n = !0); } if (!n) return t; let s; try { s = xe(r); } catch (i) { s = xe("function " + r); } return s.__json = t, s; } catch (s) { tt(`解析失败:${r} err: ${s}`); return; } } return t; } function At(t, e) { return JSON.parse(t, function(r, n) { return m.Undef(n) || !n.indexOf ? n : Q(n, e); }); } let Wr = 0; function Ue() { const t = 370 + ++Wr; return "F" + Math.random().toString(36).substr(3, 3) + (+`${Date.now()}`).toString(36) + t.toString(36) + "c"; } function ae(t, e, r) { let n = t, s; return (e || "").split(".").forEach((i) => { s && ((!n[s] || typeof n[s] != "object") && (n[s] = {}), n = n[s]), s = i; }), n[s] = r, n; } const Kr = "fcGroup", Xr = /* @__PURE__ */ ge({ name: Kr, props: { field: String, rule: Array, expand: Number, options: Object, button: { type: Boolean, default: !0 }, max: { type: Number, default: 0 }, min: { type: Number, default: 0 }, modelValue: { type: Array, default: () => [] }, defaultValue: Object, sortBtn: { type: Boolean, default: !0 }, disabled: { type: Boolean, default: !1 }, syncDisabled: { type: Boolean, default: !0 }, title: { type: [String, Function], default: null }, type: { type: String, default: "default" }, onBeforeRemove: { type: Function, default: () => { } }, onBeforeAdd: { type: Function, default: () => { } }, formCreateInject: Object, parse: Function }, data() { return { len: 0, cacheRule: {}, cacheValue: {}, sort: [], form: se(this.formCreateInject.form.$form()) }; }, emits: ["update:modelValue", "change", "itemMounted", "remove", "add"], watch: { rule: { handler(t, e) { Object.keys(this.cacheRule).forEach((r) => { const n = this.cacheRule[r]; if (n.$f) { const s = n.$f.formData(); if (t === e) n.$f.deferSyncValue(() => { Oe(n.rule, t), n.$f.setValue(s); }, !0); else { const i = n.$f.formData(); n.$f.once("reloading", () => { n.$f.setValue(i); }), n.rule = X(t); } } }); }, deep: !0 }, expand(t) { let e = t - this.modelValue.length; e > 0 && this.expandRule(e); }, modelValue: { handler(t) { t = t || []; let e = this.sort, r = e.length, n = r - t.length; if (n < 0) { for (let s = n; s < 0; s++) this.addRule(t.length + s, !0); for (let s = 0; s < r; s++) this.setValue(e[s], t[s]); } else { if (n > 0) for (let s = 0; s < n; s++) this.removeRule(e[r - s - 1]); t.forEach((s, i) => { this.setValue(e[i], t[i]); }); } }, deep: !0 } }, methods: { _value(t) { return t && k(t, this.field) ? t[this.field] : t; }, cache(t, e) { this.cacheValue[t] = JSON.stringify(e); }, input(t) { this.$emit("update:modelValue", t), this.$emit("change", t); }, formData(t, e) { const r = this.cacheRule, n = this.sort; if (n.filter((i) => r[i] && r[i].$f).length !== n.length) return; const s = n.map((i) => { const o = t === i ? e : v({}, this.cacheRule[i].$f.form), a = this.field ? m.Undef(o[this.field]) ? null : o[this.field] : o; return this.cache(i, a), a; }); this.input(s); }, setValue(t, e) { const r = this.field; r && (e = { [r]: this._value(e) }), this.cacheValue[t] !== JSON.stringify(r ? e[r] : e) && (this.cacheRule[t].$f && this.cacheRule[t].$f.coverValue(e), this.cache(t, e)); }, addRule(t, e) { const r = this.formCreateInject.form.copyRules(this.rule || []), n = this.options ? v({}, this.options) : { submitBtn: !1, resetBtn: !1 }; if (this.defaultValue) { n.formData || (n.formData = {}); const s = X(this.defaultValue); C(n.formData, this.field ? { [this.field]: s } : s); } this.parse && this.parse({ rule: r, options: n, index: this.sort.length }), this.cacheRule[++this.len] = { rule: r, options: n }, this.sort = Object.keys(this.cacheRule), e && A(() => this.$emit("add", r, Object.keys(this.cacheRule).length - 1)); }, add$f(t, e, r) { this.cacheRule[e].$f = r, A(() => { this.$emit("itemMounted", r, Object.keys(this.cacheRule).indexOf(e)); }); }, removeRule(t, e) { const r = Object.keys(this.cacheRule).indexOf(t); delete this.cacheRule[t], delete this.cacheValue[t], this.sort = Object.keys(this.cacheRule), e && A(() => this.$emit("remove", r)); }, add(t) { if (this.disabled || this.onBeforeAdd(this.modelValue) === !1) return; const e = [...this.modelValue]; e.push(this.defaultValue ? X(this.defaultValue) : this.field ? null : {}), this.input(e); }, del(t, e) { if (this.disabled) return; const r = () => { this.removeRule(e, !0); const n = [...this.modelValue]; n.splice(t, 1), this.input(n); }; Te(this.onBeforeRemove(this.modelValue, t)).then((n) => { n !== !1 && r(); }); }, addIcon(t) { return w("div", { class: "_fc-group-btn _fc-group-plus-minus", onClick: this.add }, null); }, delIcon(t, e) { return w("div", { class: "_fc-group-btn _fc-group-plus-minus _fc-group-minus", onClick: () => this.del(t, e) }, null); }, sortUpIcon(t) { return w("div", { class: "_fc-group-btn _fc-group-arrow _fc-group-up", onClick: () => this.changeSort(t, -1) }, null); }, sortDownIcon(t) { return w("div", { class: "_fc-group-btn _fc-group-arrow _fc-group-down", onClick: () => this.changeSort(t, 1) }, null); }, changeSort(t, e) { const r = this.sort[t]; this.sort[t] = this.sort[t + e], this.sort[t + e] = r, this.formCreateInject.subForm(this.sort.map((n) => this.cacheRule[n].$f)), this.formData(0); }, sortIcon(t, e) { const r = t > 0, n = t < e - 1, s = []; return !r && !n ? s : this.type === "card" && r && n ? (s.push(w("div", { class: "_fc-group-btn _fc-group-sort" }, [w("div", { class: " _fc-group-sort-up", onClick: () => this.changeSort(t, -1) }, null), w("div", { class: " _fc-group-sort-down", onClick: () => this.changeSort(t, 1) }, null)])), s) : (r && s.push(this.sortUpIcon(t)), n && s.push(this.sortDownIcon(t)), s); }, makeIcon(t, e, r) { if (this.$slots.button) return this.$slots.button({ total: t, index: e, vm: this, key: r, del: () => this.del(e, r), add: this.add }); const n = []; if ((!this.max || t < this.max) && t === e + 1 && n.push(this.addIcon(r)), t > this.min && n.push(this.delIcon(e, r)), this.sortBtn) { const s = this.sortIcon(e, t); s && n.push(...s); } return n; }, expandRule(t) { for (let e = 0; e < t; e++) this.modelValue.push(this.field ? null : {}); this.input([...this.modelValue]); }, getTitle(t, e) { return typeof this.title == "function" ? this.title(t, this.modelValue[t], e) : typeof this.title == "string" ? this.title.replace("{index}", t + 1) : !1; } }, created() { const t = (this.expand || 0) - this.modelValue.length; for (let e = 0; e < this.modelValue.length; e++) this.addRule(e); t > 0 && this.expandRule(t); }, render() { const t = this.sort, e = this.button, r = this.form, n = this.disabled, s = this.type === "card", i = t.length === 0 ? this.$slots.default ? this.$slots.default({ vm: this, add: this.add }) : w("div", { key: "a_def", class: "_fc-group-plus-minus _fc-group-add fc-clock", onClick: this.add }, null) : t.map((o, a) => { const { rule: l, options: u } = this.cacheRule[o], f = e && !n ? this.makeIcon(t.length, a, o) : [], d = this.getTitle(a, o); return s ? w("div", { class: "_fc-group-container", key: o }, [w("div", { class: "_fc-group-header" }, [d === !1 ? w("div", { class: "_fc-group-idx" }, [a + 1]) : null, d !== !1 ? w("div", { class: "_fc-group-title" }, [d]) : null, w("div", { class: "_fc-group-handle fc-clock" }, [f.length ? f : null])]), w("div", { class: "_fc-group-content" }, [w(r, Ie({ key: o }, { disabled: n, "onUpdate:modelValue": (h) => this.formData(o, h), "onUpdate:api": (h) => this.add$f(a, o, h), inFor: !0, modelValue: this.field ? { [this.field]: this._value(this.modelValue[a]) } : this.modelValue[a], rule: l, option: u, extendOption: !0 }), null)])]) : w("div", { class: "_fc-group-container", key: o }, [w(r, Ie({ key: o }, { disabled: n, "onUpdate:modelValue": (h) => this.formData(o, h), "onUpdate:api": (h) => this.add$f(a, o, h), inFor: !0, modelValue: this.field ? { [this.field]: this._value(this.modelValue[a]) } : this.modelValue[a], rule: l, option: u, extendOption: !0 }), null), w("div", { class: "_fc-group-idx" }, [a + 1]), f.length ? w("div", { class: "_fc-group-handle fc-clock" }, [f]) : null]); }); return w("div", { key: "con", class: "_fc-group " + (n ? "_fc-group-disabled" : "") + (s ? " _fc-group-card" : "") }, [i]); } }), Qr = "fcSubForm", Zr = /* @__PURE__ */ ge({ name: Qr, props: { rule: Array, options: { type: Object, default: () => K({ submitBtn: !1, resetBtn: !1 }) }, modelValue: { type: Object, default: () => ({}) }, disabled: { type: Boolean, default: !1 }, syncDisabled: { type: Boolean, default: !0 }, formCreateInject: Object }, data() { return { cacheValue: {}, subApi: {}, form: se(this.formCreateInject.form.$form()) }; }, emits: ["fc:subform", "update:modelValue", "change", "itemMounted"], watch: { modelValue(t) { this.setValue(t); } }, methods: { formData(t) { this.cacheValue = JSON.stringify(t), this.$emit("update:modelValue", t), this.$emit("change", t); }, setValue(t) { const e = JSON.stringify(t); this.cacheValue !== e && (this.cacheValue = e, this.subApi.coverValue(t || {})); }, add$f(t) { this.subApi = t, A(() => { this.$emit("itemMounted", t); }); } }, render() { const t = this.form; return w(t, { disabled: this.disabled, "onUpdate:modelValue": this.formData, modelValue: this.modelValue, "onUpdate:api": this.add$f, rule: this.rule, option: this.options, extendOption: !0 }, null); } }), Yr = { name: "QuestionCircleOutlined" }, en = { height: "1em", width: "1em", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }; function tn(t, e, r, n, s, i) { return Le(), Me("svg", en, [...e[0] || (e[0] = [ $e("path", { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448s448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372s372 166.6 372 372s-166.6 372-372 372z", fill: "currentColor" }, null, -1), $e("path", { d: "M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7c-21.2 8.1-39.2 22.3-52.1 40.9c-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0 1 30.9-44.8c59-22.7 97.1-74.7 97.1-132.5c.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1 0 80 0a40 40 0 1 0-80 0z", fill: "currentColor" }, null, -1) ])]); } const rn = /* @__PURE__ */ Ne(Yr, [["render", tn]]), nn = [ Ur, Gr, Xr, Zr, rn ], Pt = ["props"], It = ["class", "style", "directives"], Bt = ["on", "hook"], ee = (t, e = {}, r = {}) => { const n = [...Pt, ...r.normal || []], s = [...It, ...r.array || []], i = [...Bt, ...r.functional || []], o = r.props || []; return t.reduce((a, l) => { for (const u in l) if (a[u]) if (o.indexOf(u) > -1) a[u] = ee([l[u]], a[u]); else if (n.indexOf(u) > -1) a[u] = v(v({}, a[u]), l[u]); else if (s.indexOf(u) > -1) { const f = a[u] instanceof Array ? a[u] : [a[u]], d = l[u] instanceof Array ? l[u] : [l[u]]; a[u] = [...f, ...d]; } else if (i.indexOf(u) > -1) for (const f in l[u]) if (a[u][f]) { const d = a[u][f] instanceof Array ? a[u][f] : [a[u][f]], h = l[u][f] instanceof Array ? l[u][f] : [l[u][f]]; a[u][f] = [...d, ...h]; } else a[u][f] = l[u][f]; else if (u === "hook") for (let f in l[u]) a[u][f] ? a[u][f] = sn(a[u][f], l[u][f]) : a[u][f] = l[u][f]; else a[u] = l[u]; else n.indexOf(u) > -1 || i.indexOf(u) > -1 || o.indexOf(u) > -1 ? a[u] = v({}, l[u]) : s.indexOf(u) > -1 ? a[u] = l[u] instanceof Array ? [...l[u]] : typeof l[u] == "object" ? v({}, l[u]) : l[u] : a[u] = l[u]; return a; }, e); }, sn = (t, e) => function() { t && t.apply(this, arguments), e && e.apply(this, arguments); }, Tt = ["type", "slot", "ignore", "emitPrefix", "value", "name", "native", "hidden", "display", "inject", "options", "emit", "link", "prefix", "suffix", "update", "sync", "optionsTo", "key", "slotUpdate", "computed", "preview", "component", "cache", "modelEmit"], rt = ["validate", "children", "control"], nt = ["effect", "deep", "renderSlots"]; function Lt() { return [...Tt, ...Pt, ...It, ...Bt, ...rt, ...nt]; } function N(t) { const e = t.replace(/(-[a-z])/g, function(r) { return r.replace("-", "").toLocaleUpperCase(); }); return Mt(e); } function Mt(t) { return t.replace(t[0], t[0].toLowerCase()); } function et(t, e) { return { value: t, enumerable: !1, configurable: !1, writable: !0 }; } function Nt(t, e) { return Ut([t], e || !1)[0]; } function Ut(t, e) { return Oe([], [...t], e || !1); } function te(t, e) { return ee(Array.isArray(e) ? e : [e], t, { array: rt, normal: nt }), t; } function mt(t) { const e = m.Function(t.getRule) ? t.getRule() : t; return e.type || (e.type = "input"), e; } function on(t, e) { return t ? (Object.keys(e || {}).forEach((r) => { e[r] && (t[r] = te(t[r] || {}, e[r])); }), t) : e; } function qt(t, e) { Object.defineProperties(t, Object.keys(e).reduce((r, n) => (r[n] = { get() { return e[n](); } }, r), {})); } function W(t) { return t.__fc__ || (t.__origin__ ? t.__origin__.__fc__ : null); } function F(t, e) { try { e = t(); } catch (r) { Jr(r); } return e; } function je() { const t = {}, e = (r) => r || "default"; return { setSlot(r, n) { r = e(r), !(!n || Array.isArray(n) && n.length) && (t[r] || (t[r] = []), t[r].push(n)); }, getSlot(r, n) { r = e(r); const s = []; return (t[r] || []).forEach((i) => { if (Array.isArray(i)) s.push(...i); else if (m.Function(i)) { const o = i(...n || []); Array.isArray(o) ? s.push(...o) : s.push(o); } else m.Undef(i) || s.push(i); }), s; }, getSlots() { const r = {}; return Object.keys(t).forEach((n) => { r[n] = (...s) => this.getSlot(n, s); }), r; }, slotLen(r) { return r = e(r), t[r] ? t[r].length : 0; }, mergeBag(r) { if (!r) return this; const n = m.Function(r.getSlots) ? r.getSlots() : r; return Array.isArray(r) || mr(r) ? this.setSlot(void 0, () => r) : Object.keys(n).forEach((s) => { this.setSlot(s, n[s]); }), this; } }; } function gt(t) { const e = v({}, t.props || {}); return Object.keys(t.on || {}).forEach((r) => { r.indexOf("-") > 0 && (r = N(r)); const n = `on${Dt(r)}`; Array.isArray(e[n]) ? e[n] = [...e[n], t.on[r]] : e[n] ? e[n] = [e[n], t.on[r]] : e[n] = t.on[r]; }), e.key = t.key, e.ref = t.ref, e.class = t.class, e.id = t.id, e.style = t.style, e.slot && delete e.slot, e; } function Ae(t, e) { return Object.setPrototypeOf(t, e), t; } const yt = (t, e) => typeof t == "string" ? String(e) : typeof t == "number" ? Number(e) : e, me = { "==": (t, e) => JSON.stringify(t) === JSON.stringify(yt(t, e)), "!=": (t, e) => !me["=="](t, e), ">": (t, e) => t > e, ">=": (t, e) => t >= e, "<": (t, e) => t < e, "<=": (t, e) => t <= e, on(t, e) { return t && t.indexOf && t.indexOf(yt(t[0], e)) > -1; }, notOn(t, e) { return !me.on(t, e); }, in(t, e) { return e && e.indexOf && e.indexOf(t) > -1; }, notIn(t, e) { return !me.in(t, e); }, between(t, e) { return t > e[0] && t < e[1]; }, notBetween(t, e) { return t < e[0] || t > e[1]; }, empty(t) { return m.empty(t); }, notEmpty(t) { return !m.empty(t); }, pattern(t, e) { return new RegExp(e, "g").test(t); } }; function B(t, e) { return (Array.isArray(e) ? e : (e || "").split(".")).forEach((r) => { t != null && (t = t[r]); }), t; } function an(t) { const e = /{{\s*(.*?)\s*}}/g; let r; const n = {}; for (; (r = e.exec(t)) !== null; ) r[1] && (n[r[1]] = !0); return Object.keys(n); } function bt(t) { let e = t.split("."), r = [], n = ""; return e.forEach((s, i) => { i === 0 ? n = s : n += "." + s, r.push(n); }), r.join(" && "); } function Ht(t) { const e = []; let r = "", n = 0; for (let s = 0; s < t.length; s++) { const i = t[s]; i === "[" ? (n === 0 && r && (e.push({ type: "key", value: r }), r = ""), n++, r += i) : i === "]" ? (n--, r += i, n === 0 && (e.push({ type: "bracket", value: Ht(r.slice(1, -1)) }), r = "")) : i === "." && n === 0 ? r && (e.push({ type: "key", value: r }), r = "") : r += i; } return r && e.push({ type: "key", value: r }), e.map((s) => s.type === "key" ? { key: s.value } : { children: s.value }); } const Pe = (t, e) => { if (!(!t || t === e)) { if (t.props.formCreateInject) return t.props.formCreateInject; if (t.parent) return Pe(t.parent, e); } }; function ln(t, e, r) { return ge({ name: "FormCreate" + (t.isMobile ? "Mobile" : ""), components: e, directives: r, props: { rule: { type: Array, required: !0, default: () => [] }, option: { type: Object, default: () => ({}) }, extendOption: Boolean, driver: [String, Object], modelValue: Object, disabled: { type: Boolean, default: void 0 }, preview: { type: Boolean, default: void 0 }, index: [String, Number], api: Object, locale: [String, Object], t: Function, name: String, subForm: { type: Boolean, default: !0 }, inFor: Boolean }, emits: ["update:api", "update:modelValue", "mounted", "beforeUnmount", "submit", "reset", "change", "emit-event", "control", "remove-rule", "remove-field", "sync", "reload", "repeat-field", "update", "validate-field-fail", "validate-fail", "created"], render() { return this.fc.render(); }, setup(n) { const s = Xe(); gr("parentFC", s); const i = yr("parentFC", null); let o = i; if (i) for (; o.setupState.parent; ) o = o.setupState.parent; else o = s; const { rule: a, modelValue: l, subForm: u, inFor: f } = ht(n), d = K({ ctxInject: {}, destroyed: !1, isShow: !0, unique: 1, renderRule: [...a.value || []], updateValue: JSON.stringify(l.value || {}) }), h = new t(s), p = h.api(), $ = f.value, _ = () => { if (i) { const V = Pe(s, i);