@patternfly/react-core 4.225.11 → 4.226.2
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 +27 -0
- package/dist/esm/components/CalendarMonth/CalendarMonth.d.ts +3 -1
- package/dist/esm/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
- package/dist/esm/components/CalendarMonth/CalendarMonth.js +9 -6
- package/dist/esm/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/esm/components/Wizard/Wizard.d.ts +4 -0
- package/dist/esm/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/esm/components/Wizard/Wizard.js +28 -13
- package/dist/esm/components/Wizard/Wizard.js.map +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.d.ts +3 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.js +9 -6
- package/dist/js/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/js/components/Wizard/Wizard.d.ts +4 -0
- package/dist/js/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/js/components/Wizard/Wizard.js +28 -13
- package/dist/js/components/Wizard/Wizard.js.map +1 -1
- package/dist/umd/react-core.css +4 -3
- package/dist/umd/react-core.js +37 -19
- package/dist/umd/react-core.min.css +38 -37
- package/dist/umd/react-core.min.js +2 -2
- package/package.json +6 -6
- package/src/components/CalendarMonth/CalendarMonth.tsx +22 -5
- package/src/components/CalendarMonth/examples/CalendarMonth.md +0 -5
- package/src/components/CalendarMonth/examples/CalendarMonthSelectableDate.tsx +6 -1
- package/src/components/Pagination/examples/Pagination.md +14 -14
- package/src/components/Toolbar/examples/Toolbar.md +2 -2
- package/src/components/Truncate/__tests__/Truncate.test.tsx +143 -4
- package/src/components/Truncate/__tests__/__snapshots__/Truncate.test.tsx.snap +34 -29
- package/src/components/Wizard/Wizard.tsx +34 -12
- package/src/components/Wizard/__tests__/Wizard.test.tsx +59 -0
- package/src/components/Wizard/examples/Wizard.md +9 -19
- package/src/components/CalendarMonth/examples/CalendarMonthDefault.tsx +0 -4
|
@@ -782,36 +782,29 @@ class ProgressiveWizard extends React.Component {
|
|
|
782
782
|
}
|
|
783
783
|
```
|
|
784
784
|
|
|
785
|
-
###
|
|
785
|
+
### Get current step
|
|
786
786
|
|
|
787
787
|
```js
|
|
788
788
|
import React from 'react';
|
|
789
789
|
import { Button, Wizard } from '@patternfly/react-core';
|
|
790
790
|
|
|
791
|
-
class
|
|
791
|
+
class GetCurrentStepWizard extends React.Component {
|
|
792
792
|
constructor(props) {
|
|
793
793
|
super(props);
|
|
794
794
|
this.state = {
|
|
795
795
|
step: 1
|
|
796
796
|
};
|
|
797
|
+
this.onCurrentStepChanged = ({ id }) => {
|
|
798
|
+
this.setState({
|
|
799
|
+
step: id
|
|
800
|
+
});
|
|
801
|
+
}
|
|
797
802
|
this.closeWizard = () => {
|
|
798
803
|
console.log('close wizard');
|
|
799
804
|
};
|
|
800
|
-
this.onMove = (curr, prev) => {
|
|
801
|
-
this.setState({
|
|
802
|
-
step: curr.id
|
|
803
|
-
});
|
|
804
|
-
};
|
|
805
|
-
this.onSave = () => {
|
|
806
|
-
this.setState({
|
|
807
|
-
step: 1
|
|
808
|
-
});
|
|
809
|
-
};
|
|
810
805
|
}
|
|
811
806
|
|
|
812
807
|
render() {
|
|
813
|
-
const { step } = this.state;
|
|
814
|
-
|
|
815
808
|
const steps = [
|
|
816
809
|
{ id: 1, name: 'First step', component: <p>Step 1 content</p> },
|
|
817
810
|
{ id: 2, name: 'Second step', component: <p>Step 2 content</p> },
|
|
@@ -819,19 +812,16 @@ class RememberLastStepWizard extends React.Component {
|
|
|
819
812
|
{ id: 4, name: 'Fourth step', component: <p>Step 4 content</p> },
|
|
820
813
|
{ id: 5, name: 'Review', component: <p>Review step content</p>, nextButtonText: 'Finish' }
|
|
821
814
|
];
|
|
822
|
-
const title = '
|
|
815
|
+
const title = 'Get current step wizard';
|
|
823
816
|
return (
|
|
824
817
|
<Wizard
|
|
825
818
|
navAriaLabel={`${title} steps`}
|
|
826
819
|
mainAriaLabel={`${title} content`}
|
|
827
|
-
startAtStep={step}
|
|
828
|
-
onNext={this.onMove}
|
|
829
|
-
onBack={this.onMove}
|
|
830
|
-
onSave={this.onSave}
|
|
831
820
|
onClose={this.closeWizard}
|
|
832
821
|
description="Simple Wizard Description"
|
|
833
822
|
steps={steps}
|
|
834
823
|
height={400}
|
|
824
|
+
onCurrentStepChanged={this.onCurrentStepChanged}
|
|
835
825
|
/>
|
|
836
826
|
);
|
|
837
827
|
}
|