@patternfly/react-core 4.223.3 → 4.224.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 +11 -0
- package/dist/esm/components/Wizard/Wizard.d.ts +9 -0
- package/dist/esm/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/esm/components/Wizard/Wizard.js +6 -3
- package/dist/esm/components/Wizard/Wizard.js.map +1 -1
- package/dist/esm/components/Wizard/WizardBody.d.ts +6 -0
- package/dist/esm/components/Wizard/WizardBody.d.ts.map +1 -1
- package/dist/esm/components/Wizard/WizardBody.js +6 -2
- package/dist/esm/components/Wizard/WizardBody.js.map +1 -1
- package/dist/esm/components/Wizard/WizardDrawerWrapper.d.ts +11 -0
- package/dist/esm/components/Wizard/WizardDrawerWrapper.d.ts.map +1 -0
- package/dist/esm/components/Wizard/WizardDrawerWrapper.js +3 -0
- package/dist/esm/components/Wizard/WizardDrawerWrapper.js.map +1 -0
- package/dist/esm/components/Wizard/WizardToggle.d.ts +5 -1
- package/dist/esm/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/esm/components/Wizard/WizardToggle.js +4 -2
- package/dist/esm/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/js/components/Wizard/Wizard.d.ts +9 -0
- package/dist/js/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/js/components/Wizard/Wizard.js +6 -3
- package/dist/js/components/Wizard/Wizard.js.map +1 -1
- package/dist/js/components/Wizard/WizardBody.d.ts +6 -0
- package/dist/js/components/Wizard/WizardBody.d.ts.map +1 -1
- package/dist/js/components/Wizard/WizardBody.js +6 -2
- package/dist/js/components/Wizard/WizardBody.js.map +1 -1
- package/dist/js/components/Wizard/WizardDrawerWrapper.d.ts +11 -0
- package/dist/js/components/Wizard/WizardDrawerWrapper.d.ts.map +1 -0
- package/dist/js/components/Wizard/WizardDrawerWrapper.js +7 -0
- package/dist/js/components/Wizard/WizardDrawerWrapper.js.map +1 -0
- package/dist/js/components/Wizard/WizardToggle.d.ts +5 -1
- package/dist/js/components/Wizard/WizardToggle.d.ts.map +1 -1
- package/dist/js/components/Wizard/WizardToggle.js +4 -2
- package/dist/js/components/Wizard/WizardToggle.js.map +1 -1
- package/dist/umd/react-core.js +17 -7
- package/dist/umd/react-core.min.js +4 -4
- package/package.json +5 -5
- package/src/components/Wizard/Wizard.tsx +21 -1
- package/src/components/Wizard/WizardBody.tsx +23 -2
- package/src/components/Wizard/WizardDrawerWrapper.tsx +18 -0
- package/src/components/Wizard/WizardToggle.tsx +12 -2
- package/src/components/Wizard/__tests__/Wizard.test.tsx +24 -7
- package/src/components/Wizard/examples/Wizard.md +157 -2
- package/src/demos/Wizard/WizardDemo.md +1033 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardToggle.js","sourceRoot":"","sources":["../../../../src/components/Wizard/WizardToggle.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,2DAA+C;AAC/C,2GAA2E;AAC3E,sHAAqF;AACrF,oHAAmF;AAEnF,6CAA0C;
|
|
1
|
+
{"version":3,"file":"WizardToggle.js","sourceRoot":"","sources":["../../../../src/components/Wizard/WizardToggle.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,2DAA+C;AAC/C,2GAA2E;AAC3E,sHAAqF;AACrF,oHAAmF;AAEnF,6CAA0C;AA+BnC,MAAM,YAAY,GAA+C,CAAC,EACvE,SAAS,EACT,WAAW,EACX,GAAG,EACH,KAAK,EACL,UAAU,EACV,QAAQ,EACR,gBAAgB,GAAG,KAAK,EACxB,YAAY,EAAE,SAAS,GAAG,eAAe,EACzC,kBAAkB,GAAG,IAAI,EACzB,aAAa,GAAG,IAAI,EACpB,QAAQ,GAAG,IAAI,EACf,SAAS,EACT,gBAAgB,EACE,EAAE,EAAE;IACtB,IAAI,eAAe,CAAC;IACpB,IAAI,cAAc,CAAC;IACnB,IAAI,iBAAiB,CAAC;IACtB,KAAK,IAAI,C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BAAM,CAAC,eAAe,CAAC,IAAG,eAAe,CAAQ;;oBAAE,cAAc;oBACrF,iBAAiB,IAAI,oBAAC,0BAAc,IAAC,SAAS,EAAE,kBAAG,CAAC,gBAAM,CAAC,qBAAqB,CAAC,iBAAc,MAAM,GAAG,CACpG;gBACN,iBAAiB,IAAI,8BAAM,SAAS,EAAE,kBAAG,CAAC,gBAAM,CAAC,oBAAoB,CAAC,IAAG,iBAAiB,CAAQ,CAC9F;YACP,8BAAM,SAAS,EAAE,kBAAG,CAAC,gBAAM,CAAC,gBAAgB,CAAC;gBAC3C,oBAAC,yBAAa,mBAAa,MAAM,GAAG,CAC/B,CACA;QACT,6BAAK,SAAS,EAAE,kBAAG,CAAC,gBAAM,CAAC,eAAe,CAAC;YACzC,6BAAK,SAAS,EAAE,kBAAG,CAAC,gBAAM,CAAC,eAAe,CAAC;gBACxC,GAAG,CAAC,SAAS,CAAC;gBACf,oBAAC,uBAAU,IACT,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,gBAC5B,aAAa,qBACR,kBAAkB,EACnC,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS;oBAEnB,SAAS,IAAI,CAAC,gBAAgB,IAAI,UAAU,CAAC,kBAAkB;oBAC/D,UAAU,CAAC,SAAS,CACV,CACT;YACL,QAAQ,CACL,CACS,CAClB,CAAC;AACJ,CAAC,CAAC;AA1EW,QAAA,YAAY,gBA0EvB;AACF,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC"}
|
package/dist/umd/react-core.js
CHANGED
|
@@ -20883,14 +20883,19 @@
|
|
|
20883
20883
|
React__namespace.createElement(Button, { variant: exports.ButtonVariant.link, onClick: onClose }, cancelButtonText)))));
|
|
20884
20884
|
WizardFooterInternal.displayName = 'WizardFooterInternal';
|
|
20885
20885
|
|
|
20886
|
-
const
|
|
20886
|
+
const WizardDrawerWrapper = ({ hasDrawer, wrapper, children }) => (hasDrawer ? wrapper(children) : children);
|
|
20887
|
+
WizardDrawerWrapper.displayName = 'WizardDrawerWrapper';
|
|
20888
|
+
|
|
20889
|
+
const WizardBody = ({ children, hasNoBodyPadding = false, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, mainComponent = 'div', hasDrawer, isDrawerExpanded, activeStep }) => {
|
|
20887
20890
|
const MainComponent = mainComponent;
|
|
20888
20891
|
return (React__namespace.createElement(MainComponent, { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, className: css(styles$8.wizardMain) },
|
|
20889
|
-
React__namespace.createElement(
|
|
20892
|
+
React__namespace.createElement(WizardDrawerWrapper, { hasDrawer: hasDrawer && activeStep.drawerPanelContent, wrapper: (children) => (React__namespace.createElement(Drawer, { isInline: true, isExpanded: isDrawerExpanded },
|
|
20893
|
+
React__namespace.createElement(DrawerContent, { panelContent: activeStep.drawerPanelContent }, children))) },
|
|
20894
|
+
React__namespace.createElement("div", { className: css(styles$8.wizardMainBody, hasNoBodyPadding && styles$8.modifiers.noPadding) }, children))));
|
|
20890
20895
|
};
|
|
20891
20896
|
WizardBody.displayName = 'WizardBody';
|
|
20892
20897
|
|
|
20893
|
-
const WizardToggle = ({ isNavOpen, onNavToggle, nav, steps, activeStep, children, hasNoBodyPadding = false, 'aria-label': ariaLabel = 'Wizard Toggle', mainAriaLabelledBy = null, mainAriaLabel = null, isInPage = true }) => {
|
|
20898
|
+
const WizardToggle = ({ isNavOpen, onNavToggle, nav, steps, activeStep, children, hasNoBodyPadding = false, 'aria-label': ariaLabel = 'Wizard Toggle', mainAriaLabelledBy = null, mainAriaLabel = null, isInPage = true, hasDrawer, isDrawerExpanded }) => {
|
|
20894
20899
|
let activeStepIndex;
|
|
20895
20900
|
let activeStepName;
|
|
20896
20901
|
let activeStepSubName;
|
|
@@ -20925,7 +20930,9 @@
|
|
|
20925
20930
|
React__namespace.createElement("div", { className: css(styles$8.wizardOuterWrap) },
|
|
20926
20931
|
React__namespace.createElement("div", { className: css(styles$8.wizardInnerWrap) },
|
|
20927
20932
|
nav(isNavOpen),
|
|
20928
|
-
React__namespace.createElement(WizardBody, { mainComponent: isInPage ? 'div' : 'main', "aria-label": mainAriaLabel, "aria-labelledby": mainAriaLabelledBy, hasNoBodyPadding: hasNoBodyPadding
|
|
20933
|
+
React__namespace.createElement(WizardBody, { mainComponent: isInPage ? 'div' : 'main', "aria-label": mainAriaLabel, "aria-labelledby": mainAriaLabelledBy, hasNoBodyPadding: hasNoBodyPadding, activeStep: activeStep, isDrawerExpanded: isDrawerExpanded, hasDrawer: hasDrawer },
|
|
20934
|
+
hasDrawer && !isDrawerExpanded && activeStep.drawerToggleButton,
|
|
20935
|
+
activeStep.component)),
|
|
20929
20936
|
children)));
|
|
20930
20937
|
};
|
|
20931
20938
|
WizardToggle.displayName = 'WizardToggle';
|
|
@@ -21132,6 +21139,7 @@
|
|
|
21132
21139
|
currentStep: this.props.startAtStep && Number.isInteger(this.props.startAtStep) ? this.props.startAtStep : 1,
|
|
21133
21140
|
isNavOpen: false
|
|
21134
21141
|
};
|
|
21142
|
+
this.drawerRef = React__namespace.createRef();
|
|
21135
21143
|
}
|
|
21136
21144
|
componentDidMount() {
|
|
21137
21145
|
const target = typeof document !== 'undefined' ? document.body : null;
|
|
@@ -21148,7 +21156,7 @@
|
|
|
21148
21156
|
render() {
|
|
21149
21157
|
const _a = this.props, {
|
|
21150
21158
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
21151
|
-
width, height, title, description, descriptionComponent, onClose, onSave, onBack, onNext, onGoToStep, className, steps, startAtStep, nextButtonText = 'Next', backButtonText = 'Back', cancelButtonText = 'Cancel', hideClose, closeButtonAriaLabel = 'Close', navAriaLabel, navAriaLabelledBy, mainAriaLabel, mainAriaLabelledBy, hasNoBodyPadding, footer, appendTo, isOpen, titleId, descriptionId, isNavExpandable } = _a, rest = __rest$1(_a, ["width", "height", "title", "description", "descriptionComponent", "onClose", "onSave", "onBack", "onNext", "onGoToStep", "className", "steps", "startAtStep", "nextButtonText", "backButtonText", "cancelButtonText", "hideClose", "closeButtonAriaLabel", "navAriaLabel", "navAriaLabelledBy", "mainAriaLabel", "mainAriaLabelledBy", "hasNoBodyPadding", "footer", "appendTo", "isOpen", "titleId", "descriptionId", "isNavExpandable"])
|
|
21159
|
+
width, height, title, description, descriptionComponent, onClose, onSave, onBack, onNext, onGoToStep, className, steps, startAtStep, nextButtonText = 'Next', backButtonText = 'Back', cancelButtonText = 'Cancel', hideClose, closeButtonAriaLabel = 'Close', navAriaLabel, navAriaLabelledBy, mainAriaLabel, mainAriaLabelledBy, hasNoBodyPadding, footer, appendTo, isOpen, titleId, descriptionId, isNavExpandable, hasDrawer, isDrawerExpanded } = _a, rest = __rest$1(_a, ["width", "height", "title", "description", "descriptionComponent", "onClose", "onSave", "onBack", "onNext", "onGoToStep", "className", "steps", "startAtStep", "nextButtonText", "backButtonText", "cancelButtonText", "hideClose", "closeButtonAriaLabel", "navAriaLabel", "navAriaLabelledBy", "mainAriaLabel", "mainAriaLabelledBy", "hasNoBodyPadding", "footer", "appendTo", "isOpen", "titleId", "descriptionId", "isNavExpandable", "hasDrawer", "isDrawerExpanded"])
|
|
21152
21160
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
21153
21161
|
;
|
|
21154
21162
|
const { currentStep } = this.state;
|
|
@@ -21212,7 +21220,7 @@
|
|
|
21212
21220
|
const wizard = (React__namespace.createElement(WizardContextProvider, { value: context },
|
|
21213
21221
|
React__namespace.createElement("div", Object.assign({}, rest, { className: css(styles$8.wizard, activeStep && activeStep.isFinishedStep && 'pf-m-finished', className), style: Object.keys(divStyles).length ? divStyles : undefined }),
|
|
21214
21222
|
title && (React__namespace.createElement(WizardHeader, { titleId: this.titleId, descriptionId: this.descriptionId, onClose: onClose, title: title, description: description, descriptionComponent: descriptionComponent, closeButtonAriaLabel: closeButtonAriaLabel, hideClose: hideClose })),
|
|
21215
|
-
React__namespace.createElement(WizardToggle, { mainAriaLabel: mainAriaLabel, isInPage: isOpen === undefined, mainAriaLabelledBy: (title || mainAriaLabelledBy) && (mainAriaLabelledBy || this.titleId), isNavOpen: this.state.isNavOpen, onNavToggle: isNavOpen => this.setState({ isNavOpen }), nav: nav, steps: steps, activeStep: activeStep, hasNoBodyPadding: hasNoBodyPadding }, footer || (React__namespace.createElement(WizardFooterInternal, { onNext: this.onNext, onBack: this.onBack, onClose: onClose, isValid: isValid, firstStep: firstStep, activeStep: activeStep, nextButtonText: (activeStep && activeStep.nextButtonText) || nextButtonText, backButtonText: backButtonText, cancelButtonText: cancelButtonText }))))));
|
|
21223
|
+
React__namespace.createElement(WizardToggle, { hasDrawer: hasDrawer, isDrawerExpanded: isDrawerExpanded, mainAriaLabel: mainAriaLabel, isInPage: isOpen === undefined, mainAriaLabelledBy: (title || mainAriaLabelledBy) && (mainAriaLabelledBy || this.titleId), isNavOpen: this.state.isNavOpen, onNavToggle: isNavOpen => this.setState({ isNavOpen }), nav: nav, steps: steps, activeStep: activeStep, hasNoBodyPadding: hasNoBodyPadding }, footer || (React__namespace.createElement(WizardFooterInternal, { onNext: this.onNext, onBack: this.onBack, onClose: onClose, isValid: isValid, firstStep: firstStep, activeStep: activeStep, nextButtonText: (activeStep && activeStep.nextButtonText) || nextButtonText, backButtonText: backButtonText, cancelButtonText: cancelButtonText }))))));
|
|
21216
21224
|
if (isOpen !== undefined) {
|
|
21217
21225
|
return (React__namespace.createElement(Modal, { width: width !== null ? width : undefined, isOpen: isOpen, variant: exports.ModalVariant.large, "aria-labelledby": this.titleId, "aria-describedby": this.descriptionId, showClose: false, hasNoBodyWrapper: true }, wizard));
|
|
21218
21226
|
}
|
|
@@ -21246,7 +21254,9 @@
|
|
|
21246
21254
|
onClose: () => undefined,
|
|
21247
21255
|
appendTo: null,
|
|
21248
21256
|
isOpen: undefined,
|
|
21249
|
-
isNavExpandable: false
|
|
21257
|
+
isNavExpandable: false,
|
|
21258
|
+
hasDrawer: false,
|
|
21259
|
+
isDrawerExpanded: false
|
|
21250
21260
|
};
|
|
21251
21261
|
|
|
21252
21262
|
const WizardFooter = ({ children }) => (React__namespace.createElement("footer", { className: css(styles$8.wizardFooter) }, children));
|