@jetbrains/ring-ui 4.1.0-beta.3 → 4.1.1
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/CHANGELOG.md +13 -0
- package/README.md +17 -15
- package/babel.config.js +3 -2
- package/components/alert/alert.js +9 -3
- package/components/alert/alert.test.js +21 -48
- package/components/alert/container.css +1 -1
- package/components/alert/container.test.js +3 -13
- package/components/alert-service/alert-service.examples.css +18 -0
- package/components/alert-service/alert-service.examples.js +21 -0
- package/components/alert-service/alert-service.js +10 -3
- package/components/analytics/analytics__fus-plugin.js +3 -3
- package/components/analytics/analytics__ga-plugin.js +2 -2
- package/components/auth/auth.test.js +14 -7
- package/components/auth/auth__core.js +64 -33
- package/components/auth-dialog/auth-dialog.css +2 -3
- package/components/auth-dialog/auth-dialog.js +4 -1
- package/components/auth-dialog/auth-dialog.test.js +3 -19
- package/components/avatar/avatar.css +4 -1
- package/components/avatar/avatar.examples.js +3 -2
- package/components/avatar/avatar.js +34 -6
- package/components/avatar/avatar.test.js +20 -17
- package/components/avatar/fallback-avatar.js +136 -0
- package/components/avatar-editor-ng/avatar-editor-ng.css +2 -2
- package/components/avatar-editor-ng/avatar-editor-ng.js +2 -1
- package/components/avatar-editor-ng/{avatar-editor-ng.html → avatar-editor-ng__template.js} +2 -2
- package/components/badge/badge.test.js +13 -20
- package/components/button/button.css +2 -2
- package/components/button/button.js +4 -1
- package/components/button/button.test.js +32 -33
- package/components/button-group/button-group.js +1 -1
- package/components/button-group/caption.js +1 -1
- package/components/button-ng/button-ng.js +1 -1
- package/components/button-set-ng/button-set-ng.js +3 -1
- package/components/checkbox/checkbox.css +1 -1
- package/components/code/code.js +2 -5
- package/components/confirm/confirm.js +1 -0
- package/components/confirm-service/confirm-service.js +5 -5
- package/components/content-layout/content-layout.css +1 -1
- package/components/data-list/data-list.css +1 -1
- package/components/date-picker/date-input.js +5 -4
- package/components/date-picker/date-picker.css +34 -22
- package/components/date-picker/date-picker.js +16 -14
- package/components/date-picker/date-popup.js +22 -7
- package/components/date-picker/month-names.js +8 -5
- package/components/date-picker/month.js +6 -2
- package/components/date-picker/weekdays.js +10 -2
- package/components/dialog/dialog.examples.js +3 -1
- package/components/dialog/dialog.js +10 -5
- package/components/dialog/dialog.test.js +1 -1
- package/components/dialog/dialog__body-scroll-preventer.js +51 -31
- package/components/dialog-ng/dialog-ng.js +10 -10
- package/components/dialog-ng/{dialog-ng.html → dialog-ng__template.js} +2 -2
- package/components/dropdown/dropdown.examples.js +36 -1
- package/components/dropdown/dropdown.test.js +2 -2
- package/components/dropdown-menu/dropdown-menu.examples.js +47 -0
- package/components/dropdown-menu/dropdown-menu.js +117 -0
- package/components/dropdown-menu/dropdown-menu.test.js +76 -0
- package/components/error-bubble/error-bubble-legacy.css +1 -1
- package/components/error-bubble/error-bubble.css +1 -1
- package/components/error-bubble/error-bubble.examples.js +1 -1
- package/components/error-page/error-page.css +2 -2
- package/components/footer-ng/footer-ng.js +13 -3
- package/components/form/form.css +2 -2
- package/components/form-ng/form-ng.js +3 -1
- package/components/global/global.css +1 -1
- package/components/global/theme.js +1 -1
- package/components/global/variables.css +8 -1
- package/components/grid/grid.css +10 -9
- package/components/header/header.css +1 -1
- package/components/header/header.examples.js +7 -8
- package/components/header/profile.js +10 -11
- package/components/http/http.js +1 -1
- package/components/icon/icon.css +5 -4
- package/components/input/input-legacy.css +7 -7
- package/components/island/header.js +2 -2
- package/components/island/island.css +8 -3
- package/components/island-legacy/island-legacy.css +3 -1
- package/components/list/list.js +6 -1
- package/components/list/list__custom.js +9 -3
- package/components/list/list__item.js +8 -2
- package/components/list/list__link.js +2 -1
- package/components/loader-inline/loader-inline.css +1 -1
- package/components/loader-screen/loader-screen.css +1 -1
- package/components/message/message.css +1 -1
- package/components/message/message.examples.js +8 -7
- package/components/pager/pager.js +5 -3
- package/components/permissions/permissions.js +1 -1
- package/components/popup/popup.js +1 -1
- package/components/popup/popup.test.js +15 -13
- package/components/progress-bar/progress-bar.css +1 -1
- package/components/progress-bar/progress-bar.examples.js +3 -3
- package/components/progress-bar/progress-bar.js +5 -2
- package/components/progress-bar/progress-bar.test.js +12 -13
- package/components/progress-bar-ng/progress-bar-ng.examples.js +3 -3
- package/components/query-assist/query-assist.css +13 -3
- package/components/query-assist/query-assist.examples.js +3 -4
- package/components/query-assist/query-assist.js +56 -12
- package/components/query-assist/query-assist.test.js +37 -5
- package/components/save-field-ng/save-field-ng.css +0 -3
- package/components/save-field-ng/save-field-ng.js +3 -1
- package/components/save-field-ng/{save-field-ng.html → save-field-ng__template.js} +2 -2
- package/components/select/select.css +12 -7
- package/components/select/select.examples.js +13 -0
- package/components/select/select.js +30 -43
- package/components/select/select.test.js +4 -5
- package/components/select/select__popup.js +1 -0
- package/components/shortcuts-hint-ng/shortcuts-hint-ng.css +1 -1
- package/components/shortcuts-hint-ng/shortcuts-hint-ng.js +1 -1
- package/components/shortcuts-hint-ng/{shortcuts-hint-ng.html → shortcuts-hint-ng__template.js} +2 -2
- package/components/sidebar/sidebar.css +1 -0
- package/components/sidebar-ng/sidebar-ng.js +6 -2
- package/components/sidebar-ng/{sidebar-ng__button.html → sidebar-ng__button-template.js} +2 -2
- package/components/sidebar-ng/{sidebar-ng.html → sidebar-ng__template.js} +2 -2
- package/components/table/header.js +9 -1
- package/components/table/row.js +2 -1
- package/components/table/table.css +2 -1
- package/components/table-legacy/table-legacy.css +2 -2
- package/components/table-legacy/table-legacy__toolbar.css +2 -2
- package/components/table-legacy-ng/table-legacy-ng.js +38 -5
- package/components/table-legacy-ng/table-legacy-ng__pager.js +7 -1
- package/components/tabs/collapsible-tab.js +2 -2
- package/components/tabs/collapsible-tabs.js +5 -9
- package/components/tabs/tab-link.js +4 -2
- package/components/tabs/tabs.css +32 -5
- package/components/tabs-ng/tabs-ng.js +4 -2
- package/components/tabs-ng/{tabs-ng.html → tabs-ng__template.js} +6 -2
- package/components/tag/tag.css +5 -2
- package/components/tag/tag.examples.js +3 -0
- package/components/tag/tag.js +19 -16
- package/components/tags-input/tag-input.examples.js +1 -1
- package/components/tags-input/tags-input.js +5 -2
- package/components/template-ng/template-ng.js +1 -1
- package/components/tooltip/tooltip.js +7 -2
- package/components/user-agreement/user-agreement.css +1 -5
- package/components/user-agreement/user-agreement.examples.js +7 -6
- package/components/user-agreement/user-agreement.js +11 -3
- package/package.json +85 -83
- package/webpack.config.js +14 -10
- package/components/button-set-ng/button-set-ng.html +0 -1
- package/components/footer-ng/footer-ng.html +0 -13
- package/components/form-ng/form-ng__error-bubble.html +0 -3
- package/components/table-legacy-ng/table-legacy-ng.html +0 -4
- package/components/table-legacy-ng/table-legacy-ng__column.html +0 -12
- package/components/table-legacy-ng/table-legacy-ng__header.html +0 -4
- package/components/table-legacy-ng/table-legacy-ng__pager.html +0 -7
- package/components/table-legacy-ng/table-legacy-ng__row.html +0 -12
- package/components/table-legacy-ng/table-legacy-ng__title.html +0 -9
- package/dist/_helpers/_rollupPluginBabelHelpers.js +0 -123
- package/dist/_helpers/background-flow.js +0 -232
- package/dist/_helpers/badge.js +0 -3
- package/dist/_helpers/button.js +0 -145
- package/dist/_helpers/clickableLink.js +0 -65
- package/dist/_helpers/data-tests.js +0 -15
- package/dist/_helpers/disable-hover-hoc.js +0 -407
- package/dist/_helpers/dom.js +0 -101
- package/dist/_helpers/get-uid.js +0 -15
- package/dist/_helpers/linear-function.js +0 -17
- package/dist/_helpers/list.js +0 -1327
- package/dist/_helpers/logo.js +0 -36
- package/dist/_helpers/memoize.js +0 -17
- package/dist/_helpers/popup.js +0 -691
- package/dist/_helpers/popup.target.js +0 -27
- package/dist/_helpers/rerender-hoc.js +0 -49
- package/dist/_helpers/schedule-raf.js +0 -31
- package/dist/_helpers/sniffer.js +0 -6
- package/dist/_helpers/theme.js +0 -40
- package/dist/_helpers/url.js +0 -125
- package/dist/alert-service.js +0 -149
- package/dist/alert.js +0 -284
- package/dist/analytics.js +0 -116
- package/dist/auth-dialog-service.js +0 -56
- package/dist/auth-dialog.js +0 -122
- package/dist/auth.js +0 -1744
- package/dist/avatar.js +0 -152
- package/dist/badge.js +0 -52
- package/dist/button-group.js +0 -48
- package/dist/button-set.js +0 -27
- package/dist/button-toolbar.js +0 -30
- package/dist/button.js +0 -12
- package/dist/caret.js +0 -262
- package/dist/checkbox.js +0 -108
- package/dist/confirm-service.js +0 -102
- package/dist/confirm.js +0 -113
- package/dist/content-layout.js +0 -184
- package/dist/contenteditable.js +0 -81
- package/dist/data-list.js +0 -466
- package/dist/date-picker.js +0 -1398
- package/dist/dialog.js +0 -223
- package/dist/dropdown.js +0 -250
- package/dist/error-bubble.js +0 -56
- package/dist/error-message.js +0 -53
- package/dist/footer.js +0 -124
- package/dist/grid.js +0 -148
- package/dist/group.js +0 -34
- package/dist/header.js +0 -658
- package/dist/heading.js +0 -76
- package/dist/http.js +0 -207
- package/dist/hub-source.js +0 -130
- package/dist/icon.js +0 -211
- package/dist/input.js +0 -228
- package/dist/island.js +0 -314
- package/dist/link.js +0 -117
- package/dist/list.js +0 -29
- package/dist/loader-inline.js +0 -165
- package/dist/loader-screen.js +0 -45
- package/dist/loader.js +0 -338
- package/dist/login-dialog.js +0 -173
- package/dist/logo.js +0 -8
- package/dist/message.js +0 -226
- package/dist/old-browsers-message.js +0 -129
- package/dist/pager.js +0 -325
- package/dist/panel.js +0 -34
- package/dist/permissions.js +0 -466
- package/dist/popup-menu.js +0 -93
- package/dist/popup.js +0 -16
- package/dist/progress-bar.js +0 -111
- package/dist/proxy-attrs.js +0 -19
- package/dist/query-assist.js +0 -1081
- package/dist/radio.js +0 -112
- package/dist/select.js +0 -1920
- package/dist/selection.js +0 -213
- package/dist/shortcuts.js +0 -307
- package/dist/storage.js +0 -373
- package/dist/style.css +0 -1
- package/dist/tab-trap.js +0 -174
- package/dist/table.js +0 -903
- package/dist/tabs.js +0 -721
- package/dist/tag.js +0 -187
- package/dist/tags-input.js +0 -440
- package/dist/tags-list.js +0 -91
- package/dist/text.js +0 -38
- package/dist/toggle.js +0 -80
- package/dist/tooltip.js +0 -202
- package/dist/user-card.js +0 -218
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<tr ng-click="rowCtrl.setActiveItem(rowCtrl.rowItem)"
|
|
2
|
-
ng-mouseover="rowCtrl.onMouseOver(rowCtrl.rowItem)"
|
|
3
|
-
ng-mouseout="rowCtrl.onMouseOut(rowCtrl.rowItem)"
|
|
4
|
-
class="ring-table__row" ng-class="{
|
|
5
|
-
'ring-table__row_active': rowCtrl.rowItem.active,
|
|
6
|
-
'ring-table__row_checked': rowCtrl.rowItem.checked,
|
|
7
|
-
'ring-table__row_active-checked': rowCtrl.rowItem.active && !rowCtrl.hasCheckedItems(),
|
|
8
|
-
'ring-table__row_implicit': rowCtrl.rowItem.implicit,
|
|
9
|
-
'ring-table__row_expanded': rowCtrl.rowItem.expanded,
|
|
10
|
-
'ring-table__row_unselectable': rowCtrl.rowItem.unselectable
|
|
11
|
-
}" ng-transclude>
|
|
12
|
-
</tr>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<th class="ring-table__title"
|
|
2
|
-
ng-class="{
|
|
3
|
-
'ring-table__title_border': isBorder,
|
|
4
|
-
'ring-table__title_active': isActive,
|
|
5
|
-
'ring-table__column_snuggle-right': isPullRight,
|
|
6
|
-
'ring-table__column_snuggle-left': isPullLeft,
|
|
7
|
-
'ring-table__column_align-right' : isAlignRight
|
|
8
|
-
}" ng-transclude>
|
|
9
|
-
</th>
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) {
|
|
2
|
-
if (key in obj) {
|
|
3
|
-
Object.defineProperty(obj, key, {
|
|
4
|
-
value: value,
|
|
5
|
-
enumerable: true,
|
|
6
|
-
configurable: true,
|
|
7
|
-
writable: true
|
|
8
|
-
});
|
|
9
|
-
} else {
|
|
10
|
-
obj[key] = value;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return obj;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function _extends() {
|
|
17
|
-
_extends = Object.assign || function (target) {
|
|
18
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
19
|
-
var source = arguments[i];
|
|
20
|
-
|
|
21
|
-
for (var key in source) {
|
|
22
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
23
|
-
target[key] = source[key];
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return target;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
return _extends.apply(this, arguments);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function ownKeys(object, enumerableOnly) {
|
|
35
|
-
var keys = Object.keys(object);
|
|
36
|
-
|
|
37
|
-
if (Object.getOwnPropertySymbols) {
|
|
38
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
39
|
-
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
|
40
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
41
|
-
});
|
|
42
|
-
keys.push.apply(keys, symbols);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return keys;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function _objectSpread2(target) {
|
|
49
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
50
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
51
|
-
|
|
52
|
-
if (i % 2) {
|
|
53
|
-
ownKeys(Object(source), true).forEach(function (key) {
|
|
54
|
-
_defineProperty(target, key, source[key]);
|
|
55
|
-
});
|
|
56
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
57
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
58
|
-
} else {
|
|
59
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
60
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return target;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
69
|
-
if (source == null) return {};
|
|
70
|
-
var target = {};
|
|
71
|
-
var sourceKeys = Object.keys(source);
|
|
72
|
-
var key, i;
|
|
73
|
-
|
|
74
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
75
|
-
key = sourceKeys[i];
|
|
76
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
77
|
-
target[key] = source[key];
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return target;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function _objectWithoutProperties(source, excluded) {
|
|
84
|
-
if (source == null) return {};
|
|
85
|
-
|
|
86
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
87
|
-
|
|
88
|
-
var key, i;
|
|
89
|
-
|
|
90
|
-
if (Object.getOwnPropertySymbols) {
|
|
91
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
92
|
-
|
|
93
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
94
|
-
key = sourceSymbolKeys[i];
|
|
95
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
96
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
97
|
-
target[key] = source[key];
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return target;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function _toPrimitive(input, hint) {
|
|
105
|
-
if (typeof input !== "object" || input === null) return input;
|
|
106
|
-
var prim = input[Symbol.toPrimitive];
|
|
107
|
-
|
|
108
|
-
if (prim !== undefined) {
|
|
109
|
-
var res = prim.call(input, hint || "default");
|
|
110
|
-
if (typeof res !== "object") return res;
|
|
111
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return (hint === "string" ? String : Number)(input);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function _toPropertyKey(arg) {
|
|
118
|
-
var key = _toPrimitive(arg, "string");
|
|
119
|
-
|
|
120
|
-
return typeof key === "symbol" ? key : String(key);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export { _objectWithoutProperties as _, _extends as a, _defineProperty as b, _objectSpread2 as c, _toPropertyKey as d };
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
import { b as _defineProperty } from './_rollupPluginBabelHelpers.js';
|
|
2
|
-
import ExtendableError from 'es6-error';
|
|
3
|
-
import { p as parseQueryString } from './url.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @typedef {Object} AuthResponse
|
|
7
|
-
* @property {?string} accessToken
|
|
8
|
-
* @property {?string} state
|
|
9
|
-
* @property {?string} token_type
|
|
10
|
-
* @property {?string} expiresIn
|
|
11
|
-
* @property {?string} scope
|
|
12
|
-
* @property {?string} error
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
class AuthResponseParser {
|
|
16
|
-
constructor() {
|
|
17
|
-
this._authResponse = this.readAuthResponseFromURL();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
static convertKey(key) {
|
|
21
|
-
return key.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Check if the hash contains an access token.
|
|
25
|
-
* If it does, return auth response. Otherwise return undefined.
|
|
26
|
-
* Always clears the hash part of the URL.
|
|
27
|
-
*
|
|
28
|
-
* @throws {Error} if the auth server returned an error
|
|
29
|
-
* @return {?AuthResponse}
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
getAuthResponseFromURL() {
|
|
34
|
-
return this.validateAuthResponse(this._authResponse);
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Validates given authResponse.
|
|
38
|
-
* If it contains a token - returns the token, if an error is found - throws the error,
|
|
39
|
-
* otherwise - null
|
|
40
|
-
* Always clears the hash part of the URL.
|
|
41
|
-
*
|
|
42
|
-
* @param authResponse {AuthResponse} parsed authResponse
|
|
43
|
-
* @throws {Error} if the auth server returned an error
|
|
44
|
-
* @return {?AuthResponse}
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
validateAuthResponse(authResponse) {
|
|
49
|
-
// Check for errors
|
|
50
|
-
if (authResponse.error) {
|
|
51
|
-
throw new AuthResponseParser.AuthError(authResponse);
|
|
52
|
-
} // If there is no token in the hash
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (!authResponse.accessToken) {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return authResponse;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Reads the current accessToken from the URL.
|
|
63
|
-
* Doesn't modify URL
|
|
64
|
-
*
|
|
65
|
-
* @return {AuthResponse}
|
|
66
|
-
*/
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
readAuthResponseFromURL() {
|
|
70
|
-
const authResponse = {};
|
|
71
|
-
const rawAuthResponse = parseQueryString(this.getHash());
|
|
72
|
-
Object.keys(rawAuthResponse).forEach(key => {
|
|
73
|
-
if (key.indexOf('_') !== -1) {
|
|
74
|
-
authResponse[AuthResponseParser.convertKey(key)] = rawAuthResponse[key];
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
authResponse[key] = rawAuthResponse[key];
|
|
79
|
-
});
|
|
80
|
-
return authResponse;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* @return {string} part of the URL after # sign.
|
|
84
|
-
* @private
|
|
85
|
-
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
getHash() {
|
|
89
|
-
// Because of stupid Firefox bug — https://bugzilla.mozilla.org/show_bug.cgi?id=483304
|
|
90
|
-
const location = this.getLocation();
|
|
91
|
-
return location && location.replace(/^[^#]*#?/, '');
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Current page location.
|
|
95
|
-
* @return {string}
|
|
96
|
-
*/
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
getLocation() {
|
|
100
|
-
return window.location.toString();
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
_defineProperty(AuthResponseParser, "AuthError", class AuthError extends ExtendableError {
|
|
106
|
-
// Supports weird IE 11 failing test issue
|
|
107
|
-
constructor(authResponse = {}) {
|
|
108
|
-
super(authResponse.errorDescription);
|
|
109
|
-
this.code = authResponse.error;
|
|
110
|
-
this.uri = authResponse.errorUri;
|
|
111
|
-
this.stateId = authResponse.state;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
const HUB_AUTH_PAGE_OPENED = 'HUB_AUTH_PAGE_OPENED';
|
|
117
|
-
class BackgroundFlow {
|
|
118
|
-
constructor(requestBuilder, storage, timeout) {
|
|
119
|
-
this._requestBuilder = requestBuilder;
|
|
120
|
-
this._storage = storage;
|
|
121
|
-
this._timeout = timeout;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Creates a hidden iframe
|
|
125
|
-
* @return {HTMLIFrameElement}
|
|
126
|
-
* @private
|
|
127
|
-
*/
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
_createHiddenFrame() {
|
|
131
|
-
const iframe = document.createElement('iframe');
|
|
132
|
-
iframe.style.border = iframe.style.width = iframe.style.height = '0px';
|
|
133
|
-
iframe.style.visibility = 'hidden';
|
|
134
|
-
iframe.style.position = 'fixed';
|
|
135
|
-
iframe.style.left = '-10000px';
|
|
136
|
-
window.document.body.appendChild(iframe);
|
|
137
|
-
return iframe;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Redirects the given iframe to the given URL
|
|
141
|
-
* @param {HTMLIFrameElement} iframe
|
|
142
|
-
* @param {string} url
|
|
143
|
-
* @private
|
|
144
|
-
*/
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
_redirectFrame(iframe, url) {
|
|
148
|
-
iframe.src = `${url}&rnd=${Math.random()}`;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Refreshes the access token in an iframe.
|
|
152
|
-
*
|
|
153
|
-
* @return {Promise.<string>} promise that is resolved to access the token when it is loaded in a background iframe. The
|
|
154
|
-
* promise is rejected if no token was received after {@link BackgroundToken.BACKGROUND_TIMEOUT} ms.
|
|
155
|
-
*/
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
async _load() {
|
|
159
|
-
const authRequest = await this._requestBuilder. // eslint-disable-next-line camelcase
|
|
160
|
-
prepareAuthRequest({
|
|
161
|
-
request_credentials: 'silent'
|
|
162
|
-
}, {
|
|
163
|
-
nonRedirect: true
|
|
164
|
-
});
|
|
165
|
-
return new Promise((resolve, reject) => {
|
|
166
|
-
function onMessage(e) {
|
|
167
|
-
if (e.data === HUB_AUTH_PAGE_OPENED) {
|
|
168
|
-
reject(new Error('Failed to obtain/refresh token in background'));
|
|
169
|
-
cleanUp();
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
window.addEventListener('message', onMessage);
|
|
174
|
-
|
|
175
|
-
const iframe = this._createHiddenFrame();
|
|
176
|
-
|
|
177
|
-
let cleanRun;
|
|
178
|
-
const timeout = setTimeout(() => {
|
|
179
|
-
reject(new Error('Failed to refresh authorization'));
|
|
180
|
-
cleanUp();
|
|
181
|
-
}, this._timeout);
|
|
182
|
-
|
|
183
|
-
const removeTokenListener = this._storage.onTokenChange(token => {
|
|
184
|
-
if (token) {
|
|
185
|
-
cleanUp();
|
|
186
|
-
resolve(token.accessToken);
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
const removeStateListener = this._storage.onStateChange(authRequest.stateId, state => {
|
|
191
|
-
if (state && state.error) {
|
|
192
|
-
cleanUp();
|
|
193
|
-
reject(new AuthResponseParser.AuthError(state));
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
function cleanUp() {
|
|
198
|
-
if (cleanRun) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
cleanRun = true;
|
|
203
|
-
clearTimeout(timeout);
|
|
204
|
-
removeStateListener();
|
|
205
|
-
removeTokenListener();
|
|
206
|
-
window.removeEventListener('message', onMessage);
|
|
207
|
-
window.document.body.removeChild(iframe);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
this._redirectFrame(iframe, authRequest.url);
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
authorize() {
|
|
215
|
-
if (this._promise) {
|
|
216
|
-
return this._promise;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
const resetPromise = () => {
|
|
220
|
-
this._promise = null;
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
this._promise = this._load();
|
|
224
|
-
|
|
225
|
-
this._promise.then(resetPromise, resetPromise);
|
|
226
|
-
|
|
227
|
-
return this._promise;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export { AuthResponseParser as A, BackgroundFlow as B, HUB_AUTH_PAGE_OPENED as H };
|
package/dist/_helpers/badge.js
DELETED
package/dist/_helpers/button.js
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { _ as _objectWithoutProperties, a as _extends, b as _defineProperty } from './_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'focus-visible';
|
|
3
|
-
import React, { PureComponent } from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import classNames from 'classnames';
|
|
6
|
-
import chevronDown from '@jetbrains/icons/chevron-10px';
|
|
7
|
-
import Icon, { Size } from '../icon.js';
|
|
8
|
-
import { T as Theme, w as withTheme } from './theme.js';
|
|
9
|
-
import { C as ClickableLink } from './clickableLink.js';
|
|
10
|
-
|
|
11
|
-
var modules_e81895c9 = {"unit":"8px","button-shadow":"inset 0 0 0 1px","height":"24px","loaderWidth":"64px","danger":"button_danger__d4d7e4da","light":"button_light__d4d7e4da","active":"button_active__d4d7e4da buttonGroup_active__e33e6cf7","withIcon":"button_withIcon__d4d7e4da","icon":"button_icon__d4d7e4da","primary":"button_primary__d4d7e4da","loaderBackground":"button_loaderBackground__d4d7e4da","dark":"button_dark__d4d7e4da","dropdownIcon":"button_dropdownIcon__d4d7e4da","button":"button_button__d4d7e4da buttonGroup_button__e33e6cf7 buttonSet_button__40c7f807 buttonToolbar_button__ec743009","loader":"button_loader__d4d7e4da","text":"button_text__d4d7e4da","content":"button_content__d4d7e4da","text-loading":"button_textLoading__d4d7e4da","inline":"button_inline__d4d7e4da","withNormalIconLight":"button_withNormalIconLight__d4d7e4da","withNormalIconDark":"button_withNormalIconDark__d4d7e4da","withDangerIconLight":"button_withDangerIconLight__d4d7e4da","withDangerIconDark":"button_withDangerIconDark__d4d7e4da","progress":"button_progress__d4d7e4da","delayed":"button_delayed__d4d7e4da","short":"button_short__d4d7e4da"};
|
|
12
|
-
|
|
13
|
-
function getButtonClasses({
|
|
14
|
-
className,
|
|
15
|
-
active,
|
|
16
|
-
disabled,
|
|
17
|
-
loader,
|
|
18
|
-
primary,
|
|
19
|
-
short,
|
|
20
|
-
text,
|
|
21
|
-
inline,
|
|
22
|
-
danger,
|
|
23
|
-
delayed,
|
|
24
|
-
icon,
|
|
25
|
-
theme
|
|
26
|
-
}) {
|
|
27
|
-
const withNormalIcon = icon && !active && !danger && !primary && !disabled;
|
|
28
|
-
return classNames(modules_e81895c9.button, className, modules_e81895c9[theme], {
|
|
29
|
-
[modules_e81895c9.active]: active,
|
|
30
|
-
[modules_e81895c9.danger]: danger,
|
|
31
|
-
[modules_e81895c9.delayed]: delayed,
|
|
32
|
-
[modules_e81895c9.withIcon]: icon,
|
|
33
|
-
[modules_e81895c9.withNormalIconLight]: withNormalIcon && theme === Theme.LIGHT,
|
|
34
|
-
[modules_e81895c9.withNormalIconDark]: withNormalIcon && theme === Theme.DARK,
|
|
35
|
-
[modules_e81895c9.withDangerIconLight]: icon && danger && theme === Theme.LIGHT,
|
|
36
|
-
[modules_e81895c9.withDangerIconDark]: icon && danger && theme === Theme.DARK,
|
|
37
|
-
[modules_e81895c9.loader]: loader && !icon,
|
|
38
|
-
[modules_e81895c9.primary]: primary,
|
|
39
|
-
[modules_e81895c9.short]: short,
|
|
40
|
-
[modules_e81895c9.text]: text,
|
|
41
|
-
[modules_e81895c9.inline]: inline
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* @name Button
|
|
47
|
-
*/
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* A component for displaying variously styled buttons.
|
|
51
|
-
*/
|
|
52
|
-
|
|
53
|
-
class Button extends PureComponent {
|
|
54
|
-
render() {
|
|
55
|
-
const _this$props = this.props,
|
|
56
|
-
{
|
|
57
|
-
// Modifiers
|
|
58
|
-
theme,
|
|
59
|
-
active,
|
|
60
|
-
danger,
|
|
61
|
-
delayed,
|
|
62
|
-
loader,
|
|
63
|
-
primary,
|
|
64
|
-
short,
|
|
65
|
-
text,
|
|
66
|
-
inline,
|
|
67
|
-
dropdown,
|
|
68
|
-
// Props
|
|
69
|
-
icon,
|
|
70
|
-
iconSize,
|
|
71
|
-
iconClassName,
|
|
72
|
-
iconSuppressSizeWarning,
|
|
73
|
-
className,
|
|
74
|
-
children
|
|
75
|
-
} = _this$props,
|
|
76
|
-
props = _objectWithoutProperties(_this$props, ["theme", "active", "danger", "delayed", "loader", "primary", "short", "text", "inline", "dropdown", "icon", "iconSize", "iconClassName", "iconSuppressSizeWarning", "className", "children"]);
|
|
77
|
-
|
|
78
|
-
const classes = getButtonClasses({
|
|
79
|
-
className,
|
|
80
|
-
active,
|
|
81
|
-
danger,
|
|
82
|
-
delayed,
|
|
83
|
-
icon,
|
|
84
|
-
theme,
|
|
85
|
-
loader,
|
|
86
|
-
primary,
|
|
87
|
-
short,
|
|
88
|
-
text,
|
|
89
|
-
inline
|
|
90
|
-
});
|
|
91
|
-
const content = /*#__PURE__*/React.createElement("span", {
|
|
92
|
-
className: modules_e81895c9.content
|
|
93
|
-
}, icon && /*#__PURE__*/React.createElement("span", {
|
|
94
|
-
className: classNames(modules_e81895c9.icon, iconClassName)
|
|
95
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
96
|
-
glyph: icon,
|
|
97
|
-
size: iconSize,
|
|
98
|
-
loading: loader,
|
|
99
|
-
suppressSizeWarning: iconSuppressSizeWarning
|
|
100
|
-
})), children && /*#__PURE__*/React.createElement("span", null, children), dropdown && /*#__PURE__*/React.createElement(Icon, {
|
|
101
|
-
glyph: chevronDown,
|
|
102
|
-
className: modules_e81895c9.dropdownIcon
|
|
103
|
-
}));
|
|
104
|
-
const isLink = !!props.href;
|
|
105
|
-
const Tag = isLink ? ClickableLink : 'button';
|
|
106
|
-
return /*#__PURE__*/React.createElement(Tag, _extends({
|
|
107
|
-
tabIndex: loader ? -1 : 0,
|
|
108
|
-
type: isLink ? null : 'button'
|
|
109
|
-
}, props, {
|
|
110
|
-
className: classes
|
|
111
|
-
}), loader && !text && !icon && /*#__PURE__*/React.createElement("div", {
|
|
112
|
-
className: modules_e81895c9.loaderBackground
|
|
113
|
-
}), content);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
_defineProperty(Button, "propTypes", {
|
|
119
|
-
theme: PropTypes.oneOf(['light', 'dark']),
|
|
120
|
-
active: PropTypes.bool,
|
|
121
|
-
danger: PropTypes.bool,
|
|
122
|
-
delayed: PropTypes.bool,
|
|
123
|
-
loader: PropTypes.bool,
|
|
124
|
-
primary: PropTypes.bool,
|
|
125
|
-
short: PropTypes.bool,
|
|
126
|
-
text: PropTypes.bool,
|
|
127
|
-
inline: PropTypes.bool,
|
|
128
|
-
dropdown: PropTypes.bool,
|
|
129
|
-
href: PropTypes.string,
|
|
130
|
-
target: PropTypes.string,
|
|
131
|
-
icon: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]),
|
|
132
|
-
iconSize: PropTypes.number,
|
|
133
|
-
iconClassName: PropTypes.string,
|
|
134
|
-
iconSuppressSizeWarning: PropTypes.bool,
|
|
135
|
-
className: PropTypes.string,
|
|
136
|
-
children: PropTypes.node,
|
|
137
|
-
onClick: PropTypes.func
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
_defineProperty(Button, "IconSize", Size);
|
|
141
|
-
|
|
142
|
-
_defineProperty(Button, "Theme", Theme);
|
|
143
|
-
var Button$1 = withTheme()(Button);
|
|
144
|
-
|
|
145
|
-
export { Button$1 as B, modules_e81895c9 as m };
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { b as _defineProperty, _ as _objectWithoutProperties, a as _extends } from './_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { PureComponent } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
|
|
5
|
-
const LEFT_BUTTON = 0; // Cmd/Ctrl/Shift/Alt + Click should trigger default browser behaviour. Same applies to non-left clicks
|
|
6
|
-
|
|
7
|
-
const isPlainLeftClick = e => e.button === LEFT_BUTTON && !e.altKey && !e.ctrlKey && !e.metaKey && !e.shiftKey;
|
|
8
|
-
|
|
9
|
-
class ClickableLink extends PureComponent {
|
|
10
|
-
constructor(...args) {
|
|
11
|
-
super(...args);
|
|
12
|
-
|
|
13
|
-
_defineProperty(this, "onClick", e => {
|
|
14
|
-
const {
|
|
15
|
-
onClick,
|
|
16
|
-
onConditionalClick,
|
|
17
|
-
onPlainLeftClick
|
|
18
|
-
} = this.props;
|
|
19
|
-
const isPlainLeft = isPlainLeftClick(e);
|
|
20
|
-
|
|
21
|
-
if (onClick) {
|
|
22
|
-
onClick(e);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (onConditionalClick) {
|
|
26
|
-
onConditionalClick(isPlainLeft, e);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (onPlainLeftClick && isPlainLeft) {
|
|
30
|
-
e.preventDefault();
|
|
31
|
-
onPlainLeftClick(e);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
render() {
|
|
37
|
-
const _this$props = this.props,
|
|
38
|
-
{
|
|
39
|
-
onConditionalClick,
|
|
40
|
-
onPlainLeftClick,
|
|
41
|
-
activeClassName,
|
|
42
|
-
href,
|
|
43
|
-
children
|
|
44
|
-
} = _this$props,
|
|
45
|
-
restProps = _objectWithoutProperties(_this$props, ["onConditionalClick", "onPlainLeftClick", "activeClassName", "href", "children"]);
|
|
46
|
-
|
|
47
|
-
return /*#__PURE__*/React.createElement("a", _extends({
|
|
48
|
-
href: href
|
|
49
|
-
}, restProps, {
|
|
50
|
-
onClick: this.onClick
|
|
51
|
-
}), children);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
_defineProperty(ClickableLink, "propTypes", {
|
|
57
|
-
onClick: PropTypes.func,
|
|
58
|
-
onPlainLeftClick: PropTypes.func,
|
|
59
|
-
onConditionalClick: PropTypes.func,
|
|
60
|
-
activeClassName: PropTypes.string,
|
|
61
|
-
href: PropTypes.string.isRequired,
|
|
62
|
-
children: PropTypes.node.isRequired
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
export { ClickableLink as C };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
function expandMap(attrsMap) {
|
|
2
|
-
return Object.entries(attrsMap).reduce((result, [key, value]) => value ? [...result, key] : result, []);
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
function joinDataTestAttributes(...attrs) {
|
|
6
|
-
return attrs.filter(attr => !!attr).reduce((result, attr) => {
|
|
7
|
-
if (typeof attr === 'object') {
|
|
8
|
-
return [...result, ...expandMap(attr)];
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
return [...result, attr];
|
|
12
|
-
}, []).join(' ');
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { joinDataTestAttributes as j };
|