@carbon/ibm-products 2.43.2-canary.25 → 2.43.2-canary.27
Sign up to get free protection for your applications and to get access to all the features.
@@ -90,7 +90,8 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
|
|
90
90
|
var resizerAriaLabel = datagridState.resizerAriaLabel,
|
91
91
|
isTableSortable = datagridState.isTableSortable,
|
92
92
|
rows = datagridState.rows,
|
93
|
-
isFetching = datagridState.isFetching
|
93
|
+
isFetching = datagridState.isFetching,
|
94
|
+
headers = datagridState.headers;
|
94
95
|
useInitialColumnSort(datagridState);
|
95
96
|
// Used to measure the height of the table and uses that value
|
96
97
|
// to display a vertical line to indicate the column you are resizing
|
@@ -152,6 +153,9 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
|
|
152
153
|
});
|
153
154
|
var key = headerGroupProps.key,
|
154
155
|
rowProps = _objectWithoutProperties(headerGroupProps, _excluded2);
|
156
|
+
var withActionsColumn = headers ? !!headers.filter(function (header) {
|
157
|
+
return header.isAction;
|
158
|
+
}).length : false;
|
155
159
|
return /*#__PURE__*/React__default.createElement(TableRow, _extends({
|
156
160
|
key: key
|
157
161
|
}, rowProps, {
|
@@ -184,6 +188,12 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
|
|
184
188
|
var _header$getHeaderProp = header.getHeaderProps(),
|
185
189
|
headerProps = _extends({}, (_objectDestructuringEmpty(_header$getHeaderProp), _header$getHeaderProp));
|
186
190
|
var resizerProps = header === null || header === void 0 || (_header$getResizerPro = header.getResizerProps) === null || _header$getResizerPro === void 0 ? void 0 : _header$getResizerPro.call(header);
|
191
|
+
var headerStyle = headerProps === null || headerProps === void 0 ? void 0 : headerProps.style;
|
192
|
+
var lastVisibleIndex = withActionsColumn ? 2 : 1;
|
193
|
+
var lastVisibleFlexStyle = index === visibleColumns.length - lastVisibleIndex ? '1 1 0' : '0 0 auto';
|
194
|
+
if (headerStyle) {
|
195
|
+
headerStyle.flex = lastVisibleFlexStyle;
|
196
|
+
}
|
187
197
|
return /*#__PURE__*/React__default.createElement(TableHeader, _extends({}, headerProps, {
|
188
198
|
className: cx(header === null || header === void 0 ? void 0 : header.className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(blockClass, "__resizableColumn"), resizerProps), "".concat(blockClass, "__isResizing"), header === null || header === void 0 ? void 0 : header.isResizing), "".concat(blockClass, "__sortableColumn"), datagridState.isTableSortable && header.id !== 'spacer'), "".concat(blockClass, "__isSorted"), header === null || header === void 0 ? void 0 : header.isSorted), "".concat(blockClass, "__header-actions-column"), header === null || header === void 0 ? void 0 : header.isAction), "".concat(blockClass, "__with-slug"), header.slug && /*#__PURE__*/React__default.isValidElement(header === null || header === void 0 ? void 0 : header.slug)), headerProps.className),
|
189
199
|
key: header.id,
|
@@ -16,7 +16,7 @@ import { DatagridSlug } from './addons/Slug/DatagridSlug.js';
|
|
16
16
|
|
17
17
|
var _SkeletonText;
|
18
18
|
var _excluded = ["className"],
|
19
|
-
_excluded2 = ["children"];
|
19
|
+
_excluded2 = ["style", "children"];
|
20
20
|
var blockClass = "".concat(pkg.prefix, "--datagrid");
|
21
21
|
var rowHeights = {
|
22
22
|
xs: 24,
|
@@ -39,7 +39,8 @@ var DatagridRow = function DatagridRow(datagridState) {
|
|
39
39
|
withExpandedRows = datagridState.withExpandedRows,
|
40
40
|
withMouseHover = datagridState.withMouseHover,
|
41
41
|
setMouseOverRowIndex = datagridState.setMouseOverRowIndex,
|
42
|
-
headers = datagridState.headers
|
42
|
+
headers = datagridState.headers,
|
43
|
+
visibleColumns = datagridState.visibleColumns;
|
43
44
|
var getVisibleNestedRowCount = function getVisibleNestedRowCount(_ref) {
|
44
45
|
var isExpanded = _ref.isExpanded,
|
45
46
|
subRows = _ref.subRows;
|
@@ -115,6 +116,9 @@ var DatagridRow = function DatagridRow(datagridState) {
|
|
115
116
|
return /*#__PURE__*/isValidElement(r === null || r === void 0 || (_r$original = r.original) === null || _r$original === void 0 ? void 0 : _r$original.slug);
|
116
117
|
});
|
117
118
|
var rowClassNames = cx("".concat(blockClass, "__carbon-row"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(blockClass, "__carbon-row-expanded"), row.isExpanded), "".concat(blockClass, "__carbon-row-expandable"), row.canExpand), "".concat(carbon.prefix, "--data-table--selected"), row.isSelected), "".concat(blockClass, "__slug--row"), /*#__PURE__*/isValidElement(row === null || row === void 0 || (_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.slug)));
|
119
|
+
var withActionsColumn = headers ? !!headers.filter(function (header) {
|
120
|
+
return header.isAction;
|
121
|
+
}).length : false;
|
118
122
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
119
123
|
key: key
|
120
124
|
}, /*#__PURE__*/React__default.createElement(TableRow, _extends({}, rowProps, {
|
@@ -136,6 +140,7 @@ var DatagridRow = function DatagridRow(datagridState) {
|
|
136
140
|
var cellProps = cell.getCellProps();
|
137
141
|
// eslint-disable-next-line no-unused-vars
|
138
142
|
var _ref2 = cellProps,
|
143
|
+
style = _ref2.style,
|
139
144
|
children = _ref2.children,
|
140
145
|
restProps = _objectWithoutProperties(_ref2, _excluded2);
|
141
146
|
var columnClassname = cell === null || cell === void 0 || (_cell$column = cell.column) === null || _cell$column === void 0 ? void 0 : _cell$column.className;
|
@@ -150,9 +155,15 @@ var DatagridRow = function DatagridRow(datagridState) {
|
|
150
155
|
var associatedHeader = headers === null || headers === void 0 ? void 0 : headers.filter(function (h) {
|
151
156
|
return h.id === cell.column.id;
|
152
157
|
});
|
158
|
+
var lastVisibleIndex = withActionsColumn ? 2 : 1;
|
159
|
+
var lastVisibleFlexStyle = index === visibleColumns.length - lastVisibleIndex ? '1 1 0' : '0 0 auto';
|
160
|
+
if (style) {
|
161
|
+
style.flex = lastVisibleFlexStyle;
|
162
|
+
}
|
153
163
|
return /*#__PURE__*/React__default.createElement(TableCell, _extends({
|
154
164
|
className: cx("".concat(blockClass, "__cell"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(blockClass, "__expandable-row-cell"), row.canExpand && index === 0), "".concat(blockClass, "__expandable-row-cell--is-expanded"), row.isExpanded && index === 0), "".concat(blockClass, "__slug--cell"), associatedHeader && associatedHeader.length && /*#__PURE__*/isValidElement((_associatedHeader$ = associatedHeader[0]) === null || _associatedHeader$ === void 0 ? void 0 : _associatedHeader$.slug)), columnClassname)
|
155
165
|
}, restProps, {
|
166
|
+
style: style,
|
156
167
|
key: cell.column.id,
|
157
168
|
title: title
|
158
169
|
}), content);
|
@@ -99,7 +99,8 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
|
|
99
99
|
var resizerAriaLabel = datagridState.resizerAriaLabel,
|
100
100
|
isTableSortable = datagridState.isTableSortable,
|
101
101
|
rows = datagridState.rows,
|
102
|
-
isFetching = datagridState.isFetching
|
102
|
+
isFetching = datagridState.isFetching,
|
103
|
+
headers = datagridState.headers;
|
103
104
|
useInitialColumnSort.useInitialColumnSort(datagridState);
|
104
105
|
// Used to measure the height of the table and uses that value
|
105
106
|
// to display a vertical line to indicate the column you are resizing
|
@@ -161,6 +162,9 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
|
|
161
162
|
});
|
162
163
|
var key = headerGroupProps.key,
|
163
164
|
rowProps = _rollupPluginBabelHelpers.objectWithoutProperties(headerGroupProps, _excluded2);
|
165
|
+
var withActionsColumn = headers ? !!headers.filter(function (header) {
|
166
|
+
return header.isAction;
|
167
|
+
}).length : false;
|
164
168
|
return /*#__PURE__*/React__default["default"].createElement(react.TableRow, _rollupPluginBabelHelpers["extends"]({
|
165
169
|
key: key
|
166
170
|
}, rowProps, {
|
@@ -193,6 +197,12 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
|
|
193
197
|
var _header$getHeaderProp = header.getHeaderProps(),
|
194
198
|
headerProps = _rollupPluginBabelHelpers["extends"]({}, (_rollupPluginBabelHelpers.objectDestructuringEmpty(_header$getHeaderProp), _header$getHeaderProp));
|
195
199
|
var resizerProps = header === null || header === void 0 || (_header$getResizerPro = header.getResizerProps) === null || _header$getResizerPro === void 0 ? void 0 : _header$getResizerPro.call(header);
|
200
|
+
var headerStyle = headerProps === null || headerProps === void 0 ? void 0 : headerProps.style;
|
201
|
+
var lastVisibleIndex = withActionsColumn ? 2 : 1;
|
202
|
+
var lastVisibleFlexStyle = index === visibleColumns.length - lastVisibleIndex ? '1 1 0' : '0 0 auto';
|
203
|
+
if (headerStyle) {
|
204
|
+
headerStyle.flex = lastVisibleFlexStyle;
|
205
|
+
}
|
196
206
|
return /*#__PURE__*/React__default["default"].createElement(react.TableHeader, _rollupPluginBabelHelpers["extends"]({}, headerProps, {
|
197
207
|
className: cx__default["default"](header === null || header === void 0 ? void 0 : header.className, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__resizableColumn"), resizerProps), "".concat(blockClass, "__isResizing"), header === null || header === void 0 ? void 0 : header.isResizing), "".concat(blockClass, "__sortableColumn"), datagridState.isTableSortable && header.id !== 'spacer'), "".concat(blockClass, "__isSorted"), header === null || header === void 0 ? void 0 : header.isSorted), "".concat(blockClass, "__header-actions-column"), header === null || header === void 0 ? void 0 : header.isAction), "".concat(blockClass, "__with-slug"), header.slug && /*#__PURE__*/React__default["default"].isValidElement(header === null || header === void 0 ? void 0 : header.slug)), headerProps.className),
|
198
208
|
key: header.id,
|
@@ -25,7 +25,7 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
25
25
|
|
26
26
|
var _SkeletonText;
|
27
27
|
var _excluded = ["className"],
|
28
|
-
_excluded2 = ["children"];
|
28
|
+
_excluded2 = ["style", "children"];
|
29
29
|
var blockClass = "".concat(settings.pkg.prefix, "--datagrid");
|
30
30
|
var rowHeights = {
|
31
31
|
xs: 24,
|
@@ -48,7 +48,8 @@ var DatagridRow = function DatagridRow(datagridState) {
|
|
48
48
|
withExpandedRows = datagridState.withExpandedRows,
|
49
49
|
withMouseHover = datagridState.withMouseHover,
|
50
50
|
setMouseOverRowIndex = datagridState.setMouseOverRowIndex,
|
51
|
-
headers = datagridState.headers
|
51
|
+
headers = datagridState.headers,
|
52
|
+
visibleColumns = datagridState.visibleColumns;
|
52
53
|
var getVisibleNestedRowCount = function getVisibleNestedRowCount(_ref) {
|
53
54
|
var isExpanded = _ref.isExpanded,
|
54
55
|
subRows = _ref.subRows;
|
@@ -124,6 +125,9 @@ var DatagridRow = function DatagridRow(datagridState) {
|
|
124
125
|
return /*#__PURE__*/React.isValidElement(r === null || r === void 0 || (_r$original = r.original) === null || _r$original === void 0 ? void 0 : _r$original.slug);
|
125
126
|
});
|
126
127
|
var rowClassNames = cx__default["default"]("".concat(blockClass, "__carbon-row"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__carbon-row-expanded"), row.isExpanded), "".concat(blockClass, "__carbon-row-expandable"), row.canExpand), "".concat(settings.carbon.prefix, "--data-table--selected"), row.isSelected), "".concat(blockClass, "__slug--row"), /*#__PURE__*/React.isValidElement(row === null || row === void 0 || (_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.slug)));
|
128
|
+
var withActionsColumn = headers ? !!headers.filter(function (header) {
|
129
|
+
return header.isAction;
|
130
|
+
}).length : false;
|
127
131
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
|
128
132
|
key: key
|
129
133
|
}, /*#__PURE__*/React__default["default"].createElement(react.TableRow, _rollupPluginBabelHelpers["extends"]({}, rowProps, {
|
@@ -145,6 +149,7 @@ var DatagridRow = function DatagridRow(datagridState) {
|
|
145
149
|
var cellProps = cell.getCellProps();
|
146
150
|
// eslint-disable-next-line no-unused-vars
|
147
151
|
var _ref2 = cellProps,
|
152
|
+
style = _ref2.style,
|
148
153
|
children = _ref2.children,
|
149
154
|
restProps = _rollupPluginBabelHelpers.objectWithoutProperties(_ref2, _excluded2);
|
150
155
|
var columnClassname = cell === null || cell === void 0 || (_cell$column = cell.column) === null || _cell$column === void 0 ? void 0 : _cell$column.className;
|
@@ -159,9 +164,15 @@ var DatagridRow = function DatagridRow(datagridState) {
|
|
159
164
|
var associatedHeader = headers === null || headers === void 0 ? void 0 : headers.filter(function (h) {
|
160
165
|
return h.id === cell.column.id;
|
161
166
|
});
|
167
|
+
var lastVisibleIndex = withActionsColumn ? 2 : 1;
|
168
|
+
var lastVisibleFlexStyle = index === visibleColumns.length - lastVisibleIndex ? '1 1 0' : '0 0 auto';
|
169
|
+
if (style) {
|
170
|
+
style.flex = lastVisibleFlexStyle;
|
171
|
+
}
|
162
172
|
return /*#__PURE__*/React__default["default"].createElement(react.TableCell, _rollupPluginBabelHelpers["extends"]({
|
163
173
|
className: cx__default["default"]("".concat(blockClass, "__cell"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__expandable-row-cell"), row.canExpand && index === 0), "".concat(blockClass, "__expandable-row-cell--is-expanded"), row.isExpanded && index === 0), "".concat(blockClass, "__slug--cell"), associatedHeader && associatedHeader.length && /*#__PURE__*/React.isValidElement((_associatedHeader$ = associatedHeader[0]) === null || _associatedHeader$ === void 0 ? void 0 : _associatedHeader$.slug)), columnClassname)
|
164
174
|
}, restProps, {
|
175
|
+
style: style,
|
165
176
|
key: cell.column.id,
|
166
177
|
title: title
|
167
178
|
}), content);
|
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.27+1a9f44148",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -119,5 +119,5 @@
|
|
119
119
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0",
|
120
120
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
|
121
121
|
},
|
122
|
-
"gitHead": "
|
122
|
+
"gitHead": "1a9f44148f35422f3a2722c304ae83c8dc914782"
|
123
123
|
}
|