@jetbrains/ring-ui 5.0.137 → 5.0.138

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.
Files changed (86) hide show
  1. package/components/auth/auth__core.d.ts +1 -1
  2. package/components/auth/auth__core.js +21 -26
  3. package/components/auth-dialog/auth-dialog.js +3 -1
  4. package/components/date-picker/date-input.js +3 -1
  5. package/components/editable-heading/editable-heading.css +7 -3
  6. package/components/editable-heading/editable-heading.js +29 -8
  7. package/components/global/react-render-adapter.js +16 -31
  8. package/components/header/profile.d.ts +54 -1
  9. package/components/header/profile.js +15 -11
  10. package/components/i18n/README.md +3 -0
  11. package/components/i18n/i18n-context.d.ts +54 -0
  12. package/components/i18n/i18n-context.js +3 -0
  13. package/components/i18n/i18n.d.ts +56 -0
  14. package/components/i18n/i18n.js +8 -0
  15. package/components/i18n/messages.json +53 -0
  16. package/components/input/input.d.ts +1 -4
  17. package/components/input/input.js +16 -16
  18. package/components/message/message.d.ts +1 -5
  19. package/components/message/message.js +15 -16
  20. package/components/pager/pager.d.ts +54 -8
  21. package/components/pager/pager.js +10 -12
  22. package/components/query-assist/query-assist.d.ts +1 -5
  23. package/components/query-assist/query-assist.js +30 -29
  24. package/components/select/select.d.ts +2 -4
  25. package/components/select/select.js +14 -11
  26. package/components/select/select__filter.d.ts +0 -1
  27. package/components/select/select__filter.js +4 -2
  28. package/components/user-agreement/user-agreement.d.ts +1 -9
  29. package/components/user-agreement/user-agreement.js +31 -30
  30. package/components/user-card/card.d.ts +65 -13
  31. package/components/user-card/card.js +19 -22
  32. package/dist/_helpers/card.js +19 -28
  33. package/dist/_helpers/select__filter.js +14 -10
  34. package/dist/auth/auth.js +1 -0
  35. package/dist/auth/auth__core.d.ts +1 -1
  36. package/dist/auth/auth__core.js +19 -27
  37. package/dist/auth/landing.js +1 -0
  38. package/dist/auth-dialog/auth-dialog.js +1 -1
  39. package/dist/auth-ng/auth-ng.js +1 -0
  40. package/dist/date-picker/date-input.js +3 -1
  41. package/dist/date-picker/date-picker.js +2 -0
  42. package/dist/date-picker/date-popup.js +2 -0
  43. package/dist/editable-heading/editable-heading.js +32 -9
  44. package/dist/global/react-render-adapter.js +0 -2
  45. package/dist/header/header.js +2 -0
  46. package/dist/header/profile.d.ts +54 -1
  47. package/dist/header/profile.js +22 -15
  48. package/dist/header/smart-profile.js +2 -0
  49. package/dist/header/smart-services.js +1 -0
  50. package/dist/i18n/i18n-context.d.ts +54 -0
  51. package/dist/i18n/i18n-context.js +6 -0
  52. package/dist/i18n/i18n.d.ts +56 -0
  53. package/dist/i18n/i18n.js +114 -0
  54. package/dist/input/input.d.ts +1 -4
  55. package/dist/input/input.js +6 -7
  56. package/dist/message/message.d.ts +1 -5
  57. package/dist/message/message.js +5 -7
  58. package/dist/pager/pager.d.ts +54 -8
  59. package/dist/pager/pager.js +19 -15
  60. package/dist/pager-ng/pager-ng.js +2 -0
  61. package/dist/permissions-ng/permissions-ng.js +1 -0
  62. package/dist/query-assist/query-assist.d.ts +1 -5
  63. package/dist/query-assist/query-assist.js +22 -19
  64. package/dist/query-assist-ng/query-assist-ng.js +2 -0
  65. package/dist/select/select.d.ts +2 -4
  66. package/dist/select/select.js +49 -45
  67. package/dist/select/select__filter.d.ts +0 -1
  68. package/dist/select/select__filter.js +2 -0
  69. package/dist/select/select__popup.js +2 -0
  70. package/dist/select-ng/select-ng.js +2 -0
  71. package/dist/select-ng/select-ng__lazy.js +2 -0
  72. package/dist/style.css +1 -1
  73. package/dist/table-legacy-ng/table-legacy-ng.js +2 -0
  74. package/dist/table-legacy-ng/table-legacy-ng__pager.js +2 -0
  75. package/dist/tags-input/tags-input.js +2 -0
  76. package/dist/tags-input-ng/tags-input-ng.js +2 -0
  77. package/dist/user-agreement/service.js +2 -0
  78. package/dist/user-agreement/user-agreement.d.ts +1 -9
  79. package/dist/user-agreement/user-agreement.js +11 -17
  80. package/dist/user-card/card.d.ts +65 -13
  81. package/dist/user-card/card.js +2 -0
  82. package/dist/user-card/smart-user-card-tooltip.js +2 -0
  83. package/dist/user-card/tooltip.js +2 -0
  84. package/dist/user-card/user-card.js +2 -0
  85. package/dist/user-card-ng/user-card-ng.js +2 -0
  86. package/package.json +22 -22
