carbon-addons-iot-react 5.5.2 → 5.6.3

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.
@@ -7,6 +7,7 @@ import 'core-js/modules/es.array.concat.js';
7
7
  import 'core-js/modules/es.array.filter.js';
8
8
  import 'core-js/modules/es.array.find.js';
9
9
  import 'core-js/modules/es.array.find-index.js';
10
+ import 'core-js/modules/es.array.map.js';
10
11
  import 'core-js/modules/es.array.slice.js';
11
12
  import 'core-js/modules/es.array.sort.js';
12
13
  import 'core-js/modules/es.number.constructor.js';
@@ -312,9 +313,20 @@ var DataSeriesFormItemModal = function DataSeriesFormItemModal(_ref) {
312
313
  });
313
314
  var initialAggregation = matchedDataItem === null || matchedDataItem === void 0 ? void 0 : matchedDataItem.aggregationMethod;
314
315
  var initialGrain = matchedDataItem === null || matchedDataItem === void 0 ? void 0 : matchedDataItem.grain;
315
- var selectedDimensionFilter = editDataItem.dataFilter ? Object.keys(editDataItem.dataFilter)[0] : '';
316
+ var selectedDimensionFilter = useMemo(function () {
317
+ return editDataItem.dataFilter ? Object.keys(editDataItem.dataFilter)[0] : '';
318
+ }, [editDataItem.dataFilter]);
319
+ var availableDimensionsItems = useMemo(function () {
320
+ var _availableDimensions$;
321
+ return selectedDimensionFilter && ((_availableDimensions$ = availableDimensions[selectedDimensionFilter]) === null || _availableDimensions$ === void 0 ? void 0 : _availableDimensions$.sort().map(function (item) {
322
+ return {
323
+ id: item,
324
+ text: item.toString()
325
+ };
326
+ })) || [];
327
+ }, [availableDimensions, selectedDimensionFilter]);
316
328
  var DataEditorContent = useMemo(function () {
317
- var _editDataItem$aggrega, _editDataItem$aggrega2, _editDataItem$precisi, _availableDimensions$;
329
+ var _editDataItem$aggrega, _editDataItem$aggrega2, _editDataItem$precisi;
318
330
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, hasAggregationsDropDown && hasAggregationsDropDown(editDataItem) && /*#__PURE__*/React__default.createElement("div", {
319
331
  className: "".concat(baseClassName, "--input-group")
320
332
  }, !initialAggregation || !isSummaryDashboard ?
@@ -494,19 +506,22 @@ var DataSeriesFormItemModal = function DataSeriesFormItemModal(_ref) {
494
506
  autoAlign: true
495
507
  })), /*#__PURE__*/React__default.createElement("div", {
496
508
  className: "".concat(baseClassName, "--input-group--item")
497
- }, !isEmpty(editDataItem.dataFilter) && availableDimensions[selectedDimensionFilter] && /*#__PURE__*/React__default.createElement(Dropdown, {
509
+ }, !isEmpty(editDataItem.dataFilter) && (availableDimensionsItems === null || availableDimensionsItems === void 0 ? void 0 : availableDimensionsItems.length) > 0 && /*#__PURE__*/React__default.createElement(Dropdown, {
498
510
  id: "".concat(id, "_data-filter-value"),
499
511
  label: "",
500
512
  direction: "bottom",
501
- items: (_availableDimensions$ = availableDimensions[selectedDimensionFilter]) === null || _availableDimensions$ === void 0 ? void 0 : _availableDimensions$.sort(),
513
+ items: availableDimensionsItems,
502
514
  light: true,
503
515
  itemToString: function itemToString(item) {
504
- return item === null || item === void 0 ? void 0 : item.toString();
516
+ return item ? item.text : '';
505
517
  },
506
- selectedItem: editDataItem.dataFilter ? editDataItem.dataFilter[selectedDimensionFilter] : undefined,
518
+ selectedItem: availableDimensionsItems.find(function (item) {
519
+ var _editDataItem$dataFil;
520
+ return item.id === ((_editDataItem$dataFil = editDataItem.dataFilter) === null || _editDataItem$dataFil === void 0 ? void 0 : _editDataItem$dataFil[selectedDimensionFilter]);
521
+ }),
507
522
  onChange: function onChange(_ref9) {
508
523
  var selectedItem = _ref9.selectedItem;
509
- var dataFilter = _defineProperty({}, selectedDimensionFilter, selectedItem);
524
+ var dataFilter = _defineProperty({}, selectedDimensionFilter, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.id);
510
525
  setEditDataItem(_objectSpread(_objectSpread({}, editDataItem), {}, {
511
526
  dataFilter: dataFilter
512
527
  }));
@@ -536,7 +551,7 @@ var DataSeriesFormItemModal = function DataSeriesFormItemModal(_ref) {
536
551
  },
537
552
  columnType: editDataItem.columnType || editDataItem.type
538
553
  }));
539
- }, [availableDimensions, availableGrains, baseClassName, cardConfig, editDataItem, handleTranslation, hasAggregationsDropDown, hasColorDropdown, hasDataFilterDropdown, hasDecimalPlacesDropdown, hasGrainsDropDown, hasThresholds, hasTooltip, hasUnit, id, initialAggregation, initialGrain, isSummaryDashboard, isTimeBasedCard$1, mergedI18n, selectedDimensionFilter, setEditDataItem, type]);
554
+ }, [availableDimensions, availableDimensionsItems, availableGrains, baseClassName, cardConfig, editDataItem, handleTranslation, hasAggregationsDropDown, hasColorDropdown, hasDataFilterDropdown, hasDecimalPlacesDropdown, hasGrainsDropDown, hasThresholds, hasTooltip, hasUnit, id, initialAggregation, initialGrain, isSummaryDashboard, isTimeBasedCard$1, mergedI18n, selectedDimensionFilter, setEditDataItem, type]);
540
555
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, showEditor && /*#__PURE__*/React__default.createElement("div", {
541
556
  className: "".concat(baseClassName, "--modal-wrapper")
542
557
  }, /*#__PURE__*/React__default.createElement(ComposedModal, {
@@ -62,7 +62,11 @@ var propTypes = {
62
62
  /** Toggle side panel busy state */
63
63
  isBusy: PropTypes.bool,
64
64
  /** should the footer primary button be disabled */
65
- isPrimaryButtonDisabled: PropTypes.bool
65
+ isPrimaryButtonDisabled: PropTypes.bool,
66
+ /** Custom width in pixels for the side panel (e.g., 400, '400px', or '25rem') */
67
+ width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
68
+ /** Custom background color for the side panel (e.g., '#f4f4f4', 'gray', or any valid CSS color) */
69
+ backgroundColor: PropTypes.string
66
70
  };
67
71
  var defaultProps = {
68
72
  isOpen: false,
@@ -84,7 +88,9 @@ var defaultProps = {
84
88
  onPrimaryButtonClick: undefined,
85
89
  onSecondaryButtonClick: undefined,
86
90
  isBusy: false,
87
- isPrimaryButtonDisabled: false
91
+ isPrimaryButtonDisabled: false,
92
+ width: undefined,
93
+ backgroundColor: undefined
88
94
  };
89
95
  var baseClass = "".concat(iotPrefix, "--sidepanel");
90
96
  var SidePanel = function SidePanel(_ref) {
@@ -104,7 +110,9 @@ var SidePanel = function SidePanel(_ref) {
104
110
  children = _ref.children,
105
111
  style = _ref.style,
106
112
  isBusy = _ref.isBusy,
107
- isPrimaryButtonDisabled = _ref.isPrimaryButtonDisabled;
113
+ isPrimaryButtonDisabled = _ref.isPrimaryButtonDisabled,
114
+ width = _ref.width,
115
+ backgroundColor = _ref.backgroundColor;
108
116
  var titleRef = useRef();
109
117
  var subtitleRef = useRef();
110
118
  var contentRef = useRef();
@@ -192,11 +200,24 @@ var SidePanel = function SidePanel(_ref) {
192
200
  }
193
201
  return "".concat(str.substring(0, length), "...");
194
202
  };
203
+ var panelWidth = useMemo(function () {
204
+ if (width !== undefined) {
205
+ return typeof width === 'number' ? "".concat(width, "px") : width;
206
+ }
207
+ return undefined;
208
+ }, [width]);
209
+ var panelStyle = useMemo(function () {
210
+ return _objectSpread(_objectSpread(_objectSpread({}, style), panelWidth && {
211
+ width: panelWidth
212
+ }), backgroundColor && {
213
+ backgroundColor: backgroundColor
214
+ });
215
+ }, [style, panelWidth, backgroundColor]);
195
216
  return /*#__PURE__*/React__default.createElement("div", {
196
217
  key: "sidePanel--".concat(subtitle),
197
218
  "data-testid": testId,
198
219
  className: classnames("".concat(baseClass), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(baseClass, "--closed"), !isOpen), "".concat(baseClass, "--full-width"), isFullWidth), "".concat(baseClass, "--start"), direction === 'left'), "".concat(baseClass, "--inline"), type === 'inline'), "".concat(baseClass, "--slide-over"), type === 'over'), "".concat(baseClass, "--condensed"), isCondensed || isScrolled)),
199
- style: style
220
+ style: panelStyle
200
221
  }, onToggle && (isOpen || type === 'inline') ? /*#__PURE__*/React__default.createElement(Button, {
201
222
  testId: "".concat(testId, "-toggle-button"),
202
223
  hasIconOnly: true,
@@ -490,6 +511,33 @@ SidePanel.__docgenInfo = {
490
511
  "name": "bool"
491
512
  },
492
513
  "required": false
514
+ },
515
+ "width": {
516
+ "defaultValue": {
517
+ "value": "undefined",
518
+ "computed": true
519
+ },
520
+ "description": "Custom width in pixels for the side panel (e.g., 400, '400px', or '25rem')",
521
+ "type": {
522
+ "name": "union",
523
+ "value": [{
524
+ "name": "number"
525
+ }, {
526
+ "name": "string"
527
+ }]
528
+ },
529
+ "required": false
530
+ },
531
+ "backgroundColor": {
532
+ "defaultValue": {
533
+ "value": "undefined",
534
+ "computed": true
535
+ },
536
+ "description": "Custom background color for the side panel (e.g., '#f4f4f4', 'gray', or any valid CSS color)",
537
+ "type": {
538
+ "name": "string"
539
+ },
540
+ "required": false
493
541
  }
494
542
  }
