td-stylekit 25.7.0 → 25.7.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [25.7.1](https://github.com/treasure-data/td-stylekit/compare/v25.7.0...v25.7.1) (2022-03-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Correctly set onClickOutside prop internally ([#1238](https://github.com/treasure-data/td-stylekit/issues/1238)) ([02f672c](https://github.com/treasure-data/td-stylekit/commit/02f672c))
7
+
1
8
  # [25.7.0](https://github.com/treasure-data/td-stylekit/compare/v25.6.0...v25.7.0) (2022-02-23)
2
9
 
3
10
 
@@ -12,8 +12,9 @@ export declare type TooltipPopoverProps = {
12
12
  show?: boolean;
13
13
  target: DOMContainer;
14
14
  escClose?: boolean;
15
+ overrideOnClickOutside?: () => void;
15
16
  } & Omit<TippyProps, // https://atomiks.github.io/tippyjs/v6/all-props/
16
- 'allowHTML' | 'arrow' | 'animateFill' | 'content' | 'inlinePositioning' | 'onHide' | 'placement' | 'plugins' | 'reference' | 'singleton' | 'visible' | 'render'>;
17
+ 'allowHTML' | 'arrow' | 'animateFill' | 'content' | 'inlinePositioning' | 'onClickOutside' | 'onHide' | 'placement' | 'plugins' | 'reference' | 'singleton' | 'visible' | 'render'>;
17
18
  /**
18
19
  * A popover handler built on Tippy.js.
19
20
  * Compose with the Popover wrapper for popover content.
@@ -17,7 +17,7 @@ var _Modal = _interopRequireDefault(require("../Modal"));
17
17
 
18
18
  var _useWaitForDOMRef = require("./useWaitForDOMRef");
19
19
 
20
- var _excluded = ["data-instrumentation", "arrowHidden", "children", "hideOnClick", "interactive", "onHide", "onClickOutside", "show", "showOnCreate", "target", "trigger", "escClose"];
20
+ var _excluded = ["data-instrumentation", "arrowHidden", "children", "hideOnClick", "interactive", "onHide", "overrideOnClickOutside", "show", "showOnCreate", "target", "trigger", "escClose"];
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
23
 
@@ -74,7 +74,7 @@ var TooltipPopover = function TooltipPopover(props) {
74
74
  _props$interactive = props.interactive,
75
75
  interactive = _props$interactive === void 0 ? true : _props$interactive,
76
76
  onHide = props.onHide,
77
- onClickOutside = props.onClickOutside,
77
+ overrideOnClickOutside = props.overrideOnClickOutside,
78
78
  show = props.show,
79
79
  showOnCreate = props.showOnCreate,
80
80
  target = props.target,
@@ -84,7 +84,8 @@ var TooltipPopover = function TooltipPopover(props) {
84
84
  otherProps = _objectWithoutProperties(props, _excluded);
85
85
 
86
86
  var triggerTarget = (0, _useWaitForDOMRef.useWaitForDOMRef)(target);
87
- var tooltipRef = (0, _react.useRef)(null); // If escClose === true, then add an event listener on the document do close popover
87
+ var tooltipRef = (0, _react.useRef)(null);
88
+ var onClickOutsideBehaviour = overrideOnClickOutside || (!(show === undefined && trigger) ? onHide : undefined); // If escClose === true, then add an event listener on the document do close popover
88
89
 
89
90
  (0, _react.useEffect)(function () {
90
91
  var handleEsc = function handleEsc(e) {
@@ -140,7 +141,7 @@ var TooltipPopover = function TooltipPopover(props) {
140
141
  return setMounted(false);
141
142
  },
142
143
  reference: triggerTarget,
143
- onClickOutside: onClickOutside
144
+ onClickOutside: onClickOutsideBehaviour
144
145
  /** Tippy is very strict about the rules of what props are allowed.
145
146
  * An instrumentation plugin adds in `data-gs-c` and `data-gs`.
146
147
  * By defining as tippy plugins we can make these props acceptable. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "td-stylekit",
3
- "version": "25.7.0",
3
+ "version": "25.7.1",
4
4
  "main": "dist/es/index.js",
5
5
  "module": "dist/es/index.js",
6
6
  "types": "dist/es/index.d.ts",