@farris/ui-vue 1.8.3 → 1.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/batch-editor/index.esm.js +7332 -7299
- package/components/batch-editor/index.umd.cjs +22 -22
- package/components/button/index.esm.js +7334 -7301
- package/components/button/index.umd.cjs +22 -22
- package/components/component/index.esm.js +880 -874
- package/components/component/index.umd.cjs +2 -2
- package/components/data-grid/index.esm.js +841 -835
- package/components/data-grid/index.umd.cjs +2 -2
- package/components/data-view/index.esm.js +14551 -14472
- package/components/data-view/index.umd.cjs +27 -27
- package/components/designer-canvas/index.esm.js +820 -814
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +848 -842
- package/components/mapping-editor/index.umd.cjs +2 -2
- package/components/popover/index.esm.js +264 -243
- package/components/popover/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +315 -309
- package/components/tree-grid/index.umd.cjs +1 -1
- package/designer/data-grid/index.esm.js +8304 -8257
- package/designer/data-grid/index.umd.cjs +26 -26
- package/designer/farris-designer.all.esm.js +3235 -3223
- package/designer/farris-designer.all.umd.cjs +14 -14
- package/designer/radio-group/index.esm.js +80 -62
- package/designer/radio-group/index.umd.cjs +2 -2
- package/designer/tabs/index.esm.js +830 -824
- package/designer/tabs/index.umd.cjs +2 -2
- package/designer/tree-grid/index.esm.js +348 -342
- package/designer/tree-grid/index.umd.cjs +1 -1
- package/farris.all.esm.js +18917 -18820
- package/farris.all.umd.cjs +39 -39
- package/package.json +1 -1
- package/types/data-view/components/column-header/column-header.component.d.ts +2 -2
- package/types/data-view/composition/column/persist-column-widths.d.ts +15 -0
- package/types/data-view/composition/column/use-resize.d.ts +3 -2
- package/types/data-view/index.d.ts +1 -0
- package/types/popover/src/composition/measure-host.d.ts +10 -5
- package/types/popover/src/composition/types.d.ts +2 -2
- package/types/popover/src/composition/use-host.d.ts +1 -2
- package/types/radio-group/src/property-config/radio-group.property-config.d.ts +21 -0
- package/package.zip +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(B,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../common/index.umd.js"],i):(B=typeof globalThis<"u"?globalThis:B||self,i(B.popover={},B.Vue,B.common))})(this,function(B,i,Z){"use strict";const G={id:{type:String},arrowOffsetX:{type:Number,default:0},class:{type:String,default:""},customStyles:{type:Object,default:null},isSimpleTips:{type:Boolean,default:!1},fitContent:{type:Boolean,default:!1},host:{type:Object},leftBoundary:{type:Object},keepWidthWithReference:{type:Boolean,default:!1},minWidth:{type:Number,default:-1},offsetX:{type:Object,default:i.ref(0)},offsetY:{type:Object,default:i.ref(0)},placement:{type:String,default:"bottom"},reference:{type:Object},rightBoundary:{type:Object},showArrow:{type:Boolean,default:!1},title:{type:String},visible:{type:Boolean,default:!1},zIndex:{type:Number,default:-1},limitContentBySpace:{type:Boolean,default:!1},beforeClose:{type:Function}};function ot(t){const n=i.isRef(t)?t.value:t;return typeof n=="string"?n==="body"||typeof document>"u"?"body":document.querySelector(n)||"body":!!n&&typeof n.getBoundingClientRect=="function"&&typeof n.insertBefore=="function"?n:"body"}function et(t){return typeof document>"u"?null:t==="body"?document.body:t}function j(t,n){const l=et(t);if(!l){const g=typeof window<"u"?window.innerHeight:0;return{left:0,top:0,width:0,height:g,bottom:g,scrollLeft:0,scrollTop:0}}const s=l.getBoundingClientRect(),p=t==="body"||l===document.body,w=typeof window<"u"?window.innerHeight:s.height;let{width:h}=s;!p&&n&&(h-=n.getBoundingClientRect().width);const{top:m}=s;let{bottom:C,height:b}=s;if(p){const g=Math.max(s.top,0),y=Math.min(s.bottom,w);C=y,b=Math.max(y-g,0)||w}return{left:s.left,top:m,width:h,height:b,bottom:C,scrollLeft:l.scrollLeft||0,scrollTop:l.scrollTop||0}}function nt(t){const n=ot(t.host),l=i.computed(()=>j(n,t.rightBoundary).top),s=i.computed(()=>j(n,t.rightBoundary).left),p=i.computed(()=>j(n,t.rightBoundary).bottom),w=i.computed(()=>j(n,t.rightBoundary).width),h=i.computed(()=>j(n,t.rightBoundary).height);return{host:n,hostLeft:s,hostTop:l,hostWidth:w,hostHeight:h,hostBottom:p,measure:()=>j(n,t.rightBoundary)}}function it(t,n,l,s){const p=i.ref(t.offsetX||0),w=i.ref(t.offsetY||0),h=i.ref(-1),m=i.ref(-1),C=i.ref(-1),b=i.ref(-1),g=i.ref(t.placement),y=i.ref(0),v=i.ref(0),O=i.ref(0);let x=s.measure();i.watch(()=>t.offsetX,o=>{p.value=o});const f=i.computed(()=>{const o={left:`${v.value}px`,top:`${O.value}px`,transform:`translate(${p.value}px, ${w.value}px)`};return t.zIndex!==-1&&(o["z-index"]=t.zIndex),t.fitContent?t.keepWidthWithReference&&l.value&&h.value>=l.value.getBoundingClientRect().width&&(o.width=`${h.value}px`):h.value!==-1&&(o.width=`${h.value}px`),t.minWidth!==-1&&(o.minWidth=`${t.minWidth}px`),t.customStyles&&Object.assign(o,t.customStyles),m.value>0&&(o.maxHeight=m.value+"px"),o}),S=i.computed(()=>({left:`${y.value}px`,transform:`translateX(${t.arrowOffsetX}px)`}));function L(){return x.left}function P(){return x.top}function E(){return x.width}function V(){return x.height}function I(){return x.bottom}function H(){return x.scrollLeft}function a(){return x.scrollTop}function M(o){if(o&&t.keepWidthWithReference){const e=o.getBoundingClientRect();h.value=Math.max(t.minWidth,e.width)}}function X(o,e){const r=E()-o.width-4;return r>0?r:e}function z(o,e){const r=V()-o.height-12;return r>0?r:e}function D(o,e,r){const d=y.value,c=e.left-L()+e.width/2+H(),u=e.top-P()-(o.height+r.height)+a();return{popoverLeft:c,popoverTop:u,arrowLeft:d}}function F(o,e,r){const d=e.top-P()+(e.height+r.height)+a(),c=z(o,d);return Math.min(d,c)}function Y(o,e){const r=X(e,o),d=o<=r?y.value:o-r;return{popoverLeft:Math.min(o,r),arrowLeft:d,maxHeight:0}}function at(o,e){const r=o<=X(e,o)?y.value:o-X(e,o);return{popoverLeft:o,arrowLeft:r,maxHeight:0}}function ut(o,e,r){const d=e.left-L()+H(),{arrowLeft:c,popoverLeft:u}=at(d,o),{popoverTop:T}=D(o,e,r);return{popoverLeft:u,popoverTop:T,arrowLeft:c,maxHeight:0}}function ct(o,e,r){const d=e.left-L()+e.width/2-(r.width/2-(o.left-L()))+H(),{arrowLeft:c,popoverLeft:u}=Y(d,o),T=F(o,e,r);return{popoverLeft:u,popoverTop:T,arrowLeft:c,maxHeight:0}}function ft(o,e,r){const d=e.left-L()+H(),{arrowLeft:c,popoverLeft:u}=Y(d,o),T=F(o,e,r);return{popoverLeft:u,popoverTop:T,arrowLeft:c,maxHeight:0}}function dt(o,e,r){const d=e.left-L();let c=0,u=0,T=0,W=0,k="bottom-left";window.innerWidth-d>o.width?c=d+H():(c=e.right-o.width-L()+H(),T=o.width-r.width-20);let A=0;if(t.limitContentBySpace){const tt={topHeight:e.top-P()-r.height-8,bottomHeight:I()-e.bottom-r.height-8};A=Math.max(tt.topHeight,tt.bottomHeight),o.height>A&&(W=A,l.value.classList.add("popover-limitmax"))}const _=W?Math.floor(W):o.height,K=e.top-P()+(e.height+r.height);return I()-K>_?u=K+a():(u=e.top-P()-_-r.height+a(),I()-K>e.top-P()?(u=K+a(),_>e.top-P()&&(u=I()-P()-_+a())):(u=u<0?0:u,k="top")),l.value.classList.add("popover-"+k,"bs-popover-"+k),{popoverLeft:c<0?5:c,popoverTop:u,arrowLeft:T,maxHeight:W}}function pt(o,e,r){const d=e.left-L()+e.width+H(),c=Math.max(e.top-P()-(o.height/2-e.height/2)+a(),a());let u=V()-o.height+a();u<0&&(u=c);const T=Math.min(c,u);return{popoverLeft:d,popoverTop:T,arrowLeft:0,maxHeight:0}}function ht(o,e,r){const d=e.left-L()+e.width+H(),c=Math.max(e.top-P()-e.height+a(),a());let u=V()-o.height+a();u<0&&(u=c);const T=Math.min(c,u);return{popoverLeft:d,popoverTop:T,arrowLeft:0,maxHeight:0}}const vt=new Map([["top",D],["top-left",ut],["bottom",ct],["bottom-left",ft],["right",pt],["right-top",ht],["auto",dt]]);function $(o){var u;x=s.measure(),t.keepWidthWithReference&&M(o);const e=o.getBoundingClientRect();C.value=e.top,b.value=e.left;const r=n.value?n.value.getBoundingClientRect():{height:4,width:4},d=(u=l.value)==null?void 0:u.getBoundingClientRect();h.value=d.width;const c=vt.get(g.value);if(c){const{arrowLeft:T,popoverLeft:W,popoverTop:k,maxHeight:A}=c(d,e,r);y.value=T,v.value=W,O.value=k,m.value=A||-1}}function mt(o){if(o){const e=o.getBoundingClientRect();(e.left!==b.value||e.top!==C.value)&&$(o)}}function wt(){g.value=t.placement,y.value=0,v.value=0,O.value=0,h.value=-1}return{arrowStyle:S,popoverStyle:f,position:g,popoverWidth:h,fitToReference:M,followToReferencePosition:mt,locateToReference:$,resetPosition:wt}}function st(t,n,l,s,p,w,h){const m=i.ref(t.visible),C=i.computed(()=>m.value),{fitToReference:b,locateToReference:g,resetPosition:y}=h;let v;async function O(){m.value&&(t.beforeClose&&typeof t.beforeClose=="function"&&!await t.beforeClose()||(m.value=!1,document.body.removeEventListener("click",v),document.body.removeEventListener("mousedown",v),document.body.removeEventListener("wheel",v,!0),document.removeEventListener("scroll",v),y(),n.emit("hidden")))}v=f=>{var P;if(!p.value)return;const S=p.value.contains(f.target);if(f.type==="scroll"||f.type==="wheel"&&S){O();return}if(f.target.closest(".time-picker-panel")||f.target.closest(".fv-grid"))return;const L=(P=f.target)==null?void 0:P.closest(".popover");if(L&&s.value&&L===s.value){f.type!=="scroll"&&f.type!=="wheel"&&f.stopPropagation();return}if(!S&&m.value){const E=p.value.closest(".popover");E&&E.removeEventListener("click",v),O()}};async function x(f){if(s.value&&(t.showArrow===!1||t.showArrow&&l.value)&&f){m.value=!0,p.value=f,w.value&&b(f),await i.nextTick(),g(f),document.body.addEventListener("click",v),document.body.addEventListener("mousedown",v),document.body.addEventListener("wheel",v,!0),document.addEventListener("scroll",v),(top==null?void 0:top.document)!==document&&(top==null||top.document.addEventListener("mousedown",v));const S=f.closest(".popover");S&&S.addEventListener("click",v),n.emit("shown")}}return n.expose({hide:O,popoverRef:s,show:x,shown:C,isShow:m}),{showPopover:m,hidePopverOnClickBodyHandler:v}}function lt(t,n,l,s,p,w){const{popoverWidth:h,fitToReference:m,followToReferencePosition:C}=p;function b(){var g;if(w.value&&((g=w.value.style)==null?void 0:g.display)!=="none"&&l.value){C(l.value);const y=l.value.getBoundingClientRect();s.value&&y.width!==h.value&&m(l.value)}}return{onResize:b}}const N=i.defineComponent({name:"FPopover",props:G,emits:["shown","hidden"],setup(t,n){const l=i.ref(),s=i.ref(),p=i.ref(t.reference),w=i.ref(t.keepWidthWithReference),h=i.computed(()=>!!t.title),m=nt(t),{host:C}=m,b=it(t,l,s,m),{position:g,arrowStyle:y,popoverStyle:v,fitToReference:O,locateToReference:x}=b,{showPopover:f,hidePopverOnClickBodyHandler:S}=st(t,n,l,s,p,w,b),{onResize:L}=lt(t,n,p,w,b,s),P=i.computed(()=>{let a=g.value;a==="top-left"&&(a="top");const M=`popover in popover-${a}`,X=`bs-popover-${a}`,z={"popover-fitcontent":t.fitContent,fade:!0};z[M]=!0,z[X]=!0;const D=(t.class||"").split(" ");return t.isSimpleTips&&D.unshift("popover-tips"),D.reduce((F,Y)=>(F[Y]=!0,F),z),z}),E=i.computed(()=>({"popover-content":!0,"popover-body":!0})),V=i.computed(()=>{const a={};return a.opacity=f.value?1:0,a.visibility=f.value?"visible":"hidden",a.zIndex=Z.getMaxZIndex()||1060,a}),I=i.computed(()=>t.isSimpleTips?!0:t.showArrow),{delayedValue:H}=Z.useDelayedRef(V,50);return i.onMounted(()=>{var a;w.value&&O(p.value),t.reference&&x(p.value),window.addEventListener("resize",L),(a=s.value)==null||a.focus()}),i.onUnmounted(()=>{document.body.removeEventListener("click",S),window.removeEventListener("resize",L),f.value=!1}),()=>i.createVNode(i.Teleport,{to:C},{default:()=>{var a;return[i.withDirectives(i.createVNode("div",{tabindex:"-1",ref:s,class:P.value,style:{...v.value,...H.value},onMousedown:M=>{M.stopPropagation()},onClick:M=>{M.stopPropagation()}},[I.value&&i.createVNode("div",{ref:l,class:"popover-arrow arrow",style:y.value},null),h.value&&i.createVNode("h3",{class:"popover-title popover-header"},[t.title]),i.createVNode("div",{class:E.value},[n.slots.default&&((a=n.slots)==null?void 0:a.default())])]),[[i.vShow,f.value]])]}})}}),q="FarrisVue_PopoverInstancesKey";typeof window<"u"&&(window[q]=window[q]||new WeakMap);function U(t,n,l){t.stopPropagation();const s=n.value;s&&s.value&&!s.value.isShow&&(s.value.show(l),window[q].set(l,s.value))}function J(t,n,l){t.stopPropagation(),n.value.value.hide(),window[q].delete(l)}function rt(t,n,l){t.stopPropagation();const s=n.value;s&&s.value&&(s.value.isShow?J(t,n,l):U(t,n,l))}function Q(t,n,l){n.arg&&n.arg==="toggle"?rt(t,n,l):U(t,n,l)}const R={mounted:(t,n,l)=>{n.modifiers.hover?(t.addEventListener("mouseenter",s=>U(s,n,t)),t.addEventListener("mouseleave",s=>J(s,n,t))):n.modifiers.click?t.addEventListener("click",s=>Q(s,n,t)):t.addEventListener("click",s=>Q(s,n,t)),t.classList.add("v-popover")},unMounted:(t,n,l)=>{}};N.install=t=>{t.component(N.name,N),t.directive("popover",R)},B.Popover=N,B.PopoverDirective=R,B.default=N,B.popoverProps=G,Object.defineProperties(B,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(C,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../common/index.umd.js"],i):(C=typeof globalThis<"u"?globalThis:C||self,i(C.popover={},C.Vue,C.common))})(this,function(C,i,U){"use strict";const Z={id:{type:String},arrowOffsetX:{type:Number,default:0},class:{type:String,default:""},customStyles:{type:Object,default:null},isSimpleTips:{type:Boolean,default:!1},fitContent:{type:Boolean,default:!1},host:{type:Object},leftBoundary:{type:Object},keepWidthWithReference:{type:Boolean,default:!1},minWidth:{type:Number,default:-1},offsetX:{type:Object,default:i.ref(0)},offsetY:{type:Object,default:i.ref(0)},placement:{type:String,default:"bottom"},reference:{type:Object},rightBoundary:{type:Object},showArrow:{type:Boolean,default:!1},title:{type:String},visible:{type:Boolean,default:!1},zIndex:{type:Number,default:-1},limitContentBySpace:{type:Boolean,default:!1},beforeClose:{type:Function}};function nt(t){const e=i.isRef(t)?t.value:t;return typeof e=="string"?e==="body"||typeof document>"u"?"body":document.querySelector(e)||"body":!!e&&typeof e.getBoundingClientRect=="function"&&typeof e.insertBefore=="function"?e:"body"}function G(t){return typeof document>"u"?null:t==="body"?document.body:t}function J(){const t=typeof window<"u"?window.innerHeight:0;return{left:0,top:0,width:typeof window<"u"?window.innerWidth:0,height:t,bottom:t,scrollLeft:0,scrollTop:0}}function j(t,e){const l=G(t);if(!l)return J();const s=l.getBoundingClientRect(),r=t==="body"||l===document.body,w=typeof window<"u"?window.innerHeight:s.height;let{width:v}=s;!r&&e&&(v-=e.getBoundingClientRect().width);const{top:p}=s;let{bottom:B,height:y}=s;if(r){const L=Math.max(s.top,0),m=Math.min(s.bottom,w);B=m,y=Math.max(m-L,0)||w}return{left:s.left,top:p,width:v,height:y,bottom:B,scrollLeft:l.scrollLeft||0,scrollTop:l.scrollTop||0}}function it(t,e,l){const s=j(e,l);if(!t||!t.isConnected)return s;const r=t.style,w=r.left,v=r.top,p=r.right,B=r.bottom;r.left="0px",r.top="0px",r.right="auto",r.bottom="auto";const y=t.getBoundingClientRect();r.left=w,r.top=v,r.right=p,r.bottom=B;const L=e==="body"||G(e)===document.body,m=L?J():s;return{left:y.left,top:y.top,width:m.width,height:m.height,bottom:L?m.bottom:y.top+m.height,scrollLeft:0,scrollTop:0}}function st(t){const e=nt(t.host),l=i.computed(()=>j(e,t.rightBoundary).top),s=i.computed(()=>j(e,t.rightBoundary).left),r=i.computed(()=>j(e,t.rightBoundary).bottom),w=i.computed(()=>j(e,t.rightBoundary).width),v=i.computed(()=>j(e,t.rightBoundary).height);return{host:e,hostLeft:s,hostTop:l,hostWidth:w,hostHeight:v,hostBottom:r,measure:p=>it(p,e,t.rightBoundary)}}function lt(t,e,l,s){const r=i.ref(t.offsetX||0),w=i.ref(t.offsetY||0),v=i.ref(-1),p=i.ref(-1),B=i.ref(-1),y=i.ref(-1),L=i.ref(t.placement),m=i.ref(0),g=i.ref(0),W=i.ref(0);let x=s.measure();i.watch(()=>t.offsetX,o=>{r.value=o});const d=i.computed(()=>{const o={left:`${g.value}px`,top:`${W.value}px`,transform:`translate(${r.value}px, ${w.value}px)`};return t.zIndex!==-1&&(o["z-index"]=t.zIndex),t.fitContent?t.keepWidthWithReference&&l.value&&v.value>=l.value.getBoundingClientRect().width&&(o.width=`${v.value}px`):v.value!==-1&&(o.width=`${v.value}px`),t.minWidth!==-1&&(o.minWidth=`${t.minWidth}px`),t.customStyles&&Object.assign(o,t.customStyles),p.value>0&&(o.maxHeight=p.value+"px"),o}),O=i.computed(()=>({left:`${m.value}px`,transform:`translateX(${t.arrowOffsetX}px)`}));function P(){return x.left}function b(){return x.top}function I(){return x.width}function N(){return x.height}function z(){return x.bottom}function H(){return x.scrollLeft}function u(){return x.scrollTop}function S(o){if(o&&t.keepWidthWithReference){const n=o.getBoundingClientRect();v.value=Math.max(t.minWidth,n.width)}}function X(o,n){const a=I()-o.width-4;return a>0?a:n}function E(o,n){const a=N()-o.height-12;return a>0?a:n}function D(o,n,a){const h=m.value,f=n.left-P()+n.width/2+H(),c=n.top-b()-(o.height+a.height)+u();return{popoverLeft:f,popoverTop:c,arrowLeft:h}}function F(o,n,a){const h=n.top-b()+(n.height+a.height)+u(),f=E(o,h);return Math.min(h,f)}function Y(o,n){const a=X(n,o),h=o<=a?m.value:o-a;return{popoverLeft:Math.min(o,a),arrowLeft:h,maxHeight:0}}function ct(o,n){const a=o<=X(n,o)?m.value:o-X(n,o);return{popoverLeft:o,arrowLeft:a,maxHeight:0}}function ft(o,n,a){const h=n.left-P()+H(),{arrowLeft:f,popoverLeft:c}=ct(h,o),{popoverTop:T}=D(o,n,a);return{popoverLeft:c,popoverTop:T,arrowLeft:f,maxHeight:0}}function dt(o,n,a){const h=n.left-P()+n.width/2-(a.width/2-(o.left-P()))+H(),{arrowLeft:f,popoverLeft:c}=Y(h,o),T=F(o,n,a);return{popoverLeft:c,popoverTop:T,arrowLeft:f,maxHeight:0}}function pt(o,n,a){const h=n.left-P()+H(),{arrowLeft:f,popoverLeft:c}=Y(h,o),T=F(o,n,a);return{popoverLeft:c,popoverTop:T,arrowLeft:f,maxHeight:0}}function ht(o,n,a){const h=n.left-P();let f=0,c=0,T=0,M=0,k="bottom-left";window.innerWidth-h>o.width?f=h+H():(f=n.right-o.width-P()+H(),T=o.width-a.width-20);let A=0;if(t.limitContentBySpace){const et={topHeight:n.top-b()-a.height-8,bottomHeight:z()-n.bottom-a.height-8};A=Math.max(et.topHeight,et.bottomHeight),o.height>A&&(M=A,l.value.classList.add("popover-limitmax"))}const _=M?Math.floor(M):o.height,K=n.top-b()+(n.height+a.height);return z()-K>_?c=K+u():(c=n.top-b()-_-a.height+u(),z()-K>n.top-b()?(c=K+u(),_>n.top-b()&&(c=z()-b()-_+u())):(c=c<0?0:c,k="top")),l.value.classList.add("popover-"+k,"bs-popover-"+k),{popoverLeft:f<0?5:f,popoverTop:c,arrowLeft:T,maxHeight:M}}function vt(o,n,a){const h=n.left-P()+n.width+H(),f=Math.max(n.top-b()-(o.height/2-n.height/2)+u(),u());let c=N()-o.height+u();c<0&&(c=f);const T=Math.min(f,c);return{popoverLeft:h,popoverTop:T,arrowLeft:0,maxHeight:0}}function mt(o,n,a){const h=n.left-P()+n.width+H(),f=Math.max(n.top-b()-n.height+u(),u());let c=N()-o.height+u();c<0&&(c=f);const T=Math.min(f,c);return{popoverLeft:h,popoverTop:T,arrowLeft:0,maxHeight:0}}const gt=new Map([["top",D],["top-left",ft],["bottom",dt],["bottom-left",pt],["right",vt],["right-top",mt],["auto",ht]]);function ot(o){var c;x=s.measure(l.value),t.keepWidthWithReference&&S(o);const n=o.getBoundingClientRect();B.value=n.top,y.value=n.left;const a=e.value?e.value.getBoundingClientRect():{height:4,width:4},h=(c=l.value)==null?void 0:c.getBoundingClientRect();v.value=h.width;const f=gt.get(L.value);if(f){const{arrowLeft:T,popoverLeft:M,popoverTop:k,maxHeight:A}=f(h,n,a);m.value=T,g.value=M,W.value=k,p.value=A||-1}}function wt(o){if(o){const n=o.getBoundingClientRect();(n.left!==y.value||n.top!==B.value)&&ot(o)}}function yt(){L.value=t.placement,m.value=0,g.value=0,W.value=0,v.value=-1}return{arrowStyle:O,popoverStyle:d,position:L,popoverWidth:v,fitToReference:S,followToReferencePosition:wt,locateToReference:ot,resetPosition:yt}}function rt(t,e,l,s,r,w,v){const p=i.ref(t.visible),B=i.computed(()=>p.value),{fitToReference:y,locateToReference:L,resetPosition:m}=v;let g;async function W(){p.value&&(t.beforeClose&&typeof t.beforeClose=="function"&&!await t.beforeClose()||(p.value=!1,document.body.removeEventListener("click",g),document.body.removeEventListener("mousedown",g),document.body.removeEventListener("wheel",g,!0),document.removeEventListener("scroll",g),m(),e.emit("hidden")))}g=d=>{var b;if(!r.value)return;const O=r.value.contains(d.target);if(d.type==="scroll"||d.type==="wheel"&&O){W();return}if(d.target.closest(".time-picker-panel")||d.target.closest(".fv-grid"))return;const P=(b=d.target)==null?void 0:b.closest(".popover");if(P&&s.value&&P===s.value){d.type!=="scroll"&&d.type!=="wheel"&&d.stopPropagation();return}if(!O&&p.value){const I=r.value.closest(".popover");I&&I.removeEventListener("click",g),W()}};async function x(d){if(s.value&&(t.showArrow===!1||t.showArrow&&l.value)&&d){p.value=!0,r.value=d,w.value&&y(d),await i.nextTick(),L(d),document.body.addEventListener("click",g),document.body.addEventListener("mousedown",g),document.body.addEventListener("wheel",g,!0),document.addEventListener("scroll",g),(top==null?void 0:top.document)!==document&&(top==null||top.document.addEventListener("mousedown",g));const O=d.closest(".popover");O&&O.addEventListener("click",g),e.emit("shown")}}return e.expose({hide:W,popoverRef:s,show:x,shown:B,isShow:p}),{showPopover:p,hidePopverOnClickBodyHandler:g}}function at(t,e,l,s,r,w){const{popoverWidth:v,fitToReference:p,followToReferencePosition:B}=r;function y(){var L;if(w.value&&((L=w.value.style)==null?void 0:L.display)!=="none"&&l.value){B(l.value);const m=l.value.getBoundingClientRect();s.value&&m.width!==v.value&&p(l.value)}}return{onResize:y}}const V=i.defineComponent({name:"FPopover",props:Z,emits:["shown","hidden"],setup(t,e){const l=i.ref(),s=i.ref(),r=i.ref(t.reference),w=i.ref(t.keepWidthWithReference),v=i.computed(()=>!!t.title),p=st(t),{host:B}=p,y=lt(t,l,s,p),{position:L,arrowStyle:m,popoverStyle:g,fitToReference:W,locateToReference:x}=y,{showPopover:d,hidePopverOnClickBodyHandler:O}=rt(t,e,l,s,r,w,y),{onResize:P}=at(t,e,r,w,y,s),b=i.computed(()=>{let u=L.value;u==="top-left"&&(u="top");const S=`popover in popover-${u}`,X=`bs-popover-${u}`,E={"popover-fitcontent":t.fitContent,fade:!0};E[S]=!0,E[X]=!0;const D=(t.class||"").split(" ");return t.isSimpleTips&&D.unshift("popover-tips"),D.reduce((F,Y)=>(F[Y]=!0,F),E),E}),I=i.computed(()=>({"popover-content":!0,"popover-body":!0})),N=i.computed(()=>{const u={};return u.opacity=d.value?1:0,u.visibility=d.value?"visible":"hidden",u.zIndex=U.getMaxZIndex()||1060,u}),z=i.computed(()=>t.isSimpleTips?!0:t.showArrow),{delayedValue:H}=U.useDelayedRef(N,50);return i.onMounted(()=>{var u;w.value&&W(r.value),t.reference&&x(r.value),window.addEventListener("resize",P),(u=s.value)==null||u.focus()}),i.onUnmounted(()=>{document.body.removeEventListener("click",O),window.removeEventListener("resize",P),d.value=!1}),()=>i.createVNode(i.Teleport,{to:B},{default:()=>{var u;return[i.withDirectives(i.createVNode("div",{tabindex:"-1",ref:s,class:b.value,style:{...g.value,...H.value},onMousedown:S=>{S.stopPropagation()},onClick:S=>{S.stopPropagation()}},[z.value&&i.createVNode("div",{ref:l,class:"popover-arrow arrow",style:m.value},null),v.value&&i.createVNode("h3",{class:"popover-title popover-header"},[t.title]),i.createVNode("div",{class:I.value},[e.slots.default&&((u=e.slots)==null?void 0:u.default())])]),[[i.vShow,d.value]])]}})}}),q="FarrisVue_PopoverInstancesKey";typeof window<"u"&&(window[q]=window[q]||new WeakMap);function R(t,e,l){t.stopPropagation();const s=e.value;s&&s.value&&!s.value.isShow&&(s.value.show(l),window[q].set(l,s.value))}function Q(t,e,l){t.stopPropagation(),e.value.value.hide(),window[q].delete(l)}function ut(t,e,l){t.stopPropagation();const s=e.value;s&&s.value&&(s.value.isShow?Q(t,e,l):R(t,e,l))}function $(t,e,l){e.arg&&e.arg==="toggle"?ut(t,e,l):R(t,e,l)}const tt={mounted:(t,e,l)=>{e.modifiers.hover?(t.addEventListener("mouseenter",s=>R(s,e,t)),t.addEventListener("mouseleave",s=>Q(s,e,t))):e.modifiers.click?t.addEventListener("click",s=>$(s,e,t)):t.addEventListener("click",s=>$(s,e,t)),t.classList.add("v-popover")},unMounted:(t,e,l)=>{}};V.install=t=>{t.component(V.name,V),t.directive("popover",tt)},C.Popover=V,C.PopoverDirective=tt,C.default=V,C.popoverProps=Z,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|