@jetbrains/ring-ui 5.0.137 → 5.0.139

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 (87) 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 +3 -1
  9. package/components/header/profile.js +15 -11
  10. package/components/i18n/README.md +46 -0
  11. package/components/i18n/i18n-context.d.ts +13 -0
  12. package/components/i18n/i18n-context.js +14 -0
  13. package/components/i18n/i18n.d.ts +59 -0
  14. package/components/i18n/i18n.js +26 -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 +17 -16
  20. package/components/pager/pager.d.ts +3 -8
  21. package/components/pager/pager.js +11 -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 +14 -13
  31. package/components/user-card/card.js +26 -27
  32. package/dist/_helpers/card.js +28 -33
  33. package/dist/_helpers/select__filter.js +17 -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 +18 -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 +3 -1
  47. package/dist/header/profile.js +27 -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 +13 -0
  51. package/dist/i18n/i18n-context.js +24 -0
  52. package/dist/i18n/i18n.d.ts +59 -0
  53. package/dist/i18n/i18n.js +136 -0
  54. package/dist/input/input.d.ts +1 -4
  55. package/dist/input/input.js +35 -30
  56. package/dist/link/link.js +1 -1
  57. package/dist/message/message.d.ts +1 -5
  58. package/dist/message/message.js +41 -35
  59. package/dist/pager/pager.d.ts +3 -8
  60. package/dist/pager/pager.js +25 -15
  61. package/dist/pager-ng/pager-ng.js +2 -0
  62. package/dist/permissions-ng/permissions-ng.js +1 -0
  63. package/dist/query-assist/query-assist.d.ts +1 -5
  64. package/dist/query-assist/query-assist.js +105 -93
  65. package/dist/query-assist-ng/query-assist-ng.js +2 -0
  66. package/dist/select/select.d.ts +2 -4
  67. package/dist/select/select.js +54 -47
  68. package/dist/select/select__filter.d.ts +0 -1
  69. package/dist/select/select__filter.js +2 -0
  70. package/dist/select/select__popup.js +2 -0
  71. package/dist/select-ng/select-ng.js +2 -0
  72. package/dist/select-ng/select-ng__lazy.js +2 -0
  73. package/dist/style.css +1 -1
  74. package/dist/table-legacy-ng/table-legacy-ng.js +2 -0
  75. package/dist/table-legacy-ng/table-legacy-ng__pager.js +2 -0
  76. package/dist/tags-input/tags-input.js +2 -0
  77. package/dist/tags-input-ng/tags-input-ng.js +2 -0
  78. package/dist/user-agreement/service.js +2 -0
  79. package/dist/user-agreement/user-agreement.d.ts +1 -9
  80. package/dist/user-agreement/user-agreement.js +41 -41
  81. package/dist/user-card/card.d.ts +14 -13
  82. package/dist/user-card/card.js +2 -0
  83. package/dist/user-card/smart-user-card-tooltip.js +2 -0
  84. package/dist/user-card/tooltip.js +2 -0
  85. package/dist/user-card/user-card.js +2 -0
  86. package/dist/user-card-ng/user-card-ng.js +2 -0
  87. package/package.json +32 -32
@@ -11,6 +11,7 @@ import Select from '../select/select.js';
11
11
  import memoize from '../global/memoize.js';
12
12
  import Link from '../link/link.js';
13
13
  import Icon from '../icon/icon.js';
14
+ import { I18nContext } from '../i18n/i18n-context.js';
14
15
  import '@jetbrains/icons/chevron-10px';
15
16
  import '../link/clickableLink.js';
16
17
  import '../global/controls-height.js';
@@ -72,6 +73,7 @@ import '../list/consts.js';
72
73
  import '../input/input.js';
73
74
  import '../_helpers/input.js';
74
75
  import '../input/input-label.js';
76
+ import '../i18n/i18n.js';
75
77
  import '../global/rerender-hoc.js';
76
78
  import '../global/react-render-adapter.js';
77
79
  import '../global/fuzzy-highlight.js';
@@ -98,27 +100,27 @@ class Pager extends PureComponent {
98
100
  disablePageSizeSelector: false,
99
101
  openTotal: false,
100
102
  canLoadLastPageWithOpenTotal: false,
101
- translations: {
102
- perPage: 'per page',
103
- firstPage: 'First page',
104
- lastPage: 'Last page',
105
- nextPage: 'Next page',
106
- previousPage: 'Previous'
107
- },
108
103
  loader: false,
109
104
  loaderNavigation: false,
110
105
  onPageSizeChange: () => {},
111
106
  onLoadPage: () => {}
112
107
  };
