@carbon/ibm-products 2.48.0 → 2.49.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/css/index-full-carbon.css +29 -14
  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 +11 -2
  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 +29 -14
  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 +29 -14
  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/APIKeyModal/APIKeyModal.types.d.ts +1 -1
  18. package/es/components/Card/Card.js +4 -2
  19. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +100 -24
  20. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +30 -27
  21. package/es/components/ConditionBuilder/ConditionBuilder.d.ts +9 -2
  22. package/es/components/ConditionBuilder/ConditionBuilder.js +13 -9
  23. package/es/components/ConditionBuilder/ConditionBuilder.types.d.ts +151 -0
  24. package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +26 -12
  25. package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +7 -7
  26. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +62 -27
  27. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +2 -3
  28. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +86 -37
  29. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +2 -2
  30. package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.d.ts +29 -14
  31. package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +10 -9
  32. package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +4 -1
  33. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +40 -20
  34. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +40 -37
  35. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +10 -49
  36. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +22 -31
  37. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +6 -0
  38. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +7 -1
  39. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +81 -31
  40. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +14 -8
  41. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +27 -12
  42. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +2 -3
  43. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.d.ts +30 -12
  44. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +12 -7
  45. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +35 -12
  46. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +16 -9
  47. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts +32 -12
  48. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +4 -4
  49. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +35 -14
  50. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +5 -6
  51. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +25 -10
  52. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +1 -1
  53. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +44 -17
  54. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +50 -40
  55. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +30 -13
  56. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +2 -3
  57. package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +9 -10
  58. package/es/components/ConditionBuilder/utils/useDataConfigs.d.ts +18 -0
  59. package/es/components/ConditionBuilder/utils/useDataConfigs.js +120 -0
  60. package/es/components/ConditionBuilder/utils/useTranslations.d.ts +1 -1
  61. package/es/components/ConditionBuilder/utils/useTranslations.js +4 -1
  62. package/es/components/ConditionBuilder/utils/util.d.ts +12 -0
  63. package/es/components/ConditionBuilder/utils/util.js +48 -2
  64. package/es/components/CreateFullPage/CreateFullPageStep.d.ts +2 -2
  65. package/es/components/CreateFullPage/index.d.ts +1 -0
  66. package/es/components/CreateTearsheet/CreateTearsheet.js +3 -4
  67. package/es/components/DataSpreadsheet/DataSpreadsheet.js +8 -1
  68. package/es/components/Datagrid/Datagrid/DatagridToolbar.js +8 -3
  69. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +20 -11
  70. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +7 -2
  71. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +12 -7
  72. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +18 -16
  73. package/es/components/Datagrid/types/index.d.ts +1 -0
  74. package/es/components/Datagrid/useActionsColumn.js +1 -4
  75. package/es/components/Datagrid/useFiltering.d.ts +1 -0
  76. package/es/components/Datagrid/useFiltering.js +14 -3
  77. package/es/components/EditInPlace/EditInPlace.js +7 -5
  78. package/es/components/NotificationsPanel/NotificationsPanel.d.ts +2 -0
  79. package/es/components/NotificationsPanel/NotificationsPanel.js +75 -5
  80. package/es/components/TagOverflow/TagOverflow.d.ts +1 -0
  81. package/es/components/TagOverflow/TagOverflow.js +8 -2
  82. package/es/components/TagOverflow/TagOverflowPopover.d.ts +1 -0
  83. package/es/components/TagOverflow/TagOverflowPopover.js +7 -1
  84. package/es/components/TagSet/TagSetOverflow.js +1 -1
  85. package/es/components/Tearsheet/Tearsheet.d.ts +2 -2
  86. package/es/components/Tearsheet/TearsheetShell.js +7 -3
  87. package/es/components/Toolbar/ToolbarButton.d.ts +12 -1
  88. package/es/components/Toolbar/ToolbarButton.js +16 -8
  89. package/es/global/js/hooks/useFocus.d.ts +1 -1
  90. package/es/global/js/hooks/useFocus.js +40 -24
  91. package/es/global/js/utils/keyboardNavigation.d.ts +27 -0
  92. package/es/global/js/utils/keyboardNavigation.js +37 -0
  93. package/es/global/js/utils/wrapFocus.d.ts +25 -0
  94. package/es/global/js/utils/wrapFocus.js +68 -0
  95. package/lib/components/APIKeyModal/APIKeyModal.types.d.ts +1 -1
  96. package/lib/components/Card/Card.js +3 -1
  97. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +100 -24
  98. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +36 -33
  99. package/lib/components/ConditionBuilder/ConditionBuilder.d.ts +9 -2
  100. package/lib/components/ConditionBuilder/ConditionBuilder.js +15 -11
  101. package/lib/components/ConditionBuilder/ConditionBuilder.types.d.ts +151 -0
  102. package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +26 -12
  103. package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +15 -15
  104. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +62 -27
  105. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +7 -8
  106. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +86 -37
  107. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +4 -4
  108. package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.d.ts +29 -14
  109. package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +11 -10
  110. package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +8 -5
  111. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +40 -20
  112. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +47 -44
  113. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +10 -49
  114. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +22 -31
  115. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +6 -0
  116. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +7 -1
  117. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +81 -31
  118. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +18 -12
  119. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +27 -12
  120. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +3 -4
  121. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.d.ts +30 -12
  122. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +13 -8
  123. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +35 -12
  124. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +22 -15
  125. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts +32 -12
  126. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +15 -15
  127. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +35 -14
  128. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +5 -6
  129. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +25 -10
  130. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +2 -2
  131. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +44 -17
  132. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +60 -50
  133. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +30 -13
  134. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +18 -19
  135. package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +12 -13
  136. package/lib/components/ConditionBuilder/utils/useDataConfigs.d.ts +18 -0
  137. package/lib/components/ConditionBuilder/utils/useDataConfigs.js +124 -0
  138. package/lib/components/ConditionBuilder/utils/useTranslations.d.ts +1 -1
  139. package/lib/components/ConditionBuilder/utils/useTranslations.js +4 -1
  140. package/lib/components/ConditionBuilder/utils/util.d.ts +12 -0
  141. package/lib/components/ConditionBuilder/utils/util.js +53 -3
  142. package/lib/components/CreateFullPage/CreateFullPageStep.d.ts +2 -2
  143. package/lib/components/CreateFullPage/index.d.ts +1 -0
  144. package/lib/components/CreateTearsheet/CreateTearsheet.js +3 -4
  145. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +8 -1
  146. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +8 -3
  147. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +19 -10
  148. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +6 -1
  149. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +11 -6
  150. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +18 -16
  151. package/lib/components/Datagrid/types/index.d.ts +1 -0
  152. package/lib/components/Datagrid/useActionsColumn.js +1 -4
  153. package/lib/components/Datagrid/useFiltering.d.ts +1 -0
  154. package/lib/components/Datagrid/useFiltering.js +13 -1
  155. package/lib/components/EditInPlace/EditInPlace.js +7 -5
  156. package/lib/components/NotificationsPanel/NotificationsPanel.d.ts +2 -0
  157. package/lib/components/NotificationsPanel/NotificationsPanel.js +74 -4
  158. package/lib/components/TagOverflow/TagOverflow.d.ts +1 -0
  159. package/lib/components/TagOverflow/TagOverflow.js +8 -2
  160. package/lib/components/TagOverflow/TagOverflowPopover.d.ts +1 -0
  161. package/lib/components/TagOverflow/TagOverflowPopover.js +7 -1
  162. package/lib/components/TagSet/TagSetOverflow.js +1 -1
  163. package/lib/components/Tearsheet/Tearsheet.d.ts +2 -2
  164. package/lib/components/Tearsheet/TearsheetShell.js +6 -2
  165. package/lib/components/Toolbar/ToolbarButton.d.ts +12 -1
  166. package/lib/components/Toolbar/ToolbarButton.js +15 -6
  167. package/lib/global/js/hooks/useFocus.d.ts +1 -1
  168. package/lib/global/js/hooks/useFocus.js +40 -24
  169. package/lib/global/js/utils/keyboardNavigation.d.ts +27 -0
  170. package/lib/global/js/utils/keyboardNavigation.js +43 -0
  171. package/lib/global/js/utils/wrapFocus.d.ts +25 -0
  172. package/lib/global/js/utils/wrapFocus.js +73 -0
  173. package/package.json +4 -4
  174. package/scss/components/ConditionBuilder/_condition-builder.scss +1 -1
  175. package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +33 -22
  176. package/scss/components/Datagrid/styles/_datagrid.scss +7 -0
  177. package/scss/components/Datagrid/styles/_useActionsColumn.scss +4 -0
  178. package/scss/components/EditInPlace/_edit-in-place.scss +2 -2
  179. package/telemetry.yml +15 -6
  180. package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +0 -28
  181. package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +0 -123
  182. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +0 -28
  183. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +0 -131
