@carbon/ibm-products 2.43.2-canary.4 → 2.43.2-canary.40

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 (203) hide show
  1. package/css/index-full-carbon.css +52 -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 +12 -0
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +1 -1
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +52 -3
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +1 -1
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +52 -3
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +1 -1
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +23 -21
  18. package/es/components/ConditionBuilder/ConditionBuilder.js +67 -20
  19. package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +15 -0
  20. package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +129 -0
  21. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +6 -4
  22. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +5 -1
  23. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +16 -4
  24. package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +2 -2
  25. package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +2 -2
  26. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +9 -11
  27. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +36 -32
  28. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +0 -1
  29. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +7 -2
  30. package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +6 -1
  31. package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +18 -10
  32. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +39 -36
  33. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +12 -10
  34. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +1 -1
  35. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +24 -16
  36. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +19 -4
  37. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +13 -0
  38. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +109 -0
  39. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.d.ts → ItemOptionForValueField.d.ts} +2 -2
  40. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.js → ItemOptionForValueField.js} +58 -33
  41. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +4 -6
  42. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +14 -5
  43. package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +1 -2
  44. package/es/components/ConditionBuilder/utils/util.d.ts +1 -0
  45. package/es/components/ConditionBuilder/utils/util.js +16 -1
  46. package/es/components/DataSpreadsheet/DataSpreadsheet.d.ts +12 -0
  47. package/es/components/DataSpreadsheet/DataSpreadsheet.js +51 -19
  48. package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +21 -1
  49. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +40 -8
  50. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +8 -0
  51. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +20 -6
  52. package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +4 -1
  53. package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.d.ts +3 -1
  54. package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +15 -3
  55. package/es/components/DataSpreadsheet/types/index.d.ts +1 -1
  56. package/es/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +34 -2
  57. package/es/components/Datagrid/Datagrid/Datagrid.js +2 -1
  58. package/es/components/Datagrid/Datagrid/DatagridContent.js +1 -1
  59. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +11 -1
  60. package/es/components/Datagrid/Datagrid/DatagridRow.js +13 -2
  61. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -1
  62. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -1
  63. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -1
  64. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +6 -3
  65. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.d.ts +1 -1
  66. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +21 -16
  67. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +1 -1
  68. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +74 -11
  69. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +10 -2
  70. package/es/components/Datagrid/types/index.d.ts +37 -4
  71. package/es/components/Datagrid/useActionsColumn.d.ts +8 -1
  72. package/es/components/Datagrid/useActionsColumn.js +7 -6
  73. package/es/components/Datagrid/useColumnRightAlign.d.ts +8 -1
  74. package/es/components/Datagrid/useColumnRightAlign.js +4 -3
  75. package/es/components/Datagrid/useCustomizeColumns.d.ts +8 -1
  76. package/es/components/Datagrid/useCustomizeColumns.js +4 -3
  77. package/es/components/Datagrid/useInlineEdit.js +12 -2
  78. package/es/components/Datagrid/useNestedRows.js +32 -13
  79. package/es/components/Decorator/Decorator.js +2 -1
  80. package/es/components/DecoratorBase/DecoratorBase.js +3 -5
  81. package/es/components/DecoratorDualButton/DecoratorDualButton.js +2 -1
  82. package/es/components/DecoratorLink/DecoratorLink.js +2 -1
  83. package/es/components/DecoratorSingleButton/DecoratorSingleButton.js +2 -1
  84. package/es/components/EditTearsheet/EditTearsheet.d.ts +5 -1
  85. package/es/components/EditTearsheet/EditTearsheet.js +0 -1
  86. package/es/components/EditTearsheet/EditTearsheetForm.d.ts +45 -2
  87. package/es/components/EditTearsheet/EditTearsheetForm.js +3 -0
  88. package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
  89. package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
  90. package/es/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
  91. package/es/components/PageHeader/PageHeader.js +1 -0
  92. package/es/components/RemoveModal/RemoveModal.d.ts +4 -0
  93. package/es/components/RemoveModal/RemoveModal.js +7 -1
  94. package/es/components/StatusIndicator/StatusIndicatorStep.js +87 -0
  95. package/es/components/Tearsheet/Tearsheet.d.ts +8 -1
  96. package/es/components/Tearsheet/Tearsheet.js +9 -1
  97. package/es/components/Tearsheet/TearsheetNarrow.d.ts +11 -0
  98. package/es/components/Tearsheet/TearsheetNarrow.js +12 -0
  99. package/es/components/Tearsheet/TearsheetShell.d.ts +10 -0
  100. package/es/components/Tearsheet/TearsheetShell.js +17 -3
  101. package/es/components/Toolbar/ToolbarButton.js +1 -1
  102. package/es/components/index.d.ts +1 -1
  103. package/es/index.js +1 -0
  104. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +23 -21
  105. package/lib/components/ConditionBuilder/ConditionBuilder.js +67 -20
  106. package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +15 -0
  107. package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +137 -0
  108. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +6 -3
  109. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +5 -1
  110. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +16 -4
  111. package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +2 -2
  112. package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +2 -2
  113. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +9 -11
  114. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +36 -32
  115. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +0 -1
  116. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +7 -2
  117. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +6 -1
  118. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +18 -10
  119. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +39 -36
  120. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +12 -10
  121. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +1 -1
  122. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +23 -15
  123. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +20 -5
  124. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +13 -0
  125. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +117 -0
  126. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.d.ts → ItemOptionForValueField.d.ts} +2 -2
  127. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.js → ItemOptionForValueField.js} +56 -31
  128. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +4 -6
  129. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +14 -4
  130. package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +1 -2
  131. package/lib/components/ConditionBuilder/utils/util.d.ts +1 -0
  132. package/lib/components/ConditionBuilder/utils/util.js +17 -0
  133. package/lib/components/DataSpreadsheet/DataSpreadsheet.d.ts +12 -0
  134. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +51 -19
  135. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +21 -1
  136. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +40 -8
  137. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +8 -0
  138. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +20 -6
  139. package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +4 -1
  140. package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.d.ts +3 -1
  141. package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +15 -3
  142. package/lib/components/DataSpreadsheet/types/index.d.ts +1 -1
  143. package/lib/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +34 -2
  144. package/lib/components/Datagrid/Datagrid/Datagrid.js +2 -1
  145. package/lib/components/Datagrid/Datagrid/DatagridContent.js +1 -1
  146. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +11 -1
  147. package/lib/components/Datagrid/Datagrid/DatagridRow.js +13 -2
  148. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -1
  149. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -1
  150. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -1
  151. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +6 -3
  152. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.d.ts +1 -1
  153. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +21 -16
  154. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +1 -1
  155. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +73 -10
  156. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +10 -2
  157. package/lib/components/Datagrid/types/index.d.ts +37 -4
  158. package/lib/components/Datagrid/useActionsColumn.d.ts +8 -1
  159. package/lib/components/Datagrid/useActionsColumn.js +7 -6
  160. package/lib/components/Datagrid/useColumnRightAlign.d.ts +8 -1
  161. package/lib/components/Datagrid/useColumnRightAlign.js +4 -3
  162. package/lib/components/Datagrid/useCustomizeColumns.d.ts +8 -1
  163. package/lib/components/Datagrid/useCustomizeColumns.js +4 -3
  164. package/lib/components/Datagrid/useInlineEdit.js +12 -2
  165. package/lib/components/Datagrid/useNestedRows.js +32 -13
  166. package/lib/components/Decorator/Decorator.js +2 -1
  167. package/lib/components/DecoratorBase/DecoratorBase.js +3 -5
  168. package/lib/components/DecoratorDualButton/DecoratorDualButton.js +2 -1
  169. package/lib/components/DecoratorLink/DecoratorLink.js +2 -1
  170. package/lib/components/DecoratorSingleButton/DecoratorSingleButton.js +2 -1
  171. package/lib/components/EditTearsheet/EditTearsheet.d.ts +5 -1
  172. package/lib/components/EditTearsheet/EditTearsheet.js +0 -1
  173. package/lib/components/EditTearsheet/EditTearsheetForm.d.ts +45 -2
  174. package/lib/components/EditTearsheet/EditTearsheetForm.js +3 -0
  175. package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
  176. package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
  177. package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
  178. package/lib/components/PageHeader/PageHeader.js +1 -0
  179. package/lib/components/RemoveModal/RemoveModal.d.ts +4 -0
  180. package/lib/components/RemoveModal/RemoveModal.js +7 -1
  181. package/lib/components/StatusIndicator/StatusIndicatorStep.js +94 -0
  182. package/lib/components/Tearsheet/Tearsheet.d.ts +8 -1
  183. package/lib/components/Tearsheet/Tearsheet.js +9 -1
  184. package/lib/components/Tearsheet/TearsheetNarrow.d.ts +11 -0
  185. package/lib/components/Tearsheet/TearsheetNarrow.js +12 -0
  186. package/lib/components/Tearsheet/TearsheetShell.d.ts +10 -0
  187. package/lib/components/Tearsheet/TearsheetShell.js +16 -2
  188. package/lib/components/Toolbar/ToolbarButton.js +1 -1
  189. package/lib/components/index.d.ts +1 -1
  190. package/lib/index.js +5 -0
  191. package/package.json +7 -6
  192. package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +9 -1
  193. package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +26 -1
  194. package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +8 -0
  195. package/scss/components/Datagrid/styles/_useInlineEdit.scss +13 -0
  196. package/scss/components/StatusIcon/_status-icon.scss +4 -4
  197. package/scss/components/StringFormatter/_string-formatter.scss +2 -2
  198. package/scss/components/UserProfileImage/_user-profile-image.scss +6 -2
  199. package/telemetry.yml +8 -3
  200. package/es/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +0 -1
  201. package/es/components/ConditionBuilder/utils/checkForHoldingKey.js +0 -16
  202. package/lib/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +0 -1
  203. 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;
