@carbon/ibm-products 2.42.1-canary.0 → 2.42.1-canary.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. package/css/index-full-carbon.css +312 -11
  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 +10 -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 +312 -11
  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 +312 -11
  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/Carousel/Carousel.d.ts +1 -1
  18. package/es/components/Carousel/Carousel.js +1 -1
  19. package/es/components/Coachmark/CoachmarkDragbar.d.ts +1 -1
  20. package/es/components/Coachmark/CoachmarkDragbar.js +1 -1
  21. package/es/components/Coachmark/CoachmarkHeader.d.ts +1 -1
  22. package/es/components/Coachmark/CoachmarkHeader.js +1 -1
  23. package/es/components/Coachmark/CoachmarkOverlay.d.ts +1 -1
  24. package/es/components/Coachmark/CoachmarkOverlay.js +1 -1
  25. package/es/components/Coachmark/CoachmarkTagline.d.ts +1 -1
  26. package/es/components/Coachmark/CoachmarkTagline.js +1 -1
  27. package/es/components/CoachmarkStack/CoachmarkStackHome.d.ts +1 -1
  28. package/es/components/CoachmarkStack/CoachmarkStackHome.js +2 -2
  29. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +6 -0
  30. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +74 -33
  31. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +15 -1
  32. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +95 -12
  33. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +11 -2
  34. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +27 -9
  35. package/es/components/ConditionBuilder/{ConditionConnector → ConditionBuilderConnector}/ConditionConnector.js +38 -33
  36. package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.d.ts +2 -0
  37. package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +44 -0
  38. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +5 -0
  39. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +95 -14
  40. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +1 -0
  41. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +1 -0
  42. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +7 -0
  43. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +8 -1
  44. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
  45. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +197 -67
  46. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +10 -0
  47. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +69 -0
  48. package/es/components/ConditionBuilder/utils/util.d.ts +1 -0
  49. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
  50. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +7 -1
  51. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +1 -1
  52. package/es/components/Datagrid/types/index.d.ts +1 -0
  53. package/es/components/Datagrid/useSortableColumns.d.ts +10 -3
  54. package/es/components/Datagrid/useSortableColumns.js +3 -2
  55. package/es/components/InterstitialScreenView/InterstitialScreenView.d.ts +1 -1
  56. package/es/components/InterstitialScreenView/InterstitialScreenView.js +1 -1
  57. package/es/components/SidePanel/SidePanel.d.ts +2 -2
  58. package/es/components/SidePanel/SidePanel.js +18 -16
  59. package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +1 -1
  60. package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +1 -1
  61. package/es/feature-flags.js +18 -0
  62. package/es/global/js/package-settings.js +2 -2
  63. package/es/index.d.ts +1 -0
  64. package/es/index.js +1 -0
  65. package/lib/components/Carousel/Carousel.d.ts +1 -1
  66. package/lib/components/Carousel/Carousel.js +1 -1
  67. package/lib/components/Coachmark/CoachmarkDragbar.d.ts +1 -1
  68. package/lib/components/Coachmark/CoachmarkDragbar.js +1 -1
  69. package/lib/components/Coachmark/CoachmarkHeader.d.ts +1 -1
  70. package/lib/components/Coachmark/CoachmarkHeader.js +1 -1
  71. package/lib/components/Coachmark/CoachmarkOverlay.d.ts +1 -1
  72. package/lib/components/Coachmark/CoachmarkOverlay.js +1 -1
  73. package/lib/components/Coachmark/CoachmarkTagline.d.ts +1 -1
  74. package/lib/components/Coachmark/CoachmarkTagline.js +1 -1
  75. package/lib/components/CoachmarkStack/CoachmarkStackHome.d.ts +1 -1
  76. package/lib/components/CoachmarkStack/CoachmarkStackHome.js +2 -2
  77. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +6 -0
  78. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +73 -32
  79. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +15 -1
  80. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +92 -9
  81. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +11 -2
  82. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +26 -8
  83. package/lib/components/ConditionBuilder/{ConditionConnector → ConditionBuilderConnector}/ConditionConnector.js +36 -31
  84. package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.d.ts +2 -0
  85. package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +52 -0
  86. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +5 -0
  87. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +92 -11
  88. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +1 -0
  89. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +1 -0
  90. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +7 -0
  91. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +8 -1
  92. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
  93. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +195 -64
  94. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +10 -0
  95. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +77 -0
  96. package/lib/components/ConditionBuilder/utils/util.d.ts +1 -0
  97. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
  98. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +7 -1
  99. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +1 -1
  100. package/lib/components/Datagrid/types/index.d.ts +1 -0
  101. package/lib/components/Datagrid/useSortableColumns.d.ts +10 -3
  102. package/lib/components/Datagrid/useSortableColumns.js +3 -2
  103. package/lib/components/InterstitialScreenView/InterstitialScreenView.d.ts +1 -1
  104. package/lib/components/InterstitialScreenView/InterstitialScreenView.js +1 -1
  105. package/lib/components/SidePanel/SidePanel.d.ts +2 -2
  106. package/lib/components/SidePanel/SidePanel.js +17 -15
  107. package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +1 -1
  108. package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +1 -1
  109. package/lib/feature-flags.js +40 -0
  110. package/lib/global/js/package-settings.js +2 -2
  111. package/lib/index.d.ts +1 -0
  112. package/lib/index.js +1 -0
  113. package/package.json +2 -2
  114. package/scss/components/ConditionBuilder/_condition-builder.scss +21 -1
  115. package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +22 -3
  116. package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +58 -21
  117. package/scss/components/NonLinearReading/_non-linear-reading.scss +1 -1
  118. package/scss/components/SidePanel/_side-panel.scss +8 -1
  119. /package/es/components/ConditionBuilder/{ConditionConnector → ConditionBuilderConnector}/ConditionConnector.d.ts +0 -0
  120. /package/lib/components/ConditionBuilder/{ConditionConnector → ConditionBuilderConnector}/ConditionConnector.d.ts +0 -0
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import * as FeatureFlags from '@carbon/feature-flags';
9
+
10
+ FeatureFlags.merge({
11
+ 'default-portal-target-body': true,
12
+ 'enable-datagrid-useInlineEdit': false,
13
+ 'enable-datagrid-useEditableCell': false,
14
+ 'enable-datagrid-useCustomizeColumns': false,
15
+ 'ExampleComponent.secondaryIcon': false,
16
+ 'ExampleComponent.useExample': false,
17
+ 'enable-example-flag': false
18
+ });
@@ -98,7 +98,7 @@ var defaults = {
98
98
  GetStartedCard: false,
99
99
  /* new component flags here - comment used by generate CLI */
100
100
 
101
- // Novice to pro components not yet reviewed and released:
101
+ // Onboarding components not yet reviewed and released:
102
102
  Coachmark: false,
103
103
  CoachmarkBeacon: false,
104
104
  CoachmarkButton: false,
@@ -118,7 +118,7 @@ var defaults = {
118
118
  UserAvatar: false,
119
119
  /* new component flags here - comment used by generate CLI */
120
120
 
121
- // Novice to pro components not yet reviewed and released:
121
+ // Onboarding components not yet reviewed and released:
122
122
  EmptyStateV2: false,
123
123
  Guidebanner: false,
124
124
  GuidebannerElement: false,
package/es/index.d.ts CHANGED
@@ -4,6 +4,7 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
+ import './feature-flags';
7
8
  export { pkg } from './settings';
8
9
  export { usePrefix } from './global/js/hooks';
9
10
  export * from './components';
package/es/index.js CHANGED
@@ -5,6 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ import './feature-flags.js';
8
9
  export { pkg } from './settings.js';
9
10
  export { useColumnOrder } from 'react-table';
10
11
  export { usePrefix } from './global/js/hooks/usePrefix.js';
@@ -47,7 +47,7 @@ export interface CarouselProps {
47
47
  [key: string]: any;
48
48
  }
49
49
  /**
50
- * The Carousel acts as a scaffold for other Novice to Pro content.
50
+ * The Carousel acts as a scaffold for other Onboarding content.
51
51
  *
52
52
  * This component is not intended for general use.
53
53
  *
@@ -35,7 +35,7 @@ var defaults = {
35
35
  };
36
36
 
37
37
  /**
38
- * The Carousel acts as a scaffold for other Novice to Pro content.
38
+ * The Carousel acts as a scaffold for other Onboarding content.
39
39
  *
40
40
  * This component is not intended for general use.
41
41
  *
@@ -38,7 +38,7 @@ interface CoachmarkDragbarProps {
38
38
  }
39
39
  /**
40
40
  * DO NOT USE. This component is for the exclusive use
41
- * of other Novice to Pro components.
41
+ * of other Onboarding components.
42
42
  */
43
43
  export declare let CoachmarkDragbar: React.ForwardRefExoticComponent<Omit<CoachmarkDragbarProps, "ref"> & React.RefAttributes<HTMLElement>>;
44
44
  export {};
@@ -42,7 +42,7 @@ var defaults = {
42
42
  };
43
43
  /**
44
44
  * DO NOT USE. This component is for the exclusive use
45
- * of other Novice to Pro components.
45
+ * of other Onboarding components.
46
46
  */
47
47
  exports.CoachmarkDragbar = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
48
48
  var a11yKeyboardHandler = _ref.a11yKeyboardHandler,
@@ -25,7 +25,7 @@ interface CoachmarkHeaderProps {
25
25
  }
26
26
  /**
27
27
  * DO NOT USE. This component is for the exclusive use
28
- * of other Novice to Pro components.
28
+ * of other Onboarding components.
29
29
  */
30
30
  export declare let CoachmarkHeader: React.ForwardRefExoticComponent<CoachmarkHeaderProps & React.RefAttributes<HTMLElement>>;
31
31
  export {};
@@ -37,7 +37,7 @@ var defaults = {
37
37
  };
38
38
  /**
39
39
  * DO NOT USE. This component is for the exclusive use
40
- * of other Novice to Pro components.
40
+ * of other Onboarding components.
41
41
  */
42
42
  exports.CoachmarkHeader = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
43
43
  var _ref$closeIconDescrip = _ref.closeIconDescription,
@@ -40,7 +40,7 @@ interface CoachmarkOverlayProps {
40
40
  }
41
41
  /**
42
42
  * DO NOT USE. This component is for the exclusive use
43
- * of other Novice to Pro components.
43
+ * of other Onboarding components.
44
44
  */
45
45
  export declare let CoachmarkOverlay: React.ForwardRefExoticComponent<Omit<CoachmarkOverlayProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
46
46
  export {};
@@ -41,7 +41,7 @@ var defaults = {
41
41
  };
42
42
  /**
43
43
  * DO NOT USE. This component is for the exclusive use
44
- * of other Novice to Pro components.
44
+ * of other Onboarding components.
45
45
  */
46
46
  exports.CoachmarkOverlay = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
47
47
  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 Novice to Pro components.
28
+ * of other Onboarding components.
29
29
  */
30
30
  export declare let CoachmarkTagline: React.ForwardRefExoticComponent<CoachmarkTaglineProps & React.RefAttributes<HTMLDivElement>>;
31
31
  export {};
@@ -37,7 +37,7 @@ var defaults = {
37
37
  };
38
38
  /**
39
39
  * DO NOT USE. This component is for the exclusive use
40
- * of other Novice to Pro components.
40
+ * of other Onboarding components.
41
41
  */
42
42
  exports.CoachmarkTagline = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
43
43
  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 Novice to Pro components.
3
+ * of other Onboarding components.
4
4
  */
5
5
  export let CoachmarkStackHome: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
6
6
  import React from 'react';
@@ -39,7 +39,7 @@ var componentName = 'CoachmarkStackHome';
39
39
 
40
40
  /**
41
41
  * DO NOT USE. This component is for the exclusive use
42
- * of other Novice to Pro components.
42
+ * of other Onboarding components.
43
43
  */
44
44
  exports.CoachmarkStackHome = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
45
45
  var _document$querySelect;
@@ -67,7 +67,7 @@ exports.CoachmarkStackHome = /*#__PURE__*/React.forwardRef(function (_ref, ref)
67
67
  }, 100);
68
68
  }, [isOpen]);
