UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1 lines 297 kB
(function(K,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("../tags/index.umd.js"),require("../popover/index.umd.js"),require("../common/index.umd.js"),require("@vueuse/core"),require("../modal/index.umd.js"),require("../transfer/index.umd.js"),require("../tabs/index.umd.js"),require("../order/index.umd.js"),require("../condition/index.umd.js"),require("../checkbox/index.umd.js"),require("../filter-bar/index.umd.js"),require("../tooltip/index.umd.js"),require("lodash-es"),require("../pagination/index.umd.js"),require("../button/index.umd.js"),require("../search-box/index.umd.js"),require("../dynamic-form/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../property-panel/index.umd.js"),require("../accordion/index.umd.js"),require("../avatar/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../events-editor/index.umd.js"),require("../field-selector/index.umd.js"),require("../binding-selector/index.umd.js"),require("../image-cropper/index.umd.js"),require("../../designer/input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../mapping-editor/index.umd.js"),require("../nav/index.umd.js"),require("../number-range/index.umd.js"),require("../number-spinner/index.umd.js"),require("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../rate/index.umd.js"),require("../response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../response-layout-editor/index.umd.js"),require("../section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../switch/index.umd.js"),require("../text/index.umd.js"),require("../time-picker/index.umd.js"),require("../tree-view/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../textarea/index.umd.js"),require("../schema-selector/index.umd.js"),require("../tree-grid/index.umd.js"),require("../event-parameter/index.umd.js"),require("../filter-condition-editor/index.umd.js"),require("../fieldset/index.umd.js"),require("../sort-condition-editor/index.umd.js"),require("../menu-lookup/index.umd.js"),require("../drawer/index.umd.js"),require("../json-editor/index.umd.js"),require("../property-editor/index.umd.js"),require("../expression-editor/index.umd.js"),require("../code-editor/index.umd.js"),require("../html-template/index.umd.js"),require("../external-container/index.umd.js"),require("../data-view/index.umd.js"),require("../notify/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../tags/index.umd.js","../popover/index.umd.js","../common/index.umd.js","@vueuse/core","../modal/index.umd.js","../transfer/index.umd.js","../tabs/index.umd.js","../order/index.umd.js","../condition/index.umd.js","../checkbox/index.umd.js","../filter-bar/index.umd.js","../tooltip/index.umd.js","lodash-es","../pagination/index.umd.js","../button/index.umd.js","../search-box/index.umd.js","../dynamic-form/index.umd.js","../dynamic-resolver/index.umd.js","../designer-canvas/index.umd.js","../property-panel/index.umd.js","../accordion/index.umd.js","../avatar/index.umd.js","../../designer/button-edit/index.umd.js","../button-group/index.umd.js","../calendar/index.umd.js","../capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-list/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../events-editor/index.umd.js","../field-selector/index.umd.js","../binding-selector/index.umd.js","../image-cropper/index.umd.js","../../designer/input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../list-view/index.umd.js","../lookup/index.umd.js","../mapping-editor/index.umd.js","../nav/index.umd.js","../number-range/index.umd.js","../number-spinner/index.umd.js","../page-header/index.umd.js","../page-footer/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../rate/index.umd.js","../response-toolbar/index.umd.js","../response-layout/index.umd.js","../response-layout-editor/index.umd.js","../section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../switch/index.umd.js","../text/index.umd.js","../time-picker/index.umd.js","../tree-view/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../textarea/index.umd.js","../schema-selector/index.umd.js","../tree-grid/index.umd.js","../event-parameter/index.umd.js","../filter-condition-editor/index.umd.js","../fieldset/index.umd.js","../sort-condition-editor/index.umd.js","../menu-lookup/index.umd.js","../drawer/index.umd.js","../json-editor/index.umd.js","../property-editor/index.umd.js","../expression-editor/index.umd.js","../code-editor/index.umd.js","../html-template/index.umd.js","../external-container/index.umd.js","../data-view/index.umd.js","../notify/index.umd.js"],a):(K=typeof globalThis<"u"?globalThis:K||self,a(K["mapping-editor"]={},K.Vue,K.FTags,K.FPopover,K.common,K.VueUseCore,null,K.FTransfer,K.FTabs,K.FOrder,null,K.checkbox,K.FFilterBar,K.FTooltip,K.LodashES,K.FPagination,K.FButton,K.FSearchBox,K.FDynamicForm,K.dynamicResolver,null,null,K.FAccordion,K.FAvatar,K.FButtonEdit$1,K.FButtonGroup,K.FCalendar,K.FCapsule,K.FCheckbox,K.FCheckboxGroup,K.FComboList,K.FComboTree,K.FComponent,K.FColorPicker,K.FContentContainer,K.FDatePicker,K.FDataGrid$1,K.FDropdown,K.FEventsEditor,K.FFieldSelector,K.FBindingSelector,K.FImageCropper,K.FInputGroup,K.FLayout,K.FListNav,K.FListView,K.FLookup,K.FMappingEditor,K.FNav,K.FNumberRange,K.FNumberSpinner,K.FPageHeader,K.FPageFooter,K.FProgress,K.FQuerySolution,K.FRadioGroup,K.FRate,K.FResponseToolbar,K.FResponseLayout,K.FResponseLayoutEditorSetting,K.FSection,K.FSmokeDetector,K.FSplitter,K.FStep,K.FSwitch,K.FText,K.FTimePicker,K.FTreeview,K.FUploader,K.FVerifyDetail,K.FVideo,K.FTextArea,K.FSchemaSelector,K.FTreeGrid$1,K.FEventParameter,K.FFilterConditionEditor,K.FFieldset,K.FSortConditionEditor,K.FMenuLookup,K.FDrawer,K.FJsonEditor,K.FPropertyEditor,K.FExpressionEditor,K.FCodeEditor,K.FHtmlTemplate,null,K.dataView))})(this,function(K,a,Mt,Bo,Pe,on,Bu,Po,jo,Ro,Pu,Ho,$o,_n,We,Wo,Lo,qo,rn,Ao,ju,Ru,Go,zo,Yo,Uo,Xo,Qo,Sn,Tn,an,Ko,Jo,Zo,er,tr,nr,or,rr,ar,ir,sr,lr,ur,cr,dr,fr,mr,pr,hr,gr,yr,vr,br,wr,Cr,xr,_r,Sr,Tr,kr,Fr,Nr,Or,Mr,Er,Vr,Ir,Dr,Br,Pr,jr,Rr,Hr,$r,Wr,Lr,qr,Ar,Gr,zr,Yr,Ur,Xr,Qr,Hu,de){"use strict";var Iu=Object.defineProperty;var Du=(K,a,Mt)=>a in K?Iu(K,a,{enumerable:!0,configurable:!0,writable:!0,value:Mt}):K[a]=Mt;var j=(K,a,Mt)=>Du(K,typeof a!="symbol"?a+"":a,Mt);const Kr={id:String,buttonContent:{type:String,default:'<i class="f-icon f-icon-lookup"></i>'},buttonBehavior:{type:String,default:"Popup"},autoComplete:{type:Boolean,default:!1},customClass:{type:String,default:""},disable:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},enableClear:{type:Boolean,default:!1},modelValue:{type:String,default:""},readonly:{type:Boolean,default:!1},showButtonWhenDisabled:{type:Boolean,default:!1},enableTitle:{type:Boolean,default:!1},inputType:{type:String,default:"text"},forcePlaceholder:{type:Boolean,default:!1},placeholder:{type:String,default:""},minLength:Number,maxLength:Number,tabIndex:Number,popupHost:{type:Object},popupRightBoundary:{type:Object},popupOffsetX:{type:Object},popupOnInput:{type:Boolean,default:!1},popupOnFocus:{type:Boolean,default:!1},popupOnClick:{type:Boolean,default:!1},popupClass:{type:String,default:""},popupMinWidth:{type:Number,default:160},modalOptions:{type:Object,default:{}},wrapText:{type:Boolean,default:!1},multiSelect:{type:Boolean,default:!1},separator:{type:String,default:","},textAlign:{type:String,default:"left"},beforeClickButton:{type:Function,default:null},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1},beforeOpen:{type:Function,default:null},updateOn:{type:String,default:"change"},keepWidthWithReference:{type:Boolean,default:!0},placement:{type:String,default:"bottom-left"}},Jr={popupContentPosition:{type:Object,default:{left:0,top:0}},host:{type:Object},backgroundColor:{type:String,default:""}},Zr=a.defineComponent({name:"FOverlay",props:Jr,emits:["click"],setup(t,n){const e=a.ref(t.popupContentPosition),o=a.ref(t.host),r=a.computed(()=>({backgroundColor:t.backgroundColor||"",pointerEvents:"auto"}));function i(l){n.emit("click"),l.preventDefault(),l.stopPropagation()}a.computed(()=>{const l=o.value;if(l){const u=l.getBoundingClientRect(),{left:c,top:d,height:f}=u;return{left:c,top:d+f}}return e.value});const s=a.computed(()=>({}));return()=>a.createVNode(a.Teleport,{to:"body"},{default:()=>{var l,u;return[a.createVNode("div",{class:"overlay-container",onClick:c=>i(c),style:r.value},[a.createVNode("div",{style:s.value},[(u=(l=n.slots).default)==null?void 0:u.call(l)])])]}})}});function ea(t){if(t.content&&t.content.render)return t.content.render;if(t.render&&typeof t.render=="function")return t.render}function ta(t){const n=document.createElement("div");n.style.display="contents";let e;const o=t.onClickCallback||(()=>{}),r=()=>{o(),e&&e.unmount()};return e=a.createApp({setup(){a.onUnmounted(()=>{document.body.removeChild(n)});const i=ea(t);return()=>a.createVNode(Zr,{"popup-content-position":t.popupPosition,host:t.host,onClick:r,backgroundColor:t.backgroundColor},{default:()=>[i&&i()]})}}),document.body.appendChild(n),e.mount(n),e}class na{static show(n){return ta(n)}}const oa={allowClickMaskToClose:{type:Boolean,default:!1},beforeClose:{type:Function,default:()=>!0},class:{type:String,default:""},maskClass:{type:String,default:""},title:{type:String,default:""},width:{type:Number,default:500},height:{type:Number,default:320},buttons:{type:Array,default:[]},modelValue:{type:Boolean,default:!1},mask:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!0},fitContent:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},showMaxButton:{type:Boolean,default:!1},minHeight:{type:Number},maxHeight:{type:Number},minWidth:{type:Number},maxWidth:{type:Number},containment:{type:Object,default:null},resizeable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},dragHandle:{type:Object,default:null},closedCallback:{type:Function,default:null},resizeHandle:{type:Function,default:null},render:{type:Function,default:null},acceptCallback:{type:Function,default:null},rejectCallback:{type:Function,default:null},enableEsc:{type:Boolean,default:!0},enableEnter:{type:Boolean,default:!1},dialogType:{type:String,default:""},src:{type:String,default:""},footerHeight:{type:Number,default:60}};class Xe{constructor(n,e){this.x=n,this.y=e}static getTransformInfo(n){const o=window.getComputedStyle(n).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(o.length>=6){const r=parseInt(o[4],10),i=parseInt(o[5],10);return{x:r,y:i}}return{x:0,y:0}}static fromEvent(n,e=null){if(this.isMouseEvent(n))return new Xe(n.clientX,n.clientY);if(e===null||n.changedTouches.length===1)return new Xe(n.changedTouches[0].clientX,n.changedTouches[0].clientY);for(let o=0;o<n.changedTouches.length;o++)if(n.changedTouches[o].target===e)return new Xe(n.changedTouches[o].clientX,n.changedTouches[o].clientY)}static isMouseEvent(n){return Object.prototype.toString.apply(n).indexOf("MouseEvent")===8}static isIPosition(n){return!!n&&"x"in n&&"y"in n}static getCurrent(n){const e=new Xe(0,0);if(window){const o=window.getComputedStyle(n);if(o){const r=parseInt(o.getPropertyValue("left"),10),i=parseInt(o.getPropertyValue("top"),10);e.x=isNaN(r)?0:r,e.y=isNaN(i)?0:i}return e}return null}static copy(n){return new Xe(0,0).set(n)}get value(){return{x:this.x,y:this.y}}add(n){return this.x+=n.x,this.y+=n.y,this}subtract(n){return this.x-=n.x,this.y-=n.y,this}multiply(n){this.x*=n,this.y*=n}divide(n){this.x/=n,this.y/=n}reset(){return this.x=0,this.y=0,this}set(n){return this.x=n.x,this.y=n.y,this}}class Et{constructor(n,e){this.width=n,this.height=e}static getCurrent(n){const e=new Et(0,0);if(window){const o=window.getComputedStyle(n);return o&&(e.width=parseInt(o.getPropertyValue("width"),10),e.height=parseInt(o.getPropertyValue("height"),10)),e}return null}static copy(n){return new Et(0,0).set(n)}set(n){return this.width=n.width,this.height=n.height,this}}function ra(t,n){const e=a.ref(),o=a.ref(),r=a.ref(),i=a.ref(),s=a.ref(),l=a.ref(),u=a.ref(),c=a.ref(),d=a.ref(),f=a.ref(),m=a.ref(),p=a.ref(t.resizeable),y=a.ref(),O=a.ref(t.draggable),x=a.ref(!1);function v(){const I=o.value||document.body,R=window.getComputedStyle(I);if(!R||!e.value)return;const X=Xe.getTransformInfo(e.value),P={};u.value&&(P.deltaL=e.value.offsetLeft-u.value.x,P.deltaT=e.value.offsetTop-u.value.y);const D=R.getPropertyValue("position");P.width=I.clientWidth,P.height=I.clientHeight,P.pr=parseInt(R.getPropertyValue("padding-right"),10),P.pb=parseInt(R.getPropertyValue("padding-bottom"),10),P.position=R.getPropertyValue("position"),D==="static"&&(I.style.position="relative"),P.translateX=X.x,P.translateY=X.y,f.value=P}function C(I){if(e.value){i.value=Et.getCurrent(e.value),s.value=Xe.getCurrent(e.value),l.value=i.value?Et.copy(i.value):null,u.value=s.value?Xe.copy(s.value):null,v();const R=I.target.getAttribute("type")||"";c.value={n:!!R.match(/n/),s:!!R.match(/s/),w:!!R.match(/w/),e:!!R.match(/e/)}}}function b(){var I,R,X,P;if(e.value){const D=e.value;c.value&&((c.value.n||c.value.s)&&((I=l.value)!=null&&I.height)&&(D.style.height=l.value.height+"px"),(c.value.w||c.value.e)&&((R=l.value)!=null&&R.width)&&(D.style.width=l.value.width+"px"),u.value&&((X=u.value)!=null&&X.x&&(D.style.left=u.value.x+"px"),(P=u.value)!=null&&P.y&&(D.style.top=u.value.y+"px")))}}function w(){const I=t.minHeight?t.minHeight:1,R=t.minWidth?t.minWidth:1;l.value&&u.value&&c.value&&i.value&&(l.value.height<I&&(l.value.height=I,c.value.n&&s.value&&(u.value.y=s.value.y+(i.value.height-I))),l.value.width<R&&(l.value.width=R,c.value.w&&s.value&&(u.value.x=s.value.x+(i.value.width-R))),t.maxHeight&&l.value.height>t.maxHeight&&(l.value.height=t.maxHeight,s.value&&c.value.n&&(u.value.y=s.value.y+(i.value.height-t.maxHeight))),t.maxWidth&&l.value.width>t.maxWidth&&(l.value.width=t.maxWidth,c.value.w&&s.value&&(u.value.x=s.value.x+(i.value.width-t.maxWidth))))}function k(){if(o.value){const I=f.value;if(u.value&&l.value&&c.value&&i.value){const R=I.width-I.pr-I.deltaL-I.translateX-u.value.x,X=I.height-I.pb-I.deltaT-I.translateY-u.value.y;c.value.n&&u.value.y+I.translateY<0&&s.value&&(u.value.y=-I.translateY,l.value.height=i.value.height+s.value.y+I.translateY),c.value.w&&u.value.x+I.translateX<0&&s.value&&(u.value.x=-I.translateX,l.value.width=i.value.width+s.value.x+I.translateX),l.value.width>R&&(l.value.width=R),l.value.height>X&&(l.value.height=X)}}}function F(I){if(!r.value||!i.value||!s.value||!c.value)return;I.subtract(r.value);const R=I.x,X=I.y;c.value.n?(u.value.y=s.value.y+X,l.value.height=i.value.height-X):c.value.s&&(l.value.height=i.value.height+X),c.value.e?l.value.width=i.value.width+R:c.value.w&&(l.value.width=i.value.width-R,u.value.x=s.value.x+R),k(),w(),b()}function h(I){if(!d.value)return;const R=Xe.fromEvent(I);R&&F(R)}function S(){if(e.value){const{width:I,height:R,x:X,y:P}=e.value.getBoundingClientRect(),D=Xe.getTransformInfo(e.value);return{size:{width:I,height:R},position:{x:X-D.x,y:P-D.y}}}return null}function _(I){if(e.value){const R=S();m.value=R}r.value=void 0,i.value=null,s.value=null,l.value=null,u.value=null,c.value=null,d.value=null,document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",_)}function N(){document.addEventListener("mousemove",h),document.addEventListener("mouseup",_)}function g(I){I instanceof MouseEvent&&I.button===2||O.value&&(document.body.click(),I.stopPropagation(),I.preventDefault(),r.value=Xe.fromEvent(I),d.value=I.target,C(I),N())}function V(I){return e.value=I,p.value&&a.createVNode(a.Fragment,null,[a.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:R=>g(R)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:R=>g(R)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:R=>g(R)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:R=>g(R)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:R=>g(R)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:R=>g(R)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:R=>g(R)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:R=>g(R)},null)])}function B(I=!0){document.body.click();const R=o.value||document.body,X=Et.getCurrent(R),P=e.value;I&&P&&(y.value=S(),y.value.transform=P.style.transform),X&&P&&(l.value=X,l.value.height-=14,l.value.width-=14,P.style.height=l.value.height+"px",P.style.width=l.value.width+"px",P.style.left="7px",P.style.top="7px",P.style.transform="",m.value={size:l.value,position:{x:0,y:0}},O.value=!1,x.value=!0)}function T(){var I,R;if(document.body.click(),y.value){const X={width:y.value.size.width||0,height:y.value.size.height||0},P={x:(window.innerWidth-X.width)/2,y:(window.innerHeight-X.height)/2};(I=l.value)==null||I.set(X),(R=u.value)==null||R.set(P);const D=e.value;D.style.height=X.height+"px",D.style.width=X.width+"px",D.style.left=`${P.x}px`,D.style.top=`${P.y}px`,D.style.transform="",m.value={size:X,position:P},O.value=t.draggable,x.value=!1}}function M(){if(e.value){const I=Et.getCurrent(e.value);if(I){const{width:R,height:X}=I;e.value.style.left=`${(window.innerWidth-R)/2}px`,e.value.style.top=`${(window.innerHeight-X)/2}px`,e.value.style.transform=""}}}function L(){const I=()=>{x.value?B(!1):M(),document.body.click()};return window.addEventListener("resize",I),()=>{window.removeEventListener("resize",I)}}const W=L();return{renderResizeBar:V,boundingElement:o,resizedEventParam:m,maximize:B,restore:T,allowDrag:O,isMaximized:x,unWindowResizeHandle:W}}function aa(t,n,e){const o=a.ref(),r=a.ref(t.draggable),i=a.ref(t.lockAxis),s=a.ref(),l=a.ref(),u=a.ref(!1),c=a.ref(new Xe(0,0)),d=a.ref(new Xe(0,0)),f=a.ref(new Xe(0,0)),m=a.ref(new Xe(0,0));a.watch(()=>e.value,h=>{s.value.style.cursor=h?"move":"default"});function p(h,S){if(S.tagName==="BUTTON")return!1;if(S===h)return!0;for(const _ in S.children)if(Object.prototype.hasOwnProperty.call(S.children,_)&&p(h,S.children[_]))return!0;return!1}function y(){var N,g;let h=f.value.x+d.value.x,S=f.value.y+d.value.y;i.value==="x"?(h=((N=c.value)==null?void 0:N.x)||0,f.value.x=0):i.value==="y"&&(S=((g=c.value)==null?void 0:g.y)||0,f.value.y=0);const _=`translate3d(${Math.round(h)}px, ${Math.round(S)}px, 0px)`;o.value&&(o.value.style.transform=_),m.value.x=h,m.value.y=S}function O(){if(!l.value||!o.value)return null;const h=l.value.getBoundingClientRect(),S=o.value.getBoundingClientRect(),_={top:h.top<S.top,right:h.right>S.right,bottom:h.bottom>S.bottom,left:h.left<S.left};return _.top||(f.value.y-=S.top-h.top),_.bottom||(f.value.y-=S.bottom-h.bottom),_.right||(f.value.x-=S.right-h.right),_.left||(f.value.x-=S.left-h.left),y(),_}function x(h){h&&(c.value&&h.subtract(c.value),f.value.set(h),y(),O())}function v(h){u.value&&r.value&&(h.stopPropagation(),h.preventDefault(),x(Xe.fromEvent(h,s.value)))}function C(){var h;u.value&&(u.value=!1,d.value.add(f.value),f.value.reset(),(h=o.value)==null||h.classList.remove("ng-dragging"),n.emit("stopMove"),document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",C))}function b(){!u.value&&s.value&&(u.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",v),document.addEventListener("mouseup",C))}function w(){if(o.value){const h=Xe.getTransformInfo(o.value);d.value.set(h);return}d.value.reset()}function k(h){if(!e.value||h instanceof MouseEvent&&h.button===2)return;const S=h.target||h.srcElement;s.value!==void 0&&S&&!p(S,s.value)||r.value!==!1&&(document.body.click(),h.stopPropagation(),h.preventDefault(),c.value=Xe.fromEvent(h,o.value),w(),b())}function F(h,S,_){if(r.value&&S){if(h)s.value=h;else if(t.dragHandle){if(t.dragHandle instanceof HTMLElement)s.value=t.dragHandle;else if(typeof t.dragHandle=="string"){const N=S.querySelector(t.dragHandle);N&&(s.value=N)}}o.value=S,l.value=_,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",k)):r.value=!1}}return{registerDraggle:F,resetTranslate:w}}function kn(t,n){if(t){const e=o=>{o.key.toLowerCase()===t.toLowerCase()&&n({event:o,key:t})};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}}function ia(t,n){const e=a.ref(t.enableEsc);let o=null;return e.value?(o=kn("Escape",r=>{n.emit("esc",{event:r.event,type:"esc"})}),{remove:o}):null}function sa(t,n){const e=a.ref(t.enableEnter);let o=null;return e.value?(o=kn("Enter",r=>{n.emit("enter",{event:r.event,type:"enter"})}),{remove:o}):null}const Wt=a.defineComponent({name:"FModal",props:oa,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],setup(t,n){const e=a.ref(t.width||300),o=a.ref(t.height||200),r=a.ref(t.modelValue),i=a.ref(""),s=a.ref(t.class),l=a.ref(t.fitContent),u=a.ref(t.showHeader),c=a.ref(""),d=a.ref(t.showCloseButton),f=a.ref(t.showMaxButton),m=a.ref(!1),p=a.ref(t.dialogType),y=a.ref(t.src),O=a.ref(""),x=a.ref(t.showButtons),v=a.ref(t.title),C=a.ref(t.containment||null),b=a.ref(),w=a.ref(!1);function k(E,ae){Promise.resolve().then(()=>{var we;return(we=t.beforeClose)==null?void 0:we.call(t)}).then(we=>{we&&(r.value=!1,n.emit("update:modelValue",!1),ae!=null&&n.emit(ae?"accept":"cancel"),n.emit("closed",E))})}const F=[{name:"cancel",text:"取消",class:"btn btn-secondary",handle:E=>{k(E,!1)}},{name:"accept",text:"确定",class:"btn btn-primary",handle:E=>{k(E,!0)}}],h=a.ref(t.buttons&&t.buttons.length?t.buttons:F),S=a.computed(()=>!!c.value),_=a.computed(()=>!!x.value&&!!h.value),N=a.ref(),g=a.ref(),V=a.ref(!1),{renderResizeBar:B,maximize:T,restore:M,boundingElement:L,resizedEventParam:W,allowDrag:I,unWindowResizeHandle:R}=ra(t),{registerDraggle:X}=aa(t,n,I);function P(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function D(){const E=document.querySelectorAll(".farris-modal").length;(!E||E-1<=0)&&document.body.classList.remove("modal-open"),b.value&&b.value.classList.remove("show")}a.watch(()=>t.title,(E,ae)=>{E!==ae&&(v.value=E)}),a.watch(()=>t.modelValue,(E,ae)=>{E!==ae&&(r.value=E,r.value&&t.draggable&&a.nextTick(()=>{g.value&&!C.value&&(C.value=g.value.parentElement,L.value=C.value,X(N.value,g.value,L.value))}),E||(C.value&&(C.value=null),D())),r.value&&(w.value=P())}),a.watch(()=>t.showHeader,(E,ae)=>{E!==ae&&(u.value=E)}),a.watch(()=>t.showButtons,(E,ae)=>{E!==ae&&(x.value=E)}),a.watch(()=>W.value,(E,ae)=>{const we=E||{},ce=ae||{};JSON.stringify(we)!==JSON.stringify(ce)&&n.emit("resize",{newSize:E,oldSize:ae,isMaximized:V.value})});const U=a.computed(()=>(r.value&&document.body.classList.add("modal-open"),r.value)),q=a.computed(()=>{var we;const E={modal:!0,"farris-modal":!0,fade:!0};E["f-modal-fitContent"]=!!l.value,E.show=!!U.value;const ae=(we=t.maskClass)==null?void 0:we.split(" ");return ae==null||ae.reduce((ce,Ne)=>(ce[Ne]=!0,ce),E),E}),H=a.computed(()=>{var we;const E={"modal-dialog":!0},ae=(we=s.value)==null?void 0:we.split(" ");return ae==null||ae.reduce((ce,Ne)=>(ce[Ne]=!0,ce),E),E}),z=a.computed(()=>{const E={position:"absolute",top:`${(window.innerHeight-o.value)/2}px`,left:`${(window.innerWidth-e.value)/2}px`,width:`${e.value}px`,height:l.value?"auto":`${o.value}px`};return t.mask||(E.pointerEvents="auto"),E}),Q=a.computed(()=>{const E={display:"block"};return t.mask||(E.pointerEvents="none",E.backgroundColor="transparent"),w.value&&(E.backgroundColor="transparent"),E}),ne=a.computed(()=>({"modal-content":!0,"modal-content-has-header":u.value})),J=a.computed(()=>{const E={display:u.value?"":"none"};return E["pointer-events"]=I.value?"auto":"none",E}),me=a.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:V.value})),be=a.computed(()=>({"modal-body":!0,"f-utils-flex-column":p.value==="iframe","f-utils-fill":!0}));function Se(){return{height:`${t.footerHeight||60}px`}}const De=a.computed(()=>{const E={textAlgin:O.value},ae=Se();return Object.assign(E,ae)});function je(E){if(E.stopPropagation(),V.value){V.value=!1,M();return}T(),V.value=!0}async function G(E,ae){E.handle&&await E.handle(ae,E)&&n.emit("closed",ae)}function ie(E){E.width&&(e.value=E.width),E.height&&(o.value=E.height),E.buttons&&(h.value=E.buttons),E.title&&(v.value=E.title)}let A=null,ee=null;a.onBeforeMount(()=>{w.value=P()}),a.onMounted(()=>{g.value&&!C.value&&(C.value=g.value.parentElement,L.value=C.value,X(N.value,g.value,L.value)),U.value&&document.body.classList.add("modal-open"),A=ia(t,n),ee=sa(t,n)}),a.onUnmounted(()=>{R&&R(),A&&A.remove(),ee&&ee.remove()}),n.expose({modalElementRef:g,updateModalOptions:ie,close:k,maxDialog:je,isMaximized:V});function ve(){return a.createVNode("ul",null,[m.value&&a.createVNode("li",{class:"f-btn-icon f-bare"},[a.createVNode("span",{class:"f-icon modal_minimize"},null)]),f.value&&a.createVNode("li",{onClick:je,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[a.createVNode("span",{class:me.value},null)]),d.value&&a.createVNode("li",{class:"f-btn-icon f-bare",onClick:E=>k(E,!1),style:"pointer-events: auto;"},[a.createVNode("span",{class:"f-icon modal_close"},null)])])}function Fe(){return a.createVNode("div",{class:"modal-footer",style:De.value},[h.value&&h.value.map(E=>{const ae=a.ref(E.disabled);return a.createVNode("button",{name:E.name,type:"button",disabled:ae.value,class:E.class+(E.iconClass?" btn-icontext":""),onClick:we=>{G(E,we)}},[!!E.iconClass&&a.createVNode("i",{class:E.iconClass},null),E.text])})])}function Ve(){return a.createVNode("div",{ref:N,class:"modal-header",style:J.value},[n.slots.headerTemplate?n.slots.headerTemplate():a.createVNode("div",{class:"modal-title"},[S.value&&a.createVNode("span",{class:c.value,style:"margin-right: 8px"},null),a.createVNode("span",{class:"modal-title-label"},[v.value])]),a.createVNode("div",{class:"actions"},[ve()])])}function Je(){return n.slots.footerTemplate?n.slots.footerTemplate():_.value&&Fe()}function st(E){if(E.stopPropagation(),t.allowClickMaskToClose){if(E.target!==b.value)return;k(E,!1)}}function lt(){var E,ae;return a.createVNode("div",{id:i.value,class:H.value,style:z.value,ref:g},[a.createVNode("div",{class:ne.value},[u.value&&Ve(),a.createVNode("div",{class:be.value},[(ae=(E=n.slots).default)==null?void 0:ae.call(E),p.value==="iframe"&&a.createVNode("iframe",{title:i.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:y.value},null)]),Je()]),!l.value&&g.value&&!V.value&&B(g.value)])}return()=>a.createVNode(a.Teleport,{to:"body"},{default:()=>[U.value&&a.createVNode(a.Transition,{name:"fade",appear:!0},{default:()=>[a.createVNode("div",{ref:b,class:q.value,style:Q.value,onClick:st},[lt()])]})]})}});function Fn(t){if(t.content&&t.content.render)return t.content.render;if(t.render&&typeof t.render=="function")return t.render}function la(t){const n=document.createElement("div");n.style.display="contents";const e=a.createApp({setup(o,r){a.onUnmounted(()=>{document.body.removeChild(n)});const i=a.ref(),s=a.ref(t.class||""),l=a.ref(!!t.showButtons),u=a.ref(!!t.showHeader),c=a.ref(t.showCloseButton==null?!0:t.showCloseButton),d=a.ref(!0),f=a.ref(t.title||""),m=t.acceptCallback||(()=>{}),p=t.rejectCallback||(()=>{}),y=t.closedCallback||(b=>{}),O=t.resizeHandle||(b=>{}),x=t.stopMoveHandle||(b=>{}),v=Fn(t),C=b=>{d.value=!1,e.unmount(),y(b)};return a.onMounted(()=>{}),r.expose({modalRef:i}),()=>a.createVNode(Wt,{ref:i,class:s.value,modelValue:d.value,"onUpdate:modelValue":b=>d.value=b,title:f.value,width:t.width,height:t.height,buttons:t.buttons,"show-header":u.value,"show-buttons":l.value,"show-close-button":c.value,"show-max-button":!1,onAccept:m,onCancel:p,fitContent:t.fitContent==null?!0:t.fitContent,onClosed:C,onResize:O,onStopMove:x},{default:()=>[v&&v(e)]})}});return document.body.appendChild(n),e.mount(n),e}class Nn{constructor(n){j(this,"appContext",null);j(this,"modalRef",a.ref());j(this,"activeModalIndex",a.ref(0));j(this,"modalRefs",{});j(this,"isUseEscCloseModal",a.ref(!1));j(this,"activeModalInstance",a.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=n,this.appContext=n?n._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(n,e){const{width:o,height:r}={width:window.innerWidth,height:window.innerHeight};return o<n&&(n=o-14),r<e&&(e=r-14),{width:n,height:e}}static show(n){const e=Object.assign({title:"",showButtons:!0,showHeader:!0},n);return la(e)}close(n){var e,o;n?(o=n.value)==null||o.close():(e=this.getCurrentModal())==null||e.close()}open(n){const e=document.createDocumentFragment();n.showMaxButton&&n.fitContent&&(n.showMaxButton=!1);const o=a.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},n)),r=a.ref(!0),i=o.value.acceptCallback||(()=>{}),s=o.value.rejectCallback||(()=>{}),l=o.value.closedCallback||((k,F)=>{}),u=o.value.resizeHandle||(k=>{}),c=n.stopMoveHandle||(k=>{});let d;const f=Fn(o.value),m=k=>{var h;r.value=!1;const F=(h=k==null?void 0:k.target)==null?void 0:h.classList.contains("modal_close");l(k,this.isUseEscCloseModal.value?"esc":F?"icon":"button")},p=k=>{m(k),d&&a.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],a.render(null,e),d=null,this.modalRef.value=null,this.modalRefs){const F=Object.keys(this.modalRefs).map(h=>Number(h));F.length>0?this.activeModalIndex.value=Math.max(...F):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},y=k=>{var F;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((F=this.activeModalInstance.value)==null||F.close(k==null?void 0:k.event))},{width:O,height:x}=o.value,v=this.adaptToWindow(O||500,x||320);Object.assign(o.value,v);const C=()=>a.createVNode(Wt,a.mergeProps({ref:this.modalRef,modelValue:r.value,"onUpdate:modelValue":k=>r.value=k},o.value,{onAccept:i,onCancel:s,onClosed:p,onResize:u,onEsc:y,onStopMove:c}),{default:()=>[f&&f(this.app)]});return d=(k=>{const F=a.h(C,k);return F.appContext=this.appContext,a.render(F,e),F})({...o.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:k=>{o.value={...o.value,...k},d&&a.render(a.cloneVNode(d,{...o}),e)},destroy:p,modalRef:this.activeModalInstance,close:this.close}}}const On=Symbol("FModalService");Wt.install=t=>{t.component(Wt.name,Wt);const n=new Nn(t);t.provide(On,n),t.provide("FModalService",n)};function Mn(t,n){function e(){const o=t.beforeOpen||t.beforeClickButton||null;let r=Promise.resolve(!0);if(o){const i=o(n.value);if(typeof i>"u")return r;typeof i=="boolean"?r=Promise.resolve(i):r=i}return r}return{judgeCanOpen:e}}function ua(t,n,e,o,r){const i=a.ref(t.buttonBehavior),s=a.ref(t.popupOnInput),l=a.computed(()=>({"input-group-append":!0,"append-force-show":t.showButtonWhenDisabled&&(t.readonly||t.disable)})),{judgeCanOpen:u}=Mn(t,r),c=a.computed(()=>t.showButtonWhenDisabled||(!t.editable||!t.readonly)&&!t.disable),d=a.inject(On,null),f=a.ref();async function m(O){if(await u()&&c.value){const x=!!n.slots.default;if(i.value==="Modal"){const v=t.modalOptions,C=d==null?void 0:d.open({...v,render:()=>n.slots.default&&n.slots.default()});f.value=C==null?void 0:C.modalRef}i.value==="Overlay"&&na.show({host:document.body,backgroundColor:"rgba(0,0,0,.15)",render:()=>n.slots.default&&n.slots.default()}),x&&i.value==="Popup"&&o.togglePopup(!0),x&&s.value&&o.hidePopup(),n.emit("clickButton",{origin:O,value:t.modelValue})}}function p(O){n.emit("mouseEnterIcon",O)}function y(O){n.emit("mouseLeaveIcon",O)}return{buttonGroupClass:l,onClickButton:m,onMouseEnterButton:p,onMouseLeaveButton:y,modalRef:f}}function ca(t,n,e,o,r,i){const s=a.ref(!1),l=a.computed(()=>t.enableClear&&!t.readonly&&!t.disable),{changeTextBoxValue:u,hasClearClass:c}=i;function d(y){s.value=y,c.value=y}a.watch(r,()=>{d(!!r.value)});function f(y){const O=!t.readonly&&!t.disable&&t.editable,x=!t.editable;y.stopPropagation(),(O||x)&&(u(""),d(!s.value),n.emit("clear"))}function m(y){if(l.value){if(!e.value){d(!1);return}!t.disable&&!t.readonly&&d(!0)}}function p(y){l.value&&d(!1)}return{enableClearButton:l,showClearButton:s,onClearValue:f,onMouseEnterTextBox:m,onMouseLeaveTextBox:p}}function da(t,n,e,o,r){const i=a.computed(()=>t.popupOnInput),s=a.computed(()=>t.popupOnFocus),{shouldPopupContent:l,closeAllPopover:u}=r,c=a.ref(!1),d=a.computed(()=>t.enableTitle?e.value:""),f=a.computed(()=>(t.disable||t.readonly)&&!t.forcePlaceholder?"":t.placeholder),m=a.computed(()=>t.readonly||!t.editable),p=a.ref(!1),y=a.computed(()=>!t.disable&&p.value),O=a.computed(()=>({"text-left":t.textAlign==="left","text-center":t.textAlign==="center","text-right":t.textAlign==="right","form-control":!0,"f-utils-fill":!0})),x=a.computed(()=>({"input-group":!0,"f-state-disabled":t.disable,"f-state-editable":t.editable&&!t.disable&&!t.readonly,"f-state-readonly":t.readonly&&!t.disable,"f-state-focus":y.value,"input-group--has-clear":t.enableClear&&c.value}));function v(g,V=!0){e.value=g,V&&(n.emit("change",g),n.emit("update:modelValue",g))}function C(g){l.value=!1,v(g,!0)}a.watch(()=>t.modelValue,g=>{e.value=g});function b(g){p.value=!1,n.emit("blur",g),g.stopPropagation()}function w(g){n.emit("click",g),u(),n.slots.default&&!t.disable&&!t.readonly&&t.popupOnClick&&r.togglePopup()}function k(g){t.disable||(p.value=!0,m.value||(n.emit("focus",g),s.value&&!l.value&&r.popup()))}function F(g){n.emit("input",g.target.value);const V=g.target.value;o.value=V,e.value!==V&&v(V,t.updateOn==="change"),i.value&&!l.value&&r.popup()}function h(g){g.target.tagName!=="INPUT"&&g.preventDefault(),g.stopPropagation()}function S(g){n.emit("keydown",g)}function _(g){g.key==="Enter"&&(i.value||s.value)&&r.hidePopup(),n.emit("keyup",g)}function N(g){const V=g.target.value;g.stopPropagation(),v(V)}return{hasFocusedTextBox:y,isTextBoxReadonly:m,textBoxClass:O,textBoxPlaceholder:f,textBoxTitle:d,inputGroupClass:x,hasClearClass:c,changeTextBoxValue:v,commitValue:C,onBlurTextBox:b,onClickTextBox:w,onFocusTextBox:k,onInput:F,onKeyDownTextBox:S,onKeyUpTextBox:_,onMouseDownTextBox:h,onTextBoxValueChange:N}}const Vt="FarrisVue_PopoverInstancesKey";function fa(t,n,e,o){const r=a.ref(),i=a.ref(!1),{judgeCanOpen:s}=Mn(t,o);a.watch(()=>r.value,(p,y)=>{window[Vt]=window[Vt]||new WeakMap,p?window[Vt].set(e.value,p):window[Vt].delete(e.value)});function l(){if(window[Vt]){const p=window[Vt];document.querySelectorAll(".f-button-edit,.v-popover").forEach(y=>{p.get(y)&&y!==e.value&&p.get(y).hide()})}}function u(){const p=r.value;p&&p.show(e.value)}async function c(p=!1){if(!!n.slots.default){if(!p&&!i.value&&!await s())return;i.value=!i.value,await a.nextTick(),u()}}async function d(p=!1){if(!!n.slots.default){if(!p&&!await s())return;i.value=!0,await a.nextTick(),u()}}function f(){i.value=!1}function m(){i.value=!0,a.nextTick(()=>{u()})}return{hidePopup:f,showPopup:m,popup:d,shouldPopupContent:i,togglePopup:c,popoverRef:r,closeAllPopover:l}}function ma(t,n,e){const o=a.ref(),{isTextBoxReadonly:r,textBoxClass:i,textBoxPlaceholder:s,textBoxTitle:l,onBlurTextBox:u,onClickTextBox:c,onFocusTextBox:d,onInput:f,onKeyDownTextBox:m,onKeyUpTextBox:p,onMouseDownTextBox:y,onTextBoxValueChange:O}=e;return a.onMounted(()=>{var x,v;t.selectOnCreated&&((x=o.value)==null||x.select()),t.focusOnCreated&&((v=o.value)==null||v.focus({preventScroll:!0}))}),()=>a.createVNode("input",{ref:o,name:"input-group-value",autocomplete:t.autoComplete?"on":"off",class:i.value,disabled:t.disable,maxlength:t.maxLength,minlength:t.minLength,placeholder:s.value,readonly:r.value,tabindex:t.tabIndex,title:l.value,type:t.inputType,value:n.value,onBlur:u,onChange:O,onClick:c,onFocus:d,onInput:f,onKeydown:m,onKeyup:p,onMousedown:y},null)}function pa(t,n,e){const o=a.ref(t.separator),{changeTextBoxValue:r}=e,i=a.computed(()=>t.readonly||t.disable),s=a.computed(()=>n.value?n.value.split(o.value).map(u=>({name:u,selectable:!0})):[]);function l(u){r(u.map(c=>c.name).join(o.value),!0)}return()=>a.createVNode(Mt,{id:`${t.id}-tag-editor`,class:"form-control",data:s.value,showClose:!i.value,disable:i.value,showInput:!0,onChange:l},null)}function ha(t,n,e,o){const{buttonGroupClass:r,onClickButton:i,onMouseEnterButton:s,onMouseLeaveButton:l}=e,{enableClearButton:u,showClearButton:c,onClearValue:d}=o,f=a.ref();return{renderButtonGroup:()=>a.createVNode("div",{id:`${t.id}-button-group`,class:r.value},[u.value&&a.withDirectives(a.createVNode("span",{class:"input-group-text input-group-clear",onClick:d},[a.createVNode("i",{class:"f-icon modal_close"},null)]),[[a.vShow,c.value]]),n.slots.buttonContent?a.createVNode("span",{class:"input-group-text input-group-append-button",onClick:i,onMouseenter:s,onMouseleave:l},[n.slots.buttonContent()]):t.buttonContent?a.createVNode("span",{class:"input-group-text input-group-append-button",innerHTML:t.buttonContent,ref:f,onClick:i,onMouseenter:s,onMouseleave:l},null):null]),buttonHandleElement:f}}function ga(t,n,e){const o=a.ref(t.popupMinWidth),{hidePopup:r,popoverRef:i}=e;return()=>a.createVNode(Bo,{id:`${t.id}-popover`,ref:i,placement:t.placement,host:t.popupHost,"keep-width-with-reference":t.keepWidthWithReference,fitContent:!0,"right-boundary":t.popupRightBoundary,minWidth:o.value,class:t.popupClass,offsetX:t.popupOffsetX,onHidden:r},{default:()=>{var s,l;return[(l=(s=n.slots).default)==null?void 0:l.call(s)]}})}const En=a.defineComponent({name:"FButtonEdit",props:Kr,emits:["updateExtendInfo","clear","change","click","clickButton","blur","focus","mouseEnterIcon","mouseLeaveIcon","keyup","keydown","inputClick","input","update:modelValue"],setup(t,n){const e=a.ref(),o=a.ref(t.customClass),r=a.ref(t.modelValue),i=fa(t,n,e,r),{shouldPopupContent:s,hidePopup:l,showPopup:u,togglePopup:c}=i,d=ua(t,n,e,i,r),f=a.ref(""),m=da(t,n,r,f,i),{hasFocusedTextBox:p,commitValue:y,inputGroupClass:O}=m,x=ca(t,n,r,p,f,m),{onMouseEnterTextBox:v,onMouseLeaveTextBox:C}=x,b=a.computed(()=>{const N={"f-button-edit":!0,"f-cmp-inputgroup":!0,"f-button-edit-nowrap":!t.wrapText};return o.value&&o.value.split(" ").reduce((g,V)=>(g[V]=!0,g),N),N});function w(){return t.multiSelect&&t.inputType==="tag"?pa(t,r,m):ma(t,r,m)}let k=w();a.watch([()=>t.multiSelect,()=>t.inputType],()=>{k=w()});const{renderButtonGroup:F,buttonHandleElement:h}=ha(t,n,d,x),S=ga(t,n,i),_={commitValue:y,elementRef:e,hidePopup:l,showPopup:u,popoverRef:i.popoverRef,shouldPopupContent:s,togglePopup:c,openDialog:()=>{h.value&&t.buttonBehavior==="Modal"&&h.value.click()},getModal:()=>{var N;return t.buttonBehavior==="Modal"?(N=d.modalRef.value)==null?void 0:N.value:null}};return a.onMounted(()=>{e.value.componentInstance=_,window.onresize=()=>{document.body.click()}}),a.onBeforeUnmount(()=>{var N;window.onresize=null,(N=window[Vt])==null||N.delete(e.value)}),n.expose(_),()=>a.createVNode(a.Fragment,null,[a.createVNode("div",a.mergeProps(n.attrs,{ref:e,class:b.value,id:t.id}),[a.createVNode("div",{id:`${t.id}-input-group`,class:O.value,onMouseenter:v,onMouseleave:C},[k(),F()])]),s.value&&S()])}});Pe.withInstall(En);const ya={appendOnEnterAtLastCell:{type:Boolean,default:!1},beforeEditCell:{type:Function,default:t=>!0},beforeEndEditCell:{type:Function,default:()=>!0},changePolicy:{type:String,default:"push"},columns:{type:Array,default:[]},columnOption:{type:Object},commandOption:{type:Object,default:{enable:!1,commands:[]}},data:{type:Array,default:[]},disabled:{type:Boolean,default:!1},disabledField:{type:String,default:"disabled"},editable:{type:Boolean,default:!1},editOption:{type:Object,default:{selectOnEditing:!1,editMode:"cell"}},enableCommands:{type:Boolean,default:!1},enableFilter:{type:Boolean,default:!1},filter:{type:Object},fit:{type:Boolean,default:!1},focusOnEditingCell:{type:Boolean,default:!0},group:{type:Object},header:{type:Object},height:{type:Number,default:-1},id:{type:String,default:""},idField:{type:String,default:"id",require:!0},loading:{type:Boolean,default:!1},mergeCell:{type:Boolean,default:!1},minHeight:{type:Number,default:300},minWidth:{type:Number,default:400},newDataItem:{type:Function,default:()=>{}},pagination:{type:Object,default:{enable:!1,size:20}},rowNumber:{type:Object,default:{enable:!0,width:32,heading:"序号"}},rowOption:{type:Object,default:{wrapContent:!1}},selection:{type:Object,default:{enableSelectRow:!0,multiSelect:!1,multiSelectMode:"DependOnCheck",showCheckbox:!1,showSelectAll:!1,showSelection:!0,keepSelectingOnClick:!0}},selectionValues:{type:Array,default:[]},selectOnEditingCell:{type:Boolean,default:!1},showBorder:{type:Boolean,default:!1},showFooter:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},showHorizontalLines:{type:Boolean,default:!0},showScrollBar:{type:String,default:"auto"},showSetting:{type:Boolean,default:!1},showStripe:{type:Boolean,default:!0},showVerticallLines:{type:Boolean,default:!1},sort:{type:Object},summary:{type:Object,default:{enable:!1,groupFields:["numericField1","numericField2"]}},virtualized:{type:Boolean,default:!0},width:{type:Number,default:-1}};var at=(t=>(t[t.readonly=0]="readonly",t[t.editable=1]="editable",t[t.editing=2]="editing",t))(at||{}),gt=(t=>(t[t.initial=0]="initial",t[t.editing=1]="editing",t))(gt||{}),Lt=(t=>(t[t.data=0]="data",t[t.group=1]="group",t[t.summary=2]="summary",t))(Lt||{}),it=(t=>(t[t.none=0]="none",t[t.filterable=1]="filterable",t[t.sortable=2]="sortable",t[t.filtered=4]="filtered",t[t.sorted=8]="sorted",t[t.ascending=16]="ascending",t[t.descending=32]="descending",t))(it||{});function va(t,n){var p;const e=String(Date.now()),o=((p=t.rowOption)==null?void 0:p.height)||28,r=a.ref(n.value.primaryColumnsWidth);function i(y){const O={};return y.reduce((x,v,C)=>{const b=C<y.length-1?y[C+1]:null;return C===0&&(x[v.field]={left:0}),v.actualWidth!==void 0&&(x[v.field].width=v.actualWidth),b&&(x[b.field]={left:x[v.field].left+(v.actualWidth||0)}),x},O),O}function s(y,O,x){const v=o*(x+1),b=O[y.field].left-v+(O[y.field].width||0),w=y.parent.height?`${y.parent.height}px`:"";return{left:`${v}px`,width:`${b}px`,height:`${w}`}}function l(y,O,x){return{right:"0px",height:`${y.parent.height?`${y.parent.height}px`:""}`}}function u(y,O){const x=y.parent.height?`${y.parent.height}px`:"";return{left:`${O[y.field].left}px`,height:`${x}`,width:isNaN(Number(O[y.field].width))?"100%":`${O[y.field].width}px`}}function c(y,O,x){const C=(O.spanned||[]).reduce((w,k)=>w+(k.parent.height||0),0)+(y.height||0);return{top:`${y.top}px`,left:`${x[O.field].left}px`,width:`${x[O.field].width}px`,height:`${C}px`,padding:`calc(${C/2}px - 1rem) 0`}}function d(y,O){return`${e}_${y.type}_r_${y.index}_c_${O}_${y.refreshKey||""}`}function f(y){return`${e}_${y.type}_r_${y.index}_${y.refreshKey||""}`}function m(y){const O=y.height?`${y.height}px`:"";return{top:`${y.top}px`,width:isNaN(r.value)?"100%":`${r.value}px`,height:`${O}`}}return a.watch(n,()=>{r.value=n.value.primaryColumnsWidth}),{calculateCellPositionInRow:i,cellKey:d,cellPosition:u,groupCellPosition:s,rowKey:f,rowPosition:m,rowSpanCellPosition:c,summaryCellPosition:l}}function ba(t,n,e){const{hasChildrenField:o}=e,r=a.ref("#9399a0"),i=a.ref(28);function s(){return[].concat(...n.value.filter(m=>m.raw.__fv_descendant_index__.length!==0).map(m=>[...m.raw.__fv_descendant_index__.slice(-1)]).flat()).sort((m,p)=>Number(m)-Number(p))}function l(d){const f=new Array(n.value.length).fill(0);if(t.showLines){const m=s();n.value.forEach((p,y)=>{const O=m.includes(y),x=p.raw[o.value];f[y]=`repeating-linear-gradient(90deg, ${r.value} 0 1px, transparent 0px 2px) ${x?"-10px":"0px"} ${i.value/2}px/20px 1px no-repeat,repeating-linear-gradient(${r.value} 0 1px, transparent 0px 2px) 0px 0px/1px ${O?"50%":"100%"} no-repeat`}),f[0]=""}return f[d]}function u(d,f,m){return m[d].parents.set(d,!0).forEach(y=>{m[y].childsLength=m[y].childWithLines.filter(O=>f[O].visible).length}),f}function c(d){const p=d.raw.__fv_parent_index__===void 0||d.raw.__fv_parent_index__===-1?0:8,y=0,O=d.raw[o.value],x=`${d.layer*10+d.layer*p+y}px`,v=d.visible||We.isUndefined(d.visible)?{paddingLeft:`calc(${x} + 0.75rem)`,background:l(d.index),display:"flex",width:"100%",position:"relative"}:{display:"none"};return O||(v.paddingLeft=`calc(${x} + 2rem)`),v}return{hierarchyCellContentStyle:c,handleCollapsedPaddingBottom:u}}function wa(t,n,e){const o=a.ref(t.iconField);function r(i,s){if(o.value)return i.raw[t.iconField];let l="";return i.raw[e.value]!==!0?l=n.value.leafnodes:l=i.collapse?n.value.fold:n.value.unfold,l}return{treeNodeIconsClass:r}}function Ca(t,n,e,o,r,i,s,l){const{dataView:u,hasRealChildren:c,reOrderVisibleIndex:d}=o,{collapseField:f,hasChildrenField:m}=r,{reCalculateVisualDataRows:p,updateVirticalScroll:y}=i;function O(x){if(x.raw[m.value]){const C=u.value[x.raw.__fv_index__];C[f.value]=!C[f.value],o.toggleChildrenVisibiltyByCollapseStatus(C),C[m.value]=c(C),d(),p(),y()}n.emit("expandNode",{row:x})}return{toggleTreeNode:O}}function xa(t){function n(r){return{}}function e(r){const{valign:i,align:s}=r;return{"d-flex":!0,"h-100":!0,"w-100":!0,"justify-content-start":s!=="center"&&s!=="right","justify-content-center":s==="center","justify-content-right":s==="right","align-items-start":i!=="middle"&&i!=="bottom","align-items-center":i==="middle","align-items-end":i==="bottom"}}function o(r){const{align:i,showEllipsis:s}=r;return{"w-100":!0,"text-left":i!=="center"&&i!=="right","text-center":i==="center","text-right":i==="right","text-truncate":s}}return{cellContentPosition:n,cellContentClass:e,cellContentClassWithEllipsis:o}}function _a(t,n,e,o,r,i,s,l,u,c,d,f,m){const{onClickCell:p}=i,{gridCellClass:y,gridHierarchyCellClass:O,gridRowClass:x,onClickRow:v,onMouseoverRow:C,onMouseoutRow:b}=l,{enableMultiSelect:w,select:k,unSelect:F,selectItem:h}=u;a.ref(t.cellHeight);const S=a.ref(t.treeNodeIconsData||{}),{hasChildrenField:_,shouldShowCheckBox:N,shouldShowIcon:g}=s,{toggleTreeNode:V}=Ca(t,n,o,r,s,d),{toggleSelectHierarchyItem:B}=c,{cellKey:T,cellPosition:M,rowKey:L,rowPosition:W}=va(t,e),{cellContentClass:I,cellContentPosition:R,cellContentClassWithEllipsis:X}=xa(),{hierarchyCellContentStyle:P}=ba(t,o,s),{treeNodeIconsClass:D}=wa(t,S,_);function U(A,ee){const ve=A.raw[_.value];return{"fv-tree-node-toggle":ve&&A.collapse,"fv-tree-node-toggle-minus":ve&&!A.collapse}}function q(A,ee){A.stopPropagation(),V(ee)}function H(A){A.stopPropagation()}function z(A,ee){return a.createVNode("div",{class:U(A),onClick:ve=>q(ve,A),onDblclick:H},null)}function Q(A,ee){return g.value&&a.createVNode("div",{id:"treeNodeIcons",class:D(A,ee)},null)}function ne(A){w.value?(A.checked?k(A):F(A),B(A)):h(A)}function J(A,ee){return N.value&&a.createVNode(Ho.FCheckbox,{id:"checkbox_for_"+T(A,ee.index),indeterminate:A.indeterminate,disabled:A.disabled,checked:A.checked,"onUpdate:checked":ve=>A.checked=ve,onChange:()=>ne(A)},null)}function me(A,ee){return a.createVNode("span",{title:ee.data,style:"user-select:none"},[n.slots.cellTemplate?n.slots.cellTemplate({cell:ee,row:A}):ee.mode===at.editing?ee.getEditor(ee):ee.formatter?ee.formatter(ee,A):ee.data!=null?ee.data.toString():ee.data])}function be(A,ee){return a.createVNode("div",{class:X(ee)},[ee.showTips?a.createVNode(_n,null,{default:()=>me(A,ee),contentTemplate:()=>me(A,ee)}):me(A,ee)])}function Se(A,ee,ve){const Fe=P(A);return a.createVNode("div",{ref:ee.setRef,key:T(A,ee.index),class:"fv-grid-hierarchy-cell",style:M(ee,ve)},[a.createVNode("div",{class:I(ee),style:Fe},[z(A),Q(A,ee),J(A,ee),be(A,ee)])])}function De(A,ee,ve){return a.createVNode("div",{ref:ee.setRef,key:T(A,ee.index),class:y(ee),style:M(ee,ve),onClick:Fe=>p(Fe,ee,A,ee.column)},[a.createVNode("div",{class:I(ee)},[a.createVNode("div",{class:X(ee)},[ee.showTips?a.createVNode(_n,null,{default:()=>me(A,ee),contentTemplate:()=>me(A,ee)}):me(A,ee)])])])}function je(A,ee){return ee==="left"&&e.value.leftColumns.length>0&&e.value.leftColumns[0].field===A.field||ee==="primary"&&e.value.primaryColumns.length>0&&e.value.primaryColumns[0].field===A.field}function G(A,ee){n.emit("dblclickNode",{$event:A,node:ee.raw})}function ie(A,ee,ve="primary",Fe){return a.createVNode("div",{ref:A.setRef,key:L(A),class:x(A,Fe),style:W(A),onMouseover:Ve=>C(Ve,A),onMouseout:Ve=>b(Ve,A),onClick:Ve=>v(Ve,A),onDblclick:Ve=>G(Ve,A)},[Object.values(A.data).filter(Ve=>ee[Ve.field]&&Ve.rowSpan===1).map(Ve=>je(Ve,ve)?Se(A,Ve,ee):De(A,Ve,ee))])}return{renderDataRow:ie}}function Sa(t,n,e){const{horizontalScrollThumbStyle:o,onMouseDownScrollThumb:r,shouldShowHorizontalScrollbar:i}=e;function s(){return i.value&&a.createVNode("div",{