@@ -6,6 +6,7 @@ import Avatar, { Size } from '../avatar/avatar.js';
6
6
  import { Button } from '../button/button.js';
7
7
  import DropdownMenu from '../dropdown-menu/dropdown-menu.js';
8
8
  import PopupMenu from '../popup-menu/popup-menu.js';
9
+ import { I18nContext } from '../i18n/i18n-context.js';
9
10
  import { isTruthy } from '../global/typescript-utils.js';
10
11
  import { m as modules_47759f5e } from '../_helpers/header.js';
11
12
  import '../global/url.js';
@@ -61,6 +62,7 @@ import '../tab-trap/tab-trap.js';
61
62
  import '../popup/position.js';
62
63
  import '../popup/popup.consts.js';
63
64
  import '../popup/popup.target.js';
65
+ import '../i18n/i18n.js';
64
66
 
65
67
  const rgItemType = PopupMenu.ListProps.Type.LINK;
66
68
  class Profile extends PureComponent {
@@ -99,7 +101,6 @@ class Profile extends PureComponent {
99
101
  static defaultProps = {
100
102
  closeOnSelect: true,
101
103
  renderPopupItems: items => items,
102
- translations: {},
103
104
  size: Size.Size32,
104
105
  renderGuest: _ref => {
105
106
  let {
@@ -108,19 +109,24 @@ class Profile extends PureComponent {
108
109
  className,
109
110
  translations
110
111
  } = _ref;
111
- return /*#__PURE__*/React.createElement("div", {
112
- className: classNames(modules_47759f5e.profileEmpty, className)
113
- }, /*#__PURE__*/React.createElement(Button, {
114
- primary: true,
115
- "data-test": "ring-header-login-button",
116
- disabled: loading,
117
- loader: loading,
118
- onClick: onLogin
119
- }, translations.login || 'Log in...'));
112
+ return /*#__PURE__*/React.createElement(I18nContext.Consumer, null, messages => {
113
+ var _translations$login;
114
+ return /*#__PURE__*/React.createElement("div", {
115
+ className: classNames(modules_47759f5e.profileEmpty, className)
116
+ }, /*#__PURE__*/React.createElement(Button, {
117
+ primary: true,
118
+ "data-test": "ring-header-login-button",
119
+ disabled: loading,
120
+ loader: loading,
121
+ onClick: onLogin
122
+ }, (_translations$login = translations?.login) !== null && _translations$login !== void 0 ? _translations$login : messages.login));
123
+ });
120
124
  }
121
125
  };
126
+ static contextType = I18nContext;
122
127
  static Size = Size;
123
128
  render() {
129
+ var _translations$applyCh, _translations$login2, _translations$profile, _translations$switchU, _translations$logout;
124
130
  const {
125
131
  className,
126
132
  closeOnSelect,
@@ -144,6 +150,7 @@ class Profile extends PureComponent {
144
150
  onLogin,
145
151
  ...props
146
152
  } = this.props;
153
+ const messages = this.context;
147
154
  if (!user) {
148
155
  return /*#__PURE__*/React.createElement("div", _extends({}, props, {
149
156
  className: classNames(modules_47759f5e.profileEmpty, className)
@@ -168,28 +175,28 @@ class Profile extends PureComponent {
168
175
  }));
169
176
  const items = [showApplyChangedUser && {
170
177
  rgItemType,
171
- label: translations.applyChangedUser || 'Apply changed user',
178
+ label: (_translations$applyCh = translations?.applyChangedUser) !== null && _translations$applyCh !== void 0 ? _translations$applyCh : messages.applyChangedUser,
172
179
  className: modules_47759f5e.profileMenuItem,
173
180
  onClick: onRevertPostponement
174
181
  }, showLogIn && {
175
182
  rgItemType,
176
- label: translations.login || 'Log in',
183
+ label: (_translations$login2 = translations?.login) !== null && _translations$login2 !== void 0 ? _translations$login2 : messages.login,
177
184
  className: modules_47759f5e.profileMenuItem,
178
185
  onClick: onRevertPostponement
179
186
  }, {
180
187
  rgItemType: PopupMenu.ListProps.Type.LINK,
181
- label: translations.profile || 'Profile',
188
+ label: (_translations$profile = translations?.profile) !== null && _translations$profile !== void 0 ? _translations$profile : messages.profile,
182
189
  target: '_self',
183
190
  href: profileUrl,
184
191
  LinkComponent
185
192
  }, showSwitchUser && {
186
193
  rgItemType,
187
- label: translations.switchUser || 'Switch user',
194
+ label: (_translations$switchU = translations?.switchUser) !== null && _translations$switchU !== void 0 ? _translations$switchU : messages.switchUser,
188
195
  className: modules_47759f5e.profileMenuItem,
189
196
  onClick: onSwitchUser
190
197
  }, showLogOut && {
191
198
  rgItemType,
192
- label: translations.logout || 'Log out',
199
+ label: (_translations$logout = translations?.logout) !== null && _translations$logout !== void 0 ? _translations$logout : messages.logout,
193
200
  onClick: onLogout
194
201
  }].filter(isTruthy);
195
202
  return /*#__PURE__*/React.createElement(DropdownMenu, _extends({}, props, {
@@ -54,6 +54,7 @@ import '../global/react-render-adapter.js';
54
54
  import '../global/listeners.js';
55
55
  import '../http/http.js';
56
56
  import '../global/promise-with-timeout.js';
57
+ import '../i18n/i18n.js';
57
58
  import '../auth/storage.js';
58
59
  import '../storage/storage.js';
59
60
  import '../storage/storage__local.js';
@@ -92,6 +93,7 @@ import '../dropdown/dropdown.js';
92
93
  import '../global/typescript-utils.js';
93
94
  import '../_helpers/anchor.js';
94
95
  import '../popup-menu/popup-menu.js';
96
+ import '../i18n/i18n-context.js';
95
97
  import '../_helpers/header.js';
96
98
 
97
99
  const CERTIFICATE_MISMATCH_HEADER = 'x-client-certificate-token-mismatch';
@@ -54,6 +54,7 @@ import '../group/group.js';
54
54
  import '../_helpers/group.js';
55
55
  import '../global/listeners.js';
56
56
  import '../global/promise-with-timeout.js';
57
+ import '../i18n/i18n.js';
57
58
  import '../auth/storage.js';
58
59
  import '../storage/storage.js';
59
60
  import '../storage/storage__local.js';
@@ -0,0 +1,54 @@
1
+ import React from 'react';
2
+ export declare const I18nContext: React.Context<{
3
+ login: string;
4
+ logout: string;
5
+ loginTo: string;
6
+ ok: string;
7
+ cancel: string;
8
+ tryAgainLabel: string;
9
+ postpone: string;
10
+ youHaveLoggedInAs: string;
11
+ applyChange: string;
12
+ backendIsNotAvailable: string;
13
+ checkAgain: string;
14
+ nothingHappensLink: string;
15
+ errorMessage: string;
16
+ applyChangedUser: string;
17
+ profile: string;
18
+ switchUser: string;
19
+ addFirstDate: string;
20
+ addSecondDate: string;
21
+ addTime: string;
22
+ selectName: string;
23
+ setDate: string;
24
+ setDateTime: string;
25
+ setPeriod: string;
26
+ clear: string;
27
+ gotIt: string;
28
+ dismiss: string;
29
+ perPage: string;
30
+ firstPage: string;
31
+ lastPage: string;
32
+ nextPage: string;
33
+ previousPage: string;
34
+ searchTitle: string;
35
+ clearTitle: string;
36
+ userAgreement: string;
37
+ accept: string;
38
+ decline: string;
39
+ close: string;
40
+ scrollToAccept: string;
41
+ remindLater: string;
42
+ filterItems: string;
43
+ selectOption: string;
44
+ progress: string;
45
+ loading: string;
46
+ noOptionsFound: string;
47
+ banned: string;
48
+ online: string;
49
+ offline: string;
50
+ copyToClipboard: string;
51
+ copiedToClipboard: string;
52
+ copingToClipboardError: string;
53
+ unverified: string;
54
+ }>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { getTranslations } from './i18n.js';
3
+
4
+ const I18nContext = /*#__PURE__*/React.createContext(getTranslations());
5
+
6
+ export { I18nContext };
@@ -0,0 +1,56 @@
1
+ import defaultMessages from './messages.json';
2
+ export type Messages = typeof defaultMessages;
3
+ export declare function setTranslations(newMessages: Messages): void;
4
+ export declare function getTranslations(): {
5
+ login: string;
6
+ logout: string;
7
+ loginTo: string;
8
+ ok: string;
9
+ cancel: string;
10
+ tryAgainLabel: string;
11
+ postpone: string;
12
+ youHaveLoggedInAs: string;
13
+ applyChange: string;
14
+ backendIsNotAvailable: string;
15
+ checkAgain: string;
16
+ nothingHappensLink: string;
17
+ errorMessage: string;
18
+ applyChangedUser: string;
19
+ profile: string;
20
+ switchUser: string;
21
+ addFirstDate: string;
22
+ addSecondDate: string;
23
+ addTime: string;
24
+ selectName: string;
25
+ setDate: string;
26
+ setDateTime: string;
27
+ setPeriod: string;
28
+ clear: string;
29
+ gotIt: string;
30
+ dismiss: string;
31
+ perPage: string;
32
+ firstPage: string;
33
+ lastPage: string;
34
+ nextPage: string;
35
+ previousPage: string;
36
+ searchTitle: string;
37
+ clearTitle: string;
38
+ userAgreement: string;
39
+ accept: string;
40
+ decline: string;
41
+ close: string;
42
+ scrollToAccept: string;
43
+ remindLater: string;
44
+ filterItems: string;
45
+ selectOption: string;
46
+ progress: string;
47
+ loading: string;
48
+ noOptionsFound: string;
49
+ banned: string;
50
+ online: string;
51
+ offline: string;
52
+ copyToClipboard: string;
53
+ copiedToClipboard: string;
54
+ copingToClipboardError: string;
55
+ unverified: string;
56
+ };
@@ -0,0 +1,114 @@
1
+ var login = "Log in";
2
+ var logout = "Log out";
3
+ var loginTo = "Log in to {{serviceName}}";
4
+ var ok = "OK";
5
+ var cancel = "Cancel";
6
+ var tryAgainLabel = "Try again";
7
+ var postpone = "Postpone";
8
+ var youHaveLoggedInAs = "You have logged in as another user: {{userName}}";
9
+ var applyChange = "Apply change";
10
+ var backendIsNotAvailable = "Connection lost";
11
+ var checkAgain = "try again";
12
+ var nothingHappensLink = "Click here if nothing happens";
13
+ var errorMessage = "There may be a problem with your network connection. Make sure that you are online and";
14
+ var applyChangedUser = "Apply changed user";
15
+ var profile = "Profile";
16
+ var switchUser = "Switch user";
17
+ var addFirstDate = "Add first date";
18
+ var addSecondDate = "Add second date";
19
+ var addTime = "Add time";
20
+ var selectName = "Select {{name}}";
21
+ var setDate = "Set a date";
22
+ var setDateTime = "Set date and time";
23
+ var setPeriod = "Set a period";
24
+ var clear = "Clear input";
25
+ var gotIt = "Got it";
26
+ var dismiss = "Dismiss";
27
+ var perPage = "per page";
28
+ var firstPage = "First page";
29
+ var lastPage = "Last page";
30
+ var nextPage = "Next page";
31
+ var previousPage = "Previous";
32
+ var searchTitle = "Search";
33
+ var clearTitle = "Clear search input";
34
+ var userAgreement = "User Agreement";
35
+ var accept = "Accept";
36
+ var decline = "Decline";
37
+ var close = "Close";
38
+ var scrollToAccept = "View the entire agreement to continue";
39
+ var remindLater = "Remind me later";
40
+ var filterItems = "Filter items";
41
+ var selectOption = "Select an option";
42
+ var progress = "Progress";
43
+ var loading = "Loading...";
44
+ var noOptionsFound = "No options found";
45
+ var banned = "banned";
46
+ var online = "online";
47
+ var offline = "offline";
48
+ var copyToClipboard = "Copy email to clipboard";
49
+ var copiedToClipboard = "Email was copied to clipboard";
50
+ var copingToClipboardError = "Failed to copy to clipboard";
51
+ var unverified = "Unverified";
52
+ var defaultMessages = {
53
+ login: login,
54
+ logout: logout,
55
+ loginTo: loginTo,
56
+ ok: ok,
57
+ cancel: cancel,
58
+ tryAgainLabel: tryAgainLabel,
59
+ postpone: postpone,
60
+ youHaveLoggedInAs: youHaveLoggedInAs,
61
+ applyChange: applyChange,
62
+ backendIsNotAvailable: backendIsNotAvailable,
63
+ checkAgain: checkAgain,
64
+ nothingHappensLink: nothingHappensLink,
65
+ errorMessage: errorMessage,
66
+ applyChangedUser: applyChangedUser,
67
+ profile: profile,
68
+ switchUser: switchUser,
69
+ addFirstDate: addFirstDate,
70
+ addSecondDate: addSecondDate,
71
+ addTime: addTime,
72
+ selectName: selectName,
73
+ setDate: setDate,
74
+ setDateTime: setDateTime,
75
+ setPeriod: setPeriod,
76
+ clear: clear,
77
+ gotIt: gotIt,
78
+ dismiss: dismiss,
79
+ perPage: perPage,
80
+ firstPage: firstPage,
81
+ lastPage: lastPage,
82
+ nextPage: nextPage,
83
+ previousPage: previousPage,
84
+ searchTitle: searchTitle,
85
+ clearTitle: clearTitle,
86
+ userAgreement: userAgreement,
87
+ accept: accept,
88
+ decline: decline,
89
+ close: close,
90
+ scrollToAccept: scrollToAccept,
91
+ remindLater: remindLater,
92
+ filterItems: filterItems,
93
+ selectOption: selectOption,
94
+ progress: progress,
95
+ loading: loading,
96
+ noOptionsFound: noOptionsFound,
97
+ banned: banned,
98
+ online: online,
99
+ offline: offline,
100
+ copyToClipboard: copyToClipboard,
101
+ copiedToClipboard: copiedToClipboard,
102
+ copingToClipboardError: copingToClipboardError,
103
+ unverified: unverified
104
+ };
105
+
106
+ let messages = defaultMessages;
107
+ function setTranslations(newMessages) {
108
+ messages = newMessages;
109
+ }
110
+ function getTranslations() {
111
+ return messages;
112
+ }
113
+
114
+ export { getTranslations, setTranslations };
@@ -28,7 +28,7 @@ export interface InputBaseProps {
28
28
  icon?: string | ComponentType | null | undefined;
29
29
  height?: ControlsHeight | undefined;
30
30
  afterInput?: ReactNode;
31
- translations: InputTranslations;
31
+ translations?: InputTranslations | null | undefined;
32
32
  }
33
33
  type Override<D, S> = Omit<D, keyof S> & S;
34
34
  export type InputSpecificProps = Override<InputHTMLAttributes<HTMLInputElement>, InputBaseProps> & {
@@ -46,9 +46,6 @@ export declare class Input extends PureComponent<InputProps> {
46
46
  onChange: typeof noop;
47
47
  inputRef: typeof noop;
48
48
  enableShortcuts: string[];
49
- translations: {
50
- clear: string;
51
- };
52
49
  };
53
50
  state: {
54
51
  empty: boolean;
@@ -7,6 +7,7 @@ import { refObject } from '../global/prop-types.js';
7
7
  import { Button } from '../button/button.js';
8
8
  import getUID from '../global/get-uid.js';
9
9
  import Icon from '../icon/icon.js';
10
+ import { I18nContext } from '../i18n/i18n-context.js';
10
11
  import composeRefs from '../global/composeRefs.js';
11
12
  import { ControlsHeightContext } from '../global/controls-height.js';
12
13
  import { m as modules_88cfaf40 } from '../_helpers/input.js';
@@ -19,6 +20,7 @@ import 'util-deprecate';
19
20
  import '../_helpers/icon.js';
20
21
  import '../icon/icon__svg.js';
21
22
  import '../global/memoize.js';
23
+ import '../i18n/i18n.js';
22
24
 
23
25
  function noop() {}
24
26
  /**
@@ -37,10 +39,7 @@ class Input extends PureComponent {
37
39
  size: Size.M,
38
40
  onChange: noop,
39
41
  inputRef: noop,
40
- enableShortcuts: ['esc'],
41
- translations: {
42
- clear: 'Clear input'
43
- }
42
+ enableShortcuts: ['esc']
44
43
  };
45
44
  state = {
46
45
  empty: true
@@ -152,7 +151,7 @@ class Input extends PureComponent {
152
151
  'aria-label': typeof label === 'string' && label ? label : placeholder,
153
152
  'data-enabled-shortcuts': Array.isArray(enableShortcuts) ? enableShortcuts.join(',') : null
154
153
  };
155
- return /*#__PURE__*/React.createElement("div", {
154
+ return /*#__PURE__*/React.createElement(I18nContext.Consumer, null, messages => /*#__PURE__*/React.createElement("div", {
156
155
  className: classes,
157
156
  "data-test": "ring-input"
158
157
  }, label && /*#__PURE__*/React.createElement(InputLabel, {
@@ -170,14 +169,14 @@ class Input extends PureComponent {
170
169
  }, commonProps, restProps)) : /*#__PURE__*/React.createElement("input", _extends({
171
170
  onChange: this.handleInputChange
172
171
  }, commonProps, restProps)), clearable && !disabled && /*#__PURE__*/React.createElement(Button, {
173
- title: translations.clear,
172
+ title: (translations !== null && translations !== void 0 ? translations : messages).clear,
174
173
  "data-test": "ring-input-clear",
175
174
  className: modules_88cfaf40.clear,
176
175
  icon: closeIcon,
177
176
  onClick: this.clear
178
177
  }), afterInput), error && /*#__PURE__*/React.createElement("div", {
179
178
  className: modules_88cfaf40.errorText
180
- }, error));
179
+ }, error)));
181
180
  }
182
181
  }
183
182
  Input.propTypes = {
@@ -11,7 +11,7 @@ export interface MessageTranslations {
11
11
  export interface MessageProps {
12
12
  icon: string | IconType | null;
13
13
  directions: readonly Directions[];
14
- translations: MessageTranslations;
14
+ translations?: MessageTranslations | null | undefined;
15
15
  theme: Theme;
16
16
  title?: string | null | undefined;
17
17
  children?: ReactNode;
@@ -34,10 +34,6 @@ export default class Message extends Component<MessageProps> {
34
34
  static defaultProps: {
35
35
  icon: string;
36
36
  directions: Directions[];
37
- translations: {
38
- gotIt: string;
39
- dismiss: string;
40
- };
41
37
  theme: Theme;
42
38
  };
43
39
  state: MessageState;
@@ -7,6 +7,7 @@ import Popup from '../popup/popup.js';
7
7
  import { Directions } from '../popup/popup.consts.js';
8
8
  import Icon from '../icon/icon.js';
9
9
  import { Button } from '../button/button.js';
10
+ import { I18nContext } from '../i18n/i18n-context.js';
10
11
  import { T as Theme, m as modules_59717246, W as WithThemeClasses, a as ThemeProvider } from '../_helpers/theme.js';
11
12
  import 'react-dom';
12
13
  import '../global/get-uid.js';
@@ -30,6 +31,7 @@ import '@jetbrains/icons/chevron-10px';
30
31
  import '../link/clickableLink.js';
31
32
  import '../global/controls-height.js';
32
33
  import '../_helpers/button__classes.js';
34
+ import '../i18n/i18n.js';
33
35
 
34
36
  var modules_8b837449 = {"unit":"i__const_unit_0","padding":"12px","light":"light_rui_f3db","container":"container_rui_f3db","message":"message_rui_f3db","icon":"icon_rui_f3db","title":"title_rui_f3db font-lower_rui_8bff font_rui_8bff","description":"description_rui_f3db","button":"button_rui_f3db","tail":"tail_rui_f3db"};
35
37
 
@@ -107,10 +109,6 @@ class Message extends Component {
107
109
  static defaultProps = {
108
110
  icon: gift,
109
111
  directions: [Directions.TOP_RIGHT, Directions.TOP_LEFT, Directions.TOP_CENTER, Directions.BOTTOM_RIGHT, Directions.BOTTOM_LEFT, Directions.BOTTOM_CENTER, Directions.RIGHT_TOP, Directions.RIGHT_BOTTOM, Directions.RIGHT_CENTER, Directions.LEFT_TOP, Directions.LEFT_BOTTOM, Directions.LEFT_CENTER],
110
- translations: {
111
- gotIt: 'Got it',
112
- dismiss: 'Dismiss'
113
- },
114
112
  theme: Theme.DARK
115
113
  };
116
114
  state = {};
@@ -166,7 +164,7 @@ class Message extends Component {
166
164
  const {
167
165
  direction
168
166
  } = this.state;
169
- return /*#__PURE__*/React.createElement(WithThemeClasses, {
167
+ return /*#__PURE__*/React.createElement(I18nContext.Consumer, null, messages => /*#__PURE__*/React.createElement(WithThemeClasses, {
170
168
  theme: theme
171
169
  }, themeClasses => /*#__PURE__*/React.createElement(Popup, _extends({
172
170
  ref: this.popupRef,
@@ -193,10 +191,10 @@ class Message extends Component {
193
191
  className: modules_8b837449.button,
194
192
  onClick: onClose,
195
193
  primary: true
196
- }, buttonProps), translations.gotIt), onDismiss && /*#__PURE__*/React.createElement(Button, {
194
+ }, buttonProps), (translations !== null && translations !== void 0 ? translations : messages).gotIt), onDismiss && /*#__PURE__*/React.createElement(Button, {
197
195
  onClick: onDismiss,
198
196
  text: true
199
- }, translations.dismiss))));
197
+ }, (translations !== null && translations !== void 0 ? translations : messages).dismiss)))));
200
198
  }
201
199
  }
202
200
  Message.propTypes = {
@@ -19,7 +19,7 @@ export interface PagerProps {
19
19
  disablePageSizeSelector: boolean;
20
20
  openTotal: boolean;
21
21
  canLoadLastPageWithOpenTotal: boolean;
22
- translations: PagerTranslations;
22
+ translations?: PagerTranslations | null | undefined;
23
23
  loader: boolean;
24
24
  loaderNavigation: boolean;
25
25
  onPageSizeChange: (size: number) => void;
@@ -40,18 +40,64 @@ export default class Pager extends PureComponent<PagerProps> {
40
40
  disablePageSizeSelector: boolean;
41
41
  openTotal: boolean;
42
42
  canLoadLastPageWithOpenTotal: boolean;
43
- translations: {
44
- perPage: string;
45
- firstPage: string;
46
- lastPage: string;
47
- nextPage: string;
48
- previousPage: string;
49
- };
50
43
  loader: boolean;
51
44
  loaderNavigation: boolean;
52
45
  onPageSizeChange: () => void;
53
46
  onLoadPage: () => void;
54
47
  };
48
+ static contextType: React.Context<{
49
+ login: string;
50
+ logout: string;
51
+ loginTo: string;
52
+ ok: string;
53
+ cancel: string;
54
+ tryAgainLabel: string;
55
+ postpone: string;
56
+ youHaveLoggedInAs: string;
57
+ applyChange: string;
58
+ backendIsNotAvailable: string;
59
+ checkAgain: string;
60
+ nothingHappensLink: string;
61
+ errorMessage: string;
62
+ applyChangedUser: string;
63
+ profile: string;
64
+ switchUser: string;
65
+ addFirstDate: string;
66
+ addSecondDate: string;
67
+ addTime: string;
68
+ selectName: string;
69
+ setDate: string;
70
+ setDateTime: string;
71
+ setPeriod: string;
72
+ clear: string;
73
+ gotIt: string;
74
+ dismiss: string;
75
+ perPage: string;
76
+ firstPage: string;
77
+ lastPage: string;
78
+ nextPage: string;
79
+ previousPage: string;
80
+ searchTitle: string;
81
+ clearTitle: string;
82
+ userAgreement: string;
83
+ accept: string;
84
+ decline: string;
85
+ close: string;
86
+ scrollToAccept: string;
87
+ remindLater: string;
88
+ filterItems: string;
89
+ selectOption: string;
90
+ progress: string;
91
+ loading: string;
92
+ noOptionsFound: string;
93
+ banned: string;
94
+ online: string;
95
+ offline: string;
96
+ copyToClipboard: string;
97
+ copiedToClipboard: string;
98
+ copingToClipboardError: string;
99
+ unverified: string;
100
+ }>;
55
101
  getSelectOptions(): {
56
102
  selected: SelectItem<PagerSizeItem> | undefined;
57
103
  data: SelectItem<PagerSizeItem>[];