Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@uifabric/react-hooks

Package Overview
Dependencies
Maintainers
5
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uifabric/react-hooks - npm Package Compare versions

Comparing version 7.9.1 to 7.10.0

15

CHANGELOG.json

@@ -5,2 +5,17 @@ {

{
"date": "Tue, 25 Aug 2020 12:31:34 GMT",
"tag": "@uifabric/react-hooks_v7.10.0",
"version": "7.10.0",
"comments": {
"minor": [
{
"comment": "Adding Document type to useOnEvent element parameter.",
"author": "czearing@outlook.com",
"commit": "89eca359d7534b9bb6d7476cdf92781ea82c3dea",
"package": "@uifabric/react-hooks"
}
]
}
},
{
"date": "Mon, 10 Aug 2020 06:19:21 GMT",

@@ -7,0 +22,0 @@ "tag": "@uifabric/react-hooks_v7.8.0",

11

CHANGELOG.md
# Change Log - @uifabric/react-hooks
This log was last generated on Mon, 10 Aug 2020 06:19:21 GMT and should not be manually modified.
This log was last generated on Tue, 25 Aug 2020 12:31:34 GMT and should not be manually modified.
<!-- Start content -->
## [7.10.0](https://github.com/microsoft/fluentui/tree/@uifabric/react-hooks_v7.10.0)
Tue, 25 Aug 2020 12:31:34 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@uifabric/react-hooks_v7.8.0..@uifabric/react-hooks_v7.10.0)
### Minor changes
- Adding Document type to useOnEvent element parameter. ([PR #14238](https://github.com/microsoft/fluentui/pull/14238) by czearing@outlook.com)
## [7.8.0](https://github.com/microsoft/fluentui/tree/@uifabric/react-hooks_v7.8.0)

@@ -8,0 +17,0 @@

27

dist/react-hooks.api.json

@@ -1102,2 +1102,11 @@ {

"kind": "Content",
"text": " | "
},
{
"kind": "Reference",
"text": "Document",
"canonicalReference": "!Document:interface"
},
{
"kind": "Content",
"text": " | undefined | null"

@@ -1143,4 +1152,4 @@ },

"returnTypeTokenRange": {
"startIndex": 16,
"endIndex": 17
"startIndex": 18,
"endIndex": 19
},

@@ -1154,3 +1163,3 @@ "releaseTag": "Public",

"startIndex": 5,
"endIndex": 9
"endIndex": 11
}

@@ -1161,4 +1170,4 @@ },

"parameterTypeTokenRange": {
"startIndex": 10,
"endIndex": 11
"startIndex": 12,
"endIndex": 13
}

@@ -1169,4 +1178,4 @@ },

"parameterTypeTokenRange": {
"startIndex": 12,
"endIndex": 13
"startIndex": 14,
"endIndex": 15
}

@@ -1177,4 +1186,4 @@ },

"parameterTypeTokenRange": {
"startIndex": 14,
"endIndex": 15
"startIndex": 16,
"endIndex": 17
}

@@ -1181,0 +1190,0 @@ }

@@ -147,3 +147,3 @@ import { Async } from '@uifabric/utilities';

*/
export declare function useOnEvent<TElement extends Element, TEvent extends Event>(element: React.RefObject<TElement | undefined | null> | TElement | Window | undefined | null, eventName: string, callback: (ev: TEvent) => void, useCapture?: boolean): void;
export declare function useOnEvent<TElement extends Element, TEvent extends Event>(element: React.RefObject<TElement | undefined | null> | TElement | Window | Document | undefined | null, eventName: string, callback: (ev: TEvent) => void, useCapture?: boolean): void;

