@carbon/ibm-products 2.46.0 → 2.47.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/config-dev.css +6 -1
- package/css/config-dev.css.map +1 -1
- package/css/config.css +6 -1
- package/css/config.css.map +1 -1
- package/css/index-full-carbon.css +1323 -264
- 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 +49 -60
- 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 +1323 -264
- 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 +1323 -264
- 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/APIKeyModal/APIKeyModal.types.d.ts +6 -0
- package/es/components/ActionBar/ActionBar.d.ts +58 -2
- package/es/components/ActionBar/ActionBar.js +14 -9
- package/es/components/ActionBar/ActionBarItem.d.ts +36 -2
- package/es/components/ActionBar/ActionBarItem.js +7 -4
- package/es/components/ActionBar/ActionBarOverflowItems.d.ts +55 -16
- package/es/components/ActionBar/ActionBarOverflowItems.js +8 -4
- package/es/components/AddSelect/types/index.d.ts +6 -0
- package/es/components/Card/Card.d.ts +68 -2
- package/es/components/Card/Card.js +28 -35
- package/es/components/Card/CardFooter.d.ts +51 -48
- package/es/components/Card/CardFooter.js +4 -2
- package/es/components/Card/CardHeader.d.ts +67 -49
- package/es/components/Card/CardHeader.js +4 -2
- package/es/components/Coachmark/utils/enums.d.ts +6 -0
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +1 -0
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +17 -4
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +6 -4
- package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +4 -1
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +8 -2
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +3 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +5 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +20 -4
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +15 -7
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +9 -3
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +19 -6
- package/es/components/DataSpreadsheet/types/index.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/DatagridBody.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/DatagridContent.js +3 -2
- package/es/components/Datagrid/Datagrid/DatagridRefBody.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +4 -5
- package/es/components/Datagrid/Datagrid/DatagridSimpleBody.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -1
- package/es/components/Datagrid/Datagrid/DraggableElement.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -2
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +13 -8
- package/es/components/Datagrid/Datagrid/addons/Filtering/handleCheckboxChange.js +7 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +1 -1
- package/es/components/Datagrid/common-column-ids.d.ts +6 -0
- package/es/components/Datagrid/types/index.d.ts +6 -0
- package/es/components/Datagrid/useDatagrid.d.ts +6 -0
- package/es/components/Datagrid/useDisableSelectRows.d.ts +6 -0
- package/es/components/Datagrid/useInitialColumnSort.js +4 -0
- package/es/components/Datagrid/useRowIsMouseOver.d.ts +6 -0
- package/es/components/Datagrid/useSortableColumns.d.ts +5 -4
- package/es/components/Datagrid/useSortableColumns.js +18 -13
- package/es/components/EmptyStates/EmptyState.d.ts +72 -5
- package/es/components/EmptyStates/EmptyState.js +8 -5
- package/es/components/EmptyStates/EmptyStateV2.d.ts +63 -2
- package/es/components/EmptyStates/EmptyStateV2.js +3 -2
- package/es/components/FullPageError/FullPageError.d.ts +36 -2
- package/es/components/FullPageError/FullPageError.js +0 -3
- package/es/components/GetStartedCard/GetStartedCard.d.ts +60 -2
- package/es/components/GetStartedCard/GetStartedCard.js +11 -10
- package/es/components/PageHeader/PageHeaderUtils.js +1 -1
- package/es/components/StringFormatter/utils/enums.js +7 -0
- package/es/components/TagOverflow/TagOverflow.d.ts +35 -4
- package/es/components/TagOverflow/TagOverflow.js +47 -64
- package/es/components/TagOverflow/TagOverflowModal.js +4 -6
- package/es/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
- package/es/components/TagOverflow/TagOverflowPopover.js +38 -41
- package/es/components/Tearsheet/TearsheetShell.js +4 -1
- package/es/components/UserAvatar/UserAvatar.d.ts +59 -1
- package/es/components/UserAvatar/UserAvatar.js +7 -23
- package/es/global/js/utils/scrollableAncestor.js +7 -0
- package/es/global/js/utils/uuidv4.d.ts +6 -0
- package/es/global/js/utils/uuidv4.js +2 -0
- package/es/global/js/utils/wait.d.ts +6 -0
- package/es/global/js/utils/wait.js +2 -0
- package/flags.js +7 -0
- package/lib/components/APIKeyModal/APIKeyModal.types.d.ts +6 -0
- package/lib/components/ActionBar/ActionBar.d.ts +58 -2
- package/lib/components/ActionBar/ActionBar.js +14 -9
- package/lib/components/ActionBar/ActionBarItem.d.ts +36 -2
- package/lib/components/ActionBar/ActionBarItem.js +6 -3
- package/lib/components/ActionBar/ActionBarOverflowItems.d.ts +55 -16
- package/lib/components/ActionBar/ActionBarOverflowItems.js +8 -4
- package/lib/components/AddSelect/types/index.d.ts +6 -0
- package/lib/components/Card/Card.d.ts +68 -2
- package/lib/components/Card/Card.js +28 -35
- package/lib/components/Card/CardFooter.d.ts +51 -48
- package/lib/components/Card/CardFooter.js +4 -2
- package/lib/components/Card/CardHeader.d.ts +67 -49
- package/lib/components/Card/CardHeader.js +4 -2
- package/lib/components/Coachmark/utils/enums.d.ts +6 -0
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +1 -0
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +16 -3
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +5 -3
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +4 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +8 -2
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +3 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +5 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +20 -4
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +15 -7
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +9 -3
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +19 -6
- package/lib/components/DataSpreadsheet/types/index.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/DatagridBody.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +3 -2
- package/lib/components/Datagrid/Datagrid/DatagridRefBody.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +4 -5
- package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -1
- package/lib/components/Datagrid/Datagrid/DraggableElement.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -2
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +13 -8
- package/lib/components/Datagrid/Datagrid/addons/Filtering/handleCheckboxChange.js +7 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +1 -1
- package/lib/components/Datagrid/common-column-ids.d.ts +6 -0
- package/lib/components/Datagrid/types/index.d.ts +6 -0
- package/lib/components/Datagrid/useDatagrid.d.ts +6 -0
- package/lib/components/Datagrid/useDisableSelectRows.d.ts +6 -0
- package/lib/components/Datagrid/useInitialColumnSort.js +4 -0
- package/lib/components/Datagrid/useRowIsMouseOver.d.ts +6 -0
- package/lib/components/Datagrid/useSortableColumns.d.ts +5 -4
- package/lib/components/Datagrid/useSortableColumns.js +18 -13
- package/lib/components/EmptyStates/EmptyState.d.ts +72 -5
- package/lib/components/EmptyStates/EmptyState.js +8 -5
- package/lib/components/EmptyStates/EmptyStateV2.d.ts +63 -2
- package/lib/components/EmptyStates/EmptyStateV2.js +3 -2
- package/lib/components/FullPageError/FullPageError.d.ts +36 -2
- package/lib/components/FullPageError/FullPageError.js +0 -3
- package/lib/components/GetStartedCard/GetStartedCard.d.ts +60 -2
- package/lib/components/GetStartedCard/GetStartedCard.js +10 -9
- package/lib/components/PageHeader/PageHeaderUtils.js +1 -1
- package/lib/components/StringFormatter/utils/enums.js +7 -0
- package/lib/components/TagOverflow/TagOverflow.d.ts +35 -4
- package/lib/components/TagOverflow/TagOverflow.js +46 -63
- package/lib/components/TagOverflow/TagOverflowModal.js +4 -6
- package/lib/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
- package/lib/components/TagOverflow/TagOverflowPopover.js +37 -40
- package/lib/components/Tearsheet/TearsheetShell.js +4 -1
- package/lib/components/UserAvatar/UserAvatar.d.ts +59 -1
- package/lib/components/UserAvatar/UserAvatar.js +7 -23
- package/lib/global/js/utils/scrollableAncestor.js +7 -0
- package/lib/global/js/utils/uuidv4.d.ts +6 -0
- package/lib/global/js/utils/uuidv4.js +2 -0
- package/lib/global/js/utils/wait.d.ts +6 -0
- package/lib/global/js/utils/wait.js +2 -0
- package/package.json +4 -4
- package/scss/components/ConditionBuilder/_condition-builder.scss +3 -0
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +18 -2
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +48 -31
- package/scss/components/ConditionBuilder/styles/_index.scss +7 -0
- package/scss/components/CreateModal/_create-modal.scss +0 -4
- package/scss/components/Datagrid/styles/_datagrid.scss +1 -0
- package/scss/components/Datagrid/styles/_useActionsColumn.scss +6 -7
- package/scss/components/Datagrid/styles/_useColumnRightAlign.scss +6 -7
- package/scss/components/Datagrid/styles/_useExpandedRow.scss +6 -7
- package/scss/components/Datagrid/styles/_useInlineEdit.scss +6 -7
- package/scss/components/Datagrid/styles/_useNestedRows.scss +6 -7
- package/scss/components/Datagrid/styles/_useNestedTable.scss +6 -7
- package/scss/components/Datagrid/styles/_useStickyColumn.scss +6 -7
- package/scss/components/Datagrid/styles/addons/_RowSizeDropdown.scss +6 -7
- package/scss/config-dev.scss +7 -0
- package/scss/config.scss +7 -0
- package/telemetry.yml +2 -0
@@ -1,50 +1,53 @@
|
|
1
|
-
|
2
|
-
actions?: any[] | undefined;
|
3
|
-
disabled: any;
|
4
|
-
footerActionIcon: any;
|
5
|
-
hasActions: any;
|
6
|
-
hasButton: any;
|
7
|
-
onPrimaryButtonClick: any;
|
8
|
-
onSecondaryButtonClick: any;
|
9
|
-
primaryButtonDisabled: any;
|
10
|
-
primaryButtonHref: any;
|
11
|
-
primaryButtonIcon: any;
|
12
|
-
primaryButtonKind?: string | undefined;
|
13
|
-
primaryButtonPlacement: any;
|
14
|
-
primaryButtonText: any;
|
15
|
-
productive?: boolean | undefined;
|
16
|
-
secondaryButtonDisabled: any;
|
17
|
-
secondaryButtonHref: any;
|
18
|
-
secondaryButtonIcon: any;
|
19
|
-
secondaryButtonKind?: string | undefined;
|
20
|
-
secondaryButtonPlacement: any;
|
21
|
-
secondaryButtonText: any;
|
22
|
-
}): import("react/jsx-runtime").JSX.Element;
|
23
|
-
export namespace CardFooter {
|
24
|
-
export namespace propTypes {
|
25
|
-
let actions: PropTypes.Requireable<NonNullable<any[] | PropTypes.ReactNodeLike>>;
|
26
|
-
let disabled: PropTypes.Requireable<boolean>;
|
27
|
-
let footerActionIcon: PropTypes.Requireable<object>;
|
28
|
-
let hasActions: PropTypes.Requireable<boolean>;
|
29
|
-
let hasButton: PropTypes.Requireable<boolean>;
|
30
|
-
let onPrimaryButtonClick: PropTypes.Requireable<(...args: any[]) => any>;
|
31
|
-
let onSecondaryButtonClick: PropTypes.Requireable<(...args: any[]) => any>;
|
32
|
-
let primaryButtonDisabled: PropTypes.Requireable<boolean>;
|
33
|
-
let primaryButtonHref: PropTypes.Requireable<string>;
|
34
|
-
let primaryButtonIcon: PropTypes.Requireable<object>;
|
35
|
-
let primaryButtonKind: PropTypes.Requireable<string>;
|
36
|
-
let primaryButtonPlacement: PropTypes.Requireable<string>;
|
37
|
-
let primaryButtonText: PropTypes.Requireable<string>;
|
38
|
-
let productive: PropTypes.Requireable<boolean>;
|
39
|
-
let secondaryButtonDisabled: PropTypes.Requireable<boolean>;
|
40
|
-
let secondaryButtonHref: PropTypes.Requireable<string>;
|
41
|
-
let secondaryButtonIcon: PropTypes.Requireable<object>;
|
42
|
-
let secondaryButtonKind: PropTypes.Requireable<string>;
|
43
|
-
let secondaryButtonPlacement: PropTypes.Requireable<string>;
|
44
|
-
let secondaryButtonText: PropTypes.Requireable<string>;
|
45
|
-
}
|
46
|
-
export { componentName as displayName };
|
47
|
-
}
|
1
|
+
import React, { ReactNode } from 'react';
|
48
2
|
import PropTypes from 'prop-types';
|
49
|
-
|
3
|
+
interface CardFooterProps {
|
4
|
+
actions?: ReactNode[] | ReactNode;
|
5
|
+
disabled?: boolean;
|
6
|
+
footerActionIcon?: React.ElementType;
|
7
|
+
hasActions?: boolean;
|
8
|
+
hasButton?: boolean;
|
9
|
+
onPrimaryButtonClick?: () => void;
|
10
|
+
onSecondaryButtonClick?: () => void;
|
11
|
+
primaryButtonDisabled?: boolean;
|
12
|
+
primaryButtonHref?: string;
|
13
|
+
primaryButtonIcon?: React.ElementType;
|
14
|
+
primaryButtonKind?: 'primary' | 'ghost';
|
15
|
+
primaryButtonPlacement?: 'top' | 'bottom';
|
16
|
+
primaryButtonText?: string;
|
17
|
+
productive?: boolean;
|
18
|
+
secondaryButtonDisabled?: boolean;
|
19
|
+
secondaryButtonHref?: string;
|
20
|
+
secondaryButtonIcon?: React.ElementType;
|
21
|
+
secondaryButtonKind?: 'secondary' | 'ghost';
|
22
|
+
secondaryButtonPlacement?: 'top' | 'bottom';
|
23
|
+
secondaryButtonText?: string;
|
24
|
+
}
|
25
|
+
export declare const CardFooter: {
|
26
|
+
({ actions, disabled, footerActionIcon: FooterActionIcon, hasActions, hasButton, onPrimaryButtonClick, onSecondaryButtonClick, primaryButtonDisabled, primaryButtonHref, primaryButtonIcon, primaryButtonKind, primaryButtonPlacement, primaryButtonText, productive, secondaryButtonDisabled, secondaryButtonHref, secondaryButtonIcon, secondaryButtonKind, secondaryButtonPlacement, secondaryButtonText, }: CardFooterProps): import("react/jsx-runtime").JSX.Element;
|
27
|
+
/**@ts-ignore */
|
28
|
+
propTypes: {
|
29
|
+
actions: PropTypes.Requireable<NonNullable<any[] | PropTypes.ReactNodeLike>>;
|
30
|
+
disabled: PropTypes.Requireable<boolean>;
|
31
|
+
footerActionIcon: PropTypes.Requireable<object>;
|
32
|
+
hasActions: PropTypes.Requireable<boolean>;
|
33
|
+
hasButton: PropTypes.Requireable<boolean>;
|
34
|
+
onPrimaryButtonClick: PropTypes.Requireable<(...args: any[]) => any>;
|
35
|
+
onSecondaryButtonClick: PropTypes.Requireable<(...args: any[]) => any>;
|
36
|
+
primaryButtonDisabled: PropTypes.Requireable<boolean>;
|
37
|
+
primaryButtonHref: PropTypes.Requireable<string>;
|
38
|
+
primaryButtonIcon: PropTypes.Requireable<object>;
|
39
|
+
primaryButtonKind: PropTypes.Requireable<string>;
|
40
|
+
primaryButtonPlacement: PropTypes.Requireable<string>;
|
41
|
+
primaryButtonText: PropTypes.Requireable<string>;
|
42
|
+
productive: PropTypes.Requireable<boolean>;
|
43
|
+
secondaryButtonDisabled: PropTypes.Requireable<boolean>;
|
44
|
+
secondaryButtonHref: PropTypes.Requireable<string>;
|
45
|
+
secondaryButtonIcon: PropTypes.Requireable<object>;
|
46
|
+
secondaryButtonKind: PropTypes.Requireable<string>;
|
47
|
+
secondaryButtonPlacement: PropTypes.Requireable<string>;
|
48
|
+
secondaryButtonText: PropTypes.Requireable<string>;
|
49
|
+
};
|
50
|
+
/**@ts-ignore */
|
51
|
+
displayName: string;
|
52
|
+
};
|
50
53
|
export {};
|
@@ -34,7 +34,7 @@ var CardFooter = function CardFooter(_ref) {
|
|
34
34
|
primaryButtonHref = _ref.primaryButtonHref,
|
35
35
|
primaryButtonIcon = _ref.primaryButtonIcon,
|
36
36
|
_ref$primaryButtonKin = _ref.primaryButtonKind,
|
37
|
-
primaryButtonKind = _ref$primaryButtonKin === void 0 ?
|
37
|
+
primaryButtonKind = _ref$primaryButtonKin === void 0 ? 'primary' : _ref$primaryButtonKin,
|
38
38
|
primaryButtonPlacement = _ref.primaryButtonPlacement,
|
39
39
|
primaryButtonText = _ref.primaryButtonText,
|
40
40
|
_ref$productive = _ref.productive,
|
@@ -43,7 +43,7 @@ var CardFooter = function CardFooter(_ref) {
|
|
43
43
|
secondaryButtonHref = _ref.secondaryButtonHref,
|
44
44
|
secondaryButtonIcon = _ref.secondaryButtonIcon,
|
45
45
|
_ref$secondaryButtonK = _ref.secondaryButtonKind,
|
46
|
-
secondaryButtonKind = _ref$secondaryButtonK === void 0 ?
|
46
|
+
secondaryButtonKind = _ref$secondaryButtonK === void 0 ? 'secondary' : _ref$secondaryButtonK,
|
47
47
|
secondaryButtonPlacement = _ref.secondaryButtonPlacement,
|
48
48
|
secondaryButtonText = _ref.secondaryButtonText;
|
49
49
|
var blockClass = "".concat(pkg.prefix, "--card");
|
@@ -73,6 +73,7 @@ var CardFooter = function CardFooter(_ref) {
|
|
73
73
|
size: 16
|
74
74
|
})) : /*#__PURE__*/React__default.createElement(FooterActionIcon, null)));
|
75
75
|
};
|
76
|
+
/**@ts-ignore */
|
76
77
|
CardFooter.propTypes = {
|
77
78
|
actions: PropTypes.oneOfType([PropTypes.array, PropTypes.node]),
|
78
79
|
disabled: PropTypes.bool,
|
@@ -95,6 +96,7 @@ CardFooter.propTypes = {
|
|
95
96
|
secondaryButtonPlacement: PropTypes.oneOf(['top', 'bottom']),
|
96
97
|
secondaryButtonText: PropTypes.string
|
97
98
|
};
|
99
|
+
/**@ts-ignore */
|
98
100
|
CardFooter.displayName = componentName;
|
99
101
|
|
100
102
|
export { CardFooter };
|
@@ -1,51 +1,69 @@
|
|
1
|
-
|
2
|
-
actions: any;
|
3
|
-
noActionIcons: any;
|
4
|
-
onPrimaryButtonClick: any;
|
5
|
-
onSecondaryButtonClick: any;
|
6
|
-
primaryButtonIcon: any;
|
7
|
-
primaryButtonPlacement: any;
|
8
|
-
primaryButtonText: any;
|
9
|
-
primaryButtonDisabled: any;
|
10
|
-
description: any;
|
11
|
-
hasActions?: boolean | undefined;
|
12
|
-
inClickableCard: any;
|
13
|
-
label: any;
|
14
|
-
secondaryButtonDisabled: any;
|
15
|
-
secondaryButtonHref: any;
|
16
|
-
secondaryButtonIcon: any;
|
17
|
-
secondaryButtonPlacement: any;
|
18
|
-
secondaryButtonText: any;
|
19
|
-
slug: any;
|
20
|
-
title: any;
|
21
|
-
titleSize?: string | undefined;
|
22
|
-
}): import("react/jsx-runtime").JSX.Element;
|
23
|
-
export namespace CardHeader {
|
24
|
-
export namespace propTypes {
|
25
|
-
let actions: PropTypes.Requireable<NonNullable<any[] | PropTypes.ReactNodeLike>>;
|
26
|
-
let description: PropTypes.Requireable<NonNullable<object | PropTypes.ReactNodeLike>>;
|
27
|
-
let hasActions: PropTypes.Requireable<boolean>;
|
28
|
-
let inClickableCard: PropTypes.Requireable<boolean>;
|
29
|
-
let label: PropTypes.Requireable<string>;
|
30
|
-
let noActionIcons: PropTypes.Requireable<boolean>;
|
31
|
-
let onPrimaryButtonClick: PropTypes.Requireable<(...args: any[]) => any>;
|
32
|
-
let onSecondaryButtonClick: PropTypes.Requireable<(...args: any[]) => any>;
|
33
|
-
let primaryButtonDisabled: PropTypes.Requireable<boolean>;
|
34
|
-
let primaryButtonIcon: PropTypes.Requireable<object>;
|
35
|
-
let primaryButtonPlacement: PropTypes.Requireable<string>;
|
36
|
-
let primaryButtonText: PropTypes.Requireable<string>;
|
37
|
-
let secondaryButtonDisabled: PropTypes.Requireable<boolean>;
|
38
|
-
let secondaryButtonHref: PropTypes.Requireable<string>;
|
39
|
-
let secondaryButtonIcon: PropTypes.Requireable<object>;
|
40
|
-
let secondaryButtonKind: PropTypes.Requireable<string>;
|
41
|
-
let secondaryButtonPlacement: PropTypes.Requireable<string>;
|
42
|
-
let secondaryButtonText: PropTypes.Requireable<string>;
|
43
|
-
let slug: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
44
|
-
let title: PropTypes.Requireable<NonNullable<object | PropTypes.ReactNodeLike>>;
|
45
|
-
let titleSize: PropTypes.Requireable<string>;
|
46
|
-
}
|
47
|
-
export { componentName as displayName };
|
48
|
-
}
|
1
|
+
import React, { ReactNode } from 'react';
|
49
2
|
import PropTypes from 'prop-types';
|
50
|
-
|
3
|
+
interface CardHeaderProps {
|
4
|
+
actions?: ReactNode[] | ReactNode;
|
5
|
+
description?: ReactNode;
|
6
|
+
hasActions?: boolean;
|
7
|
+
/**
|
8
|
+
* is the host card clickable
|
9
|
+
*/
|
10
|
+
inClickableCard?: boolean;
|
11
|
+
label?: ReactNode;
|
12
|
+
noActionIcons?: boolean;
|
13
|
+
onPrimaryButtonClick?: () => void;
|
14
|
+
onSecondaryButtonClick?: () => void;
|
15
|
+
primaryButtonDisabled?: boolean;
|
16
|
+
primaryButtonIcon?: React.ElementType;
|
17
|
+
primaryButtonPlacement?: 'top' | 'bottom';
|
18
|
+
primaryButtonText?: string;
|
19
|
+
secondaryButtonDisabled?: boolean;
|
20
|
+
secondaryButtonHref?: string;
|
21
|
+
secondaryButtonIcon?: React.ElementType;
|
22
|
+
secondaryButtonKind?: 'secondary' | 'ghost';
|
23
|
+
secondaryButtonPlacement?: 'top' | 'bottom';
|
24
|
+
secondaryButtonText?: string;
|
25
|
+
/**
|
26
|
+
* **Experimental:** For all cases a `Slug` component can be provided.
|
27
|
+
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
28
|
+
*/
|
29
|
+
slug?: ReactNode;
|
30
|
+
title?: ReactNode;
|
31
|
+
titleSize?: 'default' | 'large';
|
32
|
+
}
|
33
|
+
export declare const CardHeader: {
|
34
|
+
({ actions, noActionIcons, onPrimaryButtonClick, onSecondaryButtonClick, primaryButtonIcon, primaryButtonPlacement, primaryButtonText, primaryButtonDisabled, description, hasActions, inClickableCard, label, secondaryButtonDisabled, secondaryButtonHref, secondaryButtonIcon, secondaryButtonPlacement, secondaryButtonText, slug, title, titleSize, }: CardHeaderProps): import("react/jsx-runtime").JSX.Element;
|
35
|
+
/**@ts-ignore */
|
36
|
+
propTypes: {
|
37
|
+
actions: PropTypes.Requireable<NonNullable<any[] | PropTypes.ReactNodeLike>>;
|
38
|
+
description: PropTypes.Requireable<NonNullable<object | PropTypes.ReactNodeLike>>;
|
39
|
+
hasActions: PropTypes.Requireable<boolean>;
|
40
|
+
/**
|
41
|
+
* is the host card clickable
|
42
|
+
*/
|
43
|
+
inClickableCard: PropTypes.Requireable<boolean>;
|
44
|
+
label: PropTypes.Requireable<string>;
|
45
|
+
noActionIcons: PropTypes.Requireable<boolean>;
|
46
|
+
onPrimaryButtonClick: PropTypes.Requireable<(...args: any[]) => any>;
|
47
|
+
onSecondaryButtonClick: PropTypes.Requireable<(...args: any[]) => any>;
|
48
|
+
primaryButtonDisabled: PropTypes.Requireable<boolean>;
|
49
|
+
primaryButtonIcon: PropTypes.Requireable<object>;
|
50
|
+
primaryButtonPlacement: PropTypes.Requireable<string>;
|
51
|
+
primaryButtonText: PropTypes.Requireable<string>;
|
52
|
+
secondaryButtonDisabled: PropTypes.Requireable<boolean>;
|
53
|
+
secondaryButtonHref: PropTypes.Requireable<string>;
|
54
|
+
secondaryButtonIcon: PropTypes.Requireable<object>;
|
55
|
+
secondaryButtonKind: PropTypes.Requireable<string>;
|
56
|
+
secondaryButtonPlacement: PropTypes.Requireable<string>;
|
57
|
+
secondaryButtonText: PropTypes.Requireable<string>;
|
58
|
+
/**
|
59
|
+
* **Experimental:** For all cases a `Slug` component can be provided.
|
60
|
+
* Clickable tiles only accept a boolean value of true and display a hollow slug.
|
61
|
+
*/
|
62
|
+
slug: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
63
|
+
title: PropTypes.Requireable<NonNullable<object | PropTypes.ReactNodeLike>>;
|
64
|
+
titleSize: PropTypes.Requireable<string>;
|
65
|
+
};
|
66
|
+
/**@ts-ignore */
|
67
|
+
displayName: string;
|
68
|
+
};
|
51
69
|
export {};
|
@@ -40,7 +40,7 @@ var CardHeader = function CardHeader(_ref) {
|
|
40
40
|
slug = _ref.slug,
|
41
41
|
title = _ref.title,
|
42
42
|
_ref$titleSize = _ref.titleSize,
|
43
|
-
titleSize = _ref$titleSize === void 0 ?
|
43
|
+
titleSize = _ref$titleSize === void 0 ? 'default' : _ref$titleSize;
|
44
44
|
var carbonPrefix = usePrefix();
|
45
45
|
var blockClass = "".concat(pkg.prefix, "--card");
|
46
46
|
var headerClass = "".concat(blockClass, "__header");
|
@@ -63,7 +63,7 @@ var CardHeader = function CardHeader(_ref) {
|
|
63
63
|
d: "M13.2436 16H11.5996L10.9276 13.864H7.95164L7.29164 16H5.68364L8.49164 7.624H10.4596L13.2436 16ZM10.5436 12.508L9.46364 9.064H9.40364L8.33564 12.508H10.5436ZM17.9341 16H14.1301V14.728H15.2341V8.896H14.1301V7.624H17.9341V8.896H16.8181V14.728H17.9341V16Z",
|
64
64
|
fill: "#161616"
|
65
65
|
})));
|
66
|
-
var normalizedSlug;
|
66
|
+
var normalizedSlug = null;
|
67
67
|
if (slug) {
|
68
68
|
if (inClickableCard || typeof slug === 'boolean') {
|
69
69
|
normalizedSlug = hollowSlugIcon;
|
@@ -104,6 +104,7 @@ var CardHeader = function CardHeader(_ref) {
|
|
104
104
|
disabled: primaryButtonDisabled
|
105
105
|
}, primaryButtonText)), normalizedSlug));
|
106
106
|
};
|
107
|
+
/**@ts-ignore */
|
107
108
|
CardHeader.propTypes = {
|
108
109
|
actions: PropTypes.oneOfType([PropTypes.array, PropTypes.node]),
|
109
110
|
description: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.node]),
|
@@ -134,6 +135,7 @@ CardHeader.propTypes = {
|
|
134
135
|
title: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.node]),
|
135
136
|
titleSize: PropTypes.oneOf(['default', 'large'])
|
136
137
|
};
|
138
|
+
/**@ts-ignore */
|
137
139
|
CardHeader.displayName = componentName;
|
138
140
|
|
139
141
|
export { CardHeader };
|
@@ -20,6 +20,7 @@ declare namespace ConditionBlock {
|
|
20
20
|
let onConnectorOperatorChange: PropTypes.Requireable<(...args: any[]) => any>;
|
21
21
|
let onRemove: PropTypes.Requireable<(...args: any[]) => any>;
|
22
22
|
let onStatementChange: PropTypes.Requireable<(...args: any[]) => any>;
|
23
|
+
let setShowDeletionPreviewForSubgroups: PropTypes.Requireable<(...args: any[]) => any>;
|
23
24
|
let showConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
24
25
|
let showConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
25
26
|
let state: PropTypes.Requireable<object>;
|
@@ -6,7 +6,7 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
import { slicedToArray as _slicedToArray, extends as _extends, defineProperty as _defineProperty, objectSpread2 as _objectSpread2 } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
-
import React__default, { useContext, useState } from 'react';
|
9
|
+
import React__default, { useContext, useState, useEffect } from 'react';
|
10
10
|
import { Close } from '@carbon/react/icons';
|
11
11
|
import { ConditionBuilderItem } from '../ConditionBuilderItem/ConditionBuilderItem.js';
|
12
12
|
import PropTypes from '../../../node_modules/prop-types/index.js';
|
@@ -52,7 +52,8 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
52
52
|
showConditionSubGroupPreviewHandler = props.showConditionSubGroupPreviewHandler,
|
53
53
|
hideConditionPreviewHandler = props.hideConditionPreviewHandler,
|
54
54
|
showConditionPreviewHandler = props.showConditionPreviewHandler,
|
55
|
-
isLastCondition = props.isLastCondition
|
55
|
+
isLastCondition = props.isLastCondition,
|
56
|
+
setShowDeletionPreviewForSubgroups = props.setShowDeletionPreviewForSubgroups;
|
56
57
|
var _useContext = useContext(ConditionBuilderContext),
|
57
58
|
inputConfig = _useContext.inputConfig,
|
58
59
|
variant = _useContext.variant,
|
@@ -93,6 +94,15 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
93
94
|
textarea: ConditionBuilderItemText
|
94
95
|
};
|
95
96
|
var ItemComponent = property ? itemComponents[type] : null;
|
97
|
+
useEffect(function () {
|
98
|
+
var _group$conditions, _group$conditions2;
|
99
|
+
if (showDeletionPreview && (group === null || group === void 0 || (_group$conditions = group.conditions) === null || _group$conditions === void 0 ? void 0 : _group$conditions.length) > 1 && group !== null && group !== void 0 && (_group$conditions2 = group.conditions) !== null && _group$conditions2 !== void 0 && _group$conditions2[1].conditions && group.conditions[1].id !== condition.id) {
|
100
|
+
setShowDeletionPreviewForSubgroups === null || setShowDeletionPreviewForSubgroups === void 0 || setShowDeletionPreviewForSubgroups(true);
|
101
|
+
} else {
|
102
|
+
setShowDeletionPreviewForSubgroups === null || setShowDeletionPreviewForSubgroups === void 0 || setShowDeletionPreviewForSubgroups(false);
|
103
|
+
}
|
104
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
105
|
+
}, [showDeletionPreview]);
|
96
106
|
var onStatementChangeHandler = function onStatementChangeHandler(v, evt) {
|
97
107
|
focusThisField(evt, conditionBuilderRef);
|
98
108
|
onStatementChange(v);
|
@@ -112,10 +122,9 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
112
122
|
popoverToOpen: checkIsValid(newOperator) ? 'valueField' : ''
|
113
123
|
}));
|
114
124
|
};
|
115
|
-
var onValueChangeHandler = function onValueChangeHandler(newValue
|
125
|
+
var onValueChangeHandler = function onValueChangeHandler(newValue) {
|
116
126
|
var currentCondition = _objectSpread2({}, condition);
|
117
127
|
delete currentCondition.popoverToOpen;
|
118
|
-
focusThisField(evt, conditionBuilderRef);
|
119
128
|
onChange(_objectSpread2(_objectSpread2({}, currentCondition), {}, {
|
120
129
|
value: newValue
|
121
130
|
}));
|
@@ -308,6 +317,10 @@ ConditionBlock.propTypes = {
|
|
308
317
|
* callback to handle the statement(if/ excl.if) change
|
309
318
|
*/
|
310
319
|
onStatementChange: PropTypes.func,
|
320
|
+
/**
|
321
|
+
* method to set ShowDeletionPreviewForSubgroups
|
322
|
+
*/
|
323
|
+
setShowDeletionPreviewForSubgroups: PropTypes.func,
|
311
324
|
/**
|
312
325
|
* handler for showing add condition preview
|
313
326
|
*/
|
@@ -87,11 +87,11 @@ var ConditionBuilderAdd = function ConditionBuilderAdd(_ref) {
|
|
87
87
|
})), enableSubGroup && /*#__PURE__*/React__default.createElement(ConditionBuilderButton, _extends({
|
88
88
|
renderIcon: TextNewLine,
|
89
89
|
onClick: addConditionSubGroupHandler,
|
90
|
-
className: cx("".concat(blockClass, "__add-condition-sub-group
|
90
|
+
className: cx("".concat(blockClass, "__add-condition-sub-group")),
|
91
91
|
hideLabel: true,
|
92
92
|
label: addSubgroupText,
|
93
93
|
wrapperProps: wrapperProps,
|
94
|
-
wrapperClassName: cx("".concat(blockClass, "__add-condition-sub-group-wrapper"), _defineProperty({}, "".concat(blockClass, "__add-condition-sub-group-wrapper--show"), isAddSubgroup))
|
94
|
+
wrapperClassName: cx("".concat(blockClass, "__add-condition-sub-group-wrapper ").concat(blockClass, "__gap-left"), _defineProperty({}, "".concat(blockClass, "__add-condition-sub-group-wrapper--show"), isAddSubgroup))
|
95
95
|
}, previewHandlersForSubgroup())));
|
96
96
|
};
|
97
97
|
var ConditionBuilderAdd$1 = ConditionBuilderAdd;
|
@@ -9,7 +9,7 @@ import { objectWithoutProperties as _objectWithoutProperties, extends as _extend
|
|
9
9
|
import React__default from 'react';
|
10
10
|
import cx from 'classnames';
|
11
11
|
import PropTypes from '../../../node_modules/prop-types/index.js';
|
12
|
-
import { Tooltip } from '@carbon/react';
|
12
|
+
import { usePrefix, Tooltip } from '@carbon/react';
|
13
13
|
import { blockClass } from '../ConditionBuilderContext/DataConfigs.js';
|
14
14
|
import { WarningAltFilled } from '@carbon/react/icons';
|
15
15
|
|
@@ -33,11 +33,11 @@ var ConditionBuilderButton = function ConditionBuilderButton(_ref) {
|
|
33
33
|
wrapperClassName = _ref.wrapperClassName,
|
34
34
|
tabIndex = _ref.tabIndex,
|
35
35
|
rest = _objectWithoutProperties(_ref, _excluded);
|
36
|
+
var carbonPrefix = usePrefix();
|
36
37
|
var Button = function Button() {
|
37
38
|
var _rest$dataName;
|
38
39
|
var dataName = (_rest$dataName = rest['data-name']) !== null && _rest$dataName !== void 0 ? _rest$dataName : '';
|
39
40
|
return /*#__PURE__*/React__default.createElement("button", _extends({
|
40
|
-
// role={'gridcell'}
|
41
41
|
tabIndex: tabIndex != undefined ? tabIndex : -1,
|
42
42
|
className: cx([className, "".concat(blockClass, "__button"), _defineProperty({}, "".concat(blockClass, "__text-ellipsis"), showToolTip && !hideLabel && !isInvalid), _defineProperty({}, "".concat(blockClass, "__invalid-input"), isInvalid)]),
|
43
43
|
type: "button",
|
@@ -52,8 +52,10 @@ var ConditionBuilderButton = function ConditionBuilderButton(_ref) {
|
|
52
52
|
return hideLabel || showToolTip ? /*#__PURE__*/React__default.createElement(Tooltip, _extends({
|
53
53
|
label: label,
|
54
54
|
align: tooltipAlign,
|
55
|
-
className: "".concat(wrapperClassName)
|
56
|
-
}, wrapperProps
|
55
|
+
className: "".concat(wrapperClassName, " ").concat(blockClass, "__tooltip ").concat(carbonPrefix, "--icon-tooltip")
|
56
|
+
}, wrapperProps, {
|
57
|
+
leaveDelayMs: 0
|
58
|
+
}), Button()) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, Button());
|
57
59
|
};
|
58
60
|
ConditionBuilderButton.propTypes = {
|
59
61
|
/**
|
@@ -14,6 +14,7 @@ import PropTypes from '../../../node_modules/prop-types/index.js';
|
|
14
14
|
import { focusThisField } from '../utils/util.js';
|
15
15
|
import { ConditionBuilderContext } from '../ConditionBuilderContext/ConditionBuilderProvider.js';
|
16
16
|
import { useTranslations } from '../utils/useTranslations.js';
|
17
|
+
import { ConditionBuilderButton } from '../ConditionBuilderButton/ConditionBuilderButton.js';
|
17
18
|
|
18
19
|
var _excluded = ["operator", "className", "onChange"];
|
19
20
|
var ConditionConnector = function ConditionConnector(_ref) {
|
@@ -48,7 +49,9 @@ var ConditionConnector = function ConditionConnector(_ref) {
|
|
48
49
|
};
|
49
50
|
return variant == 'tree' ? /*#__PURE__*/React__default.createElement("span", {
|
50
51
|
className: "".concat(className, " ").concat(blockClass, "__connector--disabled")
|
51
|
-
},
|
52
|
+
}, /*#__PURE__*/React__default.createElement(ConditionBuilderButton, {
|
53
|
+
label: operator
|
54
|
+
})) :
|
52
55
|
/*#__PURE__*/
|
53
56
|
// <div className={className} {...rest}>
|
54
57
|
React__default.createElement(ConditionBuilderItem, _extends({
|
@@ -22,7 +22,7 @@ import { useTranslations } from '../utils/useTranslations.js';
|
|
22
22
|
|
23
23
|
var _GroupConnector;
|
24
24
|
var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
25
|
-
var _rootState$
|
25
|
+
var _rootState$groups3;
|
26
26
|
var startConditionLabel = _ref.startConditionLabel,
|
27
27
|
getConditionState = _ref.getConditionState,
|
28
28
|
getActionsState = _ref.getActionsState,
|
@@ -110,6 +110,11 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
110
110
|
groups: [].concat(_toConsumableArray(rootState.groups), [newGroup])
|
111
111
|
}));
|
112
112
|
};
|
113
|
+
var getColorIndex = function getColorIndex() {
|
114
|
+
var _rootState$groups$len, _rootState$groups2;
|
115
|
+
var groupLength = (_rootState$groups$len = rootState === null || rootState === void 0 || (_rootState$groups2 = rootState.groups) === null || _rootState$groups2 === void 0 ? void 0 : _rootState$groups2.length) !== null && _rootState$groups$len !== void 0 ? _rootState$groups$len : 0;
|
116
|
+
return groupLength % 5;
|
117
|
+
};
|
113
118
|
if (!isConditionBuilderActive) {
|
114
119
|
return /*#__PURE__*/React__default.createElement(Button, {
|
115
120
|
className: "".concat(blockClass, "__addConditionText-button"),
|
@@ -129,7 +134,7 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
129
134
|
className: "".concat(blockClass, "__content-container"),
|
130
135
|
role: "treegrid",
|
131
136
|
"aria-label": "condition builder tree"
|
132
|
-
}, rootState && (rootState === null || rootState === void 0 || (_rootState$
|
137
|
+
}, rootState && (rootState === null || rootState === void 0 || (_rootState$groups3 = rootState.groups) === null || _rootState$groups3 === void 0 ? void 0 : _rootState$groups3.map(function (eachGroup, groupIndex) {
|
133
138
|
return /*#__PURE__*/React__default.createElement("div", {
|
134
139
|
key: eachGroup.id,
|
135
140
|
className: "".concat(blockClass, "__group-wrapper")
|
@@ -169,6 +174,7 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
169
174
|
}
|
170
175
|
})), showConditionGroupPreview && /*#__PURE__*/React__default.createElement(ConditionPreview, {
|
171
176
|
previewType: "newGroup",
|
177
|
+
colorIndex: getColorIndex(),
|
172
178
|
group: {
|
173
179
|
groupOperator: rootState.operator
|
174
180
|
}
|
@@ -32,7 +32,7 @@ var translationsObject = {
|
|
32
32
|
connectorText: 'Connector',
|
33
33
|
conditionRowText: 'Condition row',
|
34
34
|
conditionRowGroupText: 'Condition row group',
|
35
|
-
removeConditionText: '
|
35
|
+
removeConditionText: 'Delete condition',
|
36
36
|
addConditionRowText: 'Add condition row',
|
37
37
|
startText: 'Start',
|
38
38
|
endText: 'End',
|
@@ -45,7 +45,10 @@ var translationsObject = {
|
|
45
45
|
invalidNumberWarnText: 'Invalid number, must be 0 or greater',
|
46
46
|
conditionBuilderText: 'Condition Builder',
|
47
47
|
actionSectionText: 'Action Section',
|
48
|
-
conditionHeadingText: 'Condition'
|
48
|
+
conditionHeadingText: 'Condition',
|
49
|
+
addPropertyText: 'Add property',
|
50
|
+
addOperatorText: 'Add operator',
|
51
|
+
addValueText: 'Add value'
|
49
52
|
};
|
50
53
|
|
51
54
|
export { translationsObject };
|
@@ -36,11 +36,14 @@ var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
|
36
36
|
_useState2 = _slicedToArray(_useState, 2),
|
37
37
|
open = _useState2[0],
|
38
38
|
setOpen = _useState2[1];
|
39
|
-
var _useTranslations = useTranslations(['invalidText', 'addConditionText', label]),
|
40
|
-
_useTranslations2 = _slicedToArray(_useTranslations,
|
39
|
+
var _useTranslations = useTranslations(['invalidText', 'addConditionText', 'addPropertyText', 'addOperatorText', 'addValueText', label]),
|
40
|
+
_useTranslations2 = _slicedToArray(_useTranslations, 6),
|
41
41
|
invalidText = _useTranslations2[0],
|
42
42
|
addConditionText = _useTranslations2[1],
|
43
|
-
|
43
|
+
addPropertyText = _useTranslations2[2],
|
44
|
+
addOperatorText = _useTranslations2[3],
|
45
|
+
addValueText = _useTranslations2[4],
|
46
|
+
labelText = _useTranslations2[5];
|
44
47
|
var _useContext = useContext(ConditionBuilderContext),
|
45
48
|
conditionBuilderRef = _useContext.conditionBuilderRef;
|
46
49
|
var getPropertyDetails = function getPropertyDetails() {
|
@@ -125,6 +128,19 @@ var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
|
125
128
|
manageInvalidSelection();
|
126
129
|
}
|
127
130
|
};
|
131
|
+
var getLabel = function getLabel() {
|
132
|
+
if (propertyLabel) {
|
133
|
+
return propertyLabel;
|
134
|
+
} else if (rest['data-name'] === 'propertyField') {
|
135
|
+
return addPropertyText;
|
136
|
+
} else if (rest['data-name'] === 'operatorField') {
|
137
|
+
return addOperatorText;
|
138
|
+
} else if (rest['data-name'] === 'valueField') {
|
139
|
+
return addValueText;
|
140
|
+
} else {
|
141
|
+
return addConditionText;
|
142
|
+
}
|
143
|
+
};
|
128
144
|
return /*#__PURE__*/React__default.createElement(Popover, {
|
129
145
|
open: open,
|
130
146
|
isTabTip: true,
|
@@ -133,7 +149,7 @@ var ConditionBuilderItem = function ConditionBuilderItem(_ref) {
|
|
133
149
|
ref: popoverRef,
|
134
150
|
onRequestClose: closePopover
|
135
151
|
}, /*#__PURE__*/React__default.createElement(ConditionBuilderButton, _extends({
|
136
|
-
label:
|
152
|
+
label: getLabel(),
|
137
153
|
hideLabel: !label ? true : false,
|
138
154
|
onClick: togglePopover,
|
139
155
|
className: className,
|
@@ -50,6 +50,10 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
50
50
|
_useState4 = _slicedToArray(_useState3, 2),
|
51
51
|
showConditionSubGroupPreview = _useState4[0],
|
52
52
|
setShowConditionSubGroupPreview = _useState4[1];
|
53
|
+
var _useState5 = useState(false),
|
54
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
55
|
+
showDeletionPreviewForSubgroups = _useState6[0],
|
56
|
+
setShowDeletionPreviewForSubgroups = _useState6[1];
|
53
57
|
var conditionBuilderContentRef = useRef();
|
54
58
|
var onRemoveHandler = function onRemoveHandler(conditionId, evt, conditionIndex) {
|
55
59
|
if (group.conditions.length > 1) {
|
@@ -80,9 +84,11 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
80
84
|
groupedItems.conditions.push(item);
|
81
85
|
}
|
82
86
|
});
|
83
|
-
|
84
|
-
|
85
|
-
|
87
|
+
onRemove(evt);
|
88
|
+
// onChange({
|
89
|
+
// ...group,
|
90
|
+
// conditions: [...groupedItems.conditions, ...groupedItems.groups],
|
91
|
+
// });
|
86
92
|
} else {
|
87
93
|
onChange(_objectSpread2(_objectSpread2({}, group), {}, {
|
88
94
|
conditions: group.conditions.filter(function (condition) {
|
@@ -155,10 +161,11 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
155
161
|
};
|
156
162
|
setTimeout(function () {
|
157
163
|
var currentRowToFocus = conditionBuilderContentRef.current.querySelector("[role=\"row\"][aria-level=\"".concat(rowIdentity.ariaLevel, "\"][aria-posinset=\"").concat(rowIdentity.ariaPosInSet, "\"]"));
|
158
|
-
manageTabIndexAndFocus(currentRowToFocus, conditionBuilderRef);
|
164
|
+
manageTabIndexAndFocus(currentRowToFocus === null || currentRowToFocus === void 0 ? void 0 : currentRowToFocus.querySelector('[data-name="closeCondition"]'), conditionBuilderRef);
|
159
165
|
}, 0);
|
160
166
|
} else if ((prevRows === null || prevRows === void 0 ? void 0 : prevRows.length) > 1) {
|
161
|
-
|
167
|
+
var _prevRows;
|
168
|
+
manageTabIndexAndFocus((_prevRows = prevRows[prevRows.length - 2]) === null || _prevRows === void 0 ? void 0 : _prevRows.querySelector('[data-name="closeCondition"]'), conditionBuilderRef);
|
162
169
|
}
|
163
170
|
}
|
164
171
|
};
|
@@ -279,7 +286,7 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
279
286
|
return /*#__PURE__*/React__default.createElement(Fragment, {
|
280
287
|
key: eachCondition.id
|
281
288
|
}, eachCondition.conditions ? /*#__PURE__*/React__default.createElement("div", {
|
282
|
-
className: cx("".concat(blockClass, "__condition-block subgroup ").concat(blockClass, "__gap"), _defineProperty({}, "".concat(blockClass, "__gap-bottom"), group.conditions.length < conditionIndex + 1))
|
289
|
+
className: cx("".concat(blockClass, "__condition-block subgroup ").concat(blockClass, "__gap"), _defineProperty(_defineProperty({}, "".concat(blockClass, "__gap-bottom"), group.conditions.length < conditionIndex + 1), "".concat(blockClass, "__subgroup_deletionPreview"), showDeletionPreviewForSubgroups), {})
|
283
290
|
}, /*#__PURE__*/React__default.createElement(ConditionConnector, {
|
284
291
|
className: "".concat(blockClass, "__gap ").concat(blockClass, "__gap-bottom ").concat(blockClass, "__groupConnector"),
|
285
292
|
operator: group.groupOperator,
|
@@ -327,7 +334,8 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
|
|
327
334
|
_showConditionPreviewHandler(conditionIndex);
|
328
335
|
},
|
329
336
|
hideConditionPreviewHandler: hideConditionPreviewHandler,
|
330
|
-
isLastCondition: isLastCondition
|
337
|
+
isLastCondition: isLastCondition,
|
338
|
+
setShowDeletionPreviewForSubgroups: setShowDeletionPreviewForSubgroups
|
331
339
|
})), conditionIndex == showConditionSubGroupPreview && (_ConditionPreview || (_ConditionPreview = /*#__PURE__*/React__default.createElement(ConditionPreview, {
|
332
340
|
previewType: "subGroup",
|
333
341
|
group: group
|
@@ -1,10 +1,12 @@
|
|
1
1
|
export default ConditionPreview;
|
2
|
-
declare function ConditionPreview({ previewType, group }: {
|
2
|
+
declare function ConditionPreview({ previewType, group, colorIndex }: {
|
3
3
|
previewType: any;
|
4
4
|
group: any;
|
5
|
+
colorIndex: any;
|
5
6
|
}): import("react/jsx-runtime").JSX.Element;
|
6
7
|
declare namespace ConditionPreview {
|
7
8
|
namespace propTypes {
|
9
|
+
let colorIndex: PropTypes.Requireable<number>;
|
8
10
|
let group: PropTypes.Requireable<object>;
|
9
11
|
let previewType: PropTypes.Requireable<string>;
|
10
12
|
}
|