@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
@@ -0,0 +1,210 @@
|
|
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
|
+
fetchMoreData?: () => void;
|
194
|
+
loadMoreThreshold?: number;
|
195
|
+
}
|
196
|
+
export interface ResizeHeaderProps {
|
197
|
+
resizerProps?: ResizerProps;
|
198
|
+
header: DataGridHeader;
|
199
|
+
originalCol?: DatagridColumn;
|
200
|
+
handleOnMouseDownResize?: (evt?: any, props?: ResizerProps) => void;
|
201
|
+
columnWidths?: any[];
|
202
|
+
datagridState: DataGridState;
|
203
|
+
incrementAmount: number;
|
204
|
+
minWidth?: number;
|
205
|
+
dispatch?: TableDispatch<any>;
|
206
|
+
onColResizeEnd?: () => void;
|
207
|
+
resizerAriaLabel?: string;
|
208
|
+
isFetching?: boolean;
|
209
|
+
}
|
210
|
+
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>;
|
@@ -38,7 +38,7 @@ var useFocusRowExpander = function useFocusRowExpander(_ref) {
|
|
38
38
|
});
|
39
39
|
if (activeRow.length) {
|
40
40
|
var rowExpander = activeRow[0].querySelector(".".concat(blockClass, "__row-expander"));
|
41
|
-
rowExpander.focus();
|
41
|
+
rowExpander === null || rowExpander === void 0 || rowExpander.focus();
|
42
42
|
}
|
43
43
|
}, [instance === null || instance === void 0 ? void 0 : instance.tableId, instance === null || instance === void 0 ? void 0 : instance.expandedRows, lastExpandedRowIndex, blockClass, activeElement]);
|
44
44
|
};
|
@@ -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 { Hooks } from 'react-table';
|
8
|
+
declare const useInfiniteScroll: (hooks: Hooks) => void;
|
1
9
|
export default useInfiniteScroll;
|
2
|
-
declare function useInfiniteScroll(hooks: any): void;
|
@@ -23,12 +23,13 @@ var useInfiniteScroll = function useInfiniteScroll(hooks) {
|
|
23
23
|
useResizeTable["default"](hooks);
|
24
24
|
var useInstance = function useInstance(instance) {
|
25
25
|
var _tableElement;
|
26
|
-
var
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
var _ref = instance,
|
27
|
+
isFetching = _ref.isFetching,
|
28
|
+
tableHeight = _ref.tableHeight,
|
29
|
+
innerListRef = _ref.innerListRef,
|
30
|
+
fetchMoreData = _ref.fetchMoreData,
|
31
|
+
tableId = _ref.tableId,
|
32
|
+
loadMoreThreshold = _ref.loadMoreThreshold;
|
32
33
|
var tableElement;
|
33
34
|
if (typeof document !== 'undefined') {
|
34
35
|
tableElement = document.querySelector("#".concat(tableId));
|
@@ -41,9 +42,9 @@ var useInfiniteScroll = function useInfiniteScroll(hooks) {
|
|
41
42
|
leading: true,
|
42
43
|
trailing: false
|
43
44
|
}), [fetchMoreData]);
|
44
|
-
var onScroll = function onScroll(
|
45
|
-
var scrollDirection =
|
46
|
-
scrollOffset =
|
45
|
+
var onScroll = function onScroll(_ref2) {
|
46
|
+
var scrollDirection = _ref2.scrollDirection,
|
47
|
+
scrollOffset = _ref2.scrollOffset;
|
47
48
|
if (innerListRef && innerListRef.current) {
|
48
49
|
if (!isFetching && scrollDirection === 'forward' && scrollOffset + totalTableHeight >= innerListRef.current.clientHeight - loadMoreThresholdValue) {
|
49
50
|
if (fetchMoreData) {
|
@@ -128,7 +128,11 @@ var SelectRow = function SelectRow(datagridState) {
|
|
128
128
|
var cellProps = cell.getCellProps();
|
129
129
|
var isFirstColumnStickyLeft = ((_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.sticky) === 'left' && withStickyColumn;
|
130
130
|
var rowId = "".concat(tableId, "-").concat(row.id, "-").concat(row.index);
|
131
|
-
|
131
|
+
var key = cellProps.key,
|
132
|
+
_cellProps = cellProps._cellProps;
|
133
|
+
return /*#__PURE__*/React__default["default"].createElement(react.TableSelectRow, _rollupPluginBabelHelpers["extends"]({
|
134
|
+
key: key
|
135
|
+
}, _cellProps, selectProps, {
|
132
136
|
radio: radio,
|
133
137
|
onSelect: onSelectHandler,
|
134
138
|
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;
|
@@ -42,8 +42,7 @@ var FilterSummary = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
42
42
|
clearFiltersText = _ref$clearFiltersText === void 0 ? 'Clear filters' : _ref$clearFiltersText,
|
43
43
|
clearFilters = _ref.clearFilters,
|
44
44
|
filters = _ref.filters,
|
45
|
-
|
46
|
-
renderLabel = _ref$renderLabel === void 0 ? null : _ref$renderLabel,
|
45
|
+
renderLabel = _ref.renderLabel,
|
47
46
|
_ref$overflowType = _ref.overflowType,
|
48
47
|
overflowType = _ref$overflowType === void 0 ? 'default' : _ref$overflowType,
|
49
48
|
_ref$clearButtonInlin = _ref.clearButtonInline,
|
@@ -60,9 +59,9 @@ var FilterSummary = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
60
59
|
label: (_renderLabel = renderLabel === null || renderLabel === void 0 ? void 0 : renderLabel(key, value)) !== null && _renderLabel !== void 0 ? _renderLabel : "".concat(key, ": ").concat(value)
|
61
60
|
});
|
62
61
|
});
|
63
|
-
var filterSummaryClearButton = React.useRef();
|
64
|
-
var viewAllButtonRef = React.useRef();
|
65
|
-
var filterSummaryRef = React.useRef();
|
62
|
+
var filterSummaryClearButton = React.useRef(null);
|
63
|
+
var viewAllButtonRef = React.useRef(null);
|
64
|
+
var filterSummaryRef = React.useRef(null);
|
66
65
|
var localRef = filterSummaryRef || ref;
|
67
66
|
var _useState = React.useState(0),
|
68
67
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
@@ -74,7 +73,7 @@ var FilterSummary = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
74
73
|
setMultiline = _useState4[1];
|
75
74
|
var previousState = usePreviousValue.usePreviousValue({
|
76
75
|
multiline: multiline
|
77
|
-
});
|
76
|
+
}) || {};
|
78
77
|
var handleViewAll = function handleViewAll() {
|
79
78
|
if (overflowCount === 0) {
|
80
79
|
setMultiline(false);
|
@@ -85,7 +84,7 @@ var FilterSummary = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
85
84
|
});
|
86
85
|
};
|
87
86
|
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;
|
88
|
-
var measurementOffset = (filterSummaryClearButton === null || filterSummaryClearButton === void 0 || (_filterSummaryClearBu = filterSummaryClearButton.current) === null || _filterSummaryClearBu === void 0 ? void 0 : _filterSummaryClearBu.offsetWidth) + viewAllWidth;
|
87
|
+
var measurementOffset = ((filterSummaryClearButton === null || filterSummaryClearButton === void 0 || (_filterSummaryClearBu = filterSummaryClearButton.current) === null || _filterSummaryClearBu === void 0 ? void 0 : _filterSummaryClearBu.offsetWidth) || 0) + viewAllWidth;
|
89
88
|
var renderTagSet = function renderTagSet(type) {
|
90
89
|
return /*#__PURE__*/React__default["default"].createElement(framerMotion.motion.div, {
|
91
90
|
key: type,
|
@@ -116,15 +115,15 @@ var FilterSummary = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
116
115
|
containingElementRef: localRef,
|
117
116
|
measurementOffset: measurementOffset,
|
118
117
|
onOverflowTagChange: function onOverflowTagChange(overflowTags) {
|
119
|
-
return setOverflowCount(overflowTags.length);
|
118
|
+
return setOverflowCount(overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.length);
|
120
119
|
},
|
121
120
|
multiline: multiline
|
122
121
|
}));
|
123
122
|
};
|
124
123
|
useWindowResize.useWindowResize(function () {
|
125
124
|
var handleFilterSummaryResize = function handleFilterSummaryResize() {
|
126
|
-
var _localRef$current;
|
127
|
-
if (multiline && (localRef === null || localRef === void 0 || (_localRef$
|
125
|
+
var _localRef$current, _localRef$current2;
|
126
|
+
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) {
|
128
127
|
setMultiline(false);
|
129
128
|
}
|
130
129
|
};
|
@@ -137,7 +136,6 @@ var FilterSummary = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
137
136
|
ref: localRef,
|
138
137
|
className: cx__default["default"]([blockClass, className], _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__expanded"), multiline))
|
139
138
|
}), /*#__PURE__*/React__default["default"].createElement(framerMotion.AnimatePresence, {
|
140
|
-
mode: "wait",
|
141
139
|
exitBeforeEnter: true
|
142
140
|
}, !multiline && renderTagSet('single'), multiline && renderTagSet('multiline')), /*#__PURE__*/React__default["default"].createElement(react.Button, {
|
143
141
|
kind: "ghost",
|
@@ -166,6 +164,7 @@ FilterSummary.propTypes = {
|
|
166
164
|
clearButtonInline: index["default"].bool,
|
167
165
|
clearFilters: index["default"].func.isRequired,
|
168
166
|
clearFiltersText: index["default"].string,
|
167
|
+
/**@ts-ignore */
|
169
168
|
filters: index["default"].arrayOf(index["default"].object).isRequired,
|
170
169
|
overflowType: index["default"].oneOf(['default', 'tag']),
|
171
170
|
renderLabel: index["default"].func
|
@@ -18,6 +18,7 @@ var icons = require('@carbon/react/icons');
|
|
18
18
|
var react = require('@carbon/react');
|
19
19
|
var devtools = require('../../global/js/utils/devtools.js');
|
20
20
|
var settings = require('../../settings.js');
|
21
|
+
var uuidv4 = require('../../global/js/utils/uuidv4.js');
|
21
22
|
var Carousel = require('../Carousel/Carousel.js');
|
22
23
|
|
23
24
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
@@ -85,8 +86,9 @@ exports.Guidebanner = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
85
86
|
return !prevState;
|
86
87
|
});
|
87
88
|
};
|
89
|
+
var carouselContentId = "".concat(uuidv4["default"](), "--carousel-content-id");
|
88
90
|
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
89
|
-
"aria-
|
91
|
+
"aria-owns": !isCollapsed ? carouselContentId : undefined,
|
90
92
|
className: cx__default["default"](blockClass, className, collapsible && "".concat(blockClass, "__collapsible"), isCollapsed && "".concat(blockClass, "__collapsible-collapsed"), withLeftGutter && "".concat(blockClass, "__with-left-gutter")),
|
91
93
|
ref: ref
|
92
94
|
}, devtools.getDevtoolsProps(componentName)), /*#__PURE__*/React__default["default"].createElement(icons.Idea, {
|
@@ -95,6 +97,7 @@ exports.Guidebanner = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
95
97
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
96
98
|
className: "".concat(blockClass, "__title")
|
97
99
|
}, title), /*#__PURE__*/React__default["default"].createElement(Carousel.Carousel, {
|
100
|
+
id: carouselContentId,
|
98
101
|
className: "".concat(blockClass, "__carousel")
|
99
102
|
// These colors are to match the Carousel's faded edges
|
100
103
|
// against the Guidebanner's gradient background.
|
@@ -117,7 +120,9 @@ exports.Guidebanner = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
117
120
|
size: "md",
|
118
121
|
className: "".concat(blockClass, "__toggle-button"),
|
119
122
|
onClick: handleClickToggle,
|
120
|
-
ref: toggleRef
|
123
|
+
ref: toggleRef,
|
124
|
+
"aria-controls": !isCollapsed ? carouselContentId : undefined,
|
125
|
+
"aria-expanded": !isCollapsed
|
121
126
|
}, isCollapsed ? expandButtonLabel : collapseButtonLabel), showNavigation && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("span", {
|
122
127
|
className: cx__default["default"]("".concat(blockClass, "__back-button"), [scrollPosition === 0 ? "".concat(blockClass, "__back-button--disabled") : null])
|
123
128
|
}, /*#__PURE__*/React__default["default"].createElement(react.IconButton, {
|
@@ -69,7 +69,7 @@ exports.WebTerminal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
69
69
|
matches: true
|
70
70
|
},
|
71
71
|
prefersReducedMotion = _ref2.matches;
|
72
|
-
var webTerminalAnimationName = "".concat(open ? 'web-terminal-entrance' : 'web-terminal-exit', " ").concat(carbonMotion.moderate02);
|
72
|
+
var webTerminalAnimationName = "".concat(open ? 'web-terminal-entrance' : 'web-terminal-exit forwards', " ").concat(carbonMotion.moderate02);
|
73
73
|
var showDocumentationLinks = React.useMemo(function () {
|
74
74
|
return documentationLinks.length > 0;
|
75
75
|
}, [documentationLinks]);
|
@@ -1 +1 @@
|
|
1
|
-
export function usePreviousValue(value: object): undefined;
|
1
|
+
export function usePreviousValue(value: object): T | undefined;
|
@@ -12,8 +12,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
12
12
|
var React = require('react');
|
13
13
|
|
14
14
|
/**
|
15
|
-
* Returns the previous state
|
16
|
-
* @param {object} value
|
15
|
+
* Returns the previous state value included in the param
|
16
|
+
* @param {object} value - The current value of any type.
|
17
|
+
* @returns {T | undefined} - The previous value of the same type, or undefined if there is none
|
17
18
|
*/
|
18
19
|
var usePreviousValue = function usePreviousValue(value) {
|
19
20
|
var ref = React.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;
|
@@ -18,11 +18,11 @@ var React = require('react');
|
|
18
18
|
* @param {object} useResetCreateComponent
|
19
19
|
* @param {object} useResetCreateComponent.stepsContext
|
20
20
|
* @param {number} useResetCreateComponent.stepNumber
|
21
|
-
* @param {boolean} useResetCreateComponent.introStep
|
22
|
-
* @param {boolean} useResetCreateComponent.invalid
|
23
|
-
* @param {boolean} useResetCreateComponent.shouldIncludeStep
|
24
|
-
* @param {string} useResetCreateComponent.secondaryLabel
|
25
|
-
* @param {React.ReactNode} useResetCreateComponent.title
|
21
|
+
* @param {boolean | undefined} useResetCreateComponent.introStep
|
22
|
+
* @param {boolean | undefined} useResetCreateComponent.invalid
|
23
|
+
* @param {boolean | undefined} useResetCreateComponent.shouldIncludeStep
|
24
|
+
* @param {string | undefined } useResetCreateComponent.secondaryLabel
|
25
|
+
* @param {string | React.ReactNode} useResetCreateComponent.title
|
26
26
|
*/
|
27
27
|
var useRetrieveStepData = function useRetrieveStepData(_ref) {
|
28
28
|
var stepsContext = _ref.stepsContext,
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@carbon/ibm-products",
|
3
3
|
"description": "Carbon for IBM Products",
|
4
|
-
"version": "2.
|
4
|
+
"version": "2.42.0",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -71,6 +71,7 @@
|
|
71
71
|
"@rollup/plugin-commonjs": "^25.0.0",
|
72
72
|
"@rollup/plugin-node-resolve": "^15.0.0",
|
73
73
|
"@rollup/plugin-typescript": "^11.0.0",
|
74
|
+
"@types/react-table": "^7.7.20",
|
74
75
|
"babel-plugin-dev-expression": "^0.2.3",
|
75
76
|
"babel-preset-ibm-cloud-cognitive": "^0.14.40",
|
76
77
|
"chalk": "^4.1.2",
|
@@ -81,7 +82,7 @@
|
|
81
82
|
"fs-extra": "^11.2.0",
|
82
83
|
"glob": "^10.3.10",
|
83
84
|
"jest": "^29.7.0",
|
84
|
-
"jest-config-ibm-cloud-cognitive": "^1.
|
85
|
+
"jest-config-ibm-cloud-cognitive": "^1.2.0",
|
85
86
|
"jest-environment-jsdom": "^29.7.0",
|
86
87
|
"namor": "^1.1.2",
|
87
88
|
"npm-check-updates": "^16.14.12",
|
@@ -96,7 +97,7 @@
|
|
96
97
|
"dependencies": {
|
97
98
|
"@babel/runtime": "^7.23.9",
|
98
99
|
"@carbon/feature-flags": "^0.20.0",
|
99
|
-
"@carbon/ibm-products-styles": "^2.38.
|
100
|
+
"@carbon/ibm-products-styles": "^2.38.1",
|
100
101
|
"@carbon/telemetry": "^0.1.0",
|
101
102
|
"@dnd-kit/core": "^6.0.8",
|
102
103
|
"@dnd-kit/modifiers": "^7.0.0",
|
@@ -120,5 +121,5 @@
|
|
120
121
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0",
|
121
122
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
|
122
123
|
},
|
123
|
-
"gitHead": "
|
124
|
+
"gitHead": "73ee632d9d3c27f11b01e2b1028be2369aebceab"
|
124
125
|
}
|