@@ -28,6 +28,10 @@ interface DataSpreadsheetProps {
28
28
  * Sets the number of empty rows to be created when there is no data provided
29
29
  */
30
30
  defaultEmptyRowCount?: number;
31
+ /**
32
+ * Check if has custom row header component attached
33
+ */
34
+ hasCustomRowHeader?: boolean;
31
35
  /**
32
36
  * The spreadsheet id
33
37
  */
@@ -46,6 +50,14 @@ interface DataSpreadsheetProps {
46
50
  * The event handler that is called when the selection area values change
47
51
  */
48
52
  onSelectionAreaChange?: () => void;
53
+ /**
54
+ * Position of the custom row numbering component
55
+ */
56
+ renderRowHeaderDirection?: 'left' | 'right';
57
+ /**
58
+ * Component next to numbering rows
59
+ */
60
+ renderRowHeader?: (index: number) => any[];
49
61
  /**
50
62
  * The aria label applied to the Select all button
51
63
  */
@@ -41,7 +41,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
41
41
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
42
42
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
43
43
 
44
- var _excluded = ["cellSize", "className", "columns", "data", "defaultEmptyRowCount", "onDataUpdate", "id", "onActiveCellChange", "onSelectionAreaChange", "selectAllAriaLabel", "spreadsheetAriaLabel", "theme", "totalVisibleColumns"];
44
+ var _excluded = ["cellSize", "className", "columns", "data", "defaultEmptyRowCount", "onDataUpdate", "id", "onActiveCellChange", "onSelectionAreaChange", "renderRowHeader", "renderRowHeaderDirection", "selectAllAriaLabel", "spreadsheetAriaLabel", "theme", "totalVisibleColumns"];
45
45
  // The block part of our conventional BEM class names (blockClass__E--M).
46
46
  var blockClass = "".concat(settings.pkg.prefix, "--data-spreadsheet");
47
47
  var componentName = 'DataSpreadsheet';
@@ -76,6 +76,8 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
76
76
  onActiveCellChange = _ref$onActiveCellChan === void 0 ? defaults.onActiveCellChange : _ref$onActiveCellChan,
77
77
  _ref$onSelectionAreaC = _ref.onSelectionAreaChange,
78
78
  onSelectionAreaChange = _ref$onSelectionAreaC === void 0 ? defaults.onSelectionAreaChange : _ref$onSelectionAreaC,
79
+ renderRowHeader = _ref.renderRowHeader,
80
+ renderRowHeaderDirection = _ref.renderRowHeaderDirection,
79
81
  selectAllAriaLabel = _ref.selectAllAriaLabel,
80
82
  spreadsheetAriaLabel = _ref.spreadsheetAriaLabel,
81
83
  theme = _ref.theme,
@@ -121,15 +123,19 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
121
123
  _useState18 = _rollupPluginBabelHelpers.slicedToArray(_useState17, 2),
122
124
  headerCellHoldActive = _useState18[0],
123
125
  setHeaderCellHoldActive = _useState18[1];
124
- var isBlurSpreadsheet = React.useRef(false);
125
126
  var _useState19 = React.useState(false),
126
127
  _useState20 = _rollupPluginBabelHelpers.slicedToArray(_useState19, 2),
127
- isActiveHeaderCellChanged = _useState20[0],
128
- setIsActiveHeaderCellChanged = _useState20[1];
128
+ selectedHeaderReorderActive = _useState20[0],
129
+ setSelectedHeaderReorderActive = _useState20[1];
130
+ var isBlurSpreadsheet = React.useRef(false);
129
131
  var _useState21 = React.useState(false),
130
132
  _useState22 = _rollupPluginBabelHelpers.slicedToArray(_useState21, 2),
131
- activeCellInsideSelectionArea = _useState22[0],
132
- setActiveCellInsideSelectionArea = _useState22[1];
133
+ isActiveHeaderCellChanged = _useState22[0],
134
+ setIsActiveHeaderCellChanged = _useState22[1];
135
+ var _useState23 = React.useState(false),
136
+ _useState24 = _rollupPluginBabelHelpers.slicedToArray(_useState23, 2),
137
+ activeCellInsideSelectionArea = _useState24[0],
138
+ setActiveCellInsideSelectionArea = _useState24[1];
133
139
  var previousState = usePreviousValue.usePreviousValue({
134
140
  activeCellCoordinates: activeCellCoordinates,
135
141
  isEditing: isEditing,
@@ -137,19 +143,21 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
137
143
  }) || {};
138
144
  var cellSizeValue = getCellSize.getCellSize(cellSize);
139
145
  var cellEditorRef = React.useRef();
140
- var _useState23 = React.useState(),
141
- _useState24 = _rollupPluginBabelHelpers.slicedToArray(_useState23, 2),
142
- activeCellContent = _useState24[0],
143
- setActiveCellContent = _useState24[1];
146
+ var _useState25 = React.useState(),
147
+ _useState26 = _rollupPluginBabelHelpers.slicedToArray(_useState25, 2),
148
+ activeCellContent = _useState26[0],
149
+ setActiveCellContent = _useState26[1];
144
150
  var activeCellRef = React.useRef();
145
151
  var cellEditorRulerRef = React.useRef();
152
+ var hasCustomRowHeader = typeof renderRowHeader === 'function';
153
+ var maxNumRowsCount = data.length.toString().length;
146
154
  var defaultColumn = React.useMemo(function () {
147
155
  return {
148
156
  width: 150,
149
- rowHeaderWidth: 64,
157
+ rowHeaderWidth: hasCustomRowHeader ? 40 + maxNumRowsCount * 8.56 : 64,
150
158
  rowHeight: cellSizeValue
151
159
  };
152
- }, [cellSizeValue]);
160
+ }, [cellSizeValue, hasCustomRowHeader, maxNumRowsCount]);
153
161
  var _useMultipleKeyTracki = useMultipleKeyTracking.useMultipleKeyTracking({
154
162
  ref: multiKeyTrackingRef,
155
163
  containerHasFocus: containerHasFocus,
@@ -216,9 +224,12 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
216
224
  }
217
225
  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
226
  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
227
  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);
