@bigbinary/neeto-commons-frontend 2.1.12 → 2.1.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-commons-frontend",
3
- "version": "2.1.12",
3
+ "version": "2.1.14",
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) {
@@ -6310,7 +6315,10 @@ var isMetaKeyPressed = function isMetaKeyPressed(event) {
6310
6315
  return !!(event !== null && event !== void 0 && event.ctrlKey || event !== null && event !== void 0 && event.metaKey);
6311
6316
  };
6312
6317
 
6313
- var withT = reactI18next.withTranslation();
6318
+ var withT = function withT(Component, options) {
6319
+ var namespace = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
6320
+ return reactI18next.withTranslation(namespace, options)(Component);
6321
+ };
6314
6322
 
6315
6323
  var withTitle = function withTitle(Component) {
6316
6324
  var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;