@jetbrains/ring-ui-built 8.0.0-beta.5 → 8.0.0-beta.7
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/avatar-info.js +2 -4
- package/components/_helpers/icon-svg.js +1 -1
- package/components/auth-dialog/auth-dialog.js +1 -1
- package/components/avatar/avatar-size.d.ts +0 -4
- package/components/avatar/avatar-size.js +0 -4
- package/components/avatar/avatar.js +0 -7
- package/components/avatar/fallback-avatar.js +2 -47
- package/components/avatar-stack/avatar-stack.js +3 -3
- package/components/button/button.d.ts +0 -4
- package/components/button/button.js +2 -8
- package/components/collapse/collapse-content.d.ts +7 -0
- package/components/collapse/collapse-content.js +67 -35
- package/components/collapse/collapse-context.d.ts +1 -0
- package/components/collapse/collapse-context.js +1 -0
- package/components/collapse/collapse.d.ts +9 -0
- package/components/collapse/collapse.js +42 -38
- package/components/collapsible-group/collapsible-group.d.ts +14 -1
- package/components/collapsible-group/collapsible-group.js +82 -64
- package/components/confirm/confirm.js +1 -1
- package/components/confirm-service/confirm-service.js +1 -1
- package/components/data-list/data-list.js +1 -1
- package/components/data-list/item.js +1 -1
- package/components/date-picker/date-input.js +1 -1
- package/components/date-picker/date-popup.js +1 -1
- package/components/dialog/dialog.js +1 -1
- package/components/dropdown/anchor.js +1 -1
- package/components/dropdown/dropdown.js +1 -1
- package/components/global/variables.interface.d.ts +0 -4
- package/components/header/header-icon.js +1 -1
- package/components/header/header.js +1 -1
- package/components/header/profile.js +3 -3
- package/components/header/services.js +1 -1
- package/components/header/smart-profile.js +1 -1
- package/components/header/smart-services.js +1 -1
- package/components/icon/icon.d.ts +0 -1
- package/components/icon/icon.js +1 -4
- package/components/input/input.js +1 -1
- package/components/list/consts.d.ts +0 -1
- package/components/list/consts.js +0 -1
- package/components/list/list-item.js +2 -3
- package/components/list/list.d.ts +0 -4
- package/components/login-dialog/login-dialog.js +1 -1
- package/components/pager/pager.js +2 -2
- package/components/select/chevron-button.js +1 -1
- package/components/select/select-filter.js +1 -1
- package/components/select/select.js +3 -3
- package/components/style.css +1 -1
- package/components/tags-input/tags-input.js +2 -2
- package/components/user-agreement/user-agreement.js +1 -1
- package/components/user-card/card.js +3 -3
- package/components/user-card/smart-user-card-tooltip.js +1 -1
- package/components/user-card/tooltip.js +1 -1
- package/components/user-card/user-card.js +3 -3
- package/package.json +1 -2
- package/components/__mocks__/old-browsers-message.js +0 -3
- package/components/_helpers/grid.js +0 -3
- package/components/_helpers/sidebar.js +0 -110
- package/components/content-layout/content-layout.d.ts +0 -20
- package/components/content-layout/content-layout.js +0 -50
- package/components/content-layout/sidebar.d.ts +0 -26
- package/components/content-layout/sidebar.js +0 -5
- package/components/expand/collapsible-group.d.ts +0 -8
- package/components/expand/collapsible-group.js +0 -51
- package/components/grid/col.d.ts +0 -16
- package/components/grid/col.js +0 -63
- package/components/grid/grid.d.ts +0 -13
- package/components/grid/grid.js +0 -27
- package/components/grid/row.d.ts +0 -21
- package/components/grid/row.js +0 -72
- package/components/old-browsers-message/old-browsers-message-stop.d.ts +0 -1
- package/components/old-browsers-message/old-browsers-message-stop.js +0 -5
- package/components/old-browsers-message/old-browsers-message.d.ts +0 -5
- package/components/old-browsers-message/old-browsers-message.js +0 -89
- package/components/old-browsers-message/white-list.d.ts +0 -2
- package/components/old-browsers-message/white-list.js +0 -30
|
@@ -7,22 +7,20 @@ var styles = {"avatar":"ring-avatar-avatar","round":"ring-avatar-round","avatarI
|
|
|
7
7
|
|
|
8
8
|
const fontSizes = {
|
|
9
9
|
[Size.Size16]: 9,
|
|
10
|
-
[Size.Size18]: 9,
|
|
11
10
|
[Size.Size20]: 9,
|
|
12
11
|
[Size.Size24]: 11,
|
|
13
12
|
[Size.Size28]: 12,
|
|
14
13
|
[Size.Size32]: 14,
|
|
15
14
|
[Size.Size40]: 16,
|
|
16
|
-
[Size.Size48]: 16,
|
|
17
15
|
[Size.Size56]: 22
|
|
18
16
|
};
|
|
19
17
|
function AvatarInfo(t0) {
|
|
20
18
|
const $ = c(7);
|
|
21
|
-
if ($[0] !== "
|
|
19
|
+
if ($[0] !== "33d9e62fc244e982736d73abc4599d28e2503bcb0c1be77e33e4cecd23099cfb") {
|
|
22
20
|
for (let $i = 0; $i < 7; $i += 1) {
|
|
23
21
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
24
22
|
}
|
|
25
|
-
$[0] = "
|
|
23
|
+
$[0] = "33d9e62fc244e982736d73abc4599d28e2503bcb0c1be77e33e4cecd23099cfb";
|
|
26
24
|
}
|
|
27
25
|
const {
|
|
28
26
|
size,
|
|
@@ -4,7 +4,7 @@ import classNames from 'classnames';
|
|
|
4
4
|
import memoize from '../global/memoize.js';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
|
-
var styles = {"icon":"ring-icon-icon","glyph":"ring-icon-glyph","compatibilityMode":"ring-icon-compatibilityMode","gray":"ring-icon-gray","hover":"ring-icon-hover","green":"ring-icon-green","magenta":"ring-icon-magenta","red":"ring-icon-red","blue":"ring-icon-blue","white":"ring-icon-white"
|
|
7
|
+
var styles = {"icon":"ring-icon-icon","glyph":"ring-icon-glyph","compatibilityMode":"ring-icon-compatibilityMode","gray":"ring-icon-gray","hover":"ring-icon-hover","green":"ring-icon-green","magenta":"ring-icon-magenta","red":"ring-icon-red","blue":"ring-icon-blue","white":"ring-icon-white"};
|
|
8
8
|
|
|
9
9
|
function convertReactSVGDOMProperty(str) {
|
|
10
10
|
return str.replace(/[-|:]([a-z])/g, g => g[1].toUpperCase());
|
|
@@ -36,8 +36,8 @@ import '../_helpers/dialog-body-scroll-preventer.js';
|
|
|
36
36
|
import 'scrollbar-width';
|
|
37
37
|
import '@jetbrains/icons/chevron-down';
|
|
38
38
|
import '@jetbrains/icons/chevron-12px-down';
|
|
39
|
-
import 'util-deprecate';
|
|
40
39
|
import '../icon/icon.js';
|
|
40
|
+
import 'util-deprecate';
|
|
41
41
|
import '../icon/icon.constants.js';
|
|
42
42
|
import '../_helpers/icon-svg.js';
|
|
43
43
|
import '../global/memoize.js';
|
|
@@ -4,15 +4,11 @@
|
|
|
4
4
|
var Size;
|
|
5
5
|
(function (Size) {
|
|
6
6
|
Size[Size["Size16"] = 16] = "Size16";
|
|
7
|
-
/** @deprecated */
|
|
8
|
-
Size[Size["Size18"] = 18] = "Size18";
|
|
9
7
|
Size[Size["Size20"] = 20] = "Size20";
|
|
10
8
|
Size[Size["Size24"] = 24] = "Size24";
|
|
11
9
|
Size[Size["Size28"] = 28] = "Size28";
|
|
12
10
|
Size[Size["Size32"] = 32] = "Size32";
|
|
13
11
|
Size[Size["Size40"] = 40] = "Size40";
|
|
14
|
-
/** @deprecated */
|
|
15
|
-
Size[Size["Size48"] = 48] = "Size48";
|
|
16
12
|
Size[Size["Size56"] = 56] = "Size56";
|
|
17
13
|
})(Size || (Size = {}));
|
|
18
14
|
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import 'core-js/modules/es.array.includes.js';
|
|
2
1
|
import { PureComponent } from 'react';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
|
-
import deprecate from 'util-deprecate';
|
|
5
3
|
import { isDataURI, parseQueryString, encodeURL } from '../global/url.js';
|
|
6
4
|
import { getPixelRatio } from '../global/dom.js';
|
|
7
|
-
import memoize from '../global/memoize.js';
|
|
8
5
|
import FallbackAvatar from './fallback-avatar.js';
|
|
9
6
|
import { Size } from './avatar-size.js';
|
|
10
7
|
import { s as styles, A as AvatarInfo } from '../_helpers/avatar-info.js';
|
|
@@ -12,7 +9,6 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
12
9
|
import 'react/compiler-runtime';
|
|
13
10
|
import '../global/get-uid.js';
|
|
14
11
|
|
|
15
|
-
const warnSize = memoize(size => deprecate(() => {}, `Avatar: Size${size} is deprecated and will be removed in 8.0. The supported sizes are: Size20, Size24, Size28, Size32, Size40.`));
|
|
16
12
|
class Avatar extends PureComponent {
|
|
17
13
|
static defaultProps = {
|
|
18
14
|
dpr: getPixelRatio(),
|
|
@@ -47,9 +43,6 @@ class Avatar extends PureComponent {
|
|
|
47
43
|
skipParams,
|
|
48
44
|
...restProps
|
|
49
45
|
} = this.props;
|
|
50
|
-
if ([Size.Size18, Size.Size48].includes(size)) {
|
|
51
|
-
warnSize(size)();
|
|
52
|
-
}
|
|
53
46
|
const sizeString = `${size}px`;
|
|
54
47
|
const subavatarSizeString = `${subavatarSize}px`;
|
|
55
48
|
const styleObj = {
|
|
@@ -15,15 +15,6 @@ const SizesSquare = {
|
|
|
15
15
|
fontSize: '8px',
|
|
16
16
|
textAnchor: 'middle'
|
|
17
17
|
},
|
|
18
|
-
[Size.Size18]: {
|
|
19
|
-
radius: 4,
|
|
20
|
-
text: {
|
|
21
|
-
x: 9,
|
|
22
|
-
y: 13
|
|
23
|
-
},
|
|
24
|
-
fontSize: '11px',
|
|
25
|
-
textAnchor: 'middle'
|
|
26
|
-
},
|
|
27
18
|
[Size.Size20]: {
|
|
28
19
|
radius: 4,
|
|
29
20
|
text: {
|
|
@@ -96,21 +87,6 @@ const SizesSquare = {
|
|
|
96
87
|
height: 2.5
|
|
97
88
|
}
|
|
98
89
|
},
|
|
99
|
-
[Size.Size48]: {
|
|
100
|
-
radius: 4,
|
|
101
|
-
text: {
|
|
102
|
-
x: 3,
|
|
103
|
-
y: 21
|
|
104
|
-
},
|
|
105
|
-
fontSize: '19px',
|
|
106
|
-
letterSpacing: 1,
|
|
107
|
-
underscore: {
|
|
108
|
-
x: 5,
|
|
109
|
-
y: 32,
|
|
110
|
-
width: 15,
|
|
111
|
-
height: 2.5
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
90
|
[Size.Size56]: {
|
|
115
91
|
radius: 4,
|
|
116
92
|
text: {
|
|
@@ -138,16 +114,6 @@ const SizesRound = {
|
|
|
138
114
|
textAnchor: 'middle',
|
|
139
115
|
dominantBaseline: 'middle'
|
|
140
116
|
},
|
|
141
|
-
[Size.Size18]: {
|
|
142
|
-
radius: 4,
|
|
143
|
-
fontSize: '11px',
|
|
144
|
-
text: {
|
|
145
|
-
x: '50%',
|
|
146
|
-
y: '54%'
|
|
147
|
-
},
|
|
148
|
-
textAnchor: 'middle',
|
|
149
|
-
dominantBaseline: 'middle'
|
|
150
|
-
},
|
|
151
117
|
[Size.Size20]: {
|
|
152
118
|
radius: 4,
|
|
153
119
|
fontSize: '9px',
|
|
@@ -200,17 +166,6 @@ const SizesRound = {
|
|
|
200
166
|
textAnchor: 'middle',
|
|
201
167
|
dominantBaseline: 'middle'
|
|
202
168
|
},
|
|
203
|
-
[Size.Size48]: {
|
|
204
|
-
radius: 4,
|
|
205
|
-
fontSize: '19px',
|
|
206
|
-
letterSpacing: 1,
|
|
207
|
-
text: {
|
|
208
|
-
x: '50%',
|
|
209
|
-
y: '54%'
|
|
210
|
-
},
|
|
211
|
-
textAnchor: 'middle',
|
|
212
|
-
dominantBaseline: 'middle'
|
|
213
|
-
},
|
|
214
169
|
[Size.Size56]: {
|
|
215
170
|
radius: 4,
|
|
216
171
|
fontSize: '26px',
|
|
@@ -247,11 +202,11 @@ function hashCode(s) {
|
|
|
247
202
|
}
|
|
248
203
|
function FallbackAvatar(t0) {
|
|
249
204
|
const $ = c(38);
|
|
250
|
-
if ($[0] !== "
|
|
205
|
+
if ($[0] !== "1a4ecd5a43a79807aefab02d5c9ac8b224f24139f867e5804d91fecdd9285808") {
|
|
251
206
|
for (let $i = 0; $i < 38; $i += 1) {
|
|
252
207
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
253
208
|
}
|
|
254
|
-
$[0] = "
|
|
209
|
+
$[0] = "1a4ecd5a43a79807aefab02d5c9ac8b224f24139f867e5804d91fecdd9285808";
|
|
255
210
|
}
|
|
256
211
|
const {
|
|
257
212
|
username,
|
|
@@ -70,11 +70,11 @@ var styles = {"avatarStack":"ring-avatar-stack-avatarStack","extraText":"ring-av
|
|
|
70
70
|
|
|
71
71
|
function AvatarStack(t0) {
|
|
72
72
|
const $ = c(28);
|
|
73
|
-
if ($[0] !== "
|
|
73
|
+
if ($[0] !== "f469d96d157850b6a22cfb2dd7b1d71f151ee90317dbfd199eb6713e97a9ce55") {
|
|
74
74
|
for (let $i = 0; $i < 28; $i += 1) {
|
|
75
75
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
76
76
|
}
|
|
77
|
-
$[0] = "
|
|
77
|
+
$[0] = "f469d96d157850b6a22cfb2dd7b1d71f151ee90317dbfd199eb6713e97a9ce55";
|
|
78
78
|
}
|
|
79
79
|
let children;
|
|
80
80
|
let className;
|
|
@@ -108,7 +108,7 @@ function AvatarStack(t0) {
|
|
|
108
108
|
}
|
|
109
109
|
const size = t1 === undefined ? Size.Size20 : t1;
|
|
110
110
|
const [dropdownOpen, setDropdownOpen] = useState(false);
|
|
111
|
-
const sizeClass = size !== Size.Size16
|
|
111
|
+
const sizeClass = size !== Size.Size16 ? styles[`size${size}`] : undefined;
|
|
112
112
|
let t2;
|
|
113
113
|
if ($[8] !== className || $[9] !== dropdownOpen || $[10] !== sizeClass) {
|
|
114
114
|
t2 = classNames(styles.avatarStack, className, sizeClass, {
|
|
@@ -15,10 +15,6 @@ export interface ButtonBaseProps {
|
|
|
15
15
|
secondary?: boolean | null | undefined;
|
|
16
16
|
ghost?: boolean | null | undefined;
|
|
17
17
|
short?: boolean | null | undefined;
|
|
18
|
-
/**
|
|
19
|
-
* @deprecated Use inline instead
|
|
20
|
-
*/
|
|
21
|
-
text?: boolean | null | undefined;
|
|
22
18
|
inline?: boolean | null | undefined;
|
|
23
19
|
dropdown?: boolean | null | undefined;
|
|
24
20
|
disabled?: boolean | undefined;
|
|
@@ -2,19 +2,18 @@ import { PureComponent, createRef } from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import chevronDownIcon from '@jetbrains/icons/chevron-down';
|
|
4
4
|
import chevron12pxDown from '@jetbrains/icons/chevron-12px-down';
|
|
5
|
-
import deprecate from 'util-deprecate';
|
|
6
5
|
import Icon from '../icon/icon.js';
|
|
7
6
|
import ClickableLink from '../link/clickable-link.js';
|
|
8
7
|
import { ControlsHeightContext } from '../global/controls-height.js';
|
|
9
8
|
import { g as getButtonClasses, s as styles } from '../_helpers/button.classes.js';
|
|
10
9
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
11
10
|
import { Size } from '../icon/icon.constants.js';
|
|
11
|
+
import 'util-deprecate';
|
|
12
12
|
import '../_helpers/icon-svg.js';
|
|
13
13
|
import 'react/compiler-runtime';
|
|
14
14
|
import '../global/memoize.js';
|
|
15
15
|
import '../global/configuration.js';
|
|
16
16
|
|
|
17
|
-
const warnText = deprecate(() => {}, 'Button: "text" prop is deprecated and will be removed in 8.0. Use inline instead.');
|
|
18
17
|
function removeLinkProps(props) {
|
|
19
18
|
const {
|
|
20
19
|
download,
|
|
@@ -46,7 +45,6 @@ class Button extends PureComponent {
|
|
|
46
45
|
static contextType = ControlsHeightContext;
|
|
47
46
|
buttonRef = /*#__PURE__*/createRef();
|
|
48
47
|
render() {
|
|
49
|
-
var _ref;
|
|
50
48
|
const {
|
|
51
49
|
// Modifiers
|
|
52
50
|
active,
|
|
@@ -59,7 +57,6 @@ class Button extends PureComponent {
|
|
|
59
57
|
secondary,
|
|
60
58
|
ghost,
|
|
61
59
|
short,
|
|
62
|
-
text,
|
|
63
60
|
dropdown,
|
|
64
61
|
height,
|
|
65
62
|
// Props
|
|
@@ -75,10 +72,7 @@ class Button extends PureComponent {
|
|
|
75
72
|
disabled,
|
|
76
73
|
...props
|
|
77
74
|
} = this.props;
|
|
78
|
-
const isInline =
|
|
79
|
-
if (text) {
|
|
80
|
-
warnText();
|
|
81
|
-
}
|
|
75
|
+
const isInline = inline !== null && inline !== void 0 ? inline : !!icon;
|
|
82
76
|
const classes = getButtonClasses({
|
|
83
77
|
...this.props,
|
|
84
78
|
inline: isInline,
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import React, { type PropsWithChildren } from 'react';
|
|
2
2
|
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* Height of the always-visible preview of the collapsed content.
|
|
5
|
+
* The collapsed subtree is inert until expanded, matching `aria-expanded`.
|
|
6
|
+
* The preview is only a visual clip of that subtree, so it is inert too and
|
|
7
|
+
* assistive technology will not perceive it — if the preview carries essential
|
|
8
|
+
* information, expose an accessible summary outside the collapsed content.
|
|
9
|
+
*/
|
|
3
10
|
minHeight?: number;
|
|
4
11
|
className?: string;
|
|
5
12
|
'data-test'?: string | null | undefined;
|
|
@@ -3,6 +3,7 @@ import { use, useRef, useState, useEffect } from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import joinDataTestAttributes from '../global/data-tests.js';
|
|
5
5
|
import { getRect } from '../global/dom.js';
|
|
6
|
+
import { parseCssDuration } from '../global/parse-css-duration.js';
|
|
6
7
|
import { toPx } from './utils.js';
|
|
7
8
|
import { CollapseContext } from './collapse-context.js';
|
|
8
9
|
import { COLLAPSE_CONTENT_CONTAINER_TEST_ID, COLLAPSE_CONTENT_TEST_ID } from './consts.js';
|
|
@@ -14,16 +15,19 @@ const DURATION_FACTOR = 0.5;
|
|
|
14
15
|
const DEFAULT_HEIGHT = 0;
|
|
15
16
|
const VISIBLE = 1;
|
|
16
17
|
const HIDDEN = 0;
|
|
18
|
+
// margin for the hide fallback timer, so it fires only if transitionend never did
|
|
19
|
+
const HIDE_FALLBACK_EXTRA_DELAY = 100;
|
|
20
|
+
const isFullyCollapsed = (collapsed, initialContentHeight) => collapsed && initialContentHeight <= DEFAULT_HEIGHT;
|
|
17
21
|
/**
|
|
18
22
|
* @name CollapseContent
|
|
19
23
|
*/
|
|
20
24
|
const CollapseContent = t0 => {
|
|
21
|
-
const $ = c(
|
|
22
|
-
if ($[0] !== "
|
|
23
|
-
for (let $i = 0; $i <
|
|
25
|
+
const $ = c(33);
|
|
26
|
+
if ($[0] !== "e428f8c30c8f8cfdd43da215eea42f35a3b93ebf1af57f7e14bd2e082111ea3f") {
|
|
27
|
+
for (let $i = 0; $i < 33; $i += 1) {
|
|
24
28
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
25
29
|
}
|
|
26
|
-
$[0] = "
|
|
30
|
+
$[0] = "e428f8c30c8f8cfdd43da215eea42f35a3b93ebf1af57f7e14bd2e082111ea3f";
|
|
27
31
|
}
|
|
28
32
|
const {
|
|
29
33
|
children,
|
|
@@ -35,7 +39,8 @@ const CollapseContent = t0 => {
|
|
|
35
39
|
collapsed,
|
|
36
40
|
duration,
|
|
37
41
|
id,
|
|
38
|
-
disableAnimation
|
|
42
|
+
disableAnimation,
|
|
43
|
+
keepMounted
|
|
39
44
|
} = use(CollapseContext);
|
|
40
45
|
const containerRef = useRef(null);
|
|
41
46
|
const contentRef = useRef(null);
|
|
@@ -56,15 +61,23 @@ const CollapseContent = t0 => {
|
|
|
56
61
|
let t4;
|
|
57
62
|
if ($[3] !== collapsed || $[4] !== initialContentHeight) {
|
|
58
63
|
t3 = () => {
|
|
59
|
-
const
|
|
64
|
+
const container = containerRef.current;
|
|
65
|
+
const finalizeCollapse = function finalizeCollapse() {
|
|
60
66
|
if (initialContentHeight <= DEFAULT_HEIGHT) {
|
|
61
67
|
setShouldHideContent(collapsed);
|
|
62
68
|
}
|
|
63
69
|
};
|
|
64
|
-
const
|
|
70
|
+
const onTransitionEnd = function onTransitionEnd(event) {
|
|
71
|
+
if (event.target === container && event.propertyName === "height") {
|
|
72
|
+
finalizeCollapse();
|
|
73
|
+
}
|
|
74
|
+
};
|
|
65
75
|
container?.addEventListener("transitionend", onTransitionEnd);
|
|
76
|
+
const cssDuration = parseCssDuration(container?.style.getPropertyValue("--duration") || "");
|
|
77
|
+
const fallbackTimeout = window.setTimeout(finalizeCollapse, cssDuration + HIDE_FALLBACK_EXTRA_DELAY);
|
|
66
78
|
return () => {
|
|
67
79
|
container?.removeEventListener("transitionend", onTransitionEnd);
|
|
80
|
+
window.clearTimeout(fallbackTimeout);
|
|
68
81
|
};
|
|
69
82
|
};
|
|
70
83
|
t4 = [collapsed, initialContentHeight];
|
|
@@ -80,6 +93,9 @@ const CollapseContent = t0 => {
|
|
|
80
93
|
if (!collapsed && shouldHideContent) {
|
|
81
94
|
setShouldHideContent(false);
|
|
82
95
|
}
|
|
96
|
+
if (disableAnimation && !shouldHideContent && isFullyCollapsed(collapsed, initialContentHeight)) {
|
|
97
|
+
setShouldHideContent(true);
|
|
98
|
+
}
|
|
83
99
|
let t5;
|
|
84
100
|
let t6;
|
|
85
101
|
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
@@ -118,7 +134,9 @@ const CollapseContent = t0 => {
|
|
|
118
134
|
}
|
|
119
135
|
const style = t9;
|
|
120
136
|
const fadeShouldBeVisible = Boolean(minHeight && collapsed);
|
|
121
|
-
const
|
|
137
|
+
const contentVisible = !shouldHideContent;
|
|
138
|
+
const contentHidden = Boolean(keepMounted) && !contentVisible;
|
|
139
|
+
const contentInert = collapsed;
|
|
122
140
|
const t10 = `collapse-content-${id}`;
|
|
123
141
|
let t11;
|
|
124
142
|
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
@@ -146,50 +164,64 @@ const CollapseContent = t0 => {
|
|
|
146
164
|
} else {
|
|
147
165
|
t14 = $[17];
|
|
148
166
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
167
|
+
let t15;
|
|
168
|
+
if ($[18] !== contentHidden) {
|
|
169
|
+
t15 = contentHidden ? {
|
|
170
|
+
visibility: "hidden"
|
|
171
|
+
} : undefined;
|
|
172
|
+
$[18] = contentHidden;
|
|
173
|
+
$[19] = t15;
|
|
174
|
+
} else {
|
|
175
|
+
t15 = $[19];
|
|
176
|
+
}
|
|
177
|
+
const t16 = keepMounted || contentVisible ? children : null;
|
|
178
|
+
let t17;
|
|
179
|
+
if ($[20] !== contentInert || $[21] !== t14 || $[22] !== t15 || $[23] !== t16) {
|
|
180
|
+
t17 = /*#__PURE__*/jsx("div", {
|
|
153
181
|
ref: contentRef,
|
|
154
182
|
"data-test": t14,
|
|
155
|
-
|
|
183
|
+
style: t15,
|
|
184
|
+
inert: contentInert,
|
|
185
|
+
children: t16
|
|
156
186
|
});
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
187
|
+
$[20] = contentInert;
|
|
188
|
+
$[21] = t14;
|
|
189
|
+
$[22] = t15;
|
|
190
|
+
$[23] = t16;
|
|
191
|
+
$[24] = t17;
|
|
160
192
|
} else {
|
|
161
|
-
|
|
193
|
+
t17 = $[24];
|
|
162
194
|
}
|
|
163
|
-
let
|
|
164
|
-
if ($[
|
|
165
|
-
|
|
195
|
+
let t18;
|
|
196
|
+
if ($[25] !== fadeShouldBeVisible) {
|
|
197
|
+
t18 = fadeShouldBeVisible && /*#__PURE__*/jsx("div", {
|
|
166
198
|
className: styles.fade
|
|
167
199
|
});
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
200
|
+
$[25] = fadeShouldBeVisible;
|
|
201
|
+
$[26] = t18;
|
|
170
202
|
} else {
|
|
171
|
-
|
|
203
|
+
t18 = $[26];
|
|
172
204
|
}
|
|
173
|
-
let
|
|
174
|
-
if ($[
|
|
175
|
-
|
|
205
|
+
let t19;
|
|
206
|
+
if ($[27] !== style || $[28] !== t10 || $[29] !== t13 || $[30] !== t17 || $[31] !== t18) {
|
|
207
|
+
t19 = /*#__PURE__*/jsxs("div", {
|
|
176
208
|
ref: containerRef,
|
|
177
209
|
id: t10,
|
|
178
210
|
"data-test": t11,
|
|
179
211
|
className: t13,
|
|
180
212
|
style: style,
|
|
181
|
-
children: [
|
|
213
|
+
children: [t17, t18]
|
|
182
214
|
});
|
|
183
|
-
$[
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
215
|
+
$[27] = style;
|
|
216
|
+
$[28] = t10;
|
|
217
|
+
$[29] = t13;
|
|
218
|
+
$[30] = t17;
|
|
219
|
+
$[31] = t18;
|
|
220
|
+
$[32] = t19;
|
|
189
221
|
} else {
|
|
190
|
-
|
|
222
|
+
t19 = $[32];
|
|
191
223
|
}
|
|
192
|
-
return
|
|
224
|
+
return t19;
|
|
193
225
|
};
|
|
194
226
|
|
|
195
227
|
export { CollapseContent, CollapseContent as default };
|
|
@@ -4,6 +4,15 @@ interface Props {
|
|
|
4
4
|
onChange?: (collapsed: boolean) => void;
|
|
5
5
|
duration?: number;
|
|
6
6
|
disableAnimation?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Keep children mounted while collapsed (hidden via `visibility: hidden`
|
|
9
|
+
* and the `inert` attribute) instead of unmounting them, preserving their state.
|
|
10
|
+
* Note: hidden form controls still participate in form validation
|
|
11
|
+
* and submission — disable them while collapsed if needed.
|
|
12
|
+
* Content rendered through portals (e.g. Popup) escapes the hidden
|
|
13
|
+
* wrapper and is not hidden — close overlays on collapse.
|
|
14
|
+
*/
|
|
15
|
+
keepMounted?: boolean;
|
|
7
16
|
className?: string;
|
|
8
17
|
defaultCollapsed?: boolean;
|
|
9
18
|
collapsed?: boolean | null;
|
|
@@ -5,87 +5,91 @@ import { BASE_ANIMATION_DURATION } from './consts.js';
|
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
const Collapse = t0 => {
|
|
8
|
-
const $ = c(
|
|
9
|
-
if ($[0] !== "
|
|
10
|
-
for (let $i = 0; $i <
|
|
8
|
+
const $ = c(17);
|
|
9
|
+
if ($[0] !== "c01294e8c8f1b12e5881d26b9c4bcfc3b1ba5726fff07b53471c113b3a63b1f5") {
|
|
10
|
+
for (let $i = 0; $i < 17; $i += 1) {
|
|
11
11
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
12
12
|
}
|
|
13
|
-
$[0] = "
|
|
13
|
+
$[0] = "c01294e8c8f1b12e5881d26b9c4bcfc3b1ba5726fff07b53471c113b3a63b1f5";
|
|
14
14
|
}
|
|
15
15
|
const {
|
|
16
16
|
children,
|
|
17
17
|
duration: t1,
|
|
18
18
|
disableAnimation: t2,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
keepMounted: t3,
|
|
20
|
+
className: t4,
|
|
21
|
+
onChange: t5,
|
|
22
|
+
defaultCollapsed: t6,
|
|
23
|
+
collapsed: t7
|
|
23
24
|
} = t0;
|
|
24
25
|
const duration = t1 === undefined ? BASE_ANIMATION_DURATION : t1;
|
|
25
26
|
const disableAnimation = t2 === undefined ? false : t2;
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
27
|
+
const keepMounted = t3 === undefined ? false : t3;
|
|
28
|
+
const className = t4 === undefined ? "" : t4;
|
|
29
|
+
const onChange = t5 === undefined ? _temp : t5;
|
|
30
|
+
const defaultCollapsed = t6 === undefined ? true : t6;
|
|
31
|
+
const collapsed = t7 === undefined ? null : t7;
|
|
30
32
|
const [innerCollapsed, setInnerCollapsed] = useState(defaultCollapsed);
|
|
31
33
|
const id = useId();
|
|
32
34
|
const finalCollapsedValue = collapsed !== null && collapsed !== void 0 ? collapsed : innerCollapsed;
|
|
33
|
-
let
|
|
35
|
+
let t8;
|
|
34
36
|
if ($[1] !== finalCollapsedValue || $[2] !== onChange) {
|
|
35
|
-
|
|
37
|
+
t8 = () => {
|
|
36
38
|
setInnerCollapsed(!finalCollapsedValue);
|
|
37
39
|
onChange(!finalCollapsedValue);
|
|
38
40
|
};
|
|
39
41
|
$[1] = finalCollapsedValue;
|
|
40
42
|
$[2] = onChange;
|
|
41
|
-
$[3] =
|
|
43
|
+
$[3] = t8;
|
|
42
44
|
} else {
|
|
43
|
-
|
|
45
|
+
t8 = $[3];
|
|
44
46
|
}
|
|
45
|
-
const setCollapsed =
|
|
46
|
-
let
|
|
47
|
-
if ($[4] !== disableAnimation || $[5] !== duration || $[6] !== finalCollapsedValue || $[7] !== id || $[8] !== setCollapsed) {
|
|
48
|
-
|
|
47
|
+
const setCollapsed = t8;
|
|
48
|
+
let t9;
|
|
49
|
+
if ($[4] !== disableAnimation || $[5] !== duration || $[6] !== finalCollapsedValue || $[7] !== id || $[8] !== keepMounted || $[9] !== setCollapsed) {
|
|
50
|
+
t9 = {
|
|
49
51
|
collapsed: finalCollapsedValue,
|
|
50
52
|
setCollapsed,
|
|
51
53
|
duration,
|
|
52
54
|
disableAnimation,
|
|
55
|
+
keepMounted,
|
|
53
56
|
id
|
|
54
57
|
};
|
|
55
58
|
$[4] = disableAnimation;
|
|
56
59
|
$[5] = duration;
|
|
57
60
|
$[6] = finalCollapsedValue;
|
|
58
61
|
$[7] = id;
|
|
59
|
-
$[8] =
|
|
60
|
-
$[9] =
|
|
62
|
+
$[8] = keepMounted;
|
|
63
|
+
$[9] = setCollapsed;
|
|
64
|
+
$[10] = t9;
|
|
61
65
|
} else {
|
|
62
|
-
|
|
66
|
+
t9 = $[10];
|
|
63
67
|
}
|
|
64
|
-
let
|
|
65
|
-
if ($[
|
|
66
|
-
|
|
67
|
-
value:
|
|
68
|
+
let t10;
|
|
69
|
+
if ($[11] !== children || $[12] !== t9) {
|
|
70
|
+
t10 = /*#__PURE__*/jsx(CollapseContext, {
|
|
71
|
+
value: t9,
|
|
68
72
|
children: children
|
|
69
73
|
});
|
|
70
|
-
$[
|
|
71
|
-
$[11] = t8;
|
|
74
|
+
$[11] = children;
|
|
72
75
|
$[12] = t9;
|
|
76
|
+
$[13] = t10;
|
|
73
77
|
} else {
|
|
74
|
-
|
|
78
|
+
t10 = $[13];
|
|
75
79
|
}
|
|
76
|
-
let
|
|
77
|
-
if ($[
|
|
78
|
-
|
|
80
|
+
let t11;
|
|
81
|
+
if ($[14] !== className || $[15] !== t10) {
|
|
82
|
+
t11 = /*#__PURE__*/jsx("div", {
|
|
79
83
|
className: className,
|
|
80
|
-
children:
|
|
84
|
+
children: t10
|
|
81
85
|
});
|
|
82
|
-
$[
|
|
83
|
-
$[14] = t9;
|
|
86
|
+
$[14] = className;
|
|
84
87
|
$[15] = t10;
|
|
88
|
+
$[16] = t11;
|
|
85
89
|
} else {
|
|
86
|
-
|
|
90
|
+
t11 = $[16];
|
|
87
91
|
}
|
|
88
|
-
return
|
|
92
|
+
return t11;
|
|
89
93
|
};
|
|
90
94
|
function _temp() {}
|
|
91
95
|
|
|
@@ -11,10 +11,23 @@ export interface CollapsibleGroupProps {
|
|
|
11
11
|
onChange?: (expanded: boolean) => void;
|
|
12
12
|
disableAnimation?: boolean;
|
|
13
13
|
interactive?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Keep children mounted while collapsed (hidden via `visibility: hidden`
|
|
16
|
+
* and the `inert` attribute) instead of unmounting them, preserving their state.
|
|
17
|
+
* Note: hidden form controls still participate in form validation
|
|
18
|
+
* and submission — disable them while collapsed if needed.
|
|
19
|
+
* Content rendered through portals (e.g. Popup) escapes the hidden
|
|
20
|
+
* wrapper and is not hidden — close overlays on collapse.
|
|
21
|
+
*/
|
|
22
|
+
keepMounted?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Wraps the header in an <h2>–<h6> to keep the document outline.
|
|
25
|
+
*/
|
|
26
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
14
27
|
'data-test'?: string | null | undefined;
|
|
15
28
|
}
|
|
16
29
|
declare const CollapsibleGroup: {
|
|
17
|
-
({ ref, avatar, title, subtitle, children, className, defaultExpanded, expanded, onChange, disableAnimation, interactive, "data-test": dataTest, }: CollapsibleGroupProps): React.JSX.Element;
|
|
30
|
+
({ ref, avatar, title, subtitle, children, className, defaultExpanded, expanded, onChange, disableAnimation, interactive, keepMounted, headingLevel, "data-test": dataTest, }: CollapsibleGroupProps): React.JSX.Element;
|
|
18
31
|
displayName: string;
|
|
19
32
|
};
|
|
20
33
|
export default CollapsibleGroup;
|