@carbon/ibm-products 2.42.1-canary.27 → 2.42.1-canary.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. package/css/index-full-carbon.css +9 -302
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +1 -1
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon.css +9 -302
  6. package/css/index-without-carbon.css.map +1 -1
  7. package/css/index-without-carbon.min.css +1 -1
  8. package/css/index-without-carbon.min.css.map +1 -1
  9. package/css/index.css +9 -302
  10. package/css/index.css.map +1 -1
  11. package/css/index.min.css +1 -1
  12. package/css/index.min.css.map +1 -1
  13. package/es/components/Carousel/Carousel.d.ts +1 -1
  14. package/es/components/Carousel/Carousel.js +1 -1
  15. package/es/components/Coachmark/CoachmarkDragbar.d.ts +1 -1
  16. package/es/components/Coachmark/CoachmarkDragbar.js +1 -1
  17. package/es/components/Coachmark/CoachmarkHeader.d.ts +1 -1
  18. package/es/components/Coachmark/CoachmarkHeader.js +1 -1
  19. package/es/components/Coachmark/CoachmarkOverlay.d.ts +1 -1
  20. package/es/components/Coachmark/CoachmarkOverlay.js +1 -1
  21. package/es/components/Coachmark/CoachmarkTagline.d.ts +1 -1
  22. package/es/components/Coachmark/CoachmarkTagline.js +1 -1
  23. package/es/components/CoachmarkStack/CoachmarkStackHome.d.ts +1 -1
  24. package/es/components/CoachmarkStack/CoachmarkStackHome.js +2 -2
  25. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +0 -6
  26. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +33 -74
  27. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +1 -15
  28. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +12 -95
  29. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +2 -11
  30. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +9 -27
  31. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +0 -5
  32. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +14 -95
  33. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +0 -1
  34. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +0 -1
  35. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +0 -7
  36. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +1 -8
  37. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
  38. package/es/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.js +33 -38
  39. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +67 -197
  40. package/es/components/ConditionBuilder/utils/util.d.ts +0 -1
  41. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
  42. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.d.ts +1 -1
  43. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -0
  44. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +4 -7
  45. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -7
  46. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts +0 -1
  47. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +3 -13
  48. package/es/components/Datagrid/types/index.d.ts +0 -2
  49. package/es/components/Datagrid/useColumnOrder.d.ts +1 -7
  50. package/es/components/Datagrid/useFiltering.d.ts +1 -8
  51. package/es/components/Datagrid/useFiltering.js +7 -8
  52. package/es/components/Datagrid/useFlexResize.d.ts +1 -1
  53. package/es/components/Datagrid/useFlexResize.js +11 -11
  54. package/es/components/Datagrid/useNestedRows.js +2 -24
  55. package/es/components/Datagrid/useOnRowClick.d.ts +1 -8
  56. package/es/components/Datagrid/useOnRowClick.js +1 -2
  57. package/es/components/Datagrid/useRowIsMouseOver.d.ts +1 -2
  58. package/es/components/Datagrid/useRowIsMouseOver.js +1 -1
  59. package/es/components/Datagrid/useSelectRows.d.ts +1 -8
  60. package/es/components/Datagrid/useSelectRows.js +2 -3
  61. package/es/components/Datagrid/useSortableColumns.d.ts +3 -10
  62. package/es/components/Datagrid/useSortableColumns.js +2 -3
  63. package/es/components/Datagrid/utils/getAutoSizedColumnWidth.d.ts +1 -8
  64. package/es/components/Datagrid/utils/getAutoSizedColumnWidth.js +7 -0
  65. package/es/components/InterstitialScreenView/InterstitialScreenView.d.ts +1 -1
  66. package/es/components/InterstitialScreenView/InterstitialScreenView.js +1 -1
  67. package/es/components/SidePanel/SidePanel.d.ts +2 -2
  68. package/es/components/SidePanel/SidePanel.js +5 -9
  69. package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +1 -1
  70. package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +1 -1
  71. package/es/global/js/package-settings.js +2 -2
  72. package/lib/components/Carousel/Carousel.d.ts +1 -1
  73. package/lib/components/Carousel/Carousel.js +1 -1
  74. package/lib/components/Coachmark/CoachmarkDragbar.d.ts +1 -1
  75. package/lib/components/Coachmark/CoachmarkDragbar.js +1 -1
  76. package/lib/components/Coachmark/CoachmarkHeader.d.ts +1 -1
  77. package/lib/components/Coachmark/CoachmarkHeader.js +1 -1
  78. package/lib/components/Coachmark/CoachmarkOverlay.d.ts +1 -1
  79. package/lib/components/Coachmark/CoachmarkOverlay.js +1 -1
  80. package/lib/components/Coachmark/CoachmarkTagline.d.ts +1 -1
  81. package/lib/components/Coachmark/CoachmarkTagline.js +1 -1
  82. package/lib/components/CoachmarkStack/CoachmarkStackHome.d.ts +1 -1
  83. package/lib/components/CoachmarkStack/CoachmarkStackHome.js +2 -2
  84. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +0 -6
  85. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +32 -73
  86. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +1 -15
  87. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +9 -92
  88. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +2 -11
  89. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +8 -26
  90. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +0 -5
  91. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +11 -92
  92. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +0 -1
  93. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +0 -1
  94. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +0 -7
  95. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +1 -8
  96. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
  97. package/lib/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.js +31 -36
  98. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +64 -195
  99. package/lib/components/ConditionBuilder/utils/util.d.ts +0 -1
  100. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
  101. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.d.ts +1 -1
  102. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -0
  103. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +4 -7
  104. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -7
  105. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts +0 -1
  106. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +3 -13
  107. package/lib/components/Datagrid/types/index.d.ts +0 -2
  108. package/lib/components/Datagrid/useColumnOrder.d.ts +1 -7
  109. package/lib/components/Datagrid/useFiltering.d.ts +1 -8
  110. package/lib/components/Datagrid/useFiltering.js +7 -8
  111. package/lib/components/Datagrid/useFlexResize.d.ts +1 -1
  112. package/lib/components/Datagrid/useFlexResize.js +11 -11
  113. package/lib/components/Datagrid/useNestedRows.js +2 -24
  114. package/lib/components/Datagrid/useOnRowClick.d.ts +1 -8
  115. package/lib/components/Datagrid/useOnRowClick.js +1 -2
  116. package/lib/components/Datagrid/useRowIsMouseOver.d.ts +1 -2
  117. package/lib/components/Datagrid/useRowIsMouseOver.js +1 -1
  118. package/lib/components/Datagrid/useSelectRows.d.ts +1 -8
  119. package/lib/components/Datagrid/useSelectRows.js +2 -3
  120. package/lib/components/Datagrid/useSortableColumns.d.ts +3 -10
  121. package/lib/components/Datagrid/useSortableColumns.js +2 -3
  122. package/lib/components/Datagrid/utils/getAutoSizedColumnWidth.d.ts +1 -8
  123. package/lib/components/Datagrid/utils/getAutoSizedColumnWidth.js +7 -0
  124. package/lib/components/InterstitialScreenView/InterstitialScreenView.d.ts +1 -1
  125. package/lib/components/InterstitialScreenView/InterstitialScreenView.js +1 -1
  126. package/lib/components/SidePanel/SidePanel.d.ts +2 -2
  127. package/lib/components/SidePanel/SidePanel.js +5 -9
  128. package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +1 -1
  129. package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +1 -1
  130. package/lib/global/js/package-settings.js +2 -2
  131. package/package.json +2 -2
  132. package/scss/components/ConditionBuilder/_condition-builder.scss +1 -21
  133. package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +3 -22
  134. package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +21 -58
  135. package/scss/components/NonLinearReading/_non-linear-reading.scss +1 -1
  136. package/telemetry.yml +0 -23
  137. package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.d.ts +0 -2
  138. package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +0 -44
  139. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +0 -10
  140. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +0 -69
  141. package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.d.ts +0 -2
  142. package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +0 -52
  143. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +0 -10
  144. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +0 -77
  145. /package/es/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.d.ts +0 -0
  146. /package/lib/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.d.ts +0 -0