495
543
  };
@@ -58,7 +58,7 @@ import ErrorTable from './ErrorTable/ErrorTable.js';
58
58
  import { PIN_COLUMN } from './tableUtilities.js';
59
59
  import { FilterEdit } from '@carbon/icons-react';
60
60
 
61
- var _excluded = ["id", "columns", "enablePercentageColumnWidth", "columnGroups", "data", "expandedData", "locale", "view", "actions", "actions", "options", "lightweight", "className", "style", "i18n", "secondaryTitle", "tooltip", "error", "testId", "size", "zIndex", "emptyStateIcon"],
61
+ var _excluded = ["id", "columns", "enablePercentageColumnWidth", "columnGroups", "data", "expandedData", "locale", "view", "actions", "actions", "options", "lightweight", "className", "style", "i18n", "secondaryTitle", "tooltip", "error", "testId", "size", "zIndex", "emptyStateIcon", "deletedAttribute"],
62
62
  _excluded2 = ["renderIcon"],
63
63
  _excluded3 = ["error"],
64
64
  _excluded4 = ["maxPages"];
@@ -393,7 +393,9 @@ var propTypes = {
393
393
  /** Specify the error message that need to be displayed by default.
394
394
  * Incase we use view.table.errorState property then the error state will be displayed instead of error message */
395
395
  error: PropTypes.string,
396
- testId: PropTypes.string
396
+ testId: PropTypes.string,
397
+ /** Attribute name to identify deleted rows */
398
+ deletedAttribute: PropTypes.string
397
399
  };
