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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) 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/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +0 -6
  14. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +33 -74
  15. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +1 -15
  16. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +12 -95
  17. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +2 -11
  18. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +9 -27
  19. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +0 -5
  20. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +14 -95
  21. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +0 -1
  22. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +0 -1
  23. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +0 -7
  24. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +1 -8
  25. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
  26. package/es/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.js +33 -38
  27. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +67 -197
  28. package/es/components/ConditionBuilder/utils/util.d.ts +0 -1
  29. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
  30. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.d.ts +1 -1
  31. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -0
  32. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +4 -7
  33. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -7
  34. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts +0 -1
  35. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +3 -13
  36. package/es/components/Datagrid/types/index.d.ts +0 -2
  37. package/es/components/Datagrid/useColumnOrder.d.ts +1 -7
  38. package/es/components/Datagrid/useFiltering.d.ts +1 -8
  39. package/es/components/Datagrid/useFiltering.js +7 -8
  40. package/es/components/Datagrid/useFlexResize.d.ts +1 -1
  41. package/es/components/Datagrid/useFlexResize.js +11 -11
  42. package/es/components/Datagrid/useNestedRows.js +2 -24
  43. package/es/components/Datagrid/useOnRowClick.d.ts +1 -8
  44. package/es/components/Datagrid/useOnRowClick.js +1 -2
  45. package/es/components/Datagrid/useRowIsMouseOver.d.ts +1 -2
  46. package/es/components/Datagrid/useRowIsMouseOver.js +1 -1
  47. package/es/components/Datagrid/useSelectRows.d.ts +1 -8
  48. package/es/components/Datagrid/useSelectRows.js +2 -3
  49. package/es/components/Datagrid/useSortableColumns.d.ts +3 -10
  50. package/es/components/Datagrid/useSortableColumns.js +2 -3
  51. package/es/components/Datagrid/utils/getAutoSizedColumnWidth.d.ts +1 -8
  52. package/es/components/Datagrid/utils/getAutoSizedColumnWidth.js +7 -0
  53. package/es/components/SidePanel/SidePanel.d.ts +2 -2
  54. package/es/components/SidePanel/SidePanel.js +5 -9
  55. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +0 -6
  56. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +32 -73
  57. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +1 -15
  58. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +9 -92
  59. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +2 -11
  60. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +8 -26
  61. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +0 -5
  62. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +11 -92
  63. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +0 -1
  64. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +0 -1
  65. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +0 -7
  66. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +1 -8
  67. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
  68. package/lib/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.js +31 -36
  69. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +64 -195
  70. package/lib/components/ConditionBuilder/utils/util.d.ts +0 -1
  71. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
  72. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.d.ts +1 -1
  73. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -0
  74. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +4 -7
  75. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -7
  76. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts +0 -1
  77. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +3 -13
  78. package/lib/components/Datagrid/types/index.d.ts +0 -2
  79. package/lib/components/Datagrid/useColumnOrder.d.ts +1 -7
  80. package/lib/components/Datagrid/useFiltering.d.ts +1 -8
  81. package/lib/components/Datagrid/useFiltering.js +7 -8
  82. package/lib/components/Datagrid/useFlexResize.d.ts +1 -1
  83. package/lib/components/Datagrid/useFlexResize.js +11 -11
  84. package/lib/components/Datagrid/useNestedRows.js +2 -24
  85. package/lib/components/Datagrid/useOnRowClick.d.ts +1 -8
  86. package/lib/components/Datagrid/useOnRowClick.js +1 -2
  87. package/lib/components/Datagrid/useRowIsMouseOver.d.ts +1 -2
  88. package/lib/components/Datagrid/useRowIsMouseOver.js +1 -1
  89. package/lib/components/Datagrid/useSelectRows.d.ts +1 -8
  90. package/lib/components/Datagrid/useSelectRows.js +2 -3
  91. package/lib/components/Datagrid/useSortableColumns.d.ts +3 -10
  92. package/lib/components/Datagrid/useSortableColumns.js +2 -3
  93. package/lib/components/Datagrid/utils/getAutoSizedColumnWidth.d.ts +1 -8
  94. package/lib/components/Datagrid/utils/getAutoSizedColumnWidth.js +7 -0
  95. package/lib/components/SidePanel/SidePanel.d.ts +2 -2
  96. package/lib/components/SidePanel/SidePanel.js +5 -9
  97. package/package.json +3 -3
  98. package/scss/components/ConditionBuilder/_condition-builder.scss +1 -21
  99. package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +3 -22
  100. package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +21 -58
  101. package/telemetry.yml +0 -23
  102. package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.d.ts +0 -2
  103. package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +0 -44
  104. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +0 -10
  105. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +0 -69
  106. package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.d.ts +0 -2
  107. package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +0 -52
  108. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +0 -10
  109. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +0 -77
  110. /package/es/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.d.ts +0 -0
  111. /package/lib/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.d.ts +0 -0
