@carbon/ibm-products 2.41.1-canary.9 → 2.42.0
Sign up to get free protection for your applications and to get access to all the features.
- package/es/components/CreateFullPage/CreateFullPage.d.ts +2 -1
- package/es/components/CreateFullPage/CreateFullPageStep.d.ts +71 -2
- package/es/components/CreateFullPage/CreateFullPageStep.js +3 -0
- package/es/components/DataSpreadsheet/DataSpreadsheet.d.ts +3 -2
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +28 -28
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +7 -8
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +1 -0
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +4 -3
- package/es/components/DataSpreadsheet/types/index.d.ts +1 -4
- package/es/components/Datagrid/Datagrid/Datagrid.d.ts +24 -2
- package/es/components/Datagrid/Datagrid/Datagrid.js +4 -4
- package/es/components/Datagrid/Datagrid/DatagridBody.d.ts +2 -1
- package/es/components/Datagrid/Datagrid/DatagridBody.js +1 -2
- package/es/components/Datagrid/Datagrid/DatagridContent.d.ts +16 -13
- package/es/components/Datagrid/Datagrid/DatagridContent.js +12 -13
- package/es/components/Datagrid/Datagrid/DatagridEmptyBody.d.ts +8 -1
- package/es/components/Datagrid/Datagrid/DatagridEmptyBody.js +3 -4
- package/es/components/Datagrid/Datagrid/DatagridExpandedRow.d.ts +9 -1
- package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +10 -5
- package/es/components/Datagrid/Datagrid/DatagridHead.d.ts +8 -1
- package/es/components/Datagrid/Datagrid/DatagridHead.js +3 -5
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.d.ts +8 -1
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +41 -36
- package/es/components/Datagrid/Datagrid/DatagridRefBody.d.ts +2 -1
- package/es/components/Datagrid/Datagrid/DatagridRefBody.js +4 -4
- package/es/components/Datagrid/Datagrid/DatagridRow.d.ts +8 -1
- package/es/components/Datagrid/Datagrid/DatagridRow.js +12 -16
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.d.ts +9 -1
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +10 -8
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.d.ts +23 -27
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +9 -9
- package/es/components/Datagrid/Datagrid/DatagridSimpleBody.d.ts +2 -1
- package/es/components/Datagrid/Datagrid/DatagridSimpleBody.js +3 -3
- package/es/components/Datagrid/Datagrid/DatagridToolbar.d.ts +17 -10
- package/es/components/Datagrid/Datagrid/DatagridToolbar.js +15 -11
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.d.ts +8 -1
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +29 -17
- package/es/components/Datagrid/Datagrid/DraggableElement.d.ts +23 -21
- package/es/components/Datagrid/Datagrid/DraggableElement.js +2 -4
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.d.ts +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/Slug/DatagridSlug.d.ts +12 -2
- package/es/components/Datagrid/Datagrid/index.d.ts +7 -1
- package/es/components/Datagrid/types/index.d.ts +210 -0
- package/es/components/Datagrid/useColumnOrder.d.ts +1 -0
- package/es/components/Datagrid/useDatagrid.d.ts +1 -1
- package/es/components/Datagrid/useFocusRowExpander.js +1 -1
- package/es/components/Datagrid/useInfiniteScroll.d.ts +8 -1
- package/es/components/Datagrid/useInfiniteScroll.js +10 -9
- package/es/components/Datagrid/useSelectRows.js +5 -1
- package/es/components/FilterSummary/FilterSummary.d.ts +21 -2
- package/es/components/FilterSummary/FilterSummary.js +10 -11
- package/es/components/Guidebanner/Guidebanner.js +7 -2
- package/es/components/WebTerminal/WebTerminal.js +1 -1
- package/es/global/js/hooks/usePreviousValue.d.ts +1 -1
- package/es/global/js/hooks/usePreviousValue.js +3 -2
- package/es/global/js/hooks/useRetrieveStepData.d.ts +5 -5
- package/es/global/js/hooks/useRetrieveStepData.js +5 -5
- package/lib/components/CreateFullPage/CreateFullPage.d.ts +2 -1
- package/lib/components/CreateFullPage/CreateFullPageStep.d.ts +71 -2
- package/lib/components/CreateFullPage/CreateFullPageStep.js +3 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheet.d.ts +3 -2
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +28 -28
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +7 -8
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +1 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +4 -3
- package/lib/components/DataSpreadsheet/types/index.d.ts +1 -4
- package/lib/components/Datagrid/Datagrid/Datagrid.d.ts +24 -2
- package/lib/components/Datagrid/Datagrid/Datagrid.js +4 -4
- package/lib/components/Datagrid/Datagrid/DatagridBody.d.ts +2 -1
- package/lib/components/Datagrid/Datagrid/DatagridBody.js +1 -2
- package/lib/components/Datagrid/Datagrid/DatagridContent.d.ts +16 -13
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +44 -45
- package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.d.ts +8 -1
- package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.js +3 -4
- package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.d.ts +9 -1
- package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +9 -4
- package/lib/components/Datagrid/Datagrid/DatagridHead.d.ts +8 -1
- package/lib/components/Datagrid/Datagrid/DatagridHead.js +3 -5
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.d.ts +8 -1
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +40 -35
- package/lib/components/Datagrid/Datagrid/DatagridRefBody.d.ts +2 -1
- package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +4 -4
- package/lib/components/Datagrid/Datagrid/DatagridRow.d.ts +8 -1
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +12 -16
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.d.ts +9 -1
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +10 -8
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.d.ts +23 -27
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +9 -9
- package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.d.ts +2 -1
- package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.js +3 -3
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.d.ts +17 -10
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +15 -11
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.d.ts +8 -1
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +29 -17
- package/lib/components/Datagrid/Datagrid/DraggableElement.d.ts +23 -21
- package/lib/components/Datagrid/Datagrid/DraggableElement.js +2 -4
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.d.ts +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Slug/DatagridSlug.d.ts +12 -2
- package/lib/components/Datagrid/Datagrid/index.d.ts +7 -1
- package/lib/components/Datagrid/types/index.d.ts +210 -0
- package/lib/components/Datagrid/useColumnOrder.d.ts +1 -0
- package/lib/components/Datagrid/useDatagrid.d.ts +1 -1
- package/lib/components/Datagrid/useFocusRowExpander.js +1 -1
- package/lib/components/Datagrid/useInfiniteScroll.d.ts +8 -1
- package/lib/components/Datagrid/useInfiniteScroll.js +10 -9
- package/lib/components/Datagrid/useSelectRows.js +5 -1
- package/lib/components/FilterSummary/FilterSummary.d.ts +21 -2
- package/lib/components/FilterSummary/FilterSummary.js +10 -11
- package/lib/components/Guidebanner/Guidebanner.js +7 -2
- package/lib/components/WebTerminal/WebTerminal.js +1 -1
- package/lib/global/js/hooks/usePreviousValue.d.ts +1 -1
- package/lib/global/js/hooks/usePreviousValue.js +3 -2
- package/lib/global/js/hooks/useRetrieveStepData.d.ts +5 -5
- package/lib/global/js/hooks/useRetrieveStepData.js +5 -5
- package/package.json +5 -4
- package/telemetry.yml +67 -6
@@ -59,13 +59,13 @@ var SelectAll = function SelectAll(datagridState) {
|
|
59
59
|
if (hideSelectAll || radio) {
|
60
60
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
61
61
|
className: cx__default["default"]("".concat(blockClass, "__head-hidden-select-all"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__select-all-sticky-left"), /* istanbul ignore next */
|
62
|
-
isFirstColumnStickyLeft && windowSize > 671))
|
62
|
+
isFirstColumnStickyLeft && Number(windowSize) > 671))
|
63
63
|
});
|
64
64
|
}
|
65
65
|
var getProps = DatagridPagination ? getToggleAllPageRowsSelectedProps : getToggleAllRowsSelectedProps;
|
66
|
-
var
|
67
|
-
onChange =
|
68
|
-
selectProps = _rollupPluginBabelHelpers.objectWithoutProperties(
|
66
|
+
var _ref = getProps(),
|
67
|
+
onChange = _ref.onChange,
|
68
|
+
selectProps = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
69
69
|
var indeterminate = selectProps.indeterminate;
|
70
70
|
var handleSelectAllChange = function handleSelectAllChange(event) {
|
71
71
|
if (indeterminate) {
|
@@ -73,7 +73,8 @@ var SelectAll = function SelectAll(datagridState) {
|
|
73
73
|
dispatch: dispatch,
|
74
74
|
rows: rows,
|
75
75
|
getRowId: getRowId,
|
76
|
-
indeterminate: true
|
76
|
+
indeterminate: true,
|
77
|
+
isChecked: undefined
|
77
78
|
});
|
78
79
|
toggleAllRowsSelected(false);
|
79
80
|
onAllRowSelect === null || onAllRowSelect === void 0 || onAllRowSelect(rows, event);
|
@@ -87,18 +88,19 @@ var SelectAll = function SelectAll(datagridState) {
|
|
87
88
|
dispatch: dispatch,
|
88
89
|
rows: rows,
|
89
90
|
getRowId: getRowId,
|
90
|
-
isChecked: event.target.checked
|
91
|
+
isChecked: event.target.checked,
|
92
|
+
indeterminate: indeterminate
|
91
93
|
});
|
92
94
|
onAllRowSelect === null || onAllRowSelect === void 0 || onAllRowSelect(rows, event);
|
93
95
|
return onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
94
96
|
};
|
95
97
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
96
98
|
className: cx__default["default"]("".concat(blockClass, "__head-select-all"), "".concat(blockClass, "__checkbox-cell"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__checkbox-cell-sticky-left"), /* istanbul ignore next */
|
97
|
-
isFirstColumnStickyLeft && windowSize > 671))
|
99
|
+
isFirstColumnStickyLeft && Number(windowSize) > 671))
|
98
100
|
}, /*#__PURE__*/React__default["default"].createElement(react.TableSelectAll, _rollupPluginBabelHelpers["extends"]({}, selectProps, {
|
99
101
|
name: "".concat(tableId, "-select-all-checkbox-name"),
|
100
102
|
onSelect: handleSelectAllChange,
|
101
|
-
disabled: isFetching || selectProps.disabled,
|
103
|
+
disabled: isFetching || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled),
|
102
104
|
id: "".concat(tableId, "-select-all-checkbox-id")
|
103
105
|
})));
|
104
106
|
};
|
@@ -1,28 +1,24 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
getToggleAllPageRowsSelectedProps: any;
|
8
|
-
getToggleAllRowsSelectedProps: any;
|
9
|
-
allPageRowsLabel?: string | undefined;
|
10
|
-
allRowsLabel?: string | undefined;
|
11
|
-
columns: any;
|
12
|
-
withStickyColumn: any;
|
13
|
-
}): import("react/jsx-runtime").JSX.Element;
|
14
|
-
declare namespace SelectAllWithToggle {
|
15
|
-
namespace propTypes {
|
16
|
-
let allPageRowsLabel: PropTypes.Requireable<string>;
|
17
|
-
let allRowsLabel: PropTypes.Requireable<string>;
|
18
|
-
let columns: PropTypes.Requireable<(object | null | undefined)[]>;
|
19
|
-
let getToggleAllPageRowsSelectedProps: PropTypes.Validator<(...args: any[]) => any>;
|
20
|
-
let getToggleAllRowsSelectedProps: PropTypes.Validator<(...args: any[]) => any>;
|
21
|
-
let isAllRowsSelected: PropTypes.Validator<boolean>;
|
22
|
-
let isFetching: PropTypes.Requireable<boolean>;
|
23
|
-
let selectAllToggle: PropTypes.Requireable<object>;
|
24
|
-
let tableId: PropTypes.Validator<string>;
|
25
|
-
let withStickyColumn: PropTypes.Requireable<boolean>;
|
26
|
-
}
|
27
|
-
}
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2023
|
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
|
+
*/
|
28
7
|
import PropTypes from 'prop-types';
|
8
|
+
import { DataGridState } from '../types';
|
9
|
+
declare const SelectAllWithToggle: {
|
10
|
+
({ tableId, isFetching, isAllRowsSelected, selectAllToggle, getToggleAllPageRowsSelectedProps, getToggleAllRowsSelectedProps, allPageRowsLabel, allRowsLabel, columns, withStickyColumn, }: DataGridState): import("react/jsx-runtime").JSX.Element;
|
11
|
+
propTypes: {
|
12
|
+
allPageRowsLabel: PropTypes.Requireable<string>;
|
13
|
+
allRowsLabel: PropTypes.Requireable<string>;
|
14
|
+
columns: PropTypes.Requireable<(object | null | undefined)[]>;
|
15
|
+
getToggleAllPageRowsSelectedProps: PropTypes.Validator<(...args: any[]) => any>;
|
16
|
+
getToggleAllRowsSelectedProps: PropTypes.Validator<(...args: any[]) => any>;
|
17
|
+
isAllRowsSelected: PropTypes.Validator<boolean>;
|
18
|
+
isFetching: PropTypes.Requireable<boolean>;
|
19
|
+
selectAllToggle: PropTypes.Requireable<object>;
|
20
|
+
tableId: PropTypes.Validator<string>;
|
21
|
+
withStickyColumn: PropTypes.Requireable<boolean>;
|
22
|
+
};
|
23
|
+
};
|
24
|
+
export default SelectAllWithToggle;
|
@@ -66,22 +66,22 @@ var SelectAllWithToggle = function SelectAllWithToggle(_ref) {
|
|
66
66
|
};
|
67
67
|
}, []);
|
68
68
|
if (labels) {
|
69
|
-
allPageRowsLabel = labels.allPageRows || allPageRowsLabel;
|
69
|
+
allPageRowsLabel = (labels === null || labels === void 0 ? void 0 : labels.allPageRows) || allPageRowsLabel;
|
70
70
|
allRowsLabel = labels.allRows || allRowsLabel;
|
71
71
|
}
|
72
72
|
var getProps = selectAllMode === SELECT_ALL_PAGE_ROWS ? getToggleAllPageRowsSelectedProps : getToggleAllRowsSelectedProps;
|
73
|
-
var
|
74
|
-
onChange =
|
75
|
-
selectProps = _rollupPluginBabelHelpers.objectWithoutProperties(
|
73
|
+
var _ref3 = getProps(),
|
74
|
+
onChange = _ref3.onChange,
|
75
|
+
selectProps = _rollupPluginBabelHelpers.objectWithoutProperties(_ref3, _excluded);
|
76
76
|
var disabled = isFetching || selectProps.disabled;
|
77
|
-
var isFirstColumnStickyLeft = ((_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.sticky) === 'left' && withStickyColumn;
|
77
|
+
var isFirstColumnStickyLeft = (columns === null || columns === void 0 || (_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.sticky) === 'left' && withStickyColumn;
|
78
78
|
return /*#__PURE__*/React__default["default"].createElement("th", {
|
79
79
|
scope: "col",
|
80
80
|
className: cx__default["default"]("".concat(blockClass, "__select-all-toggle-on"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__select-all-sticky-left"), isFirstColumnStickyLeft && windowSize > 671))
|
81
81
|
}, /*#__PURE__*/React__default["default"].createElement("span", null, /*#__PURE__*/React__default["default"].createElement(react.Checkbox, _rollupPluginBabelHelpers["extends"]({}, selectProps, {
|
82
82
|
name: "".concat(tableId, "-select-all-checkbox-name"),
|
83
83
|
onClick: function onClick(e) {
|
84
|
-
onChange(e);
|
84
|
+
onChange === null || onChange === void 0 || onChange(e);
|
85
85
|
},
|
86
86
|
disabled: disabled,
|
87
87
|
id: "".concat(tableId, "-select-all-checkbox-id"),
|
@@ -101,9 +101,10 @@ var SelectAllWithToggle = function SelectAllWithToggle(_ref) {
|
|
101
101
|
requireTitle: true,
|
102
102
|
disabled: disabled,
|
103
103
|
onClick: function onClick() {
|
104
|
+
var _ref4;
|
104
105
|
setSelectAllMode(SELECT_ALL_PAGE_ROWS);
|
105
106
|
// deselect all rows first
|
106
|
-
getToggleAllRowsSelectedProps().onChange({
|
107
|
+
getToggleAllRowsSelectedProps === null || getToggleAllRowsSelectedProps === void 0 || (_ref4 = getToggleAllRowsSelectedProps()) === null || _ref4 === void 0 || _ref4.onChange({
|
107
108
|
target: {
|
108
109
|
checked: false
|
109
110
|
}
|
@@ -141,6 +142,5 @@ SelectAllWithToggle.propTypes = {
|
|
141
142
|
tableId: index["default"].string.isRequired,
|
142
143
|
withStickyColumn: index["default"].bool
|
143
144
|
};
|
144
|
-
var SelectAllWithToggle$1 = SelectAllWithToggle;
|
145
145
|
|
146
|
-
exports["default"] = SelectAllWithToggle
|
146
|
+
exports["default"] = SelectAllWithToggle;
|
@@ -1,2 +1,3 @@
|
|
1
|
+
import { DataGridState } from '../types';
|
2
|
+
declare const DatagridSimpleBody: (datagridState: DataGridState) => import("react/jsx-runtime").JSX.Element;
|
1
3
|
export default DatagridSimpleBody;
|
2
|
-
declare function DatagridSimpleBody(datagridState: any): import("react/jsx-runtime").JSX.Element;
|
@@ -31,15 +31,15 @@ var DatagridSimpleBody = function DatagridSimpleBody(datagridState) {
|
|
31
31
|
"aria-live": null,
|
32
32
|
className: cx__default["default"]("".concat(blockClass, "__simple-body"), getTableBodyProps().className)
|
33
33
|
}), rows.map(function (row) {
|
34
|
+
var _row$RowRenderer;
|
34
35
|
prepareRow(row);
|
35
36
|
var _row$getRowProps = row.getRowProps(),
|
36
37
|
key = _row$getRowProps.key;
|
37
|
-
return row.RowRenderer(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, datagridState), {}, {
|
38
|
+
return row === null || row === void 0 || (_row$RowRenderer = row.RowRenderer) === null || _row$RowRenderer === void 0 ? void 0 : _row$RowRenderer.call(row, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, datagridState), {}, {
|
38
39
|
row: row,
|
39
40
|
key: key
|
40
41
|
}));
|
41
42
|
}));
|
42
43
|
};
|
43
|
-
var DatagridSimpleBody$1 = DatagridSimpleBody;
|
44
44
|
|
45
|
-
exports["default"] = DatagridSimpleBody
|
45
|
+
exports["default"] = DatagridSimpleBody;
|
@@ -1,11 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
namespace propTypes {
|
8
|
-
let ariaToolbarLabel: PropTypes.Requireable<string>;
|
9
|
-
}
|
10
|
-
}
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2021, 2023
|
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
|
+
*/
|
11
7
|
import PropTypes from 'prop-types';
|
8
|
+
import { DataGridState } from '../types';
|
9
|
+
interface DatagridToolbarProps {
|
10
|
+
ariaToolbarLabel?: string;
|
11
|
+
}
|
12
|
+
declare const DatagridToolbar: {
|
13
|
+
({ ariaToolbarLabel, ...datagridState }: DatagridToolbarProps & DataGridState): import("react/jsx-runtime").JSX.Element | null;
|
14
|
+
propTypes: {
|
15
|
+
ariaToolbarLabel: PropTypes.Requireable<string>;
|
16
|
+
};
|
17
|
+
};
|
18
|
+
export default DatagridToolbar;
|
@@ -57,13 +57,14 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
|
|
57
57
|
// the ButtonMenu
|
58
58
|
React.useEffect(function () {
|
59
59
|
if (totalSelected === 1 && !receivedInitialWidth) {
|
60
|
-
var
|
60
|
+
var _ref$current;
|
61
|
+
var batchActionListWidth = ref === null || ref === void 0 || (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.querySelector(".".concat(settings.carbon.prefix, "--action-list")).offsetWidth;
|
61
62
|
setInitialListWidth(batchActionListWidth);
|
62
63
|
setReceivedInitialWidth(true);
|
63
64
|
}
|
64
65
|
}, [totalSelected, receivedInitialWidth, ref]);
|
65
66
|
React.useEffect(function () {
|
66
|
-
var summaryWidth = ref.current.querySelector(".".concat(settings.carbon.prefix, "--batch-summary")).offsetWidth;
|
67
|
+
var summaryWidth = ref === null || ref === void 0 ? void 0 : ref.current.querySelector(".".concat(settings.carbon.prefix, "--batch-summary")).offsetWidth;
|
67
68
|
if (width < summaryWidth + initialListWidth + 32) {
|
68
69
|
setDisplayAllInMenu(true);
|
69
70
|
} else {
|
@@ -88,7 +89,7 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
|
|
88
89
|
var minWidthBeforeOverflowIcon = 380;
|
89
90
|
// Do not render ButtonMenu when there are 3 or less items
|
90
91
|
// and if there is enough available space to render all the items
|
91
|
-
if ((toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.length) <= 3 && !displayAllInMenu) {
|
92
|
+
if (toolbarBatchActions && (toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.length) <= 3 && !displayAllInMenu) {
|
92
93
|
return;
|
93
94
|
}
|
94
95
|
var renderItem = function renderItem(batchAction, index) {
|
@@ -103,7 +104,8 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
|
|
103
104
|
return /*#__PURE__*/React__default["default"].createElement(react.MenuButton, {
|
104
105
|
label: batchActionMenuButtonLabelText,
|
105
106
|
className: cx__default["default"]([menuClass, _rollupPluginBabelHelpers.defineProperty({}, "".concat(menuClass, "-icon-only"), width <= minWidthBeforeOverflowIcon)]),
|
106
|
-
tabIndex: totalSelected > 0 ? 0 : -1
|
107
|
+
tabIndex: totalSelected > 0 ? 0 : -1,
|
108
|
+
menuAlignment: "bottom"
|
107
109
|
}, toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.map(function (batchAction, index) {
|
108
110
|
var hidden = index < 2 && !displayAllInMenu;
|
109
111
|
if (!hidden) {
|
@@ -122,10 +124,11 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
|
|
122
124
|
dispatch: dispatch,
|
123
125
|
rows: [],
|
124
126
|
getRowId: getRowId,
|
125
|
-
isChecked: false
|
127
|
+
isChecked: false,
|
128
|
+
indeterminate: undefined
|
126
129
|
});
|
127
130
|
toggleAllRowsSelected(false);
|
128
|
-
setGlobalFilter(null);
|
131
|
+
setGlobalFilter === null || setGlobalFilter === void 0 || setGlobalFilter(null);
|
129
132
|
};
|
130
133
|
var onSelectAllHandler = function onSelectAllHandler() {
|
131
134
|
toggleAllRowsSelected(true);
|
@@ -133,7 +136,9 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
|
|
133
136
|
stateReducer.handleSelectAllRowData({
|
134
137
|
dispatch: dispatch,
|
135
138
|
rows: rows,
|
136
|
-
getRowId: getRowId
|
139
|
+
getRowId: getRowId,
|
140
|
+
indeterminate: undefined,
|
141
|
+
isChecked: undefined
|
137
142
|
});
|
138
143
|
};
|
139
144
|
|
@@ -177,15 +182,14 @@ var DatagridToolbar = function DatagridToolbar(_ref2) {
|
|
177
182
|
className: cx__default["default"]([blockClass, "".concat(blockClass, "--").concat(getRowHeight)])
|
178
183
|
}, /*#__PURE__*/React__default["default"].createElement(react.TableToolbar, {
|
179
184
|
"aria-label": ariaToolbarLabel
|
180
|
-
}, DatagridActions && /*#__PURE__*/React__default["default"].createElement(DatagridActions, datagridState), DatagridBatchActionsToolbar
|
185
|
+
}, DatagridActions && /*#__PURE__*/React__default["default"].createElement(DatagridActions, datagridState), DatagridBatchActionsToolbar === null || DatagridBatchActionsToolbar === void 0 ? void 0 : DatagridBatchActionsToolbar(datagridState, width, ref))) : DatagridActions ? /*#__PURE__*/React__default["default"].createElement("div", {
|
181
186
|
className: blockClass
|
182
187
|
}, /*#__PURE__*/React__default["default"].createElement(react.TableToolbar, {
|
183
188
|
"aria-label": ariaToolbarLabel
|
184
|
-
}, DatagridActions && /*#__PURE__*/React__default["default"].createElement(DatagridActions, datagridState), DatagridBatchActions
|
189
|
+
}, DatagridActions && /*#__PURE__*/React__default["default"].createElement(DatagridActions, datagridState), DatagridBatchActions === null || DatagridBatchActions === void 0 ? void 0 : DatagridBatchActions(datagridState))) : null;
|
185
190
|
};
|
186
191
|
DatagridToolbar.propTypes = {
|
187
192
|
ariaToolbarLabel: index["default"].string
|
188
193
|
};
|
189
|
-
var DatagridToolbar$1 = DatagridToolbar;
|
190
194
|
|
191
|
-
exports["default"] = DatagridToolbar
|
195
|
+
exports["default"] = DatagridToolbar;
|
@@ -1,2 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2023
|
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
|
+
import { DataGridState } from '../types';
|
8
|
+
declare const DatagridVirtualBody: (datagridState: DataGridState) => import("react/jsx-runtime").JSX.Element;
|
1
9
|
export default DatagridVirtualBody;
|
2
|
-
declare function DatagridVirtualBody(datagridState: any): import("react/jsx-runtime").JSX.Element;
|
@@ -53,37 +53,48 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
|
|
53
53
|
/* istanbul ignore next */
|
54
54
|
var handleVirtualGridResize = function handleVirtualGridResize() {
|
55
55
|
var gridRefElement = gridRef === null || gridRef === void 0 ? void 0 : gridRef.current;
|
56
|
-
|
56
|
+
if (gridRefElement) {
|
57
|
+
var _gridRefElement$clien;
|
58
|
+
gridRefElement.style.width = gridRefElement === null || gridRefElement === void 0 || (_gridRefElement$clien = gridRefElement.clientWidth) === null || _gridRefElement$clien === void 0 ? void 0 : _gridRefElement$clien.toString();
|
59
|
+
}
|
57
60
|
};
|
58
61
|
useResizeObserver.useResizeObserver(gridRef, handleVirtualGridResize);
|
59
62
|
React.useEffect(function () {
|
60
|
-
handleResize();
|
63
|
+
handleResize === null || handleResize === void 0 || handleResize();
|
61
64
|
}, [handleResize]);
|
62
65
|
var rowHeight = rowSize && rowSizeMap[rowSize] || defaultRowHeight;
|
63
|
-
|
64
|
-
listRef.current
|
65
|
-
|
66
|
+
React.useEffect(function () {
|
67
|
+
if (listRef && listRef.current) {
|
68
|
+
listRef.current.resetAfterIndex(0);
|
69
|
+
}
|
70
|
+
}, [listRef]);
|
66
71
|
var visibleRows = DatagridPagination && page || rows;
|
67
|
-
var testRef = React.useRef();
|
72
|
+
var testRef = React.useRef(null);
|
68
73
|
|
69
74
|
// Sync the scrollLeft position of the virtual body to the table header
|
70
75
|
React.useEffect(function () {
|
71
76
|
function handleScroll(event) {
|
77
|
+
var _document;
|
72
78
|
var virtualBody = event.target;
|
73
|
-
document.querySelector("#".concat(tableId, " .").concat(blockClass, "__head-wrap"))
|
79
|
+
var headWrapEl = (_document = document) === null || _document === void 0 ? void 0 : _document.querySelector("#".concat(tableId, " .").concat(blockClass, "__head-wrap"));
|
80
|
+
if (headWrapEl) {
|
81
|
+
headWrapEl.scrollLeft = virtualBody === null || virtualBody === void 0 ? void 0 : virtualBody.scrollLeft;
|
82
|
+
}
|
74
83
|
var spacerColumn = document.querySelector("#".concat(tableId, " .").concat(blockClass, "__head-wrap thead th:last-child"));
|
75
|
-
|
84
|
+
if (spacerColumn) {
|
85
|
+
spacerColumn.style.width = layout.px(32 + (virtualBody.offsetWidth - virtualBody.clientWidth)); // scrollbar width to header column to fix header alignment
|
86
|
+
}
|
76
87
|
}
|
77
|
-
var testRefValue = testRef.current;
|
78
|
-
testRefValue.addEventListener('scroll', handleScroll);
|
88
|
+
var testRefValue = testRef === null || testRef === void 0 ? void 0 : testRef.current;
|
89
|
+
testRefValue === null || testRefValue === void 0 || testRefValue.addEventListener('scroll', handleScroll);
|
79
90
|
return function () {
|
80
|
-
testRefValue.removeEventListener('scroll', handleScroll);
|
91
|
+
testRefValue === null || testRefValue === void 0 || testRefValue.removeEventListener('scroll', handleScroll);
|
81
92
|
};
|
82
93
|
});
|
83
94
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
84
95
|
className: "".concat(blockClass, "__head-wrap"),
|
85
96
|
style: {
|
86
|
-
width: (_gridRef$current = gridRef.current) === null || _gridRef$current === void 0 ? void 0 : _gridRef$current.clientWidth,
|
97
|
+
width: gridRef === null || gridRef === void 0 || (_gridRef$current = gridRef.current) === null || _gridRef$current === void 0 ? void 0 : _gridRef$current.clientWidth,
|
87
98
|
overflow: 'hidden'
|
88
99
|
}
|
89
100
|
}, /*#__PURE__*/React__default["default"].createElement(DatagridHead["default"], datagridState)), /*#__PURE__*/React__default["default"].createElement(react.TableBody, _rollupPluginBabelHelpers["extends"]({}, getTableBodyProps({
|
@@ -94,7 +105,8 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
|
|
94
105
|
height: virtualHeight || tableHeight,
|
95
106
|
itemCount: visibleRows.length,
|
96
107
|
itemSize: function itemSize(index) {
|
97
|
-
|
108
|
+
var _visibleRows$index;
|
109
|
+
return (_visibleRows$index = visibleRows[index]) !== null && _visibleRows$index !== void 0 && _visibleRows$index.isExpanded ? (visibleRows[index].expandedContentHeight || 0) + rowHeight : rowHeight;
|
98
110
|
},
|
99
111
|
estimatedItemSize: rowHeight,
|
100
112
|
onScroll: onScroll,
|
@@ -106,9 +118,10 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
|
|
106
118
|
ref: listRef,
|
107
119
|
className: "".concat(blockClass, "__virtual-scrollbar"),
|
108
120
|
style: {
|
109
|
-
width: (_gridRef$current2 = gridRef.current) === null || _gridRef$current2 === void 0 ? void 0 : _gridRef$current2.clientWidth
|
121
|
+
width: gridRef === null || gridRef === void 0 || (_gridRef$current2 = gridRef.current) === null || _gridRef$current2 === void 0 ? void 0 : _gridRef$current2.clientWidth
|
110
122
|
}
|
111
123
|
}, function (_ref) {
|
124
|
+
var _row$RowRenderer;
|
112
125
|
var index = _ref.index,
|
113
126
|
style = _ref.style;
|
114
127
|
var row = visibleRows[index];
|
@@ -117,12 +130,11 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
|
|
117
130
|
key = _row$getRowProps.key;
|
118
131
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
119
132
|
style: _rollupPluginBabelHelpers.objectSpread2({}, style)
|
120
|
-
}, row.RowRenderer(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, datagridState), {}, {
|
133
|
+
}, row === null || row === void 0 || (_row$RowRenderer = row.RowRenderer) === null || _row$RowRenderer === void 0 ? void 0 : _row$RowRenderer.call(row, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, datagridState), {}, {
|
121
134
|
row: row,
|
122
135
|
key: key
|
123
136
|
})));
|
124
137
|
})));
|
125
138
|
};
|
126
|
-
var DatagridVirtualBody$1 = DatagridVirtualBody;
|
127
139
|
|
128
|
-
exports["default"] = DatagridVirtualBody
|
140
|
+
exports["default"] = DatagridVirtualBody;
|
@@ -1,22 +1,24 @@
|
|
1
|
-
|
2
|
-
declare function DraggableElement({ id, children, classList, disabled, ariaLabel, isSticky, selected, }: {
|
3
|
-
id: any;
|
4
|
-
children: any;
|
5
|
-
classList: any;
|
6
|
-
disabled: any;
|
7
|
-
ariaLabel: any;
|
8
|
-
isSticky: any;
|
9
|
-
selected: any;
|
10
|
-
}): import("react/jsx-runtime").JSX.Element;
|
11
|
-
declare namespace DraggableElement {
|
12
|
-
namespace propTypes {
|
13
|
-
let ariaLabel: PropTypes.Validator<string>;
|
14
|
-
let children: PropTypes.Validator<PropTypes.ReactElementLike>;
|
15
|
-
let classList: PropTypes.Requireable<string>;
|
16
|
-
let disabled: PropTypes.Requireable<boolean>;
|
17
|
-
let id: PropTypes.Validator<string>;
|
18
|
-
let isSticky: PropTypes.Requireable<boolean>;
|
19
|
-
let selected: PropTypes.Requireable<boolean>;
|
20
|
-
}
|
21
|
-
}
|
1
|
+
import { PropsWithChildren, ReactNode } from 'react';
|
22
2
|
import PropTypes from 'prop-types';
|
3
|
+
interface DraggableElementProps extends PropsWithChildren {
|
4
|
+
ariaLabel: string;
|
5
|
+
children: ReactNode;
|
6
|
+
classList?: string;
|
7
|
+
disabled?: boolean;
|
8
|
+
id: string;
|
9
|
+
isSticky?: boolean;
|
10
|
+
selected?: boolean;
|
11
|
+
}
|
12
|
+
declare const DraggableElement: {
|
13
|
+
({ id, children, classList, disabled, ariaLabel, isSticky, selected, }: DraggableElementProps): import("react/jsx-runtime").JSX.Element;
|
14
|
+
propTypes: {
|
15
|
+
ariaLabel: PropTypes.Validator<string>;
|
16
|
+
children: PropTypes.Validator<PropTypes.ReactElementLike>;
|
17
|
+
classList: PropTypes.Requireable<string>;
|
18
|
+
disabled: PropTypes.Requireable<boolean>;
|
19
|
+
id: PropTypes.Validator<string>;
|
20
|
+
isSticky: PropTypes.Requireable<boolean>;
|
21
|
+
selected: PropTypes.Requireable<boolean>;
|
22
|
+
};
|
23
|
+
};
|
24
|
+
export default DraggableElement;
|
@@ -53,7 +53,7 @@ var DraggableElement = function DraggableElement(_ref) {
|
|
53
53
|
size: 16
|
54
54
|
}))), children);
|
55
55
|
var style = {
|
56
|
-
transform: !disabled ? utilities.CSS.Transform.toString(transform) :
|
56
|
+
transform: !disabled ? utilities.CSS.Transform.toString(transform) : undefined,
|
57
57
|
transition: transition
|
58
58
|
};
|
59
59
|
return /*#__PURE__*/React__default["default"].createElement("li", _rollupPluginBabelHelpers["extends"]({
|
@@ -62,7 +62,6 @@ var DraggableElement = function DraggableElement(_ref) {
|
|
62
62
|
ref: setNodeRef,
|
63
63
|
style: style
|
64
64
|
}, attributes, listeners, {
|
65
|
-
disabled: disabled,
|
66
65
|
"aria-selected": selected,
|
67
66
|
role: "option"
|
68
67
|
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
@@ -80,6 +79,5 @@ DraggableElement.propTypes = {
|
|
80
79
|
isSticky: index["default"].bool,
|
81
80
|
selected: index["default"].bool
|
82
81
|
};
|
83
|
-
var DraggableElement$1 = DraggableElement;
|
84
82
|
|
85
|
-
exports["default"] = DraggableElement
|
83
|
+
exports["default"] = DraggableElement;
|
@@ -41,7 +41,7 @@ declare namespace FilterPanel {
|
|
41
41
|
let searchLabelText: PropTypes.Requireable<string>;
|
42
42
|
let searchPlaceholder: PropTypes.Requireable<string>;
|
43
43
|
let secondaryActionLabel: PropTypes.Requireable<string>;
|
44
|
-
let setAllFilters: PropTypes.
|
44
|
+
let setAllFilters: PropTypes.Requireable<(...args: any[]) => any>;
|
45
45
|
let showFilterSearch: PropTypes.Requireable<boolean>;
|
46
46
|
let title: PropTypes.Requireable<string>;
|
47
47
|
let updateMethod: PropTypes.Requireable<string>;
|
@@ -292,7 +292,7 @@ FilterPanel.propTypes = {
|
|
292
292
|
searchLabelText: index["default"].string,
|
293
293
|
searchPlaceholder: index["default"].string,
|
294
294
|
secondaryActionLabel: index["default"].string,
|
295
|
-
setAllFilters: index["default"].func
|
295
|
+
setAllFilters: index["default"].func,
|
296
296
|
showFilterSearch: index["default"].bool,
|
297
297
|
title: index["default"].string,
|
298
298
|
updateMethod: index["default"].oneOf([constants.BATCH, constants.INSTANT])
|
@@ -1,2 +1,12 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2024, 2024
|
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
|
+
import React, { ReactNode } from 'react';
|
8
|
+
interface DatagridSlugProps {
|
9
|
+
slug?: ReactNode;
|
10
|
+
}
|
11
|
+
export declare const DatagridSlug: React.ForwardRefExoticComponent<DatagridSlugProps & React.RefAttributes<HTMLDivElement>>;
|
12
|
+
export {};
|