@datarobot/design-system 30.1.3 → 30.3.0
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/cjs/collapsible-panel/collapsible-panel.js +1 -0
- package/cjs/loading-backdrop/loading-backdrop.js +5 -1
- package/cjs/selectable-tiles/index.d.ts +2 -0
- package/cjs/selectable-tiles/index.js +7 -0
- package/cjs/selectable-tiles/selectable-tiles-item.d.ts +3 -1
- package/cjs/selectable-tiles/selectable-tiles-item.js +2 -1
- package/cjs/selectable-tiles/selectable-tiles.d.ts +4 -1
- package/cjs/selectable-tiles/selectable-tiles.js +5 -2
- package/cjs/selectable-tiles/types.d.ts +6 -0
- package/cjs/selectable-tiles/types.js +10 -0
- package/cjs/table-react/components/table-settings/table-settings-item.js +13 -0
- package/esm/collapsible-panel/collapsible-panel.js +1 -0
- package/esm/loading-backdrop/loading-backdrop.js +4 -1
- package/esm/selectable-tiles/index.d.ts +2 -0
- package/esm/selectable-tiles/index.js +1 -0
- package/esm/selectable-tiles/selectable-tiles-item.d.ts +3 -1
- package/esm/selectable-tiles/selectable-tiles-item.js +2 -1
- package/esm/selectable-tiles/selectable-tiles.d.ts +4 -1
- package/esm/selectable-tiles/selectable-tiles.js +5 -2
- package/esm/selectable-tiles/types.d.ts +6 -0
- package/esm/selectable-tiles/types.js +4 -0
- package/esm/table-react/components/table-settings/table-settings-item.js +13 -0
- package/js/bundle/bundle.js +54 -11
- package/js/bundle/bundle.min.js +1 -1
- package/js/bundle/index.d.ts +9 -1
- package/package.json +1 -1
- package/styles/index.css +13 -4
- package/styles/index.min.css +1 -1
- package/styles/themes/alpine-light.css +2 -1
- package/styles/themes/alpine-light.min.css +1 -1
- package/styles/themes/light.css +2 -1
- package/styles/themes/light.min.css +1 -1
- package/styles/themes/midnight-gray.css +2 -1
- package/styles/themes/midnight-gray.min.css +1 -1
|
@@ -98,6 +98,7 @@ const CollapsiblePanel = ({
|
|
|
98
98
|
}),
|
|
99
99
|
children: [headerPlacement === COLLAPSIBLE_PANEL_PLACEMENT.TOP && headerContainer, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.CSSTransition, {
|
|
100
100
|
...transitionProps,
|
|
101
|
+
nodeRef: wrapperRef,
|
|
101
102
|
in: expanded,
|
|
102
103
|
onEntering: onEntering,
|
|
103
104
|
onEntered: onEntered,
|
|
@@ -4,13 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.LoadingBackdrop = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
9
|
var _reactTransitionGroup = require("react-transition-group");
|
|
10
10
|
var _message = require("../message");
|
|
11
11
|
var _useTranslation = require("../hooks/use-translation");
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
15
|
/** Shows loader when content is not ready
|
|
15
16
|
* [CAPITALIZATION] Use sentence case
|
|
16
17
|
* @midnight-gray-supported
|
|
@@ -26,13 +27,16 @@ const LoadingBackdrop = ({
|
|
|
26
27
|
const {
|
|
27
28
|
t
|
|
28
29
|
} = (0, _useTranslation.useTranslation)();
|
|
30
|
+
const nodeRef = (0, _react.useRef)(null);
|
|
29
31
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.CSSTransition, {
|
|
30
32
|
classNames: "loading-backdrop",
|
|
33
|
+
nodeRef: nodeRef,
|
|
31
34
|
in: isLoading,
|
|
32
35
|
onExited: onTransitionEnd,
|
|
33
36
|
timeout: 500,
|
|
34
37
|
appear: true,
|
|
35
38
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
39
|
+
ref: nodeRef,
|
|
36
40
|
className: (0, _classnames.default)('loading-backdrop center-status ', customClassName),
|
|
37
41
|
"test-id": testId,
|
|
38
42
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_message.Message, {
|
|
@@ -3,11 +3,18 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "SELECTABLE_TILES_SIZES", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _types.SELECTABLE_TILES_SIZES;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
Object.defineProperty(exports, "SelectableTiles", {
|
|
7
13
|
enumerable: true,
|
|
8
14
|
get: function () {
|
|
9
15
|
return _selectableTiles.default;
|
|
10
16
|
}
|
|
11
17
|
});
|
|
18
|
+
var _types = require("./types");
|
|
12
19
|
var _selectableTiles = _interopRequireDefault(require("./selectable-tiles"));
|
|
13
20
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
3
3
|
import { TooltipPlacementsType } from '../tooltip';
|
|
4
|
+
import type { SelectableTilesSize } from './types';
|
|
4
5
|
type SelectableTilesItemProps = {
|
|
5
6
|
id: string;
|
|
6
7
|
label?: string;
|
|
@@ -12,9 +13,10 @@ type SelectableTilesItemProps = {
|
|
|
12
13
|
isDisabled?: boolean;
|
|
13
14
|
itemClassName?: string;
|
|
14
15
|
itemAriaLabel?: string;
|
|
16
|
+
size: SelectableTilesSize;
|
|
15
17
|
customContent?: ReactElement;
|
|
16
18
|
tooltipText?: string;
|
|
17
19
|
tooltipPlacement?: TooltipPlacementsType;
|
|
18
20
|
};
|
|
19
|
-
export declare function SelectableTilesItem({ id, label, imgSrc, icon, itemTestId, selectedKey, onItemSelect, isDisabled, itemClassName, itemAriaLabel, customContent, tooltipText, tooltipPlacement, }: SelectableTilesItemProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function SelectableTilesItem({ id, label, imgSrc, icon, itemTestId, size, selectedKey, onItemSelect, isDisabled, itemClassName, itemAriaLabel, customContent, tooltipText, tooltipPlacement, }: SelectableTilesItemProps): import("react/jsx-runtime").JSX.Element;
|
|
20
22
|
export {};
|
|
@@ -16,6 +16,7 @@ function SelectableTilesItem({
|
|
|
16
16
|
imgSrc,
|
|
17
17
|
icon,
|
|
18
18
|
itemTestId,
|
|
19
|
+
size,
|
|
19
20
|
selectedKey,
|
|
20
21
|
onItemSelect,
|
|
21
22
|
isDisabled,
|
|
@@ -51,7 +52,7 @@ function SelectableTilesItem({
|
|
|
51
52
|
content: tooltipText,
|
|
52
53
|
placement: tooltipPlacement,
|
|
53
54
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
54
|
-
className: (0, _classnames.default)('selectable-tiles-item', itemClassName, {
|
|
55
|
+
className: (0, _classnames.default)('selectable-tiles-item', itemClassName, size, {
|
|
55
56
|
'selectable-tiles-item-selected': isItemSelected,
|
|
56
57
|
'selectable-tiles-item-disabled': isDisabled,
|
|
57
58
|
'label-with-image': !!imgSrc
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
3
3
|
import { TooltipPlacementsType } from '../tooltip';
|
|
4
|
+
import { SelectableTilesSize } from './types';
|
|
4
5
|
import './selectable-tiles.less';
|
|
5
6
|
export type SelectableTileOptions = {
|
|
6
7
|
id: string;
|
|
@@ -42,11 +43,13 @@ export type SelectableTilesProps = {
|
|
|
42
43
|
isDisabled?: boolean;
|
|
43
44
|
/** Allows for aria label to be associated with the component */
|
|
44
45
|
labelledBy?: string;
|
|
46
|
+
/** size of the tiles */
|
|
47
|
+
size?: SelectableTilesSize;
|
|
45
48
|
};
|
|
46
49
|
/** SelectableTiles let user choose on of the options represented in the form of tiles
|
|
47
50
|
* [CAPITALIZATION] Sentence case (capitalize proper nouns i.e., Holdout).
|
|
48
51
|
* @midnight-gray-supported
|
|
49
52
|
* @alpine-light-supported
|
|
50
53
|
*/
|
|
51
|
-
declare function SelectableTiles({ options, selectedKey, onItemSelect, containerClassName, itemClassName, optionId, isDisabled, labelledBy, }: SelectableTilesProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
declare function SelectableTiles({ options, selectedKey, onItemSelect, containerClassName, itemClassName, optionId, isDisabled, labelledBy, size, }: SelectableTilesProps): import("react/jsx-runtime").JSX.Element;
|
|
52
55
|
export default SelectableTiles;
|
|
@@ -7,6 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
9
|
var _selectableTilesItem = require("./selectable-tiles-item");
|
|
10
|
+
var _types = require("./types");
|
|
10
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
13
|
/** SelectableTiles let user choose on of the options represented in the form of tiles
|
|
@@ -22,7 +23,8 @@ function SelectableTiles({
|
|
|
22
23
|
itemClassName,
|
|
23
24
|
optionId = 'id',
|
|
24
25
|
isDisabled,
|
|
25
|
-
labelledBy
|
|
26
|
+
labelledBy,
|
|
27
|
+
size = _types.SELECTABLE_TILES_SIZES.MD
|
|
26
28
|
}) {
|
|
27
29
|
const onSelect = key => {
|
|
28
30
|
if (key === selectedKey) {
|
|
@@ -63,7 +65,8 @@ function SelectableTiles({
|
|
|
63
65
|
customContent: customContent,
|
|
64
66
|
tooltipText: tooltipText,
|
|
65
67
|
tooltipPlacement: tooltipPlacement,
|
|
66
|
-
itemAriaLabel: itemAriaLabel
|
|
68
|
+
itemAriaLabel: itemAriaLabel,
|
|
69
|
+
size: size
|
|
67
70
|
}, tileId);
|
|
68
71
|
})
|
|
69
72
|
});
|
|
@@ -15,6 +15,7 @@ var _truncateWithTooltip = require("../../../truncate-with-tooltip");
|
|
|
15
15
|
var _button = require("../../../button");
|
|
16
16
|
var _fontAwesomeIcon = require("../../../font-awesome-icon");
|
|
17
17
|
var _hooks = require("../../../hooks");
|
|
18
|
+
var _useTranslation = require("../../../hooks/use-translation");
|
|
18
19
|
var _types = require("../../types");
|
|
19
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
21
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -30,6 +31,9 @@ function TableSettingsItem({
|
|
|
30
31
|
handleKeyboardColumnsReorder,
|
|
31
32
|
localizationText
|
|
32
33
|
}) {
|
|
34
|
+
const {
|
|
35
|
+
t
|
|
36
|
+
} = (0, _useTranslation.useTranslation)();
|
|
33
37
|
const isPinned = listItem.getIsPinned();
|
|
34
38
|
const sorted = listItem.getIsSorted();
|
|
35
39
|
const isVisible = listItem.getIsVisible();
|
|
@@ -67,6 +71,13 @@ function TableSettingsItem({
|
|
|
67
71
|
break;
|
|
68
72
|
}
|
|
69
73
|
};
|
|
74
|
+
const visibleColumns = settings.getVisibleLeafColumns().filter(({
|
|
75
|
+
columnDef: {
|
|
76
|
+
meta
|
|
77
|
+
}
|
|
78
|
+
}) => meta?.hideFromSettings !== true);
|
|
79
|
+
const isOneVisible = visibleColumns.length === 1;
|
|
80
|
+
const disableHideColumns = isOneVisible && isVisible;
|
|
70
81
|
return (
|
|
71
82
|
/*#__PURE__*/
|
|
72
83
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
@@ -87,6 +98,8 @@ function TableSettingsItem({
|
|
|
87
98
|
id: `checkbox-${listItem.id}`,
|
|
88
99
|
testId: `visibility-checkbox-${listItem.id}`,
|
|
89
100
|
isChecked: isVisible,
|
|
101
|
+
isDisabled: disableHideColumns,
|
|
102
|
+
tooltipText: disableHideColumns ? t('At least one column must stay selected') : undefined,
|
|
90
103
|
onChange: listItem.getToggleVisibilityHandler(),
|
|
91
104
|
className: "table-settings-checkbox",
|
|
92
105
|
ariaLabel: listItem.columnDef.header
|
|
@@ -90,6 +90,7 @@ const CollapsiblePanel = ({
|
|
|
90
90
|
}),
|
|
91
91
|
children: [headerPlacement === COLLAPSIBLE_PANEL_PLACEMENT.TOP && headerContainer, /*#__PURE__*/_jsx(CSSTransition, {
|
|
92
92
|
...transitionProps,
|
|
93
|
+
nodeRef: wrapperRef,
|
|
93
94
|
in: expanded,
|
|
94
95
|
onEntering: onEntering,
|
|
95
96
|
onEntered: onEntered,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { CSSTransition } from 'react-transition-group';
|
|
4
4
|
import { Message, MESSAGE_TYPES } from '../message';
|
|
@@ -19,13 +19,16 @@ export const LoadingBackdrop = ({
|
|
|
19
19
|
const {
|
|
20
20
|
t
|
|
21
21
|
} = useTranslation();
|
|
22
|
+
const nodeRef = useRef(null);
|
|
22
23
|
return /*#__PURE__*/_jsx(CSSTransition, {
|
|
23
24
|
classNames: "loading-backdrop",
|
|
25
|
+
nodeRef: nodeRef,
|
|
24
26
|
in: isLoading,
|
|
25
27
|
onExited: onTransitionEnd,
|
|
26
28
|
timeout: 500,
|
|
27
29
|
appear: true,
|
|
28
30
|
children: /*#__PURE__*/_jsx("div", {
|
|
31
|
+
ref: nodeRef,
|
|
29
32
|
className: classNames('loading-backdrop center-status ', customClassName),
|
|
30
33
|
"test-id": testId,
|
|
31
34
|
children: /*#__PURE__*/_jsx(Message, {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
3
3
|
import { TooltipPlacementsType } from '../tooltip';
|
|
4
|
+
import type { SelectableTilesSize } from './types';
|
|
4
5
|
type SelectableTilesItemProps = {
|
|
5
6
|
id: string;
|
|
6
7
|
label?: string;
|
|
@@ -12,9 +13,10 @@ type SelectableTilesItemProps = {
|
|
|
12
13
|
isDisabled?: boolean;
|
|
13
14
|
itemClassName?: string;
|
|
14
15
|
itemAriaLabel?: string;
|
|
16
|
+
size: SelectableTilesSize;
|
|
15
17
|
customContent?: ReactElement;
|
|
16
18
|
tooltipText?: string;
|
|
17
19
|
tooltipPlacement?: TooltipPlacementsType;
|
|
18
20
|
};
|
|
19
|
-
export declare function SelectableTilesItem({ id, label, imgSrc, icon, itemTestId, selectedKey, onItemSelect, isDisabled, itemClassName, itemAriaLabel, customContent, tooltipText, tooltipPlacement, }: SelectableTilesItemProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function SelectableTilesItem({ id, label, imgSrc, icon, itemTestId, size, selectedKey, onItemSelect, isDisabled, itemClassName, itemAriaLabel, customContent, tooltipText, tooltipPlacement, }: SelectableTilesItemProps): import("react/jsx-runtime").JSX.Element;
|
|
20
22
|
export {};
|
|
@@ -9,6 +9,7 @@ export function SelectableTilesItem({
|
|
|
9
9
|
imgSrc,
|
|
10
10
|
icon,
|
|
11
11
|
itemTestId,
|
|
12
|
+
size,
|
|
12
13
|
selectedKey,
|
|
13
14
|
onItemSelect,
|
|
14
15
|
isDisabled,
|
|
@@ -44,7 +45,7 @@ export function SelectableTilesItem({
|
|
|
44
45
|
content: tooltipText,
|
|
45
46
|
placement: tooltipPlacement,
|
|
46
47
|
children: /*#__PURE__*/_jsx("div", {
|
|
47
|
-
className: classnames('selectable-tiles-item', itemClassName, {
|
|
48
|
+
className: classnames('selectable-tiles-item', itemClassName, size, {
|
|
48
49
|
'selectable-tiles-item-selected': isItemSelected,
|
|
49
50
|
'selectable-tiles-item-disabled': isDisabled,
|
|
50
51
|
'label-with-image': !!imgSrc
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
3
3
|
import { TooltipPlacementsType } from '../tooltip';
|
|
4
|
+
import { SelectableTilesSize } from './types';
|
|
4
5
|
import './selectable-tiles.less';
|
|
5
6
|
export type SelectableTileOptions = {
|
|
6
7
|
id: string;
|
|
@@ -42,11 +43,13 @@ export type SelectableTilesProps = {
|
|
|
42
43
|
isDisabled?: boolean;
|
|
43
44
|
/** Allows for aria label to be associated with the component */
|
|
44
45
|
labelledBy?: string;
|
|
46
|
+
/** size of the tiles */
|
|
47
|
+
size?: SelectableTilesSize;
|
|
45
48
|
};
|
|
46
49
|
/** SelectableTiles let user choose on of the options represented in the form of tiles
|
|
47
50
|
* [CAPITALIZATION] Sentence case (capitalize proper nouns i.e., Holdout).
|
|
48
51
|
* @midnight-gray-supported
|
|
49
52
|
* @alpine-light-supported
|
|
50
53
|
*/
|
|
51
|
-
declare function SelectableTiles({ options, selectedKey, onItemSelect, containerClassName, itemClassName, optionId, isDisabled, labelledBy, }: SelectableTilesProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
declare function SelectableTiles({ options, selectedKey, onItemSelect, containerClassName, itemClassName, optionId, isDisabled, labelledBy, size, }: SelectableTilesProps): import("react/jsx-runtime").JSX.Element;
|
|
52
55
|
export default SelectableTiles;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { SelectableTilesItem } from './selectable-tiles-item';
|
|
4
|
+
import { SELECTABLE_TILES_SIZES } from './types';
|
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
6
|
/** SelectableTiles let user choose on of the options represented in the form of tiles
|
|
6
7
|
* [CAPITALIZATION] Sentence case (capitalize proper nouns i.e., Holdout).
|
|
@@ -15,7 +16,8 @@ function SelectableTiles({
|
|
|
15
16
|
itemClassName,
|
|
16
17
|
optionId = 'id',
|
|
17
18
|
isDisabled,
|
|
18
|
-
labelledBy
|
|
19
|
+
labelledBy,
|
|
20
|
+
size = SELECTABLE_TILES_SIZES.MD
|
|
19
21
|
}) {
|
|
20
22
|
const onSelect = key => {
|
|
21
23
|
if (key === selectedKey) {
|
|
@@ -56,7 +58,8 @@ function SelectableTiles({
|
|
|
56
58
|
customContent: customContent,
|
|
57
59
|
tooltipText: tooltipText,
|
|
58
60
|
tooltipPlacement: tooltipPlacement,
|
|
59
|
-
itemAriaLabel: itemAriaLabel
|
|
61
|
+
itemAriaLabel: itemAriaLabel,
|
|
62
|
+
size: size
|
|
60
63
|
}, tileId);
|
|
61
64
|
})
|
|
62
65
|
});
|
|
@@ -9,6 +9,7 @@ import { TruncateWithTooltip } from '../../../truncate-with-tooltip';
|
|
|
9
9
|
import { ACCENT_TYPES, Button, BUTTON_SIZES } from '../../../button';
|
|
10
10
|
import { FontAwesomeIcon } from '../../../font-awesome-icon';
|
|
11
11
|
import { useFocusWithin } from '../../../hooks';
|
|
12
|
+
import { useTranslation } from '../../../hooks/use-translation';
|
|
12
13
|
import { PINNED_WIDTH_THRESHOLD, SORTING } from '../../types';
|
|
13
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
15
|
export function TableSettingsItem({
|
|
@@ -22,6 +23,9 @@ export function TableSettingsItem({
|
|
|
22
23
|
handleKeyboardColumnsReorder,
|
|
23
24
|
localizationText
|
|
24
25
|
}) {
|
|
26
|
+
const {
|
|
27
|
+
t
|
|
28
|
+
} = useTranslation();
|
|
25
29
|
const isPinned = listItem.getIsPinned();
|
|
26
30
|
const sorted = listItem.getIsSorted();
|
|
27
31
|
const isVisible = listItem.getIsVisible();
|
|
@@ -59,6 +63,13 @@ export function TableSettingsItem({
|
|
|
59
63
|
break;
|
|
60
64
|
}
|
|
61
65
|
};
|
|
66
|
+
const visibleColumns = settings.getVisibleLeafColumns().filter(({
|
|
67
|
+
columnDef: {
|
|
68
|
+
meta
|
|
69
|
+
}
|
|
70
|
+
}) => meta?.hideFromSettings !== true);
|
|
71
|
+
const isOneVisible = visibleColumns.length === 1;
|
|
72
|
+
const disableHideColumns = isOneVisible && isVisible;
|
|
62
73
|
return (
|
|
63
74
|
/*#__PURE__*/
|
|
64
75
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
@@ -79,6 +90,8 @@ export function TableSettingsItem({
|
|
|
79
90
|
id: `checkbox-${listItem.id}`,
|
|
80
91
|
testId: `visibility-checkbox-${listItem.id}`,
|
|
81
92
|
isChecked: isVisible,
|
|
93
|
+
isDisabled: disableHideColumns,
|
|
94
|
+
tooltipText: disableHideColumns ? t('At least one column must stay selected') : undefined,
|
|
82
95
|
onChange: listItem.getToggleVisibilityHandler(),
|
|
83
96
|
className: "table-settings-checkbox",
|
|
84
97
|
ariaLabel: listItem.columnDef.header
|
package/js/bundle/bundle.js
CHANGED
|
@@ -47982,6 +47982,7 @@ var CollapsiblePanel = function CollapsiblePanel(_ref) {
|
|
|
47982
47982
|
'collapsible-panel-expanded': expanded
|
|
47983
47983
|
})
|
|
47984
47984
|
}, headerPlacement === COLLAPSIBLE_PANEL_PLACEMENT.TOP && headerContainer, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_transition_group__WEBPACK_IMPORTED_MODULE_7__["default"], _extends({}, transitionProps, {
|
|
47985
|
+
nodeRef: wrapperRef,
|
|
47985
47986
|
"in": expanded,
|
|
47986
47987
|
onEntering: onEntering,
|
|
47987
47988
|
onEntered: onEntered,
|
|
@@ -67201,6 +67202,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
67201
67202
|
/* harmony export */ RangeSlider: () => (/* reexport safe */ _range_slider__WEBPACK_IMPORTED_MODULE_70__.RangeSlider),
|
|
67202
67203
|
/* harmony export */ RefreshButton: () => (/* reexport safe */ _refresh_button__WEBPACK_IMPORTED_MODULE_72__.RefreshButton),
|
|
67203
67204
|
/* harmony export */ SEARCH_MODE_TYPES: () => (/* reexport safe */ _search__WEBPACK_IMPORTED_MODULE_74__.SEARCH_MODE_TYPES),
|
|
67205
|
+
/* harmony export */ SELECTABLE_TILES_SIZES: () => (/* reexport safe */ _selectable_tiles__WEBPACK_IMPORTED_MODULE_76__.SELECTABLE_TILES_SIZES),
|
|
67204
67206
|
/* harmony export */ SKELETON_TYPES: () => (/* reexport safe */ _skeleton__WEBPACK_IMPORTED_MODULE_81__.SKELETON_TYPES),
|
|
67205
67207
|
/* harmony export */ SUB_NAVIGATION_ACCENT_SIZES: () => (/* reexport safe */ _sub_navigation__WEBPACK_IMPORTED_MODULE_86__.SUB_NAVIGATION_ACCENT_SIZES),
|
|
67206
67208
|
/* harmony export */ SUB_NAVIGATION_ACCENT_TYPES: () => (/* reexport safe */ _sub_navigation__WEBPACK_IMPORTED_MODULE_86__.SUB_NAVIGATION_ACCENT_TYPES),
|
|
@@ -69297,13 +69299,16 @@ var LoadingBackdrop = function LoadingBackdrop(_ref) {
|
|
|
69297
69299
|
testId = _ref$testId === void 0 ? 'loading-backdrop' : _ref$testId;
|
|
69298
69300
|
var _useTranslation = (0,_hooks_use_translation__WEBPACK_IMPORTED_MODULE_3__.useTranslation)(),
|
|
69299
69301
|
t = _useTranslation.t;
|
|
69302
|
+
var nodeRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
69300
69303
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_transition_group__WEBPACK_IMPORTED_MODULE_5__["default"], {
|
|
69301
69304
|
classNames: "loading-backdrop",
|
|
69305
|
+
nodeRef: nodeRef,
|
|
69302
69306
|
"in": isLoading,
|
|
69303
69307
|
onExited: onTransitionEnd,
|
|
69304
69308
|
timeout: 500,
|
|
69305
69309
|
appear: true
|
|
69306
69310
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
69311
|
+
ref: nodeRef,
|
|
69307
69312
|
className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('loading-backdrop center-status ', customClassName),
|
|
69308
69313
|
"test-id": testId
|
|
69309
69314
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_message__WEBPACK_IMPORTED_MODULE_2__.Message, {
|
|
@@ -74924,9 +74929,12 @@ function SearchableList(_ref) {
|
|
|
74924
74929
|
|
|
74925
74930
|
"use strict";
|
|
74926
74931
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
74927
|
-
/* harmony export */
|
|
74932
|
+
/* harmony export */ SELECTABLE_TILES_SIZES: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_0__.SELECTABLE_TILES_SIZES),
|
|
74933
|
+
/* harmony export */ SelectableTiles: () => (/* reexport safe */ _selectable_tiles__WEBPACK_IMPORTED_MODULE_1__["default"])
|
|
74928
74934
|
/* harmony export */ });
|
|
74929
|
-
/* harmony import */ var
|
|
74935
|
+
/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./src/components/selectable-tiles/types.ts");
|
|
74936
|
+
/* harmony import */ var _selectable_tiles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./selectable-tiles */ "./src/components/selectable-tiles/selectable-tiles.tsx");
|
|
74937
|
+
|
|
74930
74938
|
|
|
74931
74939
|
|
|
74932
74940
|
/***/ }),
|
|
@@ -74957,6 +74965,7 @@ function SelectableTilesItem(_ref) {
|
|
|
74957
74965
|
imgSrc = _ref.imgSrc,
|
|
74958
74966
|
icon = _ref.icon,
|
|
74959
74967
|
itemTestId = _ref.itemTestId,
|
|
74968
|
+
size = _ref.size,
|
|
74960
74969
|
selectedKey = _ref.selectedKey,
|
|
74961
74970
|
onItemSelect = _ref.onItemSelect,
|
|
74962
74971
|
isDisabled = _ref.isDisabled,
|
|
@@ -74992,7 +75001,7 @@ function SelectableTilesItem(_ref) {
|
|
|
74992
75001
|
content: tooltipText,
|
|
74993
75002
|
placement: tooltipPlacement
|
|
74994
75003
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
74995
|
-
className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('selectable-tiles-item', itemClassName, {
|
|
75004
|
+
className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('selectable-tiles-item', itemClassName, size, {
|
|
74996
75005
|
'selectable-tiles-item-selected': isItemSelected,
|
|
74997
75006
|
'selectable-tiles-item-disabled': isDisabled,
|
|
74998
75007
|
'label-with-image': !!imgSrc
|
|
@@ -75053,8 +75062,10 @@ function StandardContent(_ref2) {
|
|
|
75053
75062
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
|
|
75054
75063
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
|
|
75055
75064
|
/* harmony import */ var _selectable_tiles_item__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selectable-tiles-item */ "./src/components/selectable-tiles/selectable-tiles-item.tsx");
|
|
75056
|
-
/* harmony import */ var
|
|
75057
|
-
/* harmony import */ var
|
|
75065
|
+
/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./types */ "./src/components/selectable-tiles/types.ts");
|
|
75066
|
+
/* harmony import */ var _selectable_tiles_less__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./selectable-tiles.less */ "./src/components/selectable-tiles/selectable-tiles.less");
|
|
75067
|
+
/* harmony import */ var _selectable_tiles_less__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_selectable_tiles_less__WEBPACK_IMPORTED_MODULE_4__);
|
|
75068
|
+
|
|
75058
75069
|
|
|
75059
75070
|
|
|
75060
75071
|
|
|
@@ -75073,7 +75084,9 @@ function SelectableTiles(_ref) {
|
|
|
75073
75084
|
_ref$optionId = _ref.optionId,
|
|
75074
75085
|
optionId = _ref$optionId === void 0 ? 'id' : _ref$optionId,
|
|
75075
75086
|
isDisabled = _ref.isDisabled,
|
|
75076
|
-
labelledBy = _ref.labelledBy
|
|
75087
|
+
labelledBy = _ref.labelledBy,
|
|
75088
|
+
_ref$size = _ref.size,
|
|
75089
|
+
size = _ref$size === void 0 ? _types__WEBPACK_IMPORTED_MODULE_3__.SELECTABLE_TILES_SIZES.MD : _ref$size;
|
|
75077
75090
|
var onSelect = function onSelect(key) {
|
|
75078
75091
|
if (key === selectedKey) {
|
|
75079
75092
|
return;
|
|
@@ -75112,7 +75125,8 @@ function SelectableTiles(_ref) {
|
|
|
75112
75125
|
customContent: customContent,
|
|
75113
75126
|
tooltipText: tooltipText,
|
|
75114
75127
|
tooltipPlacement: tooltipPlacement,
|
|
75115
|
-
itemAriaLabel: itemAriaLabel
|
|
75128
|
+
itemAriaLabel: itemAriaLabel,
|
|
75129
|
+
size: size
|
|
75116
75130
|
});
|
|
75117
75131
|
}));
|
|
75118
75132
|
}
|
|
@@ -75120,6 +75134,23 @@ function SelectableTiles(_ref) {
|
|
|
75120
75134
|
|
|
75121
75135
|
/***/ }),
|
|
75122
75136
|
|
|
75137
|
+
/***/ "./src/components/selectable-tiles/types.ts":
|
|
75138
|
+
/*!**************************************************!*\
|
|
75139
|
+
!*** ./src/components/selectable-tiles/types.ts ***!
|
|
75140
|
+
\**************************************************/
|
|
75141
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
75142
|
+
|
|
75143
|
+
"use strict";
|
|
75144
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
75145
|
+
/* harmony export */ SELECTABLE_TILES_SIZES: () => (/* binding */ SELECTABLE_TILES_SIZES)
|
|
75146
|
+
/* harmony export */ });
|
|
75147
|
+
var SELECTABLE_TILES_SIZES = {
|
|
75148
|
+
SM: 'sm',
|
|
75149
|
+
MD: 'md'
|
|
75150
|
+
};
|
|
75151
|
+
|
|
75152
|
+
/***/ }),
|
|
75153
|
+
|
|
75123
75154
|
/***/ "./src/components/sidebar-cards/index.ts":
|
|
75124
75155
|
/*!***********************************************!*\
|
|
75125
75156
|
!*** ./src/components/sidebar-cards/index.ts ***!
|
|
@@ -79045,7 +79076,8 @@ function TableSettingsGroup(_ref) {
|
|
|
79045
79076
|
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../button */ "./src/components/button/index.ts");
|
|
79046
79077
|
/* harmony import */ var _font_awesome_icon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../font-awesome-icon */ "./src/components/font-awesome-icon/index.ts");
|
|
79047
79078
|
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../hooks */ "./src/components/hooks/index.ts");
|
|
79048
|
-
/* harmony import */ var
|
|
79079
|
+
/* harmony import */ var _hooks_use_translation__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../hooks/use-translation */ "./src/components/hooks/use-translation/index.ts");
|
|
79080
|
+
/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../types */ "./src/components/table-react/types.ts");
|
|
79049
79081
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
79050
79082
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
79051
79083
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -79064,6 +79096,7 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
|
79064
79096
|
|
|
79065
79097
|
|
|
79066
79098
|
|
|
79099
|
+
|
|
79067
79100
|
function TableSettingsItem(_ref) {
|
|
79068
79101
|
var index = _ref.index,
|
|
79069
79102
|
listItem = _ref.listItem,
|
|
@@ -79074,6 +79107,8 @@ function TableSettingsItem(_ref) {
|
|
|
79074
79107
|
isReorderEnabled = _ref.isReorderEnabled,
|
|
79075
79108
|
handleKeyboardColumnsReorder = _ref.handleKeyboardColumnsReorder,
|
|
79076
79109
|
localizationText = _ref.localizationText;
|
|
79110
|
+
var _useTranslation = (0,_hooks_use_translation__WEBPACK_IMPORTED_MODULE_11__.useTranslation)(),
|
|
79111
|
+
t = _useTranslation.t;
|
|
79077
79112
|
var isPinned = listItem.getIsPinned();
|
|
79078
79113
|
var sorted = listItem.getIsSorted();
|
|
79079
79114
|
var isVisible = listItem.getIsVisible();
|
|
@@ -79089,10 +79124,10 @@ function TableSettingsItem(_ref) {
|
|
|
79089
79124
|
setItemFocused(false);
|
|
79090
79125
|
}
|
|
79091
79126
|
});
|
|
79092
|
-
var sortIcon = sorted ===
|
|
79127
|
+
var sortIcon = sorted === _types__WEBPACK_IMPORTED_MODULE_12__.SORTING.DESC ? _fortawesome_free_solid_svg_icons_faDownLong__WEBPACK_IMPORTED_MODULE_2__.faDownLong : _fortawesome_free_solid_svg_icons_faUpLong__WEBPACK_IMPORTED_MODULE_3__.faUpLong;
|
|
79093
79128
|
var nextSorting = listItem.getNextSortingOrder();
|
|
79094
|
-
var nextSortIcon = nextSorting ===
|
|
79095
|
-
var isColumnPinDisabled = !isPinned && (listItem.getSize() + settings.getLeftTotalSize()) / tableContainerWidth >
|
|
79129
|
+
var nextSortIcon = nextSorting === _types__WEBPACK_IMPORTED_MODULE_12__.SORTING.DESC ? _fortawesome_free_solid_svg_icons_faDownLong__WEBPACK_IMPORTED_MODULE_2__.faDownLong : _fortawesome_free_solid_svg_icons_faUpLong__WEBPACK_IMPORTED_MODULE_3__.faUpLong;
|
|
79130
|
+
var isColumnPinDisabled = !isPinned && (listItem.getSize() + settings.getLeftTotalSize()) / tableContainerWidth > _types__WEBPACK_IMPORTED_MODULE_12__.PINNED_WIDTH_THRESHOLD;
|
|
79096
79131
|
var togglePin = function togglePin() {
|
|
79097
79132
|
if (isPinned) {
|
|
79098
79133
|
listItem.pin(false);
|
|
@@ -79114,6 +79149,12 @@ function TableSettingsItem(_ref) {
|
|
|
79114
79149
|
break;
|
|
79115
79150
|
}
|
|
79116
79151
|
};
|
|
79152
|
+
var visibleColumns = settings.getVisibleLeafColumns().filter(function (_ref2) {
|
|
79153
|
+
var meta = _ref2.columnDef.meta;
|
|
79154
|
+
return (meta === null || meta === void 0 ? void 0 : meta.hideFromSettings) !== true;
|
|
79155
|
+
});
|
|
79156
|
+
var isOneVisible = visibleColumns.length === 1;
|
|
79157
|
+
var disableHideColumns = isOneVisible && isVisible;
|
|
79117
79158
|
return (
|
|
79118
79159
|
/*#__PURE__*/
|
|
79119
79160
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
@@ -79135,6 +79176,8 @@ function TableSettingsItem(_ref) {
|
|
|
79135
79176
|
id: "checkbox-".concat(listItem.id),
|
|
79136
79177
|
testId: "visibility-checkbox-".concat(listItem.id),
|
|
79137
79178
|
isChecked: isVisible,
|
|
79179
|
+
isDisabled: disableHideColumns,
|
|
79180
|
+
tooltipText: disableHideColumns ? t('At least one column must stay selected') : undefined,
|
|
79138
79181
|
onChange: listItem.getToggleVisibilityHandler(),
|
|
79139
79182
|
className: "table-settings-checkbox",
|
|
79140
79183
|
ariaLabel: listItem.columnDef.header
|