@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.
- package/components/_helpers/_rollupPluginBabelHelpers.js +1 -504
- package/components/_helpers/anchor.js +7 -5
- package/components/_helpers/button__classes.js +15 -13
- package/components/_helpers/caption.js +11 -17
- package/components/_helpers/card.js +92 -96
- package/components/_helpers/dialog__body-scroll-preventer.js +10 -17
- package/components/_helpers/icon__svg.js +27 -23
- package/components/_helpers/input.js +150 -171
- package/components/_helpers/query-assist__suggestions.js +78 -93
- package/components/_helpers/select__filter.js +56 -67
- package/components/_helpers/services-link.js +23 -29
- package/components/_helpers/sidebar.js +91 -93
- package/components/_helpers/tab-link.js +8 -6
- package/components/_helpers/theme.js +41 -50
- package/components/_helpers/title.js +59 -69
- package/components/alert/alert.js +112 -156
- package/components/alert/container.js +32 -39
- package/components/alert-service/alert-service.js +104 -161
- package/components/analytics/analytics.js +12 -20
- package/components/analytics/analytics__custom-plugin.js +52 -68
- package/components/auth/auth.js +2 -27
- package/components/auth/auth__core.d.ts +1 -1
- package/components/auth/auth__core.js +742 -1428
- package/components/auth/background-flow.js +84 -121
- package/components/auth/down-notification.js +31 -69
- package/components/auth/iframe-flow.js +70 -123
- package/components/auth/request-builder.js +46 -77
- package/components/auth/response-parser.js +84 -112
- package/components/auth/storage.js +160 -318
- package/components/auth/token-validator.js +132 -227
- package/components/auth/window-flow.js +84 -121
- package/components/auth-dialog/auth-dialog.js +99 -150
- package/components/auth-dialog-service/auth-dialog-service.js +6 -26
- package/components/avatar/avatar-example-datauri.js +1 -1
- package/components/avatar/avatar.js +94 -123
- package/components/avatar/fallback-avatar.js +20 -34
- package/components/badge/badge.js +32 -38
- package/components/breadcrumbs/breadcrumbs.js +13 -17
- package/components/button/button.js +67 -80
- package/components/button-group/button-group.js +27 -36
- package/components/button-set/button-set.js +19 -27
- package/components/button-toolbar/button-toolbar.js +17 -25
- package/components/caret/caret.js +184 -211
- package/components/checkbox/checkbox.js +69 -86
- package/components/clipboard/clipboard-fallback.js +7 -7
- package/components/clipboard/clipboard.js +36 -128
- package/components/code/code.js +83 -151
- package/components/collapse/collapse-content.js +42 -60
- package/components/collapse/collapse-context.js +2 -2
- package/components/collapse/collapse-control.js +12 -12
- package/components/collapse/collapse.js +12 -17
- package/components/collapse/consts.js +4 -4
- package/components/collapse/utils.js +1 -3
- package/components/confirm/confirm.js +57 -87
- package/components/confirm-service/confirm-service.js +23 -44
- package/components/content-layout/content-layout.js +41 -56
- package/components/content-layout/sidebar.js +1 -1
- package/components/contenteditable/contenteditable.js +38 -46
- package/components/control-help/control-help.js +5 -3
- package/components/control-label/control-label.js +9 -8
- package/components/data-list/data-list.js +113 -156
- package/components/data-list/data-list.mock.js +3 -5
- package/components/data-list/item.js +120 -140
- package/components/data-list/selection.js +77 -135
- package/components/data-list/title.js +2 -10
- package/components/date-picker/consts.js +16 -22
- package/components/date-picker/date-input.js +99 -124
- package/components/date-picker/date-picker.js +140 -184
- package/components/date-picker/date-popup.js +280 -327
- package/components/date-picker/day.js +71 -94
- package/components/date-picker/month-names.js +41 -59
- package/components/date-picker/month-slider.js +42 -61
- package/components/date-picker/month.js +17 -24
- package/components/date-picker/months.js +44 -49
- package/components/date-picker/weekdays.js +12 -21
- package/components/date-picker/years.js +77 -98
- package/components/dialog/dialog.js +151 -187
- package/components/dialog/dialog__body-scroll-preventer.js +0 -3
- package/components/dropdown/anchor.js +0 -6
- package/components/dropdown/dropdown.js +134 -154
- package/components/dropdown-menu/dropdown-menu.js +59 -87
- package/components/editable-heading/editable-heading.js +69 -116
- package/components/error-bubble/error-bubble.js +29 -54
- package/components/error-message/error-message.js +34 -49
- package/components/footer/footer.js +27 -28
- package/components/global/compose.js +1 -8
- package/components/global/composeRefs.d.ts +0 -3
- package/components/global/composeRefs.js +8 -15
- package/components/global/controls-height.js +2 -2
- package/components/global/create-stateful-context.js +14 -13
- package/components/global/data-tests.js +7 -12
- package/components/global/dom.js +49 -82
- package/components/global/focus-sensor-hoc.js +99 -106
- package/components/global/fuzzy-highlight.js +23 -34
- package/components/global/get-event-key.js +8 -8
- package/components/global/get-uid.js +3 -7
- package/components/global/inject-styles.js +7 -14
- package/components/global/listeners.js +28 -47
- package/components/global/memoize.js +6 -10
- package/components/global/normalize-indent.js +19 -46
- package/components/global/promise-with-timeout.js +6 -8
- package/components/global/prop-types.js +3 -5
- package/components/global/react-dom-renderer.js +29 -40
- package/components/global/rerender-hoc.js +16 -32
- package/components/global/schedule-raf.js +4 -4
- package/components/global/sniffer.js +1 -1
- package/components/global/theme.js +1 -18
- package/components/global/trivial-template-tag.js +4 -9
- package/components/global/typescript-utils.js +2 -6
- package/components/global/url.js +20 -23
- package/components/global/use-event-callback.js +7 -4
- package/components/grid/col.js +27 -39
- package/components/grid/grid.js +18 -27
- package/components/grid/row.js +23 -30
- package/components/group/group.js +16 -22
- package/components/header/header-icon.js +19 -31
- package/components/header/header.d.ts +0 -1
- package/components/header/header.js +30 -64
- package/components/header/links.js +6 -3
- package/components/header/logo.js +15 -26
- package/components/header/profile.js +124 -150
- package/components/header/services-link.js +1 -3
- package/components/header/services.js +64 -97
- package/components/header/smart-profile.js +101 -178
- package/components/header/smart-services.js +55 -90
- package/components/header/tray.js +21 -30
- package/components/heading/heading.js +21 -20
- package/components/http/http.js +162 -319
- package/components/http/http.mock.js +50 -98
- package/components/hub-source/hub-source.js +77 -182
- package/components/hub-source/hub-source__user.js +9 -37
- package/components/hub-source/hub-source__users-groups.js +34 -60
- package/components/i18n/i18n-context.js +7 -8
- package/components/i18n/i18n.js +3 -6
- package/components/icon/icon.js +60 -74
- package/components/icon/icon__svg.js +0 -5
- package/components/icon/index.js +0 -5
- package/components/input/input.js +1 -11
- package/components/island/adaptive-island-hoc.js +29 -37
- package/components/island/content.js +100 -110
- package/components/island/header.js +56 -66
- package/components/island/island.js +25 -33
- package/components/island-legacy/content-legacy.js +16 -22
- package/components/island-legacy/header-legacy.js +19 -25
- package/components/island-legacy/island-legacy.js +16 -22
- package/components/link/clickableLink.js +33 -42
- package/components/link/link.js +47 -55
- package/components/list/consts.js +2 -2
- package/components/list/list.js +399 -486
- package/components/list/list__custom.js +51 -61
- package/components/list/list__hint.js +9 -17
- package/components/list/list__item.js +147 -178
- package/components/list/list__link.js +38 -47
- package/components/list/list__separator.js +15 -24
- package/components/list/list__title.js +25 -34
- package/components/list/list__users-groups-source.js +55 -121
- package/components/loader/loader.js +38 -60
- package/components/loader/loader__core.js +123 -184
- package/components/loader-inline/loader-inline.js +24 -32
- package/components/loader-screen/loader-screen.js +24 -40
- package/components/login-dialog/login-dialog.js +81 -121
- package/components/login-dialog/service.js +6 -29
- package/components/markdown/markdown.js +16 -24
- package/components/message/message.js +170 -201
- package/components/old-browsers-message/old-browsers-message.js +11 -14
- package/components/old-browsers-message/old-browsers-message__stop.js +1 -4
- package/components/old-browsers-message/white-list.js +8 -13
- package/components/pager/pager.js +212 -257
- package/components/panel/panel.js +16 -22
- package/components/permissions/permissions.js +118 -161
- package/components/permissions/permissions__cache.js +191 -218
- package/components/popup/popup.consts.js +1 -1
- package/components/popup/popup.js +237 -288
- package/components/popup/popup.target.js +9 -7
- package/components/popup/position.js +94 -101
- package/components/popup-menu/popup-menu.js +33 -67
- package/components/progress-bar/progress-bar.js +57 -68
- package/components/query-assist/query-assist.js +583 -652
- package/components/query-assist/query-assist__suggestions.js +2 -26
- package/components/radio/radio.js +15 -27
- package/components/radio/radio__item.js +52 -62
- package/components/scrollable-section/scrollable-section.js +22 -32
- package/components/select/select.js +693 -793
- package/components/select/select__filter.js +1 -26
- package/components/select/select__popup.js +316 -413
- package/components/shortcuts/core.js +147 -195
- package/components/shortcuts/shortcut-title.js +6 -10
- package/components/shortcuts/shortcuts-hoc.js +23 -41
- package/components/shortcuts/shortcuts.js +41 -64
- package/components/slider/slider.js +93 -112
- package/components/slider/slider.utils.js +16 -23
- package/components/storage/storage.js +3 -27
- package/components/storage/storage__fallback.js +137 -210
- package/components/storage/storage__local.js +89 -147
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +35 -53
- package/components/table/cell.js +11 -21
- package/components/table/disable-hover-hoc.js +27 -42
- package/components/table/header-cell.js +59 -75
- package/components/table/header.js +89 -110
- package/components/table/multitable.js +83 -89
- package/components/table/row-with-focus-sensor.js +25 -57
- package/components/table/row.js +169 -200
- package/components/table/selection-adapter.js +2 -2
- package/components/table/selection-shortcuts-hoc.js +108 -113
- package/components/table/selection.js +150 -217
- package/components/table/simple-table.js +19 -55
- package/components/table/smart-table.js +42 -76
- package/components/table/table.js +267 -327
- package/components/tabs/collapsible-more.js +47 -73
- package/components/tabs/collapsible-tab.js +32 -36
- package/components/tabs/collapsible-tabs.js +89 -148
- package/components/tabs/custom-item.js +4 -2
- package/components/tabs/dumb-tabs.js +60 -92
- package/components/tabs/smart-tabs.js +29 -61
- package/components/tabs/tab-link.js +1 -3
- package/components/tabs/tab.js +15 -24
- package/components/tabs/tabs.js +1 -26
- package/components/tag/tag.d.ts +0 -2
- package/components/tag/tag.js +120 -162
- package/components/tags-input/tags-input.js +222 -304
- package/components/tags-list/tags-list.js +45 -61
- package/components/text/text.js +28 -37
- package/components/toggle/toggle.js +51 -61
- package/components/tooltip/tooltip.js +109 -141
- package/components/user-agreement/service.js +259 -400
- package/components/user-agreement/user-agreement.js +80 -108
- package/components/user-card/card.js +1 -25
- package/components/user-card/smart-user-card-tooltip.js +52 -103
- package/components/user-card/tooltip.js +35 -65
- package/components/user-card/user-card.js +1 -25
- package/package.json +1 -1
- package/components/global/react-render-adapter.d.ts +0 -1
- package/components/global/react-render-adapter.js +0 -6
- package/components/header/tray-icon.d.ts +0 -1
- package/components/header/tray-icon.js +0 -26
@@ -1,8 +1,5 @@
|
|
1
|
-
import { _ as _defineProperty,
|
2
|
-
import 'core-js/modules/
|
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
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
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
|
-
|
100
|
+
this.props.onPageSizeChange(item.key);
|
131
101
|
}
|
132
102
|
});
|
133
|
-
_defineProperty(
|
134
|
-
|
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
|
-
|
138
|
-
(_this$props$onPageCha = (_this$props =
|
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(
|
142
|
-
|
143
|
-
currentPage
|
144
|
-
onLoadPage
|
145
|
-
|
146
|
-
|
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$
|
149
|
-
(_this$props$onPageCha2 = (_this$
|
150
|
-
} else if (
|
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(
|
155
|
-
|
156
|
-
|
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(
|
161
|
-
|
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
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
var
|
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
|
-
|
188
|
-
|
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
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
}
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
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
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
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
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
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
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
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
|
-
|
343
|
-
|
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
|
-
|
362
|
-
|
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
|
-
|
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:
|
384
|
-
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
|
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
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
-
|
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
|