Skip to content

Commit 73fbc27

Browse files
authored
Merge pull request #554 from rvsia/fixTypesWizard
fix(pf4): fix wizard types for new version
2 parents dbd63b0 + 008b74c commit 73fbc27

File tree

3 files changed

+30
-16
lines changed

3 files changed

+30
-16
lines changed

packages/pf4-component-mapper/src/files/dual-list-select.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ export interface DualListSelectOption extends AnyObject {
77
label: ReactNode;
88
}
99

10+
export interface RenderStatusInput {
11+
selected: number;
12+
options: number;
13+
}
14+
15+
export interface RenderStatusFunction {
16+
(input: RenderStatusInput): ReactNode;
17+
}
18+
1019
interface InternalDualListSelectProps {
1120
leftTitle?: ReactNode;
1221
rightTitle?: ReactNode;
@@ -24,6 +33,7 @@ interface InternalDualListSelectProps {
2433
filterOptionsText?: ReactNode;
2534
leftValues: DualListSelectOption[];
2635
rightValues: DualListSelectOption[];
36+
renderStatus?: RenderStatusFunction;
2737
}
2838

2939
export type DualListSelectProps = InternalDualListSelectProps & FormGroupProps & UseFieldApiComponentConfig;

packages/pf4-component-mapper/src/files/wizard.d.ts

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,23 @@ export interface WizardNextStepMapper {
2828

2929
export type WizardNextStep = string | WizardNextStepMapper | WizardNextStepFunction;
3030

31+
export interface SelectNextFunction {
32+
(nextStep: WizardNextStep, getState: Function): string;
33+
}
34+
35+
export interface HandleNextFunction {
36+
(nextStep: string): void;
37+
}
38+
3139
export interface WizardButtonsProps {
32-
ConditionalNext: React.ComponentType;
33-
SubmitButton: React.ComponentType;
34-
SimpleNext: React.ComponentType;
35-
formOptions: FormOptions;
3640
disableBack?: boolean;
37-
handlePrev: any;
38-
nextStep?: string | number;
39-
FieldProvider?: React.ComponentType;
40-
handleNext: any;
41+
handlePrev: Function;
42+
nextStep?: WizardNextStep;
43+
handleNext: HandleNextFunction;
4144
buttonsClassname?: string;
42-
buttonLabels: AnyObject;
43-
renderNextButton: any;
45+
buttonLabels: WizardButtonLabels;
46+
renderNextButton: Function;
47+
selectNext: SelectNextFunction;
4448
}
4549

4650
export interface WizardField {
@@ -60,14 +64,17 @@ export interface WizardProps {
6064
buttonsClassName?: string;
6165
title?: ReactNode;
6266
description?: ReactNode;
63-
isCompactNav?: boolean;
6467
inModal?: boolean;
65-
setFullWidth?: boolean;
66-
setFullHeight?: boolean;
6768
isDynamic?: boolean;
6869
showTitles?: boolean;
6970
crossroads?: string[];
7071
fields: WizardField[];
72+
hideClose?: boolean;
73+
titleId?: string;
74+
descriptionId?: string;
75+
closeButtonAriaLabel?: string;
76+
hasNoBodyPadding?: boolean;
77+
navAriaLabel?: string;
7178
}
7279

7380
declare const Wizard: React.ComponentType<WizardProps>;

packages/pf4-component-mapper/src/files/wizard.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,7 @@ WizardInternal.propTypes = {
148148
buttonsClassName: PropTypes.string,
149149
title: PropTypes.any,
150150
description: PropTypes.any,
151-
isCompactNav: PropTypes.bool,
152151
inModal: PropTypes.bool,
153-
setFullWidth: PropTypes.bool,
154-
setFullHeight: PropTypes.bool,
155152
isDynamic: PropTypes.bool,
156153
showTitles: PropTypes.bool,
157154
crossroads: PropTypes.arrayOf(PropTypes.string),

0 commit comments

Comments
 (0)