@@ -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;
@@ -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
  /**
@@ -6,23 +6,17 @@ declare function ConditionBlock(props: any): import("react/jsx-runtime").JSX.Ele
6
6
  declare namespace ConditionBlock {
7
7
  namespace propTypes {
8
8
  let addConditionHandler: PropTypes.Requireable<(...args: any[]) => any>;
9
- let addConditionSubGroupHandler: PropTypes.Requireable<(...args: any[]) => any>;
10
9
  let aria: PropTypes.Requireable<object>;
11
10
  let condition: PropTypes.Requireable<object>;
12
11
  let conditionIndex: PropTypes.Requireable<number>;
13
12
  let conjunction: PropTypes.Requireable<string>;
14
13
  let group: PropTypes.Requireable<object>;
15
- let hideConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
16
- let hideConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
17
14
  let isLastCondition: PropTypes.Requireable<(...args: any[]) => any>;
18
15
  let isStatement: PropTypes.Requireable<boolean>;
19
16
  let onChange: PropTypes.Requireable<(...args: any[]) => any>;
20
17
  let onConnectorOperatorChange: PropTypes.Requireable<(...args: any[]) => any>;
21
18
  let onRemove: PropTypes.Requireable<(...args: any[]) => any>;
22
19
  let onStatementChange: PropTypes.Requireable<(...args: any[]) => any>;
23
- let showConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
24
- let showConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
25
- let state: PropTypes.Requireable<object>;
26
20
  }
27
21
  }
28
22
  import PropTypes from 'prop-types';
@@ -17,7 +17,7 @@ var index = require('../../../node_modules/prop-types/index.js');
17
17
  var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
18
18
  var ConditionBuilderItemOption = require('../ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js');
19
19
  var cx = require('classnames');
20
- var ConditionConnector = require('../ConditionBuilderConnector/ConditionConnector.js');
20
+ var ConditionConnector = require('../ConditionConnector/ConditionConnector.js');
21
21
  var ConditionBuilderItemNumber = require('../ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js');
22
22
  var ConditionBuilderItemText = require('../ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js');
23
23
  var ConditionBuilderItemDate = require('../ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js');
@@ -32,7 +32,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
32
32
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
33
33
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
34
34
 
35
- var _div;
36
35
  /**
37
36
  * This component build each block of condition consisting of property, operator value and close button.
38
37
  */