69
69
  if (!navLinkLabels) {
70
- return pconsole["default"].warn("".concat(componentName, " is a Novice to Pro internal component and is not intended for general use."));
70
+ return pconsole["default"].warn("".concat(componentName, " is an Onboarding internal component and is not intended for general use."));
71
71
  }
72
72
  var portalNode = portalTarget ? (_document$querySelect = document.querySelector(portalTarget)) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.querySelector('body') : document.querySelector('body');
73
73
  return /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
@@ -6,17 +6,23 @@ 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>;
9
10
  let aria: PropTypes.Requireable<object>;
10
11
  let condition: PropTypes.Requireable<object>;
11
12
  let conditionIndex: PropTypes.Requireable<number>;
12
13
  let conjunction: PropTypes.Requireable<string>;
13
14
  let group: PropTypes.Requireable<object>;
15
+ let hideConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
16
+ let hideConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
14
17
  let isLastCondition: PropTypes.Requireable<(...args: any[]) => any>;
15
18
  let isStatement: PropTypes.Requireable<boolean>;
16
19
  let onChange: PropTypes.Requireable<(...args: any[]) => any>;
17
20
  let onConnectorOperatorChange: PropTypes.Requireable<(...args: any[]) => any>;
18
21
  let onRemove: PropTypes.Requireable<(...args: any[]) => any>;
