@carbon/ibm-products 2.41.1-canary.13 → 2.41.1-canary.17
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 +208 -0
- package/es/components/Datagrid/useColumnOrder.d.ts +1 -0
- package/es/components/Datagrid/useDatagrid.d.ts +1 -1
- 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/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 +208 -0
- package/lib/components/Datagrid/useColumnOrder.d.ts +1 -0
- package/lib/components/Datagrid/useDatagrid.d.ts +1 -1
- 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/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 +3 -2
@@ -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;
|
@@ -45,37 +45,48 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
|
|
45
45
|
/* istanbul ignore next */
|
46
46
|
var handleVirtualGridResize = function handleVirtualGridResize() {
|
47
47
|
var gridRefElement = gridRef === null || gridRef === void 0 ? void 0 : gridRef.current;
|
48
|
-
|
48
|
+
if (gridRefElement) {
|
49
|
+
var _gridRefElement$clien;
|
50
|
+
gridRefElement.style.width = gridRefElement === null || gridRefElement === void 0 || (_gridRefElement$clien = gridRefElement.clientWidth) === null || _gridRefElement$clien === void 0 ? void 0 : _gridRefElement$clien.toString();
|
51
|
+
}
|
49
52
|
};
|
50
53
|
useResizeObserver(gridRef, handleVirtualGridResize);
|
51
54
|
useEffect(function () {
|
52
|
-
handleResize();
|
55
|
+
handleResize === null || handleResize === void 0 || handleResize();
|
53
56
|
}, [handleResize]);
|
54
57
|
var rowHeight = rowSize && rowSizeMap[rowSize] || defaultRowHeight;
|
55
|
-
|
56
|
-
listRef.current
|
57
|
-
|
58
|
+
useEffect(function () {
|
59
|
+
if (listRef && listRef.current) {
|
60
|
+
listRef.current.resetAfterIndex(0);
|
61
|
+
}
|
62
|
+
}, [listRef]);
|
58
63
|
var visibleRows = DatagridPagination && page || rows;
|
59
|
-
var testRef = useRef();
|
64
|
+
var testRef = useRef(null);
|
60
65
|
|
61
66
|
// Sync the scrollLeft position of the virtual body to the table header
|
62
67
|
useEffect(function () {
|
63
68
|
function handleScroll(event) {
|
69
|
+
var _document;
|
64
70
|
var virtualBody = event.target;
|
65
|
-
document.querySelector("#".concat(tableId, " .").concat(blockClass, "__head-wrap"))
|
71
|
+
var headWrapEl = (_document = document) === null || _document === void 0 ? void 0 : _document.querySelector("#".concat(tableId, " .").concat(blockClass, "__head-wrap"));
|
72
|
+
if (headWrapEl) {
|
73
|
+
headWrapEl.scrollLeft = virtualBody === null || virtualBody === void 0 ? void 0 : virtualBody.scrollLeft;
|
74
|
+
}
|
66
75
|
var spacerColumn = document.querySelector("#".concat(tableId, " .").concat(blockClass, "__head-wrap thead th:last-child"));
|
67
|
-
|
76
|
+
if (spacerColumn) {
|
77
|
+
spacerColumn.style.width = px(32 + (virtualBody.offsetWidth - virtualBody.clientWidth)); // scrollbar width to header column to fix header alignment
|
78
|
+
}
|
68
79
|
}
|
69
|
-
var testRefValue = testRef.current;
|
70
|
-
testRefValue.addEventListener('scroll', handleScroll);
|
80
|
+
var testRefValue = testRef === null || testRef === void 0 ? void 0 : testRef.current;
|
81
|
+
testRefValue === null || testRefValue === void 0 || testRefValue.addEventListener('scroll', handleScroll);
|
71
82
|
return function () {
|
72
|
-
testRefValue.removeEventListener('scroll', handleScroll);
|
83
|
+
testRefValue === null || testRefValue === void 0 || testRefValue.removeEventListener('scroll', handleScroll);
|
73
84
|
};
|
74
85
|
});
|
75
86
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
76
87
|
className: "".concat(blockClass, "__head-wrap"),
|
77
88
|
style: {
|
78
|
-
width: (_gridRef$current = gridRef.current) === null || _gridRef$current === void 0 ? void 0 : _gridRef$current.clientWidth,
|
89
|
+
width: gridRef === null || gridRef === void 0 || (_gridRef$current = gridRef.current) === null || _gridRef$current === void 0 ? void 0 : _gridRef$current.clientWidth,
|
79
90
|
overflow: 'hidden'
|
80
91
|
}
|
81
92
|
}, /*#__PURE__*/React__default.createElement(DatagridHead, datagridState)), /*#__PURE__*/React__default.createElement(TableBody, _extends({}, getTableBodyProps({
|
@@ -86,7 +97,8 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
|
|
86
97
|
height: virtualHeight || tableHeight,
|
87
98
|
itemCount: visibleRows.length,
|
88
99
|
itemSize: function itemSize(index) {
|
89
|
-
|
100
|
+
var _visibleRows$index;
|
101
|
+
return (_visibleRows$index = visibleRows[index]) !== null && _visibleRows$index !== void 0 && _visibleRows$index.isExpanded ? (visibleRows[index].expandedContentHeight || 0) + rowHeight : rowHeight;
|
90
102
|
},
|
91
103
|
estimatedItemSize: rowHeight,
|
92
104
|
onScroll: onScroll,
|
@@ -98,9 +110,10 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
|
|
98
110
|
ref: listRef,
|
99
111
|
className: "".concat(blockClass, "__virtual-scrollbar"),
|
100
112
|
style: {
|
101
|
-
width: (_gridRef$current2 = gridRef.current) === null || _gridRef$current2 === void 0 ? void 0 : _gridRef$current2.clientWidth
|
113
|
+
width: gridRef === null || gridRef === void 0 || (_gridRef$current2 = gridRef.current) === null || _gridRef$current2 === void 0 ? void 0 : _gridRef$current2.clientWidth
|
102
114
|
}
|
103
115
|
}, function (_ref) {
|
116
|
+
var _row$RowRenderer;
|
104
117
|
var index = _ref.index,
|
105
118
|
style = _ref.style;
|
106
119
|
var row = visibleRows[index];
|
@@ -109,12 +122,11 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
|
|
109
122
|
key = _row$getRowProps.key;
|
110
123
|
return /*#__PURE__*/React__default.createElement("div", {
|
111
124
|
style: _objectSpread2({}, style)
|
112
|
-
}, row.RowRenderer(_objectSpread2(_objectSpread2({}, datagridState), {}, {
|
125
|
+
}, row === null || row === void 0 || (_row$RowRenderer = row.RowRenderer) === null || _row$RowRenderer === void 0 ? void 0 : _row$RowRenderer.call(row, _objectSpread2(_objectSpread2({}, datagridState), {}, {
|
113
126
|
row: row,
|
114
127
|
key: key
|
115
128
|
})));
|
116
129
|
})));
|
117
130
|
};
|
118
|
-
var DatagridVirtualBody$1 = DatagridVirtualBody;
|
119
131
|
|
120
|
-
export { DatagridVirtualBody
|
132
|
+
export { DatagridVirtualBody as default };
|
@@ -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;
|
@@ -44,7 +44,7 @@ var DraggableElement = function DraggableElement(_ref) {
|
|
44
44
|
size: 16
|
45
45
|
}))), children);
|
46
46
|
var style = {
|
47
|
-
transform: !disabled ? CSS.Transform.toString(transform) :
|
47
|
+
transform: !disabled ? CSS.Transform.toString(transform) : undefined,
|
48
48
|
transition: transition
|
49
49
|
};
|
50
50
|
return /*#__PURE__*/React__default.createElement("li", _extends({
|
@@ -53,7 +53,6 @@ var DraggableElement = function DraggableElement(_ref) {
|
|
53
53
|
ref: setNodeRef,
|
54
54
|
style: style
|
55
55
|
}, attributes, listeners, {
|
56
|
-
disabled: disabled,
|
57
56
|
"aria-selected": selected,
|
58
57
|
role: "option"
|
59
58
|
}), /*#__PURE__*/React__default.createElement("span", {
|
@@ -71,6 +70,5 @@ DraggableElement.propTypes = {
|
|
71
70
|
isSticky: PropTypes.bool,
|
72
71
|
selected: PropTypes.bool
|
73
72
|
};
|
74
|
-
var DraggableElement$1 = DraggableElement;
|
75
73
|
|
76
|
-
export { DraggableElement
|
74
|
+
export { DraggableElement as default };
|
@@ -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>;
|
@@ -283,7 +283,7 @@ FilterPanel.propTypes = {
|
|
283
283
|
searchLabelText: PropTypes.string,
|
284
284
|
searchPlaceholder: PropTypes.string,
|
285
285
|
secondaryActionLabel: PropTypes.string,
|
286
|
-
setAllFilters: PropTypes.func
|
286
|
+
setAllFilters: PropTypes.func,
|
287
287
|
showFilterSearch: PropTypes.bool,
|
288
288
|
title: PropTypes.string,
|
289
289
|
updateMethod: PropTypes.oneOf([BATCH, 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 {};
|
@@ -0,0 +1,208 @@
|
|
1
|
+
/// <reference path="../../../../src/custom-typings/index.d.ts" />
|
2
|
+
import { MultiSelectProps } from '@carbon/react/lib/components/MultiSelect/MultiSelect';
|
3
|
+
import { FormGroupProps } from '@carbon/react/lib/components/FormGroup/FormGroup';
|
4
|
+
import { RadioButtonProps } from '@carbon/react/lib/components/RadioButton/RadioButton';
|
5
|
+
import { RadioButtonGroupProps } from '@carbon/react/lib/components/RadioButtonGroup/RadioButtonGroup';
|
6
|
+
import { CheckboxProps } from '@carbon/react/lib/components/Checkbox';
|
7
|
+
import { NumberInputProps } from '@carbon/react/lib/components/NumberInput/NumberInput';
|
8
|
+
import { CSSProperties, JSXElementConstructor, MutableRefObject, ReactNode, TouchEventHandler } from 'react';
|
9
|
+
import { Cell, ColumnInstance, FilterValue, Filters, HeaderGroup, Row, TableCommonProps, TableDispatch, TableInstance, TableToggleAllRowsSelectedProps, UseExpandedRowProps, UseFiltersInstanceProps, UsePaginationInstanceProps, UseResizeColumnsColumnProps, UseResizeColumnsState, UseRowSelectInstanceProps, UseRowSelectRowProps, UseRowSelectState, UseSortByColumnProps, UseTableHooks } from 'react-table';
|
10
|
+
import { CarbonIconType } from '@carbon/react/icons';
|
11
|
+
import { type ButtonProps } from '@carbon/react';
|
12
|
+
import { TableBatchActionsProps } from '@carbon/react/lib/components/DataTable/TableBatchActions';
|
13
|
+
export type Size = 'xs' | 'sm' | 'md' | 'lg';
|
14
|
+
export interface ResizerProps {
|
15
|
+
draggable?: boolean;
|
16
|
+
onMouseDown?: (evt: any) => void;
|
17
|
+
onTouchStart?: TouchEventHandler<HTMLElement>;
|
18
|
+
role?: string;
|
19
|
+
style?: CSSProperties;
|
20
|
+
}
|
21
|
+
export type DataGridFilter = ({
|
22
|
+
column?: string;
|
23
|
+
} & {
|
24
|
+
type: 'date';
|
25
|
+
props: {
|
26
|
+
DatePicker?: any;
|
27
|
+
DatePickerInput?: any;
|
28
|
+
};
|
29
|
+
}) | {
|
30
|
+
type: 'number';
|
31
|
+
props: {
|
32
|
+
NumberInput?: NumberInputProps;
|
33
|
+
};
|
34
|
+
} | {
|
35
|
+
type: 'checkbox';
|
36
|
+
props: {
|
37
|
+
FormGroup?: FormGroupProps;
|
38
|
+
Checkbox?: CheckboxProps[];
|
39
|
+
};
|
40
|
+
} | {
|
41
|
+
type: 'radio';
|
42
|
+
props: {
|
43
|
+
FormGroup?: FormGroupProps;
|
44
|
+
RadioButton?: RadioButtonProps[];
|
45
|
+
RadioButtonGroup?: RadioButtonGroupProps;
|
46
|
+
};
|
47
|
+
} | {
|
48
|
+
type: 'multiSelect';
|
49
|
+
props: {
|
50
|
+
MultiSelect?: MultiSelectProps<any>;
|
51
|
+
};
|
52
|
+
};
|
53
|
+
export interface ReactTableFiltersState {
|
54
|
+
id: string;
|
55
|
+
type: string;
|
56
|
+
value: string;
|
57
|
+
}
|
58
|
+
interface Labels {
|
59
|
+
allPageRows?: object;
|
60
|
+
allRows?: object;
|
61
|
+
}
|
62
|
+
interface Section {
|
63
|
+
categoryTitle?: string;
|
64
|
+
filters?: DataGridFilter[];
|
65
|
+
}
|
66
|
+
export interface FilterFlyoutProps {
|
67
|
+
data?: any;
|
68
|
+
filters?: DataGridFilter[];
|
69
|
+
flyoutIconDescription?: string;
|
70
|
+
onFlyoutClose?: () => void;
|
71
|
+
onFlyoutOpen?: () => void;
|
72
|
+
panelIconDescription?: string;
|
73
|
+
primaryActionLabel?: string;
|
74
|
+
reactTableFiltersState?: ReactTableFiltersState[];
|
75
|
+
renderLabel?: () => void;
|
76
|
+
secondaryActionLabel?: string;
|
77
|
+
updateMethod?: string;
|
78
|
+
variation?: string;
|
79
|
+
panelTitle?: string;
|
80
|
+
sections?: Section[];
|
81
|
+
autoHideFilters: boolean;
|
82
|
+
}
|
83
|
+
export interface DataGridToggleAllRowsProps extends TableToggleAllRowsSelectedProps {
|
84
|
+
disabled?: boolean;
|
85
|
+
}
|
86
|
+
export interface DatagridTableHooks<T extends object = any> extends UseTableHooks<T> {
|
87
|
+
}
|
88
|
+
export interface DatagridColumn<T extends object = any> extends ColumnInstance<T> {
|
89
|
+
sticky?: 'left' | 'right';
|
90
|
+
className?: string;
|
91
|
+
}
|
92
|
+
export interface DataGridCell<T extends object = any> extends Omit<Cell<T>, 'column'> {
|
93
|
+
column: DatagridColumn<any>;
|
94
|
+
}
|
95
|
+
export interface DatagridRow<T extends object = any> extends Omit<Row<T>, 'cells'>, UseExpandedRowProps<T>, UseRowSelectRowProps<T> {
|
96
|
+
expandedContentHeight?: number;
|
97
|
+
RowRenderer?: (state?: DataGridState) => ReactNode;
|
98
|
+
RowExpansionRenderer?: (state?: DataGridState) => void;
|
99
|
+
cells: Array<DataGridCell>;
|
100
|
+
isSkeleton?: boolean;
|
101
|
+
}
|
102
|
+
export interface DataGridHeader<T extends object = any> extends ColumnInstance, UseResizeColumnsColumnProps<T>, UseSortByColumnProps<T> {
|
103
|
+
className(className: any, arg1: {
|
104
|
+
[x: string]: any;
|
105
|
+
}): unknown;
|
106
|
+
isAction?: boolean;
|
107
|
+
slug?: any;
|
108
|
+
}
|
109
|
+
export interface DataGridHeaderGroup<T extends object = any> extends HeaderGroup<T>, UseResizeColumnsColumnProps<T> {
|
110
|
+
}
|
111
|
+
export interface TableProps {
|
112
|
+
className?: string;
|
113
|
+
role?: string;
|
114
|
+
style?: CSSStyleDeclaration;
|
115
|
+
}
|
116
|
+
interface DataGridTableState extends UseResizeColumnsState<any>, UseRowSelectState<any> {
|
117
|
+
filters: Filters<DataGridFilter>;
|
118
|
+
}
|
119
|
+
export interface DataGridTableInstance<T extends object = any> extends TableInstance<T> {
|
120
|
+
}
|
121
|
+
export interface DataGridState<T extends object = any> extends TableCommonProps, UsePaginationInstanceProps<T>, Omit<TableInstance<T>, 'state' | 'headers' | 'rows' | 'columns'>, Omit<UseFiltersInstanceProps<T>, 'rows'>, UseRowSelectInstanceProps<T>, Pick<UseRowSelectInstanceProps<T>, 'toggleAllRowsSelected'> {
|
122
|
+
withVirtualScroll?: boolean;
|
123
|
+
DatagridPagination?: JSXElementConstructor<any>;
|
124
|
+
isFetching?: boolean;
|
125
|
+
tableId?: string;
|
126
|
+
filterProps?: FilterFlyoutProps;
|
127
|
+
state: DataGridTableState;
|
128
|
+
getFilterFlyoutProps?: () => FilterFlyoutProps;
|
129
|
+
DatagridActions?: JSXElementConstructor<any>;
|
130
|
+
CustomizeColumnsTearsheet?: JSXElementConstructor<any>;
|
131
|
+
fullHeightDatagrid?: boolean;
|
132
|
+
variableRowHeight?: boolean;
|
133
|
+
useDenseHeader?: boolean;
|
134
|
+
withInlineEdit?: boolean;
|
135
|
+
verticalAlign?: string;
|
136
|
+
gridTitle?: ReactNode;
|
137
|
+
gridDescription?: ReactNode;
|
138
|
+
gridRef?: MutableRefObject<HTMLDivElement>;
|
139
|
+
DatagridBatchActions?: (args: any) => ReactNode;
|
140
|
+
batchActions?: boolean;
|
141
|
+
row: DatagridRow;
|
142
|
+
rows: Array<DatagridRow<any>>;
|
143
|
+
columns: Array<DatagridColumn>;
|
144
|
+
key?: any;
|
145
|
+
rowSize?: Size;
|
146
|
+
headers?: Array<DataGridHeader<T>>;
|
147
|
+
headRef?: MutableRefObject<HTMLDivElement>;
|
148
|
+
HeaderRow?: (state?: object, ref?: MutableRefObject<HTMLDivElement>, group?: HeaderGroup<any>) => ReactNode;
|
149
|
+
withStickyColumn?: boolean;
|
150
|
+
emptyStateTitle?: string | ReactNode;
|
151
|
+
emptyStateDescription?: string;
|
152
|
+
emptyStateSize?: 'lg' | 'sm';
|
153
|
+
emptyStateType?: string;
|
154
|
+
illustrationTheme?: 'light' | 'dark';
|
155
|
+
emptyStateAction: {
|
156
|
+
kind?: 'primary' | 'secondary' | 'tertiary';
|
157
|
+
renderIcon?: CarbonIconType;
|
158
|
+
onClick?: ButtonProps<any>['onClick'];
|
159
|
+
text?: string;
|
160
|
+
};
|
161
|
+
emptyStateLink?: {
|
162
|
+
text?: string | ReactNode;
|
163
|
+
href?: string;
|
164
|
+
};
|
165
|
+
isTableSortable?: boolean;
|
166
|
+
resizerAriaLabel?: string;
|
167
|
+
onColResizeEnd?: () => void;
|
168
|
+
withNestedRows?: boolean;
|
169
|
+
withExpandedRows?: boolean;
|
170
|
+
withMouseHover?: boolean;
|
171
|
+
setMouseOverRowIndex?: (arg: any) => void;
|
172
|
+
hideSelectAll?: boolean;
|
173
|
+
radio?: boolean;
|
174
|
+
onAllRowSelect: (rows: DatagridRow[], evt: any) => void;
|
175
|
+
selectAllToggle?: {
|
176
|
+
onSelectAllRows?: (args: any) => void;
|
177
|
+
labels?: Labels;
|
178
|
+
};
|
179
|
+
allPageRowsLabel?: string | object;
|
180
|
+
allRowsLabel: string | object;
|
181
|
+
onSelectAllRows?: (val?: boolean) => void;
|
182
|
+
toolbarBatchActions?: ButtonProps<any>[];
|
183
|
+
setGlobalFilter?: (filterValue: FilterValue) => void;
|
184
|
+
batchActionMenuButtonLabel?: string;
|
185
|
+
translateWithIdBatchActions?: TableBatchActionsProps['translateWithId'];
|
186
|
+
onScroll?: (evt?: any) => void;
|
187
|
+
innerListRef?: MutableRefObject<HTMLDivElement>;
|
188
|
+
tableHeight?: number;
|
189
|
+
virtualHeight?: number;
|
190
|
+
listRef?: MutableRefObject<any>;
|
191
|
+
handleResize?: () => void;
|
192
|
+
onVirtualScroll?: (evt?: boolean) => void;
|
193
|
+
}
|
194
|
+
export interface ResizeHeaderProps {
|
195
|
+
resizerProps?: ResizerProps;
|
196
|
+
header: DataGridHeader;
|
197
|
+
originalCol?: DatagridColumn;
|
198
|
+
handleOnMouseDownResize?: (evt?: any, props?: ResizerProps) => void;
|
199
|
+
columnWidths?: any[];
|
200
|
+
datagridState: DataGridState;
|
201
|
+
incrementAmount: number;
|
202
|
+
minWidth?: number;
|
203
|
+
dispatch?: TableDispatch<any>;
|
204
|
+
onColResizeEnd?: () => void;
|
205
|
+
resizerAriaLabel?: string;
|
206
|
+
isFetching?: boolean;
|
207
|
+
}
|
208
|
+
export {};
|
@@ -1,2 +1,2 @@
|
|
1
1
|
export default useDatagrid;
|
2
|
-
declare function useDatagrid(params: any, ...plugins: any[]): any
|
2
|
+
declare function useDatagrid(params: any, ...plugins: any[]): import("react-table").TableInstance<any>;
|
@@ -119,7 +119,11 @@ var SelectRow = function SelectRow(datagridState) {
|
|
119
119
|
var cellProps = cell.getCellProps();
|
120
120
|
var isFirstColumnStickyLeft = ((_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.sticky) === 'left' && withStickyColumn;
|
121
121
|
var rowId = "".concat(tableId, "-").concat(row.id, "-").concat(row.index);
|
122
|
-
|
122
|
+
var key = cellProps.key,
|
123
|
+
_cellProps = cellProps._cellProps;
|
124
|
+
return /*#__PURE__*/React__default.createElement(TableSelectRow, _extends({
|
125
|
+
key: key
|
126
|
+
}, _cellProps, selectProps, {
|
123
127
|
radio: radio,
|
124
128
|
onSelect: onSelectHandler,
|
125
129
|
id: rowId,
|
@@ -1,3 +1,22 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2022, 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
|
+
*/
|
3
7
|
import React from 'react';
|
8
|
+
export interface Filter {
|
9
|
+
key: string;
|
10
|
+
value: string;
|
11
|
+
}
|
12
|
+
interface FilterSummaryProps {
|
13
|
+
className?: string;
|
14
|
+
clearButtonInline?: boolean;
|
15
|
+
clearFilters: () => void;
|
16
|
+
clearFiltersText?: string;
|
17
|
+
filters: Filter[];
|
18
|
+
overflowType?: 'default' | 'tag';
|
19
|
+
renderLabel?: (key: any, value: any) => void;
|
20
|
+
}
|
21
|
+
declare const FilterSummary: React.ForwardRefExoticComponent<FilterSummaryProps & React.RefAttributes<HTMLDivElement>>;
|
22
|
+
export default FilterSummary;
|
@@ -32,8 +32,7 @@ var FilterSummary = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
32
32
|
clearFiltersText = _ref$clearFiltersText === void 0 ? 'Clear filters' : _ref$clearFiltersText,
|
33
33
|
clearFilters = _ref.clearFilters,
|
34
34
|
filters = _ref.filters,
|
35
|
-
|
36
|
-
renderLabel = _ref$renderLabel === void 0 ? null : _ref$renderLabel,
|
35
|
+
renderLabel = _ref.renderLabel,
|
37
36
|
_ref$overflowType = _ref.overflowType,
|
38
37
|
overflowType = _ref$overflowType === void 0 ? 'default' : _ref$overflowType,
|
39
38
|
_ref$clearButtonInlin = _ref.clearButtonInline,
|
@@ -50,9 +49,9 @@ var FilterSummary = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
50
49
|
label: (_renderLabel = renderLabel === null || renderLabel === void 0 ? void 0 : renderLabel(key, value)) !== null && _renderLabel !== void 0 ? _renderLabel : "".concat(key, ": ").concat(value)
|
51
50
|
});
|
52
51
|
});
|
53
|
-
var filterSummaryClearButton = useRef();
|
54
|
-
var viewAllButtonRef = useRef();
|
55
|
-
var filterSummaryRef = useRef();
|
52
|
+
var filterSummaryClearButton = useRef(null);
|
53
|
+
var viewAllButtonRef = useRef(null);
|
54
|
+
var filterSummaryRef = useRef(null);
|
56
55
|
var localRef = filterSummaryRef || ref;
|
57
56
|
var _useState = useState(0),
|
58
57
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -64,7 +63,7 @@ var FilterSummary = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
64
63
|
setMultiline = _useState4[1];
|
65
64
|
var previousState = usePreviousValue({
|
66
65
|
multiline: multiline
|
67
|
-
});
|
66
|
+
}) || {};
|
68
67
|
var handleViewAll = function handleViewAll() {
|
69
68
|
if (overflowCount === 0) {
|
70
69
|
setMultiline(false);
|
@@ -75,7 +74,7 @@ var FilterSummary = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
75
74
|
});
|
76
75
|
};
|
77
76
|
var viewAllWidth = typeof (viewAllButtonRef === null || viewAllButtonRef === void 0 || (_viewAllButtonRef$cur = viewAllButtonRef.current) === null || _viewAllButtonRef$cur === void 0 ? void 0 : _viewAllButtonRef$cur.offsetWidth) === 'undefined' ? 0 : overflowCount > 0 ? 48 : 0;
|
78
|
-
var measurementOffset = (filterSummaryClearButton === null || filterSummaryClearButton === void 0 || (_filterSummaryClearBu = filterSummaryClearButton.current) === null || _filterSummaryClearBu === void 0 ? void 0 : _filterSummaryClearBu.offsetWidth) + viewAllWidth;
|
77
|
+
var measurementOffset = ((filterSummaryClearButton === null || filterSummaryClearButton === void 0 || (_filterSummaryClearBu = filterSummaryClearButton.current) === null || _filterSummaryClearBu === void 0 ? void 0 : _filterSummaryClearBu.offsetWidth) || 0) + viewAllWidth;
|
79
78
|
var renderTagSet = function renderTagSet(type) {
|
80
79
|
return /*#__PURE__*/React__default.createElement(motion.div, {
|
81
80
|
key: type,
|
@@ -106,15 +105,15 @@ var FilterSummary = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
106
105
|
containingElementRef: localRef,
|
107
106
|
measurementOffset: measurementOffset,
|
108
107
|
onOverflowTagChange: function onOverflowTagChange(overflowTags) {
|
109
|
-
return setOverflowCount(overflowTags.length);
|
108
|
+
return setOverflowCount(overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.length);
|
110
109
|
},
|
111
110
|
multiline: multiline
|
112
111
|
}));
|
113
112
|
};
|
114
113
|
useWindowResize(function () {
|
115
114
|
var handleFilterSummaryResize = function handleFilterSummaryResize() {
|
116
|
-
var _localRef$current;
|
117
|
-
if (multiline && (localRef === null || localRef === void 0 || (_localRef$
|
115
|
+
var _localRef$current, _localRef$current2;
|
116
|
+
if (multiline && localRef !== null && localRef !== void 0 && (_localRef$current = localRef.current) !== null && _localRef$current !== void 0 && _localRef$current.offsetHeight && (localRef === null || localRef === void 0 || (_localRef$current2 = localRef.current) === null || _localRef$current2 === void 0 ? void 0 : _localRef$current2.offsetHeight) <= 50) {
|
118
117
|
setMultiline(false);
|
119
118
|
}
|
120
119
|
};
|
@@ -127,7 +126,6 @@ var FilterSummary = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
127
126
|
ref: localRef,
|
128
127
|
className: cx([blockClass, className], _defineProperty({}, "".concat(blockClass, "__expanded"), multiline))
|
129
128
|
}), /*#__PURE__*/React__default.createElement(AnimatePresence, {
|
130
|
-
mode: "wait",
|
131
129
|
exitBeforeEnter: true
|
132
130
|
}, !multiline && renderTagSet('single'), multiline && renderTagSet('multiline')), /*#__PURE__*/React__default.createElement(Button, {
|
133
131
|
kind: "ghost",
|
@@ -156,6 +154,7 @@ FilterSummary.propTypes = {
|
|
156
154
|
clearButtonInline: PropTypes.bool,
|
157
155
|
clearFilters: PropTypes.func.isRequired,
|
158
156
|
clearFiltersText: PropTypes.string,
|
157
|
+
/**@ts-ignore */
|
159
158
|
filters: PropTypes.arrayOf(PropTypes.object).isRequired,
|
160
159
|
overflowType: PropTypes.oneOf(['default', 'tag']),
|
161
160
|
renderLabel: PropTypes.func
|
@@ -60,7 +60,7 @@ var WebTerminal = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
60
60
|
matches: true
|
61
61
|
},
|
62
62
|
prefersReducedMotion = _ref2.matches;
|
63
|
-
var webTerminalAnimationName = "".concat(open ? 'web-terminal-entrance' : 'web-terminal-exit', " ").concat(moderate02);
|
63
|
+
var webTerminalAnimationName = "".concat(open ? 'web-terminal-entrance' : 'web-terminal-exit forwards', " ").concat(moderate02);
|
64
64
|
var showDocumentationLinks = useMemo(function () {
|
65
65
|
return documentationLinks.length > 0;
|
66
66
|
}, [documentationLinks]);
|
@@ -1 +1 @@
|
|
1
|
-
export function usePreviousValue(value: object): undefined;
|
1
|
+
export function usePreviousValue(value: object): T | undefined;
|
@@ -8,8 +8,9 @@
|
|
8
8
|
import { useRef, useEffect } from 'react';
|
9
9
|
|
10
10
|
/**
|
11
|
-
* Returns the previous state
|
12
|
-
* @param {object} value
|
11
|
+
* Returns the previous state value included in the param
|
12
|
+
* @param {object} value - The current value of any type.
|
13
|
+
* @returns {T | undefined} - The previous value of the same type, or undefined if there is none
|
13
14
|
*/
|
14
15
|
var usePreviousValue = function usePreviousValue(value) {
|
15
16
|
var ref = useRef();
|
@@ -1,9 +1,9 @@
|
|
1
1
|
export function useRetrieveStepData({ stepsContext, stepNumber, introStep, invalid, shouldIncludeStep, secondaryLabel, title, }: {
|
2
2
|
stepsContext: object;
|
3
3
|
stepNumber: number;
|
4
|
-
introStep: boolean;
|
5
|
-
invalid: boolean;
|
6
|
-
shouldIncludeStep: boolean;
|
7
|
-
secondaryLabel: string;
|
8
|
-
title: React.ReactNode;
|
4
|
+
introStep: boolean | undefined;
|
5
|
+
invalid: boolean | undefined;
|
6
|
+
shouldIncludeStep: boolean | undefined;
|
7
|
+
secondaryLabel: string | undefined;
|
8
|
+
title: string | React.ReactNode;
|
9
9
|
}): void;
|
@@ -14,11 +14,11 @@ import { useEffect } from 'react';
|
|
14
14
|
* @param {object} useResetCreateComponent
|
15
15
|
* @param {object} useResetCreateComponent.stepsContext
|
16
16
|
* @param {number} useResetCreateComponent.stepNumber
|
17
|
-
* @param {boolean} useResetCreateComponent.introStep
|
18
|
-
* @param {boolean} useResetCreateComponent.invalid
|
19
|
-
* @param {boolean} useResetCreateComponent.shouldIncludeStep
|
20
|
-
* @param {string} useResetCreateComponent.secondaryLabel
|
21
|
-
* @param {React.ReactNode} useResetCreateComponent.title
|
17
|
+
* @param {boolean | undefined} useResetCreateComponent.introStep
|
18
|
+
* @param {boolean | undefined} useResetCreateComponent.invalid
|
19
|
+
* @param {boolean | undefined} useResetCreateComponent.shouldIncludeStep
|
20
|
+
* @param {string | undefined } useResetCreateComponent.secondaryLabel
|
21
|
+
* @param {string | React.ReactNode} useResetCreateComponent.title
|
22
22
|
*/
|
23
23
|
var useRetrieveStepData = function useRetrieveStepData(_ref) {
|
24
24
|
var stepsContext = _ref.stepsContext,
|
@@ -5,7 +5,8 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
import React, { ReactNode } from 'react';
|
8
|
-
|
8
|
+
import { StepsContextType } from '../CreateTearsheet/CreateTearsheet';
|
9
|
+
export declare const StepsContext: React.Context<StepsContextType | null>;
|
9
10
|
export declare const StepNumberContext: React.Context<number>;
|
10
11
|
interface HeaderBreadcrumbs {
|
11
12
|
/** breadcrumb item key */
|