@@ -150,0 +150,0 @@ /**

@@ -1,2 +0,2 @@

var FabricReactHooks=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([function(t,e){t.exports=React},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r={},i=void 0;try{i=window}catch(t){}function o(t,e){if(void 0!==i){var n=i.__packages__=i.__packages__||{};if(!n[t]||!r[t])r[t]=e,(n[t]=n[t]||[]).push(e)}}o("@uifabric/set-version","6.0.0")},,function(t,e,n){"use strict";n.r(e),n.d(e,"useAsync",(function(){return l})),n.d(e,"useBoolean",(function(){return d})),n.d(e,"useConst",(function(){return c})),n.d(e,"useConstCallback",(function(){return f})),n.d(e,"useControllableValue",(function(){return m})),n.d(e,"useForceUpdate",(function(){return _})),n.d(e,"useId",(function(){return S})),n.d(e,"useMergedRefs",(function(){return C})),n.d(e,"useOnEvent",(function(){return N})),n.d(e,"usePrevious",(function(){return j})),n.d(e,"useRefEffect",(function(){return k})),n.d(e,"useSetInterval",(function(){return O})),n.d(e,"useSetTimeout",(function(){return A})),n.d(e,"useWarnings",(function(){return D}));var r=n(1);Object(r.a)("@uifabric/react-hooks","7.9.1");var i=!1;var o=void 0;try{o=window}catch(t){}function s(t){if(!i&&void 0!==o){var e=t;return e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:o}}var u=function(){function t(t,e){this._timeoutIds=null,this._immediateIds=null,this._intervalIds=null,this._animationFrameIds=null,this._isDisposed=!1,this._parent=t||null,this._onErrorHandler=e,this._noop=function(){}}return t.prototype.dispose=function(){var t;if(this._isDisposed=!0,this._parent=null,this._timeoutIds){for(t in this._timeoutIds)this._timeoutIds.hasOwnProperty(t)&&this.clearTimeout(parseInt(t,10));this._timeoutIds=null}if(this._immediateIds){for(t in this._immediateIds)this._immediateIds.hasOwnProperty(t)&&this.clearImmediate(parseInt(t,10));this._immediateIds=null}if(this._intervalIds){for(t in this._intervalIds)this._intervalIds.hasOwnProperty(t)&&this.clearInterval(parseInt(t,10));this._intervalIds=null}if(this._animationFrameIds){for(t in this._animationFrameIds)this._animationFrameIds.hasOwnProperty(t)&&this.cancelAnimationFrame(parseInt(t,10));this._animationFrameIds=null}},t.prototype.setTimeout=function(t,e){var n=this,r=0;return this._isDisposed||(this._timeoutIds||(this._timeoutIds={}),r=setTimeout((function(){try{n._timeoutIds&&delete n._timeoutIds[r],t.apply(n._parent)}catch(t){n._onErrorHandler&&n._onErrorHandler(t)}}),e),this._timeoutIds[r]=!0),r},t.prototype.clearTimeout=function(t){this._timeoutIds&&this._timeoutIds[t]&&(clearTimeout(t),delete this._timeoutIds[t])},t.prototype.setImmediate=function(t,e){var n=this,r=0,i=s(e);if(!this._isDisposed){this._immediateIds||(this._immediateIds={});r=i.setTimeout((function(){try{n._immediateIds&&delete n._immediateIds[r],t.apply(n._parent)}catch(t){n._logError(t)}}),0),this._immediateIds[r]=!0}return r},t.prototype.clearImmediate=function(t,e){var n=s(e);this._immediateIds&&this._immediateIds[t]&&(n.clearTimeout(t),delete this._immediateIds[t])},t.prototype.setInterval=function(t,e){var n=this,r=0;return this._isDisposed||(this._intervalIds||(this._intervalIds={}),r=setInterval((function(){try{t.apply(n._parent)}catch(t){n._logError(t)}}),e),this._intervalIds[r]=!0),r},t.prototype.clearInterval=function(t){this._intervalIds&&this._intervalIds[t]&&(clearInterval(t),delete this._intervalIds[t])},t.prototype.throttle=function(t,e,n){var r=this;if(this._isDisposed)return this._noop;var i,o,s=e||0,u=!0,a=!0,c=0,l=null;n&&"boolean"==typeof n.leading&&(u=n.leading),n&&"boolean"==typeof n.trailing&&(a=n.trailing);var f=function(e){var n=(new Date).getTime(),d=n-c,m=u?s-d:s;return d>=s&&(!e||u)?(c=n,l&&(r.clearTimeout(l),l=null),i=t.apply(r._parent,o)):null===l&&a&&(l=r.setTimeout(f,m)),i};return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o=t,f(!0)}},t.prototype.debounce=function(t,e,n){var r=this;if(this._isDisposed){var i=function(){};return i.cancel=function(){},i.flush=function(){return null},i.pending=function(){return!1},i}var o,s,u=e||0,a=!1,c=!0,l=null,f=0,d=(new Date).getTime(),m=null;n&&"boolean"==typeof n.leading&&(a=n.leading),n&&"boolean"==typeof n.trailing&&(c=n.trailing),n&&"number"==typeof n.maxWait&&!isNaN(n.maxWait)&&(l=n.maxWait);var _=function(t){m&&(r.clearTimeout(m),m=null),d=t},h=function(e){_(e),o=t.apply(r._parent,s)},p=function(t){var e=(new Date).getTime(),n=!1;t&&(a&&e-f>=u&&(n=!0),f=e);var i=e-f,s=u-i,_=e-d,v=!1;return null!==l&&(_>=l&&m?v=!0:s=Math.min(s,l-_)),i>=u||v||n?h(e):null!==m&&t||!c||(m=r.setTimeout(p,s)),o},v=function(){return!!m},y=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return s=t,p(!0)};return y.cancel=function(){v()&&_((new Date).getTime())},y.flush=function(){return v()&&h((new Date).getTime()),o},y.pending=v,y},t.prototype.requestAnimationFrame=function(t,e){var n=this,r=0,i=s(e);if(!this._isDisposed){this._animationFrameIds||(this._animationFrameIds={});var o=function(){try{n._animationFrameIds&&delete n._animationFrameIds[r],t.apply(n._parent)}catch(t){n._logError(t)}};r=i.requestAnimationFrame?i.requestAnimationFrame(o):i.setTimeout(o,0),this._animationFrameIds[r]=!0}return r},t.prototype.cancelAnimationFrame=function(t,e){var n=s(e);this._animationFrameIds&&this._animationFrameIds[t]&&(n.cancelAnimationFrame?n.cancelAnimationFrame(t):n.clearTimeout(t),delete this._animationFrameIds[t])},t.prototype._logError=function(t){this._onErrorHandler&&this._onErrorHandler(t)},t}(),a=n(0);function c(t){var e=a.useRef();return void 0===e.current&&(e.current={value:"function"==typeof t?t():t}),e.current.value}function l(){var t=c((function(){return new u}));return a.useEffect((function(){return function(){return t.dispose()}}),[t]),t}function f(t){var e=a.useRef();return e.current||(e.current=t),e.current}function d(t){var e=a.useState(t),n=e[0],r=e[1],i=a.useRef(n),o=f((function(){r(!0),i.current=!0})),s=f((function(){r(!1),i.current=!1})),u=f((function(){return i.current?s():o()}));return[n,{setTrue:o,setFalse:s,toggle:u}]}function m(t,e,n){var r=a.useState(e),i=r[0],o=r[1],s=c(void 0!==t),u=s?t:i,l=a.useRef(u),d=a.useRef(n);a.useEffect((function(){l.current=u,d.current=n}));var m=f((function(t,e){var n="function"==typeof t?t(l.current):t;d.current&&d.current(e,n),s||o(n)}));return[u,m]}function _(){var t=a.useState(0)[1];return f((function(){return t((function(t){return++t}))}))}
var FabricReactHooks=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([function(t,e){t.exports=React},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r={},i=void 0;try{i=window}catch(t){}function o(t,e){if(void 0!==i){var n=i.__packages__=i.__packages__||{};if(!n[t]||!r[t])r[t]=e,(n[t]=n[t]||[]).push(e)}}o("@uifabric/set-version","6.0.0")},,function(t,e,n){"use strict";n.r(e),n.d(e,"useAsync",(function(){return l})),n.d(e,"useBoolean",(function(){return d})),n.d(e,"useConst",(function(){return c})),n.d(e,"useConstCallback",(function(){return f})),n.d(e,"useControllableValue",(function(){return m})),n.d(e,"useForceUpdate",(function(){return _})),n.d(e,"useId",(function(){return S})),n.d(e,"useMergedRefs",(function(){return C})),n.d(e,"useOnEvent",(function(){return N})),n.d(e,"usePrevious",(function(){return j})),n.d(e,"useRefEffect",(function(){return k})),n.d(e,"useSetInterval",(function(){return O})),n.d(e,"useSetTimeout",(function(){return A})),n.d(e,"useWarnings",(function(){return D}));var r=n(1);Object(r.a)("@uifabric/react-hooks","7.10.0");var i=!1;var o=void 0;try{o=window}catch(t){}function s(t){if(!i&&void 0!==o){var e=t;return e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:o}}var u=function(){function t(t,e){this._timeoutIds=null,this._immediateIds=null,this._intervalIds=null,this._animationFrameIds=null,this._isDisposed=!1,this._parent=t||null,this._onErrorHandler=e,this._noop=function(){}}return t.prototype.dispose=function(){var t;if(this._isDisposed=!0,this._parent=null,this._timeoutIds){for(t in this._timeoutIds)this._timeoutIds.hasOwnProperty(t)&&this.clearTimeout(parseInt(t,10));this._timeoutIds=null}if(this._immediateIds){for(t in this._immediateIds)this._immediateIds.hasOwnProperty(t)&&this.clearImmediate(parseInt(t,10));this._immediateIds=null}if(this._intervalIds){for(t in this._intervalIds)this._intervalIds.hasOwnProperty(t)&&this.clearInterval(parseInt(t,10));this._intervalIds=null}if(this._animationFrameIds){for(t in this._animationFrameIds)this._animationFrameIds.hasOwnProperty(t)&&this.cancelAnimationFrame(parseInt(t,10));this._animationFrameIds=null}},t.prototype.setTimeout=function(t,e){var n=this,r=0;return this._isDisposed||(this._timeoutIds||(this._timeoutIds={}),r=setTimeout((function(){try{n._timeoutIds&&delete n._timeoutIds[r],t.apply(n._parent)}catch(t){n._onErrorHandler&&n._onErrorHandler(t)}}),e),this._timeoutIds[r]=!0),r},t.prototype.clearTimeout=function(t){this._timeoutIds&&this._timeoutIds[t]&&(clearTimeout(t),delete this._timeoutIds[t])},t.prototype.setImmediate=function(t,e){var n=this,r=0,i=s(e);if(!this._isDisposed){this._immediateIds||(this._immediateIds={});r=i.setTimeout((function(){try{n._immediateIds&&delete n._immediateIds[r],t.apply(n._parent)}catch(t){n._logError(t)}}),0),this._immediateIds[r]=!0}return r},t.prototype.clearImmediate=function(t,e){var n=s(e);this._immediateIds&&this._immediateIds[t]&&(n.clearTimeout(t),delete this._immediateIds[t])},t.prototype.setInterval=function(t,e){var n=this,r=0;return this._isDisposed||(this._intervalIds||(this._intervalIds={}),r=setInterval((function(){try{t.apply(n._parent)}catch(t){n._logError(t)}}),e),this._intervalIds[r]=!0),r},t.prototype.clearInterval=function(t){this._intervalIds&&this._intervalIds[t]&&(clearInterval(t),delete this._intervalIds[t])},t.prototype.throttle=function(t,e,n){var r=this;if(this._isDisposed)return this._noop;var i,o,s=e||0,u=!0,a=!0,c=0,l=null;n&&"boolean"==typeof n.leading&&(u=n.leading),n&&"boolean"==typeof n.trailing&&(a=n.trailing);var f=function(e){var n=Date.now(),d=n-c,m=u?s-d:s;return d>=s&&(!e||u)?(c=n,l&&(r.clearTimeout(l),l=null),i=t.apply(r._parent,o)):null===l&&a&&(l=r.setTimeout(f,m)),i};return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o=t,f(!0)}},t.prototype.debounce=function(t,e,n){var r=this;if(this._isDisposed){var i=function(){};return i.cancel=function(){},i.flush=function(){return null},i.pending=function(){return!1},i}var o,s,u=e||0,a=!1,c=!0,l=null,f=0,d=Date.now(),m=null;n&&"boolean"==typeof n.leading&&(a=n.leading),n&&"boolean"==typeof n.trailing&&(c=n.trailing),n&&"number"==typeof n.maxWait&&!isNaN(n.maxWait)&&(l=n.maxWait);var _=function(t){m&&(r.clearTimeout(m),m=null),d=t},h=function(e){_(e),o=t.apply(r._parent,s)},p=function(t){var e=Date.now(),n=!1;t&&(a&&e-f>=u&&(n=!0),f=e);var i=e-f,s=u-i,_=e-d,v=!1;return null!==l&&(_>=l&&m?v=!0:s=Math.min(s,l-_)),i>=u||v||n?h(e):null!==m&&t||!c||(m=r.setTimeout(p,s)),o},v=function(){return!!m},y=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return s=t,p(!0)};return y.cancel=function(){v()&&_(Date.now())},y.flush=function(){return v()&&h(Date.now()),o},y.pending=v,y},t.prototype.requestAnimationFrame=function(t,e){var n=this,r=0,i=s(e);if(!this._isDisposed){this._animationFrameIds||(this._animationFrameIds={});var o=function(){try{n._animationFrameIds&&delete n._animationFrameIds[r],t.apply(n._parent)}catch(t){n._logError(t)}};r=i.requestAnimationFrame?i.requestAnimationFrame(o):i.setTimeout(o,0),this._animationFrameIds[r]=!0}return r},t.prototype.cancelAnimationFrame=function(t,e){var n=s(e);this._animationFrameIds&&this._animationFrameIds[t]&&(n.cancelAnimationFrame?n.cancelAnimationFrame(t):n.clearTimeout(t),delete this._animationFrameIds[t])},t.prototype._logError=function(t){this._onErrorHandler&&this._onErrorHandler(t)},t}(),a=n(0);function c(t){var e=a.useRef();return void 0===e.current&&(e.current={value:"function"==typeof t?t():t}),e.current.value}function l(){var t=c((function(){return new u}));return a.useEffect((function(){return function(){return t.dispose()}}),[t]),t}function f(t){var e=a.useRef();return e.current||(e.current=t),e.current}function d(t){var e=a.useState(t),n=e[0],r=e[1],i=a.useRef(n),o=f((function(){r(!0),i.current=!0})),s=f((function(){r(!1),i.current=!1})),u=f((function(){return i.current?s():o()}));return[n,{setTrue:o,setFalse:s,toggle:u}]}function m(t,e,n){var r=a.useState(e),i=r[0],o=r[1],s=c(void 0!==t),u=s?t:i,l=a.useRef(u),d=a.useRef(n);a.useEffect((function(){l.current=u,d.current=n}));var m=f((function(t,e){var n="function"==typeof t?t(l.current):t;d.current&&d.current(e,n),s||o(n)}));return[u,m]}function _(){var t=a.useState(0)[1];return f((function(){return t((function(t){return++t}))}))}
/*! *****************************************************************************

@@ -15,3 +15,3 @@ Copyright (c) Microsoft Corporation. All rights reserved.

and limitations under the License.
***************************************************************************** */var h=function(){return(h=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function p(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,u=o.length;s<u;s++,i++)r[i]=o[s];return r}var v,y=0,g=1,I=2,b="undefined"!=typeof navigator&&/rv:11.0/.test(navigator.userAgent),T={};try{T=window}catch(t){}var E=function(){function t(t){this._rules=[],this._preservedRules=[],this._rulesToInsert=[],this._counter=0,this._keyToClassName={},this._onResetCallbacks=[],this._classNameToArgs={},this._config=h({injectionMode:g,defaultPrefix:"css",namespace:void 0,cspSettings:void 0},t),this._keyToClassName=this._config.classNameCache||{}}return t.getInstance=function(){var e;if(!(v=T.__stylesheet__)||v._lastStyleElement&&v._lastStyleElement.ownerDocument!==document){var n=(null===(e=T)||void 0===e?void 0:e.FabricConfig)||{};v=T.__stylesheet__=new t(n.mergeStyles)}return v},t.prototype.setConfig=function(t){this._config=h(h({},this._config),t)},t.prototype.onReset=function(t){this._onResetCallbacks.push(t)},t.prototype.getClassName=function(t){var e=this._config.namespace;return(e?e+"-":"")+(t||this._config.defaultPrefix)+"-"+this._counter++},t.prototype.cacheClassName=function(t,e,n,r){this._keyToClassName[e]=t,this._classNameToArgs[t]={args:n,rules:r}},t.prototype.classNameFromKey=function(t){return this._keyToClassName[t]},t.prototype.getClassNameCache=function(){return this._keyToClassName},t.prototype.argsFromClassName=function(t){var e=this._classNameToArgs[t];return e&&e.args},t.prototype.insertedRulesFromClassName=function(t){var e=this._classNameToArgs[t];return e&&e.rules},t.prototype.insertRule=function(t,e){var n=this._config.injectionMode!==y?this._getStyleElement():void 0;if(e&&this._preservedRules.push(t),n)switch(this._config.injectionMode){case g:var r=n.sheet;try{r.insertRule(t,r.cssRules.length)}catch(t){}break;case I:n.appendChild(document.createTextNode(t))}else this._rules.push(t);this._config.onInsertRule&&this._config.onInsertRule(t)},t.prototype.getRules=function(t){return(t?this._preservedRules.join(""):"")+this._rules.join("")+this._rulesToInsert.join("")},t.prototype.reset=function(){this._rules=[],this._rulesToInsert=[],this._counter=0,this._classNameToArgs={},this._keyToClassName={},this._onResetCallbacks.forEach((function(t){return t()}))},t.prototype.resetKeys=function(){this._keyToClassName={}},t.prototype._getStyleElement=function(){var t=this;return this._styleElement||"undefined"==typeof document||(this._styleElement=this._createStyleElement(),b||window.requestAnimationFrame((function(){t._styleElement=void 0}))),this._styleElement},t.prototype._createStyleElement=function(){var t=document.head,e=document.createElement("style");e.setAttribute("data-merge-styles","true");var n=this._config.cspSettings;if(n&&n.nonce&&e.setAttribute("nonce",n.nonce),this._lastStyleElement)t.insertBefore(e,this._lastStyleElement.nextElementSibling);else{var r=this._findPlaceholderStyleTag();r?t.insertBefore(e,r.nextElementSibling):t.insertBefore(e,t.childNodes[0])}return this._lastStyleElement=e,e},t.prototype._findPlaceholderStyleTag=function(){var t=document.head;return t?t.querySelector("style[data-merge-styles]"):null},t}(),R=s()||{};void 0===R.__currentId__&&(R.__currentId__=0);var w=!1;function F(t){void 0===t&&(t=0),R.__currentId__=t}function S(t,e){var n=a.useRef(e);return n.current||(n.current=function(t){if(!w){var e=E.getInstance();e&&e.onReset&&e.onReset(F),w=!0}return(t||"id__")+R.__currentId__++}(t)),n.current}function C(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object(a.useCallback)((function(e){for(var n=0,r=t;n<r.length;n++){var i=r[n];"function"==typeof i?i(e):i&&(i.current=e)}}),p(t))}function N(t,e,n,r){var i=a.useRef(n);i.current=n,a.useEffect((function(){var n=t&&"current"in t?t.current:t;if(n)return function(t,e,n,r){return t.addEventListener(e,n,r),function(){return t.removeEventListener(e,n,r)}}(n,e,(function(t){return i.current(t)}),r)}),[t,e,r])}function j(t){var e=Object(a.useRef)();return Object(a.useEffect)((function(){e.current=t})),e.current}function k(t,e){void 0===e&&(e=null);var n=a.useRef({ref:Object.assign((function(t){n.ref.current!==t&&(n.cleanup&&(n.cleanup(),n.cleanup=void 0),n.ref.current=t,null!==t&&(n.cleanup=n.callback(t)))}),{current:e}),callback:t}).current;return n.callback=t,n.ref}var O=function(){var t=c({});return a.useEffect((function(){return function(){for(var e=0,n=Object.keys(t);e<n.length;e++){var r=n[e];clearInterval(r)}}}),[t]),c({setInterval:function(e,n){var r=setInterval(e,n);return t[r]=1,r},clearInterval:function(e){delete t[e],clearInterval(e)}})},A=function(){var t=c({});return a.useEffect((function(){return function(){for(var e=0,n=Object.keys(t);e<n.length;e++){var r=n[e];clearTimeout(r)}}}),[t]),c({setTimeout:function(e,n){var r=setTimeout(e,n);return t[r]=1,r},clearTimeout:function(e){delete t[e],clearTimeout(e)}})};function D(t){}}]);
***************************************************************************** */var h=function(){return(h=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function p(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,u=o.length;s<u;s++,i++)r[i]=o[s];return r}var v,y=0,I=1,g=2,b="undefined"!=typeof navigator&&/rv:11.0/.test(navigator.userAgent),T={};try{T=window}catch(t){}var E=function(){function t(t){this._rules=[],this._preservedRules=[],this._rulesToInsert=[],this._counter=0,this._keyToClassName={},this._onResetCallbacks=[],this._classNameToArgs={},this._config=h({injectionMode:I,defaultPrefix:"css",namespace:void 0,cspSettings:void 0},t),this._keyToClassName=this._config.classNameCache||{}}return t.getInstance=function(){var e;if(!(v=T.__stylesheet__)||v._lastStyleElement&&v._lastStyleElement.ownerDocument!==document){var n=(null===(e=T)||void 0===e?void 0:e.FabricConfig)||{};v=T.__stylesheet__=new t(n.mergeStyles)}return v},t.prototype.setConfig=function(t){this._config=h(h({},this._config),t)},t.prototype.onReset=function(t){this._onResetCallbacks.push(t)},t.prototype.getClassName=function(t){var e=this._config.namespace;return(e?e+"-":"")+(t||this._config.defaultPrefix)+"-"+this._counter++},t.prototype.cacheClassName=function(t,e,n,r){this._keyToClassName[e]=t,this._classNameToArgs[t]={args:n,rules:r}},t.prototype.classNameFromKey=function(t){return this._keyToClassName[t]},t.prototype.getClassNameCache=function(){return this._keyToClassName},t.prototype.argsFromClassName=function(t){var e=this._classNameToArgs[t];return e&&e.args},t.prototype.insertedRulesFromClassName=function(t){var e=this._classNameToArgs[t];return e&&e.rules},t.prototype.insertRule=function(t,e){var n=this._config.injectionMode!==y?this._getStyleElement():void 0;if(e&&this._preservedRules.push(t),n)switch(this._config.injectionMode){case I:var r=n.sheet;try{r.insertRule(t,r.cssRules.length)}catch(t){}break;case g:n.appendChild(document.createTextNode(t))}else this._rules.push(t);this._config.onInsertRule&&this._config.onInsertRule(t)},t.prototype.getRules=function(t){return(t?this._preservedRules.join(""):"")+this._rules.join("")+this._rulesToInsert.join("")},t.prototype.reset=function(){this._rules=[],this._rulesToInsert=[],this._counter=0,this._classNameToArgs={},this._keyToClassName={},this._onResetCallbacks.forEach((function(t){return t()}))},t.prototype.resetKeys=function(){this._keyToClassName={}},t.prototype._getStyleElement=function(){var t=this;return this._styleElement||"undefined"==typeof document||(this._styleElement=this._createStyleElement(),b||window.requestAnimationFrame((function(){t._styleElement=void 0}))),this._styleElement},t.prototype._createStyleElement=function(){var t=document.head,e=document.createElement("style");e.setAttribute("data-merge-styles","true");var n=this._config.cspSettings;if(n&&n.nonce&&e.setAttribute("nonce",n.nonce),this._lastStyleElement)t.insertBefore(e,this._lastStyleElement.nextElementSibling);else{var r=this._findPlaceholderStyleTag();r?t.insertBefore(e,r.nextElementSibling):t.insertBefore(e,t.childNodes[0])}return this._lastStyleElement=e,e},t.prototype._findPlaceholderStyleTag=function(){var t=document.head;return t?t.querySelector("style[data-merge-styles]"):null},t}(),R=s()||{};void 0===R.__currentId__&&(R.__currentId__=0);var w=!1;function F(t){void 0===t&&(t=0),R.__currentId__=t}function S(t,e){var n=a.useRef(e);return n.current||(n.current=function(t){if(!w){var e=E.getInstance();e&&e.onReset&&e.onReset(F),w=!0}return(t||"id__")+R.__currentId__++}(t)),n.current}function C(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object(a.useCallback)((function(e){for(var n=0,r=t;n<r.length;n++){var i=r[n];"function"==typeof i?i(e):i&&(i.current=e)}}),p(t))}function N(t,e,n,r){var i=a.useRef(n);i.current=n,a.useEffect((function(){var n=t&&"current"in t?t.current:t;if(n)return function(t,e,n,r){return t.addEventListener(e,n,r),function(){return t.removeEventListener(e,n,r)}}(n,e,(function(t){return i.current(t)}),r)}),[t,e,r])}function j(t){var e=Object(a.useRef)();return Object(a.useEffect)((function(){e.current=t})),e.current}function k(t,e){void 0===e&&(e=null);var n=a.useRef({ref:Object.assign((function(t){n.ref.current!==t&&(n.cleanup&&(n.cleanup(),n.cleanup=void 0),n.ref.current=t,null!==t&&(n.cleanup=n.callback(t)))}),{current:e}),callback:t}).current;return n.callback=t,n.ref}var O=function(){var t=c({});return a.useEffect((function(){return function(){for(var e=0,n=Object.keys(t);e<n.length;e++){var r=n[e];clearInterval(r)}}}),[t]),c({setInterval:function(e,n){var r=setInterval(e,n);return t[r]=1,r},clearInterval:function(e){delete t[e],clearInterval(e)}})},A=function(){var t=c({});return a.useEffect((function(){return function(){for(var e=0,n=Object.keys(t);e<n.length;e++){var r=n[e];clearTimeout(r)}}}),[t]),c({setTimeout:function(e,n){var r=setTimeout(e,n);return t[r]=1,r},clearTimeout:function(e){delete t[e],clearTimeout(e)}})};function D(t){}}]);
//# sourceMappingURL=react-hooks.min.js.map