19
22
  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>;
20
26
  }
21
27
  }
22
28
  import PropTypes from 'prop-types';
@@ -17,7 +17,7 @@ var index = require('../../../node_modules/prop-types/index.js');
17
17
  var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
18
18
  var ConditionBuilderItemOption = require('../ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js');
19
19
  var cx = require('classnames');
20
- var ConditionConnector = require('../ConditionConnector/ConditionConnector.js');
20
+ var ConditionConnector = require('../ConditionBuilderConnector/ConditionConnector.js');
21
21
  var ConditionBuilderItemNumber = require('../ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js');
22
22
  var ConditionBuilderItemText = require('../ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js');
23
23
  var ConditionBuilderItemDate = require('../ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js');
@@ -32,6 +32,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
32
32
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
33
33
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
34
34
 
35
+ var _div;
35
36
  /**
36
37
  * This component build each block of condition consisting of property, operator value and close button.
37
38
  */
@@ -49,11 +50,19 @@ var ConditionBlock = function ConditionBlock(props) {
49
50
  isStatement = props.isStatement,
50
51
  group = props.group,
51
52
  onStatementChange = props.onStatementChange,
52
- addConditionHandler = props.addConditionHandler,
53
53
  conditionIndex = props.conditionIndex,
54
+ addConditionHandler = props.addConditionHandler,
55
+ _addConditionSubGroupHandler = props.addConditionSubGroupHandler,
56
+ aria = props.aria,
57
+ hideConditionSubGroupPreviewHandler = props.hideConditionSubGroupPreviewHandler,
58
+ showConditionSubGroupPreviewHandler = props.showConditionSubGroupPreviewHandler,
59
+ hideConditionPreviewHandler = props.hideConditionPreviewHandler,
60
+ showConditionPreviewHandler = props.showConditionPreviewHandler,
54
61
  isLastCondition = props.isLastCondition;
55
62
  var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
56
- inputConfig = _useContext.inputConfig;
63
+ inputConfig = _useContext.inputConfig,
64
+ variant = _useContext.variant;
65
+ //Below possible input types expected for value field.
57
66
  var itemComponents = {
58
67
  option: ConditionBuilderItemOption.ConditionBuilderItemOption,
59
68
  text: ConditionBuilderItemText.ConditionBuilderItemText,
@@ -78,14 +87,17 @@ var ConditionBlock = function ConditionBlock(props) {
78
87
  type = _getCurrentConfig.type,
79
88
  config = _getCurrentConfig.config,
80
89
  label = _getCurrentConfig.label;
81
- var ItemComponent = property ? itemComponents[type] : null;
90
+ var ItemComponent;
91
+ // if (type == 'custom') {
92
+ // ItemComponent = config.component;
93
+ // } else {
94
+ ItemComponent = property ? itemComponents[type] : null;
95
+ //}
96
+
82
97
  var onStatementChangeHandler = function onStatementChangeHandler(v, evt) {
83
98
  util.focusThisField(evt);
84
99
  onStatementChange(v);
85
100
  };
86
- var onConnectorOperatorChangeHandler = function onConnectorOperatorChangeHandler(op) {
87
- onConnectorOperatorChange(op);
88
- };
89
101
  var onPropertyChangeHandler = function onPropertyChangeHandler(newProperty) {
90
102
  onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, condition), {}, {
91
103
  property: newProperty,
@@ -118,21 +130,32 @@ var ConditionBlock = function ConditionBlock(props) {
118
130
  return operator.type.indexOf(type) != -1 || operator.type == 'all';
119
131
  });
120
132
  };
121
- return /*#__PURE__*/React__default["default"].createElement("div", {
122
- className: cx__default["default"]("".concat(DataConfigs.blockClass, "__condition-block conditionBlockWrapper ").concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-bottom"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__condition__deletion-preview"), showDeletionPreview)),
123
- key: conditionIndex,
133
+ var getAriaAttributes = function getAriaAttributes() {
134
+ return variant == 'tree' ? {
135
+ 'aria-level': aria.level,
136
+ 'aria-posinset': aria.posinset,
137
+ 'aria-setsize': aria.setsize
138
+ } : {};
139
+ };
140
+ return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
141
+ className: cx__default["default"]("".concat(DataConfigs.blockClass, "__condition-block"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__condition__deletion-preview"), showDeletionPreview), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__gap-bottom"), variant == 'tree' && !(conditionIndex + 1 >= group.conditions.length)), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-bottom"), variant == 'sentence')),
124
142
  role: "row",
125
143
  "aria-label": DataConfigs.translateWithId('condition_row'),
126
144
  tabIndex: -1
127
- }, isStatement && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem
128
- // open={false}
129
- , {
145
+ }, getAriaAttributes()), conjunction ? /*#__PURE__*/React__default["default"].createElement(ConditionConnector["default"], {
146
+ className: "".concat(DataConfigs.blockClass, "__gap"),
147
+ operator: conjunction,
148
+ onChange: function onChange(op) {
149
+ return onConnectorOperatorChange(op);
150
+ }
151
+ }) : _div || (_div = /*#__PURE__*/React__default["default"].createElement("div", {
152
+ role: "gridcell"
153
+ })), isStatement && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
130
154
  label: group.statement,
