superdesk-ui-framework 4.0.77 → 4.0.79

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.
@@ -33,6 +33,7 @@ interface IPropsButton {
33
33
  disabled?: boolean;
34
34
  iconOnly?: boolean;
35
35
  noMargin?: boolean;
36
+ ariaLabel?: string;
36
37
  'data-test-id'?: string;
37
38
  }
38
39
 
@@ -65,7 +66,7 @@ export class Button extends React.PureComponent<IPropsButton> {
65
66
  disabled={this.props.disabled || this.props.isLoading}
66
67
  data-loading={this.props.isLoading}
67
68
  onClick={this.props.disabled ? () => false : (event) => this.props.onClick(event)}
68
- aria-label={this.props.iconOnly ? this.props.text : ''}
69
+ aria-label={this.props.ariaLabel ?? (this.props.iconOnly ? this.props.text : undefined)}
69
70
  data-test-id={this.props['data-test-id']}
70
71
  style={this.props.noMargin ? {margin: 0} : undefined}
71
72
  >
@@ -9,6 +9,7 @@ interface IPropsPopupPositioner {
9
9
  getReferenceElement(): HTMLElement;
10
10
  placement: Placement;
11
11
  onClose(): void;
12
+ shouldCloseOnClick?: (event: MouseEvent) => boolean;
12
13
  closeOnHoverEnd?: boolean;
13
14
  'data-test-id'?: string;
14
15
  }
@@ -35,6 +36,10 @@ export class PopupPositioner extends React.PureComponent<IPropsPopupPositioner>
35
36
  return;
36
37
  }
37
38
 
