@jetbrains/ring-ui 5.0.36 → 5.0.37
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/input/input.css +2 -0
- package/components/query-assist/query-assist.js +1 -1
- package/dist/_helpers/_rollupPluginBabelHelpers.js +0 -4
- package/dist/_helpers/anchor.js +0 -1
- package/dist/_helpers/card.js +0 -3
- package/dist/_helpers/dialog__body-scroll-preventer.js +0 -11
- package/dist/_helpers/footer.js +2 -13
- package/dist/_helpers/query-assist__suggestions.js +0 -10
- package/dist/_helpers/select__filter.js +0 -11
- package/dist/_helpers/services-link.js +0 -2
- package/dist/_helpers/sidebar.js +0 -12
- package/dist/_helpers/theme.js +0 -3
- package/dist/_helpers/title.js +0 -9
- package/dist/alert/alert.js +2 -32
- package/dist/alert/container.js +0 -5
- package/dist/alert-service/alert-service.js +0 -26
- package/dist/analytics/analytics.js +0 -22
- package/dist/analytics/analytics__custom-plugin.js +0 -38
- package/dist/analytics/analytics__fus-plugin.js +0 -20
- package/dist/analytics/analytics__ga-plugin.js +0 -13
- package/dist/analytics/analytics__plugin-utils.js +0 -8
- package/dist/analytics-ng/analytics-ng.js +3 -9
- package/dist/auth/auth.js +2 -3
- package/dist/auth/auth__core.js +30 -243
- package/dist/auth/background-flow.js +2 -25
- package/dist/auth/down-notification.js +0 -7
- package/dist/auth/iframe-flow.js +2 -26
- package/dist/auth/landing.js +2 -6
- package/dist/auth/request-builder.js +0 -11
- package/dist/auth/response-parser.js +4 -26
- package/dist/auth/storage.js +4 -60
- package/dist/auth/token-validator.js +6 -42
- package/dist/auth/window-flow.js +2 -34
- package/dist/auth-dialog/auth-dialog.js +2 -12
- package/dist/auth-dialog-service/auth-dialog-service.js +2 -4
- package/dist/auth-ng/auth-ng.js +6 -22
- package/dist/auth-ng/auth-ng.mock.js +0 -4
- package/dist/autofocus-ng/autofocus-ng.js +0 -5
- package/dist/avatar/avatar.js +4 -17
- package/dist/avatar/fallback-avatar.js +2 -9
- package/dist/avatar-editor-ng/avatar-editor-ng.js +1 -17
- package/dist/badge/badge.js +0 -3
- package/dist/button/button.js +0 -8
- package/dist/button-group/button-group.js +0 -3
- package/dist/button-group/caption.js +0 -2
- package/dist/button-group-ng/button-group-ng.js +0 -4
- package/dist/button-ng/button-ng.js +3 -21
- package/dist/button-set/button-set.js +0 -3
- package/dist/button-set-ng/button-set-ng.js +0 -2
- package/dist/button-toolbar/button-toolbar.js +0 -3
- package/dist/button-toolbar-ng/button-toolbar-ng.js +0 -2
- package/dist/caret/caret.js +2 -53
- package/dist/checkbox/checkbox.js +0 -12
- package/dist/code/code.js +3 -25
- package/dist/compiler-ng/compiler-ng.js +0 -5
- package/dist/confirm/confirm.js +0 -6
- package/dist/confirm-service/confirm-service.js +10 -8
- package/dist/content-layout/content-layout.js +0 -7
- package/dist/contenteditable/contenteditable.js +6 -13
- package/dist/data-list/data-list.js +4 -28
- package/dist/data-list/item.js +0 -15
- package/dist/data-list/selection.js +0 -27
- package/dist/date-picker/consts.js +0 -7
- package/dist/date-picker/date-input.js +0 -20
- package/dist/date-picker/date-picker.js +2 -36
- package/dist/date-picker/date-popup.js +18 -71
- package/dist/date-picker/day.js +0 -14
- package/dist/date-picker/month-names.js +0 -9
- package/dist/date-picker/month-slider.js +0 -10
- package/dist/date-picker/month.js +2 -4
- package/dist/date-picker/months.js +6 -13
- package/dist/date-picker/years.js +0 -14
- package/dist/dialog/dialog.js +0 -19
- package/dist/dialog-ng/dialog-ng.js +17 -105
- package/dist/docked-panel-ng/docked-panel-ng.js +6 -29
- package/dist/dropdown/dropdown.js +2 -33
- package/dist/dropdown-menu/dropdown-menu.js +4 -8
- package/dist/editable-heading/editable-heading.js +0 -3
- package/dist/error-bubble/error-bubble.js +2 -4
- package/dist/error-message/error-message.js +0 -3
- package/dist/footer-ng/footer-ng.js +0 -13
- package/dist/form-ng/form-ng.js +1 -21
- package/dist/global/angular-component-factory.js +0 -10
- package/dist/global/compose.js +0 -1
- package/dist/global/composeRefs.js +0 -1
- package/dist/global/controls-height.js +0 -2
- package/dist/global/create-stateful-context.js +0 -5
- package/dist/global/data-tests.js +0 -4
- package/dist/global/dom.js +2 -11
- package/dist/global/focus-sensor-hoc.js +4 -33
- package/dist/global/fuzzy-highlight.js +2 -16
- package/dist/global/get-event-key.js +8 -17
- package/dist/global/get-uid.js +0 -2
- package/dist/global/linear-function.js +0 -2
- package/dist/global/listeners.js +0 -13
- package/dist/global/memoize.js +0 -2
- package/dist/global/normalize-indent.js +2 -5
- package/dist/global/react-dom-renderer.js +0 -8
- package/dist/global/react-render-adapter.js +0 -7
- package/dist/global/rerender-hoc.js +0 -7
- package/dist/global/ring-angular-component.js +0 -5
- package/dist/global/schedule-raf.js +0 -5
- package/dist/global/trivial-template-tag.js +2 -3
- package/dist/global/url.js +0 -27
- package/dist/grid/col.js +0 -4
- package/dist/grid/grid.js +0 -3
- package/dist/grid/row.js +0 -5
- package/dist/group/group.js +0 -3
- package/dist/header/header.js +0 -5
- package/dist/header/logo.js +0 -4
- package/dist/header/profile.js +0 -7
- package/dist/header/services.js +0 -11
- package/dist/header/smart-profile.js +4 -18
- package/dist/header/smart-services.js +0 -17
- package/dist/header/tray-icon.js +2 -3
- package/dist/header/tray.js +0 -3
- package/dist/heading/heading.js +0 -5
- package/dist/http/http.js +20 -65
- package/dist/http/http.mock.js +2 -14
- package/dist/hub-source/hub-source.js +0 -32
- package/dist/hub-source/hub-source__user.js +0 -1
- package/dist/hub-source/hub-source__users-groups.js +0 -12
- package/dist/icon/icon.js +0 -13
- package/dist/icon/icon__constants.js +0 -4
- package/dist/icon/icon__svg.js +0 -10
- package/dist/icon-ng/icon-ng.js +2 -7
- package/dist/input/input.js +0 -30
- package/dist/input-ng/input-ng.js +0 -17
- package/dist/island/adaptive-island-hoc.js +0 -7
- package/dist/island/content.js +0 -25
- package/dist/island/header.js +0 -7
- package/dist/island/island.js +0 -4
- package/dist/island-legacy/content-legacy.js +0 -2
- package/dist/island-legacy/header-legacy.js +0 -2
- package/dist/island-legacy/island-legacy.js +0 -2
- package/dist/island-ng/island-content-ng.js +0 -3
- package/dist/link/clickableLink.js +2 -10
- package/dist/link/link.js +2 -9
- package/dist/link-ng/link-ng.js +0 -2
- package/dist/list/consts.js +0 -4
- package/dist/list/list.js +6 -128
- package/dist/list/list__custom.js +0 -4
- package/dist/list/list__hint.js +0 -3
- package/dist/list/list__item.js +0 -8
- package/dist/list/list__link.js +2 -3
- package/dist/list/list__separator.js +0 -1
- package/dist/list/list__title.js +0 -1
- package/dist/list/list__users-groups-source.js +4 -17
- package/dist/loader/loader.js +0 -10
- package/dist/loader/loader__core.js +6 -70
- package/dist/loader-inline/loader-inline.js +0 -3
- package/dist/loader-ng/loader-ng.js +0 -7
- package/dist/loader-screen/loader-screen.js +0 -3
- package/dist/loader-screen-ng/loader-screen-ng.js +2 -14
- package/dist/login-dialog/login-dialog.js +0 -15
- package/dist/login-dialog/service.js +2 -4
- package/dist/markdown/code.js +0 -2
- package/dist/markdown/heading.js +0 -1
- package/dist/markdown/link.js +0 -1
- package/dist/markdown/markdown.js +0 -2
- package/dist/message/message.js +0 -24
- package/dist/message-bundle-ng/message-bundle-ng.js +2 -45
- package/dist/old-browsers-message/old-browsers-message.js +2 -21
- package/dist/old-browsers-message/white-list.js +2 -6
- package/dist/pager/pager.js +2 -39
- package/dist/panel/panel.js +0 -3
- package/dist/permissions/permissions.js +1 -43
- package/dist/permissions/permissions__cache.js +12 -63
- package/dist/permissions-ng/permissions-ng.js +11 -19
- package/dist/place-under-ng/place-under-ng.js +0 -19
- package/dist/popup/popup.consts.js +0 -11
- package/dist/popup/popup.js +6 -68
- package/dist/popup/position.js +8 -30
- package/dist/popup-menu/popup-menu.js +4 -13
- package/dist/progress-bar/progress-bar.js +0 -14
- package/dist/promised-click-ng/promised-click-ng.js +3 -22
- package/dist/query-assist/query-assist.js +17 -201
- package/dist/radio/radio.js +0 -6
- package/dist/radio/radio__item.js +0 -9
- package/dist/radio-ng/radio-ng.js +0 -4
- package/dist/save-field-ng/save-field-ng.js +1 -37
- package/dist/select/select.js +18 -208
- package/dist/select/select__popup.js +4 -76
- package/dist/select-ng/select-ng.js +18 -74
- package/dist/select-ng/select-ng__lazy.js +2 -17
- package/dist/select-ng/select-ng__options.js +3 -29
- package/dist/shortcuts/core.js +4 -56
- package/dist/shortcuts/shortcuts-hoc.js +0 -4
- package/dist/shortcuts/shortcuts.js +0 -10
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +0 -13
- package/dist/shortcuts-ng/shortcuts-ng.js +16 -46
- package/dist/sidebar-ng/sidebar-ng.js +2 -12
- package/dist/storage/storage.js +2 -5
- package/dist/storage/storage__fallback.js +2 -48
- package/dist/storage/storage__local.js +0 -23
- package/dist/style.css +1 -1
- package/dist/tab-trap/tab-trap.js +0 -37
- package/dist/table/cell.js +0 -2
- package/dist/table/disable-hover-hoc.js +0 -9
- package/dist/table/header-cell.js +0 -8
- package/dist/table/header.js +0 -16
- package/dist/table/multitable.js +0 -23
- package/dist/table/row-with-focus-sensor.js +0 -12
- package/dist/table/row.js +0 -18
- package/dist/table/selection-adapter.js +0 -2
- package/dist/table/selection-shortcuts-hoc.js +8 -42
- package/dist/table/selection.js +0 -50
- package/dist/table/smart-table.js +0 -9
- package/dist/table/table.js +6 -37
- package/dist/table-legacy-ng/table-legacy-ng.js +12 -42
- package/dist/table-legacy-ng/table-legacy-ng__selection-navigate-actions.js +0 -31
- package/dist/table-legacy-ng/table-legacy-ng__selection.js +0 -32
- package/dist/table-legacy-ng/table-legacy-ng__toolbar.js +2 -5
- package/dist/tabs/collapsible-more.js +0 -5
- package/dist/tabs/collapsible-tab.js +0 -4
- package/dist/tabs/collapsible-tabs.js +8 -28
- package/dist/tabs/dumb-tabs.js +0 -8
- package/dist/tabs/smart-tabs.js +0 -6
- package/dist/tabs/tab-link.js +0 -1
- package/dist/tabs/tab.js +0 -2
- package/dist/tabs-ng/tabs-ng.js +13 -29
- package/dist/tag/tag.js +0 -24
- package/dist/tags-input/tags-input.js +0 -76
- package/dist/tags-list/tags-list.js +0 -6
- package/dist/template-ng/template-ng.js +0 -12
- package/dist/text/text.js +0 -3
- package/dist/theme-ng/theme-ng.js +0 -8
- package/dist/title-ng/title-ng.js +6 -17
- package/dist/toggle/toggle.js +0 -4
- package/dist/tooltip/tooltip.js +4 -35
- package/dist/tooltip-ng/tooltip-ng.js +2 -8
- package/dist/user-agreement/service.js +0 -62
- package/dist/user-agreement/user-agreement.js +0 -8
- package/dist/user-card/smart-user-card-tooltip.js +2 -8
- package/dist/user-card/tooltip.js +0 -3
- package/package.json +15 -15
package/dist/markdown/heading.js
CHANGED
package/dist/markdown/link.js
CHANGED
|
@@ -26,7 +26,6 @@ var modules_9c709e64 = {"unit":"8px","p-margin":"10px","inline":"inline_rui_e3b3
|
|
|
26
26
|
/**
|
|
27
27
|
* @name Markdown
|
|
28
28
|
*/
|
|
29
|
-
|
|
30
29
|
class Markdown extends PureComponent {
|
|
31
30
|
render() {
|
|
32
31
|
const {
|
|
@@ -58,7 +57,6 @@ class Markdown extends PureComponent {
|
|
|
58
57
|
}
|
|
59
58
|
}, restProps), normalizeIndent(children));
|
|
60
59
|
}
|
|
61
|
-
|
|
62
60
|
}
|
|
63
61
|
Markdown.propTypes = {
|
|
64
62
|
inline: PropTypes.bool,
|
package/dist/message/message.js
CHANGED
|
@@ -37,10 +37,8 @@ var modules_8b837449 = {"unit":"8px","padding":"12px","container":"container_rui
|
|
|
37
37
|
/**
|
|
38
38
|
* @name Message
|
|
39
39
|
*/
|
|
40
|
-
|
|
41
40
|
const UNIT = 8;
|
|
42
41
|
const TAIL_SIZE = 11;
|
|
43
|
-
|
|
44
42
|
const getTailOffsets = offset => ({
|
|
45
43
|
[Directions.BOTTOM_RIGHT]: {
|
|
46
44
|
top: 0,
|
|
@@ -106,58 +104,41 @@ const getTailOffsets = offset => ({
|
|
|
106
104
|
/**
|
|
107
105
|
* Displays a popup containing a message.
|
|
108
106
|
*/
|
|
109
|
-
|
|
110
|
-
|
|
111
107
|
class Message extends Component {
|
|
112
108
|
constructor() {
|
|
113
109
|
super(...arguments);
|
|
114
|
-
|
|
115
110
|
_defineProperty(this, "state", {});
|
|
116
|
-
|
|
117
111
|
_defineProperty(this, "_onDirectionChange", direction => this.setState({
|
|
118
112
|
direction
|
|
119
113
|
}));
|
|
120
|
-
|
|
121
114
|
_defineProperty(this, "popup", void 0);
|
|
122
|
-
|
|
123
115
|
_defineProperty(this, "node", void 0);
|
|
124
|
-
|
|
125
116
|
_defineProperty(this, "popupRef", el => {
|
|
126
117
|
var _this$popup;
|
|
127
|
-
|
|
128
118
|
this.popup = el;
|
|
129
119
|
this.node = (_this$popup = this.popup) === null || _this$popup === void 0 ? void 0 : _this$popup.node;
|
|
130
120
|
});
|
|
131
121
|
}
|
|
132
|
-
|
|
133
122
|
getTailOffset() {
|
|
134
123
|
var _this$popup2;
|
|
135
|
-
|
|
136
124
|
const DEFAULT_OFFSET = 32;
|
|
137
125
|
const {
|
|
138
126
|
popupProps
|
|
139
127
|
} = this.props;
|
|
140
|
-
|
|
141
128
|
if (this.props.tailOffset != null) {
|
|
142
129
|
return this.props.tailOffset;
|
|
143
130
|
}
|
|
144
|
-
|
|
145
131
|
const anchor = (popupProps === null || popupProps === void 0 ? void 0 : popupProps.anchorElement) || ((_this$popup2 = this.popup) === null || _this$popup2 === void 0 ? void 0 : _this$popup2.parent);
|
|
146
|
-
|
|
147
132
|
if (!anchor) {
|
|
148
133
|
return DEFAULT_OFFSET;
|
|
149
134
|
}
|
|
150
|
-
|
|
151
135
|
const offset = Math.floor(anchor.offsetWidth / 2);
|
|
152
136
|
const isOpenedToRight = this.state.direction != null && [Directions.TOP_RIGHT, Directions.BOTTOM_RIGHT].includes(this.state.direction);
|
|
153
|
-
|
|
154
137
|
if (popupProps !== null && popupProps !== void 0 && popupProps.left && isOpenedToRight) {
|
|
155
138
|
return offset - (popupProps === null || popupProps === void 0 ? void 0 : popupProps.left);
|
|
156
139
|
}
|
|
157
|
-
|
|
158
140
|
return offset;
|
|
159
141
|
}
|
|
160
|
-
|
|
161
142
|
render() {
|
|
162
143
|
const {
|
|
163
144
|
children,
|
|
@@ -210,9 +191,7 @@ class Message extends Component {
|
|
|
210
191
|
text: true
|
|
211
192
|
}, translations.dismiss)));
|
|
212
193
|
}
|
|
213
|
-
|
|
214
194
|
}
|
|
215
|
-
|
|
216
195
|
_defineProperty(Message, "defaultProps", {
|
|
217
196
|
icon: gift,
|
|
218
197
|
directions: [Directions.TOP_RIGHT, Directions.TOP_LEFT, Directions.TOP_CENTER, Directions.BOTTOM_RIGHT, Directions.BOTTOM_LEFT, Directions.BOTTOM_CENTER, Directions.RIGHT_TOP, Directions.RIGHT_BOTTOM, Directions.RIGHT_CENTER, Directions.LEFT_TOP, Directions.LEFT_BOTTOM, Directions.LEFT_CENTER],
|
|
@@ -222,11 +201,8 @@ _defineProperty(Message, "defaultProps", {
|
|
|
222
201
|
},
|
|
223
202
|
theme: Theme.DARK
|
|
224
203
|
});
|
|
225
|
-
|
|
226
204
|
_defineProperty(Message, "Directions", Directions);
|
|
227
|
-
|
|
228
205
|
_defineProperty(Message, "PopupProps", Popup.PopupProps);
|
|
229
|
-
|
|
230
206
|
Message.propTypes = {
|
|
231
207
|
children: PropTypes.node,
|
|
232
208
|
className: PropTypes.string,
|
|
@@ -4,104 +4,61 @@ import angular from 'angular';
|
|
|
4
4
|
* This service is used by directive to correctly show messages.
|
|
5
5
|
* You can decorate this service to provide your own localized messages.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
const angularModule = angular.module('Ring.message-bundle', []);
|
|
8
|
+
|
|
9
9
|
/**
|
|
10
10
|
* Empty i18n function. If project supports localization, it should decorate i18n
|
|
11
11
|
* with translating function
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
13
|
function emptyI18n() {
|
|
15
14
|
return str => str;
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
function RingMessageBundle(ringI18n) {
|
|
19
17
|
const i18n = ringI18n;
|
|
20
|
-
/* eslint-disable camelcase */
|
|
21
18
|
|
|
19
|
+
/* eslint-disable camelcase */
|
|
22
20
|
this.form_required = () => i18n('Value is required');
|
|
23
|
-
|
|
24
21
|
this.form_invalid = () => i18n('Value is invalid');
|
|
25
|
-
|
|
26
22
|
this.form_url = () => i18n('Should be a valid URL');
|
|
27
|
-
|
|
28
23
|
this.form_email = () => i18n('Should be a valid email');
|
|
29
|
-
|
|
30
24
|
this.form_number = () => i18n('Should be a number');
|
|
31
|
-
|
|
32
25
|
this.form_maxlength = () => i18n('Is too long');
|
|
33
|
-
|
|
34
26
|
this.form_minlength = () => i18n('Is too short');
|
|
35
|
-
|
|
36
27
|
this.form_pattern = () => i18n('Doesn\'t match the pattern');
|
|
37
|
-
|
|
38
28
|
this.form_equalvalue = () => i18n('Is not the same');
|
|
39
|
-
|
|
40
29
|
this.form_unique = () => i18n('Is not unique');
|
|
41
|
-
|
|
42
30
|
this.form_max = () => i18n('Is out of range');
|
|
43
|
-
|
|
44
31
|
this.form_min = () => i18n('Is out of range');
|
|
45
|
-
|
|
46
32
|
this.form_save = () => i18n('Save');
|
|
47
|
-
|
|
48
33
|
this.form_saved = () => i18n('Saved');
|
|
49
|
-
|
|
50
34
|
this.form_cancel = () => i18n('Cancel');
|
|
51
|
-
|
|
52
35
|
this.avatareditor_nosupport = () => i18n('Sorry, your browser doesn\'t support File API');
|
|
53
|
-
|
|
54
36
|
this.avatareditor_noselected = () => i18n('No image file was selected');
|
|
55
|
-
|
|
56
37
|
this.avatareditor_delete = () => i18n('Delete Image');
|
|
57
|
-
|
|
58
38
|
this.avatareditor_add = () => i18n('Add Image');
|
|
59
|
-
|
|
60
39
|
this.errorpage_seriouslywrong = () => i18n('Oh-oh... Something went seriously wrong.');
|
|
61
|
-
|
|
62
40
|
this.errorpage_offline = () => i18n('There\'s nothing we can do: The server seems to be offline.');
|
|
63
|
-
|
|
64
41
|
this.errorpage_disconnected = () => i18n('Disconnected');
|
|
65
|
-
|
|
66
42
|
this.errorpage_disconnectedmsg = () => i18n('No, no one\'s there.');
|
|
67
|
-
|
|
68
43
|
this.errorpage_401 = () => i18n('Authorization required');
|
|
69
|
-
|
|
70
44
|
this.errorpage_401msg = () => i18n('You have requested access to a page that requires authorization, but the request is missing valid authentication credentials. It can also mean that your account has been banned.');
|
|
71
|
-
|
|
72
45
|
this.errorpage_403 = () => i18n('Woah, you can\'t touch this!');
|
|
73
|
-
|
|
74
46
|
this.errorpage_403msg = () => i18n('Unfortunately, you are not allowed to access the page you\'ve requested. It seems you don\'t have sufficient permissions.');
|
|
75
|
-
|
|
76
47
|
this.errorpage_404 = () => i18n('Nope, can\'t find it!');
|
|
77
|
-
|
|
78
48
|
this.errorpage_404msg = () => i18n('Despite our best efforts, there\'s nothing here to show you with the URL you requested. Most likely the URL is invalid or you don\'t have permissions to access the page.');
|
|
79
|
-
|
|
80
49
|
this.errorpage_500 = () => i18n('Oh-oh... Something went seriously wrong');
|
|
81
|
-
|
|
82
50
|
this.errorpage_500msg = () => i18n('Despite our best efforts, the server is not working properly.');
|
|
83
|
-
|
|
84
51
|
this.select_options_not_found = () => i18n('No options found');
|
|
85
|
-
|
|
86
52
|
this.select_loading = () => i18n('Loading...');
|
|
87
|
-
|
|
88
53
|
this.select_label = () => i18n('Select an option');
|
|
89
|
-
|
|
90
54
|
this.previous_page = () => i18n('previous');
|
|
91
|
-
|
|
92
55
|
this.next_page = () => i18n('next page');
|
|
93
|
-
|
|
94
56
|
this.first_page = () => i18n('First page');
|
|
95
|
-
|
|
96
57
|
this.last_page = () => i18n('Last page');
|
|
97
|
-
|
|
98
58
|
this.items_per_page = () => i18n('per page');
|
|
99
|
-
|
|
100
59
|
this.confirmation_ok = () => i18n('Ok');
|
|
101
|
-
|
|
102
60
|
this.confirmation_cancel = () => i18n('Cancel');
|
|
103
61
|
/* eslint-enable camelcase */
|
|
104
|
-
|
|
105
62
|
}
|
|
106
63
|
|
|
107
64
|
angularModule.factory('ringI18n', emptyI18n);
|
|
@@ -5,41 +5,32 @@ import 'sniffr';
|
|
|
5
5
|
/**
|
|
6
6
|
* @name Old Browsers Message
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
8
|
/**
|
|
10
9
|
The list of versions which are definitely supported. "Browser is unsupported"
|
|
11
10
|
won't be displayed for those and higher versions even when a JS error occurs
|
|
12
11
|
on application start.
|
|
13
12
|
*/
|
|
14
|
-
|
|
15
13
|
let smileChanges = 0;
|
|
16
14
|
const MAX_SMILE_CHANGES = 50;
|
|
17
15
|
let previousWindowErrorHandler;
|
|
18
|
-
|
|
19
16
|
function changeSmileClickListener(event) {
|
|
20
17
|
const eyes = ['O', 'o', '-', '>', '<'];
|
|
21
18
|
const target = event.target || event.srcElement;
|
|
22
19
|
smileChanges++;
|
|
23
|
-
|
|
24
20
|
function rand(min, max) {
|
|
25
21
|
return Math.round(Math.random() * (max - min)) + min;
|
|
26
22
|
}
|
|
27
|
-
|
|
28
23
|
function getRandomEye() {
|
|
29
24
|
return eyes[rand(0, eyes.length - 1)];
|
|
30
25
|
}
|
|
31
|
-
|
|
32
26
|
function getRandomSmile() {
|
|
33
27
|
if (smileChanges >= MAX_SMILE_CHANGES) {
|
|
34
28
|
return '\\\\ (x_x) //';
|
|
35
29
|
}
|
|
36
|
-
|
|
37
30
|
return `{{ (${getRandomEye()}_${getRandomEye()}) }}`;
|
|
38
31
|
}
|
|
39
|
-
|
|
40
32
|
target.innerHTML = getRandomSmile();
|
|
41
33
|
}
|
|
42
|
-
|
|
43
34
|
function attachSmileClickListener(smileNode) {
|
|
44
35
|
if (smileNode.addEventListener) {
|
|
45
36
|
smileNode.addEventListener('click', changeSmileClickListener);
|
|
@@ -52,35 +43,27 @@ function attachSmileClickListener(smileNode) {
|
|
|
52
43
|
/**
|
|
53
44
|
* Listens to unhandled errors and displays passed node
|
|
54
45
|
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
46
|
function startOldBrowsersDetector(onOldBrowserDetected) {
|
|
58
47
|
previousWindowErrorHandler = window.onerror;
|
|
59
|
-
|
|
60
48
|
window.onerror = function oldBrowsersMessageShower(errorMsg, url, lineNumber) {
|
|
61
49
|
if (onOldBrowserDetected) {
|
|
62
50
|
onOldBrowserDetected();
|
|
63
51
|
}
|
|
64
|
-
|
|
65
52
|
if (previousWindowErrorHandler) {
|
|
66
53
|
return previousWindowErrorHandler(errorMsg, url, lineNumber);
|
|
67
54
|
}
|
|
68
|
-
|
|
69
55
|
return false;
|
|
70
56
|
};
|
|
71
57
|
}
|
|
72
|
-
|
|
73
58
|
function stopOldBrowserDetector() {
|
|
74
59
|
window.onerror = previousWindowErrorHandler;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
60
|
+
}
|
|
61
|
+
//Start javascript error detection
|
|
78
62
|
startOldBrowsersDetector(() => {
|
|
79
63
|
const oldBrowsersMessageContainer = document.getElementById('ring-old-browsers-message');
|
|
80
64
|
const browserMessage = document.getElementById('ring-old-browsers-message__browser-message');
|
|
81
65
|
const errorMessage = document.getElementById('ring-old-browsers-message__error-message');
|
|
82
66
|
const smileNode = document.getElementById('ring-old-browsers-message__smile');
|
|
83
|
-
|
|
84
67
|
if (browserMessage != null && errorMessage != null) {
|
|
85
68
|
if (isBrowserInWhiteList()) {
|
|
86
69
|
browserMessage.style.display = 'none';
|
|
@@ -90,12 +73,10 @@ startOldBrowsersDetector(() => {
|
|
|
90
73
|
errorMessage.style.display = 'none';
|
|
91
74
|
}
|
|
92
75
|
}
|
|
93
|
-
|
|
94
76
|
if (oldBrowsersMessageContainer) {
|
|
95
77
|
oldBrowsersMessageContainer.hidden = false;
|
|
96
78
|
oldBrowsersMessageContainer.style.display = 'block';
|
|
97
79
|
}
|
|
98
|
-
|
|
99
80
|
if (smileNode) {
|
|
100
81
|
attachSmileClickListener(smileNode);
|
|
101
82
|
}
|
|
@@ -5,24 +5,20 @@ const MAJOR_VERSION_INDEX = 0;
|
|
|
5
5
|
/**
|
|
6
6
|
* SUPPORTED_BROWSERS are defined by Babel plugin, see babel config
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
8
|
if (!["and_chr 105", "chrome 104", "chrome 103", "edge 104", "edge 103", "firefox 103", "ios_saf 15.6", "ios_saf 15.5", "ios_saf 14.5-14.8", "op_mini all", "safari 15.6", "samsung 18.0", "samsung 17.0"]) {
|
|
10
9
|
// eslint-disable-next-line no-console
|
|
11
10
|
console.warn('Ring UI: no SUPPORTED_BROWSERS passed. Please check babel config.');
|
|
12
11
|
}
|
|
13
|
-
|
|
14
12
|
const SUPPORTED = ["and_chr 105", "chrome 104", "chrome 103", "edge 104", "edge 103", "firefox 103", "ios_saf 15.6", "ios_saf 15.5", "ios_saf 14.5-14.8", "op_mini all", "safari 15.6", "samsung 18.0", "samsung 17.0"] || [];
|
|
15
13
|
const WHITE_LISTED_BROWSERS = ['chrome', 'firefox', 'safari', 'edge'];
|
|
16
14
|
const WHITE_LIST = SUPPORTED.reduce((acc, item) => {
|
|
17
15
|
var _item$match;
|
|
18
|
-
|
|
19
16
|
const [, browserName, version] = (_item$match = item.match(/(\S+)\s(\S+)/)) !== null && _item$match !== void 0 ? _item$match : [];
|
|
20
|
-
|
|
21
17
|
if (!WHITE_LISTED_BROWSERS.includes(browserName)) {
|
|
22
18
|
return acc;
|
|
23
19
|
}
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
return {
|
|
21
|
+
...acc,
|
|
26
22
|
[browserName]: parseInt(version, 10)
|
|
27
23
|
};
|
|
28
24
|
}, {});
|
package/dist/pager/pager.js
CHANGED
|
@@ -91,26 +91,21 @@ var modules_1a5f0d42 = {"unit":"8px","pager":"pager_rui_2db7","links":"links_rui
|
|
|
91
91
|
class Pager extends PureComponent {
|
|
92
92
|
constructor() {
|
|
93
93
|
super(...arguments);
|
|
94
|
-
|
|
95
94
|
_defineProperty(this, "handlePageSizeChange", item => {
|
|
96
95
|
if (item != null) {
|
|
97
96
|
this.props.onPageSizeChange(item.key);
|
|
98
97
|
}
|
|
99
98
|
});
|
|
100
|
-
|
|
101
99
|
_defineProperty(this, "handlePrevClick", () => {
|
|
102
100
|
const {
|
|
103
101
|
currentPage
|
|
104
102
|
} = this.props;
|
|
105
|
-
|
|
106
103
|
if (currentPage !== 1) {
|
|
107
104
|
var _this$props$onPageCha, _this$props;
|
|
108
|
-
|
|
109
105
|
const prevPage = currentPage - 1;
|
|
110
106
|
(_this$props$onPageCha = (_this$props = this.props).onPageChange) === null || _this$props$onPageCha === void 0 ? void 0 : _this$props$onPageCha.call(_this$props, prevPage);
|
|
111
107
|
}
|
|
112
108
|
});
|
|
113
|
-
|
|
114
109
|
_defineProperty(this, "handleNextClick", () => {
|
|
115
110
|
const {
|
|
116
111
|
currentPage,
|
|
@@ -118,27 +113,21 @@ class Pager extends PureComponent {
|
|
|
118
113
|
} = this.props;
|
|
119
114
|
const nextPage = currentPage + 1;
|
|
120
115
|
const total = this.getTotalPages();
|
|
121
|
-
|
|
122
116
|
if (currentPage !== total) {
|
|
123
117
|
var _this$props$onPageCha2, _this$props2;
|
|
124
|
-
|
|
125
118
|
(_this$props$onPageCha2 = (_this$props2 = this.props).onPageChange) === null || _this$props$onPageCha2 === void 0 ? void 0 : _this$props$onPageCha2.call(_this$props2, nextPage);
|
|
126
119
|
} else if (this.props.openTotal) {
|
|
127
120
|
onLoadPage(nextPage);
|
|
128
121
|
}
|
|
129
122
|
});
|
|
130
|
-
|
|
131
123
|
_defineProperty(this, "handlePageChange", memoize(i => event => {
|
|
132
124
|
var _this$props$onPageCha3, _this$props3;
|
|
133
|
-
|
|
134
125
|
(_this$props$onPageCha3 = (_this$props3 = this.props).onPageChange) === null || _this$props$onPageCha3 === void 0 ? void 0 : _this$props$onPageCha3.call(_this$props3, i, event);
|
|
135
126
|
}));
|
|
136
|
-
|
|
137
127
|
_defineProperty(this, "handleLoadMore", memoize(i => () => {
|
|
138
128
|
this.props.onLoadPage(i);
|
|
139
129
|
}));
|
|
140
130
|
}
|
|
141
|
-
|
|
142
131
|
getSelectOptions() {
|
|
143
132
|
const {
|
|
144
133
|
pageSize,
|
|
@@ -154,7 +143,6 @@ class Pager extends PureComponent {
|
|
|
154
143
|
data
|
|
155
144
|
};
|
|
156
145
|
}
|
|
157
|
-
|
|
158
146
|
getTotalPages() {
|
|
159
147
|
const {
|
|
160
148
|
total,
|
|
@@ -162,7 +150,6 @@ class Pager extends PureComponent {
|
|
|
162
150
|
} = this.props;
|
|
163
151
|
return Math.ceil(total / pageSize);
|
|
164
152
|
}
|
|
165
|
-
|
|
166
153
|
getButton(page, content, key, active) {
|
|
167
154
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
168
155
|
href: this.generateHref(page),
|
|
@@ -172,13 +159,11 @@ class Pager extends PureComponent {
|
|
|
172
159
|
loader: this.props.loader && active
|
|
173
160
|
}, this.getClickProps(this.handlePageChange(page))), content);
|
|
174
161
|
}
|
|
175
|
-
|
|
176
162
|
getClickProps(onClick) {
|
|
177
163
|
const {
|
|
178
164
|
hrefFunc,
|
|
179
165
|
onPageChange
|
|
180
166
|
} = this.props;
|
|
181
|
-
|
|
182
167
|
if (!onPageChange) {
|
|
183
168
|
return {};
|
|
184
169
|
} else if (hrefFunc) {
|
|
@@ -191,7 +176,6 @@ class Pager extends PureComponent {
|
|
|
191
176
|
};
|
|
192
177
|
}
|
|
193
178
|
}
|
|
194
|
-
|
|
195
179
|
getPageSizeSelector() {
|
|
196
180
|
const selectOptions = this.getSelectOptions();
|
|
197
181
|
return !this.props.disablePageSizeSelector && /*#__PURE__*/React.createElement("div", {
|
|
@@ -207,7 +191,6 @@ class Pager extends PureComponent {
|
|
|
207
191
|
disabled: this.props.loader
|
|
208
192
|
}));
|
|
209
193
|
}
|
|
210
|
-
|
|
211
194
|
getPagerLinks() {
|
|
212
195
|
const prevLinkAvailable = this.props.currentPage !== 1;
|
|
213
196
|
const nextLinkAvailable = this.props.openTotal || this.props.currentPage !== this.getTotalPages();
|
|
@@ -221,15 +204,12 @@ class Pager extends PureComponent {
|
|
|
221
204
|
});
|
|
222
205
|
const prevText = this.props.translations.previousPage;
|
|
223
206
|
const nextText = this.props.translations.nextPage;
|
|
224
|
-
|
|
225
207
|
const nextLinkContent = WrapText => [/*#__PURE__*/React.createElement("span", {
|
|
226
208
|
key: "text"
|
|
227
209
|
}, /*#__PURE__*/React.createElement(WrapText, null, nextText)), nextIcon];
|
|
228
|
-
|
|
229
210
|
const prevLinkContent = WrapText => [prevIcon, /*#__PURE__*/React.createElement("span", {
|
|
230
211
|
key: "text"
|
|
231
212
|
}, /*#__PURE__*/React.createElement(WrapText, null, prevText))];
|
|
232
|
-
|
|
233
213
|
const prevLinkHref = this.generateHref(this.props.currentPage - 1);
|
|
234
214
|
const nextLinkHref = this.generateHref(this.props.currentPage + 1);
|
|
235
215
|
const disabledLinkClasses = classNames({
|
|
@@ -254,68 +234,55 @@ class Pager extends PureComponent {
|
|
|
254
234
|
key: "text"
|
|
255
235
|
}, nextText), nextIcon));
|
|
256
236
|
}
|
|
257
|
-
|
|
258
237
|
generateHref(page) {
|
|
259
238
|
if (this.props.hrefFunc === undefined) {
|
|
260
239
|
return undefined;
|
|
261
240
|
}
|
|
262
|
-
|
|
263
241
|
const pageSize = this.props.disablePageSizeSelector ? undefined : this.props.pageSize;
|
|
264
242
|
return this.props.hrefFunc(page, pageSize);
|
|
265
243
|
}
|
|
266
|
-
|
|
267
244
|
getPagerContent() {
|
|
268
245
|
const {
|
|
269
246
|
currentPage,
|
|
270
247
|
visiblePagesLimit
|
|
271
248
|
} = this.props;
|
|
272
249
|
const totalPages = this.getTotalPages();
|
|
273
|
-
|
|
274
250
|
if (totalPages < this.props.currentPage) {
|
|
275
251
|
var _this$props$onPageCha4, _this$props4;
|
|
276
|
-
|
|
277
252
|
(_this$props$onPageCha4 = (_this$props4 = this.props).onPageChange) === null || _this$props$onPageCha4 === void 0 ? void 0 : _this$props$onPageCha4.call(_this$props4, totalPages);
|
|
278
253
|
}
|
|
279
|
-
|
|
280
254
|
let start = 1;
|
|
281
|
-
let end = totalPages;
|
|
282
|
-
|
|
255
|
+
let end = totalPages;
|
|
256
|
+
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
283
257
|
if (totalPages >= visiblePagesLimit + 6) {
|
|
284
258
|
const leftHalfFrameSize = Math.ceil(visiblePagesLimit / 2) - 1;
|
|
285
259
|
const rightHalfFrameSize = visiblePagesLimit - leftHalfFrameSize - 1;
|
|
286
260
|
start = currentPage - leftHalfFrameSize;
|
|
287
261
|
end = currentPage + rightHalfFrameSize;
|
|
288
|
-
|
|
289
262
|
if (start < 1) {
|
|
290
263
|
const tail = 1 - start;
|
|
291
264
|
start += tail;
|
|
292
265
|
end += tail;
|
|
293
266
|
}
|
|
294
|
-
|
|
295
267
|
if (end > totalPages) {
|
|
296
268
|
const tail = end - totalPages;
|
|
297
269
|
start -= tail;
|
|
298
270
|
end -= tail;
|
|
299
271
|
}
|
|
300
|
-
|
|
301
272
|
if (start < 1) {
|
|
302
273
|
start += 1 - start;
|
|
303
274
|
}
|
|
304
275
|
}
|
|
305
|
-
|
|
306
276
|
const buttons = [];
|
|
307
|
-
|
|
308
277
|
for (let i = start; i <= end; i++) {
|
|
309
278
|
buttons.push(this.getButton(i, i, i, i === currentPage));
|
|
310
279
|
}
|
|
311
|
-
|
|
312
280
|
const lastPageButtonAvailable = end < totalPages && !this.props.openTotal || this.props.openTotal && this.props.canLoadLastPageWithOpenTotal;
|
|
313
281
|
return /*#__PURE__*/React.createElement("div", null, this.getPagerLinks(), /*#__PURE__*/React.createElement(ButtonToolbar, null, start > 1 && this.getButton(1, this.props.translations.firstPage), /*#__PURE__*/React.createElement(ButtonGroup, null, start > 1 && this.getButton(start - 1, '...'), buttons, end < totalPages && this.getButton(end + 1, '...'), end === totalPages && this.props.openTotal && /*#__PURE__*/React.createElement(Button, _extends({
|
|
314
282
|
href: this.generateHref(end + 1),
|
|
315
283
|
disabled: this.props.loader
|
|
316
284
|
}, this.getClickProps(this.handleLoadMore(end + 1))), '...')), lastPageButtonAvailable && this.getButton(this.props.openTotal ? -1 : totalPages, this.props.translations.lastPage)), this.getPageSizeSelector());
|
|
317
285
|
}
|
|
318
|
-
|
|
319
286
|
render() {
|
|
320
287
|
const classes = classNames(modules_1a5f0d42.pager, this.props.className);
|
|
321
288
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -323,9 +290,7 @@ class Pager extends PureComponent {
|
|
|
323
290
|
className: classes
|
|
324
291
|
}, this.getTotalPages() > 1 || this.props.openTotal ? this.getPagerContent() : this.getPageSizeSelector());
|
|
325
292
|
}
|
|
326
|
-
|
|
327
293
|
}
|
|
328
|
-
|
|
329
294
|
_defineProperty(Pager, "defaultProps", {
|
|
330
295
|
currentPage: 1,
|
|
331
296
|
pageSize: 50,
|
|
@@ -347,7 +312,6 @@ _defineProperty(Pager, "defaultProps", {
|
|
|
347
312
|
onPageSizeChange: () => {},
|
|
348
313
|
onLoadPage: () => {}
|
|
349
314
|
});
|
|
350
|
-
|
|
351
315
|
Pager.propTypes = {
|
|
352
316
|
total: PropTypes.number.isRequired,
|
|
353
317
|
currentPage: PropTypes.number,
|
|
@@ -365,7 +329,6 @@ Pager.propTypes = {
|
|
|
365
329
|
loader: PropTypes.bool,
|
|
366
330
|
loaderNavigation: PropTypes.bool,
|
|
367
331
|
hrefFunc: PropTypes.func //function which generates href for all pager's buttons based on pager state passed as a function parameter, either this function or onPageChange should be provided
|
|
368
|
-
|
|
369
332
|
};
|
|
370
333
|
|
|
371
334
|
export { Pager as default };
|
package/dist/panel/panel.js
CHANGED
|
@@ -7,7 +7,6 @@ import { m as modules_cf670408 } from '../_helpers/panel.js';
|
|
|
7
7
|
/**
|
|
8
8
|
* @name Panel
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
10
|
class Panel extends PureComponent {
|
|
12
11
|
render() {
|
|
13
12
|
const {
|
|
@@ -20,9 +19,7 @@ class Panel extends PureComponent {
|
|
|
20
19
|
className: classes
|
|
21
20
|
}), children);
|
|
22
21
|
}
|
|
23
|
-
|
|
24
22
|
}
|
|
25
|
-
|
|
26
23
|
_defineProperty(Panel, "propTypes", {
|
|
27
24
|
className: PropTypes.string,
|
|
28
25
|
children: PropTypes.node
|