@carbon/ibm-products 2.43.2-canary.53 → 2.43.2-canary.55
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/index-full-carbon.css +8 -2
- 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 +8 -2
- 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 +8 -2
- 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/Coachmark/Coachmark.js +12 -7
- package/es/components/CoachmarkFixed/CoachmarkFixed.js +13 -11
- package/es/components/CoachmarkStack/CoachmarkStack.js +7 -3
- package/es/components/CoachmarkStack/CoachmarkStackHome.js +8 -4
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +21 -11
- package/es/components/ConditionBuilder/ConditionBuilder.js +15 -5
- package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +58 -36
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +21 -9
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +4 -1
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +14 -4
- package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +8 -4
- package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +17 -9
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +19 -10
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +12 -6
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +20 -7
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +2 -1
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +18 -17
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +36 -39
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +36 -38
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +20 -12
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +8 -3
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +9 -7
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +9 -4
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +10 -5
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +5 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +19 -7
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +23 -17
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +31 -14
- package/es/components/ConditionBuilder/utils/useTranslations.d.ts +1 -0
- package/es/components/ConditionBuilder/utils/useTranslations.js +26 -0
- package/es/components/ConditionBuilder/utils/util.js +1 -9
- package/es/components/CreateFullPage/CreateFullPage.js +2 -2
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +2 -1
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -2
- package/es/components/Datagrid/useSelectRows.js +2 -1
- package/es/components/Nav/NavItem.js +12 -3
- package/es/components/OptionsTile/OptionsTile.js +4 -5
- package/es/components/SidePanel/SidePanel.js +17 -20
- package/es/components/SidePanel/motion/variants.d.ts +4 -6
- package/es/components/SidePanel/motion/variants.js +10 -11
- package/es/components/Tearsheet/TearsheetShell.js +3 -1
- package/es/components/WebTerminal/WebTerminal.js +10 -12
- package/es/global/js/hooks/usePrefersReducedMotion.js +14 -8
- package/lib/components/Coachmark/Coachmark.js +12 -7
- package/lib/components/CoachmarkFixed/CoachmarkFixed.js +13 -11
- package/lib/components/CoachmarkStack/CoachmarkStack.js +7 -3
- package/lib/components/CoachmarkStack/CoachmarkStackHome.js +8 -4
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +20 -10
- package/lib/components/ConditionBuilder/ConditionBuilder.js +15 -5
- package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +56 -33
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +20 -8
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +4 -1
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +13 -3
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +6 -2
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +16 -8
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +18 -9
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +12 -6
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +20 -7
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +2 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +17 -17
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +36 -39
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +36 -38
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +19 -11
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +8 -3
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +8 -6
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +8 -3
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +9 -4
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +5 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +18 -6
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +21 -15
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +30 -13
- package/lib/components/ConditionBuilder/utils/useTranslations.d.ts +1 -0
- package/lib/components/ConditionBuilder/utils/useTranslations.js +30 -0
- package/lib/components/ConditionBuilder/utils/util.js +0 -9
- package/lib/components/CreateFullPage/CreateFullPage.js +2 -2
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +2 -1
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -2
- package/lib/components/Datagrid/useSelectRows.js +2 -1
- package/lib/components/Nav/NavItem.js +10 -1
- package/lib/components/OptionsTile/OptionsTile.js +4 -5
- package/lib/components/SidePanel/SidePanel.js +16 -19
- package/lib/components/SidePanel/motion/variants.d.ts +4 -6
- package/lib/components/SidePanel/motion/variants.js +10 -11
- package/lib/components/Tearsheet/TearsheetShell.js +3 -1
- package/lib/components/WebTerminal/WebTerminal.js +10 -12
- package/lib/global/js/hooks/usePrefersReducedMotion.js +13 -7
- package/package.json +3 -3
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +5 -1
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +3 -1
- package/es/global/js/utils/window.d.ts +0 -2
- package/es/global/js/utils/window.js +0 -12
- package/lib/global/js/utils/window.d.ts +0 -2
- package/lib/global/js/utils/window.js +0 -16
@@ -16,6 +16,7 @@ var icons = require('@carbon/react/icons');
|
|
16
16
|
var index = require('../../../../node_modules/prop-types/index.js');
|
17
17
|
var ConditionBuilderProvider = require('../../ConditionBuilderContext/ConditionBuilderProvider.js');
|
18
18
|
var DataConfigs = require('../../ConditionBuilderContext/DataConfigs.js');
|
19
|
+
var useTranslations = require('../../utils/useTranslations.js');
|
19
20
|
|
20
21
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
21
22
|
|
@@ -30,6 +31,10 @@ var ItemOption = function ItemOption(_ref) {
|
|
30
31
|
var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
|
31
32
|
popOverSearchThreshold = _useContext.popOverSearchThreshold;
|
32
33
|
var contentRef = React.useRef();
|
34
|
+
var _useTranslations = useTranslations.useTranslations(['propertyText', 'clearSearchText']),
|
35
|
+
_useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations, 2),
|
36
|
+
propertyText = _useTranslations2[0],
|
37
|
+
clearSearchText = _useTranslations2[1];
|
33
38
|
var allOptions = config.options;
|
34
39
|
var _useState = React.useState(''),
|
35
40
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
@@ -57,7 +62,7 @@ var ItemOption = function ItemOption(_ref) {
|
|
57
62
|
setSearchValue(value);
|
58
63
|
};
|
59
64
|
var getAriaLabel = function getAriaLabel() {
|
60
|
-
return conditionState.label ? conditionState.label : conditionState.property ? conditionState.property :
|
65
|
+
return conditionState.label ? conditionState.label : conditionState.property ? conditionState.property : propertyText;
|
61
66
|
};
|
62
67
|
if (!allOptions) {
|
63
68
|
return;
|
@@ -69,8 +74,8 @@ var ItemOption = function ItemOption(_ref) {
|
|
69
74
|
className: "".concat(DataConfigs.blockClass, "__item-option__search")
|
70
75
|
}, /*#__PURE__*/React__default["default"].createElement(react.Search, {
|
71
76
|
size: "sm",
|
72
|
-
labelText:
|
73
|
-
closeButtonLabelText:
|
77
|
+
labelText: clearSearchText,
|
78
|
+
closeButtonLabelText: clearSearchText,
|
74
79
|
onChange: onSearchChangeHandler
|
75
80
|
})), /*#__PURE__*/React__default["default"].createElement("ul", {
|
76
81
|
"aria-label": getAriaLabel(),
|
@@ -16,6 +16,7 @@ var icons = require('@carbon/react/icons');
|
|
16
16
|
var index = require('../../../../node_modules/prop-types/index.js');
|
17
17
|
var ConditionBuilderProvider = require('../../ConditionBuilderContext/ConditionBuilderProvider.js');
|
18
18
|
var DataConfigs = require('../../ConditionBuilderContext/DataConfigs.js');
|
19
|
+
var useTranslations = require('../../utils/useTranslations.js');
|
19
20
|
|
20
21
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
21
22
|
|
@@ -28,11 +29,15 @@ var ItemOptionForValueField = function ItemOptionForValueField(_ref) {
|
|
28
29
|
_ref$config = _ref.config,
|
29
30
|
config = _ref$config === void 0 ? {} : _ref$config,
|
30
31
|
onChange = _ref.onChange;
|
31
|
-
var multiSelectable = conditionState.operator === '
|
32
|
+
var multiSelectable = conditionState.operator === 'oneOf';
|
32
33
|
var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
|
33
34
|
popOverSearchThreshold = _useContext.popOverSearchThreshold,
|
34
35
|
getOptions = _useContext.getOptions,
|
35
36
|
rootState = _useContext.rootState;
|
37
|
+
var _useTranslations = useTranslations.useTranslations(['propertyText', 'clearSearchText']),
|
38
|
+
_useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations, 2),
|
39
|
+
propertyText = _useTranslations2[0],
|
40
|
+
clearSearchText = _useTranslations2[1];
|
36
41
|
var contentRef = React.useRef();
|
37
42
|
var _useState = React.useState(config.options),
|
38
43
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
@@ -130,7 +135,7 @@ var ItemOptionForValueField = function ItemOptionForValueField(_ref) {
|
|
130
135
|
}
|
131
136
|
};
|
132
137
|
var getAriaLabel = function getAriaLabel() {
|
133
|
-
return conditionState.label ? conditionState.label : conditionState.property ? conditionState.property :
|
138
|
+
return conditionState.label ? conditionState.label : conditionState.property ? conditionState.property : propertyText;
|
134
139
|
};
|
135
140
|
if (!allOptions) {
|
136
141
|
return _SelectSkeleton || (_SelectSkeleton = /*#__PURE__*/React__default["default"].createElement(react.SelectSkeleton, null));
|
@@ -142,8 +147,8 @@ var ItemOptionForValueField = function ItemOptionForValueField(_ref) {
|
|
142
147
|
className: "".concat(DataConfigs.blockClass, "__item-option__search")
|
143
148
|
}, /*#__PURE__*/React__default["default"].createElement(react.Search, {
|
144
149
|
size: "sm",
|
145
|
-
labelText:
|
146
|
-
closeButtonLabelText:
|
150
|
+
labelText: clearSearchText,
|
151
|
+
closeButtonLabelText: clearSearchText,
|
147
152
|
onChange: onSearchChangeHandler
|
148
153
|
})), multiSelectable && /*#__PURE__*/React__default["default"].createElement("div", {
|
149
154
|
className: "".concat(DataConfigs.blockClass, "__multiselectSelectionStatusContainer")
|
@@ -1,11 +1,15 @@
|
|
1
|
-
export function ConditionBuilderItemText({ conditionState, onChange }: {
|
1
|
+
export function ConditionBuilderItemText({ conditionState, onChange, config, type, }: {
|
2
2
|
conditionState: any;
|
3
3
|
onChange: any;
|
4
|
+
config: any;
|
5
|
+
type: any;
|
4
6
|
}): import("react/jsx-runtime").JSX.Element;
|
5
7
|
export namespace ConditionBuilderItemText {
|
6
8
|
namespace propTypes {
|
7
9
|
let conditionState: PropTypes.Requireable<object>;
|
10
|
+
let config: PropTypes.Requireable<object>;
|
8
11
|
let onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
12
|
+
let type: PropTypes.Requireable<object>;
|
9
13
|
}
|
10
14
|
}
|
11
15
|
import PropTypes from 'prop-types';
|
@@ -9,6 +9,7 @@
|
|
9
9
|
|
10
10
|
Object.defineProperty(exports, '__esModule', { value: true });
|
11
11
|
|
12
|
+
var _rollupPluginBabelHelpers = require('../../../../_virtual/_rollupPluginBabelHelpers.js');
|
12
13
|
var React = require('react');
|
13
14
|
var react = require('@carbon/react');
|
14
15
|
var index = require('../../../../node_modules/prop-types/index.js');
|
@@ -21,10 +22,10 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
21
22
|
var ConditionBuilderItemText = function ConditionBuilderItemText(_ref) {
|
22
23
|
var _conditionState$value, _conditionState$prope;
|
23
24
|
var conditionState = _ref.conditionState,
|
24
|
-
_onChange = _ref.onChange
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
_onChange = _ref.onChange,
|
26
|
+
config = _ref.config,
|
27
|
+
type = _ref.type;
|
28
|
+
var inputProps = _rollupPluginBabelHelpers.objectSpread2({
|
28
29
|
labelText: conditionState.property,
|
29
30
|
hideLabel: true,
|
30
31
|
value: (_conditionState$value = conditionState.value) !== null && _conditionState$value !== void 0 ? _conditionState$value : '',
|
@@ -32,17 +33,28 @@ var ConditionBuilderItemText = function ConditionBuilderItemText(_ref) {
|
|
32
33
|
onChange: function onChange(evt) {
|
33
34
|
_onChange(evt.target.value);
|
34
35
|
}
|
35
|
-
})
|
36
|
+
}, config);
|
37
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
38
|
+
className: "".concat(DataConfigs.blockClass, "__item-text")
|
39
|
+
}, type == 'textarea' ? /*#__PURE__*/React__default["default"].createElement(react.TextArea, inputProps) : /*#__PURE__*/React__default["default"].createElement(react.TextInput, inputProps));
|
36
40
|
};
|
37
41
|
ConditionBuilderItemText.propTypes = {
|
38
42
|
/**
|
39
43
|
* current condition object
|
40
44
|
*/
|
41
45
|
conditionState: index["default"].object,
|
46
|
+
/**
|
47
|
+
* config of the current property
|
48
|
+
*/
|
49
|
+
config: index["default"].object,
|
42
50
|
/**
|
43
51
|
* callback to update state oin date change
|
44
52
|
*/
|
45
|
-
onChange: index["default"].func
|
53
|
+
onChange: index["default"].func,
|
54
|
+
/**
|
55
|
+
* current input type
|
56
|
+
*/
|
57
|
+
type: index["default"].object
|
46
58
|
};
|
47
59
|
|
48
60
|
exports.ConditionBuilderItemText = ConditionBuilderItemText;
|
@@ -22,13 +22,13 @@ var ConditionBuilderProvider = require('../ConditionBuilderContext/ConditionBuil
|
|
22
22
|
var uuidv4 = require('../../../global/js/utils/uuidv4.js');
|
23
23
|
var ConditionPreview = require('../ConditionPreview/ConditionPreview.js');
|
24
24
|
var ItemOption = require('../ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js');
|
25
|
+
var useTranslations = require('../utils/useTranslations.js');
|
25
26
|
|
26
27
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
27
28
|
|
28
29
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
29
30
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
30
31
|
|
31
|
-
var _ConditionPreview, _ConditionPreview2;
|
32
32
|
/**
|
33
33
|
*
|
34
34
|
* state - this is the current group that is being rendered . This can be a inner group or outer group
|
@@ -37,12 +37,17 @@ var _ConditionPreview, _ConditionPreview2;
|
|
37
37
|
*/
|
38
38
|
|
39
39
|
var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
40
|
+
var _ConditionPreview, _ConditionPreview2;
|
40
41
|
var group = _ref.group,
|
41
42
|
aria = _ref.aria,
|
42
43
|
onRemove = _ref.onRemove,
|
43
44
|
onChange = _ref.onChange,
|
44
45
|
conditionBuilderRef = _ref.conditionBuilderRef,
|
45
46
|
className = _ref.className;
|
47
|
+
var _useTranslations = useTranslations.useTranslations(['condition_builder_group', 'conditionText']),
|
48
|
+
_useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations, 2),
|
49
|
+
conditionBuilderGroupText = _useTranslations2[0],
|
50
|
+
conditionText = _useTranslations2[1];
|
46
51
|
var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
|
47
52
|
variant = _useContext.variant;
|
48
53
|
var _useState = React.useState(-1),
|
@@ -53,6 +58,7 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
53
58
|
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
54
59
|
showConditionSubGroupPreview = _useState4[0],
|
55
60
|
setShowConditionSubGroupPreview = _useState4[1];
|
61
|
+
var conditionBuilderContentRef = React.useRef();
|
56
62
|
var onRemoveHandler = function onRemoveHandler(conditionId, evt) {
|
57
63
|
if (group.conditions.length > 1) {
|
58
64
|
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
|
@@ -60,7 +66,6 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
60
66
|
return conditionId !== condition.id;
|
61
67
|
})
|
62
68
|
}));
|
63
|
-
handleFocusOnClose(evt);
|
64
69
|
} else {
|
65
70
|
onRemove(evt);
|
66
71
|
}
|
@@ -83,13 +88,6 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
83
88
|
conditions: [].concat(_rollupPluginBabelHelpers.toConsumableArray(group.conditions.slice(0, conditionIndex + 1)), [newCondition], _rollupPluginBabelHelpers.toConsumableArray(group.conditions.slice(conditionIndex + 1)))
|
84
89
|
}));
|
85
90
|
};
|
86
|
-
var handleFocusOnClose = function handleFocusOnClose(e) {
|
87
|
-
var _e$currentTarget;
|
88
|
-
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"]');
|
89
|
-
if (previousClose) {
|
90
|
-
previousClose.focus();
|
91
|
-
}
|
92
|
-
};
|
93
91
|
var addConditionSubGroupHandler = function addConditionSubGroupHandler(conditionIndex) {
|
94
92
|
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
|
95
93
|
conditions: [].concat(_rollupPluginBabelHelpers.toConsumableArray(group.conditions.slice(0, conditionIndex + 1)), [{
|
@@ -122,7 +120,12 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
122
120
|
setShowConditionPreview(-1);
|
123
121
|
};
|
124
122
|
var onStatementChangeHandler = function onStatementChangeHandler(updatedStatement) {
|
123
|
+
var _statementConfig$find;
|
124
|
+
var groupOperator = (_statementConfig$find = DataConfigs.statementConfig.find(function (statement) {
|
125
|
+
return statement.id == updatedStatement;
|
126
|
+
})) === null || _statementConfig$find === void 0 ? void 0 : _statementConfig$find.connector;
|
125
127
|
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
|
128
|
+
groupOperator: groupOperator,
|
126
129
|
statement: updatedStatement
|
127
130
|
}));
|
128
131
|
};
|
@@ -138,7 +141,7 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
138
141
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
139
142
|
className: "".concat(DataConfigs.blockClass, "__condition-wrapper"),
|
140
143
|
role: "grid",
|
141
|
-
"aria-label":
|
144
|
+
"aria-label": conditionBuilderGroupText
|
142
145
|
}, group === null || group === void 0 || (_group$conditions = group.conditions) === null || _group$conditions === void 0 ? void 0 : _group$conditions.map(function (eachCondition, conditionIndex) {
|
143
146
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
144
147
|
key: eachCondition.id,
|
@@ -172,7 +175,8 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
172
175
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
173
176
|
className: "".concat(className, " ").concat(DataConfigs.blockClass, "__condition-wrapper"),
|
174
177
|
role: aria.level === 1 ? 'rowgroup' : undefined,
|
175
|
-
"aria-label": aria.level == 1 ?
|
178
|
+
"aria-label": aria.level == 1 ? conditionBuilderGroupText : undefined,
|
179
|
+
ref: conditionBuilderContentRef
|
176
180
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
177
181
|
tabIndex: 0,
|
178
182
|
role: "row",
|
@@ -181,14 +185,14 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
181
185
|
"aria-setsize": aria.setsize
|
182
186
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
183
187
|
label: group.statement,
|
184
|
-
title:
|
188
|
+
title: conditionText,
|
185
189
|
"data-name": "connectorField",
|
186
190
|
popOverClassName: "".concat(DataConfigs.blockClass, "__gap"),
|
187
191
|
className: "".concat(DataConfigs.blockClass, "__statement-button")
|
188
192
|
}, /*#__PURE__*/React__default["default"].createElement(ItemOption.ItemOption, {
|
189
193
|
conditionState: {
|
190
194
|
value: group.statement,
|
191
|
-
label:
|
195
|
+
label: conditionText
|
192
196
|
},
|
193
197
|
onChange: function onChange(v, evt) {
|
194
198
|
util.focusThisField(evt);
|
@@ -252,9 +256,11 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
252
256
|
hideConditionPreviewHandler: hideConditionPreviewHandler,
|
253
257
|
isLastCondition: isLastCondition
|
254
258
|
})), conditionIndex == showConditionSubGroupPreview && (_ConditionPreview || (_ConditionPreview = /*#__PURE__*/React__default["default"].createElement(ConditionPreview["default"], {
|
255
|
-
previewType: "subGroup"
|
259
|
+
previewType: "subGroup",
|
260
|
+
group: group
|
256
261
|
}))), conditionIndex == showConditionPreview && (_ConditionPreview2 || (_ConditionPreview2 = /*#__PURE__*/React__default["default"].createElement(ConditionPreview["default"], {
|
257
|
-
previewType: "condition"
|
262
|
+
previewType: "condition",
|
263
|
+
group: group
|
258
264
|
}))));
|
259
265
|
}));
|
260
266
|
};
|
@@ -1,9 +1,11 @@
|
|
1
1
|
export default ConditionPreview;
|
2
|
-
declare function ConditionPreview({ previewType }: {
|
2
|
+
declare function ConditionPreview({ previewType, group }: {
|
3
3
|
previewType: any;
|
4
|
+
group: any;
|
4
5
|
}): import("react/jsx-runtime").JSX.Element;
|
5
6
|
declare namespace ConditionPreview {
|
6
7
|
namespace propTypes {
|
8
|
+
let group: PropTypes.Requireable<object>;
|
7
9
|
let previewType: PropTypes.Requireable<string>;
|
8
10
|
}
|
9
11
|
}
|
@@ -16,6 +16,8 @@ var index = require('../../../node_modules/prop-types/index.js');
|
|
16
16
|
var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
|
17
17
|
var ConditionBuilderItem = require('../ConditionBuilderItem/ConditionBuilderItem.js');
|
18
18
|
var ConditionConnector = require('../ConditionBuilderConnector/ConditionConnector.js');
|
19
|
+
var useTranslations = require('../utils/useTranslations.js');
|
20
|
+
var icons = require('@carbon/react/icons');
|
19
21
|
|
20
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
21
23
|
|
@@ -23,28 +25,39 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
25
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
24
26
|
|
25
27
|
var ConditionPreview = function ConditionPreview(_ref) {
|
26
|
-
var
|
28
|
+
var _ConditionBuilderItem, _ConditionBuilderItem2, _ConditionBuilderItem3;
|
29
|
+
var previewType = _ref.previewType,
|
30
|
+
group = _ref.group;
|
27
31
|
var _useState = React.useState(false),
|
28
32
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
29
33
|
animate = _useState2[0],
|
30
34
|
setAnimate = _useState2[1];
|
35
|
+
var _useTranslations = useTranslations.useTranslations(['valueText', 'operatorText', 'propertyText', 'ifText']),
|
36
|
+
_useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations, 4),
|
37
|
+
propertyText = _useTranslations2[0],
|
38
|
+
operatorText = _useTranslations2[1],
|
39
|
+
valueText = _useTranslations2[2],
|
40
|
+
ifText = _useTranslations2[3];
|
31
41
|
React.useEffect(function () {
|
32
42
|
setAnimate(true);
|
33
43
|
}, []);
|
34
44
|
var getConditionSection = function getConditionSection() {
|
35
|
-
return /*#__PURE__*/React__default["default"].createElement("div",
|
36
|
-
|
37
|
-
}
|
38
|
-
label:
|
39
|
-
|
40
|
-
|
41
|
-
|
45
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
46
|
+
className: "".concat(DataConfigs.blockClass, "__preview-condition")
|
47
|
+
}, _ConditionBuilderItem || (_ConditionBuilderItem = /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
48
|
+
label: propertyText,
|
49
|
+
renderIcon: icons.Bee
|
50
|
+
})), _ConditionBuilderItem2 || (_ConditionBuilderItem2 = /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
51
|
+
label: operatorText
|
52
|
+
})), _ConditionBuilderItem3 || (_ConditionBuilderItem3 = /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
53
|
+
label: valueText
|
54
|
+
})));
|
42
55
|
};
|
43
56
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, previewType == 'newGroup' && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
44
57
|
className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
|
45
58
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
46
59
|
className: "".concat(DataConfigs.blockClass, "__statement-button"),
|
47
|
-
label:
|
60
|
+
label: group.groupOperator
|
48
61
|
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
49
62
|
"aria-hidden": true,
|
50
63
|
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)])
|
@@ -52,32 +65,36 @@ var ConditionPreview = function ConditionPreview(_ref) {
|
|
52
65
|
className: "".concat(DataConfigs.blockClass, "__gap")
|
53
66
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
54
67
|
className: "".concat(DataConfigs.blockClass, "__statement-button"),
|
55
|
-
label:
|
68
|
+
label: ifText
|
56
69
|
})), getConditionSection())), previewType == 'subGroup' && /*#__PURE__*/React__default["default"].createElement("div", {
|
57
70
|
className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
|
58
71
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
59
72
|
className: "".concat(DataConfigs.blockClass, "__condition-block ").concat(DataConfigs.blockClass, "__gap")
|
60
73
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
61
|
-
label:
|
74
|
+
label: group.groupOperator,
|
62
75
|
className: "".concat(DataConfigs.blockClass, "__statement-button"),
|
63
76
|
popOverClassName: "".concat(DataConfigs.blockClass, "__gap")
|
64
77
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
65
78
|
className: "".concat(DataConfigs.blockClass, "__group ").concat(DataConfigs.blockClass, "__condition-wrapper")
|
66
79
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionConnector["default"], {
|
67
80
|
className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__groupConnector"),
|
68
|
-
operator:
|
81
|
+
operator: ifText
|
69
82
|
}), getConditionSection()))), previewType == 'condition' && /*#__PURE__*/React__default["default"].createElement("div", {
|
70
83
|
className: cx__default["default"](["".concat(DataConfigs.blockClass, "__group__row ").concat(DataConfigs.blockClass, "__group-preview "), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__group-preview-animate"), animate)])
|
71
84
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
72
85
|
className: "".concat(DataConfigs.blockClass, "__condition-block ").concat(DataConfigs.blockClass, "__gap")
|
73
86
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
74
|
-
label:
|
87
|
+
label: group.groupOperator,
|
75
88
|
className: "".concat(DataConfigs.blockClass, "__statement-button"),
|
76
89
|
popOverClassName: "".concat(DataConfigs.blockClass, "__gap")
|
77
90
|
}), getConditionSection())));
|
78
91
|
};
|
79
92
|
var ConditionPreview$1 = ConditionPreview;
|
80
93
|
ConditionPreview.propTypes = {
|
94
|
+
/**
|
95
|
+
* current conditional group
|
96
|
+
*/
|
97
|
+
group: index["default"].object,
|
81
98
|
/**
|
82
99
|
* type of review to be displayed
|
83
100
|
*/
|
@@ -0,0 +1 @@
|
|
1
|
+
export function useTranslations(translationKeys: any): any;
|
@@ -0,0 +1,30 @@
|
|
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
|
+
'use strict';
|
9
|
+
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
11
|
+
|
12
|
+
var React = require('react');
|
13
|
+
var ConditionBuilderProvider = require('../ConditionBuilderContext/ConditionBuilderProvider.js');
|
14
|
+
var translationObject = require('../ConditionBuilderContext/translationObject.js');
|
15
|
+
|
16
|
+
var useTranslations = function useTranslations(translationKeys) {
|
17
|
+
var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
|
18
|
+
translateWithId = _useContext.translateWithId;
|
19
|
+
return translationKeys.map(function (translationKey) {
|
20
|
+
if (translateWithId !== null && translateWithId !== void 0 && translateWithId(translationKey)) {
|
21
|
+
return translateWithId(translationKey);
|
22
|
+
} else if (translationObject.translationsObject[translationKey]) {
|
23
|
+
return translationObject.translationsObject[translationKey];
|
24
|
+
} else {
|
25
|
+
return translationKey;
|
26
|
+
}
|
27
|
+
});
|
28
|
+
};
|
29
|
+
|
30
|
+
exports.useTranslations = useTranslations;
|
@@ -52,16 +52,7 @@ var checkForHoldingKey = function checkForHoldingKey(evt, key) {
|
|
52
52
|
}
|
53
53
|
return evt[key];
|
54
54
|
};
|
55
|
-
var checkDuplicateAction = function checkDuplicateAction(actionState, selectedId, currentActionId) {
|
56
|
-
if (selectedId !== currentActionId && actionState.find(function (eachAction) {
|
57
|
-
return eachAction.id === selectedId;
|
58
|
-
})) {
|
59
|
-
return true;
|
60
|
-
}
|
61
|
-
return false;
|
62
|
-
};
|
63
55
|
|
64
|
-
exports.checkDuplicateAction = checkDuplicateAction;
|
65
56
|
exports.checkForHoldingKey = checkForHoldingKey;
|
66
57
|
exports.focusThisField = focusThisField;
|
67
58
|
exports.focusThisItem = focusThisItem;
|
@@ -98,6 +98,7 @@ exports.CreateFullPage = /*#__PURE__*/React__default["default"].forwardRef(funct
|
|
98
98
|
_useState10 = _rollupPluginBabelHelpers.slicedToArray(_useState9, 2),
|
99
99
|
modalIsOpen = _useState10[0],
|
100
100
|
setModalIsOpen = _useState10[1];
|
101
|
+
// eslint-disable-next-line ssr-friendly/no-dom-globals-in-react-fc
|
101
102
|
var previousState = usePreviousValue.usePreviousValue({
|
102
103
|
currentStep: currentStep,
|
103
104
|
open: open
|
@@ -155,8 +156,7 @@ exports.CreateFullPage = /*#__PURE__*/React__default["default"].forwardRef(funct
|
|
155
156
|
useResetCreateComponent.useResetCreateComponent({
|
156
157
|
firstIncludedStep: firstIncludedStep,
|
157
158
|
previousState: previousState,
|
158
|
-
|
159
|
-
open: open,
|
159
|
+
open: true,
|
160
160
|
setCurrentStep: setCurrentStep,
|
161
161
|
stepData: stepData,
|
162
162
|
/**@ts-ignore */
|
@@ -25,11 +25,12 @@ var _excluded = ["onChange"];
|
|
25
25
|
var blockClass = "".concat(settings.pkg.prefix, "--datagrid");
|
26
26
|
var SelectAll = function SelectAll(datagridState) {
|
27
27
|
var _columns$;
|
28
|
-
var _useState = React.useState(
|
28
|
+
var _useState = React.useState(),
|
29
29
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
30
30
|
windowSize = _useState2[0],
|
31
31
|
setWindowSize = _useState2[1];
|
32
32
|
React.useLayoutEffect(function () {
|
33
|
+
setWindowSize(window.innerWidth);
|
33
34
|
/* istanbul ignore next */
|
34
35
|
function updateSize() {
|
35
36
|
setWindowSize(window.innerWidth);
|
@@ -52,11 +52,12 @@ var SelectAllWithToggle = function SelectAllWithToggle(_ref) {
|
|
52
52
|
onSelectAllRows(isAllRowsSelected && selectAllMode === SELECT_ALL_ROWS);
|
53
53
|
}
|
54
54
|
}, [isAllRowsSelected, selectAllMode, onSelectAllRows]);
|
55
|
-
var _useState3 = React.useState(
|
55
|
+
var _useState3 = React.useState(),
|
56
56
|
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
57
57
|
windowSize = _useState4[0],
|
58
58
|
setWindowSize = _useState4[1];
|
59
59
|
React.useLayoutEffect(function () {
|
60
|
+
setWindowSize(window.innerWidth);
|
60
61
|
function updateSize() {
|
61
62
|
setWindowSize(window.innerWidth);
|
62
63
|
}
|
@@ -77,7 +78,7 @@ var SelectAllWithToggle = function SelectAllWithToggle(_ref) {
|
|
77
78
|
var isFirstColumnStickyLeft = (columns === null || columns === void 0 || (_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.sticky) === 'left' && withStickyColumn;
|
78
79
|
return /*#__PURE__*/React__default["default"].createElement("th", {
|
79
80
|
scope: "col",
|
80
|
-
className: cx__default["default"]("".concat(blockClass, "__select-all-toggle-on"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__select-all-sticky-left"), isFirstColumnStickyLeft && windowSize > 671))
|
81
|
+
className: cx__default["default"]("".concat(blockClass, "__select-all-toggle-on"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__select-all-sticky-left"), isFirstColumnStickyLeft && (windowSize !== null && windowSize !== void 0 ? windowSize : 0) > 671))
|
81
82
|
}, /*#__PURE__*/React__default["default"].createElement("span", null, /*#__PURE__*/React__default["default"].createElement(react.Checkbox, _rollupPluginBabelHelpers["extends"]({}, selectProps, {
|
82
83
|
name: "".concat(tableId, "-select-all-checkbox-name"),
|
83
84
|
onClick: function onClick(e) {
|
@@ -90,11 +90,12 @@ var SelectRow = function SelectRow(datagridState) {
|
|
90
90
|
withStickyColumn = datagridState.withStickyColumn,
|
91
91
|
dispatch = datagridState.dispatch,
|
92
92
|
getRowId = datagridState.getRowId;
|
93
|
-
var _useState = React.useState(
|
93
|
+
var _useState = React.useState(),
|
94
94
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
95
95
|
windowSize = _useState2[0],
|
96
96
|
setWindowSize = _useState2[1];
|
97
97
|
React.useLayoutEffect(function () {
|
98
|
+
setWindowSize(window.innerWidth);
|
98
99
|
function updateSize() {
|
99
100
|
setWindowSize(window.innerWidth);
|
100
101
|
}
|
@@ -60,11 +60,20 @@ var NavItem = function NavItem(_ref) {
|
|
60
60
|
_ref$tabIndex = _ref.tabIndex,
|
61
61
|
tabIndex = _ref$tabIndex === void 0 ? defaults.tabIndex : _ref$tabIndex,
|
62
62
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
63
|
+
var _useState = React.useState(false),
|
64
|
+
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
65
|
+
hrefHasDifferentHost = _useState2[0],
|
66
|
+
setHrefHasDifferentHost = _useState2[1];
|
67
|
+
React.useEffect(function () {
|
68
|
+
if (href.indexOf(window.location.host) === -1) {
|
69
|
+
setHrefHasDifferentHost(true);
|
70
|
+
}
|
71
|
+
}, [href]);
|
63
72
|
var internalId = React.useRef(uuidv4["default"]());
|
64
73
|
var instanceId = "".concat(blockClass, "__").concat(internalId.current);
|
65
74
|
var navItemId = id || instanceId;
|
66
75
|
var isAbsoluteLink = new RegExp('^([a-z]+://|//)', 'i');
|
67
|
-
var externalLink = isAbsoluteLink.test(href) &&
|
76
|
+
var externalLink = isAbsoluteLink.test(href) && hrefHasDifferentHost;
|
68
77
|
var linkClassName = "".concat(blockClass, "__link");
|
69
78
|
var handleDisabled = function handleDisabled(action) {
|
70
79
|
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
@@ -19,6 +19,7 @@ var settings = require('../../settings.js');
|
|
19
19
|
var react = require('@carbon/react');
|
20
20
|
var icons = require('@carbon/react/icons');
|
21
21
|
var carbonMotion = require('@carbon/motion');
|
22
|
+
var usePrefersReducedMotion = require('../../global/js/hooks/usePrefersReducedMotion.js');
|
22
23
|
var useControllableState = require('../../global/js/hooks/useControllableState.js');
|
23
24
|
|
24
25
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
@@ -99,9 +100,7 @@ exports.OptionsTile = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
99
100
|
var isInvalid = invalid;
|
100
101
|
var isWarn = !isInvalid && warn;
|
101
102
|
var isLocked = !isInvalid && !isWarn && locked;
|
102
|
-
var
|
103
|
-
matches: true
|
104
|
-
};
|
103
|
+
var shouldReduceMotion = usePrefersReducedMotion["default"]();
|
105
104
|
if (open !== prevIsOpen) {
|
106
105
|
if (isOpen && !open) {
|
107
106
|
collapse();
|
@@ -111,7 +110,7 @@ exports.OptionsTile = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
111
110
|
setPrevIsOpen(open);
|
112
111
|
}
|
113
112
|
function expand() {
|
114
|
-
if (detailsRef.current && contentRef.current && !
|
113
|
+
if (detailsRef.current && contentRef.current && !shouldReduceMotion) {
|
115
114
|
setIsOpen(true);
|
116
115
|
detailsRef.current.open = true;
|
117
116
|
var _getComputedStyle = getComputedStyle(contentRef.current),
|
@@ -140,7 +139,7 @@ exports.OptionsTile = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
140
139
|
}
|
141
140
|
}
|
142
141
|
function collapse() {
|
143
|
-
if (contentRef.current && !
|
142
|
+
if (contentRef.current && !shouldReduceMotion) {
|
144
143
|
setClosing(true);
|
145
144
|
var _getComputedStyle2 = getComputedStyle(contentRef.current),
|
146
145
|
paddingTop = _getComputedStyle2.paddingTop,
|