@carbon/ibm-products 2.43.2-canary.9 → 2.44.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/css/index-full-carbon.css +34 -3
  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-released-only.css.map +1 -1
  6. package/css/index-without-carbon-released-only.min.css.map +1 -1
  7. package/css/index-without-carbon.css +34 -3
  8. package/css/index-without-carbon.css.map +1 -1
  9. package/css/index-without-carbon.min.css +1 -1
  10. package/css/index-without-carbon.min.css.map +1 -1
  11. package/css/index.css +34 -3
  12. package/css/index.css.map +1 -1
  13. package/css/index.min.css +1 -1
  14. package/css/index.min.css.map +1 -1
  15. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +23 -21
  16. package/es/components/ConditionBuilder/ConditionBuilder.js +67 -20
  17. package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +15 -0
  18. package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +129 -0
  19. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +6 -4
  20. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +5 -1
  21. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +16 -4
  22. package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +2 -2
  23. package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +2 -2
  24. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +9 -11
  25. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +36 -32
  26. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +0 -1
  27. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +7 -2
  28. package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +6 -1
  29. package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +18 -10
  30. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +39 -36
  31. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +12 -10
  32. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +1 -1
  33. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +24 -16
  34. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +19 -4
  35. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +13 -0
  36. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +109 -0
  37. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.d.ts → ItemOptionForValueField.d.ts} +2 -2
  38. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.js → ItemOptionForValueField.js} +58 -33
  39. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +4 -6
  40. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +14 -5
  41. package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +1 -2
  42. package/es/components/ConditionBuilder/utils/util.d.ts +1 -0
  43. package/es/components/ConditionBuilder/utils/util.js +16 -1
  44. package/es/components/DataSpreadsheet/DataSpreadsheet.js +7 -4
  45. package/es/components/Datagrid/Datagrid/Datagrid.js +2 -1
  46. package/es/components/Datagrid/Datagrid/DatagridContent.js +1 -1
  47. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +11 -1
  48. package/es/components/Datagrid/Datagrid/DatagridRow.js +13 -2
  49. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -1
  50. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -1
  51. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -1
  52. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +6 -3
  53. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.d.ts +1 -1
  54. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +21 -16
  55. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +21 -3
  56. package/es/components/Datagrid/types/index.d.ts +18 -4
  57. package/es/components/Datagrid/useActionsColumn.d.ts +8 -1
  58. package/es/components/Datagrid/useActionsColumn.js +7 -6
  59. package/es/components/Datagrid/useColumnRightAlign.d.ts +8 -1
  60. package/es/components/Datagrid/useColumnRightAlign.js +4 -3
  61. package/es/components/Datagrid/useInlineEdit.js +12 -2
  62. package/es/components/Datagrid/useNestedRows.js +32 -13
  63. package/es/components/Decorator/Decorator.js +2 -1
  64. package/es/components/DecoratorBase/DecoratorBase.js +3 -5
  65. package/es/components/DecoratorDualButton/DecoratorDualButton.js +2 -1
  66. package/es/components/DecoratorLink/DecoratorLink.js +2 -1
  67. package/es/components/DecoratorSingleButton/DecoratorSingleButton.js +2 -1
  68. package/es/components/Tearsheet/Tearsheet.d.ts +8 -1
  69. package/es/components/Tearsheet/Tearsheet.js +9 -1
  70. package/es/components/Tearsheet/TearsheetNarrow.d.ts +11 -0
  71. package/es/components/Tearsheet/TearsheetNarrow.js +12 -0
  72. package/es/components/Tearsheet/TearsheetShell.d.ts +10 -0
  73. package/es/components/Tearsheet/TearsheetShell.js +17 -3
  74. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +23 -21
  75. package/lib/components/ConditionBuilder/ConditionBuilder.js +67 -20
  76. package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +15 -0
  77. package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +137 -0
  78. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +6 -3
  79. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +5 -1
  80. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +16 -4
  81. package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +2 -2
  82. package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +2 -2
  83. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +9 -11
  84. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +36 -32
  85. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +0 -1
  86. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +7 -2
  87. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +6 -1
  88. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +18 -10
  89. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +39 -36
  90. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +12 -10
  91. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +1 -1
  92. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +23 -15
  93. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +20 -5
  94. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +13 -0
  95. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +117 -0
  96. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.d.ts → ItemOptionForValueField.d.ts} +2 -2
  97. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.js → ItemOptionForValueField.js} +56 -31
  98. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +4 -6
  99. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +14 -4
  100. package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +1 -2
  101. package/lib/components/ConditionBuilder/utils/util.d.ts +1 -0
  102. package/lib/components/ConditionBuilder/utils/util.js +17 -0
  103. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +7 -4
  104. package/lib/components/Datagrid/Datagrid/Datagrid.js +2 -1
  105. package/lib/components/Datagrid/Datagrid/DatagridContent.js +1 -1
  106. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +11 -1
  107. package/lib/components/Datagrid/Datagrid/DatagridRow.js +13 -2
  108. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -1
  109. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -1
  110. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -1
  111. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +6 -3
  112. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.d.ts +1 -1
  113. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +21 -16
  114. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +21 -3
  115. package/lib/components/Datagrid/types/index.d.ts +18 -4
  116. package/lib/components/Datagrid/useActionsColumn.d.ts +8 -1
  117. package/lib/components/Datagrid/useActionsColumn.js +7 -6
  118. package/lib/components/Datagrid/useColumnRightAlign.d.ts +8 -1
  119. package/lib/components/Datagrid/useColumnRightAlign.js +4 -3
  120. package/lib/components/Datagrid/useInlineEdit.js +12 -2
  121. package/lib/components/Datagrid/useNestedRows.js +32 -13
  122. package/lib/components/Decorator/Decorator.js +2 -1
  123. package/lib/components/DecoratorBase/DecoratorBase.js +3 -5
  124. package/lib/components/DecoratorDualButton/DecoratorDualButton.js +2 -1
  125. package/lib/components/DecoratorLink/DecoratorLink.js +2 -1
  126. package/lib/components/DecoratorSingleButton/DecoratorSingleButton.js +2 -1
  127. package/lib/components/Tearsheet/Tearsheet.d.ts +8 -1
  128. package/lib/components/Tearsheet/Tearsheet.js +9 -1
  129. package/lib/components/Tearsheet/TearsheetNarrow.d.ts +11 -0
  130. package/lib/components/Tearsheet/TearsheetNarrow.js +12 -0
  131. package/lib/components/Tearsheet/TearsheetShell.d.ts +10 -0
  132. package/lib/components/Tearsheet/TearsheetShell.js +16 -2
  133. package/package.json +5 -5
  134. package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +9 -1
  135. package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +26 -1
  136. package/scss/components/StatusIcon/_status-icon.scss +4 -4
  137. package/scss/components/StringFormatter/_string-formatter.scss +2 -2
  138. package/scss/components/UserProfileImage/_user-profile-image.scss +6 -2
  139. package/telemetry.yml +8 -3
  140. package/es/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +0 -1
  141. package/es/components/ConditionBuilder/utils/checkForHoldingKey.js +0 -16
  142. package/lib/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +0 -1
  143. package/lib/components/ConditionBuilder/utils/checkForHoldingKey.js +0 -20
