next-helios-fe 1.7.26 → 1.7.27
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/package.json
CHANGED
@@ -7,7 +7,7 @@ interface WizardProps {
|
|
7
7
|
children: React.ReactNode;
|
8
8
|
tabs: {
|
9
9
|
title: string;
|
10
|
-
subTitle
|
10
|
+
subTitle?: string;
|
11
11
|
icon: string;
|
12
12
|
}[];
|
13
13
|
options?: {
|
@@ -17,7 +17,7 @@ interface WizardProps {
|
|
17
17
|
};
|
18
18
|
onPreviousClick?: () => void;
|
19
19
|
onNextClick?: () => void;
|
20
|
-
|
20
|
+
onChangeTab?: (window: any) => void;
|
21
21
|
}
|
22
22
|
|
23
23
|
interface WizardComponent extends React.FC<WizardProps> {
|
@@ -30,7 +30,7 @@ export const Wizard: WizardComponent = ({
|
|
30
30
|
options,
|
31
31
|
onPreviousClick,
|
32
32
|
onNextClick,
|
33
|
-
|
33
|
+
onChangeTab,
|
34
34
|
}) => {
|
35
35
|
const wizardNavigationRef = useRef<HTMLDivElement>(null);
|
36
36
|
const childrenList = React.Children.toArray(children);
|
@@ -40,10 +40,13 @@ export const Wizard: WizardComponent = ({
|
|
40
40
|
const [activeTab, setActiveTab] = useState(0);
|
41
41
|
|
42
42
|
useEffect(() => {
|
43
|
-
if (
|
44
|
-
|
43
|
+
if (onChangeTab) {
|
44
|
+
onChangeTab({
|
45
|
+
index: activeTab,
|
46
|
+
title: tabs[activeTab].title,
|
47
|
+
});
|
45
48
|
}
|
46
|
-
}, [activeTab]);
|
49
|
+
}, [tabs, activeTab]);
|
47
50
|
|
48
51
|
const handleOnPreviousClick = () => {
|
49
52
|
if (activeTab - 1 === 0) {
|