@steroidsjs/bootstrap 2.1.13 → 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.
@@ -18,21 +18,34 @@ var __importStar = (this && this.__importStar) || function (mod) {
18
18
  __setModuleDefault(result, mod);
19
19
  return result;
20
20
  };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
21
24
  exports.__esModule = true;
25
+ var isFunction_1 = __importDefault(require("lodash-es/isFunction"));
22
26
  var React = __importStar(require("react"));
23
27
  var react_use_1 = require("react-use");
24
28
  var hooks_1 = require("@steroidsjs/core/hooks");
25
29
  require("./DropDownView.scss");
30
+ var react_1 = require("react");
26
31
  function DropDownView(props) {
27
32
  var _a;
28
33
  var bem = hooks_1.useBem('DropDownView');
34
+ var ui = hooks_1.useComponents().ui;
29
35
  react_use_1.useMount(function () {
30
36
  props.calculatePosition(props.forwardedRef.current.getBoundingClientRect());
31
37
  });
38
+ var contentProps = react_1.useMemo(function () { return ({
39
+ onClose: props.onClose
40
+ }); }, [props.onClose]);
41
+ var content = props.content();
42
+ if (isFunction_1["default"](content)) {
43
+ content = ui.renderView(content, contentProps);
44
+ }
32
45
  return (React.createElement("div", { ref: props.forwardedRef, className: bem(bem.block((_a = {
33
46
  show: props.isComponentVisible
34
47
  },
35
48
  _a["position-" + props.position] = !!props.position,
36
- _a)), props.className), style: props.style }, props.content()));
49
+ _a)), props.className), style: props.style }, content));
37
50
  }
38
51
  exports["default"] = DropDownView;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/bootstrap",
3
- "version": "2.1.13",
3
+ "version": "2.1.14",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
@@ -19,7 +19,7 @@
19
19
  "dependencies": {
20
20
  "@ckeditor/ckeditor5-react": "^3.0.2",
21
21
  "@steroidsjs/ckeditor5": "^27.0.2-rc.2",
22
- "@steroidsjs/core": "^2.2.40",
22
+ "@steroidsjs/core": "^2.2.44",
23
23
  "bootstrap": "^4.5.2",
24
24
  "lodash": "^4.17.20",
25
25
  "lodash-es": "^4.17.20",