@carbon/ibm-products 2.29.0-alpha.10 → 2.30.0-alpha.11
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +1410 -3
- 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-released-only.css +44 -3
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +1410 -3
- 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 +1410 -3
- 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/AboutModal/AboutModal.d.ts +73 -2
- package/es/components/AboutModal/AboutModal.js +10 -28
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +120 -145
- package/es/components/Datagrid/Datagrid/DatagridRow.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +4 -2
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +6 -3
- package/es/components/Datagrid/useActionsColumn.js +6 -2
- package/es/components/Decorator/Decorator.d.ts +5 -0
- package/es/components/Decorator/Decorator.js +348 -0
- package/es/components/Decorator/DecoratorIcon.d.ts +5 -0
- package/es/components/Decorator/DecoratorIcon.js +95 -0
- package/es/components/Decorator/index.d.ts +1 -0
- package/es/components/Decorator/utils.d.ts +8 -0
- package/es/components/Decorator/utils.js +43 -0
- package/es/components/Toolbar/ToolbarButton.d.ts +24 -3
- package/es/components/Toolbar/ToolbarButton.js +2 -2
- package/es/components/index.d.ts +1 -0
- package/es/global/js/package-settings.d.ts +1 -0
- package/es/global/js/package-settings.js +1 -0
- package/es/index.js +1 -0
- package/es/settings.d.ts +1 -0
- package/lib/components/AboutModal/AboutModal.d.ts +73 -2
- package/lib/components/AboutModal/AboutModal.js +8 -26
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +120 -145
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +4 -2
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +6 -3
- package/lib/components/Datagrid/useActionsColumn.js +6 -2
- package/lib/components/Decorator/Decorator.d.ts +5 -0
- package/lib/components/Decorator/Decorator.js +355 -0
- package/lib/components/Decorator/DecoratorIcon.d.ts +5 -0
- package/lib/components/Decorator/DecoratorIcon.js +102 -0
- package/lib/components/Decorator/index.d.ts +1 -0
- package/lib/components/Decorator/utils.d.ts +8 -0
- package/lib/components/Decorator/utils.js +48 -0
- package/lib/components/Toolbar/ToolbarButton.d.ts +24 -3
- package/lib/components/Toolbar/ToolbarButton.js +2 -2
- package/lib/components/index.d.ts +1 -0
- package/lib/global/js/package-settings.d.ts +1 -0
- package/lib/global/js/package-settings.js +1 -0
- package/lib/index.js +5 -0
- package/lib/settings.d.ts +1 -0
- package/package.json +6 -5
- package/scss/components/AboutModal/_about-modal.scss +7 -2
- package/scss/components/Datagrid/styles/_useExpandedRow.scss +8 -0
- package/scss/components/Datagrid/styles/_useNestedRows.scss +54 -0
- package/scss/components/Datagrid/styles/_useStickyColumn.scss +5 -0
- package/scss/components/Datagrid/styles/addons/_FilterPanel.scss +1 -1
- package/scss/components/Decorator/_carbon-imports.scss +9 -0
- package/scss/components/Decorator/_decorator.scss +400 -0
- package/scss/components/Decorator/_index-with-carbon.scss +9 -0
- package/scss/components/Decorator/_index.scss +8 -0
- package/scss/components/TagSet/_tag-set.scss +1 -0
- package/scss/components/_index-with-carbon.scss +1 -0
- package/scss/components/_index.scss +1 -0
@@ -10,15 +10,14 @@
|
|
10
10
|
Object.defineProperty(exports, '__esModule', { value: true });
|
11
11
|
|
12
12
|
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
13
|
+
var react = require('@carbon/react');
|
13
14
|
var React = require('react');
|
14
|
-
var useResizeObserver = require('../../global/js/hooks/useResizeObserver.js');
|
15
15
|
var index = require('../../node_modules/prop-types/index.js');
|
16
16
|
var cx = require('classnames');
|
17
|
-
var settings = require('../../settings.js');
|
18
|
-
var uuidv4 = require('../../global/js/utils/uuidv4.js');
|
19
17
|
var devtools = require('../../global/js/utils/devtools.js');
|
20
|
-
var
|
18
|
+
var settings = require('../../settings.js');
|
21
19
|
var usePortalTarget = require('../../global/js/hooks/usePortalTarget.js');
|
20
|
+
var uuidv4 = require('../../global/js/utils/uuidv4.js');
|
22
21
|
|
23
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
24
23
|
|
@@ -30,7 +29,6 @@ var _excluded = ["additionalInfo", "className", "closeIconDescription", "copyrig
|
|
30
29
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
31
30
|
var blockClass = "".concat(settings.pkg.prefix, "--about-modal");
|
32
31
|
var componentName = 'AboutModal';
|
33
|
-
|
34
32
|
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
35
33
|
|
36
34
|
/**
|
@@ -55,30 +53,17 @@ exports.AboutModal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
55
53
|
title = _ref.title,
|
56
54
|
version = _ref.version,
|
57
55
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
58
|
-
var
|
59
|
-
|
60
|
-
hasScrollingContent = _useState2[0],
|
61
|
-
setHasScrollingContent = _useState2[1];
|
62
|
-
var bodyRef = React.useRef();
|
63
|
-
var contentRef = React.useRef();
|
56
|
+
var bodyRef = React.useRef(null);
|
57
|
+
var contentRef = React.useRef(null);
|
64
58
|
var contentId = uuidv4["default"]();
|
65
59
|
var renderPortalUse = usePortalTarget.usePortalTarget(portalTargetIn);
|
66
|
-
var handleResize = function handleResize() {
|
67
|
-
setHasScrollingContent(
|
68
|
-
// if our scroll height exceeds the client height enable scrolling
|
69
|
-
bodyRef.current.clientHeight < (hasScrollingContent ?
|
70
|
-
// Carbon modal adds 32px bottom margin when scrolling content is enabled
|
71
|
-
bodyRef.current.scrollHeight - 32 : bodyRef.current.scrollHeight));
|
72
|
-
};
|
73
60
|
|
74
61
|
// We can't add a ref directly to the ModalBody, so track it in a ref
|
75
62
|
// as the parent of the current bodyRef element
|
76
63
|
React.useEffect(function () {
|
77
|
-
|
64
|
+
var _contentRef$current;
|
65
|
+
bodyRef.current = (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.parentElement;
|
78
66
|
}, [bodyRef]);
|
79
|
-
|
80
|
-
// Detect resize of the ModalBody to recalculate whether scrolling is enabled
|
81
|
-
useResizeObserver.useResizeObserver(bodyRef, handleResize);
|
82
67
|
return renderPortalUse( /*#__PURE__*/React__default["default"].createElement(react.ComposedModal, _rollupPluginBabelHelpers["extends"]({}, rest, {
|
83
68
|
className: cx__default["default"](blockClass,
|
84
69
|
// Apply the block class to the main HTML element
|
@@ -98,10 +83,7 @@ exports.AboutModal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
98
83
|
label: title,
|
99
84
|
labelClassName: "".concat(blockClass, "__title")
|
100
85
|
}), /*#__PURE__*/React__default["default"].createElement(react.ModalBody, {
|
101
|
-
"
|
102
|
-
"aria-labelledby": hasScrollingContent ? contentId : null,
|
103
|
-
className: "".concat(blockClass, "__body"),
|
104
|
-
hasScrollingContent: hasScrollingContent
|
86
|
+
className: "".concat(blockClass, "__body")
|
105
87
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
106
88
|
className: "".concat(blockClass, "__body-content"),
|
107
89
|
ref: contentRef,
|
@@ -301,29 +301,121 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
|
|
301
301
|
updateActiveCellCoordinates({
|
302
302
|
coords: coordinatesClone,
|
303
303
|
updatedValue: {
|
304
|
-
column: type === '
|
304
|
+
column: type === 'Home' ? 0 : columns.length - 1
|
305
305
|
}
|
306
306
|
});
|
307
307
|
removeCellSelections.removeCellSelections({
|
308
308
|
spreadsheetRef: spreadsheetRef
|
309
309
|
});
|
310
310
|
}, [activeCellCoordinates, updateActiveCellCoordinates, spreadsheetRef, columns.length]);
|
311
|
+
var checkforReturnConditon = React.useCallback(function (key) {
|
312
|
+
return isEditing || key === 'Meta' || key === 'Control';
|
313
|
+
}, [isEditing]);
|
314
|
+
var handleArrowkeyPress = React.useCallback(function (arrowKey) {
|
315
|
+
event.preventDefault();
|
316
|
+
handleInitialArrowPress();
|
317
|
+
var coordinatesClone = _rollupPluginBabelHelpers.objectSpread2({}, activeCellCoordinates);
|
318
|
+
var updatedValue;
|
319
|
+
switch (arrowKey) {
|
320
|
+
// Left
|
321
|
+
case 'ArrowLeft':
|
322
|
+
{
|
323
|
+
if (coordinatesClone.column === 'header') {
|
324
|
+
return;
|
325
|
+
}
|
326
|
+
if (typeof coordinatesClone.column === 'number') {
|
327
|
+
if (coordinatesClone.column === 0) {
|
328
|
+
updatedValue = {
|
329
|
+
column: 'header'
|
330
|
+
};
|
331
|
+
} else {
|
332
|
+
updatedValue = {
|
333
|
+
column: coordinatesClone.column - 1
|
334
|
+
};
|
335
|
+
}
|
336
|
+
}
|
337
|
+
break;
|
338
|
+
}
|
339
|
+
// Up
|
340
|
+
case 'ArrowUp':
|
341
|
+
{
|
342
|
+
if (coordinatesClone.row === 'header') {
|
343
|
+
return;
|
344
|
+
}
|
345
|
+
if (typeof coordinatesClone.row === 'number') {
|
346
|
+
// set row back to header if we are at index 0
|
347
|
+
if (coordinatesClone.row === 0) {
|
348
|
+
updatedValue = {
|
349
|
+
row: 'header'
|
350
|
+
};
|
351
|
+
} else {
|
352
|
+
// if we are at any other index than 0, subtract 1 from current row index
|
353
|
+
updatedValue = {
|
354
|
+
row: coordinatesClone.row - 1
|
355
|
+
};
|
356
|
+
}
|
357
|
+
}
|
358
|
+
break;
|
359
|
+
}
|
360
|
+
// Right
|
361
|
+
case 'ArrowRight':
|
362
|
+
{
|
363
|
+
if (coordinatesClone.column === 'header') {
|
364
|
+
updatedValue = {
|
365
|
+
column: 0
|
366
|
+
};
|
367
|
+
}
|
368
|
+
if (typeof coordinatesClone.column === 'number') {
|
369
|
+
// Prevent active cell coordinates from updating if the active
|
370
|
+
// cell is in the last column, ie we can't go any further to the right
|
371
|
+
if (columns.length - 1 === coordinatesClone.column) {
|
372
|
+
return;
|
373
|
+
} else {
|
374
|
+
updatedValue = {
|
375
|
+
column: coordinatesClone.column + 1
|
376
|
+
};
|
377
|
+
}
|
378
|
+
}
|
379
|
+
break;
|
380
|
+
}
|
381
|
+
// Down
|
382
|
+
case 'ArrowDown':
|
383
|
+
{
|
384
|
+
if (coordinatesClone.row === 'header') {
|
385
|
+
updatedValue = {
|
386
|
+
row: 0
|
387
|
+
};
|
388
|
+
}
|
389
|
+
if (typeof coordinatesClone.row === 'number') {
|
390
|
+
// Prevent active cell coordinates from updating if the active
|
391
|
+
// cell is in the last row, ie we can't go any further down since
|
392
|
+
// we are in the last row
|
393
|
+
if (rows.length - 1 === coordinatesClone.row) {
|
394
|
+
return;
|
395
|
+
} else {
|
396
|
+
updatedValue = {
|
397
|
+
row: coordinatesClone.row + 1
|
398
|
+
};
|
399
|
+
}
|
400
|
+
}
|
401
|
+
break;
|
402
|
+
}
|
403
|
+
}
|
404
|
+
if (updatedValue) {
|
405
|
+
updateActiveCellCoordinates({
|
406
|
+
coords: coordinatesClone,
|
407
|
+
updatedValue: updatedValue
|
408
|
+
});
|
409
|
+
}
|
410
|
+
}, [handleInitialArrowPress, updateActiveCellCoordinates, activeCellCoordinates, columns, rows]);
|
311
411
|
var handleKeyPress = React.useCallback(function (event) {
|
312
412
|
var key = event.key;
|
313
|
-
if (isEditing) {
|
314
|
-
return;
|
315
|
-
}
|
316
413
|
// Command keys need to be returned as there is default browser behavior with these keys
|
317
|
-
|
318
|
-
|
319
|
-
}
|
320
|
-
// Prevent arrow keys, home key, and end key from scrolling the page when the data spreadsheet container has focus
|
321
|
-
if (['End', 'Home', 'ArrowLeft', 'ArrowUp', 'ArrowRight', 'ArrowDown'].indexOf(key) > -1 && !isEditing) {
|
322
|
-
event.preventDefault();
|
323
|
-
}
|
324
|
-
if (['Tab'].indexOf(key) > -1 && isEditing) {
|
414
|
+
// Needs to be returned in editing mode
|
415
|
+
if (checkforReturnConditon(key)) {
|
325
416
|
return;
|
326
417
|
}
|
418
|
+
|
327
419
|
// Clear out all cell selection areas if user uses any arrow key, except if the shift key is being held
|
328
420
|
if (['ArrowLeft', 'ArrowUp', 'ArrowRight', 'ArrowDown'].indexOf(key) > -1) {
|
329
421
|
if (selectionAreas !== null && selectionAreas !== void 0 && selectionAreas.length && keysPressedList.length < 2 && !handleMultipleKeys.includesShift(keysPressedList)) {
|
@@ -334,7 +426,7 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
|
|
334
426
|
});
|
335
427
|
}
|
336
428
|
}
|
337
|
-
if (
|
429
|
+
if ((keysPressedList === null || keysPressedList === void 0 ? void 0 : keysPressedList.length) > 1) {
|
338
430
|
handleMultipleKeys.handleMultipleKeys({
|
339
431
|
activeCellCoordinates: activeCellCoordinates,
|
340
432
|
event: event,
|
@@ -352,27 +444,24 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
|
|
352
444
|
usingMac: usingMac
|
353
445
|
});
|
354
446
|
}
|
355
|
-
|
356
|
-
selectionAreas: selectionAreas,
|
357
|
-
currentMatcher: currentMatcher,
|
358
|
-
rows: rows,
|
359
|
-
setActiveCellContent: setActiveCellContent,
|
360
|
-
updateData: updateData,
|
361
|
-
activeCellCoordinates: activeCellCoordinates
|
362
|
-
};
|
447
|
+
|
363
448
|
// Allow arrow key navigation if there are less than two activeKeys OR
|
364
449
|
// if one of the activeCellCoordinates is in a header position
|
450
|
+
// Prevent arrow keys, home key, and end key from scrolling the page when the data spreadsheet container has focus
|
451
|
+
|
365
452
|
if (keysPressedList.length < 2 && !handleMultipleKeys.includesShift(keysPressedList) || activeCellCoordinates.row === 'header' || activeCellCoordinates.column === 'header') {
|
366
453
|
switch (key) {
|
367
|
-
// Backspace
|
368
454
|
case 'Backspace':
|
369
|
-
{
|
370
|
-
handleCellDeletion.handleCellDeletion(deleteParams);
|
371
|
-
break;
|
372
|
-
}
|
373
|
-
// Delete
|
374
455
|
case 'Delete':
|
375
456
|
{
|
457
|
+
var deleteParams = {
|
458
|
+
selectionAreas: selectionAreas,
|
459
|
+
currentMatcher: currentMatcher,
|
460
|
+
rows: rows,
|
461
|
+
setActiveCellContent: setActiveCellContent,
|
462
|
+
updateData: updateData,
|
463
|
+
activeCellCoordinates: activeCellCoordinates
|
464
|
+
};
|
376
465
|
handleCellDeletion.handleCellDeletion(deleteParams);
|
377
466
|
break;
|
378
467
|
}
|
@@ -390,22 +479,14 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
|
|
390
479
|
}
|
391
480
|
// HOME
|
392
481
|
case 'Home':
|
393
|
-
{
|
394
|
-
if (handleMultipleKeys.includesResourceKey(keysPressedList, usingMac)) {
|
395
|
-
return;
|
396
|
-
}
|
397
|
-
handleHomeEndKey({
|
398
|
-
type: 'home'
|
399
|
-
});
|
400
|
-
break;
|
401
|
-
}
|
402
482
|
case 'End':
|
403
483
|
{
|
484
|
+
event.preventDefault();
|
404
485
|
if (handleMultipleKeys.includesResourceKey(keysPressedList, usingMac)) {
|
405
486
|
return;
|
406
487
|
}
|
407
488
|
handleHomeEndKey({
|
408
|
-
type:
|
489
|
+
type: key
|
409
490
|
});
|
410
491
|
break;
|
411
492
|
}
|
@@ -429,122 +510,16 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
|
|
429
510
|
setActiveCellCoordinates(null);
|
430
511
|
break;
|
431
512
|
}
|
432
|
-
// Left
|
433
513
|
case 'ArrowLeft':
|
434
|
-
{
|
435
|
-
handleInitialArrowPress();
|
436
|
-
var coordinatesClone = _rollupPluginBabelHelpers.objectSpread2({}, activeCellCoordinates);
|
437
|
-
if (coordinatesClone.column === 'header') {
|
438
|
-
return;
|
439
|
-
}
|
440
|
-
if (typeof coordinatesClone.column === 'number') {
|
441
|
-
if (coordinatesClone.column === 0) {
|
442
|
-
updateActiveCellCoordinates({
|
443
|
-
coords: coordinatesClone,
|
444
|
-
updatedValue: {
|
445
|
-
column: 'header'
|
446
|
-
}
|
447
|
-
});
|
448
|
-
return;
|
449
|
-
}
|
450
|
-
updateActiveCellCoordinates({
|
451
|
-
coords: coordinatesClone,
|
452
|
-
updatedValue: {
|
453
|
-
column: coordinatesClone.column - 1
|
454
|
-
}
|
455
|
-
});
|
456
|
-
}
|
457
|
-
break;
|
458
|
-
}
|
459
|
-
// Up
|
460
514
|
case 'ArrowUp':
|
461
|
-
{
|
462
|
-
handleInitialArrowPress();
|
463
|
-
var _coordinatesClone = _rollupPluginBabelHelpers.objectSpread2({}, activeCellCoordinates);
|
464
|
-
if (_coordinatesClone.row === 'header') {
|
465
|
-
return;
|
466
|
-
}
|
467
|
-
if (typeof _coordinatesClone.row === 'number') {
|
468
|
-
// set row back to header if we are at index 0
|
469
|
-
if (_coordinatesClone.row === 0) {
|
470
|
-
updateActiveCellCoordinates({
|
471
|
-
coords: _coordinatesClone,
|
472
|
-
updatedValue: {
|
473
|
-
row: 'header'
|
474
|
-
}
|
475
|
-
});
|
476
|
-
return;
|
477
|
-
}
|
478
|
-
// if we are at any other index than 0, subtract 1 from current row index
|
479
|
-
updateActiveCellCoordinates({
|
480
|
-
coords: _coordinatesClone,
|
481
|
-
updatedValue: {
|
482
|
-
row: _coordinatesClone.row - 1
|
483
|
-
}
|
484
|
-
});
|
485
|
-
}
|
486
|
-
break;
|
487
|
-
}
|
488
|
-
// Right
|
489
515
|
case 'ArrowRight':
|
490
|
-
{
|
491
|
-
handleInitialArrowPress();
|
492
|
-
var _coordinatesClone2 = _rollupPluginBabelHelpers.objectSpread2({}, activeCellCoordinates);
|
493
|
-
if (_coordinatesClone2.column === 'header') {
|
494
|
-
updateActiveCellCoordinates({
|
495
|
-
coords: _coordinatesClone2,
|
496
|
-
updatedValue: {
|
497
|
-
column: 0
|
498
|
-
}
|
499
|
-
});
|
500
|
-
}
|
501
|
-
if (typeof _coordinatesClone2.column === 'number') {
|
502
|
-
// Prevent active cell coordinates from updating if the active
|
503
|
-
// cell is in the last column, ie we can't go any further to the right
|
504
|
-
if (columns.length - 1 === _coordinatesClone2.column) {
|
505
|
-
return;
|
506
|
-
}
|
507
|
-
updateActiveCellCoordinates({
|
508
|
-
coords: _coordinatesClone2,
|
509
|
-
updatedValue: {
|
510
|
-
column: _coordinatesClone2.column + 1
|
511
|
-
}
|
512
|
-
});
|
513
|
-
}
|
514
|
-
break;
|
515
|
-
}
|
516
|
-
// Down
|
517
516
|
case 'ArrowDown':
|
518
517
|
{
|
519
|
-
|
520
|
-
var _coordinatesClone3 = _rollupPluginBabelHelpers.objectSpread2({}, activeCellCoordinates);
|
521
|
-
if (_coordinatesClone3.row === 'header') {
|
522
|
-
updateActiveCellCoordinates({
|
523
|
-
coords: _coordinatesClone3,
|
524
|
-
updatedValue: {
|
525
|
-
row: 0
|
526
|
-
}
|
527
|
-
});
|
528
|
-
}
|
529
|
-
if (typeof _coordinatesClone3.row === 'number') {
|
530
|
-
// Prevent active cell coordinates from updating if the active
|
531
|
-
// cell is in the last row, ie we can't go any further down since
|
532
|
-
// we are in the last row
|
533
|
-
if (rows.length - 1 === _coordinatesClone3.row) {
|
534
|
-
return;
|
535
|
-
}
|
536
|
-
updateActiveCellCoordinates({
|
537
|
-
coords: _coordinatesClone3,
|
538
|
-
updatedValue: {
|
539
|
-
row: _coordinatesClone3.row + 1
|
540
|
-
}
|
541
|
-
});
|
542
|
-
}
|
543
|
-
break;
|
518
|
+
handleArrowkeyPress(key);
|
544
519
|
}
|
545
520
|
}
|
546
521
|
}
|
547
|
-
}, [activeCellInsideSelectionArea, updateActiveCellCoordinates,
|
522
|
+
}, [activeCellInsideSelectionArea, updateActiveCellCoordinates, activeCellCoordinates, removeActiveCell, columns, rows, spreadsheetRef, currentMatcher, removeCellEditor, selectionAreas, handleHomeEndKey, keysPressedList, usingMac, updateData, checkforReturnConditon, handleArrowkeyPress]);
|
548
523
|
var startEditMode = function startEditMode() {
|
549
524
|
setIsEditing(true);
|
550
525
|
setClickAndHoldActive(false);
|
@@ -162,7 +162,7 @@ var DatagridRow = function DatagridRow(datagridState) {
|
|
162
162
|
return h.id === cell.column.id;
|
163
163
|
});
|
164
164
|
return /*#__PURE__*/React__default["default"].createElement(react.TableCell, _rollupPluginBabelHelpers["extends"]({
|
165
|
-
className: cx__default["default"]("".concat(blockClass, "__cell"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__expandable-row-cell"), row.canExpand && index === 0), "".concat(blockClass, "__slug--cell"), associatedHeader && associatedHeader.length && /*#__PURE__*/React.isValidElement((_associatedHeader$ = associatedHeader[0]) === null || _associatedHeader$ === void 0 ? void 0 : _associatedHeader$.slug)))
|
165
|
+
className: cx__default["default"]("".concat(blockClass, "__cell"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__expandable-row-cell"), row.canExpand && index === 0), "".concat(blockClass, "__expandable-row-cell--is-expanded"), row.isExpanded && index === 0), "".concat(blockClass, "__slug--cell"), associatedHeader && associatedHeader.length && /*#__PURE__*/React.isValidElement((_associatedHeader$ = associatedHeader[0]) === null || _associatedHeader$ === void 0 ? void 0 : _associatedHeader$.slug)))
|
166
166
|
}, restProps, {
|
167
167
|
key: cell.column.id,
|
168
168
|
title: title
|
@@ -16,9 +16,10 @@ var react = require('@carbon/react');
|
|
16
16
|
var common = require('./common.js');
|
17
17
|
var DraggableElement = require('../../DraggableElement.js');
|
18
18
|
var settings = require('../../../../../settings.js');
|
19
|
+
var getNodeTextContent = require('../../../../../global/js/utils/getNodeTextContent.js');
|
19
20
|
var core = require('@dnd-kit/core');
|
20
21
|
var sortable = require('@dnd-kit/sortable');
|
21
|
-
var
|
22
|
+
var modifiers = require('@dnd-kit/modifiers');
|
22
23
|
|
23
24
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
24
25
|
|
@@ -152,7 +153,8 @@ var DraggableItemsList = function DraggableItemsList(_ref) {
|
|
152
153
|
onDragEnd: handleDragEnd,
|
153
154
|
onDragStart: handleDragStart,
|
154
155
|
onDragMove: handleDragUpdate,
|
155
|
-
sensors: sensors
|
156
|
+
sensors: sensors,
|
157
|
+
modifiers: [modifiers.restrictToParentElement, modifiers.restrictToVerticalAxis]
|
156
158
|
}, /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
157
159
|
className: "".concat(blockClass, "__draggable-underlay"),
|
158
160
|
"aria-hidden": "true",
|
@@ -411,9 +411,12 @@ var useFilters = function useFilters(_ref) {
|
|
411
411
|
});
|
412
412
|
return updatedFilters[0];
|
413
413
|
};
|
414
|
-
|
415
|
-
|
416
|
-
|
414
|
+
if (savedFilters && savedFilters.length) {
|
415
|
+
var _cleanFilters;
|
416
|
+
setFiltersObjectArray(savedFilters);
|
417
|
+
var filterStateCopy = (_cleanFilters = cleanFilters(filtersState)) !== null && _cleanFilters !== void 0 ? _cleanFilters : [];
|
418
|
+
setFiltersState(filterStateCopy);
|
419
|
+
}
|
417
420
|
}
|
418
421
|
if (!isFetching) {
|
419
422
|
setFetchingReset(false);
|
@@ -21,7 +21,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
21
21
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
22
22
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
23
23
|
|
24
|
-
var _excluded = ["align", "id", "itemText", "onClick", "icon", "shouldHideMenuItem"],
|
24
|
+
var _excluded = ["align", "id", "itemText", "onClick", "icon", "shouldHideMenuItem", "shouldDisableMenuItem", "disabled"],
|
25
25
|
_excluded2 = ["id", "onClick", "shouldHideMenuItem", "shouldDisableMenuItem", "disabled"];
|
26
26
|
var blockClass = "".concat(settings.pkg.prefix, "--datagrid");
|
27
27
|
var useActionsColumn = function useActionsColumn(hooks) {
|
@@ -63,8 +63,11 @@ var useActionsColumn = function useActionsColumn(hooks) {
|
|
63
63
|
_onClick = preparedActionProps.onClick,
|
64
64
|
icon = preparedActionProps.icon,
|
65
65
|
shouldHideMenuItem = preparedActionProps.shouldHideMenuItem,
|
66
|
+
shouldDisableMenuItem = preparedActionProps.shouldDisableMenuItem,
|
67
|
+
disabled = preparedActionProps.disabled,
|
66
68
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(preparedActionProps, _excluded);
|
67
69
|
var hidden = typeof shouldHideMenuItem === 'function' && shouldHideMenuItem(row);
|
70
|
+
var isDisabledByRow = typeof shouldDisableMenuItem === 'function' ? shouldDisableMenuItem(row) : disabled;
|
68
71
|
if (hidden) {
|
69
72
|
return null;
|
70
73
|
}
|
@@ -86,7 +89,8 @@ var useActionsColumn = function useActionsColumn(hooks) {
|
|
86
89
|
}
|
87
90
|
e.stopPropagation();
|
88
91
|
_onClick(id, row, e);
|
89
|
-
}
|
92
|
+
},
|
93
|
+
disabled: isDisabledByRow
|
90
94
|
}), /*#__PURE__*/React__default["default"].createElement(Icon, null)));
|
91
95
|
})), !isFetching && (rowActions.length > 2 || isColumnSticky) && /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(react.OverflowMenu, {
|
92
96
|
align: "left",
|