@carbon/ibm-products 2.43.2-canary.96 → 2.43.2-canary.99
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 +0 -4
- 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 +0 -4
- 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 +0 -4
- 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 +0 -4
- 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/TagOverflow/TagOverflow.d.ts +35 -4
- package/es/components/TagOverflow/TagOverflow.js +47 -64
- package/es/components/TagOverflow/TagOverflowModal.js +4 -6
- package/es/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
- package/es/components/TagOverflow/TagOverflowPopover.js +38 -41
- package/lib/components/TagOverflow/TagOverflow.d.ts +35 -4
- package/lib/components/TagOverflow/TagOverflow.js +46 -63
- package/lib/components/TagOverflow/TagOverflowModal.js +4 -6
- package/lib/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
- package/lib/components/TagOverflow/TagOverflowPopover.js +37 -40
- package/package.json +2 -2
- package/scss/components/CreateModal/_create-modal.scss +0 -4
@@ -27,52 +27,36 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
27
27
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
28
28
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
29
29
|
|
30
|
-
var _excluded = ["
|
30
|
+
var _excluded = ["align", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "allTagsModalTarget", "allTagsModalTitle", "className", "containingElementRef", "items", "maxVisible", "measurementOffset", "multiline", "overflowAlign", "overflowClassName", "overflowType", "onOverflowTagChange", "showAllTagsLabel", "tagComponent"],
|
31
31
|
_excluded2 = ["className", "id"],
|
32
32
|
_excluded3 = ["tagType"],
|
33
33
|
_excluded4 = ["id", "label", "tagType", "onClose"];
|
34
34
|
var blockClass = "".concat(settings.pkg.prefix, "--tag-overflow");
|
35
35
|
var componentName = 'TagOverflow';
|
36
36
|
var allTagsModalSearchThreshold = 10;
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
showAllTagsLabel =
|
58
|
-
|
59
|
-
|
60
|
-
allTagsModalTarget = _ref.allTagsModalTarget,
|
61
|
-
allTagsModalTitle = _ref.allTagsModalTitle,
|
62
|
-
className = _ref.className,
|
63
|
-
containingElementRef = _ref.containingElementRef,
|
64
|
-
_ref$measurementOffse = _ref.measurementOffset,
|
65
|
-
measurementOffset = _ref$measurementOffse === void 0 ? defaults.measurementOffset : _ref$measurementOffse,
|
66
|
-
maxVisible = _ref.maxVisible,
|
67
|
-
multiline = _ref.multiline,
|
68
|
-
_ref$overflowAlign = _ref.overflowAlign,
|
69
|
-
overflowAlign = _ref$overflowAlign === void 0 ? defaults.overflowAlign : _ref$overflowAlign,
|
70
|
-
overflowClassName = _ref.overflowClassName,
|
71
|
-
_ref$overflowType = _ref.overflowType,
|
72
|
-
overflowType = _ref$overflowType === void 0 ? defaults.overflowType : _ref$overflowType,
|
73
|
-
_ref$onOverflowTagCha = _ref.onOverflowTagChange,
|
74
|
-
onOverflowTagChange = _ref$onOverflowTagCha === void 0 ? defaults.onOverflowTagChange : _ref$onOverflowTagCha,
|
75
|
-
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
37
|
+
exports.TagOverflow = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
38
|
+
var _props$align = props.align,
|
39
|
+
align = _props$align === void 0 ? 'start' : _props$align,
|
40
|
+
allTagsModalSearchLabel = props.allTagsModalSearchLabel,
|
41
|
+
allTagsModalSearchPlaceholderText = props.allTagsModalSearchPlaceholderText,
|
42
|
+
allTagsModalTarget = props.allTagsModalTarget,
|
43
|
+
allTagsModalTitle = props.allTagsModalTitle,
|
44
|
+
className = props.className,
|
45
|
+
containingElementRef = props.containingElementRef,
|
46
|
+
items = props.items,
|
47
|
+
maxVisible = props.maxVisible,
|
48
|
+
_props$measurementOff = props.measurementOffset,
|
49
|
+
measurementOffset = _props$measurementOff === void 0 ? 0 : _props$measurementOff,
|
50
|
+
multiline = props.multiline,
|
51
|
+
_props$overflowAlign = props.overflowAlign,
|
52
|
+
overflowAlign = _props$overflowAlign === void 0 ? 'bottom' : _props$overflowAlign,
|
53
|
+
overflowClassName = props.overflowClassName,
|
54
|
+
_props$overflowType = props.overflowType,
|
55
|
+
overflowType = _props$overflowType === void 0 ? 'default' : _props$overflowType,
|
56
|
+
onOverflowTagChange = props.onOverflowTagChange,
|
57
|
+
showAllTagsLabel = props.showAllTagsLabel,
|
58
|
+
tagComponent = props.tagComponent,
|
59
|
+
rest = _rollupPluginBabelHelpers.objectWithoutProperties(props, _excluded);
|
76
60
|
var localContainerRef = React.useRef(null);
|
77
61
|
var containerRef = ref || localContainerRef;
|
78
62
|
var itemRefs = React.useRef(null);
|
@@ -109,7 +93,9 @@ exports.TagOverflow = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
109
93
|
setShowAllModalOpen(false);
|
110
94
|
};
|
111
95
|
var handleResize = function handleResize() {
|
112
|
-
|
96
|
+
if (typeof resizeElm !== 'function' && resizeElm.current) {
|
97
|
+
setContainerWidth(resizeElm.current.offsetWidth);
|
98
|
+
}
|
113
99
|
};
|
114
100
|
useResizeObserver.useResizeObserver(resizeElm, handleResize);
|
115
101
|
var getMap = function getMap() {
|
@@ -125,7 +111,6 @@ exports.TagOverflow = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
125
111
|
}
|
126
112
|
};
|
127
113
|
var getVisibleItems = React.useCallback(function () {
|
128
|
-
var _overflowRef$current;
|
129
114
|
if (!itemRefs.current) {
|
130
115
|
return items;
|
131
116
|
}
|
@@ -137,13 +122,13 @@ exports.TagOverflow = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
137
122
|
var optionalContainingElement = containingElementRef === null || containingElementRef === void 0 ? void 0 : containingElementRef.current;
|
138
123
|
var measurementOffsetValue = typeof measurementOffset === 'number' ? measurementOffset : 0;
|
139
124
|
var spaceAvailable = optionalContainingElement ? optionalContainingElement.offsetWidth - measurementOffsetValue : containerWidth;
|
140
|
-
var overflowContainerWidth =
|
125
|
+
var overflowContainerWidth = overflowRef && overflowRef.current && overflowRef.current.offsetWidth > overflowIndicatorWidth ? overflowRef.current.offsetWidth : overflowIndicatorWidth;
|
141
126
|
var maxWidth = spaceAvailable - overflowContainerWidth;
|
142
127
|
var childrenWidth = 0;
|
143
128
|
var maxReached = false;
|
144
129
|
return items.reduce(function (prev, cur) {
|
145
130
|
if (!maxReached) {
|
146
|
-
var itemWidth = map.get(cur.id) + itemOffset;
|
131
|
+
var itemWidth = (map ? Number(map.get(cur.id)) : 0) + itemOffset;
|
147
132
|
var fits = itemWidth + childrenWidth < maxWidth;
|
148
133
|
if (fits) {
|
149
134
|
childrenWidth += itemWidth;
|
@@ -154,12 +139,13 @@ exports.TagOverflow = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
154
139
|
}
|
155
140
|
return prev;
|
156
141
|
}, []);
|
157
|
-
}, [
|
158
|
-
var getCustomComponent = function getCustomComponent(item) {
|
142
|
+
}, [containerWidth, containingElementRef, items, maxVisible, measurementOffset, multiline]);
|
143
|
+
var getCustomComponent = function getCustomComponent(item, tagComponent) {
|
159
144
|
var className = item.className,
|
160
145
|
id = item.id,
|
161
146
|
other = _rollupPluginBabelHelpers.objectWithoutProperties(item, _excluded2);
|
162
|
-
return /*#__PURE__*/
|
147
|
+
return /*#__PURE__*/React.createElement(tagComponent, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, other), {}, {
|
148
|
+
key: id,
|
163
149
|
className: cx__default["default"]("".concat(blockClass, "__item"), className),
|
164
150
|
ref: function ref(node) {
|
165
151
|
return itemRefHandler(id, node);
|
@@ -173,9 +159,9 @@ exports.TagOverflow = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
173
159
|
visibleItemsArr = (_visibleItemsArr = visibleItemsArr) === null || _visibleItemsArr === void 0 ? void 0 : _visibleItemsArr.slice(0, maxVisible);
|
174
160
|
}
|
175
161
|
var hiddenItems = items === null || items === void 0 ? void 0 : items.slice(visibleItemsArr.length);
|
176
|
-
var overflowItemsArr = hiddenItems === null || hiddenItems === void 0 ? void 0 : hiddenItems.map(function (
|
177
|
-
var tagType =
|
178
|
-
other = _rollupPluginBabelHelpers.objectWithoutProperties(
|
162
|
+
var overflowItemsArr = hiddenItems === null || hiddenItems === void 0 ? void 0 : hiddenItems.map(function (_ref) {
|
163
|
+
var tagType = _ref.tagType,
|
164
|
+
other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded3);
|
179
165
|
return _rollupPluginBabelHelpers.objectSpread2({
|
180
166
|
type: tagType
|
181
167
|
}, other);
|
@@ -183,10 +169,10 @@ exports.TagOverflow = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
183
169
|
setVisibleItems(visibleItemsArr);
|
184
170
|
setOverflowItems(overflowItemsArr);
|
185
171
|
onOverflowTagChange === null || onOverflowTagChange === void 0 || onOverflowTagChange(overflowItemsArr);
|
186
|
-
}, [
|
172
|
+
}, [getVisibleItems, items, maxVisible, onOverflowTagChange]);
|
187
173
|
var handleTagOnClose = React.useCallback(function (onClose, index) {
|
188
174
|
onClose === null || onClose === void 0 || onClose();
|
189
|
-
if (index <= visibleItems.length - 1) {
|
175
|
+
if (index <= (visibleItems === null || visibleItems === void 0 ? void 0 : visibleItems.length) - 1) {
|
190
176
|
setPopoverOpen(false);
|
191
177
|
}
|
192
178
|
}, [visibleItems]);
|
@@ -194,10 +180,10 @@ exports.TagOverflow = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
194
180
|
className: cx__default["default"](blockClass, className, "".concat(blockClass, "--align-").concat(align), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "--multiline"), multiline)),
|
195
181
|
ref: containerRef,
|
196
182
|
role: "main"
|
197
|
-
}, devtools.getDevtoolsProps(componentName)), visibleItems.length > 0 && visibleItems.map(function (item, index) {
|
183
|
+
}, devtools.getDevtoolsProps(componentName)), (visibleItems === null || visibleItems === void 0 ? void 0 : visibleItems.length) > 0 && visibleItems.map(function (item, index) {
|
198
184
|
// Render custom components
|
199
185
|
if (tagComponent) {
|
200
|
-
return getCustomComponent(item);
|
186
|
+
return getCustomComponent(item, tagComponent);
|
201
187
|
} else {
|
202
188
|
var id = item.id,
|
203
189
|
label = item.label,
|
@@ -224,7 +210,7 @@ exports.TagOverflow = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
224
210
|
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
225
211
|
className: "".concat(blockClass, "__indicator"),
|
226
212
|
ref: overflowRef
|
227
|
-
}, overflowItems.length > 0 && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(TagOverflowPopover.TagOverflowPopover, {
|
213
|
+
}, (overflowItems === null || overflowItems === void 0 ? void 0 : overflowItems.length) > 0 && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(TagOverflowPopover.TagOverflowPopover, {
|
228
214
|
allTagsModalSearchThreshold: allTagsModalSearchThreshold,
|
229
215
|
className: overflowClassName,
|
230
216
|
onShowAllClick: handleShowAllClick,
|
@@ -260,9 +246,9 @@ var tagTypes = Object.keys(constants.TYPES);
|
|
260
246
|
* The strings shown in the showAllModal are only shown if we have more than allTagsModalSearchLThreshold
|
261
247
|
* @returns null if no problems
|
262
248
|
*/
|
263
|
-
var string_required_if_more_than_10_tags = propsHelper.isRequiredIf(index["default"].string, function (
|
264
|
-
var items =
|
265
|
-
return items
|
249
|
+
var string_required_if_more_than_10_tags = propsHelper.isRequiredIf(index["default"].string, function (_ref2) {
|
250
|
+
var items = _ref2.items;
|
251
|
+
return (items === null || items === void 0 ? void 0 : items.length) > allTagsModalSearchThreshold;
|
266
252
|
});
|
267
253
|
|
268
254
|
// The types and DocGen commentary for the component props,
|
@@ -293,11 +279,6 @@ exports.TagOverflow.propTypes = {
|
|
293
279
|
* Provide an optional class to be applied to the containing node.
|
294
280
|
*/
|
295
281
|
className: index["default"].string,
|
296
|
-
/**
|
297
|
-
* Optional ref for custom resize container to measure available space
|
298
|
-
* Default will measure the available space of the TagSet container itself.
|
299
|
-
*/
|
300
|
-
containingElementRef: index["default"].object,
|
301
282
|
/**
|
302
283
|
* The items to be shown in the TagOverflow. Each item is specified as an object with properties:
|
303
284
|
* **label**\* (required) to supply the content,
|
@@ -308,6 +289,7 @@ exports.TagOverflow.propTypes = {
|
|
308
289
|
* If you want to render a custom component, pass it as tagComponent prop and
|
309
290
|
* then pass the props required for your custom component as the properties of item object
|
310
291
|
*/
|
292
|
+
//@ts-ignore
|
311
293
|
items: index["default"].arrayOf(index["default"].shape({
|
312
294
|
id: index["default"].string.isRequired,
|
313
295
|
label: index["default"].string.isRequired,
|
@@ -351,6 +333,7 @@ exports.TagOverflow.propTypes = {
|
|
351
333
|
/** Component definition of the items to be rendered inside TagOverflow.
|
352
334
|
* If this is not passed, items will be rendered as Tag component
|
353
335
|
*/
|
336
|
+
//@ts-ignore
|
354
337
|
tagComponent: index["default"].elementType
|
355
338
|
};
|
356
339
|
|
@@ -23,8 +23,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
23
23
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
24
24
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
25
25
|
|
26
|
-
var _excluded = ["allTags", "className", "title", "onClose", "open", "overflowType", "portalTarget", "searchLabel", "searchPlaceholder"]
|
27
|
-
_excluded2 = ["label", "id", "filter"];
|
26
|
+
var _excluded = ["allTags", "className", "title", "onClose", "open", "overflowType", "portalTarget", "searchLabel", "searchPlaceholder"];
|
28
27
|
var componentName = 'TagOverflowModal';
|
29
28
|
var blockClass = "".concat(settings.pkg.prefix, "--tag-overflow-modal");
|
30
29
|
|
@@ -86,13 +85,12 @@ var TagOverflowModal = function TagOverflowModal(_ref) {
|
|
86
85
|
}, getFilteredItems().map(function (_ref2) {
|
87
86
|
var label = _ref2.label,
|
88
87
|
id = _ref2.id,
|
89
|
-
filter = _ref2.filter
|
90
|
-
other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref2, _excluded2);
|
88
|
+
filter = _ref2.filter;
|
91
89
|
var isFilterable = overflowType === 'tag' ? filter : false;
|
92
|
-
return /*#__PURE__*/React__default["default"].createElement(react.Tag,
|
90
|
+
return /*#__PURE__*/React__default["default"].createElement(react.Tag, {
|
93
91
|
key: id,
|
94
92
|
filter: isFilterable
|
95
|
-
}
|
93
|
+
}, label);
|
96
94
|
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
97
95
|
className: "".concat(blockClass, "__fade")
|
98
96
|
})));
|
@@ -1,2 +1,14 @@
|
|
1
|
-
export const TagOverflowPopover: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
2
1
|
import React from 'react';
|
2
|
+
import { TagOverflowItem } from './TagOverflow';
|
3
|
+
export interface Props {
|
4
|
+
allTagsModalSearchThreshold?: number;
|
5
|
+
className?: string;
|
6
|
+
onShowAllClick: () => void;
|
7
|
+
overflowAlign?: string;
|
8
|
+
overflowTags: TagOverflowItem[];
|
9
|
+
overflowType?: string;
|
10
|
+
popoverOpen?: boolean;
|
11
|
+
setPopoverOpen?: (x: boolean) => void;
|
12
|
+
showAllTagsLabel?: string;
|
13
|
+
}
|
14
|
+
export declare const TagOverflowPopover: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
@@ -26,52 +26,48 @@ var _excluded = ["allTagsModalSearchThreshold", "className", "onShowAllClick", "
|
|
26
26
|
_excluded2 = ["label", "id", "tagType", "filter", "onClose"];
|
27
27
|
var componentName = 'TagOverflowPopover';
|
28
28
|
var blockClass = "".concat(settings.pkg.prefix, "--tag-overflow-popover");
|
29
|
-
|
30
|
-
|
31
|
-
var
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
overflowTags = _ref.overflowTags,
|
43
|
-
overflowType = _ref.overflowType,
|
44
|
-
showAllTagsLabel = _ref.showAllTagsLabel,
|
45
|
-
popoverOpen = _ref.popoverOpen,
|
46
|
-
setPopoverOpen = _ref.setPopoverOpen,
|
47
|
-
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
48
|
-
var localRef = React.useRef();
|
29
|
+
var TagOverflowPopover = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
30
|
+
var _overflowTags$length;
|
31
|
+
var allTagsModalSearchThreshold = props.allTagsModalSearchThreshold,
|
32
|
+
className = props.className,
|
33
|
+
onShowAllClick = props.onShowAllClick,
|
34
|
+
overflowAlign = props.overflowAlign,
|
35
|
+
overflowTags = props.overflowTags,
|
36
|
+
overflowType = props.overflowType,
|
37
|
+
showAllTagsLabel = props.showAllTagsLabel,
|
38
|
+
popoverOpen = props.popoverOpen,
|
39
|
+
setPopoverOpen = props.setPopoverOpen,
|
40
|
+
rest = _rollupPluginBabelHelpers.objectWithoutProperties(props, _excluded);
|
41
|
+
var localRef = React.useRef(null);
|
49
42
|
var overflowTagContent = React.useRef(null);
|
50
43
|
useClickOutside.useClickOutside(ref || localRef, function () {
|
51
44
|
if (popoverOpen) {
|
52
|
-
setPopoverOpen(false);
|
45
|
+
setPopoverOpen === null || setPopoverOpen === void 0 || setPopoverOpen(false);
|
53
46
|
}
|
54
47
|
});
|
55
48
|
var handleShowAllTagsClick = function handleShowAllTagsClick(evt) {
|
56
49
|
evt.stopPropagation();
|
57
50
|
evt.preventDefault();
|
58
|
-
setPopoverOpen(false);
|
59
|
-
onShowAllClick();
|
51
|
+
setPopoverOpen === null || setPopoverOpen === void 0 || setPopoverOpen(false);
|
52
|
+
onShowAllClick === null || onShowAllClick === void 0 || onShowAllClick();
|
60
53
|
};
|
61
|
-
var handleEscKeyPress = function handleEscKeyPress(
|
62
|
-
var key =
|
54
|
+
var handleEscKeyPress = function handleEscKeyPress(evt) {
|
55
|
+
var key = evt.key;
|
63
56
|
if (key === 'Escape') {
|
64
|
-
setPopoverOpen(false);
|
57
|
+
setPopoverOpen === null || setPopoverOpen === void 0 || setPopoverOpen(false);
|
65
58
|
}
|
66
59
|
};
|
67
60
|
var getOverflowPopoverItems = function getOverflowPopoverItems() {
|
68
|
-
|
69
|
-
|
61
|
+
var thresh = allTagsModalSearchThreshold !== null && allTagsModalSearchThreshold !== void 0 ? allTagsModalSearchThreshold : 0;
|
62
|
+
return overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.filter(function (_, index) {
|
63
|
+
return (overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.length) > thresh ? index < thresh : index <= thresh;
|
70
64
|
});
|
71
65
|
};
|
66
|
+
var visibleItems = getOverflowPopoverItems();
|
67
|
+
var hasItems = (visibleItems === null || visibleItems === void 0 ? void 0 : visibleItems.length) > 0;
|
72
68
|
return /*#__PURE__*/React__default["default"].createElement("span", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
73
|
-
"aria-hidden": overflowTags.length === 0,
|
74
|
-
className: cx__default["default"](blockClass, _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "--hidden"), overflowTags.length === 0)),
|
69
|
+
"aria-hidden": (overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.length) === 0,
|
70
|
+
className: cx__default["default"](blockClass, _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "--hidden"), (overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.length) === 0)),
|
75
71
|
ref: ref || localRef
|
76
72
|
}), /*#__PURE__*/React__default["default"].createElement(react.Popover, {
|
77
73
|
align: overflowAlign,
|
@@ -82,21 +78,21 @@ var TagOverflowPopover = /*#__PURE__*/React__default["default"].forwardRef(funct
|
|
82
78
|
open: popoverOpen
|
83
79
|
}, /*#__PURE__*/React__default["default"].createElement(react.Tag, {
|
84
80
|
onClick: function onClick() {
|
85
|
-
return setPopoverOpen(!popoverOpen);
|
81
|
+
return setPopoverOpen === null || setPopoverOpen === void 0 ? void 0 : setPopoverOpen(!popoverOpen);
|
86
82
|
},
|
87
83
|
className: cx__default["default"]("".concat(blockClass, "__trigger"))
|
88
|
-
}, "+", overflowTags.length), /*#__PURE__*/React__default["default"].createElement(react.PopoverContent, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
84
|
+
}, "+", overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.length), /*#__PURE__*/React__default["default"].createElement(react.PopoverContent, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
89
85
|
ref: overflowTagContent,
|
90
86
|
className: "".concat(blockClass, "__content")
|
91
87
|
}, /*#__PURE__*/React__default["default"].createElement("ul", {
|
92
88
|
className: "".concat(blockClass, "__tag-list")
|
93
|
-
},
|
94
|
-
var label =
|
95
|
-
id =
|
96
|
-
tagType =
|
97
|
-
filter =
|
98
|
-
_onClose =
|
99
|
-
other = _rollupPluginBabelHelpers.objectWithoutProperties(
|
89
|
+
}, hasItems && visibleItems.map(function (_ref) {
|
90
|
+
var label = _ref.label,
|
91
|
+
id = _ref.id,
|
92
|
+
tagType = _ref.tagType,
|
93
|
+
filter = _ref.filter,
|
94
|
+
_onClose = _ref.onClose,
|
95
|
+
other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded2);
|
100
96
|
var typeValue = overflowType === 'tag' ? 'high-contrast' : tagType;
|
101
97
|
var isFilterable = overflowType === 'tag' ? filter : false;
|
102
98
|
return /*#__PURE__*/React__default["default"].createElement("li", {
|
@@ -109,7 +105,7 @@ var TagOverflowPopover = /*#__PURE__*/React__default["default"].forwardRef(funct
|
|
109
105
|
type: typeValue,
|
110
106
|
filter: isFilterable
|
111
107
|
}), label) : label);
|
112
|
-
})), overflowTags.length > allTagsModalSearchThreshold && /*#__PURE__*/React__default["default"].createElement(react.Link, {
|
108
|
+
})), ((_overflowTags$length = overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.length) !== null && _overflowTags$length !== void 0 ? _overflowTags$length : 0) > (allTagsModalSearchThreshold !== null && allTagsModalSearchThreshold !== void 0 ? allTagsModalSearchThreshold : 0) && /*#__PURE__*/React__default["default"].createElement(react.Link, {
|
113
109
|
className: "".concat(blockClass, "__show-all-tags-link"),
|
114
110
|
href: "",
|
115
111
|
onClick: handleShowAllTagsClick,
|
@@ -137,6 +133,7 @@ TagOverflowPopover.propTypes = {
|
|
137
133
|
/**
|
138
134
|
* tags shown in overflow
|
139
135
|
*/
|
136
|
+
//@ts-ignore
|
140
137
|
overflowTags: index["default"].arrayOf(index["default"].object).isRequired,
|
141
138
|
/**
|
142
139
|
* Type of rendering displayed inside of the tag overflow component
|
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.99+f4e571cb9",
|
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": "f4e571cb99fe311fc2cc5bc13f72c0de33a73c7d"
|
124
124
|
}
|
@@ -12,10 +12,6 @@
|
|
12
12
|
@use '@carbon/styles/scss/type';
|
13
13
|
@use '../../global/styles/project-settings' as c4p-settings;
|
14
14
|
|
15
|
-
.#{c4p-settings.$pkg-prefix}--create-modal {
|
16
|
-
background-color: $background;
|
17
|
-
}
|
18
|
-
|
19
15
|
.#{c4p-settings.$pkg-prefix}--create-modal
|
20
16
|
.#{c4p-settings.$carbon-prefix}--modal-close {
|
21
17
|
display: none;
|