@jetbrains/ring-ui-built 7.0.0-beta.2 → 7.0.0-beta.3

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 (236) hide show
  1. package/components/_helpers/_rollupPluginBabelHelpers.js +1 -504
  2. package/components/_helpers/anchor.js +7 -5
  3. package/components/_helpers/button__classes.js +15 -13
  4. package/components/_helpers/caption.js +11 -17
  5. package/components/_helpers/card.js +92 -96
  6. package/components/_helpers/dialog__body-scroll-preventer.js +10 -17
  7. package/components/_helpers/icon__svg.js +27 -23
  8. package/components/_helpers/input.js +150 -171
  9. package/components/_helpers/query-assist__suggestions.js +78 -93
  10. package/components/_helpers/select__filter.js +56 -67
  11. package/components/_helpers/services-link.js +23 -29
  12. package/components/_helpers/sidebar.js +91 -93
  13. package/components/_helpers/tab-link.js +8 -6
  14. package/components/_helpers/theme.js +41 -50
  15. package/components/_helpers/title.js +59 -69
  16. package/components/alert/alert.js +112 -156
  17. package/components/alert/container.js +32 -39
  18. package/components/alert-service/alert-service.js +104 -161
  19. package/components/analytics/analytics.js +12 -20
  20. package/components/analytics/analytics__custom-plugin.js +52 -68
  21. package/components/auth/auth.js +2 -27
  22. package/components/auth/auth__core.d.ts +1 -1
  23. package/components/auth/auth__core.js +742 -1428
  24. package/components/auth/background-flow.js +84 -121
  25. package/components/auth/down-notification.js +31 -69
  26. package/components/auth/iframe-flow.js +70 -123
  27. package/components/auth/request-builder.js +46 -77
  28. package/components/auth/response-parser.js +84 -112
  29. package/components/auth/storage.js +160 -318
  30. package/components/auth/token-validator.js +132 -227
  31. package/components/auth/window-flow.js +84 -121
  32. package/components/auth-dialog/auth-dialog.js +99 -150
  33. package/components/auth-dialog-service/auth-dialog-service.js +6 -26
  34. package/components/avatar/avatar-example-datauri.js +1 -1
  35. package/components/avatar/avatar.js +94 -123
  36. package/components/avatar/fallback-avatar.js +20 -34
  37. package/components/badge/badge.js +32 -38
  38. package/components/breadcrumbs/breadcrumbs.js +13 -17
  39. package/components/button/button.js +67 -80
  40. package/components/button-group/button-group.js +27 -36
  41. package/components/button-set/button-set.js +19 -27
  42. package/components/button-toolbar/button-toolbar.js +17 -25
  43. package/components/caret/caret.js +184 -211
  44. package/components/checkbox/checkbox.js +69 -86
  45. package/components/clipboard/clipboard-fallback.js +7 -7
  46. package/components/clipboard/clipboard.js +36 -128
  47. package/components/code/code.js +83 -151
  48. package/components/collapse/collapse-content.js +42 -60
  49. package/components/collapse/collapse-context.js +2 -2
  50. package/components/collapse/collapse-control.js +12 -12
  51. package/components/collapse/collapse.js +12 -17
  52. package/components/collapse/consts.js +4 -4
  53. package/components/collapse/utils.js +1 -3
  54. package/components/confirm/confirm.js +57 -87
  55. package/components/confirm-service/confirm-service.js +23 -44
  56. package/components/content-layout/content-layout.js +41 -56
  57. package/components/content-layout/sidebar.js +1 -1
  58. package/components/contenteditable/contenteditable.js +38 -46
  59. package/components/control-help/control-help.js +5 -3
  60. package/components/control-label/control-label.js +9 -8
  61. package/components/data-list/data-list.js +113 -156
  62. package/components/data-list/data-list.mock.js +3 -5
  63. package/components/data-list/item.js +120 -140
  64. package/components/data-list/selection.js +77 -135
  65. package/components/data-list/title.js +2 -10
  66. package/components/date-picker/consts.js +16 -22
  67. package/components/date-picker/date-input.js +99 -124
  68. package/components/date-picker/date-picker.js +140 -184
  69. package/components/date-picker/date-popup.js +280 -327
  70. package/components/date-picker/day.js +71 -94
  71. package/components/date-picker/month-names.js +41 -59
  72. package/components/date-picker/month-slider.js +42 -61
  73. package/components/date-picker/month.js +17 -24
  74. package/components/date-picker/months.js +44 -49
  75. package/components/date-picker/weekdays.js +12 -21
  76. package/components/date-picker/years.js +77 -98
  77. package/components/dialog/dialog.js +151 -187
  78. package/components/dialog/dialog__body-scroll-preventer.js +0 -3
  79. package/components/dropdown/anchor.js +0 -6
  80. package/components/dropdown/dropdown.js +134 -154
  81. package/components/dropdown-menu/dropdown-menu.js +59 -87
  82. package/components/editable-heading/editable-heading.js +69 -116
  83. package/components/error-bubble/error-bubble.js +29 -54
  84. package/components/error-message/error-message.js +34 -49
  85. package/components/footer/footer.js +27 -28
  86. package/components/global/compose.js +1 -8
  87. package/components/global/composeRefs.d.ts +0 -3
  88. package/components/global/composeRefs.js +8 -15
  89. package/components/global/controls-height.js +2 -2
  90. package/components/global/create-stateful-context.js +14 -13
  91. package/components/global/data-tests.js +7 -12
  92. package/components/global/dom.js +49 -82
  93. package/components/global/focus-sensor-hoc.js +99 -106
  94. package/components/global/fuzzy-highlight.js +23 -34
  95. package/components/global/get-event-key.js +8 -8
  96. package/components/global/get-uid.js +3 -7
  97. package/components/global/inject-styles.js +7 -14
  98. package/components/global/listeners.js +28 -47
  99. package/components/global/memoize.js +6 -10
  100. package/components/global/normalize-indent.js +19 -46
  101. package/components/global/promise-with-timeout.js +6 -8
  102. package/components/global/prop-types.js +3 -5
  103. package/components/global/react-dom-renderer.js +29 -40
  104. package/components/global/rerender-hoc.js +16 -32
  105. package/components/global/schedule-raf.js +4 -4
  106. package/components/global/sniffer.js +1 -1
  107. package/components/global/theme.js +1 -18
  108. package/components/global/trivial-template-tag.js +4 -9
  109. package/components/global/typescript-utils.js +2 -6
  110. package/components/global/url.js +20 -23
  111. package/components/global/use-event-callback.js +7 -4
  112. package/components/grid/col.js +27 -39
  113. package/components/grid/grid.js +18 -27
  114. package/components/grid/row.js +23 -30
  115. package/components/group/group.js +16 -22
  116. package/components/header/header-icon.js +19 -31
  117. package/components/header/header.d.ts +0 -1
  118. package/components/header/header.js +30 -64
  119. package/components/header/links.js +6 -3
  120. package/components/header/logo.js +15 -26
  121. package/components/header/profile.js +124 -150
  122. package/components/header/services-link.js +1 -3
  123. package/components/header/services.js +64 -97
  124. package/components/header/smart-profile.js +101 -178
  125. package/components/header/smart-services.js +55 -90
  126. package/components/header/tray.js +21 -30
  127. package/components/heading/heading.js +21 -20
  128. package/components/http/http.js +162 -319
  129. package/components/http/http.mock.js +50 -98
  130. package/components/hub-source/hub-source.js +77 -182
  131. package/components/hub-source/hub-source__user.js +9 -37
  132. package/components/hub-source/hub-source__users-groups.js +34 -60
  133. package/components/i18n/i18n-context.js +7 -8
  134. package/components/i18n/i18n.js +3 -6
  135. package/components/icon/icon.js +60 -74
  136. package/components/icon/icon__svg.js +0 -5
  137. package/components/icon/index.js +0 -5
  138. package/components/input/input.js +1 -11
  139. package/components/island/adaptive-island-hoc.js +29 -37
  140. package/components/island/content.js +100 -110
  141. package/components/island/header.js +56 -66
  142. package/components/island/island.js +25 -33
  143. package/components/island-legacy/content-legacy.js +16 -22
  144. package/components/island-legacy/header-legacy.js +19 -25
  145. package/components/island-legacy/island-legacy.js +16 -22
  146. package/components/link/clickableLink.js +33 -42
  147. package/components/link/link.js +47 -55
  148. package/components/list/consts.js +2 -2
  149. package/components/list/list.js +399 -486
  150. package/components/list/list__custom.js +51 -61
  151. package/components/list/list__hint.js +9 -17
  152. package/components/list/list__item.js +147 -178
  153. package/components/list/list__link.js +38 -47
  154. package/components/list/list__separator.js +15 -24
  155. package/components/list/list__title.js +25 -34
  156. package/components/list/list__users-groups-source.js +55 -121
  157. package/components/loader/loader.js +38 -60
  158. package/components/loader/loader__core.js +123 -184
  159. package/components/loader-inline/loader-inline.js +24 -32
  160. package/components/loader-screen/loader-screen.js +24 -40
  161. package/components/login-dialog/login-dialog.js +81 -121
  162. package/components/login-dialog/service.js +6 -29
  163. package/components/markdown/markdown.js +16 -24
  164. package/components/message/message.js +170 -201
  165. package/components/old-browsers-message/old-browsers-message.js +11 -14
  166. package/components/old-browsers-message/old-browsers-message__stop.js +1 -4
  167. package/components/old-browsers-message/white-list.js +8 -13
  168. package/components/pager/pager.js +212 -257
  169. package/components/panel/panel.js +16 -22
  170. package/components/permissions/permissions.js +118 -161
  171. package/components/permissions/permissions__cache.js +191 -218
  172. package/components/popup/popup.consts.js +1 -1
  173. package/components/popup/popup.js +237 -288
  174. package/components/popup/popup.target.js +9 -7
  175. package/components/popup/position.js +94 -101
  176. package/components/popup-menu/popup-menu.js +33 -67
  177. package/components/progress-bar/progress-bar.js +57 -68
  178. package/components/query-assist/query-assist.js +583 -652
  179. package/components/query-assist/query-assist__suggestions.js +2 -26
  180. package/components/radio/radio.js +15 -27
  181. package/components/radio/radio__item.js +52 -62
  182. package/components/scrollable-section/scrollable-section.js +22 -32
  183. package/components/select/select.js +693 -793
  184. package/components/select/select__filter.js +1 -26
  185. package/components/select/select__popup.js +316 -413
  186. package/components/shortcuts/core.js +147 -195
  187. package/components/shortcuts/shortcut-title.js +6 -10
  188. package/components/shortcuts/shortcuts-hoc.js +23 -41
  189. package/components/shortcuts/shortcuts.js +41 -64
  190. package/components/slider/slider.js +93 -112
  191. package/components/slider/slider.utils.js +16 -23
  192. package/components/storage/storage.js +3 -27
  193. package/components/storage/storage__fallback.js +137 -210
  194. package/components/storage/storage__local.js +89 -147
  195. package/components/style.css +1 -1
  196. package/components/tab-trap/tab-trap.js +35 -53
  197. package/components/table/cell.js +11 -21
  198. package/components/table/disable-hover-hoc.js +27 -42
  199. package/components/table/header-cell.js +59 -75
  200. package/components/table/header.js +89 -110
  201. package/components/table/multitable.js +83 -89
  202. package/components/table/row-with-focus-sensor.js +25 -57
  203. package/components/table/row.js +169 -200
  204. package/components/table/selection-adapter.js +2 -2
  205. package/components/table/selection-shortcuts-hoc.js +108 -113
  206. package/components/table/selection.js +150 -217
  207. package/components/table/simple-table.js +19 -55
  208. package/components/table/smart-table.js +42 -76
  209. package/components/table/table.js +267 -327
  210. package/components/tabs/collapsible-more.js +47 -73
  211. package/components/tabs/collapsible-tab.js +32 -36
  212. package/components/tabs/collapsible-tabs.js +89 -148
  213. package/components/tabs/custom-item.js +4 -2
  214. package/components/tabs/dumb-tabs.js +60 -92
  215. package/components/tabs/smart-tabs.js +29 -61
  216. package/components/tabs/tab-link.js +1 -3
  217. package/components/tabs/tab.js +15 -24
  218. package/components/tabs/tabs.js +1 -26
  219. package/components/tag/tag.d.ts +0 -2
  220. package/components/tag/tag.js +120 -162
  221. package/components/tags-input/tags-input.js +222 -304
  222. package/components/tags-list/tags-list.js +45 -61
  223. package/components/text/text.js +28 -37
  224. package/components/toggle/toggle.js +51 -61
  225. package/components/tooltip/tooltip.js +109 -141
  226. package/components/user-agreement/service.js +259 -400
  227. package/components/user-agreement/user-agreement.js +80 -108
  228. package/components/user-card/card.js +1 -25
  229. package/components/user-card/smart-user-card-tooltip.js +52 -103
  230. package/components/user-card/tooltip.js +35 -65
  231. package/components/user-card/user-card.js +1 -25
  232. package/package.json +1 -1
  233. package/components/global/react-render-adapter.d.ts +0 -1
  234. package/components/global/react-render-adapter.js +0 -6
  235. package/components/header/tray-icon.d.ts +0 -1
  236. package/components/header/tray-icon.js +0 -26
