@jetbrains/ring-ui 5.1.19 → 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 (70) hide show
  1. package/README.md +1 -1
  2. package/components/auth/request-builder.d.ts +1 -0
  3. package/components/code/code.d.ts +1 -0
  4. package/components/editable-heading/editable-heading.css +5 -1
  5. package/components/editable-heading/editable-heading.d.ts +1 -1
  6. package/components/editable-heading/editable-heading.js +5 -3
  7. package/components/grid/row.js +3 -3
  8. package/components/header/profile.js +1 -1
  9. package/components/island/header.js +1 -1
  10. package/components/list/list.js +3 -3
  11. package/components/loader/loader__core.js +6 -6
  12. package/components/popup/popup.js +3 -3
  13. package/components/progress-bar/progress-bar.css +6 -0
  14. package/components/progress-bar/progress-bar.d.ts +6 -0
  15. package/components/progress-bar/progress-bar.js +9 -3
  16. package/components/query-assist/query-assist.js +1 -1
  17. package/components/select/select-popup.css +4 -0
  18. package/components/select/select.js +21 -21
  19. package/dist/_helpers/select__filter.js +1 -1
  20. package/dist/analytics/analytics__custom-plugin.js +1 -2
  21. package/dist/analytics/analytics__ga-plugin.js +1 -1
  22. package/dist/auth/auth__core.js +35 -35
  23. package/dist/auth/background-flow.js +2 -2
  24. package/dist/auth/iframe-flow.js +3 -3
  25. package/dist/auth/request-builder.d.ts +1 -0
  26. package/dist/auth/request-builder.js +2 -1
  27. package/dist/auth/storage.js +8 -4
  28. package/dist/auth/token-validator.js +4 -3
  29. package/dist/auth/window-flow.js +3 -3
  30. package/dist/auth-ng/auth-ng.js +0 -1
  31. package/dist/caret/caret.js +4 -4
  32. package/dist/clipboard/clipboard-fallback.js +3 -3
  33. package/dist/code/code.d.ts +1 -0
  34. package/dist/data-list/data-list.js +2 -2
  35. package/dist/date-picker/date-picker.js +1 -1
  36. package/dist/date-picker/date-popup.js +2 -2
  37. package/dist/dropdown/dropdown.js +2 -2
  38. package/dist/editable-heading/editable-heading.d.ts +1 -1
  39. package/dist/editable-heading/editable-heading.js +16 -9
  40. package/dist/global/focus-sensor-hoc.js +6 -6
  41. package/dist/global/schedule-raf.js +1 -1
  42. package/dist/grid/row.js +7 -1
  43. package/dist/header/profile.js +1 -0
  44. package/dist/header/smart-services.js +2 -2
  45. package/dist/input/input.js +2 -2
  46. package/dist/island/content.js +1 -1
  47. package/dist/island/header.js +1 -0
  48. package/dist/list/list.js +3 -0
  49. package/dist/loader/loader.js +1 -1
  50. package/dist/loader/loader__core.js +19 -7
  51. package/dist/loader-screen-ng/loader-screen-ng.js +0 -2
  52. package/dist/message-bundle-ng/message-bundle-ng.js +0 -1
  53. package/dist/pager/pager.js +4 -4
  54. package/dist/popup/popup.js +3 -0
  55. package/dist/progress-bar/progress-bar.d.ts +6 -0
  56. package/dist/progress-bar/progress-bar.js +11 -4
  57. package/dist/query-assist/query-assist.js +13 -12
  58. package/dist/select/select.js +22 -2
  59. package/dist/select-ng/select-ng.js +0 -2
  60. package/dist/select-ng/select-ng__lazy.js +1 -1
  61. package/dist/storage/storage__fallback.js +4 -2
  62. package/dist/style.css +1 -1
  63. package/dist/tab-trap/tab-trap.js +1 -1
  64. package/dist/table/multitable.js +7 -7
  65. package/dist/table/row-with-focus-sensor.js +4 -4
  66. package/dist/table/selection-shortcuts-hoc.js +11 -11
  67. package/dist/tag/tag.js +1 -1
  68. package/dist/tags-input/tags-input.js +7 -7
  69. package/dist/tooltip/tooltip.js +2 -2
  70. package/package.json +32 -32
