@jetbrains/ring-ui 7.0.23 → 7.0.25
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.
|
@@ -8,5 +8,5 @@ export default function AvatarStack({ children, className, size = Size.Size20, e
|
|
|
8
8
|
const [dropdownOpen, setDropdownOpen] = useState(false);
|
|
9
9
|
return (_jsxs("div", { className: classNames(styles.avatarStack, className, styles[`size${size}`], {
|
|
10
10
|
[styles.hovered]: dropdownOpen,
|
|
11
|
-
}), ...restProps, children: [Children.map(children, (child, index) => (_jsx("div", { className: styles.item, style: { '--ring-avatar-stack-index': index }, children: child }))), extraItems?.length
|
|
11
|
+
}), ...restProps, children: [Children.map(children, (child, index) => (_jsx("div", { className: styles.item, style: { '--ring-avatar-stack-index': index }, children: child }))), extraItems?.length ? (_jsx(DropdownMenu, { hoverMode: true, hoverShowTimeOut: 10, onShow: () => setDropdownOpen(true), onHide: () => setDropdownOpen(false), className: styles.extra, style: { width: size, height: size, '--ring-avatar-stack-index': Children.count(children) }, anchor: _jsx("button", { type: "button", className: styles.extraText, children: `+${extraItems.length}` }), data: extraItems, menuProps: { offset: 4, ...dropdownMenuProps?.menuProps }, ...dropdownMenuProps })) : null] }));
|
|
12
12
|
}
|
|
@@ -33,6 +33,17 @@ export const CollapsibleTabs = ({ children, selected, onSelect, onLastVisibleInd
|
|
|
33
33
|
onSelect,
|
|
34
34
|
});
|
|
35
35
|
}, [initialVisibleItems, children, preparedElements.ready, preparedElements.visible, onSelect, selected]);
|
|
36
|
+
const hiddenElements = useMemo(() => {
|
|
37
|
+
if (preparedElements.ready) {
|
|
38
|
+
return preparedElements.hidden;
|
|
39
|
+
}
|
|
40
|
+
else if (initialVisibleItems) {
|
|
41
|
+
return children.filter(item => !visibleElements.some(visibleItem => visibleItem.props.child === item));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
}, [children, preparedElements.hidden, preparedElements.ready, visibleElements, initialVisibleItems]);
|
|
36
47
|
const adjustTabs = useCallback((entry) => {
|
|
37
48
|
const containerWidth = entry.contentRect.width;
|
|
38
49
|
const { tabs: tabsSizes, more = 0 } = elements.sizes;
|
|
@@ -164,6 +175,6 @@ export const CollapsibleTabs = ({ children, selected, onSelect, onLastVisibleInd
|
|
|
164
175
|
}, [adjustTabs]);
|
|
165
176
|
const isAdjusted = (elements.lastVisibleIndex !== null && preparedElements.ready === true) || initialVisibleItems;
|
|
166
177
|
const className = classNames(styles.titles, styles.autoCollapse, isAdjusted && styles.adjusted);
|
|
167
|
-
return (_jsxs("div", { className: styles.autoCollapseContainer, children: [_jsxs("div", { className: classNames(className, styles.rendered), children: [visibleElements, _jsx(MoreButton, { moreClassName: moreClassName, moreActiveClassName: moreActiveClassName, morePopupClassName: morePopupClassName, morePopupBeforeEnd: morePopupBeforeEnd, morePopupItemClassName: morePopupItemClassName, items:
|
|
178
|
+
return (_jsxs("div", { className: styles.autoCollapseContainer, children: [_jsxs("div", { className: classNames(className, styles.rendered), children: [visibleElements, _jsx(MoreButton, { moreClassName: moreClassName, moreActiveClassName: moreActiveClassName, morePopupClassName: morePopupClassName, morePopupBeforeEnd: morePopupBeforeEnd, morePopupItemClassName: morePopupItemClassName, items: hiddenElements, selected: selected, onSelect: onSelect })] }), _jsxs("div", { ref: measureRef, className: classNames(className, styles.measure), children: [childrenToMeasure, _jsx(FakeMoreButton, { hasActiveChildren: hiddenElements.some(item => item.props.alwaysHidden && item.props.id === selected), moreClassName: moreClassName, moreActiveClassName: moreActiveClassName })] })] }));
|
|
168
179
|
};
|
|
169
180
|
export default memo(CollapsibleTabs);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetbrains/ring-ui",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.25",
|
|
4
4
|
"description": "JetBrains UI library",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "JetBrains"
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
"jest": "~29.7.0",
|
|
168
168
|
"jest-environment-jsdom": "^29.7.0",
|
|
169
169
|
"jest-teamcity": "^1.12.0",
|
|
170
|
-
"lint-staged": "^15.4.
|
|
170
|
+
"lint-staged": "^15.4.2",
|
|
171
171
|
"markdown-it": "^14.1.0",
|
|
172
172
|
"merge-options": "^3.0.4",
|
|
173
173
|
"pinst": "^3.0.0",
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
"react-test-renderer": "^19.0.0",
|
|
179
179
|
"regenerator-runtime": "^0.14.1",
|
|
180
180
|
"rimraf": "^6.0.1",
|
|
181
|
-
"rollup": "^4.
|
|
181
|
+
"rollup": "^4.32.0",
|
|
182
182
|
"rollup-plugin-clear": "^2.0.7",
|
|
183
183
|
"sinon": "^19.0.2",
|
|
184
184
|
"sinon-chai": "^4.0.0",
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
"terser-webpack-plugin": "^5.3.11",
|
|
191
191
|
"typescript": "~5.7.3",
|
|
192
192
|
"typescript-eslint": "^8.21.0",
|
|
193
|
-
"vitest": "^3.0.
|
|
193
|
+
"vitest": "^3.0.4",
|
|
194
194
|
"vitest-teamcity-reporter": "^0.3.1",
|
|
195
195
|
"wallaby-webpack": "^3.9.16",
|
|
196
196
|
"webpack": "^5.97.1",
|