398
400
  var defaultProps = function defaultProps(baseProps) {
399
401
  return {
@@ -612,7 +614,8 @@ var defaultProps = function defaultProps(baseProps) {
612
614
  // previously used as testId.
613
615
  testId: null,
614
616
  enablePercentageColumnWidth: false,
615
- emptyStateIcon: ''
617
+ emptyStateIcon: '',
618
+ deletedAttribute: undefined
616
619
  };
617
620
  };
618
621
  var Table = function Table(props) {
@@ -640,6 +643,7 @@ var Table = function Table(props) {
640
643
  size = _merge2.size,
641
644
  zIndex = _merge2.zIndex,
642
645
  emptyStateIcon = _merge2.emptyStateIcon,
646
+ deletedAttribute = _merge2.deletedAttribute,
643
647
  others = _objectWithoutProperties(_merge2, _excluded);
644
648
 
645
649
  // There is no way to access the current search value in the Table
@@ -1020,7 +1024,8 @@ var Table = function Table(props) {
1020
1024
  testId: "".concat(id || testId, "-table-body"),
1021
1025
  showExpanderColumn: showExpanderColumn,
1022
1026
  size: size,
1023
- pinColumn: options.pinColumn
1027
+ pinColumn: options.pinColumn,
1028
+ deletedAttribute: deletedAttribute
1024
1029
  })) : /*#__PURE__*/React__default.createElement(EmptyTable, {
1025
1030
  id: id,
1026
1031
  totalColumns: totalColumns,
@@ -2027,6 +2032,13 @@ Table.__docgenInfo = {
2027
2032
  "name": "string"
2028
2033
  },
2029
2034
  "required": false
2035
+ },
2036
+ "deletedAttribute": {
2037
+ "description": "Attribute name to identify deleted rows",
2038
+ "type": {
2039
+ "name": "string"
2040
+ },
2041
+ "required": false
2030
2042
  }
2031
2043
  }
2032
2044
  };
@@ -118,7 +118,9 @@ var propTypes = {
118
118
  /** Optional base z-index for the drag image. See details on Table component. */
119
119
  zIndex: PropTypes.number,
120
120
  /** column to pin in the table */
121
- pinColumn: PinColumnPropTypes
121
+ pinColumn: PinColumnPropTypes,
122
+ /** Attribute name to identify deleted rows */
123
+ deletedAttribute: PropTypes.string
122
124
  };
123
125
  var defaultProps = {
124
126
  expandedIds: [],
@@ -157,7 +159,8 @@ var defaultProps = {
157
159
  hasBreadcrumbDrop: false,
158
160
  hideDragHandles: false,
159
161
  zIndex: 0,
160
- pinColumn: PIN_COLUMN.NONE
162
+ pinColumn: PIN_COLUMN.NONE,
163
+ deletedAttribute: '_deleted'
161
164
  };
162
165
  var TableBody = function TableBody(_ref) {
163
166
  var tableId = _ref.tableId,
@@ -202,7 +205,8 @@ var TableBody = function TableBody(_ref) {
202
205
  hasBreadcrumbDrop = _ref.hasBreadcrumbDrop,
203
206
  hideDragHandles = _ref.hideDragHandles,
204
207
  zIndex = _ref.zIndex,
205
- pinColumn = _ref.pinColumn;
208
+ pinColumn = _ref.pinColumn,
209
+ deletedAttribute = _ref.deletedAttribute;
206
210
  // Need to merge the ordering and the columns since the columns have the renderer function
207
211
  var orderingMap = useMemo(function () {
208
212
  return ordering.map(function (col) {
@@ -357,7 +361,8 @@ var TableBody = function TableBody(_ref) {
357
361
  onDragEnterRow: isDragging ? handleEnterRow : null,
358
362
  onDragLeaveRow: isDragging ? handleLeaveRow : null,
359
363
  dragRowIds: dragRowIds,
360
- canDropRowIds: canDropRowIds
364
+ canDropRowIds: canDropRowIds,
365
+ deletedAttribute: deletedAttribute
361
366
  });
362
367
  })), dragPreview);
363
368
  };
@@ -834,6 +839,17 @@ TableBody.__docgenInfo = {
834
839
  },
835
840
  "required": false
836
841
  },
