@leafygreen-ui/hooks
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -1,2 +0,2 @@ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"));else if("function"==typeof define&&define.amd)define(["react"],t);else{var n="object"==typeof exports?t(require("react")):t(e.react);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(t,n){t.exports=e},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r=n(11),o="object"==typeof self&&self&&self.Object===Object&&self,u=r||o||Function("return this")();e.exports=u},function(e,t,n){var r=n(2).Symbol;e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useEventListener",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"useElementNode",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"useMutationObserver",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"useViewportSize",{enumerable:!0,get:function(){return i.default}});var r=f(n(5)),o=f(n(6)),u=f(n(7)),i=f(n(8));function f(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.options,u=n.enabled,i=void 0===u||u,f=n.dependencies,c=void 0===f?[i,e]:f,a=n.element,l=void 0===a?document:a,s=(0,r.useRef)(function(){});(0,r.useEffect)(function(){s.current=t},[t]),(0,r.useEffect)(function(){if(i){return l.addEventListener(e,function(e){return s.current(e)},o),function(){l.removeEventListener(e,t,o)}}},c)};var r=n(0)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=(u=(0,r.useState)(null),i=2,function(e){if(Array.isArray(e))return e}(u)||function(e,t){var n=[],r=!0,o=!1,u=void 0;try{for(var i,f=e[Symbol.iterator]();!(r=(i=f.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,u=e}finally{try{r||null==f.return||f.return()}finally{if(o)throw u}}return n}(u,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),t=e[0],n=e[1],o=(0,r.useCallback)(function(e){e&&n(e)},[]);var u,i;return[t,o]};var r=n(0)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],u=(c=(0,r.useState)(),a=2,function(e){if(Array.isArray(e))return e}(c)||function(e,t){var n=[],r=!0,o=!1,u=void 0;try{for(var i,f=e[Symbol.iterator]();!(r=(i=f.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,u=e}finally{try{r||null==f.return||f.return()}finally{if(o)throw u}}return n}(c,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),i=u[0],f=u[1];var c,a;return(0,r.useEffect)(function(){if(o){var r=new MutationObserver(function(){f(n.apply(void 0,arguments))});return e&&r.observe(e,t),function(){return r.disconnect()}}},[e,t,n,o]),i};var r=n(0)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=(r=(0,o.useState)(i),f=2,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var n=[],r=!0,o=!1,u=void 0;try{for(var i,f=e[Symbol.iterator]();!(r=(i=f.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,u=e}finally{try{r||null==f.return||f.return()}finally{if(o)throw u}}return n}(r,f)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),t=e[0],n=e[1];var r,f;return(0,o.useEffect)(function(){var e=(0,u.default)(function(){return n(i())},100);return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]),t};var r,o=n(0),u=(r=n(9))&&r.__esModule?r:{default:r};function i(){return{width:window.innerWidth,height:window.innerHeight}}},function(e,t,n){var r=n(1),o=n(10),u=n(13),i="Expected a function",f=Math.max,c=Math.min;e.exports=function(e,t,n){var a,l,s,d,v,p,y=0,b=!1,m=!1,h=!0;if("function"!=typeof e)throw new TypeError(i);function j(t){var n=a,r=l;return a=l=void 0,y=t,d=e.apply(r,n)}function x(e){var n=e-p;return void 0===p||n>=t||n<0||m&&e-y>=s}function w(){var e=o();if(x(e))return g(e);v=setTimeout(w,function(e){var n=t-(e-p);return m?c(n,s-(e-y)):n}(e))}function g(e){return v=void 0,h&&a?j(e):(a=l=void 0,d)}function O(){var e=o(),n=x(e);if(a=arguments,l=this,p=e,n){if(void 0===v)return function(e){return y=e,v=setTimeout(w,t),b?j(e):d}(p);if(m)return clearTimeout(v),v=setTimeout(w,t),j(p)}return void 0===v&&(v=setTimeout(w,t)),d}return t=u(t)||0,r(n)&&(b=!!n.leading,s=(m="maxWait"in n)?f(u(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h),O.cancel=function(){void 0!==v&&clearTimeout(v),y=0,a=p=l=v=void 0},O.flush=function(){return void 0===v?d:g(o())},O}},function(e,t,n){var r=n(2);e.exports=function(){return r.Date.now()}},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(12))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(1),o=n(14),u=NaN,i=/^\s+|\s+$/g,f=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,a=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return u;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=c.test(e);return n||a.test(e)?l(e.slice(2),n?2:8):f.test(e)?u:+e}},function(e,t,n){var r=n(15),o=n(18),u="[object Symbol]";e.exports=function(e){return"symbol"==typeof e||o(e)&&r(e)==u}},function(e,t,n){var r=n(3),o=n(16),u=n(17),i="[object Null]",f="[object Undefined]",c=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?f:i:c&&c in Object(e)?o(e):u(e)}},function(e,t,n){var r=n(3),o=Object.prototype,u=o.hasOwnProperty,i=o.toString,f=r?r.toStringTag:void 0;e.exports=function(e){var t=u.call(e,f),n=e[f];try{e[f]=void 0;var r=!0}catch(e){}var o=i.call(e);return r&&(t?e[f]=n:delete e[f]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}}])}); | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"));else if("function"==typeof define&&define.amd)define(["react"],t);else{var n="object"==typeof exports?t(require("react")):t(e.react);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(t,n){t.exports=e},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r=n(11),o="object"==typeof self&&self&&self.Object===Object&&self,u=r||o||Function("return this")();e.exports=u},function(e,t,n){var r=n(2).Symbol;e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useEventListener",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"useElementNode",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"useMutationObserver",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"useViewportSize",{enumerable:!0,get:function(){return i.default}});var r=f(n(5)),o=f(n(6)),u=f(n(7)),i=f(n(8));function f(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.options,u=n.enabled,i=void 0===u||u,f=n.dependencies,c=void 0===f?[i,e]:f,a=n.element,l=void 0===a?document:a,s=(0,r.useRef)(function(){});(0,r.useEffect)(function(){s.current=t},[t]),(0,r.useEffect)(function(){if(i){return l.addEventListener(e,function(e){return s.current(e)},o),function(){l.removeEventListener(e,t,o)}}},c)};var r=n(0)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=(u=(0,r.useState)(null),i=2,function(e){if(Array.isArray(e))return e}(u)||function(e,t){var n=[],r=!0,o=!1,u=void 0;try{for(var i,f=e[Symbol.iterator]();!(r=(i=f.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,u=e}finally{try{r||null==f.return||f.return()}finally{if(o)throw u}}return n}(u,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),t=e[0],n=e[1],o=(0,r.useCallback)(function(e){e&&n(e)},[]);var u,i;return[t,o]};var r=n(0)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],u=(c=(0,r.useState)(),a=2,function(e){if(Array.isArray(e))return e}(c)||function(e,t){var n=[],r=!0,o=!1,u=void 0;try{for(var i,f=e[Symbol.iterator]();!(r=(i=f.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,u=e}finally{try{r||null==f.return||f.return()}finally{if(o)throw u}}return n}(c,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),i=u[0],f=u[1];var c,a;return(0,r.useEffect)(function(){if(o){var r=new MutationObserver(function(){f(n.apply(void 0,arguments))});return e&&r.observe(e,t),function(){return r.disconnect()}}},[e,t,n,o]),i};var r=n(0)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=(r=(0,o.useState)(i),f=2,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var n=[],r=!0,o=!1,u=void 0;try{for(var i,f=e[Symbol.iterator]();!(r=(i=f.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,u=e}finally{try{r||null==f.return||f.return()}finally{if(o)throw u}}return n}(r,f)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),t=e[0],n=e[1];var r,f;return(0,o.useEffect)(function(){var e=(0,u.default)(function(){return n(i())},100);return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]),t};var r,o=n(0),u=(r=n(9))&&r.__esModule?r:{default:r};function i(){return{width:window.innerWidth,height:window.innerHeight}}},function(e,t,n){var r=n(1),o=n(10),u=n(13),i="Expected a function",f=Math.max,c=Math.min;e.exports=function(e,t,n){var a,l,s,d,v,p,y=0,b=!1,m=!1,h=!0;if("function"!=typeof e)throw new TypeError(i);function j(t){var n=a,r=l;return a=l=void 0,y=t,d=e.apply(r,n)}function x(e){var n=e-p;return void 0===p||n>=t||n<0||m&&e-y>=s}function w(){var e=o();if(x(e))return g(e);v=setTimeout(w,function(e){var n=t-(e-p);return m?c(n,s-(e-y)):n}(e))}function g(e){return v=void 0,h&&a?j(e):(a=l=void 0,d)}function O(){var e=o(),n=x(e);if(a=arguments,l=this,p=e,n){if(void 0===v)return function(e){return y=e,v=setTimeout(w,t),b?j(e):d}(p);if(m)return v=setTimeout(w,t),j(p)}return void 0===v&&(v=setTimeout(w,t)),d}return t=u(t)||0,r(n)&&(b=!!n.leading,s=(m="maxWait"in n)?f(u(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h),O.cancel=function(){void 0!==v&&clearTimeout(v),y=0,a=p=l=v=void 0},O.flush=function(){return void 0===v?d:g(o())},O}},function(e,t,n){var r=n(2);e.exports=function(){return r.Date.now()}},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(12))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(1),o=n(14),u=NaN,i=/^\s+|\s+$/g,f=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,a=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return u;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=c.test(e);return n||a.test(e)?l(e.slice(2),n?2:8):f.test(e)?u:+e}},function(e,t,n){var r=n(15),o=n(18),u="[object Symbol]";e.exports=function(e){return"symbol"==typeof e||o(e)&&r(e)==u}},function(e,t,n){var r=n(3),o=n(16),u=n(17),i="[object Null]",f="[object Undefined]",c=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?f:i:c&&c in Object(e)?o(e):u(e)}},function(e,t,n){var r=n(3),o=Object.prototype,u=o.hasOwnProperty,i=o.toString,f=r?r.toStringTag:void 0;e.exports=function(e){var t=u.call(e,f),n=e[f];try{e[f]=void 0;var r=!0}catch(e){}var o=i.call(e);return r&&(t?e[f]=n:delete e[f]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}}])}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@leafygreen-ui/hooks", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "LeafyGreen UI Kit Custom Hooks", | ||
@@ -15,3 +15,3 @@ "main": "./dist/index.js", | ||
}, | ||
"gitHead": "90eee26598c1ef0a1a3beea4714f04b84f3c7080" | ||
"gitHead": "39fe4a299b8b0e398443d5b64fb3da32d63081c7" | ||
} |
Sorry, the diff of this file is not supported yet
61161