@carbon/ibm-products 2.46.0 → 2.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/config-dev.css +6 -1
- package/css/config-dev.css.map +1 -1
- package/css/config.css +6 -1
- package/css/config.css.map +1 -1
- package/css/index-full-carbon.css +1323 -264
- 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 +49 -60
- 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 +1323 -264
- 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 +1323 -264
- 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/APIKeyModal/APIKeyModal.types.d.ts +6 -0
- package/es/components/ActionBar/ActionBar.d.ts +58 -2
- package/es/components/ActionBar/ActionBar.js +14 -9
- package/es/components/ActionBar/ActionBarItem.d.ts +36 -2
- package/es/components/ActionBar/ActionBarItem.js +7 -4
- package/es/components/ActionBar/ActionBarOverflowItems.d.ts +55 -16
- package/es/components/ActionBar/ActionBarOverflowItems.js +8 -4
- package/es/components/AddSelect/types/index.d.ts +6 -0
- package/es/components/Card/Card.d.ts +68 -2
- package/es/components/Card/Card.js +28 -35
- package/es/components/Card/CardFooter.d.ts +51 -48
- package/es/components/Card/CardFooter.js +4 -2
- package/es/components/Card/CardHeader.d.ts +67 -49
- package/es/components/Card/CardHeader.js +4 -2
- package/es/components/Coachmark/utils/enums.d.ts +6 -0
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +1 -0
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +17 -4
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +6 -4
- package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +4 -1
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +8 -2
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +3 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +5 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +20 -4
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +15 -7
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +9 -3
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +19 -6
- package/es/components/DataSpreadsheet/types/index.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/DatagridBody.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/DatagridContent.js +3 -2
- package/es/components/Datagrid/Datagrid/DatagridRefBody.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +4 -5
- package/es/components/Datagrid/Datagrid/DatagridSimpleBody.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -1
- package/es/components/Datagrid/Datagrid/DraggableElement.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -2
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +13 -8
- package/es/components/Datagrid/Datagrid/addons/Filtering/handleCheckboxChange.js +7 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +1 -1
- package/es/components/Datagrid/common-column-ids.d.ts +6 -0
- package/es/components/Datagrid/types/index.d.ts +6 -0
- package/es/components/Datagrid/useDatagrid.d.ts +6 -0
- package/es/components/Datagrid/useDisableSelectRows.d.ts +6 -0
- package/es/components/Datagrid/useInitialColumnSort.js +4 -0
- package/es/components/Datagrid/useRowIsMouseOver.d.ts +6 -0
- package/es/components/Datagrid/useSortableColumns.d.ts +5 -4
- package/es/components/Datagrid/useSortableColumns.js +18 -13
- package/es/components/EmptyStates/EmptyState.d.ts +72 -5
- package/es/components/EmptyStates/EmptyState.js +8 -5
- package/es/components/EmptyStates/EmptyStateV2.d.ts +63 -2
- package/es/components/EmptyStates/EmptyStateV2.js +3 -2
- package/es/components/FullPageError/FullPageError.d.ts +36 -2
- package/es/components/FullPageError/FullPageError.js +0 -3
- package/es/components/GetStartedCard/GetStartedCard.d.ts +60 -2
- package/es/components/GetStartedCard/GetStartedCard.js +11 -10
- package/es/components/PageHeader/PageHeaderUtils.js +1 -1
- package/es/components/StringFormatter/utils/enums.js +7 -0
- package/es/components/TagOverflow/TagOverflow.d.ts +35 -4
- package/es/components/TagOverflow/TagOverflow.js +47 -64
- package/es/components/TagOverflow/TagOverflowModal.js +4 -6
- package/es/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
- package/es/components/TagOverflow/TagOverflowPopover.js +38 -41
- package/es/components/Tearsheet/TearsheetShell.js +4 -1
- package/es/components/UserAvatar/UserAvatar.d.ts +59 -1
- package/es/components/UserAvatar/UserAvatar.js +7 -23
- package/es/global/js/utils/scrollableAncestor.js +7 -0
- package/es/global/js/utils/uuidv4.d.ts +6 -0
- package/es/global/js/utils/uuidv4.js +2 -0
- package/es/global/js/utils/wait.d.ts +6 -0
- package/es/global/js/utils/wait.js +2 -0
- package/flags.js +7 -0
- package/lib/components/APIKeyModal/APIKeyModal.types.d.ts +6 -0
- package/lib/components/ActionBar/ActionBar.d.ts +58 -2
- package/lib/components/ActionBar/ActionBar.js +14 -9
- package/lib/components/ActionBar/ActionBarItem.d.ts +36 -2
- package/lib/components/ActionBar/ActionBarItem.js +6 -3
- package/lib/components/ActionBar/ActionBarOverflowItems.d.ts +55 -16
- package/lib/components/ActionBar/ActionBarOverflowItems.js +8 -4
- package/lib/components/AddSelect/types/index.d.ts +6 -0
- package/lib/components/Card/Card.d.ts +68 -2
- package/lib/components/Card/Card.js +28 -35
- package/lib/components/Card/CardFooter.d.ts +51 -48
- package/lib/components/Card/CardFooter.js +4 -2
- package/lib/components/Card/CardHeader.d.ts +67 -49
- package/lib/components/Card/CardHeader.js +4 -2
- package/lib/components/Coachmark/utils/enums.d.ts +6 -0
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +1 -0
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +16 -3
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +5 -3
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +4 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +8 -2
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +3 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +5 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +20 -4
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +15 -7
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +9 -3
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +19 -6
- package/lib/components/DataSpreadsheet/types/index.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/DatagridBody.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +3 -2
- package/lib/components/Datagrid/Datagrid/DatagridRefBody.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +4 -5
- package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -1
- package/lib/components/Datagrid/Datagrid/DraggableElement.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -2
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +13 -8
- package/lib/components/Datagrid/Datagrid/addons/Filtering/handleCheckboxChange.js +7 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +1 -1
- package/lib/components/Datagrid/common-column-ids.d.ts +6 -0
- package/lib/components/Datagrid/types/index.d.ts +6 -0
- package/lib/components/Datagrid/useDatagrid.d.ts +6 -0
- package/lib/components/Datagrid/useDisableSelectRows.d.ts +6 -0
- package/lib/components/Datagrid/useInitialColumnSort.js +4 -0
- package/lib/components/Datagrid/useRowIsMouseOver.d.ts +6 -0
- package/lib/components/Datagrid/useSortableColumns.d.ts +5 -4
- package/lib/components/Datagrid/useSortableColumns.js +18 -13
- package/lib/components/EmptyStates/EmptyState.d.ts +72 -5
- package/lib/components/EmptyStates/EmptyState.js +8 -5
- package/lib/components/EmptyStates/EmptyStateV2.d.ts +63 -2
- package/lib/components/EmptyStates/EmptyStateV2.js +3 -2
- package/lib/components/FullPageError/FullPageError.d.ts +36 -2
- package/lib/components/FullPageError/FullPageError.js +0 -3
- package/lib/components/GetStartedCard/GetStartedCard.d.ts +60 -2
- package/lib/components/GetStartedCard/GetStartedCard.js +10 -9
- package/lib/components/PageHeader/PageHeaderUtils.js +1 -1
- package/lib/components/StringFormatter/utils/enums.js +7 -0
- package/lib/components/TagOverflow/TagOverflow.d.ts +35 -4
- package/lib/components/TagOverflow/TagOverflow.js +46 -63
- package/lib/components/TagOverflow/TagOverflowModal.js +4 -6
- package/lib/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
- package/lib/components/TagOverflow/TagOverflowPopover.js +37 -40
- package/lib/components/Tearsheet/TearsheetShell.js +4 -1
- package/lib/components/UserAvatar/UserAvatar.d.ts +59 -1
- package/lib/components/UserAvatar/UserAvatar.js +7 -23
- package/lib/global/js/utils/scrollableAncestor.js +7 -0
- package/lib/global/js/utils/uuidv4.d.ts +6 -0
- package/lib/global/js/utils/uuidv4.js +2 -0
- package/lib/global/js/utils/wait.d.ts +6 -0
- package/lib/global/js/utils/wait.js +2 -0
- package/package.json +4 -4
- package/scss/components/ConditionBuilder/_condition-builder.scss +3 -0
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +18 -2
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +48 -31
- package/scss/components/ConditionBuilder/styles/_index.scss +7 -0
- package/scss/components/CreateModal/_create-modal.scss +0 -4
- package/scss/components/Datagrid/styles/_datagrid.scss +1 -0
- package/scss/components/Datagrid/styles/_useActionsColumn.scss +6 -7
- package/scss/components/Datagrid/styles/_useColumnRightAlign.scss +6 -7
- package/scss/components/Datagrid/styles/_useExpandedRow.scss +6 -7
- package/scss/components/Datagrid/styles/_useInlineEdit.scss +6 -7
- package/scss/components/Datagrid/styles/_useNestedRows.scss +6 -7
- package/scss/components/Datagrid/styles/_useNestedTable.scss +6 -7
- package/scss/components/Datagrid/styles/_useStickyColumn.scss +6 -7
- package/scss/components/Datagrid/styles/addons/_RowSizeDropdown.scss +6 -7
- package/scss/config-dev.scss +7 -0
- package/scss/config.scss +7 -0
- package/telemetry.yml +2 -0
@@ -20,6 +20,7 @@ declare namespace ConditionBlock {
|
|
20
20
|
let onConnectorOperatorChange: PropTypes.Requireable<(...args: any[]) => any>;
|
21
21
|
let onRemove: PropTypes.Requireable<(...args: any[]) => any>;
|
22
22
|
let onStatementChange: PropTypes.Requireable<(...args: any[]) => any>;
|
23
|
+
let setShowDeletionPreviewForSubgroups: PropTypes.Requireable<(...args: any[]) => any>;
|
23
24
|
let showConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
24
25
|
let showConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
25
26
|
let state: PropTypes.Requireable<object>;
|
@@ -61,7 +61,8 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
61
61
|
showConditionSubGroupPreviewHandler = props.showConditionSubGroupPreviewHandler,
|
62
62
|
hideConditionPreviewHandler = props.hideConditionPreviewHandler,
|
63
63
|
showConditionPreviewHandler = props.showConditionPreviewHandler,
|
64
|
-
isLastCondition = props.isLastCondition
|
64
|
+
isLastCondition = props.isLastCondition,
|
65
|
+
setShowDeletionPreviewForSubgroups = props.setShowDeletionPreviewForSubgroups;
|
65
66
|
var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
|
66
67
|
inputConfig = _useContext.inputConfig,
|
67
68
|
variant = _useContext.variant,
|
@@ -102,6 +103,15 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
102
103
|
textarea: ConditionBuilderItemText.ConditionBuilderItemText
|
103
104
|
};
|
104
105
|
var ItemComponent = property ? itemComponents[type] : null;
|
106
|
+
React.useEffect(function () {
|
107
|
+
var _group$conditions, _group$conditions2;
|
108
|
+
if (showDeletionPreview && (group === null || group === void 0 || (_group$conditions = group.conditions) === null || _group$conditions === void 0 ? void 0 : _group$conditions.length) > 1 && group !== null && group !== void 0 && (_group$conditions2 = group.conditions) !== null && _group$conditions2 !== void 0 && _group$conditions2[1].conditions && group.conditions[1].id !== condition.id) {
|
109
|
+
setShowDeletionPreviewForSubgroups === null || setShowDeletionPreviewForSubgroups === void 0 || setShowDeletionPreviewForSubgroups(true);
|
110
|
+
} else {
|
111
|
+
setShowDeletionPreviewForSubgroups === null || setShowDeletionPreviewForSubgroups === void 0 || setShowDeletionPreviewForSubgroups(false);
|
112
|
+
}
|
113
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
114
|
+
}, [showDeletionPreview]);
|
105
115
|
var onStatementChangeHandler = function onStatementChangeHandler(v, evt) {
|
106
116
|
util.focusThisField(evt, conditionBuilderRef);
|
107
117
|
onStatementChange(v);
|
@@ -121,10 +131,9 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
121
131
|
popoverToOpen: util.checkIsValid(newOperator) ? 'valueField' : ''
|
122
132
|
}));
|
123
133
|
};
|
124
|
-
var onValueChangeHandler = function onValueChangeHandler(newValue
|
134
|
+
var onValueChangeHandler = function onValueChangeHandler(newValue) {
|
125
135
|
var currentCondition = _rollupPluginBabelHelpers.objectSpread2({}, condition);
|
126
136
|
delete currentCondition.popoverToOpen;
|
127
|
-
util.focusThisField(evt, conditionBuilderRef);
|
128
137
|
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, currentCondition), {}, {
|
129
138
|
value: newValue
|
130
139
|
}));
|
@@ -317,6 +326,10 @@ ConditionBlock.propTypes = {
|
|
317
326
|
* callback to handle the statement(if/ excl.if) change
|
318
327
|
*/
|
319
328
|
onStatementChange: index["default"].func,
|
329
|
+
/**
|
330
|
+
* method to set ShowDeletionPreviewForSubgroups
|
331
|
+
*/
|
332
|
+
setShowDeletionPreviewForSubgroups: index["default"].func,
|
320
333
|
/**
|
321
334
|
* handler for showing add condition preview
|
322
335
|
*/
|
@@ -96,11 +96,11 @@ var ConditionBuilderAdd = function ConditionBuilderAdd(_ref) {
|
|
96
96
|
})), enableSubGroup && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderButton.ConditionBuilderButton, _rollupPluginBabelHelpers["extends"]({
|
97
97
|
renderIcon: icons.TextNewLine,
|
98
98
|
onClick: addConditionSubGroupHandler,
|
99
|
-
className: cx__default["default"]("".concat(DataConfigs.blockClass, "__add-condition-sub-group
|
99
|
+
className: cx__default["default"]("".concat(DataConfigs.blockClass, "__add-condition-sub-group")),
|
100
100
|
hideLabel: true,
|
101
101
|
label: addSubgroupText,
|
102
102
|
wrapperProps: wrapperProps,
|
103
|
-
wrapperClassName: cx__default["default"]("".concat(DataConfigs.blockClass, "__add-condition-sub-group-wrapper"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__add-condition-sub-group-wrapper--show"), isAddSubgroup))
|
103
|
+
wrapperClassName: cx__default["default"]("".concat(DataConfigs.blockClass, "__add-condition-sub-group-wrapper ").concat(DataConfigs.blockClass, "__gap-left"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__add-condition-sub-group-wrapper--show"), isAddSubgroup))
|
104
104
|
}, previewHandlersForSubgroup())));
|
105
105
|
};
|
106
106
|
var ConditionBuilderAdd$1 = ConditionBuilderAdd;
|
@@ -42,11 +42,11 @@ var ConditionBuilderButton = function ConditionBuilderButton(_ref) {
|
|
42
42
|
wrapperClassName = _ref.wrapperClassName,
|
43
43
|
tabIndex = _ref.tabIndex,
|
44
44
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
45
|
+
var carbonPrefix = react.usePrefix();
|
45
46
|
var Button = function Button() {
|
46
47
|
var _rest$dataName;
|
47
48
|
var dataName = (_rest$dataName = rest['data-name']) !== null && _rest$dataName !== void 0 ? _rest$dataName : '';
|
48
49
|
return /*#__PURE__*/React__default["default"].createElement("button", _rollupPluginBabelHelpers["extends"]({
|
49
|
-
// role={'gridcell'}
|
50
50
|
tabIndex: tabIndex != undefined ? tabIndex : -1,
|
51
51
|
className: cx__default["default"]([className, "".concat(DataConfigs.blockClass, "__button"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__text-ellipsis"), showToolTip && !hideLabel && !isInvalid), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__invalid-input"), isInvalid)]),
|
52
52
|
type: "button",
|
@@ -61,8 +61,10 @@ var ConditionBuilderButton = function ConditionBuilderButton(_ref) {
|
|
61
61
|
return hideLabel || showToolTip ? /*#__PURE__*/React__default["default"].createElement(react.Tooltip, _rollupPluginBabelHelpers["extends"]({
|
62
62
|
label: label,
|
63
63
|
align: tooltipAlign,
|
64
|
-
className: "".concat(wrapperClassName)
|
65
|
-
}, wrapperProps
|
64
|
+
className: "".concat(wrapperClassName, " ").concat(DataConfigs.blockClass, "__tooltip ").concat(carbonPrefix, "--icon-tooltip")
|
65
|
+
}, wrapperProps, {
|
66
|
+
leaveDelayMs: 0
|
67
|
+
}), Button()) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, Button());
|
66
68
|
};
|
67
69
|
ConditionBuilderButton.propTypes = {
|
68
70
|
/**
|
@@ -18,6 +18,7 @@ var index = require('../../../node_modules/prop-types/index.js');
|
|
18
18
|
var util = require('../utils/util.js');
|
19
19
|
var ConditionBuilderProvider = require('../ConditionBuilderContext/ConditionBuilderProvider.js');
|
20
20
|
var useTranslations = require('../utils/useTranslations.js');
|
21
|
+
var ConditionBuilderButton = require('../ConditionBuilderButton/ConditionBuilderButton.js');
|
21
22
|
|
22
23
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
23
24
|
|
@@ -56,7 +57,9 @@ var ConditionConnector = function ConditionConnector(_ref) {
|
|
56
57
|
};
|
57
58
|
return variant == 'tree' ? /*#__PURE__*/React__default["default"].createElement("span", {
|
58
59
|
className: "".concat(className, " ").concat(DataConfigs.blockClass, "__connector--disabled")
|
59
|
-
},
|
60
|
+
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderButton.ConditionBuilderButton, {
|
61
|
+
label: operator
|
62
|
+
})) :
|
60
63
|
/*#__PURE__*/
|
61
64
|
// <div className={className} {...rest}>
|
62
65
|
React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, _rollupPluginBabelHelpers["extends"]({
|
@@ -30,7 +30,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
30
30
|
|
31
31
|
var _GroupConnector;
|
32
32
|
var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
33
|
-
var _rootState$
|
33
|
+
var _rootState$groups3;
|
34
34
|
var startConditionLabel = _ref.startConditionLabel,
|
35
35
|
getConditionState = _ref.getConditionState,
|
36
36
|
getActionsState = _ref.getActionsState,
|
@@ -118,6 +118,11 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
118
118
|
groups: [].concat(_rollupPluginBabelHelpers.toConsumableArray(rootState.groups), [newGroup])
|
119
119
|
}));
|
120
120
|
};
|
121
|
+
var getColorIndex = function getColorIndex() {
|
122
|
+
var _rootState$groups$len, _rootState$groups2;
|
123
|
+
var groupLength = (_rootState$groups$len = rootState === null || rootState === void 0 || (_rootState$groups2 = rootState.groups) === null || _rootState$groups2 === void 0 ? void 0 : _rootState$groups2.length) !== null && _rootState$groups$len !== void 0 ? _rootState$groups$len : 0;
|
124
|
+
return groupLength % 5;
|
125
|
+
};
|
121
126
|
if (!isConditionBuilderActive) {
|
122
127
|
return /*#__PURE__*/React__default["default"].createElement(react.Button, {
|
123
128
|
className: "".concat(DataConfigs.blockClass, "__addConditionText-button"),
|
@@ -137,7 +142,7 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
137
142
|
className: "".concat(DataConfigs.blockClass, "__content-container"),
|
138
143
|
role: "treegrid",
|
139
144
|
"aria-label": "condition builder tree"
|
140
|
-
}, rootState && (rootState === null || rootState === void 0 || (_rootState$
|
145
|
+
}, rootState && (rootState === null || rootState === void 0 || (_rootState$groups3 = rootState.groups) === null || _rootState$groups3 === void 0 ? void 0 : _rootState$groups3.map(function (eachGroup, groupIndex) {
|
141
146
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
142
147
|
key: eachGroup.id,
|
143
148
|
className: "".concat(DataConfigs.blockClass, "__group-wrapper")
|
@@ -177,6 +182,7 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
177
182
|
}
|
178
183
|
})), showConditionGroupPreview && /*#__PURE__*/React__default["default"].createElement(ConditionPreview["default"], {
|
179
184
|
previewType: "newGroup",
|
185
|
+
colorIndex: getColorIndex(),
|
180
186
|
group: {
|
181
187
|
groupOperator: rootState.operator
|
182
188
|
}
|
@@ -36,7 +36,7 @@ var translationsObject = {
|
|
36
36
|
connectorText: 'Connector',
|
37
37
|
conditionRowText: 'Condition row',
|
38
38
|
conditionRowGroupText: 'Condition row group',
|
39
|
-
removeConditionText: '
|
39
|
+
removeConditionText: 'Delete condition',
|
40
40
|
addConditionRowText: 'Add condition row',
|
41
41
|
startText: 'Start',
|
42
42
|
endText: 'End',
|
@@ -49,7 +49,10 @@ var translationsObject = {
|
|
49
49
|
invalidNumberWarnText: 'Invalid number, must be 0 or greater',
|
50
50
|
conditionBuilderText: 'Condition Builder',
|
51
51
|
actionSectionText: 'Action Section',
|
52
|
-
conditionHeadingText: 'Condition'
|
52
|
+
conditionHeadingText: 'Condition',
|
53
|
+
addPropertyText: 'Add property',
|
54
|
+
addOperatorText: 'Add operator',
|
55
|
+
addValueText: 'Add value'
|
53
56
|
};
|
54
57
|
|
55
58
|
exports.translationsObject = translationsObject;
|
@@ -44,11 +44,14 @@ var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
|
44
44
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
45
45
|
open = _useState2[0],
|
46
46
|
setOpen = _useState2[1];
|
47
|
-
var _useTranslations = useTranslations.useTranslations(['invalidText', 'addConditionText', label]),
|
48
|
-
_useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations,
|
47
|
+
var _useTranslations = useTranslations.useTranslations(['invalidText', 'addConditionText', 'addPropertyText', 'addOperatorText', 'addValueText', label]),
|
48
|
+
_useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations, 6),
|
49
49
|
invalidText = _useTranslations2[0],
|
50
50
|
addConditionText = _useTranslations2[1],
|
51
|
-
|
51
|
+
addPropertyText = _useTranslations2[2],
|
52
|
+
addOperatorText = _useTranslations2[3],
|
53
|
+
addValueText = _useTranslations2[4],
|
54
|
+
labelText = _useTranslations2[5];
|
52
55
|
var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
|
53
56
|
conditionBuilderRef = _useContext.conditionBuilderRef;
|
54
57
|
var getPropertyDetails = function getPropertyDetails() {
|
@@ -133,6 +136,19 @@ var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
|
133
136
|
manageInvalidSelection();
|
134
137
|
}
|
135
138
|
};
|
139
|
+
var getLabel = function getLabel() {
|
140
|
+
if (propertyLabel) {
|
141
|
+
return propertyLabel;
|
142
|
+
} else if (rest['data-name'] === 'propertyField') {
|
143
|
+
return addPropertyText;
|
144
|
+
} else if (rest['data-name'] === 'operatorField') {
|
145
|
+
return addOperatorText;
|
146
|
+
} else if (rest['data-name'] === 'valueField') {
|
147
|
+
return addValueText;
|
148
|
+
} else {
|
149
|
+
return addConditionText;
|
150
|
+
}
|
151
|
+
};
|
136
152
|
return /*#__PURE__*/React__default["default"].createElement(react.Popover, {
|
137
153
|
open: open,
|
138
154
|
isTabTip: true,
|
@@ -141,7 +157,7 @@ var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
|
141
157
|
ref: popoverRef,
|
142
158
|
onRequestClose: closePopover
|
143
159
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderButton.ConditionBuilderButton, _rollupPluginBabelHelpers["extends"]({
|
144
|
-
label:
|
160
|
+
label: getLabel(),
|
145
161
|
hideLabel: !label ? true : false,
|
146
162
|
onClick: togglePopover,
|
147
163
|
className: className,
|
@@ -59,6 +59,10 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
59
59
|
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
60
60
|
showConditionSubGroupPreview = _useState4[0],
|
61
61
|
setShowConditionSubGroupPreview = _useState4[1];
|
62
|
+
var _useState5 = React.useState(false),
|
63
|
+
_useState6 = _rollupPluginBabelHelpers.slicedToArray(_useState5, 2),
|
64
|
+
showDeletionPreviewForSubgroups = _useState6[0],
|
65
|
+
setShowDeletionPreviewForSubgroups = _useState6[1];
|
62
66
|
var conditionBuilderContentRef = React.useRef();
|
63
67
|
var onRemoveHandler = function onRemoveHandler(conditionId, evt, conditionIndex) {
|
64
68
|
if (group.conditions.length > 1) {
|
@@ -89,9 +93,11 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
89
93
|
groupedItems.conditions.push(item);
|
90
94
|
}
|
91
95
|
});
|
92
|
-
|
93
|
-
|
94
|
-
|
96
|
+
onRemove(evt);
|
97
|
+
// onChange({
|
98
|
+
// ...group,
|
99
|
+
// conditions: [...groupedItems.conditions, ...groupedItems.groups],
|
100
|
+
// });
|
95
101
|
} else {
|
96
102
|
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
|
97
103
|
conditions: group.conditions.filter(function (condition) {
|
@@ -164,10 +170,11 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
164
170
|
};
|
165
171
|
setTimeout(function () {
|
166
172
|
var currentRowToFocus = conditionBuilderContentRef.current.querySelector("[role=\"row\"][aria-level=\"".concat(rowIdentity.ariaLevel, "\"][aria-posinset=\"").concat(rowIdentity.ariaPosInSet, "\"]"));
|
167
|
-
util.manageTabIndexAndFocus(currentRowToFocus, conditionBuilderRef);
|
173
|
+
util.manageTabIndexAndFocus(currentRowToFocus === null || currentRowToFocus === void 0 ? void 0 : currentRowToFocus.querySelector('[data-name="closeCondition"]'), conditionBuilderRef);
|
168
174
|
}, 0);
|
169
175
|
} else if ((prevRows === null || prevRows === void 0 ? void 0 : prevRows.length) > 1) {
|
170
|
-
|
176
|
+
var _prevRows;
|
177
|
+
util.manageTabIndexAndFocus((_prevRows = prevRows[prevRows.length - 2]) === null || _prevRows === void 0 ? void 0 : _prevRows.querySelector('[data-name="closeCondition"]'), conditionBuilderRef);
|
171
178
|
}
|
172
179
|
}
|
173
180
|
};
|
@@ -288,7 +295,7 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
288
295
|
return /*#__PURE__*/React__default["default"].createElement(React.Fragment, {
|
289
296
|
key: eachCondition.id
|
290
297
|
}, eachCondition.conditions ? /*#__PURE__*/React__default["default"].createElement("div", {
|
291
|
-
className: cx__default["default"]("".concat(DataConfigs.blockClass, "__condition-block subgroup ").concat(DataConfigs.blockClass, "__gap"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__gap-bottom"), group.conditions.length < conditionIndex + 1))
|
298
|
+
className: cx__default["default"]("".concat(DataConfigs.blockClass, "__condition-block subgroup ").concat(DataConfigs.blockClass, "__gap"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__gap-bottom"), group.conditions.length < conditionIndex + 1), "".concat(DataConfigs.blockClass, "__subgroup_deletionPreview"), showDeletionPreviewForSubgroups), {})
|
292
299
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionConnector["default"], {
|
293
300
|
className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-bottom ").concat(DataConfigs.blockClass, "__groupConnector"),
|
294
301
|
operator: group.groupOperator,
|
@@ -336,7 +343,8 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
336
343
|
_showConditionPreviewHandler(conditionIndex);
|
337
344
|
},
|
338
345
|
hideConditionPreviewHandler: hideConditionPreviewHandler,
|
339
|
-
isLastCondition: isLastCondition
|
346
|
+
isLastCondition: isLastCondition,
|
347
|
+
setShowDeletionPreviewForSubgroups: setShowDeletionPreviewForSubgroups
|
340
348
|
})), conditionIndex == showConditionSubGroupPreview && (_ConditionPreview || (_ConditionPreview = /*#__PURE__*/React__default["default"].createElement(ConditionPreview["default"], {
|
341
349
|
previewType: "subGroup",
|
342
350
|
group: group
|
@@ -1,10 +1,12 @@
|
|
1
1
|
export default ConditionPreview;
|
2
|
-
declare function ConditionPreview({ previewType, group }: {
|
2
|
+
declare function ConditionPreview({ previewType, group, colorIndex }: {
|
3
3
|
previewType: any;
|
4
4
|
group: any;
|
5
|
+
colorIndex: any;
|
5
6
|
}): import("react/jsx-runtime").JSX.Element;
|
6
7
|
declare namespace ConditionPreview {
|
7
8
|
namespace propTypes {
|
9
|
+
let colorIndex: PropTypes.Requireable<number>;
|
8
10
|
let group: PropTypes.Requireable<object>;
|
9
11
|
let previewType: PropTypes.Requireable<string>;
|
10
12
|
}
|
@@ -27,7 +27,8 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
27
27
|
var ConditionPreview = function ConditionPreview(_ref) {
|
28
28
|
var _ConditionBuilderItem, _ConditionBuilderItem2, _ConditionBuilderItem3;
|
29
29
|
var previewType = _ref.previewType,
|
30
|
-
group = _ref.group
|
30
|
+
group = _ref.group,
|
31
|
+
colorIndex = _ref.colorIndex;
|
31
32
|
var _useState = React.useState(false),
|
32
33
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
33
34
|
animate = _useState2[0],
|
@@ -59,6 +60,7 @@ var ConditionPreview = function ConditionPreview(_ref) {
|
|
59
60
|
className: "".concat(DataConfigs.blockClass, "__statement-button"),
|
60
61
|
label: group.groupOperator
|
61
62
|
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
63
|
+
"data-color-index": colorIndex,
|
62
64
|
"aria-hidden": true,
|
63
65
|
className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group ").concat(DataConfigs.blockClass, "__condition-wrapper ").concat(DataConfigs.blockClass, "__group-preview ").concat(DataConfigs.blockClass, "__group-wrapper "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
|
64
66
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
@@ -67,7 +69,7 @@ var ConditionPreview = function ConditionPreview(_ref) {
|
|
67
69
|
className: "".concat(DataConfigs.blockClass, "__statement-button"),
|
68
70
|
label: ifText
|
69
71
|
})), getConditionSection())), previewType == 'subGroup' && /*#__PURE__*/React__default["default"].createElement("div", {
|
70
|
-
className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
|
72
|
+
className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview ").concat(DataConfigs.blockClass, "__gap-bottom"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
|
71
73
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
72
74
|
className: "".concat(DataConfigs.blockClass, "__condition-block ").concat(DataConfigs.blockClass, "__gap")
|
73
75
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
@@ -80,7 +82,7 @@ var ConditionPreview = function ConditionPreview(_ref) {
|
|
80
82
|
className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__groupConnector"),
|
81
83
|
operator: ifText
|
82
84
|
}), getConditionSection()))), previewType == 'condition' && /*#__PURE__*/React__default["default"].createElement("div", {
|
83
|
-
className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
|
85
|
+
className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview ").concat(DataConfigs.blockClass, "__gap-bottom"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
|
84
86
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
85
87
|
className: "".concat(DataConfigs.blockClass, "__condition-block ").concat(DataConfigs.blockClass, "__gap")
|
86
88
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
@@ -91,6 +93,10 @@ var ConditionPreview = function ConditionPreview(_ref) {
|
|
91
93
|
};
|
92
94
|
var ConditionPreview$1 = ConditionPreview;
|
93
95
|
ConditionPreview.propTypes = {
|
96
|
+
/**
|
97
|
+
* index of the color for next group
|
98
|
+
*/
|
99
|
+
colorIndex: index["default"].number,
|
94
100
|
/**
|
95
101
|
* current conditional group
|
96
102
|
*/
|
@@ -39,12 +39,18 @@ var handleKeyPressForPopover = function handleKeyPressForPopover(evt, parentCont
|
|
39
39
|
var allItems = [];
|
40
40
|
switch (key) {
|
41
41
|
case 'ArrowUp':
|
42
|
+
evt.preventDefault();
|
42
43
|
//traverse through the popover options, search box, selectAll button
|
43
44
|
parentContainer.querySelectorAll("[role=\"option\"]").forEach(function (eachElem, index, allElements) {
|
44
45
|
util.traverseReverse(eachElem, index, allElements, null, null, conditionBuilderRef);
|
45
46
|
});
|
47
|
+
//scroll to top when we reach a the top of the list to make search box visible
|
48
|
+
if (Array.from(evt.target.closest('ul').querySelectorAll('li')).indexOf(evt.target) === 1) {
|
49
|
+
parentContainer.querySelector(".".concat(DataConfigs.blockClass, "__popover-content-wrapper")).scrollTop = 0;
|
50
|
+
}
|
46
51
|
break;
|
47
52
|
case 'ArrowDown':
|
53
|
+
evt.preventDefault();
|
48
54
|
//traverse through the popover options, search box, selectAll button
|
49
55
|
parentContainer.querySelectorAll("[role=\"option\"]").forEach(function (eachElem, index, allElements) {
|
50
56
|
util.traverseClockVise(eachElem, index, allElements, null, null, conditionBuilderRef);
|
@@ -72,12 +78,19 @@ var handleKeyPressForPopover = function handleKeyPressForPopover(evt, parentCont
|
|
72
78
|
}
|
73
79
|
break;
|
74
80
|
case 'Enter':
|
75
|
-
if (isMultiSelect
|
81
|
+
if (isMultiSelect === 'true') {
|
76
82
|
if (document.activeElement.type !== 'button') {
|
77
83
|
var _document$activeEleme2;
|
84
|
+
//for button , enter key is click which already handled by framework, for other elements trigger click
|
85
|
+
(_document$activeEleme2 = document.activeElement) === null || _document$activeEleme2 === void 0 || _document$activeEleme2.click();
|
86
|
+
}
|
87
|
+
evt.preventDefault();
|
88
|
+
} else {
|
89
|
+
if (document.activeElement.type !== 'button') {
|
90
|
+
var _document$activeEleme3;
|
78
91
|
//for button , enter key is click which already handled by framework, else trigger click
|
79
92
|
util.focusThisField(evt, conditionBuilderRef);
|
80
|
-
(_document$
|
93
|
+
(_document$activeEleme3 = document.activeElement) === null || _document$activeEleme3 === void 0 || _document$activeEleme3.click();
|
81
94
|
}
|
82
95
|
}
|
83
96
|
break;
|
@@ -88,7 +101,7 @@ var handleKeyPressForPopover = function handleKeyPressForPopover(evt, parentCont
|
|
88
101
|
}
|
89
102
|
};
|
90
103
|
var handleKeyPressForMainContent = function handleKeyPressForMainContent(evt, conditionBuilderRef, variant) {
|
91
|
-
var _document$
|
104
|
+
var _document$activeEleme4;
|
92
105
|
switch (evt.key) {
|
93
106
|
case 'ArrowRight':
|
94
107
|
evt.preventDefault();
|
@@ -148,9 +161,9 @@ var handleKeyPressForMainContent = function handleKeyPressForMainContent(evt, co
|
|
148
161
|
}
|
149
162
|
break;
|
150
163
|
case 'Enter':
|
151
|
-
if (((_document$
|
152
|
-
var _document$
|
153
|
-
(_document$
|
164
|
+
if (((_document$activeEleme4 = document.activeElement) === null || _document$activeEleme4 === void 0 || (_document$activeEleme4 = _document$activeEleme4.querySelectorAll("button")) === null || _document$activeEleme4 === void 0 ? void 0 : _document$activeEleme4.length) === 1) {
|
165
|
+
var _document$activeEleme5;
|
166
|
+
(_document$activeEleme5 = document.activeElement) === null || _document$activeEleme5 === void 0 || (_document$activeEleme5 = _document$activeEleme5.querySelectorAll("button")[0]) === null || _document$activeEleme5 === void 0 || _document$activeEleme5.click();
|
154
167
|
}
|
155
168
|
break;
|
156
169
|
}
|
@@ -1,3 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 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
|
+
*/
|
1
7
|
export type Size = 'xs' | 'sm' | 'md' | 'lg';
|
2
8
|
export type Theme = 'light' | 'dark';
|
3
9
|
export interface SpreadsheetColumn {
|
@@ -1,3 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 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
|
+
*/
|
1
7
|
import { DataGridState } from '../types';
|
2
8
|
declare const DatagridBody: (datagridState: DataGridState) => import("react/jsx-runtime").JSX.Element;
|
3
9
|
export default DatagridBody;
|
@@ -49,7 +49,8 @@ var DatagridContent = function DatagridContent(_ref) {
|
|
49
49
|
var _useContext2 = React.useContext(FilterProvider.FilterContext),
|
50
50
|
filterTags = _useContext2.filterTags,
|
51
51
|
EventEmitter = _useContext2.EventEmitter,
|
52
|
-
panelOpen = _useContext2.panelOpen
|
52
|
+
panelOpen = _useContext2.panelOpen,
|
53
|
+
contextTableId = _useContext2.tableId;
|
53
54
|
var activeCellId = inlineEditState.activeCellId,
|
54
55
|
gridActive = inlineEditState.gridActive,
|
55
56
|
editId = inlineEditState.editId,
|
@@ -160,7 +161,7 @@ var DatagridContent = function DatagridContent(_ref) {
|
|
160
161
|
}
|
161
162
|
}, [withInlineEdit, tableId, totalColumnsWidth, datagridState, gridActive]);
|
162
163
|
useSubscribeToEventEmitter["default"](constants.CLEAR_SINGLE_FILTER, function (id) {
|
163
|
-
return FilterProvider.clearSingleFilter(id, setAllFilters, state);
|
164
|
+
return FilterProvider.clearSingleFilter(id, setAllFilters, state, contextTableId);
|
164
165
|
});
|
165
166
|
var renderFilterSummary = function renderFilterSummary() {
|
166
167
|
return state.filters.length > 0 && /*#__PURE__*/React__default["default"].createElement(FilterSummary["default"], {
|
@@ -1,3 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 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
|
+
*/
|
1
7
|
import { DataGridState } from '../types';
|
2
8
|
declare const DatagridRefBody: (datagridState: DataGridState) => import("react/jsx-runtime").JSX.Element;
|
3
9
|
export default DatagridRefBody;
|
@@ -58,7 +58,7 @@ var SelectAll = function SelectAll(datagridState) {
|
|
58
58
|
onAllRowSelect = datagridState.onAllRowSelect;
|
59
59
|
var isFirstColumnStickyLeft = ((_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.sticky) === 'left' && withStickyColumn;
|
60
60
|
if (hideSelectAll || radio) {
|
61
|
-
return /*#__PURE__*/React__default["default"].createElement("
|
61
|
+
return /*#__PURE__*/React__default["default"].createElement("th", {
|
62
62
|
className: cx__default["default"]("".concat(blockClass, "__head-hidden-select-all"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__select-all-sticky-left"), /* istanbul ignore next */
|
63
63
|
isFirstColumnStickyLeft && Number(windowSize) > 671))
|
64
64
|
});
|
@@ -95,15 +95,14 @@ var SelectAll = function SelectAll(datagridState) {
|
|
95
95
|
onAllRowSelect === null || onAllRowSelect === void 0 || onAllRowSelect(rows, event);
|
96
96
|
return onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
97
97
|
};
|
98
|
-
return /*#__PURE__*/React__default["default"].createElement("
|
98
|
+
return /*#__PURE__*/React__default["default"].createElement(react.TableSelectAll, _rollupPluginBabelHelpers["extends"]({}, selectProps, {
|
99
99
|
className: cx__default["default"]("".concat(blockClass, "__head-select-all"), "".concat(blockClass, "__checkbox-cell"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__checkbox-cell-sticky-left"), /* istanbul ignore next */
|
100
|
-
isFirstColumnStickyLeft && Number(windowSize) > 671))
|
101
|
-
}, /*#__PURE__*/React__default["default"].createElement(react.TableSelectAll, _rollupPluginBabelHelpers["extends"]({}, selectProps, {
|
100
|
+
isFirstColumnStickyLeft && Number(windowSize) > 671)),
|
102
101
|
name: "".concat(tableId, "-select-all-checkbox-name"),
|
103
102
|
onSelect: handleSelectAllChange,
|
104
103
|
disabled: isFetching || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled),
|
105
104
|
id: "".concat(tableId, "-select-all-checkbox-id")
|
106
|
-
}))
|
105
|
+
}));
|
107
106
|
};
|
108
107
|
|
109
108
|
exports.SelectAll = SelectAll;
|
@@ -1,3 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 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
|
+
*/
|
1
7
|
import { DataGridState } from '../types';
|
2
8
|
declare const DatagridSimpleBody: (datagridState: DataGridState) => import("react/jsx-runtime").JSX.Element;
|
3
9
|
export default DatagridSimpleBody;
|
@@ -52,7 +52,9 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
|
|
52
52
|
/* istanbul ignore next */
|
53
53
|
var handleVirtualGridResize = function handleVirtualGridResize() {
|
54
54
|
var gridRefElement = gridRef === null || gridRef === void 0 ? void 0 : gridRef.current;
|
55
|
-
if
|
55
|
+
// isHidden checks for an edge case where if the table is hidden by something like a Tab that the width can't be calculated to 0
|
56
|
+
var isHidden = (gridRefElement === null || gridRefElement === void 0 ? void 0 : gridRefElement.offsetParent) === null;
|
57
|
+
if (gridRefElement && !isHidden) {
|
56
58
|
var _gridRefElement$clien;
|
57
59
|
gridRefElement.style.width = gridRefElement === null || gridRefElement === void 0 || (_gridRefElement$clien = gridRefElement.clientWidth) === null || _gridRefElement$clien === void 0 ? void 0 : _gridRefElement$clien.toString();
|
58
60
|
}
|
@@ -1,3 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 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
|
+
*/
|
1
7
|
import { PropsWithChildren, ReactNode } from 'react';
|
2
8
|
import PropTypes from 'prop-types';
|
3
9
|
interface DraggableElementProps extends PropsWithChildren {
|
@@ -194,7 +194,7 @@ var FilterPanel = function FilterPanel(_ref) {
|
|
194
194
|
}, [filterPanelMinHeight]);
|
195
195
|
|
196
196
|
// tableId is passed in from the event emitter from the FilterSummary component
|
197
|
-
// in
|
197
|
+
// in DatagridContent
|
198
198
|
useSubscribeToEventEmitter["default"](constants.CLEAR_FILTERS, function (tableId) {
|
199
199
|
reset(tableId);
|
200
200
|
});
|
@@ -1,8 +1,9 @@
|
|
1
1
|
export const FilterContext: React.Context<any>;
|
2
|
-
export function clearSingleFilter({ key, value }: {
|
2
|
+
export function clearSingleFilter({ key, value, tableId }: {
|
3
3
|
key: any;
|
4
4
|
value: any;
|
5
|
-
|
5
|
+
tableId: any;
|
6
|
+
}, setAllFilters: any, state: any, contextTableId: any): void;
|
6
7
|
export function FilterProvider({ children, filters, filterProps, tableId }: {
|
7
8
|
children: any;
|
8
9
|
filters: any;
|