842
+ "deletedAttribute": {
843
+ "defaultValue": {
844
+ "value": "'_deleted'",
845
+ "computed": false
846
+ },
847
+ "description": "Attribute name to identify deleted rows",
848
+ "type": {
849
+ "name": "string"
850
+ },
851
+ "required": false
852
+ },
837
853
  "tableId": {
838
854
  "description": "The unique id of the table",
839
855
  "type": {
@@ -138,7 +138,9 @@ var propTypes = {
138
138
  /** If this row is being dragged. */
139
139
  isDragRow: PropTypes.bool,
140
140
  /** If all drag handles should be hidden. This happens when an undraggable row is in the selection. */
141
- hideDragHandles: PropTypes.bool
141
+ hideDragHandles: PropTypes.bool,
142
+ /** Attribute name to identify deleted rows */
143
+ deletedAttribute: PropTypes.string
142
144
  };
143
145
  var defaultProps = {
144
146
  isSelected: false,
@@ -174,7 +176,8 @@ var defaultProps = {
174
176
  onDragEnterRow: null,
175
177
  onDragLeaveRow: null,
176
178
  isDraggable: false,
177
- isDragRow: false
179
+ isDragRow: false,
180
+ deletedAttribute: '_deleted'
178
181
  };
179
182
  var TableBodyRow = function TableBodyRow(_ref) {
180
183
  var id = _ref.id,
@@ -231,7 +234,8 @@ var TableBodyRow = function TableBodyRow(_ref) {
231
234
  isDragRow = _ref.isDragRow,
232
235
  isDraggable = _ref.isDraggable,
233
236
  hasDragAndDrop = _ref.hasDragAndDrop,
234
- hideDragHandles = _ref.hideDragHandles;
237
+ hideDragHandles = _ref.hideDragHandles,
238
+ deletedAttribute = _ref.deletedAttribute;
235
239
  var isEditMode = rowEditMode || singleRowEditMode;
236
240
  var singleSelectionIndicatorWidth = hasRowSelection === 'single' ? 0 : 5;
237
241
  var nestingLevelPixels = nestingLevel * 32;
@@ -374,7 +378,7 @@ var TableBodyRow = function TableBodyRow(_ref) {
374
378
  key: id
375
379
  }, /*#__PURE__*/React__default.createElement(TableExpandRow, _extends({
376
380
  expandHeaderId: "".concat(tableId, "-expand"),
377
- className: classnames("".concat(iotPrefix, "--expandable-tablerow--expanded"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(iotPrefix, "--expandable-tablerow--indented"), parseInt(nestingOffset, 10) > 0), "".concat(iotPrefix, "--expandable-tablerow--childless"), hasRowNesting && nestingChildCount === 0), "".concat(iotPrefix, "--table__row--dragging"), isDragRow), "".concat(iotPrefix, "--table__row--softdeleted"), values === null || values === void 0 ? void 0 : values._deleted)),
381
+ className: classnames("".concat(iotPrefix, "--expandable-tablerow--expanded"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(iotPrefix, "--expandable-tablerow--indented"), parseInt(nestingOffset, 10) > 0), "".concat(iotPrefix, "--expandable-tablerow--childless"), hasRowNesting && nestingChildCount === 0), "".concat(iotPrefix, "--table__row--dragging"), isDragRow), "".concat(iotPrefix, "--table__row--softdeleted"), values === null || values === void 0 ? void 0 : values[deletedAttribute])),
378
382
  ariaLabel: clickToCollapseAria,
379
383
  expandIconDescription: clickToCollapseAria,
380
384
  isExpanded: true,
@@ -402,13 +406,13 @@ var TableBodyRow = function TableBodyRow(_ref) {
402
406
  rowId: id,
403
407
  langDir: langDir
404
408
  }, dragEnterLeaveHandlers), tableCells), !hasRowNesting && /*#__PURE__*/React__default.createElement(TableRow, _extends({
405
- className: classnames("".concat(iotPrefix, "--expanded-tablerow"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(iotPrefix, "--expanded-tablerow--singly-selected"), hasRowSelection === 'single' && isSelected && !useRadioButtonSingleSelect), "".concat(iotPrefix, "--table__row--dragging"), isDragRow), "".concat(iotPrefix, "--table__row--softdeleted"), values === null || values === void 0 ? void 0 : values._deleted))
409
+ className: classnames("".concat(iotPrefix, "--expanded-tablerow"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(iotPrefix, "--expanded-tablerow--singly-selected"), hasRowSelection === 'single' && isSelected && !useRadioButtonSingleSelect), "".concat(iotPrefix, "--table__row--dragging"), isDragRow), "".concat(iotPrefix, "--table__row--softdeleted"), values === null || values === void 0 ? void 0 : values[deletedAttribute]))
406
410
  }, dragEnterLeaveHandlers), /*#__PURE__*/React__default.createElement(TableCell, {
407
411
  colSpan: totalColumns
408
412
  }, rowDetails))) : /*#__PURE__*/React__default.createElement(TableExpandRow, _extends({
409
413
  key: id,
410
414
  expandHeaderId: "".concat(tableId, "-expand"),
411
- className: classnames("".concat(iotPrefix, "--expandable-tablerow"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(iotPrefix, "--expandable-tablerow--parent"), hasRowNesting && (hasRowNesting === null || hasRowNesting === void 0 ? void 0 : hasRowNesting.hasSingleNestedHierarchy) && nestingChildCount > 0), "".concat(iotPrefix, "--expandable-tablerow--childless"), hasRowNesting && nestingChildCount === 0), "".concat(iotPrefix, "--expandable-tablerow--indented"), parseInt(nestingOffset, 10) > 0), "".concat(iotPrefix, "--expandable-tablerow--singly-selected"), hasRowSelection === 'single' && isSelected && !useRadioButtonSingleSelect), "".concat(iotPrefix, "--expandable-tablerow--last-child"), isLastChild), "".concat(iotPrefix, "--table__row--dragging"), isDragRow), "".concat(iotPrefix, "--table__row--softdeleted"), values === null || values === void 0 ? void 0 : values._deleted)),
415
+ className: classnames("".concat(iotPrefix, "--expandable-tablerow"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(iotPrefix, "--expandable-tablerow--parent"), hasRowNesting && (hasRowNesting === null || hasRowNesting === void 0 ? void 0 : hasRowNesting.hasSingleNestedHierarchy) && nestingChildCount > 0), "".concat(iotPrefix, "--expandable-tablerow--childless"), hasRowNesting && nestingChildCount === 0), "".concat(iotPrefix, "--expandable-tablerow--indented"), parseInt(nestingOffset, 10) > 0), "".concat(iotPrefix, "--expandable-tablerow--singly-selected"), hasRowSelection === 'single' && isSelected && !useRadioButtonSingleSelect), "".concat(iotPrefix, "--expandable-tablerow--last-child"), isLastChild), "".concat(iotPrefix, "--table__row--dragging"), isDragRow), "".concat(iotPrefix, "--table__row--softdeleted"), values === null || values === void 0 ? void 0 : values[deletedAttribute])),
412
416
  "data-row-nesting": hasRowNesting,
