@homefile/components-v2 2.34.0 → 2.34.1
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/propertyTiles/propertyRecords/RecordsRow.d.ts +3 -1
- package/dist/components/propertyTiles/propertyRecords/RecordsRow.js +2 -2
- package/dist/components/propertyTiles/propertyRecords/RecordsSession.d.ts +1 -1
- package/dist/components/propertyTiles/propertyRecords/RecordsSession.js +3 -3
- package/dist/components/wizard/index.d.ts +1 -0
- package/dist/components/wizard/index.js +1 -0
- package/dist/helpers/propertyTiles/PropertyRecords.helper.d.ts +2 -1
- package/dist/helpers/propertyTiles/PropertyRecords.helper.js +29 -12
- package/dist/interfaces/propertyTiles/RecordsSession.interface.d.ts +3 -0
- package/dist/mocks/propertyTiles/details.d.ts +3 -1
- package/dist/mocks/propertyTiles/details.js +3 -1
- package/package.json +1 -1
- package/src/components/propertyTiles/propertyRecords/RecordsRow.tsx +10 -2
- package/src/components/propertyTiles/propertyRecords/RecordsSession.tsx +7 -4
- package/src/components/wizard/index.ts +1 -0
- package/src/helpers/propertyTiles/PropertyRecords.helper.ts +30 -9
- package/src/interfaces/propertyTiles/RecordsSession.interface.ts +3 -0
- package/src/mocks/propertyTiles/details.ts +10 -1
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { RecordsSessionI } from '../../../interfaces';
|
|
2
|
-
export declare const RecordsRow: ({ label, value }: RecordsSessionI["details"]
|
|
2
|
+
export declare const RecordsRow: ({ label, value, textAlign, }: RecordsSessionI["details"] & {
|
|
3
|
+
textAlign?: "left" | "right";
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { GridItem, Text } from '@chakra-ui/react';
|
|
3
|
-
export const RecordsRow = ({ label, value }) => {
|
|
4
|
-
return (_jsxs(_Fragment, { children: [_jsx(GridItem, { children: _jsx(Text, { fontFamily: "secondary", color: "gray.2", textTransform: "capitalize", children: label }) }), _jsx(GridItem, { children: _jsx(Text, { fontFamily: "secondary", textTransform: "capitalize", children: value }) })] }));
|
|
3
|
+
export const RecordsRow = ({ label, value, textAlign = 'left', }) => {
|
|
4
|
+
return (_jsxs(_Fragment, { children: [_jsx(GridItem, { children: _jsx(Text, { fontFamily: "secondary", color: "gray.2", textTransform: "capitalize", children: label }) }), _jsx(GridItem, { children: _jsx(Text, { fontFamily: "secondary", textTransform: "capitalize", textAlign: textAlign, children: value }) })] }));
|
|
5
5
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { RecordsSessionI } from '../../../interfaces';
|
|
2
|
-
export declare const RecordsSession: ({ details, showLine, }: RecordsSessionI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const RecordsSession: ({ details, showLine, gap, textAlign, p, }: RecordsSessionI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Grid } from '@chakra-ui/react';
|
|
3
3
|
import { RecordsRow } from '../..';
|
|
4
|
-
export const RecordsSession = ({ details, showLine = false, }) => {
|
|
5
|
-
const rows = Object.entries(details).map(([label, value = '']) => (_jsx(RecordsRow, { label: label, value: value }, label)));
|
|
6
|
-
return (_jsx(Grid, { templateColumns: "repeat(2, 1fr)", gridGap:
|
|
4
|
+
export const RecordsSession = ({ details, showLine = false, gap = 'base', textAlign = 'left', p = 'base', }) => {
|
|
5
|
+
const rows = Object.entries(details !== null && details !== void 0 ? details : {}).map(([label, value = '']) => (_jsx(RecordsRow, { label: label, value: value, textAlign: textAlign }, label)));
|
|
6
|
+
return (_jsx(Grid, { templateColumns: "repeat(2, 1fr)", gridGap: gap, p: p, borderBottom: "1px solid", borderColor: showLine ? 'lightBlue.2' : 'transparent', children: rows }));
|
|
7
7
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PropertyDetails } from '../../interfaces';
|
|
2
2
|
export declare const propertyRecordsToDB: Record<string, Record<string, string | Record<string, string>>>;
|
|
3
|
-
export declare const propertyRecordsSessions: (data: Partial<PropertyDetails>) => Record<string, Array<Record<string, string | undefined
|
|
3
|
+
export declare const propertyRecordsSessions: (data: Partial<PropertyDetails>) => Record<string, Array<Record<string, string | undefined>>>;
|
|
4
|
+
export declare const propertyRecordsWizardSessions: (data: Partial<PropertyDetails>) => Record<string, Record<string, string | undefined>>;
|
|
4
5
|
export declare const propertyRecordIcons: Record<string, string>;
|
|
5
6
|
export declare const dbDataParser: (key: string, value: string) => boolean | number | string;
|
|
@@ -61,14 +61,14 @@ export const propertyRecordsToDB = {
|
|
|
61
61
|
},
|
|
62
62
|
};
|
|
63
63
|
export const propertyRecordsSessions = (data) => {
|
|
64
|
-
var _a, _b, _c, _d;
|
|
64
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
65
65
|
const flookRisk = (data === null || data === void 0 ? void 0 : data.floodZone)
|
|
66
66
|
? {
|
|
67
67
|
'Flood Zone': (data === null || data === void 0 ? void 0 : data.floodZone) ? 'Yes' : 'No',
|
|
68
68
|
Description: 'floodZoneDescription',
|
|
69
69
|
'Flood Type': capitalize(data === null || data === void 0 ? void 0 : data.floodZoneType),
|
|
70
70
|
}
|
|
71
|
-
:
|
|
71
|
+
: {};
|
|
72
72
|
return {
|
|
73
73
|
summary: [
|
|
74
74
|
{
|
|
@@ -100,10 +100,10 @@ export const propertyRecordsSessions = (data) => {
|
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
Basement: capitalize(data === null || data === void 0 ? void 0 : data.basementType),
|
|
103
|
-
'% Finished': capitalize(data === null || data === void 0 ? void 0 : data.basementFinishedPercent),
|
|
103
|
+
'% Finished': capitalize((_a = data === null || data === void 0 ? void 0 : data.basementFinishedPercent) !== null && _a !== void 0 ? _a : ''),
|
|
104
104
|
'Finished Sqft': capitalize(data === null || data === void 0 ? void 0 : data.basementSquareFeet),
|
|
105
|
-
'% Unfinished': (100 - Number((
|
|
106
|
-
'Unfinished Sqft': capitalize(data === null || data === void 0 ? void 0 : data.basementSquareFeetUnFinished),
|
|
105
|
+
'% Unfinished': (100 - Number((_b = data === null || data === void 0 ? void 0 : data.basementFinishedPercent) !== null && _b !== void 0 ? _b : 100)).toString(),
|
|
106
|
+
'Unfinished Sqft': capitalize((_c = data === null || data === void 0 ? void 0 : data.basementSquareFeetUnFinished) !== null && _c !== void 0 ? _c : ''),
|
|
107
107
|
},
|
|
108
108
|
],
|
|
109
109
|
structure: [
|
|
@@ -119,8 +119,8 @@ export const propertyRecordsSessions = (data) => {
|
|
|
119
119
|
Garage: capitalize(data === null || data === void 0 ? void 0 : data.garageType),
|
|
120
120
|
'Garage Sqft': capitalize(data === null || data === void 0 ? void 0 : data.garageSquareFeet),
|
|
121
121
|
'% Finished': capitalize(data === null || data === void 0 ? void 0 : data.garageSquareFeet),
|
|
122
|
-
'Finished Sqft': capitalize(data === null || data === void 0 ? void 0 : data.garageSquareFeetFinished),
|
|
123
|
-
'% Unfinished': capitalize(data === null || data === void 0 ? void 0 : data.garageSquareFeetUnfinished),
|
|
122
|
+
'Finished Sqft': capitalize((_d = data === null || data === void 0 ? void 0 : data.garageSquareFeetFinished) !== null && _d !== void 0 ? _d : ''),
|
|
123
|
+
'% Unfinished': capitalize((_e = data === null || data === void 0 ? void 0 : data.garageSquareFeetUnfinished) !== null && _e !== void 0 ? _e : ''),
|
|
124
124
|
'Parking Spaces': capitalize(data === null || data === void 0 ? void 0 : data.parkingSpaces),
|
|
125
125
|
'RV Parking': (data === null || data === void 0 ? void 0 : data.rvParking) ? 'Yes' : 'No',
|
|
126
126
|
},
|
|
@@ -133,19 +133,36 @@ export const propertyRecordsSessions = (data) => {
|
|
|
133
133
|
Pool: `${(data === null || data === void 0 ? void 0 : data.pool) ? 'Yes' : 'No'} - ${data === null || data === void 0 ? void 0 : data.poolArea} sqft`,
|
|
134
134
|
},
|
|
135
135
|
{
|
|
136
|
-
Sewage: capitalize(data === null || data === void 0 ? void 0 : data.utilitiesSewageUsage),
|
|
137
|
-
Water: capitalize(data === null || data === void 0 ? void 0 : data.utilitiesWaterSource),
|
|
136
|
+
Sewage: capitalize((_f = data === null || data === void 0 ? void 0 : data.utilitiesSewageUsage) !== null && _f !== void 0 ? _f : ''),
|
|
137
|
+
Water: capitalize((_g = data === null || data === void 0 ? void 0 : data.utilitiesWaterSource) !== null && _g !== void 0 ? _g : ''),
|
|
138
138
|
},
|
|
139
139
|
],
|
|
140
140
|
community: [
|
|
141
141
|
{
|
|
142
|
-
Name: capitalize((
|
|
143
|
-
Type: capitalize((
|
|
144
|
-
Location: capitalize((
|
|
142
|
+
Name: capitalize((_h = data === null || data === void 0 ? void 0 : data.neighborhood) === null || _h === void 0 ? void 0 : _h.name),
|
|
143
|
+
Type: capitalize((_j = data === null || data === void 0 ? void 0 : data.neighborhood) === null || _j === void 0 ? void 0 : _j.type),
|
|
144
|
+
Location: capitalize((_k = data === null || data === void 0 ? void 0 : data.neighborhood) === null || _k === void 0 ? void 0 : _k.center),
|
|
145
145
|
},
|
|
146
146
|
],
|
|
147
147
|
};
|
|
148
148
|
};
|
|
149
|
+
export const propertyRecordsWizardSessions = (data) => {
|
|
150
|
+
var _a, _b;
|
|
151
|
+
return {
|
|
152
|
+
purchasePrice: {
|
|
153
|
+
Type: capitalize(data === null || data === void 0 ? void 0 : data.propertyUse),
|
|
154
|
+
'Year Built': capitalize(data === null || data === void 0 ? void 0 : data.yearBuilt),
|
|
155
|
+
Lot: capitalize(data === null || data === void 0 ? void 0 : data.lotSquareFeet),
|
|
156
|
+
Subdivision: `${capitalize((_a = data === null || data === void 0 ? void 0 : data.neighborhood) === null || _a === void 0 ? void 0 : _a.name) || ''} - ${capitalize((_b = data === null || data === void 0 ? void 0 : data.neighborhood) === null || _b === void 0 ? void 0 : _b.type) || ''}`,
|
|
157
|
+
},
|
|
158
|
+
assessedValue: {
|
|
159
|
+
Bedrooms: capitalize(data === null || data === void 0 ? void 0 : data.bedrooms),
|
|
160
|
+
Bathrooms: capitalize(data === null || data === void 0 ? void 0 : data.bathrooms),
|
|
161
|
+
'Half Bath': capitalize(data === null || data === void 0 ? void 0 : data.partialBathrooms),
|
|
162
|
+
'Total Sqft': String(data === null || data === void 0 ? void 0 : data.buildingSquareFeet),
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
};
|
|
149
166
|
export const propertyRecordIcons = {
|
|
150
167
|
summary: House,
|
|
151
168
|
interior: Building,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { HomeCardRecordsI, PropertyDetails } from '../../interfaces';
|
|
2
2
|
export declare const propertyDetailsMock: PropertyDetails;
|
|
3
|
-
export declare const propertyDetailsMockSmall: Record<string, string | undefined
|
|
3
|
+
export declare const propertyDetailsMockSmall: Record<string, string | undefined>;
|
|
4
|
+
export declare const purchasePriceMock: Record<string, string | undefined>;
|
|
5
|
+
export declare const assessedValueMock: Record<string, string | undefined>;
|
|
4
6
|
export declare const homeBoardRecorsMock: HomeCardRecordsI;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { propertyRecordsSessions } from '../../helpers';
|
|
1
|
+
import { propertyRecordsSessions, propertyRecordsWizardSessions, } from '../../helpers';
|
|
2
2
|
export const propertyDetailsMock = {
|
|
3
3
|
airConditioningType: 'central',
|
|
4
4
|
basementFinishedPercent: '100',
|
|
@@ -57,6 +57,8 @@ export const propertyDetailsMock = {
|
|
|
57
57
|
yearBuilt: 2020,
|
|
58
58
|
};
|
|
59
59
|
export const propertyDetailsMockSmall = propertyRecordsSessions(propertyDetailsMock).summary[0];
|
|
60
|
+
export const purchasePriceMock = propertyRecordsWizardSessions(propertyDetailsMock).purchasePrice;
|
|
61
|
+
export const assessedValueMock = propertyRecordsWizardSessions(propertyDetailsMock).assessedValue;
|
|
60
62
|
export const homeBoardRecorsMock = {
|
|
61
63
|
propertyUse: propertyDetailsMock.propertyUse,
|
|
62
64
|
yearBuilt: propertyDetailsMock.yearBuilt,
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { GridItem, Text } from '@chakra-ui/react'
|
|
2
2
|
import { RecordsSessionI } from '@/interfaces'
|
|
3
3
|
|
|
4
|
-
export const RecordsRow = ({
|
|
4
|
+
export const RecordsRow = ({
|
|
5
|
+
label,
|
|
6
|
+
value,
|
|
7
|
+
textAlign = 'left',
|
|
8
|
+
}: RecordsSessionI['details'] & { textAlign?: 'left' | 'right' }) => {
|
|
5
9
|
return (
|
|
6
10
|
<>
|
|
7
11
|
<GridItem>
|
|
@@ -10,7 +14,11 @@ export const RecordsRow = ({ label, value }: RecordsSessionI['details']) => {
|
|
|
10
14
|
</Text>
|
|
11
15
|
</GridItem>
|
|
12
16
|
<GridItem>
|
|
13
|
-
<Text
|
|
17
|
+
<Text
|
|
18
|
+
fontFamily="secondary"
|
|
19
|
+
textTransform="capitalize"
|
|
20
|
+
textAlign={textAlign}
|
|
21
|
+
>
|
|
14
22
|
{value}
|
|
15
23
|
</Text>
|
|
16
24
|
</GridItem>
|
|
@@ -5,15 +5,18 @@ import { RecordsSessionI } from '@/interfaces'
|
|
|
5
5
|
export const RecordsSession = ({
|
|
6
6
|
details,
|
|
7
7
|
showLine = false,
|
|
8
|
+
gap = 'base',
|
|
9
|
+
textAlign = 'left',
|
|
10
|
+
p = 'base',
|
|
8
11
|
}: RecordsSessionI) => {
|
|
9
|
-
const rows = Object.entries(details).map(([label, value = '']) => (
|
|
10
|
-
<RecordsRow key={label} label={label} value={value} />
|
|
12
|
+
const rows = Object.entries(details ?? {}).map(([label, value = '']) => (
|
|
13
|
+
<RecordsRow key={label} label={label} value={value} textAlign={textAlign} />
|
|
11
14
|
))
|
|
12
15
|
return (
|
|
13
16
|
<Grid
|
|
14
17
|
templateColumns="repeat(2, 1fr)"
|
|
15
|
-
gridGap=
|
|
16
|
-
p=
|
|
18
|
+
gridGap={gap}
|
|
19
|
+
p={p}
|
|
17
20
|
borderBottom="1px solid"
|
|
18
21
|
borderColor={showLine ? 'lightBlue.2' : 'transparent'}
|
|
19
22
|
>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Building, House, HouseHands, Patio } from '@/assets/images'
|
|
2
2
|
import { PropertyDetails } from '@/interfaces'
|
|
3
3
|
|
|
4
|
-
const capitalize = (str?: string | number
|
|
4
|
+
const capitalize = (str?: string | number) => {
|
|
5
5
|
if (!str) return ''
|
|
6
6
|
return str.toString().charAt(0).toUpperCase() + str.toString().slice(1)
|
|
7
7
|
}
|
|
@@ -68,14 +68,14 @@ export const propertyRecordsToDB: Record<
|
|
|
68
68
|
|
|
69
69
|
export const propertyRecordsSessions = (
|
|
70
70
|
data: Partial<PropertyDetails>
|
|
71
|
-
): Record<string, Array<Record<string, string | undefined
|
|
71
|
+
): Record<string, Array<Record<string, string | undefined>>> => {
|
|
72
72
|
const flookRisk = data?.floodZone
|
|
73
73
|
? {
|
|
74
74
|
'Flood Zone': data?.floodZone ? 'Yes' : 'No',
|
|
75
75
|
Description: 'floodZoneDescription',
|
|
76
76
|
'Flood Type': capitalize(data?.floodZoneType),
|
|
77
77
|
}
|
|
78
|
-
:
|
|
78
|
+
: {}
|
|
79
79
|
return {
|
|
80
80
|
summary: [
|
|
81
81
|
{
|
|
@@ -107,12 +107,12 @@ export const propertyRecordsSessions = (
|
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
109
|
Basement: capitalize(data?.basementType),
|
|
110
|
-
'% Finished': capitalize(data?.basementFinishedPercent),
|
|
110
|
+
'% Finished': capitalize(data?.basementFinishedPercent ?? ''),
|
|
111
111
|
'Finished Sqft': capitalize(data?.basementSquareFeet),
|
|
112
112
|
'% Unfinished': (
|
|
113
113
|
100 - Number(data?.basementFinishedPercent ?? 100)
|
|
114
114
|
).toString(),
|
|
115
|
-
'Unfinished Sqft': capitalize(data?.basementSquareFeetUnFinished),
|
|
115
|
+
'Unfinished Sqft': capitalize(data?.basementSquareFeetUnFinished ?? ''),
|
|
116
116
|
},
|
|
117
117
|
],
|
|
118
118
|
structure: [
|
|
@@ -128,8 +128,8 @@ export const propertyRecordsSessions = (
|
|
|
128
128
|
Garage: capitalize(data?.garageType),
|
|
129
129
|
'Garage Sqft': capitalize(data?.garageSquareFeet),
|
|
130
130
|
'% Finished': capitalize(data?.garageSquareFeet),
|
|
131
|
-
'Finished Sqft': capitalize(data?.garageSquareFeetFinished),
|
|
132
|
-
'% Unfinished': capitalize(data?.garageSquareFeetUnfinished),
|
|
131
|
+
'Finished Sqft': capitalize(data?.garageSquareFeetFinished ?? ''),
|
|
132
|
+
'% Unfinished': capitalize(data?.garageSquareFeetUnfinished ?? ''),
|
|
133
133
|
'Parking Spaces': capitalize(data?.parkingSpaces),
|
|
134
134
|
'RV Parking': data?.rvParking ? 'Yes' : 'No',
|
|
135
135
|
},
|
|
@@ -144,8 +144,8 @@ export const propertyRecordsSessions = (
|
|
|
144
144
|
Pool: `${data?.pool ? 'Yes' : 'No'} - ${data?.poolArea} sqft`,
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
|
-
Sewage: capitalize(data?.utilitiesSewageUsage),
|
|
148
|
-
Water: capitalize(data?.utilitiesWaterSource),
|
|
147
|
+
Sewage: capitalize(data?.utilitiesSewageUsage ?? ''),
|
|
148
|
+
Water: capitalize(data?.utilitiesWaterSource ?? ''),
|
|
149
149
|
},
|
|
150
150
|
],
|
|
151
151
|
community: [
|
|
@@ -158,6 +158,27 @@ export const propertyRecordsSessions = (
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
export const propertyRecordsWizardSessions = (
|
|
162
|
+
data: Partial<PropertyDetails>
|
|
163
|
+
): Record<string, Record<string, string | undefined>> => {
|
|
164
|
+
return {
|
|
165
|
+
purchasePrice: {
|
|
166
|
+
Type: capitalize(data?.propertyUse),
|
|
167
|
+
'Year Built': capitalize(data?.yearBuilt),
|
|
168
|
+
Lot: capitalize(data?.lotSquareFeet),
|
|
169
|
+
Subdivision: `${capitalize(data?.neighborhood?.name) || ''} - ${
|
|
170
|
+
capitalize(data?.neighborhood?.type) || ''
|
|
171
|
+
}`,
|
|
172
|
+
},
|
|
173
|
+
assessedValue: {
|
|
174
|
+
Bedrooms: capitalize(data?.bedrooms),
|
|
175
|
+
Bathrooms: capitalize(data?.bathrooms),
|
|
176
|
+
'Half Bath': capitalize(data?.partialBathrooms),
|
|
177
|
+
'Total Sqft': String(data?.buildingSquareFeet),
|
|
178
|
+
},
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
161
182
|
export const propertyRecordIcons: Record<string, string> = {
|
|
162
183
|
summary: House,
|
|
163
184
|
interior: Building,
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
propertyRecordsSessions,
|
|
3
|
+
propertyRecordsWizardSessions,
|
|
4
|
+
} from '@/helpers'
|
|
2
5
|
import { HomeCardRecordsI, PropertyDetails } from '@/interfaces'
|
|
3
6
|
|
|
4
7
|
export const propertyDetailsMock: PropertyDetails = {
|
|
@@ -62,6 +65,12 @@ export const propertyDetailsMock: PropertyDetails = {
|
|
|
62
65
|
export const propertyDetailsMockSmall =
|
|
63
66
|
propertyRecordsSessions(propertyDetailsMock).summary[0]
|
|
64
67
|
|
|
68
|
+
export const purchasePriceMock =
|
|
69
|
+
propertyRecordsWizardSessions(propertyDetailsMock).purchasePrice
|
|
70
|
+
|
|
71
|
+
export const assessedValueMock =
|
|
72
|
+
propertyRecordsWizardSessions(propertyDetailsMock).assessedValue
|
|
73
|
+
|
|
65
74
|
export const homeBoardRecorsMock: HomeCardRecordsI = {
|
|
66
75
|
propertyUse: propertyDetailsMock.propertyUse,
|
|
67
76
|
yearBuilt: propertyDetailsMock.yearBuilt,
|