@patternfly/react-core 4.248.0 → 4.250.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/esm/components/Icon/Icon.d.ts +25 -0
- package/dist/esm/components/Icon/Icon.d.ts.map +1 -0
- package/dist/esm/components/Icon/Icon.js +14 -0
- package/dist/esm/components/Icon/Icon.js.map +1 -0
- package/dist/esm/components/Icon/index.d.ts +2 -0
- package/dist/esm/components/Icon/index.d.ts.map +1 -0
- package/dist/esm/components/Icon/index.js +2 -0
- package/dist/esm/components/Icon/index.js.map +1 -0
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/next/components/Select/Select.d.ts +28 -0
- package/dist/esm/next/components/Select/Select.d.ts.map +1 -0
- package/dist/esm/next/components/Select/Select.js +62 -0
- package/dist/esm/next/components/Select/Select.js.map +1 -0
- package/dist/esm/next/components/Select/SelectGroup.d.ts +12 -0
- package/dist/esm/next/components/Select/SelectGroup.d.ts.map +1 -0
- package/dist/esm/next/components/Select/SelectGroup.js +10 -0
- package/dist/esm/next/components/Select/SelectGroup.js.map +1 -0
- package/dist/esm/next/components/Select/SelectList.d.ts +10 -0
- package/dist/esm/next/components/Select/SelectList.d.ts.map +1 -0
- package/dist/esm/next/components/Select/SelectList.js +10 -0
- package/dist/esm/next/components/Select/SelectList.js.map +1 -0
- package/dist/esm/next/components/Select/SelectOption.d.ts +20 -0
- package/dist/esm/next/components/Select/SelectOption.d.ts.map +1 -0
- package/dist/esm/next/components/Select/SelectOption.js +10 -0
- package/dist/esm/next/components/Select/SelectOption.js.map +1 -0
- package/dist/esm/next/components/Select/index.d.ts +5 -0
- package/dist/esm/next/components/Select/index.d.ts.map +1 -0
- package/dist/esm/next/components/Select/index.js +5 -0
- package/dist/esm/next/components/Select/index.js.map +1 -0
- package/dist/esm/next/components/Wizard/Wizard.d.ts +9 -7
- package/dist/esm/next/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/Wizard.js +62 -48
- package/dist/esm/next/components/Wizard/Wizard.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardBody.d.ts +2 -2
- package/dist/esm/next/components/Wizard/WizardBody.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardBody.js +1 -1
- package/dist/esm/next/components/Wizard/WizardBody.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardContext.d.ts +21 -20
- package/dist/esm/next/components/Wizard/WizardContext.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardContext.js +63 -32
- package/dist/esm/next/components/Wizard/WizardContext.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardFooter.d.ts +20 -6
- package/dist/esm/next/components/Wizard/WizardFooter.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardFooter.js +13 -4
- package/dist/esm/next/components/Wizard/WizardFooter.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardHeader.d.ts +1 -1
- package/dist/esm/next/components/Wizard/WizardHeader.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardHeader.js +2 -2
- package/dist/esm/next/components/Wizard/WizardHeader.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardNav.d.ts +5 -5
- package/dist/esm/next/components/Wizard/WizardNav.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardNav.js +3 -4
- package/dist/esm/next/components/Wizard/WizardNav.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardNavInternal.d.ts +14 -0
- package/dist/esm/next/components/Wizard/WizardNavInternal.d.ts.map +1 -0
- package/dist/esm/next/components/Wizard/WizardNavInternal.js +49 -0
- package/dist/esm/next/components/Wizard/WizardNavInternal.js.map +1 -0
- package/dist/esm/next/components/Wizard/WizardNavItem.d.ts +12 -8
- package/dist/esm/next/components/Wizard/WizardNavItem.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardNavItem.js +23 -12
- package/dist/esm/next/components/Wizard/WizardNavItem.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardStep.d.ts +22 -6
- package/dist/esm/next/components/Wizard/WizardStep.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardStep.js +20 -1
- package/dist/esm/next/components/Wizard/WizardStep.js.map +1 -1
- package/dist/esm/next/components/Wizard/WizardToggle.d.ts +9 -15
- package/dist/esm/next/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/WizardToggle.js +15 -50
- package/dist/esm/next/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.d.ts +2 -2
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.js +3 -3
- package/dist/esm/next/components/Wizard/hooks/useWizardFooter.js.map +1 -1
- package/dist/esm/next/components/Wizard/types.d.ts +37 -46
- package/dist/esm/next/components/Wizard/types.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/types.js +10 -2
- package/dist/esm/next/components/Wizard/types.js.map +1 -1
- package/dist/esm/next/components/Wizard/utils.d.ts +4 -5
- package/dist/esm/next/components/Wizard/utils.d.ts.map +1 -1
- package/dist/esm/next/components/Wizard/utils.js +20 -13
- package/dist/esm/next/components/Wizard/utils.js.map +1 -1
- package/dist/esm/next/components/index.d.ts +2 -1
- package/dist/esm/next/components/index.d.ts.map +1 -1
- package/dist/esm/next/components/index.js +2 -1
- package/dist/esm/next/components/index.js.map +1 -1
- package/dist/js/components/Icon/Icon.d.ts +25 -0
- package/dist/js/components/Icon/Icon.d.ts.map +1 -0
- package/dist/js/components/Icon/Icon.js +18 -0
- package/dist/js/components/Icon/Icon.js.map +1 -0
- package/dist/js/components/Icon/index.d.ts +2 -0
- package/dist/js/components/Icon/index.d.ts.map +1 -0
- package/dist/js/components/Icon/index.js +5 -0
- package/dist/js/components/Icon/index.js.map +1 -0
- package/dist/js/components/index.d.ts +1 -0
- package/dist/js/components/index.d.ts.map +1 -1
- package/dist/js/components/index.js +1 -0
- package/dist/js/components/index.js.map +1 -1
- package/dist/js/next/components/Select/Select.d.ts +28 -0
- package/dist/js/next/components/Select/Select.d.ts.map +1 -0
- package/dist/js/next/components/Select/Select.js +65 -0
- package/dist/js/next/components/Select/Select.js.map +1 -0
- package/dist/js/next/components/Select/SelectGroup.d.ts +12 -0
- package/dist/js/next/components/Select/SelectGroup.d.ts.map +1 -0
- package/dist/js/next/components/Select/SelectGroup.js +14 -0
- package/dist/js/next/components/Select/SelectGroup.js.map +1 -0
- package/dist/js/next/components/Select/SelectList.d.ts +10 -0
- package/dist/js/next/components/Select/SelectList.d.ts.map +1 -0
- package/dist/js/next/components/Select/SelectList.js +14 -0
- package/dist/js/next/components/Select/SelectList.js.map +1 -0
- package/dist/js/next/components/Select/SelectOption.d.ts +20 -0
- package/dist/js/next/components/Select/SelectOption.d.ts.map +1 -0
- package/dist/js/next/components/Select/SelectOption.js +14 -0
- package/dist/js/next/components/Select/SelectOption.js.map +1 -0
- package/dist/js/next/components/Select/index.d.ts +5 -0
- package/dist/js/next/components/Select/index.d.ts.map +1 -0
- package/dist/js/next/components/Select/index.js +8 -0
- package/dist/js/next/components/Select/index.js.map +1 -0
- package/dist/js/next/components/Wizard/Wizard.d.ts +9 -7
- package/dist/js/next/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/Wizard.js +59 -45
- package/dist/js/next/components/Wizard/Wizard.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardBody.d.ts +2 -2
- package/dist/js/next/components/Wizard/WizardBody.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardBody.js +1 -1
- package/dist/js/next/components/Wizard/WizardBody.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardContext.d.ts +21 -20
- package/dist/js/next/components/Wizard/WizardContext.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardContext.js +61 -30
- package/dist/js/next/components/Wizard/WizardContext.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardFooter.d.ts +20 -6
- package/dist/js/next/components/Wizard/WizardFooter.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardFooter.js +15 -6
- package/dist/js/next/components/Wizard/WizardFooter.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardHeader.d.ts +1 -1
- package/dist/js/next/components/Wizard/WizardHeader.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardHeader.js +2 -2
- package/dist/js/next/components/Wizard/WizardHeader.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardNav.d.ts +5 -5
- package/dist/js/next/components/Wizard/WizardNav.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardNav.js +3 -4
- package/dist/js/next/components/Wizard/WizardNav.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardNavInternal.d.ts +14 -0
- package/dist/js/next/components/Wizard/WizardNavInternal.d.ts.map +1 -0
- package/dist/js/next/components/Wizard/WizardNavInternal.js +54 -0
- package/dist/js/next/components/Wizard/WizardNavInternal.js.map +1 -0
- package/dist/js/next/components/Wizard/WizardNavItem.d.ts +12 -8
- package/dist/js/next/components/Wizard/WizardNavItem.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardNavItem.js +23 -12
- package/dist/js/next/components/Wizard/WizardNavItem.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardStep.d.ts +22 -6
- package/dist/js/next/components/Wizard/WizardStep.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardStep.js +20 -1
- package/dist/js/next/components/Wizard/WizardStep.js.map +1 -1
- package/dist/js/next/components/Wizard/WizardToggle.d.ts +9 -15
- package/dist/js/next/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/WizardToggle.js +15 -51
- package/dist/js/next/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.d.ts +2 -2
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.js +3 -3
- package/dist/js/next/components/Wizard/hooks/useWizardFooter.js.map +1 -1
- package/dist/js/next/components/Wizard/types.d.ts +37 -46
- package/dist/js/next/components/Wizard/types.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/types.js +12 -3
- package/dist/js/next/components/Wizard/types.js.map +1 -1
- package/dist/js/next/components/Wizard/utils.d.ts +4 -5
- package/dist/js/next/components/Wizard/utils.d.ts.map +1 -1
- package/dist/js/next/components/Wizard/utils.js +24 -15
- package/dist/js/next/components/Wizard/utils.js.map +1 -1
- package/dist/js/next/components/index.d.ts +2 -1
- package/dist/js/next/components/index.d.ts.map +1 -1
- package/dist/js/next/components/index.js +2 -1
- package/dist/js/next/components/index.js.map +1 -1
- package/dist/umd/react-core.min.css +337 -200
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +2 -2
- package/src/components/Icon/Icon.tsx +66 -0
- package/src/components/Icon/__tests__/Icon.test.tsx +196 -0
- package/src/components/Icon/__tests__/__snapshots__/Icon.test.tsx.snap +82 -0
- package/src/components/Icon/examples/Icon.md +61 -0
- package/src/components/Icon/examples/IconBasic.tsx +23 -0
- package/src/components/Icon/examples/IconContentSizes.tsx +20 -0
- package/src/components/Icon/examples/IconCustomProgress.tsx +24 -0
- package/src/components/Icon/examples/IconInline.tsx +62 -0
- package/src/components/Icon/examples/IconProgress.tsx +24 -0
- package/src/components/Icon/examples/IconSizes.tsx +20 -0
- package/src/components/Icon/examples/IconStatus.tsx +27 -0
- package/src/components/Icon/index.ts +1 -0
- package/src/components/index.ts +1 -0
- package/src/next/components/Select/Select.tsx +129 -0
- package/src/next/components/Select/SelectGroup.tsx +24 -0
- package/src/next/components/Select/SelectList.tsx +21 -0
- package/src/next/components/Select/SelectOption.tsx +31 -0
- package/src/next/components/Select/examples/Select.md +37 -0
- package/src/next/components/Select/examples/SelectBasic.tsx +54 -0
- package/src/next/components/Select/examples/SelectCheckbox.tsx +67 -0
- package/src/next/components/Select/examples/SelectGrouped.tsx +63 -0
- package/src/next/components/Select/examples/SelectMultiTypeahead.tsx +195 -0
- package/src/next/components/Select/examples/SelectTypeahead.tsx +191 -0
- package/src/next/components/Select/index.ts +4 -0
- package/src/next/components/Wizard/Wizard.tsx +107 -64
- package/src/next/components/Wizard/WizardBody.tsx +4 -4
- package/src/next/components/Wizard/WizardContext.tsx +117 -65
- package/src/next/components/Wizard/WizardFooter.tsx +39 -17
- package/src/next/components/Wizard/WizardHeader.tsx +6 -3
- package/src/next/components/Wizard/WizardNav.tsx +9 -10
- package/src/next/components/Wizard/WizardNavInternal.tsx +137 -0
- package/src/next/components/Wizard/WizardNavItem.tsx +47 -20
- package/src/next/components/Wizard/WizardStep.tsx +52 -7
- package/src/next/components/Wizard/WizardToggle.tsx +24 -142
- package/src/next/components/Wizard/__tests__/Wizard.test.tsx +10 -13
- package/src/next/components/Wizard/__tests__/WizardBody.test.tsx +3 -3
- package/src/next/components/Wizard/__tests__/WizardFooter.test.tsx +11 -14
- package/src/next/components/Wizard/__tests__/WizardStep.test.tsx +100 -0
- package/src/next/components/Wizard/__tests__/WizardToggle.test.tsx +4 -4
- package/src/next/components/Wizard/examples/Wizard.md +40 -15
- package/src/next/components/Wizard/examples/WizardBasic.tsx +2 -2
- package/src/next/components/Wizard/examples/WizardCustomNav.tsx +4 -4
- package/src/next/components/Wizard/examples/WizardKitchenSink.tsx +126 -60
- package/src/next/components/Wizard/hooks/__tests__/useWizardFooter.test.tsx +23 -34
- package/src/next/components/Wizard/hooks/useWizardFooter.tsx +5 -5
- package/src/next/components/Wizard/types.tsx +59 -53
- package/src/next/components/Wizard/utils.ts +25 -16
- package/src/next/components/index.ts +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardNavItem.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardNavItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"WizardNavItem.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardNavItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,MAAM,WAAW,kBAAkB;IACjC,kDAAkD;IAClD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,oDAAoD;IACpD,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mDAAmD;IACnD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,GAAG,CAAC;IAC5C,6CAA6C;IAC7C,gBAAgB,CAAC,EAAE,QAAQ,GAAG,GAAG,CAAC;IAClC,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,qCAAqC;IACrC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,iFAAiF;IACjF,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;CAC9B;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CA8FrE,CAAC"}
|
|
@@ -3,8 +3,10 @@ import * as React from 'react';
|
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
4
|
import styles from '@patternfly/react-styles/css/components/Wizard/wizard';
|
|
5
5
|
import AngleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-right-icon';
|
|
6
|
+
import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon';
|
|
7
|
+
import { WizardNavItemStatus } from './types';
|
|
6
8
|
export const WizardNavItem = (_a) => {
|
|
7
|
-
var { children = null, content = '', isCurrent = false, isDisabled = false,
|
|
9
|
+
var { children = null, content = '', isCurrent = false, isDisabled = false, isVisited = false, stepIndex, onNavItemClick = () => undefined, navItemComponent = 'button', href = null, isExpandable = false, id, status = 'default' } = _a, rest = __rest(_a, ["children", "content", "isCurrent", "isDisabled", "isVisited", "stepIndex", "onNavItemClick", "navItemComponent", "href", "isExpandable", "id", "status"]);
|
|
8
10
|
const NavItemComponent = navItemComponent;
|
|
9
11
|
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
10
12
|
React.useEffect(() => {
|
|
@@ -14,22 +16,31 @@ export const WizardNavItem = (_a) => {
|
|
|
14
16
|
// eslint-disable-next-line no-console
|
|
15
17
|
console.error('WizardNavItem: When using an anchor, please provide an href');
|
|
16
18
|
}
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
const ariaLabel = React.useMemo(() => {
|
|
20
|
+
if (status === WizardNavItemStatus.Error || (isVisited && !isCurrent)) {
|
|
21
|
+
let label = content.toString();
|
|
22
|
+
if (status === WizardNavItemStatus.Error) {
|
|
23
|
+
label += `, ${status}`;
|
|
24
|
+
}
|
|
25
|
+
// No need to signify step is visited if current
|
|
26
|
+
if (isVisited && !isCurrent) {
|
|
27
|
+
label += ', visited';
|
|
28
|
+
}
|
|
29
|
+
return label;
|
|
30
|
+
}
|
|
31
|
+
}, [content, isCurrent, isVisited, status]);
|
|
24
32
|
return (React.createElement("li", { className: css(styles.wizardNavItem, isExpandable && styles.modifiers.expandable, isExpandable && isExpanded && styles.modifiers.expanded) },
|
|
25
|
-
React.createElement(NavItemComponent, Object.assign({}, rest, (navItemComponent === 'a' ?
|
|
33
|
+
React.createElement(NavItemComponent, Object.assign({}, rest, (navItemComponent === 'a' ? { tabIndex: isDisabled ? -1 : undefined, href } : { disabled: isDisabled }), (id && { id: id.toString() }), { onClick: e => {
|
|
26
34
|
e.preventDefault();
|
|
27
|
-
isExpandable ? setIsExpanded(!isExpanded || isCurrent) : onNavItemClick(
|
|
28
|
-
}, className: css(styles.wizardNavLink, isCurrent && styles.modifiers.current, isDisabled && styles.modifiers.disabled), "aria-disabled": isDisabled ? true : null, "aria-current": isCurrent && !children ? 'step' : false }, (isExpandable && { 'aria-expanded': isExpanded })), isExpandable ? (React.createElement(React.Fragment, null,
|
|
35
|
+
isExpandable ? setIsExpanded(!isExpanded || isCurrent) : onNavItemClick(stepIndex);
|
|
36
|
+
}, className: css(styles.wizardNavLink, isCurrent && styles.modifiers.current, isDisabled && styles.modifiers.disabled), "aria-disabled": isDisabled ? true : null, "aria-current": isCurrent && !children ? 'step' : false }, (isExpandable && { 'aria-expanded': isExpanded }), (ariaLabel && { 'aria-label': ariaLabel })), isExpandable ? (React.createElement(React.Fragment, null,
|
|
29
37
|
React.createElement("span", { className: css(styles.wizardNavLinkText) }, content),
|
|
30
38
|
React.createElement("span", { className: css(styles.wizardNavLinkToggle) },
|
|
31
39
|
React.createElement("span", { className: css(styles.wizardNavLinkToggleIcon) },
|
|
32
|
-
React.createElement(AngleRightIcon, null))))) : (
|
|
40
|
+
React.createElement(AngleRightIcon, null))))) : (React.createElement(React.Fragment, null,
|
|
41
|
+
content,
|
|
42
|
+
status === WizardNavItemStatus.Error && (React.createElement("span", { style: { marginLeft: 'var(--pf-global--spacer--sm)' } },
|
|
43
|
+
React.createElement(ExclamationCircleIcon, { color: "var(--pf-global--danger-color--100)" })))))),
|
|
33
44
|
children));
|
|
34
45
|
};
|
|
35
46
|
WizardNavItem.displayName = 'WizardNavItem';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardNavItem.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardNavItem.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK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AG,CACZ,MAAM,CAAC,aAAa,EACpB,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,OAAO,EACrC,UAAU,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CACxC,mBACc,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,kBACzB,SAAS,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,IACjD,CAAC,YAAY,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,CAAC,EACjD,CAAC,SAAS,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,GAE7C,YAAY,CAAC,CAAC,CAAC,CACd;YACE,8BAAM,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAG,OAAO,CAAQ;YAChE,8BAAM,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC;gBAC9C,8BAAM,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,uBAAuB,CAAC;oBAClD,oBAAC,cAAc,OAAG,CACb,CACF,CACN,CACJ,CAAC,CAAC,CAAC,CACF;YACG,OAAO;YAEP,MAAM,KAAK,mBAAmB,CAAC,KAAK,IAAI,CACvC,8BAAM,KAAK,EAAE,EAAE,UAAU,EAAE,8BAA8B,EAAE;gBACzD,oBAAC,qBAAqB,IAAC,KAAK,EAAC,qCAAqC,GAAG,CAChE,CACR,CACA,CACJ,CACgB;QAClB,QAAQ,CACN,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC"}
|
|
@@ -1,20 +1,36 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { WizardNavItemType } from './types';
|
|
3
3
|
import { WizardBodyProps } from './WizardBody';
|
|
4
|
+
import { WizardFooterProps } from './WizardFooter';
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
-
* Also acts as a wrapper for content, with an optional inclusion of WizardBody.
|
|
6
|
+
* The primary child component for Wizard. Step props are used for the list of steps managed in context.
|
|
7
7
|
*/
|
|
8
|
-
export interface WizardStepProps
|
|
8
|
+
export interface WizardStepProps {
|
|
9
|
+
/** Name of the step's navigation item */
|
|
10
|
+
name: React.ReactNode;
|
|
11
|
+
/** Unique identifier */
|
|
12
|
+
id: string | number;
|
|
9
13
|
/** Optional for when the step is used as a parent to sub-steps */
|
|
10
14
|
children?: React.ReactNode;
|
|
11
15
|
/** Props for WizardBody that wraps content by default. Can be set to null for exclusion of WizardBody. */
|
|
12
|
-
body?: Omit<WizardBodyProps, 'children'> | null;
|
|
16
|
+
body?: Omit<Omit<WizardBodyProps, 'children'>, 'children'> | null;
|
|
13
17
|
/** Optional list of sub-steps */
|
|
14
18
|
steps?: React.ReactElement<WizardStepProps>[];
|
|
19
|
+
/** Flag to disable the step's navigation item */
|
|
20
|
+
isDisabled?: boolean;
|
|
21
|
+
/** Flag to represent whether the step has been visited (navigated to) */
|
|
22
|
+
isVisited?: boolean;
|
|
23
|
+
/** Flag to determine whether the step is hidden */
|
|
24
|
+
isHidden?: boolean;
|
|
25
|
+
/** Replaces the step's navigation item or its properties. */
|
|
26
|
+
navItem?: WizardNavItemType;
|
|
27
|
+
/** Replaces the step's footer. The step's footer takes precedance over the wizard's footer. */
|
|
28
|
+
footer?: React.ReactElement | Partial<WizardFooterProps>;
|
|
29
|
+
/** Used to determine icon next to the step's navigation item */
|
|
30
|
+
status?: 'default' | 'error';
|
|
15
31
|
}
|
|
16
32
|
export declare const WizardStep: {
|
|
17
|
-
({ body,
|
|
33
|
+
({ children, body, id, footer, isHidden, isDisabled, navItem, status }: WizardStepProps): JSX.Element;
|
|
18
34
|
displayName: string;
|
|
19
35
|
};
|
|
20
36
|
//# sourceMappingURL=WizardStep.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardStep.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardStep.tsx"],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 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WizardBody } from './WizardBody';
|
|
3
|
-
|
|
3
|
+
import { useWizardFooter } from './hooks/useWizardFooter';
|
|
4
|
+
import { useWizardContext } from './WizardContext';
|
|
5
|
+
export const WizardStep = ({ children, body, id, footer, isHidden, isDisabled, navItem, status }) => {
|
|
6
|
+
const { currentStep, setStep, toggleStep } = useWizardContext();
|
|
7
|
+
useWizardFooter(footer, id);
|
|
8
|
+
// Update the controlled step when a change is detected with select properties
|
|
9
|
+
React.useEffect(() => {
|
|
10
|
+
if ((currentStep === null || currentStep === void 0 ? void 0 : currentStep.id) === id && (isDisabled || navItem || status || !(currentStep === null || currentStep === void 0 ? void 0 : currentStep.isVisited))) {
|
|
11
|
+
setStep(Object.assign(Object.assign(Object.assign(Object.assign({ id }, (isDisabled && { isDisabled })), (navItem && { navItem })), (status && { status })), (!(currentStep === null || currentStep === void 0 ? void 0 : currentStep.isVisited) && { isVisited: true })));
|
|
12
|
+
}
|
|
13
|
+
}, [id, setStep, currentStep === null || currentStep === void 0 ? void 0 : currentStep.id, isDisabled, navItem, status, currentStep === null || currentStep === void 0 ? void 0 : currentStep.isVisited]);
|
|
14
|
+
// Toggle visibility when the isHidden flag updates.
|
|
15
|
+
// Wizard's hasUnmountedSteps prop must be set to false for visibility changes to take effect.
|
|
16
|
+
React.useEffect(() => {
|
|
17
|
+
if (isHidden !== undefined) {
|
|
18
|
+
toggleStep(id, isHidden);
|
|
19
|
+
}
|
|
20
|
+
}, [toggleStep, id, isHidden]);
|
|
21
|
+
return body || body === undefined ? React.createElement(WizardBody, Object.assign({}, body), children) : React.createElement(React.Fragment, null, children);
|
|
22
|
+
};
|
|
4
23
|
WizardStep.displayName = 'WizardStep';
|
|
5
24
|
//# sourceMappingURL=WizardStep.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardStep.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardStep.tsx"],"names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ACJ;IACH,CAAC,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,CAAC,CAAC,CAAC;IAExF,oDAAoD;IACpD,8FAA8F;IAC9F,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC1B,UAAU,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;SAC1B;IACH,CAAC,EAAE,CAAC,UAAU,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE/B,OAAO,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,oBAAC,UAAU,oBAAK,IAAI,GAAG,QAAQ,CAAc,CAAC,CAAC,CAAC,0CAAG,QAAQ,CAAI,CAAC;AACtG,CAAC,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC"}
|
|
@@ -1,35 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WizardNavProps } from '../Wizard';
|
|
3
|
-
import { WizardControlStep
|
|
3
|
+
import { WizardControlStep } from './types';
|
|
4
4
|
/**
|
|
5
|
-
* Used to toggle between step content, including the body and footer. This is also where the
|
|
5
|
+
* Used to toggle between step content, including the body and footer. This is also where the navigation and its expandability is controlled.
|
|
6
6
|
*/
|
|
7
7
|
export interface WizardToggleProps {
|
|
8
8
|
/** List of steps and/or sub-steps */
|
|
9
9
|
steps: WizardControlStep[];
|
|
10
|
-
/** The
|
|
11
|
-
|
|
10
|
+
/** The current step */
|
|
11
|
+
currentStep: WizardControlStep;
|
|
12
12
|
/** Wizard footer */
|
|
13
13
|
footer: React.ReactElement;
|
|
14
|
-
/** Wizard
|
|
14
|
+
/** Wizard navigation */
|
|
15
15
|
nav: React.ReactElement<WizardNavProps>;
|
|
16
16
|
/** The expandable dropdown button's aria-label */
|
|
17
17
|
'aria-label'?: string;
|
|
18
18
|
/** Flag to unmount inactive steps instead of hiding. Defaults to true */
|
|
19
|
-
|
|
20
|
-
/** Flag to determine whether the dropdown
|
|
19
|
+
hasUnmountedSteps?: boolean;
|
|
20
|
+
/** Flag to determine whether the dropdown navigation is expanded */
|
|
21
21
|
isNavExpanded?: boolean;
|
|
22
|
-
/** Callback to expand or collapse the dropdown
|
|
22
|
+
/** Callback to expand or collapse the dropdown navigation */
|
|
23
23
|
toggleNavExpanded?: () => void;
|
|
24
24
|
}
|
|
25
25
|
export declare const WizardToggle: {
|
|
26
|
-
({ steps,
|
|
26
|
+
({ steps, currentStep, footer, nav, isNavExpanded, toggleNavExpanded, hasUnmountedSteps, "aria-label": ariaLabel }: WizardToggleProps): JSX.Element;
|
|
27
27
|
displayName: string;
|
|
28
28
|
};
|
|
29
|
-
interface WizardToggleInternalProps extends Pick<WizardToggleProps, 'unmountInactiveSteps'> {
|
|
30
|
-
/** Custom WizardNav or callback used to create a default WizardNav */
|
|
31
|
-
nav?: DefaultWizardNavProps | CustomWizardNavFunction;
|
|
32
|
-
}
|
|
33
|
-
export declare const WizardToggleInternal: ({ nav, unmountInactiveSteps }: WizardToggleInternalProps) => JSX.Element;
|
|
34
|
-
export {};
|
|
35
29
|
//# sourceMappingURL=WizardToggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardToggle.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,
|
|
1
|
+
{"version":3,"file":"WizardToggle.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAmB,MAAM,SAAS,CAAC;AAE7D;;GAEG;AAEH,MAAM,WAAW,iBAAiB;IAChC,qCAAqC;IACrC,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,uBAAuB;IACvB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,oBAAoB;IACpB,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC;IAC3B,wBAAwB;IACxB,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IACxC,kDAAkD;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yEAAyE;IACzE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oEAAoE;IACpE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,6DAA6D;IAC7D,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC;AAED,eAAO,MAAM,YAAY;wHAStB,iBAAiB;;CAwEnB,CAAC"}
|
|
@@ -4,17 +4,17 @@ import styles from '@patternfly/react-styles/css/components/Wizard/wizard';
|
|
|
4
4
|
import AngleRightIcon from '@patternfly/react-icons/dist/esm/icons/angle-right-icon';
|
|
5
5
|
import CaretDownIcon from '@patternfly/react-icons/dist/esm/icons/caret-down-icon';
|
|
6
6
|
import { KeyTypes } from '../../../helpers/constants';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
7
|
+
import { isWizardSubStep } from './types';
|
|
8
|
+
export const WizardToggle = ({ steps, currentStep, footer, nav, isNavExpanded, toggleNavExpanded, hasUnmountedSteps = true, 'aria-label': ariaLabel = 'Wizard toggle' }) => {
|
|
9
|
+
const isActiveSubStep = isWizardSubStep(currentStep);
|
|
10
|
+
const nonSubSteps = steps.filter(step => !isWizardSubStep(step));
|
|
11
|
+
const wizardToggleIndex = nonSubSteps.indexOf(isWizardSubStep(currentStep) ? steps.find(step => step.id === currentStep.parentId) : currentStep) + 1;
|
|
12
12
|
const handleKeyClicks = React.useCallback((event) => {
|
|
13
13
|
if (isNavExpanded && event.key === KeyTypes.Escape) {
|
|
14
14
|
toggleNavExpanded();
|
|
15
15
|
}
|
|
16
16
|
}, [isNavExpanded, toggleNavExpanded]);
|
|
17
|
-
// Open/close collapsable
|
|
17
|
+
// Open/close collapsable navigation on keydown event
|
|
18
18
|
React.useEffect(() => {
|
|
19
19
|
const target = typeof document !== 'undefined' ? document.body : null;
|
|
20
20
|
target === null || target === void 0 ? void 0 : target.addEventListener('keydown', handleKeyClicks, false);
|
|
@@ -22,11 +22,11 @@ export const WizardToggle = ({ steps, activeStep, footer, nav, isNavExpanded, to
|
|
|
22
22
|
target === null || target === void 0 ? void 0 : target.removeEventListener('keydown', handleKeyClicks, false);
|
|
23
23
|
};
|
|
24
24
|
}, [handleKeyClicks]);
|
|
25
|
-
// Only render the
|
|
26
|
-
const bodyContent =
|
|
27
|
-
?
|
|
25
|
+
// Only render the current step when hasUnmountedSteps is true
|
|
26
|
+
const bodyContent = hasUnmountedSteps
|
|
27
|
+
? currentStep === null || currentStep === void 0 ? void 0 : currentStep.component
|
|
28
28
|
: steps.map(step => {
|
|
29
|
-
if ((
|
|
29
|
+
if ((currentStep === null || currentStep === void 0 ? void 0 : currentStep.name) === step.name) {
|
|
30
30
|
return step.component;
|
|
31
31
|
}
|
|
32
32
|
return (React.createElement("div", { key: step.id, style: { display: 'none' } }, step.component));
|
|
@@ -34,10 +34,12 @@ export const WizardToggle = ({ steps, activeStep, footer, nav, isNavExpanded, to
|
|
|
34
34
|
return (React.createElement(React.Fragment, null,
|
|
35
35
|
React.createElement("button", { onClick: toggleNavExpanded, className: css(styles.wizardToggle, isNavExpanded && 'pf-m-expanded'), "aria-label": ariaLabel, "aria-expanded": isNavExpanded },
|
|
36
36
|
React.createElement("span", { className: css(styles.wizardToggleList) },
|
|
37
|
-
React.createElement("span", { className: css(styles.wizardToggleListItem) },
|
|
38
|
-
|
|
37
|
+
React.createElement("span", { className: css(styles.wizardToggleListItem) },
|
|
38
|
+
React.createElement("span", { className: css(styles.wizardToggleNum) }, wizardToggleIndex),
|
|
39
|
+
" ", currentStep === null || currentStep === void 0 ? void 0 :
|
|
40
|
+
currentStep.name,
|
|
39
41
|
isActiveSubStep && React.createElement(AngleRightIcon, { className: css(styles.wizardToggleSeparator), "aria-hidden": "true" })),
|
|
40
|
-
isActiveSubStep && React.createElement("span", { className: css(styles.wizardToggleListItem) },
|
|
42
|
+
isActiveSubStep && React.createElement("span", { className: css(styles.wizardToggleListItem) }, currentStep === null || currentStep === void 0 ? void 0 : currentStep.name)),
|
|
41
43
|
React.createElement("span", { className: css(styles.wizardToggleIcon) },
|
|
42
44
|
React.createElement(CaretDownIcon, { "aria-hidden": "true" }))),
|
|
43
45
|
React.createElement("div", { className: css(styles.wizardOuterWrap) },
|
|
@@ -46,42 +48,5 @@ export const WizardToggle = ({ steps, activeStep, footer, nav, isNavExpanded, to
|
|
|
46
48
|
bodyContent),
|
|
47
49
|
footer)));
|
|
48
50
|
};
|
|
49
|
-
export const WizardToggleInternal = ({ nav, unmountInactiveSteps }) => {
|
|
50
|
-
const [isNavExpanded, setIsNavExpanded] = React.useState(false);
|
|
51
|
-
const { activeStep, steps, footer, goToStepByIndex } = useWizardContext();
|
|
52
|
-
const wizardNav = React.useMemo(() => {
|
|
53
|
-
if (isCustomWizardNav(nav)) {
|
|
54
|
-
return nav(isNavExpanded, steps, activeStep, goToStepByIndex);
|
|
55
|
-
}
|
|
56
|
-
const navProps = Object.assign({ isExpanded: isNavExpanded, 'aria-label': (nav === null || nav === void 0 ? void 0 : nav.ariaLabel) || 'Wizard nav' }, ((nav === null || nav === void 0 ? void 0 : nav.ariaLabelledBy) && { 'aria-labelledby': nav === null || nav === void 0 ? void 0 : nav.ariaLabelledBy }));
|
|
57
|
-
return (React.createElement(WizardNav, Object.assign({}, navProps), steps.map((step, index) => {
|
|
58
|
-
var _a;
|
|
59
|
-
const stepIndex = index + 1;
|
|
60
|
-
const stepNavItem = step.navItem && React.createElement(React.Fragment, { key: step.id }, step.navItem);
|
|
61
|
-
if (isWizardParentStep(step)) {
|
|
62
|
-
let firstSubStepIndex;
|
|
63
|
-
let hasActiveChild = false;
|
|
64
|
-
const subNavItems = (_a = step.subStepIds) === null || _a === void 0 ? void 0 : _a.map((subStepId, index) => {
|
|
65
|
-
const subStep = steps.find(step => step.id === subStepId);
|
|
66
|
-
const subStepIndex = steps.indexOf(subStep) + 1;
|
|
67
|
-
if (index === 0) {
|
|
68
|
-
firstSubStepIndex = subStepIndex;
|
|
69
|
-
}
|
|
70
|
-
if ((activeStep === null || activeStep === void 0 ? void 0 : activeStep.id) === subStep.id) {
|
|
71
|
-
hasActiveChild = true;
|
|
72
|
-
}
|
|
73
|
-
return subStep.navItem ? (React.createElement(React.Fragment, { key: subStep.id }, subStep.navItem)) : (React.createElement(WizardNavItem, { key: subStep.id, id: subStep.id, content: subStep.name, isCurrent: (activeStep === null || activeStep === void 0 ? void 0 : activeStep.id) === subStep.id, isDisabled: subStep.isDisabled || ((nav === null || nav === void 0 ? void 0 : nav.forceStepVisit) && !subStep.visited), step: subStepIndex, onNavItemClick: goToStepByIndex }));
|
|
74
|
-
});
|
|
75
|
-
const hasEnabledChildren = React.Children.toArray(subNavItems).some(child => React.isValidElement(child) && !child.props.isDisabled);
|
|
76
|
-
return (stepNavItem || (React.createElement(WizardNavItem, { key: step.id, id: step.id, content: step.name, isExpandable: nav === null || nav === void 0 ? void 0 : nav.isExpandable, isCurrent: hasActiveChild, isDisabled: !hasEnabledChildren, step: firstSubStepIndex, onNavItemClick: goToStepByIndex },
|
|
77
|
-
React.createElement(WizardNav, Object.assign({}, navProps, { returnList: true }), subNavItems))));
|
|
78
|
-
}
|
|
79
|
-
if (isWizardBasicStep(step)) {
|
|
80
|
-
return (stepNavItem || (React.createElement(WizardNavItem, { key: step.id, id: step.id, content: step.name, isCurrent: (activeStep === null || activeStep === void 0 ? void 0 : activeStep.id) === step.id, isDisabled: step.isDisabled || ((nav === null || nav === void 0 ? void 0 : nav.forceStepVisit) && !step.visited), step: stepIndex, onNavItemClick: goToStepByIndex })));
|
|
81
|
-
}
|
|
82
|
-
})));
|
|
83
|
-
}, [activeStep, goToStepByIndex, isNavExpanded, nav, steps]);
|
|
84
|
-
return (React.createElement(WizardToggle, { nav: wizardNav, footer: footer, steps: steps, activeStep: activeStep, isNavExpanded: isNavExpanded, toggleNavExpanded: () => setIsNavExpanded(prevIsExpanded => !prevIsExpanded), unmountInactiveSteps: unmountInactiveSteps }));
|
|
85
|
-
};
|
|
86
51
|
WizardToggle.displayName = 'WizardToggle';
|
|
87
52
|
//# sourceMappingURL=WizardToggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardToggle.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,MAAM,MAAM,uDAAuD,CAAC;AAC3E,OAAO,cAAc,MAAM,yDAAyD,CAAC;AACrF,OAAO,aAAa,MAAM,wDAAwD,CAAC;AAEnF,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"WizardToggle.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/WizardToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,MAAM,MAAM,uDAAuD,CAAC;AAC3E,OAAO,cAAc,MAAM,yDAAyD,CAAC;AACrF,OAAO,aAAa,MAAM,wDAAwD,CAAC;AAEnF,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAqB,eAAe,EAAE,MAAM,SAAS,CAAC;AAyB7D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,KA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C3C,oBAAC,aAAa,mBAAa,MAAM,GAAG,CAC/B,CACA;QACT,6BAAK,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC;YACzC,6BAAK,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC;gBACxC,GAAG;gBACH,WAAW,CACR;YAEL,MAAM,CACH,CACL,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { WizardFooterProps } from '../WizardFooter';
|
|
3
3
|
/**
|
|
4
4
|
* Set a unique footer for the wizard. stepId is only required if inactive steps are hidden instead of unmounted.
|
|
5
5
|
* @param footer
|
|
6
6
|
* @param stepId
|
|
7
7
|
*/
|
|
8
|
-
export declare const useWizardFooter: (footer:
|
|
8
|
+
export declare const useWizardFooter: (footer: React.ReactElement | Partial<WizardFooterProps>, stepId?: string | number) => void;
|
|
9
9
|
//# sourceMappingURL=useWizardFooter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWizardFooter.d.ts","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/useWizardFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useWizardFooter.d.ts","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/useWizardFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,eAAe,WAAY,MAAM,YAAY,GAAG,QAAQ,iBAAiB,CAAC,WAAW,MAAM,GAAG,MAAM,SAahH,CAAC"}
|
|
@@ -6,15 +6,15 @@ import { useWizardContext } from '../WizardContext';
|
|
|
6
6
|
* @param stepId
|
|
7
7
|
*/
|
|
8
8
|
export const useWizardFooter = (footer, stepId) => {
|
|
9
|
-
const {
|
|
9
|
+
const { currentStep, setFooter } = useWizardContext();
|
|
10
10
|
React.useEffect(() => {
|
|
11
|
-
if (!stepId ||
|
|
11
|
+
if (footer && (!stepId || (currentStep === null || currentStep === void 0 ? void 0 : currentStep.id) === stepId)) {
|
|
12
12
|
setFooter(footer);
|
|
13
13
|
// Reset the footer on unmount.
|
|
14
14
|
return () => {
|
|
15
15
|
setFooter(null);
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
}, [
|
|
18
|
+
}, [currentStep, footer, setFooter, stepId]);
|
|
19
19
|
};
|
|
20
20
|
//# sourceMappingURL=useWizardFooter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWizardFooter.js","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/useWizardFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useWizardFooter.js","sourceRoot":"","sources":["../../../../../../src/next/components/Wizard/hooks/useWizardFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGpD;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAuD,EAAE,MAAwB,EAAE,EAAE;IACnH,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAEtD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,MAAM,IAAI,CAAC,CAAC,MAAM,IAAI,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,EAAE,MAAK,MAAM,CAAC,EAAE;YACrD,SAAS,CAAC,MAAM,CAAC,CAAC;YAElB,+BAA+B;YAC/B,OAAO,GAAG,EAAE;gBACV,SAAS,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC,CAAC;SACH;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;AAC/C,CAAC,CAAC"}
|
|
@@ -1,74 +1,65 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WizardNavProps, WizardNavItemProps } from '../Wizard';
|
|
2
|
+
import { WizardNavProps, WizardNavItemProps, WizardFooterProps } from '../Wizard';
|
|
3
3
|
/** Type used to define 'basic' steps, or in other words, steps that are neither parents or children of parents. */
|
|
4
4
|
export interface WizardBasicStep {
|
|
5
|
-
/** Name of the step's
|
|
5
|
+
/** Name of the step's navigation item */
|
|
6
6
|
name: React.ReactNode;
|
|
7
7
|
/** Unique identifier */
|
|
8
8
|
id: string | number;
|
|
9
|
-
/** Flag to disable the step's
|
|
9
|
+
/** Flag to disable the step's navigation item */
|
|
10
10
|
isDisabled?: boolean;
|
|
11
11
|
/** Flag to represent whether the step has been visited (navigated to) */
|
|
12
|
-
|
|
13
|
-
/**
|
|
12
|
+
isVisited?: boolean;
|
|
13
|
+
/** Flag to determine whether the step is hidden */
|
|
14
|
+
isHidden?: boolean;
|
|
15
|
+
/** Content shown when the step's navigation item is selected. When treated as a parent step, only sub-step content will be shown. */
|
|
14
16
|
component?: React.ReactElement;
|
|
15
|
-
/**
|
|
16
|
-
navItem?:
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
/** Replaces the step's navigation item or its properties. */
|
|
18
|
+
navItem?: WizardNavItemType;
|
|
19
|
+
/** Replaces the step's footer. The step's footer takes precedance over the wizard's footer. */
|
|
20
|
+
footer?: React.ReactElement | Partial<WizardFooterProps>;
|
|
21
|
+
/** Used to determine icon next to the step's navItem */
|
|
22
|
+
status?: 'default' | 'error';
|
|
23
|
+
}
|
|
24
|
+
export declare enum WizardNavItemStatus {
|
|
25
|
+
Default = "default",
|
|
26
|
+
Error = "error"
|
|
25
27
|
}
|
|
26
28
|
/** Type used to define parent steps. */
|
|
27
29
|
export interface WizardParentStep extends WizardBasicStep {
|
|
28
30
|
/** Nested step IDs */
|
|
29
|
-
subStepIds: string[];
|
|
31
|
+
subStepIds: (string | number)[];
|
|
30
32
|
}
|
|
31
33
|
/** Type used to define sub-steps. */
|
|
32
34
|
export interface WizardSubStep extends WizardBasicStep {
|
|
33
35
|
/** Unique identifier of the parent step */
|
|
34
36
|
parentId: string | number;
|
|
35
37
|
}
|
|
36
|
-
/** Used to customize aspects of the Wizard's default navigation. */
|
|
37
|
-
export interface DefaultWizardNavProps {
|
|
38
|
-
/** Flag indicating nav items with sub steps are expandable */
|
|
39
|
-
isExpandable?: boolean;
|
|
40
|
-
/** Aria-label for the Nav */
|
|
41
|
-
ariaLabel?: string;
|
|
42
|
-
/** Sets aria-labelledby on nav element */
|
|
43
|
-
ariaLabelledBy?: string;
|
|
44
|
-
/** Disable step nav items until they are visited */
|
|
45
|
-
forceStepVisit?: boolean;
|
|
46
|
-
}
|
|
47
|
-
/** Used to customize aspects of the Wizard's default footer. */
|
|
48
|
-
export interface DefaultWizardFooterProps {
|
|
49
|
-
/** The Next button text */
|
|
50
|
-
nextButtonText?: React.ReactNode;
|
|
51
|
-
/** The Back button text */
|
|
52
|
-
backButtonText?: React.ReactNode;
|
|
53
|
-
/** The Cancel button text */
|
|
54
|
-
cancelButtonText?: React.ReactNode;
|
|
55
|
-
/** Next button callback */
|
|
56
|
-
onNext?: () => WizardNavStepFunction | void;
|
|
57
|
-
/** Back button callback */
|
|
58
|
-
onBack?: () => WizardNavStepFunction | void;
|
|
59
|
-
/** Cancel link callback */
|
|
60
|
-
onClose?: () => void;
|
|
61
|
-
}
|
|
62
38
|
/** Encompasses all step type variants that are internally controlled by the Wizard. */
|
|
63
39
|
export declare type WizardControlStep = WizardBasicStep | WizardParentStep | WizardSubStep;
|
|
64
40
|
/** Callback for the Wizard's 'onNext', 'onBack', and 'onNavByIndex' properties. */
|
|
65
41
|
export declare type WizardNavStepFunction = (currentStep: WizardNavStepData, previousStep: WizardNavStepData) => void;
|
|
66
42
|
/** Data returned for either parameter of WizardNavStepFunction. */
|
|
67
|
-
export
|
|
43
|
+
export interface WizardNavStepData {
|
|
44
|
+
/** Unique identifier */
|
|
45
|
+
id: string | number;
|
|
46
|
+
/** Name of the step */
|
|
47
|
+
name: string;
|
|
48
|
+
/** Index of the step (starts at 1) */
|
|
49
|
+
index: number;
|
|
50
|
+
}
|
|
51
|
+
export declare type WizardFooterType = Partial<WizardFooterProps> | CustomWizardFooterFunction | React.ReactElement;
|
|
52
|
+
export declare type WizardNavType = Partial<WizardNavProps> | CustomWizardNavFunction | React.ReactElement;
|
|
53
|
+
export declare type WizardNavItemType = Partial<WizardNavItemProps> | CustomWizardNavItemFunction | React.ReactElement;
|
|
68
54
|
/** Callback for the Wizard's 'nav' property. Returns element which replaces the Wizard's default navigation. */
|
|
69
|
-
export declare type CustomWizardNavFunction = (isExpanded: boolean, steps: WizardControlStep[],
|
|
70
|
-
|
|
71
|
-
export declare
|
|
55
|
+
export declare type CustomWizardNavFunction = (isExpanded: boolean, steps: WizardControlStep[], currentStep: WizardControlStep, goToStepByIndex: (index: number) => void) => React.ReactElement<WizardNavProps>;
|
|
56
|
+
/** Callback for the Wizard's 'navItem' property. Returns element which replaces the WizardStep's default navigation item. */
|
|
57
|
+
export declare type CustomWizardNavItemFunction = (step: WizardControlStep, currentStep: WizardControlStep, steps: WizardControlStep[], goToStepByIndex: (index: number) => void) => React.ReactElement<WizardNavItemProps>;
|
|
58
|
+
/** Callback for the Wizard's 'footer' property. Returns element which replaces the Wizard's default footer. */
|
|
59
|
+
export declare type CustomWizardFooterFunction = (currentStep: WizardControlStep, onNext: () => void, onBack: () => void, onClose: () => void) => React.ReactElement<WizardFooterProps>;
|
|
60
|
+
export declare function isCustomWizardNav(nav: WizardNavType): nav is CustomWizardNavFunction | React.ReactElement;
|
|
61
|
+
export declare function isCustomWizardNavItem(navItem: WizardNavItemType): navItem is CustomWizardNavItemFunction | React.ReactElement;
|
|
62
|
+
export declare function isCustomWizardFooter(footer: WizardFooterType): footer is CustomWizardFooterFunction | React.ReactElement;
|
|
72
63
|
export declare function isWizardBasicStep(step: WizardControlStep): step is WizardBasicStep;
|
|
73
64
|
export declare function isWizardSubStep(step: WizardControlStep): step is WizardSubStep;
|
|
74
65
|
export declare function isWizardParentStep(step: WizardControlStep): step is WizardParentStep;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAElF,mHAAmH;AACnH,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,wBAAwB;IACxB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,iDAAiD;IACjD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yEAAyE;IACzE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qIAAqI;IACrI,SAAS,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC/B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,+FAA+F;IAC/F,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,GAA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["Default"] = "default";
|
|
5
|
+
WizardNavItemStatus["Error"] = "error";
|
|
6
|
+
})(WizardNavItemStatus || (WizardNavItemStatus = {}));
|
|
2
7
|
export function isCustomWizardNav(nav) {
|
|
3
|
-
return typeof nav === 'function';
|
|
8
|
+
return typeof nav === 'function' || React.isValidElement(nav);
|
|
9
|
+
}
|
|
10
|
+
export function isCustomWizardNavItem(navItem) {
|
|
11
|
+
return typeof navItem === 'function' || React.isValidElement(navItem);
|
|
4
12
|
}
|
|
5
13
|
export function isCustomWizardFooter(footer) {
|
|
6
|
-
return React.isValidElement(footer);
|
|
14
|
+
return typeof footer === 'function' || React.isValidElement(footer);
|
|
7
15
|
}
|
|
8
16
|
export function isWizardBasicStep(step) {
|
|
9
17
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAyB1B,MAAM,CAAN,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,sCAAe,CAAA;AACjB,CAAC,EAHW,mBAAmB,KAAnB,mBAAmB,QAG9B;AA0DD,MAAM,UAAU,iBAAiB,CAAC,GAAkB;IAClD,OAAO,OAAO,GAAG,KAAK,UAAU,IAAI,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,OAA0B;IAE1B,OAAO,OAAO,OAAO,KAAK,UAAU,IAAI,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AACxE,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,MAAwB;IAExB,OAAO,OAAO,MAAM,KAAK,UAAU,IAAI,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAuB;;IACvD,OAAO,CAAA,MAAC,IAAyB,0CAAE,UAAU,MAAK,SAAS,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;AACxF,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAuB;;IACrD,OAAO,CAAA,MAAC,IAAsB,0CAAE,QAAQ,MAAK,SAAS,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAuB;;IACxD,OAAO,CAAA,MAAC,IAAyB,0CAAE,UAAU,MAAK,SAAS,CAAC;AAC9D,CAAC"}
|
|
@@ -7,9 +7,8 @@ import { WizardStepProps } from './WizardStep';
|
|
|
7
7
|
* @returns WizardControlStep[]
|
|
8
8
|
*/
|
|
9
9
|
export declare const buildSteps: (children: React.ReactElement<WizardStepProps> | React.ReactElement<WizardStepProps>[]) => WizardControlStep[];
|
|
10
|
-
export declare
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export declare const getActiveStep: (steps: WizardControlStep[], currentStepIndex: number) => WizardControlStep;
|
|
10
|
+
export declare function isWizardStep(child: any | React.ReactElement<WizardStepProps>): child is React.ReactElement<WizardStepProps>;
|
|
11
|
+
export declare const normalizeStep: ({ children, steps, body, ...controlStep }: WizardStepProps) => WizardControlStep;
|
|
12
|
+
export declare const normalizeNavStep: (navStep: WizardControlStep, steps: WizardControlStep[]) => WizardNavStepData;
|
|
13
|
+
export declare const getCurrentStep: (steps: WizardControlStep[], currentStepIndex: number) => WizardControlStep;
|
|
15
14
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/next/components/Wizard/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,UAAU,aAAc,MAAM,YAAY,CAAC,eAAe,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,CAAC,EAAE,wBAyBxG,CAAC;AAET,wBAAgB,YAAY,CAC1B,KAAK,EAAE,GAAG,GAAG,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,GAC/C,KAAK,IAAI,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,CAK9C;AAGD,eAAO,MAAM,aAAa,8CAA+C,eAAe,KAAG,iBAC9E,CAAC;AAEd,eAAO,MAAM,gBAAgB,YAAa,iBAAiB,SAAS,iBAAiB,EAAE,KAAG,iBAIxF,CAAC;AAEH,eAAO,MAAM,cAAc,UAAW,iBAAiB,EAAE,oBAAoB,MAAM,sBACzB,CAAC"}
|