@@ -0,0 +1,109 @@
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
+
8
+ import { slicedToArray as _slicedToArray } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
9
+ import React__default, { useContext, useRef, useState, useEffect } from 'react';
10
+ import { Search } from '@carbon/react';
11
+ import { Checkmark } from '@carbon/react/icons';
12
+ import PropTypes from '../../../../node_modules/prop-types/index.js';
13
+ import { ConditionBuilderContext } from '../../ConditionBuilderContext/ConditionBuilderProvider.js';
14
+ import { blockClass, translateWithId } from '../../ConditionBuilderContext/DataConfigs.js';
15
+
16
+ var ItemOption = function ItemOption(_ref) {
17
+ var _ref$conditionState = _ref.conditionState,
18
+ conditionState = _ref$conditionState === void 0 ? {} : _ref$conditionState,
19
+ _ref$config = _ref.config,
20
+ config = _ref$config === void 0 ? {} : _ref$config,
21
+ onChange = _ref.onChange;
22
+ var _useContext = useContext(ConditionBuilderContext),
23
+ popOverSearchThreshold = _useContext.popOverSearchThreshold;
24
+ var contentRef = useRef();
25
+ var allOptions = config.options;
26
+ var _useState = useState(''),
27
+ _useState2 = _slicedToArray(_useState, 2),
28
+ searchValue = _useState2[0],
29
+ setSearchValue = _useState2[1];
30
+ var selection = conditionState.value;
31
+ var filteredItems = allOptions === null || allOptions === void 0 ? void 0 : allOptions.filter(function (opt) {
32
+ return opt.label.toLowerCase().includes(searchValue.toLowerCase());
33
+ });
34
+ useEffect(function () {
35
+ //this will focus the first input field in the popover
36
+
37
+ if (contentRef.current) {
38
+ var firstFocusableElement = contentRef.current.querySelector('input, button,li');
39
+ if (firstFocusableElement) {
40
+ firstFocusableElement.focus();
41
+ }
42
+ }
43
+ }, [allOptions]);
44
+ var onClickHandler = function onClickHandler(evt, option) {
45
+ onChange(option.id, evt);
46
+ };
47
+ var onSearchChangeHandler = function onSearchChangeHandler(evt) {
48
+ var value = evt.target.value;
49
+ setSearchValue(value);
50
+ };
51
+ var getAriaLabel = function getAriaLabel() {
52
+ return conditionState.label ? conditionState.label : conditionState.property ? conditionState.property : translateWithId('property');
53
+ };
54
+ if (!allOptions) {
55
+ return;
56
+ }
57
+ return /*#__PURE__*/React__default.createElement("div", {
58
+ className: "".concat(blockClass, "__item-option"),
59
+ ref: contentRef
60
+ }, allOptions.length > popOverSearchThreshold && /*#__PURE__*/React__default.createElement("div", {
61
+ className: "".concat(blockClass, "__item-option__search")
62
+ }, /*#__PURE__*/React__default.createElement(Search, {
63
+ size: "sm",
64
+ labelText: translateWithId('clear_search'),
65
+ closeButtonLabelText: translateWithId('clear_search'),
66
+ onChange: onSearchChangeHandler
67
+ })), /*#__PURE__*/React__default.createElement("ul", {
68
+ "aria-label": getAriaLabel(),
69
+ role: "listbox"
70
+ }, filteredItems === null || filteredItems === void 0 ? void 0 : filteredItems.map(function (option) {
71
+ var isSelected = selection === option.id;
72
+ var Icon = option.icon;
73
+ return /*#__PURE__*/React__default.createElement("li", {
74
+ tabIndex: 0,
75
+ key: option.id,
76
+ role: "option",
77
+ "aria-selected": isSelected,
78
+ className: "".concat(blockClass, "__item-option__option"),
79
+ onKeyUp: function onKeyUp() {
80
+ return false;
81
+ },
82
+ onClick: function onClick(evt) {
83
+ return onClickHandler(evt, option);
84
+ }
85
+ }, /*#__PURE__*/React__default.createElement("div", {
86
+ className: "".concat(blockClass, "__item-option__option-content")
87
+ }, /*#__PURE__*/React__default.createElement("span", {
88
+ className: "".concat(blockClass, "__item-option__option-label")
89
+ }, Icon && /*#__PURE__*/React__default.createElement(Icon, null), option.label), isSelected && /*#__PURE__*/React__default.createElement(Checkmark, {
90
+ className: "".concat(blockClass, "__checkmark")
91
+ })));
92
+ })));
93
+ };
94
+ ItemOption.propTypes = {
95
+ /**
96
+ * current condition object
97
+ */
98
+ conditionState: PropTypes.object,
99
+ /**
100
+ * current config object that this property is part of
101
+ */
102
+ config: PropTypes.object,
103
+ /**
104
+ * callback to update state oin date change
105
+ */
106
+ onChange: PropTypes.func
107
+ };
108
+
109
+ export { ItemOption };
@@ -1,9 +1,9 @@
1
- export function ConditionBuilderItemOption({ conditionState, config, onChange, }: {
1
+ export function ItemOptionForValueField({ conditionState, config, onChange, }: {
2
2
  conditionState?: {} | undefined;
3
3
  config?: {} | undefined;
4
4
  onChange: any;
5
5
  }): import("react/jsx-runtime").JSX.Element;
6
- export namespace ConditionBuilderItemOption {
6
+ export namespace ItemOptionForValueField {
7
7
  namespace propTypes {
8
8
  let conditionState: PropTypes.Requireable<object>;
9
9
  let config: PropTypes.Requireable<object>;
@@ -6,35 +6,58 @@
6
6
  */
7
7
 
8
8
  import { slicedToArray as _slicedToArray, toConsumableArray as _toConsumableArray, asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
9
- import React__default, { useContext, useState, useRef, useEffect } from 'react';
10
- import { Search, Button, SelectSkeleton } from '@carbon/react';
9
+ import React__default, { useContext, useRef, useState, useEffect } from 'react';
10
+ import { SelectSkeleton, Search, Button } from '@carbon/react';
11
11
  import { CheckboxCheckedFilled, Checkbox, Checkmark } from '@carbon/react/icons';
12
12
  import PropTypes from '../../../../node_modules/prop-types/index.js';
13
13
  import { ConditionBuilderContext } from '../../ConditionBuilderContext/ConditionBuilderProvider.js';
14
14
  import { blockClass, translateWithId } from '../../ConditionBuilderContext/DataConfigs.js';
15
15
 
16
- var _CheckboxCheckedFille, _Checkbox, _SelectSkeleton;
17
- var ConditionBuilderItemOption = function ConditionBuilderItemOption(_ref) {
16
+ var _SelectSkeleton, _CheckboxCheckedFille, _Checkbox;
17
+ var ItemOptionForValueField = function ItemOptionForValueField(_ref) {
18
18
  var _ref$conditionState = _ref.conditionState,
19
19
  conditionState = _ref$conditionState === void 0 ? {} : _ref$conditionState,
20
20
  _ref$config = _ref.config,
21
21
  config = _ref$config === void 0 ? {} : _ref$config,
22
22
  onChange = _ref.onChange;
23
- var multiSelectable = conditionState.operator === 'one-of';
23
+ var multiSelectable = conditionState.operator === 'one_of';
24
24
  var _useContext = useContext(ConditionBuilderContext),
25
25
  popOverSearchThreshold = _useContext.popOverSearchThreshold,
26
- getOptions = _useContext.getOptions;
26
+ getOptions = _useContext.getOptions,
27
+ rootState = _useContext.rootState;
28
+ var contentRef = useRef();
27
29
  var _useState = useState(config.options),
28
30
  _useState2 = _slicedToArray(_useState, 2),
29
31
  allOptions = _useState2[0],
30
32
  setAllOptions = _useState2[1];
31
- var _useState3 = useState(config.options),
33
+ var _useState3 = useState(''),
32
34
  _useState4 = _slicedToArray(_useState3, 2),
33
- filteredItems = _useState4[0],
34
- setFilteredItems = _useState4[1];
35
+ searchValue = _useState4[0],
36
+ setSearchValue = _useState4[1];
37
+ var filteredItems = allOptions === null || allOptions === void 0 ? void 0 : allOptions.filter(function (opt) {
38
+ return opt.label.toLowerCase().includes(searchValue.toLowerCase());
39
+ });
35
40
  var selection = Array.isArray(conditionState.value) ? conditionState.value : conditionState.value !== undefined ? [conditionState.value] : [];
36
- var contentRef = useRef();
37
41
  useEffect(function () {
42
+ // if(rest['data-name'] == 'valueField'){
43
+ // const fetchData = async () => {
44
+ // const response = await config.options(conditionState);
45
+ // if (
46
+ // response?.length > 0 &&
47
+ // Object.keys(response[0]).includes('label') &&
48
+ // Object.keys(response[0]).includes('id')
49
+ // ) {
50
+ // setAllOptions(response);
51
+ // setFilteredItems(response);
52
+ // }
53
+ // };
54
+
55
+ // fetchData(); // Call the async method
56
+ // }else{
57
+ // setAllOptions(config.options);
58
+ // setFilteredItems(config.options);
59
+ // }
60
+
38
61
  if (!allOptions && getOptions) {
39
62
  var fetchData = /*#__PURE__*/function () {
40
63
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
@@ -43,12 +66,11 @@ var ConditionBuilderItemOption = function ConditionBuilderItemOption(_ref) {
43
66
  while (1) switch (_context.prev = _context.next) {
44
67
  case 0:
45
68
  _context.next = 2;
46
- return getOptions(conditionState);
69
+ return getOptions(rootState, conditionState);
47
70
  case 2:
48
71
  response = _context.sent;
49
72
  if ((response === null || response === void 0 ? void 0 : response.length) > 0 && Object.keys(response[0]).includes('label') && Object.keys(response[0]).includes('id')) {
50
73
  setAllOptions(response);
51
- setFilteredItems(response);
52
74
  }
53
75
  case 4:
54
76
  case "end":
@@ -68,46 +90,47 @@ var ConditionBuilderItemOption = function ConditionBuilderItemOption(_ref) {
68
90
  //this will focus the first input field in the popover
69
91
 
70
92
  if (contentRef.current) {
71
- var _contentRef$current;
72
- var firstFocusableElement = (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.querySelector('input, button,li');
73
- firstFocusableElement === null || firstFocusableElement === void 0 || firstFocusableElement.focus();
93
+ var firstFocusableElement = contentRef.current.querySelector('input, button,li');
94
+ if (firstFocusableElement) {
95
+ firstFocusableElement.focus();
96
+ }
74
97
  }
75
- // eslint-disable-next-line react-hooks/exhaustive-deps
76
98
  }, [allOptions]);
77
99
  var handleSelectAll = function handleSelectAll(evt) {
78
100
  if (evt.currentTarget.dataset.selectedAll == 'false') {
79
101
  onChange(undefined);
80
102
  } else {
81
- onChange(allOptions.map(function (op) {
82
- return op.id;
83
- }));
103
+ onChange(allOptions);
84
104
  }
85
105
  };
86
106
  var onSearchChangeHandler = function onSearchChangeHandler(evt) {
87
107
  var value = evt.target.value;
88
- var _filteredItems = allOptions.filter(function (opt) {
89
- return opt.label.toLowerCase().includes(value.toLowerCase());
90
- });
91
- setFilteredItems(_filteredItems);
108
+ setSearchValue(value);
92
109
  };
93
110
  var onClickHandler = function onClickHandler(evt, option, isSelected) {
94
111
  if (multiSelectable) {
95
112
  if (isSelected) {
96
113
  var items = selection.filter(function (v) {
97
- return v !== option.id;
114
+ return v.id !== option.id;
98
115
  });
99
116
  onChange(items.length > 0 ? items : undefined, evt);
100
117
  } else {
101
- onChange([].concat(_toConsumableArray(selection), [option.id]), evt);
118
+ onChange([].concat(_toConsumableArray(selection), [option]), evt);
102
119
  }
103
120
  } else {
104
- onChange(option.id, evt);
121
+ onChange(option, evt);
105
122
  }
106
123
  };
107
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, allOptions && /*#__PURE__*/React__default.createElement("div", {
124
+ var getAriaLabel = function getAriaLabel() {
125
+ return conditionState.label ? conditionState.label : conditionState.property ? conditionState.property : translateWithId('property');
126
+ };
127
+ if (!allOptions) {
128
+ return _SelectSkeleton || (_SelectSkeleton = /*#__PURE__*/React__default.createElement(SelectSkeleton, null));
129
+ }
130
+ return /*#__PURE__*/React__default.createElement("div", {
108
131
  className: "".concat(blockClass, "__item-option"),
109
132
  ref: contentRef
110
- }, (config.includeSearch || allOptions.length > popOverSearchThreshold) && /*#__PURE__*/React__default.createElement("div", {
133
+ }, allOptions.length > popOverSearchThreshold && /*#__PURE__*/React__default.createElement("div", {
111
134
  className: "".concat(blockClass, "__item-option__search")
112
135
  }, /*#__PURE__*/React__default.createElement(Search, {
113
136
  size: "sm",
@@ -123,11 +146,13 @@ var ConditionBuilderItemOption = function ConditionBuilderItemOption(_ref) {
123
146
  onClick: handleSelectAll,
124
147
  className: "".concat(blockClass, "__selectAll-button")
125
148
  }, selection.length == 0 ? 'Select all' : 'Deselect all')), /*#__PURE__*/React__default.createElement("ul", {
126
- "aria-label": conditionState.label ? conditionState.label : conditionState.property ? conditionState.property : translateWithId('property'),
149
+ "aria-label": getAriaLabel(),
127
150
  role: "listbox",
128
151
  "data-multi-select": multiSelectable
129
152
  }, filteredItems === null || filteredItems === void 0 ? void 0 : filteredItems.map(function (option) {
130
- var isSelected = selection.includes(option.id);
153
+ var isSelected = selection.map(function (option) {
154
+ return option.id;
155
+ }).includes(option.id);
131
156
  var Icon = option.icon;
132
157
  return /*#__PURE__*/React__default.createElement("li", {
133
158
  tabIndex: 0,
@@ -154,9 +179,9 @@ var ConditionBuilderItemOption = function ConditionBuilderItemOption(_ref) {
154
179
  }, Icon && /*#__PURE__*/React__default.createElement(Icon, null), option.label), isSelected && /*#__PURE__*/React__default.createElement(Checkmark, {
155
180
  className: "".concat(blockClass, "__checkmark")
156
181
  }))));
157
- }))), !allOptions && (_SelectSkeleton || (_SelectSkeleton = /*#__PURE__*/React__default.createElement(SelectSkeleton, null))));
182
+ })));
158
183
  };
159
- ConditionBuilderItemOption.propTypes = {
184
+ ItemOptionForValueField.propTypes = {
160
185
  /**
161
186
  * current condition object
162
187
  */
@@ -171,4 +196,4 @@ ConditionBuilderItemOption.propTypes = {
171
196
  onChange: PropTypes.func
172
197
  };
173
198
 
174
- export { ConditionBuilderItemOption };
199
+ export { ItemOptionForValueField };
@@ -12,15 +12,14 @@ import PropTypes from '../../../node_modules/prop-types/index.js';
12
12
  import cx from 'classnames';
13
13
  import { blockClass, translateWithId, statementConfig } from '../ConditionBuilderContext/DataConfigs.js';
14
14
  import { ConditionBuilderItem } from '../ConditionBuilderItem/ConditionBuilderItem.js';
15
- import { ConditionBuilderItemOption } from '../ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js';
16
15
  import { focusThisField } from '../utils/util.js';
17
16
  import ConditionConnector from '../ConditionBuilderConnector/ConditionConnector.js';
18
17
  import { ConditionBuilderContext } from '../ConditionBuilderContext/ConditionBuilderProvider.js';
19
18
  import uuidv4 from '../../../global/js/utils/uuidv4.js';
20
19
  import ConditionPreview from '../ConditionPreview/ConditionPreview.js';
20
+ import { ItemOption } from '../ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js';
21
21
 
22
22
  var _ConditionPreview, _ConditionPreview2;
23
-
24
23
  /**
25
24
  *
26
25
  * state - this is the current group that is being rendered . This can be a inner group or outer group
@@ -85,7 +84,6 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
85
84
  var addConditionSubGroupHandler = function addConditionSubGroupHandler(conditionIndex) {
86
85
  onChange(_objectSpread2(_objectSpread2({}, group), {}, {
87
86
  conditions: [].concat(_toConsumableArray(group.conditions.slice(0, conditionIndex + 1)), [{
88
- groupSeparateOperator: null,
89
87
  groupOperator: 'and',
90
88
  statement: 'if',
91
89
  conditions: [{
@@ -178,7 +176,7 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
178
176
  "data-name": "connectorField",
179
177
  popOverClassName: "".concat(blockClass, "__gap"),
180
178
  className: "".concat(blockClass, "__statement-button")
181
- }, /*#__PURE__*/React__default.createElement(ConditionBuilderItemOption, {
179
+ }, /*#__PURE__*/React__default.createElement(ItemOption, {
182
180
  conditionState: {
183
181
  value: group.statement,
184
182
  label: translateWithId('condition')
@@ -214,7 +212,7 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
214
212
  onRemoveHandler(eachCondition.id, e);
215
213
  },
216
214
  conditionBuilderRef: conditionBuilderRef
217
- })) : /*#__PURE__*/React__default.createElement(ConditionBlock, {
215
+ })) : /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(ConditionBlock, {
218
216
  conjunction: conditionIndex > 0 ? group.groupOperator : undefined,
219
217
  aria: {
220
218
  level: aria.level + 1,
@@ -244,7 +242,7 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
244
242
  },
245
243
  hideConditionPreviewHandler: hideConditionPreviewHandler,
246
244
  isLastCondition: isLastCondition
247
- }), conditionIndex == showConditionSubGroupPreview && (_ConditionPreview || (_ConditionPreview = /*#__PURE__*/React__default.createElement(ConditionPreview, {
245
+ })), conditionIndex == showConditionSubGroupPreview && (_ConditionPreview || (_ConditionPreview = /*#__PURE__*/React__default.createElement(ConditionPreview, {
248
246
  previewType: "subGroup"
249
247
  }))), conditionIndex == showConditionPreview && (_ConditionPreview2 || (_ConditionPreview2 = /*#__PURE__*/React__default.createElement(ConditionPreview, {
250
248
  previewType: "condition"
@@ -5,7 +5,9 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import React__default from 'react';
8
+ import { slicedToArray as _slicedToArray, defineProperty as _defineProperty } from '../../../_virtual/_rollupPluginBabelHelpers.js';
9
+ import React__default, { useState, useEffect } from 'react';
10
+ import cx from 'classnames';
9
11
  import PropTypes from '../../../node_modules/prop-types/index.js';
10
12
  import { blockClass, translateWithId } from '../ConditionBuilderContext/DataConfigs.js';
11
13
  import { ConditionBuilderItem } from '../ConditionBuilderItem/ConditionBuilderItem.js';
@@ -13,6 +15,13 @@ import ConditionConnector from '../ConditionBuilderConnector/ConditionConnector.
13
15
 
14
16
  var ConditionPreview = function ConditionPreview(_ref) {
15
17
  var previewType = _ref.previewType;
18
+ var _useState = useState(false),
19
+ _useState2 = _slicedToArray(_useState, 2),
20
+ animate = _useState2[0],
21
+ setAnimate = _useState2[1];
22
+ useEffect(function () {
23
+ setAnimate(true);
24
+ }, []);
16
25
  var getConditionSection = function getConditionSection() {
17
26
  return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
18
27
  label: translateWithId('property')
@@ -23,20 +32,20 @@ var ConditionPreview = function ConditionPreview(_ref) {
23
32
  }));
24
33
  };
25
34
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, previewType == 'newGroup' && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
26
- className: "".concat(blockClass, "__group__row ").concat(blockClass, "__group-preview ")
35
+ className: cx(["".concat(blockClass, "__group__row ").concat(blockClass, "__group-preview "), _defineProperty({}, "".concat(blockClass, "__group-preview-animate"), animate)])
27
36
  }, /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
28
37
  className: "".concat(blockClass, "__statement-button"),
29
38
  label: translateWithId('and')
30
39
  })), /*#__PURE__*/React__default.createElement("div", {
31
40
  "aria-hidden": true,
32
- className: "".concat(blockClass, "__group ").concat(blockClass, "__condition-wrapper ").concat(blockClass, "__group-preview ").concat(blockClass, "__group-wrapper")
41
+ className: cx(["".concat(blockClass, "__group ").concat(blockClass, "__condition-wrapper ").concat(blockClass, "__group-preview ").concat(blockClass, "__group-wrapper "), _defineProperty({}, "".concat(blockClass, "__group-preview-animate"), animate)])
33
42
  }, /*#__PURE__*/React__default.createElement("div", {
34
43
  className: "".concat(blockClass, "__gap")
35
44
  }, /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
36
45
  className: "".concat(blockClass, "__statement-button"),
37
46
  label: translateWithId('if')
38
47
  })), getConditionSection())), previewType == 'subGroup' && /*#__PURE__*/React__default.createElement("div", {
39
- className: "".concat(blockClass, "__group-preview")
48
+ className: cx(["".concat(blockClass, "__group__row ").concat(blockClass, "__group-preview "), _defineProperty({}, "".concat(blockClass, "__group-preview-animate"), animate)])
40
49
  }, /*#__PURE__*/React__default.createElement("div", {
41
50
  className: "".concat(blockClass, "__condition-block ").concat(blockClass, "__gap")
42
51
  }, /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
@@ -49,7 +58,7 @@ var ConditionPreview = function ConditionPreview(_ref) {
49
58
  className: "".concat(blockClass, "__gap ").concat(blockClass, "__groupConnector"),
50
59
  operator: translateWithId('if')
51
60
  }), getConditionSection()))), previewType == 'condition' && /*#__PURE__*/React__default.createElement("div", {
52
- className: "".concat(blockClass, "__group-preview")
61
+ className: cx(["".concat(blockClass, "__group__row ").concat(blockClass, "__group-preview "), _defineProperty({}, "".concat(blockClass, "__group-preview-animate"), animate)])
53
62
  }, /*#__PURE__*/React__default.createElement("div", {
54
63
  className: "".concat(blockClass, "__condition-block ").concat(blockClass, "__gap")
55
64
  }, /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
@@ -7,8 +7,7 @@
7
7
 
8
8
  import { toConsumableArray as _toConsumableArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import { blockClass } from '../ConditionBuilderContext/DataConfigs.js';
10
- import { checkForHoldingKey } from './checkForHoldingKey.js';
11
- import { focusThisField, traverseReverse, traverseClockVise } from './util.js';
10
+ import { checkForHoldingKey, focusThisField, traverseReverse, traverseClockVise } from './util.js';
12
11
 
13
12
  var handleKeyDown = function handleKeyDown(evt, conditionBuilderRef) {
14
13
  var activeElement = document.activeElement;
@@ -3,3 +3,4 @@ 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
5
  export function checkForHoldingKey(evt: any, key: any): any;
6
+ export function checkDuplicateAction(actionState: any, selectedId: any, currentActionId: any): boolean;
@@ -41,5 +41,20 @@ var traverseReverse = function traverseReverse(eachElem, index, allElements, rot
41
41
  focusThisItem(allElements[allElements.length - 1]);
42
42
  }
43
43
  };
44
+ var checkForHoldingKey = function checkForHoldingKey(evt, key) {
45
+ // possible key inputs: altKey,ctrlKey,metaKey,shiftKey
46
+ if (key === 'cmd') {
47
+ return evt.metaKey || evt.ctrlKey;
48
+ }
49
+ return evt[key];
50
+ };
51
+ var checkDuplicateAction = function checkDuplicateAction(actionState, selectedId, currentActionId) {
52
+ if (selectedId !== currentActionId && actionState.find(function (eachAction) {
53
+ return eachAction.id === selectedId;
54
+ })) {
55
+ return true;
56
+ }
57
+ return false;
58
+ };
44
59
 
45
- export { focusThisField, focusThisItem, traverseClockVise, traverseReverse };
60
+ export { checkDuplicateAction, checkForHoldingKey, focusThisField, focusThisItem, traverseClockVise, traverseReverse };
@@ -211,9 +211,12 @@ var DataSpreadsheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
211
211
  }
212
212
  if ((prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.row) !== (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) || (prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.column) !== (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column)) {
213
213
  if (activeCellCoordinates && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) !== 'header' && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) !== 'header') {
214
- var _activeCellFullData$r;
215
214
  var activeCellFullData = typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'number' && typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'number' ? rows[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row].cells[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column] : null;
216
- setActiveCellContent((_activeCellFullData$r = activeCellFullData === null || activeCellFullData === void 0 ? void 0 : activeCellFullData.render('Cell')) !== null && _activeCellFullData$r !== void 0 ? _activeCellFullData$r : null);
215
+ if (activeCellFullData) {
216
+ setActiveCellContent(activeCellFullData.render('Cell'));
217
+ } else {
218
+ setActiveCellContent(null);
219
+ }
217
220
  }
218
221
  if (activeCellCoordinates && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header' || (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header') {
219
222
  setActiveCellContent(null);
@@ -428,8 +431,8 @@ var DataSpreadsheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
428
431
  var activeCellFullData = typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'number' && typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'number' ? rows[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row].cells[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column] : null;
429
432
  var activeCellValue;
430
433
  if (activeCellFullData && activeCellCoordinates !== null && activeCellCoordinates !== void 0 && activeCellCoordinates.column) {
431
- var _activeCellFullData$r2;
432
- activeCellValue = activeCellFullData ? (_activeCellFullData$r2 = activeCellFullData.row.cells) === null || _activeCellFullData$r2 === void 0 || (_activeCellFullData$r2 = _activeCellFullData$r2[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column]) === null || _activeCellFullData$r2 === void 0 ? void 0 : _activeCellFullData$r2.value : null;
434
+ var _activeCellFullData$r;
435
+ activeCellValue = activeCellFullData ? (_activeCellFullData$r = activeCellFullData.row.cells) === null || _activeCellFullData$r === void 0 || (_activeCellFullData$r = _activeCellFullData$r[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column]) === null || _activeCellFullData$r === void 0 ? void 0 : _activeCellFullData$r.value : null;
433
436
  }
434
437
  setCellEditorValue(activeCellValue || '');
435
438
  if (cellEditorRulerRef !== null && cellEditorRulerRef !== void 0 && cellEditorRulerRef.current) {
@@ -46,7 +46,8 @@ var Datagrid = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
46
46
  };
47
47
  return /*#__PURE__*/React__default.createElement(FilterProvider, {
48
48
  filters: state === null || state === void 0 ? void 0 : state.filters,
49
- filterProps: filterProps
49
+ filterProps: filterProps,
50
+ tableId: tableId
50
51
  }, /*#__PURE__*/React__default.createElement(InlineEditProvider, null, /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
51
52
  id: tableId,
52
53
  ref: ref,
@@ -158,7 +158,7 @@ var DatagridContent = function DatagridContent(_ref) {
158
158
  className: "".concat(blockClass, "__filter-summary"),
159
159
  filters: filterTags,
160
160
  clearFilters: function clearFilters() {
161
- return EventEmitter.dispatch(CLEAR_FILTERS);
161
+ return EventEmitter.dispatch(CLEAR_FILTERS, tableId);
162
162
  },
163
163
  renderLabel: filterProps === null || filterProps === void 0 ? void 0 : filterProps.renderLabel,
164
164
  overflowType: "tag"
@@ -90,7 +90,8 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
90
90
  var resizerAriaLabel = datagridState.resizerAriaLabel,
91
91
  isTableSortable = datagridState.isTableSortable,
92
92
  rows = datagridState.rows,
93
- isFetching = datagridState.isFetching;
93
+ isFetching = datagridState.isFetching,
94
+ headers = datagridState.headers;
94
95
  useInitialColumnSort(datagridState);
95
96
  // Used to measure the height of the table and uses that value
96
97
  // to display a vertical line to indicate the column you are resizing
@@ -152,6 +153,9 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
152
153
  });
153
154
  var key = headerGroupProps.key,
154
155
  rowProps = _objectWithoutProperties(headerGroupProps, _excluded2);
156
+ var withActionsColumn = headers ? !!headers.filter(function (header) {
157
+ return header.isAction;
158
+ }).length : false;
155
159
  return /*#__PURE__*/React__default.createElement(TableRow, _extends({
156
160
  key: key
157
161
  }, rowProps, {
@@ -184,6 +188,12 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
184
188
  var _header$getHeaderProp = header.getHeaderProps(),
185
189
  headerProps = _extends({}, (_objectDestructuringEmpty(_header$getHeaderProp), _header$getHeaderProp));
186
190
  var resizerProps = header === null || header === void 0 || (_header$getResizerPro = header.getResizerProps) === null || _header$getResizerPro === void 0 ? void 0 : _header$getResizerPro.call(header);
191
+ var headerStyle = headerProps === null || headerProps === void 0 ? void 0 : headerProps.style;
192
+ var lastVisibleIndex = withActionsColumn ? 2 : 1;
193
+ var lastVisibleFlexStyle = index === visibleColumns.length - lastVisibleIndex ? '1 1 0' : '0 0 auto';
194
+ if (headerStyle) {
195
+ headerStyle.flex = lastVisibleFlexStyle;
196
+ }
187
197
  return /*#__PURE__*/React__default.createElement(TableHeader, _extends({}, headerProps, {
188
198
  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),
189
199
  key: header.id,
@@ -16,7 +16,7 @@ import { DatagridSlug } from './addons/Slug/DatagridSlug.js';
16
16
 
17
17
  var _SkeletonText;
18
18
  var _excluded = ["className"],
19
- _excluded2 = ["children"];
19
+ _excluded2 = ["style", "children"];
20
20
  var blockClass = "".concat(pkg.prefix, "--datagrid");
21
21
  var rowHeights = {
22
22
  xs: 24,
@@ -39,7 +39,8 @@ var DatagridRow = function DatagridRow(datagridState) {
39
39
  withExpandedRows = datagridState.withExpandedRows,
40
40
  withMouseHover = datagridState.withMouseHover,
41
41
  setMouseOverRowIndex = datagridState.setMouseOverRowIndex,
42
- headers = datagridState.headers;
42
+ headers = datagridState.headers,
43
+ visibleColumns = datagridState.visibleColumns;
43
44
  var getVisibleNestedRowCount = function getVisibleNestedRowCount(_ref) {
44
45
  var isExpanded = _ref.isExpanded,
45
46
  subRows = _ref.subRows;
@@ -115,6 +116,9 @@ var DatagridRow = function DatagridRow(datagridState) {
115
116
  return /*#__PURE__*/isValidElement(r === null || r === void 0 || (_r$original = r.original) === null || _r$original === void 0 ? void 0 : _r$original.slug);
116
117
  });
117
118
  var rowClassNames = cx("".concat(blockClass, "__carbon-row"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(blockClass, "__carbon-row-expanded"), row.isExpanded), "".concat(blockClass, "__carbon-row-expandable"), row.canExpand), "".concat(carbon.prefix, "--data-table--selected"), row.isSelected), "".concat(blockClass, "__slug--row"), /*#__PURE__*/isValidElement(row === null || row === void 0 || (_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.slug)));
119
+ var withActionsColumn = headers ? !!headers.filter(function (header) {
120
+ return header.isAction;
121
+ }).length : false;
118
122
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
119
123
  key: key
120
124
  }, /*#__PURE__*/React__default.createElement(TableRow, _extends({}, rowProps, {
@@ -136,6 +140,7 @@ var DatagridRow = function DatagridRow(datagridState) {
136
140
  var cellProps = cell.getCellProps();
137
141
  // eslint-disable-next-line no-unused-vars
138
142
  var _ref2 = cellProps,
143
+ style = _ref2.style,
139
144
  children = _ref2.children,
140
145
  restProps = _objectWithoutProperties(_ref2, _excluded2);
141
146
  var columnClassname = cell === null || cell === void 0 || (_cell$column = cell.column) === null || _cell$column === void 0 ? void 0 : _cell$column.className;
@@ -150,9 +155,15 @@ var DatagridRow = function DatagridRow(datagridState) {
150
155
  var associatedHeader = headers === null || headers === void 0 ? void 0 : headers.filter(function (h) {
151
156
  return h.id === cell.column.id;
152
157
  });
158
+ var lastVisibleIndex = withActionsColumn ? 2 : 1;
159
+ var lastVisibleFlexStyle = index === visibleColumns.length - lastVisibleIndex ? '1 1 0' : '0 0 auto';
160
+ if (style) {
161
+ style.flex = lastVisibleFlexStyle;
162
+ }
153
163
  return /*#__PURE__*/React__default.createElement(TableCell, _extends({
154
164
  className: cx("".concat(blockClass, "__cell"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(blockClass, "__expandable-row-cell"), row.canExpand && index === 0), "".concat(blockClass, "__expandable-row-cell--is-expanded"), row.isExpanded && index === 0), "".concat(blockClass, "__slug--cell"), associatedHeader && associatedHeader.length && /*#__PURE__*/isValidElement((_associatedHeader$ = associatedHeader[0]) === null || _associatedHeader$ === void 0 ? void 0 : _associatedHeader$.slug)), columnClassname)
155
165
  }, restProps, {
166
+ style: style,
156
167
  key: cell.column.id,
157
168
  title: title
158
169
  }), content);
@@ -209,7 +209,12 @@ var FilterFlyout = function FilterFlyout(_ref) {
209
209
  closeFlyout();
210
210
  cancel();
211
211
  });
212
- useSubscribeToEventEmitter(CLEAR_FILTERS, reset);
212
+
213
+ // tableId is passed in from the event emitter from the FilterSummary component
214
+ // in DatagridContent
215
+ useSubscribeToEventEmitter(CLEAR_FILTERS, function (tableId) {
216
+ reset(tableId);
217
+ });
213
218
  useEffect(function reflectLastAppliedFiltersWhenReactTableUpdates() {
214
219
  lastAppliedFilters.current = JSON.stringify(reactTableFiltersState);
215
220
  }, [reactTableFiltersState, lastAppliedFilters]);
@@ -183,7 +183,12 @@ var FilterPanel = function FilterPanel(_ref) {
183
183
  var _filterPanelRef$curre;
184
184
  (_filterPanelRef$curre = filterPanelRef.current) === null || _filterPanelRef$curre === void 0 || _filterPanelRef$curre.style.setProperty('--filter-panel-min-height', rem(filterPanelMinHeight));
185
185
  }, [filterPanelMinHeight]);
186
- useSubscribeToEventEmitter(CLEAR_FILTERS, reset);
186
+
187
+ // tableId is passed in from the event emitter from the FilterSummary component
188
+ // in DatagridContent
189
+ useSubscribeToEventEmitter(CLEAR_FILTERS, function (tableId) {
190
+ reset(tableId);
191
+ });
187
192
  var getScrollableContainerHeight = function getScrollableContainerHeight() {
188
193
  var _filterHeadingRef$cur, _filterSearchRef$curr, _actionSetRef$current;
189
194
  var filterHeadingHeight = (_filterHeadingRef$cur = filterHeadingRef.current) === null || _filterHeadingRef$cur === void 0 ? void 0 : _filterHeadingRef$cur.getBoundingClientRect().height;
@@ -3,16 +3,18 @@ export function clearSingleFilter({ key, value }: {
3
3
  key: any;
4
4
  value: any;
5
5
  }, setAllFilters: any, state: any): void;
6
- export function FilterProvider({ children, filters, filterProps }: {
6
+ export function FilterProvider({ children, filters, filterProps, tableId }: {
7
7
  children: any;
8
8
  filters: any;
9
9
  filterProps: any;
10
+ tableId: any;
10
11
  }): import("react/jsx-runtime").JSX.Element;
11
12
  export namespace FilterProvider {
12
13
  namespace propTypes {
13
14
  let children: PropTypes.Validator<NonNullable<NonNullable<PropTypes.ReactNodeLike>>>;
14
15
  let filterProps: PropTypes.Requireable<object>;
15
16
  let filters: PropTypes.Validator<(object | null | undefined)[]>;
17
+ let tableId: PropTypes.Requireable<string>;
16
18
  }
17
19
  }
18
20
  import React from 'react';