@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.
Files changed (118) hide show
  1. package/es/components/CreateFullPage/CreateFullPage.d.ts +2 -1
  2. package/es/components/CreateFullPage/CreateFullPageStep.d.ts +71 -2
  3. package/es/components/CreateFullPage/CreateFullPageStep.js +3 -0
  4. package/es/components/DataSpreadsheet/DataSpreadsheet.d.ts +3 -2
  5. package/es/components/DataSpreadsheet/DataSpreadsheet.js +28 -28
  6. package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +7 -8
  7. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +1 -0
  8. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +4 -3
  9. package/es/components/DataSpreadsheet/types/index.d.ts +1 -4
  10. package/es/components/Datagrid/Datagrid/Datagrid.d.ts +24 -2
  11. package/es/components/Datagrid/Datagrid/Datagrid.js +4 -4
  12. package/es/components/Datagrid/Datagrid/DatagridBody.d.ts +2 -1
  13. package/es/components/Datagrid/Datagrid/DatagridBody.js +1 -2
  14. package/es/components/Datagrid/Datagrid/DatagridContent.d.ts +16 -13
  15. package/es/components/Datagrid/Datagrid/DatagridContent.js +12 -13
  16. package/es/components/Datagrid/Datagrid/DatagridEmptyBody.d.ts +8 -1
  17. package/es/components/Datagrid/Datagrid/DatagridEmptyBody.js +3 -4
  18. package/es/components/Datagrid/Datagrid/DatagridExpandedRow.d.ts +9 -1
  19. package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +10 -5
  20. package/es/components/Datagrid/Datagrid/DatagridHead.d.ts +8 -1
  21. package/es/components/Datagrid/Datagrid/DatagridHead.js +3 -5
  22. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.d.ts +8 -1
  23. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +41 -36
  24. package/es/components/Datagrid/Datagrid/DatagridRefBody.d.ts +2 -1
  25. package/es/components/Datagrid/Datagrid/DatagridRefBody.js +4 -4
  26. package/es/components/Datagrid/Datagrid/DatagridRow.d.ts +8 -1
  27. package/es/components/Datagrid/Datagrid/DatagridRow.js +12 -16
  28. package/es/components/Datagrid/Datagrid/DatagridSelectAll.d.ts +9 -1
  29. package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +10 -8
  30. package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.d.ts +23 -27
  31. package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +9 -9
  32. package/es/components/Datagrid/Datagrid/DatagridSimpleBody.d.ts +2 -1
  33. package/es/components/Datagrid/Datagrid/DatagridSimpleBody.js +3 -3
  34. package/es/components/Datagrid/Datagrid/DatagridToolbar.d.ts +17 -10
  35. package/es/components/Datagrid/Datagrid/DatagridToolbar.js +15 -11
  36. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.d.ts +8 -1
  37. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +29 -17
  38. package/es/components/Datagrid/Datagrid/DraggableElement.d.ts +23 -21
  39. package/es/components/Datagrid/Datagrid/DraggableElement.js +2 -4
  40. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.d.ts +1 -1
  41. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +1 -1
  42. package/es/components/Datagrid/Datagrid/addons/Slug/DatagridSlug.d.ts +12 -2
  43. package/es/components/Datagrid/Datagrid/index.d.ts +7 -1
  44. package/es/components/Datagrid/types/index.d.ts +210 -0
  45. package/es/components/Datagrid/useColumnOrder.d.ts +1 -0
  46. package/es/components/Datagrid/useDatagrid.d.ts +1 -1
  47. package/es/components/Datagrid/useFocusRowExpander.js +1 -1
  48. package/es/components/Datagrid/useInfiniteScroll.d.ts +8 -1
  49. package/es/components/Datagrid/useInfiniteScroll.js +10 -9
  50. package/es/components/Datagrid/useSelectRows.js +5 -1
  51. package/es/components/FilterSummary/FilterSummary.d.ts +21 -2
  52. package/es/components/FilterSummary/FilterSummary.js +10 -11
  53. package/es/components/Guidebanner/Guidebanner.js +7 -2
  54. package/es/components/WebTerminal/WebTerminal.js +1 -1
  55. package/es/global/js/hooks/usePreviousValue.d.ts +1 -1
  56. package/es/global/js/hooks/usePreviousValue.js +3 -2
  57. package/es/global/js/hooks/useRetrieveStepData.d.ts +5 -5
  58. package/es/global/js/hooks/useRetrieveStepData.js +5 -5
  59. package/lib/components/CreateFullPage/CreateFullPage.d.ts +2 -1
  60. package/lib/components/CreateFullPage/CreateFullPageStep.d.ts +71 -2
  61. package/lib/components/CreateFullPage/CreateFullPageStep.js +3 -0
  62. package/lib/components/DataSpreadsheet/DataSpreadsheet.d.ts +3 -2
  63. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +28 -28
  64. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +7 -8
  65. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +1 -0
  66. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +4 -3
  67. package/lib/components/DataSpreadsheet/types/index.d.ts +1 -4
  68. package/lib/components/Datagrid/Datagrid/Datagrid.d.ts +24 -2
  69. package/lib/components/Datagrid/Datagrid/Datagrid.js +4 -4
  70. package/lib/components/Datagrid/Datagrid/DatagridBody.d.ts +2 -1
  71. package/lib/components/Datagrid/Datagrid/DatagridBody.js +1 -2
  72. package/lib/components/Datagrid/Datagrid/DatagridContent.d.ts +16 -13
  73. package/lib/components/Datagrid/Datagrid/DatagridContent.js +44 -45
  74. package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.d.ts +8 -1
  75. package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.js +3 -4
  76. package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.d.ts +9 -1
  77. package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +9 -4
  78. package/lib/components/Datagrid/Datagrid/DatagridHead.d.ts +8 -1
  79. package/lib/components/Datagrid/Datagrid/DatagridHead.js +3 -5
  80. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.d.ts +8 -1
  81. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +40 -35
  82. package/lib/components/Datagrid/Datagrid/DatagridRefBody.d.ts +2 -1
  83. package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +4 -4
  84. package/lib/components/Datagrid/Datagrid/DatagridRow.d.ts +8 -1
  85. package/lib/components/Datagrid/Datagrid/DatagridRow.js +12 -16
  86. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.d.ts +9 -1
  87. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +10 -8
  88. package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.d.ts +23 -27
  89. package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +9 -9
  90. package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.d.ts +2 -1
  91. package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.js +3 -3
  92. package/lib/components/Datagrid/Datagrid/DatagridToolbar.d.ts +17 -10
  93. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +15 -11
  94. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.d.ts +8 -1
  95. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +29 -17
  96. package/lib/components/Datagrid/Datagrid/DraggableElement.d.ts +23 -21
  97. package/lib/components/Datagrid/Datagrid/DraggableElement.js +2 -4
  98. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.d.ts +1 -1
  99. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +1 -1
  100. package/lib/components/Datagrid/Datagrid/addons/Slug/DatagridSlug.d.ts +12 -2
  101. package/lib/components/Datagrid/Datagrid/index.d.ts +7 -1
  102. package/lib/components/Datagrid/types/index.d.ts +210 -0
  103. package/lib/components/Datagrid/useColumnOrder.d.ts +1 -0
  104. package/lib/components/Datagrid/useDatagrid.d.ts +1 -1
  105. package/lib/components/Datagrid/useFocusRowExpander.js +1 -1
  106. package/lib/components/Datagrid/useInfiniteScroll.d.ts +8 -1
  107. package/lib/components/Datagrid/useInfiniteScroll.js +10 -9
  108. package/lib/components/Datagrid/useSelectRows.js +5 -1
  109. package/lib/components/FilterSummary/FilterSummary.d.ts +21 -2
  110. package/lib/components/FilterSummary/FilterSummary.js +10 -11
  111. package/lib/components/Guidebanner/Guidebanner.js +7 -2
  112. package/lib/components/WebTerminal/WebTerminal.js +1 -1
  113. package/lib/global/js/hooks/usePreviousValue.d.ts +1 -1
  114. package/lib/global/js/hooks/usePreviousValue.js +3 -2
  115. package/lib/global/js/hooks/useRetrieveStepData.d.ts +5 -5
  116. package/lib/global/js/hooks/useRetrieveStepData.js +5 -5
  117. package/package.json +5 -4
  118. 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 +1,2 @@
1
1
  export default useColumnOrder;
2
+ import { useColumnOrder } from 'react-table';
@@ -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 isFetching = instance.isFetching,
27
- tableHeight = instance.tableHeight,
28
- innerListRef = instance.innerListRef,
29
- fetchMoreData = instance.fetchMoreData,
30
- tableId = instance.tableId,
31
- loadMoreThreshold = instance.loadMoreThreshold;
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(_ref) {
45
- var scrollDirection = _ref.scrollDirection,
46
- scrollOffset = _ref.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
- return /*#__PURE__*/React__default["default"].createElement(react.TableSelectRow, _rollupPluginBabelHelpers["extends"]({}, cellProps, selectProps, {
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
- export default FilterSummary;
2
- declare let FilterSummary: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
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
- _ref$renderLabel = _ref.renderLabel,
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$current = localRef.current) === null || _localRef$current === void 0 ? void 0 : _localRef$current.offsetHeight) <= 50) {
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-expanded": !isCollapsed,
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 values included in the param
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.41.1-canary.9+1a6cb2508",
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.1.7",
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.0",
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": "1a6cb2508013be43018ba1a2a5325cf82b09e040"
124
+ "gitHead": "73ee632d9d3c27f11b01e2b1028be2369aebceab"
124
125
  }