@carbon/ibm-products 1.25.0 → 1.27.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +62 -15
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +62 -15
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +62 -15
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/Datagrid/Datagrid/DatagridToolbar.js +139 -11
- package/es/components/Datagrid/useActionsColumn.js +31 -6
- package/es/components/Datagrid/useDefaultStringRenderer.js +4 -1
- package/es/components/Datagrid/useSelectRows.js +2 -2
- package/es/components/Datagrid/useStickyColumn.js +3 -0
- package/es/components/Datagrid/utils/makeData.js +1 -1
- package/es/components/WebTerminal/WebTerminal.js +1 -1
- package/es/components/WebTerminal/WebTerminalContentWrapper.js +1 -1
- package/es/components/WebTerminal/hooks/index.js +6 -0
- package/es/components/WebTerminal/index.js +6 -0
- package/es/components/WebTerminal/preview-components/Navigation.js +6 -0
- package/es/components/WebTerminal/preview-components/documentationLinks.js +6 -0
- package/es/components/WebTerminal/preview-components/index.js +7 -0
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +148 -9
- package/lib/components/Datagrid/useActionsColumn.js +31 -6
- package/lib/components/Datagrid/useDefaultStringRenderer.js +5 -1
- package/lib/components/Datagrid/useSelectRows.js +1 -1
- package/lib/components/Datagrid/useStickyColumn.js +3 -0
- package/lib/components/Datagrid/utils/makeData.js +1 -1
- package/lib/components/WebTerminal/hooks/index.js +6 -0
- package/lib/components/WebTerminal/preview-components/Navigation.js +6 -0
- package/lib/components/WebTerminal/preview-components/documentationLinks.js +6 -0
- package/package.json +4 -4
- package/scss/components/AddSelect/_add-select.scss +19 -2
- package/scss/components/Datagrid/_datagrid.scss +5 -0
- package/scss/components/Datagrid/styles/{datagrid.scss → _datagrid.scss} +54 -12
- package/scss/components/Datagrid/styles/{draggableElement.scss → _draggableElement.scss} +0 -0
- package/scss/components/Datagrid/styles/{index.scss → _index.scss} +0 -0
- package/scss/components/Datagrid/styles/{useActionsColumn.scss → _useActionsColumn.scss} +0 -0
- package/scss/components/Datagrid/styles/{useColumnCenterAlign.scss → _useColumnCenterAlign.scss} +0 -0
- package/scss/components/Datagrid/styles/{useColumnRightAlign.scss → _useColumnRightAlign.scss} +0 -0
- package/scss/components/Datagrid/styles/{useExpandedRow.scss → _useExpandedRow.scss} +0 -0
- package/scss/components/Datagrid/styles/{useNestedRows.scss → _useNestedRows.scss} +0 -0
- package/scss/components/Datagrid/styles/{useNestedTable.scss → _useNestedTable.scss} +0 -0
- package/scss/components/Datagrid/styles/{useSelectAllToggle.scss → _useSelectAllToggle.scss} +0 -0
- package/scss/components/Datagrid/styles/{useSortableColumns.scss → _useSortableColumns.scss} +0 -0
- package/scss/components/Datagrid/styles/{useStickyColumn.scss → _useStickyColumn.scss} +0 -0
- package/scss/components/Datagrid/styles/addons/{CustomizeColumnsModal.scss → _CustomizeColumnsModal.scss} +0 -0
- package/scss/components/Datagrid/styles/addons/{RowSizeDropdown.scss → _RowSizeDropdown.scss} +0 -0
- package/scss/components/InlineEdit/_inline-edit.scss +1 -1
- package/scss/components/WebTerminal/_index.scss +7 -0
- package/scss/components/WebTerminal/_storybook-styles.scss +7 -0
- package/scss/components/WebTerminal/_web-terminal.scss +13 -0
- package/css/components/Datagrid/styles/addons/CustomizeColumnsModal.css +0 -47
- package/css/components/Datagrid/styles/addons/CustomizeColumnsModal.css.map +0 -1
- package/css/components/Datagrid/styles/addons/RowSizeDropdown.css +0 -20
- package/css/components/Datagrid/styles/addons/RowSizeDropdown.css.map +0 -1
- package/css/components/Datagrid/styles/datagrid.css +0 -383
- package/css/components/Datagrid/styles/datagrid.css.map +0 -1
- package/css/components/Datagrid/styles/draggableElement.css +0 -57
- package/css/components/Datagrid/styles/draggableElement.css.map +0 -1
- package/css/components/Datagrid/styles/index.css +0 -732
- package/css/components/Datagrid/styles/index.css.map +0 -1
- package/css/components/Datagrid/styles/useActionsColumn.css +0 -23
- package/css/components/Datagrid/styles/useActionsColumn.css.map +0 -1
- package/css/components/Datagrid/styles/useColumnCenterAlign.css +0 -18
- package/css/components/Datagrid/styles/useColumnCenterAlign.css.map +0 -1
- package/css/components/Datagrid/styles/useColumnRightAlign.css +0 -28
- package/css/components/Datagrid/styles/useColumnRightAlign.css.map +0 -1
- package/css/components/Datagrid/styles/useExpandedRow.css +0 -9
- package/css/components/Datagrid/styles/useExpandedRow.css.map +0 -1
- package/css/components/Datagrid/styles/useNestedRows.css +0 -15
- package/css/components/Datagrid/styles/useNestedRows.css.map +0 -1
- package/css/components/Datagrid/styles/useNestedTable.css +0 -25
- package/css/components/Datagrid/styles/useNestedTable.css.map +0 -1
- package/css/components/Datagrid/styles/useSelectAllToggle.css +0 -28
- package/css/components/Datagrid/styles/useSelectAllToggle.css.map +0 -1
- package/css/components/Datagrid/styles/useSortableColumns.css +0 -50
- package/css/components/Datagrid/styles/useSortableColumns.css.map +0 -1
- package/css/components/Datagrid/styles/useStickyColumn.css +0 -35
- package/css/components/Datagrid/styles/useStickyColumn.css.map +0 -1
@@ -32,19 +32,44 @@ var useActionsColumn = function useActionsColumn(hooks) {
|
|
32
32
|
|
33
33
|
return [props, {
|
34
34
|
children: /*#__PURE__*/React.createElement("div", {
|
35
|
-
className: "".concat(blockClass, "__actions-column-
|
35
|
+
className: "".concat(blockClass, "__actions-column-contents")
|
36
36
|
}, isFetching && /*#__PURE__*/React.createElement(IconSkeleton, {
|
37
37
|
className: "".concat(blockClass, "__actions-column-loading")
|
38
|
-
}), !isFetching && /*#__PURE__*/React.createElement(
|
38
|
+
}), !isFetching && rowActions.length <= 2 && /*#__PURE__*/React.createElement("div", {
|
39
|
+
className: "".concat(blockClass, "_actions-column"),
|
40
|
+
style: {
|
41
|
+
display: 'flex'
|
42
|
+
}
|
43
|
+
}, rowActions.map(function (action) {
|
44
|
+
var id = action.id,
|
45
|
+
itemText = action.itemText,
|
46
|
+
_onClick = action.onClick,
|
47
|
+
icon = action.icon;
|
48
|
+
return /*#__PURE__*/React.createElement("div", {
|
49
|
+
className: "".concat(blockClass, "__actions-column-button"),
|
50
|
+
key: ""
|
51
|
+
}, /*#__PURE__*/React.createElement(OverflowMenu, {
|
52
|
+
renderIcon: icon,
|
53
|
+
hasIconOnly: true,
|
54
|
+
light: true,
|
55
|
+
iconDescription: itemText,
|
56
|
+
kind: "ghost",
|
57
|
+
onClick: function onClick(e) {
|
58
|
+
e.stopPropagation();
|
59
|
+
|
60
|
+
_onClick(id, row, e);
|
61
|
+
}
|
62
|
+
}));
|
63
|
+
})), !isFetching && rowActions.length > 2 && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(OverflowMenu, {
|
39
64
|
size: "sm",
|
40
65
|
light: true,
|
41
66
|
flipped: true,
|
42
67
|
onClick: function onClick(e) {
|
43
|
-
|
68
|
+
e.stopPropagation();
|
44
69
|
}
|
45
70
|
}, rowActions.map(function (action) {
|
46
71
|
var id = action.id,
|
47
|
-
|
72
|
+
_onClick2 = action.onClick,
|
48
73
|
shouldHideMenuItem = action.shouldHideMenuItem,
|
49
74
|
shouldDisableMenuItem = action.shouldDisableMenuItem,
|
50
75
|
disabled = action.disabled,
|
@@ -64,11 +89,11 @@ var useActionsColumn = function useActionsColumn(hooks) {
|
|
64
89
|
onClick: function onClick(e) {
|
65
90
|
e.stopPropagation();
|
66
91
|
|
67
|
-
|
92
|
+
_onClick2(id, row, e);
|
68
93
|
},
|
69
94
|
key: id
|
70
95
|
}));
|
71
|
-
}))),
|
96
|
+
})))),
|
72
97
|
className: cx((_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__actions-column-cell"), true), _defineProperty(_cx, "".concat(blockClass, "__cell"), true), _cx))
|
73
98
|
}];
|
74
99
|
}
|
@@ -13,13 +13,16 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
13
13
|
* restricted by GSA ADP Schedule Contract with IBM Corp.
|
14
14
|
*/
|
15
15
|
import React from 'react';
|
16
|
+
import cx from 'classnames';
|
16
17
|
import { pkg } from '../../settings';
|
17
18
|
var blockClass = "".concat(pkg.prefix, "--datagrid");
|
18
19
|
|
19
20
|
var useDefaultStringRenderer = function useDefaultStringRenderer(hooks) {
|
20
21
|
var StringRenderer = function StringRenderer(tableProps) {
|
22
|
+
var _tableProps$column;
|
23
|
+
|
21
24
|
return /*#__PURE__*/React.createElement("div", {
|
22
|
-
className: "".concat(blockClass, "__defaultStringRenderer"),
|
25
|
+
className: cx("".concat(blockClass, "__defaultStringRenderer"), _defineProperty({}, "".concat(blockClass, "__defaultStringRenderer--multiline"), (_tableProps$column = tableProps.column) === null || _tableProps$column === void 0 ? void 0 : _tableProps$column.multiLineWrap)),
|
23
26
|
title: tableProps.value
|
24
27
|
}, tableProps.value);
|
25
28
|
};
|
@@ -21,7 +21,7 @@ import cx from 'classnames';
|
|
21
21
|
import { TableSelectRow } from 'carbon-components-react';
|
22
22
|
import { SelectAll } from './Datagrid/DatagridSelectAll';
|
23
23
|
import { selectionColumnId } from './common-column-ids';
|
24
|
-
import { pkg } from '../../settings';
|
24
|
+
import { pkg, carbon } from '../../settings';
|
25
25
|
var blockClass = "".concat(pkg.prefix, "--datagrid");
|
26
26
|
|
27
27
|
var useSelectRows = function useSelectRows(hooks) {
|
@@ -57,7 +57,7 @@ var useHighlightSelection = function useHighlightSelection(hooks) {
|
|
57
57
|
var getRowProps = function getRowProps(props, _ref) {
|
58
58
|
var row = _ref.row;
|
59
59
|
return [props, {
|
60
|
-
className: cx("".concat(blockClass, "__carbon-row"), row.getToggleRowSelectedProps().checked ?
|
60
|
+
className: cx("".concat(blockClass, "__carbon-row"), row.getToggleRowSelectedProps().checked ? "".concat(carbon.prefix, "--data-table--selected ").concat(blockClass, "__active-row") : '')
|
61
61
|
}];
|
62
62
|
};
|
63
63
|
|
@@ -117,6 +117,9 @@ var useStickyColumn = function useStickyColumn(hooks) {
|
|
117
117
|
if (spacerIdx >= 0 && stickyIdx >= 0 && stickyIdx < spacerIdx) {
|
118
118
|
var _temp = newHeaders[spacerIdx];
|
119
119
|
newHeaders[spacerIdx] = newHeaders[stickyIdx];
|
120
|
+
newHeaders[spacerIdx].canResize = false;
|
121
|
+
newHeaders[spacerIdx].disableResizing = true;
|
122
|
+
delete newHeaders[spacerIdx].getResizerProps;
|
120
123
|
newHeaders[stickyIdx] = _temp;
|
121
124
|
}
|
122
125
|
});
|
@@ -9,7 +9,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
9
9
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
10
10
|
|
11
11
|
/**
|
12
|
-
* Copyright IBM Corp. 2020,
|
12
|
+
* Copyright IBM Corp. 2020, 2022
|
13
13
|
*
|
14
14
|
* This source code is licensed under the Apache-2.0 license found in the
|
15
15
|
* LICENSE file in the root directory of this source tree.
|
@@ -4,7 +4,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
4
4
|
var _excluded = ["children"];
|
5
5
|
|
6
6
|
/**
|
7
|
-
* Copyright IBM Corp.
|
7
|
+
* Copyright IBM Corp. 2022, 2022
|
8
8
|
*
|
9
9
|
* This source code is licensed under the Apache-2.0 license found in the
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
@@ -1,4 +1,10 @@
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
2
|
+
//
|
3
|
+
// Copyright IBM Corp. 2022, 2022
|
4
|
+
//
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
7
|
+
//
|
2
8
|
import React, { useState, useCallback, createContext } from 'react';
|
3
9
|
import { useContext } from 'react';
|
4
10
|
import PropTypes from 'prop-types';
|
@@ -1,3 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2022
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
1
7
|
export { WebTerminal } from './WebTerminal';
|
2
8
|
export { WebTerminalContentWrapper } from './WebTerminalContentWrapper';
|
3
9
|
export { useWebTerminal, WebTerminalProvider } from './hooks';
|
@@ -1,3 +1,9 @@
|
|
1
|
+
//
|
2
|
+
// Copyright IBM Corp. 2020, 2022
|
3
|
+
//
|
4
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
// LICENSE file in the root directory of this source tree.
|
6
|
+
//
|
1
7
|
import React from 'react';
|
2
8
|
import { Header, HeaderName, HeaderGlobalAction, HeaderGlobalBar } from 'carbon-components-react';
|
3
9
|
import { Terminal20 as Terminal, Search20 as Search, User20 as User } from '@carbon/icons-react';
|
@@ -1,3 +1,10 @@
|
|
1
|
+
//
|
2
|
+
// Copyright IBM Corp. 2020, 2021
|
3
|
+
//
|
4
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
// LICENSE file in the root directory of this source tree.
|
6
|
+
//
|
7
|
+
|
1
8
|
/**
|
2
9
|
* Preview components are components only to be used
|
3
10
|
* in the context of storybook.
|
@@ -2,31 +2,170 @@
|
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
4
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
6
|
+
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
6
8
|
value: true
|
7
9
|
});
|
8
10
|
exports.default = void 0;
|
9
11
|
|
10
|
-
var
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
13
|
+
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
15
|
+
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
17
|
+
|
18
|
+
var _iconsReact = require("@carbon/icons-react");
|
11
19
|
|
12
20
|
var _carbonComponentsReact = require("carbon-components-react");
|
13
21
|
|
22
|
+
var _reactResizeDetector = require("react-resize-detector");
|
23
|
+
|
24
|
+
var _ButtonMenu = require("../../ButtonMenu");
|
25
|
+
|
14
26
|
var _settings = require("../../../settings");
|
15
27
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
28
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
29
|
+
|
30
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
31
|
+
|
32
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
33
|
+
|
34
|
+
/**
|
35
|
+
* Copyright IBM Corp. 2022, 2022
|
36
|
+
*
|
37
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
38
|
+
* LICENSE file in the root directory of this source tree.
|
22
39
|
*/
|
23
40
|
var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
|
24
41
|
var TableToolbar = _carbonComponentsReact.DataTable.TableToolbar;
|
25
42
|
|
43
|
+
var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridState, width, ref) {
|
44
|
+
var _useState = (0, _react.useState)(false),
|
45
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
46
|
+
displayAllInMenu = _useState2[0],
|
47
|
+
setDisplayAllInMenu = _useState2[1];
|
48
|
+
|
49
|
+
var _useState3 = (0, _react.useState)(null),
|
50
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
51
|
+
initialListWidth = _useState4[0],
|
52
|
+
setInitialListWidth = _useState4[1];
|
53
|
+
|
54
|
+
var _useState5 = (0, _react.useState)(false),
|
55
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
56
|
+
receivedInitialWidth = _useState6[0],
|
57
|
+
setReceivedInitialWidth = _useState6[1];
|
58
|
+
|
59
|
+
var selectedFlatRows = datagridState.selectedFlatRows,
|
60
|
+
toggleAllRowsSelected = datagridState.toggleAllRowsSelected,
|
61
|
+
toolbarBatchActions = datagridState.toolbarBatchActions;
|
62
|
+
var totalSelected = selectedFlatRows && selectedFlatRows.length; // Get initial width of batch actions container,
|
63
|
+
// used to measure when all items are put inside
|
64
|
+
// the ButtonMenu
|
65
|
+
|
66
|
+
(0, _react.useEffect)(function () {
|
67
|
+
if (totalSelected === 1 && !receivedInitialWidth) {
|
68
|
+
var batchActionListWidth = ref.current.querySelector(".".concat(_settings.carbon.prefix, "--action-list")).offsetWidth;
|
69
|
+
setInitialListWidth(batchActionListWidth);
|
70
|
+
setReceivedInitialWidth(true);
|
71
|
+
}
|
72
|
+
}, [totalSelected, receivedInitialWidth, ref]);
|
73
|
+
(0, _react.useEffect)(function () {
|
74
|
+
var summaryWidth = ref.current.querySelector(".".concat(_settings.carbon.prefix, "--batch-summary")).offsetWidth;
|
75
|
+
|
76
|
+
if (width < summaryWidth + initialListWidth + 32) {
|
77
|
+
setDisplayAllInMenu(true);
|
78
|
+
} else {
|
79
|
+
setDisplayAllInMenu(false);
|
80
|
+
}
|
81
|
+
}, [width, ref, initialListWidth]); // Render batch actions in ButtonMenu
|
82
|
+
|
83
|
+
var renderBatchActionOverflow = function renderBatchActionOverflow() {
|
84
|
+
var minWidthBeforeOverflowIcon = 380; // Do not render ButtonMenu when there are 3 or less items
|
85
|
+
// and if there is enough available space to render all the items
|
86
|
+
|
87
|
+
if ((toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.length) <= 3 && !displayAllInMenu) {
|
88
|
+
return null;
|
89
|
+
}
|
90
|
+
|
91
|
+
return /*#__PURE__*/_react.default.createElement(_ButtonMenu.ButtonMenu, {
|
92
|
+
label: width > minWidthBeforeOverflowIcon ? 'More' : null,
|
93
|
+
renderIcon: width > minWidthBeforeOverflowIcon ? _iconsReact.Add16 : _iconsReact.OverflowMenuVertical16,
|
94
|
+
className: (0, _classnames.default)("".concat(blockClass, "__button-menu"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__button-menu--icon-only"), width <= minWidthBeforeOverflowIcon)),
|
95
|
+
menuOptionsClass: "".concat(blockClass, "__button-menu-options"),
|
96
|
+
flipped: true
|
97
|
+
}, toolbarBatchActions && toolbarBatchActions.map(function (batchAction, index) {
|
98
|
+
if (index < 2) {
|
99
|
+
if (displayAllInMenu) {
|
100
|
+
return /*#__PURE__*/_react.default.createElement(_ButtonMenu.ButtonMenuItem, {
|
101
|
+
key: "".concat(batchAction.label, "-").concat(index),
|
102
|
+
itemText: batchAction.label,
|
103
|
+
onClick: function onClick() {
|
104
|
+
batchAction.onClick();
|
105
|
+
|
106
|
+
if (batchAction.type === 'select_all') {
|
107
|
+
toggleAllRowsSelected(true);
|
108
|
+
}
|
109
|
+
}
|
110
|
+
});
|
111
|
+
}
|
112
|
+
|
113
|
+
return null;
|
114
|
+
}
|
115
|
+
|
116
|
+
return /*#__PURE__*/_react.default.createElement(_ButtonMenu.ButtonMenuItem, {
|
117
|
+
key: "".concat(batchAction.label, "-").concat(index),
|
118
|
+
itemText: batchAction.label,
|
119
|
+
onClick: function onClick() {
|
120
|
+
batchAction.onClick();
|
121
|
+
|
122
|
+
if (batchAction.type === 'select_all') {
|
123
|
+
toggleAllRowsSelected(true);
|
124
|
+
}
|
125
|
+
}
|
126
|
+
});
|
127
|
+
}));
|
128
|
+
}; // Only display the first two batch actions, the rest are
|
129
|
+
// displayed inside of the ButtonMenu if there are more than
|
130
|
+
// 3 batch actions
|
131
|
+
|
132
|
+
|
133
|
+
return /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.TableBatchActions, {
|
134
|
+
shouldShowBatchActions: totalSelected > 0,
|
135
|
+
totalSelected: totalSelected,
|
136
|
+
onCancel: function onCancel() {
|
137
|
+
return toggleAllRowsSelected(false);
|
138
|
+
}
|
139
|
+
}, !displayAllInMenu && toolbarBatchActions && (toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.map(function (batchAction, index) {
|
140
|
+
if (index < 2 && toolbarBatchActions.length > 3 || index < 3 && toolbarBatchActions.length === 3) {
|
141
|
+
return /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.TableBatchAction, {
|
142
|
+
key: "".concat(batchAction.label, "-").concat(index),
|
143
|
+
renderIcon: batchAction.renderIcon,
|
144
|
+
onClick: function onClick() {
|
145
|
+
batchAction.onClick();
|
146
|
+
|
147
|
+
if (batchAction.type === 'select_all') {
|
148
|
+
toggleAllRowsSelected(true);
|
149
|
+
}
|
150
|
+
},
|
151
|
+
iconDescription: batchAction.label
|
152
|
+
}, batchAction.label);
|
153
|
+
}
|
154
|
+
})), renderBatchActionOverflow());
|
155
|
+
};
|
156
|
+
|
26
157
|
var DatagridToolbar = function DatagridToolbar(datagridState) {
|
158
|
+
var _useResizeDetector = (0, _reactResizeDetector.useResizeDetector)(),
|
159
|
+
width = _useResizeDetector.width,
|
160
|
+
ref = _useResizeDetector.ref;
|
161
|
+
|
27
162
|
var DatagridActions = datagridState.DatagridActions,
|
28
|
-
DatagridBatchActions = datagridState.DatagridBatchActions
|
29
|
-
|
163
|
+
DatagridBatchActions = datagridState.DatagridBatchActions,
|
164
|
+
batchActions = datagridState.batchActions;
|
165
|
+
return batchActions && DatagridActions ? /*#__PURE__*/_react.default.createElement("div", {
|
166
|
+
ref: ref,
|
167
|
+
className: "".concat(blockClass, "__table-toolbar")
|
168
|
+
}, /*#__PURE__*/_react.default.createElement(TableToolbar, null, DatagridActions && DatagridActions(datagridState), DatagridBatchActionsToolbar && DatagridBatchActionsToolbar(datagridState, width, ref))) : DatagridActions ? /*#__PURE__*/_react.default.createElement("div", {
|
30
169
|
className: "".concat(blockClass, "__table-toolbar")
|
31
170
|
}, /*#__PURE__*/_react.default.createElement(TableToolbar, null, DatagridActions && DatagridActions(datagridState), DatagridBatchActions && DatagridBatchActions(datagridState))) : null;
|
32
171
|
};
|
@@ -40,19 +40,44 @@ var useActionsColumn = function useActionsColumn(hooks) {
|
|
40
40
|
|
41
41
|
return [props, {
|
42
42
|
children: /*#__PURE__*/_react.default.createElement("div", {
|
43
|
-
className: "".concat(blockClass, "__actions-column-
|
43
|
+
className: "".concat(blockClass, "__actions-column-contents")
|
44
44
|
}, isFetching && /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.IconSkeleton, {
|
45
45
|
className: "".concat(blockClass, "__actions-column-loading")
|
46
|
-
}), !isFetching && /*#__PURE__*/_react.default.createElement(
|
46
|
+
}), !isFetching && rowActions.length <= 2 && /*#__PURE__*/_react.default.createElement("div", {
|
47
|
+
className: "".concat(blockClass, "_actions-column"),
|
48
|
+
style: {
|
49
|
+
display: 'flex'
|
50
|
+
}
|
51
|
+
}, rowActions.map(function (action) {
|
52
|
+
var id = action.id,
|
53
|
+
itemText = action.itemText,
|
54
|
+
_onClick = action.onClick,
|
55
|
+
icon = action.icon;
|
56
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
57
|
+
className: "".concat(blockClass, "__actions-column-button"),
|
58
|
+
key: ""
|
59
|
+
}, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.OverflowMenu, {
|
60
|
+
renderIcon: icon,
|
61
|
+
hasIconOnly: true,
|
62
|
+
light: true,
|
63
|
+
iconDescription: itemText,
|
64
|
+
kind: "ghost",
|
65
|
+
onClick: function onClick(e) {
|
66
|
+
e.stopPropagation();
|
67
|
+
|
68
|
+
_onClick(id, row, e);
|
69
|
+
}
|
70
|
+
}));
|
71
|
+
})), !isFetching && rowActions.length > 2 && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.OverflowMenu, {
|
47
72
|
size: "sm",
|
48
73
|
light: true,
|
49
74
|
flipped: true,
|
50
75
|
onClick: function onClick(e) {
|
51
|
-
|
76
|
+
e.stopPropagation();
|
52
77
|
}
|
53
78
|
}, rowActions.map(function (action) {
|
54
79
|
var id = action.id,
|
55
|
-
|
80
|
+
_onClick2 = action.onClick,
|
56
81
|
shouldHideMenuItem = action.shouldHideMenuItem,
|
57
82
|
shouldDisableMenuItem = action.shouldDisableMenuItem,
|
58
83
|
disabled = action.disabled,
|
@@ -71,11 +96,11 @@ var useActionsColumn = function useActionsColumn(hooks) {
|
|
71
96
|
onClick: function onClick(e) {
|
72
97
|
e.stopPropagation();
|
73
98
|
|
74
|
-
|
99
|
+
_onClick2(id, row, e);
|
75
100
|
},
|
76
101
|
key: id
|
77
102
|
}));
|
78
|
-
}))),
|
103
|
+
})))),
|
79
104
|
className: (0, _classnames.default)((_cx = {}, (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__actions-column-cell"), true), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__cell"), true), _cx))
|
80
105
|
}];
|
81
106
|
}
|
@@ -13,6 +13,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
13
13
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
15
15
|
|
16
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
17
|
+
|
16
18
|
var _settings = require("../../settings");
|
17
19
|
|
18
20
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
@@ -23,8 +25,10 @@ var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
|
|
23
25
|
|
24
26
|
var useDefaultStringRenderer = function useDefaultStringRenderer(hooks) {
|
25
27
|
var StringRenderer = function StringRenderer(tableProps) {
|
28
|
+
var _tableProps$column;
|
29
|
+
|
26
30
|
return /*#__PURE__*/_react.default.createElement("div", {
|
27
|
-
className: "".concat(blockClass, "__defaultStringRenderer"),
|
31
|
+
className: (0, _classnames.default)("".concat(blockClass, "__defaultStringRenderer"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__defaultStringRenderer--multiline"), (_tableProps$column = tableProps.column) === null || _tableProps$column === void 0 ? void 0 : _tableProps$column.multiLineWrap)),
|
28
32
|
title: tableProps.value
|
29
33
|
}, tableProps.value);
|
30
34
|
};
|
@@ -68,7 +68,7 @@ var useHighlightSelection = function useHighlightSelection(hooks) {
|
|
68
68
|
var getRowProps = function getRowProps(props, _ref) {
|
69
69
|
var row = _ref.row;
|
70
70
|
return [props, {
|
71
|
-
className: (0, _classnames.default)("".concat(blockClass, "__carbon-row"), row.getToggleRowSelectedProps().checked ?
|
71
|
+
className: (0, _classnames.default)("".concat(blockClass, "__carbon-row"), row.getToggleRowSelectedProps().checked ? "".concat(_settings.carbon.prefix, "--data-table--selected ").concat(blockClass, "__active-row") : '')
|
72
72
|
}];
|
73
73
|
};
|
74
74
|
|
@@ -123,6 +123,9 @@ var useStickyColumn = function useStickyColumn(hooks) {
|
|
123
123
|
if (spacerIdx >= 0 && stickyIdx >= 0 && stickyIdx < spacerIdx) {
|
124
124
|
var _temp = newHeaders[spacerIdx];
|
125
125
|
newHeaders[spacerIdx] = newHeaders[stickyIdx];
|
126
|
+
newHeaders[spacerIdx].canResize = false;
|
127
|
+
newHeaders[spacerIdx].disableResizing = true;
|
128
|
+
delete newHeaders[spacerIdx].getResizerProps;
|
126
129
|
newHeaders[stickyIdx] = _temp;
|
127
130
|
}
|
128
131
|
});
|
@@ -21,6 +21,12 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
21
21
|
|
22
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
23
23
|
|
24
|
+
//
|
25
|
+
// Copyright IBM Corp. 2022, 2022
|
26
|
+
//
|
27
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
28
|
+
// LICENSE file in the root directory of this source tree.
|
29
|
+
//
|
24
30
|
var WebTerminalContext = /*#__PURE__*/(0, _react.createContext)();
|
25
31
|
exports.WebTerminalContext = WebTerminalContext;
|
26
32
|
var componentName = 'WebTerminalProvider';
|
@@ -15,6 +15,12 @@ var _iconsReact = require("@carbon/icons-react");
|
|
15
15
|
|
16
16
|
var _hooks = require("../hooks");
|
17
17
|
|
18
|
+
//
|
19
|
+
// Copyright IBM Corp. 2020, 2022
|
20
|
+
//
|
21
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
22
|
+
// LICENSE file in the root directory of this source tree.
|
23
|
+
//
|
18
24
|
var Navigation = function Navigation() {
|
19
25
|
var _useWebTerminal = (0, _hooks.useWebTerminal)(),
|
20
26
|
openWebTerminal = _useWebTerminal.openWebTerminal;
|
@@ -4,6 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.documentationLinks = void 0;
|
7
|
+
//
|
8
|
+
// Copyright IBM Corp. 2020, 2021
|
9
|
+
//
|
10
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
11
|
+
// LICENSE file in the root directory of this source tree.
|
12
|
+
//
|
7
13
|
var documentationLinks = [{
|
8
14
|
itemText: 'BX/ICP docs',
|
9
15
|
href: '#',
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@carbon/ibm-products",
|
3
3
|
"description": "Carbon for IBM Products",
|
4
|
-
"version": "1.
|
4
|
+
"version": "1.27.0",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -60,13 +60,13 @@
|
|
60
60
|
"fs-extra": "^10.1.0",
|
61
61
|
"glob": "^8.0.3",
|
62
62
|
"jest": "^28.1.3",
|
63
|
-
"jest-config-ibm-cloud-cognitive": "^0.24.
|
63
|
+
"jest-config-ibm-cloud-cognitive": "^0.24.4",
|
64
64
|
"jest-environment-jsdom": "^28.1.3",
|
65
65
|
"namor": "^1.1.2",
|
66
66
|
"npm-check-updates": "^16.0.5",
|
67
67
|
"npm-run-all": "^4.1.5",
|
68
68
|
"rimraf": "^3.0.2",
|
69
|
-
"sass": "^1.54.
|
69
|
+
"sass": "^1.54.4",
|
70
70
|
"yargs": "^17.5.1"
|
71
71
|
},
|
72
72
|
"dependencies": {
|
@@ -93,5 +93,5 @@
|
|
93
93
|
"react": "^16.8.6 || ^17.0.1",
|
94
94
|
"react-dom": "^16.8.6 || ^17.0.1"
|
95
95
|
},
|
96
|
-
"gitHead": "
|
96
|
+
"gitHead": "83988f0190d38209fe2fe64539e9aab021a46f8d"
|
97
97
|
}
|
@@ -100,6 +100,22 @@
|
|
100
100
|
}
|
101
101
|
}
|
102
102
|
|
103
|
+
.#{$block-class} .#{$block-class}__selections-row:hover {
|
104
|
+
.#{$block-class}__selections-radio {
|
105
|
+
color: $interactive-04;
|
106
|
+
}
|
107
|
+
|
108
|
+
.#{$block-class}__selections-view-children svg {
|
109
|
+
color: $interactive-04;
|
110
|
+
}
|
111
|
+
|
112
|
+
button.#{$block-class}__selections-view-children.#{$carbon-prefix}--btn--ghost.#{$carbon-prefix}--btn--icon-only
|
113
|
+
.#{$carbon-prefix}--btn__icon
|
114
|
+
path {
|
115
|
+
fill: currentColor;
|
116
|
+
}
|
117
|
+
}
|
118
|
+
|
103
119
|
.#{$block-class}__sub-header {
|
104
120
|
display: flex;
|
105
121
|
align-items: flex-end;
|
@@ -325,8 +341,9 @@
|
|
325
341
|
}
|
326
342
|
|
327
343
|
.#{$block-class} .#{$carbon-prefix}--structured-list-td {
|
328
|
-
height:
|
329
|
-
padding:
|
344
|
+
height: $layout-04;
|
345
|
+
padding-top: 0;
|
346
|
+
padding-bottom: 0;
|
330
347
|
vertical-align: middle;
|
331
348
|
}
|
332
349
|
|