@carbon/ibm-products 2.42.1-canary.26 → 2.42.1-canary.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. package/css/index-full-carbon.css +9 -302
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +1 -1
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon.css +9 -302
  6. package/css/index-without-carbon.css.map +1 -1
  7. package/css/index-without-carbon.min.css +1 -1
  8. package/css/index-without-carbon.min.css.map +1 -1
  9. package/css/index.css +9 -302
  10. package/css/index.css.map +1 -1
  11. package/css/index.min.css +1 -1
  12. package/css/index.min.css.map +1 -1
  13. package/es/components/Carousel/Carousel.d.ts +1 -1
  14. package/es/components/Carousel/Carousel.js +1 -1
  15. package/es/components/Coachmark/CoachmarkDragbar.d.ts +1 -1
  16. package/es/components/Coachmark/CoachmarkDragbar.js +1 -1
  17. package/es/components/Coachmark/CoachmarkHeader.d.ts +1 -1
  18. package/es/components/Coachmark/CoachmarkHeader.js +1 -1
  19. package/es/components/Coachmark/CoachmarkOverlay.d.ts +1 -1
  20. package/es/components/Coachmark/CoachmarkOverlay.js +1 -1
  21. package/es/components/Coachmark/CoachmarkTagline.d.ts +1 -1
  22. package/es/components/Coachmark/CoachmarkTagline.js +1 -1
  23. package/es/components/CoachmarkStack/CoachmarkStackHome.d.ts +1 -1
  24. package/es/components/CoachmarkStack/CoachmarkStackHome.js +2 -2
  25. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +0 -6
  26. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +33 -74
  27. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +1 -15
  28. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +12 -95
  29. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +2 -11
  30. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +9 -27
  31. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +0 -5
  32. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +14 -95
  33. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +0 -1
  34. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +0 -1
  35. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +0 -7
  36. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +1 -8
  37. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
  38. package/es/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.js +33 -38
  39. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +67 -197
  40. package/es/components/ConditionBuilder/utils/util.d.ts +0 -1
  41. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
  42. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.d.ts +1 -1
  43. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -0
  44. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +4 -7
  45. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -7
  46. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts +0 -1
  47. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +3 -13
  48. package/es/components/Datagrid/types/index.d.ts +0 -2
  49. package/es/components/Datagrid/useColumnOrder.d.ts +1 -7
  50. package/es/components/Datagrid/useFiltering.d.ts +1 -8
  51. package/es/components/Datagrid/useFiltering.js +7 -8
  52. package/es/components/Datagrid/useFlexResize.d.ts +1 -1
  53. package/es/components/Datagrid/useFlexResize.js +11 -11
  54. package/es/components/Datagrid/useNestedRows.js +2 -24
  55. package/es/components/Datagrid/useOnRowClick.d.ts +1 -8
  56. package/es/components/Datagrid/useOnRowClick.js +1 -2
  57. package/es/components/Datagrid/useRowIsMouseOver.d.ts +1 -2
  58. package/es/components/Datagrid/useRowIsMouseOver.js +1 -1
  59. package/es/components/Datagrid/useSelectRows.d.ts +1 -8
  60. package/es/components/Datagrid/useSelectRows.js +2 -3
  61. package/es/components/Datagrid/useSortableColumns.d.ts +3 -10
  62. package/es/components/Datagrid/useSortableColumns.js +2 -3
  63. package/es/components/Datagrid/utils/getAutoSizedColumnWidth.d.ts +1 -8
  64. package/es/components/Datagrid/utils/getAutoSizedColumnWidth.js +7 -0
  65. package/es/components/InterstitialScreenView/InterstitialScreenView.d.ts +1 -1
  66. package/es/components/InterstitialScreenView/InterstitialScreenView.js +1 -1
  67. package/es/components/SidePanel/SidePanel.d.ts +2 -2
  68. package/es/components/SidePanel/SidePanel.js +5 -9
  69. package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +1 -1
  70. package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +1 -1
  71. package/es/global/js/package-settings.js +2 -2
  72. package/lib/components/Carousel/Carousel.d.ts +1 -1
  73. package/lib/components/Carousel/Carousel.js +1 -1
  74. package/lib/components/Coachmark/CoachmarkDragbar.d.ts +1 -1
  75. package/lib/components/Coachmark/CoachmarkDragbar.js +1 -1
  76. package/lib/components/Coachmark/CoachmarkHeader.d.ts +1 -1
  77. package/lib/components/Coachmark/CoachmarkHeader.js +1 -1
  78. package/lib/components/Coachmark/CoachmarkOverlay.d.ts +1 -1
  79. package/lib/components/Coachmark/CoachmarkOverlay.js +1 -1
  80. package/lib/components/Coachmark/CoachmarkTagline.d.ts +1 -1
  81. package/lib/components/Coachmark/CoachmarkTagline.js +1 -1
  82. package/lib/components/CoachmarkStack/CoachmarkStackHome.d.ts +1 -1
  83. package/lib/components/CoachmarkStack/CoachmarkStackHome.js +2 -2
  84. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +0 -6
  85. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +32 -73
  86. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +1 -15
  87. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +9 -92
  88. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +2 -11
  89. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +8 -26
  90. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +0 -5
  91. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +11 -92
  92. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +0 -1
  93. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +0 -1
  94. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +0 -7
  95. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +1 -8
  96. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
  97. package/lib/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.js +31 -36
  98. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +64 -195
  99. package/lib/components/ConditionBuilder/utils/util.d.ts +0 -1
  100. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
  101. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.d.ts +1 -1
  102. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -0
  103. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +4 -7
  104. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -7
  105. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts +0 -1
  106. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +3 -13
  107. package/lib/components/Datagrid/types/index.d.ts +0 -2
  108. package/lib/components/Datagrid/useColumnOrder.d.ts +1 -7
  109. package/lib/components/Datagrid/useFiltering.d.ts +1 -8
  110. package/lib/components/Datagrid/useFiltering.js +7 -8
  111. package/lib/components/Datagrid/useFlexResize.d.ts +1 -1
  112. package/lib/components/Datagrid/useFlexResize.js +11 -11
  113. package/lib/components/Datagrid/useNestedRows.js +2 -24
  114. package/lib/components/Datagrid/useOnRowClick.d.ts +1 -8
  115. package/lib/components/Datagrid/useOnRowClick.js +1 -2
  116. package/lib/components/Datagrid/useRowIsMouseOver.d.ts +1 -2
  117. package/lib/components/Datagrid/useRowIsMouseOver.js +1 -1
  118. package/lib/components/Datagrid/useSelectRows.d.ts +1 -8
  119. package/lib/components/Datagrid/useSelectRows.js +2 -3
  120. package/lib/components/Datagrid/useSortableColumns.d.ts +3 -10
  121. package/lib/components/Datagrid/useSortableColumns.js +2 -3
  122. package/lib/components/Datagrid/utils/getAutoSizedColumnWidth.d.ts +1 -8
  123. package/lib/components/Datagrid/utils/getAutoSizedColumnWidth.js +7 -0
  124. package/lib/components/InterstitialScreenView/InterstitialScreenView.d.ts +1 -1
  125. package/lib/components/InterstitialScreenView/InterstitialScreenView.js +1 -1
  126. package/lib/components/SidePanel/SidePanel.d.ts +2 -2
  127. package/lib/components/SidePanel/SidePanel.js +5 -9
  128. package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +1 -1
  129. package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +1 -1
  130. package/lib/global/js/package-settings.js +2 -2
  131. package/package.json +2 -2
  132. package/scss/components/ConditionBuilder/_condition-builder.scss +1 -21
  133. package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +3 -22
  134. package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +21 -58
  135. package/scss/components/NonLinearReading/_non-linear-reading.scss +1 -1
  136. package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.d.ts +0 -2
  137. package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +0 -44
  138. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +0 -10
  139. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +0 -69
  140. package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.d.ts +0 -2
  141. package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +0 -52
  142. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +0 -10
  143. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +0 -77
  144. /package/es/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.d.ts +0 -0
  145. /package/lib/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.d.ts +0 -0