108
+ static contextType = I18nContext;
113
109
  getSelectOptions() {
114
110
  const {
115
111
  pageSize,
116
112
  pageSizes
117
113
  } = this.props;
118
- const data = pageSizes.map(size => ({
119
- key: size,
120
- label: `${size} ${this.props.translations.perPage}`
121
- }));
114
+ const {
115
+ translate
116
+ } = this.context;
117
+ const data = pageSizes.map(size => {
118
+ var _this$props$translati;
119
+ return {
120
+ key: size,
121
+ label: `${size} ${(_this$props$translati = this.props.translations?.perPage) !== null && _this$props$translati !== void 0 ? _this$props$translati : translate('perPage')}`
122
+ };
123
+ });
122
124
  const selected = data.find(it => it.key === pageSize);
123
125
  return {
124
126
  selected,
@@ -207,6 +209,10 @@ class Pager extends PureComponent {
207
209
  }));
208
210
  }
209
211
  getPagerLinks() {
212
+ var _this$props$translati2, _this$props$translati3;
213
+ const {
214
+ translate
215
+ } = this.context;
210
216
  const prevLinkAvailable = this.props.currentPage !== 1;
211
217
  const nextLinkAvailable = this.props.openTotal || this.props.currentPage !== this.getTotalPages();
212
218
  const nextIcon = /*#__PURE__*/React.createElement(Icon, {
@@ -217,8 +223,8 @@ class Pager extends PureComponent {
217
223
  glyph: chevronLeftIcon,
218
224
  key: "icon"
219
225
  });
220
- const prevText = this.props.translations.previousPage;
221
- const nextText = this.props.translations.nextPage;
226
+ const prevText = (_this$props$translati2 = this.props.translations?.previousPage) !== null && _this$props$translati2 !== void 0 ? _this$props$translati2 : translate('previousPage');
227
+ const nextText = (_this$props$translati3 = this.props.translations?.nextPage) !== null && _this$props$translati3 !== void 0 ? _this$props$translati3 : translate('nextPage');
222
228
  const nextLinkContent = WrapText => [/*#__PURE__*/React.createElement("span", {
223
229
  key: "text"
224
230
  }, /*#__PURE__*/React.createElement(WrapText, null, nextText)), nextIcon];
@@ -257,11 +263,15 @@ class Pager extends PureComponent {
257
263
  return this.props.hrefFunc(page, pageSize);
258
264
  }
259
265
  getPagerContent() {
266
+ var _this$props$translati4, _this$props$translati5;
260
267
  const {
261
268
  currentPage,
262
269
  visiblePagesLimit
263
270
  } = this.props;
264
271
  const totalPages = this.getTotalPages();
272
+ const {
273
+ translate
274
+ } = this.context;
265
275
  if (totalPages < this.props.currentPage) {
266
276
  this.props.onPageChange?.(totalPages);
267
277
  }
@@ -291,10 +301,10 @@ class Pager extends PureComponent {
291
301
  buttons.push(this.getButton(i, i, i, i === currentPage));
292
302
  }
293
303
  const lastPageButtonAvailable = end < totalPages && !this.props.openTotal || this.props.openTotal && this.props.canLoadLastPageWithOpenTotal;
294
- return /*#__PURE__*/React.createElement("div", null, this.getPagerLinks(), /*#__PURE__*/React.createElement(ButtonToolbar, null, start > 1 && this.getButton(1, this.props.translations.firstPage), /*#__PURE__*/React.createElement(ButtonGroup, null, start > 1 && this.getButton(start - 1, '...'), buttons, end < totalPages && this.getButton(end + 1, '...'), end === totalPages && this.props.openTotal && /*#__PURE__*/React.createElement(Button, _extends({
304
+ return /*#__PURE__*/React.createElement("div", null, this.getPagerLinks(), /*#__PURE__*/React.createElement(ButtonToolbar, null, start > 1 && this.getButton(1, (_this$props$translati4 = this.props.translations?.firstPage) !== null && _this$props$translati4 !== void 0 ? _this$props$translati4 : translate('firstPage')), /*#__PURE__*/React.createElement(ButtonGroup, null, start > 1 && this.getButton(start - 1, '...'), buttons, end < totalPages && this.getButton(end + 1, '...'), end === totalPages && this.props.openTotal && /*#__PURE__*/React.createElement(Button, _extends({
295
305
  href: this.generateHref(end + 1),
296
306
  disabled: this.props.loader
297
- }, this.getClickProps(this.handleLoadMore(end + 1))), '...')), lastPageButtonAvailable && this.getButton(this.props.openTotal ? -1 : totalPages, this.props.translations.lastPage)), this.getPageSizeSelector());
307
+ }, this.getClickProps(this.handleLoadMore(end + 1))), '...')), lastPageButtonAvailable && this.getButton(this.props.openTotal ? -1 : totalPages, (_this$props$translati5 = this.props.translations?.lastPage) !== null && _this$props$translati5 !== void 0 ? _this$props$translati5 : translate('lastPage'))), this.getPageSizeSelector());
298
308
  }
299
309
  render() {
300
310
  const classes = classNames(modules_1a5f0d42.pager, this.props.className);
@@ -76,6 +76,8 @@ import '../list/list__separator.js';
76
76
  import '../list/list__hint.js';
77
77
  import '../list/consts.js';
78
78
  import '../input/input.js';
79
+ import '../i18n/i18n-context.js';
80
+ import '../i18n/i18n.js';
79
81
  import '../_helpers/input.js';
80
82
  import '../input/input-label.js';
81
83
  import '../global/rerender-hoc.js';
@@ -57,6 +57,7 @@ import '../auth/auth__core.js';
57
57
  import '../global/listeners.js';
58
58
  import '../http/http.js';
59
59
  import '../global/promise-with-timeout.js';
60
+ import '../i18n/i18n.js';
60
61
  import '../auth/storage.js';
61
62
  import '../storage/storage.js';
62
63
  import '../storage/storage__local.js';
@@ -40,7 +40,7 @@ export interface QueryAssistProps {
40
40
  onApplySuggestion: (suggestion: QueryAssistSuggestion, change: QueryAssistChange) => void;
41
41
  onClear: () => void;
42
42
  onFocusChange: (change: FocusChange) => void;
43
- translations: QueryAssistTranslations;
43
+ translations?: QueryAssistTranslations | null | undefined;
44
44
  autoOpen?: boolean | null | undefined | 'force';
45
45
  caret?: number | null | undefined;
46
46
  clear?: boolean | null | undefined;
@@ -226,10 +226,6 @@ export default class QueryAssist extends Component<QueryAssistProps> {
226
226
  onClear: typeof noop;
227
227
  onFocusChange: typeof noop;
228
228
  size: Size;
229
- translations: {
230
- searchTitle: string;
231
- clearTitle: string;
232
- };
233
229
  };
234
230
  static getDerivedStateFromProps({ query }: QueryAssistProps, { prevQuery }: QueryAssistState): Partial<QueryAssistState>;
235
231
  constructor(props: QueryAssistProps);
@@ -19,6 +19,7 @@ import Icon from '../icon/icon.js';
19
19
  import { ControlsHeightContext, ControlsHeight } from '../global/controls-height.js';
20
20
  import { Size } from '../input/input.js';
21
21
  import { m as modules_88cfaf40 } from '../_helpers/input.js';
22
+ import { I18nContext } from '../i18n/i18n-context.js';
22
23
  import { Q as QueryAssistSuggestions, m as modules_da7ab055 } from '../_helpers/query-assist__suggestions.js';
23
24
  import '../_helpers/_rollupPluginBabelHelpers.js';
24
25
  import 'react-dom/server';
@@ -71,6 +72,7 @@ import '../global/react-render-adapter.js';
71
72
  import '@jetbrains/icons/chevron-10px';
72
73
  import '../_helpers/button__classes.js';
73
74
  import '../input/input-label.js';
75
+ import '../i18n/i18n.js';
74
76
 
75
77
  const POPUP_COMPENSATION = PopupMenu.ListProps.Dimension.ITEM_PADDING + PopupMenu.PopupProps.Dimension.BORDER_WIDTH;
76
78
  const ngModelStateField = 'query';
@@ -216,11 +218,7 @@ class QueryAssist extends Component {
216
218
  onApplySuggestion: noop,
217
219
  onClear: noop,
218
220
  onFocusChange: noop,
219
- size: Size.L,
220
- translations: {
221
- searchTitle: 'Search',
222
- clearTitle: 'Clear search input'
223
- }
221
+ size: Size.L
224
222
  };
225
223
  static getDerivedStateFromProps(_ref, _ref2) {
226
224
  let {
@@ -872,14 +870,21 @@ class QueryAssist extends Component {
872
870
  const actions = [...(this.props.actions || [])];
873
871
  const renderClear = this.props.clear && !!this.state.query;
874
872
  if (renderClear) {
875
- actions.push( /*#__PURE__*/React.createElement(Button, {
876
- icon: closeIcon,
877
- key: 'clearAction',
878
- className: modules_da7ab055.clear,
879
- title: this.props.translations.clearTitle,
880
- ref: this.clearRef,
881
- onClick: this.clearQuery,
882
- "data-test": "query-assist-clear-icon"
873
+ actions.push( /*#__PURE__*/React.createElement(I18nContext.Consumer, {
874
+ key: 'clearAction'
875
+ }, _ref6 => {
876
+ var _this$props$translati;
877
+ let {
878
+ translate
879
+ } = _ref6;
880
+ return /*#__PURE__*/React.createElement(Button, {
881
+ icon: closeIcon,
882
+ className: modules_da7ab055.clear,
883
+ title: (_this$props$translati = this.props.translations?.clearTitle) !== null && _this$props$translati !== void 0 ? _this$props$translati : translate('clearTitle'),
884
+ ref: this.clearRef,
885
+ onClick: this.clearQuery,
886
+ "data-test": "query-assist-clear-icon"
887
+ });
883
888
  }));
884
889
  }
885
890
  return actions;
@@ -891,7 +896,8 @@ class QueryAssist extends Component {
891
896
  className,
892
897
  useCustomItemRender,
893
898
  huge,
894
- size
899
+ size,
900
+ translations
895
901
  } = this.props;
896
902
  const renderPlaceholder = !!this.props.placeholder && this.state.placeholderEnabled;
897
903
  const renderLoader = this.props.loader !== false && this.state.loading;
@@ -916,85 +922,91 @@ class QueryAssist extends Component {
916
922
  });
917
923
  return /*#__PURE__*/React.createElement(ControlsHeightContext.Provider, {
918
924
  value: ControlsHeight.M
919
- }, /*#__PURE__*/React.createElement("div", {
920
- "data-test": joinDataTestAttributes('ring-query-assist', dataTest),
921
- className: containerClasses,
922
- role: "presentation",
923
- ref: this.nodeRef
924
- }, this.state.shortcuts && /*#__PURE__*/React.createElement(Shortcuts, {
925
- map: this.shortcutsMap,
926
- scope: this.shortcutsScope
927
- }), renderGlass && !huge && /*#__PURE__*/React.createElement(Icon, {
928
- glyph: searchIcon,
929
- className: modules_da7ab055.icon,
930
- title: this.props.translations.searchTitle,
931
- ref: this.glassRef,
932
- "data-test": "query-assist-search-icon"
933
- }), renderLoader && /*#__PURE__*/React.createElement("div", {
934
- className: classNames(modules_da7ab055.icon, modules_da7ab055.loader, {
935
- [modules_da7ab055.loaderOnTheRight]: !glass && !huge,
936
- [modules_da7ab055.loaderActive]: renderLoader
937
- }),
938
- ref: this.loaderRef
939
- }, /*#__PURE__*/React.createElement(LoaderInline, null)), /*#__PURE__*/React.createElement(ContentEditable, {
940
- "aria-label": this.props.translations.searchTitle,
941
- className: inputClasses,
942
- "data-test": "ring-query-assist-input",
943
- inputRef: this.inputRef,
944
- disabled: this.props.disabled,
945
- onComponentUpdate: () => this.setCaretPosition({
946
- fromContentEditable: true
947
- }),
948
- onBlur: this.handleFocusChange,
949
- onClick: this.handleCaretMove,
950
- onCompositionStart: this.trackCompositionState,
951
- onCompositionEnd: this.trackCompositionState,
952
- onFocus: this.handleFocusChange,
953
- onInput: this.handleInput // To support IE use the same method
954
- ,
955
- onKeyUp: this.handleInput // to handle input and key up
956
- ,
957
- onKeyDown: this.handleEnter,
958
- onPaste: this.handlePaste,
959
- spellCheck: "false"
960
- }, this.state.query && /*#__PURE__*/React.createElement("span", null, this.renderQuery())), renderPlaceholder && /*#__PURE__*/React.createElement("button", {
961
- type: "button",
962
- className: placeholderStyles,
963
- ref: this.placeholderRef,
964
- onClick: this.handleCaretMove,
965
- "data-test": "query-assist-placeholder"
966
- }, this.props.placeholder), actions.length ? /*#__PURE__*/React.createElement("div", {
967
- "data-test": "ring-query-assist-actions",
968
- className: modules_da7ab055.actions
969
- }, actions) : null, /*#__PURE__*/React.createElement(PopupMenu, {
970
- hidden: !this.state.showPopup,
971
- onCloseAttempt: this.closePopup,
972
- ref: this.popupRef,
973
- anchorElement: this.node,
974
- keepMounted: true,
975
- attached: true,
976
- className: this.props.popupClassName,
977
- directions: [PopupMenu.PopupProps.Directions.BOTTOM_RIGHT],
978
- data: useCustomItemRender ? this.state.suggestions : this.renderSuggestions(),
979
- "data-test": "ring-query-assist-popup",
980
- hint: this.props.hint,
981
- hintOnSelection: this.props.hintOnSelection,
982
- left: this.getPopupOffset(this.state.suggestions),
983
- maxHeight: PopupMenu.PopupProps.MaxHeight.SCREEN,
984
- onMouseDown: this.trackPopupMouseState,
985
- onMouseUp: this.trackPopupMouseState,
986
- onSelect: item => this.handleComplete(item)
987
- }), glass && huge && /*#__PURE__*/React.createElement("div", {
988
- className: modules_da7ab055.rightSearchButton,
989
- "data-test": "query-assist-search-button"
990
- }, /*#__PURE__*/React.createElement(Icon, {
991
- glyph: searchIcon,
992
- className: modules_da7ab055.rightSearchIcon,
993
- title: this.props.translations.searchTitle,
994
- onClick: this.handleApply,
995
- ref: this.glassRef,
996
- "data-test": "query-assist-search-icon"
997
- }))));
925
+ }, /*#__PURE__*/React.createElement(I18nContext.Consumer, null, _ref7 => {
926
+ var _translations$searchT, _translations$searchT2, _translations$searchT3;
927
+ let {
928
+ translate
929
+ } = _ref7;
930
+ return /*#__PURE__*/React.createElement("div", {
931
+ "data-test": joinDataTestAttributes('ring-query-assist', dataTest),
932
+ className: containerClasses,
933
+ role: "presentation",
934
+ ref: this.nodeRef
935
+ }, this.state.shortcuts && /*#__PURE__*/React.createElement(Shortcuts, {
936
+ map: this.shortcutsMap,
937
+ scope: this.shortcutsScope
938
+ }), renderGlass && !huge && /*#__PURE__*/React.createElement(Icon, {
939
+ glyph: searchIcon,
940
+ className: modules_da7ab055.icon,
941
+ title: (_translations$searchT = translations?.searchTitle) !== null && _translations$searchT !== void 0 ? _translations$searchT : translate('searchTitle'),
942
+ ref: this.glassRef,
943
+ "data-test": "query-assist-search-icon"
944
+ }), renderLoader && /*#__PURE__*/React.createElement("div", {
945
+ className: classNames(modules_da7ab055.icon, modules_da7ab055.loader, {
946
+ [modules_da7ab055.loaderOnTheRight]: !glass && !huge,
947
+ [modules_da7ab055.loaderActive]: renderLoader
948
+ }),
949
+ ref: this.loaderRef
950
+ }, /*#__PURE__*/React.createElement(LoaderInline, null)), /*#__PURE__*/React.createElement(ContentEditable, {
951
+ "aria-label": (_translations$searchT2 = translations?.searchTitle) !== null && _translations$searchT2 !== void 0 ? _translations$searchT2 : translate('searchTitle'),
952
+ className: inputClasses,
953
+ "data-test": "ring-query-assist-input",
954
+ inputRef: this.inputRef,
955
+ disabled: this.props.disabled,
956
+ onComponentUpdate: () => this.setCaretPosition({
957
+ fromContentEditable: true
958
+ }),
959
+ onBlur: this.handleFocusChange,
960
+ onClick: this.handleCaretMove,
961
+ onCompositionStart: this.trackCompositionState,
962
+ onCompositionEnd: this.trackCompositionState,
963
+ onFocus: this.handleFocusChange,
964
+ onInput: this.handleInput // To support IE use the same method
965
+ ,
966
+ onKeyUp: this.handleInput // to handle input and key up
967
+ ,
968
+ onKeyDown: this.handleEnter,
969
+ onPaste: this.handlePaste,
970
+ spellCheck: "false"
971
+ }, this.state.query && /*#__PURE__*/React.createElement("span", null, this.renderQuery())), renderPlaceholder && /*#__PURE__*/React.createElement("button", {
972
+ type: "button",
973
+ className: placeholderStyles,
974
+ ref: this.placeholderRef,
975
+ onClick: this.handleCaretMove,
976
+ "data-test": "query-assist-placeholder"
977
+ }, this.props.placeholder), actions.length ? /*#__PURE__*/React.createElement("div", {
978
+ "data-test": "ring-query-assist-actions",
979
+ className: modules_da7ab055.actions
980
+ }, actions) : null, /*#__PURE__*/React.createElement(PopupMenu, {
981
+ hidden: !this.state.showPopup,
982
+ onCloseAttempt: this.closePopup,
983
+ ref: this.popupRef,
984
+ anchorElement: this.node,
985
+ keepMounted: true,
986
+ attached: true,
987
+ className: this.props.popupClassName,
988
+ directions: [PopupMenu.PopupProps.Directions.BOTTOM_RIGHT],
989
+ data: useCustomItemRender ? this.state.suggestions : this.renderSuggestions(),
990
+ "data-test": "ring-query-assist-popup",
991
+ hint: this.props.hint,
992
+ hintOnSelection: this.props.hintOnSelection,
993
+ left: this.getPopupOffset(this.state.suggestions),
994
+ maxHeight: PopupMenu.PopupProps.MaxHeight.SCREEN,
995
+ onMouseDown: this.trackPopupMouseState,
996
+ onMouseUp: this.trackPopupMouseState,
997
+ onSelect: item => this.handleComplete(item)
998
+ }), glass && huge && /*#__PURE__*/React.createElement("div", {
999
+ className: modules_da7ab055.rightSearchButton,
1000
+ "data-test": "query-assist-search-button"
1001
+ }, /*#__PURE__*/React.createElement(Icon, {
1002
+ glyph: searchIcon,
1003
+ className: modules_da7ab055.rightSearchIcon,
1004
+ title: (_translations$searchT3 = translations?.searchTitle) !== null && _translations$searchT3 !== void 0 ? _translations$searchT3 : translate('searchTitle'),
1005
+ onClick: this.handleApply,
1006
+ ref: this.glassRef,
1007
+ "data-test": "query-assist-search-icon"
1008
+ })));
1009
+ }));
998
1010
  }
999
1011
  }
1000
1012
  const RerenderableQueryAssist = rerenderHOC(QueryAssist);
@@ -73,6 +73,8 @@ import '@jetbrains/icons/chevron-10px';
73
73
  import '../global/controls-height.js';
74
74
  import '../_helpers/button__classes.js';
75
75
  import '../input/input.js';
76
+ import '../i18n/i18n-context.js';
77
+ import '../i18n/i18n.js';
76
78
  import '../_helpers/input.js';
77
79
  import '../input/input-label.js';
78
80
  import '../_helpers/query-assist__suggestions.js';
@@ -54,8 +54,8 @@ export interface BaseSelectProps<T = unknown> {
54
54
  clear: boolean;
55
55
  loading: boolean;
56
56
  disabled: boolean;
57
- loadingMessage: string;
58
- notFoundMessage: string;
57
+ loadingMessage?: string;
58
+ notFoundMessage?: string;
59
59
  type: Type;
60
60
  size: Size;
61
61
  hideSelected: boolean;
@@ -155,8 +155,6 @@ export default class Select<T = unknown> extends Component<SelectProps<T>, Selec
155
155
  clear: boolean;
156
156
  loading: boolean;
157
157
  disabled: boolean;
158
- loadingMessage: string;
159
- notFoundMessage: string;
160
158
  type: Type;
161
159
  size: Size;
162
160
  targetElement: null;
@@ -18,6 +18,7 @@ import getUID from '../global/get-uid.js';
18
18
  import rerenderHOC from '../global/rerender-hoc.js';
19
19
  import fuzzyHighlight from '../global/fuzzy-highlight.js';
20
20
  import memoize from '../global/memoize.js';
21
+ import { I18nContext } from '../i18n/i18n-context.js';
21
22
  import { isArray } from '../global/typescript-utils.js';
22
23
  import { ControlsHeightContext, ControlsHeight } from '../global/controls-height.js';
23
24
  import { m as modules_88cfaf40 } from '../_helpers/input.js';
@@ -68,6 +69,7 @@ import '../list/list__separator.js';
68
69
  import '../list/list__hint.js';
69
70
  import '../list/consts.js';
70
71
  import '../global/react-render-adapter.js';
72
+ import '../i18n/i18n.js';
71
73
  import '@jetbrains/icons/search';
72
74
  import '../loader-inline/loader-inline.js';
73
75
  import '../_helpers/loader-inline.js';
@@ -238,8 +240,6 @@ class Select extends Component {
238
240
  clear: false,
239
241
  loading: false,
240
242
  disabled: false,
241
- loadingMessage: 'Loading...',
242
- notFoundMessage: 'No options found',
243
243
  type: Type.BUTTON,
244
244
  size: Size.M,
245
245
  targetElement: null,
@@ -511,49 +511,56 @@ class Select extends Component {
511
511
  shownData
512
512
  } = this.state;
513
513
  const _shownData = this._prependResetOption(shownData);
514
- let message;
515
- if (this.props.loading) {
516
- message = this.props.loadingMessage;
517
- } else if (!shownData.length) {
518
- message = this.props.notFoundMessage;
519
- }
520
- return /*#__PURE__*/React.createElement(SelectPopup, {
521
- data: _shownData,
522
- message: message,
523
- toolbar: showPopup && this.getToolbar(),
524
- loading: this.props.loading,
525
- activeIndex: this.state.selectedIndex,
526
- hidden: !showPopup,
527
- ref: this.popupRef,
528
- maxHeight: this.props.maxHeight,
529
- minWidth: this.props.minWidth,
530
- directions: this.props.directions,
531
- className: this.props.popupClassName,
532
- style: this.props.popupStyle,
533
- top: this.props.top,
534
- left: this.props.left,
535
- filter: this.isInputMode() ? false : this.props.filter // disable popup filter in INPUT mode
536
- ,
537
- multiple: this.props.multiple,
538
- filterValue: this.state.filterValue,
539
- anchorElement: anchorElement,
540
- onCloseAttempt: this._onCloseAttempt,
541
- onSelect: this._listSelectHandler,
542
- onSelectAll: this._listSelectAllHandler,
543
- onFilter: this._filterChangeHandler,
544
- onClear: this.clearFilter,
545
- onLoadMore: this.props.onLoadMore,
546
- isInputMode: this.isInputMode(),
547
- selected: this.state.selected,
548
- tags: this.props.tags,
549
- compact: this.props.compact,
550
- renderOptimization: this.props.renderOptimization,
551
- ringPopupTarget: this.props.ringPopupTarget,
552
- disableMoveOverflow: this.props.disableMoveOverflow,
553
- disableScrollToActive: this.props.disableScrollToActive,
554
- dir: this.props.dir,
555
- onEmptyPopupEnter: this.onEmptyPopupEnter,
556
- listId: this.listId
514
+ return /*#__PURE__*/React.createElement(I18nContext.Consumer, null, _ref2 => {
515
+ let {
516
+ translate
517
+ } = _ref2;
518
+ let message;
519
+ if (this.props.loading) {
520
+ var _this$props$loadingMe;
521
+ message = (_this$props$loadingMe = this.props.loadingMessage) !== null && _this$props$loadingMe !== void 0 ? _this$props$loadingMe : translate('loading');
522
+ } else if (!shownData.length) {
523
+ var _this$props$notFoundM;
524
+ message = (_this$props$notFoundM = this.props.notFoundMessage) !== null && _this$props$notFoundM !== void 0 ? _this$props$notFoundM : translate('noOptionsFound');
525
+ }
526
+ return /*#__PURE__*/React.createElement(SelectPopup, {
527
+ data: _shownData,
528
+ message: message,
529
+ toolbar: showPopup && this.getToolbar(),
530
+ loading: this.props.loading,
531
+ activeIndex: this.state.selectedIndex,
532
+ hidden: !showPopup,
533
+ ref: this.popupRef,
534
+ maxHeight: this.props.maxHeight,
535
+ minWidth: this.props.minWidth,
536
+ directions: this.props.directions,
537
+ className: this.props.popupClassName,
538
+ style: this.props.popupStyle,
539
+ top: this.props.top,
540
+ left: this.props.left,
541
+ filter: this.isInputMode() ? false : this.props.filter // disable popup filter in INPUT mode
542
+ ,
543
+ multiple: this.props.multiple,
544
+ filterValue: this.state.filterValue,
545
+ anchorElement: anchorElement,
546
+ onCloseAttempt: this._onCloseAttempt,
547
+ onSelect: this._listSelectHandler,
548
+ onSelectAll: this._listSelectAllHandler,
549
+ onFilter: this._filterChangeHandler,
550
+ onClear: this.clearFilter,
551
+ onLoadMore: this.props.onLoadMore,
552
+ isInputMode: this.isInputMode(),
553
+ selected: this.state.selected,
554
+ tags: this.props.tags,
555
+ compact: this.props.compact,
556
+ renderOptimization: this.props.renderOptimization,
557
+ ringPopupTarget: this.props.ringPopupTarget,
558
+ disableMoveOverflow: this.props.disableMoveOverflow,
559
+ disableScrollToActive: this.props.disableScrollToActive,
560
+ dir: this.props.dir,
561
+ onEmptyPopupEnter: this.onEmptyPopupEnter,
562
+ listId: this.listId
563
+ });
557
564
  });
558
565
  }
559
566
  _showPopup() {
@@ -860,8 +867,8 @@ class Select extends Component {
860
867
  return Array.isArray(this.state.selected) && !this.state.selected.length || !this.state.selected;
861
868
  }
862
869
  _getLabel() {
863
- var _ref2, _this$props$label;
864
- return (_ref2 = (_this$props$label = this.props.label) !== null && _this$props$label !== void 0 ? _this$props$label : this.props.selectedLabel) !== null && _ref2 !== void 0 ? _ref2 : 'Select an option';
870
+ var _ref3, _this$props$label;
871
+ return (_ref3 = (_this$props$label = this.props.label) !== null && _this$props$label !== void 0 ? _this$props$label : this.props.selectedLabel) !== null && _ref3 !== void 0 ? _ref3 : 'Select an option';
865
872
  }
866
873
  _getPlaceholder() {
867
874
  if (this._selectionIsEmpty()) {
@@ -7,7 +7,6 @@ type SelectFilterProps = InputAttrs & {
7
7
  };
8
8
  export default class SelectFilter extends Component<SelectFilterProps> {
9
9
  static defaultProps: {
10
- placeholder: string;
11
10
  inputRef: typeof noop;
12
11
  };
13
12
  componentWillUnmount(): void;
@@ -5,6 +5,7 @@ import 'classnames';
5
5
  import '../input/input.js';
6
6
  import '../global/sniffer.js';
7
7
  import '../list/list.js';
8
+ import '../i18n/i18n-context.js';
8
9
  export { S as default } from '../_helpers/select__filter.js';
9
10
  import '@jetbrains/icons/close-12px';
10
11
  import '../global/prop-types.js';
@@ -23,6 +24,7 @@ import '../global/get-uid.js';
23
24
  import '../global/composeRefs.js';
24
25
  import '../_helpers/input.js';
25
26
  import '../input/input-label.js';
27
+ import '../i18n/i18n.js';
26
28
  import 'sniffr';
27
29
  import 'react-virtualized/dist/es/List';
28
30
  import 'react-virtualized/dist/es/AutoSizer';
@@ -66,6 +66,8 @@ import '@jetbrains/icons/close-12px';
66
66
  import '@jetbrains/icons/chevron-10px';
67
67
  import '../_helpers/button__classes.js';
68
68
  import '../input/input.js';
69
+ import '../i18n/i18n-context.js';
70
+ import '../i18n/i18n.js';
69
71
  import '../_helpers/input.js';
70
72
  import '../input/input-label.js';
71
73
 
@@ -68,6 +68,8 @@ import '../list/list__separator.js';
68
68
  import '../list/list__hint.js';
69
69
  import '../list/consts.js';
70
70
  import '../input/input.js';
71
+ import '../i18n/i18n-context.js';
72
+ import '../i18n/i18n.js';
71
73
  import '../_helpers/input.js';
72
74
  import '../input/input-label.js';
73
75
  import '../global/rerender-hoc.js';
@@ -65,6 +65,8 @@ import '../list/list__separator.js';
65
65
  import '../list/list__hint.js';
66
66
  import '../list/consts.js';
67
67
  import '../input/input.js';
68
+ import '../i18n/i18n-context.js';
69
+ import '../i18n/i18n.js';
68
70
  import '../_helpers/input.js';
69
71
  import '../input/input-label.js';
70
72
  import '../global/rerender-hoc.js';