@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.
- package/css/index-full-carbon.css +9 -302
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon.css +9 -302
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +9 -302
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/Carousel/Carousel.d.ts +1 -1
- package/es/components/Carousel/Carousel.js +1 -1
- package/es/components/Coachmark/CoachmarkDragbar.d.ts +1 -1
- package/es/components/Coachmark/CoachmarkDragbar.js +1 -1
- package/es/components/Coachmark/CoachmarkHeader.d.ts +1 -1
- package/es/components/Coachmark/CoachmarkHeader.js +1 -1
- package/es/components/Coachmark/CoachmarkOverlay.d.ts +1 -1
- package/es/components/Coachmark/CoachmarkOverlay.js +1 -1
- package/es/components/Coachmark/CoachmarkTagline.d.ts +1 -1
- package/es/components/Coachmark/CoachmarkTagline.js +1 -1
- package/es/components/CoachmarkStack/CoachmarkStackHome.d.ts +1 -1
- package/es/components/CoachmarkStack/CoachmarkStackHome.js +2 -2
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +0 -6
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +33 -74
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +1 -15
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +12 -95
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +2 -11
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +9 -27
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +0 -5
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +14 -95
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +0 -1
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +0 -1
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +0 -7
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +1 -8
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
- package/es/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.js +33 -38
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +67 -197
- package/es/components/ConditionBuilder/utils/util.d.ts +0 -1
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.d.ts +1 -1
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +4 -7
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -7
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts +0 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +3 -13
- package/es/components/Datagrid/types/index.d.ts +0 -2
- package/es/components/Datagrid/useColumnOrder.d.ts +1 -7
- package/es/components/Datagrid/useFiltering.d.ts +1 -8
- package/es/components/Datagrid/useFiltering.js +7 -8
- package/es/components/Datagrid/useFlexResize.d.ts +1 -1
- package/es/components/Datagrid/useFlexResize.js +11 -11
- package/es/components/Datagrid/useNestedRows.js +2 -24
- package/es/components/Datagrid/useOnRowClick.d.ts +1 -8
- package/es/components/Datagrid/useOnRowClick.js +1 -2
- package/es/components/Datagrid/useRowIsMouseOver.d.ts +1 -2
- package/es/components/Datagrid/useRowIsMouseOver.js +1 -1
- package/es/components/Datagrid/useSelectRows.d.ts +1 -8
- package/es/components/Datagrid/useSelectRows.js +2 -3
- package/es/components/Datagrid/useSortableColumns.d.ts +3 -10
- package/es/components/Datagrid/useSortableColumns.js +2 -3
- package/es/components/Datagrid/utils/getAutoSizedColumnWidth.d.ts +1 -8
- package/es/components/Datagrid/utils/getAutoSizedColumnWidth.js +7 -0
- package/es/components/InterstitialScreenView/InterstitialScreenView.d.ts +1 -1
- package/es/components/InterstitialScreenView/InterstitialScreenView.js +1 -1
- package/es/components/SidePanel/SidePanel.d.ts +2 -2
- package/es/components/SidePanel/SidePanel.js +5 -9
- package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +1 -1
- package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +1 -1
- package/es/global/js/package-settings.js +2 -2
- package/lib/components/Carousel/Carousel.d.ts +1 -1
- package/lib/components/Carousel/Carousel.js +1 -1
- package/lib/components/Coachmark/CoachmarkDragbar.d.ts +1 -1
- package/lib/components/Coachmark/CoachmarkDragbar.js +1 -1
- package/lib/components/Coachmark/CoachmarkHeader.d.ts +1 -1
- package/lib/components/Coachmark/CoachmarkHeader.js +1 -1
- package/lib/components/Coachmark/CoachmarkOverlay.d.ts +1 -1
- package/lib/components/Coachmark/CoachmarkOverlay.js +1 -1
- package/lib/components/Coachmark/CoachmarkTagline.d.ts +1 -1
- package/lib/components/Coachmark/CoachmarkTagline.js +1 -1
- package/lib/components/CoachmarkStack/CoachmarkStackHome.d.ts +1 -1
- package/lib/components/CoachmarkStack/CoachmarkStackHome.js +2 -2
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +0 -6
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +32 -73
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +1 -15
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +9 -92
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +2 -11
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +8 -26
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +0 -5
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +11 -92
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +0 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +0 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +0 -7
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +1 -8
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
- package/lib/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.js +31 -36
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +64 -195
- package/lib/components/ConditionBuilder/utils/util.d.ts +0 -1
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.d.ts +1 -1
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +4 -7
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -7
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts +0 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +3 -13
- package/lib/components/Datagrid/types/index.d.ts +0 -2
- package/lib/components/Datagrid/useColumnOrder.d.ts +1 -7
- package/lib/components/Datagrid/useFiltering.d.ts +1 -8
- package/lib/components/Datagrid/useFiltering.js +7 -8
- package/lib/components/Datagrid/useFlexResize.d.ts +1 -1
- package/lib/components/Datagrid/useFlexResize.js +11 -11
- package/lib/components/Datagrid/useNestedRows.js +2 -24
- package/lib/components/Datagrid/useOnRowClick.d.ts +1 -8
- package/lib/components/Datagrid/useOnRowClick.js +1 -2
- package/lib/components/Datagrid/useRowIsMouseOver.d.ts +1 -2
- package/lib/components/Datagrid/useRowIsMouseOver.js +1 -1
- package/lib/components/Datagrid/useSelectRows.d.ts +1 -8
- package/lib/components/Datagrid/useSelectRows.js +2 -3
- package/lib/components/Datagrid/useSortableColumns.d.ts +3 -10
- package/lib/components/Datagrid/useSortableColumns.js +2 -3
- package/lib/components/Datagrid/utils/getAutoSizedColumnWidth.d.ts +1 -8
- package/lib/components/Datagrid/utils/getAutoSizedColumnWidth.js +7 -0
- package/lib/components/InterstitialScreenView/InterstitialScreenView.d.ts +1 -1
- package/lib/components/InterstitialScreenView/InterstitialScreenView.js +1 -1
- package/lib/components/SidePanel/SidePanel.d.ts +2 -2
- package/lib/components/SidePanel/SidePanel.js +5 -9
- package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +1 -1
- package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +1 -1
- package/lib/global/js/package-settings.js +2 -2
- package/package.json +2 -2
- package/scss/components/ConditionBuilder/_condition-builder.scss +1 -21
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +3 -22
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +21 -58
- package/scss/components/NonLinearReading/_non-linear-reading.scss +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.d.ts +0 -2
- package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +0 -44
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +0 -10
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +0 -69
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.d.ts +0 -2
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +0 -52
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +0 -10
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +0 -77
- /package/es/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.d.ts +0 -0
- /package/lib/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.d.ts +0 -0
@@ -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
|
40
|
+
* of other Novice to Pro 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
|
43
|
+
* of other Novice to Pro 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
|
44
|
+
* of other Novice to Pro 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
|
28
|
+
* of other Novice to Pro 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
|
40
|
+
* of other Novice to Pro components.
|
41
41
|
*/
|
42
42
|
exports.CoachmarkTagline = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
|
43
43
|
var _ref$closeIconDescrip = _ref.closeIconDescription,
|
@@ -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
|
42
|
+
* of other Novice to Pro 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
|
70
|
+
return pconsole["default"].warn("".concat(componentName, " is a Novice to Pro 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,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';
|
@@ -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('../
|
20
|
+
var ConditionConnector = require('../ConditionConnector/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,7 +32,6 @@ 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;
|
36
35
|
/**
|
37
36
|
* This component build each block of condition consisting of property, operator value and close button.
|
38
37
|
*/
|
@@ -50,19 +49,11 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
50
49
|
isStatement = props.isStatement,
|
51
50
|
group = props.group,
|
52
51
|
onStatementChange = props.onStatementChange,
|
53
|
-
conditionIndex = props.conditionIndex,
|
54
52
|
addConditionHandler = props.addConditionHandler,
|
55
|
-
|
56
|
-
aria = props.aria,
|
57
|
-
hideConditionSubGroupPreviewHandler = props.hideConditionSubGroupPreviewHandler,
|
58
|
-
showConditionSubGroupPreviewHandler = props.showConditionSubGroupPreviewHandler,
|
59
|
-
hideConditionPreviewHandler = props.hideConditionPreviewHandler,
|
60
|
-
showConditionPreviewHandler = props.showConditionPreviewHandler,
|
53
|
+
conditionIndex = props.conditionIndex,
|
61
54
|
isLastCondition = props.isLastCondition;
|
62
55
|
var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
|
63
|
-
inputConfig = _useContext.inputConfig
|
64
|
-
variant = _useContext.variant;
|
65
|
-
//Below possible input types expected for value field.
|
56
|
+
inputConfig = _useContext.inputConfig;
|
66
57
|
var itemComponents = {
|
67
58
|
option: ConditionBuilderItemOption.ConditionBuilderItemOption,
|
68
59
|
text: ConditionBuilderItemText.ConditionBuilderItemText,
|
@@ -87,17 +78,14 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
87
78
|
type = _getCurrentConfig.type,
|
88
79
|
config = _getCurrentConfig.config,
|
89
80
|
label = _getCurrentConfig.label;
|
90
|
-
var ItemComponent;
|
91
|
-
// if (type == 'custom') {
|
92
|
-
// ItemComponent = config.component;
|
93
|
-
// } else {
|
94
|
-
ItemComponent = property ? itemComponents[type] : null;
|
95
|
-
//}
|
96
|
-
|
81
|
+
var ItemComponent = property ? itemComponents[type] : null;
|
97
82
|
var onStatementChangeHandler = function onStatementChangeHandler(v, evt) {
|
98
83
|
util.focusThisField(evt);
|
99
84
|
onStatementChange(v);
|
100
85
|
};
|
86
|
+
var onConnectorOperatorChangeHandler = function onConnectorOperatorChangeHandler(op) {
|
87
|
+
onConnectorOperatorChange(op);
|
88
|
+
};
|
101
89
|
var onPropertyChangeHandler = function onPropertyChangeHandler(newProperty) {
|
102
90
|
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, condition), {}, {
|
103
91
|
property: newProperty,
|
@@ -130,32 +118,21 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
130
118
|
return operator.type.indexOf(type) != -1 || operator.type == 'all';
|
131
119
|
});
|
132
120
|
};
|
133
|
-
|
134
|
-
|
135
|
-
|
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')),
|
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,
|
142
124
|
role: "row",
|
143
125
|
"aria-label": DataConfigs.translateWithId('condition_row'),
|
144
126
|
tabIndex: -1
|
145
|
-
},
|
146
|
-
|
147
|
-
|
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, {
|
127
|
+
}, isStatement && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem
|
128
|
+
// open={false}
|
129
|
+
, {
|
154
130
|
label: group.statement,
|
155
131
|
title: DataConfigs.translateWithId('condition'),
|
156
132
|
"data-name": "connectorField",
|
157
133
|
popOverClassName: "".concat(DataConfigs.blockClass, "__gap"),
|
158
|
-
className: "".concat(DataConfigs.blockClass, "__statement-button")
|
134
|
+
className: "".concat(DataConfigs.blockClass, "__statement-button"),
|
135
|
+
tabIndex: 0
|
159
136
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItemOption.ConditionBuilderItemOption, {
|
160
137
|
conditionState: {
|
161
138
|
value: group.statement,
|
@@ -165,7 +142,11 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
165
142
|
config: {
|
166
143
|
options: DataConfigs.statementConfig
|
167
144
|
}
|
168
|
-
})), /*#__PURE__*/React__default["default"].createElement(
|
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, {
|
169
150
|
label: label,
|
170
151
|
title: DataConfigs.translateWithId('property'),
|
171
152
|
renderIcon: icon !== null && icon !== void 0 ? icon : null,
|
@@ -212,8 +193,7 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
212
193
|
value: value
|
213
194
|
},
|
214
195
|
onChange: onValueChangeHandler,
|
215
|
-
config: config
|
216
|
-
"data-name": "valueField"
|
196
|
+
config: config
|
217
197
|
})), /*#__PURE__*/React__default["default"].createElement("span", {
|
218
198
|
role: "gridcell",
|
219
199
|
"aria-label": DataConfigs.translateWithId('remove_condition')
|
@@ -231,15 +211,9 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
231
211
|
})), isLastCondition(conditionIndex, group.conditions) && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderAdd["default"], {
|
232
212
|
onClick: function onClick() {
|
233
213
|
addConditionHandler(conditionIndex);
|
234
|
-
}
|
235
|
-
addConditionSubGroupHandler
|
236
|
-
|
237
|
-
},
|
238
|
-
showConditionSubGroupPreviewHandler: showConditionSubGroupPreviewHandler,
|
239
|
-
hideConditionSubGroupPreviewHandler: hideConditionSubGroupPreviewHandler,
|
240
|
-
enableSubGroup: variant == 'tree',
|
241
|
-
showConditionPreviewHandler: showConditionPreviewHandler,
|
242
|
-
hideConditionPreviewHandler: hideConditionPreviewHandler,
|
214
|
+
}
|
215
|
+
//addConditionSubGroupHandler={()=>{addConditionSubGroupHandler(conditionIndex)}}
|
216
|
+
,
|
243
217
|
className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-left")
|
244
218
|
}));
|
245
219
|
};
|
@@ -249,15 +223,17 @@ ConditionBlock.propTypes = {
|
|
249
223
|
* callback to add a new condition
|
250
224
|
*/
|
251
225
|
addConditionHandler: index["default"].func,
|
252
|
-
/**
|
253
|
-
* callback to add a new condition subgroup
|
254
|
-
*/
|
255
|
-
addConditionSubGroupHandler: index["default"].func,
|
256
226
|
/**
|
257
227
|
* object hold aria attributes
|
258
228
|
*/
|
259
229
|
aria: index["default"].object,
|
230
|
+
/**
|
231
|
+
* object that hold the current condition
|
232
|
+
*/
|
260
233
|
condition: index["default"].object,
|
234
|
+
/**
|
235
|
+
* index of the current condition
|
236
|
+
*/
|
261
237
|
conditionIndex: index["default"].number,
|
262
238
|
/**
|
263
239
|
* string that decides to show the condition connector
|
@@ -268,13 +244,8 @@ ConditionBlock.propTypes = {
|
|
268
244
|
*/
|
269
245
|
group: index["default"].object,
|
270
246
|
/**
|
271
|
-
*
|
272
|
-
*/
|
273
|
-
hideConditionPreviewHandler: index["default"].func,
|
274
|
-
/**
|
275
|
-
* handler for hiding sub group preview
|
247
|
+
* callback to add a new condition
|
276
248
|
*/
|
277
|
-
hideConditionSubGroupPreviewHandler: index["default"].func,
|
278
249
|
isLastCondition: index["default"].func,
|
279
250
|
/**
|
280
251
|
* boolean that decides to show the statement(if/ excl.if)
|
@@ -295,19 +266,7 @@ ConditionBlock.propTypes = {
|
|
295
266
|
/**
|
296
267
|
* callback to handle the statement(if/ excl.if) change
|
297
268
|
*/
|
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
|
269
|
+
onStatementChange: index["default"].func
|
311
270
|
};
|
312
271
|
|
313
272
|
exports["default"] = ConditionBlock$1;
|
@@ -1,26 +1,12 @@
|
|
1
1
|
export default ConditionBuilderAdd;
|
2
|
-
declare function ConditionBuilderAdd({ className, onClick
|
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';
|
@@ -9,7 +9,6 @@
|
|
9
9
|
|
10
10
|
Object.defineProperty(exports, '__esModule', { value: true });
|
11
11
|
|
12
|
-
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
13
12
|
var React = require('react');
|
14
13
|
var icons = require('@carbon/react/icons');
|
15
14
|
var ConditionBuilderButton = require('../ConditionBuilderButton/ConditionBuilderButton.js');
|
@@ -22,110 +21,28 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
22
21
|
|
23
22
|
var ConditionBuilderAdd = function ConditionBuilderAdd(_ref) {
|
24
23
|
var className = _ref.className,
|
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
|
-
} : {};
|
24
|
+
onClick = _ref.onClick;
|
67
25
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
68
|
-
className:
|
69
|
-
role:
|
70
|
-
|
71
|
-
onMouseEnter: showAddSubGroup,
|
72
|
-
onMouseLeave: hideAddSubGroup,
|
73
|
-
onFocus: showAddSubGroup,
|
74
|
-
onBlur: hideAddSubGroup
|
75
|
-
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderButton.ConditionBuilderButton, _rollupPluginBabelHelpers["extends"]({
|
26
|
+
className: className,
|
27
|
+
role: "gridcell"
|
28
|
+
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderButton.ConditionBuilderButton, {
|
76
29
|
renderIcon: icons.AddAlt,
|
77
|
-
onClick:
|
78
|
-
}, previewHandlers(), {
|
30
|
+
onClick: onClick,
|
79
31
|
className: "".concat(DataConfigs.blockClass, "__add-button"),
|
80
32
|
hideLabel: true,
|
81
|
-
|
82
|
-
|
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())));
|
33
|
+
label: DataConfigs.translateWithId('add-condition')
|
34
|
+
}));
|
92
35
|
};
|
93
36
|
var ConditionBuilderAdd$1 = ConditionBuilderAdd;
|
94
37
|
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,
|
105
38
|
/**
|
106
39
|
* Provide an optional class to be applied to the containing node.
|
107
40
|
*/
|
108
41
|
className: index["default"].string,
|
109
42
|
/**
|
110
|
-
*
|
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
|
43
|
+
* callback triggered on click of add button
|
128
44
|
*/
|
45
|
+
onClick: index["default"].func
|
129
46
|
};
|
130
47
|
|
131
48
|
exports["default"] = ConditionBuilderAdd$1;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
export function ConditionBuilderButton({ className, label, hideLabel, tooltipAlign, renderIcon: Icon, onClick, showToolTip,
|
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';
|
@@ -21,8 +21,9 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
21
21
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
22
22
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
23
23
|
|
24
|
+
var _excluded = ["className", "label", "hideLabel", "tooltipAlign", "renderIcon", "onClick", "showToolTip"];
|
24
25
|
var ConditionBuilderButton = function ConditionBuilderButton(_ref) {
|
25
|
-
var _Icon
|
26
|
+
var _Icon;
|
26
27
|
var className = _ref.className,
|
27
28
|
label = _ref.label,
|
28
29
|
hideLabel = _ref.hideLabel,
|
@@ -30,29 +31,21 @@ var ConditionBuilderButton = function ConditionBuilderButton(_ref) {
|
|
30
31
|
Icon = _ref.renderIcon,
|
31
32
|
onClick = _ref.onClick,
|
32
33
|
showToolTip = _ref.showToolTip,
|
33
|
-
|
34
|
-
onBlur = _ref.onBlur,
|
35
|
-
onFocus = _ref.onFocus,
|
36
|
-
onMouseEnter = _ref.onMouseEnter,
|
37
|
-
onMouseLeave = _ref.onMouseLeave;
|
34
|
+
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
38
35
|
var Button = function Button() {
|
39
|
-
return /*#__PURE__*/React__default["default"].createElement("button", {
|
36
|
+
return /*#__PURE__*/React__default["default"].createElement("button", _rollupPluginBabelHelpers["extends"]({
|
40
37
|
// role={'gridcell'}
|
41
38
|
tabIndex: -1,
|
42
39
|
className: cx__default["default"]([className, "".concat(DataConfigs.blockClass, "__button"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__text-ellipsis"), showToolTip && !hideLabel)]),
|
43
40
|
type: "button",
|
44
|
-
onClick: onClick
|
45
|
-
|
46
|
-
onFocus: onFocus,
|
47
|
-
onMouseEnter: onMouseEnter,
|
48
|
-
onMouseLeave: onMouseLeave
|
49
|
-
}, Icon && (_Icon || (_Icon = /*#__PURE__*/React__default["default"].createElement(Icon, null))), !hideLabel && (_span || (_span = /*#__PURE__*/React__default["default"].createElement("span", null, label))));
|
41
|
+
onClick: onClick
|
42
|
+
}, rest), Icon && (_Icon || (_Icon = /*#__PURE__*/React__default["default"].createElement(Icon, null))), !hideLabel && label);
|
50
43
|
};
|
51
44
|
return hideLabel || showToolTip ? /*#__PURE__*/React__default["default"].createElement(react.Tooltip, _rollupPluginBabelHelpers["extends"]({
|
52
45
|
label: label,
|
53
46
|
align: tooltipAlign,
|
54
47
|
className: "".concat(DataConfigs.blockClass, "__con-tooltip")
|
55
|
-
}, wrapperProps), Button()) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, Button());
|
48
|
+
}, rest.wrapperProps), Button()) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, Button());
|
56
49
|
};
|
57
50
|
ConditionBuilderButton.propTypes = {
|
58
51
|
/**
|
@@ -67,17 +60,10 @@ ConditionBuilderButton.propTypes = {
|
|
67
60
|
* label of the button
|
68
61
|
*/
|
69
62
|
label: index["default"].string,
|
70
|
-
/**
|
71
|
-
* mouse events callbacks
|
72
|
-
*/
|
73
|
-
onBlur: index["default"].func,
|
74
63
|
/**
|
75
64
|
* callback triggered on click of add button
|
76
65
|
*/
|
77
66
|
onClick: index["default"].func,
|
78
|
-
onFocus: index["default"].func,
|
79
|
-
onMouseEnter: index["default"].func,
|
80
|
-
onMouseLeave: index["default"].func,
|
81
67
|
/**
|
82
68
|
* Optional prop to allow overriding the icon rendering.
|
83
69
|
*/
|
@@ -91,11 +77,7 @@ ConditionBuilderButton.propTypes = {
|
|
91
77
|
/**
|
92
78
|
* tooltip position
|
93
79
|
*/
|
94
|
-
tooltipAlign: index["default"].string
|
95
|
-
/**
|
96
|
-
* optional props for tree grid to add role and aria-label to wrapper span
|
97
|
-
*/
|
98
|
-
wrapperProps: index["default"].object
|
80
|
+
tooltipAlign: index["default"].string
|
99
81
|
};
|
100
82
|
|
101
83
|
exports.ConditionBuilderButton = ConditionBuilderButton;
|
package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts
CHANGED
@@ -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<{
|