@carbon/ibm-products 2.71.1 → 2.72.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/carbon.css +50 -0
- package/css/carbon.css.map +1 -1
- package/css/index-full-carbon.css +560 -185
- 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 +132 -1
- 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 +570 -245
- 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 +358 -33
- 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/{BigNumbers/BigNumbers.d.ts → BigNumber/BigNumber.d.ts} +5 -5
- package/es/components/{BigNumbers/BigNumbers.js → BigNumber/BigNumber.js} +12 -12
- package/es/components/BigNumber/BigNumberSkeleton.d.ts +17 -0
- package/es/components/{BigNumbers/BigNumbersSkeleton.js → BigNumber/BigNumberSkeleton.js} +16 -16
- package/es/components/{BigNumbers → BigNumber}/constants.d.ts +3 -3
- package/es/components/{BigNumbers → BigNumber}/constants.js +6 -6
- package/es/components/{BigNumbers → BigNumber}/index.d.ts +2 -2
- package/es/components/Coachmark/next/Coachmark/Coachmark.d.ts +72 -0
- package/es/components/Coachmark/next/Coachmark/Coachmark.js +185 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBeacon/CoachmarkBeacon.d.ts +44 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBeacon/index.d.ts +8 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.d.ts +38 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.js +125 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.d.ts +24 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.js +25 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/index.d.ts +10 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts +34 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkContent.js +118 -0
- package/es/components/Coachmark/next/Coachmark/ContentBody.d.ts +23 -0
- package/es/components/Coachmark/next/Coachmark/ContentBody.js +37 -0
- package/es/components/Coachmark/next/Coachmark/ContentHeader.d.ts +21 -0
- package/es/components/Coachmark/next/Coachmark/ContentHeader.js +89 -0
- package/{lib/components/BigNumbers → es/components/Coachmark/next/Coachmark}/index.d.ts +2 -2
- package/es/components/CoachmarkBeacon/CoachmarkBeacon.js +0 -1
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +2 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +11 -5
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +11 -4
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +1 -1
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +42 -3
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +5 -3
- package/es/components/ConditionBuilder/utils/useTranslations.js +1 -1
- package/es/components/EditInPlace/EditInPlace.js +0 -3
- package/es/components/EmptyStates/EmptyState.d.ts +2 -2
- package/es/components/EmptyStates/EmptyState.js +2 -8
- package/es/components/FilterPanel/FilterPanelGroup/index.d.ts +1 -0
- package/es/components/InterstitialScreen/InterstitialScreen.d.ts +1 -25
- package/es/components/InterstitialScreen/InterstitialScreen.js +3 -19
- package/es/components/InterstitialScreen/InterstitialScreenBody.d.ts +1 -1
- package/es/components/InterstitialScreen/InterstitialScreenBody.js +1 -1
- package/es/components/InterstitialScreen/InterstitialScreenFooter.d.ts +1 -1
- package/es/components/InterstitialScreen/InterstitialScreenFooter.js +1 -1
- package/es/components/InterstitialScreen/InterstitialScreenHeader.d.ts +6 -0
- package/es/components/InterstitialScreen/InterstitialScreenHeader.js +1 -1
- package/es/components/InterstitialScreen/_story-assets/InterstitialScreenViewModule/InterstitialScreenViewModule.d.ts +1 -1
- package/es/components/InterstitialScreen/context.d.ts +31 -0
- package/es/components/InterstitialScreen/context.js +18 -0
- package/es/components/InterstitialScreen/index.d.ts +3 -2
- package/es/components/NotificationsPanel/NotificationsPanel.js +36 -13
- package/es/components/PageHeader/PageHeader.d.ts +2 -1
- package/es/components/PageHeader/PageHeader.js +2 -1
- package/es/components/PageHeader/next/PageHeader.d.ts +18 -3
- package/es/components/PageHeader/next/PageHeader.js +260 -12
- package/es/components/PageHeader/next/context.d.ts +25 -0
- package/es/components/PageHeader/next/context.js +30 -0
- package/es/components/PageHeader/next/index.d.ts +3 -3
- package/es/components/PageHeader/next/overflowHandler.d.ts +95 -0
- package/es/components/PageHeader/next/overflowHandler.js +162 -0
- package/es/components/PageHeader/next/utils.d.ts +19 -0
- package/es/components/PageHeader/next/utils.js +68 -0
- package/es/components/ProductiveCard/ProductiveCard.js +2 -1
- package/es/components/ScrollGradient/ScrollGradient.js +1 -2
- package/es/components/SidePanel/SidePanel.d.ts +4 -0
- package/es/components/SidePanel/SidePanel.js +8 -2
- package/es/components/Tearsheet/TearsheetShell.js +8 -5
- package/es/components/TruncatedText/TruncatedText.d.ts +48 -0
- package/es/components/TruncatedText/TruncatedText.js +86 -0
- package/es/components/TruncatedText/index.d.ts +7 -0
- package/es/components/TruncatedText/useTruncatedText.d.ts +16 -0
- package/es/components/TruncatedText/useTruncatedText.js +41 -0
- package/es/components/index.d.ts +3 -1
- package/es/global/js/hooks/useOverflowString.d.ts +2 -2
- package/es/global/js/hooks/useResizeObserver.d.ts +1 -1
- package/es/global/js/package-settings.d.ts +2 -1
- package/es/global/js/package-settings.js +3 -2
- package/es/global/js/utils/checkForOverflow.js +21 -0
- package/es/global/js/utils/makeDraggable/index.d.ts +1 -0
- package/es/global/js/utils/makeDraggable/makeDraggable.d.ts +19 -0
- package/es/global/js/utils/makeDraggable/makeDraggable.js +91 -0
- package/es/global/js/utils/makeDraggable/makeDraggable.stories.d.ts +22 -0
- package/es/index.js +3 -1
- package/es/node_modules/@floating-ui/core/dist/floating-ui.core.js +592 -0
- package/es/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +713 -0
- package/es/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +95 -0
- package/es/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +161 -0
- package/es/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +142 -0
- package/es/settings.d.ts +2 -1
- package/lib/components/{BigNumbers/BigNumbers.d.ts → BigNumber/BigNumber.d.ts} +5 -5
- package/lib/components/{BigNumbers/BigNumbers.js → BigNumber/BigNumber.js} +11 -11
- package/lib/components/BigNumber/BigNumberSkeleton.d.ts +17 -0
- package/lib/components/{BigNumbers/BigNumbersSkeleton.js → BigNumber/BigNumberSkeleton.js} +15 -15
- package/lib/components/{BigNumbers → BigNumber}/constants.d.ts +3 -3
- package/lib/components/{BigNumbers → BigNumber}/constants.js +6 -6
- package/lib/components/BigNumber/index.d.ts +7 -0
- package/lib/components/Coachmark/Coachmark.js +2 -2
- package/lib/components/Coachmark/next/Coachmark/Coachmark.d.ts +72 -0
- package/lib/components/Coachmark/next/Coachmark/Coachmark.js +189 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBeacon/CoachmarkBeacon.d.ts +44 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBeacon/index.d.ts +8 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.d.ts +38 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.js +127 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.d.ts +24 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.js +27 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/index.d.ts +10 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts +34 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.js +122 -0
- package/lib/components/Coachmark/next/Coachmark/ContentBody.d.ts +23 -0
- package/lib/components/Coachmark/next/Coachmark/ContentBody.js +41 -0
- package/lib/components/Coachmark/next/Coachmark/ContentHeader.d.ts +21 -0
- package/lib/components/Coachmark/next/Coachmark/ContentHeader.js +93 -0
- package/lib/components/Coachmark/next/Coachmark/index.d.ts +7 -0
- package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +0 -1
- package/lib/components/CoachmarkFixed/CoachmarkFixed.js +2 -2
- package/lib/components/CoachmarkStack/CoachmarkStack.js +2 -2
- package/lib/components/CoachmarkStack/CoachmarkStackHome.js +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +2 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +11 -5
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +11 -4
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +1 -1
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +41 -2
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +5 -3
- package/lib/components/ConditionBuilder/utils/useTranslations.js +1 -1
- package/lib/components/EditInPlace/EditInPlace.js +0 -3
- package/lib/components/EmptyStates/EmptyState.d.ts +2 -2
- package/lib/components/EmptyStates/EmptyState.js +2 -8
- package/lib/components/FilterPanel/FilterPanelGroup/index.d.ts +1 -0
- package/lib/components/InterstitialScreen/InterstitialScreen.d.ts +1 -25
- package/lib/components/InterstitialScreen/InterstitialScreen.js +6 -25
- package/lib/components/InterstitialScreen/InterstitialScreenBody.d.ts +1 -1
- package/lib/components/InterstitialScreen/InterstitialScreenBody.js +6 -6
- package/lib/components/InterstitialScreen/InterstitialScreenFooter.d.ts +1 -1
- package/lib/components/InterstitialScreen/InterstitialScreenFooter.js +9 -9
- package/lib/components/InterstitialScreen/InterstitialScreenHeader.d.ts +6 -0
- package/lib/components/InterstitialScreen/InterstitialScreenHeader.js +5 -5
- package/lib/components/InterstitialScreen/_story-assets/InterstitialScreenViewModule/InterstitialScreenViewModule.d.ts +1 -1
- package/lib/components/InterstitialScreen/context.d.ts +31 -0
- package/lib/components/InterstitialScreen/context.js +21 -0
- package/lib/components/InterstitialScreen/index.d.ts +3 -2
- package/lib/components/NotificationsPanel/NotificationsPanel.js +36 -13
- package/lib/components/PageHeader/PageHeader.d.ts +2 -1
- package/lib/components/PageHeader/PageHeader.js +2 -1
- package/lib/components/PageHeader/next/PageHeader.d.ts +18 -3
- package/lib/components/PageHeader/next/PageHeader.js +261 -7
- package/lib/components/PageHeader/next/context.d.ts +25 -0
- package/lib/components/PageHeader/next/context.js +33 -0
- package/lib/components/PageHeader/next/index.d.ts +3 -3
- package/lib/components/PageHeader/next/overflowHandler.d.ts +95 -0
- package/lib/components/PageHeader/next/overflowHandler.js +166 -0
- package/lib/components/PageHeader/next/utils.d.ts +19 -0
- package/lib/components/PageHeader/next/utils.js +71 -0
- package/lib/components/ProductiveCard/ProductiveCard.js +2 -1
- package/lib/components/ScrollGradient/ScrollGradient.js +1 -2
- package/lib/components/SidePanel/SidePanel.d.ts +4 -0
- package/lib/components/SidePanel/SidePanel.js +8 -2
- package/lib/components/Tearsheet/TearsheetShell.js +8 -5
- package/lib/components/TruncatedText/TruncatedText.d.ts +48 -0
- package/lib/components/TruncatedText/TruncatedText.js +86 -0
- package/lib/components/TruncatedText/index.d.ts +7 -0
- package/lib/components/TruncatedText/useTruncatedText.d.ts +16 -0
- package/lib/components/TruncatedText/useTruncatedText.js +45 -0
- package/lib/components/index.d.ts +3 -1
- package/lib/global/js/hooks/useOverflowString.d.ts +2 -2
- package/lib/global/js/hooks/usePortalTarget.js +2 -2
- package/lib/global/js/hooks/useResizeObserver.d.ts +1 -1
- package/lib/global/js/package-settings.d.ts +2 -1
- package/lib/global/js/package-settings.js +3 -2
- package/lib/global/js/utils/checkForOverflow.js +23 -0
- package/lib/global/js/utils/makeDraggable/index.d.ts +1 -0
- package/lib/global/js/utils/makeDraggable/makeDraggable.d.ts +19 -0
- package/lib/global/js/utils/makeDraggable/makeDraggable.js +93 -0
- package/lib/global/js/utils/makeDraggable/makeDraggable.stories.d.ts +22 -0
- package/lib/index.js +10 -3
- package/lib/node_modules/@floating-ui/core/dist/floating-ui.core.js +600 -0
- package/lib/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +722 -0
- package/lib/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +102 -0
- package/lib/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +182 -0
- package/lib/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +164 -0
- package/lib/settings.d.ts +2 -1
- package/package.json +9 -10
- package/scss/components/{BigNumbers/_big-numbers.scss → BigNumber/_big-number.scss} +5 -5
- package/scss/components/{BigNumbers → BigNumber}/_carbon-imports.scss +3 -3
- package/scss/components/{BigNumbers → BigNumber}/_index-with-carbon.scss +2 -2
- package/scss/components/{BigNumbers → BigNumber}/_index.scss +2 -2
- package/scss/components/Card/_card.scss +2 -0
- package/scss/components/Coachmark/_bubble.scss +62 -0
- package/scss/components/Coachmark/_coachmark-beacon.scss +164 -0
- package/scss/components/Coachmark/_coachmark.scss +15 -0
- package/scss/components/ConditionBuilder/_condition-builder.scss +8 -0
- package/scss/components/PageHeader/_page-header.scss +144 -1
- package/scss/components/Tearsheet/_tearsheet.scss +6 -0
- package/scss/components/TruncatedText/_carbon-imports.scss +6 -0
- package/scss/components/TruncatedText/_index-with-carbon.scss +9 -0
- package/scss/components/TruncatedText/_index.scss +8 -0
- package/scss/components/TruncatedText/_truncated-text.scss +26 -0
- package/scss/components/_index-with-carbon.scss +3 -2
- package/scss/components/_index.scss +3 -2
- package/telemetry.yml +24 -5
- package/es/components/BigNumbers/BigNumbersSkeleton.d.ts +0 -17
- package/lib/components/BigNumbers/BigNumbersSkeleton.d.ts +0 -17
@@ -0,0 +1,122 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2025
|
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 _rollupPluginBabelHelpers = require('../../../../_virtual/_rollupPluginBabelHelpers.js');
|
13
|
+
var React = require('react');
|
14
|
+
var index = require('../../../../_virtual/index.js');
|
15
|
+
var settings = require('../../../../settings.js');
|
16
|
+
var Coachmark = require('./Coachmark.js');
|
17
|
+
var CoachmarkBubble = require('./CoachmarkBubble/CoachmarkBubble.js');
|
18
|
+
require('./CoachmarkBubble/CoachmarkBubbleHeader.js');
|
19
|
+
var ContentHeader = require('./ContentHeader.js');
|
20
|
+
var ContentBody = require('./ContentBody.js');
|
21
|
+
var cx = require('classnames');
|
22
|
+
|
23
|
+
const CoachmarkContent = /*#__PURE__*/React.forwardRef((props, ref) => {
|
24
|
+
const {
|
25
|
+
className = '',
|
26
|
+
children,
|
27
|
+
highContrast,
|
28
|
+
dropShadow,
|
29
|
+
...rest
|
30
|
+
} = props;
|
31
|
+
const coachmarkContentBlockClass = `${Coachmark.blockClass}--coachmark-content`;
|
32
|
+
const contentBodyClass = `${Coachmark.blockClass}--content-body`;
|
33
|
+
const {
|
34
|
+
align,
|
35
|
+
open,
|
36
|
+
setOpen,
|
37
|
+
triggerRef,
|
38
|
+
setContentRef,
|
39
|
+
floating
|
40
|
+
} = React.useContext(Coachmark.CoachmarkContext);
|
41
|
+
const targetId = open ? triggerRef?.current?.id : null;
|
42
|
+
const handleRef = React.useRef(null);
|
43
|
+
const bubbleRef = ref && typeof ref !== 'function' ? ref : handleRef;
|
44
|
+
React.useEffect(() => {
|
45
|
+
if (open && bubbleRef.current) {
|
46
|
+
requestAnimationFrame(() => {
|
47
|
+
const contentBody = bubbleRef.current.querySelector(`.${contentBodyClass}`);
|
48
|
+
if (contentBody) {
|
49
|
+
const firstFocusable = Array.from(contentBody.querySelectorAll('*')).find(el => el.tabIndex >= 0);
|
50
|
+
firstFocusable?.focus();
|
51
|
+
}
|
52
|
+
});
|
53
|
+
}
|
54
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
55
|
+
}, [open]);
|
56
|
+
React.useEffect(() => {
|
57
|
+
const handleOutsideClick = event => {
|
58
|
+
const targetElement = document.getElementById(targetId || '');
|
59
|
+
const bubbleElement = bubbleRef.current;
|
60
|
+
if (bubbleElement && !bubbleElement.contains(event.target) && targetElement && !targetElement.contains(event.target)) {
|
61
|
+
setOpen?.(false);
|
62
|
+
}
|
63
|
+
};
|
64
|
+
const handleKeyDown = e => {
|
65
|
+
if (e.key === 'Escape') {
|
66
|
+
setOpen?.(false);
|
67
|
+
}
|
68
|
+
};
|
69
|
+
if (open) {
|
70
|
+
document.addEventListener('click', handleOutsideClick);
|
71
|
+
window.addEventListener('keydown', handleKeyDown);
|
72
|
+
}
|
73
|
+
return () => {
|
74
|
+
document.removeEventListener('click', handleOutsideClick);
|
75
|
+
window.removeEventListener('keydown', handleKeyDown);
|
76
|
+
};
|
77
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
78
|
+
}, [open, targetId, setOpen]);
|
79
|
+
React.useEffect(() => {
|
80
|
+
if (open && bubbleRef.current) {
|
81
|
+
const dragContainer = bubbleRef.current.querySelector(`.${settings.pkg.prefix}__bubble`);
|
82
|
+
if (dragContainer instanceof HTMLElement) {
|
83
|
+
setContentRef(dragContainer);
|
84
|
+
}
|
85
|
+
}
|
86
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
87
|
+
}, [open, bubbleRef.current]);
|
88
|
+
return open && /*#__PURE__*/React.createElement("div", {
|
89
|
+
ref: bubbleRef
|
90
|
+
}, /*#__PURE__*/React.createElement(CoachmarkBubble.CoachmarkBubble, _rollupPluginBabelHelpers.extends({
|
91
|
+
className: cx(coachmarkContentBlockClass, className),
|
92
|
+
highContrast: highContrast,
|
93
|
+
dropShadow: dropShadow,
|
94
|
+
align: align,
|
95
|
+
open: open,
|
96
|
+
target: `#${targetId}`,
|
97
|
+
caret: floating
|
98
|
+
}, rest), children));
|
99
|
+
});
|
100
|
+
CoachmarkContent.Header = ContentHeader.default;
|
101
|
+
CoachmarkContent.Body = ContentBody.default;
|
102
|
+
CoachmarkContent.propTypes = {
|
103
|
+
/**
|
104
|
+
* This is a required callback that has to return the content to render in the body section.
|
105
|
+
* It can be a single child or an array of children depending on your need
|
106
|
+
*/
|
107
|
+
children: index.default.node,
|
108
|
+
/**
|
109
|
+
* Provide an optional class to be applied to the containing node.
|
110
|
+
*/
|
111
|
+
className: index.default.string,
|
112
|
+
/**
|
113
|
+
* Specify whether a drop shadow should be rendered on the popover.
|
114
|
+
*/
|
115
|
+
dropShadow: index.default.bool,
|
116
|
+
/**
|
117
|
+
* Specify whether the component should be rendered on high-contrast.
|
118
|
+
*/
|
119
|
+
highContrast: index.default.bool
|
120
|
+
};
|
121
|
+
|
122
|
+
exports.default = CoachmarkContent;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2024, 2025
|
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
|
+
export interface ContentBodyProps {
|
9
|
+
/**
|
10
|
+
* Provide the optional content for header section and will be render after header titles and before progress indicator.
|
11
|
+
* People can make use of this if they want to have custom header.
|
12
|
+
*/
|
13
|
+
children: ReactNode;
|
14
|
+
/**
|
15
|
+
* Provide an optional class to be applied to the containing node.
|
16
|
+
*/
|
17
|
+
className?: string;
|
18
|
+
}
|
19
|
+
export type EnrichedChildren = {
|
20
|
+
children: ReactNode;
|
21
|
+
};
|
22
|
+
declare const ContentBody: React.ForwardRefExoticComponent<ContentBodyProps & React.RefAttributes<HTMLDivElement>>;
|
23
|
+
export default ContentBody;
|
@@ -0,0 +1,41 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2025
|
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 index = require('../../../../_virtual/index.js');
|
14
|
+
var cx = require('classnames');
|
15
|
+
var Coachmark = require('./Coachmark.js');
|
16
|
+
|
17
|
+
const ContentBody = /*#__PURE__*/React.forwardRef((props, ref) => {
|
18
|
+
const {
|
19
|
+
className = '',
|
20
|
+
children,
|
21
|
+
...rest
|
22
|
+
} = props;
|
23
|
+
const ContentBodyBlockClass = `${Coachmark.blockClass}--content-body`;
|
24
|
+
return /*#__PURE__*/React.createElement("div", {
|
25
|
+
ref: ref,
|
26
|
+
className: cx(ContentBodyBlockClass, className)
|
27
|
+
}, children);
|
28
|
+
});
|
29
|
+
ContentBody.propTypes = {
|
30
|
+
/**
|
31
|
+
* Provide the optional content for header section and will be render after header titles and before progress indicator.
|
32
|
+
* People can make use of this if they want to have custom header.
|
33
|
+
*/
|
34
|
+
children: index.default.node.isRequired,
|
35
|
+
/**
|
36
|
+
* Provide an optional class to be applied to the containing node.
|
37
|
+
*/
|
38
|
+
className: index.default.string
|
39
|
+
};
|
40
|
+
|
41
|
+
exports.default = ContentBody;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
export interface ContentHeaderProps {
|
3
|
+
/**
|
4
|
+
* Provide an optional class to be applied to the containing node.
|
5
|
+
*/
|
6
|
+
className?: string;
|
7
|
+
/**
|
8
|
+
* Tooltip text and aria label for the Close button icon.
|
9
|
+
*/
|
10
|
+
closeIconDescription?: string;
|
11
|
+
/**
|
12
|
+
* Tooltip text and aria label for the Drag button icon.
|
13
|
+
*/
|
14
|
+
dragIconDescription?: string;
|
15
|
+
/**
|
16
|
+
* Optional contents of the Coachmark Header.
|
17
|
+
*/
|
18
|
+
children?: string;
|
19
|
+
}
|
20
|
+
declare const ContentHeader: React.ForwardRefExoticComponent<ContentHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
21
|
+
export default ContentHeader;
|
@@ -0,0 +1,93 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2025
|
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 _rollupPluginBabelHelpers = require('../../../../_virtual/_rollupPluginBabelHelpers.js');
|
13
|
+
var react = require('@carbon/react');
|
14
|
+
var React = require('react');
|
15
|
+
var index = require('../../../../_virtual/index.js');
|
16
|
+
var cx = require('classnames');
|
17
|
+
var Coachmark = require('./Coachmark.js');
|
18
|
+
require('./CoachmarkBubble/CoachmarkBubble.js');
|
19
|
+
var CoachmarkBubbleHeader = require('./CoachmarkBubble/CoachmarkBubbleHeader.js');
|
20
|
+
var icons = require('@carbon/react/icons');
|
21
|
+
var makeDraggable = require('../../../../global/js/utils/makeDraggable/makeDraggable.js');
|
22
|
+
|
23
|
+
const ContentHeader = /*#__PURE__*/React.forwardRef((props, ref) => {
|
24
|
+
const {
|
25
|
+
className = '',
|
26
|
+
closeIconDescription,
|
27
|
+
dragIconDescription,
|
28
|
+
children,
|
29
|
+
...rest
|
30
|
+
} = props;
|
31
|
+
const {
|
32
|
+
setOpen,
|
33
|
+
onClose,
|
34
|
+
contentRef,
|
35
|
+
floating
|
36
|
+
} = React.useContext(Coachmark.CoachmarkContext);
|
37
|
+
const headerRef = React.useRef(null);
|
38
|
+
const dragRef = React.useRef(null);
|
39
|
+
const handleRef = ref || headerRef;
|
40
|
+
const contentHeaderBlockClass = `${Coachmark.blockClass}--content-header`;
|
41
|
+
const closeBubble = () => {
|
42
|
+
onClose?.();
|
43
|
+
setOpen(false);
|
44
|
+
};
|
45
|
+
React.useEffect(() => {
|
46
|
+
if (floating && contentRef && typeof handleRef === 'object' && handleRef !== null && 'current' in handleRef && handleRef.current && dragRef.current) {
|
47
|
+
makeDraggable.makeDraggable({
|
48
|
+
el: contentRef,
|
49
|
+
dragHandle: handleRef.current,
|
50
|
+
focusableDragHandle: dragRef.current
|
51
|
+
});
|
52
|
+
}
|
53
|
+
});
|
54
|
+
return /*#__PURE__*/React.createElement(CoachmarkBubbleHeader.CoachmarkBubbleHeader, _rollupPluginBabelHelpers.extends({
|
55
|
+
ref: handleRef,
|
56
|
+
className: cx(contentHeaderBlockClass, className)
|
57
|
+
}, rest), floating && /*#__PURE__*/React.createElement(react.Button, {
|
58
|
+
kind: "ghost",
|
59
|
+
size: "sm",
|
60
|
+
ref: dragRef,
|
61
|
+
renderIcon: icons.Draggable,
|
62
|
+
iconDescription: dragIconDescription,
|
63
|
+
hasIconOnly: true,
|
64
|
+
className: `${contentHeaderBlockClass}--drag-icon`
|
65
|
+
}), children, /*#__PURE__*/React.createElement(react.Button, {
|
66
|
+
kind: "ghost",
|
67
|
+
size: "sm",
|
68
|
+
renderIcon: icons.Close,
|
69
|
+
iconDescription: closeIconDescription,
|
70
|
+
hasIconOnly: true,
|
71
|
+
onClick: closeBubble
|
72
|
+
}));
|
73
|
+
});
|
74
|
+
ContentHeader.propTypes = {
|
75
|
+
/**
|
76
|
+
* Optional contents of the Coachmark Header.
|
77
|
+
*/
|
78
|
+
children: index.default.node,
|
79
|
+
/**
|
80
|
+
* Provide an optional class to be applied to the containing node.
|
81
|
+
*/
|
82
|
+
className: index.default.string,
|
83
|
+
/**
|
84
|
+
* Tooltip text and aria label for the Close button icon.
|
85
|
+
*/
|
86
|
+
closeIconDescription: index.default.string,
|
87
|
+
/**
|
88
|
+
* Tooltip text and aria label for the Drag button icon.
|
89
|
+
*/
|
90
|
+
dragIconDescription: index.default.string
|
91
|
+
};
|
92
|
+
|
93
|
+
exports.default = ContentHeader;
|
@@ -40,7 +40,6 @@ exports.CoachmarkBeacon = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
40
40
|
}, devtools.getDevtoolsProps(componentName), {
|
41
41
|
role: "tooltip"
|
42
42
|
}), /*#__PURE__*/React.createElement("button", _rollupPluginBabelHelpers.extends({
|
43
|
-
tabIndex: 0,
|
44
43
|
type: "button"
|
45
44
|
}, buttonProps, {
|
46
45
|
className: `${blockClass}__target`
|
@@ -14,7 +14,7 @@ var context = require('../Coachmark/utils/context.js');
|
|
14
14
|
var CoachmarkOverlay = require('../Coachmark/CoachmarkOverlay.js');
|
15
15
|
var CoachmarkTagline = require('../Coachmark/CoachmarkTagline.js');
|
16
16
|
var index = require('../../_virtual/index.js');
|
17
|
-
var
|
17
|
+
var ReactDOM = require('react-dom');
|
18
18
|
var cx = require('classnames');
|
19
19
|
var devtools = require('../../global/js/utils/devtools.js');
|
20
20
|
var settings = require('../../settings.js');
|
@@ -151,7 +151,7 @@ exports.CoachmarkFixed = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
151
151
|
}, devtools.getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement(CoachmarkTagline.CoachmarkTagline, {
|
152
152
|
title: tagline,
|
153
153
|
onClose: onClose
|
154
|
-
}), isOpen && portalNode?.current && /*#__PURE__*/
|
154
|
+
}), isOpen && portalNode?.current && /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/React.createElement(CoachmarkOverlay.CoachmarkOverlay, {
|
155
155
|
ref: overlayRef,
|
156
156
|
fixedIsVisible: fixedIsVisible,
|
157
157
|
kind: enums.COACHMARK_OVERLAY_KIND.FIXED,
|
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
11
11
|
var React = require('react');
|
12
|
-
var
|
12
|
+
var ReactDOM = require('react-dom');
|
13
13
|
var index = require('../../_virtual/index.js');
|
14
14
|
var cx = require('classnames');
|
15
15
|
var devtools = require('../../global/js/utils/devtools.js');
|
@@ -210,7 +210,7 @@ exports.CoachmarkStack = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
210
210
|
closeButtonLabel: closeButtonLabel,
|
211
211
|
title: title,
|
212
212
|
tooltipAlign: tooltipAlign
|
213
|
-
}), portalNode?.current ? /*#__PURE__*/
|
213
|
+
}), portalNode?.current ? /*#__PURE__*/ReactDOM.createPortal(wrappedChildren, portalNode?.current) : null));
|
214
214
|
});
|
215
215
|
|
216
216
|
// Return a placeholder if not released and not enabled by feature flag
|
@@ -16,7 +16,7 @@ var icons = require('@carbon/react/icons');
|
|
16
16
|
var react = require('@carbon/react');
|
17
17
|
var devtools = require('../../global/js/utils/devtools.js');
|
18
18
|
var settings = require('../../settings.js');
|
19
|
-
var
|
19
|
+
var ReactDOM = require('react-dom');
|
20
20
|
var CoachmarkHeader = require('../Coachmark/CoachmarkHeader.js');
|
21
21
|
var useIsomorphicEffect = require('../../global/js/hooks/useIsomorphicEffect.js');
|
22
22
|
|
@@ -101,7 +101,7 @@ exports.CoachmarkStackHome = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
101
101
|
className: `${blockClass}__navLinkLabels-text`
|
102
102
|
}, label)) : label));
|
103
103
|
}
|
104
|
-
return portalNode?.current ? /*#__PURE__*/
|
104
|
+
return portalNode?.current ? /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({}, rest, {
|
105
105
|
className: cx(blockClass, className),
|
106
106
|
ref: ref
|
107
107
|
}, devtools.getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement(CoachmarkHeader.CoachmarkHeader, {
|
@@ -193,9 +193,10 @@ const ConditionBuilderContent = _ref => {
|
|
193
193
|
role: 'gridcell',
|
194
194
|
'aria-label': addConditionGroupText
|
195
195
|
}
|
196
|
-
})),
|
196
|
+
})), /*#__PURE__*/React.createElement(ConditionPreview.default, {
|
197
197
|
previewType: "newGroup",
|
198
198
|
colorIndex: getColorIndex(),
|
199
|
+
className: showConditionGroupPreview ? `${util.blockClass}__visible` : `${util.blockClass}__hidden`,
|
199
200
|
group: {
|
200
201
|
groupOperator: rootState?.operator,
|
201
202
|
id: uuidv4.default()
|
@@ -53,6 +53,11 @@ const ConditionBuilderItem = _ref => {
|
|
53
53
|
statementIdMap[statement.id] = statement.label;
|
54
54
|
});
|
55
55
|
const [invalidText, addConditionText, addPropertyText, addOperatorText, addValueText, labelText] = useTranslations.useTranslations(['invalidText', 'addConditionText', 'addPropertyText', 'addOperatorText', 'addValueText', label], statementIdMap);
|
56
|
+
const getCustomOperatorLabel = propertyLabel => {
|
57
|
+
return propertyLabel && config?.operators?.find(operator => {
|
58
|
+
return operator.id === propertyLabel;
|
59
|
+
});
|
60
|
+
};
|
56
61
|
const getPropertyDetails = () => {
|
57
62
|
const {
|
58
63
|
property,
|
@@ -64,6 +69,12 @@ const ConditionBuilderItem = _ref => {
|
|
64
69
|
isInvalid: true
|
65
70
|
};
|
66
71
|
}
|
72
|
+
if (rest['data-name'] == 'operatorField' && type == 'custom') {
|
73
|
+
return {
|
74
|
+
isInvalid: false,
|
75
|
+
propertyLabel: getCustomOperatorLabel(label)?.id
|
76
|
+
};
|
77
|
+
}
|
67
78
|
const propertyId = rest['data-name'] == 'valueField' && type ? util.getValue(type, label, config) : labelText;
|
68
79
|
return {
|
69
80
|
isInvalid: false,
|
@@ -135,11 +146,6 @@ const ConditionBuilderItem = _ref => {
|
|
135
146
|
manageInvalidSelection();
|
136
147
|
}
|
137
148
|
};
|
138
|
-
const getCustomOperatorLabel = propertyLabel => {
|
139
|
-
return propertyLabel && config?.operators?.find(operator => {
|
140
|
-
return operator.id === propertyLabel;
|
141
|
-
});
|
142
|
-
};
|
143
149
|
const getLabel = () => {
|
144
150
|
if (config?.operators && rest['data-name'] === 'operatorField') {
|
145
151
|
return getCustomOperatorLabel(propertyLabel)?.label ?? addOperatorText;
|
@@ -25,7 +25,7 @@ const ConditionBuilderItemDate = _ref => {
|
|
25
25
|
const DatePickerInputRef = React.useRef(null);
|
26
26
|
const [startText, endText] = useTranslations.useTranslations(['startText', 'endText']);
|
27
27
|
const [dateFromState, setDateFromState] = React.useState();
|
28
|
-
const dateFormat = config
|
28
|
+
const dateFormat = config?.dateFormat || 'm/d/Y';
|
29
29
|
const {
|
30
30
|
conditionBuilderRef
|
31
31
|
} = React.useContext(ConditionBuilderProvider.ConditionBuilderContext);
|
@@ -26,19 +26,26 @@ const ConditionBuilderItemNumber = _ref => {
|
|
26
26
|
value
|
27
27
|
} = _ref2;
|
28
28
|
if (value !== '' && !isNaN(value) && checkIfValid(value)) {
|
29
|
-
onChange(`${value} ${config.unit
|
29
|
+
onChange(config?.unit ? `${value} ${config.unit}` : String(value));
|
30
30
|
} else {
|
31
31
|
onChange('INVALID');
|
32
32
|
}
|
33
33
|
};
|
34
34
|
const checkIfValid = value => {
|
35
|
-
if (config
|
35
|
+
if (!config) {
|
36
|
+
return true;
|
37
|
+
}
|
38
|
+
const {
|
39
|
+
min,
|
40
|
+
max
|
41
|
+
} = config;
|
42
|
+
if (max !== undefined && min === undefined && value > max) {
|
36
43
|
return false;
|
37
44
|
}
|
38
|
-
if (
|
45
|
+
if (min !== undefined && max === undefined && value < min) {
|
39
46
|
return false;
|
40
47
|
}
|
41
|
-
if (
|
48
|
+
if (min !== undefined && max !== undefined && (value < min || value > max)) {
|
42
49
|
return false;
|
43
50
|
}
|
44
51
|
return true;
|
@@ -30,7 +30,7 @@ const ItemOption = _ref => {
|
|
30
30
|
const {
|
31
31
|
conditionBuilderRef
|
32
32
|
} = React.useContext(ConditionBuilderProvider.ConditionBuilderContext);
|
33
|
-
const allOptions = config
|
33
|
+
const allOptions = config?.options;
|
34
34
|
const [searchValue, setSearchValue] = React.useState('');
|
35
35
|
const selection = conditionState.value;
|
36
36
|
const filteredItems = searchValue ? allOptions?.filter(opt => opt.label?.toLowerCase().includes(searchValue.toLowerCase())) : allOptions;
|
@@ -97,7 +97,7 @@ const ItemOption = _ref => {
|
|
97
97
|
className: `${util.blockClass}__item-option__option-content`
|
98
98
|
}, /*#__PURE__*/React.createElement("span", {
|
99
99
|
className: `${util.blockClass}__item-option__option-label`
|
100
|
-
}, Icon && /*#__PURE__*/React.createElement(Icon, null), config
|
100
|
+
}, Icon && /*#__PURE__*/React.createElement(Icon, null), config?.isStatement ? getStatementContent(option) : option.label), isSelected && /*#__PURE__*/React.createElement(icons.Checkmark, {
|
101
101
|
className: `${util.blockClass}__checkmark`
|
102
102
|
})));
|
103
103
|
})));
|
@@ -34,7 +34,7 @@ const ItemOptionForValueField = _ref => {
|
|
34
34
|
conditionBuilderRef
|
35
35
|
} = React.useContext(ConditionBuilderProvider.ConditionBuilderContext);
|
36
36
|
const contentRef = React.useRef(null);
|
37
|
-
const [allOptions, setAllOptions] = React.useState(config
|
37
|
+
const [allOptions, setAllOptions] = React.useState(config?.options);
|
38
38
|
const [searchValue, setSearchValue] = React.useState('');
|
39
39
|
const filteredItems = allOptions?.filter(opt => opt.label.toLowerCase().includes(searchValue.toLowerCase()));
|
40
40
|
const selection = Array.isArray(conditionState.value) ? conditionState.value : conditionState.value !== undefined ? [conditionState.value] : [];
|
@@ -51,6 +51,45 @@ const ConditionGroupBuilder = _ref => {
|
|
51
51
|
const [showConditionSubGroupPreview, setShowConditionSubGroupPreview] = React.useState(-1);
|
52
52
|
React.useState(false);
|
53
53
|
const conditionBuilderContentRef = React.useRef(null);
|
54
|
+
const scrollParentRef = React.useRef(null);
|
55
|
+
React.useEffect(() => {
|
56
|
+
// getting scrollable parent initially
|
57
|
+
if (typeof conditionBuilderRef !== 'function' && conditionBuilderRef?.current) {
|
58
|
+
scrollParentRef.current = getScrollableParent(conditionBuilderRef.current);
|
59
|
+
}
|
60
|
+
}, [conditionBuilderRef]);
|
61
|
+
React.useEffect(() => {
|
62
|
+
// This fix addresses a flickering issue when hovering over "Add Condition" or "Add Subgroup".
|
63
|
+
// On hover, the component inserts a preview element below, ideally pushing the layout downward to create space.
|
64
|
+
// However, if the container is scrolled to the bottom, the layout may instead shift content upward,
|
65
|
+
// breaking the hover chain and causing the preview to flicker.
|
66
|
+
// Fix: When showing the preview on hover, if the scroll position is at the bottom,
|
67
|
+
// scrolling up by 1px prevents layout shift from breaking the hover chain and eliminates flickering.
|
68
|
+
|
69
|
+
const parent = scrollParentRef.current;
|
70
|
+
let atBottom = false;
|
71
|
+
if (parent instanceof Window || parent === document.body || parent === document.documentElement) {
|
72
|
+
atBottom = window.innerHeight + window.scrollY >= document.body.scrollHeight;
|
73
|
+
} else if (scrollParentRef.current) {
|
74
|
+
const parent = scrollParentRef.current;
|
75
|
+
atBottom = parent.scrollTop + parent.clientHeight >= parent.scrollHeight;
|
76
|
+
}
|
77
|
+
if ((showConditionPreview || showConditionSubGroupPreview) && atBottom) {
|
78
|
+
scrollParentRef.current?.scrollBy(0, -1);
|
79
|
+
}
|
80
|
+
}, [showConditionPreview, showConditionSubGroupPreview]);
|
81
|
+
const getScrollableParent = element => {
|
82
|
+
while (element && element !== document.body) {
|
83
|
+
const style = getComputedStyle(element);
|
84
|
+
const overflowY = style.overflowY;
|
85
|
+
const isScrollable = overflowY === 'auto' || overflowY === 'scroll' || overflowY === 'overlay';
|
86
|
+
if (isScrollable && element.scrollHeight > element.clientHeight) {
|
87
|
+
return element;
|
88
|
+
}
|
89
|
+
element = element.parentElement;
|
90
|
+
}
|
91
|
+
return window; // fallback to window
|
92
|
+
};
|
54
93
|
const onRemoveHandler = (conditionId, evt, conditionIndex) => {
|
55
94
|
if (group && group.conditions && group.conditions.length > 1) {
|
56
95
|
if (variant == util.HIERARCHICAL_VARIANT) {
|
@@ -331,10 +370,10 @@ const ConditionGroupBuilder = _ref => {
|
|
331
370
|
},
|
332
371
|
hideConditionPreviewHandler: hideConditionPreviewHandler,
|
333
372
|
isLastCondition: isLastCondition
|
334
|
-
})), conditionIndex
|
373
|
+
})), conditionIndex === showConditionSubGroupPreview && (_ConditionPreview || (_ConditionPreview = /*#__PURE__*/React.createElement(ConditionPreview.default, {
|
335
374
|
previewType: "subGroup",
|
336
375
|
group: group
|
337
|
-
}))), conditionIndex
|
376
|
+
}))), conditionIndex === showConditionPreview && (_ConditionPreview2 || (_ConditionPreview2 = /*#__PURE__*/React.createElement(ConditionPreview.default, {
|
338
377
|
previewType: "condition",
|
339
378
|
group: group
|
340
379
|
}))))));
|
@@ -10,10 +10,12 @@ interface ConditionPreviewProps {
|
|
10
10
|
previewType: 'newGroup' | 'subGroup' | 'condition';
|
11
11
|
group: ConditionGroup;
|
12
12
|
colorIndex?: number;
|
13
|
+
className?: string;
|
13
14
|
}
|
14
15
|
declare const ConditionPreview: {
|
15
|
-
({ previewType, group, colorIndex, }: ConditionPreviewProps): React.JSX.Element;
|
16
|
+
({ previewType, group, colorIndex, className, }: ConditionPreviewProps): React.JSX.Element;
|
16
17
|
propTypes: {
|
18
|
+
className: any;
|
17
19
|
/**
|
18
20
|
* index of the color for next group
|
19
21
|
*/
|
@@ -23,7 +23,8 @@ const ConditionPreview = _ref => {
|
|
23
23
|
let {
|
24
24
|
previewType,
|
25
25
|
group,
|
26
|
-
colorIndex
|
26
|
+
colorIndex,
|
27
|
+
className
|
27
28
|
} = _ref;
|
28
29
|
const [animate, setAnimate] = React.useState(false);
|
29
30
|
const [propertyText, operatorText, valueText, ifText] = useTranslations.useTranslations(['valueText', 'operatorText', 'propertyText', 'ifText']);
|
@@ -43,7 +44,7 @@ const ConditionPreview = _ref => {
|
|
43
44
|
})));
|
44
45
|
};
|
45
46
|
return /*#__PURE__*/React.createElement(React.Fragment, null, previewType == 'newGroup' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
46
|
-
className: cx([`${util.blockClass}__group__row ${util.blockClass}__group-preview `, {
|
47
|
+
className: cx([`${util.blockClass}__group__row ${util.blockClass}__group-preview ${className}`, {
|
47
48
|
[`${util.blockClass}__group-preview-animate`]: animate
|
48
49
|
}])
|
49
50
|
}, /*#__PURE__*/React.createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
@@ -52,7 +53,7 @@ const ConditionPreview = _ref => {
|
|
52
53
|
})), /*#__PURE__*/React.createElement("div", {
|
53
54
|
"data-color-index": colorIndex,
|
54
55
|
"aria-hidden": true,
|
55
|
-
className: cx([`${util.blockClass}__group
|
56
|
+
className: cx([`${util.blockClass}__group ${util.blockClass}__condition-wrapper ${util.blockClass}__group-preview ${util.blockClass}__group-wrapper ${className}`, {
|
56
57
|
[`${util.blockClass}__group-preview-animate`]: animate
|
57
58
|
}])
|
58
59
|
}, /*#__PURE__*/React.createElement("div", {
|
@@ -88,6 +89,7 @@ const ConditionPreview = _ref => {
|
|
88
89
|
}), getConditionSection())));
|
89
90
|
};
|
90
91
|
ConditionPreview.propTypes = {
|
92
|
+
className: index.default.string,
|
91
93
|
/**
|
92
94
|
* index of the color for next group
|
93
95
|
*/
|
@@ -19,7 +19,7 @@ const useTranslations = (translationKeys, alterTranslationKeyMap) => {
|
|
19
19
|
if (alterTranslationKeyMap?.[translationKey]) {
|
20
20
|
translationKey = alterTranslationKeyMap[translationKey];
|
21
21
|
}
|
22
|
-
if (translateWithId?.(translationKey)) {
|
22
|
+
if (translateWithId?.(translationKey) && translateWithId?.(translationKey) !== translationKey) {
|
23
23
|
return translateWithId(translationKey);
|
24
24
|
} else if (translationObject.translationsObject[translationKey]) {
|
25
25
|
return translationObject.translationsObject[translationKey];
|
@@ -181,7 +181,6 @@ exports.EditInPlace = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
181
181
|
label: cancelLabel,
|
182
182
|
onClick: onCancelHandler,
|
183
183
|
kind: "ghost",
|
184
|
-
tabIndex: 0,
|
185
184
|
key: "cancel",
|
186
185
|
className: `${blockClass}__btn ${blockClass}__btn-cancel`
|
187
186
|
}, _Close || (_Close = /*#__PURE__*/React.createElement(icons.Close, {
|
@@ -192,7 +191,6 @@ exports.EditInPlace = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
192
191
|
label: saveLabel,
|
193
192
|
onClick: onSaveHandler,
|
194
193
|
kind: "ghost",
|
195
|
-
tabIndex: 0,
|
196
194
|
key: "save",
|
197
195
|
className: `${blockClass}__btn ${blockClass}__btn-save`,
|
198
196
|
disabled: !canSave
|
@@ -207,7 +205,6 @@ exports.EditInPlace = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
207
205
|
label: editLabel,
|
208
206
|
onClick: onFocusHandler,
|
209
207
|
kind: "ghost",
|
210
|
-
tabIndex: 0,
|
211
208
|
key: "edit"
|
212
209
|
}, _Edit || (_Edit = /*#__PURE__*/React.createElement(icons.Edit, {
|
213
210
|
size: 16
|
@@ -67,8 +67,8 @@ export interface EmptyStateProps {
|
|
67
67
|
*/
|
68
68
|
title: string | ReactNode;
|
69
69
|
/**
|
70
|
-
* Designates which version of the EmptyState component is being used.
|
71
|
-
*
|
70
|
+
* **Deprecated:** Designates which version of the EmptyState component is being used. Refer to V2 documentation separately.
|
71
|
+
* @deprecated
|
72
72
|
*/
|
73
73
|
v2?: boolean;
|
74
74
|
}
|