131
155
  title: DataConfigs.translateWithId('condition'),
132
156
  "data-name": "connectorField",
133
157
  popOverClassName: "".concat(DataConfigs.blockClass, "__gap"),
134
- className: "".concat(DataConfigs.blockClass, "__statement-button"),
135
- tabIndex: 0
158
+ className: "".concat(DataConfigs.blockClass, "__statement-button")
136
159
  }, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItemOption.ConditionBuilderItemOption, {
137
160
  conditionState: {
138
161
  value: group.statement,
@@ -142,11 +165,7 @@ var ConditionBlock = function ConditionBlock(props) {
142
165
  config: {
143
166
  options: DataConfigs.statementConfig
144
167
  }
145
- })), conjunction && /*#__PURE__*/React__default["default"].createElement(ConditionConnector["default"], {
146
- className: "".concat(DataConfigs.blockClass, "__gap"),
147
- operator: conjunction,
148
- onChange: onConnectorOperatorChangeHandler
149
- }), /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
168
+ })), /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
150
169
  label: label,
151
170
  title: DataConfigs.translateWithId('property'),
152
171
  renderIcon: icon !== null && icon !== void 0 ? icon : null,
@@ -193,7 +212,8 @@ var ConditionBlock = function ConditionBlock(props) {
193
212
  value: value
194
213
  },
