@jetbrains/ring-ui-built 7.0.74 → 7.0.76

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.
@@ -7,6 +7,10 @@ var styles = {"extra-small-screen-media":"(max-width: 639px)","small-screen-medi
7
7
 
8
8
  const ABOVE = 'above';
9
9
  const INSIDE = 'inside';
10
+ /**
11
+ * @name Sidebar
12
+ * @deprecated Will be removed in Ring UI 8.0.
13
+ */
10
14
  class Sidebar extends Component {
11
15
  state = {
12
16
  topIsOutside: true,
@@ -1,3 +1,4 @@
1
+ import { c } from 'react-compiler-runtime';
1
2
  import React__default from 'react';
2
3
  import classNames from 'classnames';
3
4
  import infoIcon from '@jetbrains/icons/info-filled';
@@ -8,11 +9,10 @@ import closeIcon from '@jetbrains/icons/close';
8
9
  import Icon from '../icon/icon.js';
9
10
  import Link from '../link/link.js';
10
11
  import Tooltip from '../tooltip/tooltip.js';
11
- import { jsxs, jsx } from 'react/jsx-runtime';
12
+ import { jsx, jsxs } from 'react/jsx-runtime';
12
13
  import 'util-deprecate';
13
14
  import '../icon/icon.constants.js';
14
15
  import '../_helpers/icon-svg.js';
15
- import 'react-compiler-runtime';
16
16
  import '../global/memoize.js';
17
17
  import '../global/data-tests.js';
18
18
  import '../link/clickable-link.js';
@@ -38,52 +38,129 @@ import '../_helpers/theme.js';
38
38
  var styles = {"banner":"ring-banner-banner","inline":"ring-banner-inline","info":"ring-banner-info","icon":"ring-banner-icon","error":"ring-banner-error","success":"ring-banner-success","warning":"ring-banner-warning","purple":"ring-banner-purple","grey":"ring-banner-grey","title":"ring-banner-title","description":"ring-banner-description","closeButtonWrapper":"ring-banner-closeButtonWrapper","closeButton":"ring-banner-closeButton"};
39
39
 
40
40
  function Banner(props) {
41
+ const $ = c(32);
42
+ if ($[0] !== "df3c8f8e5b4a6ff238ad913306a06eab46faf0049973cb0f10cf90f321812a0d") {
43
+ for (let $i = 0; $i < 32; $i += 1) {
44
+ $[$i] = Symbol.for("react.memo_cache_sentinel");
45
+ }
46
+ $[0] = "df3c8f8e5b4a6ff238ad913306a06eab46faf0049973cb0f10cf90f321812a0d";
47
+ }
41
48
  const {
42
49
  title,
43
50
  children,
44
- mode = 'info',
45
- withIcon = false,
46
- inline = false,
51
+ mode: t0,
52
+ withIcon: t1,
53
+ inline: t2,
47
54
  onClose,
48
55
  closeButtonTitle,
49
56
  className,
50
- ['data-test']: dataTest,
51
- translations = {
52
- close: 'Close'
53
- }
57
+ translations: t3
54
58
  } = props;
59
+ const mode = t0 === undefined ? "info" : t0;
60
+ const withIcon = t1 === undefined ? false : t1;
61
+ const inline = t2 === undefined ? false : t2;
62
+ let t4;
63
+ if ($[1] !== t3) {
64
+ t4 = t3 === undefined ? {
65
+ close: "Close"
66
+ } : t3;
67
+ $[1] = t3;
68
+ $[2] = t4;
69
+ } else {
70
+ t4 = $[2];
71
+ }
72
+ const translations = t4;
73
+ const dataTest = props["data-test"];
55
74
  let icon = infoIcon;
56
- if (mode === 'error') {
75
+ if (mode === "error") {
57
76
  icon = exceptionIcon;
58
- } else if (mode === 'success') {
59
- icon = successIcon;
60
- } else if (mode === 'warning') {
61
- icon = warningIcon;
77
+ } else {
78
+ if (mode === "success") {
79
+ icon = successIcon;
80
+ } else {
81
+ if (mode === "warning") {
82
+ icon = warningIcon;
83
+ }
84
+ }
62
85
  }
63
- return /*#__PURE__*/jsxs("div", {
64
- className: classNames({
86
+ const t5 = mode === "info";
87
+ const t6 = mode === "error";
88
+ const t7 = mode === "success";
89
+ const t8 = mode === "warning";
90
+ const t9 = mode === "purple";
91
+ const t10 = mode === "grey";
92
+ let t11;
93
+ if ($[3] !== className || $[4] !== inline || $[5] !== t10 || $[6] !== t5 || $[7] !== t6 || $[8] !== t7 || $[9] !== t8 || $[10] !== t9) {
94
+ t11 = classNames({
65
95
  [styles.banner]: true,
66
96
  [styles.inline]: inline,
67
- [styles.info]: mode === 'info',
68
- [styles.error]: mode === 'error',
69
- [styles.success]: mode === 'success',
70
- [styles.warning]: mode === 'warning',
71
- [styles.purple]: mode === 'purple',
72
- [styles.grey]: mode === 'grey'
73
- }, className),
74
- "data-test": dataTest,
75
- children: [withIcon && /*#__PURE__*/jsx(Icon, {
97
+ [styles.info]: t5,
98
+ [styles.error]: t6,
99
+ [styles.success]: t7,
100
+ [styles.warning]: t8,
101
+ [styles.purple]: t9,
102
+ [styles.grey]: t10
103
+ }, className);
104
+ $[3] = className;
105
+ $[4] = inline;
106
+ $[5] = t10;
107
+ $[6] = t5;
108
+ $[7] = t6;
109
+ $[8] = t7;
110
+ $[9] = t8;
111
+ $[10] = t9;
112
+ $[11] = t11;
113
+ } else {
114
+ t11 = $[11];
115
+ }
116
+ let t12;
117
+ if ($[12] !== icon || $[13] !== withIcon) {
118
+ t12 = withIcon && /*#__PURE__*/jsx(Icon, {
76
119
  glyph: icon,
77
120
  className: styles.icon
78
- }), /*#__PURE__*/jsxs("div", {
79
- children: [title && /*#__PURE__*/jsx("div", {
80
- className: styles.title,
81
- children: title
82
- }), /*#__PURE__*/jsx("div", {
83
- className: styles.description,
84
- children: children
85
- })]
86
- }), onClose && /*#__PURE__*/jsx(Tooltip, {
121
+ });
122
+ $[12] = icon;
123
+ $[13] = withIcon;
124
+ $[14] = t12;
125
+ } else {
126
+ t12 = $[14];
127
+ }
128
+ let t13;
129
+ if ($[15] !== title) {
130
+ t13 = title && /*#__PURE__*/jsx("div", {
131
+ className: styles.title,
132
+ children: title
133
+ });
134
+ $[15] = title;
135
+ $[16] = t13;
136
+ } else {
137
+ t13 = $[16];
138
+ }
139
+ let t14;
140
+ if ($[17] !== children) {
141
+ t14 = /*#__PURE__*/jsx("div", {
142
+ className: styles.description,
143
+ children: children
144
+ });
145
+ $[17] = children;
146
+ $[18] = t14;
147
+ } else {
148
+ t14 = $[18];
149
+ }
150
+ let t15;
151
+ if ($[19] !== t13 || $[20] !== t14) {
152
+ t15 = /*#__PURE__*/jsxs("div", {
153
+ children: [t13, t14]
154
+ });
155
+ $[19] = t13;
156
+ $[20] = t14;
157
+ $[21] = t15;
158
+ } else {
159
+ t15 = $[21];
160
+ }
161
+ let t16;
162
+ if ($[22] !== closeButtonTitle || $[23] !== onClose || $[24] !== translations) {
163
+ t16 = onClose && /*#__PURE__*/jsx(Tooltip, {
87
164
  title: closeButtonTitle !== null && closeButtonTitle !== void 0 ? closeButtonTitle : translations.close,
88
165
  className: styles.closeButtonWrapper,
89
166
  children: /*#__PURE__*/jsx(Link, {
@@ -95,8 +172,31 @@ function Banner(props) {
95
172
  glyph: closeIcon
96
173
  })
97
174
  })
98
- })]
99
- });
175
+ });
176
+ $[22] = closeButtonTitle;
177
+ $[23] = onClose;
178
+ $[24] = translations;
179
+ $[25] = t16;
180
+ } else {
181
+ t16 = $[25];
182
+ }
183
+ let t17;
184
+ if ($[26] !== dataTest || $[27] !== t11 || $[28] !== t12 || $[29] !== t15 || $[30] !== t16) {
185
+ t17 = /*#__PURE__*/jsxs("div", {
186
+ className: t11,
187
+ "data-test": dataTest,
188
+ children: [t12, t15, t16]
189
+ });
190
+ $[26] = dataTest;
191
+ $[27] = t11;
192
+ $[28] = t12;
193
+ $[29] = t15;
194
+ $[30] = t16;
195
+ $[31] = t17;
196
+ } else {
197
+ t17 = $[31];
198
+ }
199
+ return t17;
100
200
  }
101
201
  var banner = /*#__PURE__*/React__default.memo(Banner);
102
202
 
@@ -5,6 +5,7 @@ export interface ContentLayoutProps extends HTMLAttributes<HTMLElement> {
5
5
  }
6
6
  /**
7
7
  * @name Content Layout
8
+ * @deprecated Will be removed in Ring UI 8.0.
8
9
  */
9
10
  export default class ContentLayout extends Component<ContentLayoutProps> {
10
11
  static defaultProps: {
@@ -6,6 +6,10 @@ export interface SidebarProps extends HTMLAttributes<HTMLElement> {
6
6
  fixedClassName?: string | null | undefined;
7
7
  contentNode?: HTMLElement | null | undefined;
8
8
  }
9
+ /**
10
+ * @name Sidebar
11
+ * @deprecated Will be removed in Ring UI 8.0.
12
+ */
9
13
  export default class Sidebar extends Component<SidebarProps> {
10
14
  state: {
11
15
  topIsOutside: boolean;
@@ -59,7 +59,7 @@ export interface DatePopupState {
59
59
  active: Field;
60
60
  text: string | null;
61
61
  hoverDate: Date | null;
62
- scrollDate: number | null;
62
+ scrollDate: number | Date | null;
63
63
  }
64
64
  export interface DatePopupBaseProps {
65
65
  date?: Date | number | string | null | undefined;
@@ -91,17 +91,14 @@ class DatePopup extends Component {
91
91
  const active = withTime && parsedDate && !props.time ? 'time' : 'date';
92
92
  this.state = {
93
93
  ...defaultState,
94
- active
95
- };
96
- } else if (props.from && !props.to) {
97
- this.state = {
98
- ...defaultState,
99
- active: 'to'
94
+ active,
95
+ scrollDate: parsedDate
100
96
  };
101
97
  } else {
102
98
  this.state = {
103
99
  ...defaultState,
104
- active: 'from'
100
+ active: props.from && !props.to ? 'to' : 'from',
101
+ scrollDate: this.parse(props.from, 'from')
105
102
  };
106
103
  }
107
104
  }
@@ -321,7 +318,6 @@ class DatePopup extends Component {
321
318
  render() {
322
319
  const {
323
320
  range,
324
- withTime,
325
321
  locale
326
322
  } = this.props;
327
323
  const {
@@ -363,7 +359,7 @@ class DatePopup extends Component {
363
359
  break;
364
360
  }
365
361
  }
366
- const scrollDate = withTime && !range ? this.state.scrollDate || dates.date || new Date() : this.state.scrollDate || dates[this.state.active] || new Date();
362
+ const scrollDate = this.state.scrollDate || new Date();
367
363
  const calendarProps = {
368
364
  ...restProps,
369
365
  ...dates,
@@ -1,6 +1,7 @@
1
1
  import { Component, type HTMLAttributes } from 'react';
2
2
  /**
3
3
  * @name Grid
4
+ * @deprecated Will be removed in Ring UI 8.0. Use flexbox or another layout library instead.
4
5
  */
5
6
  export declare class Grid extends Component<HTMLAttributes<HTMLDivElement>> {
6
7
  render(): import("react").JSX.Element;
@@ -5,11 +5,11 @@ const MAJOR_VERSION_INDEX = 0;
5
5
  /**
6
6
  * SUPPORTED_BROWSERS are defined by Babel plugin, see babel config
7
7
  */
8
- if (!["and_chr 141", "and_ff 143", "and_qq 14.9", "and_uc 15.5", "android 141", "chrome 141", "chrome 140", "chrome 139", "chrome 138", "chrome 137", "chrome 136", "chrome 135", "chrome 134", "chrome 133", "chrome 132", "chrome 131", "chrome 130", "chrome 129", "chrome 128", "chrome 127", "chrome 126", "chrome 125", "chrome 124", "chrome 123", "chrome 122", "chrome 121", "chrome 120", "chrome 119", "chrome 118", "chrome 117", "chrome 116", "chrome 115", "chrome 114", "chrome 113", "chrome 112", "chrome 111", "chrome 109", "edge 141", "edge 140", "edge 139", "edge 138", "edge 137", "edge 136", "edge 135", "edge 134", "edge 133", "edge 132", "edge 131", "edge 130", "edge 129", "edge 128", "edge 127", "edge 126", "edge 125", "edge 124", "edge 123", "edge 122", "edge 121", "edge 120", "edge 119", "edge 118", "edge 117", "edge 116", "edge 115", "edge 114", "edge 113", "edge 112", "edge 111", "firefox 144", "firefox 143", "firefox 142", "firefox 141", "firefox 140", "firefox 139", "firefox 138", "firefox 137", "firefox 136", "firefox 135", "firefox 134", "firefox 133", "firefox 132", "firefox 131", "firefox 130", "firefox 129", "firefox 128", "firefox 127", "firefox 126", "firefox 125", "firefox 124", "firefox 123", "firefox 122", "firefox 121", "firefox 120", "firefox 119", "firefox 118", "firefox 117", "firefox 116", "firefox 115", "firefox 114", "firefox 113", "firefox 112", "ios_saf 26.0", "ios_saf 18.5-18.6", "ios_saf 18.4", "ios_saf 18.3", "ios_saf 18.2", "ios_saf 18.1", "ios_saf 18.0", "ios_saf 17.6-17.7", "ios_saf 17.5", "ios_saf 17.4", "ios_saf 17.3", "ios_saf 17.2", "ios_saf 17.1", "ios_saf 17.0", "ios_saf 16.6-16.7", "ios_saf 16.5", "ios_saf 16.4", "kaios 3.0-3.1", "kaios 2.5", "op_mini all", "op_mob 80", "opera 122", "opera 121", "safari 26.0", "safari 18.5-18.6", "safari 18.4", "safari 18.3", "safari 18.2", "safari 18.1", "safari 18.0", "safari 17.6", "safari 17.5", "safari 17.4", "safari 17.3", "safari 17.2", "safari 17.1", "safari 17.0", "safari 16.6", "safari 16.5", "safari 16.4", "samsung 28", "samsung 27"]) {
8
+ if (!["and_chr 142", "and_ff 144", "and_qq 14.9", "and_uc 15.5", "android 142", "chrome 142", "chrome 141", "chrome 140", "chrome 139", "chrome 138", "chrome 137", "chrome 136", "chrome 135", "chrome 134", "chrome 133", "chrome 132", "chrome 131", "chrome 130", "chrome 129", "chrome 128", "chrome 127", "chrome 126", "chrome 125", "chrome 124", "chrome 123", "chrome 122", "chrome 121", "chrome 120", "chrome 119", "chrome 118", "chrome 117", "chrome 116", "chrome 115", "chrome 114", "chrome 113", "chrome 112", "chrome 111", "chrome 109", "edge 142", "edge 141", "edge 140", "edge 139", "edge 138", "edge 137", "edge 136", "edge 135", "edge 134", "edge 133", "edge 132", "edge 131", "edge 130", "edge 129", "edge 128", "edge 127", "edge 126", "edge 125", "edge 124", "edge 123", "edge 122", "edge 121", "edge 120", "edge 119", "edge 118", "edge 117", "edge 116", "edge 115", "edge 114", "edge 113", "edge 112", "edge 111", "firefox 144", "firefox 143", "firefox 142", "firefox 141", "firefox 140", "firefox 139", "firefox 138", "firefox 137", "firefox 136", "firefox 135", "firefox 134", "firefox 133", "firefox 132", "firefox 131", "firefox 130", "firefox 129", "firefox 128", "firefox 127", "firefox 126", "firefox 125", "firefox 124", "firefox 123", "firefox 122", "firefox 121", "firefox 120", "firefox 119", "firefox 118", "firefox 117", "firefox 116", "firefox 115", "firefox 114", "firefox 113", "ios_saf 26.0", "ios_saf 18.5-18.6", "ios_saf 18.4", "ios_saf 18.3", "ios_saf 18.2", "ios_saf 18.1", "ios_saf 18.0", "ios_saf 17.6-17.7", "ios_saf 17.5", "ios_saf 17.4", "ios_saf 17.3", "ios_saf 17.2", "ios_saf 17.1", "ios_saf 17.0", "ios_saf 16.6-16.7", "ios_saf 16.5", "ios_saf 16.4", "kaios 3.0-3.1", "kaios 2.5", "op_mini all", "op_mob 80", "opera 122", "opera 121", "safari 26.1", "safari 26.0", "safari 18.5-18.6", "safari 18.4", "safari 18.3", "safari 18.2", "safari 18.1", "safari 18.0", "safari 17.6", "safari 17.5", "safari 17.4", "safari 17.3", "safari 17.2", "safari 17.1", "safari 17.0", "safari 16.6", "safari 16.5", "safari 16.4", "samsung 29", "samsung 28"]) {
9
9
  // eslint-disable-next-line no-console
10
10
  console.warn('Ring UI: no SUPPORTED_BROWSERS passed. Please check babel config.');
11
11
  }
12
- const SUPPORTED = ["and_chr 141", "and_ff 143", "and_qq 14.9", "and_uc 15.5", "android 141", "chrome 141", "chrome 140", "chrome 139", "chrome 138", "chrome 137", "chrome 136", "chrome 135", "chrome 134", "chrome 133", "chrome 132", "chrome 131", "chrome 130", "chrome 129", "chrome 128", "chrome 127", "chrome 126", "chrome 125", "chrome 124", "chrome 123", "chrome 122", "chrome 121", "chrome 120", "chrome 119", "chrome 118", "chrome 117", "chrome 116", "chrome 115", "chrome 114", "chrome 113", "chrome 112", "chrome 111", "chrome 109", "edge 141", "edge 140", "edge 139", "edge 138", "edge 137", "edge 136", "edge 135", "edge 134", "edge 133", "edge 132", "edge 131", "edge 130", "edge 129", "edge 128", "edge 127", "edge 126", "edge 125", "edge 124", "edge 123", "edge 122", "edge 121", "edge 120", "edge 119", "edge 118", "edge 117", "edge 116", "edge 115", "edge 114", "edge 113", "edge 112", "edge 111", "firefox 144", "firefox 143", "firefox 142", "firefox 141", "firefox 140", "firefox 139", "firefox 138", "firefox 137", "firefox 136", "firefox 135", "firefox 134", "firefox 133", "firefox 132", "firefox 131", "firefox 130", "firefox 129", "firefox 128", "firefox 127", "firefox 126", "firefox 125", "firefox 124", "firefox 123", "firefox 122", "firefox 121", "firefox 120", "firefox 119", "firefox 118", "firefox 117", "firefox 116", "firefox 115", "firefox 114", "firefox 113", "firefox 112", "ios_saf 26.0", "ios_saf 18.5-18.6", "ios_saf 18.4", "ios_saf 18.3", "ios_saf 18.2", "ios_saf 18.1", "ios_saf 18.0", "ios_saf 17.6-17.7", "ios_saf 17.5", "ios_saf 17.4", "ios_saf 17.3", "ios_saf 17.2", "ios_saf 17.1", "ios_saf 17.0", "ios_saf 16.6-16.7", "ios_saf 16.5", "ios_saf 16.4", "kaios 3.0-3.1", "kaios 2.5", "op_mini all", "op_mob 80", "opera 122", "opera 121", "safari 26.0", "safari 18.5-18.6", "safari 18.4", "safari 18.3", "safari 18.2", "safari 18.1", "safari 18.0", "safari 17.6", "safari 17.5", "safari 17.4", "safari 17.3", "safari 17.2", "safari 17.1", "safari 17.0", "safari 16.6", "safari 16.5", "safari 16.4", "samsung 28", "samsung 27"] || [];
12
+ const SUPPORTED = ["and_chr 142", "and_ff 144", "and_qq 14.9", "and_uc 15.5", "android 142", "chrome 142", "chrome 141", "chrome 140", "chrome 139", "chrome 138", "chrome 137", "chrome 136", "chrome 135", "chrome 134", "chrome 133", "chrome 132", "chrome 131", "chrome 130", "chrome 129", "chrome 128", "chrome 127", "chrome 126", "chrome 125", "chrome 124", "chrome 123", "chrome 122", "chrome 121", "chrome 120", "chrome 119", "chrome 118", "chrome 117", "chrome 116", "chrome 115", "chrome 114", "chrome 113", "chrome 112", "chrome 111", "chrome 109", "edge 142", "edge 141", "edge 140", "edge 139", "edge 138", "edge 137", "edge 136", "edge 135", "edge 134", "edge 133", "edge 132", "edge 131", "edge 130", "edge 129", "edge 128", "edge 127", "edge 126", "edge 125", "edge 124", "edge 123", "edge 122", "edge 121", "edge 120", "edge 119", "edge 118", "edge 117", "edge 116", "edge 115", "edge 114", "edge 113", "edge 112", "edge 111", "firefox 144", "firefox 143", "firefox 142", "firefox 141", "firefox 140", "firefox 139", "firefox 138", "firefox 137", "firefox 136", "firefox 135", "firefox 134", "firefox 133", "firefox 132", "firefox 131", "firefox 130", "firefox 129", "firefox 128", "firefox 127", "firefox 126", "firefox 125", "firefox 124", "firefox 123", "firefox 122", "firefox 121", "firefox 120", "firefox 119", "firefox 118", "firefox 117", "firefox 116", "firefox 115", "firefox 114", "firefox 113", "ios_saf 26.0", "ios_saf 18.5-18.6", "ios_saf 18.4", "ios_saf 18.3", "ios_saf 18.2", "ios_saf 18.1", "ios_saf 18.0", "ios_saf 17.6-17.7", "ios_saf 17.5", "ios_saf 17.4", "ios_saf 17.3", "ios_saf 17.2", "ios_saf 17.1", "ios_saf 17.0", "ios_saf 16.6-16.7", "ios_saf 16.5", "ios_saf 16.4", "kaios 3.0-3.1", "kaios 2.5", "op_mini all", "op_mob 80", "opera 122", "opera 121", "safari 26.1", "safari 26.0", "safari 18.5-18.6", "safari 18.4", "safari 18.3", "safari 18.2", "safari 18.1", "safari 18.0", "safari 17.6", "safari 17.5", "safari 17.4", "safari 17.3", "safari 17.2", "safari 17.1", "safari 17.0", "safari 16.6", "safari 16.5", "safari 16.4", "samsung 29", "samsung 28"] || [];
13
13
  const WHITE_LISTED_BROWSERS = ['chrome', 'firefox', 'safari', 'edge'];
14
14
  const WHITE_LIST = SUPPORTED.reduce((acc, item) => {
15
15
  var _item$match;
@@ -94,6 +94,7 @@ export default class Popup<P extends BasePopupProps = PopupProps> extends PureCo
94
94
  parent?: HTMLElement | null;
95
95
  container?: HTMLElement | null;
96
96
  ringPopupTarget?: string | Element;
97
+ clickStartedInsidePopup: boolean;
97
98
  shouldUseShortcuts(): boolean;
98
99
  listeners: Listeners;
99
100
  redrawScheduler: (cb: () => void) => void;
@@ -136,8 +137,9 @@ export default class Popup<P extends BasePopupProps = PopupProps> extends PureCo
136
137
  isVisible(): boolean;
137
138
  _onCloseAttempt(evt?: Event | SyntheticEvent, isEsc?: boolean): void;
138
139
  private _onEscPress;
140
+ private _onDocumentPointerDown;
139
141
  /**
140
- * @param {jQuery.Event} evt
142
+ * @param {MouseEvent} evt
141
143
  * @private
142
144
  */
143
145
  private _onDocumentClick;
@@ -110,6 +110,7 @@ class Popup extends PureComponent {
110
110
  parent;
111
111
  container;
112
112
  ringPopupTarget;
113
+ clickStartedInsidePopup = false;
113
114
  shouldUseShortcuts() {
114
115
  const {
115
116
  shortcuts,
@@ -263,7 +264,8 @@ class Popup extends PureComponent {
263
264
  el = el.parentElement;
264
265
  }
265
266
  }
266
- this.listeners.add(document, 'pointerdown', this._onDocumentClick, true);
267
+ this.listeners.add(document, 'pointerdown', this._onDocumentPointerDown, true);
268
+ this.listeners.add(document, 'click', this._onDocumentClick, true);
267
269
  }, 0);
268
270
  return;
269
271
  }
@@ -287,12 +289,17 @@ class Popup extends PureComponent {
287
289
  this.props.onEscPress(evt);
288
290
  this._onCloseAttempt(evt, true);
289
291
  };
292
+ _onDocumentPointerDown = evt => {
293
+ this.clickStartedInsidePopup = !!(evt.target instanceof Node && this.container && this.container.contains(evt.target));
294
+ };
290
295
  /**
291
- * @param {jQuery.Event} evt
296
+ * @param {MouseEvent} evt
292
297
  * @private
293
298
  */
294
299
  _onDocumentClick = evt => {
295
- if (this.container && evt.target instanceof Node && this.container.contains(evt.target) || !this._listenersEnabled || this.props.dontCloseOnAnchorClick && evt.target instanceof Node && this._getAnchor()?.contains(evt.target) ||
300
+ const clickStartedInsidePopup = this.clickStartedInsidePopup;
301
+ this.clickStartedInsidePopup = false;
302
+ if (this.container && evt.target instanceof Node && this.container.contains(evt.target) || clickStartedInsidePopup || !this._listenersEnabled || this.props.dontCloseOnAnchorClick && evt.target instanceof Node && this._getAnchor()?.contains(evt.target) ||
296
303
  // ignore clicks in shadow DOM, e.g., Grammarly suggestions
297
304
  evt.target instanceof Element && evt.target.shadowRoot) {
298
305
  return;