@carbon/ibm-products 2.43.2-canary.102 → 2.43.2-canary.104
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +1147 -95
- 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 +1147 -95
- 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 +1147 -95
- 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/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +1 -0
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +17 -4
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +6 -4
- package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +4 -1
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +8 -2
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +3 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +5 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +20 -4
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +15 -7
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +9 -3
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +19 -6
- package/es/components/EmptyStates/EmptyState.d.ts +72 -5
- package/es/components/EmptyStates/EmptyState.js +8 -5
- package/es/components/EmptyStates/EmptyStateV2.d.ts +2 -2
- package/es/components/EmptyStates/EmptyStateV2.js +1 -1
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +1 -0
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +16 -3
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +5 -3
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +4 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +8 -2
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +3 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +5 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +20 -4
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +15 -7
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +9 -3
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +19 -6
- package/lib/components/EmptyStates/EmptyState.d.ts +72 -5
- package/lib/components/EmptyStates/EmptyState.js +8 -5
- package/lib/components/EmptyStates/EmptyStateV2.d.ts +2 -2
- package/lib/components/EmptyStates/EmptyStateV2.js +1 -1
- package/package.json +3 -3
- package/scss/components/ConditionBuilder/_condition-builder.scss +3 -0
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +11 -2
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +41 -31
@@ -96,11 +96,11 @@ var ConditionBuilderAdd = function ConditionBuilderAdd(_ref) {
|
|
96
96
|
})), enableSubGroup && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderButton.ConditionBuilderButton, _rollupPluginBabelHelpers["extends"]({
|
97
97
|
renderIcon: icons.TextNewLine,
|
98
98
|
onClick: addConditionSubGroupHandler,
|
99
|
-
className: cx__default["default"]("".concat(DataConfigs.blockClass, "__add-condition-sub-group
|
99
|
+
className: cx__default["default"]("".concat(DataConfigs.blockClass, "__add-condition-sub-group")),
|
100
100
|
hideLabel: true,
|
101
101
|
label: addSubgroupText,
|
102
102
|
wrapperProps: wrapperProps,
|
103
|
-
wrapperClassName: cx__default["default"]("".concat(DataConfigs.blockClass, "__add-condition-sub-group-wrapper"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__add-condition-sub-group-wrapper--show"), isAddSubgroup))
|
103
|
+
wrapperClassName: cx__default["default"]("".concat(DataConfigs.blockClass, "__add-condition-sub-group-wrapper ").concat(DataConfigs.blockClass, "__gap-left"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__add-condition-sub-group-wrapper--show"), isAddSubgroup))
|
104
104
|
}, previewHandlersForSubgroup())));
|
105
105
|
};
|
106
106
|
var ConditionBuilderAdd$1 = ConditionBuilderAdd;
|
@@ -42,11 +42,11 @@ var ConditionBuilderButton = function ConditionBuilderButton(_ref) {
|
|
42
42
|
wrapperClassName = _ref.wrapperClassName,
|
43
43
|
tabIndex = _ref.tabIndex,
|
44
44
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
45
|
+
var carbonPrefix = react.usePrefix();
|
45
46
|
var Button = function Button() {
|
46
47
|
var _rest$dataName;
|
47
48
|
var dataName = (_rest$dataName = rest['data-name']) !== null && _rest$dataName !== void 0 ? _rest$dataName : '';
|
48
49
|
return /*#__PURE__*/React__default["default"].createElement("button", _rollupPluginBabelHelpers["extends"]({
|
49
|
-
// role={'gridcell'}
|
50
50
|
tabIndex: tabIndex != undefined ? tabIndex : -1,
|
51
51
|
className: cx__default["default"]([className, "".concat(DataConfigs.blockClass, "__button"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__text-ellipsis"), showToolTip && !hideLabel && !isInvalid), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__invalid-input"), isInvalid)]),
|
52
52
|
type: "button",
|
@@ -61,8 +61,10 @@ var ConditionBuilderButton = function ConditionBuilderButton(_ref) {
|
|
61
61
|
return hideLabel || showToolTip ? /*#__PURE__*/React__default["default"].createElement(react.Tooltip, _rollupPluginBabelHelpers["extends"]({
|
62
62
|
label: label,
|
63
63
|
align: tooltipAlign,
|
64
|
-
className: "".concat(wrapperClassName)
|
65
|
-
}, wrapperProps
|
64
|
+
className: "".concat(wrapperClassName, " ").concat(DataConfigs.blockClass, "__tooltip ").concat(carbonPrefix, "--icon-tooltip")
|
65
|
+
}, wrapperProps, {
|
66
|
+
leaveDelayMs: 0
|
67
|
+
}), Button()) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, Button());
|
66
68
|
};
|
67
69
|
ConditionBuilderButton.propTypes = {
|
68
70
|
/**
|
@@ -18,6 +18,7 @@ var index = require('../../../node_modules/prop-types/index.js');
|
|
18
18
|
var util = require('../utils/util.js');
|
19
19
|
var ConditionBuilderProvider = require('../ConditionBuilderContext/ConditionBuilderProvider.js');
|
20
20
|
var useTranslations = require('../utils/useTranslations.js');
|
21
|
+
var ConditionBuilderButton = require('../ConditionBuilderButton/ConditionBuilderButton.js');
|
21
22
|
|
22
23
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
23
24
|
|
@@ -56,7 +57,9 @@ var ConditionConnector = function ConditionConnector(_ref) {
|
|
56
57
|
};
|
57
58
|
return variant == 'tree' ? /*#__PURE__*/React__default["default"].createElement("span", {
|
58
59
|
className: "".concat(className, " ").concat(DataConfigs.blockClass, "__connector--disabled")
|
59
|
-
},
|
60
|
+
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderButton.ConditionBuilderButton, {
|
61
|
+
label: operator
|
62
|
+
})) :
|
60
63
|
/*#__PURE__*/
|
61
64
|
// <div className={className} {...rest}>
|
62
65
|
React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, _rollupPluginBabelHelpers["extends"]({
|
@@ -30,7 +30,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
30
30
|
|
31
31
|
var _GroupConnector;
|
32
32
|
var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
33
|
-
var _rootState$
|
33
|
+
var _rootState$groups3;
|
34
34
|
var startConditionLabel = _ref.startConditionLabel,
|
35
35
|
getConditionState = _ref.getConditionState,
|
36
36
|
getActionsState = _ref.getActionsState,
|
@@ -118,6 +118,11 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
118
118
|
groups: [].concat(_rollupPluginBabelHelpers.toConsumableArray(rootState.groups), [newGroup])
|
119
119
|
}));
|
120
120
|
};
|
121
|
+
var getColorIndex = function getColorIndex() {
|
122
|
+
var _rootState$groups$len, _rootState$groups2;
|
123
|
+
var groupLength = (_rootState$groups$len = rootState === null || rootState === void 0 || (_rootState$groups2 = rootState.groups) === null || _rootState$groups2 === void 0 ? void 0 : _rootState$groups2.length) !== null && _rootState$groups$len !== void 0 ? _rootState$groups$len : 0;
|
124
|
+
return groupLength % 5;
|
125
|
+
};
|
121
126
|
if (!isConditionBuilderActive) {
|
122
127
|
return /*#__PURE__*/React__default["default"].createElement(react.Button, {
|
123
128
|
className: "".concat(DataConfigs.blockClass, "__addConditionText-button"),
|
@@ -137,7 +142,7 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
137
142
|
className: "".concat(DataConfigs.blockClass, "__content-container"),
|
138
143
|
role: "treegrid",
|
139
144
|
"aria-label": "condition builder tree"
|
140
|
-
}, rootState && (rootState === null || rootState === void 0 || (_rootState$
|
145
|
+
}, rootState && (rootState === null || rootState === void 0 || (_rootState$groups3 = rootState.groups) === null || _rootState$groups3 === void 0 ? void 0 : _rootState$groups3.map(function (eachGroup, groupIndex) {
|
141
146
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
142
147
|
key: eachGroup.id,
|
143
148
|
className: "".concat(DataConfigs.blockClass, "__group-wrapper")
|
@@ -177,6 +182,7 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
177
182
|
}
|
178
183
|
})), showConditionGroupPreview && /*#__PURE__*/React__default["default"].createElement(ConditionPreview["default"], {
|
179
184
|
previewType: "newGroup",
|
185
|
+
colorIndex: getColorIndex(),
|
180
186
|
group: {
|
181
187
|
groupOperator: rootState.operator
|
182
188
|
}
|
@@ -36,7 +36,7 @@ var translationsObject = {
|
|
36
36
|
connectorText: 'Connector',
|
37
37
|
conditionRowText: 'Condition row',
|
38
38
|
conditionRowGroupText: 'Condition row group',
|
39
|
-
removeConditionText: '
|
39
|
+
removeConditionText: 'Delete condition',
|
40
40
|
addConditionRowText: 'Add condition row',
|
41
41
|
startText: 'Start',
|
42
42
|
endText: 'End',
|
@@ -49,7 +49,10 @@ var translationsObject = {
|
|
49
49
|
invalidNumberWarnText: 'Invalid number, must be 0 or greater',
|
50
50
|
conditionBuilderText: 'Condition Builder',
|
51
51
|
actionSectionText: 'Action Section',
|
52
|
-
conditionHeadingText: 'Condition'
|
52
|
+
conditionHeadingText: 'Condition',
|
53
|
+
addPropertyText: 'Add property',
|
54
|
+
addOperatorText: 'Add operator',
|
55
|
+
addValueText: 'Add value'
|
53
56
|
};
|
54
57
|
|
55
58
|
exports.translationsObject = translationsObject;
|
@@ -44,11 +44,14 @@ var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
|
44
44
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
45
45
|
open = _useState2[0],
|
46
46
|
setOpen = _useState2[1];
|
47
|
-
var _useTranslations = useTranslations.useTranslations(['invalidText', 'addConditionText', label]),
|
48
|
-
_useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations,
|
47
|
+
var _useTranslations = useTranslations.useTranslations(['invalidText', 'addConditionText', 'addPropertyText', 'addOperatorText', 'addValueText', label]),
|
48
|
+
_useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations, 6),
|
49
49
|
invalidText = _useTranslations2[0],
|
50
50
|
addConditionText = _useTranslations2[1],
|
51
|
-
|
51
|
+
addPropertyText = _useTranslations2[2],
|
52
|
+
addOperatorText = _useTranslations2[3],
|
53
|
+
addValueText = _useTranslations2[4],
|
54
|
+
labelText = _useTranslations2[5];
|
52
55
|
var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
|
53
56
|
conditionBuilderRef = _useContext.conditionBuilderRef;
|
54
57
|
var getPropertyDetails = function getPropertyDetails() {
|
@@ -133,6 +136,19 @@ var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
|
133
136
|
manageInvalidSelection();
|
134
137
|
}
|
135
138
|
};
|
139
|
+
var getLabel = function getLabel() {
|
140
|
+
if (propertyLabel) {
|
141
|
+
return propertyLabel;
|
142
|
+
} else if (rest['data-name'] === 'propertyField') {
|
143
|
+
return addPropertyText;
|
144
|
+
} else if (rest['data-name'] === 'operatorField') {
|
145
|
+
return addOperatorText;
|
146
|
+
} else if (rest['data-name'] === 'valueField') {
|
147
|
+
return addValueText;
|
148
|
+
} else {
|
149
|
+
return addConditionText;
|
150
|
+
}
|
151
|
+
};
|
136
152
|
return /*#__PURE__*/React__default["default"].createElement(react.Popover, {
|
137
153
|
open: open,
|
138
154
|
isTabTip: true,
|
@@ -141,7 +157,7 @@ var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
|
141
157
|
ref: popoverRef,
|
142
158
|
onRequestClose: closePopover
|
143
159
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderButton.ConditionBuilderButton, _rollupPluginBabelHelpers["extends"]({
|
144
|
-
label:
|
160
|
+
label: getLabel(),
|
145
161
|
hideLabel: !label ? true : false,
|
146
162
|
onClick: togglePopover,
|
147
163
|
className: className,
|
@@ -59,6 +59,10 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
59
59
|
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
60
60
|
showConditionSubGroupPreview = _useState4[0],
|
61
61
|
setShowConditionSubGroupPreview = _useState4[1];
|
62
|
+
var _useState5 = React.useState(false),
|
63
|
+
_useState6 = _rollupPluginBabelHelpers.slicedToArray(_useState5, 2),
|
64
|
+
showDeletionPreviewForSubgroups = _useState6[0],
|
65
|
+
setShowDeletionPreviewForSubgroups = _useState6[1];
|
62
66
|
var conditionBuilderContentRef = React.useRef();
|
63
67
|
var onRemoveHandler = function onRemoveHandler(conditionId, evt, conditionIndex) {
|
64
68
|
if (group.conditions.length > 1) {
|
@@ -89,9 +93,11 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
89
93
|
groupedItems.conditions.push(item);
|
90
94
|
}
|
91
95
|
});
|
92
|
-
|
93
|
-
|
94
|
-
|
96
|
+
onRemove(evt);
|
97
|
+
// onChange({
|
98
|
+
// ...group,
|
99
|
+
// conditions: [...groupedItems.conditions, ...groupedItems.groups],
|
100
|
+
// });
|
95
101
|
} else {
|
96
102
|
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
|
97
103
|
conditions: group.conditions.filter(function (condition) {
|
@@ -164,10 +170,11 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
164
170
|
};
|
165
171
|
setTimeout(function () {
|
166
172
|
var currentRowToFocus = conditionBuilderContentRef.current.querySelector("[role=\"row\"][aria-level=\"".concat(rowIdentity.ariaLevel, "\"][aria-posinset=\"").concat(rowIdentity.ariaPosInSet, "\"]"));
|
167
|
-
util.manageTabIndexAndFocus(currentRowToFocus, conditionBuilderRef);
|
173
|
+
util.manageTabIndexAndFocus(currentRowToFocus === null || currentRowToFocus === void 0 ? void 0 : currentRowToFocus.querySelector('[data-name="closeCondition"]'), conditionBuilderRef);
|
168
174
|
}, 0);
|
169
175
|
} else if ((prevRows === null || prevRows === void 0 ? void 0 : prevRows.length) > 1) {
|
170
|
-
|
176
|
+
var _prevRows;
|
177
|
+
util.manageTabIndexAndFocus((_prevRows = prevRows[prevRows.length - 2]) === null || _prevRows === void 0 ? void 0 : _prevRows.querySelector('[data-name="closeCondition"]'), conditionBuilderRef);
|
171
178
|
}
|
172
179
|
}
|
173
180
|
};
|
@@ -288,7 +295,7 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
288
295
|
return /*#__PURE__*/React__default["default"].createElement(React.Fragment, {
|
289
296
|
key: eachCondition.id
|
290
297
|
}, eachCondition.conditions ? /*#__PURE__*/React__default["default"].createElement("div", {
|
291
|
-
className: cx__default["default"]("".concat(DataConfigs.blockClass, "__condition-block subgroup ").concat(DataConfigs.blockClass, "__gap"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__gap-bottom"), group.conditions.length < conditionIndex + 1))
|
298
|
+
className: cx__default["default"]("".concat(DataConfigs.blockClass, "__condition-block subgroup ").concat(DataConfigs.blockClass, "__gap"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__gap-bottom"), group.conditions.length < conditionIndex + 1), "".concat(DataConfigs.blockClass, "__subgroup_deletionPreview"), showDeletionPreviewForSubgroups), {})
|
292
299
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionConnector["default"], {
|
293
300
|
className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-bottom ").concat(DataConfigs.blockClass, "__groupConnector"),
|
294
301
|
operator: group.groupOperator,
|
@@ -336,7 +343,8 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
336
343
|
_showConditionPreviewHandler(conditionIndex);
|
337
344
|
},
|
338
345
|
hideConditionPreviewHandler: hideConditionPreviewHandler,
|
339
|
-
isLastCondition: isLastCondition
|
346
|
+
isLastCondition: isLastCondition,
|
347
|
+
setShowDeletionPreviewForSubgroups: setShowDeletionPreviewForSubgroups
|
340
348
|
})), conditionIndex == showConditionSubGroupPreview && (_ConditionPreview || (_ConditionPreview = /*#__PURE__*/React__default["default"].createElement(ConditionPreview["default"], {
|
341
349
|
previewType: "subGroup",
|
342
350
|
group: group
|
@@ -1,10 +1,12 @@
|
|
1
1
|
export default ConditionPreview;
|
2
|
-
declare function ConditionPreview({ previewType, group }: {
|
2
|
+
declare function ConditionPreview({ previewType, group, colorIndex }: {
|
3
3
|
previewType: any;
|
4
4
|
group: any;
|
5
|
+
colorIndex: any;
|
5
6
|
}): import("react/jsx-runtime").JSX.Element;
|
6
7
|
declare namespace ConditionPreview {
|
7
8
|
namespace propTypes {
|
9
|
+
let colorIndex: PropTypes.Requireable<number>;
|
8
10
|
let group: PropTypes.Requireable<object>;
|
9
11
|
let previewType: PropTypes.Requireable<string>;
|
10
12
|
}
|
@@ -27,7 +27,8 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
27
27
|
var ConditionPreview = function ConditionPreview(_ref) {
|
28
28
|
var _ConditionBuilderItem, _ConditionBuilderItem2, _ConditionBuilderItem3;
|
29
29
|
var previewType = _ref.previewType,
|
30
|
-
group = _ref.group
|
30
|
+
group = _ref.group,
|
31
|
+
colorIndex = _ref.colorIndex;
|
31
32
|
var _useState = React.useState(false),
|
32
33
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
33
34
|
animate = _useState2[0],
|
@@ -59,6 +60,7 @@ var ConditionPreview = function ConditionPreview(_ref) {
|
|
59
60
|
className: "".concat(DataConfigs.blockClass, "__statement-button"),
|
60
61
|
label: group.groupOperator
|
61
62
|
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
63
|
+
"data-color-index": colorIndex,
|
62
64
|
"aria-hidden": true,
|
63
65
|
className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group ").concat(DataConfigs.blockClass, "__condition-wrapper ").concat(DataConfigs.blockClass, "__group-preview ").concat(DataConfigs.blockClass, "__group-wrapper "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
|
64
66
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
@@ -67,7 +69,7 @@ var ConditionPreview = function ConditionPreview(_ref) {
|
|
67
69
|
className: "".concat(DataConfigs.blockClass, "__statement-button"),
|
68
70
|
label: ifText
|
69
71
|
})), getConditionSection())), previewType == 'subGroup' && /*#__PURE__*/React__default["default"].createElement("div", {
|
70
|
-
className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
|
72
|
+
className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview ").concat(DataConfigs.blockClass, "__gap-bottom"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
|
71
73
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
72
74
|
className: "".concat(DataConfigs.blockClass, "__condition-block ").concat(DataConfigs.blockClass, "__gap")
|
73
75
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
@@ -80,7 +82,7 @@ var ConditionPreview = function ConditionPreview(_ref) {
|
|
80
82
|
className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__groupConnector"),
|
81
83
|
operator: ifText
|
82
84
|
}), getConditionSection()))), previewType == 'condition' && /*#__PURE__*/React__default["default"].createElement("div", {
|
83
|
-
className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
|
85
|
+
className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview ").concat(DataConfigs.blockClass, "__gap-bottom"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
|
84
86
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
85
87
|
className: "".concat(DataConfigs.blockClass, "__condition-block ").concat(DataConfigs.blockClass, "__gap")
|
86
88
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
@@ -91,6 +93,10 @@ var ConditionPreview = function ConditionPreview(_ref) {
|
|
91
93
|
};
|
92
94
|
var ConditionPreview$1 = ConditionPreview;
|
93
95
|
ConditionPreview.propTypes = {
|
96
|
+
/**
|
97
|
+
* index of the color for next group
|
98
|
+
*/
|
99
|
+
colorIndex: index["default"].number,
|
94
100
|
/**
|
95
101
|
* current conditional group
|
96
102
|
*/
|
@@ -39,12 +39,18 @@ var handleKeyPressForPopover = function handleKeyPressForPopover(evt, parentCont
|
|
39
39
|
var allItems = [];
|
40
40
|
switch (key) {
|
41
41
|
case 'ArrowUp':
|
42
|
+
evt.preventDefault();
|
42
43
|
//traverse through the popover options, search box, selectAll button
|
43
44
|
parentContainer.querySelectorAll("[role=\"option\"]").forEach(function (eachElem, index, allElements) {
|
44
45
|
util.traverseReverse(eachElem, index, allElements, null, null, conditionBuilderRef);
|
45
46
|
});
|
47
|
+
//scroll to top when we reach a the top of the list to make search box visible
|
48
|
+
if (Array.from(evt.target.closest('ul').querySelectorAll('li')).indexOf(evt.target) === 1) {
|
49
|
+
parentContainer.querySelector(".".concat(DataConfigs.blockClass, "__popover-content-wrapper")).scrollTop = 0;
|
50
|
+
}
|
46
51
|
break;
|
47
52
|
case 'ArrowDown':
|
53
|
+
evt.preventDefault();
|
48
54
|
//traverse through the popover options, search box, selectAll button
|
49
55
|
parentContainer.querySelectorAll("[role=\"option\"]").forEach(function (eachElem, index, allElements) {
|
50
56
|
util.traverseClockVise(eachElem, index, allElements, null, null, conditionBuilderRef);
|
@@ -72,12 +78,19 @@ var handleKeyPressForPopover = function handleKeyPressForPopover(evt, parentCont
|
|
72
78
|
}
|
73
79
|
break;
|
74
80
|
case 'Enter':
|
75
|
-
if (isMultiSelect
|
81
|
+
if (isMultiSelect === 'true') {
|
76
82
|
if (document.activeElement.type !== 'button') {
|
77
83
|
var _document$activeEleme2;
|
84
|
+
//for button , enter key is click which already handled by framework, for other elements trigger click
|
85
|
+
(_document$activeEleme2 = document.activeElement) === null || _document$activeEleme2 === void 0 || _document$activeEleme2.click();
|
86
|
+
}
|
87
|
+
evt.preventDefault();
|
88
|
+
} else {
|
89
|
+
if (document.activeElement.type !== 'button') {
|
90
|
+
var _document$activeEleme3;
|
78
91
|
//for button , enter key is click which already handled by framework, else trigger click
|
79
92
|
util.focusThisField(evt, conditionBuilderRef);
|
80
|
-
(_document$
|
93
|
+
(_document$activeEleme3 = document.activeElement) === null || _document$activeEleme3 === void 0 || _document$activeEleme3.click();
|
81
94
|
}
|
82
95
|
}
|
83
96
|
break;
|
@@ -88,7 +101,7 @@ var handleKeyPressForPopover = function handleKeyPressForPopover(evt, parentCont
|
|
88
101
|
}
|
89
102
|
};
|
90
103
|
var handleKeyPressForMainContent = function handleKeyPressForMainContent(evt, conditionBuilderRef, variant) {
|
91
|
-
var _document$
|
104
|
+
var _document$activeEleme4;
|
92
105
|
switch (evt.key) {
|
93
106
|
case 'ArrowRight':
|
94
107
|
evt.preventDefault();
|
@@ -148,9 +161,9 @@ var handleKeyPressForMainContent = function handleKeyPressForMainContent(evt, co
|
|
148
161
|
}
|
149
162
|
break;
|
150
163
|
case 'Enter':
|
151
|
-
if (((_document$
|
152
|
-
var _document$
|
153
|
-
(_document$
|
164
|
+
if (((_document$activeEleme4 = document.activeElement) === null || _document$activeEleme4 === void 0 || (_document$activeEleme4 = _document$activeEleme4.querySelectorAll("button")) === null || _document$activeEleme4 === void 0 ? void 0 : _document$activeEleme4.length) === 1) {
|
165
|
+
var _document$activeEleme5;
|
166
|
+
(_document$activeEleme5 = document.activeElement) === null || _document$activeEleme5 === void 0 || (_document$activeEleme5 = _document$activeEleme5.querySelectorAll("button")[0]) === null || _document$activeEleme5 === void 0 || _document$activeEleme5.click();
|
154
167
|
}
|
155
168
|
break;
|
156
169
|
}
|
@@ -1,9 +1,76 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2021
|
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, { ReactNode } from 'react';
|
9
|
+
import '../../global/js/utils/props-helper';
|
10
|
+
import { ButtonProps } from '@carbon/react';
|
11
|
+
import { CarbonIconType } from '@carbon/icons-react/lib/CarbonIcon';
|
12
|
+
declare enum sizes {
|
13
|
+
lg = "lg",
|
14
|
+
sm = "sm"
|
15
|
+
}
|
16
|
+
export declare const defaults: {
|
17
|
+
position: string;
|
18
|
+
size: sizes;
|
19
|
+
};
|
20
|
+
interface EmptyStateProps {
|
21
|
+
/**
|
22
|
+
* Empty state action button
|
23
|
+
*/
|
24
|
+
action?: {
|
25
|
+
kind?: 'primary' | 'secondary' | 'tertiary';
|
26
|
+
renderIcon?: CarbonIconType;
|
27
|
+
onClick?: ButtonProps['onClick'];
|
28
|
+
text?: string;
|
29
|
+
};
|
30
|
+
/**
|
31
|
+
* Provide an optional class to be applied to the containing node.
|
32
|
+
*/
|
33
|
+
className?: string;
|
34
|
+
/**
|
35
|
+
* Empty state illustration, specify the `src` for a provided illustration to be displayed. In the case of requiring a light and dark illustration of your own, simply pass the corresponding illustration based on the current theme of your application.
|
36
|
+
* For example: `illustration={appTheme === 'dark' ? darkIllustration : lightIllustration}`
|
37
|
+
*/
|
38
|
+
illustration?: string;
|
39
|
+
/**
|
40
|
+
* The alt text for empty state svg images. If not provided , title will be used.
|
41
|
+
*/
|
42
|
+
illustrationDescription?: string;
|
43
|
+
/**
|
44
|
+
* Designates the position of the illustration relative to the content
|
45
|
+
*/
|
46
|
+
illustrationPosition?: 'top' | 'right' | 'bottom' | 'left';
|
47
|
+
/**
|
48
|
+
* Empty state link object
|
49
|
+
*/
|
50
|
+
link?: {
|
51
|
+
text?: string | ReactNode;
|
52
|
+
href?: string;
|
53
|
+
};
|
54
|
+
/**
|
55
|
+
* Empty state size
|
56
|
+
*/
|
57
|
+
size?: 'lg' | 'sm';
|
58
|
+
/**
|
59
|
+
* Empty state subtitle
|
60
|
+
*/
|
61
|
+
subtitle?: string | ReactNode;
|
62
|
+
/**
|
63
|
+
* Empty state title
|
64
|
+
*/
|
65
|
+
title: string | ReactNode;
|
66
|
+
/**
|
67
|
+
* Designates which version of the EmptyState component is being used.
|
68
|
+
* Refer to V2 documentation separately.
|
69
|
+
*/
|
70
|
+
v2?: boolean;
|
4
71
|
}
|
5
72
|
/**
|
6
73
|
* The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
|
7
74
|
*/
|
8
|
-
export let EmptyState: React.ForwardRefExoticComponent<React.RefAttributes<
|
9
|
-
|
75
|
+
export declare let EmptyState: React.ForwardRefExoticComponent<EmptyStateProps & React.RefAttributes<HTMLDivElement>>;
|
76
|
+
export {};
|
@@ -31,13 +31,15 @@ var _excluded = ["v2"],
|
|
31
31
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
32
32
|
var blockClass = "".concat(settings.pkg.prefix, "--empty-state");
|
33
33
|
var componentName = 'EmptyState';
|
34
|
-
|
35
|
-
|
34
|
+
var sizes = /*#__PURE__*/function (sizes) {
|
35
|
+
sizes["lg"] = "lg";
|
36
|
+
sizes["sm"] = "sm";
|
37
|
+
return sizes;
|
38
|
+
}(sizes || {}); // Default values for props
|
36
39
|
var defaults = {
|
37
40
|
position: 'top',
|
38
|
-
size:
|
41
|
+
size: sizes.lg
|
39
42
|
};
|
40
|
-
|
41
43
|
/**
|
42
44
|
* The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
|
43
45
|
*/
|
@@ -73,7 +75,7 @@ exports.EmptyState = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
73
75
|
link: link,
|
74
76
|
size: size,
|
75
77
|
subtitle: subtitle,
|
76
|
-
title: title
|
78
|
+
title: title !== null && title !== void 0 ? title : ''
|
77
79
|
}));
|
78
80
|
});
|
79
81
|
|
@@ -101,6 +103,7 @@ exports.EmptyState.propTypes = {
|
|
101
103
|
/**
|
102
104
|
* The alt text for custom provided illustrations
|
103
105
|
*/
|
106
|
+
/**@ts-ignore*/
|
104
107
|
illustrationDescription: index["default"].string.isRequired.if(function (_ref2) {
|
105
108
|
var illustration = _ref2.illustration;
|
106
109
|
return illustration;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright IBM Corp. 2023,
|
2
|
+
* Copyright IBM Corp. 2023, 2024
|
3
3
|
*
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
@@ -44,7 +44,7 @@ interface EmptyStateV2Props {
|
|
44
44
|
* Props for the link. Refer to the Carbon Components link documentation for full list of props.
|
45
45
|
*/
|
46
46
|
link?: {
|
47
|
-
text?: string;
|
47
|
+
text?: string | ReactNode;
|
48
48
|
};
|
49
49
|
/**
|
50
50
|
* Empty state size
|
@@ -116,7 +116,7 @@ exports.EmptyStateV2.propTypes = {
|
|
116
116
|
*/
|
117
117
|
/**@ts-ignore*/
|
118
118
|
link: index["default"].shape({
|
119
|
-
text: index["default"].string
|
119
|
+
text: index["default"].oneOfType([index["default"].string, index["default"].node])
|
120
120
|
}),
|
121
121
|
/**
|
122
122
|
* Empty state size
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@carbon/ibm-products",
|
3
3
|
"description": "Carbon for IBM Products",
|
4
|
-
"version": "2.43.2-canary.
|
4
|
+
"version": "2.43.2-canary.104+5c1e5682a",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -96,7 +96,7 @@
|
|
96
96
|
"dependencies": {
|
97
97
|
"@babel/runtime": "^7.23.9",
|
98
98
|
"@carbon/feature-flags": "^0.20.0",
|
99
|
-
"@carbon/ibm-products-styles": "^2.
|
99
|
+
"@carbon/ibm-products-styles": "^2.39.1-canary.114+5c1e5682a",
|
100
100
|
"@carbon/telemetry": "^0.1.0",
|
101
101
|
"@dnd-kit/core": "^6.0.8",
|
102
102
|
"@dnd-kit/modifiers": "^7.0.0",
|
@@ -120,5 +120,5 @@
|
|
120
120
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0",
|
121
121
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
|
122
122
|
},
|
123
|
-
"gitHead": "
|
123
|
+
"gitHead": "5c1e5682a1d849f809f252555001adadef3c2800"
|
124
124
|
}
|
@@ -36,6 +36,15 @@ $block-class: #{c4p-settings.$pkg-prefix}--condition-builder;
|
|
36
36
|
background-color: $tag-background-red;
|
37
37
|
color: $tag-color-red;
|
38
38
|
}
|
39
|
+
.#{$block-class}__subgroup_deletionPreview {
|
40
|
+
.#{$block-class}__group {
|
41
|
+
/* stylelint-disable max-nesting-depth */
|
42
|
+
button {
|
43
|
+
background-color: $tag-background-red;
|
44
|
+
color: $tag-color-red;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
39
48
|
|
40
49
|
.#{$block-class}__condition__deletion-preview
|
41
50
|
.#{$block-class}__button:not(
|
@@ -63,6 +72,7 @@ $block-class: #{c4p-settings.$pkg-prefix}--condition-builder;
|
|
63
72
|
}
|
64
73
|
.#{$block-class}__group-preview-animate {
|
65
74
|
height: auto;
|
75
|
+
color: $text-secondary;
|
66
76
|
opacity: 0.5;
|
67
77
|
pointer-events: none;
|
68
78
|
transition: all $duration-moderate-02 motion(exit, expressive);
|
@@ -70,10 +80,9 @@ $block-class: #{c4p-settings.$pkg-prefix}--condition-builder;
|
|
70
80
|
.#{$block-class}__connector--disabled {
|
71
81
|
display: flex;
|
72
82
|
min-width: $spacing-10;
|
73
|
-
align-items: center;
|
74
83
|
background-color: $layer;
|
75
84
|
color: $text-helper;
|
76
|
-
|
85
|
+
pointer-events: none;
|
77
86
|
}
|
78
87
|
.#{$block-class}__condition-wrapper
|
79
88
|
> .#{$block-class}__condition-block:last-child
|