@carbon/ibm-products 2.33.0 → 2.35.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +31990 -32061
- 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 +38 -17
- 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 +636 -24096
- 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 +2342 -17830
- 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/ActionSet/ActionSet.d.ts +38 -2
- package/es/components/ActionSet/ActionSet.js +3 -5
- package/es/components/CoachmarkFixed/CoachmarkFixed.js +1 -1
- package/es/components/ConditionBuilder/ConditionBuilder.d.ts +5 -0
- package/es/components/ConditionBuilder/ConditionBuilder.js +125 -0
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +10 -0
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +92 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.d.ts +38 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.js +88 -0
- package/es/components/ConditionBuilder/assets/sampleInput.d.ts +58 -0
- package/es/components/ConditionBuilder/index.d.ts +1 -0
- package/es/components/CreateFullPage/CreateFullPage.js +3 -19
- package/es/components/CreateFullPage/CreateFullPageStep.js +22 -7
- package/es/components/CreateSidePanel/CreateSidePanel.d.ts +81 -2
- package/es/components/CreateSidePanel/CreateSidePanel.js +5 -2
- package/es/components/CreateTearsheetNarrow/CreateTearsheetNarrow.d.ts +82 -2
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +5 -117
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +12 -111
- package/es/components/DataSpreadsheet/utils/commonEventHandlers.d.ts +4 -0
- package/es/components/DataSpreadsheet/utils/commonEventHandlers.js +304 -0
- package/es/components/Datagrid/Datagrid/DatagridContent.js +2 -1
- package/es/components/Datagrid/Datagrid/DatagridEmptyBody.js +4 -1
- package/es/components/Datagrid/Datagrid/DatagridRefBody.js +3 -1
- package/es/components/Datagrid/Datagrid/DatagridSimpleBody.js +4 -1
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +6 -2
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.d.ts +1 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +4 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.d.ts +2 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +4 -3
- package/es/components/Datagrid/Datagrid/addons/stateReducer.js +2 -1
- package/es/components/Datagrid/useEditableCell.js +15 -0
- package/es/components/DelimitedList/DelimitedList.d.ts +27 -2
- package/es/components/DelimitedList/DelimitedList.js +0 -1
- package/es/components/EditInPlace/EditInPlace.d.ts +97 -5
- package/es/components/EditInPlace/EditInPlace.js +10 -6
- package/es/components/EditSidePanel/EditSidePanel.d.ts +92 -2
- package/es/components/EditSidePanel/EditSidePanel.js +8 -10
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.d.ts +61 -2
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -3
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.d.ts +61 -2
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -2
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.d.ts +61 -2
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -3
- package/es/components/ExportModal/ExportModal.d.ts +110 -2
- package/es/components/ExportModal/ExportModal.js +10 -4
- package/es/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.d.ts +5 -0
- package/es/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +83 -0
- package/es/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.d.ts +5 -0
- package/es/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +94 -0
- package/es/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.d.ts +5 -0
- package/es/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +8 -10
- package/es/components/FilterPanel/FilterPanelCheckbox/index.d.ts +1 -0
- package/es/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.d.ts +10 -0
- package/es/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +157 -0
- package/es/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.d.ts +5 -0
- package/es/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.js +72 -0
- package/es/components/FilterPanel/FilterPanelLabel/FilterPanelLabel.js +2 -2
- package/es/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.d.ts +5 -0
- package/es/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js +92 -0
- package/es/components/FilterPanel/index.d.ts +5 -0
- package/es/components/HTTPErrors/HTTPError403/HTTPError403.d.ts +40 -2
- package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +1 -1
- package/es/components/HTTPErrors/HTTPError404/HTTPError404.d.ts +40 -2
- package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +1 -1
- package/es/components/ImportModal/ImportModal.d.ts +136 -2
- package/es/components/ImportModal/ImportModal.js +3 -2
- package/es/components/InlineTip/InlineTip.d.ts +90 -2
- package/es/components/InlineTip/InlineTip.js +3 -2
- package/es/components/Nav/Nav.js +1 -1
- package/es/components/Nav/NavList.js +7 -7
- package/es/components/NotificationsPanel/NotificationsPanel.js +1 -1
- package/es/components/OptionsTile/OptionsTile.d.ts +77 -3
- package/es/components/OptionsTile/OptionsTile.js +9 -20
- package/es/components/PageHeader/PageHeader.js +3 -3
- package/es/components/PageHeader/PageHeaderUtils.d.ts +1 -1
- package/es/components/PageHeader/PageHeaderUtils.js +4 -3
- package/es/components/RemoveModal/RemoveModal.d.ts +81 -7
- package/es/components/RemoveModal/RemoveModal.js +1 -0
- package/es/components/ScrollGradient/ScrollGradient.d.ts +5 -0
- package/es/components/ScrollGradient/ScrollGradient.js +156 -0
- package/es/components/ScrollGradient/constants.d.ts +15 -0
- package/es/components/ScrollGradient/constants.js +121 -0
- package/es/components/ScrollGradient/index.d.ts +1 -0
- package/es/components/SidePanel/SidePanel.d.ts +144 -2
- package/es/components/SidePanel/SidePanel.js +100 -75
- package/es/components/StatusIcon/StatusIcon.d.ts +34 -2
- package/es/components/StatusIcon/StatusIcon.js +97 -95
- package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +23 -2
- package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +6 -5
- package/es/components/TagOverflow/TagOverflow.d.ts +5 -0
- package/es/components/TagOverflow/TagOverflow.js +209 -0
- package/es/components/TagOverflow/constants.d.ts +14 -0
- package/es/components/TagOverflow/constants.js +30 -0
- package/es/components/TagOverflow/index.d.ts +1 -0
- package/es/components/Tearsheet/TearsheetNarrow.d.ts +105 -6
- package/es/components/Tearsheet/TearsheetNarrow.js +6 -1
- package/es/components/Toolbar/Toolbar.d.ts +23 -5
- package/es/components/Toolbar/Toolbar.js +30 -26
- package/es/components/TruncatedList/TruncatedList.js +5 -3
- package/es/components/UserAvatar/UserAvatar.js +7 -4
- package/es/components/index.d.ts +5 -2
- package/es/global/js/package-settings.d.ts +8 -0
- package/es/global/js/package-settings.js +8 -0
- package/es/index.js +9 -0
- package/es/settings.d.ts +8 -0
- package/lib/components/ActionSet/ActionSet.d.ts +38 -2
- package/lib/components/ActionSet/ActionSet.js +3 -5
- package/lib/components/CoachmarkFixed/CoachmarkFixed.js +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilder.d.ts +5 -0
- package/lib/components/ConditionBuilder/ConditionBuilder.js +132 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +10 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +100 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.d.ts +38 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.js +98 -0
- package/lib/components/ConditionBuilder/assets/sampleInput.d.ts +58 -0
- package/lib/components/ConditionBuilder/index.d.ts +1 -0
- package/lib/components/CreateFullPage/CreateFullPage.js +2 -18
- package/lib/components/CreateFullPage/CreateFullPageStep.js +20 -5
- package/lib/components/CreateSidePanel/CreateSidePanel.d.ts +81 -2
- package/lib/components/CreateSidePanel/CreateSidePanel.js +5 -2
- package/lib/components/CreateTearsheetNarrow/CreateTearsheetNarrow.d.ts +82 -2
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +5 -117
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +12 -111
- package/lib/components/DataSpreadsheet/utils/commonEventHandlers.d.ts +4 -0
- package/lib/components/DataSpreadsheet/utils/commonEventHandlers.js +311 -0
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +2 -1
- package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.js +4 -1
- package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +3 -1
- package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.js +4 -1
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.d.ts +1 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +4 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.d.ts +2 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +4 -3
- package/lib/components/Datagrid/Datagrid/addons/stateReducer.js +2 -1
- package/lib/components/Datagrid/useEditableCell.js +19 -0
- package/lib/components/DelimitedList/DelimitedList.d.ts +27 -2
- package/lib/components/DelimitedList/DelimitedList.js +0 -1
- package/lib/components/EditInPlace/EditInPlace.d.ts +97 -5
- package/lib/components/EditInPlace/EditInPlace.js +10 -6
- package/lib/components/EditSidePanel/EditSidePanel.d.ts +92 -2
- package/lib/components/EditSidePanel/EditSidePanel.js +8 -10
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.d.ts +61 -2
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -3
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.d.ts +61 -2
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -2
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.d.ts +61 -2
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -3
- package/lib/components/ExportModal/ExportModal.d.ts +110 -2
- package/lib/components/ExportModal/ExportModal.js +10 -4
- package/lib/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.d.ts +5 -0
- package/lib/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +90 -0
- package/lib/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.d.ts +5 -0
- package/lib/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +101 -0
- package/lib/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.d.ts +5 -0
- package/lib/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +8 -10
- package/lib/components/FilterPanel/FilterPanelCheckbox/index.d.ts +1 -0
- package/lib/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.d.ts +10 -0
- package/lib/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +164 -0
- package/lib/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.d.ts +5 -0
- package/lib/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.js +79 -0
- package/lib/components/FilterPanel/FilterPanelLabel/FilterPanelLabel.js +2 -2
- package/lib/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.d.ts +5 -0
- package/lib/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js +99 -0
- package/lib/components/FilterPanel/index.d.ts +5 -0
- package/lib/components/HTTPErrors/HTTPError403/HTTPError403.d.ts +40 -2
- package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +1 -1
- package/lib/components/HTTPErrors/HTTPError404/HTTPError404.d.ts +40 -2
- package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +1 -1
- package/lib/components/ImportModal/ImportModal.d.ts +136 -2
- package/lib/components/ImportModal/ImportModal.js +3 -2
- package/lib/components/InlineTip/InlineTip.d.ts +90 -2
- package/lib/components/InlineTip/InlineTip.js +3 -2
- package/lib/components/Nav/Nav.js +1 -1
- package/lib/components/Nav/NavList.js +7 -7
- package/lib/components/NotificationsPanel/NotificationsPanel.js +1 -1
- package/lib/components/OptionsTile/OptionsTile.d.ts +77 -3
- package/lib/components/OptionsTile/OptionsTile.js +9 -20
- package/lib/components/PageHeader/PageHeader.js +3 -3
- package/lib/components/PageHeader/PageHeaderUtils.d.ts +1 -1
- package/lib/components/PageHeader/PageHeaderUtils.js +4 -3
- package/lib/components/RemoveModal/RemoveModal.d.ts +81 -7
- package/lib/components/RemoveModal/RemoveModal.js +1 -0
- package/lib/components/ScrollGradient/ScrollGradient.d.ts +5 -0
- package/lib/components/ScrollGradient/ScrollGradient.js +163 -0
- package/lib/components/ScrollGradient/constants.d.ts +15 -0
- package/lib/components/ScrollGradient/constants.js +128 -0
- package/lib/components/ScrollGradient/index.d.ts +1 -0
- package/lib/components/SidePanel/SidePanel.d.ts +144 -2
- package/lib/components/SidePanel/SidePanel.js +100 -75
- package/lib/components/StatusIcon/StatusIcon.d.ts +34 -2
- package/lib/components/StatusIcon/StatusIcon.js +97 -95
- package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +23 -2
- package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +6 -5
- package/lib/components/TagOverflow/TagOverflow.d.ts +5 -0
- package/lib/components/TagOverflow/TagOverflow.js +216 -0
- package/lib/components/TagOverflow/constants.d.ts +14 -0
- package/lib/components/TagOverflow/constants.js +34 -0
- package/lib/components/TagOverflow/index.d.ts +1 -0
- package/lib/components/Tearsheet/TearsheetNarrow.d.ts +105 -6
- package/lib/components/Tearsheet/TearsheetNarrow.js +6 -1
- package/lib/components/Toolbar/Toolbar.d.ts +23 -5
- package/lib/components/Toolbar/Toolbar.js +30 -26
- package/lib/components/TruncatedList/TruncatedList.js +5 -3
- package/lib/components/UserAvatar/UserAvatar.js +7 -4
- package/lib/components/index.d.ts +5 -2
- package/lib/global/js/package-settings.d.ts +8 -0
- package/lib/global/js/package-settings.js +8 -0
- package/lib/index.js +42 -0
- package/lib/settings.d.ts +8 -0
- package/package.json +3 -3
- package/scss/components/Coachmark/_coachmark-dragbar.scss +0 -1
- package/scss/components/Coachmark/_coachmark-tagline.scss +2 -2
- package/scss/components/ConditionBuilder/_carbon-imports.scss +9 -0
- package/scss/components/ConditionBuilder/_condition-builder.scss +25 -0
- package/scss/components/ConditionBuilder/_index-with-carbon.scss +9 -0
- package/scss/components/ConditionBuilder/_index.scss +8 -0
- package/scss/components/CreateFullPage/_create-full-page.scss +10 -10
- package/scss/components/Datagrid/styles/_useNestedRows.scss +5 -1
- package/scss/components/FilterPanel/_carbon-imports.scss +5 -0
- package/scss/components/FilterPanel/_filter-panel-accordion-item.scss +54 -0
- package/scss/components/FilterPanel/_filter-panel-accordion.scss +6 -0
- package/scss/components/FilterPanel/_filter-panel-checkbox-with-overflow.scss +60 -0
- package/scss/components/FilterPanel/_filter-panel-checkbox.scss +24 -3
- package/scss/components/FilterPanel/_filter-panel-group.scss +39 -0
- package/scss/components/FilterPanel/_filter-panel-label.scss +0 -8
- package/scss/components/FilterPanel/_filter-panel-search.scss +38 -0
- package/scss/components/FilterPanel/_filter-panel.scss +2 -0
- package/scss/components/FilterPanel/_index-with-carbon.scss +5 -0
- package/scss/components/FilterPanel/_index.scss +5 -0
- package/scss/components/Guidebanner/_guidebanner.scss +1 -1
- package/scss/components/InlineTip/_inline-tip.scss +1 -1
- package/scss/components/ProductiveCard/_productive-card.scss +13 -0
- package/scss/components/ScrollGradient/_carbon-imports.scss +9 -0
- package/scss/components/ScrollGradient/_index-with-carbon.scss +9 -0
- package/scss/components/ScrollGradient/_index.scss +8 -0
- package/scss/components/ScrollGradient/_scroll-gradient.scss +102 -0
- package/scss/components/SidePanel/_side-panel.scss +9 -9
- package/scss/components/TagOverflow/_carbon-imports.scss +9 -0
- package/scss/components/TagOverflow/_index-with-carbon.scss +9 -0
- package/scss/components/TagOverflow/_index.scss +8 -0
- package/scss/components/TagOverflow/_tag-overflow.scss +55 -0
- package/scss/components/Tearsheet/_tearsheet.scss +10 -0
- package/scss/components/UserAvatar/_user-avatar.scss +38 -4
- package/scss/components/_index-with-carbon.scss +3 -0
- package/scss/components/_index.scss +3 -0
@@ -1,3 +1,39 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2021, 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
|
+
/// <reference path="../../../src/custom-typings/index.d.ts" />
|
8
|
+
import React from 'react';
|
9
|
+
import { ButtonProps } from '@carbon/react';
|
10
|
+
export declare const ButtonSizes: readonly ["sm", "md", "lg", "xl", "2xl"];
|
11
|
+
export type ButtonSize = (typeof ButtonSizes)[number];
|
12
|
+
interface ActionSetProps {
|
13
|
+
/**
|
14
|
+
* The action buttons to show. Each action is specified as an object
|
15
|
+
* representation of a Carbon button.
|
16
|
+
*
|
17
|
+
* See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
|
18
|
+
*/
|
19
|
+
actions: ButtonProps[];
|
20
|
+
/**
|
21
|
+
* The size of buttons to use for the actions. The allowed values are
|
22
|
+
* those for the size prop of carbon Button. If this prop is specified, all
|
23
|
+
* the buttons will be set to this size, overriding any 'size' values (if any)
|
24
|
+
* supplied in the actions array (if any).
|
25
|
+
*/
|
26
|
+
buttonSize?: ButtonSize;
|
27
|
+
/**
|
28
|
+
* An optional class or classes to be added to the outermost element.
|
29
|
+
*/
|
30
|
+
className?: string;
|
31
|
+
/**
|
32
|
+
* The size of the action set. Different button arrangements are used at
|
33
|
+
* different sizes, to make best use of the available space.
|
34
|
+
*/
|
35
|
+
size?: ButtonSize;
|
36
|
+
}
|
1
37
|
/**
|
2
38
|
* An ActionSet presents a set of action buttons, constructed from bundles
|
3
39
|
* of prop values and applying some layout rules. When the size is 'sm'
|
@@ -10,5 +46,5 @@
|
|
10
46
|
* it appears at the left side. If there is a primary button it appears at the
|
11
47
|
* right.
|
12
48
|
*/
|
13
|
-
export const ActionSet: React.ForwardRefExoticComponent<React.RefAttributes<
|
14
|
-
|
49
|
+
export declare const ActionSet: React.ForwardRefExoticComponent<ActionSetProps & React.RefAttributes<HTMLDivElement>>;
|
50
|
+
export {};
|
@@ -18,9 +18,6 @@ var _excluded = ["className", "disabled", "kind", "label", "loading", "isExpress
|
|
18
18
|
_excluded2 = ["actions", "buttonSize", "className", "size"];
|
19
19
|
var blockClass = "".concat(pkg.prefix, "--action-set");
|
20
20
|
var componentName = 'ActionSet';
|
21
|
-
|
22
|
-
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
23
|
-
|
24
21
|
var ActionSetButton = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
25
22
|
var className = _ref.className,
|
26
23
|
disabled = _ref.disabled,
|
@@ -53,7 +50,6 @@ var willStack = function willStack(size, numberOfActions) {
|
|
53
50
|
var defaults = {
|
54
51
|
size: 'md'
|
55
52
|
};
|
56
|
-
|
57
53
|
/**
|
58
54
|
* An ActionSet presents a set of action buttons, constructed from bundles
|
59
55
|
* of prop values and applying some layout rules. When the size is 'sm'
|
@@ -124,6 +120,7 @@ ActionSet.displayName = componentName;
|
|
124
120
|
* @returns null if the actions meet the requirements, or an Error object with
|
125
121
|
* an explanatory message.
|
126
122
|
*/
|
123
|
+
/**@ts-ignore*/
|
127
124
|
ActionSet.validateActions = function (sizeFn) {
|
128
125
|
return function (props, propName, componentName, location, propFullName) {
|
129
126
|
var name = propFullName || propName;
|
@@ -166,7 +163,8 @@ ActionSet.propTypes = {
|
|
166
163
|
*
|
167
164
|
* See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
|
168
165
|
*/
|
169
|
-
actions: allPropTypes([
|
166
|
+
actions: allPropTypes([/**@ts-ignore*/
|
167
|
+
ActionSet.validateActions(), PropTypes.arrayOf(PropTypes.shape(_objectSpread2(_objectSpread2({}, Button.propTypes), {}, {
|
170
168
|
kind: PropTypes.oneOf(['ghost', 'danger--ghost', 'secondary', 'danger', 'primary']),
|
171
169
|
label: PropTypes.string,
|
172
170
|
loading: PropTypes.bool,
|
@@ -85,7 +85,7 @@ var CoachmarkFixed = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
85
85
|
}
|
86
86
|
}, [prefersReducedMotion.matches]);
|
87
87
|
var handleTransitionEnd = function handleTransitionEnd(e) {
|
88
|
-
console.log('
|
88
|
+
console.log('Here at transition end... ', e.propertyName === 'transform' && !fixedIsVisible);
|
89
89
|
if (e.propertyName === 'transform' && !fixedIsVisible) {
|
90
90
|
setIsOpen(false);
|
91
91
|
onClose();
|
@@ -0,0 +1,125 @@
|
|
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 { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
+
import React__default from 'react';
|
10
|
+
import { VStack } from '@carbon/react';
|
11
|
+
import PropTypes from '../../node_modules/prop-types/index.js';
|
12
|
+
import cx from 'classnames';
|
13
|
+
import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
14
|
+
import { pkg } from '../../settings.js';
|
15
|
+
import ConditionBuilderContent from './ConditionBuilderContent/ConditionBuilderContent.js';
|
16
|
+
import { ConditionBuilderProvider } from './ConditionBuilderContext/DataTreeContext.js';
|
17
|
+
|
18
|
+
var _excluded = ["className", "inputConfig", "startConditionLabel", "popOverSearchThreshold"];
|
19
|
+
|
20
|
+
// Carbon and package components we use.
|
21
|
+
/* TODO: @import(s) of carbon components and other package components. */
|
22
|
+
|
23
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
24
|
+
var blockClass = "".concat(pkg.prefix, "--condition-builder");
|
25
|
+
var componentName = 'ConditionBuilder';
|
26
|
+
|
27
|
+
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
28
|
+
|
29
|
+
// Default values can be included here and then assigned to the prop params,
|
30
|
+
// e.g. prop = defaults.prop,
|
31
|
+
// This gathers default values together neatly and ensures non-primitive
|
32
|
+
// values are initialized early to avoid react making unnecessary re-renders.
|
33
|
+
// Note that default values are not required for props that are 'required',
|
34
|
+
// nor for props where the component can apply undefined values reasonably.
|
35
|
+
// Default values should be provided when the component needs to make a choice
|
36
|
+
// or assumption when a prop is not supplied.
|
37
|
+
|
38
|
+
// Default values for props
|
39
|
+
// const defaults = {
|
40
|
+
// /* TODO: add defaults for relevant props if needed */
|
41
|
+
// };
|
42
|
+
|
43
|
+
/**
|
44
|
+
* TODO: A description of the component.
|
45
|
+
*/
|
46
|
+
|
47
|
+
var ConditionBuilder = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
48
|
+
var className = _ref.className,
|
49
|
+
inputConfig = _ref.inputConfig,
|
50
|
+
startConditionLabel = _ref.startConditionLabel,
|
51
|
+
popOverSearchThreshold = _ref.popOverSearchThreshold,
|
52
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
53
|
+
return /*#__PURE__*/React__default.createElement(ConditionBuilderProvider, {
|
54
|
+
inputConfig: inputConfig,
|
55
|
+
popOverSearchThreshold: popOverSearchThreshold
|
56
|
+
}, /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
57
|
+
className: cx(blockClass,
|
58
|
+
// Apply the block class to the main HTML element
|
59
|
+
className,
|
60
|
+
// Apply any supplied class names to the main HTML element.
|
61
|
+
// example: `${blockClass}__template-string-class-${kind}-n-${size}`,
|
62
|
+
{
|
63
|
+
// switched classes dependant on props or state
|
64
|
+
// example: [`${blockClass}__here-if-small`]: size === 'sm',
|
65
|
+
}),
|
66
|
+
ref: ref,
|
67
|
+
role: "main"
|
68
|
+
}, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement(VStack, null, /*#__PURE__*/React__default.createElement(ConditionBuilderContent, {
|
69
|
+
startConditionLabel: startConditionLabel
|
70
|
+
}))));
|
71
|
+
});
|
72
|
+
|
73
|
+
// Return a placeholder if not released and not enabled by feature flag
|
74
|
+
ConditionBuilder = pkg.checkComponentEnabled(ConditionBuilder, componentName);
|
75
|
+
|
76
|
+
// The display name of the component, used by React. Note that displayName
|
77
|
+
// is used in preference to relying on function.name.
|
78
|
+
ConditionBuilder.displayName = componentName;
|
79
|
+
|
80
|
+
// The types and DocGen commentary for the component props,
|
81
|
+
// in alphabetical order (for consistency).
|
82
|
+
// See https://www.npmjs.com/package/prop-types#usage.
|
83
|
+
ConditionBuilder.propTypes = {
|
84
|
+
/**
|
85
|
+
* Provide the contents of the ConditionBuilder.
|
86
|
+
*/
|
87
|
+
//children: PropTypes.node.isRequired,
|
88
|
+
|
89
|
+
/**
|
90
|
+
* Provide an optional class to be applied to the containing node.
|
91
|
+
*/
|
92
|
+
className: PropTypes.string,
|
93
|
+
/**
|
94
|
+
* This is a mandatory prop that defines the input to the condition builder.
|
95
|
+
|
96
|
+
*/
|
97
|
+
inputConfig: PropTypes.shape({
|
98
|
+
properties: PropTypes.arrayOf(PropTypes.shape({
|
99
|
+
id: PropTypes.string,
|
100
|
+
label: PropTypes.string,
|
101
|
+
icon: PropTypes.func,
|
102
|
+
type: PropTypes.oneOf(['text', 'number', 'date', 'option']),
|
103
|
+
config: PropTypes.shape({
|
104
|
+
options: PropTypes.arrayOf(PropTypes.shape({
|
105
|
+
id: PropTypes.string,
|
106
|
+
label: PropTypes.string,
|
107
|
+
icon: PropTypes.func
|
108
|
+
})),
|
109
|
+
includeSearch: PropTypes.bool
|
110
|
+
})
|
111
|
+
}))
|
112
|
+
}).isRequired,
|
113
|
+
/**
|
114
|
+
* Provide an mandatory numeric value that will be used to enable search option in the popovers with list.
|
115
|
+
*/
|
116
|
+
popOverSearchThreshold: PropTypes.number.isRequired,
|
117
|
+
/**
|
118
|
+
* Provide a label to the button that starts condition builder
|
119
|
+
*/
|
120
|
+
startConditionLabel: PropTypes.string.isRequired
|
121
|
+
|
122
|
+
/* TODO: add types and DocGen for all props. */
|
123
|
+
};
|
124
|
+
|
125
|
+
export { ConditionBuilder };
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export default ConditionBuilderContent;
|
2
|
+
declare function ConditionBuilderContent({ startConditionLabel }: {
|
3
|
+
startConditionLabel: any;
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
5
|
+
declare namespace ConditionBuilderContent {
|
6
|
+
namespace propTypes {
|
7
|
+
let startConditionLabel: PropTypes.Validator<string>;
|
8
|
+
}
|
9
|
+
}
|
10
|
+
import PropTypes from 'prop-types';
|
@@ -0,0 +1,92 @@
|
|
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, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
+
import React__default, { useContext, useState, useRef, useEffect } from 'react';
|
10
|
+
import { pkg } from '../../../settings.js';
|
11
|
+
import PropTypes from '../../../node_modules/prop-types/index.js';
|
12
|
+
import { Button } from '@carbon/react';
|
13
|
+
import { Add } from '@carbon/react/icons';
|
14
|
+
import { ConditionBuilderContext, emptyState } from '../ConditionBuilderContext/DataTreeContext.js';
|
15
|
+
|
16
|
+
var blockClass = "".concat(pkg.prefix, "--condition-builder");
|
17
|
+
function ConditionBuilderContent(_ref) {
|
18
|
+
var _rootState$groups2;
|
19
|
+
var startConditionLabel = _ref.startConditionLabel;
|
20
|
+
var _useContext = useContext(ConditionBuilderContext),
|
21
|
+
rootState = _useContext.rootState,
|
22
|
+
setRootState = _useContext.setRootState;
|
23
|
+
var _useState = useState(true),
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
25
|
+
isConditionBuilderActive = _useState2[0],
|
26
|
+
setIsConditionBuilderActive = _useState2[1];
|
27
|
+
var conditionBuilderRef = useRef();
|
28
|
+
useEffect(function () {
|
29
|
+
var _rootState$groups;
|
30
|
+
if (rootState !== null && rootState !== void 0 && (_rootState$groups = rootState.groups) !== null && _rootState$groups !== void 0 && _rootState$groups.length) {
|
31
|
+
setIsConditionBuilderActive(false);
|
32
|
+
if (rootState.groups[0].conditions.length == 1 && rootState.groups[0].conditions[0].property == undefined) {
|
33
|
+
// when the add condition clicked to start the condition building, we by default open the popover of the first property
|
34
|
+
setTimeout(function () {
|
35
|
+
conditionBuilderRef.current.querySelector('.propertyField').click();
|
36
|
+
}, 0);
|
37
|
+
}
|
38
|
+
} else {
|
39
|
+
setIsConditionBuilderActive(true);
|
40
|
+
}
|
41
|
+
}, [rootState]);
|
42
|
+
var onStartConditionBuilder = function onStartConditionBuilder() {
|
43
|
+
//when add condition button is clicked.
|
44
|
+
setIsConditionBuilderActive(false);
|
45
|
+
setRootState(emptyState); //here we can set an empty skeleton object for an empty condition builder,
|
46
|
+
//or we can even pre-populate some existing builder and continue editing
|
47
|
+
};
|
48
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
49
|
+
ref: conditionBuilderRef,
|
50
|
+
className: "".concat(blockClass, "__content-container")
|
51
|
+
}, isConditionBuilderActive && /*#__PURE__*/React__default.createElement(Button, {
|
52
|
+
className: "".concat(blockClass, "__condition-builder"),
|
53
|
+
renderIcon: function renderIcon(props) {
|
54
|
+
return /*#__PURE__*/React__default.createElement(Add, _extends({
|
55
|
+
size: 16
|
56
|
+
}, props));
|
57
|
+
},
|
58
|
+
iconDescription: startConditionLabel,
|
59
|
+
kind: "ghost",
|
60
|
+
size: "sm",
|
61
|
+
onClick: onStartConditionBuilder
|
62
|
+
}, startConditionLabel), rootState && (rootState === null || rootState === void 0 || (_rootState$groups2 = rootState.groups) === null || _rootState$groups2 === void 0 ? void 0 : _rootState$groups2.map(function () {
|
63
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "conditionBuilder group renders here")
|
64
|
+
// <ConditionBuilderGroup
|
65
|
+
// state={eachGroup}
|
66
|
+
// onRemove={() => {
|
67
|
+
// onRemove(groupIndex);
|
68
|
+
// }}
|
69
|
+
// onChange={(updatedGroup) => {
|
70
|
+
// /**
|
71
|
+
// * This method is triggered from inner components. This will be called every time when any change is to be updated in the rootState.
|
72
|
+
// * This gets the updated group as argument.
|
73
|
+
// */
|
74
|
+
// setRootState({
|
75
|
+
// ...rootState,
|
76
|
+
// groups: rootState.groups.map((group, gIndex) =>
|
77
|
+
// groupIndex === gIndex ? updatedGroup : group
|
78
|
+
// ),
|
79
|
+
// });
|
80
|
+
// }}
|
81
|
+
//>
|
82
|
+
;
|
83
|
+
})));
|
84
|
+
}
|
85
|
+
ConditionBuilderContent.propTypes = {
|
86
|
+
/**
|
87
|
+
* Provide a label to the button that starts condition builder
|
88
|
+
*/
|
89
|
+
startConditionLabel: PropTypes.string.isRequired
|
90
|
+
};
|
91
|
+
|
92
|
+
export { ConditionBuilderContent as default };
|
@@ -0,0 +1,38 @@
|
|
1
|
+
export namespace emptyState {
|
2
|
+
let groups: {
|
3
|
+
groupSeparateOperator: null;
|
4
|
+
groupOperator: string;
|
5
|
+
statement: string;
|
6
|
+
conditions: {
|
7
|
+
property: undefined;
|
8
|
+
operator: string;
|
9
|
+
value: string;
|
10
|
+
}[];
|
11
|
+
}[];
|
12
|
+
}
|
13
|
+
export const ConditionBuilderContext: React.Context<any>;
|
14
|
+
export function ConditionBuilderProvider(props: any): import("react/jsx-runtime").JSX.Element;
|
15
|
+
export namespace ConditionBuilderProvider {
|
16
|
+
namespace propTypes {
|
17
|
+
let children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
18
|
+
let inputConfig: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
19
|
+
properties: PropTypes.Requireable<(PropTypes.InferProps<{
|
20
|
+
id: PropTypes.Requireable<string>;
|
21
|
+
label: PropTypes.Requireable<string>;
|
22
|
+
icon: PropTypes.Requireable<(...args: any[]) => any>;
|
23
|
+
type: PropTypes.Requireable<string>;
|
24
|
+
config: PropTypes.Requireable<PropTypes.InferProps<{
|
25
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
26
|
+
id: PropTypes.Requireable<string>;
|
27
|
+
label: PropTypes.Requireable<string>;
|
28
|
+
icon: PropTypes.Requireable<(...args: any[]) => any>;
|
29
|
+
}> | null | undefined)[]>;
|
30
|
+
includeSearch: PropTypes.Requireable<boolean>;
|
31
|
+
}>>;
|
32
|
+
}> | null | undefined)[]>;
|
33
|
+
}>>>;
|
34
|
+
let popOverSearchThreshold: PropTypes.Validator<number>;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
import React from 'react';
|
38
|
+
import PropTypes from 'prop-types';
|
@@ -0,0 +1,88 @@
|
|
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 } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
+
import React__default, { useState, createContext } from 'react';
|
10
|
+
import PropTypes from '../../../node_modules/prop-types/index.js';
|
11
|
+
|
12
|
+
var emptyState = {
|
13
|
+
groups: [{
|
14
|
+
groupSeparateOperator: null,
|
15
|
+
groupOperator: 'and',
|
16
|
+
statement: 'if',
|
17
|
+
conditions: [{
|
18
|
+
property: undefined,
|
19
|
+
operator: '',
|
20
|
+
value: ''
|
21
|
+
}]
|
22
|
+
}]
|
23
|
+
};
|
24
|
+
var ConditionBuilderContext = /*#__PURE__*/createContext();
|
25
|
+
|
26
|
+
// const rootReducer=(state,action)=>{
|
27
|
+
// switch(action.type){
|
28
|
+
// case 'update':
|
29
|
+
// ;
|
30
|
+
// return {
|
31
|
+
// ...state,
|
32
|
+
// ...action.payload
|
33
|
+
// }
|
34
|
+
// break;
|
35
|
+
// default:
|
36
|
+
// return state;
|
37
|
+
// }
|
38
|
+
|
39
|
+
// }
|
40
|
+
|
41
|
+
var ConditionBuilderProvider = function ConditionBuilderProvider(props) {
|
42
|
+
var _useState = useState({
|
43
|
+
groups: []
|
44
|
+
}),
|
45
|
+
_useState2 = _slicedToArray(_useState, 2),
|
46
|
+
rootState = _useState2[0],
|
47
|
+
setRootState = _useState2[1];
|
48
|
+
return /*#__PURE__*/React__default.createElement(ConditionBuilderContext.Provider, {
|
49
|
+
value: {
|
50
|
+
rootState: rootState,
|
51
|
+
setRootState: setRootState,
|
52
|
+
inputConfig: props.inputConfig,
|
53
|
+
popOverSearchThreshold: props.popOverSearchThreshold
|
54
|
+
}
|
55
|
+
},
|
56
|
+
// eslint-disable-next-line react/prop-types
|
57
|
+
props.children);
|
58
|
+
};
|
59
|
+
ConditionBuilderProvider.propTypes = {
|
60
|
+
/**
|
61
|
+
* Provide the contents of the ConditionBuilder.
|
62
|
+
*/
|
63
|
+
children: PropTypes.node.isRequired,
|
64
|
+
/**
|
65
|
+
* This is a mandatory prop that defines the input to the condition builder.
|
66
|
+
|
67
|
+
*/
|
68
|
+
inputConfig: PropTypes.shape({
|
69
|
+
properties: PropTypes.arrayOf(PropTypes.shape({
|
70
|
+
id: PropTypes.string,
|
71
|
+
label: PropTypes.string,
|
72
|
+
icon: PropTypes.func,
|
73
|
+
type: PropTypes.oneOf(['text', 'number', 'date', 'option']),
|
74
|
+
config: PropTypes.shape({
|
75
|
+
options: PropTypes.arrayOf(PropTypes.shape({
|
76
|
+
id: PropTypes.string,
|
77
|
+
label: PropTypes.string,
|
78
|
+
icon: PropTypes.func
|
79
|
+
})),
|
80
|
+
includeSearch: PropTypes.bool
|
81
|
+
})
|
82
|
+
}))
|
83
|
+
}).isRequired,
|
84
|
+
popOverSearchThreshold: PropTypes.number.isRequired
|
85
|
+
/* TODO: add types and DocGen for all props. */
|
86
|
+
};
|
87
|
+
|
88
|
+
export { ConditionBuilderContext, ConditionBuilderProvider, emptyState };
|
@@ -0,0 +1,58 @@
|
|
1
|
+
export declare const inputData: {
|
2
|
+
properties: ({
|
3
|
+
id: string;
|
4
|
+
label: string;
|
5
|
+
icon: import("@carbon/icons-react/lib/CarbonIcon").CarbonIconType;
|
6
|
+
type: string;
|
7
|
+
config: {
|
8
|
+
options: {
|
9
|
+
label: string;
|
10
|
+
id: string;
|
11
|
+
}[];
|
12
|
+
includeSearch?: undefined;
|
13
|
+
min?: undefined;
|
14
|
+
step?: undefined;
|
15
|
+
unit?: undefined;
|
16
|
+
};
|
17
|
+
} | {
|
18
|
+
id: string;
|
19
|
+
label: string;
|
20
|
+
icon: import("@carbon/icons-react/lib/CarbonIcon").CarbonIconType;
|
21
|
+
type: string;
|
22
|
+
config: {
|
23
|
+
options: {
|
24
|
+
label: string;
|
25
|
+
id: string;
|
26
|
+
icon: import("@carbon/icons-react/lib/CarbonIcon").CarbonIconType;
|
27
|
+
}[];
|
28
|
+
includeSearch: boolean;
|
29
|
+
min?: undefined;
|
30
|
+
step?: undefined;
|
31
|
+
unit?: undefined;
|
32
|
+
};
|
33
|
+
} | {
|
34
|
+
id: string;
|
35
|
+
label: string;
|
36
|
+
icon: import("@carbon/icons-react/lib/CarbonIcon").CarbonIconType;
|
37
|
+
type: string;
|
38
|
+
config: {
|
39
|
+
options?: undefined;
|
40
|
+
includeSearch?: undefined;
|
41
|
+
min?: undefined;
|
42
|
+
step?: undefined;
|
43
|
+
unit?: undefined;
|
44
|
+
};
|
45
|
+
} | {
|
46
|
+
id: string;
|
47
|
+
label: string;
|
48
|
+
icon: import("@carbon/icons-react/lib/CarbonIcon").CarbonIconType;
|
49
|
+
type: string;
|
50
|
+
config: {
|
51
|
+
min: number;
|
52
|
+
step: number;
|
53
|
+
unit: string;
|
54
|
+
options?: undefined;
|
55
|
+
includeSearch?: undefined;
|
56
|
+
};
|
57
|
+
})[];
|
58
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { ConditionBuilder } from "./ConditionBuilder";
|
@@ -6,7 +6,7 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
-
import React__default, { useState,
|
9
|
+
import React__default, { useState, useEffect, createContext } from 'react';
|
10
10
|
import PropTypes from '../../node_modules/prop-types/index.js';
|
11
11
|
import cx from 'classnames';
|
12
12
|
import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
@@ -118,11 +118,6 @@ var CreateFullPage = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
118
118
|
_useState22 = _slicedToArray(_useState21, 2),
|
119
119
|
lastIncludedStep = _useState22[0],
|
120
120
|
setLastIncludedStep = _useState22[1];
|
121
|
-
var _useState23 = useState(0),
|
122
|
-
_useState24 = _slicedToArray(_useState23, 2),
|
123
|
-
headerHeight = _useState24[0],
|
124
|
-
setHeaderHeight = _useState24[1];
|
125
|
-
var headerRef = useRef(null);
|
126
121
|
useEffect(function () {
|
127
122
|
var firstItem = stepData.findIndex(function (item) {
|
128
123
|
return item === null || item === void 0 ? void 0 : item.shouldIncludeStep;
|
@@ -139,13 +134,6 @@ var CreateFullPage = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
139
134
|
setCurrentStep(Number(initialStep + numberOfHiddenSteps));
|
140
135
|
}
|
141
136
|
}, [stepData, firstIncludedStep, lastIncludedStep, initialStep]);
|
142
|
-
useEffect(function () {
|
143
|
-
var headerHeight = 0;
|
144
|
-
if (title || (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) > 0) {
|
145
|
-
headerHeight = headerRef.current.getBoundingClientRect().height;
|
146
|
-
}
|
147
|
-
setHeaderHeight(headerHeight);
|
148
|
-
}, [title, breadcrumbs]);
|
149
137
|
useCreateComponentFocus({
|
150
138
|
previousState: previousState,
|
151
139
|
currentStep: currentStep,
|
@@ -193,8 +181,7 @@ var CreateFullPage = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
193
181
|
ref: ref,
|
194
182
|
className: cx(blockClass, className)
|
195
183
|
}, getDevtoolsProps(componentName)), (title || (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) > 0) && /*#__PURE__*/React__default.createElement("div", {
|
196
|
-
className: "".concat(blockClass, "__header")
|
197
|
-
ref: headerRef
|
184
|
+
className: "".concat(blockClass, "__header")
|
198
185
|
}, /*#__PURE__*/React__default.createElement(SimpleHeader, {
|
199
186
|
title: title,
|
200
187
|
breadcrumbs: breadcrumbs,
|
@@ -202,10 +189,7 @@ var CreateFullPage = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
202
189
|
overflowAriaLabel: breadcrumbsOverflowAriaLabel,
|
203
190
|
maxVisible: maxVisibleBreadcrumbs
|
204
191
|
})), /*#__PURE__*/React__default.createElement("div", {
|
205
|
-
className: "".concat(blockClass, "__influencer-and-body-container")
|
206
|
-
style: {
|
207
|
-
height: "calc(100vh - ".concat(headerHeight, "px)")
|
208
|
-
}
|
192
|
+
className: "".concat(blockClass, "__influencer-and-body-container")
|
209
193
|
}, /*#__PURE__*/React__default.createElement("div", {
|
210
194
|
className: "".concat(blockClass, "__influencer")
|
211
195
|
}, /*#__PURE__*/React__default.createElement(CreateInfluencer, {
|
@@ -5,8 +5,8 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
-
import React__default, { forwardRef, useContext, useState, useEffect } from 'react';
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends, defineProperty as _defineProperty, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
+
import React__default, { forwardRef, useContext, useState, useEffect, isValidElement } from 'react';
|
10
10
|
import PropTypes from '../../node_modules/prop-types/index.js';
|
11
11
|
import cx from 'classnames';
|
12
12
|
import { pkg } from '../../settings.js';
|
@@ -83,6 +83,24 @@ var CreateFullPageStep = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
83
83
|
span: 50
|
84
84
|
}; // Half.
|
85
85
|
|
86
|
+
var renderDescription = function renderDescription() {
|
87
|
+
if (description) {
|
88
|
+
var common = _objectSpread2({
|
89
|
+
children: description,
|
90
|
+
className: "".concat(blockClass, "-description")
|
91
|
+
}, span);
|
92
|
+
if (typeof description === 'string') {
|
93
|
+
return /*#__PURE__*/React__default.createElement(Column, _extends({}, common, {
|
94
|
+
as: "p"
|
95
|
+
}));
|
96
|
+
} else if ( /*#__PURE__*/isValidElement(description)) {
|
97
|
+
return /*#__PURE__*/React__default.createElement(Column, _extends({}, common, {
|
98
|
+
as: "div"
|
99
|
+
}));
|
100
|
+
}
|
101
|
+
}
|
102
|
+
return null;
|
103
|
+
};
|
86
104
|
return stepsContext ? /*#__PURE__*/React__default.createElement("section", _extends({}, rest, {
|
87
105
|
className: cx(blockClass, className, _defineProperty(_defineProperty({}, "".concat(blockClass, "__step--hidden-step"), stepNumber !== (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)), "".concat(blockClass, "__step--visible-step"), stepNumber === (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep))),
|
88
106
|
ref: ref
|
@@ -92,10 +110,7 @@ var CreateFullPageStep = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
92
110
|
}, span), title), subtitle && /*#__PURE__*/React__default.createElement(Column, _extends({
|
93
111
|
className: "".concat(blockClass, "-subtitle"),
|
94
112
|
as: "h6"
|
95
|
-
}, span), subtitle),
|
96
|
-
className: "".concat(blockClass, "-description"),
|
97
|
-
as: "p"
|
98
|
-
}, span), description)))), hasFieldset ? /*#__PURE__*/React__default.createElement(FormGroup, {
|
113
|
+
}, span), subtitle), renderDescription()))), hasFieldset ? /*#__PURE__*/React__default.createElement(FormGroup, {
|
99
114
|
legendText: fieldsetLegendText,
|
100
115
|
className: "".concat(blockClass, "-fieldset")
|
101
116
|
}, children) : children) : pconsole.warn("You have tried using a ".concat(componentName, " component outside of a CreateFullPage. This is not allowed. ").concat(componentName, "s should always be children of the CreateFullPage"));
|
@@ -115,7 +130,7 @@ CreateFullPageStep.propTypes = {
|
|
115
130
|
/**
|
116
131
|
* Sets an optional description on the progress step component
|
117
132
|
*/
|
118
|
-
description: PropTypes.
|
133
|
+
description: PropTypes.node,
|
119
134
|
/**
|
120
135
|
* This will conditionally disable the submit button in the multi step CreateFullPage
|
121
136
|
*/
|