@jetbrains/ring-ui-built 7.0.19 → 7.0.21
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/_helpers/_rollupPluginBabelHelpers.js +5 -5
- package/components/_helpers/card.js +5 -5
- package/components/_helpers/input.js +7 -7
- package/components/_helpers/list.js +1 -1
- package/components/_helpers/select__filter.js +2 -2
- package/components/_helpers/sidebar.js +2 -2
- package/components/alert/alert.js +2 -2
- package/components/alert-service/alert-service.js +2 -2
- package/components/analytics/analytics.js +1 -1
- package/components/analytics/analytics__custom-plugin.js +8 -8
- package/components/auth/auth__core.js +54 -54
- package/components/auth/background-flow.js +4 -4
- package/components/auth/iframe-flow.js +7 -7
- package/components/auth/request-builder.js +3 -3
- package/components/auth/response-parser.js +4 -4
- package/components/auth/storage.js +12 -12
- package/components/auth/token-validator.js +7 -7
- package/components/auth/window-flow.js +7 -7
- package/components/auth-dialog/auth-dialog.js +1 -1
- package/components/avatar/avatar.d.ts +2 -0
- package/components/avatar/avatar.js +8 -0
- package/components/avatar-stack/avatar-stack.d.ts +15 -0
- package/components/avatar-stack/avatar-stack.js +117 -0
- package/components/button/button.js +2 -2
- package/components/caret/caret.js +6 -6
- package/components/checkbox/checkbox.js +1 -1
- package/components/clipboard/clipboard-fallback.js +3 -3
- package/components/code/code.js +1 -1
- package/components/collapse/collapse-content.js +2 -2
- package/components/collapse/collapse.js +1 -1
- package/components/data-list/data-list.js +3 -3
- package/components/data-list/item.js +1 -1
- package/components/date-picker/consts.js +1 -1
- package/components/date-picker/date-input.js +5 -5
- package/components/date-picker/date-picker.js +9 -9
- package/components/date-picker/date-popup.js +4 -4
- package/components/date-picker/years.js +1 -1
- package/components/dialog/dialog.js +1 -1
- package/components/dropdown/dropdown.js +4 -4
- package/components/editable-heading/editable-heading.js +4 -4
- package/components/global/focus-sensor-hoc.js +10 -10
- package/components/global/memoize.js +1 -1
- package/components/global/normalize-indent.js +1 -1
- package/components/global/react-dom-renderer.js +1 -1
- package/components/global/schedule-raf.js +1 -1
- package/components/header/profile.js +8 -8
- package/components/header/smart-profile.js +2 -2
- package/components/header/smart-services.js +4 -4
- package/components/http/http.js +9 -9
- package/components/http/http.mock.js +3 -3
- package/components/hub-source/hub-source.js +6 -6
- package/components/hub-source/hub-source__user.js +2 -2
- package/components/hub-source/hub-source__users-groups.js +4 -4
- package/components/i18n/i18n.js +1 -1
- package/components/island/adaptive-island-hoc.js +1 -1
- package/components/island/content.js +3 -3
- package/components/island/header.js +1 -1
- package/components/list/list.js +4 -4
- package/components/list/list__item.js +2 -2
- package/components/list/list__link.js +1 -1
- package/components/list/list__users-groups-source.js +2 -2
- package/components/loader/loader.js +2 -2
- package/components/loader/loader__core.js +27 -27
- package/components/login-dialog/login-dialog.js +1 -1
- package/components/message/message.js +14 -14
- package/components/old-browsers-message/white-list.js +3 -3
- package/components/pager/pager.js +9 -9
- package/components/permissions/permissions.js +7 -7
- package/components/permissions/permissions__cache.js +4 -4
- package/components/popup/popup.js +8 -8
- package/components/popup/position.js +1 -1
- package/components/popup-menu/popup-menu.js +1 -1
- package/components/progress-bar/progress-bar.js +2 -2
- package/components/query-assist/query-assist.js +43 -43
- package/components/radio/radio__item.js +2 -2
- package/components/select/select.js +27 -27
- package/components/select/select__popup.js +9 -9
- package/components/shortcuts/core.js +1 -1
- package/components/slider/slider.js +8 -8
- package/components/slider/slider.utils.js +1 -1
- package/components/storage/storage__local.js +1 -1
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +4 -4
- package/components/table/header-cell.js +2 -2
- package/components/table/multitable.js +7 -7
- package/components/table/row-with-focus-sensor.js +4 -4
- package/components/table/row.js +1 -1
- package/components/table/selection-shortcuts-hoc.js +12 -12
- package/components/table/selection.js +7 -7
- package/components/table/table.js +1 -1
- package/components/tabs/collapsible-tab.js +3 -3
- package/components/tabs/collapsible-tabs.js +6 -6
- package/components/tabs/dumb-tabs.js +1 -1
- package/components/tabs/smart-tabs.js +1 -1
- package/components/tag/tag.js +2 -2
- package/components/tags-input/tags-input.js +17 -17
- package/components/tooltip/tooltip.js +10 -10
- package/components/upload/upload.js +3 -3
- package/components/user-agreement/service.js +3 -3
- package/components/user-agreement/user-agreement.js +8 -8
- package/components/user-card/card.js +2 -2
- package/components/user-card/user-card.js +2 -2
- package/package.json +3 -3
- package/typings.d.ts +5 -0
@@ -9,9 +9,9 @@ class AuthError extends ExtendableError {
|
|
9
9
|
constructor() {
|
10
10
|
let authResponse = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11
11
|
super(authResponse.errorDescription);
|
12
|
-
_defineProperty(this, "code",
|
13
|
-
_defineProperty(this, "uri",
|
14
|
-
_defineProperty(this, "stateId",
|
12
|
+
_defineProperty(this, "code", undefined);
|
13
|
+
_defineProperty(this, "uri", undefined);
|
14
|
+
_defineProperty(this, "stateId", undefined);
|
15
15
|
this.code = authResponse.error;
|
16
16
|
this.uri = authResponse.errorUri;
|
17
17
|
this.stateId = authResponse.state;
|
@@ -28,7 +28,7 @@ class AuthError extends ExtendableError {
|
|
28
28
|
*/
|
29
29
|
class AuthResponseParser {
|
30
30
|
constructor() {
|
31
|
-
_defineProperty(this, "_authResponse",
|
31
|
+
_defineProperty(this, "_authResponse", undefined);
|
32
32
|
this._authResponse = this.readAuthResponseFromURL();
|
33
33
|
}
|
34
34
|
static convertKey(key) {
|
@@ -66,17 +66,17 @@ class AuthStorage {
|
|
66
66
|
* @param {{stateKeyPrefix: string, tokenKey: string, onTokenRemove: Function}} config
|
67
67
|
*/
|
68
68
|
constructor(config) {
|
69
|
-
_defineProperty(this, "messagePrefix",
|
70
|
-
_defineProperty(this, "stateKeyPrefix",
|
71
|
-
_defineProperty(this, "tokenKey",
|
72
|
-
_defineProperty(this, "userKey",
|
73
|
-
_defineProperty(this, "stateTTL",
|
74
|
-
_defineProperty(this, "stateQuota",
|
75
|
-
_defineProperty(this, "_lastMessage",
|
76
|
-
_defineProperty(this, "_stateStorage",
|
77
|
-
_defineProperty(this, "_tokenStorage",
|
78
|
-
_defineProperty(this, "_messagesStorage",
|
79
|
-
_defineProperty(this, "_currentUserStorage",
|
69
|
+
_defineProperty(this, "messagePrefix", undefined);
|
70
|
+
_defineProperty(this, "stateKeyPrefix", undefined);
|
71
|
+
_defineProperty(this, "tokenKey", undefined);
|
72
|
+
_defineProperty(this, "userKey", undefined);
|
73
|
+
_defineProperty(this, "stateTTL", undefined);
|
74
|
+
_defineProperty(this, "stateQuota", undefined);
|
75
|
+
_defineProperty(this, "_lastMessage", undefined);
|
76
|
+
_defineProperty(this, "_stateStorage", undefined);
|
77
|
+
_defineProperty(this, "_tokenStorage", undefined);
|
78
|
+
_defineProperty(this, "_messagesStorage", undefined);
|
79
|
+
_defineProperty(this, "_currentUserStorage", undefined);
|
80
80
|
this.messagePrefix = config.messagePrefix || '';
|
81
81
|
this.stateKeyPrefix = config.stateKeyPrefix || '';
|
82
82
|
this.tokenKey = config.tokenKey || '';
|
@@ -169,7 +169,7 @@ class AuthStorage {
|
|
169
169
|
var _state$created;
|
170
170
|
// Clean old states
|
171
171
|
const state = value;
|
172
|
-
const created = (_state$created = state.created) !== null && _state$created !==
|
172
|
+
const created = (_state$created = state.created) !== null && _state$created !== undefined ? _state$created : Date.now();
|
173
173
|
if (created + this.stateTTL < now) {
|
174
174
|
return this._stateStorage.remove(key);
|
175
175
|
}
|
@@ -9,17 +9,17 @@ import 'core-js/modules/es.string.replace.js';
|
|
9
9
|
class TokenValidationError extends ExtendableError {
|
10
10
|
constructor(message, cause) {
|
11
11
|
super(message);
|
12
|
-
_defineProperty(this, "cause",
|
13
|
-
_defineProperty(this, "authRedirect",
|
12
|
+
_defineProperty(this, "cause", undefined);
|
13
|
+
_defineProperty(this, "authRedirect", undefined);
|
14
14
|
this.cause = cause;
|
15
15
|
this.authRedirect = true;
|
16
16
|
}
|
17
17
|
}
|
18
18
|
class TokenValidator {
|
19
19
|
constructor(config, getUser, storage) {
|
20
|
-
_defineProperty(this, "_getUser",
|
21
|
-
_defineProperty(this, "_config",
|
22
|
-
_defineProperty(this, "_storage",
|
20
|
+
_defineProperty(this, "_getUser", undefined);
|
21
|
+
_defineProperty(this, "_config", undefined);
|
22
|
+
_defineProperty(this, "_storage", undefined);
|
23
23
|
this._getUser = getUser;
|
24
24
|
this._config = config;
|
25
25
|
this._storage = storage;
|
@@ -95,7 +95,7 @@ class TokenValidator {
|
|
95
95
|
const requiredScopes = optionalScopes ? scope.filter(scopeId => !optionalScopes.includes(scopeId)) : scope;
|
96
96
|
const hasAllScopes = requiredScopes.every(scopeId => {
|
97
97
|
var _storedToken$scopes;
|
98
|
-
return (_storedToken$scopes = storedToken.scopes) === null || _storedToken$scopes ===
|
98
|
+
return (_storedToken$scopes = storedToken.scopes) === null || _storedToken$scopes === undefined ? undefined : _storedToken$scopes.includes(scopeId);
|
99
99
|
});
|
100
100
|
if (!hasAllScopes) {
|
101
101
|
throw new TokenValidator.TokenValidationError("Token doesn't match required scopes");
|
@@ -129,7 +129,7 @@ class TokenValidator {
|
|
129
129
|
if (errorResponse.status === CODE.UNAUTHORIZED || TokenValidator.shouldRefreshToken(response.error)) {
|
130
130
|
var _errorResponse$data, _errorResponse$data2;
|
131
131
|
// Token expired
|
132
|
-
throw new TokenValidator.TokenValidationError(response.error || errorResponse.message, (_errorResponse$data = errorResponse.data) !== null && _errorResponse$data !==
|
132
|
+
throw new TokenValidator.TokenValidationError(response.error || errorResponse.message, (_errorResponse$data = errorResponse.data) !== null && _errorResponse$data !== undefined && _errorResponse$data.error ? new Error((_errorResponse$data2 = errorResponse.data) === null || _errorResponse$data2 === undefined ? undefined : _errorResponse$data2.error) : undefined);
|
133
133
|
}
|
134
134
|
// Request unexpectedly failed
|
135
135
|
throw errorResponse;
|
@@ -10,14 +10,14 @@ const CLOSED_CHECK_INTERVAL = 200;
|
|
10
10
|
class WindowFlow {
|
11
11
|
constructor(requestBuilder, storage) {
|
12
12
|
_defineProperty(this, "_timeoutId", undefined);
|
13
|
-
_defineProperty(this, "_requestBuilder",
|
14
|
-
_defineProperty(this, "_storage",
|
15
|
-
_defineProperty(this, "reject",
|
16
|
-
_defineProperty(this, "_loginWindow",
|
17
|
-
_defineProperty(this, "_promise",
|
13
|
+
_defineProperty(this, "_requestBuilder", undefined);
|
14
|
+
_defineProperty(this, "_storage", undefined);
|
15
|
+
_defineProperty(this, "reject", undefined);
|
16
|
+
_defineProperty(this, "_loginWindow", undefined);
|
17
|
+
_defineProperty(this, "_promise", undefined);
|
18
18
|
_defineProperty(this, "checkIsClosed", () => {
|
19
19
|
var _this$_loginWindow;
|
20
|
-
if ((_this$_loginWindow = this._loginWindow) !== null && _this$_loginWindow !==
|
20
|
+
if ((_this$_loginWindow = this._loginWindow) !== null && _this$_loginWindow !== undefined && _this$_loginWindow.closed) {
|
21
21
|
this.stop();
|
22
22
|
return;
|
23
23
|
}
|
@@ -70,7 +70,7 @@ class WindowFlow {
|
|
70
70
|
removeStateListener();
|
71
71
|
removeTokenListener();
|
72
72
|
/* eslint-enable @typescript-eslint/no-use-before-define */
|
73
|
-
(_this$_loginWindow2 = this._loginWindow) === null || _this$_loginWindow2 ===
|
73
|
+
(_this$_loginWindow2 = this._loginWindow) === null || _this$_loginWindow2 === undefined || _this$_loginWindow2.close();
|
74
74
|
clearTimeout(this._timeoutId);
|
75
75
|
};
|
76
76
|
const removeTokenListener = this._storage.onTokenChange(token => {
|
@@ -103,7 +103,7 @@ class AuthDialog extends Component {
|
|
103
103
|
retrying
|
104
104
|
} = this.state;
|
105
105
|
const defaultTitle = serviceName ? loginToCaption : loginCaption;
|
106
|
-
const title = (this.props.title || defaultTitle).replace('%serviceName%', serviceName !== null && serviceName !==
|
106
|
+
const title = (this.props.title || defaultTitle).replace('%serviceName%', serviceName !== null && serviceName !== undefined ? serviceName : '').replace('{{serviceName}}', serviceName !== null && serviceName !== undefined ? serviceName : '');
|
107
107
|
return jsx(Dialog, {
|
108
108
|
label: title,
|
109
109
|
"data-test": "ring-auth-dialog",
|
@@ -3,12 +3,14 @@ import { PureComponent, ImgHTMLAttributes } from 'react';
|
|
3
3
|
* @name Avatar
|
4
4
|
*/
|
5
5
|
export declare enum Size {
|
6
|
+
/** @deprecated */
|
6
7
|
Size18 = 18,
|
7
8
|
Size20 = 20,
|
8
9
|
Size24 = 24,
|
9
10
|
Size28 = 28,
|
10
11
|
Size32 = 32,
|
11
12
|
Size40 = 40,
|
13
|
+
/** @deprecated */
|
12
14
|
Size48 = 48,
|
13
15
|
Size56 = 56
|
14
16
|
}
|
@@ -3,8 +3,10 @@ import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
4
4
|
import { PureComponent } from 'react';
|
5
5
|
import classNames from 'classnames';
|
6
|
+
import deprecate from 'util-deprecate';
|
6
7
|
import { isDataURI, parseQueryString, encodeURL } from '../global/url.js';
|
7
8
|
import { getPixelRatio } from '../global/dom.js';
|
9
|
+
import memoize from '../global/memoize.js';
|
8
10
|
import FallbackAvatar from './fallback-avatar.js';
|
9
11
|
import 'core-js/modules/es.regexp.exec.js';
|
10
12
|
import 'core-js/modules/es.string.replace.js';
|
@@ -18,15 +20,18 @@ const _excluded = ["size", "url", "dpr", "style", "round", "subavatar", "subavat
|
|
18
20
|
*/
|
19
21
|
var Size;
|
20
22
|
(function (Size) {
|
23
|
+
/** @deprecated */
|
21
24
|
Size[Size["Size18"] = 18] = "Size18";
|
22
25
|
Size[Size["Size20"] = 20] = "Size20";
|
23
26
|
Size[Size["Size24"] = 24] = "Size24";
|
24
27
|
Size[Size["Size28"] = 28] = "Size28";
|
25
28
|
Size[Size["Size32"] = 32] = "Size32";
|
26
29
|
Size[Size["Size40"] = 40] = "Size40";
|
30
|
+
/** @deprecated */
|
27
31
|
Size[Size["Size48"] = 48] = "Size48";
|
28
32
|
Size[Size["Size56"] = 56] = "Size56";
|
29
33
|
})(Size || (Size = {}));
|
34
|
+
const warnSize = memoize(size => deprecate(() => {}, "Avatar: Size".concat(size, " is deprecated and will be removed in 8.0. The supported sizes are: Size20, Size24, Size28, Size32, Size40.")));
|
30
35
|
class Avatar extends PureComponent {
|
31
36
|
constructor() {
|
32
37
|
super(...arguments);
|
@@ -58,6 +63,9 @@ class Avatar extends PureComponent {
|
|
58
63
|
skipParams
|
59
64
|
} = _this$props,
|
60
65
|
restProps = _objectWithoutProperties(_this$props, _excluded);
|
66
|
+
if ([Size.Size18, Size.Size48].includes(size)) {
|
67
|
+
warnSize(size)();
|
68
|
+
}
|
61
69
|
const sizeString = "".concat(size, "px");
|
62
70
|
const subavatarSizeString = "".concat(subavatarSize, "px");
|
63
71
|
const borderRadius = size <= Size.Size18 ? 'var(--ring-border-radius-small)' : 'var(--ring-border-radius)';
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
2
|
+
import { ListDataItem } from '../list/consts';
|
3
|
+
import { DropdownMenuProps } from '../dropdown-menu/dropdown-menu';
|
4
|
+
import { Size } from '../avatar/avatar';
|
5
|
+
declare module 'csstype' {
|
6
|
+
interface Properties {
|
7
|
+
'--ring-avatar-stack-index'?: number;
|
8
|
+
}
|
9
|
+
}
|
10
|
+
export interface AvatarProps<T = unknown> extends HTMLAttributes<HTMLDivElement> {
|
11
|
+
size?: Size | undefined;
|
12
|
+
extraItems?: readonly ListDataItem<T>[] | null | undefined;
|
13
|
+
dropdownMenuProps?: DropdownMenuProps<T> | null | undefined;
|
14
|
+
}
|
15
|
+
export default function AvatarStack({ children, className, size, extraItems, dropdownMenuProps, ...restProps }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
@@ -0,0 +1,117 @@
|
|
1
|
+
import { a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
4
|
+
import { useState, Children } from 'react';
|
5
|
+
import classNames from 'classnames';
|
6
|
+
import DropdownMenu from '../dropdown-menu/dropdown-menu.js';
|
7
|
+
import { Size } from '../avatar/avatar.js';
|
8
|
+
import '../list/list.js';
|
9
|
+
import 'core-js/modules/es.symbol.description.js';
|
10
|
+
import 'core-js/modules/es.string.trim.js';
|
11
|
+
import 'react-virtualized/dist/es/List';
|
12
|
+
import 'react-virtualized/dist/es/AutoSizer';
|
13
|
+
import 'react-virtualized/dist/es/WindowScroller';
|
14
|
+
import 'react-virtualized/dist/es/CellMeasurer';
|
15
|
+
import 'util-deprecate';
|
16
|
+
import 'memoize-one';
|
17
|
+
import '../global/data-tests.js';
|
18
|
+
import '../global/get-uid.js';
|
19
|
+
import '../global/schedule-raf.js';
|
20
|
+
import '../global/memoize.js';
|
21
|
+
import '../global/dom.js';
|
22
|
+
import 'core-js/modules/es.regexp.exec.js';
|
23
|
+
import '../shortcuts/shortcuts.js';
|
24
|
+
import '../shortcuts/core.js';
|
25
|
+
import 'combokeys';
|
26
|
+
import '../global/sniffer.js';
|
27
|
+
import 'sniffr';
|
28
|
+
import '../global/create-stateful-context.js';
|
29
|
+
import '../list/list__link.js';
|
30
|
+
import '../link/link.js';
|
31
|
+
import '../link/clickableLink.js';
|
32
|
+
import '../_helpers/link.js';
|
33
|
+
import '../_helpers/list.js';
|
34
|
+
import '../list/list__item.js';
|
35
|
+
import '../checkbox/checkbox.js';
|
36
|
+
import '@jetbrains/icons/checkmark-12px';
|
37
|
+
import '@jetbrains/icons/remove-12px';
|
38
|
+
import '../icon/icon.js';
|
39
|
+
import '../icon/icon__constants.js';
|
40
|
+
import '../_helpers/icon__svg.js';
|
41
|
+
import 'core-js/modules/es.string.replace.js';
|
42
|
+
import '../global/composeRefs.js';
|
43
|
+
import '../control-help/control-help.js';
|
44
|
+
import '../global/url.js';
|
45
|
+
import '../avatar/fallback-avatar.js';
|
46
|
+
import '../list/list__custom.js';
|
47
|
+
import '../global/get-event-key.js';
|
48
|
+
import '../list/list__title.js';
|
49
|
+
import '../list/list__separator.js';
|
50
|
+
import '../list/list__hint.js';
|
51
|
+
import '../list/consts.js';
|
52
|
+
import '../dropdown/dropdown.js';
|
53
|
+
import '../global/typescript-utils.js';
|
54
|
+
import '../_helpers/anchor.js';
|
55
|
+
import '../button/button.js';
|
56
|
+
import '@jetbrains/icons/chevron-down';
|
57
|
+
import '@jetbrains/icons/chevron-12px-down';
|
58
|
+
import '../global/controls-height.js';
|
59
|
+
import '../_helpers/button__classes.js';
|
60
|
+
import '../popup-menu/popup-menu.js';
|
61
|
+
import '../popup/popup.js';
|
62
|
+
import 'react-dom';
|
63
|
+
import '../tab-trap/tab-trap.js';
|
64
|
+
import '../popup/position.js';
|
65
|
+
import 'core-js/modules/es.array.sort.js';
|
66
|
+
import '../popup/popup.consts.js';
|
67
|
+
import '../popup/popup.target.js';
|
68
|
+
|
69
|
+
var styles = {"avatarStack":"avatarStack_rui_9a0c","extraText":"extraText_rui_9a0c resetButton_rui_8bff","item":"item_rui_9a0c","size20":"size20_rui_9a0c","size24":"size24_rui_9a0c","size28":"size28_rui_9a0c","size32":"size32_rui_9a0c","size40":"size40_rui_9a0c","size56":"size56_rui_9a0c","hovered":"hovered_rui_9a0c","extra":"extra_rui_9a0c item_rui_9a0c"};
|
70
|
+
|
71
|
+
const _excluded = ["children", "className", "size", "extraItems", "dropdownMenuProps"];
|
72
|
+
function AvatarStack(_ref) {
|
73
|
+
let {
|
74
|
+
children,
|
75
|
+
className,
|
76
|
+
size = Size.Size20,
|
77
|
+
extraItems,
|
78
|
+
dropdownMenuProps
|
79
|
+
} = _ref,
|
80
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
81
|
+
const [dropdownOpen, setDropdownOpen] = useState(false);
|
82
|
+
return jsxs("div", _objectSpread2(_objectSpread2({
|
83
|
+
className: classNames(styles.avatarStack, className, styles["size".concat(size)], {
|
84
|
+
[styles.hovered]: dropdownOpen
|
85
|
+
})
|
86
|
+
}, restProps), {}, {
|
87
|
+
children: [Children.map(children, (child, index) => jsx("div", {
|
88
|
+
className: styles.item,
|
89
|
+
style: {
|
90
|
+
'--ring-avatar-stack-index': index
|
91
|
+
},
|
92
|
+
children: child
|
93
|
+
})), (extraItems === null || extraItems === undefined ? undefined : extraItems.length) && jsx(DropdownMenu, _objectSpread2({
|
94
|
+
hoverMode: true,
|
95
|
+
hoverShowTimeOut: 10,
|
96
|
+
onShow: () => setDropdownOpen(true),
|
97
|
+
onHide: () => setDropdownOpen(false),
|
98
|
+
className: styles.extra,
|
99
|
+
style: {
|
100
|
+
width: size,
|
101
|
+
height: size,
|
102
|
+
'--ring-avatar-stack-index': Children.count(children)
|
103
|
+
},
|
104
|
+
anchor: jsx("button", {
|
105
|
+
type: "button",
|
106
|
+
className: styles.extraText,
|
107
|
+
children: "+".concat(extraItems.length)
|
108
|
+
}),
|
109
|
+
data: extraItems,
|
110
|
+
menuProps: _objectSpread2({
|
111
|
+
offset: 4
|
112
|
+
}, dropdownMenuProps === null || dropdownMenuProps === undefined ? undefined : dropdownMenuProps.menuProps)
|
113
|
+
}, dropdownMenuProps))]
|
114
|
+
}));
|
115
|
+
}
|
116
|
+
|
117
|
+
export { AvatarStack as default };
|
@@ -57,13 +57,13 @@ class Button extends PureComponent {
|
|
57
57
|
inline
|
58
58
|
} = _this$props,
|
59
59
|
props = _objectWithoutProperties(_this$props, _excluded);
|
60
|
-
const isInline = (_ref = inline !== null && inline !==
|
60
|
+
const isInline = (_ref = inline !== null && inline !== undefined ? inline : text) !== null && _ref !== undefined ? _ref : icon != null;
|
61
61
|
if (text != null) {
|
62
62
|
warnText();
|
63
63
|
}
|
64
64
|
const classes = getButtonClasses(_objectSpread2(_objectSpread2({}, this.props), {}, {
|
65
65
|
inline: isInline,
|
66
|
-
height: height !== null && height !==
|
66
|
+
height: height !== null && height !== undefined ? height : this.context
|
67
67
|
}));
|
68
68
|
const content = jsxs(Fragment, {
|
69
69
|
children: [icon && jsx(Icon, {
|
@@ -19,7 +19,7 @@ class Caret {
|
|
19
19
|
return typeof value === 'string' ? value.replace(this.returnRE, '') : value;
|
20
20
|
}
|
21
21
|
constructor(target) {
|
22
|
-
_defineProperty(this, "target",
|
22
|
+
_defineProperty(this, "target", undefined);
|
23
23
|
this.target = target;
|
24
24
|
}
|
25
25
|
isContentEditable() {
|
@@ -43,7 +43,7 @@ class Caret {
|
|
43
43
|
while (_curNode != null && _curNode !== this.target) {
|
44
44
|
while (_curNode.previousSibling) {
|
45
45
|
var _curNode$previousSibl, _curNode$previousSibl2;
|
46
|
-
curPos += (_curNode$previousSibl = (_curNode$previousSibl2 = _curNode.previousSibling.textContent) === null || _curNode$previousSibl2 ===
|
46
|
+
curPos += (_curNode$previousSibl = (_curNode$previousSibl2 = _curNode.previousSibling.textContent) === null || _curNode$previousSibl2 === undefined ? undefined : _curNode$previousSibl2.length) !== null && _curNode$previousSibl !== undefined ? _curNode$previousSibl : 0;
|
47
47
|
_curNode = _curNode.previousSibling;
|
48
48
|
}
|
49
49
|
_curNode = _curNode.parentNode;
|
@@ -63,7 +63,7 @@ class Caret {
|
|
63
63
|
this.focus();
|
64
64
|
}
|
65
65
|
const selection = window.getSelection();
|
66
|
-
if (!(selection !== null && selection !==
|
66
|
+
if (!(selection !== null && selection !== undefined && selection.rangeCount)) {
|
67
67
|
return 0;
|
68
68
|
}
|
69
69
|
const range1 = selection.getRangeAt(0);
|
@@ -134,11 +134,11 @@ class Caret {
|
|
134
134
|
i++;
|
135
135
|
if (_curNode.childNodes[i] != null) {
|
136
136
|
var _curNode$childNodes$i, _curNode$childNodes$i2;
|
137
|
-
curPos += (_curNode$childNodes$i = (_curNode$childNodes$i2 = _curNode.childNodes[i].textContent) === null || _curNode$childNodes$i2 ===
|
137
|
+
curPos += (_curNode$childNodes$i = (_curNode$childNodes$i2 = _curNode.childNodes[i].textContent) === null || _curNode$childNodes$i2 === undefined ? undefined : _curNode$childNodes$i2.length) !== null && _curNode$childNodes$i !== undefined ? _curNode$childNodes$i : 0;
|
138
138
|
if (curPos >= position) {
|
139
139
|
var _curNode$textContent$, _curNode$textContent;
|
140
140
|
_curNode = _curNode.childNodes[i];
|
141
|
-
curPos -= (_curNode$textContent$ = (_curNode$textContent = _curNode.textContent) === null || _curNode$textContent ===
|
141
|
+
curPos -= (_curNode$textContent$ = (_curNode$textContent = _curNode.textContent) === null || _curNode$textContent === undefined ? undefined : _curNode$textContent.length) !== null && _curNode$textContent$ !== undefined ? _curNode$textContent$ : 0;
|
142
142
|
i = -1;
|
143
143
|
}
|
144
144
|
} else {
|
@@ -172,7 +172,7 @@ class Caret {
|
|
172
172
|
} else if (position === -1) {
|
173
173
|
var _value$length;
|
174
174
|
const value = isContentEditable ? this.target.textContent : Caret.normalizeNewlines('value' in this.target ? this.target.value : undefined);
|
175
|
-
correctedPosition = (_value$length = value === null || value ===
|
175
|
+
correctedPosition = (_value$length = value === null || value === undefined ? undefined : value.length) !== null && _value$length !== undefined ? _value$length : 0;
|
176
176
|
} else {
|
177
177
|
const {
|
178
178
|
_curNode,
|
@@ -28,7 +28,7 @@ const _excluded = ["children", "label", "className", "containerClassName", "cont
|
|
28
28
|
class Checkbox extends PureComponent {
|
29
29
|
constructor() {
|
30
30
|
super(...arguments);
|
31
|
-
_defineProperty(this, "input",
|
31
|
+
_defineProperty(this, "input", undefined);
|
32
32
|
_defineProperty(this, "inputRef", el => {
|
33
33
|
if (el != null) {
|
34
34
|
el.indeterminate = this.props.indeterminate;
|
@@ -26,12 +26,12 @@ function copyHTMLToClipboard(str) {
|
|
26
26
|
const selection = document.getSelection();
|
27
27
|
// Should restore previous selection
|
28
28
|
const selected = selection && selection.rangeCount > 0 ? selection.getRangeAt(0) : false;
|
29
|
-
selection === null || selection ===
|
29
|
+
selection === null || selection === undefined || selection.removeAllRanges();
|
30
30
|
const range = document.createRange();
|
31
31
|
range.selectNode(el);
|
32
|
-
selection === null || selection ===
|
32
|
+
selection === null || selection === undefined || selection.addRange(range);
|
33
33
|
document.execCommand('copy');
|
34
|
-
selection === null || selection ===
|
34
|
+
selection === null || selection === undefined || selection.removeAllRanges();
|
35
35
|
document.execCommand('copy');
|
36
36
|
document.body.removeChild(el);
|
37
37
|
if (selected && selection) {
|
package/components/code/code.js
CHANGED
@@ -26,7 +26,7 @@ const registerLanguage = memoize(async language => {
|
|
26
26
|
class Code extends PureComponent {
|
27
27
|
constructor() {
|
28
28
|
super(...arguments);
|
29
|
-
_defineProperty(this, "code",
|
29
|
+
_defineProperty(this, "code", undefined);
|
30
30
|
}
|
31
31
|
componentDidMount() {
|
32
32
|
this.highlight();
|
@@ -49,9 +49,9 @@ const CollapseContent = _ref => {
|
|
49
49
|
}
|
50
50
|
}
|
51
51
|
const container = containerRef.current;
|
52
|
-
container === null || container ===
|
52
|
+
container === null || container === undefined || container.addEventListener('transitionend', onTransitionEnd);
|
53
53
|
return () => {
|
54
|
-
container === null || container ===
|
54
|
+
container === null || container === undefined || container.removeEventListener('transitionend', onTransitionEnd);
|
55
55
|
};
|
56
56
|
}, [collapsed]);
|
57
57
|
useEffect(() => {
|
@@ -19,7 +19,7 @@ const Collapse = _ref => {
|
|
19
19
|
} = _ref;
|
20
20
|
const [innerCollapsed, setInnerCollapsed] = useState(defaultCollapsed);
|
21
21
|
const id = useId();
|
22
|
-
const finalCollapsedValue = useMemo(() => collapsed !== null && collapsed !==
|
22
|
+
const finalCollapsedValue = useMemo(() => collapsed !== null && collapsed !== undefined ? collapsed : innerCollapsed, [innerCollapsed, collapsed]);
|
23
23
|
const setCollapsed = useCallback(() => {
|
24
24
|
setInnerCollapsed(!finalCollapsedValue);
|
25
25
|
onChange(!finalCollapsedValue);
|
@@ -77,10 +77,10 @@ class DataList extends PureComponent {
|
|
77
77
|
const item = itemFormatter(focused);
|
78
78
|
if (item.collapsed) {
|
79
79
|
var _item$onExpand;
|
80
|
-
(_item$onExpand = item.onExpand) === null || _item$onExpand ===
|
80
|
+
(_item$onExpand = item.onExpand) === null || _item$onExpand === undefined || _item$onExpand.call(item);
|
81
81
|
} else {
|
82
82
|
var _item$onCollapse;
|
83
|
-
(_item$onCollapse = item.onCollapse) === null || _item$onCollapse ===
|
83
|
+
(_item$onCollapse = item.onCollapse) === null || _item$onCollapse === undefined || _item$onCollapse.call(item);
|
84
84
|
}
|
85
85
|
});
|
86
86
|
_defineProperty(this, "shortcutsMap", {
|
@@ -138,7 +138,7 @@ class DataList extends PureComponent {
|
|
138
138
|
title,
|
139
139
|
items
|
140
140
|
} = item;
|
141
|
-
const showMoreLessButton = (_this$props$itemMoreL = (_this$props = this.props).itemMoreLessState) === null || _this$props$itemMoreL ===
|
141
|
+
const showMoreLessButton = (_this$props$itemMoreL = (_this$props = this.props).itemMoreLessState) === null || _this$props$itemMoreL === undefined ? undefined : _this$props$itemMoreL.call(_this$props, item);
|
142
142
|
return jsx(Item, {
|
143
143
|
item: model,
|
144
144
|
title: title,
|
@@ -162,7 +162,7 @@ class Item extends PureComponent {
|
|
162
162
|
});
|
163
163
|
}
|
164
164
|
}
|
165
|
-
const itemIsEmpty = !(items !== null && items !==
|
165
|
+
const itemIsEmpty = !(items !== null && items !== undefined && items.length) || collapsible && collapsed;
|
166
166
|
const offset = level * LIST_LEFT_OFFSET + ITEM_LEFT_OFFSET + parentShift;
|
167
167
|
return jsxs("li", {
|
168
168
|
children: [jsx(Title, {
|
@@ -45,7 +45,7 @@ function shiftWeekArray(arr, startOfWeek) {
|
|
45
45
|
}
|
46
46
|
function getWeekStartsOn(locale) {
|
47
47
|
var _locale$options$weekS, _locale$options;
|
48
|
-
return (_locale$options$weekS = locale === null || locale ===
|
48
|
+
return (_locale$options$weekS = locale === null || locale === undefined || (_locale$options = locale.options) === null || _locale$options === undefined ? undefined : _locale$options.weekStartsOn) !== null && _locale$options$weekS !== undefined ? _locale$options$weekS : weekdays.MO;
|
49
49
|
}
|
50
50
|
function getDayNumInWeek(locale, day) {
|
51
51
|
const weekDays = shiftWeekArray(Object.values(weekdays), getWeekStartsOn(locale));
|
@@ -30,7 +30,7 @@ import '../i18n/i18n.js';
|
|
30
30
|
class DateInput extends React.PureComponent {
|
31
31
|
constructor() {
|
32
32
|
super(...arguments);
|
33
|
-
_defineProperty(this, "input",
|
33
|
+
_defineProperty(this, "input", undefined);
|
34
34
|
_defineProperty(this, "inputRef", el => {
|
35
35
|
this.input = el;
|
36
36
|
});
|
@@ -113,13 +113,13 @@ class DateInput extends React.PureComponent {
|
|
113
113
|
const placeholder = ((_translations$addFirs, _translations$addSeco, _translations$addTime, _translations$selectN) => {
|
114
114
|
switch (name) {
|
115
115
|
case 'from':
|
116
|
-
return fromPlaceholder || ((_translations$addFirs = translations === null || translations ===
|
116
|
+
return fromPlaceholder || ((_translations$addFirs = translations === null || translations === undefined ? undefined : translations.addFirstDate) !== null && _translations$addFirs !== undefined ? _translations$addFirs : translate('addFirstDate'));
|
117
117
|
case 'to':
|
118
|
-
return toPlaceholder || ((_translations$addSeco = translations === null || translations ===
|
118
|
+
return toPlaceholder || ((_translations$addSeco = translations === null || translations === undefined ? undefined : translations.addSecondDate) !== null && _translations$addSeco !== undefined ? _translations$addSeco : translate('addSecondDate'));
|
119
119
|
case 'time':
|
120
|
-
return timePlaceholder || ((_translations$addTime = translations === null || translations ===
|
120
|
+
return timePlaceholder || ((_translations$addTime = translations === null || translations === undefined ? undefined : translations.addTime) !== null && _translations$addTime !== undefined ? _translations$addTime : translate('addTime'));
|
121
121
|
default:
|
122
|
-
return ((_translations$selectN = translations === null || translations ===
|
122
|
+
return ((_translations$selectN = translations === null || translations === undefined ? undefined : translations.selectName) !== null && _translations$selectN !== undefined ? _translations$selectN : translate('selectName')).replace('%name%', name).replace('{{name}}', name);
|
123
123
|
}
|
124
124
|
})();
|
125
125
|
const classes = classNames(styles.filter, styles["".concat(name, "Input")], divider && styles["".concat(name, "InputWithDivider")], 'ring-js-shortcuts');
|
@@ -128,7 +128,7 @@ class DatePicker extends PureComponent {
|
|
128
128
|
withTime,
|
129
129
|
applyTimeInput
|
130
130
|
} = this.props;
|
131
|
-
const adjustedChange = withTime && !(change instanceof Date) && (change === null || change ===
|
131
|
+
const adjustedChange = withTime && !(change instanceof Date) && (change === null || change === undefined ? undefined : change.date) != null ? applyTimeInput(change.date, change.time) : change;
|
132
132
|
onChange(adjustedChange);
|
133
133
|
});
|
134
134
|
_defineProperty(this, "clear", () => {
|
@@ -141,13 +141,13 @@ class DatePicker extends PureComponent {
|
|
141
141
|
}
|
142
142
|
this.handleChange(change);
|
143
143
|
});
|
144
|
-
_defineProperty(this, "popup",
|
144
|
+
_defineProperty(this, "popup", undefined);
|
145
145
|
_defineProperty(this, "popupRef", el => {
|
146
146
|
this.popup = el;
|
147
147
|
});
|
148
148
|
_defineProperty(this, "closePopup", () => {
|
149
149
|
var _this$popup;
|
150
|
-
(_this$popup = this.popup) === null || _this$popup ===
|
150
|
+
(_this$popup = this.popup) === null || _this$popup === undefined || _this$popup._onCloseAttempt();
|
151
151
|
});
|
152
152
|
_defineProperty(this, "parse", memoize(date => {
|
153
153
|
const {
|
@@ -183,11 +183,11 @@ class DatePicker extends PureComponent {
|
|
183
183
|
const time = this.formatTime();
|
184
184
|
if (!range && !withTime) {
|
185
185
|
var _ref2;
|
186
|
-
return date ? displayFormat(date, locale) : (_ref2 = datePlaceholder !== null && datePlaceholder !==
|
186
|
+
return date ? displayFormat(date, locale) : (_ref2 = datePlaceholder !== null && datePlaceholder !== undefined ? datePlaceholder : translations === null || translations === undefined ? undefined : translations.setDate) !== null && _ref2 !== undefined ? _ref2 : translate('setDate');
|
187
187
|
} else if (!range && withTime) {
|
188
188
|
if (!date && !time) {
|
189
189
|
var _ref3;
|
190
|
-
return (_ref3 = dateTimePlaceholder !== null && dateTimePlaceholder !==
|
190
|
+
return (_ref3 = dateTimePlaceholder !== null && dateTimePlaceholder !== undefined ? dateTimePlaceholder : translations === null || translations === undefined ? undefined : translations.setDateTime) !== null && _ref3 !== undefined ? _ref3 : translate('setDateTime');
|
191
191
|
} else {
|
192
192
|
return "".concat(date && displayFormat(date, locale) || '—', ", ").concat(time || '—');
|
193
193
|
}
|
@@ -207,7 +207,7 @@ class DatePicker extends PureComponent {
|
|
207
207
|
return "\u2014 ".concat(displayFormat(to, locale));
|
208
208
|
} else {
|
209
209
|
var _ref4;
|
210
|
-
return (_ref4 = rangePlaceholder !== null && rangePlaceholder !==
|
210
|
+
return (_ref4 = rangePlaceholder !== null && rangePlaceholder !== undefined ? rangePlaceholder : translations === null || translations === undefined ? undefined : translations.setPeriod) !== null && _ref4 !== undefined ? _ref4 : translate('setPeriod');
|
211
211
|
}
|
212
212
|
});
|
213
213
|
}
|
@@ -254,14 +254,14 @@ class DatePicker extends PureComponent {
|
|
254
254
|
anchor: inline ? jsx(Link, {
|
255
255
|
"data-test-ring-dropdown-anchor": true,
|
256
256
|
className: styles.anchor,
|
257
|
-
disabled: (_this$props$disabled = this.props.disabled) !== null && _this$props$disabled !==
|
257
|
+
disabled: (_this$props$disabled = this.props.disabled) !== null && _this$props$disabled !== undefined ? _this$props$disabled : false,
|
258
258
|
pseudo: true,
|
259
259
|
children: this.getAnchorText()
|
260
260
|
}) : jsx(Button, _objectSpread2(_objectSpread2({
|
261
261
|
"data-test-ring-dropdown-anchor": true,
|
262
262
|
className: styles.anchor,
|
263
263
|
inline: false,
|
264
|
-
disabled: (_this$props$disabled2 = this.props.disabled) !== null && _this$props$disabled2 !==
|
264
|
+
disabled: (_this$props$disabled2 = this.props.disabled) !== null && _this$props$disabled2 !== undefined ? _this$props$disabled2 : false
|
265
265
|
}, this.props.buttonAttributes), {}, {
|
266
266
|
children: anchorContent
|
267
267
|
}))
|
@@ -308,7 +308,7 @@ _defineProperty(DatePicker, "defaultProps", {
|
|
308
308
|
onChange() {},
|
309
309
|
applyTimeInput(date, timeString) {
|
310
310
|
var _timeString$split$map;
|
311
|
-
const [hours, minutes] = (_timeString$split$map = timeString === null || timeString ===
|
311
|
+
const [hours, minutes] = (_timeString$split$map = timeString === null || timeString === undefined ? undefined : timeString.split(':').map(Number)) !== null && _timeString$split$map !== undefined ? _timeString$split$map : [];
|
312
312
|
return minutes != null ? set(date, {
|
313
313
|
hours,
|
314
314
|
minutes
|