@jetbrains/ring-ui 5.1.20 → 5.1.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.
Files changed (65) hide show
  1. package/components/auth/request-builder.d.ts +1 -0
  2. package/components/code/code.d.ts +1 -0
  3. package/components/grid/row.js +3 -3
  4. package/components/header/profile.js +1 -1
  5. package/components/island/header.js +1 -1
  6. package/components/list/list.js +3 -3
  7. package/components/loader/loader__core.js +6 -6
  8. package/components/popup/popup.js +3 -3
  9. package/components/progress-bar/progress-bar.css +6 -0
  10. package/components/progress-bar/progress-bar.d.ts +6 -0
  11. package/components/progress-bar/progress-bar.js +9 -3
  12. package/components/query-assist/query-assist.js +1 -1
  13. package/components/select/select-popup.css +4 -0
  14. package/components/select/select.js +21 -21
  15. package/dist/_helpers/select__filter.js +1 -1
  16. package/dist/analytics/analytics__custom-plugin.js +1 -2
  17. package/dist/analytics/analytics__ga-plugin.js +1 -1
  18. package/dist/auth/auth__core.js +35 -35
  19. package/dist/auth/background-flow.js +2 -2
  20. package/dist/auth/iframe-flow.js +3 -3
  21. package/dist/auth/request-builder.d.ts +1 -0
  22. package/dist/auth/request-builder.js +2 -1
  23. package/dist/auth/storage.js +8 -4
  24. package/dist/auth/token-validator.js +4 -3
  25. package/dist/auth/window-flow.js +3 -3
  26. package/dist/auth-ng/auth-ng.js +0 -1
  27. package/dist/caret/caret.js +4 -4
  28. package/dist/clipboard/clipboard-fallback.js +3 -3
  29. package/dist/code/code.d.ts +1 -0
  30. package/dist/data-list/data-list.js +2 -2
  31. package/dist/date-picker/date-picker.js +1 -1
  32. package/dist/date-picker/date-popup.js +2 -2
  33. package/dist/dropdown/dropdown.js +2 -2
  34. package/dist/editable-heading/editable-heading.js +4 -4
  35. package/dist/global/focus-sensor-hoc.js +6 -6
  36. package/dist/global/schedule-raf.js +1 -1
  37. package/dist/grid/row.js +7 -1
  38. package/dist/header/profile.js +1 -0
  39. package/dist/header/smart-services.js +2 -2
  40. package/dist/input/input.js +2 -2
  41. package/dist/island/content.js +1 -1
  42. package/dist/island/header.js +1 -0
  43. package/dist/list/list.js +3 -0
  44. package/dist/loader/loader.js +1 -1
  45. package/dist/loader/loader__core.js +19 -7
  46. package/dist/loader-screen-ng/loader-screen-ng.js +0 -2
  47. package/dist/message-bundle-ng/message-bundle-ng.js +0 -1
  48. package/dist/pager/pager.js +4 -4
  49. package/dist/popup/popup.js +3 -0
  50. package/dist/progress-bar/progress-bar.d.ts +6 -0
  51. package/dist/progress-bar/progress-bar.js +11 -4
  52. package/dist/query-assist/query-assist.js +13 -12
  53. package/dist/select/select.js +22 -2
  54. package/dist/select-ng/select-ng.js +0 -2
  55. package/dist/select-ng/select-ng__lazy.js +1 -1
  56. package/dist/storage/storage__fallback.js +4 -2
  57. package/dist/style.css +1 -1
  58. package/dist/tab-trap/tab-trap.js +1 -1
  59. package/dist/table/multitable.js +7 -7
  60. package/dist/table/row-with-focus-sensor.js +4 -4
  61. package/dist/table/selection-shortcuts-hoc.js +11 -11
  62. package/dist/tag/tag.js +1 -1
  63. package/dist/tags-input/tags-input.js +7 -7
  64. package/dist/tooltip/tooltip.js +2 -2
  65. package/package.json +26 -26
@@ -8,6 +8,7 @@ import 'core-js/modules/es.array.splice.js';
8
8
  import 'core-js/modules/es.promise.js';
9
9
  import 'core-js/modules/es.symbol.js';
10
10
  import 'core-js/modules/es.symbol.description.js';
11
+ import 'core-js/modules/es.array.concat.js';
11
12
  import 'core-js/modules/es.array.map.js';
12
13
  import React, { Component } from 'react';
13
14
  import PropTypes from 'prop-types';
@@ -33,7 +34,6 @@ import { m as modules_88cfaf40 } from '../_helpers/input.js';
33
34
  import { I18nContext } from '../i18n/i18n-context.js';
34
35
  import { Q as QueryAssistSuggestions, m as modules_da7ab055 } from '../_helpers/query-assist__suggestions.js';