@@ -1,14 +1,31 @@
1
- export default ConditionPreview;
2
- declare function ConditionPreview({ previewType, group, colorIndex }: {
3
- previewType: any;
4
- group: any;
5
- colorIndex: any;
6
- }): import("react/jsx-runtime").JSX.Element;
7
- declare namespace ConditionPreview {
8
- namespace propTypes {
9
- let colorIndex: PropTypes.Requireable<number>;
10
- let group: PropTypes.Requireable<object>;
11
- let previewType: PropTypes.Requireable<string>;
12
- }
13
- }
1
+ /**
2
+ * Copyright IBM Corp. 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
14
7
  import PropTypes from 'prop-types';
8
+ import { ConditionGroup } from '../ConditionBuilder.types';
9
+ interface ConditionPreviewProps {
10
+ previewType: 'newGroup' | 'subGroup' | 'condition';
11
+ group: ConditionGroup;
12
+ colorIndex?: number;
13
+ }
14
+ declare const ConditionPreview: {
15
+ ({ previewType, group, colorIndex, }: ConditionPreviewProps): import("react/jsx-runtime").JSX.Element;
16
+ propTypes: {
17
+ /**
18
+ * index of the color for next group
19
+ */
20
+ colorIndex: PropTypes.Requireable<number>;
21
+ /**
22
+ * current conditional group
23
+ */
24
+ group: PropTypes.Requireable<object>;
25
+ /**
26
+ * type of review to be displayed
27
+ */
28
+ previewType: PropTypes.Requireable<string>;
29
+ };
30
+ };
31
+ export default ConditionPreview;
@@ -13,11 +13,11 @@ var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHel
13
13
  var React = require('react');
14
14
  var cx = require('classnames');
15
15
  var index = require('../../../node_modules/prop-types/index.js');
16
- var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
17
16
  var ConditionBuilderItem = require('../ConditionBuilderItem/ConditionBuilderItem.js');
18
17
  var ConditionConnector = require('../ConditionBuilderConnector/ConditionConnector.js');
19
18
  var useTranslations = require('../utils/useTranslations.js');
20
19
  var icons = require('@carbon/react/icons');
20
+ var util = require('../utils/util.js');
21
21
 
