@carbon/ibm-products 2.54.0-canary.65 → 2.54.0-canary.68
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/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +9 -5
- package/es/components/TagOverflow/TagOverflow.js +2 -5
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +9 -5
- package/lib/components/TagOverflow/TagOverflow.js +1 -4
- package/package.json +2 -2
@@ -72,8 +72,7 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
72
72
|
}, [actionState]);
|
73
73
|
useEffect(function () {
|
74
74
|
if (initialState !== null && initialState !== void 0 && initialState.enabledDefault) {
|
75
|
-
setRootState === null || setRootState === void 0 || setRootState(
|
76
|
-
initialConditionState.current = null;
|
75
|
+
setRootState === null || setRootState === void 0 || setRootState(initialState.state);
|
77
76
|
}
|
78
77
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
79
78
|
}, [initialState]);
|
@@ -92,11 +91,16 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
92
91
|
};
|
93
92
|
var _onRemove = useCallback(function (groupId) {
|
94
93
|
var _rootState$groups2;
|
94
|
+
var groups = rootState === null || rootState === void 0 || (_rootState$groups2 = rootState.groups) === null || _rootState$groups2 === void 0 ? void 0 : _rootState$groups2.filter(function (group) {
|
95
|
+
return groupId !== (group === null || group === void 0 ? void 0 : group.id);
|
96
|
+
});
|
95
97
|
setRootState === null || setRootState === void 0 || setRootState(_objectSpread2(_objectSpread2({}, rootState), {}, {
|
96
|
-
groups: rootState ?
|
97
|
-
return groupId !== (group === null || group === void 0 ? void 0 : group.id);
|
98
|
-
}) : []
|
98
|
+
groups: rootState ? groups : []
|
99
99
|
}));
|
100
|
+
//set the initial state to empty.
|
101
|
+
if ((groups === null || groups === void 0 ? void 0 : groups.length) === 0) {
|
102
|
+
initialConditionState.current = null;
|
103
|
+
}
|
100
104
|
}, [setRootState, rootState]);
|
101
105
|
var onChangeHandler = function onChangeHandler(updatedGroup, groupIndex) {
|
102
106
|
/**
|
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import React__default, { forwardRef, useRef, useState, useCallback, useEffect, createElement } from 'react';
|
10
|
-
import {
|
10
|
+
import { DismissibleTag, Tag } from '@carbon/react';
|
11
11
|
import PropTypes from '../../_virtual/index.js';
|
12
12
|
import { TYPES } from './constants.js';
|
13
13
|
import { TagOverflowModal } from './TagOverflowModal.js';
|
@@ -189,9 +189,6 @@ var TagOverflow = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
189
189
|
return itemRefHandler(id, node);
|
190
190
|
},
|
191
191
|
key: id
|
192
|
-
}, /*#__PURE__*/React__default.createElement(Tooltip, {
|
193
|
-
align: overflowAlign,
|
194
|
-
label: label
|
195
192
|
}, typeof _onClose === 'function' || filter ? /*#__PURE__*/React__default.createElement(DismissibleTag, _extends({}, other, {
|
196
193
|
className: "".concat(blockClass, "__item--tag"),
|
197
194
|
type: tagType,
|
@@ -202,7 +199,7 @@ var TagOverflow = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
202
199
|
})) : /*#__PURE__*/React__default.createElement(Tag, _extends({}, other, {
|
203
200
|
className: "".concat(blockClass, "__item--tag"),
|
204
201
|
type: tagType
|
205
|
-
}), label))
|
202
|
+
}), label));
|
206
203
|
}
|
207
204
|
}), /*#__PURE__*/React__default.createElement("span", {
|
208
205
|
className: "".concat(blockClass, "__indicator"),
|
@@ -76,8 +76,7 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
76
76
|
}, [actionState]);
|
77
77
|
React.useEffect(function () {
|
78
78
|
if (initialState !== null && initialState !== void 0 && initialState.enabledDefault) {
|
79
|
-
setRootState === null || setRootState === void 0 || setRootState(
|
80
|
-
initialConditionState.current = null;
|
79
|
+
setRootState === null || setRootState === void 0 || setRootState(initialState.state);
|
81
80
|
}
|
82
81
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
83
82
|
}, [initialState]);
|
@@ -96,11 +95,16 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
96
95
|
};
|
97
96
|
var _onRemove = React.useCallback(function (groupId) {
|
98
97
|
var _rootState$groups2;
|
98
|
+
var groups = rootState === null || rootState === void 0 || (_rootState$groups2 = rootState.groups) === null || _rootState$groups2 === void 0 ? void 0 : _rootState$groups2.filter(function (group) {
|
99
|
+
return groupId !== (group === null || group === void 0 ? void 0 : group.id);
|
100
|
+
});
|
99
101
|
setRootState === null || setRootState === void 0 || setRootState(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, rootState), {}, {
|
100
|
-
groups: rootState ?
|
101
|
-
return groupId !== (group === null || group === void 0 ? void 0 : group.id);
|
102
|
-
}) : []
|
102
|
+
groups: rootState ? groups : []
|
103
103
|
}));
|
104
|
+
//set the initial state to empty.
|
105
|
+
if ((groups === null || groups === void 0 ? void 0 : groups.length) === 0) {
|
106
|
+
initialConditionState.current = null;
|
107
|
+
}
|
104
108
|
}, [setRootState, rootState]);
|
105
109
|
var onChangeHandler = function onChangeHandler(updatedGroup, groupIndex) {
|
106
110
|
/**
|
@@ -191,9 +191,6 @@ exports.TagOverflow = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
191
191
|
return itemRefHandler(id, node);
|
192
192
|
},
|
193
193
|
key: id
|
194
|
-
}, /*#__PURE__*/React.createElement(react.Tooltip, {
|
195
|
-
align: overflowAlign,
|
196
|
-
label: label
|
197
194
|
}, typeof _onClose === 'function' || filter ? /*#__PURE__*/React.createElement(react.DismissibleTag, _rollupPluginBabelHelpers.extends({}, other, {
|
198
195
|
className: "".concat(blockClass, "__item--tag"),
|
199
196
|
type: tagType,
|
@@ -204,7 +201,7 @@ exports.TagOverflow = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
204
201
|
})) : /*#__PURE__*/React.createElement(react.Tag, _rollupPluginBabelHelpers.extends({}, other, {
|
205
202
|
className: "".concat(blockClass, "__item--tag"),
|
206
203
|
type: tagType
|
207
|
-
}), label))
|
204
|
+
}), label));
|
208
205
|
}
|
209
206
|
}), /*#__PURE__*/React.createElement("span", {
|
210
207
|
className: "".concat(blockClass, "__indicator"),
|
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.54.0-canary.
|
4
|
+
"version": "2.54.0-canary.68+ea0989ae2",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -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": "ea0989ae23b6a23450491c4994bf4e46687dbeb2"
|
124
124
|
}
|