@@ -2,4 +2,3 @@ export function focusThisField(evt: any): void;
2
2
  export function focusThisItem(currentElement: any): void;
3
3
  export function traverseClockVise(eachElem: any, index: any, allElements: any, rotate: any, trapFocus: any): void;
4
4
  export function traverseReverse(eachElem: any, index: any, allElements: any, rotate: any, trapFocus: any): void;
5
- export function checkForHoldingKey(evt: any, key: any): any;
@@ -185,7 +185,7 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
185
185
  headerProps = _extends({}, (_objectDestructuringEmpty(_header$getHeaderProp), _header$getHeaderProp));
186
186
  var resizerProps = header === null || header === void 0 || (_header$getResizerPro = header.getResizerProps) === null || _header$getResizerPro === void 0 ? void 0 : _header$getResizerPro.call(header);
187
187
  return /*#__PURE__*/React__default.createElement(TableHeader, _extends({}, headerProps, {
188
- className: cx(header === null || header === void 0 ? void 0 : header.className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(blockClass, "__resizableColumn"), resizerProps), "".concat(blockClass, "__isResizing"), header === null || header === void 0 ? void 0 : header.isResizing), "".concat(blockClass, "__sortableColumn"), datagridState.isTableSortable && header.id !== 'spacer'), "".concat(blockClass, "__isSorted"), header === null || header === void 0 ? void 0 : header.isSorted), "".concat(blockClass, "__header-actions-column"), header === null || header === void 0 ? void 0 : header.isAction), "".concat(blockClass, "__with-slug"), header.slug && /*#__PURE__*/React__default.isValidElement(header === null || header === void 0 ? void 0 : header.slug)), headerProps.className),
188
+ className: cx(header === null || header === void 0 ? void 0 : header.className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(blockClass, "__resizableColumn"), resizerProps), "".concat(blockClass, "__isResizing"), header === null || header === void 0 ? void 0 : header.isResizing), "".concat(blockClass, "__sortableColumn"), datagridState.isTableSortable && header.id !== 'spacer'), "".concat(blockClass, "__isSorted"), header === null || header === void 0 ? void 0 : header.isSorted), "".concat(blockClass, "__header-actions-column"), header === null || header === void 0 ? void 0 : header.isAction), "".concat(blockClass, "__with-slug"), header.slug && /*#__PURE__*/React__default.isValidElement(header === null || header === void 0 ? void 0 : header.slug))),
189
189
  key: header.id,