@@ -50,19 +49,11 @@ var ConditionBlock = function ConditionBlock(props) {
50
49
  isStatement = props.isStatement,
51
50
  group = props.group,
52
51
  onStatementChange = props.onStatementChange,
53
- conditionIndex = props.conditionIndex,
54
52
  addConditionHandler = props.addConditionHandler,
55
- _addConditionSubGroupHandler = props.addConditionSubGroupHandler,
56
- aria = props.aria,
57
- hideConditionSubGroupPreviewHandler = props.hideConditionSubGroupPreviewHandler,
58
- showConditionSubGroupPreviewHandler = props.showConditionSubGroupPreviewHandler,
59
- hideConditionPreviewHandler = props.hideConditionPreviewHandler,
60
- showConditionPreviewHandler = props.showConditionPreviewHandler,
53
+ conditionIndex = props.conditionIndex,
61
54
  isLastCondition = props.isLastCondition;
62
55
  var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
63
- inputConfig = _useContext.inputConfig,
64
- variant = _useContext.variant;
65
- //Below possible input types expected for value field.
56
+ inputConfig = _useContext.inputConfig;
66
57
  var itemComponents = {
67
58
  option: ConditionBuilderItemOption.ConditionBuilderItemOption,
68
59
  text: ConditionBuilderItemText.ConditionBuilderItemText,
@@ -87,17 +78,14 @@ var ConditionBlock = function ConditionBlock(props) {
87
78
  type = _getCurrentConfig.type,
88
79
  config = _getCurrentConfig.config,
89
80
  label = _getCurrentConfig.label;
90
- var ItemComponent;
91
- // if (type == 'custom') {
92
- // ItemComponent = config.component;
93
- // } else {
94
- ItemComponent = property ? itemComponents[type] : null;
95
- //}
96
-
81
+ var ItemComponent = property ? itemComponents[type] : null;
97
82
  var onStatementChangeHandler = function onStatementChangeHandler(v, evt) {
98
83
  util.focusThisField(evt);
99
84
  onStatementChange(v);
100
85
  };
86
+ var onConnectorOperatorChangeHandler = function onConnectorOperatorChangeHandler(op) {
87
+ onConnectorOperatorChange(op);
88
+ };
101
89
  var onPropertyChangeHandler = function onPropertyChangeHandler(newProperty) {
102
90
  onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, condition), {}, {
103
91
  property: newProperty,
@@ -130,32 +118,21 @@ var ConditionBlock = function ConditionBlock(props) {
130
118
  return operator.type.indexOf(type) != -1 || operator.type == 'all';
131
119
  });
132
120
  };
133
- var getAriaAttributes = function getAriaAttributes() {
134
- return variant == 'tree' ? {
135
- 'aria-level': aria.level,
136
- 'aria-posinset': aria.posinset,
137
- 'aria-setsize': aria.setsize
138
- } : {};
139
- };
140
- return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
141
- className: cx__default["default"]("".concat(DataConfigs.blockClass, "__condition-block"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__condition__deletion-preview"), showDeletionPreview), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__gap-bottom"), variant == 'tree' && !(conditionIndex + 1 >= group.conditions.length)), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-bottom"), variant == 'sentence')),
121
+ return /*#__PURE__*/React__default["default"].createElement("div", {
122
+ className: cx__default["default"]("".concat(DataConfigs.blockClass, "__condition-block conditionBlockWrapper ").concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-bottom"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__condition__deletion-preview"), showDeletionPreview)),
123
+ key: conditionIndex,
142
124
  role: "row",
143
125
  "aria-label": DataConfigs.translateWithId('condition_row'),
144
126
  tabIndex: -1
145
- }, getAriaAttributes()), conjunction ? /*#__PURE__*/React__default["default"].createElement(ConditionConnector["default"], {
146
- className: "".concat(DataConfigs.blockClass, "__gap"),
147
- operator: conjunction,
148
- onChange: function onChange(op) {
149
- return onConnectorOperatorChange(op);
150
- }
151
- }) : _div || (_div = /*#__PURE__*/React__default["default"].createElement("div", {
152
- role: "gridcell"
153
- })), isStatement && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
127
+ }, isStatement && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem
128
+ // open={false}
129
+ , {
154
130
  label: group.statement,
155
131
  title: DataConfigs.translateWithId('condition'),
156
132
  "data-name": "connectorField",
157
133
  popOverClassName: "".concat(DataConfigs.blockClass, "__gap"),
158
- className: "".concat(DataConfigs.blockClass, "__statement-button")
134
+ className: "".concat(DataConfigs.blockClass, "__statement-button"),
135
+ tabIndex: 0
159
136
  }, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItemOption.ConditionBuilderItemOption, {
160
137
  conditionState: {
161
138
  value: group.statement,
@@ -165,7 +142,11 @@ var ConditionBlock = function ConditionBlock(props) {
165
142
  config: {
166
143
  options: DataConfigs.statementConfig
167
144
  }
168
- })), /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
145
+ })), conjunction && /*#__PURE__*/React__default["default"].createElement(ConditionConnector["default"], {
146
+ className: "".concat(DataConfigs.blockClass, "__gap"),
147
+ operator: conjunction,
148
+ onChange: onConnectorOperatorChangeHandler
149
+ }), /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
169
150
  label: label,
170
151
  title: DataConfigs.translateWithId('property'),
171
152
  renderIcon: icon !== null && icon !== void 0 ? icon : null,
@@ -212,8 +193,7 @@ var ConditionBlock = function ConditionBlock(props) {
212
193
  value: value
213
194
  },
214
195
  onChange: onValueChangeHandler,