22
22
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
23
23
 
@@ -44,7 +44,7 @@ var ConditionPreview = function ConditionPreview(_ref) {
44
44
  }, []);
45
45
  var getConditionSection = function getConditionSection() {
46
46
  return /*#__PURE__*/React__default["default"].createElement("div", {
47
- className: "".concat(DataConfigs.blockClass, "__preview-condition")
47
+ className: "".concat(util.blockClass, "__preview-condition")
48
48
  }, _ConditionBuilderItem || (_ConditionBuilderItem = /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
49
49
  label: propertyText,
50
50
  renderIcon: icons.Bee
@@ -55,43 +55,42 @@ var ConditionPreview = function ConditionPreview(_ref) {
55
55
  })));
56
56
  };
57
57
  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", {
58
- className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
58
+ className: cx__default["default"](["".concat(util.blockClass, "__group__row ").concat(util.blockClass, "__group-preview "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(util.blockClass, "__group-preview-animate"), animate)])
59
59
  }, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
60
- className: "".concat(DataConfigs.blockClass, "__statement-button"),
60
+ className: "".concat(util.blockClass, "__statement-button"),
61
61
  label: group.groupOperator
62
62
  })), /*#__PURE__*/React__default["default"].createElement("div", {
63
63
  "data-color-index": colorIndex,
64
64
  "aria-hidden": true,
65
- 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)])
65
+ className: cx__default["default"](["".concat(util.blockClass, "__group ").concat(util.blockClass, "__condition-wrapper ").concat(util.blockClass, "__group-preview ").concat(util.blockClass, "__group-wrapper "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(util.blockClass, "__group-preview-animate"), animate)])
66
66
  }, /*#__PURE__*/React__default["default"].createElement("div", {
67
- className: "".concat(DataConfigs.blockClass, "__gap")
67
+ className: "".concat(util.blockClass, "__gap")
68
68
  }, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
69
- className: "".concat(DataConfigs.blockClass, "__statement-button"),
69
+ className: "".concat(util.blockClass, "__statement-button"),
70
70
  label: ifText
71
71
  })), getConditionSection())), previewType == 'subGroup' && /*#__PURE__*/React__default["default"].createElement("div", {
72
- className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview ").concat(DataConfigs.blockClass, "__gap-bottom"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
72
+ className: cx__default["default"](["".concat(util.blockClass, "__group__row ").concat(util.blockClass, "__group-preview ").concat(util.blockClass, "__gap-bottom"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(util.blockClass, "__group-preview-animate"), animate)])
73
73
  }, /*#__PURE__*/React__default["default"].createElement("div", {
74
- className: "".concat(DataConfigs.blockClass, "__condition-block ").concat(DataConfigs.blockClass, "__gap")
74
+ className: "".concat(util.blockClass, "__condition-block ").concat(util.blockClass, "__gap")
75
75
  }, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
76
76
  label: group.groupOperator,
77
- className: "".concat(DataConfigs.blockClass, "__statement-button"),
78
- popOverClassName: "".concat(DataConfigs.blockClass, "__gap")
77
+ className: "".concat(util.blockClass, "__statement-button"),
78
+ popOverClassName: "".concat(util.blockClass, "__gap")
79
79
  }), /*#__PURE__*/React__default["default"].createElement("div", {
80
- className: "".concat(DataConfigs.blockClass, "__group ").concat(DataConfigs.blockClass, "__condition-wrapper")
80
+ className: "".concat(util.blockClass, "__group ").concat(util.blockClass, "__condition-wrapper")
81
81
  }, /*#__PURE__*/React__default["default"].createElement(ConditionConnector["default"], {
82
- className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__groupConnector"),
82
+ className: "".concat(util.blockClass, "__gap ").concat(util.blockClass, "__groupConnector"),
83
83
  operator: ifText
84
84
  }), getConditionSection()))), previewType == 'condition' && /*#__PURE__*/React__default["default"].createElement("div", {
85
- className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview ").concat(DataConfigs.blockClass, "__gap-bottom"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
85
+ className: cx__default["default"](["".concat(util.blockClass, "__group__row ").concat(util.blockClass, "__group-preview ").concat(util.blockClass, "__gap-bottom"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(util.blockClass, "__group-preview-animate"), animate)])
86
86
  }, /*#__PURE__*/React__default["default"].createElement("div", {
87
- className: "".concat(DataConfigs.blockClass, "__condition-block ").concat(DataConfigs.blockClass, "__gap")
87
+ className: "".concat(util.blockClass, "__condition-block ").concat(util.blockClass, "__gap")
88
88
  }, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
89
89
  label: group.groupOperator,
90
- className: "".concat(DataConfigs.blockClass, "__statement-button"),
91
- popOverClassName: "".concat(DataConfigs.blockClass, "__gap")
90
+ className: "".concat(util.blockClass, "__statement-button"),
91
+ popOverClassName: "".concat(util.blockClass, "__gap")
92
92
  }), getConditionSection())));
93
93
  };