39
+ if (this.props.shouldCloseOnClick != null && this.props.shouldCloseOnClick(event) === false) {
40
+ return;
41
+ }
42
+
38
43
  if (
39
44
  this.props.getReferenceElement().contains(event.target as Node) !== true &&
40
45
  this.wrapperEl.contains(event.target as Node) !== true
@@ -191,6 +196,7 @@ export function showPopup(
191
196
  Component: React.ComponentType<{closePopup(): void}>,
192
197
  closeOnHoverEnd?: boolean,
193
198
  onClose?: () => void,
199
+ shouldCloseOnClick?: (event: MouseEvent) => boolean,
194
200
  ): {close: () => void} {
195
201
  const el = document.createElement('div');
196
202
 
@@ -207,6 +213,7 @@ export function showPopup(
207
213
  getReferenceElement={() => referenceElement}
208
214
  placement={placement}
209
215
  onClose={closeFn}
216
+ shouldCloseOnClick={shouldCloseOnClick}
210
217
  closeOnHoverEnd={closeOnHoverEnd || false}
211
218
  >
212
219
  <Component closePopup={closeFn} />
@@ -8,6 +8,7 @@ export interface IPropsWithPopover {
8
8
  component: React.ComponentType<{closePopup(): void}>;
9
9
  closeOnHoverEnd?: boolean;
10
10
  onClose?: () => void;
11
+ shouldCloseOnClick?(event: MouseEvent): boolean;
11
12
  }
12
13
 
13
14
  /**
@@ -37,6 +38,7 @@ export class WithPopover extends React.PureComponent<IPropsWithPopover> {
37
38
  this.closePopup = undefined;
38
39
  this.props.onClose?.();
39
40
  },
41
+ this.props.shouldCloseOnClick,
40
42
  ).close;
41
43
  }
42
44
  }
@@ -27468,8 +27468,9 @@ var Button = /** @class */ (function (_super) {
27468
27468
  _a['sd-flex-justify-end'] = this.props.textAlign === 'end',
27469
27469
  _a));
27470
27470
  return (React.createElement(TooltipWrapper, { tooltipText: this.props.tooltip }, function (_a) {
27471
+ var _b;
27471
27472
  var attributes = _a.attributes;
27472
- return (React.createElement("button", __assign({}, attributes, { id: _this.props.id, className: classes, tabIndex: 0, disabled: _this.props.disabled || _this.props.isLoading, "data-loading": _this.props.isLoading, onClick: _this.props.disabled ? function () { return false; } : function (event) { return _this.props.onClick(event); }, "aria-label": _this.props.iconOnly ? _this.props.text : '', "data-test-id": _this.props['data-test-id'], style: _this.props.noMargin ? { margin: 0 } : undefined }),
27473
+ return (React.createElement("button", __assign({}, attributes, { id: _this.props.id, className: classes, tabIndex: 0, disabled: _this.props.disabled || _this.props.isLoading, "data-loading": _this.props.isLoading, onClick: _this.props.disabled ? function () { return false; } : function (event) { return _this.props.onClick(event); }, "aria-label": (_b = _this.props.ariaLabel) !== null && _b !== void 0 ? _b : (_this.props.iconOnly ? _this.props.text : undefined), "data-test-id": _this.props['data-test-id'], style: _this.props.noMargin ? { margin: 0 } : undefined }),
27473
27474
  _this.props.isLoading ? React.createElement(Spinner_1.Spinner, { size: "mini" }) : null,
27474
27475
  _this.props.icon && !_this.props.isLoading ? React.createElement(Icon_1.Icon, { ariaHidden: true, name: _this.props.icon }) : null,
27475
27476
  _this.props.iconOnly ? null : _this.props.text));
@@ -60158,6 +60159,9 @@ var PopupPositioner = /** @class */ (function (_super) {
60158
60159
  if (this.wrapperEl == null) {
60159
60160
  return;
60160
60161
  }
60162
+ if (this.props.shouldCloseOnClick != null && this.props.shouldCloseOnClick(event) === false) {
60163
+ return;
60164
+ }
60161
60165
  if (this.props.getReferenceElement().contains(event.target) !== true &&
60162
60166
  this.wrapperEl.contains(event.target) !== true) {
60163
60167
  this.props.onClose();
@@ -60281,7 +60285,7 @@ exports.PopupPositioner = PopupPositioner;
60281
60285
  /**
60282
60286
  * The popup will remove itself if click/scroll events are detected outside the popup.
60283
60287
  */
60284
- function showPopup(referenceElement, placement, Component, closeOnHoverEnd, onClose) {
60288
+ function showPopup(referenceElement, placement, Component, closeOnHoverEnd, onClose, shouldCloseOnClick) {
60285
60289
  var el = document.createElement('div');
60286
60290
  document.body.appendChild(el);
60287
60291
  var closeFn = function () {
@@ -60289,7 +60293,7 @@ function showPopup(referenceElement, placement, Component, closeOnHoverEnd, onCl
60289
60293
  el.remove();
60290
60294
  onClose === null || onClose === void 0 ? void 0 : onClose();
60291
60295
  };
60292
- react_dom_1.default.render(React.createElement(PopupPositioner, { getReferenceElement: function () { return referenceElement; }, placement: placement, onClose: closeFn, closeOnHoverEnd: closeOnHoverEnd || false },
60296
+ react_dom_1.default.render(React.createElement(PopupPositioner, { getReferenceElement: function () { return referenceElement; }, placement: placement, onClose: closeFn, shouldCloseOnClick: shouldCloseOnClick, closeOnHoverEnd: closeOnHoverEnd || false },
60293
60297
  React.createElement(Component, { closePopup: closeFn })), el);
60294
60298
  return { close: closeFn };
60295
60299
  }
@@ -70614,7 +70618,7 @@ var WithPopover = /** @class */ (function (_super) {
70614
70618
  var _a, _b;
70615
70619
  _this.closePopup = undefined;
70616
70620
  (_b = (_a = _this.props).onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
70617
- }).close;
70621
+ }, this.props.shouldCloseOnClick).close;
70618
70622
  }
70619
70623
  };
70620
70624
  WithPopover.prototype.render = function () {
@@ -195159,7 +195163,7 @@ exports.ThreePaneLayoutPattern = ThreePaneLayoutPattern;
195159
195163
  /* 1049 */
195160
195164
  /***/ (function(module, exports) {
195161
195165
 
195162
- module.exports = {"name":"superdesk-ui-framework","version":"4.0.77","license":"AGPL-3.0","repository":{"type":"git","url":"https://github.com/superdesk/superdesk-ui-framework.git"},"main":"dist/superdesk-ui.bundle.js","types":"react/index.d.ts","contributors":["Nemanja Pavlovic","Vladimir Stefanovic","Darko Tomic","Aleksandar Jelicic","Tomas Kikutis","Dragana Zivkovic"],"scripts":{"start":"webpack-dev-server --config tasks/webpack.dev.js","server":"webpack --watch --config tasks/webpack.prod.js && tsc-watch","build":"tsc -p tsconfig.json --noEmit && webpack --config tasks/webpack.prod.js && tsc","build-ui":"webpack && tsc && npm run lint","playground-lint":"tsc -p examples/pages/playgrounds/react-playgrounds --noEmit","format-code":"npx prettier . --write","lint":"tsc -p tsconfig.json --noEmit && npx prettier . --check && eslint --parser=@typescript-eslint/parser app && tslint -c tslint.json 'app-typescript/**/*.{ts,tsx}' && npm run playground-lint && npm run unit-test","lint-fix":"tsc -p tsconfig.json --noEmit && tslint --fix -c tslint.json 'app-typescript/**/*.{ts,tsx}'","prepublishOnly":"npm run build","unit-test":"mocha","debug-unit-tests":"mocha --inspect-brk"},"devDependencies":{"@types/assert":"^1.5.6","@types/chart.js":"^2.9.24","@types/classnames":"^2.2.9","@types/enzyme":"^3.10.12","@types/enzyme-adapter-react-16":"^1.0.6","@types/lodash":"^4.14.161","@types/mocha":"^9.1.1","@types/react":"16.8.23","@types/react-beautiful-dnd":"^13.1.2","@types/react-dom":"16.8.0","@types/react-router-dom":"^5.1.2","@types/react-scrollspy":"^3.3.5","@typescript-eslint/parser":"^5.58.0","angular":"^1.7.9","angular-animate":"^1.7.9","angular-route":"^1.7.9","classnames":"^2.2.5","clean-webpack-plugin":"^1.0.0","code-prettify":"^0.1.0","copy-webpack-plugin":"^4.6.0","css-loader":"^2.1.1","enzyme":"^3.11.0","enzyme-adapter-react-16":"^1.15.7","eslint":"^4.6.1","eslint-loader":"^1.9.0","eslint-plugin-angular":"^3.1.1","eslint-plugin-react":"^7.3.0","extract-text-webpack-plugin":"^3.0.2","file-loader":"^0.11.2","html-loader":"^0.5.1","html-webpack-plugin":"^2.30.1","jquery":"^3.1.1","jquery-ui":"^1.12.1","jsdom":"20.0.3","jsdom-global":"3.0.2","lodash":"4.17.21","mocha":"^8.4.0","moment":"^2.29.3","node-sass":"6.0","prettier":"3.5.3","prismjs":"^1.28.0","prop-types":"^15.6.0","react":"16.8.6","react-dom":"16.8.6","react-redux":"^5.0.6","react-router-dom":"^5.1.2","redux":"^3.7.2","redux-form":"^7.0.4","sass-loader":"^6.0.6","style-loader":"^0.18.2","superdesk-code-style":"^1.1.2","ts-loader":"^6.0.2","ts-node":"^10.9.1","tslint":"^5.18.0","typescript":"^5.8.3","url-loader":"^1.1.2","webpack":"^3.5.5","webpack-cli":"3.3.10","webpack-dev-server":"2.11.1","webpack-merge":"^4.2.1"},"dependencies":{"@popperjs/core":"^2.4.0","@sourcefabric/common":"0.0.66","@superdesk/primereact":"^5.0.2-13","@superdesk/react-resizable-panels":"0.0.39","chart.js":"^2.9.3","date-fns":"^4.1.0","popper-max-size-modifier":"^0.2.0","popper.js":"1.14.4","primeicons":"2.0.0","react-beautiful-dnd":"^13.0.0","react-id-generator":"^3.0.0","react-scrollspy":"^3.4.3","tippy.js":"^6.3.7","weekstart":"^2.0.0"},"peerDependencies":{"moment":"*"},"volta":{"node":"14.21.3"}}
195166
+ module.exports = {"name":"superdesk-ui-framework","version":"4.0.79","license":"AGPL-3.0","repository":{"type":"git","url":"https://github.com/superdesk/superdesk-ui-framework.git"},"main":"dist/superdesk-ui.bundle.js","types":"react/index.d.ts","contributors":["Nemanja Pavlovic","Vladimir Stefanovic","Darko Tomic","Aleksandar Jelicic","Tomas Kikutis","Dragana Zivkovic"],"scripts":{"start":"webpack-dev-server --config tasks/webpack.dev.js","server":"webpack --watch --config tasks/webpack.prod.js && tsc-watch","build":"tsc -p tsconfig.json --noEmit && webpack --config tasks/webpack.prod.js && tsc","build-ui":"webpack && tsc && npm run lint","playground-lint":"tsc -p examples/pages/playgrounds/react-playgrounds --noEmit","format-code":"npx prettier . --write","lint":"tsc -p tsconfig.json --noEmit && npx prettier . --check && eslint --parser=@typescript-eslint/parser app && tslint -c tslint.json 'app-typescript/**/*.{ts,tsx}' && npm run playground-lint && npm run unit-test","lint-fix":"tsc -p tsconfig.json --noEmit && tslint --fix -c tslint.json 'app-typescript/**/*.{ts,tsx}'","prepublishOnly":"npm run build","unit-test":"mocha","debug-unit-tests":"mocha --inspect-brk"},"devDependencies":{"@types/assert":"^1.5.6","@types/chart.js":"^2.9.24","@types/classnames":"^2.2.9","@types/enzyme":"^3.10.12","@types/enzyme-adapter-react-16":"^1.0.6","@types/lodash":"^4.14.161","@types/mocha":"^9.1.1","@types/react":"16.8.23","@types/react-beautiful-dnd":"^13.1.2","@types/react-dom":"16.8.0","@types/react-router-dom":"^5.1.2","@types/react-scrollspy":"^3.3.5","@typescript-eslint/parser":"^5.58.0","angular":"^1.7.9","angular-animate":"^1.7.9","angular-route":"^1.7.9","classnames":"^2.2.5","clean-webpack-plugin":"^1.0.0","code-prettify":"^0.1.0","copy-webpack-plugin":"^4.6.0","css-loader":"^2.1.1","enzyme":"^3.11.0","enzyme-adapter-react-16":"^1.15.7","eslint":"^4.6.1","eslint-loader":"^1.9.0","eslint-plugin-angular":"^3.1.1","eslint-plugin-react":"^7.3.0","extract-text-webpack-plugin":"^3.0.2","file-loader":"^0.11.2","html-loader":"^0.5.1","html-webpack-plugin":"^2.30.1","jquery":"^3.1.1","jquery-ui":"^1.12.1","jsdom":"20.0.3","jsdom-global":"3.0.2","lodash":"4.17.21","mocha":"^8.4.0","moment":"^2.29.3","node-sass":"6.0","prettier":"3.5.3","prismjs":"^1.28.0","prop-types":"^15.6.0","react":"16.8.6","react-dom":"16.8.6","react-redux":"^5.0.6","react-router-dom":"^5.1.2","redux":"^3.7.2","redux-form":"^7.0.4","sass-loader":"^6.0.6","style-loader":"^0.18.2","superdesk-code-style":"^1.1.2","ts-loader":"^6.0.2","ts-node":"^10.9.1","tslint":"^5.18.0","typescript":"^5.8.3","url-loader":"^1.1.2","webpack":"^3.5.5","webpack-cli":"3.3.10","webpack-dev-server":"2.11.1","webpack-merge":"^4.2.1"},"dependencies":{"@popperjs/core":"^2.4.0","@sourcefabric/common":"0.0.66","@superdesk/primereact":"^5.0.2-13","@superdesk/react-resizable-panels":"0.0.39","chart.js":"^2.9.3","date-fns":"^4.1.0","popper-max-size-modifier":"^0.2.0","popper.js":"1.14.4","primeicons":"2.0.0","react-beautiful-dnd":"^13.0.0","react-id-generator":"^3.0.0","react-scrollspy":"^3.4.3","tippy.js":"^6.3.7","weekstart":"^2.0.0"},"peerDependencies":{"moment":"*"},"volta":{"node":"14.21.3"}}
195163
195167
 
195164
195168
  /***/ }),
195165
195169
  /* 1050 */
@@ -27245,8 +27245,9 @@ var Button = /** @class */ (function (_super) {
27245
27245
  _a['sd-flex-justify-end'] = this.props.textAlign === 'end',
27246
27246
  _a));
27247
27247
  return (React.createElement(TooltipWrapper, { tooltipText: this.props.tooltip }, function (_a) {
27248
+ var _b;
27248
27249
  var attributes = _a.attributes;
27249
- return (React.createElement("button", __assign({}, attributes, { id: _this.props.id, className: classes, tabIndex: 0, disabled: _this.props.disabled || _this.props.isLoading, "data-loading": _this.props.isLoading, onClick: _this.props.disabled ? function () { return false; } : function (event) { return _this.props.onClick(event); }, "aria-label": _this.props.iconOnly ? _this.props.text : '', "data-test-id": _this.props['data-test-id'], style: _this.props.noMargin ? { margin: 0 } : undefined }),
27250
+ return (React.createElement("button", __assign({}, attributes, { id: _this.props.id, className: classes, tabIndex: 0, disabled: _this.props.disabled || _this.props.isLoading, "data-loading": _this.props.isLoading, onClick: _this.props.disabled ? function () { return false; } : function (event) { return _this.props.onClick(event); }, "aria-label": (_b = _this.props.ariaLabel) !== null && _b !== void 0 ? _b : (_this.props.iconOnly ? _this.props.text : undefined), "data-test-id": _this.props['data-test-id'], style: _this.props.noMargin ? { margin: 0 } : undefined }),
27250
27251
  _this.props.isLoading ? React.createElement(Spinner_1.Spinner, { size: "mini" }) : null,
27251
27252
  _this.props.icon && !_this.props.isLoading ? React.createElement(Icon_1.Icon, { ariaHidden: true, name: _this.props.icon }) : null,
27252
27253
  _this.props.iconOnly ? null : _this.props.text));
@@ -59888,6 +59889,9 @@ var PopupPositioner = /** @class */ (function (_super) {
59888
59889
  if (this.wrapperEl == null) {
59889
59890
  return;
59890
59891
  }
59892
+ if (this.props.shouldCloseOnClick != null && this.props.shouldCloseOnClick(event) === false) {
59893
+ return;
59894
+ }
59891
59895
  if (this.props.getReferenceElement().contains(event.target) !== true &&
59892
59896
  this.wrapperEl.contains(event.target) !== true) {
59893
59897
  this.props.onClose();
@@ -60011,7 +60015,7 @@ exports.PopupPositioner = PopupPositioner;
60011
60015
  /**
60012
60016
  * The popup will remove itself if click/scroll events are detected outside the popup.
60013
60017
  */
60014
- function showPopup(referenceElement, placement, Component, closeOnHoverEnd, onClose) {
60018
+ function showPopup(referenceElement, placement, Component, closeOnHoverEnd, onClose, shouldCloseOnClick) {
60015
60019
  var el = document.createElement('div');
60016
60020
  document.body.appendChild(el);
60017
60021
  var closeFn = function () {
@@ -60019,7 +60023,7 @@ function showPopup(referenceElement, placement, Component, closeOnHoverEnd, onCl
60019
60023
  el.remove();
60020
60024
  onClose === null || onClose === void 0 ? void 0 : onClose();
60021
60025
  };
60022
- react_dom_1.default.render(React.createElement(PopupPositioner, { getReferenceElement: function () { return referenceElement; }, placement: placement, onClose: closeFn, closeOnHoverEnd: closeOnHoverEnd || false },
60026
+ react_dom_1.default.render(React.createElement(PopupPositioner, { getReferenceElement: function () { return referenceElement; }, placement: placement, onClose: closeFn, shouldCloseOnClick: shouldCloseOnClick, closeOnHoverEnd: closeOnHoverEnd || false },
60023
60027
  React.createElement(Component, { closePopup: closeFn })), el);
60024
60028
  return { close: closeFn };
60025
60029
  }
@@ -70344,7 +70348,7 @@ var WithPopover = /** @class */ (function (_super) {
70344
70348
  var _a, _b;
70345
70349
  _this.closePopup = undefined;
70346
70350
  (_b = (_a = _this.props).onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
70347
- }).close;
70351
+ }, this.props.shouldCloseOnClick).close;
70348
70352
  }
70349
70353
  };
70350
70354
  WithPopover.prototype.render = function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superdesk-ui-framework",
3
- "version": "4.0.77",
3
+ "version": "4.0.79",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,6 +18,7 @@ interface IPropsButton {
18
18
  disabled?: boolean;
19
19
  iconOnly?: boolean;
20
20
  noMargin?: boolean;
21
+ ariaLabel?: string;
21
22
  'data-test-id'?: string;
22
23
  }
23
24
  export declare class Button extends React.PureComponent<IPropsButton> {
@@ -92,8 +92,9 @@ var Button = /** @class */ (function (_super) {
92
92
  _a['sd-flex-justify-end'] = this.props.textAlign === 'end',
93
93
  _a));
94
94
  return (React.createElement(TooltipWrapper, { tooltipText: this.props.tooltip }, function (_a) {
95
+ var _b;
95
96
  var attributes = _a.attributes;
96
- return (React.createElement("button", __assign({}, attributes, { id: _this.props.id, className: classes, tabIndex: 0, disabled: _this.props.disabled || _this.props.isLoading, "data-loading": _this.props.isLoading, onClick: _this.props.disabled ? function () { return false; } : function (event) { return _this.props.onClick(event); }, "aria-label": _this.props.iconOnly ? _this.props.text : '', "data-test-id": _this.props['data-test-id'], style: _this.props.noMargin ? { margin: 0 } : undefined }),
97
+ return (React.createElement("button", __assign({}, attributes, { id: _this.props.id, className: classes, tabIndex: 0, disabled: _this.props.disabled || _this.props.isLoading, "data-loading": _this.props.isLoading, onClick: _this.props.disabled ? function () { return false; } : function (event) { return _this.props.onClick(event); }, "aria-label": (_b = _this.props.ariaLabel) !== null && _b !== void 0 ? _b : (_this.props.iconOnly ? _this.props.text : undefined), "data-test-id": _this.props['data-test-id'], style: _this.props.noMargin ? { margin: 0 } : undefined }),
97
98
  _this.props.isLoading ? React.createElement(Spinner_1.Spinner, { size: "mini" }) : null,
98
99
  _this.props.icon && !_this.props.isLoading ? React.createElement(Icon_1.Icon, { ariaHidden: true, name: _this.props.icon }) : null,
99
100
  _this.props.iconOnly ? null : _this.props.text));
@@ -4,6 +4,7 @@ interface IPropsPopupPositioner {
4
4
  getReferenceElement(): HTMLElement;
5
5
  placement: Placement;
6
6
  onClose(): void;
7
+ shouldCloseOnClick?: (event: MouseEvent) => boolean;
7
8
  closeOnHoverEnd?: boolean;
8
9
  'data-test-id'?: string;
9
10
  }
@@ -24,7 +25,7 @@ export declare class PopupPositioner extends React.PureComponent<IPropsPopupPosi
24
25
  */
25
26
  export declare function showPopup(referenceElement: HTMLElement, placement: Placement, Component: React.ComponentType<{
26
27
  closePopup(): void;
27
- }>, closeOnHoverEnd?: boolean, onClose?: () => void): {
28
+ }>, closeOnHoverEnd?: boolean, onClose?: () => void, shouldCloseOnClick?: (event: MouseEvent) => boolean): {
28
29
  close: () => void;
29
30
  };
30
31
  export {};
@@ -76,6 +76,9 @@ var PopupPositioner = /** @class */ (function (_super) {
76
76
  if (this.wrapperEl == null) {
77
77
  return;
78
78
  }
79
+ if (this.props.shouldCloseOnClick != null && this.props.shouldCloseOnClick(event) === false) {
80
+ return;
81
+ }
79
82
  if (this.props.getReferenceElement().contains(event.target) !== true &&
80
83
  this.wrapperEl.contains(event.target) !== true) {
81
84
  this.props.onClose();
@@ -199,7 +202,7 @@ exports.PopupPositioner = PopupPositioner;
199
202
  /**
200
203
  * The popup will remove itself if click/scroll events are detected outside the popup.
201
204
  */
202
- function showPopup(referenceElement, placement, Component, closeOnHoverEnd, onClose) {
205
+ function showPopup(referenceElement, placement, Component, closeOnHoverEnd, onClose, shouldCloseOnClick) {
203
206
  var el = document.createElement('div');
204
207
  document.body.appendChild(el);
205
208
  var closeFn = function () {
@@ -207,7 +210,7 @@ function showPopup(referenceElement, placement, Component, closeOnHoverEnd, onCl
207
210
  el.remove();
208
211
  onClose === null || onClose === void 0 ? void 0 : onClose();
209
212
  };
210
- react_dom_1.default.render(React.createElement(PopupPositioner, { getReferenceElement: function () { return referenceElement; }, placement: placement, onClose: closeFn, closeOnHoverEnd: closeOnHoverEnd || false },
213
+ react_dom_1.default.render(React.createElement(PopupPositioner, { getReferenceElement: function () { return referenceElement; }, placement: placement, onClose: closeFn, shouldCloseOnClick: shouldCloseOnClick, closeOnHoverEnd: closeOnHoverEnd || false },
211
214
  React.createElement(Component, { closePopup: closeFn })), el);
212
215
  return { close: closeFn };
213
216
  }
@@ -8,6 +8,7 @@ export interface IPropsWithPopover {
8
8
  }>;
9
9
  closeOnHoverEnd?: boolean;
10
10
  onClose?: () => void;
11
+ shouldCloseOnClick?(event: MouseEvent): boolean;
11
12
  }
12
13
  /**
13
14
  * Wraps `PopupPositioner`
@@ -73,7 +73,7 @@ var WithPopover = /** @class */ (function (_super) {
73
73
  var _a, _b;
74
74
  _this.closePopup = undefined;
75
75
  (_b = (_a = _this.props).onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
76
- }).close;
76
+ }, this.props.shouldCloseOnClick).close;
77
77
  }
78
78
  };
79
79
  WithPopover.prototype.render = function () {