@radix-ui/react-popper
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1,2 +0,2 @@ | ||
var e,r,t=require("@radix-ui/utils").getPartDataAttrObj,n=require("@radix-ui/react-arrow").Arrow,o=require("@radix-ui/react-polymorphic").forwardRefWithAs,i=require("@radix-ui/react-utils"),a=i.createContext,l=i.useRect,s=i.useSize,c=i.useComposedRefs,u=require("@radix-ui/popper").getPlacementData,f=(e={},r=require("react"),Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})})),e);function p(){return(p=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function y(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function d(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?y(Object(t),!0).forEach((function(r){b(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):y(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function b(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function O(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function v(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],n=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(n=(a=l.next()).done)&&(t.push(a.value),!r||t.length!==r);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(o)throw i}}return t}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return m(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return m(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var g=v(a("PopperContext","Popper"),2),w=g[0],h=g[1],j=o((function(e,r){var n=e.as,o=void 0===n?"div":n,i=e.children,a=e.anchorRef,y=e.side,b=void 0===y?"bottom":y,m=e.sideOffset,g=e.align,h=void 0===g?"center":g,j=e.alignOffset,P=e.collisionTolerance,A=e.avoidCollisions,S=void 0===A||A,x=O(e,["as","children","anchorRef","side","sideOffset","align","alignOffset","collisionTolerance","avoidCollisions"]),E=v(f.useState(),2),R=E[0],C=E[1],q=l(a),D=f.useRef(null),k=s(D),I=f.useRef(null),T=s(I),z=c(r,D),M=u({anchorRect:q,popperSize:k,arrowSize:T,arrowOffset:R,side:b,sideOffset:m,align:h,alignOffset:j,collisionTolerance:P,shouldAvoidCollisions:S}),N=M.popperStyles,_=M.arrowStyles,U=M.placedSide,W=M.placedAlign,$=void 0!==U,B=f.useMemo((function(){return{arrowRef:I,arrowStyles:_,setArrowOffset:C}}),[_]);return f.createElement("div",{style:N},f.createElement(o,p({},t("Popper"),x,{style:d(d({},x.style),{},{animation:$?void 0:"none"}),ref:z,"data-side":U,"data-align":W}),f.createElement(w.Provider,{value:B},i)))}));exports.Popper=j,j.displayName="Popper";var P=o((function(e,r){var o=e.offset,i=O(e,["offset"]),a=h("PopperArrow"),l=a.arrowRef,s=a.setArrowOffset,c=a.arrowStyles;return f.useEffect((function(){return s(o)}),[s,o]),f.createElement("span",{style:d(d({},c),{},{pointerEvents:"none"})},f.createElement("span",{ref:l,style:{display:"inline-block",verticalAlign:"top",pointerEvents:"auto"}},f.createElement(n,p({},t("PopperArrow"),i,{ref:r,style:d(d({},i.style),{},{display:"block"})}))))}));exports.PopperArrow=P,P.displayName="PopperArrow";var A=j;exports.Root=A;var S=P;exports.Arrow=S; | ||
var e,r,t=require("@radix-ui/utils"),n=t.getSelector,o=t.getSelectorObj,i=t.makeRect,a=require("@radix-ui/react-arrow").Arrow,l=require("@radix-ui/react-primitive").Primitive,c=require("@radix-ui/react-utils"),s=c.createContext,u=c.useRect,f=c.useSize,p=c.useComposedRefs,d=require("@radix-ui/popper").getPlacementData,y=(e={},r=require("react"),Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})})),e);function v(){return(v=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function w(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function b(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?w(Object(t),!0).forEach((function(r){O(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function O(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function m(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function g(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],n=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(n=(a=l.next()).done)&&(t.push(a.value),!r||t.length!==r);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(o)throw i}}return t}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return h(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var j=g(s("PopperContext","Popper"),2),P=j[0],S=j[1],A=y.forwardRef((function(e,r){var t=e.selector,a=void 0===t?n("Popper"):t,c=e.children,s=e.anchorRef,w=e.side,O=void 0===w?"bottom":w,h=e.sideOffset,j=e.align,S=void 0===j?"center":j,A=e.alignOffset,E=e.collisionTolerance,x=e.avoidCollisions,R=void 0===x||x,C=m(e,["selector","children","anchorRef","side","sideOffset","align","alignOffset","collisionTolerance","avoidCollisions"]),k=g(y.useState(),2),q=k[0],T=k[1],z=u(s),D=y.useRef(null),I=f(D),M=y.useRef(null),L=f(M),N=p(r,D),_=function(){var e=g(y.useState(void 0),2),r=e[0],t=e[1];return y.useEffect((function(){var e;function r(){t({width:window.innerWidth,height:window.innerHeight})}function n(){window.clearTimeout(e),e=window.setTimeout(r,100)}return r(),window.addEventListener("resize",n),function(){return window.removeEventListener("resize",n)}}),[]),r}(),B=_?i(_,{x:0,y:0}):void 0,H=d({anchorRect:z,popperSize:I,arrowSize:L,arrowOffset:q,side:O,sideOffset:h,align:S,alignOffset:A,shouldAvoidCollisions:R,collisionBoundariesRect:B,collisionTolerance:E}),U=H.popperStyles,W=H.arrowStyles,$=H.placedSide,F=H.placedAlign,G=void 0!==$,J=y.useMemo((function(){return{arrowRef:M,arrowStyles:W,setArrowOffset:T}}),[W]);return y.createElement("div",v({style:U},a?o(a+"-wrapper"):void 0),y.createElement(l,v({selector:a},C,{style:b(b({},C.style),{},{animation:G?void 0:"none"}),ref:N,"data-side":$,"data-align":F}),y.createElement(P.Provider,{value:J},c)))}));exports.Popper=A,A.displayName="Popper";var E=y.forwardRef((function(e,r){var t=e.offset,o=m(e,["offset"]),i=S("PopperArrow"),l=i.arrowRef,c=i.setArrowOffset,s=i.arrowStyles;return y.useEffect((function(){return c(t)}),[c,t]),y.createElement("span",{style:b(b({},s),{},{pointerEvents:"none"})},y.createElement("span",{ref:l,style:{display:"inline-block",verticalAlign:"top",pointerEvents:"auto"}},y.createElement(a,v({selector:n("PopperArrow")},o,{ref:r,style:b(b({},o.style),{},{display:"block"})}))))}));exports.PopperArrow=E,E.displayName="PopperArrow";var x=A;exports.Root=x;var R=E;exports.Arrow=R; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{getPartDataAttrObj as e}from"@radix-ui/utils";import{Arrow as r}from"@radix-ui/react-arrow";import{forwardRefWithAs as t}from"@radix-ui/react-polymorphic";import{createContext as o,useRect as n,useSize as i,useComposedRefs as l}from"@radix-ui/react-utils";import{getPlacementData as a}from"@radix-ui/popper";import*as s from"react";function p(){return(p=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e}).apply(this,arguments)}function c(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function f(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?c(Object(t),!0).forEach((function(r){u(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function u(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function y(e,r){if(null==e)return{};var t,o,n=function(e,r){if(null==e)return{};var t,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)t=i[o],r.indexOf(t)>=0||(n[t]=e[t]);return n}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)t=i[o],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}const[O,d]=o("PopperContext","Popper"),m="div";export const Popper=t(((r,t)=>{const{as:o=m,children:c,anchorRef:u,side:d="bottom",sideOffset:b,align:w="center",alignOffset:P,collisionTolerance:g,avoidCollisions:v=!0}=r,j=y(r,["as","children","anchorRef","side","sideOffset","align","alignOffset","collisionTolerance","avoidCollisions"]),[h,A]=s.useState(),x=n(u),E=s.useRef(null),S=i(E),R=s.useRef(null),k=i(R),C=l(t,E),{popperStyles:D,arrowStyles:T,placedSide:z,placedAlign:N}=a({anchorRect:x,popperSize:S,arrowSize:k,arrowOffset:h,side:d,sideOffset:b,align:w,alignOffset:P,collisionTolerance:g,shouldAvoidCollisions:v}),I=void 0!==z,M=s.useMemo((()=>({arrowRef:R,arrowStyles:T,setArrowOffset:A})),[T]);return s.createElement("div",{style:D},s.createElement(o,p({},e("Popper"),j,{style:f(f({},j.style),{},{animation:I?void 0:"none"}),ref:C,"data-side":z,"data-align":N}),s.createElement(O.Provider,{value:M},c)))}));Popper.displayName="Popper";export const PopperArrow=t((function(t,o){const{offset:n}=t,i=y(t,["offset"]),{arrowRef:l,setArrowOffset:a,arrowStyles:c}=d("PopperArrow");return s.useEffect((()=>a(n)),[a,n]),s.createElement("span",{style:f(f({},c),{},{pointerEvents:"none"})},s.createElement("span",{ref:l,style:{display:"inline-block",verticalAlign:"top",pointerEvents:"auto"}},s.createElement(r,p({},e("PopperArrow"),i,{ref:o,style:f(f({},i.style),{},{display:"block"})}))))}));PopperArrow.displayName="PopperArrow";export const Root=Popper;export const Arrow=PopperArrow; | ||
import{getSelector as e,getSelectorObj as r,makeRect as t}from"@radix-ui/utils";import{Arrow as o}from"@radix-ui/react-arrow";import{Primitive as n}from"@radix-ui/react-primitive";import{createContext as i,useRect as s,useSize as l,useComposedRefs as a}from"@radix-ui/react-utils";import{getPlacementData as c}from"@radix-ui/popper";import*as p from"react";function f(){return(f=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e}).apply(this,arguments)}function u(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function d(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?u(Object(t),!0).forEach((function(r){w(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):u(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function w(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function y(e,r){if(null==e)return{};var t,o,n=function(e,r){if(null==e)return{};var t,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)t=i[o],r.indexOf(t)>=0||(n[t]=e[t]);return n}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)t=i[o],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}const[O,m]=i("PopperContext","Popper"),b="Popper";export const Popper=p.forwardRef(((o,i)=>{const{selector:u=e(b),children:w,anchorRef:m,side:v="bottom",sideOffset:g,align:P="center",alignOffset:h,collisionTolerance:j,avoidCollisions:E=!0}=o,x=y(o,["selector","children","anchorRef","side","sideOffset","align","alignOffset","collisionTolerance","avoidCollisions"]),[A,S]=p.useState(),R=s(m),T=p.useRef(null),k=l(T),z=p.useRef(null),C=l(z),D=a(i,T),L=function(){const[e,r]=p.useState(void 0);return p.useEffect((()=>{let e;function t(){r({width:window.innerWidth,height:window.innerHeight})}function o(){window.clearTimeout(e),e=window.setTimeout(t,100)}return t(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)}),[]),e}(),N=L?t(L,{x:0,y:0}):void 0,{popperStyles:B,arrowStyles:H,placedSide:I,placedAlign:M}=c({anchorRect:R,popperSize:k,arrowSize:C,arrowOffset:A,side:v,sideOffset:g,align:P,alignOffset:h,shouldAvoidCollisions:E,collisionBoundariesRect:N,collisionTolerance:j}),W=void 0!==I,q=p.useMemo((()=>({arrowRef:z,arrowStyles:H,setArrowOffset:S})),[H]);return p.createElement("div",f({style:B},u?r(u+"-wrapper"):void 0),p.createElement(n,f({selector:u},x,{style:d(d({},x.style),{},{animation:W?void 0:"none"}),ref:D,"data-side":I,"data-align":M}),p.createElement(O.Provider,{value:q},w)))}));Popper.displayName=b;export const PopperArrow=p.forwardRef((function(r,t){const{offset:n}=r,i=y(r,["offset"]),{arrowRef:s,setArrowOffset:l,arrowStyles:a}=m("PopperArrow");return p.useEffect((()=>l(n)),[l,n]),p.createElement("span",{style:d(d({},a),{},{pointerEvents:"none"})},p.createElement("span",{ref:s,style:{display:"inline-block",verticalAlign:"top",pointerEvents:"auto"}},p.createElement(o,f({selector:e("PopperArrow")},i,{ref:t,style:d(d({},i.style),{},{display:"block"})}))))}));PopperArrow.displayName="PopperArrow";export const Root=Popper;export const Arrow=PopperArrow; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-popper", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"license": "MIT", | ||
@@ -21,11 +21,9 @@ "source": "src/index.ts", | ||
"dependencies": { | ||
"@radix-ui/popper": "0.0.1", | ||
"@radix-ui/react-arrow": "0.0.1", | ||
"@radix-ui/react-polymorphic": "0.0.1", | ||
"@radix-ui/react-utils": "0.0.1", | ||
"@radix-ui/utils": "0.0.1" | ||
"@radix-ui/popper": "0.0.2", | ||
"@radix-ui/react-arrow": "0.0.2", | ||
"@radix-ui/react-polymorphic": "0.0.2", | ||
"@radix-ui/react-primitive": "0.0.1", | ||
"@radix-ui/react-utils": "0.0.2", | ||
"@radix-ui/utils": "0.0.2" | ||
}, | ||
"devDependencies": { | ||
"parcel": "^2.0.0-beta.1" | ||
}, | ||
"peerDependencies": { | ||
@@ -32,0 +30,0 @@ "react": "^16.8 || ^17.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
33141
0
54
7
+ Added@radix-ui/popper@0.0.2(transitive)
+ Added@radix-ui/react-arrow@0.0.2(transitive)
+ Added@radix-ui/react-polymorphic@0.0.2(transitive)
+ Added@radix-ui/react-primitive@0.0.1(transitive)
+ Added@radix-ui/react-utils@0.0.2(transitive)
+ Added@radix-ui/utils@0.0.2(transitive)
- Removed@radix-ui/popper@0.0.1(transitive)
- Removed@radix-ui/react-arrow@0.0.1(transitive)
- Removed@radix-ui/react-polymorphic@0.0.1(transitive)
- Removed@radix-ui/react-utils@0.0.1(transitive)
- Removed@radix-ui/utils@0.0.1(transitive)
Updated@radix-ui/popper@0.0.2
Updated@radix-ui/react-arrow@0.0.2
Updated@radix-ui/react-utils@0.0.2
Updated@radix-ui/utils@0.0.2