228
+ if (activeCellFullData) {
229
+ setActiveCellContent(activeCellFullData.render('Cell'));
230
+ } else {
231
+ setActiveCellContent(null);
232
+ }
222
233
  }
223
234
  if (activeCellCoordinates && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header' || (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header') {
224
235
  setActiveCellContent(null);
@@ -433,8 +444,8 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
433
444
  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
445
  var activeCellValue;
435
446
  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;
447
+ var _activeCellFullData$r;
448
+ 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
449
  }
439
450
  setCellEditorValue(activeCellValue || '');
440
451
  if (cellEditorRulerRef !== null && cellEditorRulerRef !== void 0 && cellEditorRulerRef.current) {
@@ -624,6 +635,8 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
624
635
  columns: columns,
625
636
  currentMatcher: currentMatcher,
626
637
  defaultColumn: defaultColumn,
638
+ selectedHeaderReorderActive: selectedHeaderReorderActive,
639
+ setSelectedHeaderReorderActive: setSelectedHeaderReorderActive,
627
640
  headerGroups: headerGroups,
628
641
  rows: rows,
629
642
  scrollBarSize: scrollBarSize,
@@ -647,12 +660,17 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
647
660
  currentMatcher: currentMatcher,
648
661
  setCurrentMatcher: setCurrentMatcher,
649
662
  setContainerHasFocus: setContainerHasFocus,
663
+ selectedHeaderReorderActive: selectedHeaderReorderActive,
664
+ setSelectedHeaderReorderActive: setSelectedHeaderReorderActive,
650
665
  selectionAreas: selectionAreas,
651
666
  setSelectionAreas: setSelectionAreas,
652
667
  headerGroups: headerGroups,
653
668
  defaultColumn: defaultColumn,
654
669
  getTableBodyProps: getTableBodyProps,
670
+ hasCustomRowHeader: hasCustomRowHeader,
655
671
  onDataUpdate: onDataUpdate,
672
+ renderRowHeaderDirection: renderRowHeaderDirection,
673
+ renderRowHeader: renderRowHeader,
656
674
  onActiveCellChange: onActiveCellChange,
657
675
  onSelectionAreaChange: onSelectionAreaChange,
658
676
  prepareRow: prepareRow,
@@ -697,9 +715,11 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
697
715
  updateData: updateData
698
716
  }),
