"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("vue"),f=require("../interface.js"),p=require("./use-create-table-modal.js"),s=o=>o.id;function w(o){const{finishCallback:l,getRowKey:r,...c}=o,{destroy:n,openModal:u,closeModal:i,...d}=p.useCreateTableModal({...c,destroyOnUnmounted:!1,getRowKey:r||s}),y=async(t=[],M={})=>{try{const e=await u(t,M)||{keys:[],rows:[]};return l?.(e),e}catch(e){if(e===f.AsyncOpenResultError.ModalCancel)return{keys:t?.map(r||s),rows:t};throw e}},a=()=>{i()};return b.onUnmounted(()=>{a(),n()}),{open:y,destroy:n,close:a,...d}}exports.useTableSelectModal=w;
