@skedulo/sked-ui 21.0.0-alpha.2 → 21.0.0-alpha.4

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.
Files changed (2) hide show
  1. package/dist/index.js +10 -18
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6243,8 +6243,7 @@ var InfoWindow = function InfoWindow(props) {
6243
6243
  closeOnOuterClick = _props$closeOnOuterCl === void 0 ? true : _props$closeOnOuterCl,
6244
6244
  containerClassName = props.containerClassName,
6245
6245
  dataAttributes = props.dataAttributes,
6246
- _props$delayShow = props.delayShow,
6247
- delayShow = _props$delayShow === void 0 ? 250 : _props$delayShow,
6246
+ delayShow = props.delayShow,
6248
6247
  className = props.className,
6249
6248
  content = props.content,
6250
6249
  event = props.event,
@@ -6358,8 +6357,8 @@ var PopOut = function PopOut(props) {
6358
6357
  openOnMount: openOnMount
6359
6358
  }),
6360
6359
  visible = _usePopOut.visible,
6361
- openPopOut = _usePopOut.openPopOut,
6362
- closePopOut = _usePopOut.closePopOut;
6360
+ closePopOut = _usePopOut.closePopOut,
6361
+ openPopOut = _usePopOut.openPopOut;
6363
6362
 
6364
6363
  var contentRef = react__WEBPACK_IMPORTED_MODULE_0__["useRef"](null);
6365
6364
  var triggerRef = react__WEBPACK_IMPORTED_MODULE_0__["useRef"](null);
@@ -6371,10 +6370,7 @@ var PopOut = function PopOut(props) {
6371
6370
  return null;
6372
6371
  }, [visible, triggerRef.current]);
6373
6372
 
6374
- var onTriggerClick = function onTriggerClick(e) {
6375
- // stop propagation here since we don't want this interaction to interfere with the document click handler we setup.
6376
- e.stopPropagation();
6377
-
6373
+ var onTriggerClick = function onTriggerClick() {
6378
6374
  if (visible && closeOnFirstClick) {
6379
6375
  closePopOut();
6380
6376
  } else if (!visible) {
@@ -6394,7 +6390,7 @@ var PopOut = function PopOut(props) {
6394
6390
  return;
6395
6391
  }
6396
6392
 
6397
- var pageScrolled = triggerRect.top !== updatedTriggerRect.top || triggerRect.left !== updatedTriggerRect.left; // const pageScrolled = true
6393
+ var pageScrolled = triggerRect.top !== updatedTriggerRect.top || triggerRect.left !== updatedTriggerRect.left;
6398
6394
 
6399
6395
  if (closeOnScroll && pageScrolled) {
6400
6396
  closePopOut();
@@ -10721,18 +10717,14 @@ var usePopOut = function usePopOut(_ref) {
10721
10717
  }
10722
10718
  }, [preventShow]);
10723
10719
  var closePopOut = react__WEBPACK_IMPORTED_MODULE_1__["useCallback"](function () {
10724
- if (isOpen) {
10725
- setIsOpen(false);
10720
+ setIsOpen(false);
10726
10721
 
10727
- if (onClose) {
10728
- onClose();
10729
- }
10722
+ if (isOpen && onClose) {
10723
+ onClose();
10730
10724
  }
10731
- }, [isOpen]);
10725
+ }, [isOpen, onClose]);
10732
10726
  var openPopOut = react__WEBPACK_IMPORTED_MODULE_1__["useCallback"](function () {
10733
- if (!isOpen) {
10734
- setIsOpen(true);
10735
- }
10727
+ setIsOpen(true);
10736
10728
  }, [isOpen]);
10737
10729
  return {
10738
10730
  visible: visible,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skedulo/sked-ui",
3
- "version": "21.0.0-alpha.2",
3
+ "version": "21.0.0-alpha.4",
4
4
  "license": "UNLICENSED",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",