@carbon/ibm-products 2.43.2-canary.3 → 2.43.2-canary.30

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 (172) hide show
  1. package/css/index-full-carbon.css +35 -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 +35 -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 +35 -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 +29 -16
  45. package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +9 -1
  46. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +18 -2
  47. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +8 -0
  48. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +17 -6
  49. package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +4 -1
  50. package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.d.ts +3 -1
  51. package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +15 -3
  52. package/es/components/DataSpreadsheet/types/index.d.ts +1 -1
  53. package/es/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +34 -2
  54. package/es/components/Datagrid/Datagrid/Datagrid.js +2 -1
  55. package/es/components/Datagrid/Datagrid/DatagridContent.js +1 -1
  56. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +11 -1
  57. package/es/components/Datagrid/Datagrid/DatagridRow.js +13 -2
  58. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -1
  59. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -1
  60. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -1
  61. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +6 -3
  62. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.d.ts +1 -1
  63. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +21 -16
  64. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +21 -3
  65. package/es/components/Datagrid/types/index.d.ts +18 -4
  66. package/es/components/Datagrid/useActionsColumn.d.ts +8 -1
  67. package/es/components/Datagrid/useActionsColumn.js +7 -6
  68. package/es/components/Datagrid/useColumnRightAlign.d.ts +8 -1
  69. package/es/components/Datagrid/useColumnRightAlign.js +4 -3
  70. package/es/components/Datagrid/useInlineEdit.js +12 -2
  71. package/es/components/Datagrid/useNestedRows.js +32 -13
  72. package/es/components/Decorator/Decorator.js +2 -1
  73. package/es/components/DecoratorBase/DecoratorBase.js +3 -5
  74. package/es/components/DecoratorDualButton/DecoratorDualButton.js +2 -1
  75. package/es/components/DecoratorLink/DecoratorLink.js +2 -1
  76. package/es/components/DecoratorSingleButton/DecoratorSingleButton.js +2 -1
  77. package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
  78. package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
  79. package/es/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
  80. package/es/components/RemoveModal/RemoveModal.d.ts +4 -0
  81. package/es/components/RemoveModal/RemoveModal.js +7 -1
  82. package/es/components/Tearsheet/Tearsheet.d.ts +8 -1
  83. package/es/components/Tearsheet/Tearsheet.js +9 -1
  84. package/es/components/Tearsheet/TearsheetNarrow.d.ts +11 -0
  85. package/es/components/Tearsheet/TearsheetNarrow.js +12 -0
  86. package/es/components/Tearsheet/TearsheetShell.d.ts +10 -0
  87. package/es/components/Tearsheet/TearsheetShell.js +17 -3
  88. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +23 -21
  89. package/lib/components/ConditionBuilder/ConditionBuilder.js +67 -20
  90. package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +15 -0
  91. package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +137 -0
  92. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +6 -3
  93. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +5 -1
  94. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +16 -4
  95. package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +2 -2
  96. package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +2 -2
  97. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +9 -11
  98. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +36 -32
  99. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +0 -1
  100. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +7 -2
  101. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +6 -1
  102. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +18 -10
  103. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +39 -36
  104. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +12 -10
  105. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +1 -1
  106. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +23 -15
  107. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +20 -5
  108. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +13 -0
  109. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +117 -0
  110. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.d.ts → ItemOptionForValueField.d.ts} +2 -2
  111. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.js → ItemOptionForValueField.js} +56 -31
  112. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +4 -6
  113. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +14 -4
  114. package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +1 -2
  115. package/lib/components/ConditionBuilder/utils/util.d.ts +1 -0
  116. package/lib/components/ConditionBuilder/utils/util.js +17 -0
  117. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +29 -16
  118. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +9 -1
  119. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +18 -2
  120. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +8 -0
  121. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +17 -6
  122. package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +4 -1
  123. package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.d.ts +3 -1
  124. package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +15 -3
  125. package/lib/components/DataSpreadsheet/types/index.d.ts +1 -1
  126. package/lib/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +34 -2
  127. package/lib/components/Datagrid/Datagrid/Datagrid.js +2 -1
  128. package/lib/components/Datagrid/Datagrid/DatagridContent.js +1 -1
  129. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +11 -1
  130. package/lib/components/Datagrid/Datagrid/DatagridRow.js +13 -2
  131. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -1
  132. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -1
  133. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -1
  134. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +6 -3
  135. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.d.ts +1 -1
  136. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +21 -16
  137. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +21 -3
  138. package/lib/components/Datagrid/types/index.d.ts +18 -4
  139. package/lib/components/Datagrid/useActionsColumn.d.ts +8 -1
  140. package/lib/components/Datagrid/useActionsColumn.js +7 -6
  141. package/lib/components/Datagrid/useColumnRightAlign.d.ts +8 -1
  142. package/lib/components/Datagrid/useColumnRightAlign.js +4 -3
  143. package/lib/components/Datagrid/useInlineEdit.js +12 -2
  144. package/lib/components/Datagrid/useNestedRows.js +32 -13
  145. package/lib/components/Decorator/Decorator.js +2 -1
  146. package/lib/components/DecoratorBase/DecoratorBase.js +3 -5
  147. package/lib/components/DecoratorDualButton/DecoratorDualButton.js +2 -1
  148. package/lib/components/DecoratorLink/DecoratorLink.js +2 -1
  149. package/lib/components/DecoratorSingleButton/DecoratorSingleButton.js +2 -1
  150. package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
  151. package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
  152. package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
  153. package/lib/components/RemoveModal/RemoveModal.d.ts +4 -0
  154. package/lib/components/RemoveModal/RemoveModal.js +7 -1
  155. package/lib/components/Tearsheet/Tearsheet.d.ts +8 -1
  156. package/lib/components/Tearsheet/Tearsheet.js +9 -1
  157. package/lib/components/Tearsheet/TearsheetNarrow.d.ts +11 -0
  158. package/lib/components/Tearsheet/TearsheetNarrow.js +12 -0
  159. package/lib/components/Tearsheet/TearsheetShell.d.ts +10 -0
  160. package/lib/components/Tearsheet/TearsheetShell.js +16 -2
  161. package/package.json +3 -3
  162. package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +9 -1
  163. package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +26 -1
  164. package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +1 -0
  165. package/scss/components/StatusIcon/_status-icon.scss +4 -4
  166. package/scss/components/StringFormatter/_string-formatter.scss +2 -2
  167. package/scss/components/UserProfileImage/_user-profile-image.scss +6 -2
  168. package/telemetry.yml +1 -0
  169. package/es/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +0 -1
  170. package/es/components/ConditionBuilder/utils/checkForHoldingKey.js +0 -16
  171. package/lib/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +0 -1
  172. package/lib/components/ConditionBuilder/utils/checkForHoldingKey.js +0 -20
