@bigbinary/neeto-commons-frontend 2.1.13 → 2.1.15

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/README.md CHANGED
@@ -162,6 +162,7 @@ Web utility functions [↗](./docs/utils/README.md)
162
162
  - [hasAllPermissions](./docs/utils/hasAllPermissions.md)
163
163
  - [createSubscription](./docs/utils/createSubscription.md)
164
164
  - [getFromLocalStorage](./docs/utils/getFromLocalStorage.md)
165
+ - [setToLocalStorage](./docs/utils/setToLocalStorage.md)
165
166
 
166
167
  </td>
167
168
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-commons-frontend",
3
- "version": "2.1.13",
3
+ "version": "2.1.15",
4
4
  "description": "A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.",
5
5
  "repository": "git@github.com:bigbinary/neeto-commons-frontend.git",
6
6
  "author": "Amaljith K <amaljith.k@bigbinary.com>",
@@ -3619,6 +3619,9 @@ var useMutationWithInvalidation = function useMutationWithInvalidation(mutationF
3619
3619
  };
3620
3620
 
3621
3621
  var useOnClickOutside = function useOnClickOutside(ref, handler) {
3622
+ var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
3623
+ _ref$enabled = _ref.enabled,
3624
+ enabled = _ref$enabled === void 0 ? true : _ref$enabled;
3622
3625
  React.useEffect(function () {
3623
3626
  var listener = function listener(event) {
3624
3627
  // Do nothing if clicking ref's element or descendent elements
@@ -3627,13 +3630,15 @@ var useOnClickOutside = function useOnClickOutside(ref, handler) {
3627
3630
  }
3628
3631
  handler(event);
3629
3632
  };
3630
- document.addEventListener("mousedown", listener);
3631
- document.addEventListener("touchstart", listener);
3633
+ if (enabled) {
3634
+ document.addEventListener("mousedown", listener);
3635
+ document.addEventListener("touchstart", listener);
3636
+ }
3632
3637
  return function () {
3633
3638
  document.removeEventListener("mousedown", listener);
3634
3639
  document.removeEventListener("touchstart", listener);
3635
3640
  };
3636
- }, [handler]);
3641
+ }, [handler, enabled]);
3637
3642
  };
3638
3643
 
3639
3644
  var usePrevious = function usePrevious(value) {