699
717
  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;
718
+ if (previousState.isEditing) {
719
+ setCellEditorValue(event.target.value);
720
+ if (cellEditorRulerRef !== null && cellEditorRulerRef !== void 0 && cellEditorRulerRef.current) {
721
+ cellEditorRulerRef.current.textContent = event.target.value;
722
+ }
703
723
  }
704
724
  },
705
725
  ref: cellEditorRef,
@@ -749,6 +769,10 @@ exports.DataSpreadsheet.propTypes = {
749
769
  * Sets the number of empty rows to be created when there is no data provided
750
770
  */
751
771
  defaultEmptyRowCount: index["default"].number,
772
+ /**
773
+ * Check if spreadsheet is using custom row header component attached
774
+ */
775
+ hasCustomRowHeader: index["default"].bool,
752
776
  /**
753
777
  * The spreadsheet id
754
778
  */
@@ -765,6 +789,14 @@ exports.DataSpreadsheet.propTypes = {
765
789
  * The event handler that is called when the selection area values change
766
790
  */
767
791
  onSelectionAreaChange: index["default"].func,
792
+ /**
793
+ * Component next to numbering rows
794
+ */
795
+ renderRowHeader: index["default"].func,
796
+ /**
797
+ * Component next to numbering rows
798
+ */
799
+ renderRowHeaderDirection: index["default"].oneOf(['left', 'right']),
768
800
  /**
769
801
  * The aria label applied to the Select all button
770
802
  */
@@ -52,6 +52,18 @@ interface DataSpreadsheetBodyProps {
52
52
  * The event handler that is called when the active cell changes
53
53
  */
54
54
  onActiveCellChange?: () => void;
55
+ /**
56
+ * Check if user is using custom component
57
+ */
58
+ hasCustomRowHeader?: boolean;
59
+ /**
60
+ * Component next to numbering rows
61
+ */
62
+ renderRowHeader?: (index: number) => any[];
63
+ /**
64
+ * Component next to numbering rows
65
+ */
66
+ renderRowHeaderDirection?: string;
55
67
  /**
56
68
  * The event handler that is called to set the rows for the empty spreadsheet
57
69
  */
@@ -79,7 +91,15 @@ interface DataSpreadsheetBodyProps {
79
91
  /**
80
92
  * Array of selection area data
81
93
  */
82
- selectionAreaData?: object[];
94
+ selectionAreaData?: any[];
95
+ /**
96
+ * Header reordering is active
97
+ */
98
+ selectedHeaderReorderActive?: boolean;
99
+ /**
100
+ * Set header reordering active or not
101
+ */
102
+ setSelectedHeaderReorderActive?: Dispatch<SetStateAction<boolean>>;
83
103
  /**
84
104
  * Array of selection areas
85
105
  */