195
214
  onChange: onValueChangeHandler,
196
- config: config
215
+ config: config,
216
+ "data-name": "valueField"
197
217
  })), /*#__PURE__*/React__default["default"].createElement("span", {
198
218
  role: "gridcell",
199
219
  "aria-label": DataConfigs.translateWithId('remove_condition')
@@ -211,9 +231,15 @@ var ConditionBlock = function ConditionBlock(props) {
211
231
  })), isLastCondition(conditionIndex, group.conditions) && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderAdd["default"], {
212
232
  onClick: function onClick() {
213
233
  addConditionHandler(conditionIndex);
214
- }
215
- //addConditionSubGroupHandler={()=>{addConditionSubGroupHandler(conditionIndex)}}
216
- ,
234
+ },
235
+ addConditionSubGroupHandler: function addConditionSubGroupHandler() {
236
+ _addConditionSubGroupHandler(conditionIndex);
237
+ },
238
+ showConditionSubGroupPreviewHandler: showConditionSubGroupPreviewHandler,
239
+ hideConditionSubGroupPreviewHandler: hideConditionSubGroupPreviewHandler,
240
+ enableSubGroup: variant == 'tree',
241
+ showConditionPreviewHandler: showConditionPreviewHandler,
242
+ hideConditionPreviewHandler: hideConditionPreviewHandler,
217
243
  className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-left")
