@carbon/ibm-products 2.37.0 → 2.38.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-without-carbon-released-only.css +218 -0
- 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.css +218 -0
- 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/ActionSet/ActionSet.js +3 -2
- package/es/components/Checklist/Checklist.js +10 -10
- package/es/components/Checklist/ChecklistChart.d.ts +1 -1
- package/es/components/Checklist/ChecklistChart.js +6 -30
- package/es/components/Coachmark/Coachmark.d.ts +65 -2
- package/es/components/Coachmark/Coachmark.js +7 -10
- package/es/components/Coachmark/CoachmarkDragbar.d.ts +40 -2
- package/es/components/Coachmark/CoachmarkDragbar.js +3 -1
- package/es/components/Coachmark/CoachmarkHeader.d.ts +27 -2
- package/es/components/Coachmark/CoachmarkHeader.js +0 -1
- package/es/components/Coachmark/CoachmarkOverlay.d.ts +42 -2
- package/es/components/Coachmark/CoachmarkOverlay.js +18 -15
- package/es/components/Coachmark/CoachmarkTagline.d.ts +27 -2
- package/es/components/Coachmark/CoachmarkTagline.js +0 -1
- package/es/components/Coachmark/utils/enums.d.ts +20 -20
- package/es/components/Coachmark/utils/enums.js +22 -20
- package/es/components/CoachmarkFixed/CoachmarkFixed.d.ts +42 -2
- package/es/components/CoachmarkFixed/CoachmarkFixed.js +4 -2
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +2 -1
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +25 -23
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +14 -24
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +2 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +4 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +3 -3
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +11 -11
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +5 -3
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +54 -44
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +14 -8
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +5 -2
- package/es/components/DataSpreadsheet/hooks/useMoveActiveCell.js +2 -1
- package/es/components/Datagrid/Datagrid/DatagridContent.d.ts +1 -0
- package/es/components/Datagrid/Datagrid/DatagridContent.js +1 -0
- package/es/components/Datagrid/useSkeletonRows.d.ts +1 -1
- package/es/components/Datagrid/useSkeletonRows.js +11 -3
- package/es/components/EditTearsheetNarrow/EditTearsheetNarrow.d.ts +19 -2
- package/es/components/SearchBar/SearchBar.d.ts +10 -1
- package/es/components/SearchBar/SearchBar.js +26 -20
- package/es/components/TagSet/TagSet.d.ts +87 -3
- package/es/components/TagSet/TagSet.js +20 -9
- package/es/components/TagSet/TagSetModal.d.ts +32 -26
- package/es/components/TagSet/TagSetModal.js +5 -5
- package/es/components/TagSet/TagSetOverflow.d.ts +45 -2
- package/es/components/TagSet/TagSetOverflow.js +14 -12
- package/es/components/WebTerminal/WebTerminal.js +2 -2
- package/es/components/WebTerminal/WebTerminalContentWrapper.d.ts +15 -2
- package/es/components/WebTerminal/hooks/index.d.ts +16 -11
- package/es/components/WebTerminal/hooks/index.js +1 -1
- package/es/global/js/package-settings.d.ts +1 -1
- package/es/global/js/package-settings.js +1 -1
- package/es/node_modules/@carbon/colors/es/index.js +4 -1
- package/es/settings.d.ts +1 -1
- package/lib/components/ActionSet/ActionSet.js +2 -1
- package/lib/components/Checklist/Checklist.js +10 -10
- package/lib/components/Checklist/ChecklistChart.d.ts +1 -1
- package/lib/components/Checklist/ChecklistChart.js +6 -30
- package/lib/components/Coachmark/Coachmark.d.ts +65 -2
- package/lib/components/Coachmark/Coachmark.js +6 -9
- package/lib/components/Coachmark/CoachmarkDragbar.d.ts +40 -2
- package/lib/components/Coachmark/CoachmarkDragbar.js +3 -1
- package/lib/components/Coachmark/CoachmarkHeader.d.ts +27 -2
- package/lib/components/Coachmark/CoachmarkHeader.js +0 -1
- package/lib/components/Coachmark/CoachmarkOverlay.d.ts +42 -2
- package/lib/components/Coachmark/CoachmarkOverlay.js +18 -15
- package/lib/components/Coachmark/CoachmarkTagline.d.ts +27 -2
- package/lib/components/Coachmark/CoachmarkTagline.js +0 -1
- package/lib/components/Coachmark/utils/enums.d.ts +20 -20
- package/lib/components/Coachmark/utils/enums.js +22 -20
- package/lib/components/CoachmarkFixed/CoachmarkFixed.d.ts +42 -2
- package/lib/components/CoachmarkFixed/CoachmarkFixed.js +4 -2
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +2 -1
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +25 -23
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +13 -23
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +2 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +4 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +3 -3
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +11 -11
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +5 -3
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +54 -44
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +13 -7
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +5 -2
- package/lib/components/DataSpreadsheet/hooks/useMoveActiveCell.js +2 -1
- package/lib/components/Datagrid/Datagrid/DatagridContent.d.ts +1 -0
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +1 -0
- package/lib/components/Datagrid/useSkeletonRows.d.ts +1 -1
- package/lib/components/Datagrid/useSkeletonRows.js +11 -3
- package/lib/components/EditTearsheetNarrow/EditTearsheetNarrow.d.ts +19 -2
- package/lib/components/SearchBar/SearchBar.d.ts +10 -1
- package/lib/components/SearchBar/SearchBar.js +26 -18
- package/lib/components/TagSet/TagSet.d.ts +87 -3
- package/lib/components/TagSet/TagSet.js +20 -9
- package/lib/components/TagSet/TagSetModal.d.ts +32 -26
- package/lib/components/TagSet/TagSetModal.js +3 -3
- package/lib/components/TagSet/TagSetOverflow.d.ts +45 -2
- package/lib/components/TagSet/TagSetOverflow.js +14 -12
- package/lib/components/WebTerminal/WebTerminal.js +2 -2
- package/lib/components/WebTerminal/WebTerminalContentWrapper.d.ts +15 -2
- package/lib/components/WebTerminal/hooks/index.d.ts +16 -11
- package/lib/components/WebTerminal/hooks/index.js +1 -1
- package/lib/global/js/package-settings.d.ts +1 -1
- package/lib/global/js/package-settings.js +1 -1
- package/lib/node_modules/@carbon/colors/es/index.js +6 -0
- package/lib/settings.d.ts +1 -1
- package/package.json +5 -3
- package/scss/components/Checklist/_carbon-imports.scss +2 -2
- package/scss/components/_index-released-only-with-carbon.scss +2 -1
- package/scss/components/_index-released-only.scss +2 -1
- package/scss/components/_index-with-carbon.scss +1 -0
- package/telemetry.yml +936 -683
@@ -1,4 +1,4 @@
|
|
1
|
-
export function ConditionBuilderItem({ children, className, label, renderIcon, title, type, showToolTip,
|
1
|
+
export function ConditionBuilderItem({ children, className, label, renderIcon, title, type, showToolTip, condition, popOverClassName, config, ...rest }: {
|
2
2
|
[x: string]: any;
|
3
3
|
children: any;
|
4
4
|
className: any;
|
@@ -7,7 +7,7 @@ export function ConditionBuilderItem({ children, className, label, renderIcon, t
|
|
7
7
|
title: any;
|
8
8
|
type: any;
|
9
9
|
showToolTip: any;
|
10
|
-
|
10
|
+
condition: any;
|
11
11
|
popOverClassName: any;
|
12
12
|
config: any;
|
13
13
|
}): import("react/jsx-runtime").JSX.Element;
|
@@ -15,12 +15,12 @@ export namespace ConditionBuilderItem {
|
|
15
15
|
namespace propTypes {
|
16
16
|
let children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
17
17
|
let className: PropTypes.Requireable<string>;
|
18
|
+
let condition: PropTypes.Requireable<object>;
|
18
19
|
let config: PropTypes.Requireable<object>;
|
19
20
|
let label: PropTypes.Requireable<NonNullable<string | any[] | null | undefined>>;
|
20
21
|
let popOverClassName: PropTypes.Requireable<string>;
|
21
22
|
let renderIcon: PropTypes.Requireable<object>;
|
22
23
|
let showToolTip: PropTypes.Requireable<boolean>;
|
23
|
-
let state: PropTypes.Requireable<object>;
|
24
24
|
let title: PropTypes.Requireable<string>;
|
25
25
|
let type: PropTypes.Requireable<string>;
|
26
26
|
}
|
@@ -21,7 +21,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
21
21
|
|
22
22
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
23
23
|
|
24
|
-
var _excluded = ["children", "className", "label", "renderIcon", "title", "type", "showToolTip", "
|
24
|
+
var _excluded = ["children", "className", "label", "renderIcon", "title", "type", "showToolTip", "condition", "popOverClassName", "config"];
|
25
25
|
var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
26
26
|
var children = _ref.children,
|
27
27
|
className = _ref.className,
|
@@ -30,7 +30,7 @@ var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
|
30
30
|
title = _ref.title,
|
31
31
|
type = _ref.type,
|
32
32
|
showToolTip = _ref.showToolTip,
|
33
|
-
|
33
|
+
condition = _ref.condition,
|
34
34
|
popOverClassName = _ref.popOverClassName,
|
35
35
|
config = _ref.config,
|
36
36
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
@@ -53,17 +53,17 @@ var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
|
53
53
|
* rest['data-name'] holds the current field name
|
54
54
|
* popoverToOpen hold the next popover to be opened if required
|
55
55
|
*/
|
56
|
-
if (
|
56
|
+
if (condition) {
|
57
57
|
var currentField = rest['data-name'];
|
58
58
|
//if any condition is changed, state prop is triggered
|
59
|
-
if (
|
59
|
+
if (condition.popoverToOpen && currentField !== condition.popoverToOpen) {
|
60
60
|
// close the previous popover
|
61
61
|
setOpen(false);
|
62
|
-
} else if (currentField == 'valueField' && type == 'option' &&
|
62
|
+
} else if (currentField == 'valueField' && type == 'option' && condition.operator !== 'one-of') {
|
63
63
|
//close the current popover if the field is valueField and is a single select dropdown. For all other inputs ,popover need to be open on value changes.
|
64
64
|
setOpen(false);
|
65
65
|
}
|
66
|
-
if (
|
66
|
+
if (condition.popoverToOpen == currentField) {
|
67
67
|
//current popover need to be opened
|
68
68
|
setOpen(true);
|
69
69
|
}
|
@@ -73,7 +73,7 @@ var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
|
73
73
|
setOpen(false);
|
74
74
|
}
|
75
75
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
76
|
-
}, [
|
76
|
+
}, [condition, label]);
|
77
77
|
React.useEffect(function () {
|
78
78
|
//this will focus the first input field in the popover
|
79
79
|
if (open && contentRef.current) {
|
@@ -121,6 +121,10 @@ ConditionBuilderItem.propTypes = {
|
|
121
121
|
* Provide an optional class to be applied to the containing node.
|
122
122
|
*/
|
123
123
|
className: index["default"].string,
|
124
|
+
/**
|
125
|
+
* current condition state object
|
126
|
+
*/
|
127
|
+
condition: index["default"].object,
|
124
128
|
/**
|
125
129
|
* this is the config object again the current property from inputConfig
|
126
130
|
*/
|
@@ -142,10 +146,6 @@ ConditionBuilderItem.propTypes = {
|
|
142
146
|
* show tool tip
|
143
147
|
*/
|
144
148
|
showToolTip: index["default"].bool,
|
145
|
-
/**
|
146
|
-
* current condition state object
|
147
|
-
*/
|
148
|
-
state: index["default"].object,
|
149
149
|
/**
|
150
150
|
* title of the popover
|
151
151
|
*/
|
@@ -5,20 +5,22 @@ export default ConditionGroupBuilder;
|
|
5
5
|
* All the inner components of group are called from here.
|
6
6
|
* @returns
|
7
7
|
*/
|
8
|
-
declare function ConditionGroupBuilder({
|
9
|
-
|
8
|
+
declare function ConditionGroupBuilder({ group, aria, onRemove, onChange, conditionBuilderRef, className, }: {
|
9
|
+
group: any;
|
10
10
|
aria: any;
|
11
11
|
onRemove: any;
|
12
12
|
onChange: any;
|
13
13
|
conditionBuilderRef: any;
|
14
|
+
className: any;
|
14
15
|
}): import("react/jsx-runtime").JSX.Element;
|
15
16
|
declare namespace ConditionGroupBuilder {
|
16
17
|
namespace propTypes {
|
17
18
|
let aria: PropTypes.Requireable<object>;
|
19
|
+
let className: PropTypes.Requireable<string>;
|
18
20
|
let conditionBuilderRef: PropTypes.Requireable<object>;
|
21
|
+
let group: PropTypes.Requireable<object>;
|
19
22
|
let onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
20
23
|
let onRemove: PropTypes.Requireable<(...args: any[]) => any>;
|
21
|
-
let state: PropTypes.Requireable<object>;
|
22
24
|
}
|
23
25
|
}
|
24
26
|
import PropTypes from 'prop-types';
|
@@ -14,6 +14,7 @@ var React = require('react');
|
|
14
14
|
var ConditionBlock = require('../ConditionBlock/ConditionBlock.js');
|
15
15
|
var index = require('../../../node_modules/prop-types/index.js');
|
16
16
|
var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
|
17
|
+
var uuidv4 = require('../../../global/js/utils/uuidv4.js');
|
17
18
|
|
18
19
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
19
20
|
|
@@ -26,17 +27,18 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
26
27
|
* @returns
|
27
28
|
*/
|
28
29
|
var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
29
|
-
var
|
30
|
-
var
|
30
|
+
var _group$conditions;
|
31
|
+
var group = _ref.group,
|
31
32
|
aria = _ref.aria,
|
32
33
|
onRemove = _ref.onRemove,
|
33
34
|
onChange = _ref.onChange,
|
34
|
-
conditionBuilderRef = _ref.conditionBuilderRef
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
conditionBuilderRef = _ref.conditionBuilderRef,
|
36
|
+
className = _ref.className;
|
37
|
+
var onRemoveHandler = function onRemoveHandler(conditionId, e) {
|
38
|
+
if (group.conditions.length > 1) {
|
39
|
+
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
|
40
|
+
conditions: group.conditions.filter(function (condition) {
|
41
|
+
return conditionId !== condition.id;
|
40
42
|
})
|
41
43
|
}));
|
42
44
|
handleFocusOnClose(e);
|
@@ -44,23 +46,27 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
44
46
|
onRemove();
|
45
47
|
}
|
46
48
|
};
|
47
|
-
var onChangeHandler = function onChangeHandler(
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
})
|
49
|
+
var onChangeHandler = function onChangeHandler(updatedCondition, conditionIndex) {
|
50
|
+
var updatedConditions = [].concat(_rollupPluginBabelHelpers.toConsumableArray(group.conditions.slice(0, conditionIndex)), [updatedCondition], _rollupPluginBabelHelpers.toConsumableArray(group.conditions.slice(conditionIndex + 1)));
|
51
|
+
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
|
52
|
+
conditions: updatedConditions
|
52
53
|
}));
|
53
54
|
};
|
54
55
|
var addConditionHandler = function addConditionHandler(conditionIndex) {
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
56
|
+
var newCondition = {
|
57
|
+
property: undefined,
|
58
|
+
operator: '',
|
59
|
+
value: '',
|
60
|
+
popoverToOpen: 'propertyField',
|
61
|
+
id: uuidv4["default"]()
|
62
|
+
};
|
63
|
+
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
|
64
|
+
conditions: [].concat(_rollupPluginBabelHelpers.toConsumableArray(group.conditions.slice(0, conditionIndex + 1)), [newCondition], _rollupPluginBabelHelpers.toConsumableArray(group.conditions.slice(conditionIndex + 1)))
|
62
65
|
}));
|
63
66
|
};
|
67
|
+
var isLastCondition = function isLastCondition(conditionIndex, conditionArr) {
|
68
|
+
return conditionIndex + 1 >= conditionArr.length || conditionArr.length - 1 != conditionIndex && conditionArr[conditionIndex + 1].conditions;
|
69
|
+
};
|
64
70
|
var handleFocusOnClose = function handleFocusOnClose(e) {
|
65
71
|
var _e$currentTarget;
|
66
72
|
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"]');
|
@@ -69,40 +75,39 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
69
75
|
}
|
70
76
|
};
|
71
77
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
72
|
-
className: "
|
78
|
+
className: "".concat(className, " eachGroup")
|
73
79
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
74
80
|
className: "".concat(DataConfigs.blockClass, "__condition-wrapper"),
|
75
81
|
role: "grid",
|
76
82
|
"aria-label": DataConfigs.translateWithId('condition_builder_group')
|
77
|
-
},
|
83
|
+
}, group === null || group === void 0 || (_group$conditions = group.conditions) === null || _group$conditions === void 0 ? void 0 : _group$conditions.map(function (eachCondition, conditionIndex) {
|
78
84
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
79
|
-
key:
|
85
|
+
key: eachCondition.id
|
80
86
|
}, eachCondition.conditions && /*#__PURE__*/React__default["default"].createElement(ConditionGroupBuilder, {
|
87
|
+
className: "".concat(DataConfigs.blockClass, "__condition-builder__group"),
|
81
88
|
aria: {
|
82
89
|
level: aria.level + 1,
|
83
90
|
posinset: conditionIndex + 1,
|
84
|
-
setsize:
|
91
|
+
setsize: group.conditions.length
|
85
92
|
},
|
86
|
-
|
87
|
-
onChange: function onChange(
|
88
|
-
onChangeHandler(
|
93
|
+
group: eachCondition,
|
94
|
+
onChange: function onChange(updatedCondition) {
|
95
|
+
onChangeHandler(updatedCondition, conditionIndex);
|
89
96
|
},
|
90
97
|
onRemove: function onRemove(e) {
|
91
|
-
onRemoveHandler(
|
98
|
+
onRemoveHandler(eachCondition.id, e);
|
92
99
|
},
|
93
|
-
conditionBuilderRef: conditionBuilderRef
|
94
|
-
key: conditionIndex
|
100
|
+
conditionBuilderRef: conditionBuilderRef
|
95
101
|
}), !eachCondition.conditions && /*#__PURE__*/React__default["default"].createElement(ConditionBlock["default"], {
|
96
|
-
|
97
|
-
conjunction: conditionIndex > 0 ? state.groupOperator : undefined,
|
102
|
+
conjunction: conditionIndex > 0 ? group.groupOperator : undefined,
|
98
103
|
aria: {
|
99
104
|
level: aria.level + 1,
|
100
105
|
posinset: conditionIndex + 1,
|
101
|
-
setsize:
|
106
|
+
setsize: group.conditions.length
|
102
107
|
},
|
103
108
|
isStatement: conditionIndex == 0,
|
104
|
-
|
105
|
-
group:
|
109
|
+
condition: eachCondition,
|
110
|
+
group: group,
|
106
111
|
conditionIndex: conditionIndex,
|
107
112
|
className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-bottom"),
|
108
113
|
onChange: function onChange(updatedConditions) {
|
@@ -110,18 +115,19 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
110
115
|
},
|
111
116
|
addConditionHandler: addConditionHandler,
|
112
117
|
onRemove: function onRemove(e) {
|
113
|
-
onRemoveHandler(
|
118
|
+
onRemoveHandler(eachCondition.id, e);
|
114
119
|
},
|
115
120
|
onConnectorOperatorChange: function onConnectorOperatorChange(op) {
|
116
|
-
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({},
|
121
|
+
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
|
117
122
|
groupOperator: op
|
118
123
|
}));
|
119
124
|
},
|
120
125
|
onStatementChange: function onStatementChange(updatedStatement) {
|
121
|
-
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({},
|
126
|
+
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
|
122
127
|
statement: updatedStatement
|
123
128
|
}));
|
124
|
-
}
|
129
|
+
},
|
130
|
+
isLastCondition: isLastCondition
|
125
131
|
}));
|
126
132
|
})));
|
127
133
|
};
|
@@ -131,10 +137,18 @@ ConditionGroupBuilder.propTypes = {
|
|
131
137
|
* object contains the aria attributes
|
132
138
|
*/
|
133
139
|
aria: index["default"].object,
|
140
|
+
/**
|
141
|
+
* Provide an class to be applied to the containing node.
|
142
|
+
*/
|
143
|
+
className: index["default"].string,
|
134
144
|
/**
|
135
145
|
* ref of condition builder
|
136
146
|
*/
|
137
147
|
conditionBuilderRef: index["default"].object,
|
148
|
+
/**
|
149
|
+
* group defines the current group
|
150
|
+
*/
|
151
|
+
group: index["default"].object,
|
138
152
|
/**
|
139
153
|
|
140
154
|
* callback to update the current condition of the state tree
|
@@ -143,11 +157,7 @@ ConditionGroupBuilder.propTypes = {
|
|
143
157
|
/**
|
144
158
|
* call back to remove the particular group from the state tree
|
145
159
|
*/
|
146
|
-
onRemove: index["default"].func
|
147
|
-
/**
|
148
|
-
* state defines the current group
|
149
|
-
*/
|
150
|
-
state: index["default"].object
|
160
|
+
onRemove: index["default"].func
|
151
161
|
};
|
152
162
|
|
153
163
|
exports["default"] = ConditionGroupBuilder$1;
|
@@ -23,6 +23,7 @@ var checkActiveHeaderCell = require('./utils/checkActiveHeaderCell.js');
|
|
23
23
|
var checkSelectedHeaderCell = require('./utils/checkSelectedHeaderCell.js');
|
24
24
|
var getSpreadsheetWidth = require('./utils/getSpreadsheetWidth.js');
|
25
25
|
var commonEventHandlers = require('./utils/commonEventHandlers.js');
|
26
|
+
var propsHelper = require('../../global/js/utils/props-helper.js');
|
26
27
|
var usePreviousValue = require('../../global/js/hooks/usePreviousValue.js');
|
27
28
|
var useSpreadsheetMouseUp = require('./hooks/useSpreadsheetMouseUp.js');
|
28
29
|
|
@@ -204,10 +205,6 @@ var DataSpreadsheetBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
204
205
|
}
|
205
206
|
}
|
206
207
|
}, [defaultColumn, ref, activeCellCoordinates, previousState === null || previousState === void 0 ? void 0 : previousState.rowHeight, selectionAreas, setActiveCellInsideSelectionArea, setSelectionAreas, visibleColumns]);
|
207
|
-
//selectionAreas will be set when ever a selection area is made.
|
208
|
-
React.useEffect(function () {
|
209
|
-
removeDuplicateSelections();
|
210
|
-
}, [selectionAreas, removeDuplicateSelections]);
|
211
208
|
|
212
209
|
//this method will check for any duplicate selection area and remove.
|
213
210
|
//same selections are those have the same height, width, top, left styles. These inline styles are being set in createCellSelection util.
|
@@ -246,6 +243,11 @@ var DataSpreadsheetBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
246
243
|
}
|
247
244
|
}, [ref, setSelectionAreas, setSelectionAreaData]);
|
248
245
|
|
246
|
+
//selectionAreas will be set when ever a selection area is made.
|
247
|
+
React.useEffect(function () {
|
248
|
+
removeDuplicateSelections();
|
249
|
+
}, [selectionAreas, removeDuplicateSelections]);
|
250
|
+
|
249
251
|
// onClick fn for each cell in the data spreadsheet body,
|
250
252
|
// adds the active cell highlight
|
251
253
|
|
@@ -308,9 +310,12 @@ var DataSpreadsheetBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
308
310
|
var row = rows[index];
|
309
311
|
if (rows && rows.length) {
|
310
312
|
prepareRow(row);
|
311
|
-
|
313
|
+
var rowProps = propsHelper.prepareProps(row.getRowProps({
|
312
314
|
style: style
|
313
|
-
}),
|
315
|
+
}), 'key');
|
316
|
+
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
317
|
+
key: _rollupPluginBabelHelpers.objectSpread2({}, row.getRowProps().key)
|
318
|
+
}, rowProps, {
|
314
319
|
className: cx__default["default"]("".concat(blockClass, "__tr")),
|
315
320
|
"data-row-index": index,
|
316
321
|
"aria-rowindex": index + 1,
|
@@ -331,10 +336,11 @@ var DataSpreadsheetBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
331
336
|
}
|
332
337
|
}, index + 1)), row.cells.map(function (cell, index) {
|
333
338
|
var _cell$column;
|
339
|
+
var cellProps = propsHelper.prepareProps(cell.getCellProps(), 'key');
|
334
340
|
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
335
341
|
key: "cell_".concat(index),
|
336
342
|
"aria-colindex": index + 1
|
337
|
-
},
|
343
|
+
}, cellProps, {
|
338
344
|
role: "gridcell",
|
339
345
|
style: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, cell.getCellProps().style), {}, {
|
340
346
|
display: 'grid',
|
@@ -21,6 +21,7 @@ var handleHeaderCellSelection = require('./utils/handleHeaderCellSelection.js');
|
|
21
21
|
var selectAllCells = require('./utils/selectAllCells.js');
|
22
22
|
var getSpreadsheetWidth = require('./utils/getSpreadsheetWidth.js');
|
23
23
|
var checkForHoldingKey = require('./utils/checkForHoldingKey.js');
|
24
|
+
var propsHelper = require('../../global/js/utils/props-helper.js');
|
24
25
|
var usePreviousValue = require('../../global/js/hooks/usePreviousValue.js');
|
25
26
|
var useSpreadsheetMouseMove = require('./hooks/useSpreadsheetMouseMove.js');
|
26
27
|
|
@@ -143,9 +144,10 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
143
144
|
className: cx__default["default"]("".concat(blockClass, "__header--container")),
|
144
145
|
role: "rowgroup"
|
145
146
|
}, headerGroups.map(function (headerGroup, index) {
|
147
|
+
var headerProps = propsHelper.prepareProps(headerGroup.getHeaderGroupProps(), 'key');
|
146
148
|
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
147
149
|
key: "header_".concat(index)
|
148
|
-
},
|
150
|
+
}, headerProps, {
|
149
151
|
style: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, headerGroup.getHeaderGroupProps().style), {}, {
|
150
152
|
width: getSpreadsheetWidth.getSpreadsheetWidth({
|
151
153
|
type: 'header',
|
@@ -175,12 +177,13 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
175
177
|
onClick: handleSelectAllClick,
|
176
178
|
className: cx__default["default"]("".concat(blockClass, "__th"), "".concat(blockClass, "--interactive-cell-element"), "".concat(blockClass, "__th--select-all"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__th--active-header"), (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header' && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header'))
|
177
179
|
}, "\xA0")), headerGroup.headers.map(function (column, index) {
|
180
|
+
var colProps = propsHelper.prepareProps(column.getHeaderProps(), 'key');
|
178
181
|
var selectedHeader = checkSelectedHeaderCell.checkSelectedHeaderCell(index, selectionAreas, 'column', rows);
|
179
182
|
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
180
183
|
key: "column_".concat(index),
|
181
184
|
role: "columnheader",
|
182
185
|
className: "".concat(blockClass, "__columnheader")
|
183
|
-
},
|
186
|
+
}, colProps), /*#__PURE__*/React__default["default"].createElement("button", {
|
184
187
|
id: "".concat(blockClass, "__cell--header--").concat(index),
|
185
188
|
"data-row-index": "header",
|
186
189
|
"data-column-index": index,
|
@@ -19,12 +19,13 @@ var useMoveActiveCell = function useMoveActiveCell(_ref) {
|
|
19
19
|
createActiveCell = _ref.createActiveCell,
|
20
20
|
activeCellContent = _ref.activeCellContent,
|
21
21
|
isActiveHeaderCellChanged = _ref.isActiveHeaderCellChanged;
|
22
|
+
var performCreateActiveCell;
|
22
23
|
//new active cell is created when the activeCellContent changes or navigate through headers
|
23
24
|
// Otherwise new active cell will display the old value in a glance
|
24
25
|
React.useEffect(function () {
|
25
26
|
performCreateActiveCell();
|
26
27
|
}, [activeCellContent, performCreateActiveCell, isActiveHeaderCellChanged]);
|
27
|
-
|
28
|
+
performCreateActiveCell = React.useCallback(function () {
|
28
29
|
var activeCellPlacementElement = spreadsheetRef === null || spreadsheetRef === void 0 ? void 0 : spreadsheetRef.current.querySelector("[data-row-index=\"".concat(activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row, "\"][data-column-index=\"").concat(activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column, "\"]"));
|
29
30
|
var shouldPlaceActiveCellInHeader = (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header' && true;
|
30
31
|
var selectAllElement = spreadsheetRef === null || spreadsheetRef === void 0 ? void 0 : spreadsheetRef.current.querySelector("[data-row-index=\"header\"][data-column-index=\"header\"]");
|
@@ -14,6 +14,7 @@ export namespace DatagridContent {
|
|
14
14
|
DatagridPagination: PropTypes.Requireable<NonNullable<PropTypes.ReactElementLike | ((...args: any[]) => any) | null | undefined>>;
|
15
15
|
CustomizeColumnsTearsheet: PropTypes.Requireable<NonNullable<PropTypes.ReactElementLike | ((...args: any[]) => any) | null | undefined>>;
|
16
16
|
isFetching: PropTypes.Requireable<boolean>;
|
17
|
+
skeletonRowCount: PropTypes.Requireable<number>;
|
17
18
|
fullHeightDatagrid: PropTypes.Requireable<boolean>;
|
18
19
|
filterProps: PropTypes.Requireable<object>;
|
19
20
|
variableRowHeight: PropTypes.Requireable<boolean>;
|
@@ -193,6 +193,7 @@ DatagridContent.propTypes = {
|
|
193
193
|
DatagridPagination: index["default"].oneOfType([index["default"].element, index["default"].func]),
|
194
194
|
CustomizeColumnsTearsheet: index["default"].oneOfType([index["default"].element, index["default"].func]),
|
195
195
|
isFetching: index["default"].bool,
|
196
|
+
skeletonRowCount: index["default"].number,
|
196
197
|
fullHeightDatagrid: index["default"].bool,
|
197
198
|
filterProps: index["default"].object,
|
198
199
|
variableRowHeight: index["default"].bool,
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
12
12
|
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
13
13
|
|
14
14
|
/**
|
15
|
-
* Copyright IBM Corp. 2020,
|
15
|
+
* Copyright IBM Corp. 2020, 2024
|
16
16
|
*
|
17
17
|
* This source code is licensed under the Apache-2.0 license found in the
|
18
18
|
* LICENSE file in the root directory of this source tree.
|
@@ -21,7 +21,11 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
|
|
21
21
|
var useSkeletons = function useSkeletons(hooks) {
|
22
22
|
var useInstance = function useInstance(instance) {
|
23
23
|
var isFetching = instance.isFetching,
|
24
|
-
rows = instance.rows
|
24
|
+
rows = instance.rows,
|
25
|
+
skeletonRowCount = instance.skeletonRowCount;
|
26
|
+
if (isFetching && skeletonRowCount === 0) {
|
27
|
+
throw new Error('skeletonRowCount cannot be set to 0, if isFetching is true');
|
28
|
+
}
|
25
29
|
var skeletonRow = function skeletonRow(id) {
|
26
30
|
return {
|
27
31
|
isSkeleton: true,
|
@@ -29,7 +33,11 @@ var useSkeletons = function useSkeletons(hooks) {
|
|
29
33
|
id: id
|
30
34
|
};
|
31
35
|
};
|
32
|
-
var rowsWithSkeletons = [].concat(_rollupPluginBabelHelpers.toConsumableArray(rows),
|
36
|
+
var rowsWithSkeletons = [].concat(_rollupPluginBabelHelpers.toConsumableArray(rows), _rollupPluginBabelHelpers.toConsumableArray(Array.from({
|
37
|
+
length: skeletonRowCount || 3
|
38
|
+
}, function (_, index) {
|
39
|
+
return skeletonRow("skeleton-row-".concat(index + 1));
|
40
|
+
})));
|
33
41
|
Object.assign(instance, {
|
34
42
|
rows: isFetching ? rowsWithSkeletons : rows
|
35
43
|
});
|
@@ -1,5 +1,22 @@
|
|
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 React, { ReactNode } from 'react';
|
8
|
+
interface EditTearsheetNarrowProps {
|
9
|
+
/**
|
10
|
+
* Provide the contents of the EditTearsheetNarrow.
|
11
|
+
*/
|
12
|
+
children: ReactNode;
|
13
|
+
/**
|
14
|
+
* Provide an optional class to be applied to the containing node.
|
15
|
+
*/
|
16
|
+
className?: string;
|
17
|
+
}
|
1
18
|
/**
|
2
19
|
* Use a narrow tearsheet as an alternative to a modal when there is scrolling. See usage guidance for further information.
|
3
20
|
*/
|
4
|
-
export let EditTearsheetNarrow: React.ForwardRefExoticComponent<React.RefAttributes<
|
5
|
-
|
21
|
+
export declare let EditTearsheetNarrow: React.ForwardRefExoticComponent<EditTearsheetNarrowProps & React.RefAttributes<HTMLDivElement>>;
|
22
|
+
export {};
|
@@ -5,6 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
import React, { PropsWithChildren } from 'react';
|
8
|
+
import PropTypes from 'prop-types';
|
8
9
|
type Scopes = string[] | object[];
|
9
10
|
interface SearchBarProps extends PropsWithChildren {
|
10
11
|
/** @type {string} Optional additional class name. */
|
@@ -22,7 +23,7 @@ interface SearchBarProps extends PropsWithChildren {
|
|
22
23
|
/** @type {Function} Function handler for when the user submits a search. */
|
23
24
|
onSubmit?: (event: any) => void;
|
24
25
|
/** @type {string} Placeholder text to be displayed in the search input. */
|
25
|
-
|
26
|
+
placeholderText: string;
|
26
27
|
/** @type {Function} Function to get the text for each scope to display in dropdown. */
|
27
28
|
scopeToString?: () => void;
|
28
29
|
/** @type {Array<any>} Array of allowed search scopes. */
|
@@ -50,4 +51,12 @@ interface SearchBarProps extends PropsWithChildren {
|
|
50
51
|
}
|
51
52
|
export declare let SearchBar: React.ForwardRefExoticComponent<SearchBarProps & React.RefAttributes<HTMLFormElement>>;
|
52
53
|
declare const conditionalScopePropValidator: (props: any, propName: any, componentName: any, ...rest: any[]) => Error | null;
|
54
|
+
export declare const deprecatedProps: {
|
55
|
+
/**
|
56
|
+
* **Deprecated**
|
57
|
+
*
|
58
|
+
* Provide accessible label text for the scopes MultiSelect.
|
59
|
+
*/
|
60
|
+
titleText: PropTypes.Requireable<string>;
|
61
|
+
};
|
53
62
|
export {};
|