@carbon/ibm-products 2.43.2-canary.172 → 2.43.2-canary.173

Sign up to get free protection for your applications and to get access to all the features.
@@ -42,6 +42,7 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
42
42
  selectedRowIds = datagridState.state.selectedRowIds,
43
43
  toggleAllRowsSelected = datagridState.toggleAllRowsSelected,
44
44
  toolbarBatchActions = datagridState.toolbarBatchActions,
45
+ toolbarBatchActionsDisplayMin = datagridState.toolbarBatchActionsDisplayMin,
45
46
  setGlobalFilter = datagridState.setGlobalFilter,
46
47
  rows = datagridState.rows,
47
48
  dispatch = datagridState.dispatch,
@@ -89,7 +90,7 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
89
90
  var minWidthBeforeOverflowIcon = 380;
90
91
  // Do not render ButtonMenu when there are 3 or less items
91
92
  // and if there is enough available space to render all the items
92
- if (toolbarBatchActions && (toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.length) <= 3 && !displayAllInMenu) {
93
+ if (toolbarBatchActions && !displayAllInMenu && (!toolbarBatchActionsDisplayMin && (toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.length) <= 3 || toolbarBatchActionsDisplayMin !== undefined && (toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.length) <= toolbarBatchActionsDisplayMin)) {
93
94
  return;
94
95
  }
95
96
  var renderItem = function renderItem(batchAction, index) {
@@ -107,7 +108,10 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
107
108
  tabIndex: totalSelected > 0 ? 0 : -1,
108
109
  menuAlignment: "bottom"
109
110
  }, toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.map(function (batchAction, index) {
110
- var hidden = index < 2 && !displayAllInMenu;
111
+ var hidden = toolbarBatchActionsDisplayMin === undefined && index < 2 && !displayAllInMenu;
112
+ if (toolbarBatchActionsDisplayMin !== undefined && index < toolbarBatchActionsDisplayMin && !displayAllInMenu) {
113
+ hidden = true;
114
+ }
111
115
  if (!hidden) {
112
116
  return renderItem(batchAction, index);
113
117
  }
@@ -153,13 +157,14 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
153
157
  totalCount: rows && rows.length,
154
158
  translateWithId: translateWithIdBatchActions
155
159
  }, !displayAllInMenu && toolbarBatchActions && (toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.map(function (batchAction, index) {
156
- if (index < 2 && toolbarBatchActions.length > 3 || index < 3 && toolbarBatchActions.length <= 3) {
160
+ if (!toolbarBatchActionsDisplayMin && index < 2 && toolbarBatchActions.length > 3 || index < 3 && toolbarBatchActions.length <= 3 || toolbarBatchActionsDisplayMin !== undefined && index < toolbarBatchActionsDisplayMin) {
157
161
  return /*#__PURE__*/React__default["default"].createElement(react.TableBatchAction, {
158
162
  key: "".concat(batchAction.label, "-").concat(index),
159
163
  renderIcon: batchAction.renderIcon,
160
164
  onClick: function onClick(event) {
161
165
  return onClickHandler(event, batchAction);
162
166
  },
167
+ className: cx__default["default"](_rollupPluginBabelHelpers.defineProperty({}, "".concat(settings.carbon.prefix, "--noLabel"), !batchAction.label || batchAction.label === '')),
163
168
  iconDescription: batchAction.label,
164
169
  tabIndex: totalSelected > 0 ? 0 : -1
165
170
  }, batchAction.label);
@@ -223,6 +223,7 @@ export interface DataGridState<T extends object = any> extends TableCommonProps,
223
223
  setGlobalFilter?: (filterValue: FilterValue) => void;
224
224
  batchActionMenuButtonLabel?: string;
225
225
  translateWithIdBatchActions?: TableBatchActionsProps['translateWithId'];
226
+ toolbarBatchActionsDisplayMin?: number;
226
227
  onScroll?: (evt?: any) => void;
227
228
  innerListRef?: MutableRefObject<HTMLDivElement>;
228
229
  tableHeight?: number;
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.172+517e4f366",
4
+ "version": "2.43.2-canary.173+485e8bcac",
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.44.0-rc.0",
99
+ "@carbon/ibm-products-styles": "^2.39.1-canary.183+485e8bcac",
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": "517e4f36631cf1cc81d6f21fd25a83b3c65da540"
123
+ "gitHead": "485e8bcac3193e56d65721076160944b4e126256"
124
124
  }
@@ -789,6 +789,12 @@
789
789
  padding: 0;
790
790
  }
791
791
 
792
+ .#{$block-class}
793
+ .#{c4p-settings.$carbon-prefix}--noLabel
794
+ svg.#{c4p-settings.$carbon-prefix}--btn__icon {
795
+ margin-inline-start: 0;
796
+ }
797
+
792
798
  .#{$block-class}
793
799
  .#{c4p-settings.$carbon-prefix}--action-list
794
800
  .#{c4p-settings.$carbon-prefix}--btn__icon {