@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
package/dist/text.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { _ as _objectWithoutProperties, a as _extends, b as _defineProperty } from './_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { Component } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import classNames from 'classnames';
|
|
5
|
-
|
|
6
|
-
var modules_78d1bce6 = {"text":"text_text__bc47c17b","info":"text_info__bc47c17b"};
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @name Text
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
class Text extends Component {
|
|
13
|
-
render() {
|
|
14
|
-
const _this$props = this.props,
|
|
15
|
-
{
|
|
16
|
-
children,
|
|
17
|
-
className,
|
|
18
|
-
info
|
|
19
|
-
} = _this$props,
|
|
20
|
-
restProps = _objectWithoutProperties(_this$props, ["children", "className", "info"]);
|
|
21
|
-
|
|
22
|
-
const classes = classNames(modules_78d1bce6.text, className, {
|
|
23
|
-
[modules_78d1bce6.info]: info
|
|
24
|
-
});
|
|
25
|
-
return /*#__PURE__*/React.createElement("span", _extends({
|
|
26
|
-
className: classes
|
|
27
|
-
}, restProps), children);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
_defineProperty(Text, "propTypes", {
|
|
33
|
-
children: PropTypes.node,
|
|
34
|
-
info: PropTypes.bool,
|
|
35
|
-
className: PropTypes.string
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
export default Text;
|
package/dist/toggle.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { _ as _objectWithoutProperties, a as _extends, b as _defineProperty } from './_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { PureComponent } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import classNames from 'classnames';
|
|
5
|
-
import { w as withTheme } from './_helpers/theme.js';
|
|
6
|
-
import { j as joinDataTestAttributes } from './_helpers/data-tests.js';
|
|
7
|
-
|
|
8
|
-
var modules_331c5aa7 = {"unit":"8px","padding":"2px","disabled-line-color":"hsla(0,0%,100%,.9)","duration":".3s","timing-function":"cubic-bezier(.23,1,.32,1)","toggle":"toggle_toggle__ca2e3a7a","switch":"toggle_switch__ca2e3a7a","disabled":"toggle_disabled__ca2e3a7a","label":"toggle_label__ca2e3a7a","leftLabel":"toggle_leftLabel__ca2e3a7a","light":"toggle_light__ca2e3a7a","dark":"toggle_dark__ca2e3a7a","switchWrapper":"toggle_switchWrapper__ca2e3a7a","input":"toggle_input__ca2e3a7a","size20":"toggle_size20__ca2e3a7a","paleSwitch":"toggle_paleSwitch__ca2e3a7a"};
|
|
9
|
-
|
|
10
|
-
const Size = {
|
|
11
|
-
Size16: modules_331c5aa7.size16,
|
|
12
|
-
Size20: modules_331c5aa7.size20
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* @name Toggle
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
class Toggle extends PureComponent {
|
|
19
|
-
render() {
|
|
20
|
-
const _this$props = this.props,
|
|
21
|
-
{
|
|
22
|
-
className,
|
|
23
|
-
children,
|
|
24
|
-
disabled,
|
|
25
|
-
pale,
|
|
26
|
-
title,
|
|
27
|
-
leftLabel,
|
|
28
|
-
theme,
|
|
29
|
-
size = Size.Size16,
|
|
30
|
-
'data-test': dataTest,
|
|
31
|
-
onTransitionEnd
|
|
32
|
-
} = _this$props,
|
|
33
|
-
restProps = _objectWithoutProperties(_this$props, ["className", "children", "disabled", "pale", "title", "leftLabel", "theme", "size", "data-test", "onTransitionEnd"]);
|
|
34
|
-
|
|
35
|
-
const classes = classNames(className, size, modules_331c5aa7.toggle, modules_331c5aa7[theme], disabled && modules_331c5aa7.disabled);
|
|
36
|
-
return /*#__PURE__*/React.createElement("label", {
|
|
37
|
-
className: classes,
|
|
38
|
-
title: title,
|
|
39
|
-
"data-test": joinDataTestAttributes('ring-toggle', dataTest)
|
|
40
|
-
}, leftLabel && /*#__PURE__*/React.createElement("span", {
|
|
41
|
-
className: modules_331c5aa7.leftLabel
|
|
42
|
-
}, leftLabel), /*#__PURE__*/React.createElement("span", {
|
|
43
|
-
className: modules_331c5aa7.switchWrapper
|
|
44
|
-
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
45
|
-
"data-test": "ring-toggle-input"
|
|
46
|
-
}, restProps, {
|
|
47
|
-
type: "checkbox",
|
|
48
|
-
disabled: disabled,
|
|
49
|
-
className: modules_331c5aa7.input
|
|
50
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
51
|
-
className: classNames(modules_331c5aa7.switch, pale && modules_331c5aa7.paleSwitch),
|
|
52
|
-
onTransitionEnd: onTransitionEnd
|
|
53
|
-
})), children && /*#__PURE__*/React.createElement("span", {
|
|
54
|
-
className: modules_331c5aa7.label
|
|
55
|
-
}, children));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
_defineProperty(Toggle, "propTypes", {
|
|
61
|
-
children: PropTypes.node,
|
|
62
|
-
name: PropTypes.string,
|
|
63
|
-
className: PropTypes.string,
|
|
64
|
-
title: PropTypes.string,
|
|
65
|
-
leftLabel: PropTypes.node,
|
|
66
|
-
defaultChecked: PropTypes.bool,
|
|
67
|
-
checked: PropTypes.bool,
|
|
68
|
-
disabled: PropTypes.bool,
|
|
69
|
-
pale: PropTypes.bool,
|
|
70
|
-
onChange: PropTypes.func,
|
|
71
|
-
onTransitionEnd: PropTypes.func,
|
|
72
|
-
theme: PropTypes.string,
|
|
73
|
-
size: PropTypes.oneOf(Object.values(Size)),
|
|
74
|
-
'data-test': PropTypes.string
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
var toggle = withTheme()(Toggle);
|
|
78
|
-
|
|
79
|
-
export default toggle;
|
|
80
|
-
export { Size };
|
package/dist/tooltip.js
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import { b as _defineProperty, _ as _objectWithoutProperties, a as _extends } from './_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { Component, createContext } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { P as Popup } from './_helpers/popup.js';
|
|
5
|
-
import { L as Listeners } from './_helpers/dom.js';
|
|
6
|
-
import { j as joinDataTestAttributes } from './_helpers/data-tests.js';
|
|
7
|
-
import { s as scheduleRAF } from './_helpers/schedule-raf.js';
|
|
8
|
-
import 'react-dom';
|
|
9
|
-
import 'classnames';
|
|
10
|
-
import './_helpers/get-uid.js';
|
|
11
|
-
import './shortcuts.js';
|
|
12
|
-
import 'combokeys';
|
|
13
|
-
import './_helpers/sniffer.js';
|
|
14
|
-
import 'sniffr';
|
|
15
|
-
import './tab-trap.js';
|
|
16
|
-
import './_helpers/popup.target.js';
|
|
17
|
-
|
|
18
|
-
var modules_cd5e45a9 = {"unit":"8px","tooltip":"tooltip_tooltip__b9231867"};
|
|
19
|
-
|
|
20
|
-
const scheduleScroll = scheduleRAF();
|
|
21
|
-
const TooltipContext = /*#__PURE__*/createContext();
|
|
22
|
-
/**
|
|
23
|
-
* @name Tooltip
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
class Tooltip extends Component {
|
|
27
|
-
constructor(...args) {
|
|
28
|
-
super(...args);
|
|
29
|
-
|
|
30
|
-
_defineProperty(this, "state", {
|
|
31
|
-
showPopup: false,
|
|
32
|
-
showNestedPopup: false
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
_defineProperty(this, "listeners", new Listeners());
|
|
36
|
-
|
|
37
|
-
_defineProperty(this, "containerRef", el => {
|
|
38
|
-
this.containerNode = el;
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
_defineProperty(this, "tryToShowPopup", () => {
|
|
42
|
-
const {
|
|
43
|
-
delay,
|
|
44
|
-
title
|
|
45
|
-
} = this.props;
|
|
46
|
-
|
|
47
|
-
if (!title) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (delay) {
|
|
52
|
-
this.timeout = setTimeout(this.showPopup, delay);
|
|
53
|
-
} else {
|
|
54
|
-
this.showPopup();
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
_defineProperty(this, "showPopup", () => {
|
|
59
|
-
var _this$context;
|
|
60
|
-
|
|
61
|
-
if (this.props.selfOverflowOnly) {
|
|
62
|
-
const {
|
|
63
|
-
containerNode
|
|
64
|
-
} = this; // rare cases when containerNode is null are possible;
|
|
65
|
-
// probably the collision is due to the asynchronous nature of the code,
|
|
66
|
-
// i.e. this code runs after the component is unmounted,
|
|
67
|
-
// although at first glance it looks unlikely.
|
|
68
|
-
|
|
69
|
-
if (!containerNode) {
|
|
70
|
-
return;
|
|
71
|
-
} // inline element?
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (containerNode.clientWidth === 0 && containerNode.clientHeight === 0) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (containerNode.scrollWidth <= containerNode.clientWidth && containerNode.scrollHeight <= containerNode.clientHeight) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
(_this$context = this.context) === null || _this$context === void 0 ? void 0 : _this$context.onNestedTooltipShow();
|
|
84
|
-
this.setState({
|
|
85
|
-
showPopup: true
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
_defineProperty(this, "hidePopup", () => {
|
|
90
|
-
var _this$context2;
|
|
91
|
-
|
|
92
|
-
clearTimeout(this.timeout);
|
|
93
|
-
(_this$context2 = this.context) === null || _this$context2 === void 0 ? void 0 : _this$context2.onNestedTooltipHide();
|
|
94
|
-
this.setState({
|
|
95
|
-
showPopup: false
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
_defineProperty(this, "popupRef", el => {
|
|
100
|
-
this.popup = el;
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
_defineProperty(this, "onNestedTooltipShow", () => {
|
|
104
|
-
this.setState({
|
|
105
|
-
showNestedPopup: true
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
_defineProperty(this, "onNestedTooltipHide", () => {
|
|
110
|
-
this.setState({
|
|
111
|
-
showNestedPopup: false
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
componentDidMount() {
|
|
117
|
-
if (this.props.title) {
|
|
118
|
-
this.addListeners();
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
componentDidUpdate(prevProps) {
|
|
123
|
-
if (!prevProps.title && this.props.title) {
|
|
124
|
-
this.addListeners();
|
|
125
|
-
} else if (prevProps.title && !this.props.title) {
|
|
126
|
-
this.listeners.removeAll();
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
componentWillUnmount() {
|
|
131
|
-
clearTimeout(this.timeout);
|
|
132
|
-
this.listeners.removeAll();
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
addListeners() {
|
|
136
|
-
this.listeners.add(this.containerNode, 'mouseover', this.tryToShowPopup);
|
|
137
|
-
this.listeners.add(this.containerNode, 'mouseout', this.hidePopup);
|
|
138
|
-
this.listeners.add(document, 'scroll', () => scheduleScroll(this.hidePopup), {
|
|
139
|
-
passive: true
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
render() {
|
|
144
|
-
const _this$props = this.props,
|
|
145
|
-
{
|
|
146
|
-
children,
|
|
147
|
-
'data-test': dataTest,
|
|
148
|
-
title,
|
|
149
|
-
delay,
|
|
150
|
-
selfOverflowOnly,
|
|
151
|
-
popupProps
|
|
152
|
-
} = _this$props,
|
|
153
|
-
restProps = _objectWithoutProperties(_this$props, ["children", "data-test", "title", "delay", "selfOverflowOnly", "popupProps"]);
|
|
154
|
-
|
|
155
|
-
const {
|
|
156
|
-
onNestedTooltipShow,
|
|
157
|
-
onNestedTooltipHide
|
|
158
|
-
} = this;
|
|
159
|
-
return /*#__PURE__*/React.createElement(TooltipContext.Provider, {
|
|
160
|
-
value: {
|
|
161
|
-
onNestedTooltipShow,
|
|
162
|
-
onNestedTooltipHide
|
|
163
|
-
}
|
|
164
|
-
}, /*#__PURE__*/React.createElement("span", _extends({}, restProps, {
|
|
165
|
-
ref: this.containerRef,
|
|
166
|
-
"data-test": joinDataTestAttributes('ring-tooltip', dataTest),
|
|
167
|
-
"data-test-title": title
|
|
168
|
-
}), children, /*#__PURE__*/React.createElement(Popup, _extends({
|
|
169
|
-
trapFocus: false,
|
|
170
|
-
hidden: !this.state.showPopup || this.state.showNestedPopup,
|
|
171
|
-
onCloseAttempt: this.hidePopup,
|
|
172
|
-
maxHeight: 400,
|
|
173
|
-
className: modules_cd5e45a9.tooltip,
|
|
174
|
-
attached: false,
|
|
175
|
-
top: 4,
|
|
176
|
-
dontCloseOnAnchorClick: true,
|
|
177
|
-
ref: this.popupRef
|
|
178
|
-
}, popupProps), title)));
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
_defineProperty(Tooltip, "propTypes", {
|
|
184
|
-
delay: PropTypes.number,
|
|
185
|
-
selfOverflowOnly: PropTypes.bool,
|
|
186
|
-
popupProps: PropTypes.object,
|
|
187
|
-
title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
188
|
-
children: PropTypes.node,
|
|
189
|
-
'data-test': PropTypes.string
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
_defineProperty(Tooltip, "defaultProps", {
|
|
193
|
-
title: '',
|
|
194
|
-
selfOverflowOnly: false,
|
|
195
|
-
popupProps: {}
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
_defineProperty(Tooltip, "PopupProps", Popup.PopupProps);
|
|
199
|
-
|
|
200
|
-
_defineProperty(Tooltip, "contextType", TooltipContext);
|
|
201
|
-
|
|
202
|
-
export default Tooltip;
|
package/dist/user-card.js
DELETED
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import { _ as _objectWithoutProperties, a as _extends, b as _defineProperty, c as _objectSpread2 } from './_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { PureComponent, Component } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import classNames from 'classnames';
|
|
5
|
-
import Avatar, { Size } from './avatar.js';
|
|
6
|
-
import Link from './link.js';
|
|
7
|
-
import { m as modules_6c9187df } from './_helpers/badge.js';
|
|
8
|
-
import Dropdown from './dropdown.js';
|
|
9
|
-
import { P as Popup } from './_helpers/popup.js';
|
|
10
|
-
import LoaderInline from './loader-inline.js';
|
|
11
|
-
import './_helpers/url.js';
|
|
12
|
-
import './_helpers/dom.js';
|
|
13
|
-
import 'focus-visible';
|
|
14
|
-
import './_helpers/memoize.js';
|
|
15
|
-
import './_helpers/data-tests.js';
|
|
16
|
-
import './_helpers/clickableLink.js';
|
|
17
|
-
import '@jetbrains/icons/chevron-10px';
|
|
18
|
-
import './icon.js';
|
|
19
|
-
import 'util-deprecate';
|
|
20
|
-
import './_helpers/button.js';
|
|
21
|
-
import './_helpers/theme.js';
|
|
22
|
-
import 'react-dom';
|
|
23
|
-
import './_helpers/get-uid.js';
|
|
24
|
-
import './_helpers/schedule-raf.js';
|
|
25
|
-
import './shortcuts.js';
|
|
26
|
-
import 'combokeys';
|
|
27
|
-
import './_helpers/sniffer.js';
|
|
28
|
-
import 'sniffr';
|
|
29
|
-
import './tab-trap.js';
|
|
30
|
-
import './_helpers/popup.target.js';
|
|
31
|
-
import 'conic-gradient';
|
|
32
|
-
|
|
33
|
-
var modules_a4196c17 = {"unit":"8px","userCardSpaced":"userCard_userCardSpaced__2a18ba49","userInformationContainer":"userCard_userInformationContainer__2a18ba49","userInformation":"userCard_userInformation__2a18ba49","userName":"userCard_userName__2a18ba49","userActiveStatus":"userCard_userActiveStatus__2a18ba49","online":"userCard_online__2a18ba49"};
|
|
34
|
-
|
|
35
|
-
class UserCard extends PureComponent {
|
|
36
|
-
render() {
|
|
37
|
-
const _this$props = this.props,
|
|
38
|
-
{
|
|
39
|
-
children,
|
|
40
|
-
className,
|
|
41
|
-
user,
|
|
42
|
-
wording
|
|
43
|
-
} = _this$props,
|
|
44
|
-
restProps = _objectWithoutProperties(_this$props, ["children", "className", "user", "wording"]);
|
|
45
|
-
|
|
46
|
-
const classes = classNames(className, {});
|
|
47
|
-
const userActiveStatusClasses = classNames(modules_a4196c17.userActiveStatus, user.online ? modules_a4196c17.online : '');
|
|
48
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
49
|
-
className: classes
|
|
50
|
-
}, restProps), /*#__PURE__*/React.createElement("div", {
|
|
51
|
-
className: modules_a4196c17.userInformationContainer
|
|
52
|
-
}, /*#__PURE__*/React.createElement(Avatar, {
|
|
53
|
-
size: Size.Size56,
|
|
54
|
-
url: user.avatarUrl
|
|
55
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
56
|
-
className: modules_a4196c17.userInformation
|
|
57
|
-
}, /*#__PURE__*/React.createElement("div", null, user.href && /*#__PURE__*/React.createElement(Link, {
|
|
58
|
-
href: user.href,
|
|
59
|
-
className: modules_a4196c17.userName
|
|
60
|
-
}, user.name), !user.href && /*#__PURE__*/React.createElement("span", {
|
|
61
|
-
className: modules_a4196c17.userName
|
|
62
|
-
}, user.name), user.banned && /*#__PURE__*/React.createElement("span", {
|
|
63
|
-
className: classNames(modules_6c9187df.badge, modules_6c9187df.invalid),
|
|
64
|
-
title: user.banReason
|
|
65
|
-
}, wording.banned)), /*#__PURE__*/React.createElement("div", null, typeof user.online === 'boolean' && /*#__PURE__*/React.createElement("span", {
|
|
66
|
-
className: userActiveStatusClasses,
|
|
67
|
-
title: user.online ? wording.online : wording.offline
|
|
68
|
-
}), user.login), user.email && /*#__PURE__*/React.createElement("div", null, user.email))), children);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
_defineProperty(UserCard, "propTypes", {
|
|
74
|
-
children: PropTypes.node,
|
|
75
|
-
className: PropTypes.string,
|
|
76
|
-
user: PropTypes.shape({
|
|
77
|
-
name: PropTypes.string.isRequired,
|
|
78
|
-
login: PropTypes.string.isRequired,
|
|
79
|
-
avatarUrl: PropTypes.string.isRequired,
|
|
80
|
-
email: PropTypes.string,
|
|
81
|
-
href: PropTypes.string,
|
|
82
|
-
online: PropTypes.bool,
|
|
83
|
-
banned: PropTypes.bool,
|
|
84
|
-
banReason: PropTypes.string
|
|
85
|
-
}).isRequired,
|
|
86
|
-
wording: PropTypes.shape({
|
|
87
|
-
banned: PropTypes.string.isRequired,
|
|
88
|
-
online: PropTypes.string.isRequired,
|
|
89
|
-
offline: PropTypes.string.isRequired
|
|
90
|
-
})
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
_defineProperty(UserCard, "defaultProps", {
|
|
94
|
-
wording: {
|
|
95
|
-
banned: 'banned',
|
|
96
|
-
online: 'online',
|
|
97
|
-
offline: 'offline'
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
const DEFAULT_TIMEOUT = 300;
|
|
102
|
-
class UserCardTooltip extends Component {
|
|
103
|
-
render() {
|
|
104
|
-
const {
|
|
105
|
-
children,
|
|
106
|
-
user,
|
|
107
|
-
renderUserCard,
|
|
108
|
-
renderNoUser,
|
|
109
|
-
dropdownProps
|
|
110
|
-
} = this.props;
|
|
111
|
-
return /*#__PURE__*/React.createElement(Dropdown, _extends({
|
|
112
|
-
anchor: children,
|
|
113
|
-
hoverMode: true,
|
|
114
|
-
clickMode: false
|
|
115
|
-
}, dropdownProps), /*#__PURE__*/React.createElement(Popup, {
|
|
116
|
-
attached: false
|
|
117
|
-
}, user ? renderUserCard(this.props) : renderNoUser()));
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
_defineProperty(UserCardTooltip, "propTypes", {
|
|
123
|
-
className: PropTypes.string,
|
|
124
|
-
children: PropTypes.node,
|
|
125
|
-
dropdownProps: PropTypes.object,
|
|
126
|
-
user: PropTypes.object,
|
|
127
|
-
renderUserCard: PropTypes.func,
|
|
128
|
-
renderNoUser: PropTypes.func
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
_defineProperty(UserCardTooltip, "defaultProps", {
|
|
132
|
-
renderUserCard: props => {
|
|
133
|
-
const {
|
|
134
|
-
className,
|
|
135
|
-
children,
|
|
136
|
-
renderUserCard,
|
|
137
|
-
renderNoUser,
|
|
138
|
-
dropdownProps
|
|
139
|
-
} = props,
|
|
140
|
-
restProps = _objectWithoutProperties(props, ["className", "children", "renderUserCard", "renderNoUser", "dropdownProps"]);
|
|
141
|
-
|
|
142
|
-
return /*#__PURE__*/React.createElement(UserCard, _extends({}, restProps, {
|
|
143
|
-
className: classNames(modules_a4196c17.userCardSpaced, className)
|
|
144
|
-
}));
|
|
145
|
-
},
|
|
146
|
-
renderNoUser: () => '',
|
|
147
|
-
dropdownProps: {
|
|
148
|
-
hoverShowTimeOut: DEFAULT_TIMEOUT,
|
|
149
|
-
hoverHideTimeOut: DEFAULT_TIMEOUT
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
class SmartUserCardTooltip extends Component {
|
|
154
|
-
constructor(...args) {
|
|
155
|
-
super(...args);
|
|
156
|
-
|
|
157
|
-
_defineProperty(this, "state", {
|
|
158
|
-
user: null,
|
|
159
|
-
loading: false
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
_defineProperty(this, "loadUser", async () => {
|
|
163
|
-
if (this.state.user) {
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
try {
|
|
168
|
-
this.setState({
|
|
169
|
-
loading: true
|
|
170
|
-
});
|
|
171
|
-
const user = await this.props.userDataSource();
|
|
172
|
-
this.setState({
|
|
173
|
-
user
|
|
174
|
-
});
|
|
175
|
-
} catch (e) {// Skip it
|
|
176
|
-
} finally {
|
|
177
|
-
this.setState({
|
|
178
|
-
loading: false
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
_defineProperty(this, "renderNoUser", () => this.state.loading ? /*#__PURE__*/React.createElement("div", {
|
|
184
|
-
className: modules_a4196c17.userCardSpaced
|
|
185
|
-
}, /*#__PURE__*/React.createElement(LoaderInline, null)) : '');
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
render() {
|
|
189
|
-
const {
|
|
190
|
-
user
|
|
191
|
-
} = this.state;
|
|
192
|
-
|
|
193
|
-
const _this$props = this.props,
|
|
194
|
-
{
|
|
195
|
-
children,
|
|
196
|
-
userDataSource
|
|
197
|
-
} = _this$props,
|
|
198
|
-
restProps = _objectWithoutProperties(_this$props, ["children", "userDataSource"]);
|
|
199
|
-
|
|
200
|
-
const dropdownProps = _objectSpread2({
|
|
201
|
-
onMouseEnter: this.loadUser
|
|
202
|
-
}, UserCardTooltip.defaultProps.dropdownProps);
|
|
203
|
-
|
|
204
|
-
return /*#__PURE__*/React.createElement(UserCardTooltip, _extends({
|
|
205
|
-
user: user,
|
|
206
|
-
renderNoUser: this.renderNoUser,
|
|
207
|
-
dropdownProps: dropdownProps
|
|
208
|
-
}, restProps), children);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
_defineProperty(SmartUserCardTooltip, "propTypes", {
|
|
214
|
-
children: PropTypes.node,
|
|
215
|
-
userDataSource: PropTypes.func
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
export { SmartUserCardTooltip, UserCard, UserCardTooltip };
|