@jetbrains/ring-ui 4.1.0-beta.9 → 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/container.css +1 -1
- 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 +1 -1
- package/components/auth/auth.test.js +14 -7
- package/components/auth/auth__core.js +64 -33
- package/components/auth-dialog/auth-dialog.js +1 -0
- package/components/avatar/avatar.css +4 -1
- package/components/avatar/avatar.examples.js +3 -2
- package/components/avatar/avatar.js +31 -6
- 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/button/button.css +2 -2
- package/components/button/button.js +4 -1
- 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 +1 -1
- 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 +5 -2
- package/components/dialog/dialog.test.js +1 -1
- package/components/dialog/dialog__body-scroll-preventer.js +2 -2
- package/components/dialog-ng/dialog-ng.js +7 -8
- package/components/dialog-ng/{dialog-ng.html → dialog-ng__template.js} +2 -2
- package/components/dropdown/dropdown.examples.js +36 -1
- 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/island/island.css +4 -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 -5
- package/components/pager/pager.js +5 -3
- package/components/permissions/permissions.js +1 -1
- 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 -1
- 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/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/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 +4 -8
- package/components/tabs/tab-link.js +4 -2
- package/components/tabs/tabs.css +27 -0
- 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 -1
- package/components/user-agreement/user-agreement.examples.js +7 -4
- package/components/user-agreement/user-agreement.js +1 -0
- package/package.json +75 -78
- 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 -127
- package/dist/_helpers/anchor.js +0 -33
- package/dist/_helpers/badge.js +0 -3
- package/dist/_helpers/button__classes.js +0 -39
- package/dist/_helpers/caption.js +0 -25
- package/dist/_helpers/card.js +0 -77
- package/dist/_helpers/date-picker.js +0 -3
- package/dist/_helpers/dialog__body-scroll-preventer.js +0 -56
- package/dist/_helpers/grid.js +0 -3
- package/dist/_helpers/header.js +0 -3
- package/dist/_helpers/icon__svg.js +0 -83
- package/dist/_helpers/inject-styles.js +0 -22
- package/dist/_helpers/island.js +0 -3
- package/dist/_helpers/list.js +0 -3
- package/dist/_helpers/query-assist__suggestions.js +0 -95
- package/dist/_helpers/select__filter.js +0 -78
- package/dist/_helpers/services-link.js +0 -42
- package/dist/_helpers/sidebar.js +0 -127
- package/dist/_helpers/table.js +0 -3
- package/dist/_helpers/tabs.js +0 -3
- package/dist/_helpers/title.js +0 -99
- package/dist/alert/alert.js +0 -254
- package/dist/alert/container.js +0 -50
- package/dist/alert-service/alert-service.js +0 -159
- package/dist/analytics/analytics.js +0 -116
- package/dist/analytics/analytics__custom-plugin.js +0 -127
- package/dist/analytics/analytics__fus-plugin.js +0 -101
- package/dist/analytics/analytics__ga-plugin.js +0 -66
- package/dist/analytics/analytics__plugin-utils.js +0 -79
- package/dist/auth/auth.js +0 -90
- package/dist/auth/auth__core.js +0 -987
- package/dist/auth/background-flow.js +0 -123
- package/dist/auth/down-notification.js +0 -111
- package/dist/auth/iframe-flow.js +0 -147
- package/dist/auth/landing-entry.js +0 -5
- package/dist/auth/landing.js +0 -84
- package/dist/auth/request-builder.js +0 -75
- package/dist/auth/response-parser.js +0 -117
- package/dist/auth/storage.js +0 -279
- package/dist/auth/token-validator.js +0 -176
- package/dist/auth/window-flow.js +0 -133
- package/dist/auth-dialog/auth-dialog.js +0 -132
- package/dist/auth-dialog-service/auth-dialog-service.js +0 -67
- package/dist/avatar/avatar-example-datauri.js +0 -26
- package/dist/avatar/avatar.js +0 -155
- package/dist/badge/badge.js +0 -52
- package/dist/button/button.js +0 -117
- package/dist/button/button__classes.js +0 -5
- package/dist/button-group/button-group.js +0 -30
- package/dist/button-group/caption.js +0 -5
- package/dist/button-set/button-set.js +0 -27
- package/dist/button-toolbar/button-toolbar.js +0 -30
- package/dist/caret/caret.js +0 -264
- package/dist/checkbox/checkbox.js +0 -110
- package/dist/confirm/confirm.js +0 -122
- package/dist/confirm-service/confirm-service.js +0 -112
- package/dist/content-layout/content-layout.js +0 -67
- package/dist/content-layout/sidebar.js +0 -6
- package/dist/contenteditable/contenteditable.js +0 -81
- package/dist/data-list/data-list.js +0 -203
- package/dist/data-list/data-list.mock.js +0 -190
- package/dist/data-list/item.js +0 -225
- package/dist/data-list/selection.js +0 -101
- package/dist/data-list/title.js +0 -16
- package/dist/date-picker/consts.js +0 -70
- package/dist/date-picker/date-input.js +0 -169
- package/dist/date-picker/date-picker.js +0 -356
- package/dist/date-picker/date-popup.js +0 -459
- package/dist/date-picker/day.js +0 -119
- package/dist/date-picker/formats.js +0 -3
- package/dist/date-picker/month-names.js +0 -92
- package/dist/date-picker/month-slider.js +0 -83
- package/dist/date-picker/month.js +0 -48
- package/dist/date-picker/months.js +0 -121
- package/dist/date-picker/weekdays.js +0 -24
- package/dist/date-picker/years.js +0 -109
- package/dist/dialog/dialog.js +0 -197
- package/dist/dialog/dialog__body-scroll-preventer.js +0 -2
- package/dist/dropdown/anchor.js +0 -16
- package/dist/dropdown/dropdown.js +0 -236
- package/dist/error-bubble/error-bubble.js +0 -59
- package/dist/error-message/error-message.js +0 -55
- package/dist/footer/footer.js +0 -127
- package/dist/global/angular-component-factory.js +0 -83
- package/dist/global/compose.js +0 -9
- package/dist/global/composeRefs.js +0 -15
- package/dist/global/conic-gradient.js +0 -37
- package/dist/global/create-stateful-context.js +0 -54
- package/dist/global/data-tests.js +0 -22
- package/dist/global/dom.js +0 -124
- package/dist/global/focus-sensor-hoc.js +0 -147
- package/dist/global/fuzzy-highlight.js +0 -67
- package/dist/global/get-event-key.js +0 -111
- package/dist/global/get-uid.js +0 -15
- package/dist/global/inject-styles.js +0 -17
- package/dist/global/linear-function.js +0 -18
- package/dist/global/listeners.js +0 -42
- package/dist/global/memoize.js +0 -18
- package/dist/global/normalize-indent.js +0 -28
- package/dist/global/promise-with-timeout.js +0 -13
- package/dist/global/radial-gradient-mask.js +0 -49
- package/dist/global/react-dom-renderer.js +0 -45
- package/dist/global/rerender-hoc.js +0 -53
- package/dist/global/ring-angular-component.js +0 -24
- package/dist/global/schedule-raf.js +0 -31
- package/dist/global/sniffer.js +0 -6
- package/dist/global/supports-css.js +0 -20
- package/dist/global/theme.js +0 -56
- package/dist/global/trivial-template-tag.js +0 -15
- package/dist/global/url.js +0 -163
- package/dist/global/variables_dark.js +0 -57
- package/dist/grid/col.js +0 -62
- package/dist/grid/grid.js +0 -35
- package/dist/grid/row.js +0 -66
- package/dist/group/group.js +0 -34
- package/dist/header/header.js +0 -144
- package/dist/header/logo.js +0 -39
- package/dist/header/profile.js +0 -212
- package/dist/header/services-link.js +0 -10
- package/dist/header/services.js +0 -135
- package/dist/header/smart-profile.js +0 -227
- package/dist/header/smart-services.js +0 -159
- package/dist/header/tray-icon.js +0 -45
- package/dist/header/tray.js +0 -33
- package/dist/heading/heading.js +0 -76
- package/dist/http/http.js +0 -216
- package/dist/http/http.mock.js +0 -65
- package/dist/hub-source/hub-source.js +0 -130
- package/dist/hub-source/hub-source__user.js +0 -28
- package/dist/hub-source/hub-source__users-groups.js +0 -62
- package/dist/icon/icon.js +0 -105
- package/dist/icon/icon__constants.js +0 -33
- package/dist/icon/icon__svg.js +0 -6
- package/dist/icon/index.js +0 -9
- package/dist/input/input.js +0 -231
- package/dist/island/adaptive-island-hoc.js +0 -48
- package/dist/island/content.js +0 -158
- package/dist/island/header.js +0 -85
- package/dist/island/island.js +0 -53
- package/dist/island-legacy/content-legacy.js +0 -28
- package/dist/island-legacy/header-legacy.js +0 -30
- package/dist/island-legacy/island-legacy.js +0 -30
- package/dist/link/clickableLink.js +0 -65
- package/dist/link/link.js +0 -118
- package/dist/list/consts.js +0 -26
- package/dist/list/list.js +0 -800
- package/dist/list/list__custom.js +0 -82
- package/dist/list/list__hint.js +0 -26
- package/dist/list/list__item.js +0 -197
- package/dist/list/list__link.js +0 -65
- package/dist/list/list__separator.js +0 -30
- package/dist/list/list__title.js +0 -39
- package/dist/list/list__users-groups-source.js +0 -124
- package/dist/loader/loader.js +0 -72
- package/dist/loader/loader__core.js +0 -272
- package/dist/loader-inline/inject-styles.js +0 -11
- package/dist/loader-inline/loader-inline.js +0 -58
- package/dist/loader-screen/loader-screen.js +0 -46
- package/dist/login-dialog/login-dialog.js +0 -184
- package/dist/login-dialog/service.js +0 -67
- package/dist/message/message.js +0 -232
- package/dist/old-browsers-message/old-browsers-message.js +0 -101
- package/dist/old-browsers-message/old-browsers-message__stop.js +0 -5
- package/dist/old-browsers-message/white-list.js +0 -34
- package/dist/pager/pager.js +0 -352
- package/dist/panel/panel.js +0 -34
- package/dist/permissions/permissions.js +0 -200
- package/dist/permissions/permissions__cache.js +0 -272
- package/dist/popup/popup.consts.js +0 -41
- package/dist/popup/popup.js +0 -389
- package/dist/popup/popup.target.js +0 -27
- package/dist/popup/position.js +0 -280
- package/dist/popup-menu/popup-menu.js +0 -108
- package/dist/progress-bar/progress-bar.js +0 -111
- package/dist/proxy-attrs/proxy-attrs.js +0 -19
- package/dist/query-assist/query-assist.js +0 -1023
- package/dist/query-assist/query-assist__suggestions.js +0 -43
- package/dist/radio/radio.js +0 -39
- package/dist/radio/radio__item.js +0 -82
- package/dist/select/select.js +0 -1335
- package/dist/select/select__filter.js +0 -49
- package/dist/select/select__popup.js +0 -541
- package/dist/shortcuts/core.js +0 -245
- package/dist/shortcuts/shortcut-title.js +0 -51
- package/dist/shortcuts/shortcuts-hoc.js +0 -43
- package/dist/shortcuts/shortcuts.js +0 -72
- package/dist/storage/storage.js +0 -55
- package/dist/storage/storage__fallback.js +0 -214
- package/dist/storage/storage__local.js +0 -150
- package/dist/style.css +0 -1
- package/dist/tab-trap/tab-trap.js +0 -178
- package/dist/table/cell.js +0 -25
- package/dist/table/disable-hover-hoc.js +0 -53
- package/dist/table/header-cell.js +0 -91
- package/dist/table/header.js +0 -189
- package/dist/table/multitable.js +0 -140
- package/dist/table/row-with-focus-sensor.js +0 -79
- package/dist/table/row.js +0 -270
- package/dist/table/selection-adapter.js +0 -14
- package/dist/table/selection-shortcuts-hoc.js +0 -212
- package/dist/table/selection.js +0 -221
- package/dist/table/smart-table.js +0 -113
- package/dist/table/table.js +0 -405
- package/dist/tabs/collapsible-more.js +0 -193
- package/dist/tabs/collapsible-tab.js +0 -90
- package/dist/tabs/collapsible-tabs.js +0 -361
- package/dist/tabs/custom-item.js +0 -13
- package/dist/tabs/dumb-tabs.js +0 -159
- package/dist/tabs/smart-tabs.js +0 -102
- package/dist/tabs/tab-link.js +0 -35
- package/dist/tabs/tab.js +0 -32
- package/dist/tabs/tabs.js +0 -65
- package/dist/tag/tag.js +0 -190
- package/dist/tags-input/tags-input.js +0 -474
- package/dist/tags-list/tags-list.js +0 -94
- package/dist/text/text.js +0 -38
- package/dist/toggle/toggle.js +0 -80
- package/dist/tooltip/tooltip.js +0 -205
- package/dist/user-card/card.js +0 -14
- package/dist/user-card/smart-user-card-tooltip.js +0 -112
- package/dist/user-card/tooltip.js +0 -91
- package/dist/user-card/user-card.js +0 -46
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { _ as _defineProperty, b as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { PureComponent } from 'react';
|
|
3
|
-
|
|
4
|
-
function disableHoverHOC(ComposedComponent) {
|
|
5
|
-
var _class, _temp;
|
|
6
|
-
|
|
7
|
-
return _temp = _class = class DisableHover extends PureComponent {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments);
|
|
10
|
-
|
|
11
|
-
_defineProperty(this, "state", {
|
|
12
|
-
disabledHover: false
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
_defineProperty(this, "onMouseMove", () => {
|
|
16
|
-
if (this.state.disabledHover) {
|
|
17
|
-
this.setState({
|
|
18
|
-
disabledHover: false
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
_defineProperty(this, "onKeyDown", e => {
|
|
24
|
-
const metaKeys = [16, 17, 18, 19, 20, 91]; // eslint-disable-line no-magic-numbers
|
|
25
|
-
|
|
26
|
-
if (!this.state.disabledHover && !metaKeys.includes(e.keyCode)) {
|
|
27
|
-
this.setState({
|
|
28
|
-
disabledHover: true
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
componentDidMount() {
|
|
35
|
-
document.addEventListener('mousemove', this.onMouseMove);
|
|
36
|
-
document.addEventListener('keydown', this.onKeyDown, true);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
componentWillUnmount() {
|
|
40
|
-
document.removeEventListener('mousemove', this.onMouseMove);
|
|
41
|
-
document.removeEventListener('keydown', this.onKeyDown, true);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
render() {
|
|
45
|
-
return /*#__PURE__*/React.createElement(ComposedComponent, _extends({}, this.props, {
|
|
46
|
-
disabledHover: this.state.disabledHover
|
|
47
|
-
}));
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
}, _defineProperty(_class, "propTypes", ComposedComponent.propTypes), _defineProperty(_class, "defaultProps", ComposedComponent.defaultProps), _temp;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export default disableHoverHOC;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { _ as _defineProperty, a as _objectWithoutProperties, b as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { PureComponent } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import classNames from 'classnames';
|
|
5
|
-
import sortableIcon from '@jetbrains/icons/unsorted-10px';
|
|
6
|
-
import chevronDown from '@jetbrains/icons/chevron-10px';
|
|
7
|
-
import Icon from '../icon/icon.js';
|
|
8
|
-
import joinDataTestAttributes from '../global/data-tests.js';
|
|
9
|
-
import { m as modules_1db4bbca } from '../_helpers/table.js';
|
|
10
|
-
import 'util-deprecate';
|
|
11
|
-
import '../icon/icon__constants.js';
|
|
12
|
-
import '../_helpers/icon__svg.js';
|
|
13
|
-
import '../global/memoize.js';
|
|
14
|
-
|
|
15
|
-
class HeaderCell extends PureComponent {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
|
|
19
|
-
_defineProperty(this, "onClick", () => {
|
|
20
|
-
if (this.sortable) {
|
|
21
|
-
const {
|
|
22
|
-
column,
|
|
23
|
-
onSort,
|
|
24
|
-
sortOrder
|
|
25
|
-
} = this.props;
|
|
26
|
-
onSort({
|
|
27
|
-
column,
|
|
28
|
-
order: !(this.sorted && sortOrder)
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
onChildrenClick(e) {
|
|
35
|
-
e.stopPropagation();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
render() {
|
|
39
|
-
const _this$props = this.props,
|
|
40
|
-
{
|
|
41
|
-
className,
|
|
42
|
-
column,
|
|
43
|
-
onSort,
|
|
44
|
-
sortKey,
|
|
45
|
-
sortOrder,
|
|
46
|
-
'data-test': dataTest
|
|
47
|
-
} = _this$props,
|
|
48
|
-
restProps = _objectWithoutProperties(_this$props, ["className", "column", "onSort", "sortKey", "sortOrder", "data-test"]);
|
|
49
|
-
|
|
50
|
-
this.sortable = column.sortable === true;
|
|
51
|
-
this.sorted = sortKey === column.id;
|
|
52
|
-
const glyph = this.sorted ? chevronDown : sortableIcon;
|
|
53
|
-
const classes = classNames(className, column.headerClassName, {
|
|
54
|
-
[modules_1db4bbca.headerCell]: true,
|
|
55
|
-
[modules_1db4bbca.headerCellSortable]: this.sortable,
|
|
56
|
-
[modules_1db4bbca.headerCellSorted]: this.sorted,
|
|
57
|
-
[modules_1db4bbca.sortedUp]: sortOrder && this.sorted,
|
|
58
|
-
[modules_1db4bbca.cellRight]: column.rightAlign
|
|
59
|
-
});
|
|
60
|
-
return /*#__PURE__*/React.createElement("th", _extends({}, restProps, {
|
|
61
|
-
className: classes,
|
|
62
|
-
onClick: this.onClick,
|
|
63
|
-
"data-test": joinDataTestAttributes('ring-table-header-cell', dataTest)
|
|
64
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
65
|
-
onClick: this.onChildrenClick,
|
|
66
|
-
role: "presentation"
|
|
67
|
-
}, this.props.children), column.getHeaderValue ? column.getHeaderValue() : column.title, this.sortable && /*#__PURE__*/React.createElement("span", {
|
|
68
|
-
className: modules_1db4bbca.sorter
|
|
69
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
70
|
-
glyph: glyph,
|
|
71
|
-
className: modules_1db4bbca.icon
|
|
72
|
-
})));
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
_defineProperty(HeaderCell, "propTypes", {
|
|
78
|
-
children: PropTypes.any,
|
|
79
|
-
className: PropTypes.string,
|
|
80
|
-
column: PropTypes.object.isRequired,
|
|
81
|
-
onSort: PropTypes.func,
|
|
82
|
-
sortKey: PropTypes.string,
|
|
83
|
-
sortOrder: PropTypes.bool,
|
|
84
|
-
'data-test': PropTypes.string
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
_defineProperty(HeaderCell, "defaultProps", {
|
|
88
|
-
onSort: () => {}
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
export default HeaderCell;
|
package/dist/table/header.js
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import { _ as _defineProperty, b as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { PureComponent } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import classNames from 'classnames';
|
|
5
|
-
import { Waypoint } from 'react-waypoint';
|
|
6
|
-
import Checkbox from '../checkbox/checkbox.js';
|
|
7
|
-
import getUID from '../global/get-uid.js';
|
|
8
|
-
import { m as modules_1db4bbca } from '../_helpers/table.js';
|
|
9
|
-
import HeaderCell from './header-cell.js';
|
|
10
|
-
import '@jetbrains/icons/checkmark';
|
|
11
|
-
import '@jetbrains/icons/remove-10px';
|
|
12
|
-
import '../icon/icon.js';
|
|
13
|
-
import 'util-deprecate';
|
|
14
|
-
import '../icon/icon__constants.js';
|
|
15
|
-
import '../_helpers/icon__svg.js';
|
|
16
|
-
import '../global/memoize.js';
|
|
17
|
-
import '@jetbrains/icons/unsorted-10px';
|
|
18
|
-
import '@jetbrains/icons/chevron-10px';
|
|
19
|
-
import '../global/data-tests.js';
|
|
20
|
-
|
|
21
|
-
class Header extends PureComponent {
|
|
22
|
-
constructor() {
|
|
23
|
-
super(...arguments);
|
|
24
|
-
|
|
25
|
-
_defineProperty(this, "state", {
|
|
26
|
-
fixed: false,
|
|
27
|
-
headerWidth: null,
|
|
28
|
-
widths: []
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
_defineProperty(this, "id", getUID('table-header-'));
|
|
32
|
-
|
|
33
|
-
_defineProperty(this, "onCheckboxFocus", event => {
|
|
34
|
-
event.target.blur();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
_defineProperty(this, "storeColumnsRowNode", node => {
|
|
38
|
-
if (node) {
|
|
39
|
-
this._columnsRowNode = node;
|
|
40
|
-
this.calculateColumnsWidths(node);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
_defineProperty(this, "onScrollIn", () => {
|
|
45
|
-
this.calculateColumnsWidths(this._columnsRowNode);
|
|
46
|
-
this.setState({
|
|
47
|
-
fixed: false
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
_defineProperty(this, "onScrollOut", _ref => {
|
|
52
|
-
let {
|
|
53
|
-
currentPosition
|
|
54
|
-
} = _ref;
|
|
55
|
-
|
|
56
|
-
if (currentPosition !== 'above') {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
this.calculateColumnsWidths(this._columnsRowNode);
|
|
61
|
-
this.setState({
|
|
62
|
-
fixed: true
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
calculateColumnsWidths(columnsRowNode) {
|
|
68
|
-
this.setState({
|
|
69
|
-
headerWidth: columnsRowNode.clientWidth,
|
|
70
|
-
widths: [...columnsRowNode.childNodes].map(column => column.clientWidth)
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
createCells() {
|
|
75
|
-
let widths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
76
|
-
const {
|
|
77
|
-
selectable,
|
|
78
|
-
draggable,
|
|
79
|
-
columns,
|
|
80
|
-
checked,
|
|
81
|
-
checkboxDisabled,
|
|
82
|
-
onCheckboxChange,
|
|
83
|
-
onSort,
|
|
84
|
-
sortKey,
|
|
85
|
-
sortOrder
|
|
86
|
-
} = this.props;
|
|
87
|
-
const metaColumnClasses = classNames(modules_1db4bbca.metaColumn, modules_1db4bbca.headerMetaColumn);
|
|
88
|
-
const metaColumn = /*#__PURE__*/React.createElement("div", {
|
|
89
|
-
className: metaColumnClasses
|
|
90
|
-
}, selectable && /*#__PURE__*/React.createElement(Checkbox, {
|
|
91
|
-
"aria-labelledby": this.id,
|
|
92
|
-
disabled: checkboxDisabled,
|
|
93
|
-
checked: checked,
|
|
94
|
-
onChange: onCheckboxChange,
|
|
95
|
-
onFocus: this.onCheckboxFocus
|
|
96
|
-
}));
|
|
97
|
-
return columns.map((column, index) => {
|
|
98
|
-
const columnStyle = widths[index] ? {
|
|
99
|
-
width: widths[index]
|
|
100
|
-
} : null;
|
|
101
|
-
const props = {
|
|
102
|
-
column,
|
|
103
|
-
onSort,
|
|
104
|
-
sortKey,
|
|
105
|
-
sortOrder,
|
|
106
|
-
style: columnStyle
|
|
107
|
-
};
|
|
108
|
-
return /*#__PURE__*/React.createElement(HeaderCell, _extends({
|
|
109
|
-
key: column.id,
|
|
110
|
-
"data-test": column.id
|
|
111
|
-
}, props), index === 0 && (draggable || selectable) && metaColumn);
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
render() {
|
|
116
|
-
const {
|
|
117
|
-
caption,
|
|
118
|
-
sticky,
|
|
119
|
-
topStickOffset
|
|
120
|
-
} = this.props;
|
|
121
|
-
const {
|
|
122
|
-
fixed,
|
|
123
|
-
widths,
|
|
124
|
-
headerWidth
|
|
125
|
-
} = this.state;
|
|
126
|
-
const regularCells = this.createCells();
|
|
127
|
-
const waypointChild = /*#__PURE__*/React.createElement("tr", {
|
|
128
|
-
"data-test": "ring-table-header-row"
|
|
129
|
-
}, regularCells.map((c, i) => /*#__PURE__*/React.createElement("td", {
|
|
130
|
-
key: i
|
|
131
|
-
})));
|
|
132
|
-
return /*#__PURE__*/React.createElement("thead", {
|
|
133
|
-
id: this.id,
|
|
134
|
-
"data-test": "ring-table-header",
|
|
135
|
-
className: modules_1db4bbca.tableHead
|
|
136
|
-
}, caption && /*#__PURE__*/React.createElement("tr", {
|
|
137
|
-
"data-test": "ring-table-header-row"
|
|
138
|
-
}, /*#__PURE__*/React.createElement("th", {
|
|
139
|
-
className: classNames(modules_1db4bbca.headerCell, modules_1db4bbca.caption),
|
|
140
|
-
colSpan: regularCells.length + 1,
|
|
141
|
-
"data-test": "ring-table-header-cell"
|
|
142
|
-
}, caption)), sticky && /*#__PURE__*/React.createElement(Waypoint, {
|
|
143
|
-
topOffset: topStickOffset,
|
|
144
|
-
onEnter: this.onScrollIn,
|
|
145
|
-
onLeave: this.onScrollOut
|
|
146
|
-
}, waypointChild), /*#__PURE__*/React.createElement("tr", {
|
|
147
|
-
className: modules_1db4bbca.subHeader,
|
|
148
|
-
ref: this.storeColumnsRowNode,
|
|
149
|
-
"data-test": "ring-table-header-row"
|
|
150
|
-
}, regularCells), fixed && sticky && /*#__PURE__*/React.createElement("tr", {
|
|
151
|
-
className: modules_1db4bbca.subHeaderFixed,
|
|
152
|
-
style: {
|
|
153
|
-
width: headerWidth,
|
|
154
|
-
top: topStickOffset
|
|
155
|
-
},
|
|
156
|
-
"data-test": "ring-table-header-row"
|
|
157
|
-
}, this.createCells(widths)));
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
_defineProperty(Header, "propTypes", {
|
|
163
|
-
caption: PropTypes.string,
|
|
164
|
-
selectable: PropTypes.bool,
|
|
165
|
-
draggable: PropTypes.bool,
|
|
166
|
-
checked: PropTypes.bool,
|
|
167
|
-
checkboxDisabled: PropTypes.bool,
|
|
168
|
-
sticky: PropTypes.bool,
|
|
169
|
-
topStickOffset: PropTypes.string,
|
|
170
|
-
onCheckboxChange: PropTypes.func,
|
|
171
|
-
columns: PropTypes.array.isRequired,
|
|
172
|
-
onSort: PropTypes.func,
|
|
173
|
-
sortKey: PropTypes.string,
|
|
174
|
-
sortOrder: PropTypes.bool
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
_defineProperty(Header, "defaultProps", {
|
|
178
|
-
selectable: true,
|
|
179
|
-
draggable: false,
|
|
180
|
-
checked: true,
|
|
181
|
-
sticky: true,
|
|
182
|
-
topStickOffset: '0px',
|
|
183
|
-
onSort: () => {},
|
|
184
|
-
onCheckboxChange: () => {},
|
|
185
|
-
sortKey: 'id',
|
|
186
|
-
sortOrder: true
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
export default Header;
|
package/dist/table/multitable.js
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { PureComponent, Children, cloneElement } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
|
|
5
|
-
class MultiTable extends PureComponent {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
|
|
9
|
-
_defineProperty(this, "onUpPress", () => {
|
|
10
|
-
const {
|
|
11
|
-
children: tables
|
|
12
|
-
} = this.props;
|
|
13
|
-
const tableIndex = tables.findIndex(_ref => {
|
|
14
|
-
let {
|
|
15
|
-
props: {
|
|
16
|
-
selection
|
|
17
|
-
}
|
|
18
|
-
} = _ref;
|
|
19
|
-
return selection.getFocused();
|
|
20
|
-
});
|
|
21
|
-
const currentTable = tables[tableIndex].props;
|
|
22
|
-
const prevTable = tables[tableIndex - 1] ? tables[tableIndex - 1].props : null;
|
|
23
|
-
let newSelection = currentTable.selection.moveUp();
|
|
24
|
-
|
|
25
|
-
if (newSelection) {
|
|
26
|
-
currentTable.onSelect(newSelection);
|
|
27
|
-
} else if (prevTable) {
|
|
28
|
-
currentTable.onSelect(currentTable.selection.resetFocus());
|
|
29
|
-
newSelection = prevTable.selection.moveUp();
|
|
30
|
-
|
|
31
|
-
if (newSelection) {
|
|
32
|
-
prevTable.onSelect(newSelection);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return false;
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
_defineProperty(this, "onDownPress", () => {
|
|
40
|
-
const {
|
|
41
|
-
children: tables
|
|
42
|
-
} = this.props;
|
|
43
|
-
const tableIndex = tables.findIndex(_ref2 => {
|
|
44
|
-
let {
|
|
45
|
-
props: {
|
|
46
|
-
selection
|
|
47
|
-
}
|
|
48
|
-
} = _ref2;
|
|
49
|
-
return selection.getFocused();
|
|
50
|
-
});
|
|
51
|
-
const currentTable = tables[tableIndex].props;
|
|
52
|
-
const nextTable = tables[tableIndex + 1] ? tables[tableIndex + 1].props : null;
|
|
53
|
-
let newSelection = currentTable.selection.moveDown();
|
|
54
|
-
|
|
55
|
-
if (newSelection) {
|
|
56
|
-
currentTable.onSelect(newSelection);
|
|
57
|
-
} else if (nextTable) {
|
|
58
|
-
currentTable.onSelect(currentTable.selection.resetFocus());
|
|
59
|
-
newSelection = nextTable.selection.moveDown();
|
|
60
|
-
|
|
61
|
-
if (newSelection) {
|
|
62
|
-
nextTable.onSelect(newSelection);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return false;
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
_defineProperty(this, "onEscPress", () => {
|
|
70
|
-
const {
|
|
71
|
-
children
|
|
72
|
-
} = this.props;
|
|
73
|
-
Children.forEach(children, _ref3 => {
|
|
74
|
-
let {
|
|
75
|
-
props: {
|
|
76
|
-
selection,
|
|
77
|
-
onSelect
|
|
78
|
-
}
|
|
79
|
-
} = _ref3;
|
|
80
|
-
onSelect(selection.reset());
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
_defineProperty(this, "onCmdAPress", () => {
|
|
85
|
-
const {
|
|
86
|
-
children
|
|
87
|
-
} = this.props;
|
|
88
|
-
Children.forEach(children, _ref4 => {
|
|
89
|
-
let {
|
|
90
|
-
props: {
|
|
91
|
-
selection,
|
|
92
|
-
onSelect
|
|
93
|
-
}
|
|
94
|
-
} = _ref4;
|
|
95
|
-
onSelect(selection.selectAll());
|
|
96
|
-
});
|
|
97
|
-
return false;
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
_defineProperty(this, "shortcuts", {
|
|
101
|
-
up: this.onUpPress,
|
|
102
|
-
down: this.onDownPress,
|
|
103
|
-
esc: this.onEscPress,
|
|
104
|
-
'command+a': this.onCmdAPress,
|
|
105
|
-
'ctrl+a': this.onCmdAPress
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
componentDidUpdate(prevProps) {
|
|
110
|
-
if (prevProps.children) {
|
|
111
|
-
const prevSelections = prevProps.children.map(element => element.props.selection);
|
|
112
|
-
const prevFocusedIndex = prevSelections.findIndex(selection => selection.getFocused());
|
|
113
|
-
const prevFocused = prevSelections[prevFocusedIndex];
|
|
114
|
-
const currentSelections = this.props.children.map(element => element.props.selection);
|
|
115
|
-
const currentFocused = currentSelections.filter(selection => selection.getFocused());
|
|
116
|
-
|
|
117
|
-
if (currentFocused.includes(prevFocused)) {
|
|
118
|
-
prevProps.children[prevFocusedIndex].props.onSelect(prevFocused.resetFocus());
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
render() {
|
|
124
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
125
|
-
"data-test": "ring-multitable"
|
|
126
|
-
}, Children.map(this.props.children, child => {
|
|
127
|
-
const props = {
|
|
128
|
-
shortcuts: this.shortcuts
|
|
129
|
-
};
|
|
130
|
-
return /*#__PURE__*/cloneElement(child, props);
|
|
131
|
-
}));
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
_defineProperty(MultiTable, "propTypes", {
|
|
137
|
-
children: PropTypes.any.isRequired
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
export default MultiTable;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { _ as _defineProperty, b as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { PureComponent } from 'react';
|
|
3
|
-
import focusSensorHOC from '../global/focus-sensor-hoc.js';
|
|
4
|
-
import Row from './row.js';
|
|
5
|
-
import 'prop-types';
|
|
6
|
-
import '../global/composeRefs.js';
|
|
7
|
-
import 'classnames';
|
|
8
|
-
import '@jetbrains/icons/chevron-right';
|
|
9
|
-
import '@jetbrains/icons/chevron-down';
|
|
10
|
-
import '@jetbrains/icons/drag';
|
|
11
|
-
import '../checkbox/checkbox.js';
|
|
12
|
-
import '@jetbrains/icons/checkmark';
|
|
13
|
-
import '@jetbrains/icons/remove-10px';
|
|
14
|
-
import '../icon/icon.js';
|
|
15
|
-
import 'util-deprecate';
|
|
16
|
-
import '../icon/icon__constants.js';
|
|
17
|
-
import '../_helpers/icon__svg.js';
|
|
18
|
-
import '../global/memoize.js';
|
|
19
|
-
import '../button/button.js';
|
|
20
|
-
import 'focus-visible';
|
|
21
|
-
import '@jetbrains/icons/chevron-10px';
|
|
22
|
-
import '../global/theme.js';
|
|
23
|
-
import '../link/clickableLink.js';
|
|
24
|
-
import '../_helpers/button__classes.js';
|
|
25
|
-
import '../tooltip/tooltip.js';
|
|
26
|
-
import '../popup/popup.js';
|
|
27
|
-
import 'react-dom';
|
|
28
|
-
import '../global/get-uid.js';
|
|
29
|
-
import '../global/schedule-raf.js';
|
|
30
|
-
import '../global/dom.js';
|
|
31
|
-
import '../shortcuts/shortcuts.js';
|
|
32
|
-
import '../shortcuts/core.js';
|
|
33
|
-
import 'combokeys';
|
|
34
|
-
import '../global/sniffer.js';
|
|
35
|
-
import 'sniffr';
|
|
36
|
-
import '../global/data-tests.js';
|
|
37
|
-
import '../tab-trap/tab-trap.js';
|
|
38
|
-
import '../popup/position.js';
|
|
39
|
-
import '../popup/popup.consts.js';
|
|
40
|
-
import '../popup/popup.target.js';
|
|
41
|
-
import './cell.js';
|
|
42
|
-
import '../_helpers/table.js';
|
|
43
|
-
|
|
44
|
-
const RowWithFocusSensor = focusSensorHOC(Row);
|
|
45
|
-
class RowWithFocusSensorCallbacks extends PureComponent {
|
|
46
|
-
constructor() {
|
|
47
|
-
super(...arguments);
|
|
48
|
-
|
|
49
|
-
_defineProperty(this, "onFocus", () => {
|
|
50
|
-
this.props.onFocus(this.props.item);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
_defineProperty(this, "onSelect", (item, selected) => {
|
|
54
|
-
this.props.onSelect(item, selected);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
_defineProperty(this, "onCollapse", () => {
|
|
58
|
-
this.props.onCollapse(this.props.item);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
_defineProperty(this, "onExpand", () => {
|
|
62
|
-
this.props.onExpand(this.props.item);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
render() {
|
|
67
|
-
return /*#__PURE__*/React.createElement(RowWithFocusSensor, _extends({}, this.props, {
|
|
68
|
-
onFocus: this.onFocus,
|
|
69
|
-
onSelect: this.onSelect,
|
|
70
|
-
onCollapse: this.onCollapse,
|
|
71
|
-
onExpand: this.onExpand
|
|
72
|
-
}));
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
_defineProperty(RowWithFocusSensorCallbacks, "propTypes", Row.propTypes);
|
|
78
|
-
|
|
79
|
-
export default RowWithFocusSensorCallbacks;
|