@@ -21,28 +21,51 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
21
21
 
22
22
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
23
23
 
24
- var _CheckboxCheckedFille, _Checkbox, _SelectSkeleton;
25
- var ConditionBuilderItemOption = function ConditionBuilderItemOption(_ref) {
24
+ var _SelectSkeleton, _CheckboxCheckedFille, _Checkbox;
25
+ var ItemOptionForValueField = function ItemOptionForValueField(_ref) {
26
26
  var _ref$conditionState = _ref.conditionState,
27
27
  conditionState = _ref$conditionState === void 0 ? {} : _ref$conditionState,
28
28
  _ref$config = _ref.config,
29
29
  config = _ref$config === void 0 ? {} : _ref$config,
30
30
  onChange = _ref.onChange;
31
- var multiSelectable = conditionState.operator === 'one-of';
31
+ var multiSelectable = conditionState.operator === 'one_of';
32
32
  var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
33
33
  popOverSearchThreshold = _useContext.popOverSearchThreshold,
34
- getOptions = _useContext.getOptions;
34
+ getOptions = _useContext.getOptions,
35
+ rootState = _useContext.rootState;
36
+ var contentRef = React.useRef();
35
37
  var _useState = React.useState(config.options),
36
38
  _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
37
39
  allOptions = _useState2[0],
38
40
  setAllOptions = _useState2[1];
39
- var _useState3 = React.useState(config.options),
41
+ var _useState3 = React.useState(''),
40
42
  _useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
41
- filteredItems = _useState4[0],
42
- setFilteredItems = _useState4[1];
43
+ searchValue = _useState4[0],
44
+ setSearchValue = _useState4[1];
45
+ var filteredItems = allOptions === null || allOptions === void 0 ? void 0 : allOptions.filter(function (opt) {
46
+ return opt.label.toLowerCase().includes(searchValue.toLowerCase());
47
+ });
43
48
  var selection = Array.isArray(conditionState.value) ? conditionState.value : conditionState.value !== undefined ? [conditionState.value] : [];
44
- var contentRef = React.useRef();
45
49
  React.useEffect(function () {
50
+ // if(rest['data-name'] == 'valueField'){
51
+ // const fetchData = async () => {
52
+ // const response = await config.options(conditionState);
53
+ // if (
54
+ // response?.length > 0 &&
55
+ // Object.keys(response[0]).includes('label') &&
56
+ // Object.keys(response[0]).includes('id')
57
+ // ) {
58
+ // setAllOptions(response);
59
+ // setFilteredItems(response);
60
+ // }
61
+ // };
62
+
63
+ // fetchData(); // Call the async method
64
+ // }else{
65
+ // setAllOptions(config.options);
66
+ // setFilteredItems(config.options);
67
+ // }
68
+
46
69
  if (!allOptions && getOptions) {
47
70
  var fetchData = /*#__PURE__*/function () {
48
71
  var _ref2 = _rollupPluginBabelHelpers.asyncToGenerator( /*#__PURE__*/_rollupPluginBabelHelpers.regeneratorRuntime().mark(function _callee() {
@@ -51,12 +74,11 @@ var ConditionBuilderItemOption = function ConditionBuilderItemOption(_ref) {
51
74
  while (1) switch (_context.prev = _context.next) {
52
75
  case 0:
53
76
  _context.next = 2;
54
- return getOptions(conditionState);
77
+ return getOptions(rootState, conditionState);
55
78
  case 2:
56
79
  response = _context.sent;
57
80
  if ((response === null || response === void 0 ? void 0 : response.length) > 0 && Object.keys(response[0]).includes('label') && Object.keys(response[0]).includes('id')) {
58
81
  setAllOptions(response);
59
- setFilteredItems(response);
60
82
  }
61
83
  case 4:
62
84
  case "end":
@@ -76,46 +98,47 @@ var ConditionBuilderItemOption = function ConditionBuilderItemOption(_ref) {
76
98
  //this will focus the first input field in the popover
77
99
 
78
100
  if (contentRef.current) {
79
- var _contentRef$current;
80
- var firstFocusableElement = (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.querySelector('input, button,li');
81
- firstFocusableElement === null || firstFocusableElement === void 0 || firstFocusableElement.focus();
101
+ var firstFocusableElement = contentRef.current.querySelector('input, button,li');
102
+ if (firstFocusableElement) {
103
+ firstFocusableElement.focus();
104
+ }
82
105
  }
83
- // eslint-disable-next-line react-hooks/exhaustive-deps
84
106
  }, [allOptions]);
85
107
  var handleSelectAll = function handleSelectAll(evt) {
86
108
  if (evt.currentTarget.dataset.selectedAll == 'false') {
87
109
  onChange(undefined);
88
110
  } else {
89
- onChange(allOptions.map(function (op) {
90
- return op.id;
91
- }));
111
+ onChange(allOptions);
92
112
  }
93
113
  };
94
114
  var onSearchChangeHandler = function onSearchChangeHandler(evt) {
95
115
  var value = evt.target.value;
96
- var _filteredItems = allOptions.filter(function (opt) {
97
- return opt.label.toLowerCase().includes(value.toLowerCase());
98
- });
99
- setFilteredItems(_filteredItems);
116
+ setSearchValue(value);
100
117
  };
101
118
  var onClickHandler = function onClickHandler(evt, option, isSelected) {
102
119
  if (multiSelectable) {
103
120
  if (isSelected) {
104
121
  var items = selection.filter(function (v) {
105
- return v !== option.id;
122
+ return v.id !== option.id;
106
123
  });
107
124
  onChange(items.length > 0 ? items : undefined, evt);
108
125
  } else {
109
- onChange([].concat(_rollupPluginBabelHelpers.toConsumableArray(selection), [option.id]), evt);
126
+ onChange([].concat(_rollupPluginBabelHelpers.toConsumableArray(selection), [option]), evt);
110
127
  }
111
128
  } else {
112
- onChange(option.id, evt);
129
+ onChange(option, evt);
113
130
  }
114
131
  };
115
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, allOptions && /*#__PURE__*/React__default["default"].createElement("div", {
132
+ var getAriaLabel = function getAriaLabel() {
133
+ return conditionState.label ? conditionState.label : conditionState.property ? conditionState.property : DataConfigs.translateWithId('property');
134
+ };
135
+ if (!allOptions) {
136
+ return _SelectSkeleton || (_SelectSkeleton = /*#__PURE__*/React__default["default"].createElement(react.SelectSkeleton, null));
137
+ }
138
+ return /*#__PURE__*/React__default["default"].createElement("div", {
116
139
  className: "".concat(DataConfigs.blockClass, "__item-option"),
117
140
  ref: contentRef
118
- }, (config.includeSearch || allOptions.length > popOverSearchThreshold) && /*#__PURE__*/React__default["default"].createElement("div", {
141
+ }, allOptions.length > popOverSearchThreshold && /*#__PURE__*/React__default["default"].createElement("div", {
119
142
  className: "".concat(DataConfigs.blockClass, "__item-option__search")
120
143
  }, /*#__PURE__*/React__default["default"].createElement(react.Search, {
121
144
  size: "sm",
@@ -131,11 +154,13 @@ var ConditionBuilderItemOption = function ConditionBuilderItemOption(_ref) {
131
154
  onClick: handleSelectAll,
132
155
  className: "".concat(DataConfigs.blockClass, "__selectAll-button")
133
156
  }, selection.length == 0 ? 'Select all' : 'Deselect all')), /*#__PURE__*/React__default["default"].createElement("ul", {
134
- "aria-label": conditionState.label ? conditionState.label : conditionState.property ? conditionState.property : DataConfigs.translateWithId('property'),
157
+ "aria-label": getAriaLabel(),
135
158
  role: "listbox",
136
159
  "data-multi-select": multiSelectable
137
160
  }, filteredItems === null || filteredItems === void 0 ? void 0 : filteredItems.map(function (option) {
138
- var isSelected = selection.includes(option.id);
161
+ var isSelected = selection.map(function (option) {
162
+ return option.id;
163
+ }).includes(option.id);
139
164
  var Icon = option.icon;
140
165
  return /*#__PURE__*/React__default["default"].createElement("li", {
141
166
  tabIndex: 0,
@@ -162,9 +187,9 @@ var ConditionBuilderItemOption = function ConditionBuilderItemOption(_ref) {
162
187
  }, Icon && /*#__PURE__*/React__default["default"].createElement(Icon, null), option.label), isSelected && /*#__PURE__*/React__default["default"].createElement(icons.Checkmark, {
163
188
  className: "".concat(DataConfigs.blockClass, "__checkmark")
164
189
  }))));
165
- }))), !allOptions && (_SelectSkeleton || (_SelectSkeleton = /*#__PURE__*/React__default["default"].createElement(react.SelectSkeleton, null))));
190
+ })));
166
191
  };
167
- ConditionBuilderItemOption.propTypes = {
192
+ ItemOptionForValueField.propTypes = {
168
193
  /**
169
194
  * current condition object
170
195
  */
@@ -179,4 +204,4 @@ ConditionBuilderItemOption.propTypes = {
179
204
  onChange: index["default"].func
180
205
  };
181
206
 
182
- exports.ConditionBuilderItemOption = ConditionBuilderItemOption;
207
+ exports.ItemOptionForValueField = ItemOptionForValueField;
@@ -16,12 +16,12 @@ var index = require('../../../node_modules/prop-types/index.js');
16
16
  var cx = require('classnames');
17
17
  var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
18
18
  var ConditionBuilderItem = require('../ConditionBuilderItem/ConditionBuilderItem.js');
19
- var ConditionBuilderItemOption = require('../ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js');
20
19
  var util = require('../utils/util.js');
21
20
  var ConditionConnector = require('../ConditionBuilderConnector/ConditionConnector.js');
22
21
  var ConditionBuilderProvider = require('../ConditionBuilderContext/ConditionBuilderProvider.js');
23
22
  var uuidv4 = require('../../../global/js/utils/uuidv4.js');
24
23
  var ConditionPreview = require('../ConditionPreview/ConditionPreview.js');
24
+ var ItemOption = require('../ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js');
25
25
 
26
26
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
27
27
 
@@ -29,7 +29,6 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
29
29
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
30
30
 
31
31
  var _ConditionPreview, _ConditionPreview2;
32
-
33
32
  /**
34
33
  *
35
34
  * state - this is the current group that is being rendered . This can be a inner group or outer group
@@ -94,7 +93,6 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
94
93
  var addConditionSubGroupHandler = function addConditionSubGroupHandler(conditionIndex) {
95
94
  onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
96
95
  conditions: [].concat(_rollupPluginBabelHelpers.toConsumableArray(group.conditions.slice(0, conditionIndex + 1)), [{
97
- groupSeparateOperator: null,
98
96
  groupOperator: 'and',
99
97
  statement: 'if',
100
98
  conditions: [{
@@ -187,7 +185,7 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
187
185
  "data-name": "connectorField",
188
186
  popOverClassName: "".concat(DataConfigs.blockClass, "__gap"),
189
187
  className: "".concat(DataConfigs.blockClass, "__statement-button")
190
- }, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItemOption.ConditionBuilderItemOption, {
188
+ }, /*#__PURE__*/React__default["default"].createElement(ItemOption.ItemOption, {
191
189
  conditionState: {
192
190
  value: group.statement,
193
191
  label: DataConfigs.translateWithId('condition')
@@ -223,7 +221,7 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
223
221
  onRemoveHandler(eachCondition.id, e);
224
222
  },
225
223
  conditionBuilderRef: conditionBuilderRef
226
- })) : /*#__PURE__*/React__default["default"].createElement(ConditionBlock["default"], {
224
+ })) : /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(ConditionBlock["default"], {
227
225
  conjunction: conditionIndex > 0 ? group.groupOperator : undefined,
228
226
  aria: {
229
227
  level: aria.level + 1,
@@ -253,7 +251,7 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
253
251
  },
254
252
  hideConditionPreviewHandler: hideConditionPreviewHandler,
255
253
  isLastCondition: isLastCondition
256
- }), conditionIndex == showConditionSubGroupPreview && (_ConditionPreview || (_ConditionPreview = /*#__PURE__*/React__default["default"].createElement(ConditionPreview["default"], {
254
+ })), conditionIndex == showConditionSubGroupPreview && (_ConditionPreview || (_ConditionPreview = /*#__PURE__*/React__default["default"].createElement(ConditionPreview["default"], {
257
255
  previewType: "subGroup"
258
256
  }))), conditionIndex == showConditionPreview && (_ConditionPreview2 || (_ConditionPreview2 = /*#__PURE__*/React__default["default"].createElement(ConditionPreview["default"], {
259
257
  previewType: "condition"
@@ -9,7 +9,9 @@
9
9
 
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
+ var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
12
13
  var React = require('react');
14
+ var cx = require('classnames');
13
15
  var index = require('../../../node_modules/prop-types/index.js');
14
16
  var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
15
17
  var ConditionBuilderItem = require('../ConditionBuilderItem/ConditionBuilderItem.js');
@@ -18,9 +20,17 @@ var ConditionConnector = require('../ConditionBuilderConnector/ConditionConnecto
18
20
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
19
21
 
20
22
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
23
+ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
21
24
 
22
25
  var ConditionPreview = function ConditionPreview(_ref) {
23
26
  var previewType = _ref.previewType;
27
+ var _useState = React.useState(false),
28
+ _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
29
+ animate = _useState2[0],
30
+ setAnimate = _useState2[1];
31
+ React.useEffect(function () {
32
+ setAnimate(true);
33
+ }, []);
24
34
  var getConditionSection = function getConditionSection() {
25
35
  return /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
26
36
  label: DataConfigs.translateWithId('property')
@@ -31,20 +41,20 @@ var ConditionPreview = function ConditionPreview(_ref) {
31
41
  }));
32
42
  };
33
43
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, previewType == 'newGroup' && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
34
- className: "".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview ")
44
+ className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
35
45
  }, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
36
46
  className: "".concat(DataConfigs.blockClass, "__statement-button"),
37
47
  label: DataConfigs.translateWithId('and')
38
48
  })), /*#__PURE__*/React__default["default"].createElement("div", {
39
49
  "aria-hidden": true,
40
- className: "".concat(DataConfigs.blockClass, "__group ").concat(DataConfigs.blockClass, "__condition-wrapper ").concat(DataConfigs.blockClass, "__group-preview ").concat(DataConfigs.blockClass, "__group-wrapper")
50
+ className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group ").concat(DataConfigs.blockClass, "__condition-wrapper ").concat(DataConfigs.blockClass, "__group-preview ").concat(DataConfigs.blockClass, "__group-wrapper "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
41
51
  }, /*#__PURE__*/React__default["default"].createElement("div", {
42
52
  className: "".concat(DataConfigs.blockClass, "__gap")
43
53
  }, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
44
54
  className: "".concat(DataConfigs.blockClass, "__statement-button"),
45
55
  label: DataConfigs.translateWithId('if')
46
56
  })), getConditionSection())), previewType == 'subGroup' && /*#__PURE__*/React__default["default"].createElement("div", {
47
- className: "".concat(DataConfigs.blockClass, "__group-preview")
57
+ className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
48
58
  }, /*#__PURE__*/React__default["default"].createElement("div", {
49
59
  className: "".concat(DataConfigs.blockClass, "__condition-block ").concat(DataConfigs.blockClass, "__gap")
50
60
  }, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
@@ -57,7 +67,7 @@ var ConditionPreview = function ConditionPreview(_ref) {
57
67
  className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__groupConnector"),
58
68
  operator: DataConfigs.translateWithId('if')
59
69
  }), getConditionSection()))), previewType == 'condition' && /*#__PURE__*/React__default["default"].createElement("div", {
60
- className: "".concat(DataConfigs.blockClass, "__group-preview")
70
+ className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
61
71
  }, /*#__PURE__*/React__default["default"].createElement("div", {
62
72
  className: "".concat(DataConfigs.blockClass, "__condition-block ").concat(DataConfigs.blockClass, "__gap")
63
73
  }, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
@@ -11,7 +11,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
12
  var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
13
13
  var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
14
- var checkForHoldingKey = require('./checkForHoldingKey.js');
15
14
  var util = require('./util.js');
16
15
 
17
16
  var handleKeyDown = function handleKeyDown(evt, conditionBuilderRef) {
@@ -25,7 +24,7 @@ var handleKeyDown = function handleKeyDown(evt, conditionBuilderRef) {
25
24
  var handleKeyPressForPopover = function handleKeyPressForPopover(evt, parentContainer) {
26
25
  var _parentContainer$quer;
27
26
  var key = evt.key;
28
- var isHoldingShiftKey = checkForHoldingKey.checkForHoldingKey(evt, 'shiftKey');
27
+ var isHoldingShiftKey = util.checkForHoldingKey(evt, 'shiftKey');
29
28
  var isMultiSelect = (_parentContainer$quer = parentContainer.querySelector('ul')) === null || _parentContainer$quer === void 0 ? void 0 : _parentContainer$quer.dataset.multiSelect;
30
29
  var allItems = [];
31
30
  switch (key) {
@@ -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;
@@ -45,7 +45,24 @@ var traverseReverse = function traverseReverse(eachElem, index, allElements, rot
45
45
  focusThisItem(allElements[allElements.length - 1]);
46
46
  }
47
47
  };
48
+ var checkForHoldingKey = function checkForHoldingKey(evt, key) {
49
+ // possible key inputs: altKey,ctrlKey,metaKey,shiftKey
50
+ if (key === 'cmd') {
51
+ return evt.metaKey || evt.ctrlKey;
52
+ }
53
+ return evt[key];
54
+ };
55
+ var checkDuplicateAction = function checkDuplicateAction(actionState, selectedId, currentActionId) {
56
+ if (selectedId !== currentActionId && actionState.find(function (eachAction) {
57
+ return eachAction.id === selectedId;
58
+ })) {
59
+ return true;
60
+ }
61
+ return false;
62
+ };
48
63
 
64
+ exports.checkDuplicateAction = checkDuplicateAction;
65
+ exports.checkForHoldingKey = checkForHoldingKey;
49
66
  exports.focusThisField = focusThisField;
50
67
  exports.focusThisItem = focusThisItem;
51
68
  exports.traverseClockVise = traverseClockVise;
@@ -121,15 +121,19 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
121
121
  _useState18 = _rollupPluginBabelHelpers.slicedToArray(_useState17, 2),
122
122
  headerCellHoldActive = _useState18[0],
123
123
  setHeaderCellHoldActive = _useState18[1];
124
- var isBlurSpreadsheet = React.useRef(false);
125
124
  var _useState19 = React.useState(false),
126
125
  _useState20 = _rollupPluginBabelHelpers.slicedToArray(_useState19, 2),
127
- isActiveHeaderCellChanged = _useState20[0],
128
- setIsActiveHeaderCellChanged = _useState20[1];
126
+ selectedHeaderReorderActive = _useState20[0],
127
+ setSelectedHeaderReorderActive = _useState20[1];
128
+ var isBlurSpreadsheet = React.useRef(false);
129
129
  var _useState21 = React.useState(false),
130
130
  _useState22 = _rollupPluginBabelHelpers.slicedToArray(_useState21, 2),
131
- activeCellInsideSelectionArea = _useState22[0],
132
- setActiveCellInsideSelectionArea = _useState22[1];
131
+ isActiveHeaderCellChanged = _useState22[0],
132
+ setIsActiveHeaderCellChanged = _useState22[1];
133
+ var _useState23 = React.useState(false),
134
+ _useState24 = _rollupPluginBabelHelpers.slicedToArray(_useState23, 2),
135
+ activeCellInsideSelectionArea = _useState24[0],
136
+ setActiveCellInsideSelectionArea = _useState24[1];
133
137
  var previousState = usePreviousValue.usePreviousValue({
134
138
  activeCellCoordinates: activeCellCoordinates,
135
139
  isEditing: isEditing,
@@ -137,10 +141,10 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
137
141
  }) || {};
138
142
  var cellSizeValue = getCellSize.getCellSize(cellSize);
139
143
  var cellEditorRef = React.useRef();
140
- var _useState23 = React.useState(),
141
- _useState24 = _rollupPluginBabelHelpers.slicedToArray(_useState23, 2),
142
- activeCellContent = _useState24[0],
143
- setActiveCellContent = _useState24[1];
144
+ var _useState25 = React.useState(),
145
+ _useState26 = _rollupPluginBabelHelpers.slicedToArray(_useState25, 2),
146
+ activeCellContent = _useState26[0],
147
+ setActiveCellContent = _useState26[1];
144
148
  var activeCellRef = React.useRef();
145
149
  var cellEditorRulerRef = React.useRef();
146
150
  var defaultColumn = React.useMemo(function () {
@@ -216,9 +220,12 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
216
220
  }
217
221
  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)) {
218
222
  if (activeCellCoordinates && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) !== 'header' && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) !== 'header') {
219
- var _activeCellFullData$r;
220
223
  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;
221
- setActiveCellContent((_activeCellFullData$r = activeCellFullData === null || activeCellFullData === void 0 ? void 0 : activeCellFullData.render('Cell')) !== null && _activeCellFullData$r !== void 0 ? _activeCellFullData$r : null);
224
+ if (activeCellFullData) {
225
+ setActiveCellContent(activeCellFullData.render('Cell'));
226
+ } else {
227
+ setActiveCellContent(null);
228
+ }
222
229
  }
223
230
  if (activeCellCoordinates && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header' || (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header') {
224
231
  setActiveCellContent(null);
@@ -433,8 +440,8 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
433
440
  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;
434
441
  var activeCellValue;
435
442
  if (activeCellFullData && activeCellCoordinates !== null && activeCellCoordinates !== void 0 && activeCellCoordinates.column) {
436
- var _activeCellFullData$r2;
437
- 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;
443
+ var _activeCellFullData$r;
444
+ 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;
438
445
  }
439
446
  setCellEditorValue(activeCellValue || '');
440
447
  if (cellEditorRulerRef !== null && cellEditorRulerRef !== void 0 && cellEditorRulerRef.current) {
@@ -624,6 +631,8 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
624
631
  columns: columns,
625
632
  currentMatcher: currentMatcher,
626
633
  defaultColumn: defaultColumn,
634
+ selectedHeaderReorderActive: selectedHeaderReorderActive,
635
+ setSelectedHeaderReorderActive: setSelectedHeaderReorderActive,
627
636
  headerGroups: headerGroups,
628
637
  rows: rows,
629
638
  scrollBarSize: scrollBarSize,
@@ -647,6 +656,8 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
647
656
  currentMatcher: currentMatcher,
648
657
  setCurrentMatcher: setCurrentMatcher,
649
658
  setContainerHasFocus: setContainerHasFocus,
659
+ selectedHeaderReorderActive: selectedHeaderReorderActive,
660
+ setSelectedHeaderReorderActive: setSelectedHeaderReorderActive,
650
661
  selectionAreas: selectionAreas,
651
662
  setSelectionAreas: setSelectionAreas,
652
663
  headerGroups: headerGroups,
@@ -697,9 +708,11 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
697
708
  updateData: updateData
698
709
  }),
699
710
  onChange: function onChange(event) {
700
- setCellEditorValue(event.target.value);
701
- if (cellEditorRulerRef !== null && cellEditorRulerRef !== void 0 && cellEditorRulerRef.current) {
702
- cellEditorRulerRef.current.textContent = event.target.value;
711
+ if (previousState.isEditing) {
712
+ setCellEditorValue(event.target.value);
713
+ if (cellEditorRulerRef !== null && cellEditorRulerRef !== void 0 && cellEditorRulerRef.current) {
714
+ cellEditorRulerRef.current.textContent = event.target.value;
715
+ }
703
716
  }
704
717
  },
705
718
  ref: cellEditorRef,
@@ -79,7 +79,15 @@ interface DataSpreadsheetBodyProps {
79
79
  /**
80
80
  * Array of selection area data
81
81
  */
82
- selectionAreaData?: object[];
82
+ selectionAreaData?: any[];
83
+ /**
84
+ * Header reordering is active
85
+ */
86
+ selectedHeaderReorderActive?: boolean;
87
+ /**
88
+ * Set header reordering active or not
89
+ */
90
+ setSelectedHeaderReorderActive?: Dispatch<SetStateAction<boolean>>;
83
91
  /**
84
92
  * Array of selection areas
85
93
  */
@@ -49,6 +49,8 @@ var DataSpreadsheetBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
49
49
  selectionAreaData = _ref.selectionAreaData,
50
50
  setSelectionAreaData = _ref.setSelectionAreaData,
51
51
  setActiveCellCoordinates = _ref.setActiveCellCoordinates,
52
+ selectedHeaderReorderActive = _ref.selectedHeaderReorderActive,
53
+ setSelectedHeaderReorderActive = _ref.setSelectedHeaderReorderActive,
52
54
  selectionAreas = _ref.selectionAreas,
53
55
  setContainerHasFocus = _ref.setContainerHasFocus,
54
56
  setSelectionAreas = _ref.setSelectionAreas,
@@ -84,8 +86,12 @@ var DataSpreadsheetBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
84
86
  // back to the consumer
85
87
  React.useEffect(function () {
86
88
  if (selectionAreaData !== null && selectionAreaData !== void 0 && selectionAreaData.length) {
87
- var _previousState$select;
88
- if (!clickAndHoldActive && previousState !== null && previousState !== void 0 && previousState.clickAndHoldActive || (previousState === null || previousState === void 0 || (_previousState$select = previousState.selectionAreaData) === null || _previousState$select === void 0 ? void 0 : _previousState$select.length) !== (selectionAreaData === null || selectionAreaData === void 0 ? void 0 : selectionAreaData.length)) {
89
+ var _previousState$select, _selectionAreaData$, _previousState$select2;
90
+ var selectionChanged = false;
91
+ if ((previousState === null || previousState === void 0 || (_previousState$select = previousState.selectionAreaData) === null || _previousState$select === void 0 ? void 0 : _previousState$select.length) !== (selectionAreaData === null || selectionAreaData === void 0 ? void 0 : selectionAreaData.length) || (selectionAreaData === null || selectionAreaData === void 0 || (_selectionAreaData$ = selectionAreaData[0]) === null || _selectionAreaData$ === void 0 ? void 0 : _selectionAreaData$.cells.length) !== (previousState === null || previousState === void 0 || (_previousState$select2 = previousState.selectionAreaData) === null || _previousState$select2 === void 0 || (_previousState$select2 = _previousState$select2[0]) === null || _previousState$select2 === void 0 ? void 0 : _previousState$select2.cells.length)) {
92
+ selectionChanged = true;
93
+ }
94
+ if (!clickAndHoldActive && previousState !== null && previousState !== void 0 && previousState.clickAndHoldActive || selectionChanged) {
89
95
  onSelectionAreaChange === null || onSelectionAreaChange === void 0 || onSelectionAreaChange(selectionAreaData);
90
96
  }
91
97
  }
@@ -160,6 +166,8 @@ var DataSpreadsheetBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
160
166
  setClickAndHoldActive: setClickAndHoldActive,
161
167
  setSelectionAreas: setSelectionAreas,
162
168
  setValidStartingPoint: setValidStartingPoint,
169
+ selectedHeaderReorderActive: selectedHeaderReorderActive,
170
+ setSelectedHeaderReorderActive: setSelectedHeaderReorderActive,
163
171
  validStartingPoint: validStartingPoint,
164
172
  ref: ref,
165
173
  setHeaderCellHoldActive: setHeaderCellHoldActive,
@@ -466,6 +474,10 @@ DataSpreadsheetBody.propTypes = {
466
474
  * The scrollbar width
467
475
  */
468
476
  scrollBarSize: index["default"].number,
477
+ /**
478
+ * Header reordering is active
479
+ */
480
+ selectedHeaderReorderActive: index["default"].bool,
469
481
  /**
470
482
  * Array of selection area data
471
483
  */
@@ -502,6 +514,10 @@ DataSpreadsheetBody.propTypes = {
502
514
  * Setter fn for header cell hold active value
503
515
  */
504
516
  setHeaderCellHoldActive: index["default"].func,
517
+ /**
518
+ * Set header reordering active or not
519
+ */
520
+ setSelectedHeaderReorderActive: index["default"].func,
505
521
  /**
506
522
  * Setter fn for selectionAreaData state value
507
523
  */
@@ -56,6 +56,14 @@ interface DataSpreadsheetHeaderProps {
56
56
  * Setter fn for activeCellCoordinates value
57
57
  */
58
58
  setActiveCellCoordinates?: Dispatch<SetStateAction<ActiveCellCoordinates | null>>;
59
+ /**
60
+ * Header reordering is active
61
+ */
62
+ selectedHeaderReorderActive?: boolean;
63
+ /**
64
+ * Set header reordering active or not
65
+ */
66
+ setSelectedHeaderReorderActive?: Dispatch<SetStateAction<boolean>>;
59
67
  /**
60
68
  * Setter fn for currentMatcher value
61
69
  */
@@ -40,6 +40,8 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
40
40
  headerGroups = _ref.headerGroups,
41
41
  scrollBarSize = _ref.scrollBarSize,
42
42
  selectionAreas = _ref.selectionAreas,
43
+ selectedHeaderReorderActive = _ref.selectedHeaderReorderActive,
44
+ setSelectedHeaderReorderActive = _ref.setSelectedHeaderReorderActive,
43
45
  setActiveCellCoordinates = _ref.setActiveCellCoordinates,
44
46
  setCurrentMatcher = _ref.setCurrentMatcher,
45
47
  setSelectionAreas = _ref.setSelectionAreas,
@@ -55,10 +57,6 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
55
57
  _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
56
58
  scrollBarSizeValue = _useState2[0],
57
59
  setScrollBarSizeValue = _useState2[1];
58
- var _useState3 = React.useState(false),
59
- _useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
60
- selectedHeaderReorderActive = _useState4[0],
61
- setSelectedHeaderReorderActive = _useState4[1];
62
60
  var previousState = usePreviousValue.usePreviousValue({
63
61
  cellSize: cellSize
64
62
  }) || {};
@@ -116,11 +114,16 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
116
114
  // Remove columns, need to call handleHeaderCellSelection
117
115
  return;
118
116
  }
119
- setSelectedHeaderReorderActive(true);
120
117
  var selectionAreaToClone = selectionAreas === null || selectionAreas === void 0 ? void 0 : selectionAreas.filter(function (item) {
121
118
  return (item === null || item === void 0 ? void 0 : item.matcher) === currentMatcher;
122
119
  });
123
120
  var selectionAreaElement = ref.current.querySelector("[data-matcher-id=\"".concat(selectionAreaToClone === null || selectionAreaToClone === void 0 || (_selectionAreaToClone = selectionAreaToClone[0]) === null || _selectionAreaToClone === void 0 ? void 0 : _selectionAreaToClone.matcher, "\"]"));
121
+ if (selectionAreaElement) {
122
+ selectionAreaElement.classList.add("".concat(blockClass, "__selection-area--element"));
123
+ }
124
+ if (typeof setSelectedHeaderReorderActive === 'function') {
125
+ setSelectedHeaderReorderActive(true);
126
+ }
124
127
  var clickXPosition = event.clientX;
125
128
  var headerButtonCoords = event.target.getBoundingClientRect();
126
129
  var headerIndex = event.target.getAttribute('data-column-index');
@@ -198,7 +201,7 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
198
201
  "data-column-index": index,
199
202
  tabIndex: -1,
200
203
  onMouseDown: selectedHeader ? handleHeaderMouseDown(index) : undefined,
201
- onMouseUp: selectedHeader ? function () {
204
+ onMouseUp: selectedHeader && typeof setSelectedHeaderReorderActive === 'function' ? function () {
202
205
  return setSelectedHeaderReorderActive(false);
203
206
  } : undefined,
204
207
  onClick: !selectedHeader ? handleColumnHeaderClick(index) : undefined,
@@ -263,6 +266,10 @@ DataSpreadsheetHeader.propTypes = {
263
266
  * The aria label applied to the Select all button
264
267
  */
265
268
  selectAllAriaLabel: index["default"].string.isRequired,
269
+ /**
270
+ * Header reordering is active
271
+ */
272
+ selectedHeaderReorderActive: index["default"].bool,
266
273
  /**
267
274
  * All of the cell selection area items
268
275
  */
@@ -280,6 +287,10 @@ DataSpreadsheetHeader.propTypes = {
280
287
  * Setter fn for header cell hold active value
281
288
  */
282
289
  setHeaderCellHoldActive: index["default"].func,
290
+ /**
291
+ * Set header reordering active or not
292
+ */
293
+ setSelectedHeaderReorderActive: index["default"].func,
283
294
  /**
284
295
  * Setter fn for selectionAreaData state value
285
296
  */
@@ -44,9 +44,12 @@ var useSpreadsheetMouseMove = function useSpreadsheetMouseMove(_ref) {
44
44
  var totalSpreadsheetScrollingWidth = listContainer.scrollWidth;
45
45
  var clonedSelectionWidth = clonedSelectionElement.offsetWidth;
46
46
  var clonePlacement = Math.max(xPositionRelativeToSpreadsheet - offsetXValue, defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeaderWidth);
47
+ var leftPosition = totalSpreadsheetScrollingWidth - clonedSelectionWidth >= clonePlacement ? clonePlacement + scrollAmount : totalSpreadsheetScrollingWidth - clonedSelectionWidth;
47
48
  // Moves the position of the cloned selection area to follow mouse, and
48
49
  // add the amount horizontally scrolled
49
- clonedSelectionElement.style.left = layout.px(totalSpreadsheetScrollingWidth - clonedSelectionWidth >= clonePlacement ? clonePlacement + scrollAmount : totalSpreadsheetScrollingWidth - clonedSelectionWidth);
50
+ if (leftPosition < spreadsheetCoords.right - 40) {
51
+ clonedSelectionElement.style.left = layout.px(leftPosition);
52
+ }
50
53
  };
51
54
  if (headerCellHoldActive) {
52
55
  ref.current.addEventListener('mousemove', handleMouseMove);
@@ -1,6 +1,8 @@
1
- export function useSpreadsheetMouseUp({ currentMatcher, setSelectionAreas, setClickAndHoldActive, setValidStartingPoint, validStartingPoint, blockClass, ref, setHeaderCellHoldActive, setColumnOrder, visibleColumns, setActiveCellCoordinates, activeCellCoordinates, rows, defaultColumn, selectionAreas, }: {
1
+ export function useSpreadsheetMouseUp({ currentMatcher, setSelectionAreas, selectedHeaderReorderActive, setSelectedHeaderReorderActive, setClickAndHoldActive, setValidStartingPoint, validStartingPoint, blockClass, ref, setHeaderCellHoldActive, setColumnOrder, visibleColumns, setActiveCellCoordinates, activeCellCoordinates, rows, defaultColumn, selectionAreas, }: {
2
2
  currentMatcher: any;
3
3
  setSelectionAreas: any;
4
+ selectedHeaderReorderActive: any;
5
+ setSelectedHeaderReorderActive: any;
4
6
  setClickAndHoldActive: any;
5
7
  setValidStartingPoint: any;
6
8
  validStartingPoint: any;