@homefile/components-v2 2.8.36 → 2.8.37
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/dist/components/homeAssistant/panel/HomeAssistantPanel.d.ts +1 -1
- package/dist/components/homeAssistant/panel/HomeAssistantPanel.js +4 -2
- package/dist/components/homeBoard/HomeBoard.js +1 -1
- package/dist/interfaces/homeAssistant/HomeAssistantPanel.interface.d.ts +1 -0
- package/dist/stories/homeAssistant/panel/HomeAssistantPanel.stories.js +1 -1
- package/package.json +1 -1
- package/src/components/contacts/sharePanel/ShareContactsContent.tsx +0 -1
- package/src/components/forms/dynamicForm/ItemFormPanel/ItemFormPanel.tsx +0 -1
- package/src/components/homeAssistant/panel/HomeAssistantPanel.tsx +5 -2
- package/src/components/homeBoard/HomeBoard.tsx +1 -0
- package/src/interfaces/homeAssistant/HomeAssistantPanel.interface.ts +1 -0
- package/src/stories/homeAssistant/panel/HomeAssistantPanel.stories.tsx +1 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { HomeAssistantPanelI } from '../../../interfaces';
|
|
3
|
-
export declare const HomeAssistantPanel: ({ children, currentForm, currentStep, onApplianceClick, onBack, onClose, onNext, onSave, backDisabled, nextDisabled, hasCompleted }: PropsWithChildren<HomeAssistantPanelI>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const HomeAssistantPanel: ({ children, currentForm, currentStep, onApplianceClick, onBack, onClose, onNext, onSave, backDisabled, nextDisabled, hasCompleted, isLoading }: PropsWithChildren<HomeAssistantPanelI>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,10 +4,10 @@ import { FormProvider } from 'react-hook-form';
|
|
|
4
4
|
import { t } from 'i18next';
|
|
5
5
|
import { DrawerHeader, DrawerBody, Stack, Text, DrawerFooter, } from '@chakra-ui/react';
|
|
6
6
|
import { IA } from '../../../assets/images';
|
|
7
|
-
import { ApplianceSteps, SimpleDynamicForm, FooterButtons, HomeAssistantPanelStep, PanelHeader, } from '../..';
|
|
7
|
+
import { ApplianceSteps, SimpleDynamicForm, FooterButtons, HomeAssistantPanelStep, PanelHeader, Loading } from '../..';
|
|
8
8
|
import { homeAssistantSteps } from '../../../helpers';
|
|
9
9
|
import { useSimpleDynamicForm } from '../../../hooks';
|
|
10
|
-
export const HomeAssistantPanel = ({ children, currentForm, currentStep, onApplianceClick, onBack, onClose, onNext, onSave, backDisabled, nextDisabled, hasCompleted }) => {
|
|
10
|
+
export const HomeAssistantPanel = ({ children, currentForm, currentStep, onApplianceClick, onBack, onClose, onNext, onSave, backDisabled, nextDisabled, hasCompleted, isLoading }) => {
|
|
11
11
|
const [addedAppliances, updateAddedAppliances] = useState([]);
|
|
12
12
|
const { title } = homeAssistantSteps[currentStep - 1];
|
|
13
13
|
const text = `${t('homeAssistant.details')} ${title.toLowerCase()}:`;
|
|
@@ -26,6 +26,8 @@ export const HomeAssistantPanel = ({ children, currentForm, currentStep, onAppli
|
|
|
26
26
|
const { form, updatedFields } = useSimpleDynamicForm({
|
|
27
27
|
fields: currentForm,
|
|
28
28
|
});
|
|
29
|
+
if (isLoading)
|
|
30
|
+
return _jsx(Loading, {});
|
|
29
31
|
return (_jsxs(_Fragment, { children: [_jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: onClose, title: t('homeAssistant.title'), icon: IA }) }), _jsxs(DrawerBody, { p: "0", children: [_jsx(HomeAssistantPanelStep, { currentStep: currentStep }), children, isAppliances && (_jsx(ApplianceSteps, { onClick: onApplianceClick, addedAppliances: addedAppliances })), _jsxs(Stack, { spacing: "base", p: "base", children: [_jsx(Text, { fontFamily: "secondary", fontSize: "sm", children: text }), _jsx(FormProvider, Object.assign({}, form, { children: _jsx(SimpleDynamicForm, { fields: currentForm }) }))] })] }), _jsx(DrawerFooter, { px: "0", py: "6", bg: "neutral.white", children: _jsx(FooterButtons, { button1: {
|
|
30
32
|
buttonStyle: 'secondaryFooter',
|
|
31
33
|
label: t('buttons.back'),
|
|
@@ -48,7 +48,7 @@ export const HomeBoard = () => {
|
|
|
48
48
|
], onShareContacts: () => null, onDeleteContacts: () => null })),
|
|
49
49
|
PartnerCatalog: (_jsx(PartnerCatalogPanel, { onClose: onRightClose, onPartnerAdd: () => null, partners: partnerCatalogMock })),
|
|
50
50
|
AddHouseholdItem: (_jsxs(DrawerContent, { bg: "lightBlue.1", children: [_jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: handleClose, icon: Painting, title: "Add Household Item" }) }), _jsx(DrawerBody, { children: _jsx(DynamicForm, { form: formFieldsMock }) })] })),
|
|
51
|
-
HomeAssistant: (_jsx(HomeAssistantPanel, { currentStep: homeAssistantCurrentStep, currentForm: currentHomeAssistantForm, onNext: handleHomeAssistantFormChange, onBack: handleHomeAssistantBack, onApplianceClick: () => null, onClose: onRightClose, onSave: () => { }, backDisabled: false, nextDisabled: false, hasCompleted: true })),
|
|
51
|
+
HomeAssistant: (_jsx(HomeAssistantPanel, { currentStep: homeAssistantCurrentStep, currentForm: currentHomeAssistantForm, onNext: handleHomeAssistantFormChange, onBack: handleHomeAssistantBack, onApplianceClick: () => null, onClose: onRightClose, onSave: () => { }, backDisabled: false, nextDisabled: false, hasCompleted: true, isLoading: false })),
|
|
52
52
|
Notifications: (_jsx(NotificationsPanel, { notifications: notificationsMock, onClose: onRightClose, onDismiss: () => null })),
|
|
53
53
|
};
|
|
54
54
|
const panelSize = currentComponent === 'PartnerCatalog' ? 'lg' : 'md';
|
|
@@ -37,5 +37,5 @@ export const HomeAssistantPanelComponent = (args) => {
|
|
|
37
37
|
return prev - 1;
|
|
38
38
|
});
|
|
39
39
|
const currentForm = forms[currentStep];
|
|
40
|
-
return (_jsx(DrawerContent, { bg: "lightBlue.1", children: _jsx(HomeAssistantPanel, Object.assign({}, args, { currentStep: currentStep, currentForm: currentForm, onNext: handleFormChange, onBack: handleBack, onSave: action('onSave') })) }));
|
|
40
|
+
return (_jsx(DrawerContent, { bg: "lightBlue.1", children: _jsx(HomeAssistantPanel, Object.assign({}, args, { currentStep: currentStep, currentForm: currentForm, onNext: handleFormChange, onBack: handleBack, onSave: action('onSave'), isLoading: false })) }));
|
|
41
41
|
};
|
package/package.json
CHANGED
|
@@ -2,7 +2,6 @@ import { PropsWithChildren, useState, useEffect } from 'react'
|
|
|
2
2
|
import { FormProvider } from 'react-hook-form'
|
|
3
3
|
import { t } from 'i18next'
|
|
4
4
|
import {
|
|
5
|
-
DrawerContent,
|
|
6
5
|
DrawerHeader,
|
|
7
6
|
DrawerBody,
|
|
8
7
|
Stack,
|
|
@@ -16,6 +15,7 @@ import {
|
|
|
16
15
|
FooterButtons,
|
|
17
16
|
HomeAssistantPanelStep,
|
|
18
17
|
PanelHeader,
|
|
18
|
+
Loading
|
|
19
19
|
} from '@/components'
|
|
20
20
|
import { AppliancesType, HomeAssistantPanelI } from '@/interfaces'
|
|
21
21
|
import { homeAssistantSteps } from '@/helpers'
|
|
@@ -32,7 +32,8 @@ export const HomeAssistantPanel = ({
|
|
|
32
32
|
onSave,
|
|
33
33
|
backDisabled,
|
|
34
34
|
nextDisabled,
|
|
35
|
-
hasCompleted
|
|
35
|
+
hasCompleted,
|
|
36
|
+
isLoading
|
|
36
37
|
}: PropsWithChildren<HomeAssistantPanelI>) => {
|
|
37
38
|
const [addedAppliances, updateAddedAppliances] = useState<AppliancesType[]>([])
|
|
38
39
|
const { title } = homeAssistantSteps[currentStep - 1]
|
|
@@ -54,6 +55,8 @@ export const HomeAssistantPanel = ({
|
|
|
54
55
|
fields: currentForm,
|
|
55
56
|
})
|
|
56
57
|
|
|
58
|
+
if (isLoading) return <Loading />
|
|
59
|
+
|
|
57
60
|
return (
|
|
58
61
|
<>
|
|
59
62
|
<DrawerHeader p="0">
|