@carbon/ibm-products 2.42.1-canary.27 → 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/telemetry.yml +0 -23
- 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
@@ -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
|
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
|
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
|
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,
|
@@ -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
|
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
|
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,
|
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 '../
|
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
|
-
|
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
|
-
|
125
|
-
|
126
|
-
|
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
|
-
},
|
137
|
-
|
138
|
-
|
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(
|
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
|
227
|
-
|
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
|
-
*
|
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
|
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
|
9
|
-
import
|
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 {
|
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:
|
61
|
-
role:
|
62
|
-
|
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:
|
70
|
-
}, previewHandlers(), {
|
22
|
+
onClick: onClick,
|
71
23
|
className: "".concat(blockClass, "__add-button"),
|
72
24
|
hideLabel: true,
|
73
|
-
|
74
|
-
|
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
|
-
*
|
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,
|
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
|
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
|
-
|
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
|
-
|
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<{
|