@farris/ui-vue 1.6.5-beta.8 → 1.6.5
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/avatar/index.esm.js +334 -334
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +4 -4
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/combo-list/index.esm.js +136 -133
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/component/index.esm.js +300 -300
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +4 -4
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +295 -295
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +99 -99
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +3416 -3350
- package/components/data-view/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +4 -4
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dynamic-form/index.esm.js +170 -170
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +637 -637
- package/components/events-editor/index.umd.cjs +3 -3
- package/components/expression-editor/index.esm.js +699 -696
- package/components/expression-editor/index.umd.cjs +4 -4
- package/components/filter-bar/index.esm.js +446 -446
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/filter-condition-editor/index.esm.js +377 -374
- package/components/filter-condition-editor/index.umd.cjs +2 -2
- package/components/flow-canvas/index.esm.js +204 -204
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +42 -40
- package/components/list-view/index.umd.cjs +2 -2
- package/components/mapping-editor/index.esm.js +427 -427
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.esm.js +212 -212
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.esm.js +276 -276
- package/components/modal/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +160 -160
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +314 -314
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +468 -463
- package/components/order/index.umd.cjs +2 -2
- package/components/popover/index.esm.js +58 -56
- package/components/popover/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +215 -215
- package/components/property-panel/index.umd.cjs +2 -2
- package/components/query-solution/index.esm.js +4 -4
- package/components/query-solution/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +282 -282
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +944 -941
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +498 -492
- package/components/schema-selector/index.umd.cjs +6 -6
- package/components/search-box/index.esm.js +76 -72
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +211 -211
- package/components/section/index.umd.cjs +1 -1
- package/components/sort-condition-editor/index.esm.js +377 -374
- package/components/sort-condition-editor/index.umd.cjs +2 -2
- package/components/switch/index.esm.js +78 -77
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +579 -579
- package/components/tabs/index.umd.cjs +2 -2
- package/components/textarea/index.esm.js +362 -362
- package/components/textarea/index.umd.cjs +2 -2
- package/components/time-picker/index.css +1 -0
- package/components/time-picker/index.esm.js +9799 -0
- package/components/time-picker/index.umd.cjs +1 -0
- package/components/time-picker/package.json +8 -0
- package/components/time-picker/style.js +6 -0
- package/components/transfer/index.esm.js +81 -79
- package/components/transfer/index.umd.cjs +2 -2
- package/components/tree-grid/index.esm.js +100 -100
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +2361 -2279
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/video/index.esm.js +219 -219
- package/components/video/index.umd.cjs +1 -1
- package/designer/button-edit/index.css +1 -0
- package/designer/button-edit/index.esm.js +4856 -0
- package/designer/button-edit/index.umd.cjs +1 -0
- package/designer/checkbox/index.esm.js +254 -0
- package/designer/checkbox/index.umd.cjs +1 -0
- package/designer/checkbox-group/index.esm.js +382 -0
- package/designer/checkbox-group/index.umd.cjs +1 -0
- package/designer/data-grid/index.css +1 -0
- package/designer/data-grid/index.esm.js +15439 -0
- package/designer/data-grid/index.umd.cjs +23 -0
- package/designer/data-view/index.esm.js +854 -0
- package/designer/data-view/index.umd.cjs +38 -0
- package/designer/drawer/index.css +1 -0
- package/designer/drawer/index.esm.js +525 -0
- package/designer/drawer/index.umd.cjs +1 -0
- package/designer/farris-designer.all.esm.js +22330 -0
- package/designer/farris-designer.all.umd.cjs +34 -0
- package/designer/index.css +1 -0
- package/designer/input-group/index.esm.js +1098 -0
- package/designer/input-group/index.umd.cjs +1 -0
- package/designer/list-view/index.css +1 -0
- package/designer/list-view/index.esm.js +4689 -0
- package/designer/list-view/index.umd.cjs +40 -0
- package/designer/radio-group/index.css +1 -0
- package/designer/radio-group/index.esm.js +6985 -0
- package/designer/radio-group/index.umd.cjs +1 -0
- package/designer/tree-grid/index.esm.js +1099 -0
- package/designer/tree-grid/index.umd.cjs +1 -0
- package/farris.all.esm.js +9619 -9535
- package/farris.all.umd.cjs +24 -24
- package/locales/data-grid/ui/en.json +2 -2
- package/locales/designer/en.json +7 -6
- package/locales/designer/zh-CHS.json +2 -1
- package/locales/designer/zh-CHT.json +2 -1
- package/locales/ui/en.json +7 -6
- package/locales/ui/zh-CHS.json +2 -1
- package/locales/ui/zh-CHT.json +2 -1
- package/package.json +1 -1
- package/types/combo-list/src/property-config/combo-list.property-config.d.ts +0 -6
- package/types/data-view/composition/types.d.ts +10 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(L,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):(L=typeof globalThis<"u"?globalThis:L||self,i(L.popover={},L.Vue,L.common))})(this,function(L,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)},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 tt(t){const n=t.host?t.host:"body",a=i.computed(()=>n==="body"?0:n?n.getBoundingClientRect().top:0),l=i.computed(()=>n==="body"?window.innerHeight:n?n.getBoundingClientRect().bottom:window.innerHeight),h=i.computed(()=>n==="body"?0:n?n.getBoundingClientRect().left:0),f=i.computed(()=>n==="body"?document.body.getBoundingClientRect().width:n?n.getBoundingClientRect().width-(t.rightBoundary?t.rightBoundary.getBoundingClientRect().width:0):document.body.getBoundingClientRect().width),P=i.computed(()=>n==="body"?window.innerHeight:n?n.getBoundingClientRect().height:window.innerHeight);return{host:n,hostLeft:h,hostTop:a,hostWidth:f,hostHeight:P,hostBottom:l}}function et(t,n,a,l){const h=i.ref(t.offsetX||0),f=i.ref(-1),P=i.ref(-1),g=i.ref(-1),x=i.ref(-1),T=i.ref(t.placement),b=i.ref(0),S=i.ref(0),p=i.ref(0),y=i.computed(()=>document.documentElement.scrollLeft),C=i.computed(()=>document.documentElement.scrollTop),{hostLeft:c,hostTop:m,hostWidth:W,hostHeight:H,hostBottom:B}=l;i.watch(()=>t.offsetX,e=>{h.value=e});const _=i.computed(()=>{const e={left:`${S.value}px`,top:`${p.value}px`,transform:`translateX(${h.value}px)`};return t.zIndex!==-1&&(e["z-index"]=t.zIndex),t.fitContent?t.keepWidthWithReference&&a.value&&f.value>=a.value.getBoundingClientRect().width&&(e.width=`${f.value}px`):f.value!==-1&&(e.width=`${f.value}px`),t.minWidth!==-1&&(e.minWidth=`${t.minWidth}px`),t.customStyles&&Object.assign(e,t.customStyles),P.value>0&&(e.maxHeight=P.value+"px"),e}),q=i.computed(()=>({left:`${b.value}px`,transform:`translateX(${t.arrowOffsetX}px)`}));function V(e){if(e&&t.keepWidthWithReference){const o=e.getBoundingClientRect();f.value=Math.max(t.minWidth,o.width)}}function v(e,o){const s=W.value-e.width-4;return s>0?s:o}function M(e,o){const s=H.value-e.height-4;return s>0?s:o}function X(e,o,s){const r=b.value,d=o.left-c.value+o.width/2+y.value,u=o.top-m.value-(e.height+s.height)+C.value;return{popoverLeft:d,popoverTop:u,arrowLeft:r}}function k(e,o,s){const r=o.top-m.value+(o.height+s.height)+C.value,d=M(e,r);return Math.min(r,d)}function z(e,o){const s=v(o,e),r=e<=s?b.value:e-s;return{popoverLeft:Math.min(e,s),arrowLeft:r,maxHeight:0}}function A(e,o){const s=v(o,e),r=e<=s?b.value:e-s;return{popoverLeft:e,arrowLeft:r,maxHeight:0}}function K(e,o,s){const r=o.left-c.value+y.value,{arrowLeft:d,popoverLeft:u}=A(r,e),{popoverTop:w}=X(e,o,s);return{popoverLeft:u,popoverTop:w,arrowLeft:d,maxHeight:0}}function lt(e,o,s){const r=o.left-c.value+o.width/2-(s.width/2-(e.left-c.value))+y.value,{arrowLeft:d,popoverLeft:u}=z(r,e),w=k(e,o,s);return{popoverLeft:u,popoverTop:w,arrowLeft:d,maxHeight:0}}function st(e,o,s){const r=o.left-c.value+y.value,{arrowLeft:d,popoverLeft:u}=z(r,e),w=k(e,o,s);return{popoverLeft:u,popoverTop:w,arrowLeft:d,maxHeight:0}}function at(e,o,s){const r=o.left-c.value;let d=0,u=0,w=0,O=0,j="bottom-left";window.innerWidth-r>e.width?d=r+y.value:(d=o.right-e.width+y.value,w=e.width-s.width-20);let E=0;if(t.limitContentBySpace){const Y={topHeight:o.top-m.value-s.height-8,bottomHeight:B.value-o.bottom-s.height-8};E=Math.max(Y.topHeight,Y.bottomHeight),e.height>E&&(O=E,a.value.classList.add("popover-limitmax"))}const R=O?Math.floor(O):e.height,D=o.top-m.value+(o.height+s.height);return B.value-D>R?u=D+C.value:(u=o.top-R-s.height+C.value,B.value-D>o.top?(u=D+C.value,R>o.top&&(u=B.value-R)):(u=u<0?0:u,j="top")),a.value.classList.add("popover-"+j,"bs-popover-"+j),{popoverLeft:d,popoverTop:u,arrowLeft:w,maxHeight:O}}function ut(e,o,s){const r=o.left+o.width,d=Math.max(o.top-(e.height/2-o.height/2),m.value);let u=m.value+H.value-e.height;u<0&&(u=d);const w=Math.min(d,u);return{popoverLeft:r,popoverTop:w,arrowLeft:0,maxHeight:0}}function ct(e,o,s){const r=o.left+o.width,d=Math.max(o.top-o.height,m.value);let u=m.value+H.value-e.height;u<0&&(u=d);const w=Math.min(d,u);return{popoverLeft:r,popoverTop:w,arrowLeft:0,maxHeight:0}}const rt=new Map([["top",X],["top-left",K],["bottom",lt],["bottom-left",st],["right",ut],["right-top",ct],["auto",at]]);function Q(e){var u;t.keepWidthWithReference&&V(e);const o=e.getBoundingClientRect();g.value=o.top,x.value=o.left;const s=n.value?n.value.getBoundingClientRect():{height:4,width:4},r=(u=a.value)==null?void 0:u.getBoundingClientRect();f.value=r.width;const d=rt.get(T.value);if(d){const{arrowLeft:w,popoverLeft:O,popoverTop:j,maxHeight:E}=d(r,o,s);b.value=w,S.value=O,p.value=j,P.value=E||-1}}function dt(e){if(e){const o=e.getBoundingClientRect();(o.left!==x.value||o.top!==g.value)&&Q(e)}}function pt(){T.value=t.placement,b.value=0,S.value=0,p.value=0,f.value=-1}return{arrowStyle:q,popoverStyle:_,position:T,popoverWidth:f,fitToReference:V,followToReferencePosition:dt,locateToReference:Q,resetPosition:pt}}function ot(t,n,a,l,h,f,P){const g=i.ref(t.visible),x=i.computed(()=>g.value),{fitToReference:T,locateToReference:b,resetPosition:S}=P;let p;async function y(){g.value&&(t.beforeClose&&typeof t.beforeClose=="function"&&!await t.beforeClose()||(g.value=!1,document.body.removeEventListener("click",p),document.body.removeEventListener("mousedown",p),document.body.removeEventListener("wheel",p,!0),document.removeEventListener("scroll",p),S(),n.emit("hidden")))}p=c=>{var H;if(!h.value)return;const m=h.value.contains(c.target);if(c.type==="scroll"||c.type==="wheel"&&m){y();return}const W=(H=c.target)==null?void 0:H.closest(".popover");if(W&&l.value&&W===l.value){c.type!=="scroll"&&c.type!=="wheel"&&c.stopPropagation();return}if(!m&&g.value){const B=h.value.closest(".popover");B&&B.removeEventListener("click",p),y()}};async function C(c){if(l.value&&(t.showArrow===!1||t.showArrow&&a.value)&&c){g.value=!0,h.value=c,f.value&&T(c),await i.nextTick(),b(c),document.body.addEventListener("click",p),document.body.addEventListener("mousedown",p),document.body.addEventListener("wheel",p,!0),document.addEventListener("scroll",p),(top==null?void 0:top.document)!==document&&(top==null||top.document.addEventListener("mousedown",p));const m=c.closest(".popover");m&&m.addEventListener("click",p),n.emit("shown")}}return n.expose({hide:y,popoverRef:l,show:C,shown:x,isShow:g}),{showPopover:g,hidePopverOnClickBodyHandler:p}}function nt(t,n,a,l,h){const{popoverWidth:f,fitToReference:P,followToReferencePosition:g}=h;function x(){if(a.value){g(a.value);const T=a.value.getBoundingClientRect();l.value&&T.width!==f.value&&P(a.value)}}return{onResize:x}}const I=i.defineComponent({name:"FPopover",props:Z,emits:["shown","hidden"],setup(t,n){const a=i.ref(),l=i.ref(),h=i.ref(t.reference),f=i.ref(t.keepWidthWithReference),P=i.computed(()=>!!t.title),g=tt(t),{host:x}=g,T=et(t,a,l,g),{position:b,arrowStyle:S,popoverStyle:p,fitToReference:y,locateToReference:C}=T,{showPopover:c,hidePopverOnClickBodyHandler:m}=ot(t,n,a,l,h,f,T),{onResize:W}=nt(t,n,h,f,T),H=i.computed(()=>{let v=b.value;v==="top-left"&&(v="top");const M=`popover in popover-${v}`,X=`bs-popover-${v}`,k={"popover-fitcontent":t.fitContent,fade:!0};k[M]=!0,k[X]=!0;const z=(t.class||"").split(" ");return t.isSimpleTips&&z.unshift("popover-tips"),z.reduce((A,K)=>(A[K]=!0,A),k),k}),B=i.computed(()=>({"popover-content":!0,"popover-body":!0})),_=i.computed(()=>{const v={};return v.opacity=c.value?1:0,v.visibility=c.value?"visible":"hidden",v.zIndex=U.getMaxZIndex()||1060,v}),q=i.computed(()=>t.isSimpleTips?!0:t.showArrow),{delayedValue:V}=U.useDelayedRef(_,50);return i.onMounted(()=>{var v;f.value&&y(h.value),t.reference&&C(h.value),window.addEventListener("resize",W),(v=l.value)==null||v.focus()}),i.onUnmounted(()=>{document.body.removeEventListener("click",m),window.removeEventListener("resize",W),c.value=!1}),()=>i.createVNode(i.Teleport,{to:x},{default:()=>{var v;return[i.withDirectives(i.createVNode("div",{tabindex:"-1",ref:l,class:H.value,style:{...p.value,...V.value},onMousedown:M=>{M.stopPropagation()},onClick:M=>{M.stopPropagation()}},[q.value&&i.createVNode("div",{ref:a,class:"popover-arrow arrow",style:S.value},null),P.value&&i.createVNode("h3",{class:"popover-title popover-header"},[t.title]),i.createVNode("div",{class:B.value},[n.slots.default&&((v=n.slots)==null?void 0:v.default())])]),[[i.vShow,c.value]])]}})}}),N="FarrisVue_PopoverInstancesKey";window[N]=window[N]||new WeakMap;function F(t,n,a){t.stopPropagation();const l=n.value;l&&l.value&&!l.value.isShow&&(l.value.show(a),window[N].set(a,l.value))}function $(t,n,a){t.stopPropagation(),n.value.value.hide(),window[N].delete(a)}function it(t,n,a){t.stopPropagation();const l=n.value;l&&l.value&&(l.value.isShow?$(t,n,a):F(t,n,a))}function G(t,n,a){n.arg&&n.arg==="toggle"?it(t,n,a):F(t,n,a)}const J={mounted:(t,n,a)=>{n.modifiers.hover?(t.addEventListener("mouseenter",l=>F(l,n,t)),t.addEventListener("mouseleave",l=>$(l,n,t))):n.modifiers.click?t.addEventListener("click",l=>G(l,n,t)):t.addEventListener("click",l=>G(l,n,t)),t.classList.add("v-popover")},unMounted:(t,n,a)=>{}};I.install=t=>{t.component(I.name,I),t.directive("popover",J)},L.Popover=I,L.PopoverDirective=J,L.default=I,L.popoverProps=Z,Object.defineProperties(L,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(L,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):(L=typeof globalThis<"u"?globalThis:L||self,i(L.popover={},L.Vue,L.common))})(this,function(L,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)},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 tt(t){const n=t.host?t.host:"body",a=i.computed(()=>n==="body"?0:n?n.getBoundingClientRect().top:0),l=i.computed(()=>n==="body"?window.innerHeight:n?n.getBoundingClientRect().bottom:window.innerHeight),h=i.computed(()=>n==="body"?0:n?n.getBoundingClientRect().left:0),f=i.computed(()=>n==="body"?document.body.getBoundingClientRect().width:n?n.getBoundingClientRect().width-(t.rightBoundary?t.rightBoundary.getBoundingClientRect().width:0):document.body.getBoundingClientRect().width),P=i.computed(()=>n==="body"?window.innerHeight:n?n.getBoundingClientRect().height:window.innerHeight);return{host:n,hostLeft:h,hostTop:a,hostWidth:f,hostHeight:P,hostBottom:l}}function et(t,n,a,l){const h=i.ref(t.offsetX||0),f=i.ref(-1),P=i.ref(-1),g=i.ref(-1),x=i.ref(-1),T=i.ref(t.placement),b=i.ref(0),S=i.ref(0),p=i.ref(0),y=i.computed(()=>document.documentElement.scrollLeft),C=i.computed(()=>document.documentElement.scrollTop),{hostLeft:r,hostTop:m,hostWidth:W,hostHeight:H,hostBottom:B}=l;i.watch(()=>t.offsetX,e=>{h.value=e});const _=i.computed(()=>{const e={left:`${S.value}px`,top:`${p.value}px`,transform:`translateX(${h.value}px)`};return t.zIndex!==-1&&(e["z-index"]=t.zIndex),t.fitContent?t.keepWidthWithReference&&a.value&&f.value>=a.value.getBoundingClientRect().width&&(e.width=`${f.value}px`):f.value!==-1&&(e.width=`${f.value}px`),t.minWidth!==-1&&(e.minWidth=`${t.minWidth}px`),t.customStyles&&Object.assign(e,t.customStyles),P.value>0&&(e.maxHeight=P.value+"px"),e}),q=i.computed(()=>({left:`${b.value}px`,transform:`translateX(${t.arrowOffsetX}px)`}));function V(e){if(e&&t.keepWidthWithReference){const o=e.getBoundingClientRect();f.value=Math.max(t.minWidth,o.width)}}function v(e,o){const s=W.value-e.width-4;return s>0?s:o}function M(e,o){const s=H.value-e.height-4;return s>0?s:o}function X(e,o,s){const c=b.value,d=o.left-r.value+o.width/2+y.value,u=o.top-m.value-(e.height+s.height)+C.value;return{popoverLeft:d,popoverTop:u,arrowLeft:c}}function k(e,o,s){const c=o.top-m.value+(o.height+s.height)+C.value,d=M(e,c);return Math.min(c,d)}function z(e,o){const s=v(o,e),c=e<=s?b.value:e-s;return{popoverLeft:Math.min(e,s),arrowLeft:c,maxHeight:0}}function A(e,o){const s=v(o,e),c=e<=s?b.value:e-s;return{popoverLeft:e,arrowLeft:c,maxHeight:0}}function K(e,o,s){const c=o.left-r.value+y.value,{arrowLeft:d,popoverLeft:u}=A(c,e),{popoverTop:w}=X(e,o,s);return{popoverLeft:u,popoverTop:w,arrowLeft:d,maxHeight:0}}function lt(e,o,s){const c=o.left-r.value+o.width/2-(s.width/2-(e.left-r.value))+y.value,{arrowLeft:d,popoverLeft:u}=z(c,e),w=k(e,o,s);return{popoverLeft:u,popoverTop:w,arrowLeft:d,maxHeight:0}}function st(e,o,s){const c=o.left-r.value+y.value,{arrowLeft:d,popoverLeft:u}=z(c,e),w=k(e,o,s);return{popoverLeft:u,popoverTop:w,arrowLeft:d,maxHeight:0}}function at(e,o,s){const c=o.left-r.value;let d=0,u=0,w=0,O=0,j="bottom-left";window.innerWidth-c>e.width?d=c+y.value:(d=o.right-e.width+y.value,w=e.width-s.width-20);let E=0;if(t.limitContentBySpace){const $={topHeight:o.top-m.value-s.height-8,bottomHeight:B.value-o.bottom-s.height-8};E=Math.max($.topHeight,$.bottomHeight),e.height>E&&(O=E,a.value.classList.add("popover-limitmax"))}const R=O?Math.floor(O):e.height,D=o.top-m.value+(o.height+s.height);return B.value-D>R?u=D+C.value:(u=o.top-R-s.height+C.value,B.value-D>o.top?(u=D+C.value,R>o.top&&(u=B.value-R)):(u=u<0?0:u,j="top")),a.value.classList.add("popover-"+j,"bs-popover-"+j),{popoverLeft:d,popoverTop:u,arrowLeft:w,maxHeight:O}}function ut(e,o,s){const c=o.left+o.width,d=Math.max(o.top-(e.height/2-o.height/2),m.value);let u=m.value+H.value-e.height;u<0&&(u=d);const w=Math.min(d,u);return{popoverLeft:c,popoverTop:w,arrowLeft:0,maxHeight:0}}function rt(e,o,s){const c=o.left+o.width,d=Math.max(o.top-o.height,m.value);let u=m.value+H.value-e.height;u<0&&(u=d);const w=Math.min(d,u);return{popoverLeft:c,popoverTop:w,arrowLeft:0,maxHeight:0}}const ct=new Map([["top",X],["top-left",K],["bottom",lt],["bottom-left",st],["right",ut],["right-top",rt],["auto",at]]);function Y(e){var u;t.keepWidthWithReference&&V(e);const o=e.getBoundingClientRect();g.value=o.top,x.value=o.left;const s=n.value?n.value.getBoundingClientRect():{height:4,width:4},c=(u=a.value)==null?void 0:u.getBoundingClientRect();f.value=c.width;const d=ct.get(T.value);if(d){const{arrowLeft:w,popoverLeft:O,popoverTop:j,maxHeight:E}=d(c,o,s);b.value=w,S.value=O,p.value=j,P.value=E||-1}}function dt(e){if(e){const o=e.getBoundingClientRect();(o.left!==x.value||o.top!==g.value)&&Y(e)}}function pt(){T.value=t.placement,b.value=0,S.value=0,p.value=0,f.value=-1}return{arrowStyle:q,popoverStyle:_,position:T,popoverWidth:f,fitToReference:V,followToReferencePosition:dt,locateToReference:Y,resetPosition:pt}}function ot(t,n,a,l,h,f,P){const g=i.ref(t.visible),x=i.computed(()=>g.value),{fitToReference:T,locateToReference:b,resetPosition:S}=P;let p;async function y(){g.value&&(t.beforeClose&&typeof t.beforeClose=="function"&&!await t.beforeClose()||(g.value=!1,document.body.removeEventListener("click",p),document.body.removeEventListener("mousedown",p),document.body.removeEventListener("wheel",p,!0),document.removeEventListener("scroll",p),S(),n.emit("hidden")))}p=r=>{var H;if(!h.value)return;const m=h.value.contains(r.target);if(r.type==="scroll"||r.type==="wheel"&&m){y();return}if(r.target.closest(".time-picker-panel"))return;const W=(H=r.target)==null?void 0:H.closest(".popover");if(W&&l.value&&W===l.value){r.type!=="scroll"&&r.type!=="wheel"&&r.stopPropagation();return}if(!m&&g.value){const B=h.value.closest(".popover");B&&B.removeEventListener("click",p),y()}};async function C(r){if(l.value&&(t.showArrow===!1||t.showArrow&&a.value)&&r){g.value=!0,h.value=r,f.value&&T(r),await i.nextTick(),b(r),document.body.addEventListener("click",p),document.body.addEventListener("mousedown",p),document.body.addEventListener("wheel",p,!0),document.addEventListener("scroll",p),(top==null?void 0:top.document)!==document&&(top==null||top.document.addEventListener("mousedown",p));const m=r.closest(".popover");m&&m.addEventListener("click",p),n.emit("shown")}}return n.expose({hide:y,popoverRef:l,show:C,shown:x,isShow:g}),{showPopover:g,hidePopverOnClickBodyHandler:p}}function nt(t,n,a,l,h){const{popoverWidth:f,fitToReference:P,followToReferencePosition:g}=h;function x(){if(a.value){g(a.value);const T=a.value.getBoundingClientRect();l.value&&T.width!==f.value&&P(a.value)}}return{onResize:x}}const I=i.defineComponent({name:"FPopover",props:Z,emits:["shown","hidden"],setup(t,n){const a=i.ref(),l=i.ref(),h=i.ref(t.reference),f=i.ref(t.keepWidthWithReference),P=i.computed(()=>!!t.title),g=tt(t),{host:x}=g,T=et(t,a,l,g),{position:b,arrowStyle:S,popoverStyle:p,fitToReference:y,locateToReference:C}=T,{showPopover:r,hidePopverOnClickBodyHandler:m}=ot(t,n,a,l,h,f,T),{onResize:W}=nt(t,n,h,f,T),H=i.computed(()=>{let v=b.value;v==="top-left"&&(v="top");const M=`popover in popover-${v}`,X=`bs-popover-${v}`,k={"popover-fitcontent":t.fitContent,fade:!0};k[M]=!0,k[X]=!0;const z=(t.class||"").split(" ");return t.isSimpleTips&&z.unshift("popover-tips"),z.reduce((A,K)=>(A[K]=!0,A),k),k}),B=i.computed(()=>({"popover-content":!0,"popover-body":!0})),_=i.computed(()=>{const v={};return v.opacity=r.value?1:0,v.visibility=r.value?"visible":"hidden",v.zIndex=U.getMaxZIndex()||1060,v}),q=i.computed(()=>t.isSimpleTips?!0:t.showArrow),{delayedValue:V}=U.useDelayedRef(_,50);return i.onMounted(()=>{var v;f.value&&y(h.value),t.reference&&C(h.value),window.addEventListener("resize",W),(v=l.value)==null||v.focus()}),i.onUnmounted(()=>{document.body.removeEventListener("click",m),window.removeEventListener("resize",W),r.value=!1}),()=>i.createVNode(i.Teleport,{to:x},{default:()=>{var v;return[i.withDirectives(i.createVNode("div",{tabindex:"-1",ref:l,class:H.value,style:{...p.value,...V.value},onMousedown:M=>{M.stopPropagation()},onClick:M=>{M.stopPropagation()}},[q.value&&i.createVNode("div",{ref:a,class:"popover-arrow arrow",style:S.value},null),P.value&&i.createVNode("h3",{class:"popover-title popover-header"},[t.title]),i.createVNode("div",{class:B.value},[n.slots.default&&((v=n.slots)==null?void 0:v.default())])]),[[i.vShow,r.value]])]}})}}),N="FarrisVue_PopoverInstancesKey";window[N]=window[N]||new WeakMap;function F(t,n,a){t.stopPropagation();const l=n.value;l&&l.value&&!l.value.isShow&&(l.value.show(a),window[N].set(a,l.value))}function G(t,n,a){t.stopPropagation(),n.value.value.hide(),window[N].delete(a)}function it(t,n,a){t.stopPropagation();const l=n.value;l&&l.value&&(l.value.isShow?G(t,n,a):F(t,n,a))}function J(t,n,a){n.arg&&n.arg==="toggle"?it(t,n,a):F(t,n,a)}const Q={mounted:(t,n,a)=>{n.modifiers.hover?(t.addEventListener("mouseenter",l=>F(l,n,t)),t.addEventListener("mouseleave",l=>G(l,n,t))):n.modifiers.click?t.addEventListener("click",l=>J(l,n,t)):t.addEventListener("click",l=>J(l,n,t)),t.classList.add("v-popover")},unMounted:(t,n,a)=>{}};I.install=t=>{t.component(I.name,I),t.directive("popover",Q)},L.Popover=I,L.PopoverDirective=Q,L.default=I,L.popoverProps=Z,Object.defineProperties(L,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|