@carbon/ibm-products 2.42.1-canary.18 → 2.42.1-canary.2
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +9 -302
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon.css +9 -302
- 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 +9 -302
- 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/Carousel/Carousel.d.ts +1 -1
- package/es/components/Carousel/Carousel.js +1 -1
- package/es/components/Coachmark/CoachmarkDragbar.d.ts +1 -1
- package/es/components/Coachmark/CoachmarkDragbar.js +1 -1
- package/es/components/Coachmark/CoachmarkHeader.d.ts +1 -1
- package/es/components/Coachmark/CoachmarkHeader.js +1 -1
- package/es/components/Coachmark/CoachmarkOverlay.d.ts +1 -1
- package/es/components/Coachmark/CoachmarkOverlay.js +1 -1
- package/es/components/Coachmark/CoachmarkTagline.d.ts +1 -1
- package/es/components/Coachmark/CoachmarkTagline.js +1 -1
- package/es/components/CoachmarkStack/CoachmarkStackHome.d.ts +1 -1
- package/es/components/CoachmarkStack/CoachmarkStackHome.js +2 -2
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +0 -6
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +33 -74
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +1 -15
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +12 -95
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +2 -11
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +9 -27
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +0 -5
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +14 -95
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +0 -1
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +0 -1
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +0 -7
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +1 -8
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
- package/es/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.js +33 -38
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +67 -197
- package/es/components/ConditionBuilder/utils/util.d.ts +0 -1
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +4 -7
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -7
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts +0 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +3 -13
- package/es/components/Datagrid/types/index.d.ts +0 -2
- package/es/components/Datagrid/useColumnOrder.d.ts +1 -7
- package/es/components/Datagrid/useNestedRows.js +0 -17
- package/es/components/Datagrid/useOnRowClick.d.ts +1 -8
- package/es/components/Datagrid/useOnRowClick.js +1 -2
- package/es/components/Datagrid/useRowIsMouseOver.d.ts +1 -2
- package/es/components/Datagrid/useRowIsMouseOver.js +1 -1
- package/es/components/Datagrid/useSortableColumns.d.ts +3 -10
- package/es/components/Datagrid/useSortableColumns.js +2 -3
- package/es/components/InterstitialScreenView/InterstitialScreenView.d.ts +1 -1
- package/es/components/InterstitialScreenView/InterstitialScreenView.js +1 -1
- package/es/components/SidePanel/SidePanel.d.ts +2 -2
- package/es/components/SidePanel/SidePanel.js +3 -5
- package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +1 -1
- package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +1 -1
- package/es/global/js/package-settings.js +2 -2
- package/es/index.d.ts +0 -1
- package/es/index.js +0 -1
- package/lib/components/Carousel/Carousel.d.ts +1 -1
- package/lib/components/Carousel/Carousel.js +1 -1
- package/lib/components/Coachmark/CoachmarkDragbar.d.ts +1 -1
- package/lib/components/Coachmark/CoachmarkDragbar.js +1 -1
- package/lib/components/Coachmark/CoachmarkHeader.d.ts +1 -1
- package/lib/components/Coachmark/CoachmarkHeader.js +1 -1
- package/lib/components/Coachmark/CoachmarkOverlay.d.ts +1 -1
- package/lib/components/Coachmark/CoachmarkOverlay.js +1 -1
- package/lib/components/Coachmark/CoachmarkTagline.d.ts +1 -1
- package/lib/components/Coachmark/CoachmarkTagline.js +1 -1
- package/lib/components/CoachmarkStack/CoachmarkStackHome.d.ts +1 -1
- package/lib/components/CoachmarkStack/CoachmarkStackHome.js +2 -2
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +0 -6
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +32 -73
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +1 -15
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +9 -92
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +2 -11
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +8 -26
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +0 -5
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +11 -92
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +0 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +0 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +0 -7
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +1 -8
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
- package/lib/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.js +31 -36
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +64 -195
- package/lib/components/ConditionBuilder/utils/util.d.ts +0 -1
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +4 -7
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -7
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts +0 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +3 -13
- package/lib/components/Datagrid/types/index.d.ts +0 -2
- package/lib/components/Datagrid/useColumnOrder.d.ts +1 -7
- package/lib/components/Datagrid/useNestedRows.js +0 -17
- package/lib/components/Datagrid/useOnRowClick.d.ts +1 -8
- package/lib/components/Datagrid/useOnRowClick.js +1 -2
- package/lib/components/Datagrid/useRowIsMouseOver.d.ts +1 -2
- package/lib/components/Datagrid/useRowIsMouseOver.js +1 -1
- package/lib/components/Datagrid/useSortableColumns.d.ts +3 -10
- package/lib/components/Datagrid/useSortableColumns.js +2 -3
- package/lib/components/InterstitialScreenView/InterstitialScreenView.d.ts +1 -1
- package/lib/components/InterstitialScreenView/InterstitialScreenView.js +1 -1
- package/lib/components/SidePanel/SidePanel.d.ts +2 -2
- package/lib/components/SidePanel/SidePanel.js +3 -5
- package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +1 -1
- package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +1 -1
- package/lib/global/js/package-settings.js +2 -2
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/package.json +3 -3
- package/scss/components/ConditionBuilder/_condition-builder.scss +1 -21
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +3 -22
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +21 -58
- package/scss/components/NonLinearReading/_non-linear-reading.scss +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.d.ts +0 -2
- package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +0 -44
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +0 -10
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +0 -69
- package/es/feature-flags.js +0 -18
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.d.ts +0 -2
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +0 -52
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +0 -10
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +0 -77
- package/lib/feature-flags.js +0 -40
- /package/es/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.d.ts +0 -0
- /package/lib/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.d.ts +0 -0
@@ -17,12 +17,9 @@ export namespace translationsObject {
|
|
17
17
|
after: string;
|
18
18
|
between: string;
|
19
19
|
'add-condition': string;
|
20
|
-
'add-condition-group': string;
|
21
|
-
'add-condition-sub-group': string;
|
22
20
|
condition: string;
|
23
21
|
property: string;
|
24
22
|
operator: string;
|
25
|
-
value: string;
|
26
23
|
connector: string;
|
27
24
|
condition_row: string;
|
28
25
|
remove_condition: string;
|
@@ -30,9 +27,5 @@ export namespace translationsObject {
|
|
30
27
|
start: string;
|
31
28
|
end: string;
|
32
29
|
clear_search: string;
|
33
|
-
actions: string;
|
34
|
-
then: string;
|
35
|
-
remove_action: string;
|
36
|
-
add_action: string;
|
37
30
|
};
|
38
31
|
}
|
@@ -28,23 +28,16 @@ var translationsObject = {
|
|
28
28
|
after: 'is after',
|
29
29
|
between: 'is between',
|
30
30
|
'add-condition': 'Add Condition',
|
31
|
-
'add-condition-group': 'Add Condition Group',
|
32
|
-
'add-condition-sub-group': 'Add Condition sub group',
|
33
31
|
condition: 'Condition',
|
34
32
|
property: 'Property',
|
35
33
|
operator: 'Operator',
|
36
|
-
value: 'Value',
|
37
34
|
connector: 'Connector',
|
38
35
|
condition_row: 'Condition row',
|
39
36
|
remove_condition: 'Remove condition',
|
40
37
|
add_condition_row: 'Add condition row',
|
41
38
|
start: 'Start',
|
42
39
|
end: 'End',
|
43
|
-
clear_search: 'Clear search input'
|
44
|
-
actions: 'Actions',
|
45
|
-
then: 'then',
|
46
|
-
remove_action: 'Remove Action',
|
47
|
-
add_action: 'Add action'
|
40
|
+
clear_search: 'Clear search input'
|
48
41
|
}
|
49
42
|
};
|
50
43
|
|
@@ -95,7 +95,7 @@ var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
|
95
95
|
label: propertyLabel !== null && propertyLabel !== void 0 ? propertyLabel : DataConfigs.translateWithId('add-condition'),
|
96
96
|
hideLabel: !label ? true : false,
|
97
97
|
onClick: function onClick() {
|
98
|
-
|
98
|
+
setOpen(!open);
|
99
99
|
},
|
100
100
|
className: className,
|
101
101
|
"aria-haspopup": true,
|
@@ -14,22 +14,21 @@ var React = require('react');
|
|
14
14
|
var ConditionBuilderItem = require('../ConditionBuilderItem/ConditionBuilderItem.js');
|
15
15
|
var ConditionBuilderItemOption = require('../ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js');
|
16
16
|
var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
|
17
|
+
var settings = require('../../../settings.js');
|
17
18
|
var index = require('../../../node_modules/prop-types/index.js');
|
18
19
|
var util = require('../utils/util.js');
|
19
|
-
var ConditionBuilderProvider = require('../ConditionBuilderContext/ConditionBuilderProvider.js');
|
20
20
|
|
21
21
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
22
22
|
|
23
23
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
24
24
|
|
25
25
|
var _excluded = ["operator", "className", "onChange"];
|
26
|
-
var
|
26
|
+
var blockClass = "".concat(settings.pkg.prefix, "--condition-builder");
|
27
|
+
function ConditionConnector(_ref) {
|
27
28
|
var operator = _ref.operator,
|
28
29
|
className = _ref.className,
|
29
30
|
onChange = _ref.onChange,
|
30
31
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
31
|
-
var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
|
32
|
-
variant = _useContext.variant;
|
33
32
|
var handleConnectorHover = React.useCallback(function (parentGroup, isHover) {
|
34
33
|
if (isHover) {
|
35
34
|
parentGroup.classList.add('hoveredConnector');
|
@@ -49,37 +48,33 @@ var ConditionConnector = function ConditionConnector(_ref) {
|
|
49
48
|
onChange(op);
|
50
49
|
util.focusThisField(evt);
|
51
50
|
};
|
52
|
-
return
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
}
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
// </div>
|
80
|
-
;
|
81
|
-
};
|
82
|
-
var ConditionConnector$1 = ConditionConnector;
|
51
|
+
return (
|
52
|
+
/*#__PURE__*/
|
53
|
+
// <div className={className} {...rest}>
|
54
|
+
React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, _rollupPluginBabelHelpers["extends"]({
|
55
|
+
label: operator,
|
56
|
+
title: DataConfigs.translateWithId('connector'),
|
57
|
+
"data-name": "connectorField",
|
58
|
+
onMouseEnter: activeConnectorHandler,
|
59
|
+
onMouseLeave: inActiveConnectorHandler,
|
60
|
+
onFocus: activeConnectorHandler,
|
61
|
+
onBlur: inActiveConnectorHandler
|
62
|
+
}, rest, {
|
63
|
+
popOverClassName: className,
|
64
|
+
className: "".concat(blockClass, "__connector-button ")
|
65
|
+
}), /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItemOption.ConditionBuilderItemOption, {
|
66
|
+
config: {
|
67
|
+
options: DataConfigs.connectorConfig
|
68
|
+
},
|
69
|
+
conditionState: {
|
70
|
+
value: operator,
|
71
|
+
label: DataConfigs.translateWithId('connector')
|
72
|
+
},
|
73
|
+
onChange: onChangeHandler
|
74
|
+
}))
|
75
|
+
// </div>
|
76
|
+
);
|
77
|
+
}
|
83
78
|
ConditionConnector.propTypes = {
|
84
79
|
/**
|
85
80
|
* Provide an optional class to be applied to the containing node.
|
@@ -95,4 +90,4 @@ ConditionConnector.propTypes = {
|
|
95
90
|
operator: index["default"].string
|
96
91
|
};
|
97
92
|
|
98
|
-
exports["default"] = ConditionConnector
|
93
|
+
exports["default"] = ConditionConnector;
|
@@ -13,22 +13,12 @@ var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHel
|
|
13
13
|
var React = require('react');
|
14
14
|
var ConditionBlock = require('../ConditionBlock/ConditionBlock.js');
|
15
15
|
var index = require('../../../node_modules/prop-types/index.js');
|
16
|
-
var cx = require('classnames');
|
17
16
|
var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
|
18
|
-
var ConditionBuilderItem = require('../ConditionBuilderItem/ConditionBuilderItem.js');
|
19
|
-
var ConditionBuilderItemOption = require('../ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js');
|
20
|
-
var util = require('../utils/util.js');
|
21
|
-
var ConditionConnector = require('../ConditionBuilderConnector/ConditionConnector.js');
|
22
|
-
var ConditionBuilderProvider = require('../ConditionBuilderContext/ConditionBuilderProvider.js');
|
23
17
|
var uuidv4 = require('../../../global/js/utils/uuidv4.js');
|
24
|
-
var ConditionPreview = require('../ConditionPreview/ConditionPreview.js');
|
25
18
|
|
26
19
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
27
20
|
|
28
21
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
29
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
30
|
-
|
31
|
-
var _ConditionPreview, _ConditionPreview2;
|
32
22
|
|
33
23
|
/**
|
34
24
|
*
|
@@ -36,24 +26,14 @@ var _ConditionPreview, _ConditionPreview2;
|
|
36
26
|
* All the inner components of group are called from here.
|
37
27
|
* @returns
|
38
28
|
*/
|
39
|
-
|
40
29
|
var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
30
|
+
var _group$conditions;
|
41
31
|
var group = _ref.group,
|
42
32
|
aria = _ref.aria,
|
43
33
|
onRemove = _ref.onRemove,
|
44
34
|
onChange = _ref.onChange,
|
45
35
|
conditionBuilderRef = _ref.conditionBuilderRef,
|
46
36
|
className = _ref.className;
|
47
|
-
var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
|
48
|
-
variant = _useContext.variant;
|
49
|
-
var _useState = React.useState(-1),
|
50
|
-
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
51
|
-
showConditionPreview = _useState2[0],
|
52
|
-
setShowConditionPreview = _useState2[1];
|
53
|
-
var _useState3 = React.useState(-1),
|
54
|
-
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
55
|
-
showConditionSubGroupPreview = _useState4[0],
|
56
|
-
setShowConditionSubGroupPreview = _useState4[1];
|
57
37
|
var onRemoveHandler = function onRemoveHandler(conditionId, evt) {
|
58
38
|
if (group.conditions.length > 1) {
|
59
39
|
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
|
@@ -84,183 +64,72 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
84
64
|
conditions: [].concat(_rollupPluginBabelHelpers.toConsumableArray(group.conditions.slice(0, conditionIndex + 1)), [newCondition], _rollupPluginBabelHelpers.toConsumableArray(group.conditions.slice(conditionIndex + 1)))
|
85
65
|
}));
|
86
66
|
};
|
87
|
-
var handleFocusOnClose = function handleFocusOnClose(e) {
|
88
|
-
var _e$currentTarget;
|
89
|
-
var previousClose = (_e$currentTarget = e.currentTarget) === null || _e$currentTarget === void 0 || (_e$currentTarget = _e$currentTarget.closest('[role="row"]')) === null || _e$currentTarget === void 0 || (_e$currentTarget = _e$currentTarget.previousSibling) === null || _e$currentTarget === void 0 ? void 0 : _e$currentTarget.querySelector('[data-name="closeCondition"]');
|
90
|
-
if (previousClose) {
|
91
|
-
previousClose.focus();
|
92
|
-
}
|
93
|
-
};
|
94
|
-
var addConditionSubGroupHandler = function addConditionSubGroupHandler(conditionIndex) {
|
95
|
-
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
|
96
|
-
conditions: [].concat(_rollupPluginBabelHelpers.toConsumableArray(group.conditions.slice(0, conditionIndex + 1)), [{
|
97
|
-
groupSeparateOperator: null,
|
98
|
-
groupOperator: 'and',
|
99
|
-
statement: 'if',
|
100
|
-
conditions: [{
|
101
|
-
property: undefined,
|
102
|
-
operator: '',
|
103
|
-
value: '',
|
104
|
-
popoverToOpen: 'propertyField',
|
105
|
-
id: uuidv4["default"]()
|
106
|
-
}],
|
107
|
-
id: uuidv4["default"]()
|
108
|
-
}], _rollupPluginBabelHelpers.toConsumableArray(group.conditions.slice(conditionIndex + 1)))
|
109
|
-
}));
|
110
|
-
};
|
111
67
|
var isLastCondition = function isLastCondition(conditionIndex, conditionArr) {
|
112
68
|
return conditionIndex + 1 >= conditionArr.length || conditionArr.length - 1 != conditionIndex && conditionArr[conditionIndex + 1].conditions;
|
113
69
|
};
|
114
|
-
var
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
var _showConditionPreviewHandler = function showConditionPreviewHandler(conditionIndex) {
|
121
|
-
setShowConditionPreview(conditionIndex);
|
122
|
-
};
|
123
|
-
var hideConditionPreviewHandler = function hideConditionPreviewHandler() {
|
124
|
-
setShowConditionPreview(-1);
|
125
|
-
};
|
126
|
-
var onStatementChangeHandler = function onStatementChangeHandler(updatedStatement) {
|
127
|
-
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
|
128
|
-
statement: updatedStatement
|
129
|
-
}));
|
130
|
-
};
|
131
|
-
var onConnectorOperatorChange = function onConnectorOperatorChange(op) {
|
132
|
-
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
|
133
|
-
groupOperator: op
|
134
|
-
}));
|
135
|
-
};
|
136
|
-
var getSentenceVariant = function getSentenceVariant() {
|
137
|
-
var _group$conditions;
|
138
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
139
|
-
className: "".concat(className, " eachGroup")
|
140
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
141
|
-
className: "".concat(DataConfigs.blockClass, "__condition-wrapper"),
|
142
|
-
role: "grid",
|
143
|
-
"aria-label": DataConfigs.translateWithId('condition_builder_group')
|
144
|
-
}, group === null || group === void 0 || (_group$conditions = group.conditions) === null || _group$conditions === void 0 ? void 0 : _group$conditions.map(function (eachCondition, conditionIndex) {
|
145
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
146
|
-
key: eachCondition.id,
|
147
|
-
className: "".concat(DataConfigs.blockClass, "__group-wrapper")
|
148
|
-
}, /*#__PURE__*/React__default["default"].createElement(ConditionBlock["default"], {
|
149
|
-
conjunction: conditionIndex > 0 ? group.groupOperator : undefined,
|
150
|
-
aria: {
|
151
|
-
level: aria.level + 1,
|
152
|
-
posinset: conditionIndex + 1,
|
153
|
-
setsize: group.conditions.length
|
154
|
-
},
|
155
|
-
isStatement: conditionIndex == 0,
|
156
|
-
condition: eachCondition,
|
157
|
-
group: group,
|
158
|
-
conditionIndex: conditionIndex,
|
159
|
-
onChange: function onChange(updatedConditions) {
|
160
|
-
onChangeHandler(updatedConditions, conditionIndex);
|
161
|
-
},
|
162
|
-
addConditionHandler: addConditionHandler,
|
163
|
-
onRemove: function onRemove(e) {
|
164
|
-
onRemoveHandler(eachCondition.id, e);
|
165
|
-
},
|
166
|
-
onConnectorOperatorChange: onConnectorOperatorChange,
|
167
|
-
onStatementChange: onStatementChangeHandler,
|
168
|
-
isLastCondition: isLastCondition
|
169
|
-
}));
|
170
|
-
})));
|
70
|
+
var handleFocusOnClose = function handleFocusOnClose(evt) {
|
71
|
+
var _evt$currentTarget;
|
72
|
+
var previousClose = (_evt$currentTarget = evt.currentTarget) === null || _evt$currentTarget === void 0 || (_evt$currentTarget = _evt$currentTarget.closest('[role="row"]')) === null || _evt$currentTarget === void 0 || (_evt$currentTarget = _evt$currentTarget.parentElement) === null || _evt$currentTarget === void 0 || (_evt$currentTarget = _evt$currentTarget.previousSibling) === null || _evt$currentTarget === void 0 ? void 0 : _evt$currentTarget.querySelector('[data-name="closeCondition"]');
|
73
|
+
if (previousClose) {
|
74
|
+
previousClose.focus();
|
75
|
+
}
|
171
76
|
};
|
172
|
-
|
173
|
-
|
77
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
78
|
+
className: "".concat(className, " eachGroup")
|
79
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
80
|
+
className: "".concat(DataConfigs.blockClass, "__condition-wrapper"),
|
81
|
+
role: "grid",
|
82
|
+
"aria-label": DataConfigs.translateWithId('condition_builder_group')
|
83
|
+
}, group === null || group === void 0 || (_group$conditions = group.conditions) === null || _group$conditions === void 0 ? void 0 : _group$conditions.map(function (eachCondition, conditionIndex) {
|
174
84
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
175
|
-
|
176
|
-
|
177
|
-
"
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
85
|
+
key: eachCondition.id
|
86
|
+
}, eachCondition.conditions && /*#__PURE__*/React__default["default"].createElement(ConditionGroupBuilder, {
|
87
|
+
className: "".concat(DataConfigs.blockClass, "__group"),
|
88
|
+
aria: {
|
89
|
+
level: aria.level + 1,
|
90
|
+
posinset: conditionIndex + 1,
|
91
|
+
setsize: group.conditions.length
|
92
|
+
},
|
93
|
+
group: eachCondition,
|
94
|
+
onChange: function onChange(updatedCondition) {
|
95
|
+
onChangeHandler(updatedCondition, conditionIndex);
|
96
|
+
},
|
97
|
+
onRemove: function onRemove(evt) {
|
98
|
+
onRemoveHandler(eachCondition.id, evt);
|
99
|
+
},
|
100
|
+
conditionBuilderRef: conditionBuilderRef
|
101
|
+
}), !eachCondition.conditions && /*#__PURE__*/React__default["default"].createElement(ConditionBlock["default"], {
|
102
|
+
conjunction: conditionIndex > 0 ? group.groupOperator : undefined,
|
103
|
+
aria: {
|
104
|
+
level: aria.level + 1,
|
105
|
+
posinset: conditionIndex + 1,
|
106
|
+
setsize: group.conditions.length
|
194
107
|
},
|
195
|
-
|
196
|
-
|
197
|
-
|
108
|
+
isStatement: conditionIndex == 0,
|
109
|
+
condition: eachCondition,
|
110
|
+
group: group,
|
111
|
+
conditionIndex: conditionIndex,
|
112
|
+
className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-bottom"),
|
113
|
+
onChange: function onChange(updatedConditions) {
|
114
|
+
onChangeHandler(updatedConditions, conditionIndex);
|
198
115
|
},
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
},
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
posinset: conditionIndex + 1,
|
215
|
-
setsize: group.conditions.length
|
216
|
-
},
|
217
|
-
className: "".concat(DataConfigs.blockClass, "__group"),
|
218
|
-
group: eachCondition,
|
219
|
-
onChange: function onChange(updatedConditions) {
|
220
|
-
onChangeHandler(updatedConditions, conditionIndex);
|
221
|
-
},
|
222
|
-
onRemove: function onRemove(e) {
|
223
|
-
onRemoveHandler(eachCondition.id, e);
|
224
|
-
},
|
225
|
-
conditionBuilderRef: conditionBuilderRef
|
226
|
-
})) : /*#__PURE__*/React__default["default"].createElement(ConditionBlock["default"], {
|
227
|
-
conjunction: conditionIndex > 0 ? group.groupOperator : undefined,
|
228
|
-
aria: {
|
229
|
-
level: aria.level + 1,
|
230
|
-
posinset: conditionIndex + 1,
|
231
|
-
setsize: group.conditions.length
|
232
|
-
},
|
233
|
-
isStatement: false,
|
234
|
-
condition: eachCondition,
|
235
|
-
group: group,
|
236
|
-
conditionIndex: conditionIndex,
|
237
|
-
addConditionHandler: addConditionHandler,
|
238
|
-
addConditionSubGroupHandler: addConditionSubGroupHandler,
|
239
|
-
onChange: function onChange(updatedConditions) {
|
240
|
-
onChangeHandler(updatedConditions, conditionIndex);
|
241
|
-
},
|
242
|
-
onRemove: function onRemove(e) {
|
243
|
-
onRemoveHandler(eachCondition.id, e);
|
244
|
-
},
|
245
|
-
onConnectorOperatorChange: onConnectorOperatorChange,
|
246
|
-
onStatementChange: onStatementChangeHandler,
|
247
|
-
showConditionSubGroupPreviewHandler: function showConditionSubGroupPreviewHandler() {
|
248
|
-
_showConditionSubGroupPreviewHandler(conditionIndex);
|
249
|
-
},
|
250
|
-
hideConditionSubGroupPreviewHandler: hideConditionSubGroupPreviewHandler,
|
251
|
-
showConditionPreviewHandler: function showConditionPreviewHandler() {
|
252
|
-
_showConditionPreviewHandler(conditionIndex);
|
253
|
-
},
|
254
|
-
hideConditionPreviewHandler: hideConditionPreviewHandler,
|
255
|
-
isLastCondition: isLastCondition
|
256
|
-
}), conditionIndex == showConditionSubGroupPreview && (_ConditionPreview || (_ConditionPreview = /*#__PURE__*/React__default["default"].createElement(ConditionPreview["default"], {
|
257
|
-
previewType: "subGroup"
|
258
|
-
}))), conditionIndex == showConditionPreview && (_ConditionPreview2 || (_ConditionPreview2 = /*#__PURE__*/React__default["default"].createElement(ConditionPreview["default"], {
|
259
|
-
previewType: "condition"
|
260
|
-
}))));
|
116
|
+
addConditionHandler: addConditionHandler,
|
117
|
+
onRemove: function onRemove(evt) {
|
118
|
+
onRemoveHandler(eachCondition.id, evt);
|
119
|
+
},
|
120
|
+
onConnectorOperatorChange: function onConnectorOperatorChange(op) {
|
121
|
+
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
|
122
|
+
groupOperator: op
|
123
|
+
}));
|
124
|
+
},
|
125
|
+
onStatementChange: function onStatementChange(updatedStatement) {
|
126
|
+
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
|
127
|
+
statement: updatedStatement
|
128
|
+
}));
|
129
|
+
},
|
130
|
+
isLastCondition: isLastCondition
|
261
131
|
}));
|
262
|
-
};
|
263
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, variant == 'tree' && getTreeVariant(), variant == 'sentence' && getSentenceVariant());
|
132
|
+
})));
|
264
133
|
};
|
265
134
|
var ConditionGroupBuilder$1 = ConditionGroupBuilder;
|
266
135
|
ConditionGroupBuilder.propTypes = {
|
@@ -269,19 +138,19 @@ ConditionGroupBuilder.propTypes = {
|
|
269
138
|
*/
|
270
139
|
aria: index["default"].object,
|
271
140
|
/**
|
272
|
-
*
|
273
|
-
*/
|
274
|
-
/**
|
275
|
-
* Provide an optional class to be applied to the containing node.
|
141
|
+
* Provide an class to be applied to the containing node.
|
276
142
|
*/
|
277
143
|
className: index["default"].string,
|
278
144
|
/**
|
279
|
-
className: PropTypes.string,
|
280
145
|
* ref of condition builder
|
281
146
|
*/
|
282
147
|
conditionBuilderRef: index["default"].object,
|
148
|
+
/**
|
149
|
+
* group defines the current group
|
150
|
+
*/
|
283
151
|
group: index["default"].object,
|
284
152
|
/**
|
153
|
+
|
285
154
|
* callback to update the current condition of the state tree
|
286
155
|
*/
|
287
156
|
onChange: index["default"].func,
|
@@ -2,4 +2,3 @@ export function focusThisField(evt: any): void;
|
|
2
2
|
export function focusThisItem(currentElement: any): void;
|
3
3
|
export function traverseClockVise(eachElem: any, index: any, allElements: any, rotate: any, trapFocus: any): void;
|
4
4
|
export function traverseReverse(eachElem: any, index: any, allElements: any, rotate: any, trapFocus: any): void;
|
5
|
-
export function checkForHoldingKey(evt: any, key: any): any;
|
@@ -194,7 +194,7 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
|
|
194
194
|
headerProps = _rollupPluginBabelHelpers["extends"]({}, (_rollupPluginBabelHelpers.objectDestructuringEmpty(_header$getHeaderProp), _header$getHeaderProp));
|
195
195
|
var resizerProps = header === null || header === void 0 || (_header$getResizerPro = header.getResizerProps) === null || _header$getResizerPro === void 0 ? void 0 : _header$getResizerPro.call(header);
|
196
196
|
return /*#__PURE__*/React__default["default"].createElement(react.TableHeader, _rollupPluginBabelHelpers["extends"]({}, headerProps, {
|
197
|
-
className: cx__default["default"](header === null || header === void 0 ? void 0 : header.className, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__resizableColumn"), resizerProps), "".concat(blockClass, "__isResizing"), header === null || header === void 0 ? void 0 : header.isResizing), "".concat(blockClass, "__sortableColumn"), datagridState.isTableSortable && header.id !== 'spacer'), "".concat(blockClass, "__isSorted"), header === null || header === void 0 ? void 0 : header.isSorted), "".concat(blockClass, "__header-actions-column"), header === null || header === void 0 ? void 0 : header.isAction), "".concat(blockClass, "__with-slug"), header.slug && /*#__PURE__*/React__default["default"].isValidElement(header === null || header === void 0 ? void 0 : header.slug))
|
197
|
+
className: cx__default["default"](header === null || header === void 0 ? void 0 : header.className, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__resizableColumn"), resizerProps), "".concat(blockClass, "__isResizing"), header === null || header === void 0 ? void 0 : header.isResizing), "".concat(blockClass, "__sortableColumn"), datagridState.isTableSortable && header.id !== 'spacer'), "".concat(blockClass, "__isSorted"), header === null || header === void 0 ? void 0 : header.isSorted), "".concat(blockClass, "__header-actions-column"), header === null || header === void 0 ? void 0 : header.isAction), "".concat(blockClass, "__with-slug"), header.slug && /*#__PURE__*/React__default["default"].isValidElement(header === null || header === void 0 ? void 0 : header.slug))),
|
198
198
|
key: header.id,
|
199
199
|
"aria-hidden": header.id === 'spacer' && 'true'
|
200
200
|
}, getAccessibilityProps(header)), header.render('Header'), renderSlug(header.slug), resizerProps && !header.isAction && /*#__PURE__*/React__default["default"].createElement(ResizeHeader, {
|
package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js
CHANGED
@@ -82,7 +82,7 @@ var CustomizeColumnsTearsheet = function CustomizeColumnsTearsheet(_ref) {
|
|
82
82
|
};
|
83
83
|
var onCheckboxCheck = function onCheckboxCheck(col, value) {
|
84
84
|
var changedDefinitions = columnObjects.map(function (definition) {
|
85
|
-
if (
|
85
|
+
if (Array.isArray(col) && col.indexOf(definition) != -1 || definition.id === col.id) {
|
86
86
|
return _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, definition), {}, {
|
87
87
|
isVisible: value
|
88
88
|
});
|
@@ -106,12 +106,9 @@ var CustomizeColumnsTearsheet = function CustomizeColumnsTearsheet(_ref) {
|
|
106
106
|
React.useEffect(function () {
|
107
107
|
var notFilterableCount = columnObjects.filter(function (col) {
|
108
108
|
return !col.canFilter;
|
109
|
-
})
|
110
|
-
|
111
|
-
|
112
|
-
}).length;
|
113
|
-
setVisibleColumnsCount(getVisibleColumnsCount() - notFilterableCount - actionCount);
|
114
|
-
setTotalColumns(columnObjects.length - notFilterableCount - actionCount);
|
109
|
+
});
|
110
|
+
setVisibleColumnsCount(getVisibleColumnsCount() - notFilterableCount.length);
|
111
|
+
setTotalColumns(columnObjects.length - notFilterableCount.length);
|
115
112
|
}, [getVisibleColumnsCount, columnObjects]);
|
116
113
|
return /*#__PURE__*/React__default["default"].createElement(TearsheetNarrow.TearsheetNarrow, {
|
117
114
|
className: "".concat(blockClass, "__customize-columns-tearsheet"),
|
@@ -1,8 +1,2 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright IBM Corp. 2023, 2024
|
3
|
-
*
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
6
|
-
*/
|
7
|
-
declare const useFilterContext: () => any;
|
8
1
|
export default useFilterContext;
|
2
|
+
declare function useFilterContext(): any;
|
package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts
CHANGED
@@ -20,7 +20,6 @@ export namespace InlineEditCell {
|
|
20
20
|
rows: PropTypes.Requireable<(object | null | undefined)[]>;
|
21
21
|
rowSize: PropTypes.Requireable<string>;
|
22
22
|
tableId: PropTypes.Requireable<string>;
|
23
|
-
cellEditing: PropTypes.Requireable<object>;
|
24
23
|
}>>;
|
25
24
|
let nonEditCell: PropTypes.Requireable<boolean>;
|
26
25
|
let placeholder: PropTypes.Requireable<string>;
|
@@ -45,8 +45,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
45
45
|
var columnIndex = instance.columns.findIndex(function (col) {
|
46
46
|
return col.id === columnId;
|
47
47
|
});
|
48
|
-
var
|
49
|
-
var cellId = "column-".concat(columnIndex, "-row-").concat(rowIndex);
|
48
|
+
var cellId = "column-".concat(columnIndex, "-row-").concat(cell.row.index);
|
50
49
|
var _useContext = React.useContext(InlineEditContext.InlineEditContext),
|
51
50
|
state = _useContext.state,
|
52
51
|
dispatch = _useContext.dispatch;
|
@@ -82,14 +81,6 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
82
81
|
var rowSize = instance.rowSize,
|
83
82
|
onDataUpdate = instance.onDataUpdate;
|
84
83
|
var saveCellData;
|
85
|
-
if (inEditMode) {
|
86
|
-
instance.cellEditing = {
|
87
|
-
cellId: cellId,
|
88
|
-
columnIndex: columnIndex,
|
89
|
-
rowIndex: rowIndex,
|
90
|
-
curCellValue: cellValue
|
91
|
-
};
|
92
|
-
}
|
93
84
|
React.useEffect(function () {
|
94
85
|
setInitialValue(value);
|
95
86
|
var columnId = cell.column.id;
|
@@ -463,7 +454,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
463
454
|
"data-inline-type": type,
|
464
455
|
onClick: !nonEditCell ? handleInlineCellClick : addActiveState,
|
465
456
|
onKeyDown: !nonEditCell ? handleKeyDown : null,
|
466
|
-
className: cx__default["default"]("".concat(blockClass, "__inline-edit--outer-cell-button"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__inline-edit--outer-cell-button--").concat(rowSize), rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--lg"), !rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--invalid"),
|
457
|
+
className: cx__default["default"]("".concat(blockClass, "__inline-edit--outer-cell-button"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__inline-edit--outer-cell-button--").concat(rowSize), rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--lg"), !rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--invalid"), config === null || config === void 0 || (_config$validator = config.validator) === null || _config$validator === void 0 ? void 0 : _config$validator.call(config, cellValue)), "".concat(blockClass, "__static--outer-cell"), !disabledCell))
|
467
458
|
}, !nonEditCell && !disabledCell && renderRegularCell(), (!inEditMode || disabledCell) && /*#__PURE__*/React__default["default"].createElement(InlineEditButton.InlineEditButton, {
|
468
459
|
isActiveCell: cellId === activeCellId,
|
469
460
|
renderIcon: setRenderIcon(),
|
@@ -487,8 +478,7 @@ InlineEditCell.propTypes = {
|
|
487
478
|
onDataUpdate: index["default"].func,
|
488
479
|
rows: index["default"].arrayOf(index["default"].object),
|
489
480
|
rowSize: index["default"].string,
|
490
|
-
tableId: index["default"].string
|
491
|
-
cellEditing: index["default"].object
|
481
|
+
tableId: index["default"].string
|
492
482
|
}),
|
493
483
|
nonEditCell: index["default"].bool,
|
494
484
|
placeholder: index["default"].string,
|
@@ -192,8 +192,6 @@ export interface DataGridState<T extends object = any> extends TableCommonProps,
|
|
192
192
|
onVirtualScroll?: (evt?: boolean) => void;
|
193
193
|
fetchMoreData?: () => void;
|
194
194
|
loadMoreThreshold?: number;
|
195
|
-
onRowClick?: (row: any, event: any) => void;
|
196
|
-
onSort?: boolean;
|
197
195
|
}
|
198
196
|
export interface ResizeHeaderProps {
|
199
197
|
resizerProps?: ResizerProps;
|
@@ -1,8 +1,2 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright IBM Corp. 2022, 2022
|
3
|
-
*
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
6
|
-
*/
|
7
|
-
import { useColumnOrder } from 'react-table';
|
8
1
|
export default useColumnOrder;
|
2
|
+
import { useColumnOrder } from 'react-table';
|
@@ -23,23 +23,6 @@ var blockClass = "".concat(settings.pkg.prefix, "--datagrid");
|
|
23
23
|
var useNestedRows = function useNestedRows(hooks) {
|
24
24
|
useNestedRowExpander["default"](hooks);
|
25
25
|
var useInstance = function useInstance(instance) {
|
26
|
-
React.useEffect(function () {
|
27
|
-
var rows = instance.rows;
|
28
|
-
var defaultExpandedRows = rows.filter(function (row) {
|
29
|
-
var _row$original;
|
30
|
-
return row === null || row === void 0 || (_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.defaultExpanded;
|
31
|
-
});
|
32
|
-
if (defaultExpandedRows !== null && defaultExpandedRows !== void 0 && defaultExpandedRows.length) {
|
33
|
-
defaultExpandedRows.map(function (defaultExpandedRow) {
|
34
|
-
if (!defaultExpandedRow.isExpanded && !defaultExpandedRow.hasExpanded) {
|
35
|
-
var _defaultExpandedRow$t;
|
36
|
-
defaultExpandedRow === null || defaultExpandedRow === void 0 || (_defaultExpandedRow$t = defaultExpandedRow.toggleRowExpanded) === null || _defaultExpandedRow$t === void 0 || _defaultExpandedRow$t.call(defaultExpandedRow);
|
37
|
-
defaultExpandedRow.hasExpanded = true;
|
38
|
-
return;
|
39
|
-
}
|
40
|
-
});
|
41
|
-
}
|
42
|
-
}, [instance, instance.rows]);
|
43
26
|
// This useEffect will expand rows if they exist in the initialState obj
|
44
27
|
React.useEffect(function () {
|
45
28
|
var rows = instance.rows,
|
@@ -1,9 +1,2 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright IBM Corp. 2020, 2023
|
3
|
-
*
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
6
|
-
*/
|
7
|
-
import { Hooks } from 'react-table';
|
8
|
-
declare const useOnRowClick: (hooks: Hooks) => void;
|
9
1
|
export default useOnRowClick;
|
2
|
+
declare function useOnRowClick(hooks: any): void;
|