@homefile/components-v2 2.8.36 → 2.8.38
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/forms/readOnly/fields/ReadOnlyGrid.js +2 -3
- package/dist/components/forms/readOnly/fields/ReadOnlyGroup.js +1 -2
- 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/forms/readOnly/fields/ReadOnlyGrid.tsx +2 -3
- package/src/components/forms/readOnly/fields/ReadOnlyGroup.tsx +2 -3
- 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
|
@@ -17,7 +17,6 @@ export const ReadOnlyGrid = (_a) => {
|
|
|
17
17
|
var { children, onClick } = _a, props = __rest(_a, ["children", "onClick"]);
|
|
18
18
|
return (_jsx(Flex, Object.assign({ align: "stretch", gap: "base", borderBottom: "1px dashed", borderColor: "lightBlue.6", p: "base" }, props, { children: children === null || children === void 0 ? void 0 : children.map(({ children, id, name, value, type, icon }) => {
|
|
19
19
|
const baseProps = {
|
|
20
|
-
key: `${id}-${name}-${value}-${type}`,
|
|
21
20
|
id,
|
|
22
21
|
value,
|
|
23
22
|
icon: icon && fieldIcons[icon],
|
|
@@ -31,9 +30,9 @@ export const ReadOnlyGrid = (_a) => {
|
|
|
31
30
|
case 'select':
|
|
32
31
|
case 'string':
|
|
33
32
|
case 'currency':
|
|
34
|
-
return (_jsx(ReadOnlyInput, Object.assign({}, baseProps, { border: "none", flex: "auto", p: "0" })));
|
|
33
|
+
return (_jsx(ReadOnlyInput, Object.assign({}, baseProps, { border: "none", flex: "auto", p: "0" }), `${id}-${name}-${value}-${type}`));
|
|
35
34
|
case 'date':
|
|
36
|
-
return _jsx(ReadOnlyDate, Object.assign({}, baseProps, { name: name, p: "0" }));
|
|
35
|
+
return _jsx(ReadOnlyDate, Object.assign({}, baseProps, { name: name, p: "0" }), `${id}-${name}-${value}-${type}`);
|
|
37
36
|
case 'guidelines':
|
|
38
37
|
return (_jsx(ReadOnlyGuidelines, { name: name, children: children, onClick: onClick }, id));
|
|
39
38
|
case 'item-related':
|
|
@@ -5,7 +5,6 @@ import { fieldIcons } from '../../../../helpers';
|
|
|
5
5
|
export const ReadOnlyGroup = ({ children }) => {
|
|
6
6
|
return (_jsx(Stack, { align: "stretch", spacing: "base", p: "base", borderBottom: "1px dashed", borderColor: "lightBlue.6", children: children === null || children === void 0 ? void 0 : children.map(({ children, id, name, value, type, icon }) => {
|
|
7
7
|
const baseProps = {
|
|
8
|
-
key: `${id}-${name}-${value}-${type}`,
|
|
9
8
|
id,
|
|
10
9
|
value,
|
|
11
10
|
icon: icon && fieldIcons[icon],
|
|
@@ -19,7 +18,7 @@ export const ReadOnlyGroup = ({ children }) => {
|
|
|
19
18
|
case 'select':
|
|
20
19
|
case 'string':
|
|
21
20
|
case 'currency':
|
|
22
|
-
return (_jsx(ReadOnlyInput, Object.assign({}, baseProps, { border: "none", flex: "auto", p: "0" })));
|
|
21
|
+
return (_jsx(ReadOnlyInput, Object.assign({}, baseProps, { border: "none", flex: "auto", p: "0" }), `${id}-${name}-${value}-${type}`));
|
|
23
22
|
case 'date':
|
|
24
23
|
return _jsx(ReadOnlyDate, Object.assign({}, baseProps, { name: name }));
|
|
25
24
|
case 'grid':
|
|
@@ -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
|
@@ -24,7 +24,6 @@ export const ReadOnlyGrid = ({
|
|
|
24
24
|
>
|
|
25
25
|
{children?.map(({ children, id, name, value, type, icon }) => {
|
|
26
26
|
const baseProps = {
|
|
27
|
-
key: `${id}-${name}-${value}-${type}`,
|
|
28
27
|
id,
|
|
29
28
|
value,
|
|
30
29
|
icon: icon && (fieldIcons[icon] as IconTypes),
|
|
@@ -39,10 +38,10 @@ export const ReadOnlyGrid = ({
|
|
|
39
38
|
case 'string':
|
|
40
39
|
case 'currency':
|
|
41
40
|
return (
|
|
42
|
-
<ReadOnlyInput {...baseProps} border="none" flex="auto" p="0" />
|
|
41
|
+
<ReadOnlyInput key={`${id}-${name}-${value}-${type}`} {...baseProps} border="none" flex="auto" p="0" />
|
|
43
42
|
)
|
|
44
43
|
case 'date':
|
|
45
|
-
return <ReadOnlyDate {...baseProps} name={name} p="0" />
|
|
44
|
+
return <ReadOnlyDate key={`${id}-${name}-${value}-${type}`} {...baseProps} name={name} p="0" />
|
|
46
45
|
|
|
47
46
|
case 'guidelines':
|
|
48
47
|
return (
|
|
@@ -3,7 +3,7 @@ import { IconTypes, ReportI } from '@/interfaces'
|
|
|
3
3
|
import { ReadOnlyDate, ReadOnlyGrid, ReadOnlyInput } from '@/components'
|
|
4
4
|
import { fieldIcons } from '@/helpers'
|
|
5
5
|
|
|
6
|
-
export const ReadOnlyGroup = ({ children
|
|
6
|
+
export const ReadOnlyGroup = ({ children}: Pick<ReportI, 'children'>) => {
|
|
7
7
|
return (
|
|
8
8
|
<Stack
|
|
9
9
|
align="stretch"
|
|
@@ -14,7 +14,6 @@ export const ReadOnlyGroup = ({ children }: Pick<ReportI, 'children'>) => {
|
|
|
14
14
|
>
|
|
15
15
|
{children?.map(({ children, id, name, value, type, icon }) => {
|
|
16
16
|
const baseProps = {
|
|
17
|
-
key: `${id}-${name}-${value}-${type}`,
|
|
18
17
|
id,
|
|
19
18
|
value,
|
|
20
19
|
icon: icon && (fieldIcons[icon] as IconTypes),
|
|
@@ -29,7 +28,7 @@ export const ReadOnlyGroup = ({ children }: Pick<ReportI, 'children'>) => {
|
|
|
29
28
|
case 'string':
|
|
30
29
|
case 'currency':
|
|
31
30
|
return (
|
|
32
|
-
<ReadOnlyInput {...baseProps} border="none" flex="auto" p="0" />
|
|
31
|
+
<ReadOnlyInput key={`${id}-${name}-${value}-${type}`} {...baseProps} border="none" flex="auto" p="0" />
|
|
33
32
|
)
|
|
34
33
|
case 'date':
|
|
35
34
|
return <ReadOnlyDate {...baseProps} name={name} />
|
|
@@ -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">
|