@jetbrains/ring-ui 5.0.127 → 5.0.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/alert/alert.js +2 -1
- package/components/alert/container.js +2 -1
- package/components/auth/auth__core.js +2 -1
- package/components/auth/request-builder.js +2 -1
- package/components/auth/response-parser.js +2 -1
- package/components/auth/token-validator.js +2 -1
- package/components/auth-dialog/auth-dialog.js +2 -1
- package/components/avatar/avatar.js +2 -1
- package/components/badge/badge.js +2 -1
- package/components/button/button.js +2 -1
- package/components/button-group/button-group.js +2 -1
- package/components/button-group/caption.js +2 -1
- package/components/button-set/button-set.js +2 -1
- package/components/button-toolbar/button-toolbar.js +2 -1
- package/components/caret/caret.js +2 -1
- package/components/checkbox/checkbox.js +2 -1
- package/components/code/code.js +2 -1
- package/components/confirm/confirm.js +2 -1
- package/components/content-layout/content-layout.js +2 -1
- package/components/content-layout/sidebar.js +2 -1
- package/components/data-list/data-list.js +2 -1
- package/components/data-list/item.js +2 -1
- package/components/date-picker/date-input.js +2 -1
- package/components/date-picker/date-picker.js +2 -1
- package/components/date-picker/date-popup.js +2 -1
- package/components/date-picker/day.js +2 -1
- package/components/date-picker/month-slider.js +2 -1
- package/components/date-picker/years.js +2 -1
- package/components/dialog/dialog.d.ts +4 -16
- package/components/dialog/dialog.js +6 -3
- package/components/dropdown/dropdown.js +2 -1
- package/components/error-bubble/error-bubble.js +2 -1
- package/components/error-message/error-message.js +2 -1
- package/components/footer/footer.js +1 -0
- package/components/global/react-dom-renderer.js +2 -1
- package/components/grid/col.js +2 -1
- package/components/grid/grid.js +2 -1
- package/components/grid/row.js +2 -1
- package/components/group/group.js +2 -1
- package/components/header/logo.js +2 -1
- package/components/header/profile.js +2 -1
- package/components/header/services-link.js +2 -1
- package/components/header/services.js +2 -1
- package/components/header/smart-profile.js +2 -1
- package/components/header/smart-services.js +2 -1
- package/components/header/tray-icon.js +2 -1
- package/components/header/tray.js +2 -1
- package/components/hub-source/hub-source.js +2 -1
- package/components/icon/icon.js +2 -1
- package/components/input/input.js +2 -1
- package/components/island/island.js +2 -1
- package/components/island-legacy/content-legacy.js +2 -1
- package/components/island-legacy/header-legacy.js +2 -1
- package/components/island-legacy/island-legacy.js +2 -1
- package/components/link/clickableLink.js +2 -1
- package/components/list/list.js +2 -1
- package/components/list/list__hint.js +2 -1
- package/components/list/list__users-groups-source.js +2 -1
- package/components/loader/loader.js +2 -1
- package/components/loader/loader__core.js +2 -1
- package/components/loader-screen/loader-screen.js +2 -1
- package/components/login-dialog/login-dialog.js +2 -1
- package/components/message/message.js +2 -1
- package/components/pager/pager.js +2 -1
- package/components/panel/panel.js +2 -1
- package/components/permissions/permissions.js +2 -1
- package/components/permissions/permissions__cache.js +2 -1
- package/components/popup/popup.js +2 -1
- package/components/popup-menu/popup-menu.js +2 -1
- package/components/progress-bar/progress-bar.js +2 -1
- package/components/query-assist/query-assist.js +4 -3
- package/components/radio/radio.js +2 -1
- package/components/radio/radio__item.js +2 -1
- package/components/select/select.js +2 -1
- package/components/select/select__filter.js +2 -1
- package/components/select/select__popup.js +4 -2
- package/components/shortcuts/shortcuts.js +2 -1
- package/components/storage/storage__fallback.js +2 -1
- package/components/tab-trap/tab-trap.js +2 -1
- package/components/table/cell.js +2 -1
- package/components/table/header-cell.js +2 -1
- package/components/table/header.js +2 -1
- package/components/table/multitable.js +2 -1
- package/components/table/row.d.ts +1 -0
- package/components/table/row.js +6 -4
- package/components/table/smart-table.d.ts +1 -0
- package/components/table/table.d.ts +2 -0
- package/components/table/table.js +8 -4
- package/components/tabs/smart-tabs.js +2 -1
- package/components/tabs/tab.js +2 -1
- package/components/tag/tag.js +2 -1
- package/components/tags-input/tags-input.d.ts +1 -1
- package/components/tags-input/tags-input.js +3 -2
- package/components/tags-list/tags-list.js +2 -1
- package/components/text/text.js +2 -1
- package/components/tooltip/tooltip.js +2 -1
- package/components/user-agreement/user-agreement.js +2 -1
- package/components/user-card/card.js +2 -1
- package/components/user-card/smart-user-card-tooltip.d.ts +1 -1
- package/components/user-card/smart-user-card-tooltip.js +2 -1
- package/components/user-card/tooltip.js +2 -1
- package/dist/_helpers/_rollupPluginBabelHelpers.js +1 -29
- package/dist/_helpers/anchor.js +1 -1
- package/dist/_helpers/card.js +44 -47
- package/dist/_helpers/footer.js +1 -0
- package/dist/_helpers/select__filter.js +10 -13
- package/dist/_helpers/services-link.js +10 -10
- package/dist/_helpers/sidebar.js +34 -37
- package/dist/_helpers/theme.js +1 -1
- package/dist/_helpers/title.js +12 -16
- package/dist/alert/alert.js +63 -66
- package/dist/alert/container.js +5 -5
- package/dist/alert-service/alert-service.js +5 -7
- package/dist/analytics/analytics.js +1 -2
- package/dist/analytics/analytics__custom-plugin.js +6 -8
- package/dist/auth/auth.js +1 -1
- package/dist/auth/auth__core.js +26 -26
- package/dist/auth/background-flow.js +4 -5
- package/dist/auth/iframe-flow.js +12 -12
- package/dist/auth/landing.js +1 -1
- package/dist/auth/request-builder.js +3 -5
- package/dist/auth/response-parser.js +5 -6
- package/dist/auth/storage.js +12 -12
- package/dist/auth/token-validator.js +13 -16
- package/dist/auth/window-flow.js +18 -19
- package/dist/auth-dialog/auth-dialog.js +54 -57
- package/dist/auth-dialog-service/auth-dialog-service.js +1 -1
- package/dist/auth-ng/auth-ng.js +1 -1
- package/dist/avatar/avatar.js +30 -33
- package/dist/avatar-ng/avatar-ng.js +1 -1
- package/dist/badge/badge.js +10 -10
- package/dist/badge-ng/badge-ng.js +1 -1
- package/dist/breadcrumb-ng/breadcrumb-ng.js +0 -1
- package/dist/button/button.js +24 -27
- package/dist/button-group/button-group.js +5 -5
- package/dist/button-group/caption.js +4 -4
- package/dist/button-ng/button-ng.js +68 -69
- package/dist/button-set/button-set.js +6 -6
- package/dist/button-toolbar/button-toolbar.js +6 -6
- package/dist/caret/caret.js +2 -4
- package/dist/checkbox/checkbox.js +27 -30
- package/dist/checkbox-ng/checkbox-ng.js +0 -1
- package/dist/code/code.js +17 -21
- package/dist/confirm/confirm.js +31 -34
- package/dist/confirm-ng/confirm-ng.js +1 -1
- package/dist/confirm-service/confirm-service.js +1 -1
- package/dist/content-layout/content-layout.js +17 -20
- package/dist/contenteditable/contenteditable.js +11 -11
- package/dist/data-list/data-list.js +49 -55
- package/dist/data-list/item.js +64 -67
- package/dist/data-list/selection.js +0 -1
- package/dist/data-list/title.js +1 -1
- package/dist/data-list-ng/data-list-ng.js +1 -1
- package/dist/date-picker/date-input.js +39 -42
- package/dist/date-picker/date-picker.js +162 -165
- package/dist/date-picker/date-popup.js +119 -119
- package/dist/date-picker/day.js +34 -38
- package/dist/date-picker/month-names.js +11 -14
- package/dist/date-picker/month-slider.js +24 -28
- package/dist/date-picker/month.js +1 -1
- package/dist/date-picker/months.js +1 -1
- package/dist/date-picker/years.js +9 -13
- package/dist/dialog/dialog.d.ts +4 -16
- package/dist/dialog/dialog.js +68 -65
- package/dist/dialog-ng/dialog-ng.js +21 -22
- package/dist/docked-panel-ng/docked-panel-ng.js +0 -1
- package/dist/dropdown/dropdown.js +101 -104
- package/dist/dropdown-menu/dropdown-menu.js +1 -1
- package/dist/editable-heading/editable-heading.js +1 -1
- package/dist/error-bubble/error-bubble.js +6 -6
- package/dist/error-message/error-message.js +10 -10
- package/dist/error-message-ng/error-message-ng.js +0 -1
- package/dist/footer-ng/footer-ng.js +19 -21
- package/dist/global/angular-component-factory.js +2 -3
- package/dist/global/dom.js +1 -5
- package/dist/global/focus-sensor-hoc.js +58 -61
- package/dist/global/listeners.js +1 -5
- package/dist/global/react-dom-renderer.js +8 -12
- package/dist/global/rerender-hoc.js +1 -5
- package/dist/global/ring-angular-component.js +1 -3
- package/dist/grid/col.js +13 -14
- package/dist/grid/grid.js +5 -5
- package/dist/grid/row.js +16 -17
- package/dist/group/group.js +5 -5
- package/dist/header/header.js +10 -10
- package/dist/header/logo.js +9 -9
- package/dist/header/profile.js +58 -58
- package/dist/header/services.js +19 -22
- package/dist/header/smart-profile.js +40 -43
- package/dist/header/smart-services.js +28 -31
- package/dist/header/tray-icon.js +6 -6
- package/dist/header/tray.js +5 -5
- package/dist/heading/heading.js +1 -1
- package/dist/heading-ng/heading-ng.js +1 -1
- package/dist/http/http.js +111 -107
- package/dist/http/http.mock.js +3 -4
- package/dist/hub-source/hub-source.js +7 -9
- package/dist/hub-source/hub-source__user.js +0 -1
- package/dist/hub-source/hub-source__users-groups.js +4 -5
- package/dist/icon/icon.js +18 -18
- package/dist/icon/icon__svg.js +1 -1
- package/dist/icon-ng/icon-ng.js +0 -1
- package/dist/input/input.js +35 -38
- package/dist/input-ng/input-ng.js +25 -26
- package/dist/island/adaptive-island-hoc.js +21 -25
- package/dist/island/content.js +62 -65
- package/dist/island/header.js +11 -11
- package/dist/island/island.js +8 -8
- package/dist/island-legacy/content-legacy.js +5 -5
- package/dist/island-legacy/header-legacy.js +5 -5
- package/dist/island-legacy/island-legacy.js +5 -5
- package/dist/link/clickableLink.js +27 -30
- package/dist/link/link.js +16 -16
- package/dist/list/list.js +389 -391
- package/dist/list/list__custom.js +6 -10
- package/dist/list/list__hint.js +3 -4
- package/dist/list/list__item.js +4 -7
- package/dist/list/list__link.js +1 -1
- package/dist/list/list__users-groups-source.js +3 -3
- package/dist/loader/loader.js +16 -19
- package/dist/loader/loader__core.js +62 -62
- package/dist/loader-inline/loader-inline.js +6 -6
- package/dist/loader-ng/loader-ng.js +3 -4
- package/dist/loader-screen/loader-screen.js +6 -6
- package/dist/loader-screen-ng/loader-screen-ng.js +0 -1
- package/dist/login-dialog/login-dialog.js +55 -58
- package/dist/login-dialog/service.js +1 -1
- package/dist/markdown/code.js +0 -1
- package/dist/markdown/markdown.js +1 -1
- package/dist/message/message.js +22 -25
- package/dist/old-browsers-message/white-list.js +2 -2
- package/dist/pager/pager.js +55 -58
- package/dist/pager-ng/pager-ng.js +1 -1
- package/dist/panel/panel.js +5 -5
- package/dist/panel-ng/panel-ng.js +0 -1
- package/dist/permissions/permissions.js +14 -16
- package/dist/permissions/permissions__cache.js +4 -6
- package/dist/permissions-ng/permissions-ng.js +1 -1
- package/dist/place-under-ng/place-under-ng.js +0 -1
- package/dist/popup/popup.js +118 -121
- package/dist/popup/popup.target.js +1 -1
- package/dist/popup/position.js +0 -1
- package/dist/popup-menu/popup-menu.js +19 -22
- package/dist/progress-bar/progress-bar.js +41 -44
- package/dist/progress-bar-ng/progress-bar-ng.js +1 -1
- package/dist/promised-click-ng/promised-click-ng.js +0 -1
- package/dist/query-assist/query-assist.js +507 -501
- package/dist/query-assist/query-assist__suggestions.js +1 -1
- package/dist/query-assist-ng/query-assist-ng.js +1 -1
- package/dist/radio/radio.js +10 -13
- package/dist/radio/radio__item.js +19 -22
- package/dist/select/select.js +350 -349
- package/dist/select/select__popup.js +148 -152
- package/dist/select-ng/select-ng.js +1 -1
- package/dist/select-ng/select-ng__lazy.js +4 -4
- package/dist/select-ng/select-ng__options.js +14 -15
- package/dist/shortcuts/core.js +35 -36
- package/dist/shortcuts/shortcuts-hoc.js +7 -11
- package/dist/shortcuts/shortcuts.js +10 -11
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +0 -1
- package/dist/shortcuts-ng/shortcuts-ng.js +0 -1
- package/dist/sidebar-ng/sidebar-ng.js +0 -1
- package/dist/storage/storage.js +1 -1
- package/dist/storage/storage__fallback.js +8 -10
- package/dist/storage/storage__local.js +2 -2
- package/dist/style.css +1 -1
- package/dist/tab-trap/tab-trap.js +84 -86
- package/dist/table/cell.js +6 -6
- package/dist/table/disable-hover-hoc.js +23 -25
- package/dist/table/header-cell.js +28 -31
- package/dist/table/header.js +58 -61
- package/dist/table/multitable.js +91 -95
- package/dist/table/row-with-focus-sensor.js +15 -18
- package/dist/table/row.d.ts +1 -0
- package/dist/table/row.js +54 -55
- package/dist/table/selection-shortcuts-hoc.js +145 -147
- package/dist/table/selection.js +7 -9
- package/dist/table/smart-table.d.ts +1 -0
- package/dist/table/smart-table.js +21 -24
- package/dist/table/table.d.ts +2 -0
- package/dist/table/table.js +107 -109
- package/dist/table-legacy-ng/table-legacy-ng.js +1 -1
- package/dist/table-legacy-ng/table-legacy-ng__pager.js +1 -1
- package/dist/table-legacy-ng/table-legacy-ng__selection.js +1 -3
- package/dist/table-legacy-ng/table-legacy-ng__toolbar.js +0 -1
- package/dist/table-ng/smart-table-ng.js +1 -1
- package/dist/table-ng/table-ng.js +1 -1
- package/dist/tabs/collapsible-more.js +1 -1
- package/dist/tabs/collapsible-tab.js +1 -1
- package/dist/tabs/dumb-tabs.js +46 -49
- package/dist/tabs/smart-tabs.js +10 -10
- package/dist/tabs/tab.js +7 -8
- package/dist/tag/tag.js +42 -45
- package/dist/tags-input/tags-input.d.ts +1 -1
- package/dist/tags-input/tags-input.js +214 -213
- package/dist/tags-input-ng/tags-input-ng.js +1 -1
- package/dist/tags-list/tags-list.js +20 -20
- package/dist/template-ng/template-ng.js +25 -26
- package/dist/text/text.js +6 -6
- package/dist/toggle/toggle.js +19 -19
- package/dist/toggle-ng/toggle-ng.js +1 -1
- package/dist/tooltip/tooltip.js +86 -89
- package/dist/tooltip-ng/tooltip-ng.js +1 -1
- package/dist/user-agreement/service.js +207 -205
- package/dist/user-agreement/user-agreement.js +39 -42
- package/dist/user-card/smart-user-card-tooltip.d.ts +1 -1
- package/dist/user-card/smart-user-card-tooltip.js +32 -35
- package/dist/user-card/tooltip.js +26 -26
- package/dist/user-card-ng/user-card-ng.js +1 -1
- package/package.json +17 -17
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React, { PureComponent, Component } from 'react';
|
|
1
|
+
import React, { Component, PureComponent } from 'react';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
4
|
import focusSensorHOC from '../global/focus-sensor-hoc.js';
|
|
@@ -12,6 +11,7 @@ import { refObject } from '../global/prop-types.js';
|
|
|
12
11
|
import Item, { moreLessButtonStates } from './item.js';
|
|
13
12
|
import { m as modules_09d014b4 } from '../_helpers/title.js';
|
|
14
13
|
import Selection from './selection.js';
|
|
14
|
+
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
15
15
|
import '../global/composeRefs.js';
|
|
16
16
|
import '../table/selection.js';
|
|
17
17
|
import '../shortcuts/core.js';
|
|
@@ -46,47 +46,12 @@ import '@jetbrains/icons/remove-14px';
|
|
|
46
46
|
import '../_helpers/checkbox.js';
|
|
47
47
|
|
|
48
48
|
class DataList extends PureComponent {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
onSelect
|
|
56
|
-
} = this.props;
|
|
57
|
-
onSelect(selection.focus(item));
|
|
58
|
-
});
|
|
59
|
-
_defineProperty(this, "onItemSelect", (item, selected) => {
|
|
60
|
-
const {
|
|
61
|
-
selection,
|
|
62
|
-
onSelect
|
|
63
|
-
} = this.props;
|
|
64
|
-
if (selected) {
|
|
65
|
-
onSelect(selection.select(item));
|
|
66
|
-
} else {
|
|
67
|
-
onSelect(selection.deselect(item));
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
_defineProperty(this, "onEqualPress", () => {
|
|
71
|
-
const {
|
|
72
|
-
selection,
|
|
73
|
-
itemFormatter
|
|
74
|
-
} = this.props;
|
|
75
|
-
const focused = selection.getFocused();
|
|
76
|
-
if (focused == null) {
|
|
77
|
-
throw new Error('No focused item');
|
|
78
|
-
}
|
|
79
|
-
const item = itemFormatter(focused);
|
|
80
|
-
if (item.collapsed) {
|
|
81
|
-
item.onExpand?.();
|
|
82
|
-
} else {
|
|
83
|
-
item.onCollapse?.();
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
_defineProperty(this, "shortcutsMap", {
|
|
87
|
-
'=': this.onEqualPress
|
|
88
|
-
});
|
|
89
|
-
}
|
|
49
|
+
static defaultProps = {
|
|
50
|
+
loading: false,
|
|
51
|
+
onItemMoreLess: () => {},
|
|
52
|
+
itemMoreLessState: () => moreLessButtonStates.UNUSED,
|
|
53
|
+
remoteSelection: false
|
|
54
|
+
};
|
|
90
55
|
componentDidUpdate(prevProps) {
|
|
91
56
|
const {
|
|
92
57
|
data,
|
|
@@ -103,6 +68,44 @@ class DataList extends PureComponent {
|
|
|
103
68
|
onSelect(selection.resetSelection());
|
|
104
69
|
}
|
|
105
70
|
}
|
|
71
|
+
shortcutsScope = getUID('ring-data-list-');
|
|
72
|
+
onItemFocus = item => {
|
|
73
|
+
const {
|
|
74
|
+
selection,
|
|
75
|
+
onSelect
|
|
76
|
+
} = this.props;
|
|
77
|
+
onSelect(selection.focus(item));
|
|
78
|
+
};
|
|
79
|
+
onItemSelect = (item, selected) => {
|
|
80
|
+
const {
|
|
81
|
+
selection,
|
|
82
|
+
onSelect
|
|
83
|
+
} = this.props;
|
|
84
|
+
if (selected) {
|
|
85
|
+
onSelect(selection.select(item));
|
|
86
|
+
} else {
|
|
87
|
+
onSelect(selection.deselect(item));
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
onEqualPress = () => {
|
|
91
|
+
const {
|
|
92
|
+
selection,
|
|
93
|
+
itemFormatter
|
|
94
|
+
} = this.props;
|
|
95
|
+
const focused = selection.getFocused();
|
|
96
|
+
if (focused == null) {
|
|
97
|
+
throw new Error('No focused item');
|
|
98
|
+
}
|
|
99
|
+
const item = itemFormatter(focused);
|
|
100
|
+
if (item.collapsed) {
|
|
101
|
+
item.onExpand?.();
|
|
102
|
+
} else {
|
|
103
|
+
item.onCollapse?.();
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
shortcutsMap = {
|
|
107
|
+
'=': this.onEqualPress
|
|
108
|
+
};
|
|
106
109
|
render() {
|
|
107
110
|
const {
|
|
108
111
|
data,
|
|
@@ -165,12 +168,6 @@ class DataList extends PureComponent {
|
|
|
165
168
|
}, /*#__PURE__*/React.createElement(Loader, null)));
|
|
166
169
|
}
|
|
167
170
|
}
|
|
168
|
-
_defineProperty(DataList, "defaultProps", {
|
|
169
|
-
loading: false,
|
|
170
|
-
onItemMoreLess: () => {},
|
|
171
|
-
itemMoreLessState: () => moreLessButtonStates.UNUSED,
|
|
172
|
-
remoteSelection: false
|
|
173
|
-
});
|
|
174
171
|
DataList.propTypes = {
|
|
175
172
|
className: PropTypes.string,
|
|
176
173
|
data: PropTypes.array.isRequired,
|
|
@@ -190,15 +187,12 @@ DataList.propTypes = {
|
|
|
190
187
|
const getContainer = () => disableHoverHOC(selectionShortcutsHOC(focusSensorHOC(DataList)));
|
|
191
188
|
// eslint-disable-next-line react/no-multi-comp
|
|
192
189
|
class DataListContainer extends Component {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
_defineProperty(this, "DataList", getContainer());
|
|
197
|
-
}
|
|
190
|
+
static propTypes = getContainer().propTypes;
|
|
191
|
+
// https://stackoverflow.com/a/53882322/6304152
|
|
192
|
+
DataList = getContainer();
|
|
198
193
|
render() {
|
|
199
194
|
return /*#__PURE__*/React.createElement(this.DataList, this.props);
|
|
200
195
|
}
|
|
201
196
|
}
|
|
202
|
-
_defineProperty(DataListContainer, "propTypes", getContainer().propTypes);
|
|
203
197
|
|
|
204
198
|
export { DataListContainer as default };
|
package/dist/data-list/item.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import React, { PureComponent } from 'react';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import chevronRightIcon from '@jetbrains/icons/chevron-right';
|
|
@@ -9,6 +8,7 @@ import LoaderInline from '../loader-inline/loader-inline.js';
|
|
|
9
8
|
import { Button } from '../button/button.js';
|
|
10
9
|
import Selection$1 from '../table/selection.js';
|
|
11
10
|
import { m as modules_09d014b4, T as Title } from '../_helpers/title.js';
|
|
11
|
+
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
12
12
|
import 'focus-visible';
|
|
13
13
|
import 'classnames';
|
|
14
14
|
import '../global/memoize.js';
|
|
@@ -43,66 +43,70 @@ var moreLessButtonStates;
|
|
|
43
43
|
const ITEM_LEFT_OFFSET = 32;
|
|
44
44
|
const LIST_LEFT_OFFSET = 24;
|
|
45
45
|
class Item extends PureComponent {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
46
|
+
static defaultProps = {
|
|
47
|
+
items: [],
|
|
48
|
+
level: 0,
|
|
49
|
+
parentShift: 0,
|
|
50
|
+
showMoreLessButton: moreLessButtonStates.UNUSED,
|
|
51
|
+
onItemMoreLess: () => {}
|
|
52
|
+
};
|
|
53
|
+
onShowMore = () => {
|
|
54
|
+
const {
|
|
55
|
+
onItemMoreLess,
|
|
56
|
+
item
|
|
57
|
+
} = this.props;
|
|
58
|
+
onItemMoreLess(item, true);
|
|
59
|
+
};
|
|
60
|
+
onShowLess = () => {
|
|
61
|
+
const {
|
|
62
|
+
onItemMoreLess,
|
|
63
|
+
item
|
|
64
|
+
} = this.props;
|
|
65
|
+
onItemMoreLess(item, false);
|
|
66
|
+
};
|
|
67
|
+
onFocus = () => {
|
|
68
|
+
const {
|
|
69
|
+
onFocus,
|
|
70
|
+
item
|
|
71
|
+
} = this.props;
|
|
72
|
+
onFocus(item);
|
|
73
|
+
};
|
|
74
|
+
onSelect = selected => {
|
|
75
|
+
const {
|
|
76
|
+
onSelect,
|
|
77
|
+
item
|
|
78
|
+
} = this.props;
|
|
79
|
+
onSelect(item, selected);
|
|
80
|
+
};
|
|
81
|
+
renderItem = (model, parentShift) => {
|
|
82
|
+
const {
|
|
83
|
+
onFocus,
|
|
84
|
+
onSelect,
|
|
85
|
+
selection,
|
|
86
|
+
level,
|
|
87
|
+
itemFormatter
|
|
88
|
+
} = this.props;
|
|
89
|
+
const item = itemFormatter(model);
|
|
90
|
+
return /*#__PURE__*/React.createElement(Item, {
|
|
91
|
+
key: item.key || item.id,
|
|
92
|
+
item: model,
|
|
93
|
+
title: item.title,
|
|
94
|
+
items: item.items,
|
|
95
|
+
level: level + 1,
|
|
96
|
+
parentShift: parentShift,
|
|
97
|
+
itemFormatter: itemFormatter,
|
|
98
|
+
collapsible: item.collapsible,
|
|
99
|
+
collapsed: item.collapsed,
|
|
100
|
+
onCollapse: item.onCollapse,
|
|
101
|
+
onExpand: item.onExpand,
|
|
102
|
+
showFocus: selection.isFocused(model),
|
|
103
|
+
onFocus: onFocus,
|
|
104
|
+
selection: selection,
|
|
105
|
+
selectable: item.selectable,
|
|
106
|
+
selected: selection.isSelected(model),
|
|
107
|
+
onSelect: onSelect
|
|
104
108
|
});
|
|
105
|
-
}
|
|
109
|
+
};
|
|
106
110
|
render() {
|
|
107
111
|
const {
|
|
108
112
|
title,
|
|
@@ -179,13 +183,6 @@ class Item extends PureComponent {
|
|
|
179
183
|
}, moreLessButton) : null) : null);
|
|
180
184
|
}
|
|
181
185
|
}
|
|
182
|
-
_defineProperty(Item, "defaultProps", {
|
|
183
|
-
items: [],
|
|
184
|
-
level: 0,
|
|
185
|
-
parentShift: 0,
|
|
186
|
-
showMoreLessButton: moreLessButtonStates.UNUSED,
|
|
187
|
-
onItemMoreLess: () => {}
|
|
188
|
-
});
|
|
189
186
|
Item.propTypes = {
|
|
190
187
|
item: PropTypes.shape({
|
|
191
188
|
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
|
package/dist/data-list/title.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import 'react';
|
|
3
2
|
import 'prop-types';
|
|
4
3
|
import 'classnames';
|
|
@@ -7,6 +6,7 @@ import '../checkbox/checkbox.js';
|
|
|
7
6
|
import '../global/get-uid.js';
|
|
8
7
|
import '../global/prop-types.js';
|
|
9
8
|
export { T as default } from '../_helpers/title.js';
|
|
9
|
+
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
10
10
|
import '../global/composeRefs.js';
|
|
11
11
|
import '@jetbrains/icons/checkmark-14px';
|
|
12
12
|
import '@jetbrains/icons/remove-14px';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import angularComponentFactory from '../global/angular-component-factory.js';
|
|
2
2
|
import DataListContainer from '../data-list/data-list.js';
|
|
3
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
4
3
|
import 'angular';
|
|
5
4
|
import 'react';
|
|
6
5
|
import '../global/react-render-adapter.js';
|
|
@@ -10,6 +9,7 @@ import '../global/react-dom-renderer.js';
|
|
|
10
9
|
import 'prop-types';
|
|
11
10
|
import 'classnames';
|
|
12
11
|
import '../global/focus-sensor-hoc.js';
|
|
12
|
+
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
13
13
|
import '../global/prop-types.js';
|
|
14
14
|
import '../global/composeRefs.js';
|
|
15
15
|
import '../table/selection-shortcuts-hoc.js';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
@@ -6,6 +5,7 @@ import { Input } from '../input/input.js';
|
|
|
6
5
|
import { ControlsHeight } from '../global/controls-height.js';
|
|
7
6
|
import { dateType } from './consts.js';
|
|
8
7
|
import { m as modules_0c7b7d96 } from '../_helpers/date-picker.js';
|
|
8
|
+
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import '@jetbrains/icons/close-12px';
|
|
10
10
|
import '../global/prop-types.js';
|
|
11
11
|
import '../button/button.js';
|
|
@@ -26,16 +26,37 @@ import '../input/input-label.js';
|
|
|
26
26
|
import 'date-fns/add';
|
|
27
27
|
|
|
28
28
|
class DateInput extends React.PureComponent {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
static propTypes = {
|
|
30
|
+
active: PropTypes.bool,
|
|
31
|
+
divider: PropTypes.bool,
|
|
32
|
+
name: PropTypes.string,
|
|
33
|
+
text: PropTypes.string,
|
|
34
|
+
hoverDate: dateType,
|
|
35
|
+
date: dateType,
|
|
36
|
+
time: PropTypes.string,
|
|
37
|
+
displayFormat: PropTypes.func,
|
|
38
|
+
hidden: PropTypes.bool,
|
|
39
|
+
translations: PropTypes.object,
|
|
40
|
+
fromPlaceholder: PropTypes.string,
|
|
41
|
+
toPlaceholder: PropTypes.string,
|
|
42
|
+
timePlaceholder: PropTypes.string,
|
|
43
|
+
onInput: PropTypes.func,
|
|
44
|
+
onActivate: PropTypes.func,
|
|
45
|
+
onConfirm: PropTypes.func,
|
|
46
|
+
onClear: PropTypes.func,
|
|
47
|
+
locale: PropTypes.object
|
|
48
|
+
};
|
|
49
|
+
static defaultProps = {
|
|
50
|
+
fromPlaceholder: null,
|
|
51
|
+
toPlaceholder: null,
|
|
52
|
+
timePlaceholder: null,
|
|
53
|
+
translations: {
|
|
54
|
+
addFirstDate: 'Add first date',
|
|
55
|
+
addSecondDate: 'Add second date',
|
|
56
|
+
addTime: 'Add time',
|
|
57
|
+
selectName: 'Select %name%'
|
|
58
|
+
}
|
|
59
|
+
};
|
|
39
60
|
componentDidUpdate(prevProps) {
|
|
40
61
|
const {
|
|
41
62
|
hidden,
|
|
@@ -49,6 +70,11 @@ class DateInput extends React.PureComponent {
|
|
|
49
70
|
});
|
|
50
71
|
}
|
|
51
72
|
}
|
|
73
|
+
input;
|
|
74
|
+
inputRef = el => {
|
|
75
|
+
this.input = el;
|
|
76
|
+
this.updateInput(this.props);
|
|
77
|
+
};
|
|
52
78
|
updateInput(_ref) {
|
|
53
79
|
let {
|
|
54
80
|
text,
|
|
@@ -67,6 +93,8 @@ class DateInput extends React.PureComponent {
|
|
|
67
93
|
el.blur();
|
|
68
94
|
}
|
|
69
95
|
}
|
|
96
|
+
handleChange = e => this.props.onInput(e.currentTarget.value, e.currentTarget.dataset.name);
|
|
97
|
+
handleKeyDown = e => e.key === 'Enter' && this.props.onConfirm();
|
|
70
98
|
render() {
|
|
71
99
|
const {
|
|
72
100
|
active,
|
|
@@ -124,36 +152,5 @@ class DateInput extends React.PureComponent {
|
|
|
124
152
|
});
|
|
125
153
|
}
|
|
126
154
|
}
|
|
127
|
-
_defineProperty(DateInput, "propTypes", {
|
|
128
|
-
active: PropTypes.bool,
|
|
129
|
-
divider: PropTypes.bool,
|
|
130
|
-
name: PropTypes.string,
|
|
131
|
-
text: PropTypes.string,
|
|
132
|
-
hoverDate: dateType,
|
|
133
|
-
date: dateType,
|
|
134
|
-
time: PropTypes.string,
|
|
135
|
-
displayFormat: PropTypes.func,
|
|
136
|
-
hidden: PropTypes.bool,
|
|
137
|
-
translations: PropTypes.object,
|
|
138
|
-
fromPlaceholder: PropTypes.string,
|
|
139
|
-
toPlaceholder: PropTypes.string,
|
|
140
|
-
timePlaceholder: PropTypes.string,
|
|
141
|
-
onInput: PropTypes.func,
|
|
142
|
-
onActivate: PropTypes.func,
|
|
143
|
-
onConfirm: PropTypes.func,
|
|
144
|
-
onClear: PropTypes.func,
|
|
145
|
-
locale: PropTypes.object
|
|
146
|
-
});
|
|
147
|
-
_defineProperty(DateInput, "defaultProps", {
|
|
148
|
-
fromPlaceholder: null,
|
|
149
|
-
toPlaceholder: null,
|
|
150
|
-
timePlaceholder: null,
|
|
151
|
-
translations: {
|
|
152
|
-
addFirstDate: 'Add first date',
|
|
153
|
-
addSecondDate: 'Add second date',
|
|
154
|
-
addTime: 'Add time',
|
|
155
|
-
selectName: 'Select %name%'
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
155
|
|
|
159
156
|
export { DateInput as default };
|