@carbon/ibm-products 2.43.2-canary.209 → 2.43.2-canary.211
Sign up to get free protection for your applications and to get access to all the features.
- package/es/components/CreateTearsheet/CreateTearsheet.d.ts +6 -0
- package/es/components/CreateTearsheet/CreateTearsheet.js +13 -1
- package/es/components/CreateTearsheet/CreateTearsheetStep.d.ts +18 -0
- package/es/components/CreateTearsheet/CreateTearsheetStep.js +30 -3
- package/es/components/TagSet/TagSet.d.ts +4 -0
- package/es/components/TagSet/TagSet.js +8 -2
- package/es/components/TagSet/TagSetOverflow.d.ts +4 -0
- package/es/components/TagSet/TagSetOverflow.js +8 -2
- package/es/global/js/hooks/useCreateComponentStepChange.d.ts +3 -1
- package/es/global/js/hooks/useCreateComponentStepChange.js +18 -2
- package/lib/components/CreateTearsheet/CreateTearsheet.d.ts +6 -0
- package/lib/components/CreateTearsheet/CreateTearsheet.js +13 -1
- package/lib/components/CreateTearsheet/CreateTearsheetStep.d.ts +18 -0
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +29 -2
- package/lib/components/TagSet/TagSet.d.ts +4 -0
- package/lib/components/TagSet/TagSet.js +8 -2
- package/lib/components/TagSet/TagSetOverflow.d.ts +4 -0
- package/lib/components/TagSet/TagSetOverflow.js +8 -2
- package/lib/global/js/hooks/useCreateComponentStepChange.d.ts +3 -1
- package/lib/global/js/hooks/useCreateComponentStepChange.js +18 -2
- package/package.json +2 -2
@@ -5,8 +5,10 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
import React, { Dispatch, PropsWithChildren, ReactNode, SetStateAction } from 'react';
|
8
|
+
import { ExperimentalSecondarySubmit } from './CreateTearsheetStep';
|
8
9
|
export interface StepsContextType {
|
9
10
|
currentStep: number;
|
11
|
+
setExperimentalSecondarySubmit: Dispatch<SetStateAction<ExperimentalSecondarySubmit>>;
|
10
12
|
setIsDisabled: Dispatch<SetStateAction<boolean>>;
|
11
13
|
setOnPrevious: (fn: any) => void;
|
12
14
|
setOnNext: (fn: any) => void;
|
@@ -32,6 +34,10 @@ export interface CreateTearsheetProps extends PropsWithChildren {
|
|
32
34
|
* An optional class or classes to be added to the outermost element.
|
33
35
|
*/
|
34
36
|
className?: string;
|
37
|
+
/**
|
38
|
+
* The experimentalSecondary submit button text
|
39
|
+
*/
|
40
|
+
experimentalSecondarySubmitText?: string;
|
35
41
|
/**
|
36
42
|
* A description of the flow, displayed in the header area of the tearsheet.
|
37
43
|
*/
|
@@ -22,7 +22,7 @@ import { useResetCreateComponent } from '../../global/js/hooks/useResetCreateCom
|
|
22
22
|
import { useCreateComponentStepChange } from '../../global/js/hooks/useCreateComponentStepChange.js';
|
23
23
|
import { CreateInfluencer } from '../CreateInfluencer/CreateInfluencer.js';
|
24
24
|
|
25
|
-
var _excluded = ["backButtonText", "cancelButtonText", "children", "className", "description", "influencerWidth", "initialStep", "label", "nextButtonText", "onClose", "onRequestSubmit", "open", "firstFocusElement", "slug", "submitButtonText", "title", "verticalPosition"];
|
25
|
+
var _excluded = ["backButtonText", "cancelButtonText", "children", "className", "experimentalSecondarySubmitText", "description", "influencerWidth", "initialStep", "label", "nextButtonText", "onClose", "onRequestSubmit", "open", "firstFocusElement", "slug", "submitButtonText", "title", "verticalPosition"];
|
26
26
|
var componentName = 'CreateTearsheet';
|
27
27
|
var blockClass = "".concat(pkg.prefix, "--tearsheet-create");
|
28
28
|
|
@@ -40,6 +40,7 @@ var CreateTearsheet = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
40
40
|
cancelButtonText = _ref.cancelButtonText,
|
41
41
|
children = _ref.children,
|
42
42
|
className = _ref.className,
|
43
|
+
experimentalSecondarySubmitText = _ref.experimentalSecondarySubmitText,
|
43
44
|
description = _ref.description,
|
44
45
|
_ref$influencerWidth = _ref.influencerWidth,
|
45
46
|
influencerWidth = _ref$influencerWidth === void 0 ? 'narrow' : _ref$influencerWidth,
|
@@ -104,6 +105,10 @@ var CreateTearsheet = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
104
105
|
_useState24 = _slicedToArray(_useState23, 2),
|
105
106
|
lastIncludedStep = _useState24[0],
|
106
107
|
setLastIncludedStep = _useState24[1];
|
108
|
+
var _useState25 = useState({}),
|
109
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
110
|
+
experimentalSecondarySubmit = _useState26[0],
|
111
|
+
setExperimentalSecondarySubmit = _useState26[1];
|
107
112
|
var previousState = usePreviousValue({
|
108
113
|
currentStep: currentStep,
|
109
114
|
open: open
|
@@ -170,6 +175,8 @@ var CreateTearsheet = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
170
175
|
nextButtonText: nextButtonText,
|
171
176
|
isSubmitting: isSubmitting,
|
172
177
|
componentBlockClass: blockClass,
|
178
|
+
experimentalSecondarySubmit: experimentalSecondarySubmit,
|
179
|
+
experimentalSecondarySubmitText: experimentalSecondarySubmit.labelText ? experimentalSecondarySubmit.labelText : experimentalSecondarySubmitText,
|
173
180
|
setCreateComponentActions: setCreateTearsheetActions
|
174
181
|
});
|
175
182
|
return /*#__PURE__*/React__default.createElement(TearsheetShell, _extends({}, getDevtoolsProps(componentName), rest, {
|
@@ -198,6 +205,7 @@ var CreateTearsheet = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
198
205
|
}, /*#__PURE__*/React__default.createElement(StepsContext.Provider, {
|
199
206
|
value: {
|
200
207
|
currentStep: currentStep,
|
208
|
+
setExperimentalSecondarySubmit: setExperimentalSecondarySubmit,
|
201
209
|
setIsDisabled: setIsDisabled,
|
202
210
|
setOnPrevious: function setOnPrevious(fn) {
|
203
211
|
return _setOnPrevious(function () {
|
@@ -254,6 +262,10 @@ CreateTearsheet.propTypes = {
|
|
254
262
|
* A description of the flow, displayed in the header area of the tearsheet.
|
255
263
|
*/
|
256
264
|
description: PropTypes.node,
|
265
|
+
/**
|
266
|
+
* The experimentalSecondary submit button text
|
267
|
+
*/
|
268
|
+
experimentalSecondarySubmitText: PropTypes.string,
|
257
269
|
/**
|
258
270
|
* Specifies elements to focus on first on render.
|
259
271
|
*/
|
@@ -49,6 +49,10 @@ interface CreateTearsheetStepBaseProps extends PropsWithChildren {
|
|
49
49
|
* This will conditionally disable the submit button in the multi step Tearsheet
|
50
50
|
*/
|
51
51
|
disableSubmit?: boolean;
|
52
|
+
/**
|
53
|
+
* Configuration options for customizing the behavior of the experimentalSecondary submit button.
|
54
|
+
*/
|
55
|
+
experimentalSecondarySubmit?: ExperimentalSecondarySubmit;
|
52
56
|
/**
|
53
57
|
* This prop is used to help track dynamic steps. If this value is `false` then the step is not included in the visible steps or the ProgressIndicator
|
54
58
|
* steps. If this value is `true` then the step will be included in the list of visible steps, as well as being included in the ProgressIndicator step list
|
@@ -91,5 +95,19 @@ interface CreateTearsheetStepBaseProps extends PropsWithChildren {
|
|
91
95
|
title: React.ReactNode;
|
92
96
|
}
|
93
97
|
type CreateTearsheetStepProps = CreateTearsheetStepBaseProps & fieldsetLegendTextProps;
|
98
|
+
/**
|
99
|
+
* Configuration options for customizing the behavior of the experimentalSecondary submit button.
|
100
|
+
*
|
101
|
+
* @property {string} [labelText] - Optional text to replace the default button text.
|
102
|
+
* @property {boolean} [disabled] - If true, the button will be disabled and not clickable.
|
103
|
+
* @property {boolean} [hideSecondarySubmit] - If true, the button will be hidden from view.
|
104
|
+
* @property {() => void} [onClick] - Optional click handler function to be executed when the button is clicked.
|
105
|
+
*/
|
106
|
+
export type ExperimentalSecondarySubmit = {
|
107
|
+
labelText?: string;
|
108
|
+
disabled?: boolean;
|
109
|
+
hideSecondarySubmit?: boolean;
|
110
|
+
onClick?: () => void;
|
111
|
+
};
|
94
112
|
export declare let CreateTearsheetStep: React.ForwardRefExoticComponent<CreateTearsheetStepProps & React.RefAttributes<unknown>>;
|
95
113
|
export {};
|
@@ -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, slicedToArray as _slicedToArray, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import React__default, { forwardRef, useRef, useContext, useState, useEffect, isValidElement } from 'react';
|
10
10
|
import PropTypes from '../../node_modules/prop-types/index.js';
|
11
11
|
import cx from 'classnames';
|
@@ -16,7 +16,7 @@ import pconsole from '../../global/js/utils/pconsole.js';
|
|
16
16
|
import { usePreviousValue } from '../../global/js/hooks/usePreviousValue.js';
|
17
17
|
import { useRetrieveStepData } from '../../global/js/hooks/useRetrieveStepData.js';
|
18
18
|
|
19
|
-
var _excluded = ["children", "className", "description", "disableSubmit", "fieldsetLegendText", "hasFieldset", "includeStep", "introStep", "invalid", "onMount", "onNext", "onPrevious", "secondaryLabel", "subtitle", "title"];
|
19
|
+
var _excluded = ["children", "className", "description", "disableSubmit", "experimentalSecondarySubmit", "fieldsetLegendText", "hasFieldset", "includeStep", "introStep", "invalid", "onMount", "onNext", "onPrevious", "secondaryLabel", "subtitle", "title"];
|
20
20
|
var componentName = 'CreateTearsheetStep';
|
21
21
|
var blockClass = "".concat(pkg.prefix, "--tearsheet-create__step");
|
22
22
|
|
@@ -25,11 +25,22 @@ var defaults = {
|
|
25
25
|
hasFieldset: true,
|
26
26
|
includeStep: true
|
27
27
|
};
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Configuration options for customizing the behavior of the experimentalSecondary submit button.
|
31
|
+
*
|
32
|
+
* @property {string} [labelText] - Optional text to replace the default button text.
|
33
|
+
* @property {boolean} [disabled] - If true, the button will be disabled and not clickable.
|
34
|
+
* @property {boolean} [hideSecondarySubmit] - If true, the button will be hidden from view.
|
35
|
+
* @property {() => void} [onClick] - Optional click handler function to be executed when the button is clicked.
|
36
|
+
*/
|
37
|
+
|
28
38
|
var CreateTearsheetStep = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
29
39
|
var children = _ref.children,
|
30
40
|
className = _ref.className,
|
31
41
|
description = _ref.description,
|
32
42
|
disableSubmit = _ref.disableSubmit,
|
43
|
+
experimentalSecondarySubmit = _ref.experimentalSecondarySubmit,
|
33
44
|
fieldsetLegendText = _ref.fieldsetLegendText,
|
34
45
|
_ref$hasFieldset = _ref.hasFieldset,
|
35
46
|
hasFieldset = _ref$hasFieldset === void 0 ? defaults.hasFieldset : _ref$hasFieldset,
|
@@ -71,8 +82,9 @@ var CreateTearsheetStep = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
71
82
|
useEffect(function () {
|
72
83
|
if (stepNumber === (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep) && (previousState === null || previousState === void 0 ? void 0 : previousState.currentStep) !== (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)) {
|
73
84
|
stepsContext === null || stepsContext === void 0 || stepsContext.setOnMount(onMount);
|
85
|
+
stepsContext === null || stepsContext === void 0 || stepsContext.setExperimentalSecondarySubmit(_objectSpread2({}, experimentalSecondarySubmit));
|
74
86
|
}
|
75
|
-
}, [onMount, stepsContext, stepNumber, previousState === null || previousState === void 0 ? void 0 : previousState.currentStep]);
|
87
|
+
}, [onMount, experimentalSecondarySubmit, stepsContext, stepNumber, previousState === null || previousState === void 0 ? void 0 : previousState.currentStep]);
|
76
88
|
|
77
89
|
// Used to take the `includeStep` prop and use it as a local state value
|
78
90
|
useEffect(function () {
|
@@ -163,6 +175,21 @@ CreateTearsheetStep.propTypes = {
|
|
163
175
|
* This will conditionally disable the submit button in the multi step Tearsheet
|
164
176
|
*/
|
165
177
|
disableSubmit: PropTypes.bool,
|
178
|
+
/**
|
179
|
+
* Configuration options for customizing the behavior of the experimentalSecondary submit button.
|
180
|
+
*
|
181
|
+
* @property {string} [labelText] - Optional text to replace the default button text.
|
182
|
+
* @property {boolean} [disabled] - If true, the button will be disabled and not clickable.
|
183
|
+
* @property {boolean} [hideSecondarySubmit] - If true, the button will be hidden from view.
|
184
|
+
* @property {() => void} [onClick] - Optional click handler function to be executed when the button is clicked.
|
185
|
+
*/
|
186
|
+
/**@ts-ignore*/
|
187
|
+
experimentalSecondarySubmit: PropTypes.shape({
|
188
|
+
labelText: PropTypes.string,
|
189
|
+
disabled: PropTypes.bool,
|
190
|
+
hideSecondarySubmit: PropTypes.bool,
|
191
|
+
onClick: PropTypes.func
|
192
|
+
}),
|
166
193
|
/**
|
167
194
|
* This is the required legend text that appears above a fieldset html element for accessibility purposes.
|
168
195
|
* You can set the `hasFieldset` prop to false if you have multiple fieldset elements or want to control the children of your Full Page's step content.
|
@@ -58,6 +58,10 @@ export interface TagSetProps extends PropsWithChildren {
|
|
58
58
|
* overflowAlign from the standard tooltip. Default center.
|
59
59
|
*/
|
60
60
|
overflowAlign?: OverflowAlign;
|
61
|
+
/**
|
62
|
+
* Will auto-align the popover on first render if it is not visible. This prop is currently experimental and is subject to future changes.
|
63
|
+
*/
|
64
|
+
overflowAutoAlign?: boolean;
|
61
65
|
/**
|
62
66
|
* overflowClassName for the tooltip popup
|
63
67
|
*/
|
@@ -17,7 +17,7 @@ import { isRequiredIf } from '../../global/js/utils/props-helper.js';
|
|
17
17
|
import { pkg } from '../../settings.js';
|
18
18
|
import { useResizeObserver } from '../../global/js/hooks/useResizeObserver.js';
|
19
19
|
|
20
|
-
var _excluded = ["align", "allTagsModalTarget", "className", "maxVisible", "multiline", "overflowAlign", "overflowClassName", "overflowType", "allTagsModalTitle", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "showAllTagsLabel", "tags", "containingElementRef", "measurementOffset", "onOverflowTagChange"],
|
20
|
+
var _excluded = ["align", "allTagsModalTarget", "className", "maxVisible", "multiline", "overflowAutoAlign", "overflowAlign", "overflowClassName", "overflowType", "allTagsModalTitle", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "showAllTagsLabel", "tags", "containingElementRef", "measurementOffset", "onOverflowTagChange"],
|
21
21
|
_excluded2 = ["label", "id"],
|
22
22
|
_excluded3 = ["label", "onClose"];
|
23
23
|
var componentName = 'TagSet';
|
@@ -39,6 +39,7 @@ var TagSet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
39
39
|
className = _ref.className,
|
40
40
|
maxVisible = _ref.maxVisible,
|
41
41
|
multiline = _ref.multiline,
|
42
|
+
overflowAutoAlign = _ref.overflowAutoAlign,
|
42
43
|
_ref$overflowAlign = _ref.overflowAlign,
|
43
44
|
overflowAlign = _ref$overflowAlign === void 0 ? 'bottom' : _ref$overflowAlign,
|
44
45
|
overflowClassName = _ref.overflowClassName,
|
@@ -145,6 +146,7 @@ var TagSet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
145
146
|
});
|
146
147
|
newDisplayedTags.push( /*#__PURE__*/React__default.createElement(TagSetOverflow, {
|
147
148
|
allTagsModalSearchThreshold: allTagsModalSearchThreshold,
|
149
|
+
overflowAutoAlign: overflowAutoAlign,
|
148
150
|
className: overflowClassName,
|
149
151
|
onShowAllClick: handleShowAllClick,
|
150
152
|
overflowTags: newOverflowTags,
|
@@ -158,7 +160,7 @@ var TagSet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
158
160
|
}));
|
159
161
|
onOverflowTagChange === null || onOverflowTagChange === void 0 || onOverflowTagChange(newOverflowTags);
|
160
162
|
setDisplayedTags(newDisplayedTags);
|
161
|
-
}, [displayCount, overflowAlign, overflowClassName, overflowType, showAllTagsLabel, tags, onOverflowTagChange, popoverOpen, handleTagOnClose]);
|
163
|
+
}, [displayCount, overflowAlign, overflowClassName, overflowType, showAllTagsLabel, tags, onOverflowTagChange, popoverOpen, handleTagOnClose, overflowAutoAlign]);
|
162
164
|
var checkFullyVisibleTags = useCallback(function () {
|
163
165
|
if (multiline) {
|
164
166
|
return setDisplayCount(maxVisible || 3);
|
@@ -321,6 +323,10 @@ TagSet.propTypes = {
|
|
321
323
|
* overflowAlign from the standard tooltip. Default center.
|
322
324
|
*/
|
323
325
|
overflowAlign: PropTypes.oneOf(['top', 'top-left', 'top-right', 'bottom', 'bottom-left', 'bottom-right', 'left', 'left-bottom', 'left-top', 'right', 'right-bottom', 'right-top']),
|
326
|
+
/**
|
327
|
+
* Will auto-align the popover on first render if it is not visible. This prop is currently experimental and is subject to future changes.
|
328
|
+
*/
|
329
|
+
overflowAutoAlign: PropTypes.bool,
|
324
330
|
/**
|
325
331
|
* overflowClassName for the tooltip popup
|
326
332
|
*/
|
@@ -26,6 +26,10 @@ interface TagSetOverflowProps {
|
|
26
26
|
* Type of rendering displayed inside of the tag overflow component
|
27
27
|
*/
|
28
28
|
overflowType?: OverflowType;
|
29
|
+
/**
|
30
|
+
* Will auto-align the popover on first render if it is not visible. This prop is currently experimental and is subject to future changes.
|
31
|
+
*/
|
32
|
+
overflowAutoAlign?: boolean;
|
29
33
|
/**
|
30
34
|
* Open state of the popover
|
31
35
|
*/
|
@@ -13,7 +13,7 @@ import { Popover, Tag, PopoverContent, Link } from '@carbon/react';
|
|
13
13
|
import { pkg } from '../../settings.js';
|
14
14
|
import { useClickOutside } from '../../global/js/hooks/useClickOutside.js';
|
15
15
|
|
16
|
-
var _excluded = ["allTagsModalSearchThreshold", "className", "onShowAllClick", "overflowAlign", "overflowTags", "overflowType", "showAllTagsLabel", "popoverOpen", "setPopoverOpen"];
|
16
|
+
var _excluded = ["allTagsModalSearchThreshold", "className", "onShowAllClick", "overflowAlign", "overflowAutoAlign", "overflowTags", "overflowType", "showAllTagsLabel", "popoverOpen", "setPopoverOpen"];
|
17
17
|
var componentName = 'TagSetOverflow';
|
18
18
|
var blockClass = "".concat(pkg.prefix, "--tag-set-overflow");
|
19
19
|
|
@@ -28,6 +28,7 @@ var TagSetOverflow = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
28
28
|
onShowAllClick = _ref.onShowAllClick,
|
29
29
|
_ref$overflowAlign = _ref.overflowAlign,
|
30
30
|
overflowAlign = _ref$overflowAlign === void 0 ? 'bottom' : _ref$overflowAlign,
|
31
|
+
overflowAutoAlign = _ref.overflowAutoAlign,
|
31
32
|
overflowTags = _ref.overflowTags,
|
32
33
|
overflowType = _ref.overflowType,
|
33
34
|
showAllTagsLabel = _ref.showAllTagsLabel,
|
@@ -63,7 +64,8 @@ var TagSetOverflow = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
63
64
|
dropShadow: true,
|
64
65
|
highContrast: true,
|
65
66
|
onKeyDown: handleEscKeyPress,
|
66
|
-
open: popoverOpen
|
67
|
+
open: popoverOpen,
|
68
|
+
autoAlign: overflowAutoAlign
|
67
69
|
}, /*#__PURE__*/React__default.createElement(Tag, {
|
68
70
|
onClick: function onClick() {
|
69
71
|
return setPopoverOpen === null || setPopoverOpen === void 0 ? void 0 : setPopoverOpen(!popoverOpen);
|
@@ -115,6 +117,10 @@ TagSetOverflow.propTypes = {
|
|
115
117
|
* overflowAlign from the standard tooltip
|
116
118
|
*/
|
117
119
|
overflowAlign: PropTypes.oneOf(['top', 'top-left', 'top-right', 'bottom', 'bottom-left', 'bottom-right', 'left', 'left-bottom', 'left-top', 'right', 'right-bottom', 'right-top']),
|
120
|
+
/**
|
121
|
+
* Will auto-align the popover on first render if it is not visible. This prop is currently experimental and is subject to future changes.
|
122
|
+
*/
|
123
|
+
overflowAutoAlign: PropTypes.bool,
|
118
124
|
/**
|
119
125
|
* tags shown in overflow
|
120
126
|
*/
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export function useCreateComponentStepChange({ firstIncludedStep, lastIncludedStep, stepData, onPrevious, onNext, isSubmitDisabled, setCurrentStep, setIsSubmitting, setLoadingPrevious, loadingPrevious, onClose, onRequestSubmit, componentName, currentStep, backButtonText, cancelButtonText, submitButtonText, nextButtonText, isSubmitting, componentBlockClass, setCreateComponentActions, setModalIsOpen, }: {
|
1
|
+
export function useCreateComponentStepChange({ firstIncludedStep, lastIncludedStep, stepData, onPrevious, onNext, isSubmitDisabled, setCurrentStep, setIsSubmitting, setLoadingPrevious, loadingPrevious, onClose, onRequestSubmit, componentName, currentStep, backButtonText, cancelButtonText, submitButtonText, nextButtonText, isSubmitting, componentBlockClass, setCreateComponentActions, setModalIsOpen, experimentalSecondarySubmit, experimentalSecondarySubmitText, }: {
|
2
2
|
firstIncludedStep: any;
|
3
3
|
lastIncludedStep: any;
|
4
4
|
stepData: any;
|
@@ -21,4 +21,6 @@ export function useCreateComponentStepChange({ firstIncludedStep, lastIncludedSt
|
|
21
21
|
componentBlockClass: any;
|
22
22
|
setCreateComponentActions: any;
|
23
23
|
setModalIsOpen: any;
|
24
|
+
experimentalSecondarySubmit: any;
|
25
|
+
experimentalSecondarySubmitText: any;
|
24
26
|
}): void;
|
@@ -32,7 +32,9 @@ var useCreateComponentStepChange = function useCreateComponentStepChange(_ref) {
|
|
32
32
|
isSubmitting = _ref.isSubmitting,
|
33
33
|
componentBlockClass = _ref.componentBlockClass,
|
34
34
|
setCreateComponentActions = _ref.setCreateComponentActions,
|
35
|
-
setModalIsOpen = _ref.setModalIsOpen
|
35
|
+
setModalIsOpen = _ref.setModalIsOpen,
|
36
|
+
experimentalSecondarySubmit = _ref.experimentalSecondarySubmit,
|
37
|
+
experimentalSecondarySubmitText = _ref.experimentalSecondarySubmitText;
|
36
38
|
var continueToNextStep = useCallback(function () {
|
37
39
|
setIsSubmitting(false);
|
38
40
|
setCurrentStep(function (prev) {
|
@@ -212,6 +214,11 @@ var useCreateComponentStepChange = function useCreateComponentStepChange(_ref) {
|
|
212
214
|
return _ref5.apply(this, arguments);
|
213
215
|
};
|
214
216
|
}();
|
217
|
+
var handleExperimentalSecondarySubmit = function handleExperimentalSecondarySubmit() {
|
218
|
+
if (typeof (experimentalSecondarySubmit === null || experimentalSecondarySubmit === void 0 ? void 0 : experimentalSecondarySubmit.onClick) === 'function') {
|
219
|
+
experimentalSecondarySubmit.onClick();
|
220
|
+
}
|
221
|
+
};
|
215
222
|
if ((stepData === null || stepData === void 0 ? void 0 : stepData.length) > 0) {
|
216
223
|
var buttons = [];
|
217
224
|
if ((stepData === null || stepData === void 0 ? void 0 : stepData.length) > 1) {
|
@@ -232,6 +239,15 @@ var useCreateComponentStepChange = function useCreateComponentStepChange(_ref) {
|
|
232
239
|
} : onUnmount,
|
233
240
|
kind: 'ghost'
|
234
241
|
});
|
242
|
+
if (experimentalSecondarySubmitText && !(experimentalSecondarySubmit !== null && experimentalSecondarySubmit !== void 0 && experimentalSecondarySubmit.hideSecondarySubmit)) {
|
243
|
+
buttons.push({
|
244
|
+
key: 'create-action-button-experimentalSecondarySubmit',
|
245
|
+
label: experimentalSecondarySubmitText,
|
246
|
+
onClick: handleExperimentalSecondarySubmit,
|
247
|
+
kind: 'secondary',
|
248
|
+
disabled: experimentalSecondarySubmit === null || experimentalSecondarySubmit === void 0 ? void 0 : experimentalSecondarySubmit.disabled
|
249
|
+
});
|
250
|
+
}
|
235
251
|
buttons.push({
|
236
252
|
key: 'create-action-button-submit',
|
237
253
|
label: currentStep < lastIncludedStep ? nextButtonText : submitButtonText,
|
@@ -243,7 +259,7 @@ var useCreateComponentStepChange = function useCreateComponentStepChange(_ref) {
|
|
243
259
|
});
|
244
260
|
setCreateComponentActions(buttons);
|
245
261
|
}
|
246
|
-
}, [firstIncludedStep, lastIncludedStep, stepData, onNext, isSubmitDisabled, backButtonText, cancelButtonText, currentStep, onClose, nextButtonText, submitButtonText, onRequestSubmit, isSubmitting, componentBlockClass, componentName, continueToNextStep, setCurrentStep, setCreateComponentActions, setIsSubmitting, setModalIsOpen, moveToPreviousStep, onPrevious, setLoadingPrevious, loadingPrevious]);
|
262
|
+
}, [firstIncludedStep, lastIncludedStep, stepData, onNext, isSubmitDisabled, backButtonText, cancelButtonText, currentStep, onClose, nextButtonText, submitButtonText, onRequestSubmit, isSubmitting, componentBlockClass, componentName, continueToNextStep, setCurrentStep, setCreateComponentActions, setIsSubmitting, setModalIsOpen, moveToPreviousStep, onPrevious, setLoadingPrevious, loadingPrevious, experimentalSecondarySubmit, experimentalSecondarySubmitText]);
|
247
263
|
};
|
248
264
|
|
249
265
|
export { useCreateComponentStepChange };
|
@@ -5,8 +5,10 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
import React, { Dispatch, PropsWithChildren, ReactNode, SetStateAction } from 'react';
|
8
|
+
import { ExperimentalSecondarySubmit } from './CreateTearsheetStep';
|
8
9
|
export interface StepsContextType {
|
9
10
|
currentStep: number;
|
11
|
+
setExperimentalSecondarySubmit: Dispatch<SetStateAction<ExperimentalSecondarySubmit>>;
|
10
12
|
setIsDisabled: Dispatch<SetStateAction<boolean>>;
|
11
13
|
setOnPrevious: (fn: any) => void;
|
12
14
|
setOnNext: (fn: any) => void;
|
@@ -32,6 +34,10 @@ export interface CreateTearsheetProps extends PropsWithChildren {
|
|
32
34
|
* An optional class or classes to be added to the outermost element.
|
33
35
|
*/
|
34
36
|
className?: string;
|
37
|
+
/**
|
38
|
+
* The experimentalSecondary submit button text
|
39
|
+
*/
|
40
|
+
experimentalSecondarySubmitText?: string;
|
35
41
|
/**
|
36
42
|
* A description of the flow, displayed in the header area of the tearsheet.
|
37
43
|
*/
|
@@ -31,7 +31,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
31
31
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
32
32
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
33
33
|
|
34
|
-
var _excluded = ["backButtonText", "cancelButtonText", "children", "className", "description", "influencerWidth", "initialStep", "label", "nextButtonText", "onClose", "onRequestSubmit", "open", "firstFocusElement", "slug", "submitButtonText", "title", "verticalPosition"];
|
34
|
+
var _excluded = ["backButtonText", "cancelButtonText", "children", "className", "experimentalSecondarySubmitText", "description", "influencerWidth", "initialStep", "label", "nextButtonText", "onClose", "onRequestSubmit", "open", "firstFocusElement", "slug", "submitButtonText", "title", "verticalPosition"];
|
35
35
|
var componentName = 'CreateTearsheet';
|
36
36
|
var blockClass = "".concat(settings.pkg.prefix, "--tearsheet-create");
|
37
37
|
|
@@ -49,6 +49,7 @@ exports.CreateTearsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
49
49
|
cancelButtonText = _ref.cancelButtonText,
|
50
50
|
children = _ref.children,
|
51
51
|
className = _ref.className,
|
52
|
+
experimentalSecondarySubmitText = _ref.experimentalSecondarySubmitText,
|
52
53
|
description = _ref.description,
|
53
54
|
_ref$influencerWidth = _ref.influencerWidth,
|
54
55
|
influencerWidth = _ref$influencerWidth === void 0 ? 'narrow' : _ref$influencerWidth,
|
@@ -113,6 +114,10 @@ exports.CreateTearsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
113
114
|
_useState24 = _rollupPluginBabelHelpers.slicedToArray(_useState23, 2),
|
114
115
|
lastIncludedStep = _useState24[0],
|
115
116
|
setLastIncludedStep = _useState24[1];
|
117
|
+
var _useState25 = React.useState({}),
|
118
|
+
_useState26 = _rollupPluginBabelHelpers.slicedToArray(_useState25, 2),
|
119
|
+
experimentalSecondarySubmit = _useState26[0],
|
120
|
+
setExperimentalSecondarySubmit = _useState26[1];
|
116
121
|
var previousState = usePreviousValue.usePreviousValue({
|
117
122
|
currentStep: currentStep,
|
118
123
|
open: open
|
@@ -179,6 +184,8 @@ exports.CreateTearsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
179
184
|
nextButtonText: nextButtonText,
|
180
185
|
isSubmitting: isSubmitting,
|
181
186
|
componentBlockClass: blockClass,
|
187
|
+
experimentalSecondarySubmit: experimentalSecondarySubmit,
|
188
|
+
experimentalSecondarySubmitText: experimentalSecondarySubmit.labelText ? experimentalSecondarySubmit.labelText : experimentalSecondarySubmitText,
|
182
189
|
setCreateComponentActions: setCreateTearsheetActions
|
183
190
|
});
|
184
191
|
return /*#__PURE__*/React__default["default"].createElement(TearsheetShell.TearsheetShell, _rollupPluginBabelHelpers["extends"]({}, devtools.getDevtoolsProps(componentName), rest, {
|
@@ -207,6 +214,7 @@ exports.CreateTearsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
207
214
|
}, /*#__PURE__*/React__default["default"].createElement(StepsContext.Provider, {
|
208
215
|
value: {
|
209
216
|
currentStep: currentStep,
|
217
|
+
setExperimentalSecondarySubmit: setExperimentalSecondarySubmit,
|
210
218
|
setIsDisabled: setIsDisabled,
|
211
219
|
setOnPrevious: function setOnPrevious(fn) {
|
212
220
|
return _setOnPrevious(function () {
|
@@ -263,6 +271,10 @@ exports.CreateTearsheet.propTypes = {
|
|
263
271
|
* A description of the flow, displayed in the header area of the tearsheet.
|
264
272
|
*/
|
265
273
|
description: index["default"].node,
|
274
|
+
/**
|
275
|
+
* The experimentalSecondary submit button text
|
276
|
+
*/
|
277
|
+
experimentalSecondarySubmitText: index["default"].string,
|
266
278
|
/**
|
267
279
|
* Specifies elements to focus on first on render.
|
268
280
|
*/
|
@@ -49,6 +49,10 @@ interface CreateTearsheetStepBaseProps extends PropsWithChildren {
|
|
49
49
|
* This will conditionally disable the submit button in the multi step Tearsheet
|
50
50
|
*/
|
51
51
|
disableSubmit?: boolean;
|
52
|
+
/**
|
53
|
+
* Configuration options for customizing the behavior of the experimentalSecondary submit button.
|
54
|
+
*/
|
55
|
+
experimentalSecondarySubmit?: ExperimentalSecondarySubmit;
|
52
56
|
/**
|
53
57
|
* This prop is used to help track dynamic steps. If this value is `false` then the step is not included in the visible steps or the ProgressIndicator
|
54
58
|
* steps. If this value is `true` then the step will be included in the list of visible steps, as well as being included in the ProgressIndicator step list
|
@@ -91,5 +95,19 @@ interface CreateTearsheetStepBaseProps extends PropsWithChildren {
|
|
91
95
|
title: React.ReactNode;
|
92
96
|
}
|
93
97
|
type CreateTearsheetStepProps = CreateTearsheetStepBaseProps & fieldsetLegendTextProps;
|
98
|
+
/**
|
99
|
+
* Configuration options for customizing the behavior of the experimentalSecondary submit button.
|
100
|
+
*
|
101
|
+
* @property {string} [labelText] - Optional text to replace the default button text.
|
102
|
+
* @property {boolean} [disabled] - If true, the button will be disabled and not clickable.
|
103
|
+
* @property {boolean} [hideSecondarySubmit] - If true, the button will be hidden from view.
|
104
|
+
* @property {() => void} [onClick] - Optional click handler function to be executed when the button is clicked.
|
105
|
+
*/
|
106
|
+
export type ExperimentalSecondarySubmit = {
|
107
|
+
labelText?: string;
|
108
|
+
disabled?: boolean;
|
109
|
+
hideSecondarySubmit?: boolean;
|
110
|
+
onClick?: () => void;
|
111
|
+
};
|
94
112
|
export declare let CreateTearsheetStep: React.ForwardRefExoticComponent<CreateTearsheetStepProps & React.RefAttributes<unknown>>;
|
95
113
|
export {};
|
@@ -25,7 +25,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
25
25
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
26
26
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
27
27
|
|
28
|
-
var _excluded = ["children", "className", "description", "disableSubmit", "fieldsetLegendText", "hasFieldset", "includeStep", "introStep", "invalid", "onMount", "onNext", "onPrevious", "secondaryLabel", "subtitle", "title"];
|
28
|
+
var _excluded = ["children", "className", "description", "disableSubmit", "experimentalSecondarySubmit", "fieldsetLegendText", "hasFieldset", "includeStep", "introStep", "invalid", "onMount", "onNext", "onPrevious", "secondaryLabel", "subtitle", "title"];
|
29
29
|
var componentName = 'CreateTearsheetStep';
|
30
30
|
var blockClass = "".concat(settings.pkg.prefix, "--tearsheet-create__step");
|
31
31
|
|
@@ -34,11 +34,22 @@ var defaults = {
|
|
34
34
|
hasFieldset: true,
|
35
35
|
includeStep: true
|
36
36
|
};
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Configuration options for customizing the behavior of the experimentalSecondary submit button.
|
40
|
+
*
|
41
|
+
* @property {string} [labelText] - Optional text to replace the default button text.
|
42
|
+
* @property {boolean} [disabled] - If true, the button will be disabled and not clickable.
|
43
|
+
* @property {boolean} [hideSecondarySubmit] - If true, the button will be hidden from view.
|
44
|
+
* @property {() => void} [onClick] - Optional click handler function to be executed when the button is clicked.
|
45
|
+
*/
|
46
|
+
|
37
47
|
exports.CreateTearsheetStep = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
38
48
|
var children = _ref.children,
|
39
49
|
className = _ref.className,
|
40
50
|
description = _ref.description,
|
41
51
|
disableSubmit = _ref.disableSubmit,
|
52
|
+
experimentalSecondarySubmit = _ref.experimentalSecondarySubmit,
|
42
53
|
fieldsetLegendText = _ref.fieldsetLegendText,
|
43
54
|
_ref$hasFieldset = _ref.hasFieldset,
|
44
55
|
hasFieldset = _ref$hasFieldset === void 0 ? defaults.hasFieldset : _ref$hasFieldset,
|
@@ -80,8 +91,9 @@ exports.CreateTearsheetStep = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
80
91
|
React.useEffect(function () {
|
81
92
|
if (stepNumber === (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep) && (previousState === null || previousState === void 0 ? void 0 : previousState.currentStep) !== (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)) {
|
82
93
|
stepsContext === null || stepsContext === void 0 || stepsContext.setOnMount(onMount);
|
94
|
+
stepsContext === null || stepsContext === void 0 || stepsContext.setExperimentalSecondarySubmit(_rollupPluginBabelHelpers.objectSpread2({}, experimentalSecondarySubmit));
|
83
95
|
}
|
84
|
-
}, [onMount, stepsContext, stepNumber, previousState === null || previousState === void 0 ? void 0 : previousState.currentStep]);
|
96
|
+
}, [onMount, experimentalSecondarySubmit, stepsContext, stepNumber, previousState === null || previousState === void 0 ? void 0 : previousState.currentStep]);
|
85
97
|
|
86
98
|
// Used to take the `includeStep` prop and use it as a local state value
|
87
99
|
React.useEffect(function () {
|
@@ -172,6 +184,21 @@ exports.CreateTearsheetStep.propTypes = {
|
|
172
184
|
* This will conditionally disable the submit button in the multi step Tearsheet
|
173
185
|
*/
|
174
186
|
disableSubmit: index["default"].bool,
|
187
|
+
/**
|
188
|
+
* Configuration options for customizing the behavior of the experimentalSecondary submit button.
|
189
|
+
*
|
190
|
+
* @property {string} [labelText] - Optional text to replace the default button text.
|
191
|
+
* @property {boolean} [disabled] - If true, the button will be disabled and not clickable.
|
192
|
+
* @property {boolean} [hideSecondarySubmit] - If true, the button will be hidden from view.
|
193
|
+
* @property {() => void} [onClick] - Optional click handler function to be executed when the button is clicked.
|
194
|
+
*/
|
195
|
+
/**@ts-ignore*/
|
196
|
+
experimentalSecondarySubmit: index["default"].shape({
|
197
|
+
labelText: index["default"].string,
|
198
|
+
disabled: index["default"].bool,
|
199
|
+
hideSecondarySubmit: index["default"].bool,
|
200
|
+
onClick: index["default"].func
|
201
|
+
}),
|
175
202
|
/**
|
176
203
|
* This is the required legend text that appears above a fieldset html element for accessibility purposes.
|
177
204
|
* You can set the `hasFieldset` prop to false if you have multiple fieldset elements or want to control the children of your Full Page's step content.
|
@@ -58,6 +58,10 @@ export interface TagSetProps extends PropsWithChildren {
|
|
58
58
|
* overflowAlign from the standard tooltip. Default center.
|
59
59
|
*/
|
60
60
|
overflowAlign?: OverflowAlign;
|
61
|
+
/**
|
62
|
+
* Will auto-align the popover on first render if it is not visible. This prop is currently experimental and is subject to future changes.
|
63
|
+
*/
|
64
|
+
overflowAutoAlign?: boolean;
|
61
65
|
/**
|
62
66
|
* overflowClassName for the tooltip popup
|
63
67
|
*/
|
@@ -26,7 +26,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
26
26
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
27
27
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
28
28
|
|
29
|
-
var _excluded = ["align", "allTagsModalTarget", "className", "maxVisible", "multiline", "overflowAlign", "overflowClassName", "overflowType", "allTagsModalTitle", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "showAllTagsLabel", "tags", "containingElementRef", "measurementOffset", "onOverflowTagChange"],
|
29
|
+
var _excluded = ["align", "allTagsModalTarget", "className", "maxVisible", "multiline", "overflowAutoAlign", "overflowAlign", "overflowClassName", "overflowType", "allTagsModalTitle", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "showAllTagsLabel", "tags", "containingElementRef", "measurementOffset", "onOverflowTagChange"],
|
30
30
|
_excluded2 = ["label", "id"],
|
31
31
|
_excluded3 = ["label", "onClose"];
|
32
32
|
var componentName = 'TagSet';
|
@@ -48,6 +48,7 @@ exports.TagSet = /*#__PURE__*/React__default["default"].forwardRef(function (_re
|
|
48
48
|
className = _ref.className,
|
49
49
|
maxVisible = _ref.maxVisible,
|
50
50
|
multiline = _ref.multiline,
|
51
|
+
overflowAutoAlign = _ref.overflowAutoAlign,
|
51
52
|
_ref$overflowAlign = _ref.overflowAlign,
|
52
53
|
overflowAlign = _ref$overflowAlign === void 0 ? 'bottom' : _ref$overflowAlign,
|
53
54
|
overflowClassName = _ref.overflowClassName,
|
@@ -154,6 +155,7 @@ exports.TagSet = /*#__PURE__*/React__default["default"].forwardRef(function (_re
|
|
154
155
|
});
|
155
156
|
newDisplayedTags.push( /*#__PURE__*/React__default["default"].createElement(TagSetOverflow.TagSetOverflow, {
|
156
157
|
allTagsModalSearchThreshold: allTagsModalSearchThreshold,
|
158
|
+
overflowAutoAlign: overflowAutoAlign,
|
157
159
|
className: overflowClassName,
|
158
160
|
onShowAllClick: handleShowAllClick,
|
159
161
|
overflowTags: newOverflowTags,
|
@@ -167,7 +169,7 @@ exports.TagSet = /*#__PURE__*/React__default["default"].forwardRef(function (_re
|
|
167
169
|
}));
|
168
170
|
onOverflowTagChange === null || onOverflowTagChange === void 0 || onOverflowTagChange(newOverflowTags);
|
169
171
|
setDisplayedTags(newDisplayedTags);
|
170
|
-
}, [displayCount, overflowAlign, overflowClassName, overflowType, showAllTagsLabel, tags, onOverflowTagChange, popoverOpen, handleTagOnClose]);
|
172
|
+
}, [displayCount, overflowAlign, overflowClassName, overflowType, showAllTagsLabel, tags, onOverflowTagChange, popoverOpen, handleTagOnClose, overflowAutoAlign]);
|
171
173
|
var checkFullyVisibleTags = React.useCallback(function () {
|
172
174
|
if (multiline) {
|
173
175
|
return setDisplayCount(maxVisible || 3);
|
@@ -330,6 +332,10 @@ exports.TagSet.propTypes = {
|
|
330
332
|
* overflowAlign from the standard tooltip. Default center.
|
331
333
|
*/
|
332
334
|
overflowAlign: index["default"].oneOf(['top', 'top-left', 'top-right', 'bottom', 'bottom-left', 'bottom-right', 'left', 'left-bottom', 'left-top', 'right', 'right-bottom', 'right-top']),
|
335
|
+
/**
|
336
|
+
* Will auto-align the popover on first render if it is not visible. This prop is currently experimental and is subject to future changes.
|
337
|
+
*/
|
338
|
+
overflowAutoAlign: index["default"].bool,
|
333
339
|
/**
|
334
340
|
* overflowClassName for the tooltip popup
|
335
341
|
*/
|
@@ -26,6 +26,10 @@ interface TagSetOverflowProps {
|
|
26
26
|
* Type of rendering displayed inside of the tag overflow component
|
27
27
|
*/
|
28
28
|
overflowType?: OverflowType;
|
29
|
+
/**
|
30
|
+
* Will auto-align the popover on first render if it is not visible. This prop is currently experimental and is subject to future changes.
|
31
|
+
*/
|
32
|
+
overflowAutoAlign?: boolean;
|
29
33
|
/**
|
30
34
|
* Open state of the popover
|
31
35
|
*/
|
@@ -22,7 +22,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
22
22
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
23
23
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
24
24
|
|
25
|
-
var _excluded = ["allTagsModalSearchThreshold", "className", "onShowAllClick", "overflowAlign", "overflowTags", "overflowType", "showAllTagsLabel", "popoverOpen", "setPopoverOpen"];
|
25
|
+
var _excluded = ["allTagsModalSearchThreshold", "className", "onShowAllClick", "overflowAlign", "overflowAutoAlign", "overflowTags", "overflowType", "showAllTagsLabel", "popoverOpen", "setPopoverOpen"];
|
26
26
|
var componentName = 'TagSetOverflow';
|
27
27
|
var blockClass = "".concat(settings.pkg.prefix, "--tag-set-overflow");
|
28
28
|
|
@@ -37,6 +37,7 @@ var TagSetOverflow = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
37
37
|
onShowAllClick = _ref.onShowAllClick,
|
38
38
|
_ref$overflowAlign = _ref.overflowAlign,
|
39
39
|
overflowAlign = _ref$overflowAlign === void 0 ? 'bottom' : _ref$overflowAlign,
|
40
|
+
overflowAutoAlign = _ref.overflowAutoAlign,
|
40
41
|
overflowTags = _ref.overflowTags,
|
41
42
|
overflowType = _ref.overflowType,
|
42
43
|
showAllTagsLabel = _ref.showAllTagsLabel,
|
@@ -72,7 +73,8 @@ var TagSetOverflow = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
72
73
|
dropShadow: true,
|
73
74
|
highContrast: true,
|
74
75
|
onKeyDown: handleEscKeyPress,
|
75
|
-
open: popoverOpen
|
76
|
+
open: popoverOpen,
|
77
|
+
autoAlign: overflowAutoAlign
|
76
78
|
}, /*#__PURE__*/React__default["default"].createElement(react.Tag, {
|
77
79
|
onClick: function onClick() {
|
78
80
|
return setPopoverOpen === null || setPopoverOpen === void 0 ? void 0 : setPopoverOpen(!popoverOpen);
|
@@ -124,6 +126,10 @@ TagSetOverflow.propTypes = {
|
|
124
126
|
* overflowAlign from the standard tooltip
|
125
127
|
*/
|
126
128
|
overflowAlign: index["default"].oneOf(['top', 'top-left', 'top-right', 'bottom', 'bottom-left', 'bottom-right', 'left', 'left-bottom', 'left-top', 'right', 'right-bottom', 'right-top']),
|
129
|
+
/**
|
130
|
+
* Will auto-align the popover on first render if it is not visible. This prop is currently experimental and is subject to future changes.
|
131
|
+
*/
|
132
|
+
overflowAutoAlign: index["default"].bool,
|
127
133
|
/**
|
128
134
|
* tags shown in overflow
|
129
135
|
*/
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export function useCreateComponentStepChange({ firstIncludedStep, lastIncludedStep, stepData, onPrevious, onNext, isSubmitDisabled, setCurrentStep, setIsSubmitting, setLoadingPrevious, loadingPrevious, onClose, onRequestSubmit, componentName, currentStep, backButtonText, cancelButtonText, submitButtonText, nextButtonText, isSubmitting, componentBlockClass, setCreateComponentActions, setModalIsOpen, }: {
|
1
|
+
export function useCreateComponentStepChange({ firstIncludedStep, lastIncludedStep, stepData, onPrevious, onNext, isSubmitDisabled, setCurrentStep, setIsSubmitting, setLoadingPrevious, loadingPrevious, onClose, onRequestSubmit, componentName, currentStep, backButtonText, cancelButtonText, submitButtonText, nextButtonText, isSubmitting, componentBlockClass, setCreateComponentActions, setModalIsOpen, experimentalSecondarySubmit, experimentalSecondarySubmitText, }: {
|
2
2
|
firstIncludedStep: any;
|
3
3
|
lastIncludedStep: any;
|
4
4
|
stepData: any;
|
@@ -21,4 +21,6 @@ export function useCreateComponentStepChange({ firstIncludedStep, lastIncludedSt
|
|
21
21
|
componentBlockClass: any;
|
22
22
|
setCreateComponentActions: any;
|
23
23
|
setModalIsOpen: any;
|
24
|
+
experimentalSecondarySubmit: any;
|
25
|
+
experimentalSecondarySubmitText: any;
|
24
26
|
}): void;
|
@@ -36,7 +36,9 @@ var useCreateComponentStepChange = function useCreateComponentStepChange(_ref) {
|
|
36
36
|
isSubmitting = _ref.isSubmitting,
|
37
37
|
componentBlockClass = _ref.componentBlockClass,
|
38
38
|
setCreateComponentActions = _ref.setCreateComponentActions,
|
39
|
-
setModalIsOpen = _ref.setModalIsOpen
|
39
|
+
setModalIsOpen = _ref.setModalIsOpen,
|
40
|
+
experimentalSecondarySubmit = _ref.experimentalSecondarySubmit,
|
41
|
+
experimentalSecondarySubmitText = _ref.experimentalSecondarySubmitText;
|
40
42
|
var continueToNextStep = React.useCallback(function () {
|
41
43
|
setIsSubmitting(false);
|
42
44
|
setCurrentStep(function (prev) {
|
@@ -216,6 +218,11 @@ var useCreateComponentStepChange = function useCreateComponentStepChange(_ref) {
|
|
216
218
|
return _ref5.apply(this, arguments);
|
217
219
|
};
|
218
220
|
}();
|
221
|
+
var handleExperimentalSecondarySubmit = function handleExperimentalSecondarySubmit() {
|
222
|
+
if (typeof (experimentalSecondarySubmit === null || experimentalSecondarySubmit === void 0 ? void 0 : experimentalSecondarySubmit.onClick) === 'function') {
|
223
|
+
experimentalSecondarySubmit.onClick();
|
224
|
+
}
|
225
|
+
};
|
219
226
|
if ((stepData === null || stepData === void 0 ? void 0 : stepData.length) > 0) {
|
220
227
|
var buttons = [];
|
221
228
|
if ((stepData === null || stepData === void 0 ? void 0 : stepData.length) > 1) {
|
@@ -236,6 +243,15 @@ var useCreateComponentStepChange = function useCreateComponentStepChange(_ref) {
|
|
236
243
|
} : onUnmount,
|
237
244
|
kind: 'ghost'
|
238
245
|
});
|
246
|
+
if (experimentalSecondarySubmitText && !(experimentalSecondarySubmit !== null && experimentalSecondarySubmit !== void 0 && experimentalSecondarySubmit.hideSecondarySubmit)) {
|
247
|
+
buttons.push({
|
248
|
+
key: 'create-action-button-experimentalSecondarySubmit',
|
249
|
+
label: experimentalSecondarySubmitText,
|
250
|
+
onClick: handleExperimentalSecondarySubmit,
|
251
|
+
kind: 'secondary',
|
252
|
+
disabled: experimentalSecondarySubmit === null || experimentalSecondarySubmit === void 0 ? void 0 : experimentalSecondarySubmit.disabled
|
253
|
+
});
|
254
|
+
}
|
239
255
|
buttons.push({
|
240
256
|
key: 'create-action-button-submit',
|
241
257
|
label: currentStep < lastIncludedStep ? nextButtonText : submitButtonText,
|
@@ -247,7 +263,7 @@ var useCreateComponentStepChange = function useCreateComponentStepChange(_ref) {
|
|
247
263
|
});
|
248
264
|
setCreateComponentActions(buttons);
|
249
265
|
}
|
250
|
-
}, [firstIncludedStep, lastIncludedStep, stepData, onNext, isSubmitDisabled, backButtonText, cancelButtonText, currentStep, onClose, nextButtonText, submitButtonText, onRequestSubmit, isSubmitting, componentBlockClass, componentName, continueToNextStep, setCurrentStep, setCreateComponentActions, setIsSubmitting, setModalIsOpen, moveToPreviousStep, onPrevious, setLoadingPrevious, loadingPrevious]);
|
266
|
+
}, [firstIncludedStep, lastIncludedStep, stepData, onNext, isSubmitDisabled, backButtonText, cancelButtonText, currentStep, onClose, nextButtonText, submitButtonText, onRequestSubmit, isSubmitting, componentBlockClass, componentName, continueToNextStep, setCurrentStep, setCreateComponentActions, setIsSubmitting, setModalIsOpen, moveToPreviousStep, onPrevious, setLoadingPrevious, loadingPrevious, experimentalSecondarySubmit, experimentalSecondarySubmitText]);
|
251
267
|
};
|
252
268
|
|
253
269
|
exports.useCreateComponentStepChange = useCreateComponentStepChange;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@carbon/ibm-products",
|
3
3
|
"description": "Carbon for IBM Products",
|
4
|
-
"version": "2.43.2-canary.
|
4
|
+
"version": "2.43.2-canary.211+d5f953890",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -120,5 +120,5 @@
|
|
120
120
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0",
|
121
121
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
|
122
122
|
},
|
123
|
-
"gitHead": "
|
123
|
+
"gitHead": "d5f9538902233075e38a60abf70efc52838f5804"
|
124
124
|
}
|