@@ -50,9 +50,9 @@ import 'combokeys';
50
50
  import '../global/sniffer.js';
51
51
  import 'sniffr';
52
52
 
53
- var modules_6e69b0fe = {"unit":"i__const_unit_0","editableHeading":"editableHeading_rui_0870","fullSize":"fullSize_rui_0870","isEditing":"isEditing_rui_0870","headingWrapperButton":"headingWrapperButton_rui_0870","disabled":"disabled_rui_0870","selectionMode":"selectionMode_rui_0870","heading":"heading_rui_0870","multiline":"multiline_rui_0870","input":"input_rui_0870","error":"error_rui_0870","textarea":"textarea_rui_0870","textareaFade":"textareaFade_rui_0870","textareaWrapper":"textareaWrapper_rui_0870","button":"button_rui_0870","errorText":"errorText_rui_0870","level1":"level1_rui_0870","level2":"level2_rui_0870","level3":"level3_rui_0870","sizeS":"sizeS_rui_0870","sizeM":"sizeM_rui_0870","sizeL":"sizeL_rui_0870","sizeFULL":"sizeFULL_rui_0870"};
53
+ var modules_6e69b0fe = {"unit":"i__const_unit_0","editableHeading":"editableHeading_rui_0870","fullSize":"fullSize_rui_0870","isEditing":"isEditing_rui_0870","headingWrapperButton":"headingWrapperButton_rui_0870","disabled":"disabled_rui_0870","selectionMode":"selectionMode_rui_0870","heading":"heading_rui_0870","multiline":"multiline_rui_0870","input":"input_rui_0870","error":"error_rui_0870","textarea":"textarea_rui_0870","textareaNotOverflow":"textareaNotOverflow_rui_0870","textareaFade":"textareaFade_rui_0870","textareaWrapper":"textareaWrapper_rui_0870","button":"button_rui_0870","errorText":"errorText_rui_0870","level1":"level1_rui_0870","level2":"level2_rui_0870","level3":"level3_rui_0870","sizeS":"sizeS_rui_0870","sizeM":"sizeM_rui_0870","sizeL":"sizeL_rui_0870","sizeFULL":"sizeFULL_rui_0870"};
54
54
 
55
- var _excluded = ["level", "className", "headingClassName", "inputClassName", "children", "isEditing", "isSavingPossible", "isSaving", "embedded", "size", "onEdit", "onSave", "onCancel", "autoFocus", "data-test", "error", "disabled", "multiline", "renderMenu", "onFocus", "onBlur", "onChange", "onScroll", "maxInputHeight", "translations"];
55
+ var _excluded = ["level", "className", "headingClassName", "inputClassName", "children", "isEditing", "isSavingPossible", "isSaving", "embedded", "size", "onEdit", "onSave", "onCancel", "autoFocus", "data-test", "error", "disabled", "multiline", "renderMenu", "onFocus", "onBlur", "onChange", "onScroll", "maxInputRows", "translations"];
56
56
  function noop() {}