218
244
  }));
219
245
  };
@@ -224,16 +250,14 @@ ConditionBlock.propTypes = {
224
250
  */
225
251
  addConditionHandler: index["default"].func,
226
252
  /**
227
- * object hold aria attributes
253
+ * callback to add a new condition subgroup
228
254
  */
229
- aria: index["default"].object,
255
+ addConditionSubGroupHandler: index["default"].func,
230
256
  /**
231
- * object that hold the current condition
257
+ * object hold aria attributes
232
258
  */
259
+ aria: index["default"].object,
233
260
  condition: index["default"].object,
234
- /**
235
- * index of the current condition
236
- */
237
261
  conditionIndex: index["default"].number,
238
262
  /**
239
263
  * string that decides to show the condition connector
@@ -244,8 +268,13 @@ ConditionBlock.propTypes = {
244
268
  */
245
269
  group: index["default"].object,
246
270
  /**
247
- * callback to add a new condition
271
+ * handler for hiding sub group preview
272
+ */
273
+ hideConditionPreviewHandler: index["default"].func,
274
+ /**
275
+ * handler for hiding sub group preview
248
276
  */
277
+ hideConditionSubGroupPreviewHandler: index["default"].func,
249
278
  isLastCondition: index["default"].func,
250
279
  /**
251
280
  * boolean that decides to show the statement(if/ excl.if)
@@ -266,7 +295,19 @@ ConditionBlock.propTypes = {
266
295
  /**
267
296
  * callback to handle the statement(if/ excl.if) change
268
297
  */
269
- onStatementChange: index["default"].func
298
+ onStatementChange: index["default"].func,
299
+ /**
300
+ * handler for showing add condition preview
301
+ */
302
+ showConditionPreviewHandler: index["default"].func,
303
+ /**
304
+ * handler for showing sub group preview
305
+ */
306
+ showConditionSubGroupPreviewHandler: index["default"].func,
307
+ /**
308
+ * object that hold the current condition
309
+ */
310
+ state: index["default"].object
270
311
  };
271
312
 
272
313
  exports["default"] = ConditionBlock$1;
@@ -1,12 +1,26 @@
1
1
  export default ConditionBuilderAdd;
