@carbon/ibm-products 2.36.0-alpha.27 → 2.37.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 +5404 -5117
- 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 +4 -4
- 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 +820 -61
- 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 +329 -6
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/_virtual/_rollupPluginBabelHelpers.js +9 -10
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.d.ts +3 -1
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +8 -2
- package/es/components/Carousel/Carousel.d.ts +46 -2
- package/es/components/Carousel/Carousel.js +36 -21
- package/es/components/Carousel/CarouselItem.d.ts +19 -2
- package/es/components/Carousel/CarouselItem.js +0 -1
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +21 -0
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +261 -0
- package/es/components/ConditionBuilder/ConditionBuilder.js +45 -16
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +12 -0
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +40 -0
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +22 -0
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +74 -0
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +18 -1
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +90 -42
- package/es/components/ConditionBuilder/ConditionBuilderContext/{DataTreeContext.d.ts → ConditionBuilderProvider.d.ts} +5 -2
- package/es/components/ConditionBuilder/ConditionBuilderContext/{DataTreeContext.js → ConditionBuilderProvider.js} +27 -8
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +22 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +112 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +31 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +40 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +28 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +151 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +11 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +59 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.d.ts +13 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +52 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.d.ts +13 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js +162 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +11 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +40 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +11 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +82 -0
- package/es/components/ConditionBuilder/ConditionConnector/ConditionConnector.d.ts +15 -0
- package/es/components/ConditionBuilder/ConditionConnector/ConditionConnector.js +85 -0
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +24 -0
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +145 -0
- package/es/components/ConditionBuilder/utils/util.d.ts +4 -0
- package/es/components/ConditionBuilder/utils/util.js +16 -0
- package/es/components/CreateTearsheet/CreateTearsheet.d.ts +106 -4
- package/es/components/CreateTearsheet/CreateTearsheet.js +12 -32
- package/es/components/Datagrid/useParentDimensions.js +1 -1
- package/es/components/EditUpdateCards/EditUpdateCards.d.ts +104 -2
- package/es/components/EditUpdateCards/EditUpdateCards.js +3 -0
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.d.ts +61 -2
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +1 -3
- package/es/components/ExpressiveCard/ExpressiveCard.d.ts +97 -2
- package/es/components/ExpressiveCard/ExpressiveCard.js +4 -0
- package/es/components/InlineTip/InlineTipButton.d.ts +21 -2
- package/es/components/InterstitialScreen/InterstitialScreen.d.ts +100 -2
- package/es/components/InterstitialScreen/InterstitialScreen.js +25 -14
- package/es/components/Nav/NavItem.js +1 -1
- package/es/components/NotificationsPanel/NotificationsPanel.js +5 -6
- package/es/components/PageHeader/PageHeader.js +12 -3
- package/es/components/SidePanel/SidePanel.js +1 -1
- package/es/components/SimpleHeader/SimpleHeader.d.ts +1 -5
- package/es/components/SimpleHeader/SimpleHeader.js +2 -4
- package/es/components/Tearsheet/TearsheetNarrow.d.ts +4 -13
- package/es/components/Tearsheet/TearsheetShell.d.ts +119 -10
- package/es/components/Tearsheet/TearsheetShell.js +18 -8
- package/es/components/UserProfileImage/UserProfileImage.d.ts +66 -2
- package/es/components/UserProfileImage/UserProfileImage.js +5 -3
- package/es/components/WebTerminal/WebTerminal.d.ts +46 -2
- package/es/components/WebTerminal/WebTerminal.js +2 -2
- package/es/global/js/hooks/usePrefersReducedMotion.d.ts +2 -0
- package/es/global/js/hooks/usePrefersReducedMotion.js +28 -0
- package/es/global/js/utils/Wrap.d.ts +31 -2
- package/es/global/js/utils/Wrap.js +7 -9
- package/es/global/js/utils/getNodeTextContent.d.ts +1 -1
- package/es/global/js/utils/getNodeTextContent.js +1 -1
- package/es/global/js/utils/window.d.ts +2 -0
- package/es/global/js/utils/window.js +12 -0
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-9.js +2780 -0
- package/lib/_virtual/_rollupPluginBabelHelpers.js +9 -10
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.d.ts +3 -1
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +8 -2
- package/lib/components/Carousel/Carousel.d.ts +46 -2
- package/lib/components/Carousel/Carousel.js +35 -20
- package/lib/components/Carousel/CarouselItem.d.ts +19 -2
- package/lib/components/Carousel/CarouselItem.js +0 -1
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +21 -0
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +270 -0
- package/lib/components/ConditionBuilder/ConditionBuilder.js +46 -17
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +12 -0
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +48 -0
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +22 -0
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +83 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +18 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +90 -42
- package/lib/components/ConditionBuilder/ConditionBuilderContext/{DataTreeContext.d.ts → ConditionBuilderProvider.d.ts} +5 -2
- package/lib/components/ConditionBuilder/ConditionBuilderContext/{DataTreeContext.js → ConditionBuilderProvider.js} +27 -8
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +22 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +121 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +31 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +44 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +28 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +159 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +11 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +67 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.d.ts +13 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +60 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.d.ts +13 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js +170 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +11 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +48 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +11 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +90 -0
- package/lib/components/ConditionBuilder/ConditionConnector/ConditionConnector.d.ts +15 -0
- package/lib/components/ConditionBuilder/ConditionConnector/ConditionConnector.js +93 -0
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +24 -0
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +153 -0
- package/lib/components/ConditionBuilder/utils/util.d.ts +4 -0
- package/lib/components/ConditionBuilder/utils/util.js +20 -0
- package/lib/components/CreateTearsheet/CreateTearsheet.d.ts +106 -4
- package/lib/components/CreateTearsheet/CreateTearsheet.js +12 -32
- package/lib/components/Datagrid/useParentDimensions.js +1 -1
- package/lib/components/EditUpdateCards/EditUpdateCards.d.ts +104 -2
- package/lib/components/EditUpdateCards/EditUpdateCards.js +3 -0
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.d.ts +61 -2
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +1 -3
- package/lib/components/ExpressiveCard/ExpressiveCard.d.ts +97 -2
- package/lib/components/ExpressiveCard/ExpressiveCard.js +4 -0
- package/lib/components/InlineTip/InlineTipButton.d.ts +21 -2
- package/lib/components/InterstitialScreen/InterstitialScreen.d.ts +100 -2
- package/lib/components/InterstitialScreen/InterstitialScreen.js +24 -13
- package/lib/components/Nav/NavItem.js +2 -2
- package/lib/components/NotificationsPanel/NotificationsPanel.js +5 -6
- package/lib/components/PageHeader/PageHeader.js +11 -2
- package/lib/components/SidePanel/SidePanel.js +1 -1
- package/lib/components/SimpleHeader/SimpleHeader.d.ts +1 -5
- package/lib/components/SimpleHeader/SimpleHeader.js +2 -4
- package/lib/components/Tearsheet/TearsheetNarrow.d.ts +4 -13
- package/lib/components/Tearsheet/TearsheetShell.d.ts +119 -10
- package/lib/components/Tearsheet/TearsheetShell.js +16 -6
- package/lib/components/UserProfileImage/UserProfileImage.d.ts +66 -2
- package/lib/components/UserProfileImage/UserProfileImage.js +5 -3
- package/lib/components/WebTerminal/WebTerminal.d.ts +46 -2
- package/lib/components/WebTerminal/WebTerminal.js +2 -2
- package/lib/global/js/hooks/usePrefersReducedMotion.d.ts +2 -0
- package/lib/global/js/hooks/usePrefersReducedMotion.js +32 -0
- package/lib/global/js/utils/Wrap.d.ts +31 -2
- package/lib/global/js/utils/Wrap.js +7 -9
- package/lib/global/js/utils/getNodeTextContent.d.ts +1 -1
- package/lib/global/js/utils/getNodeTextContent.js +1 -1
- package/lib/global/js/utils/window.d.ts +2 -0
- package/lib/global/js/utils/window.js +16 -0
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-9.js +2912 -0
- package/package.json +5 -5
- package/scss/components/CoachmarkOverlayElements/_coachmark-overlay-elements.scss +1 -1
- package/scss/components/ConditionBuilder/_condition-builder.scss +26 -0
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +46 -0
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +194 -0
- package/scss/components/ConditionBuilder/styles/_index.scss +2 -0
- package/scss/components/Guidebanner/_guidebanner.scss +3 -0
- package/scss/components/InterstitialScreen/_interstitial-screen.scss +1 -6
- package/scss/components/Tearsheet/_tearsheet.scss +3 -1
- package/telemetry.yml +3 -0
- package/es/components/ConditionBuilder/assets/sampleInput.d.ts +0 -58
- package/es/global/js/utils/keyboardNavigation.d.ts +0 -27
- package/es/global/js/utils/keyboardNavigation.js +0 -33
- package/es/global/js/utils/wrapFocus.d.ts +0 -25
- package/es/global/js/utils/wrapFocus.js +0 -68
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-8.js +0 -3004
- package/lib/components/ConditionBuilder/assets/sampleInput.d.ts +0 -58
- package/lib/global/js/utils/keyboardNavigation.d.ts +0 -27
- package/lib/global/js/utils/keyboardNavigation.js +0 -39
- package/lib/global/js/utils/wrapFocus.d.ts +0 -25
- package/lib/global/js/utils/wrapFocus.js +0 -73
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-8.js +0 -3136
|
@@ -18,7 +18,7 @@ import '../../global/js/utils/props-helper.js';
|
|
|
18
18
|
import { TooltipTrigger } from '../TooltipTrigger/TooltipTrigger.js';
|
|
19
19
|
|
|
20
20
|
var _TooltipTrigger;
|
|
21
|
-
var _excluded = ["breadcrumbs", "className", "maxVisible", "noTrailingSlash", "overflowAriaLabel"],
|
|
21
|
+
var _excluded = ["breadcrumbs", "className", "maxVisible", "noTrailingSlash", "overflowAriaLabel", "overflowTooltipAlign"],
|
|
22
22
|
_excluded2 = ["label", "key", "title", "id"],
|
|
23
23
|
_excluded3 = ["className", "key", "label", "title"];
|
|
24
24
|
|
|
@@ -38,6 +38,7 @@ var BreadcrumbWithOverflow = function BreadcrumbWithOverflow(_ref) {
|
|
|
38
38
|
maxVisible = _ref.maxVisible,
|
|
39
39
|
noTrailingSlash = _ref.noTrailingSlash,
|
|
40
40
|
overflowAriaLabel = _ref.overflowAriaLabel,
|
|
41
|
+
overflowTooltipAlign = _ref.overflowTooltipAlign,
|
|
41
42
|
other = _objectWithoutProperties(_ref, _excluded);
|
|
42
43
|
var carbonPrefix = usePrefix();
|
|
43
44
|
var _useState = useState(3),
|
|
@@ -62,6 +63,7 @@ var BreadcrumbWithOverflow = function BreadcrumbWithOverflow(_ref) {
|
|
|
62
63
|
return /*#__PURE__*/React__default.createElement(BreadcrumbItem, {
|
|
63
64
|
key: "breadcrumb-overflow-".concat(internalId.current)
|
|
64
65
|
}, /*#__PURE__*/React__default.createElement(OverflowMenu, {
|
|
66
|
+
align: overflowTooltipAlign,
|
|
65
67
|
"aria-label": overflowAriaLabel,
|
|
66
68
|
iconDescription: overflowAriaLabel // also needs setting to avoid a11y "Accessible name does not match or contain the visible label text"
|
|
67
69
|
,
|
|
@@ -319,7 +321,11 @@ BreadcrumbWithOverflow.propTypes = {
|
|
|
319
321
|
overflowAriaLabel: PropTypes.string.isRequired.if(function (_ref6) {
|
|
320
322
|
var breadcrumbs = _ref6.breadcrumbs;
|
|
321
323
|
return breadcrumbs.length > 1;
|
|
322
|
-
})
|
|
324
|
+
}),
|
|
325
|
+
/**
|
|
326
|
+
* overflowTooltipAlign: align tooltip position
|
|
327
|
+
*/
|
|
328
|
+
overflowTooltipAlign: Tooltip.propTypes.align
|
|
323
329
|
};
|
|
324
330
|
BreadcrumbWithOverflow.displayName = componentName;
|
|
325
331
|
|
|
@@ -1,3 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2023, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React, { ReactNode } from 'react';
|
|
8
|
+
interface CarouselProps {
|
|
9
|
+
/**
|
|
10
|
+
* Provide the contents of the Carousel.
|
|
11
|
+
*/
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Provide an optional class to be applied to the containing node.
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Disables the ability of the Carousel to scroll
|
|
19
|
+
* use a keyboard's left and right arrow keys.
|
|
20
|
+
*/
|
|
21
|
+
disableArrowScroll?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Enables the edges of the component to have faded styling.
|
|
24
|
+
*
|
|
25
|
+
* Pass a single string (`$color`) to specify the same color for left and right.
|
|
26
|
+
*
|
|
27
|
+
* Or pass an object (`{ left: $color1, right: $color2 }`) to specify different colors.
|
|
28
|
+
*/
|
|
29
|
+
fadedEdgeColor?: string | {
|
|
30
|
+
left: string;
|
|
31
|
+
right: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* An optional callback function that returns `true`
|
|
35
|
+
* when the carousel has enough content to be scrollable,
|
|
36
|
+
* and `false` when there is not enough content.
|
|
37
|
+
*/
|
|
38
|
+
onChangeIsScrollable?: (isScrollable: boolean) => void;
|
|
39
|
+
/**
|
|
40
|
+
* An optional callback function that returns the scroll position as
|
|
41
|
+
* a value between 0 and 1.
|
|
42
|
+
*/
|
|
43
|
+
onScroll?: (scrollPercent: number) => void;
|
|
44
|
+
}
|
|
1
45
|
/**
|
|
2
46
|
* The Carousel acts as a scaffold for other Novice to Pro content.
|
|
3
47
|
*
|
|
@@ -14,5 +58,5 @@
|
|
|
14
58
|
* 2. From the right-aligned position, when scrolling left,
|
|
15
59
|
* the left-most item should again be left-aligned.
|
|
16
60
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
61
|
+
declare const Carousel: React.ForwardRefExoticComponent<CarouselProps & React.RefAttributes<HTMLDivElement>>;
|
|
62
|
+
export { Carousel };
|
|
@@ -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, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, typeof as _typeof, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import React__default, { useRef, useCallback, useEffect, useImperativeHandle } from 'react';
|
|
10
10
|
import PropTypes from '../../node_modules/prop-types/index.js';
|
|
11
11
|
import { CarouselItem } from './CarouselItem.js';
|
|
@@ -14,7 +14,6 @@ import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
|
|
14
14
|
import { pkg } from '../../settings.js';
|
|
15
15
|
|
|
16
16
|
var _excluded = ["children", "className", "disableArrowScroll", "fadedEdgeColor", "onChangeIsScrollable", "onScroll"];
|
|
17
|
-
|
|
18
17
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
|
19
18
|
var blockClass = "".concat(pkg.prefix, "--carousel");
|
|
20
19
|
var componentName = 'Carousel';
|
|
@@ -53,29 +52,31 @@ var Carousel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
53
52
|
_ref$onScroll = _ref.onScroll,
|
|
54
53
|
onScroll = _ref$onScroll === void 0 ? defaults.onScroll : _ref$onScroll,
|
|
55
54
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
56
|
-
var carouselRef = useRef();
|
|
57
|
-
var scrollRef = useRef();
|
|
55
|
+
var carouselRef = useRef(null);
|
|
56
|
+
var scrollRef = useRef(null);
|
|
58
57
|
// Array of refs used to reference this component's children DOM elements
|
|
59
58
|
var childElementsRef = useRef(Array(React__default.Children.count(children)).fill(useRef(null)));
|
|
60
|
-
var leftFadedEdgeColor = (fadedEdgeColor === null || fadedEdgeColor === void 0 ? void 0 : fadedEdgeColor.left
|
|
61
|
-
var rightFadedEdgeColor = (fadedEdgeColor === null || fadedEdgeColor === void 0 ? void 0 : fadedEdgeColor.right
|
|
59
|
+
var leftFadedEdgeColor = _typeof(fadedEdgeColor) === 'object' ? fadedEdgeColor === null || fadedEdgeColor === void 0 ? void 0 : fadedEdgeColor.left : fadedEdgeColor;
|
|
60
|
+
var rightFadedEdgeColor = _typeof(fadedEdgeColor) === 'object' ? fadedEdgeColor === null || fadedEdgeColor === void 0 ? void 0 : fadedEdgeColor.right : fadedEdgeColor;
|
|
62
61
|
|
|
63
62
|
// Trigger callbacks to report state of the carousel
|
|
64
63
|
var handleOnScroll = useCallback(function () {
|
|
64
|
+
var _scrollRef$current, _scrollRef$current2, _scrollRef$current3;
|
|
65
|
+
if (!scrollRef.current) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
65
69
|
// viewport's width
|
|
66
|
-
var clientWidth = scrollRef.current.clientWidth;
|
|
70
|
+
var clientWidth = (_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 ? void 0 : _scrollRef$current.clientWidth;
|
|
67
71
|
// scroll position
|
|
68
|
-
var scrollLeft = parseInt(scrollRef.current.scrollLeft, 10);
|
|
72
|
+
var scrollLeft = parseInt("".concat((_scrollRef$current2 = scrollRef.current) === null || _scrollRef$current2 === void 0 ? void 0 : _scrollRef$current2.scrollLeft), 10);
|
|
69
73
|
// scrollable width
|
|
70
|
-
var scrollWidth = scrollRef.current.scrollWidth;
|
|
74
|
+
var scrollWidth = (_scrollRef$current3 = scrollRef.current) === null || _scrollRef$current3 === void 0 ? void 0 : _scrollRef$current3.scrollWidth;
|
|
71
75
|
|
|
72
76
|
// The maximum scrollLeft achievable is the scrollable width - the viewport width.
|
|
73
77
|
var scrollLeftMax = scrollWidth - clientWidth;
|
|
74
78
|
// if isNaN(scrollLeft / scrollLeftMax), then set to zero
|
|
75
79
|
var scrollPercent = parseFloat((scrollLeft / scrollLeftMax).toFixed(2)) || 0;
|
|
76
|
-
if (!scrollRef.current) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
80
|
|
|
80
81
|
// Callback 1: Does the carousel have enough content to enable scrolling?
|
|
81
82
|
onChangeIsScrollable(scrollWidth > clientWidth);
|
|
@@ -95,7 +96,8 @@ var Carousel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
95
96
|
|
|
96
97
|
// Get all elements that are visible in the container.
|
|
97
98
|
var getElementsInView = useCallback(function () {
|
|
98
|
-
var
|
|
99
|
+
var _scrollRef$current4;
|
|
100
|
+
var containerRect = scrollRef === null || scrollRef === void 0 || (_scrollRef$current4 = scrollRef.current) === null || _scrollRef$current4 === void 0 ? void 0 : _scrollRef$current4.getBoundingClientRect();
|
|
99
101
|
var inViewElements = childElementsRef.current.filter(function (el) {
|
|
100
102
|
return getElementInView(containerRect, el.getBoundingClientRect());
|
|
101
103
|
});
|
|
@@ -104,8 +106,9 @@ var Carousel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
104
106
|
|
|
105
107
|
// Return container's and children's rect data
|
|
106
108
|
var getContainerAndChildRectData = useCallback(function () {
|
|
109
|
+
var _scrollRef$current5;
|
|
107
110
|
// Get the rect of the container
|
|
108
|
-
var containerRect = scrollRef.current.getBoundingClientRect();
|
|
111
|
+
var containerRect = scrollRef === null || scrollRef === void 0 || (_scrollRef$current5 = scrollRef.current) === null || _scrollRef$current5 === void 0 ? void 0 : _scrollRef$current5.getBoundingClientRect();
|
|
109
112
|
// Get all child elements that are in view of the container, and return their bounding rects.
|
|
110
113
|
var elementRectsInView = getElementsInView().map(function (el) {
|
|
111
114
|
return el.getBoundingClientRect();
|
|
@@ -123,27 +126,37 @@ var Carousel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
123
126
|
};
|
|
124
127
|
}, [getElementsInView]);
|
|
125
128
|
var handleScrollNext = useCallback(function () {
|
|
129
|
+
if (!scrollRef.current) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
126
132
|
var _getContainerAndChild = getContainerAndChildRectData(),
|
|
127
133
|
containerRect = _getContainerAndChild.containerRect,
|
|
128
134
|
visibleWidth = _getContainerAndChild.visibleWidth;
|
|
129
135
|
// Set the scrollValue to the visibleWidth, but if the visibleWidth value is 0, set it to the container's width
|
|
130
|
-
var scrollValue = visibleWidth > 0 ? visibleWidth : containerRect.width;
|
|
136
|
+
var scrollValue = visibleWidth > 0 ? visibleWidth : containerRect === null || containerRect === void 0 ? void 0 : containerRect.width;
|
|
131
137
|
// Increment the scrollLeft of the container
|
|
132
138
|
scrollRef.current.scrollLeft += scrollValue;
|
|
133
139
|
}, [getContainerAndChildRectData]);
|
|
134
140
|
var handleScrollPrev = useCallback(function () {
|
|
141
|
+
var _containerRect$width, _containerRect$left;
|
|
142
|
+
if (!scrollRef.current) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
135
145
|
var _getContainerAndChild2 = getContainerAndChildRectData(),
|
|
136
146
|
containerRect = _getContainerAndChild2.containerRect,
|
|
137
147
|
elementRectsInView = _getContainerAndChild2.elementRectsInView,
|
|
138
148
|
visibleWidth = _getContainerAndChild2.visibleWidth;
|
|
139
149
|
// Set the scrollValue to the visibleWidth minus the first child's left value,
|
|
140
150
|
// but if the visibleWidth value is 0, set it to the container's width plus the container's left value
|
|
141
|
-
var scrollValue = visibleWidth > 0 ? visibleWidth - elementRectsInView[0].left : containerRect.width + containerRect.left;
|
|
151
|
+
var scrollValue = visibleWidth > 0 ? visibleWidth - elementRectsInView[0].left : ((_containerRect$width = containerRect === null || containerRect === void 0 ? void 0 : containerRect.width) !== null && _containerRect$width !== void 0 ? _containerRect$width : 0) + ((_containerRect$left = containerRect === null || containerRect === void 0 ? void 0 : containerRect.left) !== null && _containerRect$left !== void 0 ? _containerRect$left : 0);
|
|
142
152
|
|
|
143
153
|
// Decrement the scrollLeft of the container
|
|
144
154
|
scrollRef.current.scrollLeft -= scrollValue;
|
|
145
155
|
}, [getContainerAndChildRectData]);
|
|
146
156
|
var handleScrollReset = useCallback(function () {
|
|
157
|
+
if (!scrollRef.current) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
147
160
|
// This doesn't trigger "scrollend"...
|
|
148
161
|
scrollRef.current.scrollLeft = 0;
|
|
149
162
|
// ...so trigger a callback manually.
|
|
@@ -170,6 +183,9 @@ var Carousel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
170
183
|
// On window.resize, reset carousel to zero.
|
|
171
184
|
useEffect(function () {
|
|
172
185
|
var handleWindowResize = function handleWindowResize() {
|
|
186
|
+
if (!scrollRef.current) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
173
189
|
scrollRef.current.scrollLeft = 0;
|
|
174
190
|
handleOnScroll();
|
|
175
191
|
};
|
|
@@ -185,9 +201,9 @@ var Carousel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
185
201
|
handleOnScroll();
|
|
186
202
|
};
|
|
187
203
|
var scrollDiv = scrollRef.current;
|
|
188
|
-
scrollDiv.addEventListener('scrollend', handleScrollend);
|
|
204
|
+
scrollDiv === null || scrollDiv === void 0 || scrollDiv.addEventListener('scrollend', handleScrollend);
|
|
189
205
|
return function () {
|
|
190
|
-
return scrollDiv.removeEventListener('scrollend', handleScrollend);
|
|
206
|
+
return scrollDiv === null || scrollDiv === void 0 ? void 0 : scrollDiv.removeEventListener('scrollend', handleScrollend);
|
|
191
207
|
};
|
|
192
208
|
}, [handleOnScroll]);
|
|
193
209
|
|
|
@@ -207,9 +223,7 @@ var Carousel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
207
223
|
passive: false
|
|
208
224
|
});
|
|
209
225
|
return function () {
|
|
210
|
-
scrollDiv.removeEventListener('wheel', handleWheel
|
|
211
|
-
passive: false
|
|
212
|
-
});
|
|
226
|
+
scrollDiv.removeEventListener('wheel', handleWheel);
|
|
213
227
|
};
|
|
214
228
|
}
|
|
215
229
|
}, []);
|
|
@@ -305,6 +319,7 @@ Carousel.propTypes = {
|
|
|
305
319
|
*
|
|
306
320
|
* Or pass an object (`{ left: $color1, right: $color2 }`) to specify different colors.
|
|
307
321
|
*/
|
|
322
|
+
/**@ts-ignore*/
|
|
308
323
|
fadedEdgeColor: PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
309
324
|
left: PropTypes.string,
|
|
310
325
|
right: PropTypes.string
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2023, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React, { ReactNode } from 'react';
|
|
8
|
+
interface CarouselItemProps {
|
|
9
|
+
/**
|
|
10
|
+
* Provide the contents of the CarouselItem.
|
|
11
|
+
*/
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Provide an optional class to be applied to the containing node.
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
1
18
|
/**
|
|
2
19
|
* TODO: A description of the component.
|
|
3
20
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
21
|
+
declare const CarouselItem: React.ForwardRefExoticComponent<CarouselItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
export { CarouselItem };
|
|
@@ -13,7 +13,6 @@ import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
|
|
13
13
|
import { pkg } from '../../settings.js';
|
|
14
14
|
|
|
15
15
|
var _excluded = ["children", "className"];
|
|
16
|
-
|
|
17
16
|
// Carbon and package components we use.
|
|
18
17
|
/* TODO: @import(s) of carbon components and other package components. */
|
|
19
18
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default ConditionBlock;
|
|
2
|
+
/**
|
|
3
|
+
* This component build each block of condition consisting of property, operator value and close button.
|
|
4
|
+
*/
|
|
5
|
+
declare function ConditionBlock(props: any): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare namespace ConditionBlock {
|
|
7
|
+
namespace propTypes {
|
|
8
|
+
let addConditionHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
|
9
|
+
let aria: PropTypes.Requireable<object>;
|
|
10
|
+
let conditionIndex: PropTypes.Requireable<number>;
|
|
11
|
+
let conjunction: PropTypes.Requireable<string>;
|
|
12
|
+
let group: PropTypes.Requireable<object>;
|
|
13
|
+
let isStatement: PropTypes.Requireable<boolean>;
|
|
14
|
+
let onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
|
+
let onConnectorOperatorChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
16
|
+
let onRemove: PropTypes.Requireable<(...args: any[]) => any>;
|
|
17
|
+
let onStatementChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
|
+
let state: PropTypes.Requireable<object>;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
import PropTypes from 'prop-types';
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2020, 2024
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { slicedToArray as _slicedToArray, defineProperty as _defineProperty, objectSpread2 as _objectSpread2 } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
+
import React__default, { useContext, useState } from 'react';
|
|
10
|
+
import { Close } from '@carbon/react/icons';
|
|
11
|
+
import { ConditionBuilderItem } from '../ConditionBuilderItem/ConditionBuilderItem.js';
|
|
12
|
+
import PropTypes from '../../../node_modules/prop-types/index.js';
|
|
13
|
+
import { blockClass, translateWithId, statementConfig, operatorConfig } from '../ConditionBuilderContext/DataConfigs.js';
|
|
14
|
+
import { ConditionBuilderItemOption } from '../ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js';
|
|
15
|
+
import cx from 'classnames';
|
|
16
|
+
import ConditionConnector from '../ConditionConnector/ConditionConnector.js';
|
|
17
|
+
import { ConditionBuilderItemNumber } from '../ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js';
|
|
18
|
+
import { ConditionBuilderItemText } from '../ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js';
|
|
19
|
+
import { ConditionBuilderItemDate } from '../ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js';
|
|
20
|
+
import { ConditionBuilderContext } from '../ConditionBuilderContext/ConditionBuilderProvider.js';
|
|
21
|
+
import { ConditionBuilderButton } from '../ConditionBuilderButton/ConditionBuilderButton.js';
|
|
22
|
+
import { focusThisField } from '../utils/util.js';
|
|
23
|
+
import { ConditionBuilderItemTime } from '../ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js';
|
|
24
|
+
import ConditionBuilderAdd from '../ConditionBuilderAdd/ConditionBuilderAdd.js';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* This component build each block of condition consisting of property, operator value and close button.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
var ConditionBlock = function ConditionBlock(props) {
|
|
31
|
+
var _props$state = props.state,
|
|
32
|
+
property = _props$state.property,
|
|
33
|
+
value = _props$state.value,
|
|
34
|
+
operator = _props$state.operator;
|
|
35
|
+
var onRemove = props.onRemove,
|
|
36
|
+
onChange = props.onChange,
|
|
37
|
+
state = props.state,
|
|
38
|
+
conjunction = props.conjunction,
|
|
39
|
+
onConnectorOperatorChange = props.onConnectorOperatorChange,
|
|
40
|
+
isStatement = props.isStatement,
|
|
41
|
+
group = props.group,
|
|
42
|
+
onStatementChange = props.onStatementChange,
|
|
43
|
+
addConditionHandler = props.addConditionHandler,
|
|
44
|
+
conditionIndex = props.conditionIndex;
|
|
45
|
+
var _useContext = useContext(ConditionBuilderContext),
|
|
46
|
+
inputConfig = _useContext.inputConfig;
|
|
47
|
+
var itemComponents = {
|
|
48
|
+
option: ConditionBuilderItemOption,
|
|
49
|
+
text: ConditionBuilderItemText,
|
|
50
|
+
number: ConditionBuilderItemNumber,
|
|
51
|
+
date: ConditionBuilderItemDate,
|
|
52
|
+
time: ConditionBuilderItemTime
|
|
53
|
+
};
|
|
54
|
+
var _useState = useState(false),
|
|
55
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
56
|
+
showDeletionPreview = _useState2[0],
|
|
57
|
+
setShowDeletionPreview = _useState2[1];
|
|
58
|
+
|
|
59
|
+
//filtering the current property to access its properties and config options
|
|
60
|
+
var getCurrentConfig = function getCurrentConfig(property) {
|
|
61
|
+
var _inputConfig$properti, _inputConfig$properti2;
|
|
62
|
+
return (_inputConfig$properti = (_inputConfig$properti2 = inputConfig.properties) === null || _inputConfig$properti2 === void 0 ? void 0 : _inputConfig$properti2.filter(function (eachProperty) {
|
|
63
|
+
var _eachProperty$label;
|
|
64
|
+
return ((_eachProperty$label = eachProperty.label) === null || _eachProperty$label === void 0 ? void 0 : _eachProperty$label.toUpperCase()) == (property === null || property === void 0 ? void 0 : property.toUpperCase());
|
|
65
|
+
})[0]) !== null && _inputConfig$properti !== void 0 ? _inputConfig$properti : {};
|
|
66
|
+
};
|
|
67
|
+
var isLastCondition = function isLastCondition(conditionIndex, conditionArr) {
|
|
68
|
+
return conditionIndex + 1 >= conditionArr.length || conditionArr.length - 1 != conditionIndex && conditionArr[conditionIndex + 1].conditions;
|
|
69
|
+
};
|
|
70
|
+
var _getCurrentConfig = getCurrentConfig(property),
|
|
71
|
+
icon = _getCurrentConfig.icon,
|
|
72
|
+
type = _getCurrentConfig.type,
|
|
73
|
+
config = _getCurrentConfig.config,
|
|
74
|
+
label = _getCurrentConfig.label;
|
|
75
|
+
var ItemComponent = property ? itemComponents[type] : null;
|
|
76
|
+
var onStatementChangeHandler = function onStatementChangeHandler(v, e) {
|
|
77
|
+
focusThisField(e);
|
|
78
|
+
onStatementChange(v);
|
|
79
|
+
};
|
|
80
|
+
var onConnectorOperatorChangeHandler = function onConnectorOperatorChangeHandler(op) {
|
|
81
|
+
onConnectorOperatorChange(op);
|
|
82
|
+
};
|
|
83
|
+
var onPropertyChangeHandler = function onPropertyChangeHandler(newProperty) {
|
|
84
|
+
onChange(_objectSpread2(_objectSpread2({}, state), {}, {
|
|
85
|
+
property: newProperty,
|
|
86
|
+
operator: undefined,
|
|
87
|
+
value: '',
|
|
88
|
+
popoverToOpen: 'operatorField'
|
|
89
|
+
}));
|
|
90
|
+
};
|
|
91
|
+
var onOperatorChangeHandler = function onOperatorChangeHandler(newOperator) {
|
|
92
|
+
onChange(_objectSpread2(_objectSpread2({}, state), {}, {
|
|
93
|
+
operator: newOperator,
|
|
94
|
+
value: undefined,
|
|
95
|
+
popoverToOpen: 'valueField'
|
|
96
|
+
}));
|
|
97
|
+
};
|
|
98
|
+
var onValueChangeHandler = function onValueChangeHandler(newValue) {
|
|
99
|
+
onChange(_objectSpread2(_objectSpread2({}, state), {}, {
|
|
100
|
+
value: newValue,
|
|
101
|
+
popoverToOpen: ''
|
|
102
|
+
}));
|
|
103
|
+
};
|
|
104
|
+
var handleShowDeletionPreview = function handleShowDeletionPreview() {
|
|
105
|
+
setShowDeletionPreview(true);
|
|
106
|
+
};
|
|
107
|
+
var handleHideDeletionPreview = function handleHideDeletionPreview() {
|
|
108
|
+
setShowDeletionPreview(false);
|
|
109
|
+
};
|
|
110
|
+
var getOperators = function getOperators() {
|
|
111
|
+
return operatorConfig.filter(function (operator) {
|
|
112
|
+
return operator.type.indexOf(type) != -1 || operator.type == 'all';
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
116
|
+
className: cx("".concat(blockClass, "__condition-block conditionBlockWrapper ").concat(blockClass, "__gap ").concat(blockClass, "__gap-bottom"), _defineProperty({}, "".concat(blockClass, "__condition-builder-condition__deletion-preview"), showDeletionPreview)),
|
|
117
|
+
key: conditionIndex,
|
|
118
|
+
role: "row",
|
|
119
|
+
"aria-label": translateWithId('condition_row'),
|
|
120
|
+
tabIndex: -1
|
|
121
|
+
}, isStatement && /*#__PURE__*/React__default.createElement(ConditionBuilderItem
|
|
122
|
+
// open={false}
|
|
123
|
+
, {
|
|
124
|
+
label: group.statement,
|
|
125
|
+
title: translateWithId('condition'),
|
|
126
|
+
"data-name": "connectorField",
|
|
127
|
+
popOverClassName: "".concat(blockClass, "__gap"),
|
|
128
|
+
className: "".concat(blockClass, "__statement-button")
|
|
129
|
+
}, /*#__PURE__*/React__default.createElement(ConditionBuilderItemOption, {
|
|
130
|
+
conditionState: {
|
|
131
|
+
value: group.statement,
|
|
132
|
+
label: translateWithId('condition')
|
|
133
|
+
},
|
|
134
|
+
onChange: onStatementChangeHandler,
|
|
135
|
+
config: {
|
|
136
|
+
options: statementConfig
|
|
137
|
+
}
|
|
138
|
+
})), conjunction && /*#__PURE__*/React__default.createElement(ConditionConnector, {
|
|
139
|
+
className: "".concat(blockClass, "__gap"),
|
|
140
|
+
operator: conjunction,
|
|
141
|
+
onChange: onConnectorOperatorChangeHandler
|
|
142
|
+
}), /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
|
|
143
|
+
label: label,
|
|
144
|
+
title: translateWithId('property'),
|
|
145
|
+
renderIcon: icon !== null && icon !== void 0 ? icon : null,
|
|
146
|
+
className: "".concat(blockClass, "__property-field"),
|
|
147
|
+
"data-name": "propertyField",
|
|
148
|
+
state: state,
|
|
149
|
+
type: type
|
|
150
|
+
}, /*#__PURE__*/React__default.createElement(ConditionBuilderItemOption, {
|
|
151
|
+
conditionState: {
|
|
152
|
+
value: property,
|
|
153
|
+
label: translateWithId('property')
|
|
154
|
+
},
|
|
155
|
+
onChange: onPropertyChangeHandler,
|
|
156
|
+
config: {
|
|
157
|
+
options: inputConfig.properties
|
|
158
|
+
}
|
|
159
|
+
})), property && /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
|
|
160
|
+
label: operator,
|
|
161
|
+
title: translateWithId('operator'),
|
|
162
|
+
"data-name": "operatorField",
|
|
163
|
+
state: state,
|
|
164
|
+
type: type
|
|
165
|
+
}, /*#__PURE__*/React__default.createElement(ConditionBuilderItemOption, {
|
|
166
|
+
config: {
|
|
167
|
+
options: getOperators()
|
|
168
|
+
},
|
|
169
|
+
conditionState: {
|
|
170
|
+
value: operator,
|
|
171
|
+
label: translateWithId('operator')
|
|
172
|
+
},
|
|
173
|
+
onChange: onOperatorChangeHandler
|
|
174
|
+
})), property && operator && /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
|
|
175
|
+
label: value,
|
|
176
|
+
type: type,
|
|
177
|
+
title: label,
|
|
178
|
+
showToolTip: true,
|
|
179
|
+
"data-name": "valueField",
|
|
180
|
+
state: state,
|
|
181
|
+
config: config
|
|
182
|
+
}, /*#__PURE__*/React__default.createElement(ItemComponent, {
|
|
183
|
+
conditionState: {
|
|
184
|
+
property: property,
|
|
185
|
+
operator: operator,
|
|
186
|
+
value: value
|
|
187
|
+
},
|
|
188
|
+
onChange: onValueChangeHandler,
|
|
189
|
+
config: config
|
|
190
|
+
})), /*#__PURE__*/React__default.createElement("span", {
|
|
191
|
+
role: "gridcell",
|
|
192
|
+
"aria-label": translateWithId('remove_condition')
|
|
193
|
+
}, /*#__PURE__*/React__default.createElement(ConditionBuilderButton, {
|
|
194
|
+
hideLabel: true,
|
|
195
|
+
label: translateWithId('remove_condition'),
|
|
196
|
+
onClick: onRemove,
|
|
197
|
+
onMouseEnter: handleShowDeletionPreview,
|
|
198
|
+
onMouseLeave: handleHideDeletionPreview,
|
|
199
|
+
onFocus: handleShowDeletionPreview,
|
|
200
|
+
onBlur: handleHideDeletionPreview,
|
|
201
|
+
renderIcon: Close,
|
|
202
|
+
className: "".concat(blockClass, "__close-condition"),
|
|
203
|
+
"data-name": "closeCondition"
|
|
204
|
+
})), isLastCondition(conditionIndex, group.conditions) && /*#__PURE__*/React__default.createElement(ConditionBuilderAdd, {
|
|
205
|
+
onClick: function onClick() {
|
|
206
|
+
addConditionHandler(conditionIndex);
|
|
207
|
+
}
|
|
208
|
+
//addConditionSubGroupHandler={()=>{addConditionSubGroupHandler(conditionIndex)}}
|
|
209
|
+
,
|
|
210
|
+
className: "".concat(blockClass, "__gap ").concat(blockClass, "__gap-left")
|
|
211
|
+
}));
|
|
212
|
+
};
|
|
213
|
+
var ConditionBlock$1 = ConditionBlock;
|
|
214
|
+
ConditionBlock.propTypes = {
|
|
215
|
+
/**
|
|
216
|
+
* callback to add a new condition
|
|
217
|
+
*/
|
|
218
|
+
addConditionHandler: PropTypes.func,
|
|
219
|
+
/**
|
|
220
|
+
* object hold aria attributes
|
|
221
|
+
*/
|
|
222
|
+
aria: PropTypes.object,
|
|
223
|
+
/**
|
|
224
|
+
* index of the current condition
|
|
225
|
+
*/
|
|
226
|
+
conditionIndex: PropTypes.number,
|
|
227
|
+
/**
|
|
228
|
+
* string that decides to show the condition connector
|
|
229
|
+
*/
|
|
230
|
+
conjunction: PropTypes.string,
|
|
231
|
+
/**
|
|
232
|
+
* object that hold the current group object where is condition is part of
|
|
233
|
+
*/
|
|
234
|
+
group: PropTypes.object,
|
|
235
|
+
/**
|
|
236
|
+
* boolean that decides to show the statement(if/ excl.if)
|
|
237
|
+
*/
|
|
238
|
+
isStatement: PropTypes.bool,
|
|
239
|
+
/**
|
|
240
|
+
* callback to update the current condition of the state tree
|
|
241
|
+
*/
|
|
242
|
+
onChange: PropTypes.func,
|
|
243
|
+
/**
|
|
244
|
+
* callback to handle the connector(and/or) change
|
|
245
|
+
*/
|
|
246
|
+
onConnectorOperatorChange: PropTypes.func,
|
|
247
|
+
/**
|
|
248
|
+
* callback for Remove a condition
|
|
249
|
+
*/
|
|
250
|
+
onRemove: PropTypes.func,
|
|
251
|
+
/**
|
|
252
|
+
* callback to handle the statement(if/ excl.if) change
|
|
253
|
+
*/
|
|
254
|
+
onStatementChange: PropTypes.func,
|
|
255
|
+
/**
|
|
256
|
+
* object that hold the current condition
|
|
257
|
+
*/
|
|
258
|
+
state: PropTypes.object
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
export { ConditionBlock$1 as default };
|