@carbon/ibm-products 2.4.1 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +0 -4
- 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.css +0 -4
- 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 +0 -4
- 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/AddSelect/AddSelectRow.js +1 -1
- package/es/components/AddSelect/AddSelectSidebar.js +1 -1
- package/es/components/AddSelect/add-select-utils.js +2 -2
- package/es/components/CreateTearsheet/CreateTearsheetStep.js +18 -5
- package/es/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +7 -4
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +2 -2
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +1 -1
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetEdit.js +1 -1
- package/es/components/DataSpreadsheet/utils/checkSelectedHeaderCell.js +4 -4
- package/es/components/DataSpreadsheet/utils/handleCellDeletion.js +4 -4
- package/es/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +2 -2
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
- package/es/components/Datagrid/Datagrid/DatagridRow.js +3 -3
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +7 -7
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +6 -6
- package/es/components/Datagrid/useActionsColumn.js +13 -7
- package/es/components/Datagrid/useDisableSelectRows.js +4 -4
- package/es/components/Datagrid/useInlineEdit.js +2 -2
- package/es/components/Datagrid/useOnRowClick.js +20 -4
- package/es/components/Datagrid/useSortableColumns.js +35 -3
- package/es/components/Datagrid/useStickyColumn.js +1 -1
- package/es/components/ExportModal/ExportModal.js +1 -1
- package/es/components/NotificationsPanel/NotificationsPanel.js +6 -3
- package/es/components/SidePanel/SidePanel.js +3 -3
- package/es/components/TagSet/TagSetModal.js +3 -3
- package/es/global/js/utils/StoryDocsPage.js +2 -2
- package/es/global/js/utils/Wrap.js +1 -1
- package/es/global/js/utils/props-helper.js +1 -1
- package/es/global/js/utils/story-helper.js +3 -3
- package/lib/components/AddSelect/AddSelectRow.js +1 -1
- package/lib/components/AddSelect/AddSelectSidebar.js +1 -1
- package/lib/components/AddSelect/add-select-utils.js +2 -2
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +17 -4
- package/lib/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +6 -3
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +2 -2
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +1 -1
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetEdit.js +1 -1
- package/lib/components/DataSpreadsheet/utils/checkSelectedHeaderCell.js +4 -4
- package/lib/components/DataSpreadsheet/utils/handleCellDeletion.js +4 -4
- package/lib/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +2 -2
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +3 -3
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +7 -7
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +6 -6
- package/lib/components/Datagrid/useActionsColumn.js +13 -7
- package/lib/components/Datagrid/useDisableSelectRows.js +4 -4
- package/lib/components/Datagrid/useInlineEdit.js +2 -2
- package/lib/components/Datagrid/useOnRowClick.js +20 -4
- package/lib/components/Datagrid/useSortableColumns.js +35 -3
- package/lib/components/Datagrid/useStickyColumn.js +1 -1
- package/lib/components/ExportModal/ExportModal.js +1 -1
- package/lib/components/NotificationsPanel/NotificationsPanel.js +6 -3
- package/lib/components/SidePanel/SidePanel.js +3 -3
- package/lib/components/TagSet/TagSetModal.js +3 -3
- package/lib/global/js/utils/StoryDocsPage.js +2 -2
- package/lib/global/js/utils/Wrap.js +1 -1
- package/lib/global/js/utils/props-helper.js +1 -1
- package/lib/global/js/utils/story-helper.js +3 -3
- package/package.json +11 -11
- package/scss/components/Datagrid/styles/_datagrid.scss +0 -8
@@ -161,7 +161,9 @@ var MultiStepTearsheet = function MultiStepTearsheet(_ref2) {
|
|
161
161
|
fieldsetLegendText: "Topic information",
|
162
162
|
disableSubmit: !stepOneTextInputValue,
|
163
163
|
subtitle: "This is the unique name used to recognize your topic",
|
164
|
-
description: "It will also be used by your producers and consumers as part of the connection information, so make it something easy to recognize."
|
164
|
+
description: /*#__PURE__*/_react.default.createElement("div", null, "It will also be used by your producers and consumers as part of the connection information, so make it something easy to recognize. ", /*#__PURE__*/_react.default.createElement(_react2.Link, {
|
165
|
+
href: "#"
|
166
|
+
}, "Learn more."))
|
165
167
|
}, /*#__PURE__*/_react.default.createElement(_react2.Grid, null, /*#__PURE__*/_react.default.createElement(_react2.Column, {
|
166
168
|
xlg: 8,
|
167
169
|
lg: 8,
|
@@ -215,8 +217,9 @@ var MultiStepTearsheet = function MultiStepTearsheet(_ref2) {
|
|
215
217
|
}), /*#__PURE__*/_react.default.createElement(_react2.Checkbox, {
|
216
218
|
labelText: "Include additional step",
|
217
219
|
id: "include-additional-step-checkbox",
|
218
|
-
onChange: function onChange(
|
219
|
-
|
220
|
+
onChange: function onChange(event, _ref3) {
|
221
|
+
var checked = _ref3.checked;
|
222
|
+
return setShouldIncludeAdditionalStep(checked);
|
220
223
|
},
|
221
224
|
checked: shouldIncludeAdditionalStep
|
222
225
|
})))), /*#__PURE__*/_react.default.createElement(_CreateTearsheetStep.CreateTearsheetStep, {
|
@@ -86,7 +86,7 @@ var DataSpreadsheetBody = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
86
86
|
(0, _react.useEffect)(function () {
|
87
87
|
if (selectionAreaData.length) {
|
88
88
|
var _previousState$select;
|
89
|
-
if (!clickAndHoldActive && previousState !== null && previousState !== void 0 && previousState.clickAndHoldActive || (previousState === null || previousState === void 0
|
89
|
+
if (!clickAndHoldActive && previousState !== null && previousState !== void 0 && previousState.clickAndHoldActive || (previousState === null || previousState === void 0 || (_previousState$select = previousState.selectionAreaData) === null || _previousState$select === void 0 ? void 0 : _previousState$select.length) !== (selectionAreaData === null || selectionAreaData === void 0 ? void 0 : selectionAreaData.length)) {
|
90
90
|
onSelectionAreaChange(selectionAreaData);
|
91
91
|
}
|
92
92
|
}
|
@@ -396,7 +396,7 @@ var DataSpreadsheetBody = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
396
396
|
role: "gridcell",
|
397
397
|
style: _objectSpread(_objectSpread({}, cell.getCellProps().style), {}, {
|
398
398
|
display: 'grid',
|
399
|
-
minWidth: (cell === null || cell === void 0
|
399
|
+
minWidth: (cell === null || cell === void 0 || (_cell$column = cell.column) === null || _cell$column === void 0 ? void 0 : _cell$column.width) || (defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.width)
|
400
400
|
})
|
401
401
|
}), /*#__PURE__*/_react.default.createElement("button", {
|
402
402
|
id: "".concat(blockClass, "__cell--").concat(cell.row.index, "--").concat(index),
|
@@ -65,7 +65,7 @@ var DataSpreadsheetHeader = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
|
|
65
65
|
(0, _react.useEffect)(function () {
|
66
66
|
if ((previousState === null || previousState === void 0 ? void 0 : previousState.cellSize) !== cellSize) {
|
67
67
|
var _ref$current;
|
68
|
-
var scrollContainer = ref === null || ref === void 0
|
68
|
+
var scrollContainer = ref === null || ref === void 0 || (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.querySelector(".".concat(blockClass, "__list--container"));
|
69
69
|
var hasScrollBar = (scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.scrollHeight) > (scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.clientHeight);
|
70
70
|
var scrollBarValue = hasScrollBar ? 0 : scrollBarSize;
|
71
71
|
setScrollBarSizeValue(scrollBarValue);
|
@@ -54,7 +54,7 @@ var useSpreadsheetEdit = function useSpreadsheetEdit(_ref) {
|
|
54
54
|
cellEditorRef.current.style.display = 'block';
|
55
55
|
cellEditorRef.current.style.height = activeCellRef === null || activeCellRef === void 0 ? void 0 : activeCellRef.current.style.height;
|
56
56
|
cellEditorRef.current.style.paddingTop = "".concat((parseInt(activeCellRef === null || activeCellRef === void 0 ? void 0 : activeCellRef.current.style.height) - 16) / 2 - 1, "px"); // calculate paddingTop based on cellHeight which could be variable depending on the cellSize prop
|
57
|
-
cellEditorRef.current.style.textAlign = (cellProps === null || cellProps === void 0
|
57
|
+
cellEditorRef.current.style.textAlign = (cellProps === null || cellProps === void 0 || (_cellProps$column = cellProps.column) === null || _cellProps$column === void 0 ? void 0 : _cellProps$column.placement) === 'right' ? 'right' : 'left';
|
58
58
|
(_cellEditorRef$curren = cellEditorRef.current) === null || _cellEditorRef$curren === void 0 ? void 0 : _cellEditorRef$curren.focus();
|
59
59
|
if (rulerWidth < cellEditorCurrentWidth) {
|
60
60
|
var _visibleColumns$nextI;
|
@@ -17,10 +17,10 @@ var checkSelectedHeaderCell = function checkSelectedHeaderCell(headerIndex, sele
|
|
17
17
|
var isSelectedHeader = areasCloned.some(function (area) {
|
18
18
|
var _area$point, _area$point2, _area$point3, _area$point4, _area$point5, _area$point6, _area$point7, _area$point8;
|
19
19
|
var oppositeType = headerType === 'column' ? 'row' : 'column';
|
20
|
-
var minOppositeSelection = Math.min(area === null || area === void 0
|
21
|
-
var maxOppositeSelection = Math.max(area === null || area === void 0
|
22
|
-
var minSelection = Math.min(area === null || area === void 0
|
23
|
-
var maxSelection = Math.max(area === null || area === void 0
|
20
|
+
var minOppositeSelection = Math.min(area === null || area === void 0 || (_area$point = area.point1) === null || _area$point === void 0 ? void 0 : _area$point[oppositeType], area === null || area === void 0 || (_area$point2 = area.point2) === null || _area$point2 === void 0 ? void 0 : _area$point2[oppositeType]);
|
21
|
+
var maxOppositeSelection = Math.max(area === null || area === void 0 || (_area$point3 = area.point1) === null || _area$point3 === void 0 ? void 0 : _area$point3[oppositeType], area === null || area === void 0 || (_area$point4 = area.point2) === null || _area$point4 === void 0 ? void 0 : _area$point4[oppositeType]);
|
22
|
+
var minSelection = Math.min(area === null || area === void 0 || (_area$point5 = area.point1) === null || _area$point5 === void 0 ? void 0 : _area$point5[headerType], area === null || area === void 0 || (_area$point6 = area.point2) === null || _area$point6 === void 0 ? void 0 : _area$point6[headerType]);
|
23
|
+
var maxSelection = Math.max(area === null || area === void 0 || (_area$point7 = area.point1) === null || _area$point7 === void 0 ? void 0 : _area$point7[headerType], area === null || area === void 0 || (_area$point8 = area.point2) === null || _area$point8 === void 0 ? void 0 : _area$point8[headerType]);
|
24
24
|
var isTrueSelectedState = (items === null || items === void 0 ? void 0 : items.length) - 1 === maxOppositeSelection && minOppositeSelection === 0;
|
25
25
|
// console.log({minSelection, maxSelection});
|
26
26
|
// Iterate over all columns included in the selection area
|
@@ -32,10 +32,10 @@ var handleCellDeletion = function handleCellDeletion(_ref) {
|
|
32
32
|
return item.matcher === currentMatcher;
|
33
33
|
});
|
34
34
|
var selectionAreaToEmptyContents = selectionAreaClone[indexOfCurrentSelectionArea];
|
35
|
-
var lowestColumnIndex = Math.min(selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0
|
36
|
-
var greatestColumnIndex = Math.max(selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0
|
37
|
-
var lowestRowIndex = Math.min(selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0
|
38
|
-
var greatestRowIndex = Math.max(selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0
|
35
|
+
var lowestColumnIndex = Math.min(selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 || (_selectionAreaToEmpty = selectionAreaToEmptyContents.point1) === null || _selectionAreaToEmpty === void 0 ? void 0 : _selectionAreaToEmpty.column, selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 || (_selectionAreaToEmpty2 = selectionAreaToEmptyContents.point2) === null || _selectionAreaToEmpty2 === void 0 ? void 0 : _selectionAreaToEmpty2.column);
|
36
|
+
var greatestColumnIndex = Math.max(selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 || (_selectionAreaToEmpty3 = selectionAreaToEmptyContents.point1) === null || _selectionAreaToEmpty3 === void 0 ? void 0 : _selectionAreaToEmpty3.column, selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 || (_selectionAreaToEmpty4 = selectionAreaToEmptyContents.point2) === null || _selectionAreaToEmpty4 === void 0 ? void 0 : _selectionAreaToEmpty4.column);
|
37
|
+
var lowestRowIndex = Math.min(selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 || (_selectionAreaToEmpty5 = selectionAreaToEmptyContents.point1) === null || _selectionAreaToEmpty5 === void 0 ? void 0 : _selectionAreaToEmpty5.row, selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 || (_selectionAreaToEmpty6 = selectionAreaToEmptyContents.point2) === null || _selectionAreaToEmpty6 === void 0 ? void 0 : _selectionAreaToEmpty6.row);
|
38
|
+
var greatestRowIndex = Math.max(selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 || (_selectionAreaToEmpty7 = selectionAreaToEmptyContents.point1) === null || _selectionAreaToEmpty7 === void 0 ? void 0 : _selectionAreaToEmpty7.row, selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 || (_selectionAreaToEmpty8 = selectionAreaToEmptyContents.point2) === null || _selectionAreaToEmpty8 === void 0 ? void 0 : _selectionAreaToEmpty8.row);
|
39
39
|
(0, _rangeWithCallback.rangeWithCallback)(lowestColumnIndex, greatestColumnIndex, function (columnIndex) {
|
40
40
|
(0, _rangeWithCallback.rangeWithCallback)(lowestRowIndex, greatestRowIndex, function (rowIndex) {
|
41
41
|
var cellProps = rows[rowIndex].cells[columnIndex];
|
@@ -98,7 +98,7 @@ var handleHeaderCellSelection = function handleHeaderCellSelection(_ref2) {
|
|
98
98
|
return [].concat((0, _toConsumableArray2.default)(prev), [newSelectionArea]);
|
99
99
|
}
|
100
100
|
if (isHoldingShiftKey) {
|
101
|
-
var _selectionAreasClone
|
101
|
+
var _selectionAreasClone$;
|
102
102
|
var _selectionsFromHeaderCell = selectionsClone.filter(function (item) {
|
103
103
|
var _item$header3;
|
104
104
|
return (_item$header3 = item.header) === null || _item$header3 === void 0 ? void 0 : _item$header3.type;
|
@@ -118,7 +118,7 @@ var handleHeaderCellSelection = function handleHeaderCellSelection(_ref2) {
|
|
118
118
|
return item.matcher === currentMatcher;
|
119
119
|
});
|
120
120
|
var newIndexList = getSelectedItemIndexList({
|
121
|
-
indexList: ((_selectionAreasClone$ = selectionAreasClone[indexOfCurrentArea]) === null || _selectionAreasClone$ === void 0
|
121
|
+
indexList: ((_selectionAreasClone$ = selectionAreasClone[indexOfCurrentArea]) === null || _selectionAreasClone$ === void 0 || (_selectionAreasClone$ = _selectionAreasClone$.header) === null || _selectionAreasClone$ === void 0 ? void 0 : _selectionAreasClone$.selectedIndexList) || [type === 'column' ? columnValue : rowValue],
|
122
122
|
newIndex: newIndexValue,
|
123
123
|
activeCellIndex: activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates[type]
|
124
124
|
});
|
@@ -42,7 +42,7 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
|
|
42
42
|
return /*#__PURE__*/_react.default.createElement(_react2.TableHeader, (0, _extends2.default)({}, header.getHeaderProps({
|
43
43
|
role: false
|
44
44
|
}), {
|
45
|
-
className: (0, _classnames.default)((_cx = {}, (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__resizableColumn"), header.getResizerProps), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__isResizing"), header.isResizing), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__sortableColumn"),
|
45
|
+
className: (0, _classnames.default)((_cx = {}, (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__resizableColumn"), header.getResizerProps), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__isResizing"), header.isResizing), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__sortableColumn"), datagridState.isTableSortable), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__isSorted"), header.isSorted), _cx), header.getHeaderProps().className),
|
46
46
|
key: header.id
|
47
47
|
}), header.render('Header'), header.getResizerProps && /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, header.getResizerProps(), {
|
48
48
|
className: "".concat(blockClass, "__resizer")
|
@@ -58,9 +58,9 @@ var DatagridRow = function DatagridRow(datagridState) {
|
|
58
58
|
hoverRow === null || hoverRow === void 0 ? void 0 : hoverRow.classList.add("".concat(blockClass, "__carbon-row-expanded-hover-active"));
|
59
59
|
var rowExpanderButton = hoverRow === null || hoverRow === void 0 ? void 0 : hoverRow.querySelector(".".concat(blockClass, "__row-expander"));
|
60
60
|
var rowSizeValue = rowSize || 'lg';
|
61
|
-
hoverRow === null || hoverRow === void 0
|
62
|
-
hoverRow === null || hoverRow === void 0
|
63
|
-
hoverRow === null || hoverRow === void 0
|
61
|
+
hoverRow === null || hoverRow === void 0 || (_hoverRow$style = hoverRow.style) === null || _hoverRow$style === void 0 ? void 0 : _hoverRow$style.setProperty("--".concat(blockClass, "--indicator-height"), totalNestedRowIndicatorHeight);
|
62
|
+
hoverRow === null || hoverRow === void 0 || (_hoverRow$style2 = hoverRow.style) === null || _hoverRow$style2 === void 0 ? void 0 : _hoverRow$style2.setProperty("--".concat(blockClass, "--row-height"), (0, _layout.px)(rowHeights[rowSizeValue]));
|
63
|
+
hoverRow === null || hoverRow === void 0 || (_hoverRow$style3 = hoverRow.style) === null || _hoverRow$style3 === void 0 ? void 0 : _hoverRow$style3.setProperty("--".concat(blockClass, "--indicator-offset-amount"), (0, _layout.px)((rowExpanderButton === null || rowExpanderButton === void 0 ? void 0 : rowExpanderButton.offsetLeft) || 0));
|
64
64
|
};
|
65
65
|
var focusRemover = function focusRemover() {
|
66
66
|
var elements = document.querySelectorAll(".".concat(blockClass, "__carbon-row-expanded"));
|
@@ -39,17 +39,17 @@ var DraggableItemsList = function DraggableItemsList(_ref) {
|
|
39
39
|
}).filter(function (colDef) {
|
40
40
|
return !colDef.isAction;
|
41
41
|
}).filter(function (colDef) {
|
42
|
-
var _colDef$Header$props$2, _colDef$Header$props2
|
42
|
+
var _colDef$Header$props$2, _colDef$Header$props2;
|
43
43
|
var sortableTitle = isTableSortable && ((_colDef$Header$props$2 = colDef.Header().props.children.props) === null || _colDef$Header$props$2 === void 0 ? void 0 : _colDef$Header$props$2.title);
|
44
|
-
return filterString.length === 0 || (isTableSortable ? sortableTitle === null || sortableTitle === void 0 ? void 0 : sortableTitle.toLowerCase().includes(filterString) : (_colDef$Header$props2 = colDef.Header.props) === null || _colDef$Header$props2 === void 0
|
44
|
+
return filterString.length === 0 || (isTableSortable ? sortableTitle === null || sortableTitle === void 0 ? void 0 : sortableTitle.toLowerCase().includes(filterString) : (_colDef$Header$props2 = colDef.Header.props) === null || _colDef$Header$props2 === void 0 || (_colDef$Header$props2 = _colDef$Header$props2.title) === null || _colDef$Header$props2 === void 0 ? void 0 : _colDef$Header$props2.toLowerCase().includes(filterString)) && colDef.id !== 'spacer';
|
45
45
|
}).map(function (colDef, i) {
|
46
|
-
var _colDef$Header$props$3, _colDef$Header$
|
46
|
+
var _colDef$Header$props$3, _colDef$Header$props3, _colDef$Header$props4, _colDef$Header$props5, _colDef$Header$props6;
|
47
47
|
var isSortableColumn = !!colDef.canSort && !!isTableSortable;
|
48
48
|
var sortableTitle = isTableSortable && ((_colDef$Header$props$3 = colDef.Header().props.children.props) === null || _colDef$Header$props$3 === void 0 ? void 0 : _colDef$Header$props$3.title);
|
49
49
|
var searchString = new RegExp('(' + filterString + ')');
|
50
50
|
var res = filterString.length ? isSortableColumn ? sortableTitle.toLowerCase().split(searchString) : colDef.Header.props.title.toLowerCase().split(searchString) : null;
|
51
51
|
var firstWord = res !== null ? res[0] === '' ? res[1].charAt(0).toUpperCase() + res[1].substring(1) : res[0].charAt(0).toUpperCase() + res[0].substring(1) : null;
|
52
|
-
var highlightedText = res !== null ? res[0] === '' ? "<strong>".concat(firstWord, "</strong>") + res[2] : firstWord + "<strong>".concat(res[1], "</strong>") + res[2] : isSortableColumn ? sortableTitle : (_colDef$Header$
|
52
|
+
var highlightedText = res !== null ? res[0] === '' ? "<strong>".concat(firstWord, "</strong>") + res[2] : firstWord + "<strong>".concat(res[1], "</strong>") + res[2] : isSortableColumn ? sortableTitle : (_colDef$Header$props3 = colDef.Header.props) === null || _colDef$Header$props3 === void 0 ? void 0 : _colDef$Header$props3.title;
|
53
53
|
var isFrozenColumn = !!colDef.sticky;
|
54
54
|
var listContents = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_react2.Checkbox, {
|
55
55
|
wrapperClassName: "".concat(blockClass, "__customize-columns-checkbox-wrapper"),
|
@@ -60,8 +60,8 @@ var DraggableItemsList = function DraggableItemsList(_ref) {
|
|
60
60
|
return onSelectColumn(colDef, checked);
|
61
61
|
},
|
62
62
|
id: "".concat(blockClass, "__customization-column-").concat(colDef.id),
|
63
|
-
labelText: isSortableColumn ? sortableTitle : (_colDef$Header$
|
64
|
-
title: isSortableColumn ? sortableTitle : (_colDef$Header$
|
63
|
+
labelText: isSortableColumn ? sortableTitle : (_colDef$Header$props4 = colDef.Header.props) === null || _colDef$Header$props4 === void 0 ? void 0 : _colDef$Header$props4.title,
|
64
|
+
title: isSortableColumn ? sortableTitle : (_colDef$Header$props5 = colDef.Header.props) === null || _colDef$Header$props5 === void 0 ? void 0 : _colDef$Header$props5.title,
|
65
65
|
className: "".concat(blockClass, "__customize-columns-checkbox"),
|
66
66
|
hideLabel: true
|
67
67
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
@@ -78,7 +78,7 @@ var DraggableItemsList = function DraggableItemsList(_ref) {
|
|
78
78
|
id: "dnd-datagrid-columns-".concat(colDef.id),
|
79
79
|
type: "column-customization",
|
80
80
|
disabled: filterString.length > 0 || isFrozenColumn,
|
81
|
-
ariaLabel: isSortableColumn ? sortableTitle : (_colDef$Header$
|
81
|
+
ariaLabel: isSortableColumn ? sortableTitle : (_colDef$Header$props6 = colDef.Header.props) === null || _colDef$Header$props6 === void 0 ? void 0 : _colDef$Header$props6.title,
|
82
82
|
onGrab: setAriaRegionText,
|
83
83
|
isFocused: focusIndex === i,
|
84
84
|
moveElement: moveElement,
|
@@ -294,7 +294,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
294
294
|
});
|
295
295
|
setInEditMode(false);
|
296
296
|
sendFocusBackToGrid();
|
297
|
-
inputProps === null || inputProps === void 0
|
297
|
+
inputProps === null || inputProps === void 0 || (_inputProps$onChange = inputProps.onChange) === null || _inputProps$onChange === void 0 ? void 0 : _inputProps$onChange.call(inputProps, item.selectedItem);
|
298
298
|
},
|
299
299
|
downshiftProps: {
|
300
300
|
onStateChange: function onStateChange(downshiftState) {
|
@@ -332,9 +332,9 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
332
332
|
var renderDateCell = function renderDateCell() {
|
333
333
|
var _config$inputProps, _outerButtonElement$c;
|
334
334
|
var datePickerPreparedProps = (0, _propsHelper.prepareProps)(config.inputProps, ['datePickerInputProps']);
|
335
|
-
var datePickerInputProps = config === null || config === void 0
|
335
|
+
var datePickerInputProps = config === null || config === void 0 || (_config$inputProps = config.inputProps) === null || _config$inputProps === void 0 ? void 0 : _config$inputProps.datePickerInputProps;
|
336
336
|
return /*#__PURE__*/_react.default.createElement(_react2.DatePicker, (0, _extends2.default)({}, datePickerPreparedProps, {
|
337
|
-
appendTo: outerButtonElement === null || outerButtonElement === void 0
|
337
|
+
appendTo: outerButtonElement === null || outerButtonElement === void 0 || (_outerButtonElement$c = outerButtonElement.current) === null || _outerButtonElement$c === void 0 ? void 0 : _outerButtonElement$c.parentElement,
|
338
338
|
ref: datePickerRef,
|
339
339
|
style: {
|
340
340
|
width: cell.column.totalWidth
|
@@ -344,7 +344,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
344
344
|
onChange: function onChange(newDate) {
|
345
345
|
var _datePickerPreparedPr;
|
346
346
|
var newDateObj = newDate[0];
|
347
|
-
datePickerPreparedProps === null || datePickerPreparedProps === void 0
|
347
|
+
datePickerPreparedProps === null || datePickerPreparedProps === void 0 || (_datePickerPreparedPr = datePickerPreparedProps.onChange) === null || _datePickerPreparedPr === void 0 ? void 0 : _datePickerPreparedPr.call(datePickerPreparedProps, newDateObj, cell);
|
348
348
|
var newCellId = getNewCellId('Enter');
|
349
349
|
saveCellData(newDateObj);
|
350
350
|
setCellValue(newDateObj);
|
@@ -376,7 +376,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
376
376
|
};
|
377
377
|
var buildDate = function buildDate(value) {
|
378
378
|
var _config$inputProps2;
|
379
|
-
var dateFormat = config === null || config === void 0
|
379
|
+
var dateFormat = config === null || config === void 0 || (_config$inputProps2 = config.inputProps) === null || _config$inputProps2 === void 0 ? void 0 : _config$inputProps2.dateFormat;
|
380
380
|
if (value instanceof Date) {
|
381
381
|
var maskedFullYear = value.getFullYear();
|
382
382
|
var maskedMonth = padTo2Digits(value.getMonth() + 1);
|
@@ -448,7 +448,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
448
448
|
"data-inline-type": type,
|
449
449
|
onClick: !nonEditCell ? handleInlineCellClick : addActiveState,
|
450
450
|
onKeyDown: !nonEditCell ? handleKeyDown : null,
|
451
|
-
className: (0, _classnames.default)("".concat(blockClass, "__inline-edit--outer-cell-button"), (_cx3 = {}, (0, _defineProperty2.default)(_cx3, "".concat(blockClass, "__inline-edit--outer-cell-button--").concat(rowSize), rowSize), (0, _defineProperty2.default)(_cx3, "".concat(blockClass, "__inline-edit--outer-cell-button--lg"), !rowSize), (0, _defineProperty2.default)(_cx3, "".concat(blockClass, "__inline-edit--outer-cell-button--invalid"), config === null || config === void 0
|
451
|
+
className: (0, _classnames.default)("".concat(blockClass, "__inline-edit--outer-cell-button"), (_cx3 = {}, (0, _defineProperty2.default)(_cx3, "".concat(blockClass, "__inline-edit--outer-cell-button--").concat(rowSize), rowSize), (0, _defineProperty2.default)(_cx3, "".concat(blockClass, "__inline-edit--outer-cell-button--lg"), !rowSize), (0, _defineProperty2.default)(_cx3, "".concat(blockClass, "__inline-edit--outer-cell-button--invalid"), config === null || config === void 0 || (_config$validator = config.validator) === null || _config$validator === void 0 ? void 0 : _config$validator.call(config, cellValue)), _cx3))
|
452
452
|
}, !inEditMode && /*#__PURE__*/_react.default.createElement(_InlineEditButton.InlineEditButton, {
|
453
453
|
isActiveCell: cellId === activeCellId,
|
454
454
|
renderIcon: setRenderIcon(),
|
@@ -33,7 +33,16 @@ var useActionsColumn = function useActionsColumn(hooks) {
|
|
33
33
|
var useAttachActionsOnInstance = function useAttachActionsOnInstance(instance) {
|
34
34
|
var rowActions = instance.rowActions,
|
35
35
|
isFetching = instance.isFetching,
|
36
|
-
|
36
|
+
selectedRowIds = instance.state.selectedRowIds;
|
37
|
+
var getDisabledState = function getDisabledState(rowIndex) {
|
38
|
+
var selectedRowIndexes = Object.keys(selectedRowIds).map(function (n) {
|
39
|
+
return Number(n);
|
40
|
+
});
|
41
|
+
if (selectedRowIndexes.includes(rowIndex)) {
|
42
|
+
return true;
|
43
|
+
}
|
44
|
+
return false;
|
45
|
+
};
|
37
46
|
if (rowActions && Array.isArray(rowActions)) {
|
38
47
|
var addActionsMenu = function addActionsMenu(props, cellData) {
|
39
48
|
var cell = cellData.cell;
|
@@ -62,11 +71,8 @@ var useActionsColumn = function useActionsColumn(hooks) {
|
|
62
71
|
if (hidden) {
|
63
72
|
return null;
|
64
73
|
}
|
65
|
-
var selectedRowId = selectedFlatRows === null || selectedFlatRows === void 0 ? void 0 : selectedFlatRows.filter(function (item) {
|
66
|
-
return item.id === row.id ? item.id : null;
|
67
|
-
});
|
68
74
|
return /*#__PURE__*/_react.default.createElement("div", {
|
69
|
-
className: (0, _classnames.default)("".concat(blockClass, "__actions-column-button"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__disabled-row-action-button"),
|
75
|
+
className: (0, _classnames.default)("".concat(blockClass, "__actions-column-button"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__disabled-row-action-button"), getDisabledState(row.index))),
|
70
76
|
key: "".concat(itemText, "__").concat(index)
|
71
77
|
}, /*#__PURE__*/_react.default.createElement(_react2.OverflowMenu, (0, _extends2.default)({}, rest, {
|
72
78
|
renderIcon: icon,
|
@@ -74,9 +80,9 @@ var useActionsColumn = function useActionsColumn(hooks) {
|
|
74
80
|
light: true,
|
75
81
|
iconDescription: itemText,
|
76
82
|
kind: "ghost",
|
77
|
-
className: (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(blockClass, "__disabled-row-action"),
|
83
|
+
className: (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(blockClass, "__disabled-row-action"), getDisabledState(row.index))),
|
78
84
|
onClick: function onClick(e) {
|
79
|
-
if (
|
85
|
+
if (getDisabledState(row.index)) {
|
80
86
|
// Row actions should be disabled if row is selected and batchActions toolbar is active
|
81
87
|
return;
|
82
88
|
}
|
@@ -26,7 +26,7 @@ var useDisableSelectRows = function useDisableSelectRows(hooks) {
|
|
26
26
|
};
|
27
27
|
var updateSelectAll = function updateSelectAll(hooks) {
|
28
28
|
var getToggleAllRowsSelectedProps = function getToggleAllRowsSelectedProps(props, _ref2) {
|
29
|
-
var _instance$disableSele
|
29
|
+
var _instance$disableSele;
|
30
30
|
var instance = _ref2.instance;
|
31
31
|
var selectableRows = instance.rows.filter(function (row) {
|
32
32
|
return !(instance.shouldDisableSelectRow && instance.shouldDisableSelectRow(row));
|
@@ -46,7 +46,7 @@ var updateSelectAll = function updateSelectAll(hooks) {
|
|
46
46
|
},
|
47
47
|
checked: isAllRowsSelected,
|
48
48
|
disabled: instance.disableSelectAll,
|
49
|
-
title: (instance === null || instance === void 0
|
49
|
+
title: (instance === null || instance === void 0 || (_instance$disableSele = instance.disableSelectRowsProps) === null || _instance$disableSele === void 0 || (_instance$disableSele = _instance$disableSele.labels) === null || _instance$disableSele === void 0 ? void 0 : _instance$disableSele.toggleAllRowsLabel) || 'Toggle All Rows Selected',
|
50
50
|
indeterminate: Boolean(!isAllRowsSelected && Object.keys(instance.state.selectedRowIds).length)
|
51
51
|
}];
|
52
52
|
};
|
@@ -54,7 +54,7 @@ var updateSelectAll = function updateSelectAll(hooks) {
|
|
54
54
|
};
|
55
55
|
var updatePageSelectAll = function updatePageSelectAll(hooks) {
|
56
56
|
var getToggleAllPageRowsSelectedProps = function getToggleAllPageRowsSelectedProps(props, _ref4) {
|
57
|
-
var _instance$
|
57
|
+
var _instance$disableSele2;
|
58
58
|
var instance = _ref4.instance;
|
59
59
|
var selectableRows = instance.page.filter(function (row) {
|
60
60
|
return !(instance.shouldDisableSelectRow && instance.shouldDisableSelectRow(row));
|
@@ -74,7 +74,7 @@ var updatePageSelectAll = function updatePageSelectAll(hooks) {
|
|
74
74
|
},
|
75
75
|
checked: isAllRowsSelected,
|
76
76
|
disabled: instance.disableSelectAll,
|
77
|
-
title: (instance === null || instance === void 0
|
77
|
+
title: (instance === null || instance === void 0 || (_instance$disableSele2 = instance.disableSelectRowsProps) === null || _instance$disableSele2 === void 0 || (_instance$disableSele2 = _instance$disableSele2.labels) === null || _instance$disableSele2 === void 0 ? void 0 : _instance$disableSele2.toggleAllRowsLabel) || 'Toggle All Rows Selected',
|
78
78
|
indeterminate: Boolean(!isAllRowsSelected && instance.page.some(function (_ref6) {
|
79
79
|
var id = _ref6.id;
|
80
80
|
return instance.state.selectedRowIds[id];
|
@@ -31,11 +31,11 @@ var useInlineEdit = function useInlineEdit(hooks, usingEditableCell) {
|
|
31
31
|
}
|
32
32
|
}, [usingEditableCell]);
|
33
33
|
var addInlineEdit = function addInlineEdit(props, _ref) {
|
34
|
-
var _cell$column,
|
34
|
+
var _cell$column, _instance$columns$fil;
|
35
35
|
var cell = _ref.cell,
|
36
36
|
instance = _ref.instance;
|
37
37
|
var columnInlineEditConfig = cell.column.inlineEdit;
|
38
|
-
var inlineEditType = (_cell$column = cell.column) === null || _cell$column === void 0
|
38
|
+
var inlineEditType = (_cell$column = cell.column) === null || _cell$column === void 0 || (_cell$column = _cell$column.inlineEdit) === null || _cell$column === void 0 ? void 0 : _cell$column.type;
|
39
39
|
var totalInlineEditColumns = (_instance$columns$fil = instance.columns.filter(function (item) {
|
40
40
|
return item.inlineEdit;
|
41
41
|
})) === null || _instance$columns$fil === void 0 ? void 0 : _instance$columns$fil.length;
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
+
var _settings = require("../../settings");
|
7
8
|
/*
|
8
9
|
* Licensed Materials - Property of IBM
|
9
10
|
* 5724-Q36
|
@@ -21,13 +22,28 @@ var useOnRowClick = function useOnRowClick(hooks) {
|
|
21
22
|
instance = datagridState.instance;
|
22
23
|
var id = row.id,
|
23
24
|
toggleRowSelected = row.toggleRowSelected;
|
25
|
+
var withSelectRows = instance.withSelectRows,
|
26
|
+
tableId = instance.tableId;
|
24
27
|
var onClick = function onClick(event) {
|
25
28
|
if (!isFetching && onRowClick) {
|
26
29
|
onRowClick(row, event);
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
30
|
+
// We do not want to change the list of selected rows if using the useSelectedRows hook, otherwise clicking on an entire row will mark the row as checked
|
31
|
+
|
32
|
+
// Remove selected class from all other clickable rows as only one clickable row can be selected at a time
|
33
|
+
var clickableSelectedRows = document.querySelectorAll("#".concat(tableId, ".").concat(_settings.pkg.prefix, "--datagrid .").concat(_settings.carbon.prefix, "--data-table--selected:not(.").concat(_settings.pkg.prefix, "--datagrid__active-row)"));
|
34
|
+
if (clickableSelectedRows.length) {
|
35
|
+
Array.from(clickableSelectedRows).forEach(function (row) {
|
36
|
+
row.classList.remove("".concat(_settings.carbon.prefix, "--data-table--selected"));
|
37
|
+
});
|
38
|
+
}
|
39
|
+
var closestRow = event.target.closest(".".concat(_settings.pkg.prefix, "--datagrid__carbon-row"));
|
40
|
+
closestRow.classList.add("".concat(_settings.carbon.prefix, "--data-table--selected"));
|
41
|
+
if (!withSelectRows) {
|
42
|
+
instance.selectedFlatRows && instance.selectedFlatRows.map(function (toggleRow) {
|
43
|
+
return toggleRow.toggleRowSelected(false);
|
44
|
+
});
|
45
|
+
toggleRowSelected(id, true);
|
46
|
+
}
|
31
47
|
}
|
32
48
|
};
|
33
49
|
var onKeyDown = function onKeyDown(event) {
|
@@ -26,11 +26,37 @@ var ordering = {
|
|
26
26
|
DESC: 'DESC',
|
27
27
|
NONE: 'NONE'
|
28
28
|
};
|
29
|
+
var getAriaSortValue = function getAriaSortValue(col, _ref) {
|
30
|
+
var ascendingSortableLabelText = _ref.ascendingSortableLabelText,
|
31
|
+
descendingSortableLabelText = _ref.descendingSortableLabelText,
|
32
|
+
defaultSortableLabelText = _ref.defaultSortableLabelText;
|
33
|
+
var isSorted = col.isSorted,
|
34
|
+
isSortedDesc = col.isSortedDesc;
|
35
|
+
if (!isSorted) {
|
36
|
+
return defaultSortableLabelText || 'none';
|
37
|
+
}
|
38
|
+
if (isSorted && !isSortedDesc) {
|
39
|
+
return ascendingSortableLabelText || 'ascending';
|
40
|
+
}
|
41
|
+
if (isSorted && isSortedDesc) {
|
42
|
+
return descendingSortableLabelText || 'descending';
|
43
|
+
}
|
44
|
+
};
|
45
|
+
var getAriaPressedValue = function getAriaPressedValue(col) {
|
46
|
+
var isSorted = col.isSorted;
|
47
|
+
if (isSorted) {
|
48
|
+
return 'true';
|
49
|
+
}
|
50
|
+
return 'false';
|
51
|
+
};
|
29
52
|
var useSortableColumns = function useSortableColumns(hooks) {
|
30
|
-
var sortableVisibleColumns = function sortableVisibleColumns(visibleColumns,
|
53
|
+
var sortableVisibleColumns = function sortableVisibleColumns(visibleColumns, _ref2) {
|
31
54
|
var _instance$customizeCo;
|
32
|
-
var instance =
|
33
|
-
var onSort = instance.onSort
|
55
|
+
var instance = _ref2.instance;
|
56
|
+
var onSort = instance.onSort,
|
57
|
+
ascendingSortableLabelText = instance.ascendingSortableLabelText,
|
58
|
+
descendingSortableLabelText = instance.descendingSortableLabelText,
|
59
|
+
defaultSortableLabelText = instance.defaultSortableLabelText;
|
34
60
|
var onSortClick = function onSortClick(column) {
|
35
61
|
var key = column.id;
|
36
62
|
var sortDesc = column.isSortedDesc;
|
@@ -75,6 +101,12 @@ var useSortableColumns = function useSortableColumns(hooks) {
|
|
75
101
|
var Header = function Header(headerProp) {
|
76
102
|
var _cx;
|
77
103
|
return column.disableSortBy === true ? column.Header : /*#__PURE__*/_react.default.createElement(_react2.Button, {
|
104
|
+
"aria-sort": getAriaSortValue(headerProp === null || headerProp === void 0 ? void 0 : headerProp.column, {
|
105
|
+
ascendingSortableLabelText: ascendingSortableLabelText,
|
106
|
+
descendingSortableLabelText: descendingSortableLabelText,
|
107
|
+
defaultSortableLabelText: defaultSortableLabelText
|
108
|
+
}),
|
109
|
+
"aria-pressed": getAriaPressedValue(headerProp === null || headerProp === void 0 ? void 0 : headerProp.column),
|
78
110
|
onClick: function onClick() {
|
79
111
|
return onSortClick(headerProp === null || headerProp === void 0 ? void 0 : headerProp.column);
|
80
112
|
},
|
@@ -154,7 +154,7 @@ var changeProps = function changeProps(elementName, headerCellRef, windowSize, p
|
|
154
154
|
if (column.sticky === 'left') {
|
155
155
|
var _data$instance, _cx2;
|
156
156
|
return [props, _objectSpread({
|
157
|
-
className: (0, _classnames.default)((_cx2 = {}, (0, _defineProperty2.default)(_cx2, "".concat(leftStickyStyleClassPrefix, "-").concat(elementName), true && windowSize > 671), (0, _defineProperty2.default)(_cx2, "".concat(leftStickyStyleClassPrefix, "-").concat(elementName, "--with-extra-select-column"), (data === null || data === void 0
|
157
|
+
className: (0, _classnames.default)((_cx2 = {}, (0, _defineProperty2.default)(_cx2, "".concat(leftStickyStyleClassPrefix, "-").concat(elementName), true && windowSize > 671), (0, _defineProperty2.default)(_cx2, "".concat(leftStickyStyleClassPrefix, "-").concat(elementName, "--with-extra-select-column"), (data === null || data === void 0 || (_data$instance = data.instance) === null || _data$instance === void 0 ? void 0 : _data$instance.withSelectRows) && windowSize > 671), _cx2))
|
158
158
|
}, headerCellRef && {
|
159
159
|
ref: headerCellRef
|
160
160
|
})];
|
@@ -84,7 +84,7 @@ var ExportModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
84
84
|
(0, _react.useEffect)(function () {
|
85
85
|
var _preformattedExtensio;
|
86
86
|
setName(filename);
|
87
|
-
setExtension(preformattedExtensions === null || preformattedExtensions === void 0
|
87
|
+
setExtension(preformattedExtensions === null || preformattedExtensions === void 0 || (_preformattedExtensio = preformattedExtensions[0]) === null || _preformattedExtensio === void 0 ? void 0 : _preformattedExtensio.extension);
|
88
88
|
}, [filename, preformattedExtensions, open]);
|
89
89
|
var onNameChangeHandler = function onNameChangeHandler(evt) {
|
90
90
|
setName(evt.target.value);
|
@@ -302,10 +302,10 @@ var NotificationsPanel = /*#__PURE__*/_react.default.forwardRef(function (_ref,
|
|
302
302
|
nowText: nowText
|
303
303
|
})), /*#__PURE__*/_react.default.createElement("h6", {
|
304
304
|
className: notificationHeaderClassName
|
305
|
-
}, notification.title), notification.description && notification.description.length && renderDescription(notification.id), notification.link && notification.link.text && notification.link.url && /*#__PURE__*/_react.default.createElement(_react2.Link, {
|
305
|
+
}, notification.title), notification.description && notification.description.length && renderDescription(notification.id), notification.link && notification.link.text && notification.link.url && /*#__PURE__*/_react.default.createElement(_react2.Link, (0, _extends2.default)({
|
306
306
|
href: notification.link.url,
|
307
307
|
className: "".concat(blockClass, "__notifications-link")
|
308
|
-
}, notification.link.text)), /*#__PURE__*/_react.default.createElement(_react2.IconButton, {
|
308
|
+
}, notification.link.optional), notification.link.text)), /*#__PURE__*/_react.default.createElement(_react2.IconButton, {
|
309
309
|
align: "left",
|
310
310
|
kind: "ghost",
|
311
311
|
size: "sm",
|
@@ -426,7 +426,10 @@ NotificationsPanel.propTypes = {
|
|
426
426
|
description: _propTypes.default.string,
|
427
427
|
link: _propTypes.default.shape({
|
428
428
|
url: _propTypes.default.string,
|
429
|
-
text: _propTypes.default.string
|
429
|
+
text: _propTypes.default.string,
|
430
|
+
optional: _propTypes.default.shape({
|
431
|
+
// Add optional props here
|
432
|
+
})
|
430
433
|
}),
|
431
434
|
unread: _propTypes.default.bool,
|
432
435
|
onNotificationClick: _propTypes.default.func
|
@@ -128,7 +128,7 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
128
128
|
if ((previousState === null || previousState === void 0 ? void 0 : previousState.size) !== size) {
|
129
129
|
var _sidePanelOuter$style;
|
130
130
|
scrollableSection.scrollTop = 0;
|
131
|
-
sidePanelOuter === null || sidePanelOuter === void 0
|
131
|
+
sidePanelOuter === null || sidePanelOuter === void 0 || (_sidePanelOuter$style = sidePanelOuter.style) === null || _sidePanelOuter$style === void 0 ? void 0 : _sidePanelOuter$style.setProperty("--".concat(blockClass, "--title-container-height"), "".concat(Number(initialTitleHeight), "px"));
|
132
132
|
}
|
133
133
|
}
|
134
134
|
}, [currentStep, ref, size, previousState === null || previousState === void 0 ? void 0 : previousState.size]);
|
@@ -159,7 +159,7 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
159
159
|
var actionsContainer = getActionsContainerElement();
|
160
160
|
var actionsHeight = (actionsContainer === null || actionsContainer === void 0 ? void 0 : actionsContainer.offsetHeight) + 16; // add additional 1rem spacing to bottom padding
|
161
161
|
actionsHeight = "".concat(Math.round(actionsHeight / 16), "rem");
|
162
|
-
sidePanelOuter === null || sidePanelOuter === void 0
|
162
|
+
sidePanelOuter === null || sidePanelOuter === void 0 || (_sidePanelOuter$style2 = sidePanelOuter.style) === null || _sidePanelOuter$style2 === void 0 ? void 0 : _sidePanelOuter$style2.setProperty("--".concat(blockClass, "--content-bottom-padding"), actionsHeight);
|
163
163
|
}
|
164
164
|
}, [actions, condensedActions, open, animationComplete]);
|
165
165
|
|
@@ -180,7 +180,7 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
180
180
|
var actionsContainer = getActionsContainerElement();
|
181
181
|
var actionsHeight = (actionsContainer === null || actionsContainer === void 0 ? void 0 : actionsContainer.offsetHeight) + 16; // add additional 1rem spacing to bottom padding
|
182
182
|
actionsHeight = "".concat(Math.round(actionsHeight / 16), "rem");
|
183
|
-
sidePanelOuter === null || sidePanelOuter === void 0
|
183
|
+
sidePanelOuter === null || sidePanelOuter === void 0 || (_sidePanelOuter$style3 = sidePanelOuter.style) === null || _sidePanelOuter$style3 === void 0 ? void 0 : _sidePanelOuter$style3.setProperty("--".concat(blockClass, "--content-bottom-padding"), actionsHeight);
|
184
184
|
};
|
185
185
|
var getActionsContainerElement = function getActionsContainerElement() {
|
186
186
|
var sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
|
@@ -61,9 +61,9 @@ var TagSetModal = function TagSetModal(_ref) {
|
|
61
61
|
} else {
|
62
62
|
var lCaseSearch = search.toLocaleLowerCase();
|
63
63
|
allTags.forEach(function (tag) {
|
64
|
-
var _tag$dataSearch, _tag$
|
65
|
-
var dataSearch = (_tag$dataSearch = tag['data-search']) === null || _tag$dataSearch === void 0
|
66
|
-
var labelSearch = (_tag$label = tag.label) === null || _tag$label === void 0
|
64
|
+
var _tag$dataSearch, _tag$label;
|
65
|
+
var dataSearch = (_tag$dataSearch = tag['data-search']) === null || _tag$dataSearch === void 0 || (_tag$dataSearch = _tag$dataSearch.toLocaleLowerCase()) === null || _tag$dataSearch === void 0 ? void 0 : _tag$dataSearch.indexOf(lCaseSearch);
|
66
|
+
var labelSearch = (_tag$label = tag.label) === null || _tag$label === void 0 || (_tag$label = _tag$label.toLocaleLowerCase()) === null || _tag$label === void 0 ? void 0 : _tag$label.indexOf(lCaseSearch);
|
67
67
|
if (dataSearch > -1 || labelSearch > -1) {
|
68
68
|
newFilteredModalTags.push(tag);
|
69
69
|
}
|
@@ -75,7 +75,7 @@ var processBlocks = function processBlocks(blocks, stories, omitUnreferencedStor
|
|
75
75
|
* @returns
|
76
76
|
*/
|
77
77
|
var StoryDocsPage = function StoryDocsPage(_ref2) {
|
78
|
-
var _csfFile$meta,
|
78
|
+
var _csfFile$meta, _processedBlocks$filt;
|
79
79
|
var altTitle = _ref2.altTitle,
|
80
80
|
altDescription = _ref2.altDescription,
|
81
81
|
altGuidelinesHref = _ref2.altGuidelinesHref,
|
@@ -86,7 +86,7 @@ var StoryDocsPage = function StoryDocsPage(_ref2) {
|
|
86
86
|
csfFile = _useOf.csfFile;
|
87
87
|
var storyInfo = (0, _storyHelper.storyDocsPageInfo)(csfFile);
|
88
88
|
var guidelinesHref = altGuidelinesHref !== null && altGuidelinesHref !== void 0 ? altGuidelinesHref : storyInfo.guidelinesHref;
|
89
|
-
var isFullScreen = (csfFile === null || csfFile === void 0
|
89
|
+
var isFullScreen = (csfFile === null || csfFile === void 0 || (_csfFile$meta = csfFile.meta) === null || _csfFile$meta === void 0 || (_csfFile$meta = _csfFile$meta.parameters) === null || _csfFile$meta === void 0 ? void 0 : _csfFile$meta.layout) === 'fullscreen' || false;
|
90
90
|
var storyHelperClass = isFullScreen ? 'c4p--story-docs-page--fullscreen' : '';
|
91
91
|
var processedBlocks = processBlocks(blocks, csfFile.stories, omitUnreferencedStories);
|
92
92
|
console.log(processBlocks);
|
@@ -26,7 +26,7 @@ var isEmpty = function isEmpty(children) {
|
|
26
26
|
_react.default.Children.forEach(children, function (child) {
|
27
27
|
if (child) {
|
28
28
|
var _child$type, _child$props;
|
29
|
-
result && (result = (child === null || child === void 0
|
29
|
+
result && (result = (child === null || child === void 0 || (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === 'Wrap' && isEmpty(child === null || child === void 0 || (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.children));
|
30
30
|
}
|
31
31
|
});
|
32
32
|
return result;
|
@@ -159,7 +159,7 @@ exports.getDeprecatedArgTypes = getDeprecatedArgTypes;
|
|
159
159
|
var extractShapesArray = function extractShapesArray(items) {
|
160
160
|
var _items$, _items$2;
|
161
161
|
// unwrap if items or the first index looks like a React element or fragment
|
162
|
-
if (items && (items !== null && items !== void 0 && (_items$ = items[0]) !== null && _items$ !== void 0 && _items$.props || (items === null || items === void 0
|
162
|
+
if (items && (items !== null && items !== void 0 && (_items$ = items[0]) !== null && _items$ !== void 0 && _items$.props || (items === null || items === void 0 || (_items$2 = items[0]) === null || _items$2 === void 0 ? void 0 : _items$2.type) === _react.default.Fragment || items.type === _react.default.Fragment)) {
|
163
163
|
var unwrappedItems = (0, _unwrapIfFragment.default)(items);
|
164
164
|
return unwrappedItems.map(function (item) {
|
165
165
|
return _objectSpread({
|