import { n as e } from "./chunk-TYymryXo.mjs";
import { t } from "./dist-BWeVpZNn.mjs";
import { createBlock as n, createTextVNode as r, createVNode as i, defineComponent as a, isRef as o, openBlock as s, ref as c, unref as l, withCtx as u } from "vue";
import { Button as d, Drawer as f, Form as p, FormItem as m, Input as h, Space as g } from "ant-design-vue/es";
//#region src/pages/flow-create/flow-model/createComponents/flow/right-panel/components/drawer/drawerExpand.vue?vue&type=script&setup=true&lang.ts
var _ = /* @__PURE__ */ a({
	name: "DrawerExpand",
	__name: "drawerExpand",
	emits: ["submit"],
	setup(e, { expose: a, emit: _ }) {
		let v = _, y = {
			name: [{
				required: !0,
				message: "请输入属性名称",
				trigger: "blur"
			}],
			value: [{
				required: !0,
				message: "请输入属性值",
				trigger: "blur"
			}]
		}, [b, x] = t(!1), S = c(), C = c({});
		async function w(e, t, n) {
			x(!0), e === "add" ? C.value = {} : e === "edit" && t && (C.value = { ...t }, C.value.index = n);
		}
		let [T, E] = t(!1);
		function D() {
			S.value?.validate().then(() => {
				E(!0), v("submit", { ...C.value }), E(!1), x(!1);
			});
		}
		function O() {
			x(!1);
		}
		return a({ open: w }), (e, t) => {
			let a = h, c = m, _ = p, v = d, x = g, w = f;
			return s(), n(w, {
				open: l(b),
				"onUpdate:open": t[2] ||= (e) => o(b) ? b.value = e : null,
				title: "属性配置",
				placement: "right",
				width: 520,
				"destroy-on-close": "",
				"footer-style": { textAlign: "right" },
				onClose: O
			}, {
				footer: u(() => [i(x, null, {
					default: u(() => [i(v, { onClick: O }, {
						default: u(() => [...t[3] ||= [r(" 取消 ", -1)]]),
						_: 1
					}), i(v, {
						type: "primary",
						loading: l(T),
						onClick: D
					}, {
						default: u(() => [...t[4] ||= [r(" 提交 ", -1)]]),
						_: 1
					}, 8, ["loading"])]),
					_: 1
				})]),
				default: u(() => [i(_, {
					ref_key: "formRef",
					ref: S,
					model: l(C),
					rules: y,
					"label-col": { span: 4 }
				}, {
					default: u(() => [i(c, {
						label: "属性名称",
						name: "name"
					}, {
						default: u(() => [i(a, {
							value: l(C).name,
							"onUpdate:value": t[0] ||= (e) => l(C).name = e,
							maxlength: 100
						}, null, 8, ["value"])]),
						_: 1
					}), i(c, {
						label: "属性值",
						name: "value"
					}, {
						default: u(() => [i(a, {
							value: l(C).value,
							"onUpdate:value": t[1] ||= (e) => l(C).value = e,
							maxlength: 1e3
						}, null, 8, ["value"])]),
						_: 1
					})]),
					_: 1
				}, 8, ["model"])]),
				_: 1
			}, 8, ["open"]);
		};
	}
}), v = /* @__PURE__ */ e({ default: () => y }), y = _;
//#endregion
export { v as n, y as t };