@@ -69,3 +69,3 @@ ## API Report File for "@uifabric/react-hooks"

// @public
export function useOnEvent<TElement extends Element, TEvent extends Event>(element: React.RefObject<TElement | undefined | null> | TElement | Window | undefined | null, eventName: string, callback: (ev: TEvent) => void, useCapture?: boolean): void;
export function useOnEvent<TElement extends Element, TEvent extends Event>(element: React.RefObject<TElement | undefined | null> | TElement | Window | Document | undefined | null, eventName: string, callback: (ev: TEvent) => void, useCapture?: boolean): void;

@@ -72,0 +72,0 @@ // @public

@@ -9,2 +9,2 @@ import * as React from 'react';

*/
export declare function useOnEvent<TElement extends Element, TEvent extends Event>(element: React.RefObject<TElement | undefined | null> | TElement | Window | undefined | null, eventName: string, callback: (ev: TEvent) => void, useCapture?: boolean): void;
export declare function useOnEvent<TElement extends Element, TEvent extends Event>(element: React.RefObject<TElement | undefined | null> | TElement | Window | Document | undefined | null, eventName: string, callback: (ev: TEvent) => void, useCapture?: boolean): void;
define(["require", "exports", "@uifabric/set-version"], function (require, exports, set_version_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
set_version_1.setVersion('@uifabric/react-hooks', '7.9.1');
set_version_1.setVersion('@uifabric/react-hooks', '7.10.0');
});
//# sourceMappingURL=version.js.map

