@carbon/ibm-products 1.46.2 → 1.48.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/css/index-full-carbon.css +1399 -29
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +5 -5
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +5 -12
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +2 -2
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +1395 -25
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +4 -4
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +1399 -29
- package/css/index.css.map +1 -1
- package/css/index.min.css +5 -5
- package/css/index.min.css.map +1 -1
- package/es/components/AddSelect/AddSelectBreadcrumbs.js +6 -4
- package/es/components/AddSelect/AddSelectList.js +15 -26
- package/es/components/CreateFullPage/CreateFullPage.js +3 -2
- package/es/components/Datagrid/Datagrid/DatagridContent.js +1 -1
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +14 -5
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +7 -1
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +1 -5
- package/es/components/Datagrid/useSortableColumns.js +20 -4
- package/es/components/Datagrid/utils/getArgTypes.js +5 -0
- package/es/components/NonLinearReading/NonLinearReading.js +87 -0
- package/es/components/NonLinearReading/index.js +8 -0
- package/es/components/SidePanel/SidePanel.js +16 -8
- package/es/components/index.js +2 -1
- package/es/global/js/package-settings.js +3 -1
- package/lib/components/AddSelect/AddSelectBreadcrumbs.js +6 -4
- package/lib/components/AddSelect/AddSelectList.js +14 -25
- package/lib/components/CreateFullPage/CreateFullPage.js +2 -1
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +1 -1
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +13 -4
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +7 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +0 -4
- package/lib/components/Datagrid/useSortableColumns.js +20 -4
- package/lib/components/Datagrid/utils/getArgTypes.js +5 -0
- package/lib/components/NonLinearReading/NonLinearReading.js +90 -0
- package/lib/components/NonLinearReading/index.js +12 -0
- package/lib/components/SidePanel/SidePanel.js +15 -7
- package/lib/components/index.js +8 -1
- package/lib/global/js/package-settings.js +3 -1
- package/package.json +5 -5
- package/scss/components/AddSelect/_add-select.scss +0 -10
- package/scss/components/Datagrid/_storybook-styles.scss +26 -0
- package/scss/components/Datagrid/styles/_datagrid.scss +4 -0
- package/scss/components/Datagrid/styles/_useInlineEdit.scss +4 -0
- package/scss/components/Datagrid/styles/_useSortableColumns.scss +8 -4
- package/scss/components/EmptyStates/_empty-state.scss +4 -3
- package/scss/components/NonLinearReading/_index.scss +8 -0
- package/scss/components/NonLinearReading/_non-linear-reading.scss +157 -0
- package/scss/components/NonLinearReading/_storybook-styles.scss +13 -0
- package/scss/components/SidePanel/_side-panel.scss +5 -14
- package/scss/components/Tearsheet/_tearsheet.scss +4 -0
- package/scss/components/_index.scss +1 -0
@@ -8,7 +8,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
8
8
|
//
|
9
9
|
|
10
10
|
import React from 'react';
|
11
|
-
import { Button, Checkbox, Dropdown, RadioButton
|
11
|
+
import { Button, Checkbox, Dropdown, RadioButton } from 'carbon-components-react';
|
12
12
|
import { ChevronRight16, View16 } from '@carbon/icons-react';
|
13
13
|
import PropTypes from 'prop-types';
|
14
14
|
import cx from 'classnames';
|
@@ -99,33 +99,22 @@ export var AddSelectList = function AddSelectList(_ref) {
|
|
99
99
|
};
|
100
100
|
return /*#__PURE__*/React.createElement("div", {
|
101
101
|
className: cx("".concat(blockClass, "-wrapper"), _defineProperty({}, "".concat(blockClass, "-wrapper-multi"), multi))
|
102
|
-
}, /*#__PURE__*/React.createElement(
|
103
|
-
selection: true,
|
102
|
+
}, /*#__PURE__*/React.createElement("div", {
|
104
103
|
className: "".concat(blockClass)
|
105
|
-
}, /*#__PURE__*/React.createElement(
|
104
|
+
}, /*#__PURE__*/React.createElement("div", {
|
105
|
+
className: "".concat(blockClass, "-body")
|
106
|
+
}, filteredItems.map(function (item) {
|
106
107
|
var _cx2;
|
107
|
-
return /*#__PURE__*/React.createElement(
|
108
|
+
return /*#__PURE__*/React.createElement("div", {
|
108
109
|
key: item.id,
|
109
|
-
className: cx("".concat(blockClass, "-row"), (_cx2 = {}, _defineProperty(_cx2, "".concat(blockClass, "-row--selected"), isSelected(item.id)), _defineProperty(_cx2, "".concat(blockClass, "-row-meta--selected"), isInMetaPanel(item.id)), _cx2))
|
110
|
-
onClick: function onClick(evt) {
|
111
|
-
return metaPanelHandler(item, evt);
|
112
|
-
},
|
113
|
-
label: true
|
110
|
+
className: cx("".concat(blockClass, "-row"), (_cx2 = {}, _defineProperty(_cx2, "".concat(blockClass, "-row--selected"), isSelected(item.id)), _defineProperty(_cx2, "".concat(blockClass, "-row-meta--selected"), isInMetaPanel(item.id)), _cx2))
|
114
111
|
}, /*#__PURE__*/React.createElement("div", {
|
115
112
|
className: "".concat(blockClass, "-cell")
|
116
113
|
}, /*#__PURE__*/React.createElement("div", {
|
117
114
|
className: "".concat(blockClass, "-cell-wrapper")
|
118
115
|
}, multi ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
119
116
|
className: "".concat(blockClass, "-checkbox")
|
120
|
-
},
|
121
|
-
/*#__PURE__*/
|
122
|
-
// hacky way to prevent checkbox from triggering the meta onclick handler
|
123
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
124
|
-
React.createElement("div", {
|
125
|
-
onClick: function onClick(event) {
|
126
|
-
return event.stopPropagation();
|
127
|
-
}
|
128
|
-
}, /*#__PURE__*/React.createElement(Checkbox, {
|
117
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Checkbox, {
|
129
118
|
onChange: function onChange(value, id) {
|
130
119
|
return handleMultiSelection(value, id);
|
131
120
|
},
|
@@ -147,10 +136,9 @@ export var AddSelectList = function AddSelectList(_ref) {
|
|
147
136
|
id: "add-select-modifier-".concat(item.id),
|
148
137
|
type: "inline",
|
149
138
|
items: modifiers.options,
|
150
|
-
light: true,
|
151
139
|
label: modifiers.label,
|
152
140
|
disabled: !isSelected(item.id),
|
153
|
-
className: "".concat(blockClass, "-dropdown
|
141
|
+
className: "".concat(blockClass, "-dropdown"),
|
154
142
|
initialSelectedItem: item[modifiers.id],
|
155
143
|
onChange: function onChange(_ref5) {
|
156
144
|
var selectedItem = _ref5.selectedItem;
|
@@ -178,9 +166,7 @@ export var AddSelectList = function AddSelectList(_ref) {
|
|
178
166
|
},
|
179
167
|
kind: "ghost",
|
180
168
|
size: "sm"
|
181
|
-
}), item.meta && /*#__PURE__*/React.createElement(
|
182
|
-
className: "".concat(blockClass, "-hidden-hover")
|
183
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
169
|
+
}), item.meta && /*#__PURE__*/React.createElement(Button, {
|
184
170
|
className: "".concat(blockClass, "-view-meta"),
|
185
171
|
renderIcon: View16,
|
186
172
|
iconDescription: metaIconDescription,
|
@@ -188,8 +174,11 @@ export var AddSelectList = function AddSelectList(_ref) {
|
|
188
174
|
tooltipAlignment: "center",
|
189
175
|
hasIconOnly: true,
|
190
176
|
kind: "ghost",
|
191
|
-
size: "sm"
|
192
|
-
|
177
|
+
size: "sm",
|
178
|
+
onClick: function onClick() {
|
179
|
+
return metaPanelHandler(item);
|
180
|
+
}
|
181
|
+
}))));
|
193
182
|
}))));
|
194
183
|
};
|
195
184
|
AddSelectList.propTypes = {
|
@@ -3,7 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
4
4
|
var _excluded = ["backButtonText", "cancelButtonText", "children", "className", "modalDangerButtonText", "modalDescription", "modalSecondaryButtonText", "modalTitle", "nextButtonText", "onClose", "onRequestSubmit", "firstFocusElement", "submitButtonText"];
|
5
5
|
/**
|
6
|
-
* Copyright IBM Corp. 2021,
|
6
|
+
* Copyright IBM Corp. 2021, 2023
|
7
7
|
*
|
8
8
|
* This source code is licensed under the Apache-2.0 license found in the
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
@@ -200,7 +200,8 @@ export var CreateFullPage = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
200
200
|
kind: "secondary",
|
201
201
|
onClick: function onClick() {
|
202
202
|
setModalIsOpen(!modalIsOpen);
|
203
|
-
}
|
203
|
+
},
|
204
|
+
"data-modal-primary-focus": true
|
204
205
|
}, modalSecondaryButtonText), /*#__PURE__*/React.createElement(Button, {
|
205
206
|
type: "button",
|
206
207
|
kind: "danger",
|
@@ -90,9 +90,9 @@ export var DatagridContent = function DatagridContent(_ref) {
|
|
90
90
|
return handleGridKeyPress({
|
91
91
|
event: event,
|
92
92
|
dispatch: dispatch,
|
93
|
-
inlineEditState: inlineEditState,
|
94
93
|
instance: datagridState,
|
95
94
|
keysPressedList: keysPressedList,
|
95
|
+
state: inlineEditState,
|
96
96
|
usingMac: usingMac
|
97
97
|
});
|
98
98
|
} : null,
|
@@ -5,16 +5,17 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
5
5
|
/*
|
6
6
|
* Licensed Materials - Property of IBM
|
7
7
|
* 5724-Q36
|
8
|
-
* (c) Copyright IBM Corp. 2020 -
|
8
|
+
* (c) Copyright IBM Corp. 2020 - 2023
|
9
9
|
* US Government Users Restricted Rights - Use, duplication or disclosure
|
10
10
|
* restricted by GSA ADP Schedule Contract with IBM Corp.
|
11
11
|
*/
|
12
12
|
import React, { useEffect } from 'react';
|
13
13
|
import { VariableSizeList } from 'react-window';
|
14
14
|
import { DataTable } from 'carbon-components-react';
|
15
|
+
import { px } from '@carbon/layout';
|
16
|
+
import { useResizeDetector } from 'react-resize-detector';
|
15
17
|
import { pkg } from '../../../settings';
|
16
18
|
import DatagridHead from './DatagridHead';
|
17
|
-
import { px } from '@carbon/layout';
|
18
19
|
var blockClass = "".concat(pkg.prefix, "--datagrid");
|
19
20
|
var TableBody = DataTable.TableBody;
|
20
21
|
var rowSizeMap = {
|
@@ -46,10 +47,18 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
|
|
46
47
|
page = datagridState.page,
|
47
48
|
handleResize = datagridState.handleResize,
|
48
49
|
gridRef = datagridState.gridRef;
|
50
|
+
var handleVirtualGridResize = function handleVirtualGridResize() {
|
51
|
+
var gridRefElement = gridRef === null || gridRef === void 0 ? void 0 : gridRef.current;
|
52
|
+
gridRefElement.style.width = gridRefElement === null || gridRefElement === void 0 ? void 0 : gridRefElement.clientWidth;
|
53
|
+
};
|
54
|
+
useResizeDetector({
|
55
|
+
onResize: handleVirtualGridResize,
|
56
|
+
targetRef: gridRef
|
57
|
+
});
|
49
58
|
var syncScroll = function syncScroll(e) {
|
50
59
|
var virtualBody = e.target;
|
51
|
-
document.querySelector(".".concat(blockClass, "__head-
|
52
|
-
var spacerColumn = document.querySelector(".".concat(blockClass, "__head-
|
60
|
+
document.querySelector(".".concat(blockClass, "__head-wrap")).scrollLeft = virtualBody.scrollLeft;
|
61
|
+
var spacerColumn = document.querySelector(".".concat(blockClass, "__head-wrap thead th:last-child"));
|
53
62
|
spacerColumn.style.width = px(32 + (virtualBody.offsetWidth - virtualBody.clientWidth)); // scrollbar width to header column to fix header alignment
|
54
63
|
};
|
55
64
|
|
@@ -62,7 +71,7 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
|
|
62
71
|
}
|
63
72
|
var visibleRows = DatagridPagination && page || rows;
|
64
73
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
65
|
-
className: "".concat(blockClass, "__head-
|
74
|
+
className: "".concat(blockClass, "__head-wrap"),
|
66
75
|
style: {
|
67
76
|
width: (_gridRef$current = gridRef.current) === null || _gridRef$current === void 0 ? void 0 : _gridRef$current.clientWidth,
|
68
77
|
overflow: 'hidden'
|
@@ -87,7 +87,13 @@ var Columns = function Columns(_ref) {
|
|
87
87
|
},
|
88
88
|
id: "".concat(blockClass, "__customization-column-select-all"),
|
89
89
|
labelText: selectAllLabel
|
90
|
-
})), columns
|
90
|
+
})), columns
|
91
|
+
// hide the columns without Header, e.g the sticky actions, spacer
|
92
|
+
.filter(function (colDef) {
|
93
|
+
return !!colDef.Header.props && !!colDef.Header.props.title;
|
94
|
+
}).filter(function (colDef) {
|
95
|
+
return !colDef.isAction;
|
96
|
+
}).filter(function (colDef) {
|
91
97
|
return filterString.length === 0 || colDef.Header.props.title.toLowerCase().includes(filterString);
|
92
98
|
}).map(function (colDef, i) {
|
93
99
|
var searchString = new RegExp('(' + filterString + ')');
|
package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js
CHANGED
@@ -3,7 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
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; }
|
4
4
|
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; }
|
5
5
|
/**
|
6
|
-
* Copyright IBM Corp. 2022,
|
6
|
+
* Copyright IBM Corp. 2022, 2023
|
7
7
|
*
|
8
8
|
* This source code is licensed under the Apache-2.0 license found in the
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
@@ -55,10 +55,6 @@ var CustomizeColumnsTearsheet = function CustomizeColumnsTearsheet(_ref) {
|
|
55
55
|
searchText = _useState6[0],
|
56
56
|
setSearchText = _useState6[1];
|
57
57
|
var _useState7 = useState(columnDefinitions
|
58
|
-
// hide the columns without Header, e.g the sticky actions, spacer
|
59
|
-
.filter(function (colDef) {
|
60
|
-
return !!colDef.Header.props && !colDef.isAction;
|
61
|
-
})
|
62
58
|
// only sort the hidden column to the end when modal reopen
|
63
59
|
.sort(function (defA, defB) {
|
64
60
|
var isVisibleA = isColumnVisible(defA);
|
@@ -40,14 +40,30 @@ var useSortableColumns = function useSortableColumns(hooks) {
|
|
40
40
|
if (col.isSorted) {
|
41
41
|
switch (col.isSortedDesc) {
|
42
42
|
case false:
|
43
|
-
return
|
43
|
+
return function () {
|
44
|
+
return /*#__PURE__*/React.createElement(ArrowUp16, {
|
45
|
+
className: "".concat(blockClass, "__sortable-icon ").concat(carbon.prefix, "--btn__icon")
|
46
|
+
});
|
47
|
+
};
|
44
48
|
case true:
|
45
|
-
return
|
49
|
+
return function () {
|
50
|
+
return /*#__PURE__*/React.createElement(ArrowUp16, {
|
51
|
+
className: "".concat(blockClass, "__sortable-icon ").concat(carbon.prefix, "--btn__icon")
|
52
|
+
});
|
53
|
+
};
|
46
54
|
default:
|
47
|
-
return
|
55
|
+
return function () {
|
56
|
+
return /*#__PURE__*/React.createElement(Arrows16, {
|
57
|
+
className: "".concat(blockClass, "__sortable-icon ").concat(carbon.prefix, "--btn__icon")
|
58
|
+
});
|
59
|
+
};
|
48
60
|
}
|
49
61
|
}
|
50
|
-
return
|
62
|
+
return function () {
|
63
|
+
return /*#__PURE__*/React.createElement(Arrows16, {
|
64
|
+
className: "".concat(blockClass, "__sortable-icon ").concat(carbon.prefix, "--btn__icon")
|
65
|
+
});
|
66
|
+
};
|
51
67
|
};
|
52
68
|
var Header = function Header(headerProp) {
|
53
69
|
var _cx;
|
@@ -95,5 +95,10 @@ export var ARG_TYPES = {
|
|
95
95
|
name: 'Filter props',
|
96
96
|
control: 'object',
|
97
97
|
description: 'This is an object for all the props passed into the filter flyout and filter panel'
|
98
|
+
},
|
99
|
+
expandedContentAlign: {
|
100
|
+
control: 'select',
|
101
|
+
options: ['flex-start', 'space-between'],
|
102
|
+
description: 'This sets the alignment of content inside expanded row.'
|
98
103
|
}
|
99
104
|
};
|
@@ -0,0 +1,87 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
4
|
+
var _excluded = ["children", "className", "definition", "theme"];
|
5
|
+
/**
|
6
|
+
* Copyright IBM Corp. 2023, 2023
|
7
|
+
*
|
8
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
10
|
+
*/
|
11
|
+
|
12
|
+
import React, { useState } from 'react';
|
13
|
+
import PropTypes from 'prop-types';
|
14
|
+
import cx from 'classnames';
|
15
|
+
import { ChevronUp16 } from '@carbon/icons-react';
|
16
|
+
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
17
|
+
import { pkg } from '../../settings';
|
18
|
+
|
19
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
20
|
+
var blockClass = "".concat(pkg.prefix, "--non-linear-reading");
|
21
|
+
var componentName = 'NonLinearReading';
|
22
|
+
|
23
|
+
// Default values for props
|
24
|
+
var defaults = {
|
25
|
+
theme: 'light'
|
26
|
+
};
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Use non-linear reading when space is limited to share a
|
30
|
+
* brief, at-a-glance, summary of a concept that may require
|
31
|
+
* more explanation for some users.
|
32
|
+
*/
|
33
|
+
export var NonLinearReading = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
34
|
+
var children = _ref.children,
|
35
|
+
className = _ref.className,
|
36
|
+
definition = _ref.definition,
|
37
|
+
_ref$theme = _ref.theme,
|
38
|
+
theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
|
39
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
40
|
+
var _useState = useState(false),
|
41
|
+
_useState2 = _slicedToArray(_useState, 2),
|
42
|
+
isOpen = _useState2[0],
|
43
|
+
setOpen = _useState2[1];
|
44
|
+
var handleToggle = function handleToggle() {
|
45
|
+
setOpen(function (prevState) {
|
46
|
+
return !prevState;
|
47
|
+
});
|
48
|
+
};
|
49
|
+
return /*#__PURE__*/React.createElement("span", _extends({}, rest, {
|
50
|
+
className: cx(blockClass, className),
|
51
|
+
ref: ref,
|
52
|
+
role: "main"
|
53
|
+
}, getDevtoolsProps(componentName)), ' ', /*#__PURE__*/React.createElement("button", {
|
54
|
+
type: "button",
|
55
|
+
"aria-expanded": isOpen,
|
56
|
+
className: cx("".concat(blockClass, "__term-").concat(theme), [isOpen ? ["".concat(blockClass, "__term-").concat(theme, "--open")] : ["".concat(blockClass, "__term-").concat(theme, "--closed")]]),
|
57
|
+
onClick: handleToggle
|
58
|
+
}, children, isOpen && /*#__PURE__*/React.createElement(ChevronUp16, null)), ' ', isOpen && /*#__PURE__*/React.createElement("span", {
|
59
|
+
className: "".concat(blockClass, "--body-").concat(theme)
|
60
|
+
}, definition), ' ');
|
61
|
+
});
|
62
|
+
|
63
|
+
// Return a placeholder if not released and not enabled by feature flag
|
64
|
+
NonLinearReading = pkg.checkComponentEnabled(NonLinearReading, componentName);
|
65
|
+
NonLinearReading.displayName = componentName;
|
66
|
+
|
67
|
+
// The types and DocGen commentary for the component props,
|
68
|
+
// in alphabetical order (for consistency).
|
69
|
+
// See https://www.npmjs.com/package/prop-types#usage.
|
70
|
+
NonLinearReading.propTypes = {
|
71
|
+
/**
|
72
|
+
* The term of the component appears as a pill.
|
73
|
+
*/
|
74
|
+
children: PropTypes.node.isRequired,
|
75
|
+
/**
|
76
|
+
* Provide an optional class to be applied to the containing node.
|
77
|
+
*/
|
78
|
+
className: PropTypes.string,
|
79
|
+
/**
|
80
|
+
* The content that appears when the term is toggled open.
|
81
|
+
*/
|
82
|
+
definition: PropTypes.node.isRequired,
|
83
|
+
/**
|
84
|
+
* Determines the theme of the component.
|
85
|
+
*/
|
86
|
+
theme: PropTypes.oneOf(['light', 'dark'])
|
87
|
+
};
|
@@ -3,11 +3,11 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
5
|
var _excluded = ["actionToolbarButtons", "actions", "animateTitle", "children", "className", "closeIconDescription", "condensedActions", "currentStep", "includeOverlay", "labelText", "navigationBackIconDescription", "onNavigationBack", "onRequestClose", "onUnmount", "open", "placement", "preventCloseOnClickOutside", "selectorPageContent", "selectorPrimaryFocus", "size", "slideIn", "subtitle", "title"],
|
6
|
-
_excluded2 = ["label", "kind", "icon", "leading", "disabled", "className", "onClick"];
|
6
|
+
_excluded2 = ["label", "kind", "icon", "tooltipPosition", "tooltipAlignment", "leading", "disabled", "className", "onClick"];
|
7
7
|
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; }
|
8
8
|
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; }
|
9
9
|
/**
|
10
|
-
* Copyright IBM Corp. 2020,
|
10
|
+
* Copyright IBM Corp. 2020, 2023
|
11
11
|
*
|
12
12
|
* This source code is licensed under the Apache-2.0 license found in the
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
@@ -398,10 +398,11 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
398
398
|
}, subtitle), actionToolbarButtons && actionToolbarButtons.length && /*#__PURE__*/React.createElement("div", {
|
399
399
|
className: cx("".concat(blockClass, "__action-toolbar"), _defineProperty({}, "".concat(blockClass, "__action-toolbar-no-animation"), !animateTitle))
|
400
400
|
}, actionToolbarButtons.map(function (_ref5) {
|
401
|
-
var _ref6;
|
402
401
|
var label = _ref5.label,
|
403
402
|
kind = _ref5.kind,
|
404
403
|
icon = _ref5.icon,
|
404
|
+
tooltipPosition = _ref5.tooltipPosition,
|
405
|
+
tooltipAlignment = _ref5.tooltipAlignment,
|
405
406
|
leading = _ref5.leading,
|
406
407
|
disabled = _ref5.disabled,
|
407
408
|
className = _ref5.className,
|
@@ -413,11 +414,11 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
413
414
|
size: "small",
|
414
415
|
renderIcon: icon,
|
415
416
|
iconDescription: label,
|
416
|
-
tooltipPosition:
|
417
|
-
tooltipAlignment:
|
417
|
+
tooltipPosition: tooltipPosition || 'bottom',
|
418
|
+
tooltipAlignment: tooltipAlignment || 'center',
|
418
419
|
hasIconOnly: !leading,
|
419
420
|
disabled: disabled,
|
420
|
-
className: cx(["".concat(blockClass, "__action-toolbar-button"), className, (
|
421
|
+
className: cx(["".concat(blockClass, "__action-toolbar-button"), className, _defineProperty({}, "".concat(blockClass, "__action-toolbar-leading-button"), leading)]),
|
421
422
|
onClick: onClick
|
422
423
|
}), leading && label);
|
423
424
|
})));
|
@@ -495,13 +496,18 @@ SidePanel.propTypes = {
|
|
495
496
|
leading: PropTypes.bool,
|
496
497
|
icon: PropTypes.object,
|
497
498
|
onClick: PropTypes.func,
|
498
|
-
kind: PropTypes.oneOf(['ghost', 'tertiary', 'secondary', 'primary'])
|
499
|
+
kind: PropTypes.oneOf(['ghost', 'tertiary', 'secondary', 'primary']),
|
500
|
+
tooltipAlignment: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
|
501
|
+
tooltipPosition: PropTypes.oneOf(['start', 'center', 'end'])
|
499
502
|
})),
|
500
503
|
/**
|
501
504
|
* The primary actions to be shown in the side panel. Each action is
|
502
505
|
* specified as an object with optional fields: 'label' to supply the button
|
503
506
|
* label, 'kind' to select the button kind (must be 'primary', 'secondary' or
|
504
|
-
* 'ghost'), '
|
507
|
+
* 'ghost'), 'tooltipPosition' to select where the tooltip is placed around
|
508
|
+
* the button (must be 'top', 'right', 'bottom', or 'left'), 'tooltipAlignment'
|
509
|
+
* to select how the tooltip is aligned with the button (must be 'start',
|
510
|
+
* 'center', or 'end', 'loading' to display a loading indicator, and 'onClick' to
|
505
511
|
* receive notifications when the button is clicked. Additional fields in the
|
506
512
|
* object will be passed to the Button component, and these can include
|
507
513
|
* 'disabled', 'ref', 'className', and any other Button props. Any other
|
@@ -512,6 +518,8 @@ SidePanel.propTypes = {
|
|
512
518
|
*/
|
513
519
|
actions: allPropTypes([ActionSet.validateActions(), PropTypes.arrayOf(PropTypes.shape(_objectSpread(_objectSpread({}, Button.propTypes), {}, {
|
514
520
|
kind: PropTypes.oneOf(['ghost', 'danger--ghost', 'secondary', 'danger', 'primary']),
|
521
|
+
tooltipPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
|
522
|
+
tooltipAlignment: PropTypes.oneOf(['start', 'center', 'end']),
|
515
523
|
label: PropTypes.string,
|
516
524
|
loading: PropTypes.bool,
|
517
525
|
// we duplicate this Button prop to improve the DocGen here
|
package/es/components/index.js
CHANGED
@@ -42,4 +42,5 @@ export { EditTearsheet } from './EditTearsheet';
|
|
42
42
|
export { EditTearsheetNarrow } from './EditTearsheetNarrow';
|
43
43
|
export { EditFullPage } from './EditFullPage';
|
44
44
|
export { EditUpdateCards } from './EditUpdateCards';
|
45
|
-
export { InlineEdit } from './InlineEdit';
|
45
|
+
export { InlineEdit } from './InlineEdit';
|
46
|
+
export { NonLinearReading } from './NonLinearReading';
|
@@ -69,7 +69,9 @@ var defaults = {
|
|
69
69
|
EditTearsheetNarrow: false,
|
70
70
|
EditFullPage: false,
|
71
71
|
EditUpdateCards: false,
|
72
|
-
ButtonMenu: false
|
72
|
+
ButtonMenu: false,
|
73
|
+
// Novice to pro components not yet reviewed and released:
|
74
|
+
NonLinearReading: false
|
73
75
|
/* new component flags here - comment used by generate CLI */
|
74
76
|
},
|
75
77
|
|
@@ -24,7 +24,8 @@ var AddSelectBreadcrumbs = function AddSelectBreadcrumbs(_ref) {
|
|
24
24
|
var multi = _ref.multi,
|
25
25
|
onClick = _ref.onClick,
|
26
26
|
path = _ref.path;
|
27
|
-
var clickHandler = function clickHandler(idx) {
|
27
|
+
var clickHandler = function clickHandler(e, idx) {
|
28
|
+
e.preventDefault();
|
28
29
|
onClick(idx);
|
29
30
|
};
|
30
31
|
var classNames = (0, _classnames.default)(blockClass, (0, _defineProperty2.default)({}, "".concat(blockClass, "-multi"), multi));
|
@@ -36,9 +37,10 @@ var AddSelectBreadcrumbs = function AddSelectBreadcrumbs(_ref) {
|
|
36
37
|
return /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.BreadcrumbItem, {
|
37
38
|
key: entry.id,
|
38
39
|
isCurrentPage: isCurrentPage,
|
39
|
-
onClick: function onClick() {
|
40
|
-
return clickHandler(idx);
|
41
|
-
}
|
40
|
+
onClick: function onClick(e) {
|
41
|
+
return clickHandler(e, idx);
|
42
|
+
},
|
43
|
+
href: "#"
|
42
44
|
}, entry.title);
|
43
45
|
}));
|
44
46
|
};
|
@@ -106,33 +106,22 @@ var AddSelectList = function AddSelectList(_ref) {
|
|
106
106
|
};
|
107
107
|
return /*#__PURE__*/_react.default.createElement("div", {
|
108
108
|
className: (0, _classnames.default)("".concat(blockClass, "-wrapper"), (0, _defineProperty2.default)({}, "".concat(blockClass, "-wrapper-multi"), multi))
|
109
|
-
}, /*#__PURE__*/_react.default.createElement(
|
110
|
-
selection: true,
|
109
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
111
110
|
className: "".concat(blockClass)
|
112
|
-
}, /*#__PURE__*/_react.default.createElement(
|
111
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
112
|
+
className: "".concat(blockClass, "-body")
|
113
|
+
}, filteredItems.map(function (item) {
|
113
114
|
var _cx2;
|
114
|
-
return /*#__PURE__*/_react.default.createElement(
|
115
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
115
116
|
key: item.id,
|
116
|
-
className: (0, _classnames.default)("".concat(blockClass, "-row"), (_cx2 = {}, (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "-row--selected"), isSelected(item.id)), (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "-row-meta--selected"), isInMetaPanel(item.id)), _cx2))
|
117
|
-
onClick: function onClick(evt) {
|
118
|
-
return metaPanelHandler(item, evt);
|
119
|
-
},
|
120
|
-
label: true
|
117
|
+
className: (0, _classnames.default)("".concat(blockClass, "-row"), (_cx2 = {}, (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "-row--selected"), isSelected(item.id)), (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "-row-meta--selected"), isInMetaPanel(item.id)), _cx2))
|
121
118
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
122
119
|
className: "".concat(blockClass, "-cell")
|
123
120
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
124
121
|
className: "".concat(blockClass, "-cell-wrapper")
|
125
122
|
}, multi ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
126
123
|
className: "".concat(blockClass, "-checkbox")
|
127
|
-
},
|
128
|
-
/*#__PURE__*/
|
129
|
-
// hacky way to prevent checkbox from triggering the meta onclick handler
|
130
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
131
|
-
_react.default.createElement("div", {
|
132
|
-
onClick: function onClick(event) {
|
133
|
-
return event.stopPropagation();
|
134
|
-
}
|
135
|
-
}, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Checkbox, {
|
124
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Checkbox, {
|
136
125
|
onChange: function onChange(value, id) {
|
137
126
|
return handleMultiSelection(value, id);
|
138
127
|
},
|
@@ -154,10 +143,9 @@ var AddSelectList = function AddSelectList(_ref) {
|
|
154
143
|
id: "add-select-modifier-".concat(item.id),
|
155
144
|
type: "inline",
|
156
145
|
items: modifiers.options,
|
157
|
-
light: true,
|
158
146
|
label: modifiers.label,
|
159
147
|
disabled: !isSelected(item.id),
|
160
|
-
className: "".concat(blockClass, "-dropdown
|
148
|
+
className: "".concat(blockClass, "-dropdown"),
|
161
149
|
initialSelectedItem: item[modifiers.id],
|
162
150
|
onChange: function onChange(_ref5) {
|
163
151
|
var selectedItem = _ref5.selectedItem;
|
@@ -185,9 +173,7 @@ var AddSelectList = function AddSelectList(_ref) {
|
|
185
173
|
},
|
186
174
|
kind: "ghost",
|
187
175
|
size: "sm"
|
188
|
-
}), item.meta && /*#__PURE__*/_react.default.createElement(
|
189
|
-
className: "".concat(blockClass, "-hidden-hover")
|
190
|
-
}, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, {
|
176
|
+
}), item.meta && /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, {
|
191
177
|
className: "".concat(blockClass, "-view-meta"),
|
192
178
|
renderIcon: _iconsReact.View16,
|
193
179
|
iconDescription: metaIconDescription,
|
@@ -195,8 +181,11 @@ var AddSelectList = function AddSelectList(_ref) {
|
|
195
181
|
tooltipAlignment: "center",
|
196
182
|
hasIconOnly: true,
|
197
183
|
kind: "ghost",
|
198
|
-
size: "sm"
|
199
|
-
|
184
|
+
size: "sm",
|
185
|
+
onClick: function onClick() {
|
186
|
+
return metaPanelHandler(item);
|
187
|
+
}
|
188
|
+
}))));
|
200
189
|
}))));
|
201
190
|
};
|
202
191
|
exports.AddSelectList = AddSelectList;
|
@@ -200,7 +200,8 @@ var CreateFullPage = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref)
|
|
200
200
|
kind: "secondary",
|
201
201
|
onClick: function onClick() {
|
202
202
|
setModalIsOpen(!modalIsOpen);
|
203
|
-
}
|
203
|
+
},
|
204
|
+
"data-modal-primary-focus": true
|
204
205
|
}, modalSecondaryButtonText), /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, {
|
205
206
|
type: "button",
|
206
207
|
kind: "danger",
|
@@ -100,9 +100,9 @@ var DatagridContent = function DatagridContent(_ref) {
|
|
100
100
|
return (0, _handleGridKeyPress.handleGridKeyPress)({
|
101
101
|
event: event,
|
102
102
|
dispatch: dispatch,
|
103
|
-
inlineEditState: inlineEditState,
|
104
103
|
instance: datagridState,
|
105
104
|
keysPressedList: keysPressedList,
|
105
|
+
state: inlineEditState,
|
106
106
|
usingMac: usingMac
|
107
107
|
});
|
108
108
|
} : null,
|
@@ -11,9 +11,10 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
12
12
|
var _reactWindow = require("react-window");
|
13
13
|
var _carbonComponentsReact = require("carbon-components-react");
|
14
|
+
var _layout = require("@carbon/layout");
|
15
|
+
var _reactResizeDetector = require("react-resize-detector");
|
14
16
|
var _settings = require("../../../settings");
|
15
17
|
var _DatagridHead = _interopRequireDefault(require("./DatagridHead"));
|
16
|
-
var _layout = require("@carbon/layout");
|
17
18
|
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); }
|
18
19
|
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; }
|
19
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; }
|
@@ -49,10 +50,18 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
|
|
49
50
|
page = datagridState.page,
|
50
51
|
handleResize = datagridState.handleResize,
|
51
52
|
gridRef = datagridState.gridRef;
|
53
|
+
var handleVirtualGridResize = function handleVirtualGridResize() {
|
54
|
+
var gridRefElement = gridRef === null || gridRef === void 0 ? void 0 : gridRef.current;
|
55
|
+
gridRefElement.style.width = gridRefElement === null || gridRefElement === void 0 ? void 0 : gridRefElement.clientWidth;
|
56
|
+
};
|
57
|
+
(0, _reactResizeDetector.useResizeDetector)({
|
58
|
+
onResize: handleVirtualGridResize,
|
59
|
+
targetRef: gridRef
|
60
|
+
});
|
52
61
|
var syncScroll = function syncScroll(e) {
|
53
62
|
var virtualBody = e.target;
|
54
|
-
document.querySelector(".".concat(blockClass, "__head-
|
55
|
-
var spacerColumn = document.querySelector(".".concat(blockClass, "__head-
|
63
|
+
document.querySelector(".".concat(blockClass, "__head-wrap")).scrollLeft = virtualBody.scrollLeft;
|
64
|
+
var spacerColumn = document.querySelector(".".concat(blockClass, "__head-wrap thead th:last-child"));
|
56
65
|
spacerColumn.style.width = (0, _layout.px)(32 + (virtualBody.offsetWidth - virtualBody.clientWidth)); // scrollbar width to header column to fix header alignment
|
57
66
|
};
|
58
67
|
|
@@ -65,7 +74,7 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
|
|
65
74
|
}
|
66
75
|
var visibleRows = DatagridPagination && page || rows;
|
67
76
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
68
|
-
className: "".concat(blockClass, "__head-
|
77
|
+
className: "".concat(blockClass, "__head-wrap"),
|
69
78
|
style: {
|
70
79
|
width: (_gridRef$current = gridRef.current) === null || _gridRef$current === void 0 ? void 0 : _gridRef$current.clientWidth,
|
71
80
|
overflow: 'hidden'
|
@@ -94,7 +94,13 @@ var Columns = function Columns(_ref) {
|
|
94
94
|
},
|
95
95
|
id: "".concat(blockClass, "__customization-column-select-all"),
|
96
96
|
labelText: selectAllLabel
|
97
|
-
})), columns
|
97
|
+
})), columns
|
98
|
+
// hide the columns without Header, e.g the sticky actions, spacer
|
99
|
+
.filter(function (colDef) {
|
100
|
+
return !!colDef.Header.props && !!colDef.Header.props.title;
|
101
|
+
}).filter(function (colDef) {
|
102
|
+
return !colDef.isAction;
|
103
|
+
}).filter(function (colDef) {
|
98
104
|
return filterString.length === 0 || colDef.Header.props.title.toLowerCase().includes(filterString);
|
99
105
|
}).map(function (colDef, i) {
|
100
106
|
var searchString = new RegExp('(' + filterString + ')');
|
package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js
CHANGED
@@ -57,10 +57,6 @@ var CustomizeColumnsTearsheet = function CustomizeColumnsTearsheet(_ref) {
|
|
57
57
|
searchText = _useState6[0],
|
58
58
|
setSearchText = _useState6[1];
|
59
59
|
var _useState7 = (0, _react.useState)(columnDefinitions
|
60
|
-
// hide the columns without Header, e.g the sticky actions, spacer
|
61
|
-
.filter(function (colDef) {
|
62
|
-
return !!colDef.Header.props && !colDef.isAction;
|
63
|
-
})
|
64
60
|
// only sort the hidden column to the end when modal reopen
|
65
61
|
.sort(function (defA, defB) {
|
66
62
|
var isVisibleA = (0, _common.isColumnVisible)(defA);
|