2
- declare function ConditionBuilderAdd({ className, onClick }: {
2
+ declare function ConditionBuilderAdd({ className, onClick, addConditionSubGroupHandler, showConditionSubGroupPreviewHandler, hideConditionSubGroupPreviewHandler, showConditionPreviewHandler, hideConditionPreviewHandler, enableSubGroup, buttonLabel, }: {
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;
5
12
  }): import("react/jsx-runtime").JSX.Element;
6
13
  declare namespace ConditionBuilderAdd {
7
14
  namespace propTypes {
15
+ let addConditionSubGroupHandler: PropTypes.Requireable<(...args: any[]) => any>;
16
+ let buttonLabel: PropTypes.Requireable<string>;
8
17
  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>;
9
21
  let onClick: PropTypes.Requireable<(...args: any[]) => any>;
22
+ let showConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
23
+ let showConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
10
24
  }
11
25
  }
12
26
  import PropTypes from 'prop-types';
@@ -9,6 +9,7 @@
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');
13
14
  var icons = require('@carbon/react/icons');
14
15
  var ConditionBuilderButton = require('../ConditionBuilderButton/ConditionBuilderButton.js');
@@ -21,28 +22,110 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
21
22
 
22
23
  var ConditionBuilderAdd = function ConditionBuilderAdd(_ref) {
23
24
  var className = _ref.className,
24
- onClick = _ref.onClick;
25
+ onClick = _ref.onClick,
26
+ addConditionSubGroupHandler = _ref.addConditionSubGroupHandler,
27
+ showConditionSubGroupPreviewHandler = _ref.showConditionSubGroupPreviewHandler,
28
+ hideConditionSubGroupPreviewHandler = _ref.hideConditionSubGroupPreviewHandler,
29
+ showConditionPreviewHandler = _ref.showConditionPreviewHandler,
30
+ hideConditionPreviewHandler = _ref.hideConditionPreviewHandler,
31
+ enableSubGroup = _ref.enableSubGroup,
32
+ buttonLabel = _ref.buttonLabel;
33
+ var _useState = React.useState(false),
34
+ _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
35
+ isAddSubgroup = _useState2[0],
36
+ setIsAddSubgroup = _useState2[1];
37
+ var showAddSubGroup = function showAddSubGroup() {
38
+ setIsAddSubgroup(true);
39
+ };
40
+ var hideAddSubGroup = function hideAddSubGroup() {
41
+ setIsAddSubgroup(false);
42
+ };
43
+ var onClickHandler = function onClickHandler() {
44
+ hideConditionPreviewHandler === null || hideConditionPreviewHandler === void 0 || hideConditionPreviewHandler();
45
+ onClick();
46
+ };
47
+ var previewHandlers = function previewHandlers() {
48
+ return enableSubGroup ? {
49
+ onMouseEnter: showConditionPreviewHandler,
50
+ onMouseLeave: hideConditionPreviewHandler,
51
+ onFocus: showConditionPreviewHandler,
52
+ onBlur: hideConditionPreviewHandler
53
+ } : {};
54
+ };
55
+ var previewHandlersForSubgroup = function previewHandlersForSubgroup() {
56
+ return {
57
+ onMouseEnter: showConditionSubGroupPreviewHandler,
58
+ onMouseLeave: hideConditionSubGroupPreviewHandler,
59
+ onFocus: showConditionSubGroupPreviewHandler,
60
+ onBlur: hideConditionSubGroupPreviewHandler
61
+ };
62
+ };
63
+ var wrapperProps = enableSubGroup ? {
64
+ role: 'gridcell',
65
+ 'aria-label': DataConfigs.translateWithId('add-condition')
66
+ } : {};
25
67
  return /*#__PURE__*/React__default["default"].createElement("div", {
26
- className: className,
27
- role: "gridcell"
28
- }, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderButton.ConditionBuilderButton, {
68
+ className: "".concat(className, " ").concat(DataConfigs.blockClass, "__add-button-wrapper"),
69
+ role: !enableSubGroup ? 'gridcell' : 'none',
70
+ "aria-label": !enableSubGroup ? DataConfigs.translateWithId('add_condition_row') : undefined,
71
+ onMouseEnter: showAddSubGroup,
72
+ onMouseLeave: hideAddSubGroup,
73
+ onFocus: showAddSubGroup,
74
+ onBlur: hideAddSubGroup
75
+ }, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderButton.ConditionBuilderButton, _rollupPluginBabelHelpers["extends"]({
29
76
  renderIcon: icons.AddAlt,
30
- onClick: onClick,
77
+ onClick: onClickHandler
78
+ }, previewHandlers(), {
31
79
  className: "".concat(DataConfigs.blockClass, "__add-button"),
32
80
  hideLabel: true,
33
- label: DataConfigs.translateWithId('add-condition')
34
- }));
81
+ "data-name": "addButton",
82
+ label: buttonLabel !== null && buttonLabel !== void 0 ? buttonLabel : DataConfigs.translateWithId('add-condition'),
83
+ wrapperProps: wrapperProps
84
+ })), isAddSubgroup && enableSubGroup && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderButton.ConditionBuilderButton, _rollupPluginBabelHelpers["extends"]({
85
+ renderIcon: icons.TextNewLine,
86
+ onClick: addConditionSubGroupHandler,
87
+ className: "".concat(DataConfigs.blockClass, "__add-condition-group ").concat(DataConfigs.blockClass, "__gap-left"),
88
+ hideLabel: true,
89
+ label: DataConfigs.translateWithId('add-condition'),
90
+ wrapperProps: wrapperProps
91
+ }, previewHandlersForSubgroup())));
35
92
  };