@@ -9,2 +9,2 @@ import * as React from 'react';

*/
export declare function useOnEvent<TElement extends Element, TEvent extends Event>(element: React.RefObject<TElement | undefined | null> | TElement | Window | undefined | null, eventName: string, callback: (ev: TEvent) => void, useCapture?: boolean): void;
export declare function useOnEvent<TElement extends Element, TEvent extends Event>(element: React.RefObject<TElement | undefined | null> | TElement | Window | Document | undefined | null, eventName: string, callback: (ev: TEvent) => void, useCapture?: boolean): void;

@@ -6,3 +6,3 @@ "use strict";

var set_version_1 = require("@uifabric/set-version");
set_version_1.setVersion('@uifabric/react-hooks', '7.9.1');
set_version_1.setVersion('@uifabric/react-hooks', '7.10.0');
//# sourceMappingURL=version.js.map

@@ -9,2 +9,2 @@ import * as React from 'react';

*/
export declare function useOnEvent<TElement extends Element, TEvent extends Event>(element: React.RefObject<TElement | undefined | null> | TElement | Window | undefined | null, eventName: string, callback: (ev: TEvent) => void, useCapture?: boolean): void;
export declare function useOnEvent<TElement extends Element, TEvent extends Event>(element: React.RefObject<TElement | undefined | null> | TElement | Window | Document | undefined | null, eventName: string, callback: (ev: TEvent) => void, useCapture?: boolean): void;
// Do not modify this file; it is generated as part of publish.
// The checked in version is a placeholder only and will not be updated.
import { setVersion } from '@uifabric/set-version';
setVersion('@uifabric/react-hooks', '7.9.1');
setVersion('@uifabric/react-hooks', '7.10.0');
//# sourceMappingURL=version.js.map
{
"name": "@uifabric/react-hooks",
"version": "7.9.1",
"version": "7.10.0",
"description": "Fluent UI React hooks.",

@@ -36,3 +36,3 @@ "main": "lib-commonjs/index.js",

"@uifabric/build": "^7.0.0",
"@uifabric/test-utilities": "^7.1.1",
"@uifabric/test-utilities": "^7.1.2",
"enzyme": "~3.10.0",

@@ -45,3 +45,3 @@ "enzyme-adapter-react-16": "^1.15.0",

"@uifabric/set-version": "^7.0.22",
"@uifabric/utilities": "^7.29.1",
"@uifabric/utilities": "^7.30.0",
"tslib": "^1.10.0"

@@ -48,0 +48,0 @@ },

Sorry, the diff of this file is too big to display

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

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc