@carbon/ibm-products 2.49.1 → 2.50.0-rc.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/index-full-carbon.css +1180 -1148
- 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 +3 -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-without-carbon.css +5 -0
- 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 +27 -20
- 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/AboutModal/AboutModal.js +23 -6
- package/es/components/ActionBar/ActionBar.d.ts +5 -1
- package/es/components/ActionBar/ActionBar.js +13 -3
- package/es/components/ActionBar/ActionBarOverflowItems.d.ts +12 -3
- package/es/components/ActionBar/ActionBarOverflowItems.js +13 -3
- package/es/components/Carousel/Carousel.js +1 -2
- package/es/components/Coachmark/CoachmarkDragbar.js +0 -1
- package/es/components/Coachmark/CoachmarkHeader.js +0 -1
- package/es/components/CoachmarkOverlayElement/CoachmarkOverlayElement.js +0 -1
- package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +0 -1
- package/es/components/CoachmarkStack/CoachmarkStackHome.js +1 -2
- package/es/components/ConditionBuilder/ConditionBuilder.js +1 -3
- package/es/components/CreateTearsheet/CreateTearsheet.d.ts +6 -0
- package/es/components/CreateTearsheet/CreateTearsheet.js +13 -1
- package/es/components/CreateTearsheet/CreateTearsheetStep.d.ts +18 -0
- package/es/components/CreateTearsheet/CreateTearsheetStep.js +30 -3
- package/es/components/Datagrid/Datagrid/DatagridContent.js +4 -1
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +4 -21
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +7 -2
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -3
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +4 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +3 -1
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/stateReducer.d.ts +7 -0
- package/es/components/Datagrid/Datagrid/addons/stateReducer.js +99 -41
- package/es/components/Datagrid/types/index.d.ts +2 -0
- package/es/components/Datagrid/useDisableSelectRows.js +18 -3
- package/es/components/Datagrid/useFlexResize.d.ts +0 -6
- package/es/components/Datagrid/useFlexResize.js +33 -17
- package/es/components/Datagrid/useSortableColumns.js +2 -1
- package/es/components/EditUpdateCards/EditUpdateCards.d.ts +1 -1
- package/es/components/EditUpdateCards/EditUpdateCards.js +1 -2
- package/es/components/PageHeader/PageHeader.js +12 -2
- package/es/components/PageHeader/PageHeaderUtils.js +0 -5
- package/es/components/SidePanel/SidePanel.js +6 -6
- package/es/components/TagOverflow/TagOverflow.d.ts +1 -1
- package/es/components/TagOverflow/TagOverflow.js +1 -2
- package/es/components/TagSet/TagSet.d.ts +8 -6
- package/es/components/TagSet/TagSet.js +38 -30
- package/es/components/TagSet/TagSetOverflow.d.ts +4 -0
- package/es/components/TagSet/TagSetOverflow.js +8 -2
- package/es/components/Tearsheet/Tearsheet.d.ts +1 -1
- package/es/components/Tearsheet/TearsheetNarrow.d.ts +1 -1
- package/es/components/Tearsheet/TearsheetShell.d.ts +1 -1
- package/es/components/Tearsheet/TearsheetShell.js +2 -1
- package/es/global/js/hooks/useCreateComponentStepChange.d.ts +3 -1
- package/es/global/js/hooks/useCreateComponentStepChange.js +18 -2
- package/es/global/js/utils/Wrap.d.ts +4 -0
- package/lib/components/AboutModal/AboutModal.js +22 -5
- package/lib/components/ActionBar/ActionBar.d.ts +5 -1
- package/lib/components/ActionBar/ActionBar.js +13 -3
- package/lib/components/ActionBar/ActionBarOverflowItems.d.ts +12 -3
- package/lib/components/ActionBar/ActionBarOverflowItems.js +13 -3
- package/lib/components/Carousel/Carousel.js +1 -2
- package/lib/components/Coachmark/CoachmarkDragbar.js +0 -1
- package/lib/components/Coachmark/CoachmarkHeader.js +0 -1
- package/lib/components/CoachmarkOverlayElement/CoachmarkOverlayElement.js +0 -1
- package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +0 -1
- package/lib/components/CoachmarkStack/CoachmarkStackHome.js +1 -2
- package/lib/components/ConditionBuilder/ConditionBuilder.js +1 -3
- package/lib/components/CreateTearsheet/CreateTearsheet.d.ts +6 -0
- package/lib/components/CreateTearsheet/CreateTearsheet.js +13 -1
- package/lib/components/CreateTearsheet/CreateTearsheetStep.d.ts +18 -0
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +29 -2
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +4 -1
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +3 -20
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +7 -2
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -3
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +4 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +3 -1
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/stateReducer.d.ts +7 -0
- package/lib/components/Datagrid/Datagrid/addons/stateReducer.js +99 -40
- package/lib/components/Datagrid/types/index.d.ts +2 -0
- package/lib/components/Datagrid/useDisableSelectRows.js +18 -3
- package/lib/components/Datagrid/useFlexResize.d.ts +0 -6
- package/lib/components/Datagrid/useFlexResize.js +32 -16
- package/lib/components/Datagrid/useSortableColumns.js +2 -1
- package/lib/components/EditUpdateCards/EditUpdateCards.d.ts +1 -1
- package/lib/components/EditUpdateCards/EditUpdateCards.js +1 -2
- package/lib/components/PageHeader/PageHeader.js +11 -1
- package/lib/components/PageHeader/PageHeaderUtils.js +0 -5
- package/lib/components/SidePanel/SidePanel.js +6 -6
- package/lib/components/TagOverflow/TagOverflow.d.ts +1 -1
- package/lib/components/TagOverflow/TagOverflow.js +1 -2
- package/lib/components/TagSet/TagSet.d.ts +8 -6
- package/lib/components/TagSet/TagSet.js +38 -30
- package/lib/components/TagSet/TagSetOverflow.d.ts +4 -0
- package/lib/components/TagSet/TagSetOverflow.js +8 -2
- package/lib/components/Tearsheet/Tearsheet.d.ts +1 -1
- package/lib/components/Tearsheet/TearsheetNarrow.d.ts +1 -1
- package/lib/components/Tearsheet/TearsheetShell.d.ts +1 -1
- package/lib/components/Tearsheet/TearsheetShell.js +2 -1
- package/lib/global/js/hooks/useCreateComponentStepChange.d.ts +3 -1
- package/lib/global/js/hooks/useCreateComponentStepChange.js +18 -2
- package/lib/global/js/utils/Wrap.d.ts +4 -0
- package/package.json +12 -12
- package/scss/components/Datagrid/styles/_useSortableColumns.scss +1 -0
- package/scss/components/Tearsheet/_tearsheet.scss +2 -0
- package/telemetry.yml +6 -0
@@ -6,11 +6,12 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
-
import { ComposedModal, ModalHeader, ModalBody, Theme, ModalFooter } from '@carbon/react';
|
9
|
+
import { unstable_FeatureFlags, ComposedModal, ModalHeader, ModalBody, Theme, ModalFooter } from '@carbon/react';
|
10
10
|
import React__default, { useRef, useEffect } from 'react';
|
11
11
|
import PropTypes from '../../node_modules/prop-types/index.js';
|
12
12
|
import cx from 'classnames';
|
13
13
|
import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
14
|
+
import { useFocus } from '../../global/js/hooks/useFocus.js';
|
14
15
|
import { pkg } from '../../settings.js';
|
15
16
|
import { usePortalTarget } from '../../global/js/hooks/usePortalTarget.js';
|
16
17
|
import uuidv4 from '../../global/js/utils/uuidv4.js';
|
@@ -45,9 +46,13 @@ var AboutModal = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
45
46
|
version = _ref.version,
|
46
47
|
rest = _objectWithoutProperties(_ref, _excluded);
|
47
48
|
var bodyRef = useRef(null);
|
49
|
+
var localRef = useRef();
|
50
|
+
var modalRef = ref || localRef;
|
48
51
|
var contentRef = useRef(null);
|
49
52
|
var contentId = uuidv4();
|
50
53
|
var renderPortalUse = usePortalTarget(portalTargetIn);
|
54
|
+
var _useFocus = useFocus(modalRef),
|
55
|
+
firstElement = _useFocus.firstElement;
|
51
56
|
|
52
57
|
// We can't add a ref directly to the ModalBody, so track it in a ref
|
53
58
|
// as the parent of the current bodyRef element
|
@@ -55,16 +60,28 @@ var AboutModal = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
55
60
|
var _contentRef$current;
|
56
61
|
bodyRef.current = (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.parentElement;
|
57
62
|
}, [bodyRef]);
|
58
|
-
|
63
|
+
useEffect(function () {
|
64
|
+
if (open) {
|
65
|
+
setTimeout(function () {
|
66
|
+
return firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
|
67
|
+
}, 0);
|
68
|
+
}
|
69
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
70
|
+
}, [open]);
|
71
|
+
return renderPortalUse( /*#__PURE__*/React__default.createElement(unstable_FeatureFlags, {
|
72
|
+
flags: {
|
73
|
+
'enable-experimental-focus-wrap-without-sentinels': true
|
74
|
+
}
|
75
|
+
}, /*#__PURE__*/React__default.createElement(ComposedModal, _extends({}, rest, {
|
59
76
|
className: cx(blockClass,
|
60
77
|
// Apply the block class to the main HTML element
|
61
78
|
className // Apply any supplied class names to the main HTML element.
|
62
79
|
),
|
63
|
-
"aria-label": modalAriaLabel
|
80
|
+
"aria-label": modalAriaLabel,
|
81
|
+
ref: modalRef
|
64
82
|
}, _objectSpread2({
|
65
83
|
onClose: onClose,
|
66
|
-
open: open
|
67
|
-
ref: ref
|
84
|
+
open: open
|
68
85
|
}, getDevtoolsProps(componentName))), /*#__PURE__*/React__default.createElement("div", {
|
69
86
|
className: "".concat(blockClass, "__logo")
|
70
87
|
}, logo), /*#__PURE__*/React__default.createElement(ModalHeader, {
|
@@ -95,7 +112,7 @@ var AboutModal = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
95
112
|
theme: "g100"
|
96
113
|
}, /*#__PURE__*/React__default.createElement(ModalFooter, {
|
97
114
|
className: "".concat(blockClass, "__footer")
|
98
|
-
}, additionalInfo))));
|
115
|
+
}, additionalInfo)))));
|
99
116
|
});
|
100
117
|
|
101
118
|
// Return a placeholder if not released and not enabled by feature flag
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
1
|
+
import React, { PropsWithChildren, ForwardedRef } from 'react';
|
2
2
|
import { ButtonProps } from '@carbon/type';
|
3
3
|
import { CarbonIconType } from '@carbon/icons-react/lib/CarbonIcon';
|
4
4
|
interface Action extends ButtonProps {
|
@@ -49,6 +49,10 @@ interface ActionBarProps extends PropsWithChildren {
|
|
49
49
|
* overflowAriaLabel label for open close button overflow used for action bar items that do nto fit.
|
50
50
|
*/
|
51
51
|
overflowAriaLabel: string;
|
52
|
+
/**
|
53
|
+
* overflowMenuRef for the overflow menu width that is needed to calculate the width of the action bar with overflow
|
54
|
+
*/
|
55
|
+
overflowMenuRef?: ForwardedRef<HTMLDivElement>;
|
52
56
|
/**
|
53
57
|
* align tags to right of available space
|
54
58
|
*/
|
@@ -17,7 +17,7 @@ import { prepareProps } from '../../global/js/utils/props-helper.js';
|
|
17
17
|
import { ActionBarItem } from './ActionBarItem.js';
|
18
18
|
import { ActionBarOverflowItems } from './ActionBarOverflowItems.js';
|
19
19
|
|
20
|
-
var _excluded = ["actions", "className", "maxVisible", "menuOptionsClass", "onWidthChange", "overflowAriaLabel", "rightAlign"],
|
20
|
+
var _excluded = ["actions", "className", "maxVisible", "menuOptionsClass", "onWidthChange", "overflowAriaLabel", "overflowMenuRef", "rightAlign"],
|
21
21
|
_excluded2 = ["key", "id"],
|
22
22
|
_excluded3 = ["key"];
|
23
23
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
@@ -41,6 +41,7 @@ var ActionBar = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
41
41
|
menuOptionsClass = _ref.menuOptionsClass,
|
42
42
|
onWidthChange = _ref.onWidthChange,
|
43
43
|
overflowAriaLabel = _ref.overflowAriaLabel,
|
44
|
+
overflowMenuRef = _ref.overflowMenuRef,
|
44
45
|
rightAlign = _ref.rightAlign,
|
45
46
|
rest = _objectWithoutProperties(_ref, _excluded);
|
46
47
|
var _useState = useState(0),
|
@@ -72,6 +73,7 @@ var ActionBar = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
72
73
|
}, /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(ActionBarOverflowItems, {
|
73
74
|
className: "".concat(blockClass, "__hidden-sizing-item"),
|
74
75
|
overflowAriaLabel: "hidden sizing overflow items",
|
76
|
+
overflowMenuRef: overflowMenuRef,
|
75
77
|
overflowItems: [],
|
76
78
|
key: "hidden-overflow-menu",
|
77
79
|
tabIndex: -1
|
@@ -87,7 +89,7 @@ var ActionBar = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
87
89
|
tabIndex: -1
|
88
90
|
}));
|
89
91
|
}))));
|
90
|
-
}, [actions]);
|
92
|
+
}, [actions, overflowMenuRef]);
|
91
93
|
|
92
94
|
// creates displayed items based on actions, displayCount and alignment
|
93
95
|
useEffect(function () {
|
@@ -108,12 +110,13 @@ var ActionBar = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
108
110
|
newDisplayedItems.push( /*#__PURE__*/React__default.createElement(ActionBarOverflowItems, {
|
109
111
|
menuOptionsClass: menuOptionsClass,
|
110
112
|
overflowAriaLabel: overflowAriaLabel,
|
113
|
+
overflowMenuRef: overflowMenuRef,
|
111
114
|
overflowItems: newOverflowItems,
|
112
115
|
key: "overflow-menu-".concat(internalId.current)
|
113
116
|
}));
|
114
117
|
}
|
115
118
|
setDisplayedItems(newDisplayedItems);
|
116
|
-
}, [actions, displayCount, overflowAriaLabel, menuOptionsClass]);
|
119
|
+
}, [actions, displayCount, overflowAriaLabel, menuOptionsClass, overflowMenuRef]);
|
117
120
|
|
118
121
|
// determine display count based on space available and width of pageActions
|
119
122
|
var checkFullyVisibleItems = function checkFullyVisibleItems() {
|
@@ -250,6 +253,13 @@ ActionBar.propTypes = {
|
|
250
253
|
* overflowAriaLabel label for open close button overflow used for action bar items that do nto fit.
|
251
254
|
*/
|
252
255
|
overflowAriaLabel: PropTypes.string.isRequired,
|
256
|
+
/**
|
257
|
+
* overflowMenuRef for the overflow menu width that is needed to calculate the width of the action bar with overflow
|
258
|
+
*/
|
259
|
+
/**@ts-ignore */
|
260
|
+
overflowMenuRef: PropTypes.oneOfType([PropTypes.shape({
|
261
|
+
current: PropTypes.elementType
|
262
|
+
}), PropTypes.object]),
|
253
263
|
/**
|
254
264
|
* align tags to right of available space
|
255
265
|
*/
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { PropsWithChildren, ReactElement } from 'react';
|
1
|
+
import { PropsWithChildren, ReactElement, ForwardedRef } from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import { CarbonIconType } from '@carbon/icons-react/lib/CarbonIcon';
|
4
4
|
type OverflowItem = {
|
@@ -16,9 +16,13 @@ interface ActionBarOverflowItemProps extends PropsWithChildren {
|
|
16
16
|
*/
|
17
17
|
menuOptionsClass?: string;
|
18
18
|
/**
|
19
|
-
* overflowAriaLabel label for open close button overflow used for action bar items that do
|
19
|
+
* overflowAriaLabel label for open close button overflow used for action bar items that do not fit.
|
20
20
|
*/
|
21
21
|
overflowAriaLabel?: string;
|
22
|
+
/**
|
23
|
+
* overflowMenuRef for the overflow menu width that is needed to calculate the width of the action bar with overflow
|
24
|
+
*/
|
25
|
+
overflowMenuRef?: ForwardedRef<HTMLDivElement>;
|
22
26
|
/**
|
23
27
|
* overflowItems: items to bre shown in the ActionBar overflow menu
|
24
28
|
*/
|
@@ -29,7 +33,7 @@ interface ActionBarOverflowItemProps extends PropsWithChildren {
|
|
29
33
|
tabIndex?: number;
|
30
34
|
}
|
31
35
|
export declare const ActionBarOverflowItems: {
|
32
|
-
({ className, menuOptionsClass, overflowItems, overflowAriaLabel, }: ActionBarOverflowItemProps): import("react/jsx-runtime").JSX.Element;
|
36
|
+
({ className, menuOptionsClass, overflowItems, overflowAriaLabel, overflowMenuRef, }: ActionBarOverflowItemProps): import("react/jsx-runtime").JSX.Element;
|
33
37
|
displayName: string;
|
34
38
|
propTypes: {
|
35
39
|
/**
|
@@ -48,6 +52,11 @@ export declare const ActionBarOverflowItems: {
|
|
48
52
|
* overflowItems: items to bre shown in the ActionBar overflow menu
|
49
53
|
*/
|
50
54
|
overflowItems: PropTypes.Requireable<(PropTypes.ReactElementLike | null | undefined)[]>;
|
55
|
+
/**
|
56
|
+
* overflowMenuRef for the overflow menu width that is needed to calculate the width of the action bar with overflow
|
57
|
+
*/
|
58
|
+
/**@ts-ignore */
|
59
|
+
overflowMenuRef: PropTypes.Requireable<object>;
|
51
60
|
/**
|
52
61
|
* Optional tab index
|
53
62
|
*/
|
@@ -19,9 +19,12 @@ var ActionBarOverflowItems = function ActionBarOverflowItems(_ref) {
|
|
19
19
|
var className = _ref.className,
|
20
20
|
menuOptionsClass = _ref.menuOptionsClass,
|
21
21
|
overflowItems = _ref.overflowItems,
|
22
|
-
overflowAriaLabel = _ref.overflowAriaLabel
|
22
|
+
overflowAriaLabel = _ref.overflowAriaLabel,
|
23
|
+
overflowMenuRef = _ref.overflowMenuRef;
|
23
24
|
var internalId = useRef(uuidv4());
|
24
|
-
return /*#__PURE__*/React__default.createElement(
|
25
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
26
|
+
ref: overflowMenuRef
|
27
|
+
}, /*#__PURE__*/React__default.createElement(OverflowMenu, {
|
25
28
|
"aria-label": overflowAriaLabel,
|
26
29
|
className: cx(blockClass, className),
|
27
30
|
direction: "bottom",
|
@@ -45,7 +48,7 @@ var ActionBarOverflowItems = function ActionBarOverflowItems(_ref) {
|
|
45
48
|
id: "".concat(internalId.current, "-").concat(index, "--item-label")
|
46
49
|
}, item === null || item === void 0 ? void 0 : item.props.label), typeof (item === null || item === void 0 ? void 0 : item.props.renderIcon) === 'function' ? /*#__PURE__*/React__default.createElement(ItemIcon, null) : item === null || item === void 0 ? void 0 : item.props.renderIcon)
|
47
50
|
});
|
48
|
-
}));
|
51
|
+
})));
|
49
52
|
};
|
50
53
|
ActionBarOverflowItems.displayName = componentName;
|
51
54
|
ActionBarOverflowItems.propTypes = {
|
@@ -66,6 +69,13 @@ ActionBarOverflowItems.propTypes = {
|
|
66
69
|
* overflowItems: items to bre shown in the ActionBar overflow menu
|
67
70
|
*/
|
68
71
|
overflowItems: PropTypes.arrayOf(PropTypes.element),
|
72
|
+
/**
|
73
|
+
* overflowMenuRef for the overflow menu width that is needed to calculate the width of the action bar with overflow
|
74
|
+
*/
|
75
|
+
/**@ts-ignore */
|
76
|
+
overflowMenuRef: PropTypes.oneOfType([PropTypes.shape({
|
77
|
+
current: PropTypes.elementType
|
78
|
+
}), PropTypes.object]),
|
69
79
|
/**
|
70
80
|
* Optional tab index
|
71
81
|
*/
|
@@ -267,8 +267,7 @@ var Carousel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
267
267
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
268
268
|
tabIndex: -1,
|
269
269
|
className: cx(blockClass, className),
|
270
|
-
ref: carouselRef
|
271
|
-
role: "main"
|
270
|
+
ref: carouselRef
|
272
271
|
}, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement("div", {
|
273
272
|
className: cx("".concat(blockClass, "__elements-container"))
|
274
273
|
}, /*#__PURE__*/React__default.createElement("div", {
|
@@ -84,7 +84,6 @@ var CoachmarkDragbar = /*#__PURE__*/React__default.forwardRef(function (_ref, re
|
|
84
84
|
// example: [`${blockClass}__here-if-small`]: size === 'sm',
|
85
85
|
}),
|
86
86
|
ref: ref
|
87
|
-
// role="main"
|
88
87
|
}, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement("button", {
|
89
88
|
type: "button",
|
90
89
|
className: "".concat(overlayBlockClass, "__handle"),
|
@@ -43,7 +43,6 @@ var CoachmarkHeader = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
|
|
43
43
|
return /*#__PURE__*/React__default.createElement("header", _extends({}, rest, {
|
44
44
|
className: cx(blockClass, "".concat(blockClass, "__").concat(theme)),
|
45
45
|
ref: ref
|
46
|
-
// role="main"
|
47
46
|
}, getDevtoolsProps(componentName)), showCloseButton && /*#__PURE__*/React__default.createElement("div", {
|
48
47
|
className: "".concat(overlayBlockClass, "--close-btn-container")
|
49
48
|
}, /*#__PURE__*/React__default.createElement(Button, {
|
@@ -39,7 +39,6 @@ var CoachmarkOverlayElement = /*#__PURE__*/React__default.forwardRef(function (_
|
|
39
39
|
// example: [`${blockClass}__here-if-small`]: size === 'sm',
|
40
40
|
}),
|
41
41
|
ref: ref
|
42
|
-
// role="main"
|
43
42
|
}, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement("div", {
|
44
43
|
className: "".concat(blockClass, "__content")
|
45
44
|
}, title && /*#__PURE__*/React__default.createElement("h2", {
|
@@ -111,7 +111,6 @@ var CoachmarkOverlayElements = /*#__PURE__*/React__default.forwardRef(function (
|
|
111
111
|
// example: [`${blockClass}__here-if-small`]: size === 'sm',
|
112
112
|
}),
|
113
113
|
ref: ref
|
114
|
-
// role="main"
|
115
114
|
}, getDevtoolsProps(componentName)), media && (media.render ? media.render() : /*#__PURE__*/React__default.createElement(SteppedAnimatedMedia, {
|
116
115
|
className: "".concat(blockClass, "__element-stepped-media"),
|
117
116
|
filePaths: media.filePaths,
|
@@ -80,8 +80,7 @@ var CoachmarkStackHome = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
80
80
|
}
|
81
81
|
return portalNode !== null && portalNode !== void 0 && portalNode.current ? /*#__PURE__*/createPortal( /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
82
82
|
className: cx(blockClass, className),
|
83
|
-
ref: ref
|
84
|
-
role: "main"
|
83
|
+
ref: ref
|
85
84
|
}, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement(CoachmarkHeader, {
|
86
85
|
onClose: function onClose() {
|
87
86
|
setLinkFocusIndex(0);
|
@@ -80,7 +80,6 @@ var ConditionBuilder = /*#__PURE__*/React__default.forwardRef(function (_ref, re
|
|
80
80
|
// switched classes dependant on props or state
|
81
81
|
// example: [`${blockClass}__here-if-small`]: size === 'sm',
|
82
82
|
}),
|
83
|
-
role: "main",
|
84
83
|
ref: conditionBuilderRef
|
85
84
|
}, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement(VStack, {
|
86
85
|
className: "".concat(blockClass, "__").concat(variant),
|
@@ -171,8 +170,7 @@ ConditionBuilder.propTypes = {
|
|
171
170
|
}),
|
172
171
|
/**
|
173
172
|
* This is a mandatory prop that defines the input to the condition builder.
|
174
|
-
|
175
|
-
*/
|
173
|
+
*/
|
176
174
|
/**@ts-ignore */
|
177
175
|
inputConfig: PropTypes.shape({
|
178
176
|
properties: PropTypes.arrayOf(PropTypes.shape({
|
@@ -5,8 +5,10 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
import React, { Dispatch, PropsWithChildren, ReactNode, SetStateAction } from 'react';
|
8
|
+
import { ExperimentalSecondarySubmit } from './CreateTearsheetStep';
|
8
9
|
export interface StepsContextType {
|
9
10
|
currentStep: number;
|
11
|
+
setExperimentalSecondarySubmit: Dispatch<SetStateAction<ExperimentalSecondarySubmit>>;
|
10
12
|
setIsDisabled: Dispatch<SetStateAction<boolean>>;
|
11
13
|
setOnPrevious: (fn: any) => void;
|
12
14
|
setOnNext: (fn: any) => void;
|
@@ -32,6 +34,10 @@ export interface CreateTearsheetProps extends PropsWithChildren {
|
|
32
34
|
* An optional class or classes to be added to the outermost element.
|
33
35
|
*/
|
34
36
|
className?: string;
|
37
|
+
/**
|
38
|
+
* The experimentalSecondary submit button text
|
39
|
+
*/
|
40
|
+
experimentalSecondarySubmitText?: string;
|
35
41
|
/**
|
36
42
|
* A description of the flow, displayed in the header area of the tearsheet.
|
37
43
|
*/
|
@@ -22,7 +22,7 @@ import { useResetCreateComponent } from '../../global/js/hooks/useResetCreateCom
|
|
22
22
|
import { useCreateComponentStepChange } from '../../global/js/hooks/useCreateComponentStepChange.js';
|
23
23
|
import { CreateInfluencer } from '../CreateInfluencer/CreateInfluencer.js';
|
24
24
|
|
25
|
-
var _excluded = ["backButtonText", "cancelButtonText", "children", "className", "description", "influencerWidth", "initialStep", "label", "nextButtonText", "onClose", "onRequestSubmit", "open", "firstFocusElement", "slug", "submitButtonText", "title", "verticalPosition"];
|
25
|
+
var _excluded = ["backButtonText", "cancelButtonText", "children", "className", "experimentalSecondarySubmitText", "description", "influencerWidth", "initialStep", "label", "nextButtonText", "onClose", "onRequestSubmit", "open", "firstFocusElement", "slug", "submitButtonText", "title", "verticalPosition"];
|
26
26
|
var componentName = 'CreateTearsheet';
|
27
27
|
var blockClass = "".concat(pkg.prefix, "--tearsheet-create");
|
28
28
|
|
@@ -40,6 +40,7 @@ var CreateTearsheet = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
40
40
|
cancelButtonText = _ref.cancelButtonText,
|
41
41
|
children = _ref.children,
|
42
42
|
className = _ref.className,
|
43
|
+
experimentalSecondarySubmitText = _ref.experimentalSecondarySubmitText,
|
43
44
|
description = _ref.description,
|
44
45
|
_ref$influencerWidth = _ref.influencerWidth,
|
45
46
|
influencerWidth = _ref$influencerWidth === void 0 ? 'narrow' : _ref$influencerWidth,
|
@@ -104,6 +105,10 @@ var CreateTearsheet = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
104
105
|
_useState24 = _slicedToArray(_useState23, 2),
|
105
106
|
lastIncludedStep = _useState24[0],
|
106
107
|
setLastIncludedStep = _useState24[1];
|
108
|
+
var _useState25 = useState({}),
|
109
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
110
|
+
experimentalSecondarySubmit = _useState26[0],
|
111
|
+
setExperimentalSecondarySubmit = _useState26[1];
|
107
112
|
var previousState = usePreviousValue({
|
108
113
|
currentStep: currentStep,
|
109
114
|
open: open
|
@@ -170,6 +175,8 @@ var CreateTearsheet = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
170
175
|
nextButtonText: nextButtonText,
|
171
176
|
isSubmitting: isSubmitting,
|
172
177
|
componentBlockClass: blockClass,
|
178
|
+
experimentalSecondarySubmit: experimentalSecondarySubmit,
|
179
|
+
experimentalSecondarySubmitText: experimentalSecondarySubmit.labelText ? experimentalSecondarySubmit.labelText : experimentalSecondarySubmitText,
|
173
180
|
setCreateComponentActions: setCreateTearsheetActions
|
174
181
|
});
|
175
182
|
return /*#__PURE__*/React__default.createElement(TearsheetShell, _extends({}, getDevtoolsProps(componentName), rest, {
|
@@ -198,6 +205,7 @@ var CreateTearsheet = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
198
205
|
}, /*#__PURE__*/React__default.createElement(StepsContext.Provider, {
|
199
206
|
value: {
|
200
207
|
currentStep: currentStep,
|
208
|
+
setExperimentalSecondarySubmit: setExperimentalSecondarySubmit,
|
201
209
|
setIsDisabled: setIsDisabled,
|
202
210
|
setOnPrevious: function setOnPrevious(fn) {
|
203
211
|
return _setOnPrevious(function () {
|
@@ -254,6 +262,10 @@ CreateTearsheet.propTypes = {
|
|
254
262
|
* A description of the flow, displayed in the header area of the tearsheet.
|
255
263
|
*/
|
256
264
|
description: PropTypes.node,
|
265
|
+
/**
|
266
|
+
* The experimentalSecondary submit button text
|
267
|
+
*/
|
268
|
+
experimentalSecondarySubmitText: PropTypes.string,
|
257
269
|
/**
|
258
270
|
* Specifies elements to focus on first on render.
|
259
271
|
*/
|
@@ -49,6 +49,10 @@ interface CreateTearsheetStepBaseProps extends PropsWithChildren {
|
|
49
49
|
* This will conditionally disable the submit button in the multi step Tearsheet
|
50
50
|
*/
|
51
51
|
disableSubmit?: boolean;
|
52
|
+
/**
|
53
|
+
* Configuration options for customizing the behavior of the experimentalSecondary submit button.
|
54
|
+
*/
|
55
|
+
experimentalSecondarySubmit?: ExperimentalSecondarySubmit;
|
52
56
|
/**
|
53
57
|
* This prop is used to help track dynamic steps. If this value is `false` then the step is not included in the visible steps or the ProgressIndicator
|
54
58
|
* steps. If this value is `true` then the step will be included in the list of visible steps, as well as being included in the ProgressIndicator step list
|
@@ -91,5 +95,19 @@ interface CreateTearsheetStepBaseProps extends PropsWithChildren {
|
|
91
95
|
title: React.ReactNode;
|
92
96
|
}
|
93
97
|
type CreateTearsheetStepProps = CreateTearsheetStepBaseProps & fieldsetLegendTextProps;
|
98
|
+
/**
|
99
|
+
* Configuration options for customizing the behavior of the experimentalSecondary submit button.
|
100
|
+
*
|
101
|
+
* @property {string} [labelText] - Optional text to replace the default button text.
|
102
|
+
* @property {boolean} [disabled] - If true, the button will be disabled and not clickable.
|
103
|
+
* @property {boolean} [hideSecondarySubmit] - If true, the button will be hidden from view.
|
104
|
+
* @property {() => void} [onClick] - Optional click handler function to be executed when the button is clicked.
|
105
|
+
*/
|
106
|
+
export type ExperimentalSecondarySubmit = {
|
107
|
+
labelText?: string;
|
108
|
+
disabled?: boolean;
|
109
|
+
hideSecondarySubmit?: boolean;
|
110
|
+
onClick?: () => void;
|
111
|
+
};
|
94
112
|
export declare let CreateTearsheetStep: React.ForwardRefExoticComponent<CreateTearsheetStepProps & React.RefAttributes<unknown>>;
|
95
113
|
export {};
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import React__default, { forwardRef, useRef, useContext, useState, useEffect, isValidElement } from 'react';
|
10
10
|
import PropTypes from '../../node_modules/prop-types/index.js';
|
11
11
|
import cx from 'classnames';
|
@@ -16,7 +16,7 @@ import pconsole from '../../global/js/utils/pconsole.js';
|
|
16
16
|
import { usePreviousValue } from '../../global/js/hooks/usePreviousValue.js';
|
17
17
|
import { useRetrieveStepData } from '../../global/js/hooks/useRetrieveStepData.js';
|
18
18
|
|
19
|
-
var _excluded = ["children", "className", "description", "disableSubmit", "fieldsetLegendText", "hasFieldset", "includeStep", "introStep", "invalid", "onMount", "onNext", "onPrevious", "secondaryLabel", "subtitle", "title"];
|
19
|
+
var _excluded = ["children", "className", "description", "disableSubmit", "experimentalSecondarySubmit", "fieldsetLegendText", "hasFieldset", "includeStep", "introStep", "invalid", "onMount", "onNext", "onPrevious", "secondaryLabel", "subtitle", "title"];
|
20
20
|
var componentName = 'CreateTearsheetStep';
|
21
21
|
var blockClass = "".concat(pkg.prefix, "--tearsheet-create__step");
|
22
22
|
|
@@ -25,11 +25,22 @@ var defaults = {
|
|
25
25
|
hasFieldset: true,
|
26
26
|
includeStep: true
|
27
27
|
};
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Configuration options for customizing the behavior of the experimentalSecondary submit button.
|
31
|
+
*
|
32
|
+
* @property {string} [labelText] - Optional text to replace the default button text.
|
33
|
+
* @property {boolean} [disabled] - If true, the button will be disabled and not clickable.
|
34
|
+
* @property {boolean} [hideSecondarySubmit] - If true, the button will be hidden from view.
|
35
|
+
* @property {() => void} [onClick] - Optional click handler function to be executed when the button is clicked.
|
36
|
+
*/
|
37
|
+
|
28
38
|
var CreateTearsheetStep = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
29
39
|
var children = _ref.children,
|
30
40
|
className = _ref.className,
|
31
41
|
description = _ref.description,
|
32
42
|
disableSubmit = _ref.disableSubmit,
|
43
|
+
experimentalSecondarySubmit = _ref.experimentalSecondarySubmit,
|
33
44
|
fieldsetLegendText = _ref.fieldsetLegendText,
|
34
45
|
_ref$hasFieldset = _ref.hasFieldset,
|
35
46
|
hasFieldset = _ref$hasFieldset === void 0 ? defaults.hasFieldset : _ref$hasFieldset,
|
@@ -71,8 +82,9 @@ var CreateTearsheetStep = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
71
82
|
useEffect(function () {
|
72
83
|
if (stepNumber === (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep) && (previousState === null || previousState === void 0 ? void 0 : previousState.currentStep) !== (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)) {
|
73
84
|
stepsContext === null || stepsContext === void 0 || stepsContext.setOnMount(onMount);
|
85
|
+
stepsContext === null || stepsContext === void 0 || stepsContext.setExperimentalSecondarySubmit(_objectSpread2({}, experimentalSecondarySubmit));
|
74
86
|
}
|
75
|
-
}, [onMount, stepsContext, stepNumber, previousState === null || previousState === void 0 ? void 0 : previousState.currentStep]);
|
87
|
+
}, [onMount, experimentalSecondarySubmit, stepsContext, stepNumber, previousState === null || previousState === void 0 ? void 0 : previousState.currentStep]);
|
76
88
|
|
77
89
|
// Used to take the `includeStep` prop and use it as a local state value
|
78
90
|
useEffect(function () {
|
@@ -163,6 +175,21 @@ CreateTearsheetStep.propTypes = {
|
|
163
175
|
* This will conditionally disable the submit button in the multi step Tearsheet
|
164
176
|
*/
|
165
177
|
disableSubmit: PropTypes.bool,
|
178
|
+
/**
|
179
|
+
* Configuration options for customizing the behavior of the experimentalSecondary submit button.
|
180
|
+
*
|
181
|
+
* @property {string} [labelText] - Optional text to replace the default button text.
|
182
|
+
* @property {boolean} [disabled] - If true, the button will be disabled and not clickable.
|
183
|
+
* @property {boolean} [hideSecondarySubmit] - If true, the button will be hidden from view.
|
184
|
+
* @property {() => void} [onClick] - Optional click handler function to be executed when the button is clicked.
|
185
|
+
*/
|
186
|
+
/**@ts-ignore*/
|
187
|
+
experimentalSecondarySubmit: PropTypes.shape({
|
188
|
+
labelText: PropTypes.string,
|
189
|
+
disabled: PropTypes.bool,
|
190
|
+
hideSecondarySubmit: PropTypes.bool,
|
191
|
+
onClick: PropTypes.func
|
192
|
+
}),
|
166
193
|
/**
|
167
194
|
* This is the required legend text that appears above a fieldset html element for accessibility purposes.
|
168
195
|
* You can set the `hasFieldset` prop to false if you have multiple fieldset elements or want to control the children of your Full Page's step content.
|
@@ -159,7 +159,10 @@ var DatagridContent = function DatagridContent(_ref) {
|
|
159
159
|
className: "".concat(blockClass, "__filter-summary"),
|
160
160
|
filters: filterTags,
|
161
161
|
clearFilters: function clearFilters() {
|
162
|
-
|
162
|
+
EventEmitter.dispatch(CLEAR_FILTERS, tableId);
|
163
|
+
if (typeof (filterProps === null || filterProps === void 0 ? void 0 : filterProps.onClearFilters) === 'function') {
|
164
|
+
filterProps.onClearFilters();
|
165
|
+
}
|
163
166
|
},
|
164
167
|
renderLabel: filterProps === null || filterProps === void 0 ? void 0 : filterProps.renderLabel,
|
165
168
|
overflowType: "tag"
|
@@ -10,7 +10,7 @@ import React__default, { useState, useLayoutEffect } from 'react';
|
|
10
10
|
import { TableSelectAll } from '@carbon/react';
|
11
11
|
import cx from 'classnames';
|
12
12
|
import { pkg } from '../../../settings.js';
|
13
|
-
import {
|
13
|
+
import { handleOnPageSelectAllRowData } from './addons/stateReducer.js';
|
14
14
|
|
15
15
|
var _excluded = ["onChange"];
|
16
16
|
var blockClass = "".concat(pkg.prefix, "--datagrid");
|
@@ -45,7 +45,6 @@ var SelectAll = function SelectAll(datagridState) {
|
|
45
45
|
dispatch = datagridState.dispatch,
|
46
46
|
rows = datagridState.rows,
|
47
47
|
getRowId = datagridState.getRowId,
|
48
|
-
toggleAllRowsSelected = datagridState.toggleAllRowsSelected,
|
49
48
|
onAllRowSelect = datagridState.onAllRowSelect;
|
50
49
|
var isFirstColumnStickyLeft = ((_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.sticky) === 'left' && withStickyColumn;
|
51
50
|
if (hideSelectAll || radio) {
|
@@ -59,24 +58,8 @@ var SelectAll = function SelectAll(datagridState) {
|
|
59
58
|
onChange = _ref.onChange,
|
60
59
|
selectProps = _objectWithoutProperties(_ref, _excluded);
|
61
60
|
var indeterminate = selectProps.indeterminate;
|
62
|
-
var
|
63
|
-
|
64
|
-
handleSelectAllRowData({
|
65
|
-
dispatch: dispatch,
|
66
|
-
rows: rows,
|
67
|
-
getRowId: getRowId,
|
68
|
-
indeterminate: true,
|
69
|
-
isChecked: undefined
|
70
|
-
});
|
71
|
-
toggleAllRowsSelected(false);
|
72
|
-
onAllRowSelect === null || onAllRowSelect === void 0 || onAllRowSelect(rows, event);
|
73
|
-
return onChange === null || onChange === void 0 ? void 0 : onChange({
|
74
|
-
target: {
|
75
|
-
checked: false
|
76
|
-
}
|
77
|
-
});
|
78
|
-
}
|
79
|
-
handleSelectAllRowData({
|
61
|
+
var handleOnPageSelectAllChange = function handleOnPageSelectAllChange(event) {
|
62
|
+
handleOnPageSelectAllRowData({
|
80
63
|
dispatch: dispatch,
|
81
64
|
rows: rows,
|
82
65
|
getRowId: getRowId,
|
@@ -90,7 +73,7 @@ var SelectAll = function SelectAll(datagridState) {
|
|
90
73
|
className: cx("".concat(blockClass, "__head-select-all"), "".concat(blockClass, "__checkbox-cell"), _defineProperty({}, "".concat(blockClass, "__checkbox-cell-sticky-left"), /* istanbul ignore next */
|
91
74
|
isFirstColumnStickyLeft && Number(windowSize) > 671)),
|
92
75
|
name: "".concat(tableId, "-select-all-checkbox-name"),
|
93
|
-
onSelect:
|
76
|
+
onSelect: handleOnPageSelectAllChange,
|
94
77
|
disabled: isFetching || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled),
|
95
78
|
id: "".concat(tableId, "-select-all-checkbox-id")
|
96
79
|
}));
|
@@ -68,10 +68,15 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
|
|
68
68
|
|
69
69
|
// Sync the scrollLeft position of the virtual body to the table header
|
70
70
|
useEffect(function () {
|
71
|
+
var _document;
|
72
|
+
var headWrapEl = (_document = document) === null || _document === void 0 ? void 0 : _document.querySelector("#".concat(tableId, " .").concat(blockClass, "__head-wrap"));
|
73
|
+
var headEle = headWrapEl === null || headWrapEl === void 0 ? void 0 : headWrapEl.querySelector("thead");
|
74
|
+
if (headEle) {
|
75
|
+
headEle.style.display = 'flex';
|
76
|
+
} // scrollbar width to header column to fix header alignment
|
77
|
+
|
71
78
|
function handleScroll(event) {
|
72
|
-
var _document;
|
73
79
|
var virtualBody = event.target;
|
74
|
-
var headWrapEl = (_document = document) === null || _document === void 0 ? void 0 : _document.querySelector("#".concat(tableId, " .").concat(blockClass, "__head-wrap"));
|
75
80
|
if (headWrapEl) {
|
76
81
|
headWrapEl.scrollLeft = virtualBody === null || virtualBody === void 0 ? void 0 : virtualBody.scrollLeft;
|
77
82
|
}
|
@@ -31,6 +31,9 @@ var defaults = {
|
|
31
31
|
secondaryActionLabel: 'Cancel',
|
32
32
|
align: 'bottom'
|
33
33
|
};
|
34
|
+
|
35
|
+
// Use same empty array every time, for benefit of useEffect() etc. dependency checking.
|
36
|
+
var emptyArray = [];
|
34
37
|
var FilterFlyout = function FilterFlyout(_ref) {
|
35
38
|
var updateMethod = _ref.updateMethod,
|
36
39
|
_ref$flyoutIconDescri = _ref.flyoutIconDescription,
|
@@ -38,7 +41,7 @@ var FilterFlyout = function FilterFlyout(_ref) {
|
|
38
41
|
_ref$align = _ref.align,
|
39
42
|
align = _ref$align === void 0 ? defaults.align : _ref$align,
|
40
43
|
_ref$filters = _ref.filters,
|
41
|
-
filters = _ref$filters === void 0 ?
|
44
|
+
filters = _ref$filters === void 0 ? emptyArray : _ref$filters,
|
42
45
|
_ref$title = _ref.title,
|
43
46
|
title = _ref$title === void 0 ? defaults.title : _ref$title,
|
44
47
|
_ref$primaryActionLab = _ref.primaryActionLabel,
|
@@ -55,9 +58,9 @@ var FilterFlyout = function FilterFlyout(_ref) {
|
|
55
58
|
secondaryActionLabel = _ref$secondaryActionL === void 0 ? defaults.secondaryActionLabel : _ref$secondaryActionL,
|
56
59
|
setAllFilters = _ref.setAllFilters,
|
57
60
|
_ref$data = _ref.data,
|
58
|
-
data = _ref$data === void 0 ?
|
61
|
+
data = _ref$data === void 0 ? emptyArray : _ref$data,
|
59
62
|
_ref$reactTableFilter = _ref.reactTableFiltersState,
|
60
|
-
reactTableFiltersState = _ref$reactTableFilter === void 0 ?
|
63
|
+
reactTableFiltersState = _ref$reactTableFilter === void 0 ? emptyArray : _ref$reactTableFilter;
|
61
64
|
/** State */
|
62
65
|
var _useState = useState(false),
|
63
66
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -34,6 +34,9 @@ var defaults = {
|
|
34
34
|
searchLabelText: 'Filter search',
|
35
35
|
searchPlaceholder: 'Find filters'
|
36
36
|
};
|
37
|
+
|
38
|
+
// Use same empty array every time, for benefit of useEffect() etc. dependency checking.
|
39
|
+
var emptyArray = [];
|
37
40
|
var FilterPanel = function FilterPanel(_ref) {
|
38
41
|
var _ref$title = _ref.title,
|
39
42
|
title = _ref$title === void 0 ? defaults.title : _ref$title,
|
@@ -63,7 +66,7 @@ var FilterPanel = function FilterPanel(_ref) {
|
|
63
66
|
_ref$searchPlaceholde = _ref.searchPlaceholder,
|
64
67
|
searchPlaceholder = _ref$searchPlaceholde === void 0 ? defaults.searchPlaceholder : _ref$searchPlaceholde,
|
65
68
|
_ref$reactTableFilter = _ref.reactTableFiltersState,
|
66
|
-
reactTableFiltersState = _ref$reactTableFilter === void 0 ?
|
69
|
+
reactTableFiltersState = _ref$reactTableFilter === void 0 ? emptyArray : _ref$reactTableFilter,
|
67
70
|
_ref$autoHideFilters = _ref.autoHideFilters,
|
68
71
|
autoHideFilters = _ref$autoHideFilters === void 0 ? false : _ref$autoHideFilters,
|
69
72
|
_ref$isFetching = _ref.isFetching,
|
@@ -16,10 +16,12 @@ import { handleCheckboxChange } from '../handleCheckboxChange.js';
|
|
16
16
|
import uuidv4 from '../../../../../../global/js/utils/uuidv4.js';
|
17
17
|
import { usePreviousValue } from '../../../../../../global/js/hooks/usePreviousValue.js';
|
18
18
|
|
19
|
+
// Use same empty array every time, for benefit of useEffect() etc. dependency checking.
|
20
|
+
var emptyArray = [];
|
19
21
|
var useFilters = function useFilters(_ref) {
|
20
22
|
var updateMethod = _ref.updateMethod,
|
21
23
|
_ref$filters = _ref.filters,
|
22
|
-
filters = _ref$filters === void 0 ?
|
24
|
+
filters = _ref$filters === void 0 ? emptyArray : _ref$filters,
|
23
25
|
setAllFilters = _ref.setAllFilters,
|
24
26
|
variation = _ref.variation,
|
25
27
|
reactTableFiltersState = _ref.reactTableFiltersState,
|