@@ -1,8 +1,5 @@
1
- import { _ as _defineProperty, a as _inherits, b as _createClass, d as _objectSpread2, e as _classCallCheck, f as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/es.array.concat.js';
3
- import 'core-js/modules/es.array.find.js';
4
- import 'core-js/modules/es.array.map.js';
5
- import 'core-js/modules/es.object.to-string.js';
1
+ import { _ as _defineProperty, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
2
+ import 'core-js/modules/web.dom-collections.iterator.js';
6
3
  import { PureComponent } from 'react';
7
4
  import PropTypes from 'prop-types';
8
5
  import classNames from 'classnames';
@@ -26,25 +23,12 @@ import 'util-deprecate';
26
23
  import '../_helpers/icon__svg.js';
27
24
  import 'core-js/modules/es.regexp.exec.js';
28
25
  import 'core-js/modules/es.string.replace.js';
29
- import 'core-js/modules/es.string.starts-with.js';
30
- import 'core-js/modules/es.array.iterator.js';
31
- import 'core-js/modules/es.map.js';
32
- import 'core-js/modules/es.weak-map.js';
33
- import 'core-js/modules/web.dom-collections.iterator.js';
34
- import 'core-js/modules/es.string.split.js';
35
26
  import '../global/data-tests.js';
36
27
  import 'core-js/modules/es.array.reduce.js';
37
- import 'core-js/modules/es.object.entries.js';
38
28
  import '../control-label/control-label.js';
39
29
  import '../control-help/control-help.js';
40
30
  import '../_helpers/caption.js';
41
- import 'core-js/modules/es.array.filter.js';
42
- import 'core-js/modules/es.array.index-of.js';
43
- import 'core-js/modules/es.array.slice.js';
44
- import 'core-js/modules/es.object.assign.js';
45
- import 'core-js/modules/es.object.values.js';
46
31
  import 'core-js/modules/es.string.trim.js';
47
- import 'core-js/modules/web.dom-collections.for-each.js';
48
32
  import '@jetbrains/icons/close-12px';
49
33
  import 'deep-equal';
50
34
  import '../dropdown/dropdown.js';
@@ -53,22 +37,14 @@ import '../_helpers/anchor.js';
53
37
  import '@jetbrains/icons/chevron-10px';
54
38
  import '../avatar/avatar.js';
55
39
  import '../global/url.js';
56
- import 'core-js/modules/es.string.match.js';
57
40
  import '../global/dom.js';
58
- import 'core-js/modules/es.set.js';
59
41
  import '../avatar/fallback-avatar.js';
60
- import 'core-js/modules/es.array.from.js';
61
42
  import '../global/get-uid.js';
62
- import 'core-js/modules/es.regexp.to-string.js';
63
43
  import '../popup/popup.js';
64
44
  import 'react-dom';
65
45
  import '../global/schedule-raf.js';
66
46
  import '../shortcuts/shortcuts.js';
67
47
  import '../shortcuts/core.js';
68
- import 'core-js/modules/es.array.find-index.js';
69
- import 'core-js/modules/es.array.includes.js';
70
- import 'core-js/modules/es.array.splice.js';
71
- import 'core-js/modules/es.string.includes.js';
72
48
  import 'combokeys';
73
49
  import '../global/sniffer.js';
74
50
  import 'sniffr';
@@ -78,7 +54,6 @@ import 'core-js/modules/es.array.sort.js';
78
54
  import '../popup/popup.consts.js';
79
55
  import '../popup/popup.target.js';
80
56
  import '../list/list.js';
81
- import 'core-js/modules/es.symbol.js';
82
57
  import 'core-js/modules/es.symbol.description.js';
83
58
  import 'react-virtualized/dist/es/List';
84
59
  import 'react-virtualized/dist/es/AutoSizer';
@@ -117,258 +92,238 @@ import '../i18n/i18n.js';
117
92
 
118
93
  var modules_1a5f0d42 = {"light":"light_rui_2ac4","pager":"pager_rui_ad65","links":"links_rui_ad65","link":"link_rui_ad65","linkDisabled":"linkDisabled_rui_ad65"};
119
94
 
120
- var Pager = /*#__PURE__*/function (_PureComponent) {
121
- function Pager() {
122
- var _this;
123
- _classCallCheck(this, Pager);
124
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
125
- args[_key] = arguments[_key];
126
- }
127
- _this = _callSuper(this, Pager, [].concat(args));
128
- _defineProperty(_this, "handlePageSizeChange", function (item) {
95
+ class Pager extends PureComponent {
96
+ constructor() {
97
+ super(...arguments);
98
+ _defineProperty(this, "handlePageSizeChange", item => {
129
99
  if (item != null) {
130
- _this.props.onPageSizeChange(item.key);
100
+ this.props.onPageSizeChange(item.key);
131
101
  }
132
102
  });
133
- _defineProperty(_this, "handlePrevClick", function () {
134
- var currentPage = _this.props.currentPage;
103
+ _defineProperty(this, "handlePrevClick", () => {
104
+ const {
105
+ currentPage
106
+ } = this.props;
135
107
  if (currentPage !== 1) {
136
108
  var _this$props$onPageCha, _this$props;
137
- var prevPage = currentPage - 1;
138
- (_this$props$onPageCha = (_this$props = _this.props).onPageChange) === null || _this$props$onPageCha === void 0 || _this$props$onPageCha.call(_this$props, prevPage);
109
+ const prevPage = currentPage - 1;
110
+ (_this$props$onPageCha = (_this$props = this.props).onPageChange) === null || _this$props$onPageCha === void 0 || _this$props$onPageCha.call(_this$props, prevPage);
139
111
  }
140
112
  });
141
- _defineProperty(_this, "handleNextClick", function () {
142
- var _this$props2 = _this.props,
143
- currentPage = _this$props2.currentPage,
144
- onLoadPage = _this$props2.onLoadPage;
145
- var nextPage = currentPage + 1;
146
- var total = _this.getTotalPages();
113
+ _defineProperty(this, "handleNextClick", () => {
114
+ const {
115
+ currentPage,
116
+ onLoadPage
117
+ } = this.props;
118
+ const nextPage = currentPage + 1;
119
+ const total = this.getTotalPages();
147
120
  if (currentPage !== total) {
148
- var _this$props$onPageCha2, _this$props3;
149
- (_this$props$onPageCha2 = (_this$props3 = _this.props).onPageChange) === null || _this$props$onPageCha2 === void 0 || _this$props$onPageCha2.call(_this$props3, nextPage);
150
- } else if (_this.props.openTotal) {
121
+ var _this$props$onPageCha2, _this$props2;
122
+ (_this$props$onPageCha2 = (_this$props2 = this.props).onPageChange) === null || _this$props$onPageCha2 === void 0 || _this$props$onPageCha2.call(_this$props2, nextPage);
123
+ } else if (this.props.openTotal) {
151
124
  onLoadPage(nextPage);
152
125
  }
153
126
  });
154
- _defineProperty(_this, "handlePageChange", memoize(function (i) {
155
- return function (event) {
156
- var _this$props$onPageCha3, _this$props4;
157
- (_this$props$onPageCha3 = (_this$props4 = _this.props).onPageChange) === null || _this$props$onPageCha3 === void 0 || _this$props$onPageCha3.call(_this$props4, i, event);
158
- };
127
+ _defineProperty(this, "handlePageChange", memoize(i => event => {
128
+ var _this$props$onPageCha3, _this$props3;
129
+ (_this$props$onPageCha3 = (_this$props3 = this.props).onPageChange) === null || _this$props$onPageCha3 === void 0 || _this$props$onPageCha3.call(_this$props3, i, event);
159
130
  }));
160
- _defineProperty(_this, "handleLoadMore", memoize(function (i) {
161
- return function () {
162
- _this.props.onLoadPage(i);
163
- };
131
+ _defineProperty(this, "handleLoadMore", memoize(i => () => {
132
+ this.props.onLoadPage(i);
164
133
  }));
165
- return _this;
166
134
  }
167
- _inherits(Pager, _PureComponent);
168
- return _createClass(Pager, [{
169
- key: "getSelectOptions",
170
- value: function getSelectOptions() {
171
- var _this2 = this;
172
- var _this$props5 = this.props,
173
- pageSize = _this$props5.pageSize,
174
- pageSizes = _this$props5.pageSizes;
175
- var translate = this.context.translate;
176
- var data = pageSizes.map(function (size) {
177
- var _this2$props$translat, _this2$props$translat2;
178
- return {
179
- key: size,
180
- label: "".concat(size, " ").concat((_this2$props$translat = (_this2$props$translat2 = _this2.props.translations) === null || _this2$props$translat2 === void 0 ? void 0 : _this2$props$translat2.perPage) !== null && _this2$props$translat !== void 0 ? _this2$props$translat : translate('perPage'))
181
- };
182
- });
183
- var selected = data.find(function (it) {
184
- return it.key === pageSize;
185
- });
135
+ getSelectOptions() {
136
+ const {
137
+ pageSize,
138
+ pageSizes
139
+ } = this.props;
140
+ const {
141
+ translate
142
+ } = this.context;
143
+ const data = pageSizes.map(size => {
144
+ var _this$props$translati, _this$props$translati2;
186
145
  return {
187
- selected,
188
- data
146
+ key: size,
147
+ label: "".concat(size, " ").concat((_this$props$translati = (_this$props$translati2 = this.props.translations) === null || _this$props$translati2 === void 0 ? void 0 : _this$props$translati2.perPage) !== null && _this$props$translati !== void 0 ? _this$props$translati : translate('perPage'))
148
+ };
149
+ });
150
+ const selected = data.find(it => it.key === pageSize);
151
+ return {
152
+ selected,
153
+ data
154
+ };
155
+ }
156
+ getTotalPages() {
157
+ const {
158
+ total,
159
+ pageSize
160
+ } = this.props;
161
+ return Math.ceil(total / pageSize);
162
+ }
163
+ getButton(page, content, key, active) {
164
+ return /*#__PURE__*/jsx(Button, _objectSpread2(_objectSpread2({
165
+ href: this.generateHref(page),
166
+ active: active,
167
+ disabled: this.props.loader && !active && !this.props.loaderNavigation,
168
+ loader: this.props.loader && active
169
+ }, this.getClickProps(this.handlePageChange(page))), {}, {
170
+ children: content
171
+ }), key);
172
+ }
173
+ getClickProps(onClick) {
174
+ const {
175
+ hrefFunc,
176
+ onPageChange
177
+ } = this.props;
178
+ if (!onPageChange) {
179
+ return {};
180
+ } else if (hrefFunc) {
181
+ return {
182
+ onPlainLeftClick: onClick
183
+ };
184
+ } else {
185
+ return {
186
+ onClick
189
187
  };
190
188
  }
191
- }, {
192
- key: "getTotalPages",
193
- value: function getTotalPages() {
194
- var _this$props6 = this.props,
195
- total = _this$props6.total,
196
- pageSize = _this$props6.pageSize;
197
- return Math.ceil(total / pageSize);
198
- }
199
- }, {
200
- key: "getButton",
201
- value: function getButton(page, content, key, active) {
202
- return /*#__PURE__*/jsx(Button, _objectSpread2(_objectSpread2({
203
- href: this.generateHref(page),
204
- active: active,
205
- disabled: this.props.loader && !active && !this.props.loaderNavigation,
206
- loader: this.props.loader && active
207
- }, this.getClickProps(this.handlePageChange(page))), {}, {
208
- children: content
209
- }), key);
210
- }
211
- }, {
212
- key: "getClickProps",
213
- value: function getClickProps(onClick) {
214
- var _this$props7 = this.props,
215
- hrefFunc = _this$props7.hrefFunc,
216
- onPageChange = _this$props7.onPageChange;
217
- if (!onPageChange) {
218
- return {};
219
- } else if (hrefFunc) {
220
- return {
221
- onPlainLeftClick: onClick
222
- };
223
- } else {
224
- return {
225
- onClick
226
- };
227
- }
228
- }
229
- }, {
230
- key: "getPageSizeSelector",
231
- value: function getPageSizeSelector() {
232
- var selectOptions = this.getSelectOptions();
233
- return !this.props.disablePageSizeSelector && /*#__PURE__*/jsx("div", {
234
- "data-test": "ring-pager-page-size-selector",
235
- style: {
236
- float: 'right'
237
- },
238
- children: /*#__PURE__*/jsx(Select, {
239
- data: selectOptions.data,
240
- selected: selectOptions.selected,
241
- onSelect: this.handlePageSizeChange,
242
- type: Select.Type.INLINE,
243
- disabled: this.props.loader
244
- })
245
- });
246
- }
247
- }, {
248
- key: "getPagerLinks",
249
- value: function getPagerLinks() {
250
- var _this$props$translati, _this$props$translati2, _this$props$translati3, _this$props$translati4;
251
- var translate = this.context.translate;
252
- var prevLinkAvailable = this.props.currentPage !== 1;
253
- var nextLinkAvailable = this.props.openTotal || this.props.currentPage !== this.getTotalPages();
254
- var nextIcon = /*#__PURE__*/jsx(Icon, {
255
- glyph: chevronRightIcon
256
- }, "icon");
257
- var prevIcon = /*#__PURE__*/jsx(Icon, {
258
- glyph: chevronLeftIcon
259
- }, "icon");
260
- var prevText = (_this$props$translati = (_this$props$translati2 = this.props.translations) === null || _this$props$translati2 === void 0 ? void 0 : _this$props$translati2.previousPage) !== null && _this$props$translati !== void 0 ? _this$props$translati : translate('previousPage');
261
- var nextText = (_this$props$translati3 = (_this$props$translati4 = this.props.translations) === null || _this$props$translati4 === void 0 ? void 0 : _this$props$translati4.nextPage) !== null && _this$props$translati3 !== void 0 ? _this$props$translati3 : translate('nextPage');
262
- var nextLinkContent = [/*#__PURE__*/jsx("span", {
263
- children: nextText
264
- }, "text"), nextIcon];
265
- var prevLinkContent = [prevIcon, /*#__PURE__*/jsx("span", {
266
- children: prevText
267
- }, "text")];
268
- var prevLinkHref = this.generateHref(this.props.currentPage - 1);
269
- var nextLinkHref = this.generateHref(this.props.currentPage + 1);
270
- var disabledLinkClasses = classNames({
271
- [modules_1a5f0d42.link]: true,
272
- [modules_1a5f0d42.linkDisabled]: true
273
- });
274
- return /*#__PURE__*/jsxs("div", {
275
- className: modules_1a5f0d42.links,
276
- children: [prevLinkAvailable && (!this.props.loader || this.props.loaderNavigation) ? /*#__PURE__*/jsx(Link, _objectSpread2(_objectSpread2({
277
- href: prevLinkHref,
278
- className: modules_1a5f0d42.link
279
- }, this.getClickProps(this.handlePrevClick)), {}, {
280
- children: prevLinkContent
281
- })) : /*#__PURE__*/jsxs("span", {
282
- className: disabledLinkClasses,
283
- children: [prevIcon, /*#__PURE__*/jsx("span", {
284
- children: prevText
285
- }, "text")]
286
- }), nextLinkAvailable && (!this.props.loader || this.props.loaderNavigation) ? /*#__PURE__*/jsx(Link, _objectSpread2(_objectSpread2({
287
- href: nextLinkHref,
288
- className: modules_1a5f0d42.link
289
- }, this.getClickProps(this.handleNextClick)), {}, {
290
- children: nextLinkContent
291
- })) : /*#__PURE__*/jsxs("span", {
292
- className: disabledLinkClasses,
293
- children: [/*#__PURE__*/jsx("span", {
294
- children: nextText
295
- }, "text"), nextIcon]
296
- })]
297
- });
189
+ }
190
+ getPageSizeSelector() {
191
+ const selectOptions = this.getSelectOptions();
192
+ return !this.props.disablePageSizeSelector && /*#__PURE__*/jsx("div", {
193
+ "data-test": "ring-pager-page-size-selector",
194
+ style: {
195
+ float: 'right'
196
+ },
197
+ children: /*#__PURE__*/jsx(Select, {
198
+ data: selectOptions.data,
199
+ selected: selectOptions.selected,
200
+ onSelect: this.handlePageSizeChange,
201
+ type: Select.Type.INLINE,
202
+ disabled: this.props.loader
203
+ })
204
+ });
205
+ }
206
+ getPagerLinks() {
207
+ var _this$props$translati3, _this$props$translati4, _this$props$translati5, _this$props$translati6;
208
+ const {
209
+ translate
210
+ } = this.context;
211
+ const prevLinkAvailable = this.props.currentPage !== 1;
212
+ const nextLinkAvailable = this.props.openTotal || this.props.currentPage !== this.getTotalPages();
213
+ const nextIcon = /*#__PURE__*/jsx(Icon, {
214
+ glyph: chevronRightIcon
215
+ }, "icon");
216
+ const prevIcon = /*#__PURE__*/jsx(Icon, {
217
+ glyph: chevronLeftIcon
218
+ }, "icon");
219
+ const prevText = (_this$props$translati3 = (_this$props$translati4 = this.props.translations) === null || _this$props$translati4 === void 0 ? void 0 : _this$props$translati4.previousPage) !== null && _this$props$translati3 !== void 0 ? _this$props$translati3 : translate('previousPage');
220
+ const nextText = (_this$props$translati5 = (_this$props$translati6 = this.props.translations) === null || _this$props$translati6 === void 0 ? void 0 : _this$props$translati6.nextPage) !== null && _this$props$translati5 !== void 0 ? _this$props$translati5 : translate('nextPage');
221
+ const nextLinkContent = [/*#__PURE__*/jsx("span", {
222
+ children: nextText
223
+ }, "text"), nextIcon];
224
+ const prevLinkContent = [prevIcon, /*#__PURE__*/jsx("span", {
225
+ children: prevText
226
+ }, "text")];
227
+ const prevLinkHref = this.generateHref(this.props.currentPage - 1);
228
+ const nextLinkHref = this.generateHref(this.props.currentPage + 1);
229
+ const disabledLinkClasses = classNames({
230
+ [modules_1a5f0d42.link]: true,
231
+ [modules_1a5f0d42.linkDisabled]: true
232
+ });
233
+ return /*#__PURE__*/jsxs("div", {
234
+ className: modules_1a5f0d42.links,
235
+ children: [prevLinkAvailable && (!this.props.loader || this.props.loaderNavigation) ? /*#__PURE__*/jsx(Link, _objectSpread2(_objectSpread2({
236
+ href: prevLinkHref,
237
+ className: modules_1a5f0d42.link
238
+ }, this.getClickProps(this.handlePrevClick)), {}, {
239
+ children: prevLinkContent
240
+ })) : /*#__PURE__*/jsxs("span", {
241
+ className: disabledLinkClasses,
242
+ children: [prevIcon, /*#__PURE__*/jsx("span", {
243
+ children: prevText
244
+ }, "text")]
245
+ }), nextLinkAvailable && (!this.props.loader || this.props.loaderNavigation) ? /*#__PURE__*/jsx(Link, _objectSpread2(_objectSpread2({
246
+ href: nextLinkHref,
247
+ className: modules_1a5f0d42.link
248
+ }, this.getClickProps(this.handleNextClick)), {}, {
249
+ children: nextLinkContent
250
+ })) : /*#__PURE__*/jsxs("span", {
251
+ className: disabledLinkClasses,
252
+ children: [/*#__PURE__*/jsx("span", {
253
+ children: nextText
254
+ }, "text"), nextIcon]
255
+ })]
256
+ });
257
+ }
258
+ generateHref(page) {
259
+ if (this.props.hrefFunc === undefined) {
260
+ return undefined;
298
261
  }
299
- }, {
300
- key: "generateHref",
301
- value: function generateHref(page) {
302
- if (this.props.hrefFunc === undefined) {
303
- return undefined;
304
- }
305
- var pageSize = this.props.disablePageSizeSelector ? undefined : this.props.pageSize;
306
- return this.props.hrefFunc(page, pageSize);
262
+ const pageSize = this.props.disablePageSizeSelector ? undefined : this.props.pageSize;
263
+ return this.props.hrefFunc(page, pageSize);
264
+ }
265
+ getPagerContent() {
266
+ var _this$props$translati7, _this$props$translati8, _this$props$translati9, _this$props$translati10;
267
+ const {
268
+ currentPage,
269
+ visiblePagesLimit
270
+ } = this.props;
271
+ const totalPages = this.getTotalPages();
272
+ const {
273
+ translate
274
+ } = this.context;
275
+ if (totalPages < this.props.currentPage) {
276
+ var _this$props$onPageCha4, _this$props4;
277
+ (_this$props$onPageCha4 = (_this$props4 = this.props).onPageChange) === null || _this$props$onPageCha4 === void 0 || _this$props$onPageCha4.call(_this$props4, totalPages);
307
278
  }
308
- }, {
309
- key: "getPagerContent",
310
- value: function getPagerContent() {
311
- var _this$props$translati5, _this$props$translati6, _this$props$translati7, _this$props$translati8;
312
- var _this$props8 = this.props,
313
- currentPage = _this$props8.currentPage,
314
- visiblePagesLimit = _this$props8.visiblePagesLimit;
315
- var totalPages = this.getTotalPages();
316
- var translate = this.context.translate;
317
- if (totalPages < this.props.currentPage) {
318
- var _this$props$onPageCha4, _this$props9;
319
- (_this$props$onPageCha4 = (_this$props9 = this.props).onPageChange) === null || _this$props$onPageCha4 === void 0 || _this$props$onPageCha4.call(_this$props9, totalPages);
279
+ let start = 1;
280
+ let end = totalPages;
281
+ if (totalPages >= visiblePagesLimit) {
282
+ const leftHalfFrameSize = Math.ceil(visiblePagesLimit / 2) - 1;
283
+ const rightHalfFrameSize = visiblePagesLimit - leftHalfFrameSize - 1;
284
+ start = currentPage - leftHalfFrameSize;
285
+ end = currentPage + rightHalfFrameSize;
286
+ if (start < 1) {
287
+ const tail = 1 - start;
288
+ start += tail;
289
+ end += tail;
320
290
  }
321
- var start = 1;
322
- var end = totalPages;
323
- if (totalPages >= visiblePagesLimit) {
324
- var leftHalfFrameSize = Math.ceil(visiblePagesLimit / 2) - 1;
325
- var rightHalfFrameSize = visiblePagesLimit - leftHalfFrameSize - 1;
326
- start = currentPage - leftHalfFrameSize;
327
- end = currentPage + rightHalfFrameSize;
328
- if (start < 1) {
329
- var tail = 1 - start;
330
- start += tail;
331
- end += tail;
332
- }
333
- if (end > totalPages) {
334
- var _tail = end - totalPages;
335
- start -= _tail;
336
- end -= _tail;
337
- }
338
- if (start < 1) {
339
- start += 1 - start;
340
- }
291
+ if (end > totalPages) {
292
+ const tail = end - totalPages;
293
+ start -= tail;
294
+ end -= tail;
341
295
  }
342
- var buttons = [];
343
- for (var i = start; i <= end; i++) {
344
- buttons.push(this.getButton(i, i, i, i === currentPage));
296
+ if (start < 1) {
297
+ start += 1 - start;
345
298
  }
346
- var lastPageButtonAvailable = !this.props.disableLastPageButton && end < totalPages && !this.props.openTotal || this.props.openTotal && this.props.canLoadLastPageWithOpenTotal;
347
- return /*#__PURE__*/jsxs("div", {
348
- children: [this.getPagerLinks(), /*#__PURE__*/jsxs(ButtonToolbar, {
349
- children: [start > 1 && this.getButton(1, (_this$props$translati5 = (_this$props$translati6 = this.props.translations) === null || _this$props$translati6 === void 0 ? void 0 : _this$props$translati6.firstPage) !== null && _this$props$translati5 !== void 0 ? _this$props$translati5 : translate('firstPage')), /*#__PURE__*/jsxs(ButtonGroup, {
350
- children: [start > 1 && this.getButton(start - 1, '...'), buttons, end < totalPages && this.getButton(end + 1, '...'), end === totalPages && this.props.openTotal && /*#__PURE__*/jsx(Button, _objectSpread2(_objectSpread2({
351
- href: this.generateHref(end + 1),
352
- disabled: this.props.loader
353
- }, this.getClickProps(this.handleLoadMore(end + 1))), {}, {
354
- children: '...'
355
- }))]
356
- }), lastPageButtonAvailable && this.getButton(this.props.openTotal ? -1 : totalPages, (_this$props$translati7 = (_this$props$translati8 = this.props.translations) === null || _this$props$translati8 === void 0 ? void 0 : _this$props$translati8.lastPage) !== null && _this$props$translati7 !== void 0 ? _this$props$translati7 : translate('lastPage'))]
357
- }), this.getPageSizeSelector()]
358
- });
359
299
  }
360
- }, {
361
- key: "render",
362
- value: function render() {
363
- var classes = classNames(modules_1a5f0d42.pager, this.props.className);
364
- return /*#__PURE__*/jsx("div", {
365
- "data-test": "ring-pager",
366
- className: classes,
367
- children: this.getTotalPages() > 1 || this.props.openTotal ? this.getPagerContent() : this.getPageSizeSelector()
368
- });
300
+ const buttons = [];
301
+ for (let i = start; i <= end; i++) {
302
+ buttons.push(this.getButton(i, i, i, i === currentPage));
369
303
  }
370
- }]);
371
- }(PureComponent);
304
+ const lastPageButtonAvailable = !this.props.disableLastPageButton && end < totalPages && !this.props.openTotal || this.props.openTotal && this.props.canLoadLastPageWithOpenTotal;
305
+ return /*#__PURE__*/jsxs("div", {
306
+ children: [this.getPagerLinks(), /*#__PURE__*/jsxs(ButtonToolbar, {
307
+ children: [start > 1 && this.getButton(1, (_this$props$translati7 = (_this$props$translati8 = this.props.translations) === null || _this$props$translati8 === void 0 ? void 0 : _this$props$translati8.firstPage) !== null && _this$props$translati7 !== void 0 ? _this$props$translati7 : translate('firstPage')), /*#__PURE__*/jsxs(ButtonGroup, {
308
+ children: [start > 1 && this.getButton(start - 1, '...'), buttons, end < totalPages && this.getButton(end + 1, '...'), end === totalPages && this.props.openTotal && /*#__PURE__*/jsx(Button, _objectSpread2(_objectSpread2({
309
+ href: this.generateHref(end + 1),
310
+ disabled: this.props.loader
311
+ }, this.getClickProps(this.handleLoadMore(end + 1))), {}, {
312
+ children: '...'
313
+ }))]
314
+ }), lastPageButtonAvailable && this.getButton(this.props.openTotal ? -1 : totalPages, (_this$props$translati9 = (_this$props$translati10 = this.props.translations) === null || _this$props$translati10 === void 0 ? void 0 : _this$props$translati10.lastPage) !== null && _this$props$translati9 !== void 0 ? _this$props$translati9 : translate('lastPage'))]
315
+ }), this.getPageSizeSelector()]
316
+ });
317
+ }
318
+ render() {
319
+ const classes = classNames(modules_1a5f0d42.pager, this.props.className);
320
+ return /*#__PURE__*/jsx("div", {
321
+ "data-test": "ring-pager",
322
+ className: classes,
323
+ children: this.getTotalPages() > 1 || this.props.openTotal ? this.getPagerContent() : this.getPageSizeSelector()
324
+ });
325
+ }
326
+ }
372
327
  _defineProperty(Pager, "defaultProps", {
373
328
  currentPage: 1,
374
329
  pageSize: 50,
@@ -380,8 +335,8 @@ _defineProperty(Pager, "defaultProps", {
380
335
  canLoadLastPageWithOpenTotal: false,
381
336
  loader: false,
382
337
  loaderNavigation: false,
383
- onPageSizeChange: function onPageSizeChange() {},
384
- onLoadPage: function onLoadPage() {}
338
+ onPageSizeChange: () => {},
339
+ onLoadPage: () => {}
385
340
  });
386
341
  _defineProperty(Pager, "contextType", I18nContext);
387
342
  Pager.propTypes = {
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, a as _inherits, b as _createClass, c as _objectWithoutProperties, d as _objectSpread2, e as _classCallCheck, f as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import { PureComponent } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
@@ -6,28 +6,22 @@ import { jsx } from 'react/jsx-runtime';
6
6
 
7
7
  var modules_cf670408 = {"light":"light_rui_2ac4","panel":"panel_rui_e32c panel_rui_027b"};
8
8
 
9
- var _excluded = ["className", "children"];
10
- var Panel = /*#__PURE__*/function (_PureComponent) {
11
- function Panel() {
12
- _classCallCheck(this, Panel);
13
- return _callSuper(this, Panel, arguments);
9
+ const _excluded = ["className", "children"];
10
+ class Panel extends PureComponent {
11
+ render() {
12
+ const _this$props = this.props,
13
+ {
14
+ className,
15
+ children
16
+ } = _this$props,
17
+ props = _objectWithoutProperties(_this$props, _excluded);
18
+ const classes = classNames(modules_cf670408.panel, className);
19
+ return /*#__PURE__*/jsx("div", _objectSpread2(_objectSpread2({}, props), {}, {
20
+ className: classes,
21
+ children: children
22
+ }));
14
23
  }
15
- _inherits(Panel, _PureComponent);
16
- return _createClass(Panel, [{
17
- key: "render",
18
- value: function render() {
19
- var _this$props = this.props,
20
- className = _this$props.className,
21
- children = _this$props.children,
22
- props = _objectWithoutProperties(_this$props, _excluded);
23
- var classes = classNames(modules_cf670408.panel, className);
24
- return /*#__PURE__*/jsx("div", _objectSpread2(_objectSpread2({}, props), {}, {
25
- className: classes,
26
- children: children
27
- }));
28
- }
29
- }]);
30
- }(PureComponent);
24
+ }
31
25
  _defineProperty(Panel, "propTypes", {
32
26
  className: PropTypes.string,
33
27
  children: PropTypes.node