@jetbrains/ring-ui-built 7.0.66 → 7.0.70
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/_helpers/anchor.js +12 -17
- package/components/_helpers/avatar-info.js +4 -5
- package/components/_helpers/button.classes.js +20 -21
- package/components/_helpers/caption.js +3 -3
- package/components/_helpers/card.js +26 -32
- package/components/_helpers/dialog-body-scroll-preventer.js +1 -2
- package/components/_helpers/icon-svg.js +9 -12
- package/components/_helpers/input.js +78 -86
- package/components/_helpers/loader-core.js +260 -0
- package/components/_helpers/query-assist-suggestions.js +0 -1
- package/components/_helpers/select-filter.js +19 -26
- package/components/_helpers/services-link.js +9 -12
- package/components/_helpers/sidebar.js +36 -44
- package/components/_helpers/tab-link.js +9 -11
- package/components/_helpers/theme.js +20 -24
- package/components/_helpers/title.js +12 -17
- package/components/alert/alert.js +41 -49
- package/components/alert/container.js +9 -12
- package/components/alert-service/alert-service.js +23 -32
- package/components/analytics/analytics-custom-plugin.js +12 -17
- package/components/analytics/analytics.js +1 -3
- package/components/auth/auth-core.js +128 -170
- package/components/auth/auth.js +3 -10
- package/components/auth/background-flow.js +5 -8
- package/components/auth/down-notification.js +9 -17
- package/components/auth/iframe-flow.js +13 -19
- package/components/auth/request-builder.js +4 -9
- package/components/auth/response-parser.js +9 -12
- package/components/auth/storage.js +12 -18
- package/components/auth/token-validator.js +19 -30
- package/components/auth/window-flow.js +22 -27
- package/components/auth-dialog/auth-dialog.js +40 -48
- package/components/auth-dialog-service/auth-dialog-service.js +10 -13
- package/components/avatar/avatar.figma.js +6 -6
- package/components/avatar/avatar.js +58 -59
- package/components/avatar/fallback-avatar.js +8 -11
- package/components/avatar-stack/avatar-stack.figma.js +10 -11
- package/components/avatar-stack/avatar-stack.js +25 -31
- package/components/banner/banner.js +0 -6
- package/components/breadcrumbs/breadcrumbs.figma.js +8 -6
- package/components/breadcrumbs/breadcrumbs.js +4 -5
- package/components/button/button.figma.js +15 -10
- package/components/button/button.js +59 -64
- package/components/button-group/button-group.js +11 -15
- package/components/button-group/caption.js +0 -1
- package/components/button-set/button-set.js +9 -12
- package/components/button-toolbar/button-toolbar.js +8 -11
- package/components/caret/caret.js +20 -28
- package/components/checkbox/checkbox-group.figma.js +8 -10
- package/components/checkbox/checkbox.figma.js +5 -5
- package/components/checkbox/checkbox.js +27 -35
- package/components/clipboard/clipboard-fallback.js +3 -3
- package/components/clipboard/clipboard.js +3 -16
- package/components/code/code.js +8 -14
- package/components/collapse/collapse-content.js +10 -15
- package/components/collapse/collapse-control.js +5 -7
- package/components/collapse/collapse.js +9 -11
- package/components/collapse/utils.js +1 -1
- package/components/confirm/confirm.js +17 -26
- package/components/confirm-service/confirm-service.js +30 -31
- package/components/content-layout/content-layout.js +21 -28
- package/components/content-layout/sidebar.js +0 -2
- package/components/contenteditable/contenteditable.js +23 -28
- package/components/control-help/control-help.js +8 -10
- package/components/control-label/control-label.js +12 -17
- package/components/data-list/data-list.js +57 -65
- package/components/data-list/data-list.mock.js +0 -4
- package/components/data-list/item.js +65 -72
- package/components/data-list/selection.js +11 -19
- package/components/data-list/title.js +0 -4
- package/components/date-picker/consts.js +3 -4
- package/components/date-picker/date-input.js +25 -33
- package/components/date-picker/date-picker.js +179 -193
- package/components/date-picker/date-popup.js +135 -127
- package/components/date-picker/day.d.ts +1 -1
- package/components/date-picker/day.js +24 -30
- package/components/date-picker/month-names.js +7 -12
- package/components/date-picker/month-slider.js +16 -22
- package/components/date-picker/month.js +3 -5
- package/components/date-picker/months.js +6 -6
- package/components/date-picker/weekdays.js +0 -1
- package/components/date-picker/years.js +20 -26
- package/components/dialog/dialog-body-scroll-preventer.js +0 -1
- package/components/dialog/dialog.js +73 -83
- package/components/dropdown/anchor.js +0 -4
- package/components/dropdown/dropdown.js +98 -114
- package/components/dropdown-menu/dropdown-menu.js +80 -79
- package/components/editable-heading/editable-heading.js +48 -54
- package/components/error-bubble/error-bubble.figma.js +4 -4
- package/components/error-bubble/error-bubble.js +9 -13
- package/components/error-message/error-message.js +1 -6
- package/components/footer/footer.js +11 -15
- package/components/global/compose-refs.js +1 -4
- package/components/global/compose.js +1 -4
- package/components/global/configuration.js +3 -3
- package/components/global/controls-height.js +0 -1
- package/components/global/create-stateful-context.js +10 -14
- package/components/global/data-tests.js +2 -10
- package/components/global/dom.js +6 -19
- package/components/global/focus-sensor-hoc.js +74 -87
- package/components/global/fuzzy-highlight.js +3 -8
- package/components/global/get-uid.js +1 -1
- package/components/global/inject-styles.js +5 -6
- package/components/global/listeners.js +2 -11
- package/components/global/memoize.js +0 -2
- package/components/global/normalize-indent.js +2 -6
- package/components/global/promise-with-timeout.js +4 -5
- package/components/global/react-dom-renderer.js +4 -9
- package/components/global/rerender-hoc.js +8 -11
- package/components/global/schedule-raf.js +1 -2
- package/components/global/theme.js +0 -5
- package/components/global/trivial-template-tag.js +1 -6
- package/components/global/url.js +2 -6
- package/components/global/use-event-callback.js +2 -3
- package/components/grid/col.js +7 -18
- package/components/grid/grid.js +9 -14
- package/components/grid/row.js +7 -11
- package/components/group/group.js +9 -12
- package/components/header/header-icon.js +8 -13
- package/components/header/header.js +16 -27
- package/components/header/links.js +7 -10
- package/components/header/logo.js +12 -16
- package/components/header/profile.js +73 -83
- package/components/header/services-link.js +0 -2
- package/components/header/services.js +32 -43
- package/components/header/smart-profile.js +44 -59
- package/components/header/smart-services.js +33 -45
- package/components/header/tray.js +8 -10
- package/components/heading/heading.js +27 -27
- package/components/http/http.js +120 -125
- package/components/http/http.mock.js +6 -10
- package/components/hub-source/hub-source-user.js +6 -13
- package/components/hub-source/hub-source-users-groups.js +8 -12
- package/components/hub-source/hub-source.js +8 -10
- package/components/i18n/i18n-context.js +4 -7
- package/components/i18n/i18n.js +5 -5
- package/components/icon/icon-svg.js +0 -4
- package/components/icon/icon.js +28 -32
- package/components/icon/index.js +0 -4
- package/components/input/input.figma.js +8 -8
- package/components/input/input.js +0 -4
- package/components/island/adaptive-island-hoc.js +19 -23
- package/components/island/content.js +70 -75
- package/components/island/header.js +21 -21
- package/components/island/island.js +11 -14
- package/components/link/clickable-link.js +30 -37
- package/components/link/link.js +27 -29
- package/components/list/list-custom.js +6 -11
- package/components/list/list-item.js +49 -56
- package/components/list/list-separator.js +0 -1
- package/components/list/list-title.js +0 -1
- package/components/list/list-users-groups-source.js +14 -22
- package/components/list/list.classes.js +8 -9
- package/components/list/list.js +387 -404
- package/components/loader/loader-core.js +2 -265
- package/components/loader/loader.d.ts +8 -0
- package/components/loader/loader.js +43 -29
- package/components/loader-inline/loader-inline.js +9 -12
- package/components/loader-screen/loader-screen.js +10 -14
- package/components/login-dialog/login-dialog.js +46 -54
- package/components/login-dialog/service.js +13 -15
- package/components/message/message.js +65 -79
- package/components/old-browsers-message/old-browsers-message-stop.js +0 -3
- package/components/old-browsers-message/old-browsers-message.js +1 -4
- package/components/old-browsers-message/white-list.js +5 -7
- package/components/pager/pager.js +73 -88
- package/components/panel/panel.js +9 -12
- package/components/permissions/permissions-cache.js +6 -8
- package/components/permissions/permissions.js +19 -21
- package/components/popup/popup.js +136 -145
- package/components/popup/popup.target.js +8 -10
- package/components/popup/position-css.js +19 -27
- package/components/popup/position.js +22 -28
- package/components/popup-menu/popup-menu.js +27 -37
- package/components/progress-bar/progress-bar.js +26 -32
- package/components/query-assist/query-assist-suggestions.js +0 -6
- package/components/query-assist/query-assist.js +432 -468
- package/components/radio/radio-item.js +30 -40
- package/components/radio/radio.js +6 -10
- package/components/scrollable-section/scrollable-section.js +7 -10
- package/components/select/select-filter.js +0 -6
- package/components/select/select-popup.js +155 -174
- package/components/select/select.js +464 -479
- package/components/shortcuts/core.js +40 -45
- package/components/shortcuts/shortcut-title.js +0 -1
- package/components/shortcuts/shortcuts-hoc.js +9 -15
- package/components/shortcuts/shortcuts.js +3 -5
- package/components/slider/slider.js +53 -66
- package/components/slider/slider.utils.js +1 -4
- package/components/storage/storage-local.js +2 -8
- package/components/storage/storage.js +0 -5
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +21 -30
- package/components/table/cell.js +3 -4
- package/components/table/disable-hover-hoc.js +24 -28
- package/components/table/header-cell.js +30 -38
- package/components/table/header.js +20 -28
- package/components/table/multitable.js +81 -101
- package/components/table/row-with-focus-sensor.js +17 -28
- package/components/table/row.js +89 -99
- package/components/table/selection-adapter.js +0 -2
- package/components/table/selection-shortcuts-hoc.js +159 -161
- package/components/table/selection.js +23 -31
- package/components/table/simple-table.js +16 -22
- package/components/table/smart-table.js +19 -26
- package/components/table/table.js +137 -146
- package/components/tabs/collapsible-more.js +34 -47
- package/components/tabs/collapsible-tab.js +28 -33
- package/components/tabs/collapsible-tabs.js +16 -24
- package/components/tabs/custom-item.js +3 -6
- package/components/tabs/dumb-tabs.js +48 -64
- package/components/tabs/smart-tabs.js +14 -23
- package/components/tabs/tab-link.js +0 -2
- package/components/tabs/tab.js +0 -1
- package/components/tabs/tabs.js +0 -7
- package/components/tag/tag.js +30 -35
- package/components/tags-input/tags-input.js +192 -218
- package/components/tags-list/tags-list.js +26 -31
- package/components/text/text.js +16 -19
- package/components/toggle/toggle.js +19 -23
- package/components/tooltip/tooltip.js +110 -121
- package/components/upload/upload.js +19 -28
- package/components/user-agreement/service.js +247 -252
- package/components/user-agreement/toolbox.eula.js +160 -1
- package/components/user-agreement/user-agreement.js +23 -32
- package/components/user-card/card.js +0 -5
- package/components/user-card/smart-user-card-tooltip.js +41 -50
- package/components/user-card/tooltip.js +32 -38
- package/components/user-card/user-card.js +0 -5
- package/package.json +9 -3
- package/components/_helpers/_rollupPluginBabelHelpers.js +0 -72
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
|
|
5
4
|
var styles = {"label":"ring-control-label-label","formLabel":"ring-control-label-formLabel","secondaryLabel":"ring-control-label-secondaryLabel","disabledLabel":"ring-control-label-disabledLabel"};
|
|
6
5
|
|
|
7
|
-
const _excluded = ["children", "type", "disabled"];
|
|
8
6
|
var LabelType;
|
|
9
7
|
(function (LabelType) {
|
|
10
8
|
LabelType["SECONDARY"] = "secondary";
|
|
@@ -14,20 +12,17 @@ const classNameByType = {
|
|
|
14
12
|
[LabelType.SECONDARY]: styles.secondaryLabel,
|
|
15
13
|
[LabelType.FORM]: styles.formLabel
|
|
16
14
|
};
|
|
17
|
-
const ControlLabel =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
children: children
|
|
30
|
-
}));
|
|
31
|
-
};
|
|
15
|
+
const ControlLabel = ({
|
|
16
|
+
children,
|
|
17
|
+
type = LabelType.SECONDARY,
|
|
18
|
+
disabled,
|
|
19
|
+
...rest
|
|
20
|
+
}) => jsx("label", {
|
|
21
|
+
className: classNames(styles.label, classNameByType[type], {
|
|
22
|
+
[styles.disabledLabel]: disabled
|
|
23
|
+
}),
|
|
24
|
+
...rest,
|
|
25
|
+
children: children
|
|
26
|
+
});
|
|
32
27
|
|
|
33
28
|
export { ControlLabel, LabelType, ControlLabel as default };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '
|
|
3
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { PureComponent, Component } from 'react';
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { Component, PureComponent } from 'react';
|
|
5
3
|
import classNames from 'classnames';
|
|
6
4
|
import focusSensorHOC from '../global/focus-sensor-hoc.js';
|
|
7
5
|
import selectionShortcutsHOC from '../table/selection-shortcuts-hoc.js';
|
|
@@ -14,11 +12,10 @@ import { s as styles } from '../_helpers/title.js';
|
|
|
14
12
|
import '../global/compose-refs.js';
|
|
15
13
|
import 'memoize-one';
|
|
16
14
|
import '../shortcuts/core.js';
|
|
17
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
18
15
|
import 'combokeys';
|
|
19
16
|
import '../global/sniffer.js';
|
|
20
17
|
import 'sniffr';
|
|
21
|
-
import '../
|
|
18
|
+
import '../_helpers/loader-core.js';
|
|
22
19
|
import '../global/dom.js';
|
|
23
20
|
import '@jetbrains/icons/chevron-right';
|
|
24
21
|
import '@jetbrains/icons/chevron-down';
|
|
@@ -34,7 +31,6 @@ import 'util-deprecate';
|
|
|
34
31
|
import '../icon/icon.js';
|
|
35
32
|
import '../icon/icon.constants.js';
|
|
36
33
|
import '../_helpers/icon-svg.js';
|
|
37
|
-
import 'core-js/modules/es.string.replace.js';
|
|
38
34
|
import '../global/memoize.js';
|
|
39
35
|
import '../global/controls-height.js';
|
|
40
36
|
import '../global/configuration.js';
|
|
@@ -45,49 +41,12 @@ import '@jetbrains/icons/remove-12px';
|
|
|
45
41
|
import '../control-help/control-help.js';
|
|
46
42
|
|
|
47
43
|
class DataList extends PureComponent {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
onSelect
|
|
55
|
-
} = this.props;
|
|
56
|
-
onSelect(selection.focus(item));
|
|
57
|
-
});
|
|
58
|
-
_defineProperty(this, "onItemSelect", (item, selected) => {
|
|
59
|
-
const {
|
|
60
|
-
selection,
|
|
61
|
-
onSelect
|
|
62
|
-
} = this.props;
|
|
63
|
-
if (selected) {
|
|
64
|
-
onSelect(selection.select(item));
|
|
65
|
-
} else {
|
|
66
|
-
onSelect(selection.deselect(item));
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
_defineProperty(this, "onEqualPress", () => {
|
|
70
|
-
const {
|
|
71
|
-
selection,
|
|
72
|
-
itemFormatter
|
|
73
|
-
} = this.props;
|
|
74
|
-
const focused = selection.getFocused();
|
|
75
|
-
if (!focused) {
|
|
76
|
-
throw new Error('No focused item');
|
|
77
|
-
}
|
|
78
|
-
const item = itemFormatter(focused);
|
|
79
|
-
if (item.collapsed) {
|
|
80
|
-
var _item$onExpand;
|
|
81
|
-
(_item$onExpand = item.onExpand) === null || _item$onExpand === void 0 || _item$onExpand.call(item);
|
|
82
|
-
} else {
|
|
83
|
-
var _item$onCollapse;
|
|
84
|
-
(_item$onCollapse = item.onCollapse) === null || _item$onCollapse === void 0 || _item$onCollapse.call(item);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
_defineProperty(this, "shortcutsMap", {
|
|
88
|
-
'=': this.onEqualPress
|
|
89
|
-
});
|
|
90
|
-
}
|
|
44
|
+
static defaultProps = {
|
|
45
|
+
loading: false,
|
|
46
|
+
onItemMoreLess: () => {},
|
|
47
|
+
itemMoreLessState: () => moreLessButtonStates.UNUSED,
|
|
48
|
+
remoteSelection: false
|
|
49
|
+
};
|
|
91
50
|
componentDidUpdate(prevProps) {
|
|
92
51
|
const {
|
|
93
52
|
data,
|
|
@@ -104,6 +63,44 @@ class DataList extends PureComponent {
|
|
|
104
63
|
onSelect(selection.resetSelection());
|
|
105
64
|
}
|
|
106
65
|
}
|
|
66
|
+
shortcutsScope = getUID('ring-data-list-');
|
|
67
|
+
onItemFocus = item => {
|
|
68
|
+
const {
|
|
69
|
+
selection,
|
|
70
|
+
onSelect
|
|
71
|
+
} = this.props;
|
|
72
|
+
onSelect(selection.focus(item));
|
|
73
|
+
};
|
|
74
|
+
onItemSelect = (item, selected) => {
|
|
75
|
+
const {
|
|
76
|
+
selection,
|
|
77
|
+
onSelect
|
|
78
|
+
} = this.props;
|
|
79
|
+
if (selected) {
|
|
80
|
+
onSelect(selection.select(item));
|
|
81
|
+
} else {
|
|
82
|
+
onSelect(selection.deselect(item));
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
onEqualPress = () => {
|
|
86
|
+
const {
|
|
87
|
+
selection,
|
|
88
|
+
itemFormatter
|
|
89
|
+
} = this.props;
|
|
90
|
+
const focused = selection.getFocused();
|
|
91
|
+
if (focused === null || focused === undefined) {
|
|
92
|
+
throw new Error('No focused item');
|
|
93
|
+
}
|
|
94
|
+
const item = itemFormatter(focused);
|
|
95
|
+
if (item.collapsed) {
|
|
96
|
+
item.onExpand?.();
|
|
97
|
+
} else {
|
|
98
|
+
item.onCollapse?.();
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
shortcutsMap = {
|
|
102
|
+
'=': this.onEqualPress
|
|
103
|
+
};
|
|
107
104
|
render() {
|
|
108
105
|
const {
|
|
109
106
|
data,
|
|
@@ -115,7 +112,10 @@ class DataList extends PureComponent {
|
|
|
115
112
|
focused,
|
|
116
113
|
innerRef
|
|
117
114
|
} = this.props;
|
|
118
|
-
const shortcutsMap =
|
|
115
|
+
const shortcutsMap = {
|
|
116
|
+
...this.shortcutsMap,
|
|
117
|
+
...this.props.shortcutsMap
|
|
118
|
+
};
|
|
119
119
|
const classes = classNames(className, {
|
|
120
120
|
[styles.dataList]: true,
|
|
121
121
|
[styles.disabledHover]: disabledHover,
|
|
@@ -131,7 +131,6 @@ class DataList extends PureComponent {
|
|
|
131
131
|
}), jsx("ul", {
|
|
132
132
|
className: classes,
|
|
133
133
|
children: data.map(model => {
|
|
134
|
-
var _this$props$itemMoreL, _this$props;
|
|
135
134
|
const item = itemFormatter(model);
|
|
136
135
|
const {
|
|
137
136
|
id,
|
|
@@ -139,7 +138,7 @@ class DataList extends PureComponent {
|
|
|
139
138
|
title,
|
|
140
139
|
items
|
|
141
140
|
} = item;
|
|
142
|
-
const showMoreLessButton =
|
|
141
|
+
const showMoreLessButton = this.props.itemMoreLessState?.(item);
|
|
143
142
|
return jsx(Item, {
|
|
144
143
|
item: model,
|
|
145
144
|
title: title,
|
|
@@ -167,22 +166,15 @@ class DataList extends PureComponent {
|
|
|
167
166
|
});
|
|
168
167
|
}
|
|
169
168
|
}
|
|
170
|
-
_defineProperty(DataList, "defaultProps", {
|
|
171
|
-
loading: false,
|
|
172
|
-
onItemMoreLess: () => {},
|
|
173
|
-
itemMoreLessState: () => moreLessButtonStates.UNUSED,
|
|
174
|
-
remoteSelection: false
|
|
175
|
-
});
|
|
176
169
|
const getContainer = () => disableHoverHOC(selectionShortcutsHOC(focusSensorHOC(DataList)));
|
|
177
170
|
// eslint-disable-next-line react/no-multi-comp
|
|
178
171
|
class DataListContainer extends Component {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
// https://stackoverflow.com/a/53882322/6304152
|
|
182
|
-
_defineProperty(this, "DataList", getContainer());
|
|
183
|
-
}
|
|
172
|
+
// https://stackoverflow.com/a/53882322/6304152
|
|
173
|
+
DataList = getContainer();
|
|
184
174
|
render() {
|
|
185
|
-
return jsx(this.DataList,
|
|
175
|
+
return jsx(this.DataList, {
|
|
176
|
+
...this.props
|
|
177
|
+
});
|
|
186
178
|
}
|
|
187
179
|
}
|
|
188
180
|
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import Link from '../link/link.js';
|
|
3
3
|
import Tag from '../tag/tag.js';
|
|
4
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
5
4
|
import 'react';
|
|
6
5
|
import 'classnames';
|
|
7
6
|
import '../global/data-tests.js';
|
|
8
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
9
7
|
import '../link/clickable-link.js';
|
|
10
8
|
import '../_helpers/link.js';
|
|
11
9
|
import '@jetbrains/icons/close-12px';
|
|
@@ -13,8 +11,6 @@ import '../icon/icon.js';
|
|
|
13
11
|
import 'util-deprecate';
|
|
14
12
|
import '../icon/icon.constants.js';
|
|
15
13
|
import '../_helpers/icon-svg.js';
|
|
16
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
17
|
-
import 'core-js/modules/es.string.replace.js';
|
|
18
14
|
import '../global/memoize.js';
|
|
19
15
|
import '../button/button.js';
|
|
20
16
|
import '@jetbrains/icons/chevron-down';
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
2
|
import { PureComponent } from 'react';
|
|
5
3
|
import chevronRightIcon from '@jetbrains/icons/chevron-right';
|
|
@@ -18,8 +16,6 @@ import 'util-deprecate';
|
|
|
18
16
|
import '../icon/icon.js';
|
|
19
17
|
import '../icon/icon.constants.js';
|
|
20
18
|
import '../_helpers/icon-svg.js';
|
|
21
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
22
|
-
import 'core-js/modules/es.string.replace.js';
|
|
23
19
|
import '../global/memoize.js';
|
|
24
20
|
import '../global/controls-height.js';
|
|
25
21
|
import '../global/configuration.js';
|
|
@@ -43,66 +39,70 @@ var moreLessButtonStates;
|
|
|
43
39
|
const ITEM_LEFT_OFFSET = 32;
|
|
44
40
|
const LIST_LEFT_OFFSET = 24;
|
|
45
41
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
42
|
+
static defaultProps = {
|
|
43
|
+
items: [],
|
|
44
|
+
level: 0,
|
|
45
|
+
parentShift: 0,
|
|
46
|
+
showMoreLessButton: moreLessButtonStates.UNUSED,
|
|
47
|
+
onItemMoreLess: () => {}
|
|
48
|
+
};
|
|
49
|
+
onShowMore = () => {
|
|
50
|
+
const {
|
|
51
|
+
onItemMoreLess,
|
|
52
|
+
item
|
|
53
|
+
} = this.props;
|
|
54
|
+
onItemMoreLess(item, true);
|
|
55
|
+
};
|
|
56
|
+
onShowLess = () => {
|
|
57
|
+
const {
|
|
58
|
+
onItemMoreLess,
|
|
59
|
+
item
|
|
60
|
+
} = this.props;
|
|
61
|
+
onItemMoreLess(item, false);
|
|
62
|
+
};
|
|
63
|
+
onFocus = () => {
|
|
64
|
+
const {
|
|
65
|
+
onFocus,
|
|
66
|
+
item
|
|
67
|
+
} = this.props;
|
|
68
|
+
onFocus(item);
|
|
69
|
+
};
|
|
70
|
+
onSelect = selected => {
|
|
71
|
+
const {
|
|
72
|
+
onSelect,
|
|
73
|
+
item
|
|
74
|
+
} = this.props;
|
|
75
|
+
onSelect(item, selected);
|
|
76
|
+
};
|
|
77
|
+
renderItem = (model, parentShift) => {
|
|
78
|
+
const {
|
|
79
|
+
onFocus,
|
|
80
|
+
onSelect,
|
|
81
|
+
selection,
|
|
82
|
+
level,
|
|
83
|
+
itemFormatter
|
|
84
|
+
} = this.props;
|
|
85
|
+
const item = itemFormatter(model);
|
|
86
|
+
return jsx(Item, {
|
|
87
|
+
item: model,
|
|
88
|
+
title: item.title,
|
|
89
|
+
items: item.items,
|
|
90
|
+
level: level + 1,
|
|
91
|
+
parentShift: parentShift,
|
|
92
|
+
itemFormatter: itemFormatter,
|
|
93
|
+
collapsible: item.collapsible,
|
|
94
|
+
collapsed: item.collapsed,
|
|
95
|
+
onCollapse: item.onCollapse,
|
|
96
|
+
onExpand: item.onExpand,
|
|
97
|
+
showFocus: selection.isFocused(model),
|
|
98
|
+
onFocus: onFocus,
|
|
99
|
+
selection: selection,
|
|
100
|
+
selectable: item.selectable,
|
|
101
|
+
selected: selection.isSelected(model),
|
|
102
|
+
partialSelected: selection.isPartialSelected(model),
|
|
103
|
+
onSelect: onSelect
|
|
104
|
+
}, item.key || item.id);
|
|
105
|
+
};
|
|
106
106
|
render() {
|
|
107
107
|
const {
|
|
108
108
|
title,
|
|
@@ -167,7 +167,7 @@ class Item extends PureComponent {
|
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
const itemIsEmpty = !
|
|
170
|
+
const itemIsEmpty = !items?.length || collapsible && collapsed;
|
|
171
171
|
const offset = level * LIST_LEFT_OFFSET + ITEM_LEFT_OFFSET + parentShift;
|
|
172
172
|
return jsxs("li", {
|
|
173
173
|
children: [jsx(Title, {
|
|
@@ -191,12 +191,5 @@ class Item extends PureComponent {
|
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
_defineProperty(Item, "defaultProps", {
|
|
195
|
-
items: [],
|
|
196
|
-
level: 0,
|
|
197
|
-
parentShift: 0,
|
|
198
|
-
showMoreLessButton: moreLessButtonStates.UNUSED,
|
|
199
|
-
onItemMoreLess: () => {}
|
|
200
|
-
});
|
|
201
194
|
|
|
202
195
|
export { Item as default, moreLessButtonStates };
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import { a as _objectWithoutProperties, _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
1
|
import Selection$1 from '../table/selection.js';
|
|
4
2
|
|
|
5
|
-
const _excluded = ["partialSelected"],
|
|
6
|
-
_excluded2 = ["partialSelected"];
|
|
7
3
|
class Selection extends Selection$1 {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
_partialSelected;
|
|
5
|
+
constructor({
|
|
6
|
+
partialSelected = new Set(),
|
|
7
|
+
...props
|
|
8
|
+
}) {
|
|
13
9
|
super(props);
|
|
14
|
-
_defineProperty(this, "_partialSelected", void 0);
|
|
15
10
|
this._partialSelected = partialSelected;
|
|
16
11
|
}
|
|
17
12
|
_buildData(data) {
|
|
@@ -78,8 +73,7 @@ class Selection extends Selection$1 {
|
|
|
78
73
|
selected.delete(ancestor);
|
|
79
74
|
});
|
|
80
75
|
}
|
|
81
|
-
select() {
|
|
82
|
-
let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._focused;
|
|
76
|
+
select(value = this._focused) {
|
|
83
77
|
if (!value || !this._isItemSelectable(value)) {
|
|
84
78
|
return this;
|
|
85
79
|
}
|
|
@@ -103,11 +97,10 @@ class Selection extends Selection$1 {
|
|
|
103
97
|
resetSelection() {
|
|
104
98
|
return super.resetSelection();
|
|
105
99
|
}
|
|
106
|
-
cloneWith(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
100
|
+
cloneWith({
|
|
101
|
+
partialSelected = this._partialSelected,
|
|
102
|
+
...rest
|
|
103
|
+
}) {
|
|
111
104
|
const parentClone = super.cloneWith(rest);
|
|
112
105
|
return new this.constructor({
|
|
113
106
|
// eslint-disable-next-line no-underscore-dangle
|
|
@@ -125,8 +118,7 @@ class Selection extends Selection$1 {
|
|
|
125
118
|
partialSelected
|
|
126
119
|
});
|
|
127
120
|
}
|
|
128
|
-
deselect() {
|
|
129
|
-
let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._focused;
|
|
121
|
+
deselect(value = this._focused) {
|
|
130
122
|
if (!value || !this._isItemSelectable(value)) {
|
|
131
123
|
return this;
|
|
132
124
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
1
|
import 'react/jsx-runtime';
|
|
4
2
|
import 'react';
|
|
5
3
|
import 'classnames';
|
|
@@ -15,7 +13,5 @@ import '../icon/icon.js';
|
|
|
15
13
|
import 'util-deprecate';
|
|
16
14
|
import '../icon/icon.constants.js';
|
|
17
15
|
import '../_helpers/icon-svg.js';
|
|
18
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
19
|
-
import 'core-js/modules/es.string.replace.js';
|
|
20
16
|
import '../global/memoize.js';
|
|
21
17
|
import '../control-help/control-help.js';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
2
1
|
import { add } from 'date-fns/add';
|
|
3
2
|
|
|
4
3
|
const unit = 8; // px;
|
|
@@ -35,7 +34,7 @@ function parseTime(time) {
|
|
|
35
34
|
if (/^([01][0-9]|2[0-3]):[0-5][0-9]$/.test(time)) {
|
|
36
35
|
result = time;
|
|
37
36
|
} else if (/^([0-9]|2[0-3]):[0-5][0-9]$/.test(time)) {
|
|
38
|
-
result =
|
|
37
|
+
result = `0${time}`;
|
|
39
38
|
}
|
|
40
39
|
return result;
|
|
41
40
|
}
|
|
@@ -44,8 +43,8 @@ function shiftWeekArray(arr, startOfWeek) {
|
|
|
44
43
|
return arr.slice(shiftTimes).concat(arr.slice(0, shiftTimes));
|
|
45
44
|
}
|
|
46
45
|
function getWeekStartsOn(locale) {
|
|
47
|
-
var _locale$options$weekS
|
|
48
|
-
return (_locale$options$weekS = locale
|
|
46
|
+
var _locale$options$weekS;
|
|
47
|
+
return (_locale$options$weekS = locale?.options?.weekStartsOn) !== null && _locale$options$weekS !== void 0 ? _locale$options$weekS : weekdays.MO;
|
|
49
48
|
}
|
|
50
49
|
function getDayNumInWeek(locale, day) {
|
|
51
50
|
const weekDays = shiftWeekArray(Object.values(weekdays), getWeekStartsOn(locale));
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
3
|
-
import 'core-js/modules/es.string.replace.js';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
1
|
import { jsx } from 'react/jsx-runtime';
|
|
6
2
|
import * as React from 'react';
|
|
7
3
|
import classNames from 'classnames';
|
|
@@ -29,24 +25,6 @@ import '../control-help/control-help.js';
|
|
|
29
25
|
import '../i18n/i18n.js';
|
|
30
26
|
|
|
31
27
|
class DateInput extends React.PureComponent {
|
|
32
|
-
constructor() {
|
|
33
|
-
super(...arguments);
|
|
34
|
-
_defineProperty(this, "input", void 0);
|
|
35
|
-
_defineProperty(this, "inputRef", el => {
|
|
36
|
-
this.input = el;
|
|
37
|
-
});
|
|
38
|
-
_defineProperty(this, "handleChange", e => this.props.onInput(e.currentTarget.value, e.currentTarget.dataset.name));
|
|
39
|
-
_defineProperty(this, "handleKeyDown", e => {
|
|
40
|
-
if (e.key === 'Enter') {
|
|
41
|
-
// We have to prevent the default behavior, because restoring focus by TabTrap caused by
|
|
42
|
-
// pressing Enter will trigger the onClick event on the DatePicker Dropdown anchor,
|
|
43
|
-
// so DatePicker will be open again.
|
|
44
|
-
// https://youtrack.jetbrains.com/issue/RG-2450/Anchor-should-be-focused-after-closing-datepicker#focus=Comments-27-10044234.0-0.
|
|
45
|
-
e.preventDefault();
|
|
46
|
-
this.props.onConfirm();
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
28
|
componentDidMount() {
|
|
51
29
|
this.updateInput(this.props);
|
|
52
30
|
}
|
|
@@ -62,11 +40,15 @@ class DateInput extends React.PureComponent {
|
|
|
62
40
|
});
|
|
63
41
|
}
|
|
64
42
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
43
|
+
static contextType = I18nContext;
|
|
44
|
+
input;
|
|
45
|
+
inputRef = el => {
|
|
46
|
+
this.input = el;
|
|
47
|
+
};
|
|
48
|
+
updateInput({
|
|
49
|
+
text,
|
|
50
|
+
active
|
|
51
|
+
}) {
|
|
70
52
|
const el = this.input;
|
|
71
53
|
if (!el) {
|
|
72
54
|
return;
|
|
@@ -80,6 +62,17 @@ class DateInput extends React.PureComponent {
|
|
|
80
62
|
el.blur();
|
|
81
63
|
}
|
|
82
64
|
}
|
|
65
|
+
handleChange = e => this.props.onInput(e.currentTarget.value, e.currentTarget.dataset.name);
|
|
66
|
+
handleKeyDown = e => {
|
|
67
|
+
if (e.key === 'Enter') {
|
|
68
|
+
// We have to prevent the default behavior, because restoring focus by TabTrap caused by
|
|
69
|
+
// pressing Enter will trigger the onClick event on the DatePicker Dropdown anchor,
|
|
70
|
+
// so DatePicker will be open again.
|
|
71
|
+
// https://youtrack.jetbrains.com/issue/RG-2450/Anchor-should-be-focused-after-closing-datepicker#focus=Comments-27-10044234.0-0.
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
this.props.onConfirm();
|
|
74
|
+
}
|
|
75
|
+
};
|
|
83
76
|
render() {
|
|
84
77
|
const {
|
|
85
78
|
active,
|
|
@@ -114,16 +107,16 @@ class DateInput extends React.PureComponent {
|
|
|
114
107
|
const placeholder = ((_translations$addFirs, _translations$addSeco, _translations$addTime, _translations$selectN) => {
|
|
115
108
|
switch (name) {
|
|
116
109
|
case 'from':
|
|
117
|
-
return fromPlaceholder || ((_translations$addFirs = translations
|
|
110
|
+
return fromPlaceholder || ((_translations$addFirs = translations?.addFirstDate) !== null && _translations$addFirs !== void 0 ? _translations$addFirs : translate('addFirstDate'));
|
|
118
111
|
case 'to':
|
|
119
|
-
return toPlaceholder || ((_translations$addSeco = translations
|
|
112
|
+
return toPlaceholder || ((_translations$addSeco = translations?.addSecondDate) !== null && _translations$addSeco !== void 0 ? _translations$addSeco : translate('addSecondDate'));
|
|
120
113
|
case 'time':
|
|
121
|
-
return timePlaceholder || ((_translations$addTime = translations
|
|
114
|
+
return timePlaceholder || ((_translations$addTime = translations?.addTime) !== null && _translations$addTime !== void 0 ? _translations$addTime : translate('addTime'));
|
|
122
115
|
default:
|
|
123
|
-
return ((_translations$selectN = translations
|
|
116
|
+
return ((_translations$selectN = translations?.selectName) !== null && _translations$selectN !== void 0 ? _translations$selectN : translate('selectName')).replace('%name%', name).replace('{{name}}', name);
|
|
124
117
|
}
|
|
125
118
|
})();
|
|
126
|
-
const classes = classNames(styles.filter, styles[
|
|
119
|
+
const classes = classNames(styles.filter, styles[`${name}Input`], divider && styles[`${name}InputWithDivider`], 'ring-js-shortcuts');
|
|
127
120
|
return jsx(Input, {
|
|
128
121
|
autoComplete: 'off',
|
|
129
122
|
borderless: true,
|
|
@@ -140,6 +133,5 @@ class DateInput extends React.PureComponent {
|
|
|
140
133
|
});
|
|
141
134
|
}
|
|
142
135
|
}
|
|
143
|
-
_defineProperty(DateInput, "contextType", I18nContext);
|
|
144
136
|
|
|
145
137
|
export { DateInput as default };
|