35
36
  import 'core-js/modules/es.regexp.to-string.js';
36
- import 'core-js/modules/es.array.concat.js';
37
37
  import 'core-js/modules/es.array.reduce.js';
38
38
  import 'core-js/modules/es.object.entries.js';
39
39
  import 'core-js/modules/es.string.split.js';
@@ -206,14 +206,14 @@ var QueryAssist = /*#__PURE__*/function (_Component) {
206
206
  if (typeof _this.immediateState.selection === 'number' && Number.isInteger(_this.immediateState.selection) && _this.immediateState.selection > -1) {
207
207
  var _this$caret;
208
208
  // Set to end of field value if newCaretPosition is inappropriate
209
- (_this$caret = _this.caret) === null || _this$caret === void 0 ? void 0 : _this$caret.setPosition(newCaretPosition >= 0 ? newCaretPosition : -1);
209
+ (_this$caret = _this.caret) === null || _this$caret === void 0 || _this$caret.setPosition(newCaretPosition >= 0 ? newCaretPosition : -1);
210
210
  _this.scrollInput();
211
211
  } else if (_this.immediateState.selection && typeof _this.immediateState.selection === 'object' && _this.immediateState.selection.startOffset !== undefined) {
212
212
  var _this$caret2;
213
- (_this$caret2 = _this.caret) === null || _this$caret2 === void 0 ? void 0 : _this$caret2.setPosition(_this.immediateState.selection);
213
+ (_this$caret2 = _this.caret) === null || _this$caret2 === void 0 || _this$caret2.setPosition(_this.immediateState.selection);
214
214
  } else if (_this.immediateState.selection === undefined || params.forceSetCaret) {
215
215
  var _this$caret3;
216
- (_this$caret3 = _this.caret) === null || _this$caret3 === void 0 ? void 0 : _this$caret3.setPosition(-1);
216
+ (_this$caret3 = _this.caret) === null || _this$caret3 === void 0 || _this$caret3.setPosition(-1);
217
217
  }
218
218
  }
219
219
  });
@@ -270,7 +270,7 @@ var QueryAssist = /*#__PURE__*/function (_Component) {
270
270
  _this.props.onChange(props);
271
271
  if (_this.props.autoOpen === 'force' || props.query.length > 0) {
272
272
  var _this$requestData, _this2;
273
- (_this$requestData = (_this2 = _this).requestData) === null || _this$requestData === void 0 ? void 0 : _this$requestData.call(_this2);
273
+ (_this$requestData = (_this2 = _this).requestData) === null || _this$requestData === void 0 || _this$requestData.call(_this2);
274
274
  }
275
275
  });
276
276
  // It's necessary to prevent new element creation before any other hooks
@@ -298,7 +298,7 @@ var QueryAssist = /*#__PURE__*/function (_Component) {
298
298
  _defineProperty(_assertThisInitialized(_this), "setState", function (state, resolve) {
299
299
  _get((_thisSuper = _assertThisInitialized(_this), _getPrototypeOf(QueryAssist.prototype)), "setState", _thisSuper).call(_thisSuper, state, function () {
300
300
  _this._pushHistory(state);
301
- resolve === null || resolve === void 0 ? void 0 : resolve();
301
+ resolve === null || resolve === void 0 || resolve();
302
302
  });
303
303
  });
304
304
  _defineProperty(_assertThisInitialized(_this), "undo", function (e) {
@@ -310,7 +310,7 @@ var QueryAssist = /*#__PURE__*/function (_Component) {
310
310
  query: previous.query
311
311
  }, function () {
312
312
  var _this$caret5;
313
- (_this$caret5 = _this.caret) === null || _this$caret5 === void 0 ? void 0 : _this$caret5.setPosition(previous.caret);
313
+ (_this$caret5 = _this.caret) === null || _this$caret5 === void 0 || _this$caret5.setPosition(previous.caret);
314
314
  _this.handleInput(e);
315
315
  });
316
316
  });
@@ -337,7 +337,7 @@ var QueryAssist = /*#__PURE__*/function (_Component) {
337
337
  _this.scrollInput();
338
338
  if (_this.immediateState.query.length > 0) {
339
339
  var _this$requestData2, _this3;
340
- (_this$requestData2 = (_this3 = _this).requestData) === null || _this$requestData2 === void 0 ? void 0 : _this$requestData2.call(_this3);
340
+ (_this$requestData2 = (_this3 = _this).requestData) === null || _this$requestData2 === void 0 || _this$requestData2.call(_this3);
341
341
  }
342
342
  }
