@jetbrains/ring-ui 5.0.84 → 5.0.85
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/components/date-picker/date-picker.js +3 -8
- package/components/dropdown/dropdown.d.ts +3 -0
- package/components/dropdown/dropdown.js +12 -1
- package/components/shortcuts/core.js +1 -1
- package/dist/analytics/analytics__custom-plugin.js +2 -4
- package/dist/analytics/analytics__fus-plugin.js +2 -4
- package/dist/analytics/analytics__ga-plugin.js +1 -2
- package/dist/auth/auth.js +3 -1
- package/dist/auth/auth__core.js +57 -94
- package/dist/auth/iframe-flow.js +1 -2
- package/dist/auth/landing.js +1 -2
- package/dist/auth/request-builder.js +1 -2
- package/dist/auth/token-validator.js +2 -6
- package/dist/auth/window-flow.js +2 -4
- package/dist/button/button.js +1 -2
- package/dist/caret/caret.js +13 -16
- package/dist/content-layout/content-layout.js +1 -2
- package/dist/data-list/data-list.js +3 -6
- package/dist/data-list/item.js +1 -1
- package/dist/date-picker/date-picker.js +8 -13
- package/dist/date-picker/date-popup.js +1 -2
- package/dist/dialog-ng/dialog-ng.js +2 -3
- package/dist/dropdown/dropdown.d.ts +3 -0
- package/dist/dropdown/dropdown.js +15 -6
- package/dist/editable-heading/editable-heading.js +1 -3
- package/dist/global/focus-sensor-hoc.js +8 -13
- package/dist/global/normalize-indent.js +2 -2
- package/dist/global/react-render-adapter.js +1 -4
- package/dist/global/rerender-hoc.js +1 -2
- package/dist/global/schedule-raf.js +1 -2
- package/dist/header/smart-profile.js +2 -3
- package/dist/header/smart-services.js +3 -6
- package/dist/http/http.js +7 -13
- package/dist/hub-source/hub-source__user.js +2 -3
- package/dist/icon/icon.js +1 -2
- package/dist/input/input.js +3 -6
- package/dist/island/content.js +1 -2
- package/dist/list/list__users-groups-source.js +7 -10
- package/dist/loader/loader.js +1 -2
- package/dist/loader/loader__core.js +1 -2
- package/dist/markdown/code.js +2 -3
- package/dist/message/message.js +4 -6
- package/dist/pager/pager.js +4 -8
- package/dist/permissions/permissions__cache.js +1 -1
- package/dist/popup/popup.js +2 -4
- package/dist/popup/position.js +2 -3
- package/dist/query-assist/query-assist.js +29 -41
- package/dist/select/select.js +10 -17
- package/dist/select/select__popup.js +3 -10
- package/dist/select-ng/select-ng.js +1 -2
- package/dist/select-ng/select-ng__lazy.js +1 -2
- package/dist/shortcuts/core.js +2 -3
- package/dist/tab-trap/tab-trap.js +2 -4
- package/dist/table/header.js +2 -2
- package/dist/table/multitable.js +7 -14
- package/dist/table/row-with-focus-sensor.js +4 -8
- package/dist/table/selection-shortcuts-hoc.js +11 -11
- package/dist/tabs/collapsible-tabs.js +1 -1
- package/dist/tabs/dumb-tabs.js +1 -2
- package/dist/tag/tag.js +1 -2
- package/dist/tags-input/tags-input.js +13 -23
- package/dist/tooltip/tooltip.js +2 -4
- package/package.json +9 -9
|
@@ -90,10 +90,7 @@ class TokenValidator {
|
|
|
90
90
|
optionalScopes
|
|
91
91
|
} = this._config;
|
|
92
92
|
const requiredScopes = optionalScopes ? scope.filter(scopeId => !optionalScopes.includes(scopeId)) : scope;
|
|
93
|
-
const hasAllScopes = requiredScopes.every(scopeId =>
|
|
94
|
-
var _storedToken$scopes;
|
|
95
|
-
return (_storedToken$scopes = storedToken.scopes) === null || _storedToken$scopes === void 0 ? void 0 : _storedToken$scopes.includes(scopeId);
|
|
96
|
-
});
|
|
93
|
+
const hasAllScopes = requiredScopes.every(scopeId => storedToken.scopes?.includes(scopeId));
|
|
97
94
|
if (!hasAllScopes) {
|
|
98
95
|
throw new TokenValidator.TokenValidationError('Token doesn\'t match required scopes');
|
|
99
96
|
}
|
|
@@ -124,9 +121,8 @@ class TokenValidator {
|
|
|
124
121
|
// Skip JSON parsing errors
|
|
125
122
|
}
|
|
126
123
|
if (errorResponse.status === CODE.UNAUTHORIZED || TokenValidator.shouldRefreshToken(response.error)) {
|
|
127
|
-
var _errorResponse$data, _errorResponse$data2;
|
|
128
124
|
// Token expired
|
|
129
|
-
throw new TokenValidator.TokenValidationError(response.error || errorResponse.message,
|
|
125
|
+
throw new TokenValidator.TokenValidationError(response.error || errorResponse.message, errorResponse.data?.error ? new Error(errorResponse.data?.error) : undefined);
|
|
130
126
|
}
|
|
131
127
|
// Request unexpectedly failed
|
|
132
128
|
throw errorResponse;
|
package/dist/auth/window-flow.js
CHANGED
|
@@ -14,8 +14,7 @@ class WindowFlow {
|
|
|
14
14
|
_defineProperty(this, "_loginWindow", void 0);
|
|
15
15
|
_defineProperty(this, "_promise", void 0);
|
|
16
16
|
_defineProperty(this, "checkIsClosed", () => {
|
|
17
|
-
|
|
18
|
-
if ((_this$_loginWindow = this._loginWindow) !== null && _this$_loginWindow !== void 0 && _this$_loginWindow.closed) {
|
|
17
|
+
if (this._loginWindow?.closed) {
|
|
19
18
|
this.stop();
|
|
20
19
|
return;
|
|
21
20
|
}
|
|
@@ -59,7 +58,6 @@ class WindowFlow {
|
|
|
59
58
|
this.reject = reject;
|
|
60
59
|
let cleanRun;
|
|
61
60
|
const cleanUp = () => {
|
|
62
|
-
var _this$_loginWindow2;
|
|
63
61
|
if (cleanRun) {
|
|
64
62
|
return;
|
|
65
63
|
}
|
|
@@ -68,7 +66,7 @@ class WindowFlow {
|
|
|
68
66
|
removeStateListener();
|
|
69
67
|
removeTokenListener();
|
|
70
68
|
/* eslint-enable @typescript-eslint/no-use-before-define */
|
|
71
|
-
|
|
69
|
+
this._loginWindow?.close();
|
|
72
70
|
clearTimeout(this._timeoutId);
|
|
73
71
|
};
|
|
74
72
|
const removeTokenListener = this._storage.onTokenChange(token => {
|
package/dist/button/button.js
CHANGED
|
@@ -9,7 +9,6 @@ import ClickableLink from '../link/clickableLink.js';
|
|
|
9
9
|
import { ControlsHeightContext } from '../global/controls-height.js';
|
|
10
10
|
import { g as getButtonClasses, m as modules_e81895c9 } from '../_helpers/button__classes.js';
|
|
11
11
|
import { Size } from '../icon/icon__constants.js';
|
|
12
|
-
export { Size as IconSize } from '../icon/icon__constants.js';
|
|
13
12
|
import 'util-deprecate';
|
|
14
13
|
import '../_helpers/icon.js';
|
|
15
14
|
import '../icon/icon__svg.js';
|
|
@@ -111,4 +110,4 @@ _defineProperty(Button, "propTypes", {
|
|
|
111
110
|
_defineProperty(Button, "IconSize", Size);
|
|
112
111
|
_defineProperty(Button, "contextType", ControlsHeightContext);
|
|
113
112
|
|
|
114
|
-
export { Button, Button as default };
|
|
113
|
+
export { Button, Size as IconSize, Button as default };
|
package/dist/caret/caret.js
CHANGED
|
@@ -44,8 +44,8 @@ class Caret {
|
|
|
44
44
|
let curPos = 0;
|
|
45
45
|
while (_curNode != null && _curNode !== this.target) {
|
|
46
46
|
while (_curNode.previousSibling) {
|
|
47
|
-
var _curNode$previousSibl
|
|
48
|
-
curPos += (_curNode$previousSibl =
|
|
47
|
+
var _curNode$previousSibl;
|
|
48
|
+
curPos += (_curNode$previousSibl = _curNode.previousSibling.textContent?.length) !== null && _curNode$previousSibl !== void 0 ? _curNode$previousSibl : 0;
|
|
49
49
|
_curNode = _curNode.previousSibling;
|
|
50
50
|
}
|
|
51
51
|
_curNode = _curNode.parentNode;
|
|
@@ -65,7 +65,7 @@ class Caret {
|
|
|
65
65
|
this.focus();
|
|
66
66
|
}
|
|
67
67
|
const selection = window.getSelection();
|
|
68
|
-
if (!
|
|
68
|
+
if (!selection?.rangeCount) {
|
|
69
69
|
return 0;
|
|
70
70
|
}
|
|
71
71
|
const range1 = selection.getRangeAt(0);
|
|
@@ -135,12 +135,12 @@ class Caret {
|
|
|
135
135
|
while (curPos < position && _curNode.nodeType !== nodeTypeText) {
|
|
136
136
|
i++;
|
|
137
137
|
if (_curNode.childNodes[i] != null) {
|
|
138
|
-
var _curNode$childNodes$i
|
|
139
|
-
curPos += (_curNode$childNodes$i =
|
|
138
|
+
var _curNode$childNodes$i;
|
|
139
|
+
curPos += (_curNode$childNodes$i = _curNode.childNodes[i].textContent?.length) !== null && _curNode$childNodes$i !== void 0 ? _curNode$childNodes$i : 0;
|
|
140
140
|
if (curPos >= position) {
|
|
141
|
-
var _curNode$textContent
|
|
141
|
+
var _curNode$textContent$;
|
|
142
142
|
_curNode = _curNode.childNodes[i];
|
|
143
|
-
curPos -= (_curNode$textContent$ =
|
|
143
|
+
curPos -= (_curNode$textContent$ = _curNode.textContent?.length) !== null && _curNode$textContent$ !== void 0 ? _curNode$textContent$ : 0;
|
|
144
144
|
i = -1;
|
|
145
145
|
}
|
|
146
146
|
} else {
|
|
@@ -174,7 +174,7 @@ class Caret {
|
|
|
174
174
|
} else if (position === -1) {
|
|
175
175
|
var _value$length;
|
|
176
176
|
const value = isContentEditable ? this.target.textContent : Caret.normalizeNewlines('value' in this.target ? this.target.value : undefined);
|
|
177
|
-
correctedPosition = (_value$length = value
|
|
177
|
+
correctedPosition = (_value$length = value?.length) !== null && _value$length !== void 0 ? _value$length : 0;
|
|
178
178
|
} else {
|
|
179
179
|
const {
|
|
180
180
|
_curNode,
|
|
@@ -188,12 +188,10 @@ class Caret {
|
|
|
188
188
|
this.focus();
|
|
189
189
|
try {
|
|
190
190
|
if (correctedPosition instanceof Range) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
(_window$getSelection2 = window.getSelection()) === null || _window$getSelection2 === void 0 ? void 0 : _window$getSelection2.addRange(correctedPosition);
|
|
191
|
+
window.getSelection()?.removeAllRanges();
|
|
192
|
+
window.getSelection()?.addRange(correctedPosition);
|
|
194
193
|
} else {
|
|
195
|
-
|
|
196
|
-
(_window$getSelection3 = window.getSelection()) === null || _window$getSelection3 === void 0 ? void 0 : _window$getSelection3.collapse(curNode || this.target, correctedPosition);
|
|
194
|
+
window.getSelection()?.collapse(curNode || this.target, correctedPosition);
|
|
197
195
|
}
|
|
198
196
|
} catch (e) {
|
|
199
197
|
// Do nothing
|
|
@@ -211,10 +209,9 @@ class Caret {
|
|
|
211
209
|
let offset = 0;
|
|
212
210
|
let range;
|
|
213
211
|
try {
|
|
214
|
-
var _window$getSelection4, _range;
|
|
215
212
|
// Both statements may throw
|
|
216
|
-
range =
|
|
217
|
-
|
|
213
|
+
range = window.getSelection()?.getRangeAt(0).cloneRange();
|
|
214
|
+
range?.setStart(range.startContainer, range.startOffset - 1);
|
|
218
215
|
} catch (e) {
|
|
219
216
|
return offset;
|
|
220
217
|
}
|
|
@@ -3,7 +3,6 @@ import React, { Component, cloneElement } from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { m as modules_b8a9dd4f, S as Sidebar } from '../_helpers/sidebar.js';
|
|
6
|
-
export { S as Sidebar } from '../_helpers/sidebar.js';
|
|
7
6
|
import 'react-waypoint';
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -57,4 +56,4 @@ _defineProperty(ContentLayout, "defaultProps", {
|
|
|
57
56
|
responsive: true
|
|
58
57
|
});
|
|
59
58
|
|
|
60
|
-
export { ContentLayout as default };
|
|
59
|
+
export { Sidebar, ContentLayout as default };
|
|
@@ -78,11 +78,9 @@ class DataList extends PureComponent {
|
|
|
78
78
|
}
|
|
79
79
|
const item = itemFormatter(focused);
|
|
80
80
|
if (item.collapsed) {
|
|
81
|
-
|
|
82
|
-
(_item$onExpand = item.onExpand) === null || _item$onExpand === void 0 ? void 0 : _item$onExpand.call(item);
|
|
81
|
+
item.onExpand?.();
|
|
83
82
|
} else {
|
|
84
|
-
|
|
85
|
-
(_item$onCollapse = item.onCollapse) === null || _item$onCollapse === void 0 ? void 0 : _item$onCollapse.call(item);
|
|
83
|
+
item.onCollapse?.();
|
|
86
84
|
}
|
|
87
85
|
});
|
|
88
86
|
_defineProperty(this, "shortcutsMap", {
|
|
@@ -135,7 +133,6 @@ class DataList extends PureComponent {
|
|
|
135
133
|
}), /*#__PURE__*/React.createElement("ul", {
|
|
136
134
|
className: classes
|
|
137
135
|
}, data.map(model => {
|
|
138
|
-
var _this$props$itemMoreL, _this$props;
|
|
139
136
|
const item = itemFormatter(model);
|
|
140
137
|
const {
|
|
141
138
|
id,
|
|
@@ -143,7 +140,7 @@ class DataList extends PureComponent {
|
|
|
143
140
|
title,
|
|
144
141
|
items
|
|
145
142
|
} = item;
|
|
146
|
-
const showMoreLessButton =
|
|
143
|
+
const showMoreLessButton = this.props.itemMoreLessState?.(item);
|
|
147
144
|
return /*#__PURE__*/React.createElement(Item, {
|
|
148
145
|
key: key || id,
|
|
149
146
|
item: model,
|
package/dist/data-list/item.js
CHANGED
|
@@ -160,7 +160,7 @@ class Item extends PureComponent {
|
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
const itemIsEmpty = !
|
|
163
|
+
const itemIsEmpty = !items?.length || collapsible && collapsed;
|
|
164
164
|
const offset = level * LIST_LEFT_OFFSET + ITEM_LEFT_OFFSET + parentShift;
|
|
165
165
|
return /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Title, {
|
|
166
166
|
title: title,
|
|
@@ -127,7 +127,7 @@ class DatePicker extends PureComponent {
|
|
|
127
127
|
withTime,
|
|
128
128
|
applyTimeInput
|
|
129
129
|
} = this.props;
|
|
130
|
-
const adjustedChange = withTime && !(change instanceof Date) &&
|
|
130
|
+
const adjustedChange = withTime && !(change instanceof Date) && change?.date != null ? applyTimeInput(change.date, change.time) : change;
|
|
131
131
|
onChange(adjustedChange);
|
|
132
132
|
});
|
|
133
133
|
_defineProperty(this, "clear", () => {
|
|
@@ -145,8 +145,7 @@ class DatePicker extends PureComponent {
|
|
|
145
145
|
this.popup = el;
|
|
146
146
|
});
|
|
147
147
|
_defineProperty(this, "closePopup", () => {
|
|
148
|
-
|
|
149
|
-
(_this$popup = this.popup) === null || _this$popup === void 0 ? void 0 : _this$popup._onCloseAttempt();
|
|
148
|
+
this.popup?._onCloseAttempt();
|
|
150
149
|
});
|
|
151
150
|
_defineProperty(this, "parse", memoize(date => {
|
|
152
151
|
const {
|
|
@@ -216,6 +215,7 @@ class DatePicker extends PureComponent {
|
|
|
216
215
|
return null;
|
|
217
216
|
}
|
|
218
217
|
render() {
|
|
218
|
+
var _this$props$disabled, _this$props$disabled2;
|
|
219
219
|
const anchorContent = /*#__PURE__*/React.createElement("div", {
|
|
220
220
|
className: modules_0c7b7d96.anchorContent
|
|
221
221
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -225,14 +225,6 @@ class DatePicker extends PureComponent {
|
|
|
225
225
|
glyph: chevronDownIcon,
|
|
226
226
|
className: modules_0c7b7d96.chevronDownIcon
|
|
227
227
|
}));
|
|
228
|
-
if (this.props.disabled) {
|
|
229
|
-
return /*#__PURE__*/React.createElement(Button, {
|
|
230
|
-
"data-test-ring-dropdown-anchor": true,
|
|
231
|
-
className: modules_0c7b7d96.anchor,
|
|
232
|
-
disabled: true,
|
|
233
|
-
text: false
|
|
234
|
-
}, anchorContent);
|
|
235
|
-
}
|
|
236
228
|
const {
|
|
237
229
|
className,
|
|
238
230
|
popupClassName,
|
|
@@ -247,14 +239,17 @@ class DatePicker extends PureComponent {
|
|
|
247
239
|
});
|
|
248
240
|
return /*#__PURE__*/React.createElement(Dropdown, _extends({
|
|
249
241
|
className: classes,
|
|
242
|
+
disabled: this.props.disabled,
|
|
250
243
|
anchor: inline ? /*#__PURE__*/React.createElement(Link, {
|
|
251
244
|
"data-test-ring-dropdown-anchor": true,
|
|
252
245
|
className: modules_0c7b7d96.anchor,
|
|
246
|
+
disabled: (_this$props$disabled = this.props.disabled) !== null && _this$props$disabled !== void 0 ? _this$props$disabled : false,
|
|
253
247
|
pseudo: true
|
|
254
248
|
}, this.getAnchorText()) : /*#__PURE__*/React.createElement(Button, {
|
|
255
249
|
"data-test-ring-dropdown-anchor": true,
|
|
256
250
|
className: modules_0c7b7d96.anchor,
|
|
257
|
-
text: false
|
|
251
|
+
text: false,
|
|
252
|
+
disabled: (_this$props$disabled2 = this.props.disabled) !== null && _this$props$disabled2 !== void 0 ? _this$props$disabled2 : false
|
|
258
253
|
}, anchorContent)
|
|
259
254
|
}, dropdownProps), /*#__PURE__*/React.createElement(PopupComponent, {
|
|
260
255
|
className: popupClassName,
|
|
@@ -336,7 +331,7 @@ _defineProperty(DatePicker, "defaultProps", {
|
|
|
336
331
|
},
|
|
337
332
|
applyTimeInput(date, timeString) {
|
|
338
333
|
var _timeString$split$map;
|
|
339
|
-
const [hours, minutes] = (_timeString$split$map = timeString
|
|
334
|
+
const [hours, minutes] = (_timeString$split$map = timeString?.split(':').map(Number)) !== null && _timeString$split$map !== void 0 ? _timeString$split$map : [];
|
|
340
335
|
return minutes != null ? set(date, {
|
|
341
336
|
hours,
|
|
342
337
|
minutes
|
|
@@ -147,7 +147,6 @@ class DatePopup extends Component {
|
|
|
147
147
|
scrollDate
|
|
148
148
|
}));
|
|
149
149
|
_defineProperty(this, "onClear", e => {
|
|
150
|
-
var _this$props$onClear, _this$props;
|
|
151
150
|
let changes;
|
|
152
151
|
if (this.props.range) {
|
|
153
152
|
changes = {
|
|
@@ -160,7 +159,7 @@ class DatePopup extends Component {
|
|
|
160
159
|
};
|
|
161
160
|
}
|
|
162
161
|
this.select(changes);
|
|
163
|
-
|
|
162
|
+
this.props.onClear?.(e);
|
|
164
163
|
});
|
|
165
164
|
const defaultState = {
|
|
166
165
|
text: null,
|
|
@@ -209,11 +209,10 @@ class DialogController extends RingAngularComponent {
|
|
|
209
209
|
this.done(result);
|
|
210
210
|
}
|
|
211
211
|
getErrorMessage(errorResponse) {
|
|
212
|
-
|
|
213
|
-
if (errorResponse !== null && errorResponse !== void 0 && (_errorResponse$data = errorResponse.data) !== null && _errorResponse$data !== void 0 && _errorResponse$data.error_description) {
|
|
212
|
+
if (errorResponse?.data?.error_description) {
|
|
214
213
|
return errorResponse.data.error_description;
|
|
215
214
|
}
|
|
216
|
-
if (errorResponse
|
|
215
|
+
if (errorResponse?.data?.error) {
|
|
217
216
|
return errorResponse.data.error;
|
|
218
217
|
}
|
|
219
218
|
return errorResponse;
|
|
@@ -10,6 +10,7 @@ export interface DropdownProps extends Omit<HTMLAttributes<HTMLElement>, 'childr
|
|
|
10
10
|
anchor: ReactElement | readonly ReactElement[] | string | ((props: AnchorProps) => ReactNode);
|
|
11
11
|
children: ReactElement<PopupAttrs> | ((props: Omit<PopupAttrs, 'children'>) => ReactNode);
|
|
12
12
|
initShown: boolean;
|
|
13
|
+
disabled?: boolean | null | undefined;
|
|
13
14
|
clickMode: boolean;
|
|
14
15
|
hoverMode: boolean;
|
|
15
16
|
hoverShowTimeOut: number;
|
|
@@ -41,6 +42,7 @@ export default class Dropdown extends Component<DropdownProps, DropdownState> {
|
|
|
41
42
|
hoverMode: PropTypes.Requireable<boolean>;
|
|
42
43
|
hoverShowTimeOut: PropTypes.Requireable<number>;
|
|
43
44
|
hoverHideTimeOut: PropTypes.Requireable<number>;
|
|
45
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
44
46
|
onShow: PropTypes.Requireable<(...args: any[]) => any>;
|
|
45
47
|
onHide: PropTypes.Requireable<(...args: any[]) => any>;
|
|
46
48
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -53,6 +55,7 @@ export default class Dropdown extends Component<DropdownProps, DropdownState> {
|
|
|
53
55
|
hoverMode: boolean;
|
|
54
56
|
hoverShowTimeOut: number;
|
|
55
57
|
hoverHideTimeOut: number;
|
|
58
|
+
disabled: boolean;
|
|
56
59
|
onShow: () => void;
|
|
57
60
|
onHide: () => void;
|
|
58
61
|
onMouseEnter: () => void;
|
|
@@ -5,7 +5,6 @@ import classNames from 'classnames';
|
|
|
5
5
|
import joinDataTestAttributes from '../global/data-tests.js';
|
|
6
6
|
import { isArray } from '../global/typescript-utils.js';
|
|
7
7
|
import { m as modules_d9414203, A as Anchor } from '../_helpers/anchor.js';
|
|
8
|
-
export { A as Anchor } from '../_helpers/anchor.js';
|
|
9
8
|
import '@jetbrains/icons/chevron-10px';
|
|
10
9
|
import '../icon/icon.js';
|
|
11
10
|
import 'util-deprecate';
|
|
@@ -30,6 +29,9 @@ class Dropdown extends Component {
|
|
|
30
29
|
pinned: false
|
|
31
30
|
});
|
|
32
31
|
_defineProperty(this, "onClick", () => {
|
|
32
|
+
if (this.props.disabled) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
33
35
|
const {
|
|
34
36
|
show,
|
|
35
37
|
pinned
|
|
@@ -59,9 +61,11 @@ class Dropdown extends Component {
|
|
|
59
61
|
});
|
|
60
62
|
_defineProperty(this, "hoverTimer", void 0);
|
|
61
63
|
_defineProperty(this, "onMouseEnter", event => {
|
|
62
|
-
|
|
64
|
+
if (this.props.disabled) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
63
67
|
this._clearTimer();
|
|
64
|
-
|
|
68
|
+
this.props.onMouseEnter?.(event);
|
|
65
69
|
this.hoverTimer = window.setTimeout(() => {
|
|
66
70
|
if (!this.state.show) {
|
|
67
71
|
this._toggle(true);
|
|
@@ -69,8 +73,10 @@ class Dropdown extends Component {
|
|
|
69
73
|
}, this.props.hoverShowTimeOut);
|
|
70
74
|
});
|
|
71
75
|
_defineProperty(this, "onMouseLeave", event => {
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
if (this.props.disabled) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
this.props.onMouseLeave?.(event);
|
|
74
80
|
if (this.state.pinned) {
|
|
75
81
|
return;
|
|
76
82
|
}
|
|
@@ -127,6 +133,7 @@ class Dropdown extends Component {
|
|
|
127
133
|
hoverMode,
|
|
128
134
|
clickMode,
|
|
129
135
|
'data-test': dataTest,
|
|
136
|
+
disabled,
|
|
130
137
|
...restProps
|
|
131
138
|
} = this.props;
|
|
132
139
|
const classes = classNames(modules_d9414203.dropdown, className, {
|
|
@@ -189,6 +196,7 @@ _defineProperty(Dropdown, "propTypes", {
|
|
|
189
196
|
hoverMode: PropTypes.bool,
|
|
190
197
|
hoverShowTimeOut: PropTypes.number,
|
|
191
198
|
hoverHideTimeOut: PropTypes.number,
|
|
199
|
+
disabled: PropTypes.bool,
|
|
192
200
|
onShow: PropTypes.func,
|
|
193
201
|
onHide: PropTypes.func,
|
|
194
202
|
onMouseEnter: PropTypes.func,
|
|
@@ -201,10 +209,11 @@ _defineProperty(Dropdown, "defaultProps", {
|
|
|
201
209
|
hoverMode: false,
|
|
202
210
|
hoverShowTimeOut: 300,
|
|
203
211
|
hoverHideTimeOut: 600,
|
|
212
|
+
disabled: false,
|
|
204
213
|
onShow: () => {},
|
|
205
214
|
onHide: () => {},
|
|
206
215
|
onMouseEnter: () => {},
|
|
207
216
|
onMouseLeave: () => {}
|
|
208
217
|
});
|
|
209
218
|
|
|
210
|
-
export { Dropdown as default };
|
|
219
|
+
export { Anchor, Dropdown as default };
|
|
@@ -2,10 +2,8 @@ import { a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import Heading, { Levels } from '../heading/heading.js';
|
|
5
|
-
export { Levels } from '../heading/heading.js';
|
|
6
5
|
import { Button } from '../button/button.js';
|
|
7
6
|
import { Size } from '../input/input.js';
|
|
8
|
-
export { Size } from '../input/input.js';
|
|
9
7
|
import { m as modules_88cfaf40 } from '../_helpers/input.js';
|
|
10
8
|
import getUID from '../global/get-uid.js';
|
|
11
9
|
import Shortcuts from '../shortcuts/shortcuts.js';
|
|
@@ -129,4 +127,4 @@ const EditableHeading = props => {
|
|
|
129
127
|
};
|
|
130
128
|
var editableHeading = /*#__PURE__*/React.memo(EditableHeading);
|
|
131
129
|
|
|
132
|
-
export { EditableHeading, editableHeading as default };
|
|
130
|
+
export { EditableHeading, Levels, Size, editableHeading as default };
|
|
@@ -35,7 +35,6 @@ function focusSensorHOC(ComposedComponent) {
|
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
_defineProperty(this, "onFocusCapture", _ref2 => {
|
|
38
|
-
var _this$node;
|
|
39
38
|
let {
|
|
40
39
|
target
|
|
41
40
|
} = _ref2;
|
|
@@ -43,13 +42,12 @@ function focusSensorHOC(ComposedComponent) {
|
|
|
43
42
|
this._skipNextCapture = false;
|
|
44
43
|
return;
|
|
45
44
|
}
|
|
46
|
-
const focused = target instanceof Node &&
|
|
45
|
+
const focused = target instanceof Node && this.node?.contains(target);
|
|
47
46
|
if (focused && !this.state.focused) {
|
|
48
|
-
var _this$props$onFocus, _this$props;
|
|
49
47
|
this.setState({
|
|
50
48
|
focused: true
|
|
51
49
|
});
|
|
52
|
-
|
|
50
|
+
this.props.onFocus?.();
|
|
53
51
|
}
|
|
54
52
|
});
|
|
55
53
|
_defineProperty(this, "onBlurCapture", _ref3 => {
|
|
@@ -64,25 +62,22 @@ function focusSensorHOC(ComposedComponent) {
|
|
|
64
62
|
} = this;
|
|
65
63
|
if (focused) {
|
|
66
64
|
setTimeout(() => {
|
|
67
|
-
const blurred = target instanceof Node &&
|
|
65
|
+
const blurred = target instanceof Node && node?.contains(target) && !node.contains(document.activeElement);
|
|
68
66
|
if (blurred) {
|
|
69
|
-
var _this$props$onBlur, _this$props2;
|
|
70
67
|
this.setState({
|
|
71
68
|
focused: false
|
|
72
69
|
});
|
|
73
|
-
|
|
70
|
+
this.props.onBlur?.();
|
|
74
71
|
}
|
|
75
72
|
}, 1);
|
|
76
73
|
}
|
|
77
74
|
});
|
|
78
75
|
_defineProperty(this, "onFocusRestore", () => {
|
|
79
|
-
var _this$node2;
|
|
80
76
|
this._skipNextCapture = true;
|
|
81
|
-
|
|
77
|
+
this.node?.focus();
|
|
82
78
|
});
|
|
83
79
|
_defineProperty(this, "onFocusReset", () => {
|
|
84
|
-
|
|
85
|
-
(_this$node3 = this.node) === null || _this$node3 === void 0 ? void 0 : _this$node3.blur();
|
|
80
|
+
this.node?.blur();
|
|
86
81
|
});
|
|
87
82
|
}
|
|
88
83
|
componentDidMount() {
|
|
@@ -92,14 +87,14 @@ function focusSensorHOC(ComposedComponent) {
|
|
|
92
87
|
},
|
|
93
88
|
node
|
|
94
89
|
} = this;
|
|
95
|
-
node
|
|
90
|
+
node?.setAttribute('tabindex', '0');
|
|
96
91
|
if (node != null) {
|
|
97
92
|
node.style.outline = 'none';
|
|
98
93
|
}
|
|
99
94
|
document.addEventListener('focus', this.onFocusCapture, true);
|
|
100
95
|
document.addEventListener('blur', this.onBlurCapture, true);
|
|
101
96
|
if (autofocus) {
|
|
102
|
-
node
|
|
97
|
+
node?.focus();
|
|
103
98
|
}
|
|
104
99
|
}
|
|
105
100
|
componentDidUpdate(prevProps) {
|
|
@@ -19,8 +19,8 @@ function normalizeIndent(string) {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
const indents = lines.filter(line => nonemptyRE.test(line)).map(line => {
|
|
22
|
-
var _line$match$0$length
|
|
23
|
-
return (_line$match$0$length =
|
|
22
|
+
var _line$match$0$length;
|
|
23
|
+
return (_line$match$0$length = line.match(indentRE)?.[0].length) !== null && _line$match$0$length !== void 0 ? _line$match$0$length : 0;
|
|
24
24
|
});
|
|
25
25
|
const minIndent = Math.min(...indents);
|
|
26
26
|
return lines.map(line => line.slice(minIndent)).join('\n');
|
|
@@ -20,10 +20,7 @@ function setClient(_ref) {
|
|
|
20
20
|
}
|
|
21
21
|
root.render(element);
|
|
22
22
|
};
|
|
23
|
-
unmountComponentAtNode = container =>
|
|
24
|
-
var _roots$get;
|
|
25
|
-
return (_roots$get = roots.get(container)) === null || _roots$get === void 0 ? void 0 : _roots$get.unmount();
|
|
26
|
-
};
|
|
23
|
+
unmountComponentAtNode = container => roots.get(container)?.unmount();
|
|
27
24
|
hydrate = (element, container) => {
|
|
28
25
|
const root = hydrateRoot(container, element);
|
|
29
26
|
roots.set(container, root);
|
|
@@ -21,8 +21,7 @@ function rerenderHOC(ComposedComponent) {
|
|
|
21
21
|
let callback = arguments.length > 1 ? arguments[1] : undefined;
|
|
22
22
|
let container;
|
|
23
23
|
try {
|
|
24
|
-
|
|
25
|
-
container = (_this$node = this.node) === null || _this$node === void 0 ? void 0 : _this$node.parentNode;
|
|
24
|
+
container = this.node?.parentNode;
|
|
26
25
|
} finally {
|
|
27
26
|
if (!container || !(container instanceof Element)) {
|
|
28
27
|
throw new Error(`${this.constructor.name} component isn't mounted`);
|
|
@@ -4,8 +4,7 @@ function scheduleRAF(trailingCall) {
|
|
|
4
4
|
let trailingCallScheduled = false;
|
|
5
5
|
function doSchedule() {
|
|
6
6
|
RAF = window.requestAnimationFrame(() => {
|
|
7
|
-
|
|
8
|
-
(_scheduledCb = scheduledCb) === null || _scheduledCb === void 0 ? void 0 : _scheduledCb();
|
|
7
|
+
scheduledCb?.();
|
|
9
8
|
if (trailingCallScheduled) {
|
|
10
9
|
trailingCallScheduled = false;
|
|
11
10
|
doSchedule();
|
|
@@ -165,14 +165,13 @@ class SmartProfile extends PureComponent {
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
checkUserCertificateMismatch(user) {
|
|
168
|
-
var _userMeta$headers;
|
|
169
168
|
const {
|
|
170
169
|
auth,
|
|
171
170
|
translations
|
|
172
171
|
} = this.props;
|
|
173
172
|
const userMeta = auth.http.getMetaForResponse(user);
|
|
174
|
-
if (userMeta
|
|
175
|
-
const message =
|
|
173
|
+
if (userMeta?.headers?.has(CERTIFICATE_MISMATCH_HEADER)) {
|
|
174
|
+
const message = translations?.certificateMismatch || `You are authenticated as ${user.login || user.name}. To authenticate with the client certificate for your account, log out, then click the "Log in with certificate" option on the login page.`;
|
|
176
175
|
alertService.warning(message, 0);
|
|
177
176
|
}
|
|
178
177
|
}
|
|
@@ -88,11 +88,10 @@ class SmartServices extends Component {
|
|
|
88
88
|
});
|
|
89
89
|
});
|
|
90
90
|
_defineProperty(this, "getServicesContent", () => {
|
|
91
|
-
var _this$getServices;
|
|
92
91
|
this.setState({
|
|
93
92
|
loading: true
|
|
94
93
|
});
|
|
95
|
-
|
|
94
|
+
this.getServices(SmartServices.allFields)?.then(services => {
|
|
96
95
|
this.setState({
|
|
97
96
|
services
|
|
98
97
|
});
|
|
@@ -101,12 +100,11 @@ class SmartServices extends Component {
|
|
|
101
100
|
});
|
|
102
101
|
}
|
|
103
102
|
componentDidMount() {
|
|
104
|
-
var _this$getServices2;
|
|
105
103
|
const {
|
|
106
104
|
auth
|
|
107
105
|
} = this.props;
|
|
108
106
|
this.http = new HTTP(auth, auth.getAPIPath());
|
|
109
|
-
|
|
107
|
+
this.getServices(SmartServices.countFields)?.then(services => {
|
|
110
108
|
if (!services.length) {
|
|
111
109
|
this.setState({
|
|
112
110
|
visible: false
|
|
@@ -115,8 +113,7 @@ class SmartServices extends Component {
|
|
|
115
113
|
}).catch(noop);
|
|
116
114
|
}
|
|
117
115
|
getServices(fields) {
|
|
118
|
-
|
|
119
|
-
return (_this$http = this.http) === null || _this$http === void 0 ? void 0 : _this$http.get(`services/header?fields=${fields}`);
|
|
116
|
+
return this.http?.get(`services/header?fields=${fields}`);
|
|
120
117
|
}
|
|
121
118
|
render() {
|
|
122
119
|
const {
|
package/dist/http/http.js
CHANGED
|
@@ -64,21 +64,18 @@ class HTTP {
|
|
|
64
64
|
return _this._processResponse(response);
|
|
65
65
|
});
|
|
66
66
|
_defineProperty(this, "request", async (url, params) => {
|
|
67
|
-
|
|
68
|
-
let token = await ((_this$requestToken = this.requestToken) === null || _this$requestToken === void 0 ? void 0 : _this$requestToken.call(this));
|
|
67
|
+
let token = await this.requestToken?.();
|
|
69
68
|
let response = await this._performRequest(url, token, params);
|
|
70
69
|
try {
|
|
71
70
|
// Wait for result to catch an HTTP error
|
|
72
71
|
return await this._processResponse(response);
|
|
73
72
|
} catch (error) {
|
|
74
|
-
var _this$shouldRefreshTo;
|
|
75
73
|
if (!(error instanceof HTTPError)) {
|
|
76
74
|
throw error;
|
|
77
75
|
}
|
|
78
|
-
const shouldRefreshToken = error.data.error !== undefined ?
|
|
76
|
+
const shouldRefreshToken = error.data.error !== undefined ? this.shouldRefreshToken?.(error.data.error) : false;
|
|
79
77
|
if (shouldRefreshToken) {
|
|
80
|
-
|
|
81
|
-
token = await ((_this$forceTokenUpdat = this.forceTokenUpdate) === null || _this$forceTokenUpdat === void 0 ? void 0 : _this$forceTokenUpdat.call(this));
|
|
78
|
+
token = await this.forceTokenUpdate?.();
|
|
82
79
|
response = await this._performRequest(url, token, params);
|
|
83
80
|
return this._processResponse(response);
|
|
84
81
|
}
|
|
@@ -182,23 +179,20 @@ class HTTP {
|
|
|
182
179
|
});
|
|
183
180
|
}
|
|
184
181
|
async _processResponse(response) {
|
|
185
|
-
|
|
186
|
-
const contentType = (_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers.get('content-type');
|
|
182
|
+
const contentType = response.headers?.get('content-type');
|
|
187
183
|
const isJson = contentType && contentType.indexOf('application/json') !== -1;
|
|
188
184
|
if (response.status != null && HTTP._isErrorStatus(response.status)) {
|
|
189
185
|
let resJson;
|
|
190
186
|
try {
|
|
191
|
-
|
|
192
|
-
resJson = await (isJson ? (_response$json = response.json) === null || _response$json === void 0 ? void 0 : _response$json.call(response) : (_response$text = response.text) === null || _response$text === void 0 ? void 0 : _response$text.call(response));
|
|
187
|
+
resJson = await (isJson ? response.json?.() : response.text?.());
|
|
193
188
|
} catch (err) {
|
|
194
189
|
// noop
|
|
195
190
|
}
|
|
196
191
|
throw new HTTPError(response, resJson);
|
|
197
192
|
}
|
|
198
193
|
try {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
data: await ((_response$text2 = response.text) === null || _response$text2 === void 0 ? void 0 : _response$text2.call(response))
|
|
194
|
+
const parsedResponse = await (isJson ? response.json?.() : {
|
|
195
|
+
data: await response.text?.()
|
|
202
196
|
});
|
|
203
197
|
this._storeRequestMeta(parsedResponse, response);
|
|
204
198
|
return parsedResponse;
|