@carbon/ibm-products 2.42.1-canary.2 → 2.42.1-canary.22
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +302 -9
- 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 +302 -9
- 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 +302 -9
- 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 +6 -0
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +74 -33
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +15 -1
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +95 -12
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +11 -2
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +27 -9
- package/es/components/ConditionBuilder/{ConditionConnector → ConditionBuilderConnector}/ConditionConnector.js +38 -33
- package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.d.ts +2 -0
- package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +44 -0
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +5 -0
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +95 -14
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +1 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +1 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +7 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +8 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +197 -67
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +10 -0
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +69 -0
- package/es/components/ConditionBuilder/utils/util.d.ts +1 -0
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +7 -4
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +7 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts +1 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +13 -3
- package/es/components/Datagrid/types/index.d.ts +2 -0
- package/es/components/Datagrid/useColumnOrder.d.ts +7 -1
- package/es/components/Datagrid/useNestedRows.js +24 -2
- package/es/components/Datagrid/useOnRowClick.d.ts +8 -1
- package/es/components/Datagrid/useOnRowClick.js +2 -1
- package/es/components/Datagrid/useRowIsMouseOver.d.ts +2 -1
- package/es/components/Datagrid/useRowIsMouseOver.js +1 -1
- package/es/components/Datagrid/useSelectRows.d.ts +8 -1
- package/es/components/Datagrid/useSelectRows.js +3 -2
- package/es/components/Datagrid/useSortableColumns.d.ts +10 -3
- package/es/components/Datagrid/useSortableColumns.js +3 -2
- package/es/components/Datagrid/utils/getAutoSizedColumnWidth.d.ts +8 -1
- package/es/components/Datagrid/utils/getAutoSizedColumnWidth.js +0 -7
- 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 +5 -3
- package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +1 -1
- package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +1 -1
- package/es/feature-flags.js +18 -0
- package/es/global/js/package-settings.js +2 -2
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- 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 +6 -0
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +73 -32
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +15 -1
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +92 -9
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +11 -2
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +26 -8
- package/lib/components/ConditionBuilder/{ConditionConnector → ConditionBuilderConnector}/ConditionConnector.js +36 -31
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.d.ts +2 -0
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +52 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +5 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +92 -11
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +1 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +1 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +7 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +8 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +195 -64
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +10 -0
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +77 -0
- package/lib/components/ConditionBuilder/utils/util.d.ts +1 -0
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +7 -4
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +7 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts +1 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +13 -3
- package/lib/components/Datagrid/types/index.d.ts +2 -0
- package/lib/components/Datagrid/useColumnOrder.d.ts +7 -1
- package/lib/components/Datagrid/useNestedRows.js +24 -2
- package/lib/components/Datagrid/useOnRowClick.d.ts +8 -1
- package/lib/components/Datagrid/useOnRowClick.js +2 -1
- package/lib/components/Datagrid/useRowIsMouseOver.d.ts +2 -1
- package/lib/components/Datagrid/useRowIsMouseOver.js +1 -1
- package/lib/components/Datagrid/useSelectRows.d.ts +8 -1
- package/lib/components/Datagrid/useSelectRows.js +3 -2
- package/lib/components/Datagrid/useSortableColumns.d.ts +10 -3
- package/lib/components/Datagrid/useSortableColumns.js +3 -2
- package/lib/components/Datagrid/utils/getAutoSizedColumnWidth.d.ts +8 -1
- package/lib/components/Datagrid/utils/getAutoSizedColumnWidth.js +0 -7
- 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 +5 -3
- package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +1 -1
- package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +1 -1
- package/lib/feature-flags.js +40 -0
- package/lib/global/js/package-settings.js +2 -2
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/package.json +3 -3
- package/scss/components/ConditionBuilder/_condition-builder.scss +21 -1
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +22 -3
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +58 -21
- package/scss/components/NonLinearReading/_non-linear-reading.scss +1 -1
- /package/es/components/ConditionBuilder/{ConditionConnector → ConditionBuilderConnector}/ConditionConnector.d.ts +0 -0
- /package/lib/components/ConditionBuilder/{ConditionConnector → ConditionBuilderConnector}/ConditionConnector.d.ts +0 -0
@@ -5,12 +5,21 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
import { objectSpread2 as _objectSpread2, toConsumableArray as _toConsumableArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
-
import React__default from 'react';
|
8
|
+
import { slicedToArray as _slicedToArray, defineProperty as _defineProperty, objectSpread2 as _objectSpread2, toConsumableArray as _toConsumableArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
+
import React__default, { useContext, useState, Fragment } from 'react';
|
10
10
|
import ConditionBlock from '../ConditionBlock/ConditionBlock.js';
|
11
11
|
import PropTypes from '../../../node_modules/prop-types/index.js';
|
12
|
-
import
|
12
|
+
import cx from 'classnames';
|
13
|
+
import { blockClass, translateWithId, statementConfig } from '../ConditionBuilderContext/DataConfigs.js';
|
14
|
+
import { ConditionBuilderItem } from '../ConditionBuilderItem/ConditionBuilderItem.js';
|
15
|
+
import { ConditionBuilderItemOption } from '../ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js';
|
16
|
+
import { focusThisField } from '../utils/util.js';
|
17
|
+
import ConditionConnector from '../ConditionBuilderConnector/ConditionConnector.js';
|
18
|
+
import { ConditionBuilderContext } from '../ConditionBuilderContext/ConditionBuilderProvider.js';
|
13
19
|
import uuidv4 from '../../../global/js/utils/uuidv4.js';
|
20
|
+
import ConditionPreview from '../ConditionPreview/ConditionPreview.js';
|
21
|
+
|
22
|
+
var _ConditionPreview, _ConditionPreview2;
|
14
23
|
|
15
24
|
/**
|
16
25
|
*
|
@@ -18,14 +27,24 @@ import uuidv4 from '../../../global/js/utils/uuidv4.js';
|
|
18
27
|
* All the inner components of group are called from here.
|
19
28
|
* @returns
|
20
29
|
*/
|
30
|
+
|
21
31
|
var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
22
|
-
var _group$conditions;
|
23
32
|
var group = _ref.group,
|
24
33
|
aria = _ref.aria,
|
25
34
|
onRemove = _ref.onRemove,
|
26
35
|
onChange = _ref.onChange,
|
27
36
|
conditionBuilderRef = _ref.conditionBuilderRef,
|
28
37
|
className = _ref.className;
|
38
|
+
var _useContext = useContext(ConditionBuilderContext),
|
39
|
+
variant = _useContext.variant;
|
40
|
+
var _useState = useState(-1),
|
41
|
+
_useState2 = _slicedToArray(_useState, 2),
|
42
|
+
showConditionPreview = _useState2[0],
|
43
|
+
setShowConditionPreview = _useState2[1];
|
44
|
+
var _useState3 = useState(-1),
|
45
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
46
|
+
showConditionSubGroupPreview = _useState4[0],
|
47
|
+
setShowConditionSubGroupPreview = _useState4[1];
|
29
48
|
var onRemoveHandler = function onRemoveHandler(conditionId, evt) {
|
30
49
|
if (group.conditions.length > 1) {
|
31
50
|
onChange(_objectSpread2(_objectSpread2({}, group), {}, {
|
@@ -56,72 +75,183 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
56
75
|
conditions: [].concat(_toConsumableArray(group.conditions.slice(0, conditionIndex + 1)), [newCondition], _toConsumableArray(group.conditions.slice(conditionIndex + 1)))
|
57
76
|
}));
|
58
77
|
};
|
59
|
-
var
|
60
|
-
|
61
|
-
|
62
|
-
var handleFocusOnClose = function handleFocusOnClose(evt) {
|
63
|
-
var _evt$currentTarget;
|
64
|
-
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"]');
|
78
|
+
var handleFocusOnClose = function handleFocusOnClose(e) {
|
79
|
+
var _e$currentTarget;
|
80
|
+
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"]');
|
65
81
|
if (previousClose) {
|
66
82
|
previousClose.focus();
|
67
83
|
}
|
68
84
|
};
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
85
|
+
var addConditionSubGroupHandler = function addConditionSubGroupHandler(conditionIndex) {
|
86
|
+
onChange(_objectSpread2(_objectSpread2({}, group), {}, {
|
87
|
+
conditions: [].concat(_toConsumableArray(group.conditions.slice(0, conditionIndex + 1)), [{
|
88
|
+
groupSeparateOperator: null,
|
89
|
+
groupOperator: 'and',
|
90
|
+
statement: 'if',
|
91
|
+
conditions: [{
|
92
|
+
property: undefined,
|
93
|
+
operator: '',
|
94
|
+
value: '',
|
95
|
+
popoverToOpen: 'propertyField',
|
96
|
+
id: uuidv4()
|
97
|
+
}],
|
98
|
+
id: uuidv4()
|
99
|
+
}], _toConsumableArray(group.conditions.slice(conditionIndex + 1)))
|
100
|
+
}));
|
101
|
+
};
|
102
|
+
var isLastCondition = function isLastCondition(conditionIndex, conditionArr) {
|
103
|
+
return conditionIndex + 1 >= conditionArr.length || conditionArr.length - 1 != conditionIndex && conditionArr[conditionIndex + 1].conditions;
|
104
|
+
};
|
105
|
+
var _showConditionSubGroupPreviewHandler = function showConditionSubGroupPreviewHandler(conditionIndex) {
|
106
|
+
setShowConditionSubGroupPreview(conditionIndex);
|
107
|
+
};
|
108
|
+
var hideConditionSubGroupPreviewHandler = function hideConditionSubGroupPreviewHandler() {
|
109
|
+
setShowConditionSubGroupPreview(-1);
|
110
|
+
};
|
111
|
+
var _showConditionPreviewHandler = function showConditionPreviewHandler(conditionIndex) {
|
112
|
+
setShowConditionPreview(conditionIndex);
|
113
|
+
};
|
114
|
+
var hideConditionPreviewHandler = function hideConditionPreviewHandler() {
|
115
|
+
setShowConditionPreview(-1);
|
116
|
+
};
|
117
|
+
var onStatementChangeHandler = function onStatementChangeHandler(updatedStatement) {
|
118
|
+
onChange(_objectSpread2(_objectSpread2({}, group), {}, {
|
119
|
+
statement: updatedStatement
|
120
|
+
}));
|
121
|
+
};
|
122
|
+
var onConnectorOperatorChange = function onConnectorOperatorChange(op) {
|
123
|
+
onChange(_objectSpread2(_objectSpread2({}, group), {}, {
|
124
|
+
groupOperator: op
|
125
|
+
}));
|
126
|
+
};
|
127
|
+
var getSentenceVariant = function getSentenceVariant() {
|
128
|
+
var _group$conditions;
|
76
129
|
return /*#__PURE__*/React__default.createElement("div", {
|
77
|
-
|
78
|
-
},
|
79
|
-
className: "".concat(blockClass, "
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
}
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
130
|
+
className: "".concat(className, " eachGroup")
|
131
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
132
|
+
className: "".concat(blockClass, "__condition-wrapper"),
|
133
|
+
role: "grid",
|
134
|
+
"aria-label": translateWithId('condition_builder_group')
|
135
|
+
}, group === null || group === void 0 || (_group$conditions = group.conditions) === null || _group$conditions === void 0 ? void 0 : _group$conditions.map(function (eachCondition, conditionIndex) {
|
136
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
137
|
+
key: eachCondition.id,
|
138
|
+
className: "".concat(blockClass, "__group-wrapper")
|
139
|
+
}, /*#__PURE__*/React__default.createElement(ConditionBlock, {
|
140
|
+
conjunction: conditionIndex > 0 ? group.groupOperator : undefined,
|
141
|
+
aria: {
|
142
|
+
level: aria.level + 1,
|
143
|
+
posinset: conditionIndex + 1,
|
144
|
+
setsize: group.conditions.length
|
145
|
+
},
|
146
|
+
isStatement: conditionIndex == 0,
|
147
|
+
condition: eachCondition,
|
148
|
+
group: group,
|
149
|
+
conditionIndex: conditionIndex,
|
150
|
+
onChange: function onChange(updatedConditions) {
|
151
|
+
onChangeHandler(updatedConditions, conditionIndex);
|
152
|
+
},
|
153
|
+
addConditionHandler: addConditionHandler,
|
154
|
+
onRemove: function onRemove(e) {
|
155
|
+
onRemoveHandler(eachCondition.id, e);
|
156
|
+
},
|
157
|
+
onConnectorOperatorChange: onConnectorOperatorChange,
|
158
|
+
onStatementChange: onStatementChangeHandler,
|
159
|
+
isLastCondition: isLastCondition
|
160
|
+
}));
|
161
|
+
})));
|
162
|
+
};
|
163
|
+
var getTreeVariant = function getTreeVariant() {
|
164
|
+
var _group$conditions2;
|
165
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
166
|
+
className: "".concat(className, " ").concat(blockClass, "__condition-wrapper"),
|
167
|
+
role: aria.level === 1 ? 'rowgroup' : undefined,
|
168
|
+
"aria-label": aria.level == 1 ? translateWithId('condition_builder_group') : undefined
|
169
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
170
|
+
tabIndex: 0,
|
171
|
+
role: "row",
|
172
|
+
"aria-level": aria.level,
|
173
|
+
"aria-posinset": aria.posinset,
|
174
|
+
"aria-setsize": aria.setsize
|
175
|
+
}, /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
|
176
|
+
label: group.statement,
|
177
|
+
title: translateWithId('condition'),
|
178
|
+
"data-name": "connectorField",
|
179
|
+
popOverClassName: "".concat(blockClass, "__gap"),
|
180
|
+
className: "".concat(blockClass, "__statement-button")
|
181
|
+
}, /*#__PURE__*/React__default.createElement(ConditionBuilderItemOption, {
|
182
|
+
conditionState: {
|
183
|
+
value: group.statement,
|
184
|
+
label: translateWithId('condition')
|
116
185
|
},
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
}));
|
186
|
+
onChange: function onChange(v, evt) {
|
187
|
+
focusThisField(evt);
|
188
|
+
onStatementChangeHandler(v);
|
121
189
|
},
|
122
|
-
|
190
|
+
config: {
|
191
|
+
options: statementConfig
|
192
|
+
}
|
193
|
+
}))), group === null || group === void 0 || (_group$conditions2 = group.conditions) === null || _group$conditions2 === void 0 ? void 0 : _group$conditions2.map(function (eachCondition, conditionIndex) {
|
194
|
+
return /*#__PURE__*/React__default.createElement(Fragment, {
|
195
|
+
key: eachCondition.id
|
196
|
+
}, eachCondition.conditions ? /*#__PURE__*/React__default.createElement("div", {
|
197
|
+
className: cx("".concat(blockClass, "__condition-block subgroup ").concat(blockClass, "__gap"), _defineProperty({}, "".concat(blockClass, "__gap-bottom"), group.conditions.length < conditionIndex + 1))
|
198
|
+
}, /*#__PURE__*/React__default.createElement(ConditionConnector, {
|
199
|
+
className: "".concat(blockClass, "__gap ").concat(blockClass, "__groupConnector"),
|
200
|
+
operator: group.groupOperator,
|
201
|
+
"aria-hidden": true
|
202
|
+
}), /*#__PURE__*/React__default.createElement(ConditionGroupBuilder, {
|
203
|
+
aria: {
|
204
|
+
level: aria.level + 1,
|
205
|
+
posinset: conditionIndex + 1,
|
206
|
+
setsize: group.conditions.length
|
207
|
+
},
|
208
|
+
className: "".concat(blockClass, "__group"),
|
209
|
+
group: eachCondition,
|
210
|
+
onChange: function onChange(updatedConditions) {
|
211
|
+
onChangeHandler(updatedConditions, conditionIndex);
|
212
|
+
},
|
213
|
+
onRemove: function onRemove(e) {
|
214
|
+
onRemoveHandler(eachCondition.id, e);
|
215
|
+
},
|
216
|
+
conditionBuilderRef: conditionBuilderRef
|
217
|
+
})) : /*#__PURE__*/React__default.createElement(ConditionBlock, {
|
218
|
+
conjunction: conditionIndex > 0 ? group.groupOperator : undefined,
|
219
|
+
aria: {
|
220
|
+
level: aria.level + 1,
|
221
|
+
posinset: conditionIndex + 1,
|
222
|
+
setsize: group.conditions.length
|
223
|
+
},
|
224
|
+
isStatement: false,
|
225
|
+
condition: eachCondition,
|
226
|
+
group: group,
|
227
|
+
conditionIndex: conditionIndex,
|
228
|
+
addConditionHandler: addConditionHandler,
|
229
|
+
addConditionSubGroupHandler: addConditionSubGroupHandler,
|
230
|
+
onChange: function onChange(updatedConditions) {
|
231
|
+
onChangeHandler(updatedConditions, conditionIndex);
|
232
|
+
},
|
233
|
+
onRemove: function onRemove(e) {
|
234
|
+
onRemoveHandler(eachCondition.id, e);
|
235
|
+
},
|
236
|
+
onConnectorOperatorChange: onConnectorOperatorChange,
|
237
|
+
onStatementChange: onStatementChangeHandler,
|
238
|
+
showConditionSubGroupPreviewHandler: function showConditionSubGroupPreviewHandler() {
|
239
|
+
_showConditionSubGroupPreviewHandler(conditionIndex);
|
240
|
+
},
|
241
|
+
hideConditionSubGroupPreviewHandler: hideConditionSubGroupPreviewHandler,
|
242
|
+
showConditionPreviewHandler: function showConditionPreviewHandler() {
|
243
|
+
_showConditionPreviewHandler(conditionIndex);
|
244
|
+
},
|
245
|
+
hideConditionPreviewHandler: hideConditionPreviewHandler,
|
246
|
+
isLastCondition: isLastCondition
|
247
|
+
}), conditionIndex == showConditionSubGroupPreview && (_ConditionPreview || (_ConditionPreview = /*#__PURE__*/React__default.createElement(ConditionPreview, {
|
248
|
+
previewType: "subGroup"
|
249
|
+
}))), conditionIndex == showConditionPreview && (_ConditionPreview2 || (_ConditionPreview2 = /*#__PURE__*/React__default.createElement(ConditionPreview, {
|
250
|
+
previewType: "condition"
|
251
|
+
}))));
|
123
252
|
}));
|
124
|
-
}
|
253
|
+
};
|
254
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, variant == 'tree' && getTreeVariant(), variant == 'sentence' && getSentenceVariant());
|
125
255
|
};
|
126
256
|
var ConditionGroupBuilder$1 = ConditionGroupBuilder;
|
127
257
|
ConditionGroupBuilder.propTypes = {
|
@@ -130,19 +260,19 @@ ConditionGroupBuilder.propTypes = {
|
|
130
260
|
*/
|
131
261
|
aria: PropTypes.object,
|
132
262
|
/**
|
133
|
-
*
|
263
|
+
* state defines the current group
|
264
|
+
*/
|
265
|
+
/**
|
266
|
+
* Provide an optional class to be applied to the containing node.
|
134
267
|
*/
|
135
268
|
className: PropTypes.string,
|
136
269
|
/**
|
270
|
+
className: PropTypes.string,
|
137
271
|
* ref of condition builder
|
138
272
|
*/
|
139
273
|
conditionBuilderRef: PropTypes.object,
|
140
|
-
/**
|
141
|
-
* group defines the current group
|
142
|
-
*/
|
143
274
|
group: PropTypes.object,
|
144
275
|
/**
|
145
|
-
|
146
276
|
* callback to update the current condition of the state tree
|
147
277
|
*/
|
148
278
|
onChange: PropTypes.func,
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export default ConditionPreview;
|
2
|
+
declare function ConditionPreview({ previewType }: {
|
3
|
+
previewType: any;
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
5
|
+
declare namespace ConditionPreview {
|
6
|
+
namespace propTypes {
|
7
|
+
let previewType: PropTypes.Requireable<string>;
|
8
|
+
}
|
9
|
+
}
|
10
|
+
import PropTypes from 'prop-types';
|
@@ -0,0 +1,69 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 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
|
+
|
8
|
+
import React__default from 'react';
|
9
|
+
import PropTypes from '../../../node_modules/prop-types/index.js';
|
10
|
+
import { blockClass, translateWithId } from '../ConditionBuilderContext/DataConfigs.js';
|
11
|
+
import { ConditionBuilderItem } from '../ConditionBuilderItem/ConditionBuilderItem.js';
|
12
|
+
import ConditionConnector from '../ConditionBuilderConnector/ConditionConnector.js';
|
13
|
+
|
14
|
+
var ConditionPreview = function ConditionPreview(_ref) {
|
15
|
+
var previewType = _ref.previewType;
|
16
|
+
var getConditionSection = function getConditionSection() {
|
17
|
+
return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
|
18
|
+
label: translateWithId('property')
|
19
|
+
}), /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
|
20
|
+
label: translateWithId('operator')
|
21
|
+
}), /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
|
22
|
+
label: translateWithId('value')
|
23
|
+
}));
|
24
|
+
};
|
25
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, previewType == 'newGroup' && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
26
|
+
className: "".concat(blockClass, "__group__row ").concat(blockClass, "__group-preview ")
|
27
|
+
}, /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
|
28
|
+
className: "".concat(blockClass, "__statement-button"),
|
29
|
+
label: translateWithId('and')
|
30
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
31
|
+
"aria-hidden": true,
|
32
|
+
className: "".concat(blockClass, "__group ").concat(blockClass, "__condition-wrapper ").concat(blockClass, "__group-preview ").concat(blockClass, "__group-wrapper")
|
33
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
34
|
+
className: "".concat(blockClass, "__gap")
|
35
|
+
}, /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
|
36
|
+
className: "".concat(blockClass, "__statement-button"),
|
37
|
+
label: translateWithId('if')
|
38
|
+
})), getConditionSection())), previewType == 'subGroup' && /*#__PURE__*/React__default.createElement("div", {
|
39
|
+
className: "".concat(blockClass, "__group-preview")
|
40
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
41
|
+
className: "".concat(blockClass, "__condition-block ").concat(blockClass, "__gap")
|
42
|
+
}, /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
|
43
|
+
label: translateWithId('and'),
|
44
|
+
className: "".concat(blockClass, "__statement-button"),
|
45
|
+
popOverClassName: "".concat(blockClass, "__gap")
|
46
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
47
|
+
className: "".concat(blockClass, "__group ").concat(blockClass, "__condition-wrapper")
|
48
|
+
}, /*#__PURE__*/React__default.createElement(ConditionConnector, {
|
49
|
+
className: "".concat(blockClass, "__gap ").concat(blockClass, "__groupConnector"),
|
50
|
+
operator: translateWithId('if')
|
51
|
+
}), getConditionSection()))), previewType == 'condition' && /*#__PURE__*/React__default.createElement("div", {
|
52
|
+
className: "".concat(blockClass, "__group-preview")
|
53
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
54
|
+
className: "".concat(blockClass, "__condition-block ").concat(blockClass, "__gap")
|
55
|
+
}, /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
|
56
|
+
label: translateWithId('and'),
|
57
|
+
className: "".concat(blockClass, "__statement-button"),
|
58
|
+
popOverClassName: "".concat(blockClass, "__gap")
|
59
|
+
}), getConditionSection())));
|
60
|
+
};
|
61
|
+
var ConditionPreview$1 = ConditionPreview;
|
62
|
+
ConditionPreview.propTypes = {
|
63
|
+
/**
|
64
|
+
* type of review to be displayed
|
65
|
+
*/
|
66
|
+
previewType: PropTypes.oneOf(['condition', 'subGroup', 'newGroup'])
|
67
|
+
};
|
68
|
+
|
69
|
+
export { ConditionPreview$1 as default };
|
@@ -2,3 +2,4 @@ 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;
|
@@ -185,7 +185,7 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
|
|
185
185
|
headerProps = _extends({}, (_objectDestructuringEmpty(_header$getHeaderProp), _header$getHeaderProp));
|
186
186
|
var resizerProps = header === null || header === void 0 || (_header$getResizerPro = header.getResizerProps) === null || _header$getResizerPro === void 0 ? void 0 : _header$getResizerPro.call(header);
|
187
187
|
return /*#__PURE__*/React__default.createElement(TableHeader, _extends({}, headerProps, {
|
188
|
-
className: cx(header === null || header === void 0 ? void 0 : header.className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_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.isValidElement(header === null || header === void 0 ? void 0 : header.slug))),
|
188
|
+
className: cx(header === null || header === void 0 ? void 0 : header.className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_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.isValidElement(header === null || header === void 0 ? void 0 : header.slug)), headerProps.className),
|
189
189
|
key: header.id,
|
190
190
|
"aria-hidden": header.id === 'spacer' && 'true'
|
191
191
|
}, getAccessibilityProps(header)), header.render('Header'), renderSlug(header.slug), resizerProps && !header.isAction && /*#__PURE__*/React__default.createElement(ResizeHeader, {
|
package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js
CHANGED
@@ -74,7 +74,7 @@ var CustomizeColumnsTearsheet = function CustomizeColumnsTearsheet(_ref) {
|
|
74
74
|
};
|
75
75
|
var onCheckboxCheck = function onCheckboxCheck(col, value) {
|
76
76
|
var changedDefinitions = columnObjects.map(function (definition) {
|
77
|
-
if (Array.isArray(col) && col.indexOf(definition) != -1 || definition.id === col.id) {
|
77
|
+
if ((Array.isArray(col) && col.indexOf(definition) != -1 || definition.id === col.id) && definition.canFilter && !definition.disabled) {
|
78
78
|
return _objectSpread2(_objectSpread2({}, definition), {}, {
|
79
79
|
isVisible: value
|
80
80
|
});
|
@@ -98,9 +98,12 @@ var CustomizeColumnsTearsheet = function CustomizeColumnsTearsheet(_ref) {
|
|
98
98
|
useEffect(function () {
|
99
99
|
var notFilterableCount = columnObjects.filter(function (col) {
|
100
100
|
return !col.canFilter;
|
101
|
-
});
|
102
|
-
|
103
|
-
|
101
|
+
}).length;
|
102
|
+
var actionCount = columnObjects.filter(function (col) {
|
103
|
+
return col.id === 'actions';
|
104
|
+
}).length;
|
105
|
+
setVisibleColumnsCount(getVisibleColumnsCount() - notFilterableCount - actionCount);
|
106
|
+
setTotalColumns(columnObjects.length - notFilterableCount - actionCount);
|
104
107
|
}, [getVisibleColumnsCount, columnObjects]);
|
105
108
|
return /*#__PURE__*/React__default.createElement(TearsheetNarrow, {
|
106
109
|
className: "".concat(blockClass, "__customize-columns-tearsheet"),
|
@@ -1,2 +1,8 @@
|
|
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;
|
1
8
|
export default useFilterContext;
|
2
|
-
declare function useFilterContext(): any;
|
package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts
CHANGED
@@ -20,6 +20,7 @@ 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>;
|
23
24
|
}>>;
|
24
25
|
let nonEditCell: PropTypes.Requireable<boolean>;
|
25
26
|
let placeholder: PropTypes.Requireable<string>;
|
@@ -36,7 +36,8 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
36
36
|
var columnIndex = instance.columns.findIndex(function (col) {
|
37
37
|
return col.id === columnId;
|
38
38
|
});
|
39
|
-
var
|
39
|
+
var rowIndex = cell.row.index;
|
40
|
+
var cellId = "column-".concat(columnIndex, "-row-").concat(rowIndex);
|
40
41
|
var _useContext = useContext(InlineEditContext),
|
41
42
|
state = _useContext.state,
|
42
43
|
dispatch = _useContext.dispatch;
|
@@ -72,6 +73,14 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
72
73
|
var rowSize = instance.rowSize,
|
73
74
|
onDataUpdate = instance.onDataUpdate;
|
74
75
|
var saveCellData;
|
76
|
+
if (inEditMode) {
|
77
|
+
instance.cellEditing = {
|
78
|
+
cellId: cellId,
|
79
|
+
columnIndex: columnIndex,
|
80
|
+
rowIndex: rowIndex,
|
81
|
+
curCellValue: cellValue
|
82
|
+
};
|
83
|
+
}
|
75
84
|
useEffect(function () {
|
76
85
|
setInitialValue(value);
|
77
86
|
var columnId = cell.column.id;
|
@@ -445,7 +454,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
|
|
445
454
|
"data-inline-type": type,
|
446
455
|
onClick: !nonEditCell ? handleInlineCellClick : addActiveState,
|
447
456
|
onKeyDown: !nonEditCell ? handleKeyDown : null,
|
448
|
-
className: cx("".concat(blockClass, "__inline-edit--outer-cell-button"), _defineProperty(_defineProperty(_defineProperty(_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))
|
457
|
+
className: cx("".concat(blockClass, "__inline-edit--outer-cell-button"), _defineProperty(_defineProperty(_defineProperty(_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"), inEditMode && (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))
|
449
458
|
}, !nonEditCell && !disabledCell && renderRegularCell(), (!inEditMode || disabledCell) && /*#__PURE__*/React__default.createElement(InlineEditButton, {
|
450
459
|
isActiveCell: cellId === activeCellId,
|
451
460
|
renderIcon: setRenderIcon(),
|
@@ -469,7 +478,8 @@ InlineEditCell.propTypes = {
|
|
469
478
|
onDataUpdate: PropTypes.func,
|
470
479
|
rows: PropTypes.arrayOf(PropTypes.object),
|
471
480
|
rowSize: PropTypes.string,
|
472
|
-
tableId: PropTypes.string
|
481
|
+
tableId: PropTypes.string,
|
482
|
+
cellEditing: PropTypes.object
|
473
483
|
}),
|
474
484
|
nonEditCell: PropTypes.bool,
|
475
485
|
placeholder: PropTypes.string,
|
@@ -192,6 +192,8 @@ 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;
|
195
197
|
}
|
196
198
|
export interface ResizeHeaderProps {
|
197
199
|
resizerProps?: ResizerProps;
|
@@ -1,2 +1,8 @@
|
|
1
|
-
|
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
|
+
*/
|
2
7
|
import { useColumnOrder } from 'react-table';
|
8
|
+
export default useColumnOrder;
|
@@ -15,6 +15,23 @@ var blockClass = "".concat(pkg.prefix, "--datagrid");
|
|
15
15
|
var useNestedRows = function useNestedRows(hooks) {
|
16
16
|
useNestedRowExpander(hooks);
|
17
17
|
var useInstance = function useInstance(instance) {
|
18
|
+
useEffect(function () {
|
19
|
+
var rows = instance.rows;
|
20
|
+
var defaultExpandedRows = rows.filter(function (row) {
|
21
|
+
var _row$original;
|
22
|
+
return row === null || row === void 0 || (_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.defaultExpanded;
|
23
|
+
});
|
24
|
+
if (defaultExpandedRows !== null && defaultExpandedRows !== void 0 && defaultExpandedRows.length) {
|
25
|
+
defaultExpandedRows.map(function (defaultExpandedRow) {
|
26
|
+
if (!defaultExpandedRow.isExpanded && !defaultExpandedRow.hasExpanded) {
|
27
|
+
var _defaultExpandedRow$t;
|
28
|
+
defaultExpandedRow === null || defaultExpandedRow === void 0 || (_defaultExpandedRow$t = defaultExpandedRow.toggleRowExpanded) === null || _defaultExpandedRow$t === void 0 || _defaultExpandedRow$t.call(defaultExpandedRow);
|
29
|
+
defaultExpandedRow.hasExpanded = true;
|
30
|
+
return;
|
31
|
+
}
|
32
|
+
});
|
33
|
+
}
|
34
|
+
}, [instance, instance.rows]);
|
18
35
|
// This useEffect will expand rows if they exist in the initialState obj
|
19
36
|
useEffect(function () {
|
20
37
|
var rows = instance.rows,
|
@@ -46,16 +63,21 @@ var useNestedRows = function useNestedRows(hooks) {
|
|
46
63
|
}
|
47
64
|
}];
|
48
65
|
};
|
66
|
+
var getIndentation = function getIndentation(depth) {
|
67
|
+
return 32 * depth + 16;
|
68
|
+
}; // row indentation padding
|
49
69
|
var getCellProps = function getCellProps(props, _ref3) {
|
50
70
|
var cell = _ref3.cell,
|
51
71
|
instance = _ref3.instance;
|
52
|
-
//
|
72
|
+
// we add a dynamic -ve margin right only if the cell is resized below minimum width i.e 50px, else we set the width based on indentation at different levels
|
53
73
|
var isFirstCell = instance.columns.findIndex(function (c) {
|
54
74
|
return c.id === cell.column.id;
|
55
75
|
}) === 0;
|
56
76
|
return [props, {
|
57
77
|
style: {
|
58
|
-
marginRight:
|
78
|
+
marginRight: isFirstCell && cell.row.depth > 0 && parseInt(props.style.width, 10) <= getIndentation(cell.row.depth) + 50 // indentation padding + expander cell or empty cell width
|
79
|
+
? "".concat(parseInt(props.style.width, 10) - (getIndentation(cell.row.depth) + 50), "px") : '',
|
80
|
+
width: isFirstCell && cell.row.depth > 0 ? parseInt(props.style.width, 10) - getIndentation(cell.row.depth) : props.style.width
|
59
81
|
}
|
60
82
|
}];
|
61
83
|
};
|
@@ -1,2 +1,9 @@
|
|
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;
|
1
9
|
export default useOnRowClick;
|
2
|
-
declare function useOnRowClick(hooks: any): void;
|
@@ -9,7 +9,8 @@ import { pkg, carbon } from '../../settings.js';
|
|
9
9
|
|
10
10
|
var useOnRowClick = function useOnRowClick(hooks) {
|
11
11
|
var useInstance = function useInstance(rowInstance) {
|
12
|
-
var
|
12
|
+
var _ref = rowInstance,
|
13
|
+
onRowClick = _ref.onRowClick;
|
13
14
|
var getRowProps = function getRowProps(props, datagridState) {
|
14
15
|
var isFetching = datagridState.isFetching,
|
15
16
|
row = datagridState.row,
|
@@ -17,7 +17,7 @@ var useRowIsMouseOver = function useRowIsMouseOver(hooks) {
|
|
17
17
|
setMouseOverRowIndex = _useState2[1];
|
18
18
|
var onMouseChange = useDebounce(function (datagridState) {
|
19
19
|
var row = datagridState.row;
|
20
|
-
setMouseOverRowIndex(row.index);
|
20
|
+
setMouseOverRowIndex(row === null || row === void 0 ? void 0 : row.index);
|
21
21
|
}, 100);
|
22
22
|
var getRowProps = function getRowProps(props, datagridState) {
|
23
23
|
var onMouseOver = function onMouseOver() {
|
@@ -1,2 +1,9 @@
|
|
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 useSelectRows: (hooks: Hooks) => void;
|
1
9
|
export default useSelectRows;
|
2
|
-
declare function useSelectRows(hooks: any): void;
|