215
- config: config,
216
- "data-name": "valueField"
196
+ config: config
217
197
  })), /*#__PURE__*/React__default["default"].createElement("span", {
218
198
  role: "gridcell",
219
199
  "aria-label": DataConfigs.translateWithId('remove_condition')
@@ -231,15 +211,9 @@ var ConditionBlock = function ConditionBlock(props) {
231
211
  })), isLastCondition(conditionIndex, group.conditions) && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderAdd["default"], {
232
212
  onClick: function onClick() {
233
213
  addConditionHandler(conditionIndex);
234
- },
235
- addConditionSubGroupHandler: function addConditionSubGroupHandler() {
236
- _addConditionSubGroupHandler(conditionIndex);
237
- },
238
- showConditionSubGroupPreviewHandler: showConditionSubGroupPreviewHandler,
239
- hideConditionSubGroupPreviewHandler: hideConditionSubGroupPreviewHandler,
240
- enableSubGroup: variant == 'tree',
241
- showConditionPreviewHandler: showConditionPreviewHandler,
242
- hideConditionPreviewHandler: hideConditionPreviewHandler,
214
+ }
215
+ //addConditionSubGroupHandler={()=>{addConditionSubGroupHandler(conditionIndex)}}
216
+ ,
243
217
  className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-left")
244
218
  }));
245
219
  };
@@ -249,15 +223,17 @@ ConditionBlock.propTypes = {
249
223
  * callback to add a new condition
250
224
  */
251
225
  addConditionHandler: index["default"].func,
252
- /**
253
- * callback to add a new condition subgroup
254
- */
255
- addConditionSubGroupHandler: index["default"].func,
256
226
  /**
257
227
  * object hold aria attributes
258
228
  */
259
229
  aria: index["default"].object,
230
+ /**
231
+ * object that hold the current condition
232
+ */
260
233
  condition: index["default"].object,
234
+ /**
235
+ * index of the current condition
236
+ */
261
237
  conditionIndex: index["default"].number,
262
238
  /**
263
239
  * string that decides to show the condition connector
@@ -268,13 +244,8 @@ ConditionBlock.propTypes = {
268
244
  */
269
245
  group: index["default"].object,
270
246
  /**
271
- * handler for hiding sub group preview
272
- */
273
- hideConditionPreviewHandler: index["default"].func,
274
- /**
275
- * handler for hiding sub group preview
247
+ * callback to add a new condition
276
248
  */
277
- hideConditionSubGroupPreviewHandler: index["default"].func,
278
249
  isLastCondition: index["default"].func,
279
250
  /**
280
251
  * boolean that decides to show the statement(if/ excl.if)
@@ -295,19 +266,7 @@ ConditionBlock.propTypes = {
295
266
  /**
296
267
  * callback to handle the statement(if/ excl.if) change
297
268
  */
298
- onStatementChange: index["default"].func,
299
- /**
300
- * handler for showing add condition preview
301
- */
302
- showConditionPreviewHandler: index["default"].func,
303
- /**
304
- * handler for showing sub group preview
305
- */
306
- showConditionSubGroupPreviewHandler: index["default"].func,
307
- /**
308
- * object that hold the current condition
309
- */
310
- state: index["default"].object
269
+ onStatementChange: index["default"].func
311
270
  };
312
271
 
313
272
  exports["default"] = ConditionBlock$1;
@@ -1,26 +1,12 @@
1
1
  export default ConditionBuilderAdd;
2
- declare function ConditionBuilderAdd({ className, onClick, addConditionSubGroupHandler, showConditionSubGroupPreviewHandler, hideConditionSubGroupPreviewHandler, showConditionPreviewHandler, hideConditionPreviewHandler, enableSubGroup, buttonLabel, }: {
2
+ declare function ConditionBuilderAdd({ className, onClick }: {
3
3
  className: any;
4
4
  onClick: any;
5
- addConditionSubGroupHandler: any;
6
- showConditionSubGroupPreviewHandler: any;
7
- hideConditionSubGroupPreviewHandler: any;
8
- showConditionPreviewHandler: any;
9
- hideConditionPreviewHandler: any;
10
- enableSubGroup: any;
11
- buttonLabel: any;
12
5
  }): import("react/jsx-runtime").JSX.Element;
13
6
  declare namespace ConditionBuilderAdd {
14
7
  namespace propTypes {
15
- let addConditionSubGroupHandler: PropTypes.Requireable<(...args: any[]) => any>;
16
- let buttonLabel: PropTypes.Requireable<string>;
17
8
  let className: PropTypes.Requireable<string>;
18
- let enableSubGroup: PropTypes.Requireable<boolean>;
19
- let hideConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
20
- let hideConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
21
9
  let onClick: PropTypes.Requireable<(...args: any[]) => any>;
22
- let showConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
23
- let showConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
24
10
  }
25
11
  }
26
12
  import PropTypes from 'prop-types';