@carbon/ibm-products 2.13.0 → 2.14.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +29 -3
- 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 +7 -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 -3
- 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 -3
- 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/Datagrid/Datagrid/DatagridContent.js +2 -1
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +3 -2
- package/es/components/FilterSummary/FilterSummary.js +6 -2
- package/es/components/TagSet/TagSet.js +11 -3
- package/es/components/TagSet/TagSetOverflow.js +16 -5
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +2 -1
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +3 -2
- package/lib/components/FilterSummary/FilterSummary.js +6 -2
- package/lib/components/TagSet/TagSet.js +11 -3
- package/lib/components/TagSet/TagSetOverflow.js +16 -5
- package/package.json +2 -2
- package/scss/components/Datagrid/styles/addons/_RowSizeDropdown.scss +37 -1
- package/scss/components/TagSet/_tag-set.scss +10 -2
@@ -33,7 +33,9 @@ var FilterSummary = /*#__PURE__*/_react2.default.forwardRef(function (_ref, ref)
|
|
33
33
|
_ref$filters = _ref.filters,
|
34
34
|
filters = _ref$filters === void 0 ? [] : _ref$filters,
|
35
35
|
_ref$renderLabel = _ref.renderLabel,
|
36
|
-
renderLabel = _ref$renderLabel === void 0 ? null : _ref$renderLabel
|
36
|
+
renderLabel = _ref$renderLabel === void 0 ? null : _ref$renderLabel,
|
37
|
+
_ref$overflowType = _ref.overflowType,
|
38
|
+
overflowType = _ref$overflowType === void 0 ? 'default' : _ref$overflowType;
|
37
39
|
var tagFilters = filters.map(function (_ref2) {
|
38
40
|
var _renderLabel;
|
39
41
|
var key = _ref2.key,
|
@@ -52,7 +54,8 @@ var FilterSummary = /*#__PURE__*/_react2.default.forwardRef(function (_ref, ref)
|
|
52
54
|
allTagsModalSearchPlaceholderText: "Search all tags",
|
53
55
|
allTagsModalTitle: "All tags",
|
54
56
|
showAllTagsLabel: "View all tags",
|
55
|
-
tags: tagFilters
|
57
|
+
tags: tagFilters,
|
58
|
+
overflowType: overflowType
|
56
59
|
}), /*#__PURE__*/_react2.default.createElement(_react.Button, {
|
57
60
|
kind: "ghost",
|
58
61
|
size: "sm",
|
@@ -66,6 +69,7 @@ FilterSummary.propTypes = {
|
|
66
69
|
clearFilters: _propTypes.default.func.isRequired,
|
67
70
|
clearFiltersText: _propTypes.default.string,
|
68
71
|
filters: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
72
|
+
overflowType: _propTypes.default.oneOf(['default', 'tag']),
|
69
73
|
renderLabel: _propTypes.default.func
|
70
74
|
};
|
71
75
|
var _default = exports.default = FilterSummary;
|
@@ -20,7 +20,7 @@ var _useResizeObserver = require("../../global/js/hooks/useResizeObserver");
|
|
20
20
|
var _devtools = require("../../global/js/utils/devtools");
|
21
21
|
var _propsHelper = require("../../global/js/utils/props-helper");
|
22
22
|
var _settings = require("../../settings");
|
23
|
-
var _excluded = ["align", "allTagsModalTarget", "className", "maxVisible", "multiline", "overflowAlign", "overflowClassName", "allTagsModalTitle", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "showAllTagsLabel", "tags"],
|
23
|
+
var _excluded = ["align", "allTagsModalTarget", "className", "maxVisible", "multiline", "overflowAlign", "overflowClassName", "overflowType", "allTagsModalTitle", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "showAllTagsLabel", "tags"],
|
24
24
|
_excluded2 = ["label", "id"],
|
25
25
|
_excluded3 = ["label"]; //
|
26
26
|
// Copyright IBM Corp. 2020, 2022
|
@@ -39,7 +39,8 @@ var allTagsModalSearchThreshold = 10;
|
|
39
39
|
// Default values for props
|
40
40
|
var defaults = {
|
41
41
|
align: 'start',
|
42
|
-
overflowAlign: 'bottom'
|
42
|
+
overflowAlign: 'bottom',
|
43
|
+
overflowType: 'default'
|
43
44
|
};
|
44
45
|
var TagSet = exports.TagSet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
45
46
|
var _ref$align = _ref.align,
|
@@ -51,6 +52,8 @@ var TagSet = exports.TagSet = /*#__PURE__*/_react.default.forwardRef(function (_
|
|
51
52
|
_ref$overflowAlign = _ref.overflowAlign,
|
52
53
|
overflowAlign = _ref$overflowAlign === void 0 ? defaults.overflowAlign : _ref$overflowAlign,
|
53
54
|
overflowClassName = _ref.overflowClassName,
|
55
|
+
_ref$overflowType = _ref.overflowType,
|
56
|
+
overflowType = _ref$overflowType === void 0 ? defaults.overflowType : _ref$overflowType,
|
54
57
|
allTagsModalTitle = _ref.allTagsModalTitle,
|
55
58
|
allTagsModalSearchLabel = _ref.allTagsModalSearchLabel,
|
56
59
|
allTagsModalSearchPlaceholderText = _ref.allTagsModalSearchPlaceholderText,
|
@@ -131,12 +134,13 @@ var TagSet = exports.TagSet = /*#__PURE__*/_react.default.forwardRef(function (_
|
|
131
134
|
onShowAllClick: handleShowAllClick,
|
132
135
|
overflowTags: newOverflowTags,
|
133
136
|
overflowAlign: overflowAlign,
|
137
|
+
overflowType: overflowType,
|
134
138
|
showAllTagsLabel: showAllTagsLabel,
|
135
139
|
key: "displayed-tag-overflow",
|
136
140
|
ref: overflowTag
|
137
141
|
}));
|
138
142
|
setDisplayedTags(newDisplayedTags);
|
139
|
-
}, [displayCount, overflowAlign, overflowClassName, showAllTagsLabel, tags]);
|
143
|
+
}, [displayCount, overflowAlign, overflowClassName, overflowType, showAllTagsLabel, tags]);
|
140
144
|
var checkFullyVisibleTags = (0, _react.useCallback)(function () {
|
141
145
|
if (multiline) {
|
142
146
|
return setDisplayCount(maxVisible);
|
@@ -285,6 +289,10 @@ TagSet.propTypes = {
|
|
285
289
|
* overflowClassName for the tooltip popup
|
286
290
|
*/
|
287
291
|
overflowClassName: _propTypes.default.string,
|
292
|
+
/**
|
293
|
+
* Type of rendering displayed inside of the tag overflow component
|
294
|
+
*/
|
295
|
+
overflowType: _propTypes.default.oneOf(['default', 'tag']),
|
288
296
|
/**
|
289
297
|
* label for the overflow show all tags link.
|
290
298
|
*
|
@@ -16,7 +16,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
16
16
|
var _react2 = require("@carbon/react");
|
17
17
|
var _hooks = require("../../global/js/hooks");
|
18
18
|
var _settings = require("../../settings");
|
19
|
-
var _excluded = ["allTagsModalSearchThreshold", "className", "onShowAllClick", "overflowAlign", "overflowTags", "showAllTagsLabel"]; //
|
19
|
+
var _excluded = ["allTagsModalSearchThreshold", "className", "onShowAllClick", "overflowAlign", "overflowTags", "overflowType", "showAllTagsLabel"]; //
|
20
20
|
// Copyright IBM Corp. 2021, 2022
|
21
21
|
//
|
22
22
|
// This source code is licensed under the Apache-2.0 license found in the
|
@@ -40,6 +40,7 @@ var TagSetOverflow = exports.TagSetOverflow = /*#__PURE__*/_react.default.forwar
|
|
40
40
|
_ref$overflowAlign = _ref.overflowAlign,
|
41
41
|
overflowAlign = _ref$overflowAlign === void 0 ? defaults.overflowAlign : _ref$overflowAlign,
|
42
42
|
overflowTags = _ref.overflowTags,
|
43
|
+
overflowType = _ref.overflowType,
|
43
44
|
showAllTagsLabel = _ref.showAllTagsLabel,
|
44
45
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
45
46
|
var _useState = (0, _react.useState)(false),
|
@@ -89,12 +90,18 @@ var TagSetOverflow = exports.TagSetOverflow = /*#__PURE__*/_react.default.forwar
|
|
89
90
|
}, overflowTags.filter(function (_, index) {
|
90
91
|
return overflowTags.length > allTagsModalSearchThreshold ? index < allTagsModalSearchThreshold : index <= allTagsModalSearchThreshold;
|
91
92
|
}).map(function (tag, index) {
|
93
|
+
var _cx2;
|
94
|
+
var tagProps = {};
|
95
|
+
if (overflowType === 'tag') {
|
96
|
+
tagProps.type = 'high-contrast';
|
97
|
+
}
|
98
|
+
if (overflowType === 'default') {
|
99
|
+
tagProps.filter = false;
|
100
|
+
}
|
92
101
|
return /*#__PURE__*/_react.default.createElement("li", {
|
93
|
-
className: "".concat(blockClass, "__tag-item"),
|
102
|
+
className: (0, _classnames.default)("".concat(blockClass, "__tag-item"), (_cx2 = {}, (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__tag-item--default"), overflowType === 'default'), (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__tag-item--tag"), overflowType === 'tag'), _cx2)),
|
94
103
|
key: index
|
95
|
-
}, /*#__PURE__*/_react.default.cloneElement(tag,
|
96
|
-
filter: false
|
97
|
-
}));
|
104
|
+
}, /*#__PURE__*/_react.default.cloneElement(tag, tagProps));
|
98
105
|
})), overflowTags.length > allTagsModalSearchThreshold && /*#__PURE__*/_react.default.createElement(_react2.Link, {
|
99
106
|
className: "".concat(blockClass, "__show-all-tags-link"),
|
100
107
|
href: "",
|
@@ -124,6 +131,10 @@ TagSetOverflow.propTypes = {
|
|
124
131
|
* tags shown in overflow
|
125
132
|
*/
|
126
133
|
overflowTags: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
134
|
+
/**
|
135
|
+
* Type of rendering displayed inside of the tag overflow component
|
136
|
+
*/
|
137
|
+
overflowType: _propTypes.default.oneOf(['default', 'tag']),
|
127
138
|
/**
|
128
139
|
* label for the overflow show all tags link
|
129
140
|
*/
|
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.
|
4
|
+
"version": "2.14.0",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -96,5 +96,5 @@
|
|
96
96
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0",
|
97
97
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
|
98
98
|
},
|
99
|
-
"gitHead": "
|
99
|
+
"gitHead": "8d8e1b6bbc737baf63f059b1ed6929958560ba64"
|
100
100
|
}
|
@@ -44,7 +44,43 @@
|
|
44
44
|
justify-content: center;
|
45
45
|
}
|
46
46
|
|
47
|
+
// Top align cell content for xl row size
|
47
48
|
.#{variables.$block-class}
|
48
|
-
.#{
|
49
|
+
table.#{c4p-settings.$carbon-prefix}--data-table--xl.#{variables.$block-class}__vertical-align-center
|
50
|
+
td,
|
51
|
+
.#{variables.$block-class}
|
52
|
+
table.#{c4p-settings.$carbon-prefix}--data-table--xl.#{variables.$block-class}__vertical-align-top
|
53
|
+
td {
|
54
|
+
align-items: flex-start;
|
55
|
+
padding-top: $spacing-05;
|
56
|
+
padding-bottom: $spacing-05;
|
57
|
+
|
58
|
+
&.#{variables.$block-class}__actions-column-cell {
|
59
|
+
padding-left: $spacing-03;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
// Top align header content for xl row size
|
64
|
+
.#{variables.$block-class}
|
65
|
+
table.#{c4p-settings.$carbon-prefix}--data-table--xl.#{variables.$block-class}__vertical-align-center
|
66
|
+
th,
|
67
|
+
.#{variables.$block-class}
|
68
|
+
table.#{c4p-settings.$carbon-prefix}--data-table--xl.#{variables.$block-class}__vertical-align-top
|
69
|
+
th {
|
70
|
+
.#{c4p-settings.$carbon-prefix}--table-header-label {
|
71
|
+
align-items: flex-start;
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
// Top align checkbox row header for xl row size
|
76
|
+
.#{variables.$block-class}
|
77
|
+
table.#{c4p-settings.$carbon-prefix}--data-table--xl.#{variables.$block-class}__vertical-align-center
|
78
|
+
.#{variables.$block-class}__checkbox-cell
|
79
|
+
th.cds--table-column-checkbox {
|
80
|
+
align-items: flex-start;
|
81
|
+
padding-top: $spacing-04;
|
82
|
+
}
|
83
|
+
|
84
|
+
.#{variables.$block-class}__row-size__row-settings-trigger--open.#{c4p-settings.$carbon-prefix}--btn--ghost {
|
49
85
|
background-color: $layer-02;
|
50
86
|
}
|
@@ -140,11 +140,19 @@ $block-class-modal: #{$_block-class}-modal;
|
|
140
140
|
}
|
141
141
|
|
142
142
|
.#{$block-class-overflow}__tag-list {
|
143
|
+
display: flex;
|
144
|
+
flex-direction: column;
|
143
145
|
margin-bottom: $spacing-03;
|
144
146
|
}
|
145
147
|
|
146
|
-
.#{$block-class-overflow}__tag-item
|
147
|
-
|
148
|
+
.#{$block-class-overflow}__tag-item.#{$block-class-overflow}__tag-item--tag
|
149
|
+
.#{$carbon-prefix}--tag {
|
150
|
+
background-color: $background-inverse-hover;
|
151
|
+
}
|
152
|
+
|
153
|
+
.#{$block-class-overflow}__tag-item.#{$block-class-overflow}__tag-item--default,
|
154
|
+
.#{$block-class-overflow}__tag-item.#{$block-class-overflow}__tag-item--default
|
155
|
+
.#{$carbon-prefix}--tag {
|
148
156
|
@include type.type-style('body-compact-01');
|
149
157
|
|
150
158
|
display: block;
|