@jetbrains/ring-ui-built 7.0.65 → 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 +18 -26
- 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,4 +1,3 @@
|
|
|
1
|
-
import { a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { memo, useMemo } from 'react';
|
|
4
3
|
import classNames from 'classnames';
|
|
@@ -9,10 +8,7 @@ import { A as Anchor } from '../_helpers/anchor.js';
|
|
|
9
8
|
import { s as styles } from '../_helpers/tab-link.js';
|
|
10
9
|
import getTabTitles from './collapsible-tab.js';
|
|
11
10
|
import { CustomItem } from './custom-item.js';
|
|
12
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
13
11
|
import '../popup/popup.js';
|
|
14
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
15
|
-
import 'core-js/modules/es.string.replace.js';
|
|
16
12
|
import 'react-dom';
|
|
17
13
|
import '../global/get-uid.js';
|
|
18
14
|
import '../global/schedule-raf.js';
|
|
@@ -26,12 +22,9 @@ import '../global/data-tests.js';
|
|
|
26
22
|
import '../tab-trap/tab-trap.js';
|
|
27
23
|
import '../global/configuration.js';
|
|
28
24
|
import '../popup/position.js';
|
|
29
|
-
import 'core-js/modules/es.array.sort.js';
|
|
30
25
|
import '../popup/popup.target.js';
|
|
31
26
|
import '../popup/position-css.js';
|
|
32
27
|
import '../list/list.js';
|
|
33
|
-
import 'core-js/modules/es.symbol.description.js';
|
|
34
|
-
import 'core-js/modules/es.string.trim.js';
|
|
35
28
|
import 'react-virtualized/dist/es/List';
|
|
36
29
|
import 'react-virtualized/dist/es/AutoSizer';
|
|
37
30
|
import 'react-virtualized/dist/es/WindowScroller';
|
|
@@ -72,34 +65,31 @@ import '@jetbrains/icons/chevron-12px-down';
|
|
|
72
65
|
import '../global/controls-height.js';
|
|
73
66
|
import '../_helpers/button.classes.js';
|
|
74
67
|
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
} = _ref,
|
|
82
|
-
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
68
|
+
const AnchorLink = ({
|
|
69
|
+
hasActiveChildren,
|
|
70
|
+
moreClassName,
|
|
71
|
+
moreActiveClassName,
|
|
72
|
+
...restProps
|
|
73
|
+
}) => {
|
|
83
74
|
const classnames = classNames(styles.title, hasActiveChildren && styles.selected, hasActiveChildren && moreActiveClassName, moreClassName);
|
|
84
|
-
return jsx(Anchor,
|
|
75
|
+
return jsx(Anchor, {
|
|
85
76
|
title: 'More',
|
|
86
|
-
className: classnames
|
|
87
|
-
|
|
77
|
+
className: classnames,
|
|
78
|
+
...restProps,
|
|
88
79
|
children: 'More'
|
|
89
|
-
})
|
|
80
|
+
});
|
|
90
81
|
};
|
|
91
82
|
const morePopupDirections = [Directions.BOTTOM_CENTER, Directions.BOTTOM_LEFT, Directions.BOTTOM_RIGHT];
|
|
92
|
-
const MoreButton = /*#__PURE__*/memo(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
} = _ref2;
|
|
83
|
+
const MoreButton = /*#__PURE__*/memo(({
|
|
84
|
+
items,
|
|
85
|
+
selected,
|
|
86
|
+
onSelect,
|
|
87
|
+
moreClassName,
|
|
88
|
+
moreActiveClassName,
|
|
89
|
+
morePopupClassName,
|
|
90
|
+
morePopupItemClassName,
|
|
91
|
+
morePopupBeforeEnd
|
|
92
|
+
}) => {
|
|
103
93
|
const onSelectHandler = useMemo(() => onSelect ? listItem => {
|
|
104
94
|
if (listItem.disabled === true || listItem.custom === true) {
|
|
105
95
|
return;
|
|
@@ -159,23 +149,20 @@ const MoreButton = /*#__PURE__*/memo(_ref2 => {
|
|
|
159
149
|
});
|
|
160
150
|
});
|
|
161
151
|
MoreButton.displayName = 'MoreButton';
|
|
162
|
-
const FakeMoreButton = /*#__PURE__*/memo(
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
})
|
|
177
|
-
});
|
|
178
|
-
});
|
|
152
|
+
const FakeMoreButton = /*#__PURE__*/memo(({
|
|
153
|
+
moreClassName,
|
|
154
|
+
moreActiveClassName,
|
|
155
|
+
hasActiveChildren
|
|
156
|
+
}) => jsx("div", {
|
|
157
|
+
className: classNames(styles.moreButton, styles.title),
|
|
158
|
+
children: jsx(AnchorLink, {
|
|
159
|
+
moreClassName: moreClassName,
|
|
160
|
+
moreActiveClassName: moreActiveClassName,
|
|
161
|
+
hasActiveChildren: hasActiveChildren,
|
|
162
|
+
tabIndex: -1,
|
|
163
|
+
disabled: true
|
|
164
|
+
})
|
|
165
|
+
}));
|
|
179
166
|
FakeMoreButton.displayName = 'FakeMoreButton';
|
|
180
167
|
|
|
181
168
|
export { AnchorLink, FakeMoreButton, MoreButton };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import classNames from 'classnames';
|
|
@@ -6,19 +5,16 @@ import { s as styles, T as TabLink } from '../_helpers/tab-link.js';
|
|
|
6
5
|
import { CustomItem } from './custom-item.js';
|
|
7
6
|
import '../link/link.js';
|
|
8
7
|
import '../global/data-tests.js';
|
|
9
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
10
8
|
import '../link/clickable-link.js';
|
|
11
9
|
import '../_helpers/link.js';
|
|
12
10
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
tabIndex
|
|
21
|
-
} = _ref;
|
|
11
|
+
const TabTitle = /*#__PURE__*/React.memo(function TabTitle({
|
|
12
|
+
selected,
|
|
13
|
+
child,
|
|
14
|
+
handleSelect,
|
|
15
|
+
collapsed = false,
|
|
16
|
+
tabIndex
|
|
17
|
+
}) {
|
|
22
18
|
if (child === null || typeof child !== 'object' || child.type === CustomItem) {
|
|
23
19
|
return child;
|
|
24
20
|
}
|
|
@@ -39,7 +35,7 @@ const TabTitle = /*#__PURE__*/React.memo(function TabTitle(_ref) {
|
|
|
39
35
|
[collapsedClassName !== null && collapsedClassName !== void 0 ? collapsedClassName : '']: collapsed,
|
|
40
36
|
[collapsedActiveClassName !== null && collapsedActiveClassName !== void 0 ? collapsedActiveClassName : '']: collapsed && selected
|
|
41
37
|
});
|
|
42
|
-
return jsx(TabLink,
|
|
38
|
+
return jsx(TabLink, {
|
|
43
39
|
title: title,
|
|
44
40
|
isSelected: selected,
|
|
45
41
|
active: true,
|
|
@@ -48,27 +44,26 @@ const TabTitle = /*#__PURE__*/React.memo(function TabTitle(_ref) {
|
|
|
48
44
|
disabled: disabled,
|
|
49
45
|
onPlainLeftClick: handleSelect,
|
|
50
46
|
tabIndex: tabIndex,
|
|
51
|
-
collapsed: collapsed
|
|
52
|
-
|
|
53
|
-
});
|
|
54
|
-
const getTabTitles = _ref2 => {
|
|
55
|
-
let {
|
|
56
|
-
items,
|
|
57
|
-
selected = '0',
|
|
58
|
-
collapsed,
|
|
59
|
-
onSelect = () => undefined
|
|
60
|
-
} = _ref2,
|
|
61
|
-
props = _objectWithoutProperties(_ref2, _excluded);
|
|
62
|
-
return items.map((tab, index) => {
|
|
63
|
-
const key = tab.props.id || String(index);
|
|
64
|
-
const isSelected = selected === key;
|
|
65
|
-
return jsx(TabTitle, _objectSpread2({
|
|
66
|
-
handleSelect: onSelect(key),
|
|
67
|
-
selected: isSelected,
|
|
68
|
-
child: tab,
|
|
69
|
-
collapsed: collapsed
|
|
70
|
-
}, props), key);
|
|
47
|
+
collapsed: collapsed,
|
|
48
|
+
...titleProps
|
|
71
49
|
});
|
|
72
|
-
};
|
|
50
|
+
});
|
|
51
|
+
const getTabTitles = ({
|
|
52
|
+
items,
|
|
53
|
+
selected = '0',
|
|
54
|
+
collapsed,
|
|
55
|
+
onSelect = () => undefined,
|
|
56
|
+
...props
|
|
57
|
+
}) => items.map((tab, index) => {
|
|
58
|
+
const key = tab.props.id || String(index);
|
|
59
|
+
const isSelected = selected === key;
|
|
60
|
+
return jsx(TabTitle, {
|
|
61
|
+
handleSelect: onSelect(key),
|
|
62
|
+
selected: isSelected,
|
|
63
|
+
child: tab,
|
|
64
|
+
collapsed: collapsed,
|
|
65
|
+
...props
|
|
66
|
+
}, key);
|
|
67
|
+
});
|
|
73
68
|
|
|
74
69
|
export { getTabTitles as default };
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
2
|
-
import 'core-js/modules/es.string.replace.js';
|
|
3
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
4
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
2
|
import { memo, useState, useRef, useMemo, useCallback, useEffect } from 'react';
|
|
6
3
|
import classNames from 'classnames';
|
|
@@ -8,7 +5,6 @@ import fastdom from 'fastdom';
|
|
|
8
5
|
import { s as styles } from '../_helpers/tab-link.js';
|
|
9
6
|
import { MoreButton, FakeMoreButton } from './collapsible-more.js';
|
|
10
7
|
import getTabTitles from './collapsible-tab.js';
|
|
11
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
12
8
|
import '../link/link.js';
|
|
13
9
|
import '../global/data-tests.js';
|
|
14
10
|
import '../link/clickable-link.js';
|
|
@@ -28,12 +24,9 @@ import 'sniffr';
|
|
|
28
24
|
import '../tab-trap/tab-trap.js';
|
|
29
25
|
import '../global/configuration.js';
|
|
30
26
|
import '../popup/position.js';
|
|
31
|
-
import 'core-js/modules/es.array.sort.js';
|
|
32
27
|
import '../popup/popup.target.js';
|
|
33
28
|
import '../popup/position-css.js';
|
|
34
29
|
import '../list/list.js';
|
|
35
|
-
import 'core-js/modules/es.symbol.description.js';
|
|
36
|
-
import 'core-js/modules/es.string.trim.js';
|
|
37
30
|
import 'react-virtualized/dist/es/List';
|
|
38
31
|
import 'react-virtualized/dist/es/AutoSizer';
|
|
39
32
|
import 'react-virtualized/dist/es/WindowScroller';
|
|
@@ -76,19 +69,18 @@ import './custom-item.js';
|
|
|
76
69
|
|
|
77
70
|
const DEFAULT_DEBOUNCE_INTERVAL = 100;
|
|
78
71
|
const MEASURE_TOLERANCE = 0.5;
|
|
79
|
-
const CollapsibleTabs =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
} = _ref;
|
|
72
|
+
const CollapsibleTabs = ({
|
|
73
|
+
children,
|
|
74
|
+
selected,
|
|
75
|
+
onSelect,
|
|
76
|
+
onLastVisibleIndexChange,
|
|
77
|
+
moreClassName,
|
|
78
|
+
moreActiveClassName,
|
|
79
|
+
morePopupClassName,
|
|
80
|
+
morePopupBeforeEnd,
|
|
81
|
+
morePopupItemClassName,
|
|
82
|
+
initialVisibleItems
|
|
83
|
+
}) => {
|
|
92
84
|
const [sizes, setSizes] = useState({
|
|
93
85
|
tabs: [],
|
|
94
86
|
more: undefined
|
|
@@ -173,7 +165,7 @@ const CollapsibleTabs = _ref => {
|
|
|
173
165
|
const newLastVisibleIndex = tabsToRender.length - 1;
|
|
174
166
|
if (elements.lastVisibleIndex !== newLastVisibleIndex) {
|
|
175
167
|
setLastVisibleIndex(newLastVisibleIndex);
|
|
176
|
-
onLastVisibleIndexChange
|
|
168
|
+
onLastVisibleIndexChange?.(newLastVisibleIndex);
|
|
177
169
|
}
|
|
178
170
|
}, [children, elements.lastVisibleIndex, elements.sizes, onLastVisibleIndexChange, selectedIndex]);
|
|
179
171
|
// Prepare list of visible and hidden elements
|
|
@@ -191,11 +183,11 @@ const CollapsibleTabs = _ref => {
|
|
|
191
183
|
}, {
|
|
192
184
|
visible: [],
|
|
193
185
|
hidden: [],
|
|
194
|
-
ready:
|
|
186
|
+
ready: elements.lastVisibleIndex !== null
|
|
195
187
|
});
|
|
196
188
|
if (selectedIndex > ((_elements$lastVisible2 = elements.lastVisibleIndex) !== null && _elements$lastVisible2 !== void 0 ? _elements$lastVisible2 : 0)) {
|
|
197
189
|
const selectedItem = children.find(tab => !tab.props.alwaysHidden && tab.props.id === selected);
|
|
198
|
-
if (selectedItem) {
|
|
190
|
+
if (selectedItem !== null && selectedItem !== undefined) {
|
|
199
191
|
res.visible.push(selectedItem);
|
|
200
192
|
}
|
|
201
193
|
}
|
|
@@ -225,9 +217,9 @@ const CollapsibleTabs = _ref => {
|
|
|
225
217
|
const measureTask = fastdom.measure(() => {
|
|
226
218
|
var _container$children, _moreButton$offsetWid;
|
|
227
219
|
const container = measureRef.current;
|
|
228
|
-
const descendants = [...((_container$children = container
|
|
220
|
+
const descendants = [...((_container$children = container?.children) !== null && _container$children !== void 0 ? _container$children : [])];
|
|
229
221
|
const moreButton = descendants.pop();
|
|
230
|
-
let moreButtonWidth = (_moreButton$offsetWid = moreButton
|
|
222
|
+
let moreButtonWidth = (_moreButton$offsetWid = moreButton?.offsetWidth) !== null && _moreButton$offsetWid !== void 0 ? _moreButton$offsetWid : 0;
|
|
231
223
|
const {
|
|
232
224
|
marginLeft: moreButtonMarginLeft = '0',
|
|
233
225
|
marginRight: moreButtonMarginRight = '0'
|
|
@@ -272,7 +264,7 @@ const CollapsibleTabs = _ref => {
|
|
|
272
264
|
resizeObserver.disconnect();
|
|
273
265
|
};
|
|
274
266
|
}, [adjustTabs]);
|
|
275
|
-
const isAdjusted =
|
|
267
|
+
const isAdjusted = elements.lastVisibleIndex !== null && preparedElements.ready || initialVisibleItems;
|
|
276
268
|
const className = classNames(styles.titles, styles.autoCollapse, isAdjusted && styles.adjusted);
|
|
277
269
|
return jsxs("div", {
|
|
278
270
|
className: styles.autoCollapseContainer,
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty, b as _objectSpread2, a as _objectWithoutProperties } 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 * as React from 'react';
|
|
5
3
|
import { PureComponent } from 'react';
|
|
@@ -12,8 +10,6 @@ import { CustomItem } from './custom-item.js';
|
|
|
12
10
|
import '../link/link.js';
|
|
13
11
|
import '../link/clickable-link.js';
|
|
14
12
|
import '../_helpers/link.js';
|
|
15
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
16
|
-
import 'core-js/modules/es.string.replace.js';
|
|
17
13
|
import 'fastdom';
|
|
18
14
|
import './collapsible-more.js';
|
|
19
15
|
import '../popup/popup.consts.js';
|
|
@@ -31,12 +27,9 @@ import 'sniffr';
|
|
|
31
27
|
import '../tab-trap/tab-trap.js';
|
|
32
28
|
import '../global/configuration.js';
|
|
33
29
|
import '../popup/position.js';
|
|
34
|
-
import 'core-js/modules/es.array.sort.js';
|
|
35
30
|
import '../popup/popup.target.js';
|
|
36
31
|
import '../popup/position-css.js';
|
|
37
32
|
import '../list/list.js';
|
|
38
|
-
import 'core-js/modules/es.symbol.description.js';
|
|
39
|
-
import 'core-js/modules/es.string.trim.js';
|
|
40
33
|
import 'react-virtualized/dist/es/List';
|
|
41
34
|
import 'react-virtualized/dist/es/AutoSizer';
|
|
42
35
|
import 'react-virtualized/dist/es/WindowScroller';
|
|
@@ -76,78 +69,69 @@ import '../global/controls-height.js';
|
|
|
76
69
|
import '../_helpers/button.classes.js';
|
|
77
70
|
import './collapsible-tab.js';
|
|
78
71
|
|
|
79
|
-
const _excluded = ["className", "tabContainerClassName", "children", "selected", "autoCollapse", "data-test", "onSelect"];
|
|
80
72
|
class Tabs extends PureComponent {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
} = child.props;
|
|
104
|
-
const key = id || String(i);
|
|
105
|
-
const isSelected = key === selected;
|
|
106
|
-
const titleClasses = classNames(styles.title, className, isSelected && activeClassName, {
|
|
107
|
-
[styles.selected]: isSelected
|
|
108
|
-
});
|
|
109
|
-
return jsx(TabLink, _objectSpread2({
|
|
110
|
-
title: title,
|
|
111
|
-
isSelected: isSelected,
|
|
112
|
-
href: href,
|
|
113
|
-
className: titleClasses,
|
|
114
|
-
disabled: disabled,
|
|
115
|
-
onPlainLeftClick: onSelect ? this.handleSelect(key) : undefined
|
|
116
|
-
}, titleProps), key);
|
|
73
|
+
handleSelect = memoize(key => () => this.props.onSelect?.(key));
|
|
74
|
+
getTabTitle = (child, i) => {
|
|
75
|
+
if (child === null || typeof child !== 'object' || child.type === CustomItem) {
|
|
76
|
+
return child;
|
|
77
|
+
}
|
|
78
|
+
const {
|
|
79
|
+
selected,
|
|
80
|
+
onSelect
|
|
81
|
+
} = this.props;
|
|
82
|
+
const {
|
|
83
|
+
title,
|
|
84
|
+
titleProps,
|
|
85
|
+
id,
|
|
86
|
+
disabled,
|
|
87
|
+
href,
|
|
88
|
+
className,
|
|
89
|
+
activeClassName
|
|
90
|
+
} = child.props;
|
|
91
|
+
const key = id || String(i);
|
|
92
|
+
const isSelected = key === selected;
|
|
93
|
+
const titleClasses = classNames(styles.title, className, isSelected && activeClassName, {
|
|
94
|
+
[styles.selected]: isSelected
|
|
117
95
|
});
|
|
118
|
-
|
|
96
|
+
return jsx(TabLink, {
|
|
97
|
+
title: title,
|
|
98
|
+
isSelected: isSelected,
|
|
99
|
+
href: href,
|
|
100
|
+
className: titleClasses,
|
|
101
|
+
disabled: disabled,
|
|
102
|
+
onPlainLeftClick: onSelect ? this.handleSelect(key) : undefined,
|
|
103
|
+
...titleProps
|
|
104
|
+
}, key);
|
|
105
|
+
};
|
|
119
106
|
render() {
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
restProps = _objectWithoutProperties(_this$props2, _excluded);
|
|
107
|
+
const {
|
|
108
|
+
className,
|
|
109
|
+
tabContainerClassName,
|
|
110
|
+
children,
|
|
111
|
+
selected,
|
|
112
|
+
autoCollapse,
|
|
113
|
+
'data-test': dataTest,
|
|
114
|
+
onSelect,
|
|
115
|
+
...restProps
|
|
116
|
+
} = this.props;
|
|
131
117
|
const classes = classNames(styles.tabs, className);
|
|
132
118
|
const childrenArray = React.Children.toArray(children).filter(Boolean);
|
|
133
119
|
return jsxs("div", {
|
|
134
120
|
className: classes,
|
|
135
121
|
"data-test": joinDataTestAttributes('ring-dumb-tabs', dataTest),
|
|
136
|
-
children: [autoCollapse === true ? jsx(CollapsibleTabs,
|
|
122
|
+
children: [autoCollapse === true ? jsx(CollapsibleTabs, {
|
|
123
|
+
...restProps,
|
|
137
124
|
onSelect: onSelect ? this.handleSelect : undefined,
|
|
138
125
|
selected: selected,
|
|
139
126
|
children: childrenArray
|
|
140
|
-
})
|
|
127
|
+
}) : jsx("div", {
|
|
141
128
|
className: styles.titles,
|
|
142
129
|
children: childrenArray.map(this.getTabTitle)
|
|
143
130
|
}), jsx("div", {
|
|
144
131
|
className: classNames(tabContainerClassName),
|
|
145
|
-
children: childrenArray.find((
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
} = _ref;
|
|
149
|
-
return (props.id || String(i)) === selected;
|
|
150
|
-
})
|
|
132
|
+
children: childrenArray.find(({
|
|
133
|
+
props
|
|
134
|
+
}, i) => (props.id || String(i)) === selected)
|
|
151
135
|
})]
|
|
152
136
|
});
|
|
153
137
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { PureComponent } from 'react';
|
|
4
3
|
import joinDataTestAttributes from '../global/data-tests.js';
|
|
5
4
|
import Tabs from './dumb-tabs.js';
|
|
6
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
7
5
|
import 'classnames';
|
|
8
6
|
import '../global/memoize.js';
|
|
9
7
|
import '../_helpers/tab-link.js';
|
|
@@ -11,8 +9,6 @@ import '../link/link.js';
|
|
|
11
9
|
import '../link/clickable-link.js';
|
|
12
10
|
import '../_helpers/link.js';
|
|
13
11
|
import './collapsible-tabs.js';
|
|
14
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
15
|
-
import 'core-js/modules/es.string.replace.js';
|
|
16
12
|
import 'fastdom';
|
|
17
13
|
import './collapsible-more.js';
|
|
18
14
|
import '../popup/popup.consts.js';
|
|
@@ -30,12 +26,9 @@ import 'sniffr';
|
|
|
30
26
|
import '../tab-trap/tab-trap.js';
|
|
31
27
|
import '../global/configuration.js';
|
|
32
28
|
import '../popup/position.js';
|
|
33
|
-
import 'core-js/modules/es.array.sort.js';
|
|
34
29
|
import '../popup/popup.target.js';
|
|
35
30
|
import '../popup/position-css.js';
|
|
36
31
|
import '../list/list.js';
|
|
37
|
-
import 'core-js/modules/es.symbol.description.js';
|
|
38
|
-
import 'core-js/modules/es.string.trim.js';
|
|
39
32
|
import 'react-virtualized/dist/es/List';
|
|
40
33
|
import 'react-virtualized/dist/es/AutoSizer';
|
|
41
34
|
import 'react-virtualized/dist/es/WindowScroller';
|
|
@@ -76,33 +69,31 @@ import '../_helpers/button.classes.js';
|
|
|
76
69
|
import './collapsible-tab.js';
|
|
77
70
|
import './custom-item.js';
|
|
78
71
|
|
|
79
|
-
const _excluded = ["children", "initSelected", "data-test"];
|
|
80
72
|
class SmartTabs extends PureComponent {
|
|
81
73
|
constructor(props) {
|
|
82
74
|
super(props);
|
|
83
|
-
_defineProperty(this, "state", void 0);
|
|
84
|
-
_defineProperty(this, "handleSelect", selected => this.setState({
|
|
85
|
-
selected
|
|
86
|
-
}));
|
|
87
75
|
this.state = {
|
|
88
76
|
selected: this.props.initSelected || Array.isArray(this.props.children) && this.props.children[0].props.id || '0'
|
|
89
77
|
};
|
|
90
78
|
}
|
|
79
|
+
state;
|
|
80
|
+
handleSelect = selected => this.setState({
|
|
81
|
+
selected
|
|
82
|
+
});
|
|
91
83
|
render() {
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return jsx(Tabs, _objectSpread2(_objectSpread2({
|
|
84
|
+
const {
|
|
85
|
+
children,
|
|
86
|
+
initSelected,
|
|
87
|
+
'data-test': dataTest,
|
|
88
|
+
...restProps
|
|
89
|
+
} = this.props;
|
|
90
|
+
return jsx(Tabs, {
|
|
100
91
|
"data-test": joinDataTestAttributes('ring-smart-tabs', dataTest),
|
|
101
92
|
selected: this.state.selected,
|
|
102
|
-
onSelect: this.handleSelect
|
|
103
|
-
|
|
93
|
+
onSelect: this.handleSelect,
|
|
94
|
+
...restProps,
|
|
104
95
|
children: children
|
|
105
|
-
})
|
|
96
|
+
});
|
|
106
97
|
}
|
|
107
98
|
}
|
|
108
99
|
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import 'react/jsx-runtime';
|
|
3
2
|
import 'react';
|
|
4
3
|
import '../link/link.js';
|
|
5
4
|
export { T as default } from '../_helpers/tab-link.js';
|
|
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';
|
package/components/tabs/tab.js
CHANGED
|
@@ -2,7 +2,6 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { PureComponent } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import joinDataTestAttributes from '../global/data-tests.js';
|
|
5
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
6
5
|
|
|
7
6
|
class Tab extends PureComponent {
|
|
8
7
|
render() {
|
package/components/tabs/tabs.js
CHANGED
|
@@ -2,8 +2,6 @@ export { CustomItem } from './custom-item.js';
|
|
|
2
2
|
export { default as Tabs } from './dumb-tabs.js';
|
|
3
3
|
export { default as SmartTabs } from './smart-tabs.js';
|
|
4
4
|
export { default as Tab } from './tab.js';
|
|
5
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
6
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
7
5
|
import 'react/jsx-runtime';
|
|
8
6
|
import 'react';
|
|
9
7
|
import 'classnames';
|
|
@@ -14,8 +12,6 @@ import '../link/link.js';
|
|
|
14
12
|
import '../link/clickable-link.js';
|
|
15
13
|
import '../_helpers/link.js';
|
|
16
14
|
import './collapsible-tabs.js';
|
|
17
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
18
|
-
import 'core-js/modules/es.string.replace.js';
|
|
19
15
|
import 'fastdom';
|
|
20
16
|
import './collapsible-more.js';
|
|
21
17
|
import '../popup/popup.consts.js';
|
|
@@ -33,12 +29,9 @@ import 'sniffr';
|
|
|
33
29
|
import '../tab-trap/tab-trap.js';
|
|
34
30
|
import '../global/configuration.js';
|
|
35
31
|
import '../popup/position.js';
|
|
36
|
-
import 'core-js/modules/es.array.sort.js';
|
|
37
32
|
import '../popup/popup.target.js';
|
|
38
33
|
import '../popup/position-css.js';
|
|
39
34
|
import '../list/list.js';
|
|
40
|
-
import 'core-js/modules/es.symbol.description.js';
|
|
41
|
-
import 'core-js/modules/es.string.trim.js';
|
|
42
35
|
import 'react-virtualized/dist/es/List';
|
|
43
36
|
import 'react-virtualized/dist/es/AutoSizer';
|
|
44
37
|
import 'react-virtualized/dist/es/WindowScroller';
|