"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("lodash-unified"),u=require("./constants.js");function p(e,t,r){let n=null;return{request:async o=>{const i=e;if(!i)return r?.(0),{data:[],total:0};n&&(o=Object.assign(o,n));const{records:l,total:c}=await i(Object.assign({},o));return r?.(l?.length||0),{data:l?.map(d=>a(d,t)),total:c}},setExtraParams:o=>{n=o||null}}}function a(e,t){return h.isFunction(t)?{...e,[u.ROW_KEY]:t(e)}:e}function f(e){return Reflect.deleteProperty(e,u.ROW_KEY),e}function g(e){const{renderSelectedItem:t,rightTitle:r,rightBottom:n,...s}=e||{};return{props:{...s,layoutType:e&&"two-column"},slots:{renderSelectedItem:t,rightTitle:r,rightBottom:n}}}class y{constructor(){this.p=null,this.operateFn=null}buildPromise(){return this.operateFn&&this.operateFn.reject("Ignored Reject: reuse"),this.p=new Promise((t,r)=>{this.operateFn={reject:r,resolve:t}}),this.p}clear(){this.p=null,this.operateFn=null}resolve(t){this.operateFn&&(this.operateFn.resolve(t),this.clear())}reject(t){this.operateFn&&(this.operateFn.reject(`Ignored Reject: ${t}`),this.clear())}}function F(e){return typeof e=="number"&&e?`${e}px`:e.toString()}exports.AsyncCallback=y;exports.addRowKeyField=a;exports.delRowKeyField=f;exports.genRequest=p;exports.getModalLayoutConfig=g;exports.toHeight=F;