@@ -32,7 +32,7 @@ var defaults = {
32
32
  };
33
33
  /**
34
34
  * DO NOT USE. This component is for the exclusive use
35
- * of other Onboarding components.
35
+ * of other Novice to Pro components.
36
36
  */
37
37
  var CoachmarkOverlay = /*#__PURE__*/forwardRef(function (_ref, ref) {
38
38
  var children = _ref.children,
@@ -25,7 +25,7 @@ interface CoachmarkTaglineProps {
25
25
  }
26
26
  /**
27
27
  * DO NOT USE. This component is for the exclusive use
28
- * of other Onboarding components.
28
+ * of other Novice to Pro components.
29
29
  */
30
30
  export declare let CoachmarkTagline: React.ForwardRefExoticComponent<CoachmarkTaglineProps & React.RefAttributes<HTMLDivElement>>;
31
31
  export {};
@@ -28,7 +28,7 @@ var defaults = {
28
28
  };
29
29
  /**
30
30
  * DO NOT USE. This component is for the exclusive use
31
- * of other Onboarding components.
31
+ * of other Novice to Pro components.
32
32
  */
33
33
  var CoachmarkTagline = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
34
34
  var _ref$closeIconDescrip = _ref.closeIconDescription,
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DO NOT USE. This component is for the exclusive use
3
- * of other Onboarding components.
3
+ * of other Novice to Pro components.
4
4
  */
5
5
  export let CoachmarkStackHome: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
6
6
  import React from 'react';
@@ -30,7 +30,7 @@ var componentName = 'CoachmarkStackHome';
30
30
 
31
31
  /**
32
32
  * DO NOT USE. This component is for the exclusive use
33
- * of other Onboarding components.
33
+ * of other Novice to Pro components.
34
34
  */
35
35
  var CoachmarkStackHome = /*#__PURE__*/forwardRef(function (_ref, ref) {
36
36
  var _document$querySelect;
@@ -58,7 +58,7 @@ var CoachmarkStackHome = /*#__PURE__*/forwardRef(function (_ref, ref) {
58
58
  }, 100);
59
59
  }, [isOpen]);
60
60
  if (!navLinkLabels) {
61
- return pconsole.warn("".concat(componentName, " is an Onboarding internal component and is not intended for general use."));
61
+ return pconsole.warn("".concat(componentName, " is a Novice to Pro internal component and is not intended for general use."));
62
62
  }
63
63
  var portalNode = portalTarget ? (_document$querySelect = document.querySelector(portalTarget)) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.querySelector('body') : document.querySelector('body');
64
64
  return /*#__PURE__*/createPortal( /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
@@ -6,23 +6,17 @@ declare function ConditionBlock(props: any): import("react/jsx-runtime").JSX.Ele
6
6
  declare namespace ConditionBlock {
7
7
  namespace propTypes {
8
8
  let addConditionHandler: PropTypes.Requireable<(...args: any[]) => any>;
9
- let addConditionSubGroupHandler: PropTypes.Requireable<(...args: any[]) => any>;
10
9
  let aria: PropTypes.Requireable<object>;
11
10
  let condition: PropTypes.Requireable<object>;
12
11
  let conditionIndex: PropTypes.Requireable<number>;
13
12
  let conjunction: PropTypes.Requireable<string>;
14
13
  let group: PropTypes.Requireable<object>;
15
- let hideConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
16
- let hideConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
17
14
  let isLastCondition: PropTypes.Requireable<(...args: any[]) => any>;
18
15
  let isStatement: PropTypes.Requireable<boolean>;
19
16
  let onChange: PropTypes.Requireable<(...args: any[]) => any>;
20
17
  let onConnectorOperatorChange: PropTypes.Requireable<(...args: any[]) => any>;
21
18
  let onRemove: PropTypes.Requireable<(...args: any[]) => any>;
22
19
  let onStatementChange: PropTypes.Requireable<(...args: any[]) => any>;
23
- let showConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
24
- let showConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
25
- let state: PropTypes.Requireable<object>;
26
20
  }
27
21
  }
28
22
  import PropTypes from 'prop-types';
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { slicedToArray as _slicedToArray, extends as _extends, defineProperty as _defineProperty, objectSpread2 as _objectSpread2 } from '../../../_virtual/_rollupPluginBabelHelpers.js';
8
+ import { slicedToArray as _slicedToArray, defineProperty as _defineProperty, objectSpread2 as _objectSpread2 } from '../../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import React__default, { useContext, useState } from 'react';
10
10
  import { Close } from '@carbon/react/icons';
11
11
  import { ConditionBuilderItem } from '../ConditionBuilderItem/ConditionBuilderItem.js';
@@ -13,7 +13,7 @@ import PropTypes from '../../../node_modules/prop-types/index.js';
13
13
  import { blockClass, translateWithId, statementConfig, operatorConfig } from '../ConditionBuilderContext/DataConfigs.js';
14
14
  import { ConditionBuilderItemOption } from '../ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js';
15
15
  import cx from 'classnames';
16
- import ConditionConnector from '../ConditionBuilderConnector/ConditionConnector.js';
16
+ import ConditionConnector from '../ConditionConnector/ConditionConnector.js';
17
17
  import { ConditionBuilderItemNumber } from '../ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js';
18
18
  import { ConditionBuilderItemText } from '../ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js';
19
19
  import { ConditionBuilderItemDate } from '../ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js';
@@ -23,7 +23,6 @@ import { focusThisField } from '../utils/util.js';
23
23
  import { ConditionBuilderItemTime } from '../ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js';
24
24
  import ConditionBuilderAdd from '../ConditionBuilderAdd/ConditionBuilderAdd.js';
25
25
 
26
- var _div;
27
26
  /**
28
27
  * This component build each block of condition consisting of property, operator value and close button.
29
28
  */
@@ -41,19 +40,11 @@ var ConditionBlock = function ConditionBlock(props) {
41
40
  isStatement = props.isStatement,
42
41
  group = props.group,
43
42
  onStatementChange = props.onStatementChange,
44
- conditionIndex = props.conditionIndex,
45
43
  addConditionHandler = props.addConditionHandler,
46
- _addConditionSubGroupHandler = props.addConditionSubGroupHandler,
47
- aria = props.aria,
48
- hideConditionSubGroupPreviewHandler = props.hideConditionSubGroupPreviewHandler,
49
- showConditionSubGroupPreviewHandler = props.showConditionSubGroupPreviewHandler,
50
- hideConditionPreviewHandler = props.hideConditionPreviewHandler,
51
- showConditionPreviewHandler = props.showConditionPreviewHandler,
44
+ conditionIndex = props.conditionIndex,
52
45
  isLastCondition = props.isLastCondition;
53
46
  var _useContext = useContext(ConditionBuilderContext),
54
- inputConfig = _useContext.inputConfig,
55
- variant = _useContext.variant;
56
- //Below possible input types expected for value field.
47
+ inputConfig = _useContext.inputConfig;
57
48
  var itemComponents = {
58
49
  option: ConditionBuilderItemOption,
59
50
  text: ConditionBuilderItemText,
@@ -78,17 +69,14 @@ var ConditionBlock = function ConditionBlock(props) {
78
69
  type = _getCurrentConfig.type,
79
70
  config = _getCurrentConfig.config,
80
71
  label = _getCurrentConfig.label;
81
- var ItemComponent;
82
- // if (type == 'custom') {
83
- // ItemComponent = config.component;
84
- // } else {
85
- ItemComponent = property ? itemComponents[type] : null;
86
- //}
87
-
72
+ var ItemComponent = property ? itemComponents[type] : null;
88
73
  var onStatementChangeHandler = function onStatementChangeHandler(v, evt) {
89
74
  focusThisField(evt);
90
75
  onStatementChange(v);
91
76
  };
77
+ var onConnectorOperatorChangeHandler = function onConnectorOperatorChangeHandler(op) {
78
+ onConnectorOperatorChange(op);
79
+ };
92
80
  var onPropertyChangeHandler = function onPropertyChangeHandler(newProperty) {
93
81
  onChange(_objectSpread2(_objectSpread2({}, condition), {}, {
94
82
  property: newProperty,
@@ -121,32 +109,21 @@ var ConditionBlock = function ConditionBlock(props) {
121
109
  return operator.type.indexOf(type) != -1 || operator.type == 'all';
122
110
  });
123
111
  };
124
- var getAriaAttributes = function getAriaAttributes() {
125
- return variant == 'tree' ? {
126
- 'aria-level': aria.level,
127
- 'aria-posinset': aria.posinset,
128
- 'aria-setsize': aria.setsize
129
- } : {};
130
- };
131
- return /*#__PURE__*/React__default.createElement("div", _extends({
132
- className: cx("".concat(blockClass, "__condition-block"), _defineProperty({}, "".concat(blockClass, "__condition__deletion-preview"), showDeletionPreview), _defineProperty({}, "".concat(blockClass, "__gap-bottom"), variant == 'tree' && !(conditionIndex + 1 >= group.conditions.length)), _defineProperty({}, "".concat(blockClass, "__gap ").concat(blockClass, "__gap-bottom"), variant == 'sentence')),
112
+ return /*#__PURE__*/React__default.createElement("div", {
113
+ className: cx("".concat(blockClass, "__condition-block conditionBlockWrapper ").concat(blockClass, "__gap ").concat(blockClass, "__gap-bottom"), _defineProperty({}, "".concat(blockClass, "__condition__deletion-preview"), showDeletionPreview)),
114
+ key: conditionIndex,
133
115
  role: "row",
134
116
  "aria-label": translateWithId('condition_row'),
135
117
  tabIndex: -1
136
- }, getAriaAttributes()), conjunction ? /*#__PURE__*/React__default.createElement(ConditionConnector, {
137
- className: "".concat(blockClass, "__gap"),
138
- operator: conjunction,
139
- onChange: function onChange(op) {
140
- return onConnectorOperatorChange(op);
141
- }
142
- }) : _div || (_div = /*#__PURE__*/React__default.createElement("div", {
143
- role: "gridcell"
144
- })), isStatement && /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
118
+ }, isStatement && /*#__PURE__*/React__default.createElement(ConditionBuilderItem
119
+ // open={false}
120
+ , {
145
121
  label: group.statement,
146
122
  title: translateWithId('condition'),
147
123
  "data-name": "connectorField",
148
124
  popOverClassName: "".concat(blockClass, "__gap"),
149
- className: "".concat(blockClass, "__statement-button")
125
+ className: "".concat(blockClass, "__statement-button"),
126
+ tabIndex: 0
150
127
  }, /*#__PURE__*/React__default.createElement(ConditionBuilderItemOption, {
151
128
  conditionState: {
152
129
  value: group.statement,
@@ -156,7 +133,11 @@ var ConditionBlock = function ConditionBlock(props) {
156
133
  config: {
157
134
  options: statementConfig
158
135
  }
159
- })), /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
136
+ })), conjunction && /*#__PURE__*/React__default.createElement(ConditionConnector, {
137
+ className: "".concat(blockClass, "__gap"),
138
+ operator: conjunction,
139
+ onChange: onConnectorOperatorChangeHandler
140
+ }), /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
160
141
  label: label,
161
142
  title: translateWithId('property'),
162
143
  renderIcon: icon !== null && icon !== void 0 ? icon : null,
@@ -203,8 +184,7 @@ var ConditionBlock = function ConditionBlock(props) {
203
184
  value: value
204
185
  },
205
186
  onChange: onValueChangeHandler,
206
- config: config,
207
- "data-name": "valueField"
187
+ config: config
208
188
  })), /*#__PURE__*/React__default.createElement("span", {
209
189
  role: "gridcell",
210
190
  "aria-label": translateWithId('remove_condition')
@@ -222,15 +202,9 @@ var ConditionBlock = function ConditionBlock(props) {
222
202
  })), isLastCondition(conditionIndex, group.conditions) && /*#__PURE__*/React__default.createElement(ConditionBuilderAdd, {
223
203
  onClick: function onClick() {
224
204
  addConditionHandler(conditionIndex);
225
- },
226
- addConditionSubGroupHandler: function addConditionSubGroupHandler() {
227
- _addConditionSubGroupHandler(conditionIndex);
228
- },
229
- showConditionSubGroupPreviewHandler: showConditionSubGroupPreviewHandler,
230
- hideConditionSubGroupPreviewHandler: hideConditionSubGroupPreviewHandler,
231
- enableSubGroup: variant == 'tree',
232
- showConditionPreviewHandler: showConditionPreviewHandler,
233
- hideConditionPreviewHandler: hideConditionPreviewHandler,
205
+ }
206
+ //addConditionSubGroupHandler={()=>{addConditionSubGroupHandler(conditionIndex)}}
207
+ ,
234
208
  className: "".concat(blockClass, "__gap ").concat(blockClass, "__gap-left")
235
209
  }));
236
210
  };
@@ -240,15 +214,17 @@ ConditionBlock.propTypes = {
240
214
  * callback to add a new condition
241
215
  */
242
216
  addConditionHandler: PropTypes.func,
243
- /**
244
- * callback to add a new condition subgroup
245
- */
246
- addConditionSubGroupHandler: PropTypes.func,
247
217
  /**
248
218
  * object hold aria attributes
249
219
  */
250
220
  aria: PropTypes.object,
221
+ /**
222
+ * object that hold the current condition
223
+ */
251
224
  condition: PropTypes.object,
225
+ /**
226
+ * index of the current condition
227
+ */
252
228
  conditionIndex: PropTypes.number,
253
229
  /**
254
230
  * string that decides to show the condition connector
@@ -259,13 +235,8 @@ ConditionBlock.propTypes = {
259
235
  */
260
236
  group: PropTypes.object,
261
237
  /**
262
- * handler for hiding sub group preview
263
- */
264
- hideConditionPreviewHandler: PropTypes.func,
265
- /**
266
- * handler for hiding sub group preview
238
+ * callback to add a new condition
267
239
  */
268
- hideConditionSubGroupPreviewHandler: PropTypes.func,
269
240
  isLastCondition: PropTypes.func,
270
241
  /**
271
242
  * boolean that decides to show the statement(if/ excl.if)
@@ -286,19 +257,7 @@ ConditionBlock.propTypes = {
286
257
  /**
287
258
  * callback to handle the statement(if/ excl.if) change
288
259
  */
289
- onStatementChange: PropTypes.func,
290
- /**
291
- * handler for showing add condition preview
292
- */
293
- showConditionPreviewHandler: PropTypes.func,
294
- /**
295
- * handler for showing sub group preview
296
- */
297
- showConditionSubGroupPreviewHandler: PropTypes.func,
298
- /**
299
- * object that hold the current condition
300
- */
301
- state: PropTypes.object
260
+ onStatementChange: PropTypes.func
302
261
  };
303
262
 
304
263
  export { ConditionBlock$1 as default };
@@ -1,26 +1,12 @@
1
1
  export default ConditionBuilderAdd;
2
- declare function ConditionBuilderAdd({ className, onClick, addConditionSubGroupHandler, showConditionSubGroupPreviewHandler, hideConditionSubGroupPreviewHandler, showConditionPreviewHandler, hideConditionPreviewHandler, enableSubGroup, buttonLabel, }: {
2
+ declare function ConditionBuilderAdd({ className, onClick }: {
3
3
  className: any;
4
4
  onClick: any;
5
- addConditionSubGroupHandler: any;
6
- showConditionSubGroupPreviewHandler: any;
7
- hideConditionSubGroupPreviewHandler: any;
8
- showConditionPreviewHandler: any;
9
- hideConditionPreviewHandler: any;
10
- enableSubGroup: any;
11
- buttonLabel: any;
12
5
  }): import("react/jsx-runtime").JSX.Element;
13
6
  declare namespace ConditionBuilderAdd {
14
7
  namespace propTypes {
15
- let addConditionSubGroupHandler: PropTypes.Requireable<(...args: any[]) => any>;
16
- let buttonLabel: PropTypes.Requireable<string>;
17
8
  let className: PropTypes.Requireable<string>;
18
- let enableSubGroup: PropTypes.Requireable<boolean>;
19
- let hideConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
20
- let hideConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
21
9
  let onClick: PropTypes.Requireable<(...args: any[]) => any>;
22
- let showConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
23
- let showConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
24
10
  }
25
11
  }
26
12
  import PropTypes from 'prop-types';
@@ -5,119 +5,36 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { slicedToArray as _slicedToArray, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
9
- import React__default, { useState } from 'react';
10
- import { AddAlt, TextNewLine } from '@carbon/react/icons';
8
+ import React__default from 'react';
9
+ import { AddAlt } from '@carbon/react/icons';
11
10
  import { ConditionBuilderButton } from '../ConditionBuilderButton/ConditionBuilderButton.js';
12
11
  import PropTypes from '../../../node_modules/prop-types/index.js';
13
- import { translateWithId, blockClass } from '../ConditionBuilderContext/DataConfigs.js';
12
+ import { blockClass, translateWithId } from '../ConditionBuilderContext/DataConfigs.js';
14
13
 
15
14
  var ConditionBuilderAdd = function ConditionBuilderAdd(_ref) {
16
15
  var className = _ref.className,
17
- onClick = _ref.onClick,
18
- addConditionSubGroupHandler = _ref.addConditionSubGroupHandler,
19
- showConditionSubGroupPreviewHandler = _ref.showConditionSubGroupPreviewHandler,
20
- hideConditionSubGroupPreviewHandler = _ref.hideConditionSubGroupPreviewHandler,
21
- showConditionPreviewHandler = _ref.showConditionPreviewHandler,
22
- hideConditionPreviewHandler = _ref.hideConditionPreviewHandler,
23
- enableSubGroup = _ref.enableSubGroup,
24
- buttonLabel = _ref.buttonLabel;
25
- var _useState = useState(false),
26
- _useState2 = _slicedToArray(_useState, 2),
27
- isAddSubgroup = _useState2[0],
28
- setIsAddSubgroup = _useState2[1];
29
- var showAddSubGroup = function showAddSubGroup() {
30
- setIsAddSubgroup(true);
31
- };
32
- var hideAddSubGroup = function hideAddSubGroup() {
33
- setIsAddSubgroup(false);
34
- };
35
- var onClickHandler = function onClickHandler() {
36
- hideConditionPreviewHandler === null || hideConditionPreviewHandler === void 0 || hideConditionPreviewHandler();
37
- onClick();
38
- };
39
- var previewHandlers = function previewHandlers() {
40
- return enableSubGroup ? {
41
- onMouseEnter: showConditionPreviewHandler,
42
- onMouseLeave: hideConditionPreviewHandler,
43
- onFocus: showConditionPreviewHandler,
44
- onBlur: hideConditionPreviewHandler
45
- } : {};
46
- };
47
- var previewHandlersForSubgroup = function previewHandlersForSubgroup() {
48
- return {
49
- onMouseEnter: showConditionSubGroupPreviewHandler,
50
- onMouseLeave: hideConditionSubGroupPreviewHandler,
51
- onFocus: showConditionSubGroupPreviewHandler,
52
- onBlur: hideConditionSubGroupPreviewHandler
53
- };
54
- };
55
- var wrapperProps = enableSubGroup ? {
56
- role: 'gridcell',
57
- 'aria-label': translateWithId('add-condition')
58
- } : {};
16
+ onClick = _ref.onClick;
59
17
  return /*#__PURE__*/React__default.createElement("div", {
60
- className: "".concat(className, " ").concat(blockClass, "__add-button-wrapper"),
61
- role: !enableSubGroup ? 'gridcell' : 'none',
62
- "aria-label": !enableSubGroup ? translateWithId('add_condition_row') : undefined,
63
- onMouseEnter: showAddSubGroup,
64
- onMouseLeave: hideAddSubGroup,
65
- onFocus: showAddSubGroup,
66
- onBlur: hideAddSubGroup
67
- }, /*#__PURE__*/React__default.createElement(ConditionBuilderButton, _extends({
18
+ className: className,
19
+ role: "gridcell"
20
+ }, /*#__PURE__*/React__default.createElement(ConditionBuilderButton, {
68
21
  renderIcon: AddAlt,
69
- onClick: onClickHandler
70
- }, previewHandlers(), {
22
+ onClick: onClick,
71
23
  className: "".concat(blockClass, "__add-button"),
72
24
  hideLabel: true,
73
- "data-name": "addButton",
74
- label: buttonLabel !== null && buttonLabel !== void 0 ? buttonLabel : translateWithId('add-condition'),
75
- wrapperProps: wrapperProps
76
- })), isAddSubgroup && enableSubGroup && /*#__PURE__*/React__default.createElement(ConditionBuilderButton, _extends({
77
- renderIcon: TextNewLine,
78
- onClick: addConditionSubGroupHandler,
79
- className: "".concat(blockClass, "__add-condition-group ").concat(blockClass, "__gap-left"),
80
- hideLabel: true,
81
- label: translateWithId('add-condition'),
82
- wrapperProps: wrapperProps
83
- }, previewHandlersForSubgroup())));
25
+ label: translateWithId('add-condition')
26
+ }));
84
27
  };
85
28
  var ConditionBuilderAdd$1 = ConditionBuilderAdd;
86
29
  ConditionBuilderAdd.propTypes = {
87
- /**
88
- * handler for hiding sub group preview
89
- */
90
- addConditionSubGroupHandler: PropTypes.func,
91
- /**
92
- * handler for hiding sub group preview
93
- */ /**
94
- * tooltip label for plus button
95
- */
96
- buttonLabel: PropTypes.string,
97
30
  /**
98
31
  * Provide an optional class to be applied to the containing node.
99
32
  */
100
33
  className: PropTypes.string,
101
34
  /**
102
- * boolean to enable sub groups for the tree variant
103
- */
104
- enableSubGroup: PropTypes.bool,
105
- /**
106
- * handler for hiding sub group preview
107
- */
108
- hideConditionPreviewHandler: PropTypes.func,
109
- hideConditionSubGroupPreviewHandler: PropTypes.func,
110
- /**
111
- * handler for hiding sub group preview
112
- */ /**
113
- * callback triggered on click of add button
114
- */
115
- onClick: PropTypes.func,
116
- showConditionPreviewHandler: PropTypes.func,
117
- showConditionSubGroupPreviewHandler: PropTypes.func
118
- /**
119
- * handler for hiding sub group preview
35
+ * callback triggered on click of add button
120
36
  */
37
+ onClick: PropTypes.func
121
38
  };
122
39
 
123
40
  export { ConditionBuilderAdd$1 as default };
@@ -1,4 +1,5 @@
1
- export function ConditionBuilderButton({ className, label, hideLabel, tooltipAlign, renderIcon: Icon, onClick, showToolTip, wrapperProps, onBlur, onFocus, onMouseEnter, onMouseLeave, }: {
1
+ export function ConditionBuilderButton({ className, label, hideLabel, tooltipAlign, renderIcon: Icon, onClick, showToolTip, ...rest }: {
2
+ [x: string]: any;
2
3
  className: any;
3
4
  label: any;
4
5
  hideLabel: any;
@@ -6,26 +7,16 @@ export function ConditionBuilderButton({ className, label, hideLabel, tooltipAli
6
7
  renderIcon: any;
7
8
  onClick: any;
8
9
  showToolTip: any;
9
- wrapperProps: any;
10
- onBlur: any;
11
- onFocus: any;
12
- onMouseEnter: any;
13
- onMouseLeave: any;
14
10
  }): import("react/jsx-runtime").JSX.Element;
15
11
  export namespace ConditionBuilderButton {
16
12
  namespace propTypes {
17
13
  let className: PropTypes.Requireable<string>;
18
14
  let hideLabel: PropTypes.Requireable<boolean>;
19
15
  let label: PropTypes.Requireable<string>;
20
- let onBlur: PropTypes.Requireable<(...args: any[]) => any>;
21
16
  let onClick: PropTypes.Requireable<(...args: any[]) => any>;
22
- let onFocus: PropTypes.Requireable<(...args: any[]) => any>;
23
- let onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
24
- let onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
25
17
  let renderIcon: PropTypes.Requireable<object>;
26
18
  let showToolTip: PropTypes.Requireable<boolean>;
27
19
  let tooltipAlign: PropTypes.Requireable<string>;
28
- let wrapperProps: PropTypes.Requireable<object>;
29
20
  }
30
21
  }
31
22
  import PropTypes from 'prop-types';
@@ -5,15 +5,16 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { extends as _extends, defineProperty as _defineProperty } from '../../../_virtual/_rollupPluginBabelHelpers.js';
8
+ import { objectWithoutProperties as _objectWithoutProperties, extends as _extends, defineProperty as _defineProperty } from '../../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import React__default from 'react';
10
10
  import cx from 'classnames';
11
11
  import PropTypes from '../../../node_modules/prop-types/index.js';
12
12
  import { Tooltip } from '@carbon/react';
13
13
  import { blockClass } from '../ConditionBuilderContext/DataConfigs.js';
14
14
 
15
+ var _excluded = ["className", "label", "hideLabel", "tooltipAlign", "renderIcon", "onClick", "showToolTip"];
15
16
  var ConditionBuilderButton = function ConditionBuilderButton(_ref) {
16
- var _Icon, _span;
17
+ var _Icon;
17
18
  var className = _ref.className,
18
19
  label = _ref.label,
19
20
  hideLabel = _ref.hideLabel,
@@ -21,29 +22,21 @@ var ConditionBuilderButton = function ConditionBuilderButton(_ref) {
21
22
  Icon = _ref.renderIcon,
22
23
  onClick = _ref.onClick,
23
24
  showToolTip = _ref.showToolTip,
24
- wrapperProps = _ref.wrapperProps,
25
- onBlur = _ref.onBlur,
26
- onFocus = _ref.onFocus,
27
- onMouseEnter = _ref.onMouseEnter,
28
- onMouseLeave = _ref.onMouseLeave;
25
+ rest = _objectWithoutProperties(_ref, _excluded);
29
26
  var Button = function Button() {
30
- return /*#__PURE__*/React__default.createElement("button", {
27
+ return /*#__PURE__*/React__default.createElement("button", _extends({
31
28
  // role={'gridcell'}
32
29
  tabIndex: -1,
33
30
  className: cx([className, "".concat(blockClass, "__button"), _defineProperty({}, "".concat(blockClass, "__text-ellipsis"), showToolTip && !hideLabel)]),
34
31
  type: "button",
35
- onClick: onClick,
36
- onBlur: onBlur,
37
- onFocus: onFocus,
38
- onMouseEnter: onMouseEnter,
39
- onMouseLeave: onMouseLeave
40
- }, Icon && (_Icon || (_Icon = /*#__PURE__*/React__default.createElement(Icon, null))), !hideLabel && (_span || (_span = /*#__PURE__*/React__default.createElement("span", null, label))));
32
+ onClick: onClick
33
+ }, rest), Icon && (_Icon || (_Icon = /*#__PURE__*/React__default.createElement(Icon, null))), !hideLabel && label);
41
34
  };
42
35
  return hideLabel || showToolTip ? /*#__PURE__*/React__default.createElement(Tooltip, _extends({
43
36
  label: label,
44
37
  align: tooltipAlign,
45
38
  className: "".concat(blockClass, "__con-tooltip")
46
- }, wrapperProps), Button()) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, Button());
39
+ }, rest.wrapperProps), Button()) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, Button());
47
40
  };
48
41
  ConditionBuilderButton.propTypes = {
49
42
  /**
@@ -58,17 +51,10 @@ ConditionBuilderButton.propTypes = {
58
51
  * label of the button
59
52
  */
60
53
  label: PropTypes.string,
61
- /**
62
- * mouse events callbacks
63
- */
64
- onBlur: PropTypes.func,
65
54
  /**
66
55
  * callback triggered on click of add button
67
56
  */
68
57
  onClick: PropTypes.func,
69
- onFocus: PropTypes.func,
70
- onMouseEnter: PropTypes.func,
71
- onMouseLeave: PropTypes.func,
72
58
  /**
73
59
  * Optional prop to allow overriding the icon rendering.
74
60
  */
@@ -82,11 +68,7 @@ ConditionBuilderButton.propTypes = {
82
68
  /**
83
69
  * tooltip position
84
70
  */
85
- tooltipAlign: PropTypes.string,
86
- /**
87
- * optional props for tree grid to add role and aria-label to wrapper span
88
- */
89
- wrapperProps: PropTypes.object
71
+ tooltipAlign: PropTypes.string
90
72
  };
91
73
 
92
74
  export { ConditionBuilderButton };
@@ -7,12 +7,7 @@ declare function ConditionBuilderContent({ startConditionLabel, conditionBuilder
7
7
  }): import("react/jsx-runtime").JSX.Element;
8
8
  declare namespace ConditionBuilderContent {
9
9
  namespace propTypes {
10
- let actions: PropTypes.Requireable<(PropTypes.InferProps<{
11
- id: PropTypes.Requireable<number>;
12
- label: PropTypes.Requireable<string>;
13
- }> | null | undefined)[]>;
14
10
  let conditionBuilderRef: PropTypes.Requireable<object>;
15
- let getActionsState: PropTypes.Requireable<(...args: any[]) => any>;
16
11
  let getConditionState: PropTypes.Validator<(...args: any[]) => any>;
17
12
  let initialState: PropTypes.Requireable<PropTypes.InferProps<{
18
13
  groups: PropTypes.Requireable<(PropTypes.InferProps<{