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

Sign up to get free protection for your applications and to get access to all the features.
@@ -367,11 +367,6 @@ var InlineEditCell = function InlineEditCell(_ref) {
367
367
  return Calendar;
368
368
  }
369
369
  };
370
- var renderRegularCell = function renderRegularCell() {
371
- return /*#__PURE__*/React__default.createElement("span", _extends({}, inputProps, {
372
- id: cellId
373
- }));
374
- };
375
370
  var renderDateCell = function renderDateCell() {
376
371
  var _config$inputProps, _outerButtonElement$c;
377
372
  var datePickerPreparedProps = prepareProps(config.inputProps, ['datePickerInputProps']);
@@ -531,7 +526,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
531
526
  onClick: !nonEditCell ? handleInlineCellClick : addActiveState,
532
527
  onKeyDown: !nonEditCell ? handleKeyDown : null,
533
528
  className: cx("".concat(blockClass, "__inline-edit--outer-cell-button"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(blockClass, "__inline-edit--outer-cell-button--").concat(rowSize), rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--lg"), !rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--invalid"), inEditMode && (config === null || config === void 0 || (_config$validator = config.validator) === null || _config$validator === void 0 ? void 0 : _config$validator.call(config, cellValue))), "".concat(blockClass, "__static--outer-cell"), !disabledCell))
534
- }, !nonEditCell && !disabledCell && type !== 'checkbox' && renderRegularCell(), (!inEditMode || disabledCell) && type !== 'checkbox' && /*#__PURE__*/React__default.createElement(InlineEditButton, {
529
+ }, (!inEditMode || disabledCell) && type !== 'checkbox' && /*#__PURE__*/React__default.createElement(InlineEditButton, {
535
530
  isActiveCell: cellId === activeCellId,
536
531
  renderIcon: setRenderIcon(),
537
532
  label: getLabel(),
@@ -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;
@@ -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);
@@ -376,11 +376,6 @@ var InlineEditCell = function InlineEditCell(_ref) {
376
376
  return icons.Calendar;
377
377
  }
378
378
  };
379
- var renderRegularCell = function renderRegularCell() {
380
- return /*#__PURE__*/React__default["default"].createElement("span", _rollupPluginBabelHelpers["extends"]({}, inputProps, {
381
- id: cellId
382
- }));
383
- };
384
379
  var renderDateCell = function renderDateCell() {
385
380
  var _config$inputProps, _outerButtonElement$c;
386
381
  var datePickerPreparedProps = propsHelper.prepareProps(config.inputProps, ['datePickerInputProps']);
@@ -540,7 +535,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
540
535
  onClick: !nonEditCell ? handleInlineCellClick : addActiveState,
541
536
  onKeyDown: !nonEditCell ? handleKeyDown : null,
542
537
  className: cx__default["default"]("".concat(blockClass, "__inline-edit--outer-cell-button"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__inline-edit--outer-cell-button--").concat(rowSize), rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--lg"), !rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--invalid"), inEditMode && (config === null || config === void 0 || (_config$validator = config.validator) === null || _config$validator === void 0 ? void 0 : _config$validator.call(config, cellValue))), "".concat(blockClass, "__static--outer-cell"), !disabledCell))
543
- }, !nonEditCell && !disabledCell && type !== 'checkbox' && renderRegularCell(), (!inEditMode || disabledCell) && type !== 'checkbox' && /*#__PURE__*/React__default["default"].createElement(InlineEditButton.InlineEditButton, {
538
+ }, (!inEditMode || disabledCell) && type !== 'checkbox' && /*#__PURE__*/React__default["default"].createElement(InlineEditButton.InlineEditButton, {
544
539
  isActiveCell: cellId === activeCellId,
545
540
  renderIcon: setRenderIcon(),
546
541
  label: getLabel(),
@@ -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.171+25e95bab0",
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": "25e95bab041d69b28cc8e2a1c15ddd78ea4ab311"
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 {