57
57
  var EditableHeading = function EditableHeading(props) {
58
58
  var _props$level = props.level,
@@ -92,7 +92,7 @@ var EditableHeading = function EditableHeading(props) {
92
92
  onBlur = props.onBlur,
93
93
  onChange = props.onChange,
94
94
  onScroll = props.onScroll,
95
- maxInputHeight = props.maxInputHeight,
95
+ maxInputRows = props.maxInputRows,
96
96
  _props$translations = props.translations,
97
97
  translations = _props$translations === void 0 ? {
98
98
  save: 'Save',
@@ -119,6 +119,10 @@ var EditableHeading = function EditableHeading(props) {
119
119
  _React$useState10 = _slicedToArray(_React$useState9, 2),
120
120
  isScrolledToBottom = _React$useState10[0],
121
121
  setIsScrolledToBottom = _React$useState10[1];
122
+ var _React$useState11 = React.useState(false),
123
+ _React$useState12 = _slicedToArray(_React$useState11, 2),
124
+ isOverflow = _React$useState12[0],
125
+ setIsOverflow = _React$useState12[1];
122
126
  var hasError = error !== undefined;
123
127
  var isSaveDisabled = !isSavingPossible || !children || children.trim() === '' || hasError || isSaving;
124
128
  var isCancelDisabled = isSaving;
@@ -142,7 +146,9 @@ var EditableHeading = function EditableHeading(props) {
142
146
  [modules_6e69b0fe.selectionMode]: isInSelectionMode
143
147
  });
144
148
  var headingClasses = classNames(modules_6e69b0fe.heading, headingClassName, modules_6e69b0fe["size".concat(size)]);
145
- var inputClasses = classNames('ring-js-shortcuts', modules_6e69b0fe.input, modules_6e69b0fe.textarea, modules_88cfaf40["size".concat(size)], modules_6e69b0fe["level".concat(level)], inputClassName);
149
+ var inputClasses = classNames('ring-js-shortcuts', modules_6e69b0fe.input, modules_6e69b0fe.textarea, {
150
+ [modules_6e69b0fe.textareaNotOverflow]: !isOverflow
151
+ }, modules_88cfaf40["size".concat(size)], modules_6e69b0fe["level".concat(level)], inputClassName);
146
152
  var stretch = useCallback(function (el) {
147
153
  if (!el || !el.style) {
148
154
  return;
@@ -163,6 +169,7 @@ var EditableHeading = function EditableHeading(props) {
163
169
  var clientHeight = el.clientHeight || 0;
164
170
  var scrollTop = el.scrollTop || 0;
165
171
  setIsScrolledToBottom(scrollHeight - clientHeight <= scrollTop);
172
+ setIsOverflow(scrollHeight > clientHeight);
166
173
  }, [setIsScrolledToBottom]);
167
174
  var onHeadingMouseDown = React.useCallback(function () {
168
175
  setIsMouseDown(true);
@@ -184,20 +191,20 @@ var EditableHeading = function EditableHeading(props) {
184
191
  setIsInFocus(true);
185
192
  checkValue(e.target);
186
193
  checkOverflow(e.target);
187
- onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
194
+ onFocus === null || onFocus === void 0 || onFocus(e);
188
195
  }, [onFocus, checkOverflow, checkValue]);
189
196
  var onInputChange = React.useCallback(function (e) {
190
197
  checkValue(e.target);
191
198
  checkOverflow(e.target);
192
- onChange === null || onChange === void 0 ? void 0 : onChange(e);
199
+ onChange === null || onChange === void 0 || onChange(e);
193
200
  }, [onChange, checkOverflow, checkValue]);
194
201
  var onInputScroll = React.useCallback(function (e) {
195
202
  checkOverflow(e.target);
196
- onScroll === null || onScroll === void 0 ? void 0 : onScroll(e);
203
+ onScroll === null || onScroll === void 0 || onScroll(e);
197
204
  }, [onScroll, checkOverflow]);
198
205
  var onInputBlur = React.useCallback(function (e) {
199
206
  setIsInFocus(false);
200
- onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
207
+ onBlur === null || onBlur === void 0 || onBlur(e);
201
208
  }, [onBlur]);
202
209
  useEffect(function () {
203
210
  window.addEventListener('mousemove', onMouseMove);
@@ -238,7 +245,7 @@ var EditableHeading = function EditableHeading(props) {
238
245
  onBlur: onInputBlur,
239
246
  onScroll: onInputScroll,
240
247
  style: {
241
- maxHeight: maxInputHeight
248
+ maxHeight: maxInputRows ? "".concat(maxInputRows, "lh") : ''
242
249
  }
243
250
  })), !isScrolledToBottom && /*#__PURE__*/React.createElement("div", {
244
251
  className: modules_6e69b0fe.textareaFade
@@ -55,7 +55,7 @@ function focusSensorHOC(ComposedComponent) {
55
55
  _this.setState({
56
56
  focused: true
57
57
  });
58
- (_this$props$onFocus = (_this$props = _this.props).onFocus) === null || _this$props$onFocus === void 0 ? void 0 : _this$props$onFocus.call(_this$props);
58
+ (_this$props$onFocus = (_this$props = _this.props).onFocus) === null || _this$props$onFocus === void 0 || _this$props$onFocus.call(_this$props);
59
59
  }
60
60
  });
61
61
  _defineProperty(_assertThisInitialized(_this), "onBlurCapture", function (_ref3) {
@@ -71,7 +71,7 @@ function focusSensorHOC(ComposedComponent) {
71
71
  _this.setState({
72
72
  focused: false
73
73
  });
74
- (_this$props$onBlur = (_this$props2 = _this.props).onBlur) === null || _this$props$onBlur === void 0 ? void 0 : _this$props$onBlur.call(_this$props2);
74
+ (_this$props$onBlur = (_this$props2 = _this.props).onBlur) === null || _this$props$onBlur === void 0 || _this$props$onBlur.call(_this$props2);
75
75
  }
76
76
  }, 1);
77
77
  }
@@ -79,13 +79,13 @@ function focusSensorHOC(ComposedComponent) {
79
79
  _defineProperty(_assertThisInitialized(_this), "onFocusRestore", function () {
80
80
  var _this$node2;
81
81
  _this._skipNextCapture = true;
82
- (_this$node2 = _this.node) === null || _this$node2 === void 0 ? void 0 : _this$node2.focus({
82
+ (_this$node2 = _this.node) === null || _this$node2 === void 0 || _this$node2.focus({
83
83
  preventScroll: !_this.props.scrollOnTableFocus
84
84
  });
85
85
  });
86
86
  _defineProperty(_assertThisInitialized(_this), "onFocusReset", function () {
87
87
  var _this$node3;
88
- (_this$node3 = _this.node) === null || _this$node3 === void 0 ? void 0 : _this$node3.blur();
88
+ (_this$node3 = _this.node) === null || _this$node3 === void 0 || _this$node3.blur();
89
89
  });
90
90
  return _this;
91
91
  }
@@ -96,14 +96,14 @@ function focusSensorHOC(ComposedComponent) {
96
96
  autofocus = _this$props3.autofocus,
97
97
  scrollOnTableFocus = _this$props3.scrollOnTableFocus,
98
98
  node = this.node;
99
- node === null || node === void 0 ? void 0 : node.setAttribute('tabindex', '0');
99
+ node === null || node === void 0 || node.setAttribute('tabindex', '0');
100
100
  if (node != null) {
101
101
  node.style.outline = 'none';
102
102
  }
103
103
  document.addEventListener('focus', this.onFocusCapture, true);
104
104
  document.addEventListener('blur', this.onBlurCapture, true);
105
105
  if (autofocus) {
106
- node === null || node === void 0 ? void 0 : node.focus({
106
+ node === null || node === void 0 || node.focus({
107
107
  preventScroll: !scrollOnTableFocus
108
108
  });
109
109
  }
@@ -5,7 +5,7 @@ function scheduleRAF(trailingCall) {
5
5
  function doSchedule() {
6
6
  RAF = window.requestAnimationFrame(function () {
7
7
  var _scheduledCb;
8
- (_scheduledCb = scheduledCb) === null || _scheduledCb === void 0 ? void 0 : _scheduledCb();
8
+ (_scheduledCb = scheduledCb) === null || _scheduledCb === void 0 || _scheduledCb();
9
9
  if (trailingCallScheduled) {
10
10
  trailingCallScheduled = false;
11
11
  doSchedule();
package/dist/grid/row.js CHANGED
@@ -10,7 +10,13 @@ import { m as modules_855170c0 } from '../_helpers/grid.js';
10
10
 
11
11
  var _excluded = ["children", "className", "reverse"];
12
12
  var ModifierType = PropTypes.oneOf(['xs', 'sm', 'md', 'lg']);
13
- var modifierKeys = ['start', 'center', 'end', 'around', 'between', 'top', 'middle', 'baseline', 'bottom', 'first', 'last' // order
13
+ var modifierKeys = ['start', 'center', 'end',
14
+ // text-align, justify-content
15
+ 'around', 'between',
16
+ // justify-content
17
+ 'top', 'middle', 'baseline', 'bottom',
18
+ // align-items
19
+ 'first', 'last' // order
14
20
  ];
15
21
  /**
16
22
  * Converts xs="middle" to class "middle-xs"
@@ -161,6 +161,7 @@ var Profile = /*#__PURE__*/function (_PureComponent) {
161
161
  rgItemType: PopupMenu.ListProps.Type.LINK,
162
162
  label: (_translations$profile = translations === null || translations === void 0 ? void 0 : translations.profile) !== null && _translations$profile !== void 0 ? _translations$profile : translate('profile'),
163
163
  target: '_self',
164
+ // Full page reload in Angular
164
165
  href: profileUrl,
165
166
  LinkComponent
166
167
  }, showSwitchUser && {
@@ -129,7 +129,7 @@ var SmartServices = /*#__PURE__*/function (_Component) {
129
129
  _this.setState({
130
130
  loading: true
131
131
  });
132
- (_this$getServices = _this.getServices(SmartServices.allFields)) === null || _this$getServices === void 0 ? void 0 : _this$getServices.then(function (services) {
132
+ (_this$getServices = _this.getServices(SmartServices.allFields)) === null || _this$getServices === void 0 || _this$getServices.then(function (services) {
133
133
  _this.setState({
134
134
  services
135
135
  });
@@ -145,7 +145,7 @@ var SmartServices = /*#__PURE__*/function (_Component) {
145
145
  _this2 = this;
146
146
  var auth = this.props.auth;
147
147
  this.http = new HTTP(auth, auth.getAPIPath());
148
- (_this$getServices2 = this.getServices(SmartServices.countFields)) === null || _this$getServices2 === void 0 ? void 0 : _this$getServices2.then(function (services) {
148
+ (_this$getServices2 = this.getServices(SmartServices.countFields)) === null || _this$getServices2 === void 0 || _this$getServices2.then(function (services) {
149
149
  if (!services.length) {
150
150
  _this2.setState({
151
151
  visible: false
@@ -74,14 +74,14 @@ var Input = /*#__PURE__*/function (_PureComponent) {
74
74
  _defineProperty(_assertThisInitialized(_this), "handleInputChange", function (e) {
75
75
  if (!_this.props.multiline) {
76
76
  var _this$props$onChange, _this$props;
77
- (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, e);
77
+ (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 || _this$props$onChange.call(_this$props, e);
78
78
  _this.checkValue();
79
79
  }
80
80
  });
81
81
  _defineProperty(_assertThisInitialized(_this), "handleTextareaChange", function (e) {
82
82
  if (_this.props.multiline) {
83
83
  var _this$props$onChange2, _this$props2;
84
- (_this$props$onChange2 = (_this$props2 = _this.props).onChange) === null || _this$props$onChange2 === void 0 ? void 0 : _this$props$onChange2.call(_this$props2, e);
84
+ (_this$props$onChange2 = (_this$props2 = _this.props).onChange) === null || _this$props$onChange2 === void 0 || _this$props$onChange2.call(_this$props2, e);
85
85
  _this.checkValue();
86
86
  }
87
87
  });
@@ -53,7 +53,7 @@ var Content = /*#__PURE__*/function (_Component) {
53
53
  var scrolledToBottom = offsetHeight + scrollTop >= scrollHeight - END_DISTANCE;
54
54
  if (scrolledToBottom) {
55
55
  var _this$props$onScrollT, _this$props;
56
- (_this$props$onScrollT = (_this$props = _this.props).onScrollToBottom) === null || _this$props$onScrollT === void 0 ? void 0 : _this$props$onScrollT.call(_this$props);
56
+ (_this$props$onScrollT = (_this$props = _this.props).onScrollToBottom) === null || _this$props$onScrollT === void 0 || _this$props$onScrollT.call(_this$props);
57
57
  }
58
58
  _this.setState({
59
59
  scrolledToTop,
@@ -56,6 +56,7 @@ var Header = /*#__PURE__*/function (_Component) {
56
56
  });
57
57
  var headerStyle = phase != null ? {
58
58
  lineHeight: "".concat(this.style('LINE_HEIGHT'), "px"),
59
+ // need to append px because number is a valid line-height value
59
60
  paddingTop: this.style('PADDING_TOP'),
60
61
  paddingBottom: this.style('PADDING_BOTTOM')
61
62
  } : undefined;
package/dist/list/list.js CHANGED
@@ -776,8 +776,11 @@ _defineProperty(List, "propTypes", {
776
776
  _defineProperty(List, "defaultProps", {
777
777
  data: [],
778
778
  restoreActiveIndex: false,
779
+ // restore active item using its "key" property
779
780
  activateSingleItem: false,
781
+ // if there is only one item, activate it
780
782
  activateFirstItem: false,
783
+ // if there no active items, activate the first one
781
784
  onMouseOut: noop,
782
785
  onSelect: noop,
783
786
  onScrollToBottom: noop,
@@ -56,7 +56,7 @@ var Loader = /*#__PURE__*/function (_PureComponent) {
56
56
  key: "componentWillUnmount",
57
57
  value: function componentWillUnmount() {
58
58
  var _this$loader;
59
- (_this$loader = this.loader) === null || _this$loader === void 0 ? void 0 : _this$loader.destroy();
59
+ (_this$loader = this.loader) === null || _this$loader === void 0 || _this$loader.destroy();
60
60
  }
61
61
  }, {
62
62
  key: "render",
@@ -102,7 +102,7 @@ var LoaderCore = /*#__PURE__*/function () {
102
102
  this.canvas.style.width = "".concat(this.props.size, "px");
103
103
  this.canvas.style.height = "".concat(this.props.size, "px");
104
104
  this.ctx = this.canvas.getContext('2d');
105
- (_this$ctx = this.ctx) === null || _this$ctx === void 0 ? void 0 : _this$ctx.scale(pixelRatio, pixelRatio);
105
+ (_this$ctx = this.ctx) === null || _this$ctx === void 0 || _this$ctx.scale(pixelRatio, pixelRatio);
106
106
  this.height = this.props.size;
107
107
  this.width = this.props.size;
108
108
  this.particles = [];
@@ -282,27 +282,39 @@ _defineProperty(LoaderCore, "defaultProps", {
282
282
  r: 215,
283
283
  g: 60,
284
284
  b: 234
285
- }, {
285
+ },
286
+ //#D73CEA
287
+ {
286
288
  r: 145,
287
289
  g: 53,
288
290
  b: 224
289
- }, {
291
+ },
292
+ //#9135E0
293
+ {
290
294
  r: 88,
291
295
  g: 72,
292
296
  b: 224
293
- }, {
297
+ },
298
+ //#5848F4
299
+ {
294
300
  r: 37,
295
301
  g: 183,
296
302
  b: 255
297
- }, {
303
+ },
304
+ //#25B7FF
305
+ {
298
306
  r: 89,
299
307
  g: 189,
300
308
  b: 0
301
- }, {
309
+ },
310
+ //#59BD00
311
+ {
302
312
  r: 251,
303
313
  g: 172,
304
314
  b: 2
305
- }, {
315
+ },
316
+ //#FBAC02
317
+ {
306
318
  r: 227,
307
319
  g: 37,
308
320
  b: 129
@@ -34,7 +34,6 @@ angularModule.service('loaderScreen', ["$timeout", "$rootScope", function servic
34
34
  if (showLoaderPromise) {
35
35
  return; // already scheduled to show
36
36
  }
37
-
38
37
  showLoaderPromise = $timeout(function () {
39
38
  _this.setVisible(true);
40
39
  }, ttl);
@@ -83,7 +82,6 @@ angularModule.service('loaderScreen', ["$timeout", "$rootScope", function servic
83
82
  });
84
83
  /* eslint-enable angular/on-watch */
85
84
  }]);
86
-
87
85
  angularModule.directive('rgLoaderScreen', function rgLoaderScreenDirective() {
88
86
  return {
89
87
  restrict: 'A',
@@ -144,7 +144,6 @@ function RingMessageBundle(ringI18n) {
144
144
  };
145
145
  /* eslint-enable camelcase */
146
146
  }
147
-
148
147
  angularModule.factory('ringI18n', emptyI18n);
149
148
  angularModule.service('RingMessageBundle', ['ringI18n', RingMessageBundle]);
150
149
  var messageBundleNg = angularModule.name;
@@ -138,7 +138,7 @@ var Pager = /*#__PURE__*/function (_PureComponent) {
138
138
  if (currentPage !== 1) {
139
139
  var _this$props$onPageCha, _this$props;
140
140
  var prevPage = currentPage - 1;
141
- (_this$props$onPageCha = (_this$props = _this.props).onPageChange) === null || _this$props$onPageCha === void 0 ? void 0 : _this$props$onPageCha.call(_this$props, prevPage);
141
+ (_this$props$onPageCha = (_this$props = _this.props).onPageChange) === null || _this$props$onPageCha === void 0 || _this$props$onPageCha.call(_this$props, prevPage);
142
142
  }
143
143
  });
144
144
  _defineProperty(_assertThisInitialized(_this), "handleNextClick", function () {
@@ -149,7 +149,7 @@ var Pager = /*#__PURE__*/function (_PureComponent) {
149
149
  var total = _this.getTotalPages();
150
150
  if (currentPage !== total) {
151
151
  var _this$props$onPageCha2, _this$props3;
152
- (_this$props$onPageCha2 = (_this$props3 = _this.props).onPageChange) === null || _this$props$onPageCha2 === void 0 ? void 0 : _this$props$onPageCha2.call(_this$props3, nextPage);
152
+ (_this$props$onPageCha2 = (_this$props3 = _this.props).onPageChange) === null || _this$props$onPageCha2 === void 0 || _this$props$onPageCha2.call(_this$props3, nextPage);
153
153
  } else if (_this.props.openTotal) {
154
154
  onLoadPage(nextPage);
155
155
  }
@@ -157,7 +157,7 @@ var Pager = /*#__PURE__*/function (_PureComponent) {
157
157
  _defineProperty(_assertThisInitialized(_this), "handlePageChange", memoize(function (i) {
158
158
  return function (event) {
159
159
  var _this$props$onPageCha3, _this$props4;
160
- (_this$props$onPageCha3 = (_this$props4 = _this.props).onPageChange) === null || _this$props$onPageCha3 === void 0 ? void 0 : _this$props$onPageCha3.call(_this$props4, i, event);
160
+ (_this$props$onPageCha3 = (_this$props4 = _this.props).onPageChange) === null || _this$props$onPageCha3 === void 0 || _this$props$onPageCha3.call(_this$props4, i, event);
161
161
  };
162
162
  }));
163
163
  _defineProperty(_assertThisInitialized(_this), "handleLoadMore", memoize(function (i) {
@@ -315,7 +315,7 @@ var Pager = /*#__PURE__*/function (_PureComponent) {
315
315
  var translate = this.context.translate;
316
316
  if (totalPages < this.props.currentPage) {
317
317
  var _this$props$onPageCha4, _this$props9;
318
- (_this$props$onPageCha4 = (_this$props9 = this.props).onPageChange) === null || _this$props$onPageCha4 === void 0 ? void 0 : _this$props$onPageCha4.call(_this$props9, totalPages);
318
+ (_this$props$onPageCha4 = (_this$props9 = this.props).onPageChange) === null || _this$props$onPageCha4 === void 0 || _this$props$onPageCha4.call(_this$props9, totalPages);
319
319
  }
320
320
  var start = 1;
321
321
  var end = totalPages;
@@ -393,8 +393,10 @@ Popup.propTypes = {
393
393
  dontCloseOnAnchorClick: PropTypes.bool,
394
394
  shortcuts: PropTypes.bool,
395
395
  keepMounted: PropTypes.bool,
396
+ // pass this prop to preserve the popup's DOM state while hidden
396
397
  'data-test': PropTypes.string,
397
398
  client: PropTypes.bool,
399
+ // true means that it's never used in SSR
398
400
  directions: PropTypes.arrayOf(PropTypes.string),
399
401
  autoPositioning: PropTypes.bool,
400
402
  autoCorrectTopOverflow: PropTypes.bool,
@@ -404,6 +406,7 @@ Popup.propTypes = {
404
406
  minWidth: PropTypes.number,
405
407
  sidePadding: PropTypes.number,
406
408
  attached: PropTypes.bool,
409
+ // Popup adjacent to an input, without upper border and shadow
407
410
  onMouseDown: PropTypes.func,
408
411
  onMouseUp: PropTypes.func,
409
412
  onMouseOver: PropTypes.func,
@@ -5,6 +5,7 @@ export interface ProgressBarProps extends HTMLAttributes<HTMLElement> {
5
5
  value: number;
6
6
  label: string;
7
7
  global?: boolean | null | undefined;
8
+ staticColor?: boolean;
8
9
  }
9
10
  /**
10
11
  * @name Progress Bar
@@ -43,6 +44,11 @@ export default class ProgressBar extends PureComponent<ProgressBarProps> {
43
44
  * @type {number}
44
45
  */
45
46
  value: PropTypes.Requireable<number>;
47
+ /**
48
+ * Disables Disabled progress bar color animation and sets it to static color.
49
+ * @type {boolean}
50
+ */
51
+ staticColor: PropTypes.Requireable<boolean>;
46
52
  };
47
53
  static defaultProps: {
48
54
  max: number;
@@ -4,9 +4,9 @@ import React, { PureComponent } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import classNames from 'classnames';
6
6
 
7
- var modules_fb7af416 = {"dark":"dark_rui_eb55","unit":"i__const_unit_1","light":"light_rui_2ac4","progressBar":"progressBar_rui_5875","globalMode":"globalMode_rui_5875","line":"line_rui_5875","progress-bar":"progress-bar_rui_5875"};
7
+ var modules_fb7af416 = {"dark":"dark_rui_eb55","unit":"i__const_unit_1","light":"light_rui_2ac4","progressBar":"progressBar_rui_5875","globalMode":"globalMode_rui_5875","line":"line_rui_5875","progress-bar":"progress-bar_rui_5875","staticLineColor":"staticLineColor_rui_5875"};
8
8
 
9
- var _excluded = ["className", "global", "max", "value", "label"];
9
+ var _excluded = ["className", "global", "max", "value", "label", "staticColor"];
10
10
  /**
11
11
  * @name Progress Bar
12
12
  */
@@ -39,10 +39,12 @@ var ProgressBar = /*#__PURE__*/function (_PureComponent) {
39
39
  max = _this$props.max,
40
40
  value = _this$props.value,
41
41
  label = _this$props.label,
42
+ staticColor = _this$props.staticColor,
42
43
  otherProps = _objectWithoutProperties(_this$props, _excluded);
43
44
  var width = value ? "".concat(ProgressBar.toPercent(value, max), "%") : undefined;
44
45
  var classes = classNames(modules_fb7af416.progressBar, className, {
45
- [modules_fb7af416.globalMode]: global
46
+ [modules_fb7af416.globalMode]: global,
47
+ [modules_fb7af416.staticLineColor]: staticColor
46
48
  });
47
49
  return /*#__PURE__*/React.createElement("div", _extends({}, otherProps, {
48
50
  className: classes,
@@ -102,7 +104,12 @@ _defineProperty(ProgressBar, "propTypes", {
102
104
  * A floating point number that specifies current task completion rate.
103
105
  * @type {number}
104
106
  */
105
- value: PropTypes.number
107
+ value: PropTypes.number,
108
+ /**
109
+ * Disables Disabled progress bar color animation and sets it to static color.
110
+ * @type {boolean}
111
+ */
112
+ staticColor: PropTypes.bool
106
113
  });
107
114
  _defineProperty(ProgressBar, "defaultProps", {
108
115
  max: 1.0,
@@ -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,