@steroidsjs/core 2.2.52 → 2.2.53

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": "@steroidsjs/core",
3
- "version": "2.2.52",
3
+ "version": "2.2.53",
4
4
  "description": "",
5
5
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
6
6
  "repository": {
@@ -39,6 +39,7 @@ declare namespace DropDown {
39
39
  defaultVisible: boolean;
40
40
  gap: number;
41
41
  position: string;
42
+ closeMode: string;
42
43
  };
43
44
  }
44
45
  export default DropDown;
@@ -46,13 +46,15 @@ function DropDown(props) {
46
46
  onHide();
47
47
  }
48
48
  }
49
- });
49
+ }, ['mousedown', 'touchstart']);
50
50
  // Any click -> close
51
- react_use_1.useEvent('click', react_1.useCallback(function () {
51
+ var onAnyClick = react_1.useCallback(function () {
52
52
  if (isComponentExist && isComponentVisible && props.closeMode === 'click-any') {
53
53
  onHide();
54
54
  }
55
- }, [isComponentExist, isComponentVisible, onHide, props.closeMode]));
55
+ }, [isComponentExist, isComponentVisible, onHide, props.closeMode]);
56
+ react_use_1.useEvent('mousedown', onAnyClick);
57
+ react_use_1.useEvent('touchstart', onAnyClick);
56
58
  var calculatePosition = react_1.useCallback(function (componentSize) {
57
59
  calculateAbsolutePosition(position, childRef.current, componentSize);
58
60
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -83,6 +85,7 @@ DropDown.defaultProps = {
83
85
  componentDestroyDelay: 300,
84
86
  defaultVisible: false,
85
87
  gap: 15,
86
- position: 'bottom'
88
+ position: 'bottom',
89
+ closeMode: 'click-away'
87
90
  };
88
91
  exports["default"] = DropDown;