@carbon/ibm-products 1.11.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -3
- package/css/index-full-carbon.css +1543 -529
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +5 -5
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +12 -0
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +2 -2
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +77 -187
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +4 -4
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +194 -187
- package/css/index.css.map +1 -1
- package/css/index.min.css +5 -5
- package/css/index.min.css.map +1 -1
- package/es/components/AddSelect/AddSelect.js +63 -12
- package/es/components/AddSelect/AddSelectColumn.js +58 -22
- package/es/components/AddSelect/AddSelectList.js +38 -18
- package/es/components/AddSelect/AddSelectSidebar.js +2 -1
- package/es/components/ButtonMenu/ButtonMenu.js +11 -3
- package/es/components/CreateFullPage/CreateFullPageStep.js +4 -4
- package/es/components/CreateTearsheet/CreateTearsheetStep.js +4 -4
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +107 -89
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +93 -20
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +50 -2
- package/es/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +3 -1
- package/es/components/ImportModal/ImportModal.js +2 -2
- package/es/components/UserProfileImage/UserProfileImage.js +1 -1
- package/es/components/index.js +0 -1
- package/es/global/js/package-settings.js +1 -2
- package/lib/components/AddSelect/AddSelect.js +63 -12
- package/lib/components/AddSelect/AddSelectColumn.js +57 -21
- package/lib/components/AddSelect/AddSelectList.js +39 -17
- package/lib/components/AddSelect/AddSelectSidebar.js +2 -1
- package/lib/components/ButtonMenu/ButtonMenu.js +11 -3
- package/lib/components/CreateFullPage/CreateFullPageStep.js +4 -4
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +4 -4
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +108 -91
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +94 -20
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +52 -7
- package/lib/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +3 -1
- package/lib/components/ImportModal/ImportModal.js +1 -1
- package/lib/components/UserProfileImage/UserProfileImage.js +1 -1
- package/lib/components/index.js +0 -8
- package/lib/global/js/package-settings.js +1 -2
- package/package.json +16 -16
- package/scss/components/AboutModal/_about-modal.scss +2 -2
- package/scss/components/ActionSet/_action-set.scss +3 -1
- package/scss/components/AddSelect/_add-select.scss +41 -2
- package/scss/components/CreateModal/_create-modal.scss +7 -5
- package/scss/components/CreateModal/_storybook-styles.scss +8 -7
- package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +21 -3
- package/scss/components/ExportModal/_export-modal.scss +3 -3
- package/scss/components/InlineEdit/_inline-edit.scss +3 -0
- package/scss/components/ModifiedTabs/_modified-tabs.scss +4 -9
- package/scss/components/NotificationsPanel/_notifications-panel.scss +9 -5
- package/scss/components/OptionsTile/_options-tile.scss +0 -1
- package/scss/components/RemoveModal/_remove-modal.scss +3 -3
- package/scss/components/TagSet/_tag-set.scss +2 -1
- package/scss/components/Tearsheet/_tearsheet.scss +4 -1
- package/scss/components/_index.scss +0 -1
- package/es/components/LoadingBar/LoadingBar.js +0 -156
- package/es/components/LoadingBar/index.js +0 -7
- package/lib/components/LoadingBar/LoadingBar.js +0 -170
- package/lib/components/LoadingBar/index.js +0 -13
- package/scss/components/LoadingBar/_index.scss +0 -8
- package/scss/components/LoadingBar/_loading-bar.scss +0 -224
- package/scss/components/LoadingBar/_storybook-styles.scss +0 -14
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
4
|
|
5
|
-
var
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
6
6
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
8
8
|
value: true
|
@@ -11,8 +11,6 @@ exports.DataSpreadsheet = void 0;
|
|
11
11
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
13
13
|
|
14
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
15
|
-
|
16
14
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
17
15
|
|
18
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
@@ -43,8 +41,6 @@ var _getScrollbarWidth = require("../../global/js/utils/getScrollbarWidth");
|
|
43
41
|
|
44
42
|
var _hooks = require("../../global/js/hooks");
|
45
43
|
|
46
|
-
var _deepCloneObject = require("../../global/js/utils/deepCloneObject");
|
47
|
-
|
48
44
|
var _uuidv = _interopRequireDefault(require("../../global/js/utils/uuidv4"));
|
49
45
|
|
50
46
|
var _useResetSpreadsheetFocus = require("./hooks/useResetSpreadsheetFocus");
|
@@ -61,11 +57,11 @@ var _handleMultipleKeys = require("./utils/handleMultipleKeys");
|
|
61
57
|
|
62
58
|
var _handleHeaderCellSelection = require("./utils/handleHeaderCellSelection");
|
63
59
|
|
64
|
-
var _excluded = ["cellSize", "className", "columns", "data", "onDataUpdate", "id", "onActiveCellChange"];
|
60
|
+
var _excluded = ["cellSize", "className", "columns", "data", "onDataUpdate", "id", "onActiveCellChange", "onSelectionAreaChange"];
|
65
61
|
|
66
62
|
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); }
|
67
63
|
|
68
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
64
|
+
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; }
|
69
65
|
|
70
66
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
71
67
|
|
@@ -80,7 +76,9 @@ var defaults = {
|
|
80
76
|
cellSize: 'standard',
|
81
77
|
columns: Object.freeze([]),
|
82
78
|
data: Object.freeze([]),
|
83
|
-
onDataUpdate: Object.freeze(function () {})
|
79
|
+
onDataUpdate: Object.freeze(function () {}),
|
80
|
+
onActiveCellChange: Object.freeze(function () {}),
|
81
|
+
onSelectionAreaChange: Object.freeze(function () {})
|
84
82
|
};
|
85
83
|
/**
|
86
84
|
* DataSpreadsheet: used to organize and display large amounts of structured data, separated by columns and rows in a grid-like format.
|
@@ -97,7 +95,10 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
97
95
|
_ref$onDataUpdate = _ref.onDataUpdate,
|
98
96
|
onDataUpdate = _ref$onDataUpdate === void 0 ? defaults.onDataUpdate : _ref$onDataUpdate,
|
99
97
|
id = _ref.id,
|
100
|
-
|
98
|
+
_ref$onActiveCellChan = _ref.onActiveCellChange,
|
99
|
+
onActiveCellChange = _ref$onActiveCellChan === void 0 ? defaults.onActiveCellChange : _ref$onActiveCellChan,
|
100
|
+
_ref$onSelectionAreaC = _ref.onSelectionAreaChange,
|
101
|
+
onSelectionAreaChange = _ref$onSelectionAreaC === void 0 ? defaults.onSelectionAreaChange : _ref$onSelectionAreaC,
|
101
102
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
102
103
|
var localRef = (0, _react.useRef)();
|
103
104
|
var spreadsheetRef = ref || localRef;
|
@@ -118,32 +119,42 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
118
119
|
selectionAreas = _useState6[0],
|
119
120
|
setSelectionAreas = _useState6[1];
|
120
121
|
|
121
|
-
var _useState7 = (0, _react.useState)(
|
122
|
+
var _useState7 = (0, _react.useState)([]),
|
122
123
|
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
123
|
-
|
124
|
-
|
124
|
+
selectionAreaData = _useState8[0],
|
125
|
+
setSelectionAreaData = _useState8[1];
|
125
126
|
|
126
|
-
var _useState9 = (0, _react.useState)(
|
127
|
+
var _useState9 = (0, _react.useState)(false),
|
127
128
|
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
128
|
-
|
129
|
-
|
129
|
+
clickAndHoldActive = _useState10[0],
|
130
|
+
setClickAndHoldActive = _useState10[1];
|
130
131
|
|
131
|
-
var _useState11 = (0, _react.useState)(
|
132
|
+
var _useState11 = (0, _react.useState)(''),
|
132
133
|
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
133
|
-
|
134
|
-
|
134
|
+
currentMatcher = _useState12[0],
|
135
|
+
setCurrentMatcher = _useState12[1];
|
135
136
|
|
136
|
-
var _useState13 = (0, _react.useState)(
|
137
|
+
var _useState13 = (0, _react.useState)(false),
|
137
138
|
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
138
|
-
|
139
|
-
|
139
|
+
isEditing = _useState14[0],
|
140
|
+
setIsEditing = _useState14[1];
|
141
|
+
|
142
|
+
var _useState15 = (0, _react.useState)(''),
|
143
|
+
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
144
|
+
cellEditorValue = _useState16[0],
|
145
|
+
setCellEditorValue = _useState16[1];
|
140
146
|
|
141
147
|
var previousState = (0, _hooks.usePreviousValue)({
|
142
148
|
activeCellCoordinates: activeCellCoordinates
|
143
149
|
});
|
144
150
|
var cellSizeValue = (0, _getCellSize.getCellSize)(cellSize);
|
145
151
|
var cellEditorRef = (0, _react.useRef)();
|
146
|
-
|
152
|
+
|
153
|
+
var _useState17 = (0, _react.useState)(),
|
154
|
+
_useState18 = (0, _slicedToArray2.default)(_useState17, 2),
|
155
|
+
activeCellContent = _useState18[0],
|
156
|
+
setActiveCellContent = _useState18[1];
|
157
|
+
|
147
158
|
var activeKeys = (0, _react.useRef)([]);
|
148
159
|
var activeCellRef = (0, _react.useRef)();
|
149
160
|
var defaultColumn = (0, _react.useMemo)(function () {
|
@@ -219,10 +230,18 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
219
230
|
removeCellEditor();
|
220
231
|
updateData(prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.row, cellProps.column.id);
|
221
232
|
}
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
233
|
+
|
234
|
+
if ((prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.row) !== (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) || (prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.column) !== (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column)) {
|
235
|
+
if (activeCellCoordinates && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) !== 'header' && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) !== 'header') {
|
236
|
+
var activeCellFullData = typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'number' && typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'number' ? rows[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row].cells[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column] : null;
|
237
|
+
setActiveCellContent(activeCellFullData.render('Cell'));
|
238
|
+
}
|
239
|
+
|
240
|
+
if (activeCellCoordinates && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header' || (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header') {
|
241
|
+
setActiveCellContent(null);
|
242
|
+
}
|
243
|
+
}
|
244
|
+
}, [activeCellCoordinates, previousState === null || previousState === void 0 ? void 0 : previousState.activeCellCoordinates, updateData, rows, isEditing, removeCellEditor, activeCellContent]);
|
226
245
|
var createActiveCell = (0, _react.useCallback)(function (_ref2) {
|
227
246
|
var placementElement = _ref2.placementElement,
|
228
247
|
coords = _ref2.coords,
|
@@ -326,6 +345,7 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
326
345
|
|
327
346
|
if (selectionAreas !== null && selectionAreas !== void 0 && selectionAreas.length && key !== 'Shift' && !activeKeys.current.includes('Shift')) {
|
328
347
|
setSelectionAreas([]);
|
348
|
+
setSelectionAreaData([]);
|
329
349
|
removeCellSelections({
|
330
350
|
spreadsheetRef: spreadsheetRef
|
331
351
|
});
|
@@ -509,6 +529,18 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
509
529
|
var activeCellFullData = typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'number' && typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'number' ? rows[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row].cells[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column] : null;
|
510
530
|
var activeCellValue = activeCellFullData ? Object.values(activeCellFullData.row.values)[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column] : null;
|
511
531
|
setCellEditorValue(activeCellValue);
|
532
|
+
};
|
533
|
+
|
534
|
+
var handleActiveCellClick = function handleActiveCellClick() {
|
535
|
+
if ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header' || (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header') {
|
536
|
+
var indexValue = (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header' ? activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column : activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row;
|
537
|
+
handleRowColumnHeaderClick({
|
538
|
+
isKeyboard: false,
|
539
|
+
index: indexValue
|
540
|
+
});
|
541
|
+
}
|
542
|
+
|
543
|
+
return;
|
512
544
|
}; // Go into edit mode if 'Enter' key is pressed on activeCellRef
|
513
545
|
|
514
546
|
|
@@ -521,31 +553,42 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
521
553
|
}
|
522
554
|
|
523
555
|
if ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header' || (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header') {
|
524
|
-
|
525
|
-
activeCellCoordinates: activeCellCoordinates,
|
526
|
-
rows: rows,
|
527
|
-
columns: columns,
|
528
|
-
setActiveCellCoordinates: setActiveCellCoordinates,
|
529
|
-
setCurrentMatcher: setCurrentMatcher,
|
530
|
-
setSelectionAreas: setSelectionAreas,
|
531
|
-
spreadsheetRef: spreadsheetRef,
|
556
|
+
handleRowColumnHeaderClick({
|
532
557
|
isKeyboard: true
|
533
|
-
};
|
534
|
-
|
535
|
-
if ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header') {
|
536
|
-
(0, _handleHeaderCellSelection.handleHeaderCellSelection)(_objectSpread({
|
537
|
-
type: 'column'
|
538
|
-
}, handleHeaderCellProps));
|
539
|
-
} // Select an entire row
|
540
|
-
|
541
|
-
|
542
|
-
if ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header') {
|
543
|
-
(0, _handleHeaderCellSelection.handleHeaderCellSelection)(_objectSpread({
|
544
|
-
type: 'row'
|
545
|
-
}, handleHeaderCellProps));
|
546
|
-
}
|
558
|
+
});
|
547
559
|
}
|
548
560
|
}
|
561
|
+
};
|
562
|
+
|
563
|
+
var handleRowColumnHeaderClick = function handleRowColumnHeaderClick(_ref4) {
|
564
|
+
var isKeyboard = _ref4.isKeyboard,
|
565
|
+
_ref4$index = _ref4.index,
|
566
|
+
index = _ref4$index === void 0 ? null : _ref4$index;
|
567
|
+
var handleHeaderCellProps = {
|
568
|
+
activeCellCoordinates: activeCellCoordinates,
|
569
|
+
rows: rows,
|
570
|
+
columns: columns,
|
571
|
+
setActiveCellCoordinates: setActiveCellCoordinates,
|
572
|
+
setCurrentMatcher: setCurrentMatcher,
|
573
|
+
setSelectionAreas: setSelectionAreas,
|
574
|
+
spreadsheetRef: spreadsheetRef,
|
575
|
+
isKeyboard: isKeyboard,
|
576
|
+
setSelectionAreaData: setSelectionAreaData,
|
577
|
+
index: index
|
578
|
+
}; // Select an entire column
|
579
|
+
|
580
|
+
if ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header') {
|
581
|
+
(0, _handleHeaderCellSelection.handleHeaderCellSelection)(_objectSpread({
|
582
|
+
type: 'column'
|
583
|
+
}, handleHeaderCellProps));
|
584
|
+
} // Select an entire row
|
585
|
+
|
586
|
+
|
587
|
+
if ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header') {
|
588
|
+
(0, _handleHeaderCellSelection.handleHeaderCellSelection)(_objectSpread({
|
589
|
+
type: 'row'
|
590
|
+
}, handleHeaderCellProps));
|
591
|
+
}
|
549
592
|
}; // Go into edit mode if double click is detected on activeCellRef
|
550
593
|
|
551
594
|
|
@@ -586,44 +629,8 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
586
629
|
}
|
587
630
|
|
588
631
|
return;
|
589
|
-
};
|
590
|
-
// Find point object that matches currentMatcher and remove the second point
|
591
|
-
// because hovering over the active cell while clicking and holding should
|
592
|
-
// remove the previously existing selection area
|
593
|
-
|
594
|
-
|
595
|
-
var handleActiveCellMouseEnterCallback = (0, _react.useCallback)(function (areas, clickHold) {
|
596
|
-
var freshMatcherValue = currentMatcherRef.current;
|
597
|
-
|
598
|
-
if (!freshMatcherValue) {
|
599
|
-
return;
|
600
|
-
}
|
601
|
-
|
602
|
-
if (areas && areas.length && clickHold && freshMatcherValue) {
|
603
|
-
setSelectionAreas(function (prev) {
|
604
|
-
var selectionAreaClone = (0, _deepCloneObject.deepCloneObject)(prev);
|
605
|
-
var indexOfItemToUpdate = selectionAreaClone.findIndex(function (item) {
|
606
|
-
return item.matcher === freshMatcherValue;
|
607
|
-
});
|
608
|
-
|
609
|
-
if (indexOfItemToUpdate === -1) {
|
610
|
-
return prev;
|
611
|
-
}
|
612
|
-
|
613
|
-
if ((0, _typeof2.default)(selectionAreaClone[indexOfItemToUpdate].point2) === 'object' && selectionAreaClone[indexOfItemToUpdate].areaCreated) {
|
614
|
-
selectionAreaClone[indexOfItemToUpdate].point2 = null;
|
615
|
-
selectionAreaClone[indexOfItemToUpdate].areaCreated = false;
|
616
|
-
removeCellSelections({
|
617
|
-
matcher: freshMatcherValue,
|
618
|
-
spreadsheetRef: spreadsheetRef
|
619
|
-
});
|
620
|
-
return selectionAreaClone;
|
621
|
-
}
|
632
|
+
};
|
622
633
|
|
623
|
-
return prev;
|
624
|
-
});
|
625
|
-
}
|
626
|
-
}, [spreadsheetRef, removeCellSelections]);
|
627
634
|
(0, _react.useEffect)(function () {
|
628
635
|
if (isEditing) {
|
629
636
|
var _rows$activeCellCoord, _cellProps$column, _cellEditorRef$curren;
|
@@ -636,7 +643,7 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
636
643
|
cellEditorRef.current.style.display = 'block';
|
637
644
|
cellEditorRef.current.style.width = activeCellRef === null || activeCellRef === void 0 ? void 0 : activeCellRef.current.style.width;
|
638
645
|
cellEditorRef.current.style.height = activeCellRef === null || activeCellRef === void 0 ? void 0 : activeCellRef.current.style.height;
|
639
|
-
cellEditorRef.current.style.paddingTop = "".concat((parseInt(activeCellRef === null || activeCellRef === void 0 ? void 0 : activeCellRef.current.style.height) - 16) / 2, "px"); // calculate paddingTop based on cellHeight which could be variable depending on the cellSize prop
|
646
|
+
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
|
640
647
|
|
641
648
|
cellEditorRef.current.style.textAlign = (cellProps === null || cellProps === void 0 ? void 0 : (_cellProps$column = cellProps.column) === null || _cellProps$column === void 0 ? void 0 : _cellProps$column.placement) === 'right' ? 'right' : 'left';
|
642
649
|
(_cellEditorRef$curren = cellEditorRef.current) === null || _cellEditorRef$curren === void 0 ? void 0 : _cellEditorRef$curren.focus();
|
@@ -678,15 +685,17 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
678
685
|
}), /*#__PURE__*/_react.default.createElement(_DataSpreadsheetHeader.DataSpreadsheetHeader, {
|
679
686
|
ref: spreadsheetRef,
|
680
687
|
activeCellCoordinates: activeCellCoordinates,
|
681
|
-
|
688
|
+
cellSize: cellSize,
|
682
689
|
columns: columns,
|
683
690
|
defaultColumn: defaultColumn,
|
684
691
|
headerGroups: headerGroups,
|
685
692
|
rows: rows,
|
693
|
+
scrollBarSize: scrollBarSize,
|
686
694
|
selectionAreas: selectionAreas,
|
687
695
|
setActiveCellCoordinates: setActiveCellCoordinates,
|
688
696
|
setSelectionAreas: setSelectionAreas,
|
689
|
-
setCurrentMatcher: setCurrentMatcher
|
697
|
+
setCurrentMatcher: setCurrentMatcher,
|
698
|
+
setSelectionAreaData: setSelectionAreaData
|
690
699
|
}), /*#__PURE__*/_react.default.createElement(_DataSpreadsheetBody.DataSpreadsheetBody, {
|
691
700
|
activeCellCoordinates: activeCellCoordinates,
|
692
701
|
ref: spreadsheetRef,
|
@@ -701,21 +710,24 @@ var DataSpreadsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
701
710
|
defaultColumn: defaultColumn,
|
702
711
|
getTableBodyProps: getTableBodyProps,
|
703
712
|
onActiveCellChange: onActiveCellChange,
|
713
|
+
onSelectionAreaChange: onSelectionAreaChange,
|
704
714
|
prepareRow: prepareRow,
|
705
715
|
rows: rows,
|
716
|
+
selectionAreaData: selectionAreaData,
|
717
|
+
setSelectionAreaData: setSelectionAreaData,
|
706
718
|
setActiveCellCoordinates: setActiveCellCoordinates,
|
707
719
|
scrollBarSize: scrollBarSize,
|
708
720
|
totalColumnsWidth: totalColumnsWidth,
|
709
721
|
id: id,
|
710
722
|
columns: columns
|
711
723
|
}), /*#__PURE__*/_react.default.createElement("button", {
|
724
|
+
onClick: handleActiveCellClick,
|
712
725
|
onKeyDown: handleActiveCellKeyDown,
|
713
|
-
onMouseEnter: handleActiveCellMouseEnter,
|
714
726
|
onDoubleClick: handleActiveCellDoubleClick,
|
715
727
|
ref: activeCellRef,
|
716
728
|
className: (0, _classnames.default)("".concat(blockClass, "--interactive-cell-element"), "".concat(blockClass, "__active-cell--highlight")),
|
717
729
|
type: "button"
|
718
|
-
}), /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.TextArea, {
|
730
|
+
}, activeCellContent), /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.TextArea, {
|
719
731
|
value: cellEditorValue,
|
720
732
|
onKeyDown: handleEditSubmit,
|
721
733
|
onChange: function onChange(event) {
|
@@ -776,7 +788,12 @@ DataSpreadsheet.propTypes = {
|
|
776
788
|
/**
|
777
789
|
* The setter fn for the data prop
|
778
790
|
*/
|
779
|
-
onDataUpdate: _propTypes.default.func
|
791
|
+
onDataUpdate: _propTypes.default.func,
|
792
|
+
|
793
|
+
/**
|
794
|
+
* The event handler that is called when the selection area values change
|
795
|
+
*/
|
796
|
+
onSelectionAreaChange: _propTypes.default.func
|
780
797
|
/* TODO: add types and DocGen for all props. */
|
781
798
|
|
782
799
|
};
|
@@ -29,6 +29,8 @@ var _deepCloneObject = require("../../global/js/utils/deepCloneObject");
|
|
29
29
|
|
30
30
|
var _uuidv = _interopRequireDefault(require("../../global/js/utils/uuidv4"));
|
31
31
|
|
32
|
+
var _hooks = require("../../global/js/hooks");
|
33
|
+
|
32
34
|
var _removeCellSelections = require("./utils/removeCellSelections");
|
33
35
|
|
34
36
|
var _createCellSelectionArea = require("./utils/createCellSelectionArea");
|
@@ -56,6 +58,8 @@ var DataSpreadsheetBody = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
56
58
|
id = _ref.id,
|
57
59
|
prepareRow = _ref.prepareRow,
|
58
60
|
rows = _ref.rows,
|
61
|
+
selectionAreaData = _ref.selectionAreaData,
|
62
|
+
setSelectionAreaData = _ref.setSelectionAreaData,
|
59
63
|
setActiveCellCoordinates = _ref.setActiveCellCoordinates,
|
60
64
|
selectionAreas = _ref.selectionAreas,
|
61
65
|
setContainerHasFocus = _ref.setContainerHasFocus,
|
@@ -65,24 +69,60 @@ var DataSpreadsheetBody = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
65
69
|
clickAndHoldActive = _ref.clickAndHoldActive,
|
66
70
|
setClickAndHoldActive = _ref.setClickAndHoldActive,
|
67
71
|
currentMatcher = _ref.currentMatcher,
|
68
|
-
setCurrentMatcher = _ref.setCurrentMatcher
|
69
|
-
|
72
|
+
setCurrentMatcher = _ref.setCurrentMatcher,
|
73
|
+
onSelectionAreaChange = _ref.onSelectionAreaChange;
|
74
|
+
var previousState = (0, _hooks.usePreviousValue)({
|
75
|
+
selectionAreaData: selectionAreaData,
|
76
|
+
clickAndHoldActive: clickAndHoldActive
|
77
|
+
}); // Call the `onSelectionAreaChange` handler to send selection area data
|
78
|
+
// back to the consumer
|
79
|
+
|
80
|
+
(0, _react.useEffect)(function () {
|
81
|
+
if (selectionAreaData.length) {
|
82
|
+
var _previousState$select;
|
83
|
+
|
84
|
+
if (!clickAndHoldActive && previousState !== null && previousState !== void 0 && previousState.clickAndHoldActive || (previousState === null || previousState === void 0 ? 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)) {
|
85
|
+
onSelectionAreaChange(selectionAreaData);
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}, [previousState === null || previousState === void 0 ? void 0 : previousState.selectionAreaData, selectionAreaData, onSelectionAreaChange, clickAndHoldActive, previousState === null || previousState === void 0 ? void 0 : previousState.clickAndHoldActive]); // Create cell selection areas based on selectionAreas array
|
89
|
+
|
70
90
|
(0, _react.useEffect)(function () {
|
71
91
|
if (selectionAreas && selectionAreas.length) {
|
72
92
|
selectionAreas.map(function (area) {
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
93
|
+
// Setup selection area data that will be sent back to consumer via onSelectionAreaChange prop
|
94
|
+
if (area.areaCreated) {
|
95
|
+
var rowStart = Math.min(area.point1.row, area.point2.row);
|
96
|
+
var rowEnd = Math.max(area.point1.row, area.point2.row);
|
97
|
+
var columnStart = Math.min(area.point1.column, area.point2.column);
|
98
|
+
var columnEnd = Math.max(area.point1.column, area.point2.column);
|
99
|
+
var selectionData = {
|
100
|
+
rows: {
|
101
|
+
start: rowStart,
|
102
|
+
end: rowEnd
|
103
|
+
},
|
104
|
+
columns: {
|
105
|
+
start: columnStart,
|
106
|
+
end: columnEnd
|
107
|
+
},
|
108
|
+
cells: populateSelectionAreaCellData({
|
109
|
+
rowStart: rowStart,
|
110
|
+
rowEnd: rowEnd,
|
111
|
+
columnStart: columnStart,
|
112
|
+
columnEnd: columnEnd
|
113
|
+
}),
|
114
|
+
selectionId: area.matcher
|
115
|
+
};
|
116
|
+
setSelectionAreaData(function (prev) {
|
117
|
+
var prevValues = (0, _deepCloneObject.deepCloneObject)(prev);
|
118
|
+
var newAreaData = prevValues.filter(function (item) {
|
119
|
+
return item.selectionId !== area.matcher;
|
80
120
|
});
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
}
|
121
|
+
return [].concat((0, _toConsumableArray2.default)(newAreaData), [selectionData]);
|
122
|
+
});
|
123
|
+
}
|
85
124
|
|
125
|
+
if (!area.areaCreated && area.point1 && area.point2 && area.matcher) {
|
86
126
|
(0, _createCellSelectionArea.createCellSelectionArea)({
|
87
127
|
area: area,
|
88
128
|
blockClass: blockClass,
|
@@ -95,7 +135,24 @@ var DataSpreadsheetBody = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
95
135
|
return;
|
96
136
|
});
|
97
137
|
}
|
98
|
-
}, [selectionAreas, setSelectionAreas, defaultColumn]);
|
138
|
+
}, [selectionAreas, setSelectionAreas, defaultColumn, onSelectionAreaChange, setSelectionAreaData]);
|
139
|
+
|
140
|
+
var populateSelectionAreaCellData = function populateSelectionAreaCellData(_ref2) {
|
141
|
+
var rowStart = _ref2.rowStart,
|
142
|
+
rowEnd = _ref2.rowEnd,
|
143
|
+
columnStart = _ref2.columnStart,
|
144
|
+
columnEnd = _ref2.columnEnd;
|
145
|
+
var cellContainer = [];
|
146
|
+
|
147
|
+
for (var rowIndex = rowStart; rowIndex <= rowEnd; rowIndex++) {
|
148
|
+
for (var columnIndex = columnStart; columnIndex <= columnEnd; columnIndex++) {
|
149
|
+
cellContainer.push([rowIndex, columnIndex]);
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
return cellContainer;
|
154
|
+
}; // Mouse up
|
155
|
+
|
99
156
|
|
100
157
|
(0, _react.useEffect)(function () {
|
101
158
|
var handleMouseUp = function handleMouseUp(event) {
|
@@ -196,9 +253,10 @@ var DataSpreadsheetBody = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
196
253
|
matcher: tempMatcher
|
197
254
|
}]);
|
198
255
|
setCurrentMatcher(tempMatcher);
|
256
|
+
setSelectionAreaData([]);
|
199
257
|
}
|
200
258
|
};
|
201
|
-
}, [currentMatcher, activeCellCoordinates, selectionAreas, setActiveCellCoordinates, setSelectionAreas, setContainerHasFocus, setClickAndHoldActive, setCurrentMatcher, ref]);
|
259
|
+
}, [currentMatcher, activeCellCoordinates, selectionAreas, setActiveCellCoordinates, setSelectionAreas, setContainerHasFocus, setClickAndHoldActive, setCurrentMatcher, ref, setSelectionAreaData]);
|
202
260
|
var handleBodyCellHover = (0, _react.useCallback)(function (cell, columnIndex) {
|
203
261
|
return function () {
|
204
262
|
if (clickAndHoldActive) {
|
@@ -241,14 +299,15 @@ var DataSpreadsheetBody = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
241
299
|
setCurrentMatcher: setCurrentMatcher,
|
242
300
|
setSelectionAreas: setSelectionAreas,
|
243
301
|
spreadsheetRef: ref,
|
244
|
-
index: index
|
302
|
+
index: index,
|
303
|
+
setSelectionAreaData: setSelectionAreaData
|
245
304
|
});
|
246
305
|
};
|
247
|
-
}, [columns, ref, setSelectionAreas, setCurrentMatcher, setActiveCellCoordinates, activeCellCoordinates, rows]); // Renders each row/cell in the spreadsheet body
|
306
|
+
}, [columns, ref, setSelectionAreas, setCurrentMatcher, setActiveCellCoordinates, activeCellCoordinates, rows, setSelectionAreaData]); // Renders each row/cell in the spreadsheet body
|
248
307
|
|
249
|
-
var RenderRow = (0, _react.useCallback)(function (
|
250
|
-
var index =
|
251
|
-
style =
|
308
|
+
var RenderRow = (0, _react.useCallback)(function (_ref3) {
|
309
|
+
var index = _ref3.index,
|
310
|
+
style = _ref3.style;
|
252
311
|
var row = rows[index];
|
253
312
|
prepareRow(row);
|
254
313
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, row.getRowProps({
|
@@ -342,6 +401,11 @@ DataSpreadsheetBody.propTypes = {
|
|
342
401
|
*/
|
343
402
|
onActiveCellChange: _propTypes.default.func,
|
344
403
|
|
404
|
+
/**
|
405
|
+
* The event handler that is called when the selection areas change
|
406
|
+
*/
|
407
|
+
onSelectionAreaChange: _propTypes.default.func,
|
408
|
+
|
345
409
|
/**
|
346
410
|
* Prepare row function from react-table
|
347
411
|
*/
|
@@ -357,6 +421,11 @@ DataSpreadsheetBody.propTypes = {
|
|
357
421
|
*/
|
358
422
|
scrollBarSize: _propTypes.default.number,
|
359
423
|
|
424
|
+
/**
|
425
|
+
* Array of selection area data
|
426
|
+
*/
|
427
|
+
selectionAreaData: _propTypes.default.array,
|
428
|
+
|
360
429
|
/**
|
361
430
|
* Array of selection areas
|
362
431
|
*/
|
@@ -382,6 +451,11 @@ DataSpreadsheetBody.propTypes = {
|
|
382
451
|
*/
|
383
452
|
setCurrentMatcher: _propTypes.default.func,
|
384
453
|
|
454
|
+
/**
|
455
|
+
* Setter fn for selectionAreaData state value
|
456
|
+
*/
|
457
|
+
setSelectionAreaData: _propTypes.default.func,
|
458
|
+
|
385
459
|
/**
|
386
460
|
* Setter fn for selectionAreas state value
|
387
461
|
*/
|
@@ -13,40 +13,66 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
13
13
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
15
15
|
|
16
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
17
|
+
|
16
18
|
var _react = _interopRequireWildcard(require("react"));
|
17
19
|
|
18
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
19
21
|
|
20
22
|
var _classnames = _interopRequireDefault(require("classnames"));
|
21
23
|
|
24
|
+
var _layout = require("@carbon/layout");
|
25
|
+
|
22
26
|
var _settings = require("../../settings");
|
23
27
|
|
24
28
|
var _checkActiveHeaderCell = require("./utils/checkActiveHeaderCell");
|
25
29
|
|
26
30
|
var _handleHeaderCellSelection = require("./utils/handleHeaderCellSelection");
|
27
31
|
|
32
|
+
var _hooks = require("../../global/js/hooks");
|
33
|
+
|
28
34
|
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); }
|
29
35
|
|
30
36
|
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; }
|
31
37
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
* LICENSE file in the root directory of this source tree.
|
37
|
-
*/
|
38
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
39
|
+
|
40
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
41
|
+
|
38
42
|
var blockClass = "".concat(_settings.pkg.prefix, "--data-spreadsheet");
|
39
43
|
var DataSpreadsheetHeader = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
40
44
|
var activeCellCoordinates = _ref.activeCellCoordinates,
|
45
|
+
cellSize = _ref.cellSize,
|
41
46
|
columns = _ref.columns,
|
42
47
|
defaultColumn = _ref.defaultColumn,
|
43
48
|
headerGroups = _ref.headerGroups,
|
49
|
+
scrollBarSize = _ref.scrollBarSize,
|
44
50
|
selectionAreas = _ref.selectionAreas,
|
45
51
|
setActiveCellCoordinates = _ref.setActiveCellCoordinates,
|
46
52
|
setCurrentMatcher = _ref.setCurrentMatcher,
|
47
53
|
setSelectionAreas = _ref.setSelectionAreas,
|
54
|
+
setSelectionAreaData = _ref.setSelectionAreaData,
|
48
55
|
rows = _ref.rows;
|
49
56
|
|
57
|
+
var _useState = (0, _react.useState)(0),
|
58
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
59
|
+
scrollBarSizeValue = _useState2[0],
|
60
|
+
setScrollBarSizeValue = _useState2[1];
|
61
|
+
|
62
|
+
var previousState = (0, _hooks.usePreviousValue)({
|
63
|
+
cellSize: cellSize
|
64
|
+
});
|
65
|
+
(0, _react.useEffect)(function () {
|
66
|
+
if ((previousState === null || previousState === void 0 ? void 0 : previousState.cellSize) !== cellSize) {
|
67
|
+
var _ref$current;
|
68
|
+
|
69
|
+
var scrollContainer = ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.querySelector(".".concat(blockClass, "__list--container"));
|
70
|
+
var hasScrollBar = (scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.scrollHeight) > (scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.clientHeight);
|
71
|
+
var scrollBarValue = hasScrollBar ? 0 : scrollBarSize;
|
72
|
+
setScrollBarSizeValue(scrollBarValue);
|
73
|
+
}
|
74
|
+
}, [cellSize, ref, scrollBarSize, previousState === null || previousState === void 0 ? void 0 : previousState.cellSize]);
|
75
|
+
|
50
76
|
var handleColumnHeaderClick = function handleColumnHeaderClick(index) {
|
51
77
|
return function () {
|
52
78
|
(0, _handleHeaderCellSelection.handleHeaderCellSelection)({
|
@@ -58,7 +84,8 @@ var DataSpreadsheetHeader = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
|
|
58
84
|
setCurrentMatcher: setCurrentMatcher,
|
59
85
|
setSelectionAreas: setSelectionAreas,
|
60
86
|
spreadsheetRef: ref,
|
61
|
-
index: index
|
87
|
+
index: index,
|
88
|
+
setSelectionAreaData: setSelectionAreaData
|
62
89
|
});
|
63
90
|
};
|
64
91
|
};
|
@@ -69,6 +96,9 @@ var DataSpreadsheetHeader = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
|
|
69
96
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
70
97
|
key: "header_".concat(index)
|
71
98
|
}, headerGroup.getHeaderGroupProps(), {
|
99
|
+
style: _objectSpread(_objectSpread({}, headerGroup.getHeaderGroupProps().style), {}, {
|
100
|
+
width: (0, _layout.px)(parseInt(headerGroup.getHeaderGroupProps().style.width) + scrollBarSizeValue)
|
101
|
+
}),
|
72
102
|
className: "".concat(blockClass, "__tr")
|
73
103
|
}), /*#__PURE__*/_react.default.createElement("button", {
|
74
104
|
"data-row-index": "header",
|
@@ -107,6 +137,11 @@ DataSpreadsheetHeader.propTypes = {
|
|
107
137
|
column: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
|
108
138
|
}),
|
109
139
|
|
140
|
+
/**
|
141
|
+
* Specifies the cell height
|
142
|
+
*/
|
143
|
+
cellSize: _propTypes.default.oneOf(['compact', 'standard', 'medium', 'large']),
|
144
|
+
|
110
145
|
/**
|
111
146
|
* All of the spreadsheet columns
|
112
147
|
*/
|
@@ -131,6 +166,11 @@ DataSpreadsheetHeader.propTypes = {
|
|
131
166
|
*/
|
132
167
|
rows: _propTypes.default.arrayOf(_propTypes.default.object),
|
133
168
|
|
169
|
+
/**
|
170
|
+
* The scrollbar width
|
171
|
+
*/
|
172
|
+
scrollBarSize: _propTypes.default.number,
|
173
|
+
|
134
174
|
/**
|
135
175
|
* All of the cell selection area items
|
136
176
|
*/
|
@@ -146,6 +186,11 @@ DataSpreadsheetHeader.propTypes = {
|
|
146
186
|
*/
|
147
187
|
setCurrentMatcher: _propTypes.default.func,
|
148
188
|
|
189
|
+
/**
|
190
|
+
* Setter fn for selectionAreaData state value
|
191
|
+
*/
|
192
|
+
setSelectionAreaData: _propTypes.default.func,
|
193
|
+
|
149
194
|
/**
|
150
195
|
* Setter fn for selectionAreas value
|
151
196
|
*/
|