@floating-ui/vue
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -124,2 +124,3 @@ import { arrow as arrow$1, computePosition } from '@floating-ui/dom'; | ||
} | ||
const open = openOption.value; | ||
computePosition(referenceElement.value, floatingElement.value, { | ||
@@ -135,3 +136,9 @@ middleware: middlewareOption.value, | ||
middlewareData.value = position.middlewareData; | ||
isPositioned.value = true; | ||
/** | ||
* The floating element's position may be recomputed while it's closed | ||
* but still mounted (such as when transitioning out). To ensure | ||
* `isPositioned` will be `false` initially on the next open, avoid | ||
* setting it to `true` when `open === false` (must be specified). | ||
*/ | ||
isPositioned.value = open !== false; | ||
}); | ||
@@ -161,3 +168,3 @@ } | ||
} | ||
watch([middlewareOption, placementOption, strategyOption], update, { | ||
watch([middlewareOption, placementOption, strategyOption, openOption], update, { | ||
flush: 'sync' | ||
@@ -164,0 +171,0 @@ }); |
@@ -125,2 +125,3 @@ (function (global, factory) { | ||
} | ||
const open = openOption.value; | ||
dom.computePosition(referenceElement.value, floatingElement.value, { | ||
@@ -136,3 +137,9 @@ middleware: middlewareOption.value, | ||
middlewareData.value = position.middlewareData; | ||
isPositioned.value = true; | ||
/** | ||
* The floating element's position may be recomputed while it's closed | ||
* but still mounted (such as when transitioning out). To ensure | ||
* `isPositioned` will be `false` initially on the next open, avoid | ||
* setting it to `true` when `open === false` (must be specified). | ||
*/ | ||
isPositioned.value = open !== false; | ||
}); | ||
@@ -162,3 +169,3 @@ } | ||
} | ||
vueDemi.watch([middlewareOption, placementOption, strategyOption], update, { | ||
vueDemi.watch([middlewareOption, placementOption, strategyOption, openOption], update, { | ||
flush: 'sync' | ||
@@ -165,0 +172,0 @@ }); |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@floating-ui/dom"),require("@floating-ui/utils/dom"),require("vue-demi")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/dom","@floating-ui/utils/dom","vue-demi"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIVue={},e.FloatingUIDOM,e.FloatingUIUtilsDOM,e.VueDemi)}(this,(function(e,t,n,u){"use strict";function o(e){if(function(e){return null!=e&&"object"==typeof e&&"$el"in e}(e)){const t=e.$el;return n.isNode(t)&&"#comment"===n.getNodeName(t)?null:t}return e}function r(e){return"function"==typeof e?e():u.unref(e)}function l(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function i(e,t){const n=l(e);return Math.round(t*n)/n}Object.defineProperty(e,"autoPlacement",{enumerable:!0,get:function(){return t.autoPlacement}}),Object.defineProperty(e,"autoUpdate",{enumerable:!0,get:function(){return t.autoUpdate}}),Object.defineProperty(e,"computePosition",{enumerable:!0,get:function(){return t.computePosition}}),Object.defineProperty(e,"detectOverflow",{enumerable:!0,get:function(){return t.detectOverflow}}),Object.defineProperty(e,"flip",{enumerable:!0,get:function(){return t.flip}}),Object.defineProperty(e,"getOverflowAncestors",{enumerable:!0,get:function(){return t.getOverflowAncestors}}),Object.defineProperty(e,"hide",{enumerable:!0,get:function(){return t.hide}}),Object.defineProperty(e,"inline",{enumerable:!0,get:function(){return t.inline}}),Object.defineProperty(e,"limitShift",{enumerable:!0,get:function(){return t.limitShift}}),Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return t.offset}}),Object.defineProperty(e,"platform",{enumerable:!0,get:function(){return t.platform}}),Object.defineProperty(e,"shift",{enumerable:!0,get:function(){return t.shift}}),Object.defineProperty(e,"size",{enumerable:!0,get:function(){return t.size}}),e.arrow=function(e){return{name:"arrow",options:e,fn(n){const u=o(r(e.element));return null==u?{}:t.arrow({element:u,padding:e.padding}).fn(n)}}},e.useFloating=function(e,n,a){void 0===a&&(a={});const f=a.whileElementsMounted,c=u.computed((()=>{var e;return null==(e=r(a.open))||e})),d=u.computed((()=>r(a.middleware))),s=u.computed((()=>{var e;return null!=(e=r(a.placement))?e:"bottom"})),p=u.computed((()=>{var e;return null!=(e=r(a.strategy))?e:"absolute"})),m=u.computed((()=>{var e;return null==(e=r(a.transform))||e})),v=u.computed((()=>o(e.value))),y=u.computed((()=>o(n.value))),g=u.ref(0),b=u.ref(0),w=u.ref(p.value),h=u.ref(s.value),P=u.shallowRef({}),O=u.ref(!1),j=u.computed((()=>{const e={position:w.value,left:"0",top:"0"};if(!y.value)return e;const t=i(y.value,g.value),n=i(y.value,b.value);return m.value?{...e,transform:"translate("+t+"px, "+n+"px)",...l(y.value)>=1.5&&{willChange:"transform"}}:{position:w.value,left:t+"px",top:n+"px"}}));let x;function R(){null!=v.value&&null!=y.value&&t.computePosition(v.value,y.value,{middleware:d.value,placement:s.value,strategy:p.value}).then((e=>{g.value=e.x,b.value=e.y,w.value=e.strategy,h.value=e.placement,P.value=e.middlewareData,O.value=!0}))}function D(){"function"==typeof x&&(x(),x=void 0)}return u.watch([d,s,p],R,{flush:"sync"}),u.watch([v,y],(function(){D(),void 0!==f?null==v.value||null==y.value||(x=f(v.value,y.value,R)):R()}),{flush:"sync"}),u.watch(c,(function(){c.value||(O.value=!1)}),{flush:"sync"}),u.getCurrentScope()&&u.onScopeDispose(D),{x:u.shallowReadonly(g),y:u.shallowReadonly(b),strategy:u.shallowReadonly(w),placement:u.shallowReadonly(h),middlewareData:u.shallowReadonly(P),isPositioned:u.shallowReadonly(O),floatingStyles:j,update:R}}})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@floating-ui/dom"),require("@floating-ui/utils/dom"),require("vue-demi")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/dom","@floating-ui/utils/dom","vue-demi"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FloatingUIVue={},e.FloatingUIDOM,e.FloatingUIUtilsDOM,e.VueDemi)}(this,(function(e,t,n,u){"use strict";function o(e){if(function(e){return null!=e&&"object"==typeof e&&"$el"in e}(e)){const t=e.$el;return n.isNode(t)&&"#comment"===n.getNodeName(t)?null:t}return e}function r(e){return"function"==typeof e?e():u.unref(e)}function l(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function i(e,t){const n=l(e);return Math.round(t*n)/n}Object.defineProperty(e,"autoPlacement",{enumerable:!0,get:function(){return t.autoPlacement}}),Object.defineProperty(e,"autoUpdate",{enumerable:!0,get:function(){return t.autoUpdate}}),Object.defineProperty(e,"computePosition",{enumerable:!0,get:function(){return t.computePosition}}),Object.defineProperty(e,"detectOverflow",{enumerable:!0,get:function(){return t.detectOverflow}}),Object.defineProperty(e,"flip",{enumerable:!0,get:function(){return t.flip}}),Object.defineProperty(e,"getOverflowAncestors",{enumerable:!0,get:function(){return t.getOverflowAncestors}}),Object.defineProperty(e,"hide",{enumerable:!0,get:function(){return t.hide}}),Object.defineProperty(e,"inline",{enumerable:!0,get:function(){return t.inline}}),Object.defineProperty(e,"limitShift",{enumerable:!0,get:function(){return t.limitShift}}),Object.defineProperty(e,"offset",{enumerable:!0,get:function(){return t.offset}}),Object.defineProperty(e,"platform",{enumerable:!0,get:function(){return t.platform}}),Object.defineProperty(e,"shift",{enumerable:!0,get:function(){return t.shift}}),Object.defineProperty(e,"size",{enumerable:!0,get:function(){return t.size}}),e.arrow=function(e){return{name:"arrow",options:e,fn(n){const u=o(r(e.element));return null==u?{}:t.arrow({element:u,padding:e.padding}).fn(n)}}},e.useFloating=function(e,n,a){void 0===a&&(a={});const f=a.whileElementsMounted,c=u.computed((()=>{var e;return null==(e=r(a.open))||e})),d=u.computed((()=>r(a.middleware))),s=u.computed((()=>{var e;return null!=(e=r(a.placement))?e:"bottom"})),p=u.computed((()=>{var e;return null!=(e=r(a.strategy))?e:"absolute"})),m=u.computed((()=>{var e;return null==(e=r(a.transform))||e})),v=u.computed((()=>o(e.value))),y=u.computed((()=>o(n.value))),g=u.ref(0),b=u.ref(0),w=u.ref(p.value),h=u.ref(s.value),P=u.shallowRef({}),O=u.ref(!1),j=u.computed((()=>{const e={position:w.value,left:"0",top:"0"};if(!y.value)return e;const t=i(y.value,g.value),n=i(y.value,b.value);return m.value?{...e,transform:"translate("+t+"px, "+n+"px)",...l(y.value)>=1.5&&{willChange:"transform"}}:{position:w.value,left:t+"px",top:n+"px"}}));let x;function R(){if(null==v.value||null==y.value)return;const e=c.value;t.computePosition(v.value,y.value,{middleware:d.value,placement:s.value,strategy:p.value}).then((t=>{g.value=t.x,b.value=t.y,w.value=t.strategy,h.value=t.placement,P.value=t.middlewareData,O.value=!1!==e}))}function D(){"function"==typeof x&&(x(),x=void 0)}return u.watch([d,s,p,c],R,{flush:"sync"}),u.watch([v,y],(function(){D(),void 0!==f?null==v.value||null==y.value||(x=f(v.value,y.value,R)):R()}),{flush:"sync"}),u.watch(c,(function(){c.value||(O.value=!1)}),{flush:"sync"}),u.getCurrentScope()&&u.onScopeDispose(D),{x:u.shallowReadonly(g),y:u.shallowReadonly(b),strategy:u.shallowReadonly(w),placement:u.shallowReadonly(h),middlewareData:u.shallowReadonly(P),isPositioned:u.shallowReadonly(O),floatingStyles:j,update:R}}})); |
{ | ||
"name": "@floating-ui/vue", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "Floating UI for Vue", | ||
@@ -49,3 +49,3 @@ "publishConfig": { | ||
"vue-demi": ">=0.13.0", | ||
"@floating-ui/utils": "^0.2.7" | ||
"@floating-ui/utils": "^0.2.8" | ||
}, | ||
@@ -52,0 +52,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43253
828
Updated@floating-ui/utils@^0.2.8