@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,125 @@
|
|
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
|
+
import { extends as _extends } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
+
import cx from 'classnames';
|
10
|
+
import { useTheme, usePrefix } from '@carbon/react';
|
11
|
+
import React__default, { forwardRef, useRef, useLayoutEffect } from 'react';
|
12
|
+
import { pkg } from '../../../../../settings.js';
|
13
|
+
import { offset, flip, shift, arrow } from '../../../../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js';
|
14
|
+
import { autoUpdate, computePosition } from '../../../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.js';
|
15
|
+
|
16
|
+
const CoachmarkBubble = /*#__PURE__*/forwardRef(props => {
|
17
|
+
const {
|
18
|
+
children,
|
19
|
+
align,
|
20
|
+
target,
|
21
|
+
className,
|
22
|
+
dropShadow = true,
|
23
|
+
highContrast = false,
|
24
|
+
caret = false,
|
25
|
+
open,
|
26
|
+
...rest
|
27
|
+
} = props;
|
28
|
+
const {
|
29
|
+
theme
|
30
|
+
} = useTheme();
|
31
|
+
const carbonPrefix = usePrefix();
|
32
|
+
const tooltipRef = useRef(null);
|
33
|
+
const arrowRef = useRef(null);
|
34
|
+
const targetRef = useRef(null);
|
35
|
+
useLayoutEffect(() => {
|
36
|
+
if (target) {
|
37
|
+
if (typeof target === 'string') {
|
38
|
+
targetRef.current = document.querySelector(target);
|
39
|
+
} else if ('current' in target) {
|
40
|
+
targetRef.current = target.current;
|
41
|
+
} else {
|
42
|
+
targetRef.current = target;
|
43
|
+
}
|
44
|
+
if (targetRef.current && tooltipRef.current && arrowRef.current && open) {
|
45
|
+
targetRef.current.scrollIntoView({
|
46
|
+
behavior: 'smooth',
|
47
|
+
block: 'center',
|
48
|
+
inline: 'center'
|
49
|
+
});
|
50
|
+
const middlewares = [offset(10), flip(), shift({
|
51
|
+
padding: 5
|
52
|
+
}), arrow({
|
53
|
+
element: arrowRef.current
|
54
|
+
})];
|
55
|
+
const cleanup = autoUpdate(targetRef.current, tooltipRef.current, () => {
|
56
|
+
if (targetRef.current && tooltipRef.current) {
|
57
|
+
computePosition(targetRef.current, tooltipRef.current, {
|
58
|
+
placement: align,
|
59
|
+
strategy: 'fixed',
|
60
|
+
middleware: middlewares
|
61
|
+
}).then(_ref => {
|
62
|
+
let {
|
63
|
+
x,
|
64
|
+
y,
|
65
|
+
placement,
|
66
|
+
middlewareData
|
67
|
+
} = _ref;
|
68
|
+
if (tooltipRef.current) {
|
69
|
+
Object.assign(tooltipRef.current.style, {
|
70
|
+
left: `${x}px`,
|
71
|
+
top: `${y}px`
|
72
|
+
});
|
73
|
+
}
|
74
|
+
const arrowX = middlewareData.arrow?.x;
|
75
|
+
const arrowY = middlewareData.arrow?.y;
|
76
|
+
const staticSide = {
|
77
|
+
top: 'bottom',
|
78
|
+
right: 'left',
|
79
|
+
bottom: 'top',
|
80
|
+
left: 'right'
|
81
|
+
}[placement.split('-')[0]];
|
82
|
+
if (staticSide && arrowRef.current) {
|
83
|
+
Object.assign(arrowRef.current.style, {
|
84
|
+
left: arrowX != null ? `${arrowX}px` : '',
|
85
|
+
top: arrowY != null ? `${arrowY}px` : '',
|
86
|
+
right: '',
|
87
|
+
bottom: '',
|
88
|
+
[staticSide]: '-4px'
|
89
|
+
});
|
90
|
+
}
|
91
|
+
});
|
92
|
+
}
|
93
|
+
}, {
|
94
|
+
animationFrame: true
|
95
|
+
});
|
96
|
+
return () => {
|
97
|
+
cleanup();
|
98
|
+
};
|
99
|
+
}
|
100
|
+
}
|
101
|
+
}, [target, open, align]);
|
102
|
+
if (!target) {
|
103
|
+
return null;
|
104
|
+
}
|
105
|
+
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
106
|
+
ref: tooltipRef,
|
107
|
+
className: cx({
|
108
|
+
[`${carbonPrefix}--g100`]: theme === 'white' && highContrast || theme === 'g100' && !highContrast,
|
109
|
+
[`${carbonPrefix}--g90`]: theme === 'g10' && highContrast || theme === 'g90' && !highContrast,
|
110
|
+
[`${carbonPrefix}--g10`]: theme === 'g90' && highContrast || theme === 'g10' && !highContrast,
|
111
|
+
[`${carbonPrefix}--white`]: theme === 'g100' && highContrast || theme === 'white' && !highContrast,
|
112
|
+
[`${pkg.prefix}__bubble`]: true,
|
113
|
+
[`${pkg.prefix}__bubble-open`]: open,
|
114
|
+
[`${pkg.prefix}__bubble-drop-shadow`]: dropShadow,
|
115
|
+
[`${pkg.prefix}__bubble-high-contrast`]: highContrast,
|
116
|
+
[`${pkg.prefix}__bubble-hidden`]: !targetRef.current
|
117
|
+
}, className)
|
118
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
119
|
+
ref: arrowRef,
|
120
|
+
className: !caret ? `${pkg.prefix}__bubble__arrow` : ''
|
121
|
+
}), children);
|
122
|
+
});
|
123
|
+
CoachmarkBubble.displayName = 'CoachmarkBubble';
|
124
|
+
|
125
|
+
export { CoachmarkBubble };
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/**
|
2
|
+
* @license
|
3
|
+
*
|
4
|
+
* Copyright IBM Corp. 2025
|
5
|
+
*
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
8
|
+
*/
|
9
|
+
import React, { HTMLProps, ReactNode } from 'react';
|
10
|
+
interface BubbleHeaderProps extends HTMLProps<HTMLElement> {
|
11
|
+
/**
|
12
|
+
* Provide the contents of the Bubble header
|
13
|
+
*/
|
14
|
+
children: ReactNode;
|
15
|
+
/**
|
16
|
+
* Provide an optional class to be applied to the containing node.
|
17
|
+
*/
|
18
|
+
className?: string;
|
19
|
+
}
|
20
|
+
declare const CoachmarkBubbleHeader: {
|
21
|
+
({ children, className, ...rest }: BubbleHeaderProps): React.JSX.Element;
|
22
|
+
displayName: string;
|
23
|
+
};
|
24
|
+
export { CoachmarkBubbleHeader };
|
@@ -0,0 +1,25 @@
|
|
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
|
+
import { extends as _extends } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
+
import React__default from 'react';
|
10
|
+
import cx from 'classnames';
|
11
|
+
import { pkg } from '../../../../../settings.js';
|
12
|
+
|
13
|
+
const CoachmarkBubbleHeader = _ref => {
|
14
|
+
let {
|
15
|
+
children,
|
16
|
+
className,
|
17
|
+
...rest
|
18
|
+
} = _ref;
|
19
|
+
return /*#__PURE__*/React__default.createElement("header", _extends({}, rest, {
|
20
|
+
className: cx(`${pkg.prefix}__bubble__header`, className)
|
21
|
+
}), children);
|
22
|
+
};
|
23
|
+
CoachmarkBubbleHeader.displayName = 'CoachmarkBubbleHeader';
|
24
|
+
|
25
|
+
export { CoachmarkBubbleHeader };
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/**
|
2
|
+
* @license
|
3
|
+
*
|
4
|
+
* Copyright IBM Corp. 2025
|
5
|
+
*
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
8
|
+
*/
|
9
|
+
export { CoachmarkBubble } from './CoachmarkBubble';
|
10
|
+
export { CoachmarkBubbleHeader } from './CoachmarkBubbleHeader';
|
@@ -0,0 +1,34 @@
|
|
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 { FC, ForwardRefExoticComponent, ReactElement, ReactNode, RefAttributes } from 'react';
|
8
|
+
import { ContentHeaderProps } from './ContentHeader';
|
9
|
+
import { ContentBodyProps } from './ContentBody';
|
10
|
+
export interface CoachmarkContentProps {
|
11
|
+
/**
|
12
|
+
* Provide an optional class to be applied to the containing node.
|
13
|
+
*/
|
14
|
+
className?: string;
|
15
|
+
/**
|
16
|
+
* This is a required callback that has to return the content to render in the body section.
|
17
|
+
* It can be a single child or an array of children depending on your need
|
18
|
+
*/
|
19
|
+
children: ReactElement | ReactNode;
|
20
|
+
/**
|
21
|
+
* Specify whether the component should be rendered on high-contrast.
|
22
|
+
*/
|
23
|
+
highContrast?: boolean;
|
24
|
+
/**
|
25
|
+
* Specify whether a drop shadow should be rendered on the popover.
|
26
|
+
*/
|
27
|
+
dropShadow?: boolean;
|
28
|
+
}
|
29
|
+
export type CoachmarkContentComponent = ForwardRefExoticComponent<CoachmarkContentProps & RefAttributes<HTMLDivElement>> & {
|
30
|
+
Header: FC<ContentHeaderProps>;
|
31
|
+
Body: FC<ContentBodyProps>;
|
32
|
+
};
|
33
|
+
declare const CoachmarkContent: CoachmarkContentComponent;
|
34
|
+
export default CoachmarkContent;
|
@@ -0,0 +1,118 @@
|
|
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
|
+
import { extends as _extends } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
+
import React__default, { forwardRef, useContext, useRef, useEffect } from 'react';
|
10
|
+
import PropTypes from '../../../../_virtual/index.js';
|
11
|
+
import { pkg } from '../../../../settings.js';
|
12
|
+
import { CoachmarkContext, blockClass } from './Coachmark.js';
|
13
|
+
import { CoachmarkBubble } from './CoachmarkBubble/CoachmarkBubble.js';
|
14
|
+
import './CoachmarkBubble/CoachmarkBubbleHeader.js';
|
15
|
+
import ContentHeader from './ContentHeader.js';
|
16
|
+
import ContentBody from './ContentBody.js';
|
17
|
+
import cx from 'classnames';
|
18
|
+
|
19
|
+
const CoachmarkContent = /*#__PURE__*/forwardRef((props, ref) => {
|
20
|
+
const {
|
21
|
+
className = '',
|
22
|
+
children,
|
23
|
+
highContrast,
|
24
|
+
dropShadow,
|
25
|
+
...rest
|
26
|
+
} = props;
|
27
|
+
const coachmarkContentBlockClass = `${blockClass}--coachmark-content`;
|
28
|
+
const contentBodyClass = `${blockClass}--content-body`;
|
29
|
+
const {
|
30
|
+
align,
|
31
|
+
open,
|
32
|
+
setOpen,
|
33
|
+
triggerRef,
|
34
|
+
setContentRef,
|
35
|
+
floating
|
36
|
+
} = useContext(CoachmarkContext);
|
37
|
+
const targetId = open ? triggerRef?.current?.id : null;
|
38
|
+
const handleRef = useRef(null);
|
39
|
+
const bubbleRef = ref && typeof ref !== 'function' ? ref : handleRef;
|
40
|
+
useEffect(() => {
|
41
|
+
if (open && bubbleRef.current) {
|
42
|
+
requestAnimationFrame(() => {
|
43
|
+
const contentBody = bubbleRef.current.querySelector(`.${contentBodyClass}`);
|
44
|
+
if (contentBody) {
|
45
|
+
const firstFocusable = Array.from(contentBody.querySelectorAll('*')).find(el => el.tabIndex >= 0);
|
46
|
+
firstFocusable?.focus();
|
47
|
+
}
|
48
|
+
});
|
49
|
+
}
|
50
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
51
|
+
}, [open]);
|
52
|
+
useEffect(() => {
|
53
|
+
const handleOutsideClick = event => {
|
54
|
+
const targetElement = document.getElementById(targetId || '');
|
55
|
+
const bubbleElement = bubbleRef.current;
|
56
|
+
if (bubbleElement && !bubbleElement.contains(event.target) && targetElement && !targetElement.contains(event.target)) {
|
57
|
+
setOpen?.(false);
|
58
|
+
}
|
59
|
+
};
|
60
|
+
const handleKeyDown = e => {
|
61
|
+
if (e.key === 'Escape') {
|
62
|
+
setOpen?.(false);
|
63
|
+
}
|
64
|
+
};
|
65
|
+
if (open) {
|
66
|
+
document.addEventListener('click', handleOutsideClick);
|
67
|
+
window.addEventListener('keydown', handleKeyDown);
|
68
|
+
}
|
69
|
+
return () => {
|
70
|
+
document.removeEventListener('click', handleOutsideClick);
|
71
|
+
window.removeEventListener('keydown', handleKeyDown);
|
72
|
+
};
|
73
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
74
|
+
}, [open, targetId, setOpen]);
|
75
|
+
useEffect(() => {
|
76
|
+
if (open && bubbleRef.current) {
|
77
|
+
const dragContainer = bubbleRef.current.querySelector(`.${pkg.prefix}__bubble`);
|
78
|
+
if (dragContainer instanceof HTMLElement) {
|
79
|
+
setContentRef(dragContainer);
|
80
|
+
}
|
81
|
+
}
|
82
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
83
|
+
}, [open, bubbleRef.current]);
|
84
|
+
return open && /*#__PURE__*/React__default.createElement("div", {
|
85
|
+
ref: bubbleRef
|
86
|
+
}, /*#__PURE__*/React__default.createElement(CoachmarkBubble, _extends({
|
87
|
+
className: cx(coachmarkContentBlockClass, className),
|
88
|
+
highContrast: highContrast,
|
89
|
+
dropShadow: dropShadow,
|
90
|
+
align: align,
|
91
|
+
open: open,
|
92
|
+
target: `#${targetId}`,
|
93
|
+
caret: floating
|
94
|
+
}, rest), children));
|
95
|
+
});
|
96
|
+
CoachmarkContent.Header = ContentHeader;
|
97
|
+
CoachmarkContent.Body = ContentBody;
|
98
|
+
CoachmarkContent.propTypes = {
|
99
|
+
/**
|
100
|
+
* This is a required callback that has to return the content to render in the body section.
|
101
|
+
* It can be a single child or an array of children depending on your need
|
102
|
+
*/
|
103
|
+
children: PropTypes.node,
|
104
|
+
/**
|
105
|
+
* Provide an optional class to be applied to the containing node.
|
106
|
+
*/
|
107
|
+
className: PropTypes.string,
|
108
|
+
/**
|
109
|
+
* Specify whether a drop shadow should be rendered on the popover.
|
110
|
+
*/
|
111
|
+
dropShadow: PropTypes.bool,
|
112
|
+
/**
|
113
|
+
* Specify whether the component should be rendered on high-contrast.
|
114
|
+
*/
|
115
|
+
highContrast: PropTypes.bool
|
116
|
+
};
|
117
|
+
|
118
|
+
export { CoachmarkContent as default };
|
@@ -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,37 @@
|
|
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
|
+
import React__default, { forwardRef } from 'react';
|
9
|
+
import PropTypes from '../../../../_virtual/index.js';
|
10
|
+
import cx from 'classnames';
|
11
|
+
import { blockClass } from './Coachmark.js';
|
12
|
+
|
13
|
+
const ContentBody = /*#__PURE__*/forwardRef((props, ref) => {
|
14
|
+
const {
|
15
|
+
className = '',
|
16
|
+
children,
|
17
|
+
...rest
|
18
|
+
} = props;
|
19
|
+
const ContentBodyBlockClass = `${blockClass}--content-body`;
|
20
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
21
|
+
ref: ref,
|
22
|
+
className: cx(ContentBodyBlockClass, className)
|
23
|
+
}, children);
|
24
|
+
});
|
25
|
+
ContentBody.propTypes = {
|
26
|
+
/**
|
27
|
+
* Provide the optional content for header section and will be render after header titles and before progress indicator.
|
28
|
+
* People can make use of this if they want to have custom header.
|
29
|
+
*/
|
30
|
+
children: PropTypes.node.isRequired,
|
31
|
+
/**
|
32
|
+
* Provide an optional class to be applied to the containing node.
|
33
|
+
*/
|
34
|
+
className: PropTypes.string
|
35
|
+
};
|
36
|
+
|
37
|
+
export { ContentBody as default };
|
@@ -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,89 @@
|
|
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
|
+
import { extends as _extends } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
+
import { Button } from '@carbon/react';
|
10
|
+
import React__default, { forwardRef, useContext, useRef, useEffect } from 'react';
|
11
|
+
import PropTypes from '../../../../_virtual/index.js';
|
12
|
+
import cx from 'classnames';
|
13
|
+
import { CoachmarkContext, blockClass } from './Coachmark.js';
|
14
|
+
import './CoachmarkBubble/CoachmarkBubble.js';
|
15
|
+
import { CoachmarkBubbleHeader } from './CoachmarkBubble/CoachmarkBubbleHeader.js';
|
16
|
+
import { Draggable, Close } from '@carbon/react/icons';
|
17
|
+
import { makeDraggable } from '../../../../global/js/utils/makeDraggable/makeDraggable.js';
|
18
|
+
|
19
|
+
const ContentHeader = /*#__PURE__*/forwardRef((props, ref) => {
|
20
|
+
const {
|
21
|
+
className = '',
|
22
|
+
closeIconDescription,
|
23
|
+
dragIconDescription,
|
24
|
+
children,
|
25
|
+
...rest
|
26
|
+
} = props;
|
27
|
+
const {
|
28
|
+
setOpen,
|
29
|
+
onClose,
|
30
|
+
contentRef,
|
31
|
+
floating
|
32
|
+
} = useContext(CoachmarkContext);
|
33
|
+
const headerRef = useRef(null);
|
34
|
+
const dragRef = useRef(null);
|
35
|
+
const handleRef = ref || headerRef;
|
36
|
+
const contentHeaderBlockClass = `${blockClass}--content-header`;
|
37
|
+
const closeBubble = () => {
|
38
|
+
onClose?.();
|
39
|
+
setOpen(false);
|
40
|
+
};
|
41
|
+
useEffect(() => {
|
42
|
+
if (floating && contentRef && typeof handleRef === 'object' && handleRef !== null && 'current' in handleRef && handleRef.current && dragRef.current) {
|
43
|
+
makeDraggable({
|
44
|
+
el: contentRef,
|
45
|
+
dragHandle: handleRef.current,
|
46
|
+
focusableDragHandle: dragRef.current
|
47
|
+
});
|
48
|
+
}
|
49
|
+
});
|
50
|
+
return /*#__PURE__*/React__default.createElement(CoachmarkBubbleHeader, _extends({
|
51
|
+
ref: handleRef,
|
52
|
+
className: cx(contentHeaderBlockClass, className)
|
53
|
+
}, rest), floating && /*#__PURE__*/React__default.createElement(Button, {
|
54
|
+
kind: "ghost",
|
55
|
+
size: "sm",
|
56
|
+
ref: dragRef,
|
57
|
+
renderIcon: Draggable,
|
58
|
+
iconDescription: dragIconDescription,
|
59
|
+
hasIconOnly: true,
|
60
|
+
className: `${contentHeaderBlockClass}--drag-icon`
|
61
|
+
}), children, /*#__PURE__*/React__default.createElement(Button, {
|
62
|
+
kind: "ghost",
|
63
|
+
size: "sm",
|
64
|
+
renderIcon: Close,
|
65
|
+
iconDescription: closeIconDescription,
|
66
|
+
hasIconOnly: true,
|
67
|
+
onClick: closeBubble
|
68
|
+
}));
|
69
|
+
});
|
70
|
+
ContentHeader.propTypes = {
|
71
|
+
/**
|
72
|
+
* Optional contents of the Coachmark Header.
|
73
|
+
*/
|
74
|
+
children: PropTypes.node,
|
75
|
+
/**
|
76
|
+
* Provide an optional class to be applied to the containing node.
|
77
|
+
*/
|
78
|
+
className: PropTypes.string,
|
79
|
+
/**
|
80
|
+
* Tooltip text and aria label for the Close button icon.
|
81
|
+
*/
|
82
|
+
closeIconDescription: PropTypes.string,
|
83
|
+
/**
|
84
|
+
* Tooltip text and aria label for the Drag button icon.
|
85
|
+
*/
|
86
|
+
dragIconDescription: PropTypes.string
|
87
|
+
};
|
88
|
+
|
89
|
+
export { ContentHeader as default };
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright IBM Corp. 2024,
|
2
|
+
* Copyright IBM Corp. 2024, 2025
|
3
3
|
*
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
|
-
export {
|
7
|
+
export { Coachmark } from './Coachmark';
|
@@ -38,7 +38,6 @@ let CoachmarkBeacon = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
38
38
|
}, getDevtoolsProps(componentName), {
|
39
39
|
role: "tooltip"
|
40
40
|
}), /*#__PURE__*/React__default.createElement("button", _extends({
|
41
|
-
tabIndex: 0,
|
42
41
|
type: "button"
|
43
42
|
}, buttonProps, {
|
44
43
|
className: `${blockClass}__target`
|
@@ -189,9 +189,10 @@ const ConditionBuilderContent = _ref => {
|
|
189
189
|
role: 'gridcell',
|
190
190
|
'aria-label': addConditionGroupText
|
191
191
|
}
|
192
|
-
})),
|
192
|
+
})), /*#__PURE__*/React__default.createElement(ConditionPreview, {
|
193
193
|
previewType: "newGroup",
|
194
194
|
colorIndex: getColorIndex(),
|
195
|
+
className: showConditionGroupPreview ? `${blockClass}__visible` : `${blockClass}__hidden`,
|
195
196
|
group: {
|
196
197
|
groupOperator: rootState?.operator,
|
197
198
|
id: uuidv4()
|
@@ -51,6 +51,11 @@ const ConditionBuilderItem = _ref => {
|
|
51
51
|
statementIdMap[statement.id] = statement.label;
|
52
52
|
});
|
53
53
|
const [invalidText, addConditionText, addPropertyText, addOperatorText, addValueText, labelText] = useTranslations(['invalidText', 'addConditionText', 'addPropertyText', 'addOperatorText', 'addValueText', label], statementIdMap);
|
54
|
+
const getCustomOperatorLabel = propertyLabel => {
|
55
|
+
return propertyLabel && config?.operators?.find(operator => {
|
56
|
+
return operator.id === propertyLabel;
|
57
|
+
});
|
58
|
+
};
|
54
59
|
const getPropertyDetails = () => {
|
55
60
|
const {
|
56
61
|
property,
|
@@ -62,6 +67,12 @@ const ConditionBuilderItem = _ref => {
|
|
62
67
|
isInvalid: true
|
63
68
|
};
|
64
69
|
}
|
70
|
+
if (rest['data-name'] == 'operatorField' && type == 'custom') {
|
71
|
+
return {
|
72
|
+
isInvalid: false,
|
73
|
+
propertyLabel: getCustomOperatorLabel(label)?.id
|
74
|
+
};
|
75
|
+
}
|
65
76
|
const propertyId = rest['data-name'] == 'valueField' && type ? getValue(type, label, config) : labelText;
|
66
77
|
return {
|
67
78
|
isInvalid: false,
|
@@ -133,11 +144,6 @@ const ConditionBuilderItem = _ref => {
|
|
133
144
|
manageInvalidSelection();
|
134
145
|
}
|
135
146
|
};
|
136
|
-
const getCustomOperatorLabel = propertyLabel => {
|
137
|
-
return propertyLabel && config?.operators?.find(operator => {
|
138
|
-
return operator.id === propertyLabel;
|
139
|
-
});
|
140
|
-
};
|
141
147
|
const getLabel = () => {
|
142
148
|
if (config?.operators && rest['data-name'] === 'operatorField') {
|
143
149
|
return getCustomOperatorLabel(propertyLabel)?.label ?? addOperatorText;
|
@@ -23,7 +23,7 @@ const ConditionBuilderItemDate = _ref => {
|
|
23
23
|
const DatePickerInputRef = useRef(null);
|
24
24
|
const [startText, endText] = useTranslations(['startText', 'endText']);
|
25
25
|
const [dateFromState, setDateFromState] = useState();
|
26
|
-
const dateFormat = config
|
26
|
+
const dateFormat = config?.dateFormat || 'm/d/Y';
|
27
27
|
const {
|
28
28
|
conditionBuilderRef
|
29
29
|
} = useContext(ConditionBuilderContext);
|
@@ -24,19 +24,26 @@ const ConditionBuilderItemNumber = _ref => {
|
|
24
24
|
value
|
25
25
|
} = _ref2;
|
26
26
|
if (value !== '' && !isNaN(value) && checkIfValid(value)) {
|
27
|
-
onChange(`${value} ${config.unit
|
27
|
+
onChange(config?.unit ? `${value} ${config.unit}` : String(value));
|
28
28
|
} else {
|
29
29
|
onChange('INVALID');
|
30
30
|
}
|
31
31
|
};
|
32
32
|
const checkIfValid = value => {
|
33
|
-
if (config
|
33
|
+
if (!config) {
|
34
|
+
return true;
|
35
|
+
}
|
36
|
+
const {
|
37
|
+
min,
|
38
|
+
max
|
39
|
+
} = config;
|
40
|
+
if (max !== undefined && min === undefined && value > max) {
|
34
41
|
return false;
|
35
42
|
}
|
36
|
-
if (
|
43
|
+
if (min !== undefined && max === undefined && value < min) {
|
37
44
|
return false;
|
38
45
|
}
|
39
|
-
if (
|
46
|
+
if (min !== undefined && max !== undefined && (value < min || value > max)) {
|
40
47
|
return false;
|
41
48
|
}
|
42
49
|
return true;
|
package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js
CHANGED
@@ -28,7 +28,7 @@ const ItemOption = _ref => {
|
|
28
28
|
const {
|
29
29
|
conditionBuilderRef
|
30
30
|
} = useContext(ConditionBuilderContext);
|
31
|
-
const allOptions = config
|
31
|
+
const allOptions = config?.options;
|
32
32
|
const [searchValue, setSearchValue] = useState('');
|
33
33
|
const selection = conditionState.value;
|
34
34
|
const filteredItems = searchValue ? allOptions?.filter(opt => opt.label?.toLowerCase().includes(searchValue.toLowerCase())) : allOptions;
|
@@ -95,7 +95,7 @@ const ItemOption = _ref => {
|
|
95
95
|
className: `${blockClass}__item-option__option-content`
|
96
96
|
}, /*#__PURE__*/React__default.createElement("span", {
|
97
97
|
className: `${blockClass}__item-option__option-label`
|
98
|
-
}, Icon && /*#__PURE__*/React__default.createElement(Icon, null), config
|
98
|
+
}, Icon && /*#__PURE__*/React__default.createElement(Icon, null), config?.isStatement ? getStatementContent(option) : option.label), isSelected && /*#__PURE__*/React__default.createElement(Checkmark, {
|
99
99
|
className: `${blockClass}__checkmark`
|
100
100
|
})));
|
101
101
|
})));
|
@@ -32,7 +32,7 @@ const ItemOptionForValueField = _ref => {
|
|
32
32
|
conditionBuilderRef
|
33
33
|
} = useContext(ConditionBuilderContext);
|
34
34
|
const contentRef = useRef(null);
|
35
|
-
const [allOptions, setAllOptions] = useState(config
|
35
|
+
const [allOptions, setAllOptions] = useState(config?.options);
|
36
36
|
const [searchValue, setSearchValue] = useState('');
|
37
37
|
const filteredItems = allOptions?.filter(opt => opt.label.toLowerCase().includes(searchValue.toLowerCase()));
|
38
38
|
const selection = Array.isArray(conditionState.value) ? conditionState.value : conditionState.value !== undefined ? [conditionState.value] : [];
|