413
417
  "data-child-count": nestingChildCount,
414
418
  "data-nesting-offset": nestingOffset,
@@ -437,7 +441,7 @@ var TableBodyRow = function TableBodyRow(_ref) {
437
441
  rowId: id,
438
442
  langDir: langDir
439
443
  }, dragEnterLeaveHandlers), tableCells) : hasRowSelection === 'single' && isSelected ? /*#__PURE__*/React__default.createElement(TableRow, _extends({
440
- className: classnames("".concat(iotPrefix, "--table__row"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(iotPrefix, "--table__row--singly-selected"), isSelected && !useRadioButtonSingleSelect), "".concat(iotPrefix, "--table__row--background"), isSelected), "".concat(iotPrefix, "--table__row--softdeleted"), values === null || values === void 0 ? void 0 : values._deleted)),
444
+ className: classnames("".concat(iotPrefix, "--table__row"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(iotPrefix, "--table__row--singly-selected"), isSelected && !useRadioButtonSingleSelect), "".concat(iotPrefix, "--table__row--background"), isSelected), "".concat(iotPrefix, "--table__row--softdeleted"), values === null || values === void 0 ? void 0 : values[deletedAttribute])),
441
445
  key: id,
442
446
  onClick: function onClick() {
443
447
  if (isSelectable !== false) {
@@ -448,7 +452,7 @@ var TableBodyRow = function TableBodyRow(_ref) {
448
452
  }
449
453
  }
450
454
  }, dragEnterLeaveHandlers), tableCells) : /*#__PURE__*/React__default.createElement(TableRow, _extends({
451
- className: classnames("".concat(iotPrefix, "--table__row"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(iotPrefix, "--table__row--unselectable"), isSelectable === false), "".concat(iotPrefix, "--table__row--selectable"), isSelectable !== false), "".concat(iotPrefix, "--table__row--editing"), isEditMode), "".concat(iotPrefix, "--table__row--selected"), isSelected), "".concat(iotPrefix, "--table__row--dragging"), isDragRow), "".concat(iotPrefix, "--table__row--softdeleted"), values === null || values === void 0 ? void 0 : values._deleted)),
455
+ className: classnames("".concat(iotPrefix, "--table__row"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(iotPrefix, "--table__row--unselectable"), isSelectable === false), "".concat(iotPrefix, "--table__row--selectable"), isSelectable !== false), "".concat(iotPrefix, "--table__row--editing"), isEditMode), "".concat(iotPrefix, "--table__row--selected"), isSelected), "".concat(iotPrefix, "--table__row--dragging"), isDragRow), "".concat(iotPrefix, "--table__row--softdeleted"), values === null || values === void 0 ? void 0 : values[deletedAttribute])),
452
456
  key: id,