343
343
  if (_this.props.autoOpen !== 'force' && _this.immediateState.query.length < 1) {
@@ -440,7 +440,7 @@ var QueryAssist = /*#__PURE__*/function (_Component) {
440
440
  _this.setCaretPosition();
441
441
  }
442
442
  _this.closePopup();
443
- (_this$requestData3 = (_this4 = _this).requestData) === null || _this$requestData3 === void 0 ? void 0 : _this$requestData3.call(_this4, true);
443
+ (_this$requestData3 = (_this4 = _this).requestData) === null || _this$requestData3 === void 0 || _this$requestData3.call(_this4, true);
444
444
  });
445
445
  _defineProperty(_assertThisInitialized(_this), "requestStyleRanges", function () {
446
446
  var _this$immediateState = _this.immediateState,
@@ -474,7 +474,7 @@ var QueryAssist = /*#__PURE__*/function (_Component) {
474
474
  preventDefault(e);
475
475
  if (!_this.state.showPopup) {
476
476
  var _this$requestData4, _this5;
477
- (_this$requestData4 = (_this5 = _this).requestData) === null || _this$requestData4 === void 0 ? void 0 : _this$requestData4.call(_this5);
477
+ (_this$requestData4 = (_this5 = _this).requestData) === null || _this$requestData4 === void 0 || _this$requestData4.call(_this5);
478
478
  }
479
479
  });
480
480
  _defineProperty(_assertThisInitialized(_this), "trackPopupMouseState", function (e) {
@@ -611,7 +611,7 @@ var QueryAssist = /*#__PURE__*/function (_Component) {
611
611
  this.immediateState.query = query;
612
612
  if (query && (this.props.autoOpen === 'force' || prevProps.autoOpen && query.length > 0)) {
613
613
  var _this$requestData5;
614
- (_this$requestData5 = this.requestData) === null || _this$requestData5 === void 0 ? void 0 : _this$requestData5.call(this);
614
+ (_this$requestData5 = this.requestData) === null || _this$requestData5 === void 0 || _this$requestData5.call(this);
615
615
  } else if (query) {
616
616
  this.requestStyleRanges();
617
617
  }
@@ -728,7 +728,7 @@ var QueryAssist = /*#__PURE__*/function (_Component) {
728
728
  this.immediateState.selection = null;
729
729
  if (!this.props.focus) {
730
730
  var _this$caret11;
731
- (_this$caret11 = this.caret) === null || _this$caret11 === void 0 ? void 0 : _this$caret11.target.blur();
731
+ (_this$caret11 = this.caret) === null || _this$caret11 === void 0 || _this$caret11.target.blur();
732
732
  }
733
733
  }
734
734
  /**
@@ -877,6 +877,7 @@ var QueryAssist = /*#__PURE__*/function (_Component) {
877
877
  ["".concat(modules_da7ab055.input, " ring-js-shortcuts")]: true,
878
878
  [modules_da7ab055.inputGap]: actions.length || this.isRenderingGlassOrLoader() && !glass,
879
879
  [modules_da7ab055.inputGap2]: actions.length === 2,
880
+ // TODO: replace with flex-box layout
880
881
  [modules_da7ab055.inputRevertOrder]: !glass || huge
881
882
  });
882
883
  var placeholderStyles = classNames({
@@ -179,7 +179,6 @@ function _getListItems(props, state, rawFilterString) {
179
179
  if (_isInputMode(props.type) && !props.allowAny && state.selected && !Array.isArray(state.selected) && filterString === state.selected.label) {
180
180
  filterString = ''; // ignore multiple if it is exactly the selected item
181
181
  }
182
-
183
182
  var lowerCaseString = filterString.toLowerCase();
184
183
  var filteredData = [];
185
184
  var exactMatch = false;
@@ -343,7 +342,7 @@ var Select = /*#__PURE__*/function (_Component) {
343
342
  var _this$node;
344
343
  var focusableSelectExists = (_this$node = _this.node) === null || _this$node === void 0 ? void 0 : _this$node.querySelector('[data-test~=ring-select__focus]');
345
344
  var restoreFocusNode = _this.props.targetElement || focusableSelectExists;
346
- restoreFocusNode === null || restoreFocusNode === void 0 ? void 0 : restoreFocusNode.focus();
345
+ restoreFocusNode === null || restoreFocusNode === void 0 || restoreFocusNode.focus();
347
346
  });
348
347
  _defineProperty(_assertThisInitialized(_this), "_onEnter", function () {
349
348
  var _this$_popup2;
@@ -1181,40 +1180,61 @@ var Select = /*#__PURE__*/function (_Component) {
1181
1180
  _defineProperty(Select, "defaultProps", {
1182
1181
  data: [],
1183
1182
  filter: false,
1183
+ // enable filter (not in INPUT modes)
1184
1184
  filterIcon: null,
1185
1185
  filterRef: noop,
1186
1186
  multiple: false,
1187
+ // multiple can be an object - see demo for more information
1187
1188
  clear: false,
1189
+ // enable clear button that clears the "selected" state
1188
1190
  loading: false,
1191
+ // show a loading indicator while data is loading
1189
1192
  disabled: false,
1193
+ // disable select
1190
1194
  type: Type.BUTTON,
1191
1195
  size: Size.M,
1192
1196
  targetElement: null,
1197
+ // element to bind the popup to (select BUTTON or INPUT by default)
1193
1198
  hideSelected: false,
1199
+ // INPUT mode: clears the input after an option is selected (useful when the selection is displayed in some custom way elsewhere)
1194
1200
  allowAny: false,
1201
+ // INPUT mode: allows any value to be entered
1195
1202
  hideArrow: false,
1203
+ // hide dropdown arrow icon
1196
1204
  showPopup: false,
1197
1205
  maxHeight: 600,
1206
+ // height of the options list, including the filter and the 'Add' button
1198
1207
  directions: [Popup.PopupProps.Directions.BOTTOM_RIGHT, Popup.PopupProps.Directions.BOTTOM_LEFT, Popup.PopupProps.Directions.TOP_LEFT, Popup.PopupProps.Directions.TOP_RIGHT],
1199
1208
  selected: null,
1209
+ // current selection (item / array of items)
1200
1210
  label: null,
1211
+ // BUTTON or INPUT label (nothing selected)
1201
1212
  selectedLabel: null,
1213
+ // BUTTON or INPUT label (something selected)
1202
1214
  inputPlaceholder: '',
1215
+ // Placeholder for input modes
1203
1216
  hint: null,
1217
+ // hint text to display under the list
1204
1218
  shortcutsEnabled: false,
1205
1219
  onBeforeOpen: noop,
1206
1220
  onLoadMore: noop,
1207
1221
  onOpen: noop,
1208
1222
  onClose: noop,
1209
1223
  onFilter: noop,
1224
+ // search string as first argument
1210
1225
  onFocus: noop,
1211
1226
  onBlur: noop,
1212
1227
  onKeyDown: noop,
1213
1228
  onSelect: noop,
1229
+ // single + multi
1214
1230
  onDeselect: noop,
1231
+ // multi
1215
1232
  onOutsideClick: noop,
1233
+ // multi
1216
1234
  onChange: noop,
1235
+ // multi
1217
1236
  onAdd: noop,
1237
+ // search string as first argument
1218
1238
  onDone: noop,
1219
1239
  onReset: noop,
1220
1240
  tags: null,
@@ -329,11 +329,9 @@ angularModule.directive('rgSelect', function rgSelectDirective() {
329
329
  if (query !== lastQuery) {
330
330
  return; // do not process the result if queries don't match
331
331
  }
332
-
333
332
  if (skip && ctrl.lastSkip !== -1 && skip !== ctrl.lastSkip + infiniteScrollPackSize && ctrl.infiniteScrollPackSize) {
334
333
  return; // do not process the result if skips not match
335
334
  }
336
-
337
335
  var items = memorizeOptions(results.data || results, skip).map(ctrl.convertNgModelToSelect);
338
336
  $timeout.cancel(loaderDelayTimeout);
339
337
  ctrl.dataReceived = true;
@@ -184,7 +184,7 @@ var SelectLazy = /*#__PURE__*/function () {
184
184
  ref: function ref(node) {
185
185
  var _node$_openPopupIfClo;
186
186
  _this2.selectRef(node);
187
- node === null || node === void 0 || (_node$_openPopupIfClo = node._openPopupIfClosed) === null || _node$_openPopupIfClo === void 0 ? void 0 : _node$_openPopupIfClo.call(node);
187
+ node === null || node === void 0 || (_node$_openPopupIfClo = node._openPopupIfClosed) === null || _node$_openPopupIfClo === void 0 || _node$_openPopupIfClo.call(node);
188
188
  }
189
189
  }), this.container);
190
190
  } else {
@@ -85,7 +85,7 @@ var FallbackStorage = /*#__PURE__*/function () {
85
85
  */
86
86
  }, {
87
87
  key: "set",
88
- value: function () {
88
+ value: (function () {
89
89
  var _set = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(key, value) {
90
90
  var data;
91
91
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -121,9 +121,10 @@ var FallbackStorage = /*#__PURE__*/function () {
121
121
  * @param {string} key
122
122
  * @return {Promise}
123
123
  */
124
+ )
124
125
  }, {
125
126
  key: "remove",
126
- value: function () {
127
+ value: (function () {
127
128
  var _remove = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(key) {
128
129
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
129
130
  while (1) switch (_context2.prev = _context2.next) {
@@ -146,6 +147,7 @@ var FallbackStorage = /*#__PURE__*/function () {
146
147
  * @param {function(string, value)} callback
147
148
  * @return {Promise}
148
149
  */
150
+ )
149
151
  }, {
150
152
  key: "each",
151
153
  value: function each(callback) {