@jetbrains/ring-ui 5.0.127 → 5.0.129
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/alert/alert.js +2 -1
- package/components/alert/container.js +2 -1
- package/components/auth/auth__core.js +2 -1
- package/components/auth/request-builder.js +2 -1
- package/components/auth/response-parser.js +2 -1
- package/components/auth/token-validator.js +2 -1
- package/components/auth-dialog/auth-dialog.js +2 -1
- package/components/avatar/avatar.js +2 -1
- package/components/badge/badge.js +2 -1
- package/components/button/button.js +2 -1
- package/components/button-group/button-group.js +2 -1
- package/components/button-group/caption.js +2 -1
- package/components/button-set/button-set.js +2 -1
- package/components/button-toolbar/button-toolbar.js +2 -1
- package/components/caret/caret.js +2 -1
- package/components/checkbox/checkbox.js +2 -1
- package/components/code/code.js +2 -1
- package/components/confirm/confirm.js +2 -1
- package/components/content-layout/content-layout.js +2 -1
- package/components/content-layout/sidebar.js +2 -1
- package/components/data-list/data-list.js +2 -1
- package/components/data-list/item.js +2 -1
- package/components/date-picker/date-input.js +2 -1
- package/components/date-picker/date-picker.js +2 -1
- package/components/date-picker/date-popup.js +2 -1
- package/components/date-picker/day.js +2 -1
- package/components/date-picker/month-slider.js +2 -1
- package/components/date-picker/years.js +2 -1
- package/components/dialog/dialog.d.ts +4 -16
- package/components/dialog/dialog.js +6 -3
- package/components/dropdown/dropdown.js +2 -1
- package/components/error-bubble/error-bubble.js +2 -1
- package/components/error-message/error-message.js +2 -1
- package/components/footer/footer.js +1 -0
- package/components/global/react-dom-renderer.js +2 -1
- package/components/grid/col.js +2 -1
- package/components/grid/grid.js +2 -1
- package/components/grid/row.js +2 -1
- package/components/group/group.js +2 -1
- package/components/header/logo.js +2 -1
- package/components/header/profile.js +2 -1
- package/components/header/services-link.js +2 -1
- package/components/header/services.js +2 -1
- package/components/header/smart-profile.js +2 -1
- package/components/header/smart-services.js +2 -1
- package/components/header/tray-icon.js +2 -1
- package/components/header/tray.js +2 -1
- package/components/hub-source/hub-source.js +2 -1
- package/components/icon/icon.js +2 -1
- package/components/input/input.js +2 -1
- package/components/island/island.js +2 -1
- package/components/island-legacy/content-legacy.js +2 -1
- package/components/island-legacy/header-legacy.js +2 -1
- package/components/island-legacy/island-legacy.js +2 -1
- package/components/link/clickableLink.js +2 -1
- package/components/list/list.js +2 -1
- package/components/list/list__hint.js +2 -1
- package/components/list/list__users-groups-source.js +2 -1
- package/components/loader/loader.js +2 -1
- package/components/loader/loader__core.js +2 -1
- package/components/loader-screen/loader-screen.js +2 -1
- package/components/login-dialog/login-dialog.js +2 -1
- package/components/message/message.js +2 -1
- package/components/pager/pager.js +2 -1
- package/components/panel/panel.js +2 -1
- package/components/permissions/permissions.js +2 -1
- package/components/permissions/permissions__cache.js +2 -1
- package/components/popup/popup.js +2 -1
- package/components/popup-menu/popup-menu.js +2 -1
- package/components/progress-bar/progress-bar.js +2 -1
- package/components/query-assist/query-assist.js +4 -3
- package/components/radio/radio.js +2 -1
- package/components/radio/radio__item.js +2 -1
- package/components/select/select.js +2 -1
- package/components/select/select__filter.js +2 -1
- package/components/select/select__popup.js +4 -2
- package/components/shortcuts/shortcuts.js +2 -1
- package/components/storage/storage__fallback.js +2 -1
- package/components/tab-trap/tab-trap.js +2 -1
- package/components/table/cell.js +2 -1
- package/components/table/header-cell.js +2 -1
- package/components/table/header.js +2 -1
- package/components/table/multitable.js +2 -1
- package/components/table/row.d.ts +1 -0
- package/components/table/row.js +6 -4
- package/components/table/smart-table.d.ts +1 -0
- package/components/table/table.d.ts +2 -0
- package/components/table/table.js +8 -4
- package/components/tabs/smart-tabs.js +2 -1
- package/components/tabs/tab.js +2 -1
- package/components/tag/tag.js +2 -1
- package/components/tags-input/tags-input.d.ts +1 -1
- package/components/tags-input/tags-input.js +3 -2
- package/components/tags-list/tags-list.js +2 -1
- package/components/text/text.js +2 -1
- package/components/tooltip/tooltip.js +2 -1
- package/components/user-agreement/user-agreement.js +2 -1
- package/components/user-card/card.js +2 -1
- package/components/user-card/smart-user-card-tooltip.d.ts +1 -1
- package/components/user-card/smart-user-card-tooltip.js +2 -1
- package/components/user-card/tooltip.js +2 -1
- package/dist/_helpers/_rollupPluginBabelHelpers.js +1 -29
- package/dist/_helpers/anchor.js +1 -1
- package/dist/_helpers/card.js +44 -47
- package/dist/_helpers/footer.js +1 -0
- package/dist/_helpers/select__filter.js +10 -13
- package/dist/_helpers/services-link.js +10 -10
- package/dist/_helpers/sidebar.js +34 -37
- package/dist/_helpers/theme.js +1 -1
- package/dist/_helpers/title.js +12 -16
- package/dist/alert/alert.js +63 -66
- package/dist/alert/container.js +5 -5
- package/dist/alert-service/alert-service.js +5 -7
- package/dist/analytics/analytics.js +1 -2
- package/dist/analytics/analytics__custom-plugin.js +6 -8
- package/dist/auth/auth.js +1 -1
- package/dist/auth/auth__core.js +26 -26
- package/dist/auth/background-flow.js +4 -5
- package/dist/auth/iframe-flow.js +12 -12
- package/dist/auth/landing.js +1 -1
- package/dist/auth/request-builder.js +3 -5
- package/dist/auth/response-parser.js +5 -6
- package/dist/auth/storage.js +12 -12
- package/dist/auth/token-validator.js +13 -16
- package/dist/auth/window-flow.js +18 -19
- package/dist/auth-dialog/auth-dialog.js +54 -57
- package/dist/auth-dialog-service/auth-dialog-service.js +1 -1
- package/dist/auth-ng/auth-ng.js +1 -1
- package/dist/avatar/avatar.js +30 -33
- package/dist/avatar-ng/avatar-ng.js +1 -1
- package/dist/badge/badge.js +10 -10
- package/dist/badge-ng/badge-ng.js +1 -1
- package/dist/breadcrumb-ng/breadcrumb-ng.js +0 -1
- package/dist/button/button.js +24 -27
- package/dist/button-group/button-group.js +5 -5
- package/dist/button-group/caption.js +4 -4
- package/dist/button-ng/button-ng.js +68 -69
- package/dist/button-set/button-set.js +6 -6
- package/dist/button-toolbar/button-toolbar.js +6 -6
- package/dist/caret/caret.js +2 -4
- package/dist/checkbox/checkbox.js +27 -30
- package/dist/checkbox-ng/checkbox-ng.js +0 -1
- package/dist/code/code.js +17 -21
- package/dist/confirm/confirm.js +31 -34
- package/dist/confirm-ng/confirm-ng.js +1 -1
- package/dist/confirm-service/confirm-service.js +1 -1
- package/dist/content-layout/content-layout.js +17 -20
- package/dist/contenteditable/contenteditable.js +11 -11
- package/dist/data-list/data-list.js +49 -55
- package/dist/data-list/item.js +64 -67
- package/dist/data-list/selection.js +0 -1
- package/dist/data-list/title.js +1 -1
- package/dist/data-list-ng/data-list-ng.js +1 -1
- package/dist/date-picker/date-input.js +39 -42
- package/dist/date-picker/date-picker.js +162 -165
- package/dist/date-picker/date-popup.js +119 -119
- package/dist/date-picker/day.js +34 -38
- package/dist/date-picker/month-names.js +11 -14
- package/dist/date-picker/month-slider.js +24 -28
- package/dist/date-picker/month.js +1 -1
- package/dist/date-picker/months.js +1 -1
- package/dist/date-picker/years.js +9 -13
- package/dist/dialog/dialog.d.ts +4 -16
- package/dist/dialog/dialog.js +68 -65
- package/dist/dialog-ng/dialog-ng.js +21 -22
- package/dist/docked-panel-ng/docked-panel-ng.js +0 -1
- package/dist/dropdown/dropdown.js +101 -104
- package/dist/dropdown-menu/dropdown-menu.js +1 -1
- package/dist/editable-heading/editable-heading.js +1 -1
- package/dist/error-bubble/error-bubble.js +6 -6
- package/dist/error-message/error-message.js +10 -10
- package/dist/error-message-ng/error-message-ng.js +0 -1
- package/dist/footer-ng/footer-ng.js +19 -21
- package/dist/global/angular-component-factory.js +2 -3
- package/dist/global/dom.js +1 -5
- package/dist/global/focus-sensor-hoc.js +58 -61
- package/dist/global/listeners.js +1 -5
- package/dist/global/react-dom-renderer.js +8 -12
- package/dist/global/rerender-hoc.js +1 -5
- package/dist/global/ring-angular-component.js +1 -3
- package/dist/grid/col.js +13 -14
- package/dist/grid/grid.js +5 -5
- package/dist/grid/row.js +16 -17
- package/dist/group/group.js +5 -5
- package/dist/header/header.js +10 -10
- package/dist/header/logo.js +9 -9
- package/dist/header/profile.js +58 -58
- package/dist/header/services.js +19 -22
- package/dist/header/smart-profile.js +40 -43
- package/dist/header/smart-services.js +28 -31
- package/dist/header/tray-icon.js +6 -6
- package/dist/header/tray.js +5 -5
- package/dist/heading/heading.js +1 -1
- package/dist/heading-ng/heading-ng.js +1 -1
- package/dist/http/http.js +111 -107
- package/dist/http/http.mock.js +3 -4
- package/dist/hub-source/hub-source.js +7 -9
- package/dist/hub-source/hub-source__user.js +0 -1
- package/dist/hub-source/hub-source__users-groups.js +4 -5
- package/dist/icon/icon.js +18 -18
- package/dist/icon/icon__svg.js +1 -1
- package/dist/icon-ng/icon-ng.js +0 -1
- package/dist/input/input.js +35 -38
- package/dist/input-ng/input-ng.js +25 -26
- package/dist/island/adaptive-island-hoc.js +21 -25
- package/dist/island/content.js +62 -65
- package/dist/island/header.js +11 -11
- package/dist/island/island.js +8 -8
- package/dist/island-legacy/content-legacy.js +5 -5
- package/dist/island-legacy/header-legacy.js +5 -5
- package/dist/island-legacy/island-legacy.js +5 -5
- package/dist/link/clickableLink.js +27 -30
- package/dist/link/link.js +16 -16
- package/dist/list/list.js +389 -391
- package/dist/list/list__custom.js +6 -10
- package/dist/list/list__hint.js +3 -4
- package/dist/list/list__item.js +4 -7
- package/dist/list/list__link.js +1 -1
- package/dist/list/list__users-groups-source.js +3 -3
- package/dist/loader/loader.js +16 -19
- package/dist/loader/loader__core.js +62 -62
- package/dist/loader-inline/loader-inline.js +6 -6
- package/dist/loader-ng/loader-ng.js +3 -4
- package/dist/loader-screen/loader-screen.js +6 -6
- package/dist/loader-screen-ng/loader-screen-ng.js +0 -1
- package/dist/login-dialog/login-dialog.js +55 -58
- package/dist/login-dialog/service.js +1 -1
- package/dist/markdown/code.js +0 -1
- package/dist/markdown/markdown.js +1 -1
- package/dist/message/message.js +22 -25
- package/dist/old-browsers-message/white-list.js +2 -2
- package/dist/pager/pager.js +55 -58
- package/dist/pager-ng/pager-ng.js +1 -1
- package/dist/panel/panel.js +5 -5
- package/dist/panel-ng/panel-ng.js +0 -1
- package/dist/permissions/permissions.js +14 -16
- package/dist/permissions/permissions__cache.js +4 -6
- package/dist/permissions-ng/permissions-ng.js +1 -1
- package/dist/place-under-ng/place-under-ng.js +0 -1
- package/dist/popup/popup.js +118 -121
- package/dist/popup/popup.target.js +1 -1
- package/dist/popup/position.js +0 -1
- package/dist/popup-menu/popup-menu.js +19 -22
- package/dist/progress-bar/progress-bar.js +41 -44
- package/dist/progress-bar-ng/progress-bar-ng.js +1 -1
- package/dist/promised-click-ng/promised-click-ng.js +0 -1
- package/dist/query-assist/query-assist.js +507 -501
- package/dist/query-assist/query-assist__suggestions.js +1 -1
- package/dist/query-assist-ng/query-assist-ng.js +1 -1
- package/dist/radio/radio.js +10 -13
- package/dist/radio/radio__item.js +19 -22
- package/dist/select/select.js +350 -349
- package/dist/select/select__popup.js +148 -152
- package/dist/select-ng/select-ng.js +1 -1
- package/dist/select-ng/select-ng__lazy.js +4 -4
- package/dist/select-ng/select-ng__options.js +14 -15
- package/dist/shortcuts/core.js +35 -36
- package/dist/shortcuts/shortcuts-hoc.js +7 -11
- package/dist/shortcuts/shortcuts.js +10 -11
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +0 -1
- package/dist/shortcuts-ng/shortcuts-ng.js +0 -1
- package/dist/sidebar-ng/sidebar-ng.js +0 -1
- package/dist/storage/storage.js +1 -1
- package/dist/storage/storage__fallback.js +8 -10
- package/dist/storage/storage__local.js +2 -2
- package/dist/style.css +1 -1
- package/dist/tab-trap/tab-trap.js +84 -86
- package/dist/table/cell.js +6 -6
- package/dist/table/disable-hover-hoc.js +23 -25
- package/dist/table/header-cell.js +28 -31
- package/dist/table/header.js +58 -61
- package/dist/table/multitable.js +91 -95
- package/dist/table/row-with-focus-sensor.js +15 -18
- package/dist/table/row.d.ts +1 -0
- package/dist/table/row.js +54 -55
- package/dist/table/selection-shortcuts-hoc.js +145 -147
- package/dist/table/selection.js +7 -9
- package/dist/table/smart-table.d.ts +1 -0
- package/dist/table/smart-table.js +21 -24
- package/dist/table/table.d.ts +2 -0
- package/dist/table/table.js +107 -109
- package/dist/table-legacy-ng/table-legacy-ng.js +1 -1
- package/dist/table-legacy-ng/table-legacy-ng__pager.js +1 -1
- package/dist/table-legacy-ng/table-legacy-ng__selection.js +1 -3
- package/dist/table-legacy-ng/table-legacy-ng__toolbar.js +0 -1
- package/dist/table-ng/smart-table-ng.js +1 -1
- package/dist/table-ng/table-ng.js +1 -1
- package/dist/tabs/collapsible-more.js +1 -1
- package/dist/tabs/collapsible-tab.js +1 -1
- package/dist/tabs/dumb-tabs.js +46 -49
- package/dist/tabs/smart-tabs.js +10 -10
- package/dist/tabs/tab.js +7 -8
- package/dist/tag/tag.js +42 -45
- package/dist/tags-input/tags-input.d.ts +1 -1
- package/dist/tags-input/tags-input.js +214 -213
- package/dist/tags-input-ng/tags-input-ng.js +1 -1
- package/dist/tags-list/tags-list.js +20 -20
- package/dist/template-ng/template-ng.js +25 -26
- package/dist/text/text.js +6 -6
- package/dist/toggle/toggle.js +19 -19
- package/dist/toggle-ng/toggle-ng.js +1 -1
- package/dist/tooltip/tooltip.js +86 -89
- package/dist/tooltip-ng/tooltip-ng.js +1 -1
- package/dist/user-agreement/service.js +207 -205
- package/dist/user-agreement/user-agreement.js +39 -42
- package/dist/user-card/smart-user-card-tooltip.d.ts +1 -1
- package/dist/user-card/smart-user-card-tooltip.js +32 -35
- package/dist/user-card/tooltip.js +26 -26
- package/dist/user-card-ng/user-card-ng.js +1 -1
- package/package.json +17 -17
package/dist/http/http.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import ExtendableError from 'es6-error';
|
|
3
2
|
import { encodeURL, joinBaseURLAndPath } from '../global/url.js';
|
|
4
3
|
|
|
@@ -16,11 +15,11 @@ const defaultFetchConfig = {
|
|
|
16
15
|
credentials: 'same-origin'
|
|
17
16
|
};
|
|
18
17
|
class HTTPError extends ExtendableError {
|
|
18
|
+
data;
|
|
19
|
+
status;
|
|
19
20
|
constructor(response) {
|
|
20
21
|
let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
21
22
|
super(`${response.status} ${response.statusText || ''}`);
|
|
22
|
-
_defineProperty(this, "data", void 0);
|
|
23
|
-
_defineProperty(this, "status", void 0);
|
|
24
23
|
this.data = data;
|
|
25
24
|
this.status = response.status;
|
|
26
25
|
}
|
|
@@ -32,120 +31,39 @@ function isRawBody(params) {
|
|
|
32
31
|
return params.sendRawBody === true;
|
|
33
32
|
}
|
|
34
33
|
class HTTP {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
this.requestToken = () => auth.requestToken();
|
|
46
|
-
this.shouldRefreshToken = auth.constructor.shouldRefreshToken;
|
|
47
|
-
this.forceTokenUpdate = () => auth.forceTokenUpdate();
|
|
48
|
-
});
|
|
49
|
-
_defineProperty(this, "setBaseUrl", baseUrl => {
|
|
50
|
-
this.baseUrl = baseUrl;
|
|
51
|
-
});
|
|
52
|
-
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
53
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
|
-
_defineProperty(this, "fetch", async function (url) {
|
|
55
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
56
|
-
const {
|
|
57
|
-
body,
|
|
58
|
-
query = {},
|
|
59
|
-
...fetchConfig
|
|
60
|
-
} = params;
|
|
61
|
-
const response = await _this._fetch(_this._makeRequestUrl(url, query), {
|
|
62
|
-
...fetchConfig,
|
|
63
|
-
headers: fetchConfig.headers,
|
|
64
|
-
body: body !== null && body !== undefined && body !== '' ? JSON.stringify(body) : body
|
|
65
|
-
});
|
|
66
|
-
return _this._processResponse(response);
|
|
67
|
-
});
|
|
68
|
-
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
69
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
70
|
-
_defineProperty(this, "request", async (url, params) => {
|
|
71
|
-
let token = await this.requestToken?.();
|
|
72
|
-
let response = await this._performRequest(url, token, params);
|
|
73
|
-
try {
|
|
74
|
-
// Wait for result to catch an HTTP error
|
|
75
|
-
return await this._processResponse(response);
|
|
76
|
-
} catch (error) {
|
|
77
|
-
if (!(error instanceof HTTPError)) {
|
|
78
|
-
throw error;
|
|
79
|
-
}
|
|
80
|
-
const shouldRefreshToken = error.data.error !== undefined ? this.shouldRefreshToken?.(error.data.error) : false;
|
|
81
|
-
if (shouldRefreshToken) {
|
|
82
|
-
token = await this.forceTokenUpdate?.();
|
|
83
|
-
response = await this._performRequest(url, token, params);
|
|
84
|
-
return this._processResponse(response);
|
|
85
|
-
}
|
|
86
|
-
throw error;
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
_defineProperty(this, "getMetaForResponse", response => this._requestsMeta.get(response));
|
|
90
|
-
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
91
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
|
-
_defineProperty(this, "get", (url, params) => this.request(url, {
|
|
93
|
-
...params,
|
|
94
|
-
method: 'GET'
|
|
95
|
-
}));
|
|
96
|
-
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
97
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
98
|
-
_defineProperty(this, "post", (url, params) => this.request(url, {
|
|
99
|
-
...params,
|
|
100
|
-
method: 'POST'
|
|
101
|
-
}));
|
|
102
|
-
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
103
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
104
|
-
_defineProperty(this, "delete", (url, params) => this.request(url, {
|
|
105
|
-
...params,
|
|
106
|
-
method: 'DELETE'
|
|
107
|
-
}));
|
|
108
|
-
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
109
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
110
|
-
_defineProperty(this, "put", (url, params) => this.request(url, {
|
|
111
|
-
...params,
|
|
112
|
-
method: 'PUT'
|
|
113
|
-
}));
|
|
114
|
-
/**
|
|
115
|
-
* Usage: const {promise, abort} = http.abortify(http.get<{id: string}>)('http://test.com');
|
|
116
|
-
* @param method
|
|
117
|
-
*/
|
|
118
|
-
_defineProperty(this, "abortify", method => function () {
|
|
119
|
-
for (var _len = arguments.length, _ref = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
120
|
-
_ref[_key] = arguments[_key];
|
|
121
|
-
}
|
|
122
|
-
let [url, params] = _ref;
|
|
123
|
-
const ctrl = new AbortController();
|
|
124
|
-
if (params && !('signal' in params)) {
|
|
125
|
-
params.signal = ctrl.signal;
|
|
126
|
-
}
|
|
127
|
-
return {
|
|
128
|
-
promise: method.call(_this, url, params),
|
|
129
|
-
abort: () => ctrl.abort()
|
|
130
|
-
};
|
|
131
|
-
});
|
|
132
|
-
if (_auth) {
|
|
133
|
-
this.setAuth(_auth);
|
|
34
|
+
baseUrl = null;
|
|
35
|
+
_requestsMeta = new WeakMap();
|
|
36
|
+
fetchConfig;
|
|
37
|
+
requestToken;
|
|
38
|
+
shouldRefreshToken;
|
|
39
|
+
forceTokenUpdate;
|
|
40
|
+
constructor(auth, baseUrl) {
|
|
41
|
+
let fetchConfig = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
42
|
+
if (auth) {
|
|
43
|
+
this.setAuth(auth);
|
|
134
44
|
}
|
|
135
|
-
this.setBaseUrl(
|
|
45
|
+
this.setBaseUrl(baseUrl);
|
|
136
46
|
const {
|
|
137
47
|
headers,
|
|
138
48
|
...defaultConfig
|
|
139
49
|
} = defaultFetchConfig;
|
|
140
50
|
this.fetchConfig = {
|
|
141
51
|
...defaultConfig,
|
|
142
|
-
...
|
|
52
|
+
...fetchConfig,
|
|
143
53
|
headers: {
|
|
144
54
|
...headers,
|
|
145
|
-
...
|
|
55
|
+
...fetchConfig.headers
|
|
146
56
|
}
|
|
147
57
|
};
|
|
148
58
|
}
|
|
59
|
+
setAuth = auth => {
|
|
60
|
+
this.requestToken = () => auth.requestToken();
|
|
61
|
+
this.shouldRefreshToken = auth.constructor.shouldRefreshToken;
|
|
62
|
+
this.forceTokenUpdate = () => auth.forceTokenUpdate();
|
|
63
|
+
};
|
|
64
|
+
setBaseUrl = baseUrl => {
|
|
65
|
+
this.baseUrl = baseUrl;
|
|
66
|
+
};
|
|
149
67
|
_fetch() {
|
|
150
68
|
return fetch(...arguments);
|
|
151
69
|
}
|
|
@@ -169,8 +87,8 @@ class HTTP {
|
|
|
169
87
|
} : {}),
|
|
170
88
|
...headers
|
|
171
89
|
};
|
|
172
|
-
Object.entries(combinedHeaders).forEach(
|
|
173
|
-
let [key, header] =
|
|
90
|
+
Object.entries(combinedHeaders).forEach(_ref => {
|
|
91
|
+
let [key, header] = _ref;
|
|
174
92
|
if (header === null || header === undefined) {
|
|
175
93
|
Reflect.deleteProperty(combinedHeaders, key);
|
|
176
94
|
}
|
|
@@ -233,10 +151,96 @@ class HTTP {
|
|
|
233
151
|
static _isErrorStatus(status) {
|
|
234
152
|
return status < STATUS_OK_IF_MORE_THAN || status >= STATUS_BAD_IF_MORE_THAN;
|
|
235
153
|
}
|
|
154
|
+
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
155
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
156
|
+
fetch = (() => {
|
|
157
|
+
var _this = this;
|
|
158
|
+
return async function (url) {
|
|
159
|
+
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
160
|
+
const {
|
|
161
|
+
body,
|
|
162
|
+
query = {},
|
|
163
|
+
...fetchConfig
|
|
164
|
+
} = params;
|
|
165
|
+
const response = await _this._fetch(_this._makeRequestUrl(url, query), {
|
|
166
|
+
...fetchConfig,
|
|
167
|
+
headers: fetchConfig.headers,
|
|
168
|
+
body: body !== null && body !== undefined && body !== '' ? JSON.stringify(body) : body
|
|
169
|
+
});
|
|
170
|
+
return _this._processResponse(response);
|
|
171
|
+
};
|
|
172
|
+
})();
|
|
236
173
|
async authorizedFetch() {
|
|
237
174
|
const response = await this._performRequest(...arguments);
|
|
238
175
|
return this._processResponse(response);
|
|
239
176
|
}
|
|
177
|
+
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
178
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
179
|
+
request = async (url, params) => {
|
|
180
|
+
let token = await this.requestToken?.();
|
|
181
|
+
let response = await this._performRequest(url, token, params);
|
|
182
|
+
try {
|
|
183
|
+
// Wait for result to catch an HTTP error
|
|
184
|
+
return await this._processResponse(response);
|
|
185
|
+
} catch (error) {
|
|
186
|
+
if (!(error instanceof HTTPError)) {
|
|
187
|
+
throw error;
|
|
188
|
+
}
|
|
189
|
+
const shouldRefreshToken = error.data.error !== undefined ? this.shouldRefreshToken?.(error.data.error) : false;
|
|
190
|
+
if (shouldRefreshToken) {
|
|
191
|
+
token = await this.forceTokenUpdate?.();
|
|
192
|
+
response = await this._performRequest(url, token, params);
|
|
193
|
+
return this._processResponse(response);
|
|
194
|
+
}
|
|
195
|
+
throw error;
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
getMetaForResponse = response => this._requestsMeta.get(response);
|
|
199
|
+
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
200
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
201
|
+
get = (url, params) => this.request(url, {
|
|
202
|
+
...params,
|
|
203
|
+
method: 'GET'
|
|
204
|
+
});
|
|
205
|
+
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
206
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
207
|
+
post = (url, params) => this.request(url, {
|
|
208
|
+
...params,
|
|
209
|
+
method: 'POST'
|
|
210
|
+
});
|
|
211
|
+
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
212
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
213
|
+
delete = (url, params) => this.request(url, {
|
|
214
|
+
...params,
|
|
215
|
+
method: 'DELETE'
|
|
216
|
+
});
|
|
217
|
+
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
218
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
219
|
+
put = (url, params) => this.request(url, {
|
|
220
|
+
...params,
|
|
221
|
+
method: 'PUT'
|
|
222
|
+
});
|
|
223
|
+
/**
|
|
224
|
+
* Usage: const {promise, abort} = http.abortify(http.get<{id: string}>)('http://test.com');
|
|
225
|
+
* @param method
|
|
226
|
+
*/
|
|
227
|
+
abortify = method => {
|
|
228
|
+
var _this2 = this;
|
|
229
|
+
return function () {
|
|
230
|
+
for (var _len = arguments.length, _ref2 = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
231
|
+
_ref2[_key] = arguments[_key];
|
|
232
|
+
}
|
|
233
|
+
let [url, params] = _ref2;
|
|
234
|
+
const ctrl = new AbortController();
|
|
235
|
+
if (params && !('signal' in params)) {
|
|
236
|
+
params.signal = ctrl.signal;
|
|
237
|
+
}
|
|
238
|
+
return {
|
|
239
|
+
promise: method.call(_this2, url, params),
|
|
240
|
+
abort: () => ctrl.abort()
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
};
|
|
240
244
|
}
|
|
241
245
|
|
|
242
246
|
export { CODE, HTTPError, HTTP as default, defaultFetchConfig };
|
package/dist/http/http.mock.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import HTTP from './http.js';
|
|
3
2
|
import 'es6-error';
|
|
4
3
|
import '../global/url.js';
|
|
@@ -9,11 +8,11 @@ const authMock = {
|
|
|
9
8
|
forceTokenUpdate: () => Promise.resolve(null)
|
|
10
9
|
};
|
|
11
10
|
class HTTPMock extends HTTP {
|
|
11
|
+
defaultResponse;
|
|
12
|
+
requests;
|
|
13
|
+
responsesByUrlMap;
|
|
12
14
|
constructor() {
|
|
13
15
|
super(authMock);
|
|
14
|
-
_defineProperty(this, "defaultResponse", void 0);
|
|
15
|
-
_defineProperty(this, "requests", void 0);
|
|
16
|
-
_defineProperty(this, "responsesByUrlMap", void 0);
|
|
17
16
|
this.defaultResponse = null;
|
|
18
17
|
this.requests = [];
|
|
19
18
|
this.responsesByUrlMap = new Map();
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
|
|
3
1
|
const defaultOptions = {
|
|
4
2
|
searchMax: 20,
|
|
5
3
|
searchSideThreshold: 100,
|
|
@@ -12,13 +10,14 @@ const defaultOptions = {
|
|
|
12
10
|
* select data source.
|
|
13
11
|
*/
|
|
14
12
|
class HubSource {
|
|
13
|
+
static TOP_ALL = -1;
|
|
14
|
+
http;
|
|
15
|
+
relativeUrl;
|
|
16
|
+
options;
|
|
17
|
+
storedData;
|
|
18
|
+
isClientSideSearch;
|
|
19
|
+
filterFn;
|
|
15
20
|
constructor(auth, relativeUrl, options) {
|
|
16
|
-
_defineProperty(this, "http", void 0);
|
|
17
|
-
_defineProperty(this, "relativeUrl", void 0);
|
|
18
|
-
_defineProperty(this, "options", void 0);
|
|
19
|
-
_defineProperty(this, "storedData", void 0);
|
|
20
|
-
_defineProperty(this, "isClientSideSearch", void 0);
|
|
21
|
-
_defineProperty(this, "filterFn", void 0);
|
|
22
21
|
this.http = auth.http;
|
|
23
22
|
this.relativeUrl = relativeUrl;
|
|
24
23
|
this.options = Object.assign({}, defaultOptions, options);
|
|
@@ -106,6 +105,5 @@ class HubSource {
|
|
|
106
105
|
return this.processResults(res);
|
|
107
106
|
}
|
|
108
107
|
}
|
|
109
|
-
_defineProperty(HubSource, "TOP_ALL", -1);
|
|
110
108
|
|
|
111
109
|
export { HubSource as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import HubSource from './hub-source.js';
|
|
3
2
|
|
|
4
3
|
const defaultOptions = {
|
|
@@ -6,11 +5,11 @@ const defaultOptions = {
|
|
|
6
5
|
searchSideThreshold: 200
|
|
7
6
|
};
|
|
8
7
|
class HubSourceUsersGroups {
|
|
8
|
+
auth;
|
|
9
|
+
options;
|
|
10
|
+
usersSource;
|
|
11
|
+
groupsSource;
|
|
9
12
|
constructor(auth, options) {
|
|
10
|
-
_defineProperty(this, "auth", void 0);
|
|
11
|
-
_defineProperty(this, "options", void 0);
|
|
12
|
-
_defineProperty(this, "usersSource", void 0);
|
|
13
|
-
_defineProperty(this, "groupsSource", void 0);
|
|
14
13
|
this.auth = auth;
|
|
15
14
|
this.options = Object.assign({}, defaultOptions, options);
|
|
16
15
|
this.usersSource = new HubSource(auth, 'users', {
|
package/dist/icon/icon.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import React, { PureComponent } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import classNames from 'classnames';
|
|
@@ -12,6 +12,23 @@ const warnSize = deprecate(() => {}, `\`size\`, \`width\` and \`height\` props a
|
|
|
12
12
|
|
|
13
13
|
We strongly recommend to use icons handcrafted for particular sizes. If your icon doesn't exist in the desired size, please ask your designer to draw one. "Responsive" checkmark should be unchecked when exporting icon.'`);
|
|
14
14
|
class Icon extends PureComponent {
|
|
15
|
+
static propTypes = {
|
|
16
|
+
className: PropTypes.string,
|
|
17
|
+
color: PropTypes.string,
|
|
18
|
+
glyph: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]).isRequired,
|
|
19
|
+
height: PropTypes.number,
|
|
20
|
+
size: PropTypes.number,
|
|
21
|
+
width: PropTypes.number,
|
|
22
|
+
loading: PropTypes.bool,
|
|
23
|
+
suppressSizeWarning: PropTypes.bool
|
|
24
|
+
};
|
|
25
|
+
static defaultProps = {
|
|
26
|
+
className: '',
|
|
27
|
+
color: Color.DEFAULT,
|
|
28
|
+
glyph: ''
|
|
29
|
+
};
|
|
30
|
+
static Color = Color;
|
|
31
|
+
static Size = Size;
|
|
15
32
|
warnSize() {
|
|
16
33
|
if (this.props.suppressSizeWarning) {
|
|
17
34
|
return;
|
|
@@ -70,22 +87,5 @@ class Icon extends PureComponent {
|
|
|
70
87
|
}));
|
|
71
88
|
}
|
|
72
89
|
}
|
|
73
|
-
_defineProperty(Icon, "propTypes", {
|
|
74
|
-
className: PropTypes.string,
|
|
75
|
-
color: PropTypes.string,
|
|
76
|
-
glyph: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]).isRequired,
|
|
77
|
-
height: PropTypes.number,
|
|
78
|
-
size: PropTypes.number,
|
|
79
|
-
width: PropTypes.number,
|
|
80
|
-
loading: PropTypes.bool,
|
|
81
|
-
suppressSizeWarning: PropTypes.bool
|
|
82
|
-
});
|
|
83
|
-
_defineProperty(Icon, "defaultProps", {
|
|
84
|
-
className: '',
|
|
85
|
-
color: Color.DEFAULT,
|
|
86
|
-
glyph: ''
|
|
87
|
-
});
|
|
88
|
-
_defineProperty(Icon, "Color", Color);
|
|
89
|
-
_defineProperty(Icon, "Size", Size);
|
|
90
90
|
|
|
91
91
|
export { Color, Size, Icon as default };
|
package/dist/icon/icon__svg.js
CHANGED
package/dist/icon-ng/icon-ng.js
CHANGED
|
@@ -2,7 +2,6 @@ import angular from 'angular';
|
|
|
2
2
|
import { Color } from '../icon/icon__constants.js';
|
|
3
3
|
import RingTemplateNg from '../template-ng/template-ng.js';
|
|
4
4
|
import { m as modules_29747b80 } from '../_helpers/icon.js';
|
|
5
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
6
5
|
import '../global/ring-angular-component.js';
|
|
7
6
|
|
|
8
7
|
/**
|
package/dist/input/input.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import React, { PureComponent } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import classNames from 'classnames';
|
|
@@ -34,33 +34,18 @@ var Size;
|
|
|
34
34
|
Size["FULL"] = "FULL";
|
|
35
35
|
})(Size || (Size = {}));
|
|
36
36
|
class Input extends PureComponent {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
this.props.onClear && this.props.onClear(e);
|
|
50
|
-
});
|
|
51
|
-
_defineProperty(this, "handleInputChange", e => {
|
|
52
|
-
if (!this.props.multiline) {
|
|
53
|
-
this.props.onChange?.(e);
|
|
54
|
-
this.checkValue();
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
_defineProperty(this, "handleTextareaChange", e => {
|
|
58
|
-
if (this.props.multiline) {
|
|
59
|
-
this.props.onChange?.(e);
|
|
60
|
-
this.checkValue();
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
}
|
|
37
|
+
static defaultProps = {
|
|
38
|
+
size: Size.M,
|
|
39
|
+
onChange: noop,
|
|
40
|
+
inputRef: noop,
|
|
41
|
+
enableShortcuts: ['esc'],
|
|
42
|
+
translations: {
|
|
43
|
+
clear: 'Clear input'
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
state = {
|
|
47
|
+
empty: true
|
|
48
|
+
};
|
|
64
49
|
componentDidMount() {
|
|
65
50
|
this.frame = requestAnimationFrame(() => this.adapt());
|
|
66
51
|
}
|
|
@@ -72,6 +57,10 @@ class Input extends PureComponent {
|
|
|
72
57
|
cancelAnimationFrame(this.frame);
|
|
73
58
|
}
|
|
74
59
|
}
|
|
60
|
+
static contextType = ControlsHeightContext;
|
|
61
|
+
frame;
|
|
62
|
+
input;
|
|
63
|
+
id = getUID('ring-input-');
|
|
75
64
|
getId() {
|
|
76
65
|
return this.props.id || this.id;
|
|
77
66
|
}
|
|
@@ -93,6 +82,24 @@ class Input extends PureComponent {
|
|
|
93
82
|
adapt() {
|
|
94
83
|
this.checkValue();
|
|
95
84
|
}
|
|
85
|
+
inputRef = el => {
|
|
86
|
+
this.input = el;
|
|
87
|
+
};
|
|
88
|
+
clear = e => {
|
|
89
|
+
this.props.onClear && this.props.onClear(e);
|
|
90
|
+
};
|
|
91
|
+
handleInputChange = e => {
|
|
92
|
+
if (!this.props.multiline) {
|
|
93
|
+
this.props.onChange?.(e);
|
|
94
|
+
this.checkValue();
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
handleTextareaChange = e => {
|
|
98
|
+
if (this.props.multiline) {
|
|
99
|
+
this.props.onChange?.(e);
|
|
100
|
+
this.checkValue();
|
|
101
|
+
}
|
|
102
|
+
};
|
|
96
103
|
render() {
|
|
97
104
|
const {
|
|
98
105
|
// Modifiers
|
|
@@ -174,16 +181,6 @@ class Input extends PureComponent {
|
|
|
174
181
|
}, error));
|
|
175
182
|
}
|
|
176
183
|
}
|
|
177
|
-
_defineProperty(Input, "defaultProps", {
|
|
178
|
-
size: Size.M,
|
|
179
|
-
onChange: noop,
|
|
180
|
-
inputRef: noop,
|
|
181
|
-
enableShortcuts: ['esc'],
|
|
182
|
-
translations: {
|
|
183
|
-
clear: 'Clear input'
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
_defineProperty(Input, "contextType", ControlsHeightContext);
|
|
187
184
|
Input.propTypes = {
|
|
188
185
|
value: PropTypes.string,
|
|
189
186
|
className: PropTypes.string,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import angular from 'angular';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
import closeIcon from '@jetbrains/icons/close';
|
|
@@ -18,6 +17,28 @@ var modules_c40fa551 = {"errorText":"errorText_rui_d15a","clear":"clear_rui_d15a
|
|
|
18
17
|
|
|
19
18
|
const angularModule = angular.module('Ring.input', [Button]);
|
|
20
19
|
class RingInputComponent extends RingAngularComponent {
|
|
20
|
+
static require = {
|
|
21
|
+
ngModelCtrl: '?ngModel'
|
|
22
|
+
};
|
|
23
|
+
static bindings = {
|
|
24
|
+
name: '@',
|
|
25
|
+
required: '@',
|
|
26
|
+
ngMinlength: '@',
|
|
27
|
+
ngMaxlength: '@',
|
|
28
|
+
placeholder: '@',
|
|
29
|
+
ngModel: '<',
|
|
30
|
+
onChange: '&',
|
|
31
|
+
label: '@',
|
|
32
|
+
hint: '@',
|
|
33
|
+
size: '@',
|
|
34
|
+
disabled: '@',
|
|
35
|
+
active: '<',
|
|
36
|
+
error: '@',
|
|
37
|
+
empty: '<',
|
|
38
|
+
clearable: '<',
|
|
39
|
+
borderless: '<',
|
|
40
|
+
multiline: '<'
|
|
41
|
+
};
|
|
21
42
|
$onInit() {
|
|
22
43
|
this.closeIcon = closeIcon;
|
|
23
44
|
if (!this.ngModelCtrl) {
|
|
@@ -60,30 +81,7 @@ class RingInputComponent extends RingAngularComponent {
|
|
|
60
81
|
[modules_88cfaf40.borderless]: this.borderless
|
|
61
82
|
});
|
|
62
83
|
}
|
|
63
|
-
|
|
64
|
-
_defineProperty(RingInputComponent, "require", {
|
|
65
|
-
ngModelCtrl: '?ngModel'
|
|
66
|
-
});
|
|
67
|
-
_defineProperty(RingInputComponent, "bindings", {
|
|
68
|
-
name: '@',
|
|
69
|
-
required: '@',
|
|
70
|
-
ngMinlength: '@',
|
|
71
|
-
ngMaxlength: '@',
|
|
72
|
-
placeholder: '@',
|
|
73
|
-
ngModel: '<',
|
|
74
|
-
onChange: '&',
|
|
75
|
-
label: '@',
|
|
76
|
-
hint: '@',
|
|
77
|
-
size: '@',
|
|
78
|
-
disabled: '@',
|
|
79
|
-
active: '<',
|
|
80
|
-
error: '@',
|
|
81
|
-
empty: '<',
|
|
82
|
-
clearable: '<',
|
|
83
|
-
borderless: '<',
|
|
84
|
-
multiline: '<'
|
|
85
|
-
});
|
|
86
|
-
_defineProperty(RingInputComponent, "template", `
|
|
84
|
+
static template = `
|
|
87
85
|
<div
|
|
88
86
|
data-test="ring-input-container"
|
|
89
87
|
ng-class="$ctrl.getContainerClasses()"
|
|
@@ -138,7 +136,8 @@ _defineProperty(RingInputComponent, "template", `
|
|
|
138
136
|
|
|
139
137
|
<div ng-if="!$ctrl.borderless && $ctrl.error" class="${modules_88cfaf40.errorText} ${modules_c40fa551.errorText}">{{$ctrl.error}}</div>
|
|
140
138
|
</div>
|
|
141
|
-
|
|
139
|
+
`;
|
|
140
|
+
}
|
|
142
141
|
RingInputComponent.$inject = ['$element'];
|
|
143
142
|
angularModule.component('rgInput', RingInputComponent);
|
|
144
143
|
var InputNg = angularModule.name;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React, { createContext, Component } from 'react';
|
|
1
|
+
import React, { Component, createContext } from 'react';
|
|
3
2
|
import { interpolateLinear } from '../global/linear-function.js';
|
|
4
3
|
|
|
5
4
|
const TITLE_RESIZE_END = 20;
|
|
@@ -7,28 +6,25 @@ const TITLE_RESIZE_THRESHOLD = 36;
|
|
|
7
6
|
const PhaseContext = /*#__PURE__*/createContext(null);
|
|
8
7
|
const ScrollHandlerContext = /*#__PURE__*/createContext(null);
|
|
9
8
|
function adaptiveIslandHOC(ComposedComponent) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
9
|
+
return class AdaptiveIsland extends Component {
|
|
10
|
+
static propTypes = ComposedComponent.propTypes;
|
|
11
|
+
state = {
|
|
12
|
+
phase: null
|
|
13
|
+
};
|
|
14
|
+
onContentScroll = _ref => {
|
|
15
|
+
var _this$state$phase;
|
|
16
|
+
let {
|
|
17
|
+
scrollTop,
|
|
18
|
+
scrollHeight,
|
|
19
|
+
clientHeight
|
|
20
|
+
} = _ref;
|
|
21
|
+
if (scrollHeight - clientHeight >= interpolateLinear(TITLE_RESIZE_THRESHOLD, TITLE_RESIZE_END, (_this$state$phase = this.state.phase) !== null && _this$state$phase !== void 0 ? _this$state$phase : 0)) {
|
|
22
|
+
const phase = Math.min(1, scrollTop / TITLE_RESIZE_END);
|
|
23
|
+
this.setState({
|
|
24
|
+
phase
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
32
28
|
render() {
|
|
33
29
|
return /*#__PURE__*/React.createElement(PhaseContext.Provider, {
|
|
34
30
|
value: this.state.phase
|
|
@@ -36,7 +32,7 @@ function adaptiveIslandHOC(ComposedComponent) {
|
|
|
36
32
|
value: this.onContentScroll
|
|
37
33
|
}, /*#__PURE__*/React.createElement(ComposedComponent, this.props)));
|
|
38
34
|
}
|
|
39
|
-
}
|
|
35
|
+
};
|
|
40
36
|
}
|
|
41
37
|
|
|
42
38
|
export { PhaseContext, ScrollHandlerContext, adaptiveIslandHOC as default };
|