36
93
  var ConditionBuilderAdd$1 = ConditionBuilderAdd;
37
94
  ConditionBuilderAdd.propTypes = {
95
+ /**
96
+ * handler for hiding sub group preview
97
+ */
98
+ addConditionSubGroupHandler: index["default"].func,
99
+ /**
100
+ * handler for hiding sub group preview
101
+ */ /**
102
+ * tooltip label for plus button
103
+ */
104
+ buttonLabel: index["default"].string,
38
105
  /**
39
106
  * Provide an optional class to be applied to the containing node.
40
107
  */
41
108
  className: index["default"].string,
42
109
  /**
43
- * callback triggered on click of add button
110
+ * boolean to enable sub groups for the tree variant
111
+ */
112
+ enableSubGroup: index["default"].bool,
113
+ /**
114
+ * handler for hiding sub group preview
115
+ */
116
+ hideConditionPreviewHandler: index["default"].func,
117
+ hideConditionSubGroupPreviewHandler: index["default"].func,
118
+ /**
119
+ * handler for hiding sub group preview
120
+ */ /**
121
+ * callback triggered on click of add button
122
+ */
123
+ onClick: index["default"].func,
124
+ showConditionPreviewHandler: index["default"].func,
125
+ showConditionSubGroupPreviewHandler: index["default"].func
126
+ /**
127
+ * handler for hiding sub group preview
44
128
  */
45
- onClick: index["default"].func
46
129
  };
47
130
 
48
131
  exports["default"] = ConditionBuilderAdd$1;
@@ -1,5 +1,4 @@
1
- export function ConditionBuilderButton({ className, label, hideLabel, tooltipAlign, renderIcon: Icon, onClick, showToolTip, ...rest }: {
2
- [x: string]: any;
1
+ export function ConditionBuilderButton({ className, label, hideLabel, tooltipAlign, renderIcon: Icon, onClick, showToolTip, wrapperProps, onBlur, onFocus, onMouseEnter, onMouseLeave, }: {
3
2
  className: any;
4
3
  label: any;
5
4
  hideLabel: any;
@@ -7,16 +6,26 @@ export function ConditionBuilderButton({ className, label, hideLabel, tooltipAli
7
6
  renderIcon: any;
8
7
  onClick: any;
9
8
  showToolTip: any;
9
+ wrapperProps: any;
10
+ onBlur: any;
11
+ onFocus: any;
12
+ onMouseEnter: any;
13
+ onMouseLeave: any;
10
14
  }): import("react/jsx-runtime").JSX.Element;
11
15
  export namespace ConditionBuilderButton {
12
16
  namespace propTypes {
13
17
  let className: PropTypes.Requireable<string>;
14
18
  let hideLabel: PropTypes.Requireable<boolean>;
15
19
  let label: PropTypes.Requireable<string>;
20
+ let onBlur: PropTypes.Requireable<(...args: any[]) => any>;
16
21
  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>;
17
25
  let renderIcon: PropTypes.Requireable<object>;
18
26
  let showToolTip: PropTypes.Requireable<boolean>;
19
27
  let tooltipAlign: PropTypes.Requireable<string>;
28
+ let wrapperProps: PropTypes.Requireable<object>;
20
29
  }
21
30
  }
22
31
  import PropTypes from 'prop-types';