@carbon/ibm-products 1.27.0 → 1.31.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +513 -75
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +3 -3
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +942 -23
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +3 -3
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +512 -74
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +3 -3
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +513 -75
- package/css/index.css.map +1 -1
- package/css/index.min.css +3 -3
- package/css/index.min.css.map +1 -1
- package/es/components/AddSelect/AddSelect.js +0 -3
- package/es/components/AddSelect/AddSelectBody.js +20 -3
- package/es/components/AddSelect/AddSelectBreadcrumbs.js +11 -3
- package/es/components/AddSelect/AddSelectColumn.js +4 -3
- package/es/components/AddSelect/AddSelectFilter.js +4 -3
- package/es/components/AddSelect/AddSelectList.js +40 -14
- package/es/components/Card/Card.js +16 -6
- package/es/components/Card/CardFooter.js +3 -1
- package/es/components/Card/CardHeader.js +20 -1
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +62 -11
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +7 -0
- package/es/components/DataSpreadsheet/utils/handleCellDeletion.js +31 -0
- package/es/components/DataSpreadsheet/utils/handleMultipleKeys.js +1 -1
- package/es/components/Datagrid/Datagrid/Datagrid.js +10 -38
- package/es/components/Datagrid/Datagrid/DatagridContent.js +106 -0
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +10 -3
- package/es/components/Datagrid/Datagrid/DraggableElement.js +5 -1
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +5 -40
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +35 -10
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +61 -24
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +3 -2
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +63 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/index.js +1 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +459 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/index.js +1 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +112 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +27 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/index.js +1 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +31 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +19 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +197 -0
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +6 -5
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +1 -2
- package/es/components/Datagrid/index.js +3 -1
- package/es/components/Datagrid/useColumnOrder.js +8 -0
- package/es/components/Datagrid/useCustomizeColumns.js +5 -0
- package/es/components/Datagrid/useDisableSelectRows.js +6 -2
- package/es/components/Datagrid/useInlineEdit.js +71 -0
- package/es/components/Datagrid/useRowSize.js +17 -6
- package/es/components/Datagrid/useSelectRows.js +12 -2
- package/es/components/Datagrid/useStickyColumn.js +11 -0
- package/es/components/Datagrid/utils/getInlineEditColumns.js +121 -0
- package/es/components/Datagrid/utils/makeData.js +17 -1
- package/es/components/ImportModal/ImportModal.js +2 -2
- package/es/components/InlineEdit/InlineEdit.js +4 -2
- package/es/components/ProductiveCard/ProductiveCard.js +5 -0
- package/es/components/index.js +1 -1
- package/es/global/js/hooks/useClickOutside.js +1 -1
- package/es/global/js/package-settings.js +3 -3
- package/es/global/js/utils/rangeWithCallback.js +13 -0
- package/es/global/js/utils/uuidv4.spec.js +4 -0
- package/lib/components/AddSelect/AddSelect.js +0 -4
- package/lib/components/AddSelect/AddSelectBody.js +20 -3
- package/lib/components/AddSelect/AddSelectBreadcrumbs.js +14 -3
- package/lib/components/AddSelect/AddSelectColumn.js +3 -2
- package/lib/components/AddSelect/AddSelectFilter.js +3 -2
- package/lib/components/AddSelect/AddSelectList.js +39 -13
- package/lib/components/Card/Card.js +16 -6
- package/lib/components/Card/CardFooter.js +3 -1
- package/lib/components/Card/CardHeader.js +21 -1
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +62 -10
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +7 -0
- package/lib/components/DataSpreadsheet/utils/handleCellDeletion.js +42 -0
- package/lib/components/DataSpreadsheet/utils/handleMultipleKeys.js +1 -1
- package/lib/components/Datagrid/Datagrid/Datagrid.js +12 -45
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +138 -0
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +12 -3
- package/lib/components/Datagrid/Datagrid/DraggableElement.js +5 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +12 -41
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +47 -25
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +59 -23
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +3 -2
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +79 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/index.js +13 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +483 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/index.js +13 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +129 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +36 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/index.js +19 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +42 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +28 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +204 -0
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +6 -5
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +1 -2
- package/lib/components/Datagrid/index.js +17 -1
- package/lib/components/Datagrid/useColumnOrder.js +17 -0
- package/lib/components/Datagrid/useCustomizeColumns.js +5 -0
- package/lib/components/Datagrid/useDisableSelectRows.js +6 -2
- package/lib/components/Datagrid/useInlineEdit.js +85 -0
- package/lib/components/Datagrid/useRowSize.js +18 -13
- package/lib/components/Datagrid/useSelectRows.js +12 -2
- package/lib/components/Datagrid/useStickyColumn.js +11 -0
- package/lib/components/Datagrid/utils/getInlineEditColumns.js +133 -0
- package/lib/components/Datagrid/utils/makeData.js +17 -1
- package/lib/components/ImportModal/ImportModal.js +2 -2
- package/lib/components/InlineEdit/InlineEdit.js +4 -2
- package/lib/components/ProductiveCard/ProductiveCard.js +5 -0
- package/lib/components/index.js +12 -0
- package/lib/global/js/hooks/useClickOutside.js +1 -1
- package/lib/global/js/package-settings.js +3 -3
- package/lib/global/js/utils/rangeWithCallback.js +22 -0
- package/lib/global/js/utils/uuidv4.spec.js +4 -0
- package/package.json +13 -13
- package/scss/components/AddSelect/_add-select.scss +126 -28
- package/scss/components/Card/_card.scss +1 -0
- package/scss/components/Cascade/_cascade.scss +1 -1
- package/scss/components/CreateTearsheet/_create-tearsheet.scss +1 -0
- package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +18 -1
- package/scss/components/Datagrid/_storybook-styles.scss +1 -1
- package/scss/components/Datagrid/styles/_datagrid.scss +27 -0
- package/scss/components/Datagrid/styles/_draggableElement.scss +26 -9
- package/scss/components/Datagrid/styles/_index.scss +1 -0
- package/scss/components/Datagrid/styles/_useInlineEdit.scss +211 -0
- package/scss/components/Datagrid/styles/_useStickyColumn.scss +24 -2
- package/scss/components/Datagrid/styles/addons/_CustomizeColumnsModal.scss +44 -6
- package/scss/components/NotificationsPanel/_notifications-panel.scss +5 -6
- package/scss/components/ProductiveCard/_productive-card.scss +39 -0
- package/scss/components/RemoveModal/_remove-modal.scss +0 -4
- package/scss/components/SidePanel/_side-panel.scss +4 -6
- package/scss/components/_index-released-only.scss +1 -0
@@ -65,7 +65,9 @@ var _handleActiveCellInSelectionEnter = require("./utils/handleActiveCellInSelec
|
|
65
65
|
|
66
66
|
var _handleActiveCellInSelectionTab = require("./utils/handleActiveCellInSelectionTab");
|
67
67
|
|
68
|
-
var
|
68
|
+
var _handleCellDeletion = require("./utils/handleCellDeletion");
|
69
|
+
|
70
|
+
var _excluded = ["cellSize", "className", "columns", "data", "defaultEmptyRowCount", "onDataUpdate", "id", "onActiveCellChange", "onSelectionAreaChange", "selectAllAriaLabel", "spreadsheetAriaLabel", "theme", "totalVisibleColumns"];
|
69
71
|
|
70
72
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
71
73
|
|
@@ -87,13 +89,16 @@ var defaults = {
|
|
87
89
|
defaultEmptyRowCount: 16,
|
88
90
|
onDataUpdate: Object.freeze(function () {}),
|
89
91
|
onActiveCellChange: Object.freeze(function () {}),
|
90
|
-
onSelectionAreaChange: Object.freeze(function () {})
|
92
|
+
onSelectionAreaChange: Object.freeze(function () {}),
|
93
|
+
theme: 'light'
|
91
94
|
};
|
92
95
|
/**
|
93
96
|
* DataSpreadsheet: used to organize and display large amounts of structured data, separated by columns and rows in a grid-like format.
|
94
97
|
*/
|
95
98
|
|
96
99
|
var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
100
|
+
var _cx;
|
101
|
+
|
97
102
|
var _ref$cellSize = _ref.cellSize,
|
98
103
|
cellSize = _ref$cellSize === void 0 ? defaults.cellSize : _ref$cellSize,
|
99
104
|
className = _ref.className,
|
@@ -110,6 +115,9 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
110
115
|
onActiveCellChange = _ref$onActiveCellChan === void 0 ? defaults.onActiveCellChange : _ref$onActiveCellChan,
|
111
116
|
_ref$onSelectionAreaC = _ref.onSelectionAreaChange,
|
112
117
|
onSelectionAreaChange = _ref$onSelectionAreaC === void 0 ? defaults.onSelectionAreaChange : _ref$onSelectionAreaC,
|
118
|
+
selectAllAriaLabel = _ref.selectAllAriaLabel,
|
119
|
+
spreadsheetAriaLabel = _ref.spreadsheetAriaLabel,
|
120
|
+
theme = _ref.theme,
|
113
121
|
totalVisibleColumns = _ref.totalVisibleColumns,
|
114
122
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
115
123
|
var multiKeyTrackingRef = (0, _react.useRef)();
|
@@ -216,11 +224,11 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
216
224
|
visibleColumns = _useTable.visibleColumns; // Update the spreadsheet data after editing a cell
|
217
225
|
|
218
226
|
|
219
|
-
var updateData = (0, _react.useCallback)(function (rowIndex, columnId) {
|
227
|
+
var updateData = (0, _react.useCallback)(function (rowIndex, columnId, newValue) {
|
220
228
|
onDataUpdate(function (prev) {
|
221
229
|
return prev.map(function (row, index) {
|
222
230
|
if (index === rowIndex) {
|
223
|
-
return _objectSpread(_objectSpread({}, prev[rowIndex]), {}, (0, _defineProperty2.default)({}, columnId, cellEditorValue));
|
231
|
+
return _objectSpread(_objectSpread({}, prev[rowIndex]), {}, (0, _defineProperty2.default)({}, columnId, cellEditorValue || newValue));
|
224
232
|
}
|
225
233
|
|
226
234
|
return row;
|
@@ -408,13 +416,34 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
408
416
|
setCurrentMatcher: setCurrentMatcher,
|
409
417
|
usingMac: usingMac
|
410
418
|
});
|
411
|
-
}
|
412
|
-
// if one of the activeCellCoordinates is in a header position
|
419
|
+
}
|
413
420
|
|
421
|
+
var deleteParams = {
|
422
|
+
selectionAreas: selectionAreas,
|
423
|
+
currentMatcher: currentMatcher,
|
424
|
+
rows: rows,
|
425
|
+
setActiveCellContent: setActiveCellContent,
|
426
|
+
updateData: updateData
|
427
|
+
}; // Allow arrow key navigation if there are less than two activeKeys OR
|
428
|
+
// if one of the activeCellCoordinates is in a header position
|
414
429
|
|
415
430
|
if (keysPressedList.length < 2 && !(0, _handleMultipleKeys.includesShift)(keysPressedList) || activeCellCoordinates.row === 'header' || activeCellCoordinates.column === 'header') {
|
416
431
|
switch (key) {
|
432
|
+
// Backspace
|
433
|
+
case 'Backspace':
|
434
|
+
{
|
435
|
+
(0, _handleCellDeletion.handleCellDeletion)(deleteParams);
|
436
|
+
break;
|
437
|
+
}
|
438
|
+
// Delete
|
439
|
+
|
440
|
+
case 'Delete':
|
441
|
+
{
|
442
|
+
(0, _handleCellDeletion.handleCellDeletion)(deleteParams);
|
443
|
+
break;
|
444
|
+
}
|
417
445
|
// Enter
|
446
|
+
|
418
447
|
case 'Enter':
|
419
448
|
{
|
420
449
|
(0, _handleActiveCellInSelectionEnter.handleActiveCellInSelectionEnter)({
|
@@ -612,7 +641,7 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
612
641
|
}
|
613
642
|
}
|
614
643
|
}
|
615
|
-
}, [activeCellInsideSelectionArea, updateActiveCellCoordinates, handleInitialArrowPress, activeCellCoordinates, removeActiveCell, columns, rows, spreadsheetRef, currentMatcher, isEditing, removeCellEditor, selectionAreas, handleHomeEndKey, keysPressedList, usingMac]);
|
644
|
+
}, [activeCellInsideSelectionArea, updateActiveCellCoordinates, handleInitialArrowPress, activeCellCoordinates, removeActiveCell, columns, rows, spreadsheetRef, currentMatcher, isEditing, removeCellEditor, selectionAreas, handleHomeEndKey, keysPressedList, usingMac, updateData]);
|
616
645
|
|
617
646
|
var startEditMode = function startEditMode() {
|
618
647
|
setIsEditing(true);
|
@@ -648,6 +677,11 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
648
677
|
}
|
649
678
|
|
650
679
|
return;
|
680
|
+
}; // Mouse up on active cell
|
681
|
+
|
682
|
+
|
683
|
+
var handleActiveCellMouseUp = function handleActiveCellMouseUp() {
|
684
|
+
setClickAndHoldActive(false);
|
651
685
|
}; // Mouse down on active cell
|
652
686
|
|
653
687
|
|
@@ -786,12 +820,13 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
786
820
|
}
|
787
821
|
}, [spreadsheetRef, currentMatcher]);
|
788
822
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, getTableProps(), (0, _devtools.getDevtoolsProps)(componentName), {
|
789
|
-
className: (0, _classnames.default)(blockClass, className, "".concat(blockClass, "--interactive-cell-element"), (0, _defineProperty2.default)(
|
823
|
+
className: (0, _classnames.default)(blockClass, className, "".concat(blockClass, "--interactive-cell-element"), (_cx = {}, (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__container-has-focus"), containerHasFocus), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__").concat(theme), theme === 'dark'), _cx)),
|
790
824
|
ref: spreadsheetRef,
|
791
825
|
role: "grid",
|
792
826
|
tabIndex: 0,
|
793
827
|
"aria-rowcount": (rows === null || rows === void 0 ? void 0 : rows.length) || 0,
|
794
828
|
"aria-colcount": (columns === null || columns === void 0 ? void 0 : columns.length) || 0,
|
829
|
+
"aria-label": spreadsheetAriaLabel,
|
795
830
|
onKeyDown: handleKeyPress,
|
796
831
|
onFocus: function onFocus() {
|
797
832
|
return setContainerHasFocus(true);
|
@@ -817,7 +852,8 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
817
852
|
updateActiveCellCoordinates: updateActiveCellCoordinates,
|
818
853
|
setHeaderCellHoldActive: setHeaderCellHoldActive,
|
819
854
|
headerCellHoldActive: headerCellHoldActive,
|
820
|
-
visibleColumns: visibleColumns
|
855
|
+
visibleColumns: visibleColumns,
|
856
|
+
selectAllAriaLabel: selectAllAriaLabel
|
821
857
|
}), /*#__PURE__*/_react.default.createElement(_DataSpreadsheetBody.DataSpreadsheetBody, {
|
822
858
|
activeCellCoordinates: activeCellCoordinates,
|
823
859
|
ref: spreadsheetRef,
|
@@ -852,6 +888,7 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
852
888
|
visibleColumns: visibleColumns
|
853
889
|
}), /*#__PURE__*/_react.default.createElement("button", {
|
854
890
|
onMouseDown: handleActiveCellMouseDown,
|
891
|
+
onMouseUp: handleActiveCellMouseUp,
|
855
892
|
onClick: handleActiveCellClick,
|
856
893
|
onKeyDown: handleActiveCellKeyDown,
|
857
894
|
onDoubleClick: handleActiveCellDoubleClick,
|
@@ -880,7 +917,7 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
880
917
|
},
|
881
918
|
ref: cellEditorRef,
|
882
919
|
labelText: "",
|
883
|
-
"aria-labelledby": activeCellCoordinates ? "
|
920
|
+
"aria-labelledby": activeCellCoordinates ? "".concat(blockClass, "__cell--").concat(activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row, "--").concat(activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) : null,
|
884
921
|
className: (0, _classnames.default)("".concat(blockClass, "__cell-editor"), "".concat(blockClass, "--interactive-cell-element"), "".concat(blockClass, "__cell-editor--").concat(cellSize), (0, _defineProperty2.default)({}, "".concat(blockClass, "__cell-editor--active"), isEditing))
|
885
922
|
}), /*#__PURE__*/_react.default.createElement("pre", {
|
886
923
|
"aria-hidden": true,
|
@@ -949,6 +986,21 @@ DataSpreadsheet.propTypes = {
|
|
949
986
|
*/
|
950
987
|
onSelectionAreaChange: _propTypes.default.func,
|
951
988
|
|
989
|
+
/**
|
990
|
+
* The aria label applied to the Select all button
|
991
|
+
*/
|
992
|
+
selectAllAriaLabel: _propTypes.default.string.isRequired,
|
993
|
+
|
994
|
+
/**
|
995
|
+
* The aria label applied to the Data spreadsheet component
|
996
|
+
*/
|
997
|
+
spreadsheetAriaLabel: _propTypes.default.string.isRequired,
|
998
|
+
|
999
|
+
/**
|
1000
|
+
* The theme the DataSpreadsheet should use (only used to render active cell/selection area colors on dark theme)
|
1001
|
+
*/
|
1002
|
+
theme: _propTypes.default.oneOf(['light', 'dark']),
|
1003
|
+
|
952
1004
|
/**
|
953
1005
|
* The total number of columns to be initially visible, additional columns will be rendered and
|
954
1006
|
* visible via horizontal scrollbar
|
@@ -66,6 +66,7 @@ var DataSpreadsheetHeader = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
|
|
66
66
|
updateActiveCellCoordinates = _ref.updateActiveCellCoordinates,
|
67
67
|
setHeaderCellHoldActive = _ref.setHeaderCellHoldActive,
|
68
68
|
headerCellHoldActive = _ref.headerCellHoldActive,
|
69
|
+
selectAllAriaLabel = _ref.selectAllAriaLabel,
|
69
70
|
visibleColumns = _ref.visibleColumns;
|
70
71
|
|
71
72
|
var _useState = (0, _react.useState)(0),
|
@@ -198,6 +199,7 @@ var DataSpreadsheetHeader = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
|
|
198
199
|
"data-column-index": "header",
|
199
200
|
type: "button",
|
200
201
|
tabIndex: -1,
|
202
|
+
"aria-label": selectAllAriaLabel,
|
201
203
|
onClick: handleSelectAllClick,
|
202
204
|
className: (0, _classnames.default)("".concat(blockClass, "__th"), "".concat(blockClass, "--interactive-cell-element"), "".concat(blockClass, "__th--select-all"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__th--active-header"), (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header' && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header'))
|
203
205
|
}, "\xA0")), headerGroup.headers.map(function (column, index) {
|
@@ -282,6 +284,11 @@ DataSpreadsheetHeader.propTypes = {
|
|
282
284
|
*/
|
283
285
|
scrollBarSize: _propTypes.default.number,
|
284
286
|
|
287
|
+
/**
|
288
|
+
* The aria label applied to the Select all button
|
289
|
+
*/
|
290
|
+
selectAllAriaLabel: _propTypes.default.string.isRequired,
|
291
|
+
|
285
292
|
/**
|
286
293
|
* All of the cell selection area items
|
287
294
|
*/
|
@@ -0,0 +1,42 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.handleCellDeletion = void 0;
|
7
|
+
|
8
|
+
var _deepCloneObject = require("../../../global/js/utils/deepCloneObject");
|
9
|
+
|
10
|
+
var _rangeWithCallback = require("../../../global/js/utils/rangeWithCallback");
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Copyright IBM Corp. 2022, 2022
|
14
|
+
*
|
15
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
17
|
+
*/
|
18
|
+
var handleCellDeletion = function handleCellDeletion(_ref) {
|
19
|
+
var selectionAreas = _ref.selectionAreas,
|
20
|
+
currentMatcher = _ref.currentMatcher,
|
21
|
+
rows = _ref.rows,
|
22
|
+
setActiveCellContent = _ref.setActiveCellContent,
|
23
|
+
updateData = _ref.updateData;
|
24
|
+
var selectionAreaClone = (0, _deepCloneObject.deepCloneObject)(selectionAreas);
|
25
|
+
var indexOfCurrentSelectionArea = selectionAreaClone.findIndex(function (item) {
|
26
|
+
return item.matcher === currentMatcher;
|
27
|
+
});
|
28
|
+
var selectionAreaToEmptyContents = selectionAreaClone[indexOfCurrentSelectionArea];
|
29
|
+
var lowestColumnIndex = Math.min(selectionAreaToEmptyContents.point1.column, selectionAreaToEmptyContents.point2.column);
|
30
|
+
var greatestColumnIndex = Math.max(selectionAreaToEmptyContents.point1.column, selectionAreaToEmptyContents.point2.column);
|
31
|
+
var lowestRowIndex = Math.min(selectionAreaToEmptyContents.point1.row, selectionAreaToEmptyContents.point2.row);
|
32
|
+
var greatestRowIndex = Math.max(selectionAreaToEmptyContents.point1.row, selectionAreaToEmptyContents.point2.row);
|
33
|
+
(0, _rangeWithCallback.rangeWithCallback)(lowestColumnIndex, greatestColumnIndex, function (columnIndex) {
|
34
|
+
(0, _rangeWithCallback.rangeWithCallback)(lowestRowIndex, greatestRowIndex, function (rowIndex) {
|
35
|
+
var cellProps = rows[rowIndex].cells[columnIndex];
|
36
|
+
updateData(rowIndex, cellProps === null || cellProps === void 0 ? void 0 : cellProps.column.id, '');
|
37
|
+
});
|
38
|
+
});
|
39
|
+
setActiveCellContent(null);
|
40
|
+
};
|
41
|
+
|
42
|
+
exports.handleCellDeletion = handleCellDeletion;
|
@@ -9,39 +9,29 @@ exports.Datagrid = void 0;
|
|
9
9
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
11
11
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
13
|
-
|
14
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
15
13
|
|
16
14
|
var _react = _interopRequireDefault(require("react"));
|
17
15
|
|
18
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
19
17
|
|
20
|
-
var _carbonComponentsReact = require("carbon-components-react");
|
21
|
-
|
22
18
|
var _classnames = _interopRequireDefault(require("classnames"));
|
23
19
|
|
24
|
-
var _DatagridHead = _interopRequireDefault(require("./DatagridHead"));
|
25
|
-
|
26
|
-
var _DatagridBody = _interopRequireDefault(require("./DatagridBody"));
|
27
|
-
|
28
|
-
var _DatagridToolbar = _interopRequireDefault(require("./DatagridToolbar"));
|
29
|
-
|
30
20
|
var _devtools = require("../../../global/js/utils/devtools");
|
31
21
|
|
32
22
|
var _settings = require("../../../settings");
|
33
23
|
|
34
24
|
var _pconsole = _interopRequireDefault(require("../../../global/js/utils/pconsole"));
|
35
25
|
|
26
|
+
var _InlineEditContext = require("./addons/InlineEdit/InlineEditContext");
|
27
|
+
|
28
|
+
var _DatagridContent = require("./DatagridContent");
|
29
|
+
|
36
30
|
var _excluded = ["datagridState"];
|
37
31
|
var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
|
38
32
|
var componentName = 'Datagrid';
|
39
|
-
var TableContainer = _carbonComponentsReact.DataTable.TableContainer,
|
40
|
-
Table = _carbonComponentsReact.DataTable.Table;
|
41
33
|
|
42
34
|
var Datagrid = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
43
|
-
var _getTableProps;
|
44
|
-
|
45
35
|
var datagridState = _ref.datagridState,
|
46
36
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
47
37
|
|
@@ -51,47 +41,24 @@ var Datagrid = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
51
41
|
return null;
|
52
42
|
}
|
53
43
|
|
54
|
-
var
|
55
|
-
getTableProps = _datagridState$getTab === void 0 ? function () {} : _datagridState$getTab,
|
56
|
-
withVirtualScroll = datagridState.withVirtualScroll,
|
44
|
+
var withVirtualScroll = datagridState.withVirtualScroll,
|
57
45
|
DatagridPagination = datagridState.DatagridPagination,
|
58
46
|
isFetching = datagridState.isFetching,
|
59
47
|
tableId = datagridState.tableId,
|
60
|
-
CustomizeColumnsModal = datagridState.CustomizeColumnsModal,
|
61
48
|
leftPanel = datagridState.leftPanel,
|
62
|
-
|
63
|
-
_datagridState$vertic = datagridState.verticalAlign,
|
64
|
-
verticalAlign = _datagridState$vertic === void 0 ? 'center' : _datagridState$vertic,
|
65
|
-
variableRowHeight = datagridState.variableRowHeight,
|
66
|
-
className = datagridState.className,
|
67
|
-
gridTitle = datagridState.gridTitle,
|
68
|
-
gridDescription = datagridState.gridDescription,
|
69
|
-
useDenseHeader = datagridState.useDenseHeader;
|
49
|
+
className = datagridState.className;
|
70
50
|
var rows = DatagridPagination && datagridState.page || datagridState.rows;
|
71
|
-
|
72
|
-
var dataGrid = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(TableContainer, {
|
73
|
-
className: (0, _classnames.default)("".concat(blockClass, "__grid-container"), withVirtualScroll || fullHeightDatagrid ? "".concat(blockClass, "__full-height") : '', DatagridPagination ? "".concat(blockClass, "__with-pagination") : '', useDenseHeader ? "".concat(blockClass, "__dense-header") : ''),
|
74
|
-
title: gridTitle,
|
75
|
-
description: gridDescription
|
76
|
-
}, /*#__PURE__*/_react.default.createElement(_DatagridToolbar.default, datagridState), /*#__PURE__*/_react.default.createElement("div", {
|
77
|
-
className: "".concat(blockClass, "__table-container")
|
78
|
-
}, leftPanel && leftPanel.isOpen && /*#__PURE__*/_react.default.createElement("div", {
|
79
|
-
className: "".concat(blockClass, "__datagridLeftPanel")
|
80
|
-
}, leftPanel.panelContent), /*#__PURE__*/_react.default.createElement(Table, (0, _extends2.default)({}, getTableProps(), {
|
81
|
-
className: (0, _classnames.default)(withVirtualScroll ? '' : "".concat(blockClass, "__table-simple"), "".concat(blockClass, "__vertical-align-").concat(verticalAlign), (0, _defineProperty2.default)({}, "".concat(blockClass, "__variable-row-height"), variableRowHeight), (_getTableProps = getTableProps()) === null || _getTableProps === void 0 ? void 0 : _getTableProps.className)
|
82
|
-
}), /*#__PURE__*/_react.default.createElement(_DatagridHead.default, datagridState), /*#__PURE__*/_react.default.createElement(_DatagridBody.default, (0, _extends2.default)({}, datagridState, {
|
83
|
-
rows: rows
|
84
|
-
}))))), (rows === null || rows === void 0 ? void 0 : rows.length) > 0 && !isFetching && DatagridPagination && DatagridPagination(datagridState), CustomizeColumnsModal && /*#__PURE__*/_react.default.createElement(CustomizeColumnsModal, {
|
85
|
-
instance: datagridState
|
86
|
-
}));
|
87
|
-
|
88
|
-
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, {
|
51
|
+
return /*#__PURE__*/_react.default.createElement(_InlineEditContext.InlineEditProvider, null, /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, {
|
89
52
|
id: tableId,
|
90
53
|
ref: ref,
|
91
54
|
className: (0, _classnames.default)(className, blockClass, withVirtualScroll ? "".concat(blockClass, "__datagridWrap") : "".concat(blockClass, "__datagridWrap-simple"), !isFetching && rows.length === 0 ? "".concat(blockClass, "__empty-state") : '')
|
92
55
|
}, (0, _devtools.getDevtoolsProps)(componentName)), leftPanel && /*#__PURE__*/_react.default.createElement("div", {
|
93
56
|
className: "".concat(blockClass, "__datagridWithPanel ").concat(blockClass, "__displayFlex ").concat(blockClass, "__leftPanel-position")
|
94
|
-
},
|
57
|
+
}, /*#__PURE__*/_react.default.createElement(_DatagridContent.DatagridContent, {
|
58
|
+
datagridState: datagridState
|
59
|
+
})), leftPanel === undefined && /*#__PURE__*/_react.default.createElement(_DatagridContent.DatagridContent, {
|
60
|
+
datagridState: datagridState
|
61
|
+
})));
|
95
62
|
}); // Return a placeholder if not released and not enabled by feature flag
|
96
63
|
|
97
64
|
|
@@ -0,0 +1,138 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
6
|
+
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
8
|
+
value: true
|
9
|
+
});
|
10
|
+
exports.DatagridContent = void 0;
|
11
|
+
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
13
|
+
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
15
|
+
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
17
|
+
|
18
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
19
|
+
|
20
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
21
|
+
|
22
|
+
var _carbonComponentsReact = require("carbon-components-react");
|
23
|
+
|
24
|
+
var _DatagridHead = _interopRequireDefault(require("./DatagridHead"));
|
25
|
+
|
26
|
+
var _DatagridBody = _interopRequireDefault(require("./DatagridBody"));
|
27
|
+
|
28
|
+
var _DatagridToolbar = _interopRequireDefault(require("./DatagridToolbar"));
|
29
|
+
|
30
|
+
var _handleGridKeyPress = require("./addons/InlineEdit/handleGridKeyPress");
|
31
|
+
|
32
|
+
var _settings = require("../../../settings");
|
33
|
+
|
34
|
+
var _InlineEditContext = require("./addons/InlineEdit/InlineEditContext");
|
35
|
+
|
36
|
+
var _handleGridFocus = require("./addons/InlineEdit/handleGridFocus");
|
37
|
+
|
38
|
+
var _hooks = require("../../../global/js/hooks");
|
39
|
+
|
40
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
41
|
+
|
42
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
43
|
+
|
44
|
+
var TableContainer = _carbonComponentsReact.DataTable.TableContainer,
|
45
|
+
Table = _carbonComponentsReact.DataTable.Table;
|
46
|
+
var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
|
47
|
+
|
48
|
+
var DatagridContent = function DatagridContent(_ref) {
|
49
|
+
var _getTableProps;
|
50
|
+
|
51
|
+
var datagridState = _ref.datagridState;
|
52
|
+
|
53
|
+
var _useContext = (0, _react.useContext)(_InlineEditContext.InlineEditContext),
|
54
|
+
state = _useContext.state,
|
55
|
+
dispatch = _useContext.dispatch;
|
56
|
+
|
57
|
+
var activeCellId = state.activeCellId;
|
58
|
+
var _datagridState$getTab = datagridState.getTableProps,
|
59
|
+
getTableProps = _datagridState$getTab === void 0 ? function () {} : _datagridState$getTab,
|
60
|
+
withVirtualScroll = datagridState.withVirtualScroll,
|
61
|
+
DatagridPagination = datagridState.DatagridPagination,
|
62
|
+
isFetching = datagridState.isFetching,
|
63
|
+
CustomizeColumnsModal = datagridState.CustomizeColumnsModal,
|
64
|
+
leftPanel = datagridState.leftPanel,
|
65
|
+
fullHeightDatagrid = datagridState.fullHeightDatagrid,
|
66
|
+
_datagridState$vertic = datagridState.verticalAlign,
|
67
|
+
verticalAlign = _datagridState$vertic === void 0 ? 'center' : _datagridState$vertic,
|
68
|
+
variableRowHeight = datagridState.variableRowHeight,
|
69
|
+
gridTitle = datagridState.gridTitle,
|
70
|
+
gridDescription = datagridState.gridDescription,
|
71
|
+
useDenseHeader = datagridState.useDenseHeader,
|
72
|
+
withInlineEdit = datagridState.withInlineEdit;
|
73
|
+
var rows = DatagridPagination && datagridState.page || datagridState.rows;
|
74
|
+
var gridActive = state.gridActive;
|
75
|
+
var gridAreaRef = (0, _react.useRef)();
|
76
|
+
(0, _hooks.useClickOutside)(gridAreaRef, function (target) {
|
77
|
+
if (!withInlineEdit) {
|
78
|
+
return;
|
79
|
+
} // We return from here if we find a parent element with the selector below
|
80
|
+
// because that element was initially part of the grid area but was removed
|
81
|
+
// and swapped out with an input, i.e. text, number, selection, or date picker
|
82
|
+
|
83
|
+
|
84
|
+
if (target.closest(".".concat(blockClass, "__inline-edit-button")) || target.closest(".".concat(blockClass, "__inline-edit--select"))) {
|
85
|
+
return;
|
86
|
+
}
|
87
|
+
|
88
|
+
dispatch({
|
89
|
+
type: 'REMOVE_GRID_ACTIVE_FOCUS',
|
90
|
+
payload: activeCellId
|
91
|
+
});
|
92
|
+
});
|
93
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(TableContainer, {
|
94
|
+
className: (0, _classnames.default)("".concat(blockClass, "__grid-container"), withVirtualScroll || fullHeightDatagrid ? "".concat(blockClass, "__full-height") : '', DatagridPagination ? "".concat(blockClass, "__with-pagination") : '', useDenseHeader ? "".concat(blockClass, "__dense-header") : ''),
|
95
|
+
title: gridTitle,
|
96
|
+
description: gridDescription
|
97
|
+
}, /*#__PURE__*/_react.default.createElement(_DatagridToolbar.default, datagridState), /*#__PURE__*/_react.default.createElement("div", {
|
98
|
+
className: "".concat(blockClass, "__table-container"),
|
99
|
+
ref: gridAreaRef
|
100
|
+
}, leftPanel && leftPanel.isOpen && /*#__PURE__*/_react.default.createElement("div", {
|
101
|
+
className: "".concat(blockClass, "__datagridLeftPanel")
|
102
|
+
}, leftPanel.panelContent), /*#__PURE__*/_react.default.createElement(Table, (0, _extends2.default)({}, getTableProps(), {
|
103
|
+
className: (0, _classnames.default)(withVirtualScroll ? '' : "".concat(blockClass, "__table-simple"), "".concat(blockClass, "__vertical-align-").concat(verticalAlign), (0, _defineProperty2.default)({}, "".concat(blockClass, "__variable-row-height"), variableRowHeight), (0, _defineProperty2.default)({}, "".concat(blockClass, "__table-with-inline-edit"), withInlineEdit), (0, _defineProperty2.default)({}, "".concat(blockClass, "__table-grid-active"), gridActive), (_getTableProps = getTableProps()) === null || _getTableProps === void 0 ? void 0 : _getTableProps.className),
|
104
|
+
role: withInlineEdit && 'grid',
|
105
|
+
tabIndex: withInlineEdit && 0,
|
106
|
+
onKeyDown: withInlineEdit ? function (event) {
|
107
|
+
return (0, _handleGridKeyPress.handleGridKeyPress)(event, dispatch, state, datagridState);
|
108
|
+
} : null,
|
109
|
+
onFocus: withInlineEdit ? function () {
|
110
|
+
return (0, _handleGridFocus.handleGridFocus)(state, dispatch);
|
111
|
+
} : null
|
112
|
+
}), /*#__PURE__*/_react.default.createElement(_DatagridHead.default, datagridState), /*#__PURE__*/_react.default.createElement(_DatagridBody.default, (0, _extends2.default)({}, datagridState, {
|
113
|
+
rows: rows
|
114
|
+
}))))), (rows === null || rows === void 0 ? void 0 : rows.length) > 0 && !isFetching && DatagridPagination && DatagridPagination(datagridState), CustomizeColumnsModal && /*#__PURE__*/_react.default.createElement(CustomizeColumnsModal, {
|
115
|
+
instance: datagridState
|
116
|
+
}));
|
117
|
+
};
|
118
|
+
|
119
|
+
exports.DatagridContent = DatagridContent;
|
120
|
+
DatagridContent.propTypes = {
|
121
|
+
datagridState: _propTypes.default.shape({
|
122
|
+
getTableProps: _propTypes.default.func,
|
123
|
+
withVirtualScroll: _propTypes.default.bool,
|
124
|
+
DatagridPagination: _propTypes.default.element,
|
125
|
+
CustomizeColumnsModal: _propTypes.default.element,
|
126
|
+
isFetching: _propTypes.default.bool,
|
127
|
+
leftPanel: _propTypes.default.object,
|
128
|
+
fullHeightDatagrid: _propTypes.default.bool,
|
129
|
+
variableRowHeight: _propTypes.default.bool,
|
130
|
+
useDenseHeader: _propTypes.default.bool,
|
131
|
+
withInlineEdit: _propTypes.default.bool,
|
132
|
+
verticalAlign: _propTypes.default.string,
|
133
|
+
gridTitle: _propTypes.default.node,
|
134
|
+
gridDescription: _propTypes.default.node,
|
135
|
+
page: _propTypes.default.arrayOf(_propTypes.default.object),
|
136
|
+
rows: _propTypes.default.arrayOf(_propTypes.default.object)
|
137
|
+
})
|
138
|
+
};
|
@@ -11,27 +11,36 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
11
11
|
|
12
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
13
13
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
15
|
+
|
14
16
|
var _react = _interopRequireDefault(require("react"));
|
15
17
|
|
16
18
|
var _carbonComponentsReact = require("carbon-components-react");
|
17
19
|
|
20
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
21
|
+
|
18
22
|
var _settings = require("../../../settings");
|
19
23
|
|
20
24
|
var _excluded = ["onChange"];
|
21
25
|
var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
|
22
26
|
|
23
27
|
var SelectAll = function SelectAll(datagridState) {
|
28
|
+
var _columns$;
|
29
|
+
|
24
30
|
var isFetching = datagridState.isFetching,
|
25
31
|
getToggleAllRowsSelectedProps = datagridState.getToggleAllRowsSelectedProps,
|
26
32
|
getToggleAllPageRowsSelectedProps = datagridState.getToggleAllPageRowsSelectedProps,
|
27
33
|
tableId = datagridState.tableId,
|
28
34
|
hideSelectAll = datagridState.hideSelectAll,
|
29
35
|
DatagridPagination = datagridState.DatagridPagination,
|
30
|
-
radio = datagridState.radio
|
36
|
+
radio = datagridState.radio,
|
37
|
+
columns = datagridState.columns,
|
38
|
+
withStickyColumn = datagridState.withStickyColumn;
|
39
|
+
var isFirstColumnStickyLeft = ((_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.sticky) === 'left' && withStickyColumn;
|
31
40
|
|
32
41
|
if (hideSelectAll || radio) {
|
33
42
|
return /*#__PURE__*/_react.default.createElement("div", {
|
34
|
-
className: "".concat(blockClass, "__head-hidden-select-all")
|
43
|
+
className: (0, _classnames.default)("".concat(blockClass, "__head-hidden-select-all"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__select-all-sticky-left"), isFirstColumnStickyLeft))
|
35
44
|
});
|
36
45
|
}
|
37
46
|
|
@@ -42,7 +51,7 @@ var SelectAll = function SelectAll(datagridState) {
|
|
42
51
|
selectProps = (0, _objectWithoutProperties2.default)(_getProps, _excluded);
|
43
52
|
|
44
53
|
return /*#__PURE__*/_react.default.createElement("div", {
|
45
|
-
className: "".concat(blockClass, "__head-select-all ").concat(blockClass, "__checkbox-cell")
|
54
|
+
className: (0, _classnames.default)("".concat(blockClass, "__head-select-all"), "".concat(blockClass, "__checkbox-cell"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__checkbox-cell-sticky-left"), isFirstColumnStickyLeft))
|
46
55
|
}, /*#__PURE__*/_react.default.createElement(TableSelectAll, (0, _extends2.default)({}, selectProps, {
|
47
56
|
name: "".concat(tableId, "-select-all-checkbox-name"),
|
48
57
|
onSelect: onChange,
|
@@ -45,6 +45,8 @@ var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
|
|
45
45
|
var DRAG_TYPE = "".concat(blockClass, "__shared-ui-draggable-element");
|
46
46
|
|
47
47
|
var DraggableElement = function DraggableElement(_ref) {
|
48
|
+
var _cx;
|
49
|
+
|
48
50
|
var id = _ref.id,
|
49
51
|
index = _ref.index,
|
50
52
|
listData = _ref.listData,
|
@@ -56,6 +58,7 @@ var DraggableElement = function DraggableElement(_ref) {
|
|
56
58
|
onArrowKeyDown = _ref.onArrowKeyDown,
|
57
59
|
isFocused = _ref.isFocused,
|
58
60
|
moveElement = _ref.moveElement,
|
61
|
+
selected = _ref.selected,
|
59
62
|
_ref$positionLabel = _ref.positionLabel,
|
60
63
|
positionLabel = _ref$positionLabel === void 0 ? 'Current position {index} of {total}' : _ref$positionLabel,
|
61
64
|
_ref$grabbedLabel = _ref.grabbedLabel,
|
@@ -142,7 +145,7 @@ var DraggableElement = function DraggableElement(_ref) {
|
|
142
145
|
}, "".concat(blockClass, "__draggable-handleStyle"))
|
143
146
|
}, /*#__PURE__*/React.createElement(_iconsReact.Draggable16, null)), children);
|
144
147
|
return /*#__PURE__*/React.createElement("li", {
|
145
|
-
className: (0, _classnames.default)((0, _defineProperty2.default)(
|
148
|
+
className: (0, _classnames.default)((_cx = {}, (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__draggable-handleHolder-isOver"), isOver && !disabled), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__draggable-handleHolder-grabbed"), isGrabbed), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__draggable-handleHolder-selected"), selected), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__draggable-handleHolder"), !selected), _cx)),
|
146
149
|
ref: ref,
|
147
150
|
"aria-selected": isFocused,
|
148
151
|
role: "option",
|
@@ -196,6 +199,7 @@ DraggableElement.propTypes = {
|
|
196
199
|
onArrowKeyDown: _propTypes.default.func.isRequired,
|
197
200
|
onGrab: _propTypes.default.func.isRequired,
|
198
201
|
positionLabel: _propTypes.default.string,
|
202
|
+
selected: _propTypes.default.bool,
|
199
203
|
type: _propTypes.default.string.isRequired
|
200
204
|
};
|
201
205
|
var _default = DraggableElement;
|