190
190
  "aria-hidden": header.id === 'spacer' && 'true'
191
191
  }, getAccessibilityProps(header)), header.render('Header'), renderSlug(header.slug), resizerProps && !header.isAction && /*#__PURE__*/React__default.createElement(ResizeHeader, {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2020, 2024
2
+ * Copyright IBM Corp. 2020, 2023
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -11,6 +11,7 @@ import { VariableSizeList } from 'react-window';
11
11
  import { TableBody } from '@carbon/react';
12
12
  import { pkg } from '../../../settings.js';
13
13
  import DatagridHead from './DatagridHead.js';
14
+ import { px } from '@carbon/layout';
14
15
  import { useResizeObserver } from '../../../global/js/hooks/useResizeObserver.js';
15
16
 
16
17
  var blockClass = "".concat(pkg.prefix, "--datagrid");
@@ -71,6 +72,10 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
71
72
  if (headWrapEl) {
72
73
  headWrapEl.scrollLeft = virtualBody === null || virtualBody === void 0 ? void 0 : virtualBody.scrollLeft;
73
74
  }
75
+ var spacerColumn = document.querySelector("#".concat(tableId, " .").concat(blockClass, "__head-wrap thead th:last-child"));
76
+ if (spacerColumn) {
77
+ spacerColumn.style.width = px(32 + (virtualBody.offsetWidth - virtualBody.clientWidth)); // scrollbar width to header column to fix header alignment
78
+ }
74
79
  }
75
80
  var testRefValue = testRef === null || testRef === void 0 ? void 0 : testRef.current;
76
81
  testRefValue === null || testRefValue === void 0 || testRefValue.addEventListener('scroll', handleScroll);
@@ -74,7 +74,7 @@ var CustomizeColumnsTearsheet = function CustomizeColumnsTearsheet(_ref) {
74
74
  };
75
75
  var onCheckboxCheck = function onCheckboxCheck(col, value) {
76
76
  var changedDefinitions = columnObjects.map(function (definition) {
77
- if ((Array.isArray(col) && col.indexOf(definition) != -1 || definition.id === col.id) && definition.canFilter && !definition.disabled) {
77
+ if (Array.isArray(col) && col.indexOf(definition) != -1 || definition.id === col.id) {
78
78
  return _objectSpread2(_objectSpread2({}, definition), {}, {
79
79
  isVisible: value
80
80
  });
@@ -98,12 +98,9 @@ var CustomizeColumnsTearsheet = function CustomizeColumnsTearsheet(_ref) {
98
98
  useEffect(function () {
99
99
  var notFilterableCount = columnObjects.filter(function (col) {
100
100
  return !col.canFilter;
101
- }).length;
102
- var actionCount = columnObjects.filter(function (col) {
103
- return col.id === 'actions';
104
- }).length;
105
- setVisibleColumnsCount(getVisibleColumnsCount() - notFilterableCount - actionCount);
106
- setTotalColumns(columnObjects.length - notFilterableCount - actionCount);
101
+ });
102
+ setVisibleColumnsCount(getVisibleColumnsCount() - notFilterableCount.length);
103
+ setTotalColumns(columnObjects.length - notFilterableCount.length);
107
104
  }, [getVisibleColumnsCount, columnObjects]);
108
105
  return /*#__PURE__*/React__default.createElement(TearsheetNarrow, {
109
106
  className: "".concat(blockClass, "__customize-columns-tearsheet"),
@@ -1,8 +1,2 @@
1
- /**
2
- * Copyright IBM Corp. 2023, 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
- declare const useFilterContext: () => any;
8
1
  export default useFilterContext;
2
+ declare function useFilterContext(): any;
@@ -20,7 +20,6 @@ export namespace InlineEditCell {
20
20
  rows: PropTypes.Requireable<(object | null | undefined)[]>;
21
21
  rowSize: PropTypes.Requireable<string>;
22
22
  tableId: PropTypes.Requireable<string>;
23
- cellEditing: PropTypes.Requireable<object>;
24
23
  }>>;
25
24
  let nonEditCell: PropTypes.Requireable<boolean>;
26
25
  let placeholder: PropTypes.Requireable<string>;
@@ -36,8 +36,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
36
36
  var columnIndex = instance.columns.findIndex(function (col) {
37
37
  return col.id === columnId;
38
38
  });
39
- var rowIndex = cell.row.index;
40
- var cellId = "column-".concat(columnIndex, "-row-").concat(rowIndex);
39
+ var cellId = "column-".concat(columnIndex, "-row-").concat(cell.row.index);
41
40
  var _useContext = useContext(InlineEditContext),
42
41
  state = _useContext.state,
43
42
  dispatch = _useContext.dispatch;
@@ -73,14 +72,6 @@ var InlineEditCell = function InlineEditCell(_ref) {
73
72
  var rowSize = instance.rowSize,
74
73
  onDataUpdate = instance.onDataUpdate;
75
74
  var saveCellData;
76
- if (inEditMode) {
77
- instance.cellEditing = {
78
- cellId: cellId,
79
- columnIndex: columnIndex,
80
- rowIndex: rowIndex,
81
- curCellValue: cellValue
82
- };
83
- }
84
75
  useEffect(function () {
85
76
  setInitialValue(value);
86
77
  var columnId = cell.column.id;
@@ -454,7 +445,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
454
445
  "data-inline-type": type,
455
446
  onClick: !nonEditCell ? handleInlineCellClick : addActiveState,
456
447
  onKeyDown: !nonEditCell ? handleKeyDown : null,
457
- className: cx("".concat(blockClass, "__inline-edit--outer-cell-button"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(blockClass, "__inline-edit--outer-cell-button--").concat(rowSize), rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--lg"), !rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--invalid"), inEditMode && (config === null || config === void 0 || (_config$validator = config.validator) === null || _config$validator === void 0 ? void 0 : _config$validator.call(config, cellValue))), "".concat(blockClass, "__static--outer-cell"), !disabledCell))
448
+ className: cx("".concat(blockClass, "__inline-edit--outer-cell-button"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(blockClass, "__inline-edit--outer-cell-button--").concat(rowSize), rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--lg"), !rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--invalid"), config === null || config === void 0 || (_config$validator = config.validator) === null || _config$validator === void 0 ? void 0 : _config$validator.call(config, cellValue)), "".concat(blockClass, "__static--outer-cell"), !disabledCell))
458
449
  }, !nonEditCell && !disabledCell && renderRegularCell(), (!inEditMode || disabledCell) && /*#__PURE__*/React__default.createElement(InlineEditButton, {
459
450
  isActiveCell: cellId === activeCellId,
460
451
  renderIcon: setRenderIcon(),
@@ -478,8 +469,7 @@ InlineEditCell.propTypes = {
478
469
  onDataUpdate: PropTypes.func,
479
470
  rows: PropTypes.arrayOf(PropTypes.object),
480
471
  rowSize: PropTypes.string,
481
- tableId: PropTypes.string,
482
- cellEditing: PropTypes.object
472
+ tableId: PropTypes.string
483
473
  }),
484
474
  nonEditCell: PropTypes.bool,
485
475
  placeholder: PropTypes.string,
@@ -192,8 +192,6 @@ export interface DataGridState<T extends object = any> extends TableCommonProps,
192
192
  onVirtualScroll?: (evt?: boolean) => void;
193
193
  fetchMoreData?: () => void;
194
194
  loadMoreThreshold?: number;
195
- onRowClick?: (row: any, event: any) => void;
196
- onSort?: boolean;
197
195
  }
198
196
  export interface ResizeHeaderProps {
199
197
  resizerProps?: ResizerProps;
@@ -1,8 +1,2 @@
1
- /**
2
- * Copyright IBM Corp. 2022, 2022
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 { useColumnOrder } from 'react-table';
8
1
  export default useColumnOrder;
2
+ import { useColumnOrder } from 'react-table';
@@ -1,9 +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
- */
7
- import { Hooks } from 'react-table';
8
- declare const useFiltering: (hooks: Hooks) => void;
9
1
  export default useFiltering;
2
+ declare function useFiltering(hooks: any): void;
@@ -63,13 +63,12 @@ var useFiltering = function useFiltering(hooks) {
63
63
  });
64
64
  }, []);
65
65
  hooks.useInstance.push(function (instance) {
66
- var _ref4 = instance,
67
- filterProps = _ref4.filterProps,
68
- setAllFilters = _ref4.setAllFilters,
69
- setFilter = _ref4.setFilter,
70
- headers = _ref4.headers,
71
- data = _ref4.data,
72
- state = _ref4.state;
66
+ var filterProps = instance.filterProps,
67
+ setAllFilters = instance.setAllFilters,
68
+ setFilter = instance.setFilter,
69
+ headers = instance.headers,
70
+ data = instance.data,
71
+ state = instance.state;
73
72
  var defaultProps = {
74
73
  variation: 'flyout',
75
74
  updateMethod: BATCH,
@@ -85,7 +84,7 @@ var useFiltering = function useFiltering(hooks) {
85
84
  });
86
85
  };
87
86
  Object.assign(instance, {
88
- filterProps: _objectSpread2(_objectSpread2({}, defaultProps), instance === null || instance === void 0 ? void 0 : instance.filterProps),
87
+ filterProps: _objectSpread2(_objectSpread2({}, defaultProps), instance.filterProps),
89
88
  filterTypes: filterTypes,
90
89
  getFilterFlyoutProps: getFilterFlyoutProps,
91
90
  FilterFlyout: FilterFlyout
@@ -1,6 +1,6 @@
1
1
  export default useFlexResize;
2
2
  /**
3
- * Copyright IBM Corp. 2020, 2024
3
+ * Copyright IBM Corp. 2020, 2023
4
4
  *
5
5
  * This source code is licensed under the Apache-2.0 license found in the
6
6
  * LICENSE file in the root directory of this source tree.
@@ -7,31 +7,31 @@
7
7
 
8
8
  import { toConsumableArray as _toConsumableArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
 
10
- /* eslint-disable no-unreachable */
11
10
  /**
12
- * Copyright IBM Corp. 2020, 2024
11
+ * Copyright IBM Corp. 2020, 2023
13
12
  *
14
13
  * This source code is licensed under the Apache-2.0 license found in the
15
14
  * LICENSE file in the root directory of this source tree.
16
15
  */
17
16
 
18
17
  var useFlexResize = function useFlexResize(hooks) {
18
+ var spacer = {
19
+ id: 'spacer',
20
+ width: 0,
21
+ disableSortBy: true,
22
+ disableResizing: true
23
+ };
19
24
  hooks.visibleColumns.push(function (columns) {
20
- // always move actions to the end
25
+ // always move actions and spacer to the end
21
26
  var actionsIdx = columns.findIndex(function (col) {
22
27
  return col.isAction;
23
28
  });
24
29
  if (actionsIdx === -1) {
25
- var _lastCol = columns.at(-1);
26
- _lastCol.isFlexCol = true;
27
- return _toConsumableArray(columns);
30
+ return [].concat(_toConsumableArray(columns), [spacer]);
28
31
  }
29
32
  var cols = _toConsumableArray(columns);
30
33
  var actions = cols.splice(actionsIdx, 1)[0];
31
- cols.splice(columns.length, 0, actions);
32
- // the last non-action action column should flex remaining space
33
- var lastCol = columns.at(-2);
34
- lastCol.isFlexCol = true;
34
+ cols.splice(columns.length, 0, spacer, actions);
35
35
  return cols;
36
36
  });
37
37
  var changeProps = function changeProps(props, data) {
@@ -39,7 +39,7 @@ var useFlexResize = function useFlexResize(hooks) {
39
39
  if (!column && data.cell) {
40
40
  column = data.cell.column;
41
41
  }
42
- if (column.isFlexCol) {
42
+ if (column.id === spacer.id) {
43
43
  return [props, {
44
44
  style: {
45
45
  flex: '1 1 0'
@@ -15,23 +15,6 @@ var blockClass = "".concat(pkg.prefix, "--datagrid");
15
15
  var useNestedRows = function useNestedRows(hooks) {
16
16
  useNestedRowExpander(hooks);
17
17
  var useInstance = function useInstance(instance) {
18
- useEffect(function () {
19
- var rows = instance.rows;
20
- var defaultExpandedRows = rows.filter(function (row) {
21
- var _row$original;
22
- return row === null || row === void 0 || (_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.defaultExpanded;
23
- });
24
- if (defaultExpandedRows !== null && defaultExpandedRows !== void 0 && defaultExpandedRows.length) {
25
- defaultExpandedRows.map(function (defaultExpandedRow) {
26
- if (!defaultExpandedRow.isExpanded && !defaultExpandedRow.hasExpanded) {
27
- var _defaultExpandedRow$t;
28
- defaultExpandedRow === null || defaultExpandedRow === void 0 || (_defaultExpandedRow$t = defaultExpandedRow.toggleRowExpanded) === null || _defaultExpandedRow$t === void 0 || _defaultExpandedRow$t.call(defaultExpandedRow);
29
- defaultExpandedRow.hasExpanded = true;
30
- return;
31
- }
32
- });
33
- }
34
- }, [instance, instance.rows]);
35
18
  // This useEffect will expand rows if they exist in the initialState obj
36
19
  useEffect(function () {
37
20
  var rows = instance.rows,
@@ -63,21 +46,16 @@ var useNestedRows = function useNestedRows(hooks) {
63
46
  }
64
47
  }];
65
48
  };
66
- var getIndentation = function getIndentation(depth) {
67
- return 32 * depth + 16;
68
- }; // row indentation padding
69
49
  var getCellProps = function getCellProps(props, _ref3) {
70
50
  var cell = _ref3.cell,
71
51
  instance = _ref3.instance;
72
- // we add a dynamic -ve margin right only if the cell is resized below minimum width i.e 50px, else we set the width based on indentation at different levels
52
+ // reduce the "first cell"s width to compensate added (left) margin
73
53
  var isFirstCell = instance.columns.findIndex(function (c) {
74
54
  return c.id === cell.column.id;
75
55
  }) === 0;
76
56
  return [props, {
77
57
  style: {
78
- marginRight: isFirstCell && cell.row.depth > 0 && parseInt(props.style.width, 10) <= getIndentation(cell.row.depth) + 50 // indentation padding + expander cell or empty cell width
79
- ? "".concat(parseInt(props.style.width, 10) - (getIndentation(cell.row.depth) + 50), "px") : '',
80
- width: isFirstCell && cell.row.depth > 0 ? parseInt(props.style.width, 10) - getIndentation(cell.row.depth) : props.style.width
58
+ marginRight: "".concat(isFirstCell && cell.row.depth > 0 ? "".concat(-32 * cell.row.depth - 18, "px") : '')
81
59
  }
82
60
  }];
83
61
  };
@@ -1,9 +1,2 @@
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 useOnRowClick: (hooks: Hooks) => void;
9
1
  export default useOnRowClick;
2
+ declare function useOnRowClick(hooks: any): void;
@@ -9,8 +9,7 @@ import { pkg, carbon } from '../../settings.js';
9
9
 
10
10
  var useOnRowClick = function useOnRowClick(hooks) {
11
11
  var useInstance = function useInstance(rowInstance) {
12
- var _ref = rowInstance,
13
- onRowClick = _ref.onRowClick;
12
+ var onRowClick = rowInstance.onRowClick;
14
13
  var getRowProps = function getRowProps(props, datagridState) {
15
14
  var isFetching = datagridState.isFetching,
16
15
  row = datagridState.row,
@@ -1,3 +1,2 @@
1
- import { Hooks } from 'react-table';
2
- declare const useRowIsMouseOver: (hooks: Hooks) => void;
3
1
  export default useRowIsMouseOver;
2
+ declare function useRowIsMouseOver(hooks: any): void;
@@ -17,7 +17,7 @@ var useRowIsMouseOver = function useRowIsMouseOver(hooks) {
17
17
  setMouseOverRowIndex = _useState2[1];
18
18
  var onMouseChange = useDebounce(function (datagridState) {
19
19
  var row = datagridState.row;
20
- setMouseOverRowIndex(row === null || row === void 0 ? void 0 : row.index);
20
+ setMouseOverRowIndex(row.index);
21
21
  }, 100);
22
22
  var getRowProps = function getRowProps(props, datagridState) {
23
23
  var onMouseOver = function onMouseOver() {
@@ -1,9 +1,2 @@
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 useSelectRows: (hooks: Hooks) => void;
9
1
  export default useSelectRows;
2
+ declare function useSelectRows(hooks: any): void;
@@ -108,8 +108,7 @@ var SelectRow = function SelectRow(datagridState) {
108
108
  dispatch: dispatch,
109
109
  rowData: row,
110
110
  isChecked: event.target.checked,
111
- getRowId: getRowId,
112
- selectAll: null
111
+ getRowId: getRowId
113
112
  });
114
113
  };
115
114
  var selectDisabled = isFetching || row.getRowProps().disabled;
@@ -129,7 +128,7 @@ var SelectRow = function SelectRow(datagridState) {
129
128
  onSelect: onSelectHandler,
130
129
  id: rowId,
131
130
  name: "".concat(rowId, "-name"),
132
- className: cx([checkboxClass, cellProps.className, _defineProperty({}, "".concat(checkboxClass, "-sticky-left"), isFirstColumnStickyLeft && Number(windowSize) > 671)]),
131
+ className: cx([checkboxClass, cellProps.className, _defineProperty({}, "".concat(checkboxClass, "-sticky-left"), isFirstColumnStickyLeft && windowSize > 671)]),
133
132
  ariaLabel: title,
134
133
  disabled: selectDisabled
135
134
  }));
@@ -1,13 +1,6 @@
1
- /**
2
- * Copyright IBM Corp. 2020, 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 { Hooks } from 'react-table';
8
- export declare const getNewSortOrder: (sortOrder?: boolean | string) => {
9
- newSortDesc: boolean;
1
+ export function getNewSortOrder(sortOrder: any): {
2
+ newSortDesc: undefined;
10
3
  newOrder: string;
11
4
  };
12
- declare const useSortableColumns: (hooks: Hooks) => void;
13
5
  export default useSortableColumns;
6
+ declare function useSortableColumns(hooks: any): void;
@@ -22,7 +22,7 @@ var ordering = {
22
22
  };
23
23
  var getNewSortOrder = function getNewSortOrder(sortOrder) {
24
24
  var order = {
25
- newSortDesc: false,
25
+ newSortDesc: undefined,
26
26
  newOrder: ordering.NONE
27
27
  };
28
28
  if (sortOrder === false || sortOrder === ordering.DESC) {
@@ -137,8 +137,7 @@ var useSortableColumns = function useSortableColumns(hooks) {
137
137
  return (_instance$customizeCo = instance.customizeColumnsProps) !== null && _instance$customizeCo !== void 0 && _instance$customizeCo.isTearsheetOpen ? visibleColumns : _toConsumableArray(sortableColumns);
138
138
  };
139
139
  var sortInstanceProps = function sortInstanceProps(instance) {
140
- var _ref3 = instance,
141
- onSort = _ref3.onSort;
140
+ var onSort = instance.onSort;
142
141
  Object.assign(instance, {
143
142
  manualSortBy: !!onSort,
144
143
  isTableSortable: true
@@ -1,8 +1 @@
1
- /**
2
- * Copyright IBM Corp. 2023, 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 { Row } from 'react-table';
8
- export declare const getAutoSizedColumnWidth: (rows: Array<Row<object>>, accessor: string, headerText: string) => number;
1
+ export function getAutoSizedColumnWidth(rows: Array<object>, accessor: string, headerText: string): number;
@@ -14,6 +14,13 @@ import { toConsumableArray as _toConsumableArray } from '../../../_virtual/_roll
14
14
  * LICENSE file in the root directory of this source tree.
15
15
  */
16
16
 
17
+ /**
18
+ * Calculates the auto sized width of a column
19
+ * @param {Array<object>} rows - The datagrid rows
20
+ * @param {string} accessor - The accessor for the column
21
+ * @param {string} headerText - The header text for the column
22
+ */
23
+
17
24
  var getAutoSizedColumnWidth = function getAutoSizedColumnWidth(rows, accessor, headerText) {
18
25
  var maxWidth = 400;
19
26
  var minWidth = 58;
@@ -20,7 +20,7 @@ interface InterstitialScreenViewProps extends PropsWithChildren {
20
20
  stepTitle: string;
21
21
  }
22
22
  /**
23
- * An Onboarding component intended to be used as the child elements of the InterstitialScreen component.
23
+ * A Novice to Pro component intended to be used as the child elements of the InterstitialScreen component.
24
24
  */
25
25
  export declare let InterstitialScreenView: React.ForwardRefExoticComponent<InterstitialScreenViewProps & React.RefAttributes<HTMLDivElement>>;
26
26
  export {};
@@ -21,7 +21,7 @@ var _excluded = ["children", "className", "stepTitle"];
21
21
  var blockClass = "".concat(pkg.prefix, "--interstitial-screen-view");
22
22
  var componentName = 'InterstitialScreenView';
23
23
  /**
24
- * An Onboarding component intended to be used as the child elements of the InterstitialScreen component.
24
+ * A Novice to Pro component intended to be used as the child elements of the InterstitialScreen component.
25
25
  */
26
26
  var InterstitialScreenView = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
27
27
  var children = _ref.children,
@@ -11,7 +11,7 @@ type SidePanelBaseProps = {
11
11
  /**
12
12
  * Sets the action toolbar buttons
13
13
  */
14
- actionToolbarButtons?: ButtonProps<any>[];
14
+ actionToolbarButtons?: ButtonProps[];
15
15
  /**
16
16
  * The primary actions to be shown in the side panel. Each action is
17
17
  * specified as an object that will render expressive Buttons. Any Button
@@ -20,7 +20,7 @@ type SidePanelBaseProps = {
20
20
  *
21
21
  * See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
22
22
  */
23
- actions?: ButtonProps<any>[];
23
+ actions?: ButtonProps[];
24
24
  /**
25
25
  * Determines if the title will animate on scroll
26
26
  */
@@ -95,8 +95,7 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
95
95
  var subtitleRef = useRef(null);
96
96
  var previousState = usePreviousValue({
97
97
  size: size,
98
- open: open,
99
- currentStep: currentStep
98
+ open: open
100
99
  });
101
100
  var _useState3 = useState(-1),
102
101
  _useState4 = _slicedToArray(_useState3, 2),
@@ -163,10 +162,9 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
163
162
  if (sidePanelRef && panelRefValue) {
164
163
  var _animatedScrollRef$cu;
165
164
  var scrollableSection = (_animatedScrollRef$cu = animatedScrollRef.current) !== null && _animatedScrollRef$cu !== void 0 ? _animatedScrollRef$cu : innerContentRef.current;
166
- if (previousState && previousState['currentStep'] !== currentStep && scrollableSection) {
165
+ if (scrollableSection) {
167
166
  scrollableSection.scrollTop = 0;
168
167
  }
169
-
170
168
  // The size of the panel has changed while it is still opened
171
169
  // so we need to scroll it to the top and reset the header
172
170
  // height css custom property
@@ -325,12 +323,12 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
325
323
  if (primeFocusEl) {
326
324
  primeFocusEl === null || primeFocusEl === void 0 || primeFocusEl.focus();
327
325
  }
328
- } else if (!slideIn) {
326
+ } else {
329
327
  firstElement === null || firstElement === void 0 || firstElement.focus();
330
328
  }
331
329
  }, 0);
332
330
  }
333
- }, [animationComplete, firstElement, open, selectorPrimaryFocus, slideIn]);
331
+ }, [animationComplete, firstElement, open, selectorPrimaryFocus]);
334
332
  var primaryActionContainerClassNames = cx(["".concat(blockClass, "__actions-container"), _defineProperty({}, "".concat(blockClass, "__actions-container--condensed"), condensedActions)]);
335
333
  var mainPanelClassNames = cx([blockClass, className, "".concat(blockClass), "".concat(blockClass, "--").concat(size), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(blockClass, "--right-placement"), placement === 'right'), "".concat(blockClass, "--left-placement"), placement === 'left'), "".concat(blockClass, "--slide-in"), slideIn), "".concat(blockClass, "--has-slug"), slug), "".concat(blockClass, "--condensed-actions"), condensedActions), "".concat(blockClass, "--has-overlay"), includeOverlay)]);
336
334
  var renderTitle = function renderTitle() {
@@ -450,7 +448,7 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
450
448
  placement: placement,
451
449
  shouldReduceMotion: shouldReduceMotion
452
450
  },
453
- onKeyDown: slideIn ? undefined : keyDownListener
451
+ onKeyDown: keyDownListener
454
452
  }), /*#__PURE__*/React__default.createElement(React__default.Fragment, null, renderHeader(), renderMain()), /*#__PURE__*/React__default.createElement(MotionActionSet, {
455
453
  actions: actions !== null && actions !== void 0 ? actions : [],
456
454
  className: primaryActionContainerClassNames,
@@ -473,7 +471,6 @@ SidePanel.propTypes = {
473
471
  /**
474
472
  * Sets the action toolbar buttons
475
473
  */
476
- /**@ts-ignore */
477
474
  actionToolbarButtons: PropTypes.arrayOf(PropTypes.shape({
478
475
  label: PropTypes.string,
479
476
  leading: PropTypes.bool,
@@ -507,7 +504,6 @@ SidePanel.propTypes = {
507
504
  label: PropTypes.string,
508
505
  loading: PropTypes.bool,
509
506
  // we duplicate this Button prop to improve the DocGen here
510
- /**@ts-ignore */
511
507
  onClick: Button.propTypes.onClick
512
508
  })))]),
513
509
  /**
@@ -20,7 +20,7 @@ interface SteppedAnimatedMediaProps {
20
20
  playStep?: number;
21
21
  }
22
22
  /**
23
- * The SteppedAnimatedMedia is an Onboarding internal component and is not intended for general use.
23
+ * The SteppedAnimatedMedia is a Novice to Pro internal component and is not intended for general use.
24
24
  */
25
25
  export declare const SteppedAnimatedMedia: React.ForwardRefExoticComponent<SteppedAnimatedMediaProps & React.RefAttributes<HTMLDivElement>>;
26
26
  export {};
@@ -27,7 +27,7 @@ var defaults = {
27
27
  playStep: 0
28
28
  };
29
29
  /**
30
- * The SteppedAnimatedMedia is an Onboarding internal component and is not intended for general use.
30
+ * The SteppedAnimatedMedia is a Novice to Pro internal component and is not intended for general use.
31
31
  */
32
32
  var SteppedAnimatedMedia = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
33
33
  var className = _ref.className,
@@ -98,7 +98,7 @@ var defaults = {
98
98
  GetStartedCard: false,
99
99
  /* new component flags here - comment used by generate CLI */
100
100
 
101
- // Onboarding components not yet reviewed and released:
101
+ // Novice to pro components not yet reviewed and released:
102
102
  Coachmark: false,
103
103
  CoachmarkBeacon: false,
104
104
  CoachmarkButton: false,
@@ -118,7 +118,7 @@ var defaults = {
118
118
  UserAvatar: false,
119
119
  /* new component flags here - comment used by generate CLI */
120
120
 
121
- // Onboarding components not yet reviewed and released:
121
+ // Novice to pro components not yet reviewed and released:
122
122
  EmptyStateV2: false,
123
123
  Guidebanner: false,
124
124
  GuidebannerElement: false,
@@ -47,7 +47,7 @@ export interface CarouselProps {
47
47
  [key: string]: any;
48
48
  }
49
49
  /**
50
- * The Carousel acts as a scaffold for other Onboarding content.
50
+ * The Carousel acts as a scaffold for other Novice to Pro content.
51
51
  *
52
52
  * This component is not intended for general use.
53
53
  *
@@ -35,7 +35,7 @@ var defaults = {
35
35
  };
36
36
 
37
37
  /**
38
- * The Carousel acts as a scaffold for other Onboarding content.
38
+ * The Carousel acts as a scaffold for other Novice to Pro content.
39
39
  *
40
40
  * This component is not intended for general use.
41
41
  *
@@ -38,7 +38,7 @@ interface CoachmarkDragbarProps {
38
38
  }
39
39
  /**
40
40
  * DO NOT USE. This component is for the exclusive use
41
- * of other Onboarding components.
41
+ * of other Novice to Pro components.
42
42
  */
43
43
  export declare let CoachmarkDragbar: React.ForwardRefExoticComponent<Omit<CoachmarkDragbarProps, "ref"> & React.RefAttributes<HTMLElement>>;
44
44
  export {};
@@ -42,7 +42,7 @@ var defaults = {
42
42
  };
43
43
  /**
44
44
  * DO NOT USE. This component is for the exclusive use
45
- * of other Onboarding components.
45
+ * of other Novice to Pro components.
46
46
  */
47
47
  exports.CoachmarkDragbar = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
48
48
  var a11yKeyboardHandler = _ref.a11yKeyboardHandler,
@@ -25,7 +25,7 @@ interface CoachmarkHeaderProps {
25
25
  }
26
26
  /**
27
27
  * DO NOT USE. This component is for the exclusive use
28
- * of other Onboarding components.
28
+ * of other Novice to Pro components.
29
29
  */
30
30
  export declare let CoachmarkHeader: React.ForwardRefExoticComponent<CoachmarkHeaderProps & React.RefAttributes<HTMLElement>>;
31
31
  export {};