"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("lodash-unified"),t=require("vue");require("../../../config-provider/index.js");require("../table-modal.vue.js");const u=require("../../../config-provider/config-provider.js"),g=require("../table-modal.vue2.js");function T(a){let n=!0;const s=document.body,e=t.ref(),{destroyOnUnmounted:d=!0}=a,o=document.createElement("div"),c=()=>{const r=t.defineComponent({setup(){return()=>t.h(u.ConfigProvider,{...u.globalConfigCached.value},t.h(g.default,{...b.omit(a,"destroyOnUnmounted"),ref:e}))}});s.appendChild(o),t.render(t.h(r),o),n=!1},l=()=>{e.value?.close(),n||setTimeout(()=>{t.render(null,o),o.parentElement?.removeChild(o),n=!0},400)},i=async(r=[],p={})=>(e.value||c(),e.value?.open(r,p)),v=()=>{n||e.value?.close()},f=()=>{e.value?.getApTableInstance()?.submit()},m=()=>{e.value?.getApTableInstance()?.reset()};return t.onUnmounted(()=>{d&&l()}),{openModal:i,closeModal:v,destroy:l,reloadApTableData:f,resetApTableData:m,getApTableInstance:()=>e.value?.getApTableInstance(),isDestroyed:n}}exports.useCreateTableModal=T;