94
- var ConditionPreview$1 = ConditionPreview;
95
94
  ConditionPreview.propTypes = {
96
95
  /**
97
96
  * index of the color for next group
@@ -107,4 +106,4 @@ ConditionPreview.propTypes = {
107
106
  previewType: index["default"].oneOf(['condition', 'subGroup', 'newGroup'])
108
107
  };
109
108
 
110
- exports["default"] = ConditionPreview$1;
109
+ exports["default"] = ConditionPreview;
@@ -10,13 +10,12 @@
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
12
  var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
13
- var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
14
13
  var util = require('./util.js');
15
14
 
16
15
  var handleKeyDown = function handleKeyDown(evt, conditionBuilderRef, variant) {
17
16
  var _activeElement$closes;
18
17
  var activeElement = document.activeElement;
19
- if (!((_activeElement$closes = activeElement.closest(".".concat(DataConfigs.blockClass, "__popover"))) !== null && _activeElement$closes !== void 0 && _activeElement$closes.querySelector('[role="dialog"]'))) {
18
+ if (!((_activeElement$closes = activeElement.closest(".".concat(util.blockClass, "__popover"))) !== null && _activeElement$closes !== void 0 && _activeElement$closes.querySelector('[role="dialog"]'))) {
20
19
  handleKeyPressForMainContent(evt, conditionBuilderRef, variant);
21
20
  }
22
21
  };
@@ -29,7 +28,7 @@ var handleKeyDownForPopover = function handleKeyDownForPopover(evt, conditionBui
29
28
 
30
29
  //skipping keyboard handling for date and time fields to get take carbon's
31
30
  var excludeKeyPress = function excludeKeyPress(evt) {
32
- return !['Escape'].includes(evt.key) && (evt.target.closest(".".concat(DataConfigs.blockClass, "__item-date")) || evt.target.closest(".".concat(DataConfigs.blockClass, "__item-time")));
31
+ return !['Escape'].includes(evt.key) && (evt.target.closest(".".concat(util.blockClass, "__item-date")) || evt.target.closest(".".concat(util.blockClass, "__item-time")));
33
32
  };
34
33
  var handleKeyPressForPopover = function handleKeyPressForPopover(evt, parentContainer, conditionBuilderRef) {
35
34
  var _parentContainer$quer;
@@ -46,7 +45,7 @@ var handleKeyPressForPopover = function handleKeyPressForPopover(evt, parentCont
46
45
  });
47
46
  //scroll to top when we reach a the top of the list to make search box visible
48
47
  if (Array.from(evt.target.closest('ul').querySelectorAll('li')).indexOf(evt.target) === 1) {
49
- parentContainer.querySelector(".".concat(DataConfigs.blockClass, "__popover-content-wrapper")).scrollTop = 0;
48
+ parentContainer.querySelector(".".concat(util.blockClass, "__popover-content-wrapper")).scrollTop = 0;
50
49
  }
51
50
  break;
52
51
  case 'ArrowDown':
@@ -57,7 +56,7 @@ var handleKeyPressForPopover = function handleKeyPressForPopover(evt, parentCont
57
56
  });
58
57
  break;
59
58
  case 'Tab':
60
- allItems = [].concat(_rollupPluginBabelHelpers.toConsumableArray(Array.from(parentContainer.querySelectorAll(".".concat(DataConfigs.blockClass, "__selectAll-button,[role=\"searchbox\"]")))), [parentContainer.querySelector("[role=\"option\"]")]);
59
+ allItems = [].concat(_rollupPluginBabelHelpers.toConsumableArray(Array.from(parentContainer.querySelectorAll(".".concat(util.blockClass, "__selectAll-button,[role=\"searchbox\"]")))), [parentContainer.querySelector("[role=\"option\"]")]);
61
60
  allItems.forEach(function (eachElem, index, allElements) {
62
61
  if (isHoldingShiftKey) {
63
62
  util.traverseReverse(eachElem, index, allElements, true, true, conditionBuilderRef);
@@ -82,9 +81,9 @@ var handleKeyPressForPopover = function handleKeyPressForPopover(evt, parentCont
82
81
  if (document.activeElement.type !== 'button') {
83
82
  var _document$activeEleme2;
84
83
  //for button , enter key is click which already handled by framework, for other elements trigger click
84
+ evt.preventDefault();
85
85
  (_document$activeEleme2 = document.activeElement) === null || _document$activeEleme2 === void 0 || _document$activeEleme2.click();
86
86
  }
87
- evt.preventDefault();
88
87
  } else {
89
88
  if (document.activeElement.type !== 'button') {
90
89
  var _document$activeEleme3;
@@ -105,12 +104,12 @@ var handleKeyPressForMainContent = function handleKeyPressForMainContent(evt, co
105
104
  switch (evt.key) {
106
105
  case 'ArrowRight':
107
106
  evt.preventDefault();
108
- if (variant == 'tree') {
107
+ if (variant == util.HIERARCHICAL_VARIANT) {
109
108
  var _evt$target$closest;
110
109
  var allCellsInRow = Array.from((_evt$target$closest = evt.target.closest('[role="row"]')) === null || _evt$target$closest === void 0 ? void 0 : _evt$target$closest.querySelectorAll('[role="gridcell"] button'));
111
110
  if (allCellsInRow.length === 1) {
112
111
  evt.target = evt.target.closest('[role="row"]');
113
- handleRowNavigationTree(evt, conditionBuilderRef, variant);
112
+ handleRowNavigationHierarchical(evt, conditionBuilderRef, variant);
114
113
  //focus next row
115
114
  } else if (evt.target.getAttribute('role') == 'row') {
116
115
  //when current focus is on a row, then we need to enter inside and focus the first cell of that row
@@ -132,7 +131,7 @@ var handleKeyPressForMainContent = function handleKeyPressForMainContent(evt, co
132
131
  break;
133
132
  case 'ArrowLeft':
134
133
  evt.preventDefault();
135
- if (variant == 'tree') {
134
+ if (variant == util.HIERARCHICAL_VARIANT) {
136
135
  if (evt.target.getAttribute('role') !== 'row') {
137
136
  var _evt$target$closest2;
138
137
  //when any cell is focussed, arrow left will select the previous cell or current row
@@ -154,8 +153,8 @@ var handleKeyPressForMainContent = function handleKeyPressForMainContent(evt, co
154
153
  case 'ArrowUp':
155
154
  case 'ArrowDown':
156
155
  evt.preventDefault();
157
- if (variant == 'tree') {
158
- handleRowNavigationTree(evt, conditionBuilderRef, variant);
156
+ if (variant == util.HIERARCHICAL_VARIANT) {
157
+ handleRowNavigationHierarchical(evt, conditionBuilderRef, variant);
159
158
  } else {
160
159
  handleRowNavigation(evt, conditionBuilderRef, variant);
161
160
  }
@@ -183,7 +182,7 @@ var handleRowNavigation = function handleRowNavigation(evt, conditionBuilderRef,
183
182
  var currentRowIndex = getRowIndex(evt.target, conditionBuilderRef);
184
183
  navigateToNextRowCell(evt, currentRowIndex, rows, variant, conditionBuilderRef);
185
184
  };
186
- var handleRowNavigationTree = function handleRowNavigationTree(evt, conditionBuilderRef, variant) {
185
+ var handleRowNavigationHierarchical = function handleRowNavigationHierarchical(evt, conditionBuilderRef, variant) {
187
186
  var rows = getRows(conditionBuilderRef);
188
187
  var currentRowIndex = getRowIndex(evt.target, conditionBuilderRef);
189
188
  var nextRowIndex = currentRowIndex;
@@ -221,7 +220,7 @@ var navigateToNextRowCell = function navigateToNextRowCell(evt, currentRowIndex,
221
220
  var itemName = evt.target.dataset.name;
222
221
  if (nextRow !== null && nextRow !== void 0 && nextRow.querySelector("[data-name=\"".concat(itemName, "\"]"))) {
223
222
  util.manageTabIndexAndFocus(nextRow === null || nextRow === void 0 ? void 0 : nextRow.querySelector("[data-name=\"".concat(itemName, "\"]")), conditionBuilderRef);
224
- } else if (variant === 'tree') {
223
+ } else if (variant === util.HIERARCHICAL_VARIANT) {
225
224
  //when the next row is a if statement , then that row is focused. From any cell of last row of an group , arrow down select the next row (if)
226
225
  util.manageTabIndexAndFocus(nextRow, conditionBuilderRef);
227
226
  }
@@ -0,0 +1,18 @@
1
+ export function useDataConfigs(): {
2
+ statementConfig: {
3
+ label: string;
4
+ id: string;
5
+ connector: string;
6
+ text1: any;
7
+ text2: string;
8
+ }[];
9
+ connectorConfig: {
10
+ label: any;
11
+ id: string;
12
+ }[];
13
+ operatorConfig: {
14
+ label: any;
15
+ id: string;
16
+ type: string;
17
+ }[];
18
+ };
@@ -0,0 +1,124 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
13
+ var useTranslations = require('./useTranslations.js');
14
+
15
+ var useDataConfigs = function useDataConfigs() {
16
+ var _useTranslations = useTranslations.useTranslations(['ifAll', 'ifAny', 'unlessAll', 'unlessAny', 'and', 'or', 'is', 'greater', 'greaterEqual', 'lower', 'lowerEqual', 'startsWith', 'endsWith', 'contains', 'oneOf', 'before', 'after', 'between']),
17
+ _useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations, 18),
18
+ ifAll = _useTranslations2[0],
19
+ ifAny = _useTranslations2[1],
20
+ unlessAll = _useTranslations2[2],
21
+ unlessAny = _useTranslations2[3],
22
+ and = _useTranslations2[4],
23
+ or = _useTranslations2[5],
24
+ is = _useTranslations2[6],
25
+ greater = _useTranslations2[7],
26
+ greaterEqual = _useTranslations2[8],
27
+ lower = _useTranslations2[9],
28
+ lowerEqual = _useTranslations2[10],
29
+ startsWith = _useTranslations2[11],
30
+ endsWith = _useTranslations2[12],
31
+ contains = _useTranslations2[13],
32
+ oneOf = _useTranslations2[14],
33
+ before = _useTranslations2[15],
34
+ after = _useTranslations2[16],
35
+ between = _useTranslations2[17];
36
+ var statementConfig = [{
37
+ label: 'ifText',
38
+ id: 'ifAll',
39
+ connector: 'and',
40
+ text1: ifAll,
41
+ text2: '(a && b)'
42
+ }, {
43
+ label: 'ifText',
44
+ id: 'ifAny',
45
+ connector: 'or',
46
+ text1: ifAny,
47
+ text2: '(a || b)'
48
+ }, {
49
+ label: 'unlessText',
50
+ id: 'unlessAll',
51
+ connector: 'and',
52
+ text1: unlessAll,
53
+ text2: '! (a && b)'
54
+ }, {
55
+ label: 'unlessText',
56
+ id: 'unlessAny',
57
+ connector: 'or',
58
+ text1: unlessAny,
59
+ text2: '! (a || b)'
60
+ }];
61
+ var connectorConfig = [{
62
+ label: and,
63
+ id: 'and'
64
+ }, {
65
+ label: or,
66
+ id: 'or'
67
+ }];
68
+ var operatorConfig = [{
69
+ label: is,
70
+ id: 'is',
71
+ type: 'all'
72
+ }, {
73
+ label: greater,
74
+ id: 'greater',
75
+ type: 'number'
76
+ }, {
77
+ label: greaterEqual,
78
+ id: 'greaterEqual',
79
+ type: 'number'
80
+ }, {
81
+ label: lower,
82
+ id: 'lower',
83
+ type: 'number'
84
+ }, {
85
+ label: lowerEqual,
86
+ id: 'lowerEqual',
87
+ type: 'number'
88
+ }, {
89
+ label: startsWith,
90
+ id: 'startsWith',
91
+ type: 'text,textarea'
92
+ }, {
93
+ label: endsWith,
94
+ id: 'endsWith',
95
+ type: 'text,textarea'
96
+ }, {
97
+ label: contains,
98
+ id: 'contains',
99
+ type: 'text,textarea'
100
+ }, {
101
+ label: oneOf,
102
+ id: 'oneOf',
103
+ type: 'option'
104
+ }, {
105
+ label: before,
106
+ id: 'before',
107
+ type: 'date,time'
108
+ }, {
109
+ label: after,
110
+ id: 'after',
111
+ type: 'date,time'
112
+ }, {
113
+ label: between,
114
+ id: 'between',
115
+ type: 'date'
116
+ }];
117
+ return {
118
+ statementConfig: statementConfig,
119
+ connectorConfig: connectorConfig,
120
+ operatorConfig: operatorConfig
121
+ };
122
+ };
123
+
124
+ exports.useDataConfigs = useDataConfigs;
@@ -1 +1 @@
1
- export function useTranslations(translationKeys: any): any;
1
+ export function useTranslations(translationKeys: any, alterTranslationKeyMap: any): any;
@@ -13,10 +13,13 @@ var React = require('react');
13
13
  var ConditionBuilderProvider = require('../ConditionBuilderContext/ConditionBuilderProvider.js');
14
14
  var translationObject = require('../ConditionBuilderContext/translationObject.js');
15
15
 
16
- var useTranslations = function useTranslations(translationKeys) {
16
+ var useTranslations = function useTranslations(translationKeys, alterTranslationKeyMap) {
17
17
  var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
18
18
  translateWithId = _useContext.translateWithId;
19
19
  return translationKeys.map(function (translationKey) {
20
+ if (alterTranslationKeyMap !== null && alterTranslationKeyMap !== void 0 && alterTranslationKeyMap[translationKey]) {
21
+ translationKey = alterTranslationKeyMap[translationKey];
22
+ }
20
23
  if (translateWithId !== null && translateWithId !== void 0 && translateWithId(translationKey)) {
21
24
  return translateWithId(translationKey);
22
25
  } else if (translationObject.translationsObject[translationKey]) {
@@ -1,3 +1,6 @@
1
+ export const blockClass: string;
2
+ export const NON_HIERARCHICAL_VARIANT: "Non-Hierarchical";
3
+ export const HIERARCHICAL_VARIANT: "Hierarchical";
1
4
  export function focusThisField(evt: any, conditionBuilderRef: any): void;
2
5
  export function focusThisItem(currentElement: any, conditionBuilderRef: any): void;
3
6
  export function traverseClockVise(eachElem: any, index: any, allElements: any, rotate: any, trapFocus: any, conditionBuilderRef: any): void;
@@ -5,3 +8,12 @@ export function traverseReverse(eachElem: any, index: any, allElements: any, rot
5
8
  export function checkForHoldingKey(evt: any, key: any): any;
6
9
  export function checkIsValid(item: any): any;
7
10
  export function manageTabIndexAndFocus(currentElement: any, conditionBuilderRef: any): void;
11
+ export namespace getValue {
12
+ function text(value: any): any;
13
+ function textarea(value: any): any;
14
+ function time(value: any): any;
15
+ function number(value: any): any;
16
+ function option(value: any): any;
17
+ function date(value: any): any;
18
+ function custom(value: any): any;
19
+ }
@@ -9,8 +9,11 @@
9
9
 
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
- var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
12
+ var settings = require('../../../settings.js');
13
13
 
14
+ var blockClass = "".concat(settings.pkg.prefix, "--condition-builder");
15
+ var NON_HIERARCHICAL_VARIANT = 'Non-Hierarchical';
16
+ var HIERARCHICAL_VARIANT = 'Hierarchical';
14
17
  var focusThisField = function focusThisField(evt, conditionBuilderRef) {
15
18
  if (evt) {
16
19
  setTimeout(function () {
@@ -62,19 +65,66 @@ var checkIsValid = function checkIsValid(item) {
62
65
  };
63
66
  var manageTabIndexAndFocus = function manageTabIndexAndFocus(currentElement, conditionBuilderRef) {
64
67
  var _currentElement$close, _conditionBuilderRef$;
65
- var contentContainer = (_currentElement$close = currentElement === null || currentElement === void 0 ? void 0 : currentElement.closest(".".concat(DataConfigs.blockClass, "__content-container"))) !== null && _currentElement$close !== void 0 ? _currentElement$close : currentElement === null || currentElement === void 0 ? void 0 : currentElement.closest(".".concat(DataConfigs.blockClass, "__actions-container"));
68
+ var contentContainer = (_currentElement$close = currentElement === null || currentElement === void 0 ? void 0 : currentElement.closest(".".concat(blockClass, "__content-container"))) !== null && _currentElement$close !== void 0 ? _currentElement$close : currentElement === null || currentElement === void 0 ? void 0 : currentElement.closest(".".concat(blockClass, "__actions-container"));
66
69
  contentContainer && Array.from(contentContainer.querySelectorAll('[tabindex="0"]')).map(function (element) {
67
70
  return element === null || element === void 0 ? void 0 : element.setAttribute('tabindex', '-1');
68
71
  });
69
72
  currentElement === null || currentElement === void 0 || currentElement.setAttribute('tabindex', '0');
70
- (_conditionBuilderRef$ = conditionBuilderRef.current) === null || _conditionBuilderRef$ === void 0 || (_conditionBuilderRef$ = _conditionBuilderRef$.querySelector(".".concat(DataConfigs.blockClass, "__statement-button"))) === null || _conditionBuilderRef$ === void 0 || _conditionBuilderRef$.setAttribute('tabindex', '1');
73
+ (_conditionBuilderRef$ = conditionBuilderRef.current) === null || _conditionBuilderRef$ === void 0 || (_conditionBuilderRef$ = _conditionBuilderRef$.querySelector(".".concat(blockClass, "__statement-button"))) === null || _conditionBuilderRef$ === void 0 || _conditionBuilderRef$.setAttribute('tabindex', '1');
71
74
  currentElement === null || currentElement === void 0 || currentElement.focus();
72
75
  };
76
+ var formatDate = function formatDate(date) {
77
+ var day = String(date.getDate()).padStart(2, '0');
78
+ var month = String(date.getMonth() + 1).padStart(2, '0');
79
+ var year = date.getFullYear();
80
+ return "".concat(day, "/").concat(month, "/").concat(year);
81
+ };
82
+ var getValue = {
83
+ text: function text(value) {
84
+ return value;
85
+ },
86
+ textarea: function textarea(value) {
87
+ return value;
88
+ },
89
+ time: function time(value) {
90
+ return value;
91
+ },
92
+ number: function number(value) {
93
+ return value;
94
+ },
95
+ option: function option(value) {
96
+ if (value && typeof value !== 'string') {
97
+ var selectedValues = Array.isArray(value) ? value : [value];
98
+ return selectedValues.map(function (option) {
99
+ return option.label;
100
+ }).join(', ');
101
+ }
102
+ return value;
103
+ },
104
+ date: function date(value) {
105
+ if (Array.isArray(value) && value.length > 1) {
106
+ var start = value !== null && value !== void 0 && value[0] && !isNaN(new Date(value[0])) ? formatDate(new Date(value[0])) : '';
107
+ var end = value !== null && value !== void 0 && value[1] && !isNaN(new Date(value[1])) ? formatDate(new Date(value[1])) : '';
108
+ return "".concat(start, " To ").concat(end);
109
+ } else if (Array.isArray(value) && !isNaN(new Date(value[0]))) {
110
+ return formatDate(new Date(value[0]));
111
+ } else {
112
+ return value;
113
+ }
114
+ },
115
+ custom: function custom(value) {
116
+ return value;
117
+ }
118
+ };
73
119
 
120
+ exports.HIERARCHICAL_VARIANT = HIERARCHICAL_VARIANT;
121
+ exports.NON_HIERARCHICAL_VARIANT = NON_HIERARCHICAL_VARIANT;
122
+ exports.blockClass = blockClass;
74
123
  exports.checkForHoldingKey = checkForHoldingKey;
75
124
  exports.checkIsValid = checkIsValid;
76
125
  exports.focusThisField = focusThisField;
77
126
  exports.focusThisItem = focusThisItem;
127
+ exports.getValue = getValue;
78
128
  exports.manageTabIndexAndFocus = manageTabIndexAndFocus;
79
129
  exports.traverseClockVise = traverseClockVise;
80
130
  exports.traverseReverse = traverseReverse;
@@ -21,7 +21,7 @@ interface CreateFullPageStepBaseProps extends PropsWithChildren {
21
21
  /**
22
22
  * This optional prop will render your form content inside of a fieldset html element
23
23
  */
24
- hasFieldset: boolean;
24
+ hasFieldset?: boolean;
25
25
  /**
26
26
  * This prop is used to help track dynamic steps. If this value is `false` then the step is not included in the visible steps or the ProgressIndicator
27
27
  * steps. If this value is `true` then the step will be included in the list of visible steps, as well as being included in the ProgressIndicator step list
@@ -66,6 +66,6 @@ type CreateFullPageStepFieldsetProps = {
66
66
  hasFieldset?: true;
67
67
  fieldsetLegendText: string;
68
68
  };
69
- type CreateFullPageStepProps = CreateFullPageStepBaseProps & CreateFullPageStepFieldsetProps;
69
+ export type CreateFullPageStepProps = CreateFullPageStepBaseProps & CreateFullPageStepFieldsetProps;
70
70
  export declare let CreateFullPageStep: React.ForwardRefExoticComponent<CreateFullPageStepProps & React.RefAttributes<HTMLDivElement>>;
71
71
  export {};
@@ -7,3 +7,4 @@
7
7
  export { CreateFullPage } from './CreateFullPage';
8
8
  export { CreateFullPageStep } from './CreateFullPageStep';
9
9
  export type { CreateFullPageProps } from './CreateFullPage';
10
+ export type { CreateFullPageStepProps } from './CreateFullPageStep';
@@ -120,10 +120,11 @@ exports.CreateTearsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
120
120
  var contentRef = React.useRef(null);
121
121
  React.useEffect(function () {
122
122
  var firstItem = stepData.findIndex(function (item) {
123
- return item === null || item === void 0 ? void 0 : item.shouldIncludeStep;
123
+ return item.shouldIncludeStep === true;
124
124
  }) + 1;
125
125
  var lastItem = lastIndexInArray.lastIndexInArray(stepData, 'shouldIncludeStep', true);
126
126
  if (firstItem !== firstIncludedStep) {
127
+ setCurrentStep(firstItem);
127
128
  setFirstIncludedStep(firstItem);
128
129
  }
129
130
  if (lastItem !== lastIncludedStep) {
@@ -132,10 +133,8 @@ exports.CreateTearsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
132
133
  if (open && initialStep) {
133
134
  var numberOfHiddenSteps = getNumberOfHiddenSteps.getNumberOfHiddenSteps(stepData, initialStep);
134
135
  setCurrentStep(Number(initialStep + numberOfHiddenSteps));
135
- } else {
136
- setCurrentStep(firstIncludedStep);
137
136
  }
138
- }, [stepData, firstIncludedStep, lastIncludedStep, initialStep, open]);
137
+ }, [firstIncludedStep, initialStep, lastIncludedStep, open, stepData]);
139
138
  useCreateComponentFocus.useCreateComponentFocus({
140
139
  previousState: previousState,
141
140
  currentStep: currentStep,
@@ -23,6 +23,7 @@ var devtools = require('../../global/js/utils/devtools.js');
23
23
  var getScrollbarWidth = require('../../global/js/utils/getScrollbarWidth.js');
24
24
  var handleEditSubmit = require('./utils/handleEditSubmit.js');
25
25
  var handleHeaderCellSelection = require('./utils/handleHeaderCellSelection.js');
26
+ var getNodeTextContent = require('../../global/js/utils/getNodeTextContent.js');
26
27
  var commonEventHandlers = require('./utils/commonEventHandlers.js');
27
28
  var settings = require('../../settings.js');
28
29
  var removeCellSelections = require('./utils/removeCellSelections.js');
@@ -214,7 +215,13 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
214
215
  var currentHeaders = [];
215
216
  if (Object.keys(currentColumns).length > 0) {
216
217
  Object.keys(currentColumns).forEach(function (itemIndex) {
217
- if (currentColumns[itemIndex].Header) {
218
+ if (_rollupPluginBabelHelpers["typeof"](currentColumns[itemIndex].Header) === 'object') {
219
+ if (currentColumns[itemIndex].column_name) {
220
+ currentHeaders.push(currentColumns[itemIndex].column_name);
221
+ } else {
222
+ currentHeaders.push(getNodeTextContent.getNodeTextContent(currentColumns[itemIndex].Header));
223
+ }
224
+ } else if (currentColumns[itemIndex].Header) {
218
225
  currentHeaders.push(currentColumns[itemIndex].Header);
219
226
  }
220
227
  });
@@ -42,6 +42,7 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
42
42
  selectedRowIds = datagridState.state.selectedRowIds,
43
43
  toggleAllRowsSelected = datagridState.toggleAllRowsSelected,
44
44
  toolbarBatchActions = datagridState.toolbarBatchActions,
45
+ toolbarBatchActionsDisplayMin = datagridState.toolbarBatchActionsDisplayMin,
45
46
  setGlobalFilter = datagridState.setGlobalFilter,
46
47
  rows = datagridState.rows,
47
48
  dispatch = datagridState.dispatch,
@@ -89,7 +90,7 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
89
90
  var minWidthBeforeOverflowIcon = 380;
90
91
  // Do not render ButtonMenu when there are 3 or less items
91
92
  // and if there is enough available space to render all the items
92
- if (toolbarBatchActions && (toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.length) <= 3 && !displayAllInMenu) {
93
+ if (toolbarBatchActions && !displayAllInMenu && (!toolbarBatchActionsDisplayMin && (toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.length) <= 3 || toolbarBatchActionsDisplayMin !== undefined && (toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.length) <= toolbarBatchActionsDisplayMin)) {
93
94
  return;
94
95
  }
95
96
  var renderItem = function renderItem(batchAction, index) {
@@ -107,7 +108,10 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
107
108
  tabIndex: totalSelected > 0 ? 0 : -1,
108
109
  menuAlignment: "bottom"
109
110
  }, toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.map(function (batchAction, index) {
110
- var hidden = index < 2 && !displayAllInMenu;
111
+ var hidden = toolbarBatchActionsDisplayMin === undefined && index < 2 && !displayAllInMenu;
112
+ if (toolbarBatchActionsDisplayMin !== undefined && index < toolbarBatchActionsDisplayMin && !displayAllInMenu) {
113
+ hidden = true;
114
+ }
111
115
  if (!hidden) {
112
116
  return renderItem(batchAction, index);
113
117
  }
@@ -153,13 +157,14 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
153
157
  totalCount: rows && rows.length,
154
158
  translateWithId: translateWithIdBatchActions
155
159
  }, !displayAllInMenu && toolbarBatchActions && (toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.map(function (batchAction, index) {
156
- if (index < 2 && toolbarBatchActions.length > 3 || index < 3 && toolbarBatchActions.length <= 3) {
160
+ if (!toolbarBatchActionsDisplayMin && index < 2 && toolbarBatchActions.length > 3 || index < 3 && toolbarBatchActions.length <= 3 || toolbarBatchActionsDisplayMin !== undefined && index < toolbarBatchActionsDisplayMin) {
157
161
  return /*#__PURE__*/React__default["default"].createElement(react.TableBatchAction, {
158
162
  key: "".concat(batchAction.label, "-").concat(index),
159
163
  renderIcon: batchAction.renderIcon,
160
164
  onClick: function onClick(event) {
161
165
  return onClickHandler(event, batchAction);
162
166
  },
167
+ className: cx__default["default"](_rollupPluginBabelHelpers.defineProperty({}, "".concat(settings.carbon.prefix, "--noLabel"), !batchAction.label || batchAction.label === '')),
163
168
  iconDescription: batchAction.label,
164
169
  tabIndex: totalSelected > 0 ? 0 : -1
165
170
  }, batchAction.label);