453
457
  onClick: function onClick() {
454
458
  if (isSelectable !== false) {
@@ -933,6 +937,17 @@ TableBodyRow.__docgenInfo = {
933
937
  },
934
938
  "required": false
935
939
  },
940
+ "deletedAttribute": {
941
+ "defaultValue": {
942
+ "value": "'_deleted'",
943
+ "computed": false
944
+ },
945
+ "description": "Attribute name to identify deleted rows",
946
+ "type": {
947
+ "name": "string"
948
+ },
949
+ "required": false
950
+ },
936
951
  "ordering": {
937
952
  "description": "What column ordering is currently applied to the table",
938
953
  "type": {
@@ -127,7 +127,9 @@ var propTypes = {
127
127
  /** Callback for when a row is entered during a drag. This is null when there is not drag. */
128
128
  onDragEnterRow: PropTypes.func,
129
129
  /** Callback for when a row is left during a drag. This is null when there is not drag. */
130
- onDragLeaveRow: PropTypes.func
130
+ onDragLeaveRow: PropTypes.func,
131
+ /** Attribute name to identify deleted rows */
132
+ deletedAttribute: PropTypes.string
131
133
  };
132
134
  var defaultProps = {
133
135
  actionFailedText: 'Action failed',
@@ -172,7 +174,8 @@ var defaultProps = {
172
174
  onDragEnterRow: null,
173
175
  onDragLeaveRow: null,
174
176
  dragRowIds: [],
175
- canDropRowIds: []
177
+ canDropRowIds: [],
178
+ deletedAttribute: '_deleted'
176
179
  };
177
180
  function TableBodyRowRenderer(props) {
178
181
  var actionFailedText = props.actionFailedText,
@@ -222,7 +225,8 @@ function TableBodyRowRenderer(props) {
222
225
  onDragLeaveRow = props.onDragLeaveRow,
223
226
  onDragEnterRow = props.onDragEnterRow,
224
227
  canDropRowIds = props.canDropRowIds,
225
- dragRowIds = props.dragRowIds;
228
+ dragRowIds = props.dragRowIds,
229
+ deletedAttribute = props.deletedAttribute;
226
230
  var isRowExpanded = expandedIds.includes(row.id);
227
231
  var shouldShowChildren = hasRowNesting && isRowExpanded && row.children && row.children.length > 0;
228
232
  var myRowActionState = rowActionsState.find(function (rowAction) {
@@ -307,7 +311,8 @@ function TableBodyRowRenderer(props) {
307
311
  isDraggable: row.isDraggable,
308
312
  showExpanderColumn: showExpanderColumn,
309
313
  size: size,
310
- isLastChild: isLastChild
314
+ isLastChild: isLastChild,
315
+ deletedAttribute: deletedAttribute
311
316
  }) : /*#__PURE__*/React__default.createElement(TableBodyLoadMoreRow, {
312
317
  id: row.id,
313
318
  key: "".concat(row.id, "--load-more"),
@@ -899,6 +904,17 @@ TableBodyRowRenderer.__docgenInfo = {
899
904
  },
900
905
  "required": false
901
906
  },
907
+ "deletedAttribute": {
908
+ "defaultValue": {
909
+ "value": "'_deleted'",
910
+ "computed": false
911
+ },
912
+ "description": "Attribute name to identify deleted rows",
913
+ "type": {
914
+ "name": "string"
915
+ },
916
+ "required": false
917
+ },
902
918
  "tableId": {
903
919
  "description": "The unique id of the table",
904
920
  "type": {
@@ -50,6 +50,8 @@ var TimeSeriesDatasetPropTypes = PropTypes.shape({
50
50
  dataSourceId: PropTypes.string.isRequired,
51
51
  /** optional filter to apply to this particular line */
52
52
  dataFilter: PropTypes.objectOf(PropTypes.any),
53
+ /** optional param to disable DataFilter */
54
+ disableDataFilter: PropTypes.bool,
53
55
  /** optional param to set the colors */
54
56
  color: PropTypes.string
55
57
  });
@@ -218,10 +218,12 @@ var formatChartData = function formatChartData() {
218
218
  var dataSourceId = _ref2.dataSourceId,
219
219
  _ref2$dataFilter = _ref2.dataFilter,
220
220
  dataFilter = _ref2$dataFilter === void 0 ? {} : _ref2$dataFilter,
221
- label = _ref2.label;
221
+ label = _ref2.label,
222
+ _ref2$disableDataFilt = _ref2.disableDataFilter,
223
+ disableDataFilter = _ref2$disableDataFilt === void 0 ? false : _ref2$disableDataFilt;
222
224
  timestamps.forEach(function (timestamp) {
223
225
  // First filter based on on the dataFilter
224
- var filteredData = filter(values, dataFilter);
226
+ var filteredData = !disableDataFilter ? filter(values, dataFilter) : values;
225
227
  if (!isEmpty(filteredData)) {
226
228
  // have to filter out null values from the dataset, as it causes Carbon Charts to break
227
229
  filteredData.filter(function (dataItem) {
@@ -11,6 +11,9 @@ import warning from 'warning';
11
11
 
12
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
13
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
+
15
+ // trigger lerna build
16
+
14
17
  var didWarnAboutDeprecation = {};
15
18
  function deprecate(propType, message) {
16
19
  function checker(props, propName, componentName) {
@@ -9,6 +9,7 @@ require('core-js/modules/es.array.concat.js');
9
9
  require('core-js/modules/es.array.filter.js');
10
10
  require('core-js/modules/es.array.find.js');
11
11
  require('core-js/modules/es.array.find-index.js');
12
+ require('core-js/modules/es.array.map.js');
12
13
  require('core-js/modules/es.array.slice.js');
13
14
  require('core-js/modules/es.array.sort.js');
14
15
  require('core-js/modules/es.number.constructor.js');
@@ -321,9 +322,20 @@ var DataSeriesFormItemModal = function DataSeriesFormItemModal(_ref) {
321
322
  });
322
323
  var initialAggregation = matchedDataItem === null || matchedDataItem === void 0 ? void 0 : matchedDataItem.aggregationMethod;
323
324
  var initialGrain = matchedDataItem === null || matchedDataItem === void 0 ? void 0 : matchedDataItem.grain;
324
- var selectedDimensionFilter = editDataItem.dataFilter ? Object.keys(editDataItem.dataFilter)[0] : '';
325
+ var selectedDimensionFilter = React.useMemo(function () {
326
+ return editDataItem.dataFilter ? Object.keys(editDataItem.dataFilter)[0] : '';
327
+ }, [editDataItem.dataFilter]);
328
+ var availableDimensionsItems = React.useMemo(function () {
329
+ var _availableDimensions$;
330
+ return selectedDimensionFilter && ((_availableDimensions$ = availableDimensions[selectedDimensionFilter]) === null || _availableDimensions$ === void 0 ? void 0 : _availableDimensions$.sort().map(function (item) {
331
+ return {
332
+ id: item,
333
+ text: item.toString()
334
+ };
335
+ })) || [];
336
+ }, [availableDimensions, selectedDimensionFilter]);
325
337
  var DataEditorContent = React.useMemo(function () {
326
- var _editDataItem$aggrega, _editDataItem$aggrega2, _editDataItem$precisi, _availableDimensions$;
338
+ var _editDataItem$aggrega, _editDataItem$aggrega2, _editDataItem$precisi;
327
339
  return /*#__PURE__*/React__default.default.createElement(React__default.default.Fragment, null, hasAggregationsDropDown && hasAggregationsDropDown(editDataItem) && /*#__PURE__*/React__default.default.createElement("div", {
328
340
  className: "".concat(baseClassName, "--input-group")
329
341
  }, !initialAggregation || !isSummaryDashboard ?
@@ -503,19 +515,22 @@ var DataSeriesFormItemModal = function DataSeriesFormItemModal(_ref) {
503
515
  autoAlign: true
504
516
  })), /*#__PURE__*/React__default.default.createElement("div", {
505
517
  className: "".concat(baseClassName, "--input-group--item")
506
- }, !isEmpty(editDataItem.dataFilter) && availableDimensions[selectedDimensionFilter] && /*#__PURE__*/React__default.default.createElement(react.Dropdown, {
518
+ }, !isEmpty(editDataItem.dataFilter) && (availableDimensionsItems === null || availableDimensionsItems === void 0 ? void 0 : availableDimensionsItems.length) > 0 && /*#__PURE__*/React__default.default.createElement(react.Dropdown, {
507
519
  id: "".concat(id, "_data-filter-value"),
508
520
  label: "",
509
521
  direction: "bottom",
510
- items: (_availableDimensions$ = availableDimensions[selectedDimensionFilter]) === null || _availableDimensions$ === void 0 ? void 0 : _availableDimensions$.sort(),
522
+ items: availableDimensionsItems,
511
523
  light: true,
512
524
  itemToString: function itemToString(item) {
513
- return item === null || item === void 0 ? void 0 : item.toString();
525
+ return item ? item.text : '';
514
526
  },
515
- selectedItem: editDataItem.dataFilter ? editDataItem.dataFilter[selectedDimensionFilter] : undefined,
527
+ selectedItem: availableDimensionsItems.find(function (item) {
528
+ var _editDataItem$dataFil;
529
+ return item.id === ((_editDataItem$dataFil = editDataItem.dataFilter) === null || _editDataItem$dataFil === void 0 ? void 0 : _editDataItem$dataFil[selectedDimensionFilter]);
530
+ }),
516
531
  onChange: function onChange(_ref9) {
517
532
  var selectedItem = _ref9.selectedItem;
518
- var dataFilter = _defineProperty__default.default({}, selectedDimensionFilter, selectedItem);
533
+ var dataFilter = _defineProperty__default.default({}, selectedDimensionFilter, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.id);
519
534
  setEditDataItem(_objectSpread(_objectSpread({}, editDataItem), {}, {
520
535
  dataFilter: dataFilter
521
536
  }));
@@ -545,7 +560,7 @@ var DataSeriesFormItemModal = function DataSeriesFormItemModal(_ref) {
545
560
  },
546
561
  columnType: editDataItem.columnType || editDataItem.type
547
562
  }));
548
- }, [availableDimensions, availableGrains, baseClassName, cardConfig, editDataItem, handleTranslation, hasAggregationsDropDown, hasColorDropdown, hasDataFilterDropdown, hasDecimalPlacesDropdown, hasGrainsDropDown, hasThresholds, hasTooltip, hasUnit, id, initialAggregation, initialGrain, isSummaryDashboard, isTimeBasedCard, mergedI18n, selectedDimensionFilter, setEditDataItem, type]);
563
+ }, [availableDimensions, availableDimensionsItems, availableGrains, baseClassName, cardConfig, editDataItem, handleTranslation, hasAggregationsDropDown, hasColorDropdown, hasDataFilterDropdown, hasDecimalPlacesDropdown, hasGrainsDropDown, hasThresholds, hasTooltip, hasUnit, id, initialAggregation, initialGrain, isSummaryDashboard, isTimeBasedCard, mergedI18n, selectedDimensionFilter, setEditDataItem, type]);
549
564
  return /*#__PURE__*/React__default.default.createElement(React__default.default.Fragment, null, showEditor && /*#__PURE__*/React__default.default.createElement("div", {
550
565
  className: "".concat(baseClassName, "--modal-wrapper")
551
566
  }, /*#__PURE__*/React__default.default.createElement(ComposedModal.default, {
@@ -73,7 +73,11 @@ var propTypes = {
73
73
  /** Toggle side panel busy state */
74
74
  isBusy: PropTypes__default.default.bool,
75
75
  /** should the footer primary button be disabled */
76
- isPrimaryButtonDisabled: PropTypes__default.default.bool
76
+ isPrimaryButtonDisabled: PropTypes__default.default.bool,
77
+ /** Custom width in pixels for the side panel (e.g., 400, '400px', or '25rem') */
78
+ width: PropTypes__default.default.oneOfType([PropTypes__default.default.number, PropTypes__default.default.string]),
79
+ /** Custom background color for the side panel (e.g., '#f4f4f4', 'gray', or any valid CSS color) */
80
+ backgroundColor: PropTypes__default.default.string
77
81
  };
78
82
  var defaultProps = {
79
83
  isOpen: false,
@@ -95,7 +99,9 @@ var defaultProps = {
95
99
  onPrimaryButtonClick: undefined,
96
100
  onSecondaryButtonClick: undefined,
97
101
  isBusy: false,
98
- isPrimaryButtonDisabled: false
102
+ isPrimaryButtonDisabled: false,
103
+ width: undefined,
104
+ backgroundColor: undefined
99
105
  };
100
106
  var baseClass = "".concat(iotPrefix, "--sidepanel");
101
107
  var SidePanel = function SidePanel(_ref) {
@@ -115,7 +121,9 @@ var SidePanel = function SidePanel(_ref) {
115
121
  children = _ref.children,
116
122
  style = _ref.style,
117
123
  isBusy = _ref.isBusy,
118
- isPrimaryButtonDisabled = _ref.isPrimaryButtonDisabled;
124
+ isPrimaryButtonDisabled = _ref.isPrimaryButtonDisabled,
125
+ width = _ref.width,
126
+ backgroundColor = _ref.backgroundColor;
119
127
  var titleRef = React.useRef();
120
128
  var subtitleRef = React.useRef();
121
129
  var contentRef = React.useRef();
@@ -203,11 +211,24 @@ var SidePanel = function SidePanel(_ref) {
203
211
  }
204
212
  return "".concat(str.substring(0, length), "...");
205
213
  };
214
+ var panelWidth = React.useMemo(function () {
215
+ if (width !== undefined) {
216
+ return typeof width === 'number' ? "".concat(width, "px") : width;
217
+ }
218
+ return undefined;
219
+ }, [width]);
220
+ var panelStyle = React.useMemo(function () {
221
+ return _objectSpread(_objectSpread(_objectSpread({}, style), panelWidth && {
222
+ width: panelWidth
223
+ }), backgroundColor && {
224
+ backgroundColor: backgroundColor
225
+ });
226
+ }, [style, panelWidth, backgroundColor]);
206
227
  return /*#__PURE__*/React__default.default.createElement("div", {
207
228
  key: "sidePanel--".concat(subtitle),
208
229
  "data-testid": testId,
209
230
  className: classnames__default.default("".concat(baseClass), _defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default({}, "".concat(baseClass, "--closed"), !isOpen), "".concat(baseClass, "--full-width"), isFullWidth), "".concat(baseClass, "--start"), direction === 'left'), "".concat(baseClass, "--inline"), type === 'inline'), "".concat(baseClass, "--slide-over"), type === 'over'), "".concat(baseClass, "--condensed"), isCondensed || isScrolled)),
210
- style: style
231
+ style: panelStyle
211
232
  }, onToggle && (isOpen || type === 'inline') ? /*#__PURE__*/React__default.default.createElement(Button, {
212
233
  testId: "".concat(testId, "-toggle-button"),
213
234
  hasIconOnly: true,
@@ -501,6 +522,33 @@ SidePanel.__docgenInfo = {
501
522
  "name": "bool"
502
523
  },
503
524
  "required": false
525
+ },
526
+ "width": {
527
+ "defaultValue": {
528
+ "value": "undefined",
529
+ "computed": true
530
+ },
531
+ "description": "Custom width in pixels for the side panel (e.g., 400, '400px', or '25rem')",
532
+ "type": {
533
+ "name": "union",
534
+ "value": [{
535
+ "name": "number"
536
+ }, {
537
+ "name": "string"
538
+ }]
539
+ },
540
+ "required": false
541
+ },
542
+ "backgroundColor": {
543
+ "defaultValue": {
544
+ "value": "undefined",
545
+ "computed": true
546
+ },
547
+ "description": "Custom background color for the side panel (e.g., '#f4f4f4', 'gray', or any valid CSS color)",
548
+ "type": {
549
+ "name": "string"
550
+ },
551
+ "required": false
504
552
  }
505
553
  }
506
554
  };