@carbon/ibm-products 2.48.0 → 2.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/index-full-carbon.css +29 -14
- 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-released-only.css +11 -2
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +29 -14
- 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 +29 -14
- 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/APIKeyModal/APIKeyModal.types.d.ts +1 -1
- package/es/components/Card/Card.js +4 -2
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +100 -24
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +30 -27
- package/es/components/ConditionBuilder/ConditionBuilder.d.ts +9 -2
- package/es/components/ConditionBuilder/ConditionBuilder.js +13 -9
- package/es/components/ConditionBuilder/ConditionBuilder.types.d.ts +151 -0
- package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +26 -12
- package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +7 -7
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +62 -27
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +2 -3
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +86 -37
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.d.ts +29 -14
- package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +10 -9
- package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +4 -1
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +40 -20
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +40 -37
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +10 -49
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +22 -31
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +6 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +7 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +81 -31
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +14 -8
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +27 -12
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +2 -3
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.d.ts +30 -12
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +12 -7
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +35 -12
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +16 -9
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts +32 -12
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +4 -4
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +35 -14
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +5 -6
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +25 -10
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +1 -1
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +44 -17
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +50 -40
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +30 -13
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +2 -3
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +9 -10
- package/es/components/ConditionBuilder/utils/useDataConfigs.d.ts +18 -0
- package/es/components/ConditionBuilder/utils/useDataConfigs.js +120 -0
- package/es/components/ConditionBuilder/utils/useTranslations.d.ts +1 -1
- package/es/components/ConditionBuilder/utils/useTranslations.js +4 -1
- package/es/components/ConditionBuilder/utils/util.d.ts +12 -0
- package/es/components/ConditionBuilder/utils/util.js +48 -2
- package/es/components/CreateFullPage/CreateFullPageStep.d.ts +2 -2
- package/es/components/CreateFullPage/index.d.ts +1 -0
- package/es/components/CreateTearsheet/CreateTearsheet.js +3 -4
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +8 -1
- package/es/components/Datagrid/Datagrid/DatagridToolbar.js +8 -3
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +20 -11
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +7 -2
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +12 -7
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +18 -16
- package/es/components/Datagrid/types/index.d.ts +1 -0
- package/es/components/Datagrid/useActionsColumn.js +1 -4
- package/es/components/Datagrid/useFiltering.d.ts +1 -0
- package/es/components/Datagrid/useFiltering.js +14 -3
- package/es/components/EditInPlace/EditInPlace.js +7 -5
- package/es/components/NotificationsPanel/NotificationsPanel.d.ts +2 -0
- package/es/components/NotificationsPanel/NotificationsPanel.js +75 -5
- package/es/components/TagOverflow/TagOverflow.d.ts +1 -0
- package/es/components/TagOverflow/TagOverflow.js +8 -2
- package/es/components/TagOverflow/TagOverflowPopover.d.ts +1 -0
- package/es/components/TagOverflow/TagOverflowPopover.js +7 -1
- package/es/components/TagSet/TagSetOverflow.js +1 -1
- package/es/components/Tearsheet/Tearsheet.d.ts +2 -2
- package/es/components/Tearsheet/TearsheetShell.js +7 -3
- package/es/components/Toolbar/ToolbarButton.d.ts +12 -1
- package/es/components/Toolbar/ToolbarButton.js +16 -8
- package/es/global/js/hooks/useFocus.d.ts +1 -1
- package/es/global/js/hooks/useFocus.js +40 -24
- package/es/global/js/utils/keyboardNavigation.d.ts +27 -0
- package/es/global/js/utils/keyboardNavigation.js +37 -0
- package/es/global/js/utils/wrapFocus.d.ts +25 -0
- package/es/global/js/utils/wrapFocus.js +68 -0
- package/lib/components/APIKeyModal/APIKeyModal.types.d.ts +1 -1
- package/lib/components/Card/Card.js +3 -1
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +100 -24
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +36 -33
- package/lib/components/ConditionBuilder/ConditionBuilder.d.ts +9 -2
- package/lib/components/ConditionBuilder/ConditionBuilder.js +15 -11
- package/lib/components/ConditionBuilder/ConditionBuilder.types.d.ts +151 -0
- package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +26 -12
- package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +15 -15
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +62 -27
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +7 -8
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +86 -37
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +4 -4
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.d.ts +29 -14
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +11 -10
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +8 -5
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +40 -20
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +47 -44
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +10 -49
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +22 -31
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +6 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +7 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +81 -31
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +18 -12
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +27 -12
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +3 -4
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.d.ts +30 -12
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +13 -8
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +35 -12
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +22 -15
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts +32 -12
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +15 -15
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +35 -14
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +5 -6
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +25 -10
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +2 -2
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +44 -17
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +60 -50
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +30 -13
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +18 -19
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +12 -13
- package/lib/components/ConditionBuilder/utils/useDataConfigs.d.ts +18 -0
- package/lib/components/ConditionBuilder/utils/useDataConfigs.js +124 -0
- package/lib/components/ConditionBuilder/utils/useTranslations.d.ts +1 -1
- package/lib/components/ConditionBuilder/utils/useTranslations.js +4 -1
- package/lib/components/ConditionBuilder/utils/util.d.ts +12 -0
- package/lib/components/ConditionBuilder/utils/util.js +53 -3
- package/lib/components/CreateFullPage/CreateFullPageStep.d.ts +2 -2
- package/lib/components/CreateFullPage/index.d.ts +1 -0
- package/lib/components/CreateTearsheet/CreateTearsheet.js +3 -4
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +8 -1
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +8 -3
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +19 -10
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +6 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +11 -6
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +18 -16
- package/lib/components/Datagrid/types/index.d.ts +1 -0
- package/lib/components/Datagrid/useActionsColumn.js +1 -4
- package/lib/components/Datagrid/useFiltering.d.ts +1 -0
- package/lib/components/Datagrid/useFiltering.js +13 -1
- package/lib/components/EditInPlace/EditInPlace.js +7 -5
- package/lib/components/NotificationsPanel/NotificationsPanel.d.ts +2 -0
- package/lib/components/NotificationsPanel/NotificationsPanel.js +74 -4
- package/lib/components/TagOverflow/TagOverflow.d.ts +1 -0
- package/lib/components/TagOverflow/TagOverflow.js +8 -2
- package/lib/components/TagOverflow/TagOverflowPopover.d.ts +1 -0
- package/lib/components/TagOverflow/TagOverflowPopover.js +7 -1
- package/lib/components/TagSet/TagSetOverflow.js +1 -1
- package/lib/components/Tearsheet/Tearsheet.d.ts +2 -2
- package/lib/components/Tearsheet/TearsheetShell.js +6 -2
- package/lib/components/Toolbar/ToolbarButton.d.ts +12 -1
- package/lib/components/Toolbar/ToolbarButton.js +15 -6
- package/lib/global/js/hooks/useFocus.d.ts +1 -1
- package/lib/global/js/hooks/useFocus.js +40 -24
- package/lib/global/js/utils/keyboardNavigation.d.ts +27 -0
- package/lib/global/js/utils/keyboardNavigation.js +43 -0
- package/lib/global/js/utils/wrapFocus.d.ts +25 -0
- package/lib/global/js/utils/wrapFocus.js +73 -0
- package/package.json +4 -4
- package/scss/components/ConditionBuilder/_condition-builder.scss +1 -1
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +33 -22
- package/scss/components/Datagrid/styles/_datagrid.scss +7 -0
- package/scss/components/Datagrid/styles/_useActionsColumn.scss +4 -0
- package/scss/components/EditInPlace/_edit-in-place.scss +2 -2
- package/telemetry.yml +15 -6
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +0 -28
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +0 -123
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +0 -28
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +0 -131
@@ -18,8 +18,8 @@ var devtools = require('../../global/js/utils/devtools.js');
|
|
18
18
|
var ConditionBuilderContent = require('./ConditionBuilderContent/ConditionBuilderContent.js');
|
19
19
|
var ConditionBuilderProvider = require('./ConditionBuilderContext/ConditionBuilderProvider.js');
|
20
20
|
var settings = require('../../settings.js');
|
21
|
-
var DataConfigs = require('./ConditionBuilderContext/DataConfigs.js');
|
22
21
|
var handleKeyboardEvents = require('./utils/handleKeyboardEvents.js');
|
22
|
+
var util = require('./utils/util.js');
|
23
23
|
|
24
24
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
25
25
|
|
@@ -63,11 +63,11 @@ exports.ConditionBuilder = /*#__PURE__*/React__default["default"].forwardRef(fun
|
|
63
63
|
getConditionState = _ref.getConditionState,
|
64
64
|
getActionsState = _ref.getActionsState,
|
65
65
|
_ref$variant = _ref.variant,
|
66
|
-
variant = _ref$variant === void 0 ?
|
66
|
+
variant = _ref$variant === void 0 ? util.NON_HIERARCHICAL_VARIANT : _ref$variant,
|
67
67
|
actions = _ref.actions,
|
68
68
|
translateWithId = _ref.translateWithId,
|
69
69
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
70
|
-
var localRef = React.useRef();
|
70
|
+
var localRef = React.useRef(null);
|
71
71
|
var conditionBuilderRef = ref || localRef;
|
72
72
|
var handleKeyDownHandler = function handleKeyDownHandler(evt) {
|
73
73
|
handleKeyboardEvents.handleKeyDown(evt, conditionBuilderRef, variant);
|
@@ -80,7 +80,7 @@ exports.ConditionBuilder = /*#__PURE__*/React__default["default"].forwardRef(fun
|
|
80
80
|
translateWithId: translateWithId,
|
81
81
|
conditionBuilderRef: conditionBuilderRef
|
82
82
|
}, /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
83
|
-
className: cx__default["default"](
|
83
|
+
className: cx__default["default"](util.blockClass,
|
84
84
|
// Apply the block class to the main HTML element
|
85
85
|
className,
|
86
86
|
// Apply any supplied class names to the main HTML element.
|
@@ -92,7 +92,7 @@ exports.ConditionBuilder = /*#__PURE__*/React__default["default"].forwardRef(fun
|
|
92
92
|
role: "main",
|
93
93
|
ref: conditionBuilderRef
|
94
94
|
}, devtools.getDevtoolsProps(componentName)), /*#__PURE__*/React__default["default"].createElement(react.VStack, {
|
95
|
-
className: "".concat(
|
95
|
+
className: "".concat(util.blockClass, "__").concat(variant),
|
96
96
|
onKeyDown: handleKeyDownHandler
|
97
97
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderContent["default"], {
|
98
98
|
startConditionLabel: startConditionLabel,
|
@@ -117,6 +117,7 @@ exports.ConditionBuilder.propTypes = {
|
|
117
117
|
/**
|
118
118
|
* optional array of actions
|
119
119
|
*/
|
120
|
+
/**@ts-ignore */
|
120
121
|
actions: index["default"].arrayOf(index["default"].shape({
|
121
122
|
id: index["default"].oneOfType([index["default"].string, index["default"].number]).isRequired,
|
122
123
|
label: index["default"].string.isRequired
|
@@ -158,13 +159,14 @@ exports.ConditionBuilder.propTypes = {
|
|
158
159
|
* Optional prop if you want to pass a saved condition state.
|
159
160
|
* This object should respect the structure of condition state that is available in getConditionState callback
|
160
161
|
*/
|
162
|
+
/**@ts-ignore */
|
161
163
|
initialState: index["default"].shape({
|
162
164
|
groups: index["default"].arrayOf(index["default"].shape({
|
163
|
-
groupOperator: index["default"].string
|
164
|
-
statement: index["default"].string
|
165
|
+
groupOperator: index["default"].string,
|
166
|
+
statement: index["default"].string,
|
165
167
|
conditions: index["default"].arrayOf(index["default"].oneOfType([index["default"].shape({
|
166
|
-
property: index["default"].string
|
167
|
-
operator: index["default"].string
|
168
|
+
property: index["default"].string,
|
169
|
+
operator: index["default"].string,
|
168
170
|
value: index["default"].oneOfType([index["default"].string, index["default"].arrayOf(index["default"].shape({
|
169
171
|
id: index["default"].string,
|
170
172
|
label: index["default"].string
|
@@ -180,6 +182,7 @@ exports.ConditionBuilder.propTypes = {
|
|
180
182
|
* This is a mandatory prop that defines the input to the condition builder.
|
181
183
|
|
182
184
|
*/
|
185
|
+
/**@ts-ignore */
|
183
186
|
inputConfig: index["default"].shape({
|
184
187
|
properties: index["default"].arrayOf(index["default"].shape({
|
185
188
|
id: index["default"].string.isRequired,
|
@@ -214,10 +217,11 @@ exports.ConditionBuilder.propTypes = {
|
|
214
217
|
* The message id will be one of [ "ifText","addConditionText", "addConditionGroupText", "addSubgroupText", "conditionText", "propertyText", "operatorText", "valueText", "connectorText", "conditionRowText","conditionRowGroupText","conditionBuilderText","actionSectionText", "removeConditionText", "addConditionRowText", "startText", "endText", "clearSearchText", "actionsText", "then", "removeActionText", "addActionText", "invalidText", "invalidNumberWarnText"]
|
215
218
|
]
|
216
219
|
*/
|
220
|
+
/**@ts-ignore */
|
217
221
|
translateWithId: index["default"].func,
|
218
222
|
/* TODO: add types and DocGen for all props. */
|
219
223
|
/**
|
220
|
-
* Provide the condition builder variant:
|
224
|
+
* Provide the condition builder variant: Non-Hierarchical/ Hierarchical
|
221
225
|
*/
|
222
|
-
variant: index["default"].oneOf(['
|
226
|
+
variant: index["default"].oneOf(['Non-Hierarchical', 'Hierarchical'])
|
223
227
|
};
|
@@ -0,0 +1,151 @@
|
|
1
|
+
/// <reference path="../../../src/custom-typings/index.d.ts" />
|
2
|
+
/**
|
3
|
+
* Copyright IBM Corp. 2024
|
4
|
+
*
|
5
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
7
|
+
*/
|
8
|
+
import { TextAreaProps, TextInputProps } from '@carbon/react';
|
9
|
+
import { CarbonIconType } from '@carbon/react/icons';
|
10
|
+
import { NumberInputProps } from '@carbon/react/lib/components/NumberInput/NumberInput';
|
11
|
+
import { Dispatch, ForwardedRef, PropsWithChildren, ReactNode, SetStateAction } from 'react';
|
12
|
+
export type LogicalOperator = 'and' | 'or';
|
13
|
+
export type StatementOperator = 'ifAll' | 'ifAny' | 'unlessAll' | 'unlessAny';
|
14
|
+
type CoreOperator = 'is';
|
15
|
+
type NumberOperator = 'greater' | 'greaterEqual' | 'lower' | 'lowerEqual';
|
16
|
+
type StringOperator = 'startsWith' | 'endsWith';
|
17
|
+
type ArrayOperator = 'contains';
|
18
|
+
type OptionOperator = 'oneOf';
|
19
|
+
type DateOperator = 'before' | 'after';
|
20
|
+
export type Operator = LogicalOperator | StatementOperator | CoreOperator | NumberOperator | StringOperator | ArrayOperator | OptionOperator | DateOperator;
|
21
|
+
export type OperatorGroups = 'logical' | 'statement' | 'core' | 'number' | 'string' | 'array' | 'option' | 'date';
|
22
|
+
export type Operators = {
|
23
|
+
logical: LogicalOperator;
|
24
|
+
statement: StatementOperator;
|
25
|
+
core: CoreOperator;
|
26
|
+
number: NumberOperator;
|
27
|
+
string: StringOperator;
|
28
|
+
array: ArrayOperator;
|
29
|
+
option: OptionOperator;
|
30
|
+
date: DateOperator;
|
31
|
+
};
|
32
|
+
export type PropertyConfigOption = {
|
33
|
+
type: 'option';
|
34
|
+
config?: {
|
35
|
+
options?: {
|
36
|
+
id: string;
|
37
|
+
label: string;
|
38
|
+
icon?: CarbonIconType;
|
39
|
+
}[];
|
40
|
+
};
|
41
|
+
};
|
42
|
+
export interface PropertyConfigText {
|
43
|
+
type: 'text';
|
44
|
+
config: TextInputProps;
|
45
|
+
}
|
46
|
+
export interface PropertyConfigTextArea {
|
47
|
+
type: 'textarea';
|
48
|
+
config: TextAreaProps;
|
49
|
+
}
|
50
|
+
export interface PropertyConfigNumber {
|
51
|
+
type: 'number';
|
52
|
+
config: {
|
53
|
+
min?: number;
|
54
|
+
max?: number;
|
55
|
+
step?: number;
|
56
|
+
unit?: string;
|
57
|
+
} & NumberInputProps;
|
58
|
+
}
|
59
|
+
export type PropertyConfigDate = {
|
60
|
+
type: 'date';
|
61
|
+
config: object;
|
62
|
+
};
|
63
|
+
export type PropertyConfigTime = {
|
64
|
+
type: 'time';
|
65
|
+
config: {
|
66
|
+
timeZones: string[];
|
67
|
+
};
|
68
|
+
};
|
69
|
+
export type PropertyConfigCustom = {
|
70
|
+
type: 'custom';
|
71
|
+
config: {
|
72
|
+
component: React.ComponentType<any>;
|
73
|
+
operators: {
|
74
|
+
label: string;
|
75
|
+
id: string;
|
76
|
+
}[];
|
77
|
+
};
|
78
|
+
};
|
79
|
+
export type PropertyConfig = {
|
80
|
+
option: PropertyConfigOption;
|
81
|
+
text: PropertyConfigText;
|
82
|
+
textarea: PropertyConfigTextArea;
|
83
|
+
number: PropertyConfigNumber;
|
84
|
+
date: PropertyConfigDate;
|
85
|
+
time: PropertyConfigTime;
|
86
|
+
custom: PropertyConfigCustom;
|
87
|
+
};
|
88
|
+
export type Property = {
|
89
|
+
id: string;
|
90
|
+
label: string;
|
91
|
+
icon?: CarbonIconType;
|
92
|
+
} & (PropertyConfig['option'] | PropertyConfig['text'] | PropertyConfig['number'] | PropertyConfig['date'] | PropertyConfig['textarea'] | PropertyConfig['time'] | PropertyConfig['custom']);
|
93
|
+
export type inputConfig = {
|
94
|
+
properties: Property[];
|
95
|
+
};
|
96
|
+
export type Option = {
|
97
|
+
id: string;
|
98
|
+
label: string;
|
99
|
+
icon?: CarbonIconType;
|
100
|
+
};
|
101
|
+
export type Condition = {
|
102
|
+
property?: string;
|
103
|
+
operator?: Operator | '' | 'INVALID';
|
104
|
+
value?: string | Option[] | Option;
|
105
|
+
id?: string | number;
|
106
|
+
popoverToOpen?: string;
|
107
|
+
};
|
108
|
+
export type ConditionGroup = {
|
109
|
+
conditions?: (ConditionGroup | Condition)[];
|
110
|
+
groupOperator?: LogicalOperator;
|
111
|
+
statement?: StatementOperator;
|
112
|
+
id: string;
|
113
|
+
};
|
114
|
+
export type ConditionBuilderState = {
|
115
|
+
groups?: ConditionGroup[];
|
116
|
+
operator?: LogicalOperator;
|
117
|
+
};
|
118
|
+
export type Action = {
|
119
|
+
id?: string | number;
|
120
|
+
label?: string;
|
121
|
+
};
|
122
|
+
export type variantsType = 'Non-Hierarchical' | 'Hierarchical';
|
123
|
+
export type ConditionBuilderProps = {
|
124
|
+
inputConfig: inputConfig;
|
125
|
+
initialState?: ConditionBuilderState;
|
126
|
+
getActionsState?: (state: Action[] | undefined) => void;
|
127
|
+
getConditionState: (state: ConditionBuilderState | undefined) => void;
|
128
|
+
getOptions?: (state: ConditionBuilderState, condition: Condition) => Promise<Option[]>;
|
129
|
+
actions?: Action[];
|
130
|
+
className?: string;
|
131
|
+
popOverSearchThreshold: number;
|
132
|
+
startConditionLabel: string;
|
133
|
+
variant?: 'Non-Hierarchical' | 'Hierarchical';
|
134
|
+
translateWithId: (id: string) => string;
|
135
|
+
};
|
136
|
+
export interface ConditionBuilderContextInputProps extends PropsWithChildren {
|
137
|
+
children?: ReactNode;
|
138
|
+
inputConfig?: inputConfig;
|
139
|
+
popOverSearchThreshold?: number;
|
140
|
+
getOptions?: (state: ConditionBuilderState, condition: Condition) => Promise<Option[]>;
|
141
|
+
variant?: string;
|
142
|
+
translateWithId?: (id: string) => string;
|
143
|
+
conditionBuilderRef?: ForwardedRef<HTMLDivElement>;
|
144
|
+
}
|
145
|
+
export type ConditionBuilderContextProps = {
|
146
|
+
rootState?: ConditionBuilderState;
|
147
|
+
setRootState?: Dispatch<SetStateAction<ConditionBuilderState>>;
|
148
|
+
actionState?: Action[];
|
149
|
+
setActionState?: Dispatch<SetStateAction<Action[]>>;
|
150
|
+
} & ConditionBuilderContextInputProps;
|
151
|
+
export {};
|
package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts
CHANGED
@@ -1,15 +1,29 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2024
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
import PropTypes from 'prop-types';
|
8
|
+
import { Action, Option } from '../ConditionBuilder.types';
|
9
|
+
interface ConditionBuilderActionsProps {
|
10
|
+
actions: Action[] | Option[];
|
11
|
+
className?: string;
|
12
|
+
}
|
13
|
+
declare const ConditionBuilderActions: {
|
14
|
+
({ actions, className, }: ConditionBuilderActionsProps): import("react/jsx-runtime").JSX.Element;
|
15
|
+
propTypes: {
|
16
|
+
/**
|
17
|
+
* optional array of object that give the list of actions.
|
18
|
+
*/
|
19
|
+
actions: PropTypes.Requireable<(PropTypes.InferProps<{
|
9
20
|
id: PropTypes.Validator<NonNullable<NonNullable<string | number | null | undefined>>>;
|
10
21
|
label: PropTypes.Validator<string>;
|
11
22
|
}> | null | undefined)[]>;
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
23
|
+
/**
|
24
|
+
* Provide an optional class to be applied to the containing node.
|
25
|
+
*/
|
26
|
+
className: PropTypes.Requireable<string>;
|
27
|
+
};
|
28
|
+
};
|
29
|
+
export default ConditionBuilderActions;
|
@@ -16,13 +16,13 @@ var cx = require('classnames');
|
|
16
16
|
var icons = require('@carbon/react/icons');
|
17
17
|
var react = require('@carbon/react');
|
18
18
|
var ConditionBuilderItem = require('../ConditionBuilderItem/ConditionBuilderItem.js');
|
19
|
-
var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
|
20
19
|
var ConditionBuilderProvider = require('../ConditionBuilderContext/ConditionBuilderProvider.js');
|
21
20
|
var ConditionBuilderAdd = require('../ConditionBuilderAdd/ConditionBuilderAdd.js');
|
22
21
|
var uuidv4 = require('../../../global/js/utils/uuidv4.js');
|
23
22
|
var ConditionBuilderButton = require('../ConditionBuilderButton/ConditionBuilderButton.js');
|
24
23
|
var useTranslations = require('../utils/useTranslations.js');
|
25
24
|
var ItemOptionForValueField = require('../ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js');
|
25
|
+
var util = require('../utils/util.js');
|
26
26
|
|
27
27
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
28
28
|
|
@@ -33,7 +33,8 @@ var ConditionBuilderActions = function ConditionBuilderActions(_ref) {
|
|
33
33
|
var actions = _ref.actions,
|
34
34
|
className = _ref.className;
|
35
35
|
var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
|
36
|
-
|
36
|
+
_useContext$actionSta = _useContext.actionState,
|
37
|
+
actionState = _useContext$actionSta === void 0 ? [] : _useContext$actionSta,
|
37
38
|
setActionState = _useContext.setActionState;
|
38
39
|
var _useState = React.useState(-1),
|
39
40
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
@@ -53,7 +54,7 @@ var ConditionBuilderActions = function ConditionBuilderActions(_ref) {
|
|
53
54
|
label: undefined,
|
54
55
|
popoverToOpen: 'valueField'
|
55
56
|
};
|
56
|
-
setActionState([].concat(_rollupPluginBabelHelpers.toConsumableArray(actionState), [action]));
|
57
|
+
setActionState === null || setActionState === void 0 || setActionState([].concat(_rollupPluginBabelHelpers.toConsumableArray(actionState), [action]));
|
57
58
|
};
|
58
59
|
var onchangeHandler = function onchangeHandler(selectedId, actionIndex) {
|
59
60
|
var action = actions.find(function (action) {
|
@@ -64,10 +65,10 @@ var ConditionBuilderActions = function ConditionBuilderActions(_ref) {
|
|
64
65
|
var newAction = _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, action), {}, {
|
65
66
|
id: actionState[actionIndex].id
|
66
67
|
});
|
67
|
-
setActionState([].concat(_rollupPluginBabelHelpers.toConsumableArray(actionState.slice(0, actionIndex)), [newAction], _rollupPluginBabelHelpers.toConsumableArray(actionState.slice(actionIndex + 1))));
|
68
|
+
setActionState === null || setActionState === void 0 || setActionState([].concat(_rollupPluginBabelHelpers.toConsumableArray(actionState.slice(0, actionIndex)), [newAction], _rollupPluginBabelHelpers.toConsumableArray(actionState.slice(actionIndex + 1))));
|
68
69
|
};
|
69
70
|
var onRemove = function onRemove(selectedId) {
|
70
|
-
setActionState(actionState.filter(function (action) {
|
71
|
+
setActionState === null || setActionState === void 0 || setActionState(actionState.filter(function (action) {
|
71
72
|
return action.id !== selectedId;
|
72
73
|
}));
|
73
74
|
};
|
@@ -80,21 +81,21 @@ var ConditionBuilderActions = function ConditionBuilderActions(_ref) {
|
|
80
81
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
81
82
|
className: className
|
82
83
|
}, /*#__PURE__*/React__default["default"].createElement(react.Section, {
|
83
|
-
className: "".concat(
|
84
|
+
className: "".concat(util.blockClass, "__heading"),
|
84
85
|
level: 4
|
85
86
|
}, /*#__PURE__*/React__default["default"].createElement(react.Heading, null, actionsText)), /*#__PURE__*/React__default["default"].createElement("div", {
|
86
|
-
className: "".concat(
|
87
|
+
className: "".concat(util.blockClass, "__condition-wrapper"),
|
87
88
|
role: "grid",
|
88
89
|
"aria-label": actionSectionText
|
89
90
|
}, actionState === null || actionState === void 0 ? void 0 : actionState.map(function (action, index) {
|
90
91
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
91
92
|
key: action.id,
|
92
93
|
role: "row",
|
93
|
-
className: cx__default["default"]("".concat(
|
94
|
+
className: cx__default["default"]("".concat(util.blockClass, "__condition-block ").concat(util.blockClass, "__gap ").concat(util.blockClass, "__gap-bottom"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(util.blockClass, "__condition__deletion-preview"), showDeletionPreview == index))
|
94
95
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
95
|
-
className: "".concat(
|
96
|
+
className: "".concat(util.blockClass, "__statement-button"),
|
96
97
|
tabIndex: 0,
|
97
|
-
popOverClassName: "".concat(
|
98
|
+
popOverClassName: "".concat(util.blockClass, "__gap"),
|
98
99
|
label: index === 0 ? thenText : andText
|
99
100
|
}), /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
100
101
|
label: action.label,
|
@@ -130,22 +131,21 @@ var ConditionBuilderActions = function ConditionBuilderActions(_ref) {
|
|
130
131
|
},
|
131
132
|
onBlur: handleHideDeletionPreview,
|
132
133
|
renderIcon: icons.Close,
|
133
|
-
className: "".concat(
|
134
|
+
className: "".concat(util.blockClass, "__close-condition"),
|
134
135
|
"data-name": "closeCondition"
|
135
136
|
})), actionState.length === index + 1 && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderAdd["default"], {
|
136
137
|
onClick: addActionHandler,
|
137
|
-
className: "".concat(
|
138
|
+
className: "".concat(util.blockClass, "__gap ").concat(util.blockClass, "__gap-left"),
|
138
139
|
buttonLabel: addActionText,
|
139
140
|
tabIndex: 0
|
140
141
|
}));
|
141
142
|
}), actionState.length === 0 && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderAdd["default"], {
|
142
143
|
onClick: addActionHandler,
|
143
|
-
className: "".concat(
|
144
|
+
className: "".concat(util.blockClass, "__gap ").concat(util.blockClass, "__gap-left"),
|
144
145
|
buttonLabel: addActionText,
|
145
146
|
tabIndex: 0
|
146
147
|
})));
|
147
148
|
};
|
148
|
-
var ConditionBuilderActions$1 = ConditionBuilderActions;
|
149
149
|
ConditionBuilderActions.propTypes = {
|
150
150
|
/**
|
151
151
|
* optional array of object that give the list of actions.
|
@@ -160,4 +160,4 @@ ConditionBuilderActions.propTypes = {
|
|
160
160
|
className: index["default"].string
|
161
161
|
};
|
162
162
|
|
163
|
-
exports["default"] = ConditionBuilderActions
|
163
|
+
exports["default"] = ConditionBuilderActions;
|
@@ -1,28 +1,63 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
hideConditionSubGroupPreviewHandler: any;
|
8
|
-
showConditionPreviewHandler: any;
|
9
|
-
hideConditionPreviewHandler: any;
|
10
|
-
enableSubGroup: any;
|
11
|
-
buttonLabel: any;
|
12
|
-
tabIndex: any;
|
13
|
-
}): import("react/jsx-runtime").JSX.Element;
|
14
|
-
declare namespace ConditionBuilderAdd {
|
15
|
-
namespace propTypes {
|
16
|
-
let addConditionSubGroupHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
17
|
-
let buttonLabel: PropTypes.Requireable<string>;
|
18
|
-
let className: PropTypes.Requireable<string>;
|
19
|
-
let enableSubGroup: PropTypes.Requireable<boolean>;
|
20
|
-
let hideConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
21
|
-
let hideConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
22
|
-
let onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
23
|
-
let showConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
24
|
-
let showConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
25
|
-
let tabIndex: PropTypes.Requireable<number>;
|
26
|
-
}
|
27
|
-
}
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2024
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
28
7
|
import PropTypes from 'prop-types';
|
8
|
+
interface ConditionBuilderAddProps {
|
9
|
+
className?: string;
|
10
|
+
onClick: () => void;
|
11
|
+
addConditionSubGroupHandler?: () => void;
|
12
|
+
showConditionSubGroupPreviewHandler?: () => void;
|
13
|
+
hideConditionSubGroupPreviewHandler?: () => void;
|
14
|
+
showConditionPreviewHandler?: () => void;
|
15
|
+
hideConditionPreviewHandler?: () => void;
|
16
|
+
enableSubGroup?: boolean;
|
17
|
+
buttonLabel?: string;
|
18
|
+
tabIndex?: number;
|
19
|
+
}
|
20
|
+
declare const ConditionBuilderAdd: {
|
21
|
+
({ className, onClick, addConditionSubGroupHandler, showConditionSubGroupPreviewHandler, hideConditionSubGroupPreviewHandler, showConditionPreviewHandler, hideConditionPreviewHandler, enableSubGroup, buttonLabel, tabIndex, }: ConditionBuilderAddProps): import("react/jsx-runtime").JSX.Element;
|
22
|
+
propTypes: {
|
23
|
+
/**
|
24
|
+
* handler for hiding sub group preview
|
25
|
+
*/
|
26
|
+
addConditionSubGroupHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
27
|
+
/**
|
28
|
+
* handler for hiding sub group preview
|
29
|
+
*/ /**
|
30
|
+
* tooltip label for plus button
|
31
|
+
*/
|
32
|
+
buttonLabel: PropTypes.Requireable<string>;
|
33
|
+
/**
|
34
|
+
* Provide an optional class to be applied to the containing node.
|
35
|
+
*/
|
36
|
+
className: PropTypes.Requireable<string>;
|
37
|
+
/**
|
38
|
+
* boolean to enable sub groups for the tree variant
|
39
|
+
*/
|
40
|
+
enableSubGroup: PropTypes.Requireable<boolean>;
|
41
|
+
/**
|
42
|
+
* handler for hiding sub group preview
|
43
|
+
*/
|
44
|
+
hideConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
45
|
+
hideConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
46
|
+
/**
|
47
|
+
* handler for hiding sub group preview
|
48
|
+
*/ /**
|
49
|
+
* callback triggered on click of add button
|
50
|
+
*/
|
51
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
52
|
+
showConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
53
|
+
showConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
54
|
+
/**
|
55
|
+
* handler for hiding sub group preview
|
56
|
+
*/
|
57
|
+
/**
|
58
|
+
* Tab index
|
59
|
+
*/
|
60
|
+
tabIndex: PropTypes.Requireable<number>;
|
61
|
+
};
|
62
|
+
};
|
63
|
+
export default ConditionBuilderAdd;
|
@@ -15,8 +15,8 @@ var cx = require('classnames');
|
|
15
15
|
var icons = require('@carbon/react/icons');
|
16
16
|
var ConditionBuilderButton = require('../ConditionBuilderButton/ConditionBuilderButton.js');
|
17
17
|
var index = require('../../../node_modules/prop-types/index.js');
|
18
|
-
var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
|
19
18
|
var useTranslations = require('../utils/useTranslations.js');
|
19
|
+
var util = require('../utils/util.js');
|
20
20
|
|
21
21
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
22
22
|
|
@@ -66,7 +66,7 @@ var ConditionBuilderAdd = function ConditionBuilderAdd(_ref) {
|
|
66
66
|
role: 'gridcell'
|
67
67
|
} : {};
|
68
68
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
69
|
-
className: "".concat(className, " ").concat(
|
69
|
+
className: "".concat(className, " ").concat(util.blockClass, "__add-button-wrapper"),
|
70
70
|
role: !enableSubGroup ? 'gridcell' : 'none',
|
71
71
|
"aria-label": getAriaLabel()
|
72
72
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderButton.ConditionBuilderButton, _rollupPluginBabelHelpers["extends"]({
|
@@ -74,23 +74,22 @@ var ConditionBuilderAdd = function ConditionBuilderAdd(_ref) {
|
|
74
74
|
onClick: onClickHandler
|
75
75
|
}, previewHandlers(), {
|
76
76
|
wrapperProps: wrapperProps,
|
77
|
-
className: "".concat(
|
77
|
+
className: "".concat(util.blockClass, "__add-button"),
|
78
78
|
hideLabel: true,
|
79
79
|
"data-name": "addButton",
|
80
80
|
label: buttonLabel !== null && buttonLabel !== void 0 ? buttonLabel : addConditionText,
|
81
81
|
tabIndex: tabIndex,
|
82
|
-
wrapperClassName: "".concat(
|
82
|
+
wrapperClassName: "".concat(util.blockClass, "__add-condition-wrapper")
|
83
83
|
})), enableSubGroup && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderButton.ConditionBuilderButton, _rollupPluginBabelHelpers["extends"]({
|
84
84
|
renderIcon: icons.TextNewLine,
|
85
85
|
onClick: addConditionSubGroupHandler,
|
86
|
-
className: cx__default["default"]("".concat(
|
86
|
+
className: cx__default["default"]("".concat(util.blockClass, "__add-condition-sub-group")),
|
87
87
|
hideLabel: true,
|
88
88
|
label: addSubgroupText,
|
89
89
|
wrapperProps: wrapperProps,
|
90
|
-
wrapperClassName: "".concat(
|
90
|
+
wrapperClassName: "".concat(util.blockClass, "__add-condition-sub-group-wrapper ").concat(util.blockClass, "__gap-left")
|
91
91
|
}, previewHandlersForSubgroup())));
|
92
92
|
};
|
93
|
-
var ConditionBuilderAdd$1 = ConditionBuilderAdd;
|
94
93
|
ConditionBuilderAdd.propTypes = {
|
95
94
|
/**
|
96
95
|
* handler for hiding sub group preview
|
@@ -132,4 +131,4 @@ ConditionBuilderAdd.propTypes = {
|
|
132
131
|
tabIndex: index["default"].number
|
133
132
|
};
|
134
133
|
|
135
|
-
exports["default"] = ConditionBuilderAdd
|
134
|
+
exports["default"] = ConditionBuilderAdd;
|
@@ -1,38 +1,87 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
showToolTip: any;
|
10
|
-
wrapperProps: any;
|
11
|
-
onBlur: any;
|
12
|
-
onFocus: any;
|
13
|
-
onMouseEnter: any;
|
14
|
-
onMouseLeave: any;
|
15
|
-
isInvalid: any;
|
16
|
-
wrapperClassName: any;
|
17
|
-
tabIndex: any;
|
18
|
-
}): import("react/jsx-runtime").JSX.Element;
|
19
|
-
export namespace ConditionBuilderButton {
|
20
|
-
namespace propTypes {
|
21
|
-
let className: PropTypes.Requireable<string>;
|
22
|
-
let hideLabel: PropTypes.Requireable<boolean>;
|
23
|
-
let isInvalid: PropTypes.Requireable<boolean>;
|
24
|
-
let label: PropTypes.Requireable<string>;
|
25
|
-
let onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
26
|
-
let onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
27
|
-
let onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
28
|
-
let onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
29
|
-
let onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
30
|
-
let renderIcon: PropTypes.Requireable<object>;
|
31
|
-
let showToolTip: PropTypes.Requireable<boolean>;
|
32
|
-
let tabIndex: PropTypes.Requireable<number>;
|
33
|
-
let tooltipAlign: PropTypes.Requireable<string>;
|
34
|
-
let wrapperClassName: PropTypes.Requireable<string>;
|
35
|
-
let wrapperProps: PropTypes.Requireable<object>;
|
36
|
-
}
|
37
|
-
}
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2024
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
/// <reference path="../../../../src/custom-typings/index.d.ts" />
|
8
|
+
import React from 'react';
|
38
9
|
import PropTypes from 'prop-types';
|
10
|
+
import { PopoverAlignment } from '@carbon/react';
|
11
|
+
import { CarbonIconType } from '@carbon/react/icons';
|
12
|
+
interface ConditionBuilderButtonProps {
|
13
|
+
className?: string;
|
14
|
+
label: string;
|
15
|
+
hideLabel?: boolean;
|
16
|
+
tooltipAlign?: PopoverAlignment;
|
17
|
+
renderIcon?: CarbonIconType;
|
18
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
19
|
+
onBlur?: React.FocusEventHandler<HTMLButtonElement>;
|
20
|
+
onFocus?: React.FocusEventHandler<HTMLButtonElement>;
|
21
|
+
onMouseEnter?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
22
|
+
onMouseLeave?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
23
|
+
showToolTip?: boolean;
|
24
|
+
wrapperProps?: object;
|
25
|
+
isInvalid?: boolean;
|
26
|
+
wrapperClassName?: string;
|
27
|
+
tabIndex?: number;
|
28
|
+
}
|
29
|
+
export declare const ConditionBuilderButton: {
|
30
|
+
({ className, label, hideLabel, tooltipAlign, renderIcon: Icon, onClick, showToolTip, wrapperProps, onBlur, onFocus, onMouseEnter, onMouseLeave, isInvalid, wrapperClassName, tabIndex, ...rest }: ConditionBuilderButtonProps): import("react/jsx-runtime").JSX.Element;
|
31
|
+
propTypes: {
|
32
|
+
/**
|
33
|
+
* Provide an optional class to be applied to the containing node.
|
34
|
+
*/
|
35
|
+
className: PropTypes.Requireable<string>;
|
36
|
+
/**
|
37
|
+
* decides if label and tooltip to be hidden
|
38
|
+
*/
|
39
|
+
hideLabel: PropTypes.Requireable<boolean>;
|
40
|
+
/**
|
41
|
+
* boolean to know the updated value in not valid
|
42
|
+
*/
|
43
|
+
isInvalid: PropTypes.Requireable<boolean>;
|
44
|
+
/**
|
45
|
+
* label of the button
|
46
|
+
*/
|
47
|
+
label: PropTypes.Requireable<string>;
|
48
|
+
/**
|
49
|
+
* mouse events callbacks
|
50
|
+
*/
|
51
|
+
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
52
|
+
/**
|
53
|
+
* callback triggered on click of add button
|
54
|
+
*/
|
55
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
56
|
+
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
57
|
+
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
58
|
+
onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
59
|
+
/**
|
60
|
+
* Optional prop to allow overriding the icon rendering.
|
61
|
+
*/
|
62
|
+
renderIcon: PropTypes.Requireable<object>;
|
63
|
+
/**
|
64
|
+
*/
|
65
|
+
/**
|
66
|
+
*decides if tooltip to be shown
|
67
|
+
*/
|
68
|
+
showToolTip: PropTypes.Requireable<boolean>;
|
69
|
+
/**
|
70
|
+
* Tab index
|
71
|
+
*/
|
72
|
+
tabIndex: PropTypes.Requireable<number>;
|
73
|
+
/**
|
74
|
+
* tooltip position
|
75
|
+
*/
|
76
|
+
tooltipAlign: PropTypes.Requireable<string>;
|
77
|
+
/**
|
78
|
+
* classname applies to the wrapper of popover
|
79
|
+
*/
|
80
|
+
wrapperClassName: PropTypes.Requireable<string>;
|
81
|
+
/**
|
82
|
+
* optional props for tree grid to add role and aria-label to wrapper span
|
83
|
+
*/
|
84
|
+
wrapperProps: PropTypes.Requireable<object>;
|
85
|
+
};
|
86
|
+
};
|
87
|
+
export {};
|