@homefile/components-v2 2.17.4 → 2.19.0
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/assets/images/filter-size.png +0 -0
- package/dist/assets/images/index.d.ts +2 -1
- package/dist/assets/images/index.js +2 -1
- package/dist/assets/images/index.ts +2 -0
- package/dist/components/homeAssistant/monitorAlerts/BackendAlert.js +13 -5
- package/dist/components/homeAssistant/monitorAlerts/BackendAlertCard.js +1 -1
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/AlertFields.d.ts +2 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/AlertFields.js +23 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/FilterSize.d.ts +2 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/FilterSize.js +6 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/SearchField.d.ts +2 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/SearchField.js +27 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/VideoDetail.d.ts +2 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/VideoDetail.js +5 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/index.d.ts +4 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/index.js +4 -0
- package/dist/helpers/forms/dynamicForm.helper.js +3 -2
- package/dist/interfaces/forms/dynamicForm/DynamicForm.interface.d.ts +3 -3
- package/dist/interfaces/headers/TabsHeader.interface.d.ts +3 -4
- package/dist/interfaces/homeAssistant/BackendAlert.interface.d.ts +1 -1
- package/dist/interfaces/inputs/SearchInput.interface.d.ts +2 -2
- package/dist/mocks/forms/dynamicForm.mock.js +79 -1
- package/package.json +1 -1
- package/src/assets/images/filter-size.png +0 -0
- package/src/assets/images/index.ts +2 -0
- package/src/components/forms/dynamicForm/fields/TextField.tsx +1 -1
- package/src/components/homeAssistant/monitorAlerts/BackendAlert.tsx +19 -7
- package/src/components/homeAssistant/monitorAlerts/BackendAlertCard.tsx +1 -3
- package/src/components/homeAssistant/monitorAlerts/alertDetails/AlertFields.tsx +37 -0
- package/src/components/homeAssistant/monitorAlerts/alertDetails/FilterSize.tsx +19 -0
- package/src/components/homeAssistant/monitorAlerts/alertDetails/SearchField.tsx +36 -0
- package/src/components/homeAssistant/monitorAlerts/alertDetails/VideoDetail.tsx +20 -0
- package/src/components/homeAssistant/monitorAlerts/alertDetails/index.ts +4 -0
- package/src/helpers/forms/dynamicForm.helper.ts +4 -2
- package/src/interfaces/forms/dynamicForm/DynamicForm.interface.ts +4 -0
- package/src/interfaces/headers/TabsHeader.interface.ts +3 -3
- package/src/interfaces/homeAssistant/BackendAlert.interface.ts +1 -6
- package/src/interfaces/inputs/SearchInput.interface.ts +3 -3
- package/src/mocks/forms/dynamicForm.mock.ts +83 -1
|
Binary file
|
|
@@ -53,6 +53,7 @@ import Exclamation from './exclamation.svg';
|
|
|
53
53
|
import Face from './face.svg';
|
|
54
54
|
import Feedback from './feedback.svg';
|
|
55
55
|
import FileUploading from './file-uploading.svg';
|
|
56
|
+
import FilterSize from './filter-size.png';
|
|
56
57
|
import Finance from './finance.svg';
|
|
57
58
|
import Fire from './fire.svg';
|
|
58
59
|
import Flag from './flag.png';
|
|
@@ -161,7 +162,7 @@ import WizardDetailed from './wizard-detailed.svg';
|
|
|
161
162
|
import WizardQuick from './wizard-quick.svg';
|
|
162
163
|
import YellowFolder from './yellow-folder.svg';
|
|
163
164
|
import YellowFolderUnshared from './yellow-folder-unshared.svg';
|
|
164
|
-
export { AlertDelete, AlertDeletePurple, Arrow, Batery, Bathroom, Battery, Battery2, Bedroom, BgBlue, BgLogo, Billing, BillingAddress, BlueFolder, BlueFolderShared, BookOpened, Box, Building, Calc, Calendar2, Catalog, ChatBubble, Check, CheckInCircle, CheckPen, Chemistry, CircleFace, Cleaning, Closet, Clouds, Co2, Company, Company2, ComputerReport, Confirmation, Construction, Contacts, Contacts2, Contributor, Create, CreditCard, Detector, Diamond, DiningRoom, DocIcon, Document, Document2, Drop, DropCalendar, Electricity, Entryway, EstValue, Exclamation, Face, Feedback, FileUploading, Finance, Fire, Flag, FormSent, Foundation, Garage, GearPencil, GearTime, GenericField, GlassWater, GreenFolder, Group, Groups, GuestBedroom, Hallway, HandPencil, Heater, Help, HomeAddress, Homeowner, House, HouseHands, IA, ImageDefault, ImgIcon, Inbox, Insect, Kitchen, Laundry, Light, LivingRoom, Loading, Location, LogoCompany, LogoSmall, MagnifyingGlassReport, Manager, MasterBedroom, Member, Message, MobileDrop, Money, Mudroom, NeedHelp, Office, Painting, PartnerGeneric, Patio, PdfIcon, PersonMail, Plate, Play, Plus, Pool, Pool2, PressureWasher, Price, Profile, ProgressReport, Proposal, RealEstate, Receipt, ReceiptBg, ReceiptHouse, Receipts, Recipient, Records, Register, RelationshipHome, ResendPassword, Rocket, Roof2, Security, Send, ShareHome, ShareWith, SixtyEight, SMS, Social, SolarPanel, Speaker, Sprinkler, Structure, Subscription, Target, Temperature, Theatre, Thumbnail, ThumbnailSmall, ThumbUp, Trash, Trees, TreesCrop, TreesCrop2, VideoIcon, VideoPlay, VioletFolder, Warning, Warranty, WellDone, WholeHome, Wind, WindWhite, Wizard, WizardDetailed, WizardQuick, YellowFolder, YellowFolderUnshared, };
|
|
165
|
+
export { AlertDelete, AlertDeletePurple, Arrow, Batery, Bathroom, Battery, Battery2, Bedroom, BgBlue, BgLogo, Billing, BillingAddress, BlueFolder, BlueFolderShared, BookOpened, Box, Building, Calc, Calendar2, Catalog, ChatBubble, Check, CheckInCircle, CheckPen, Chemistry, CircleFace, Cleaning, Closet, Clouds, Co2, Company, Company2, ComputerReport, Confirmation, Construction, Contacts, Contacts2, Contributor, Create, CreditCard, Detector, Diamond, DiningRoom, DocIcon, Document, Document2, Drop, DropCalendar, Electricity, Entryway, EstValue, Exclamation, Face, Feedback, FileUploading, FilterSize, Finance, Fire, Flag, FormSent, Foundation, Garage, GearPencil, GearTime, GenericField, GlassWater, GreenFolder, Group, Groups, GuestBedroom, Hallway, HandPencil, Heater, Help, HomeAddress, Homeowner, House, HouseHands, IA, ImageDefault, ImgIcon, Inbox, Insect, Kitchen, Laundry, Light, LivingRoom, Loading, Location, LogoCompany, LogoSmall, MagnifyingGlassReport, Manager, MasterBedroom, Member, Message, MobileDrop, Money, Mudroom, NeedHelp, Office, Painting, PartnerGeneric, Patio, PdfIcon, PersonMail, Plate, Play, Plus, Pool, Pool2, PressureWasher, Price, Profile, ProgressReport, Proposal, RealEstate, Receipt, ReceiptBg, ReceiptHouse, Receipts, Recipient, Records, Register, RelationshipHome, ResendPassword, Rocket, Roof2, Security, Send, ShareHome, ShareWith, SixtyEight, SMS, Social, SolarPanel, Speaker, Sprinkler, Structure, Subscription, Target, Temperature, Theatre, Thumbnail, ThumbnailSmall, ThumbUp, Trash, Trees, TreesCrop, TreesCrop2, VideoIcon, VideoPlay, VioletFolder, Warning, Warranty, WellDone, WholeHome, Wind, WindWhite, Wizard, WizardDetailed, WizardQuick, YellowFolder, YellowFolderUnshared, };
|
|
165
166
|
export * from './alerts';
|
|
166
167
|
export * from './animations';
|
|
167
168
|
export * from './appliances';
|
|
@@ -53,6 +53,7 @@ import Exclamation from './exclamation.svg';
|
|
|
53
53
|
import Face from './face.svg';
|
|
54
54
|
import Feedback from './feedback.svg';
|
|
55
55
|
import FileUploading from './file-uploading.svg';
|
|
56
|
+
import FilterSize from './filter-size.png';
|
|
56
57
|
import Finance from './finance.svg';
|
|
57
58
|
import Fire from './fire.svg';
|
|
58
59
|
import Flag from './flag.png';
|
|
@@ -161,7 +162,7 @@ import WizardDetailed from './wizard-detailed.svg';
|
|
|
161
162
|
import WizardQuick from './wizard-quick.svg';
|
|
162
163
|
import YellowFolder from './yellow-folder.svg';
|
|
163
164
|
import YellowFolderUnshared from './yellow-folder-unshared.svg';
|
|
164
|
-
export { AlertDelete, AlertDeletePurple, Arrow, Batery, Bathroom, Battery, Battery2, Bedroom, BgBlue, BgLogo, Billing, BillingAddress, BlueFolder, BlueFolderShared, BookOpened, Box, Building, Calc, Calendar2, Catalog, ChatBubble, Check, CheckInCircle, CheckPen, Chemistry, CircleFace, Cleaning, Closet, Clouds, Co2, Company, Company2, ComputerReport, Confirmation, Construction, Contacts, Contacts2, Contributor, Create, CreditCard, Detector, Diamond, DiningRoom, DocIcon, Document, Document2, Drop, DropCalendar, Electricity, Entryway, EstValue, Exclamation, Face, Feedback, FileUploading, Finance, Fire, Flag, FormSent, Foundation, Garage, GearPencil, GearTime, GenericField, GlassWater, GreenFolder, Group, Groups, GuestBedroom, Hallway, HandPencil, Heater, Help, HomeAddress, Homeowner, House, HouseHands, IA, ImageDefault, ImgIcon, Inbox, Insect, Kitchen, Laundry, Light, LivingRoom, Loading, Location, LogoCompany, LogoSmall, MagnifyingGlassReport, Manager, MasterBedroom, Member, Message, MobileDrop, Money, Mudroom, NeedHelp, Office, Painting, PartnerGeneric, Patio, PdfIcon, PersonMail, Plate, Play, Plus, Pool, Pool2, PressureWasher, Price, Profile, ProgressReport, Proposal, RealEstate, Receipt, ReceiptBg, ReceiptHouse, Receipts, Recipient, Records, Register, RelationshipHome, ResendPassword, Rocket, Roof2, Security, Send, ShareHome, ShareWith, SixtyEight, SMS, Social, SolarPanel, Speaker, Sprinkler, Structure, Subscription, Target, Temperature, Theatre, Thumbnail, ThumbnailSmall, ThumbUp, Trash, Trees, TreesCrop, TreesCrop2, VideoIcon, VideoPlay, VioletFolder, Warning, Warranty, WellDone, WholeHome, Wind, WindWhite, Wizard, WizardDetailed, WizardQuick, YellowFolder, YellowFolderUnshared, };
|
|
165
|
+
export { AlertDelete, AlertDeletePurple, Arrow, Batery, Bathroom, Battery, Battery2, Bedroom, BgBlue, BgLogo, Billing, BillingAddress, BlueFolder, BlueFolderShared, BookOpened, Box, Building, Calc, Calendar2, Catalog, ChatBubble, Check, CheckInCircle, CheckPen, Chemistry, CircleFace, Cleaning, Closet, Clouds, Co2, Company, Company2, ComputerReport, Confirmation, Construction, Contacts, Contacts2, Contributor, Create, CreditCard, Detector, Diamond, DiningRoom, DocIcon, Document, Document2, Drop, DropCalendar, Electricity, Entryway, EstValue, Exclamation, Face, Feedback, FileUploading, FilterSize, Finance, Fire, Flag, FormSent, Foundation, Garage, GearPencil, GearTime, GenericField, GlassWater, GreenFolder, Group, Groups, GuestBedroom, Hallway, HandPencil, Heater, Help, HomeAddress, Homeowner, House, HouseHands, IA, ImageDefault, ImgIcon, Inbox, Insect, Kitchen, Laundry, Light, LivingRoom, Loading, Location, LogoCompany, LogoSmall, MagnifyingGlassReport, Manager, MasterBedroom, Member, Message, MobileDrop, Money, Mudroom, NeedHelp, Office, Painting, PartnerGeneric, Patio, PdfIcon, PersonMail, Plate, Play, Plus, Pool, Pool2, PressureWasher, Price, Profile, ProgressReport, Proposal, RealEstate, Receipt, ReceiptBg, ReceiptHouse, Receipts, Recipient, Records, Register, RelationshipHome, ResendPassword, Rocket, Roof2, Security, Send, ShareHome, ShareWith, SixtyEight, SMS, Social, SolarPanel, Speaker, Sprinkler, Structure, Subscription, Target, Temperature, Theatre, Thumbnail, ThumbnailSmall, ThumbUp, Trash, Trees, TreesCrop, TreesCrop2, VideoIcon, VideoPlay, VioletFolder, Warning, Warranty, WellDone, WholeHome, Wind, WindWhite, Wizard, WizardDetailed, WizardQuick, YellowFolder, YellowFolderUnshared, };
|
|
165
166
|
export * from './alerts';
|
|
166
167
|
export * from './animations';
|
|
167
168
|
export * from './appliances';
|
|
@@ -53,6 +53,7 @@ import Exclamation from './exclamation.svg'
|
|
|
53
53
|
import Face from './face.svg'
|
|
54
54
|
import Feedback from './feedback.svg'
|
|
55
55
|
import FileUploading from './file-uploading.svg'
|
|
56
|
+
import FilterSize from './filter-size.png'
|
|
56
57
|
import Finance from './finance.svg'
|
|
57
58
|
import Fire from './fire.svg'
|
|
58
59
|
import Flag from './flag.png'
|
|
@@ -218,6 +219,7 @@ export {
|
|
|
218
219
|
Face,
|
|
219
220
|
Feedback,
|
|
220
221
|
FileUploading,
|
|
222
|
+
FilterSize,
|
|
221
223
|
Finance,
|
|
222
224
|
Fire,
|
|
223
225
|
Flag,
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { BackendAlertCard } from '../..';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AlertFields, BackendAlertCard, TabsHeader } from '../..';
|
|
3
3
|
import { getCategoryStyles } from '../../../utils/Alerts.utils';
|
|
4
|
+
import { Divider } from '@chakra-ui/react';
|
|
4
5
|
export const BackendAlert = ({ category, form }) => {
|
|
5
|
-
var _a, _b, _c;
|
|
6
|
+
var _a, _b, _c, _d, _e;
|
|
6
7
|
const { headerBg, alertIcon, alertIconBg, alertTitle } = getCategoryStyles(category);
|
|
7
|
-
const
|
|
8
|
-
|
|
8
|
+
const alert = form === null || form === void 0 ? void 0 : form.find((item) => item.type === 'alert');
|
|
9
|
+
const tabs = (_b = (_a = alert === null || alert === void 0 ? void 0 : alert.children) === null || _a === void 0 ? void 0 : _a.map((tab) => {
|
|
10
|
+
var _a;
|
|
11
|
+
return ({
|
|
12
|
+
label: tab.name,
|
|
13
|
+
component: _jsx(AlertFields, { fields: (_a = tab.children) !== null && _a !== void 0 ? _a : [] }),
|
|
14
|
+
});
|
|
15
|
+
})) !== null && _b !== void 0 ? _b : [];
|
|
16
|
+
return (_jsxs(BackendAlertCard, { alertBg: headerBg, alertIcon: alertIcon, alertTitle: alertTitle, bg: alertIconBg, icon: (_c = alert === null || alert === void 0 ? void 0 : alert.icon) !== null && _c !== void 0 ? _c : '', title: (_d = alert === null || alert === void 0 ? void 0 : alert.label) !== null && _d !== void 0 ? _d : '', description: (_e = alert === null || alert === void 0 ? void 0 : alert.description) !== null && _e !== void 0 ? _e : '', children: [_jsx(Divider, {}), _jsx(TabsHeader, { tabList: tabs })] }));
|
|
9
17
|
};
|
|
@@ -18,5 +18,5 @@ import { fieldIcons } from '../../../helpers';
|
|
|
18
18
|
export const BackendAlertCard = (_a) => {
|
|
19
19
|
var { alertBg = 'error.2', alertIcon = Warranty, alertTitle = t('homeAssistant.monitorAlerts.protection'), children, icon = 'warning' } = _a, props = __rest(_a, ["alertBg", "alertIcon", "alertTitle", "children", "icon"]);
|
|
20
20
|
const { isOpen, onToggle } = useDisclosure();
|
|
21
|
-
return (_jsxs(Box, { display: "flex", flexDir: "column", bg: "neutral.white", boxShadow: "lg", borderRadius: "lg", overflow: "hidden", maxW: "420px", children: [_jsx(AlertHeader, { bg: alertBg }), _jsx(AlertTitle, { alertIcon: alertIcon, alertTitle: alertTitle }), _jsx(AlertTemplate, Object.assign({}, props, { icon: fieldIcons[icon] })), _jsx(Collapse, { in: isOpen, animateOpacity: true, children: _jsx(Box, {
|
|
21
|
+
return (_jsxs(Box, { display: "flex", flexDir: "column", bg: "neutral.white", boxShadow: "lg", borderRadius: "lg", overflow: "hidden", maxW: "420px", children: [_jsx(AlertHeader, { bg: alertBg }), _jsx(AlertTitle, { alertIcon: alertIcon, alertTitle: alertTitle }), _jsx(AlertTemplate, Object.assign({}, props, { icon: fieldIcons[icon] })), _jsx(Collapse, { in: isOpen, animateOpacity: true, children: _jsx(Box, { bg: "lightBlue.1", children: children }) }), _jsx(Flex, { py: "base", bg: "lightBlue.1", justify: "flex-end", children: _jsx(Button, { variant: "leftRounded", w: "fit-content", px: "8", fontSize: "sm", fontWeight: "medium", onClick: onToggle, bg: isOpen ? 'blue.8' : 'blue.2', children: t(`homeAssistant.monitorAlerts.${isOpen ? 'collapse' : 'review'}`) }) })] }));
|
|
22
22
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createElement as _createElement } from "react";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Stack, Text } from '@chakra-ui/react';
|
|
4
|
+
import { FilterSize, SearchField, VideoDetail } from '../../..';
|
|
5
|
+
import { fieldIcons } from '../../../../helpers';
|
|
6
|
+
export const AlertFields = ({ fields, callback }) => {
|
|
7
|
+
return (_jsx(Stack, { spacing: "base", p: "base", children: fields === null || fields === void 0 ? void 0 : fields.map((field) => {
|
|
8
|
+
const { id, type, value, icon } = field;
|
|
9
|
+
const mappedIcon = icon && fieldIcons[icon];
|
|
10
|
+
switch (type) {
|
|
11
|
+
case 'text':
|
|
12
|
+
return (_jsx(Text, { fontSize: "sm", fontFamily: "secondary", lineHeight: "1.2", whiteSpace: "pre-line", children: String(value) }, id));
|
|
13
|
+
case 'video':
|
|
14
|
+
return _createElement(VideoDetail, Object.assign({}, field, { key: id }));
|
|
15
|
+
case 'filter-size':
|
|
16
|
+
return _createElement(FilterSize, Object.assign({}, field, { key: id, icon: mappedIcon }));
|
|
17
|
+
case 'search':
|
|
18
|
+
return _createElement(SearchField, Object.assign({}, field, { key: id, callback: callback }));
|
|
19
|
+
default:
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}) }));
|
|
23
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Flex, Image, Stack, Text } from '@chakra-ui/react';
|
|
3
|
+
import { CustomDivider } from '../../..';
|
|
4
|
+
export const FilterSize = ({ name, icon, value }) => {
|
|
5
|
+
return (_jsxs(Stack, { spacing: "base", children: [_jsx(CustomDivider, {}), _jsx(Text, { fontWeight: "semibold", children: name }), _jsxs(Flex, { gap: "base", children: [_jsx(Image, { boxSize: "86px", src: icon }), _jsx(Text, { fontSize: "sm", fontFamily: "secondary", lineHeight: "1.2", children: value })] }), _jsx(CustomDivider, {})] }));
|
|
6
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Stack, Text } from '@chakra-ui/react';
|
|
14
|
+
import { SearchInput } from '../../..';
|
|
15
|
+
import { useState } from 'react';
|
|
16
|
+
export const SearchField = (_a) => {
|
|
17
|
+
var { callback, description } = _a, props = __rest(_a, ["callback", "description"]);
|
|
18
|
+
const [search, setSearch] = useState('');
|
|
19
|
+
const handleSearch = (value) => {
|
|
20
|
+
callback === null || callback === void 0 ? void 0 : callback(Object.assign(Object.assign({}, props), { value }));
|
|
21
|
+
};
|
|
22
|
+
return (_jsxs(Stack, { spacing: "base", children: [_jsx(Text, { fontSize: "sm", fontFamily: "secondary", lineHeight: "1.2", children: description }), _jsx(SearchInput, { onChange: (e) => setSearch(e.target.value), value: search, maxW: "full", onBlur: () => handleSearch(search), onKeyDown: (e) => {
|
|
23
|
+
if (e.key === 'Enter') {
|
|
24
|
+
handleSearch(search);
|
|
25
|
+
}
|
|
26
|
+
} })] }));
|
|
27
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AspectRatio, Box, Container, Flex, Text } from '@chakra-ui/react';
|
|
3
|
+
export const VideoDetail = ({ name, label, link, description }) => {
|
|
4
|
+
return (_jsx(Container, { p: "base", children: _jsxs(Flex, { gap: "base", children: [_jsx(AspectRatio, { w: "140px", ratio: 16 / 9, children: _jsx("iframe", { title: name, src: link, allowFullScreen: true }) }), _jsxs(Box, { children: [_jsx(Text, { fontWeight: "semibold", children: name }), _jsx(Text, { fontSize: "sm", fontFamily: "secondary", children: `${label} | ${description}` })] })] }) }));
|
|
5
|
+
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
export * from './AlertFields';
|
|
1
2
|
export * from './ChangeAirFilter';
|
|
2
3
|
export * from './CustomDivider';
|
|
4
|
+
export * from './FilterSize';
|
|
5
|
+
export * from './SearchField';
|
|
3
6
|
export * from './SmokeDetectorBattery';
|
|
4
7
|
export * from './SmokeDetectorExpired';
|
|
8
|
+
export * from './VideoDetail';
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
export * from './AlertFields';
|
|
1
2
|
export * from './ChangeAirFilter';
|
|
2
3
|
export * from './CustomDivider';
|
|
4
|
+
export * from './FilterSize';
|
|
5
|
+
export * from './SearchField';
|
|
3
6
|
export * from './SmokeDetectorBattery';
|
|
4
7
|
export * from './SmokeDetectorExpired';
|
|
8
|
+
export * from './VideoDetail';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Paint, Receipt, Barcode, GoldenBars, Heart, Rating, Notes, Book, ImgIcon, Registry, ShareWith, Calendar, Contacts, Tools2, Billing, Calc, CheckPen, GenericField, Price, Battery2, Co2, Detector, Electricity, Sprinkler, SixtyEight, DropCalendar, MobileDrop, SolarPanel, Calendar2, Drop, Wind, Foundation, Heater, Light, Plate, Pool2, Closet, Structure, GlassWater, Roof2, Target, CircleFace, Pressure, WindowCleaning, RoofCleaning, HolidayLights, GutterCleaning, HomeCleaning, HouseWashing, PressureWasher, BookOpened, Company2, AADisease, AADressing, AALawn, AAMowing, AAWeed, AApest } from '../../assets/images';
|
|
1
|
+
import { Paint, Receipt, Barcode, GoldenBars, Heart, Rating, Notes, Book, ImgIcon, Registry, ShareWith, Calendar, Contacts, Tools2, Billing, Calc, CheckPen, GenericField, Price, Battery2, Co2, Detector, Electricity, Sprinkler, SixtyEight, DropCalendar, MobileDrop, SolarPanel, Calendar2, Drop, Wind, Foundation, Heater, Light, Plate, Pool2, Closet, Structure, GlassWater, Roof2, Target, CircleFace, Pressure, WindowCleaning, RoofCleaning, HolidayLights, GutterCleaning, HomeCleaning, HouseWashing, PressureWasher, BookOpened, Company2, AADisease, AADressing, AALawn, AAMowing, AAWeed, AApest, FilterSize, } from '../../assets/images';
|
|
2
2
|
export const fieldIcons = {
|
|
3
3
|
barcode: Barcode,
|
|
4
4
|
billing: Billing,
|
|
@@ -58,5 +58,6 @@ export const fieldIcons = {
|
|
|
58
58
|
'aa-disease': AADisease,
|
|
59
59
|
'aa-weed': AAWeed,
|
|
60
60
|
'aa-dressing': AADressing,
|
|
61
|
-
'aa-pest': AApest
|
|
61
|
+
'aa-pest': AApest,
|
|
62
|
+
'filter-size': FilterSize,
|
|
62
63
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AIGridFieldI, AlertFieldType, FolderFileI, MenuItemI, PartnerFooterI, TileCtaI } from '../..';
|
|
2
|
-
export type KindTypes = 'ai-image' | 'ai-grid' | 'checkbox' | 'checkbox-agreement' | 'checkbox-group' | 'currency' | 'date' | 'email' | 'file' | 'grid' | 'group' | 'hidden' | 'notes' | 'number' | 'radio' | 'rating' | 'select' | 'string' | 'switch' | 'telephone' | 'text' | 'textarea' | 'default' | UIKindTypes | HomeItemTypes | AlertFieldType;
|
|
1
|
+
import { AIGridFieldI, AlertFieldType, AlertTabType, FolderFileI, MenuItemI, PartnerFooterI, TileCtaI } from '../..';
|
|
2
|
+
export type KindTypes = 'ai-image' | 'ai-grid' | 'checkbox' | 'checkbox-agreement' | 'checkbox-group' | 'currency' | 'date' | 'email' | 'file' | 'grid' | 'group' | 'hidden' | 'notes' | 'number' | 'radio' | 'rating' | 'select' | 'string' | 'switch' | 'telephone' | 'text' | 'textarea' | 'default' | 'video' | UIKindTypes | HomeItemTypes | AlertTabType | AlertFieldType;
|
|
3
3
|
export type UIKindTypes = 'tile-body' | 'tile-body-logo' | 'tile-body-header' | 'tile-body-section' | 'tile-body-section-grid' | 'tile-body-partner-image' | 'tile-body-description' | 'tile-form' | 'tile-body-action' | 'vertical-icon' | 'primary-cta' | 'secondary-cta';
|
|
4
4
|
export type HomeItemTypes = 'appliances' | 'images' | 'guidelines' | 'item-related' | 'item-icon-btn';
|
|
5
5
|
export type IconTypes = 'barcode' | 'battery' | 'billing' | 'book' | 'book-opened' | 'calc' | 'calendar' | 'check' | 'co2' | 'contact' | 'date' | 'default' | 'detector' | 'electricity' | 'goldbars' | 'heart' | 'image' | 'notes' | 'palette' | 'people' | 'price' | 'rating' | 'receipt' | 'registry' | 'sprinkler' | 'tools' | 'wind' | '68' | 'calendar2' | 'water' | 'calendar-drop' | 'umbrella' | 'heater' | 'roof' | 'foundation' | 'solar-panel' | 'pool' | 'drop' | 'mobile-drop' | 'light' | 'plate' | 'pressure-washer' | 'house' | 'target' | 'title' | 'company' | UIIconTypes;
|
|
6
|
-
export type UIIconTypes = 'sh-pressure' | 'sh-window' | 'sh-roof' | 'sh-lights' | 'sh-gutter' | 'sh-home' | 'sh-house' | 'aa-mowing' | 'aa-fertilization' | 'aa-disease' | 'aa-weed' | 'aa-dressing' | 'aa-pest';
|
|
6
|
+
export type UIIconTypes = 'sh-pressure' | 'sh-window' | 'sh-roof' | 'sh-lights' | 'sh-gutter' | 'sh-home' | 'sh-house' | 'aa-mowing' | 'aa-fertilization' | 'aa-disease' | 'aa-weed' | 'aa-dressing' | 'aa-pest' | 'filter-size';
|
|
7
7
|
export type ValueTypes = string | string[] | number | boolean;
|
|
8
8
|
export type OptionsTypes = string[] | number[] | null;
|
|
9
9
|
export interface ReportI {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
interface
|
|
2
|
+
export interface TabI {
|
|
3
3
|
label: string;
|
|
4
4
|
component: ReactNode | null;
|
|
5
5
|
}
|
|
@@ -7,8 +7,7 @@ export interface TabsHeaderI {
|
|
|
7
7
|
defaultIndex?: number;
|
|
8
8
|
onChange?: (index: number) => void;
|
|
9
9
|
rightButton?: ReactNode;
|
|
10
|
-
rightTabList?:
|
|
10
|
+
rightTabList?: TabI[];
|
|
11
11
|
tabIndex?: number;
|
|
12
|
-
tabList:
|
|
12
|
+
tabList: TabI[];
|
|
13
13
|
}
|
|
14
|
-
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DynamicFormI } from '..';
|
|
2
2
|
export type AlertCategory = 'safeguard' | 'maintain' | 'budget' | 'improve';
|
|
3
3
|
export type AlertTabType = 'details' | 'filter-size' | 'purchase' | 'hire-out';
|
|
4
|
-
export type AlertFieldType = '
|
|
4
|
+
export type AlertFieldType = 'alert' | 'search';
|
|
5
5
|
export interface BackendAlertI extends DynamicFormI {
|
|
6
6
|
category: AlertCategory;
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface SearchInputI extends
|
|
1
|
+
import { InputProps } from '@chakra-ui/react';
|
|
2
|
+
export interface SearchInputI extends InputProps {
|
|
3
3
|
maxW?: string;
|
|
4
4
|
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
5
5
|
placeholder?: string;
|
|
@@ -847,6 +847,84 @@ export const alertFieldsMock = [
|
|
|
847
847
|
description: 'Changing your air filter every 30 days ensures efficient system performance and improves indoor air quality by trapping dust and allergens.',
|
|
848
848
|
icon: 'wind',
|
|
849
849
|
value: false,
|
|
850
|
-
type: '
|
|
850
|
+
type: 'alert',
|
|
851
|
+
children: [
|
|
852
|
+
{
|
|
853
|
+
id: faker.database.mongodbObjectId(),
|
|
854
|
+
name: 'Details',
|
|
855
|
+
label: '',
|
|
856
|
+
description: faker.lorem.sentence(),
|
|
857
|
+
comments: faker.lorem.sentence(),
|
|
858
|
+
value: '',
|
|
859
|
+
type: 'details',
|
|
860
|
+
visible: true,
|
|
861
|
+
children: [
|
|
862
|
+
{
|
|
863
|
+
id: faker.database.mongodbObjectId(),
|
|
864
|
+
name: '',
|
|
865
|
+
label: '',
|
|
866
|
+
description: '',
|
|
867
|
+
comments: '',
|
|
868
|
+
value: 'Changing your air filter is critical for maintaining your home’s HVAC system efficiency and ensuring good air quality. A clogged filter forces your system to work harder, leading to higher energy bills and potential damage to components. \n\nNeglecting this simple maintenance can result in costly repairs or even a full system replacement, which can run into thousands of dollars. Regularly replacing your air filter not only saves money but also extends the lifespan of your HVAC system, keeping your home comfortable and your expenses in check.',
|
|
869
|
+
type: 'text',
|
|
870
|
+
visible: true,
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
id: faker.database.mongodbObjectId(),
|
|
874
|
+
name: 'Where to find and change the Air Filter',
|
|
875
|
+
label: 'Dec 5, 2024',
|
|
876
|
+
description: '1:39',
|
|
877
|
+
comments: '',
|
|
878
|
+
value: '',
|
|
879
|
+
link: 'https://www.youtube.com/embed/qCNIc1y18pA?si=oC1NmAjuh0JZTYcr',
|
|
880
|
+
type: 'video',
|
|
881
|
+
visible: true,
|
|
882
|
+
},
|
|
883
|
+
],
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
id: faker.database.mongodbObjectId(),
|
|
887
|
+
name: 'Filter Size',
|
|
888
|
+
label: 'Upload Image',
|
|
889
|
+
description: faker.lorem.sentence(),
|
|
890
|
+
comments: faker.lorem.sentence(),
|
|
891
|
+
value: faker.image.urlPicsumPhotos(),
|
|
892
|
+
type: 'filter-size',
|
|
893
|
+
visible: true,
|
|
894
|
+
children: [
|
|
895
|
+
{
|
|
896
|
+
id: faker.database.mongodbObjectId(),
|
|
897
|
+
name: '',
|
|
898
|
+
label: '',
|
|
899
|
+
description: '',
|
|
900
|
+
comments: '',
|
|
901
|
+
value: 'Home air filters are typically located in the HVAC system’s return air vent, furnace compartment, or air handler, usually near the blower unit or ductwork intake.',
|
|
902
|
+
type: 'text',
|
|
903
|
+
visible: true,
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
id: faker.database.mongodbObjectId(),
|
|
907
|
+
name: 'Check the filter:',
|
|
908
|
+
label: '',
|
|
909
|
+
description: '',
|
|
910
|
+
comments: '',
|
|
911
|
+
icon: 'filter-size',
|
|
912
|
+
value: 'The size of the filter is usually printed on the side of the filter in inches. The size may be written as length x width x depth. For example, a filter that is 16 in long, 20 in wide, and 1 in deep would be written as 16 x 20 x 1. ',
|
|
913
|
+
type: 'filter-size',
|
|
914
|
+
visible: true,
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
id: faker.database.mongodbObjectId(),
|
|
918
|
+
name: '',
|
|
919
|
+
label: '',
|
|
920
|
+
description: 'or enter your air conditioning/furnace model number below.',
|
|
921
|
+
comments: '',
|
|
922
|
+
value: '',
|
|
923
|
+
type: 'search',
|
|
924
|
+
visible: true,
|
|
925
|
+
},
|
|
926
|
+
],
|
|
927
|
+
},
|
|
928
|
+
],
|
|
851
929
|
},
|
|
852
930
|
];
|
package/package.json
CHANGED
|
Binary file
|
|
@@ -53,6 +53,7 @@ import Exclamation from './exclamation.svg'
|
|
|
53
53
|
import Face from './face.svg'
|
|
54
54
|
import Feedback from './feedback.svg'
|
|
55
55
|
import FileUploading from './file-uploading.svg'
|
|
56
|
+
import FilterSize from './filter-size.png'
|
|
56
57
|
import Finance from './finance.svg'
|
|
57
58
|
import Fire from './fire.svg'
|
|
58
59
|
import Flag from './flag.png'
|
|
@@ -218,6 +219,7 @@ export {
|
|
|
218
219
|
Face,
|
|
219
220
|
Feedback,
|
|
220
221
|
FileUploading,
|
|
222
|
+
FilterSize,
|
|
221
223
|
Finance,
|
|
222
224
|
Fire,
|
|
223
225
|
Flag,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Controller, useFormContext } from 'react-hook-form'
|
|
2
2
|
import { Flex } from '@chakra-ui/react'
|
|
3
|
-
import {
|
|
3
|
+
import { TextInput } from '@/components'
|
|
4
4
|
import { TextFieldI } from '@/interfaces'
|
|
5
5
|
|
|
6
6
|
export const TextField = ({
|
|
@@ -1,22 +1,34 @@
|
|
|
1
|
-
import { BackendAlertCard } from '@/components'
|
|
2
|
-
import { BackendAlertI } from '@/interfaces'
|
|
1
|
+
import { AlertFields, BackendAlertCard, TabsHeader } from '@/components'
|
|
2
|
+
import { BackendAlertI, TabI } from '@/interfaces'
|
|
3
3
|
import { getCategoryStyles } from '@/utils/Alerts.utils'
|
|
4
|
+
import { Divider } from '@chakra-ui/react'
|
|
4
5
|
|
|
5
6
|
export const BackendAlert = ({ category, form }: BackendAlertI) => {
|
|
6
7
|
const { headerBg, alertIcon, alertIconBg, alertTitle } =
|
|
7
8
|
getCategoryStyles(category)
|
|
8
|
-
const
|
|
9
|
+
const alert = form?.find((item) => item.type === 'alert')
|
|
10
|
+
|
|
11
|
+
const tabs =
|
|
12
|
+
alert?.children?.map(
|
|
13
|
+
(tab) =>
|
|
14
|
+
({
|
|
15
|
+
label: tab.name,
|
|
16
|
+
component: <AlertFields fields={tab.children ?? []} />,
|
|
17
|
+
} as TabI)
|
|
18
|
+
) ?? []
|
|
19
|
+
|
|
9
20
|
return (
|
|
10
21
|
<BackendAlertCard
|
|
11
22
|
alertBg={headerBg}
|
|
12
23
|
alertIcon={alertIcon}
|
|
13
24
|
alertTitle={alertTitle}
|
|
14
25
|
bg={alertIconBg}
|
|
15
|
-
icon={
|
|
16
|
-
title={
|
|
17
|
-
description={
|
|
26
|
+
icon={alert?.icon ?? ''}
|
|
27
|
+
title={alert?.label ?? ''}
|
|
28
|
+
description={alert?.description ?? ''}
|
|
18
29
|
>
|
|
19
|
-
|
|
30
|
+
<Divider />
|
|
31
|
+
<TabsHeader tabList={tabs} />
|
|
20
32
|
</BackendAlertCard>
|
|
21
33
|
)
|
|
22
34
|
}
|
|
@@ -29,9 +29,7 @@ export const BackendAlertCard = ({
|
|
|
29
29
|
<AlertTitle alertIcon={alertIcon} alertTitle={alertTitle} />
|
|
30
30
|
<AlertTemplate {...props} icon={fieldIcons[icon as IconTypes]} />
|
|
31
31
|
<Collapse in={isOpen} animateOpacity>
|
|
32
|
-
<Box
|
|
33
|
-
{children}
|
|
34
|
-
</Box>
|
|
32
|
+
<Box bg="lightBlue.1">{children}</Box>
|
|
35
33
|
</Collapse>
|
|
36
34
|
<Flex py="base" bg="lightBlue.1" justify="flex-end">
|
|
37
35
|
<Button
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { FieldTypesI, IconTypes } from '@/interfaces'
|
|
2
|
+
import { Box, Stack, Text } from '@chakra-ui/react'
|
|
3
|
+
import { FilterSize, SearchField, VideoDetail } from '@/components'
|
|
4
|
+
import { fieldIcons } from '@/helpers'
|
|
5
|
+
|
|
6
|
+
export const AlertFields = ({ fields, callback }: FieldTypesI) => {
|
|
7
|
+
return (
|
|
8
|
+
<Stack spacing="base" p="base">
|
|
9
|
+
{fields?.map((field) => {
|
|
10
|
+
const { id, type, value, icon } = field
|
|
11
|
+
const mappedIcon = icon && (fieldIcons[icon] as IconTypes)
|
|
12
|
+
switch (type) {
|
|
13
|
+
case 'text':
|
|
14
|
+
return (
|
|
15
|
+
<Text
|
|
16
|
+
key={id}
|
|
17
|
+
fontSize="sm"
|
|
18
|
+
fontFamily="secondary"
|
|
19
|
+
lineHeight="1.2"
|
|
20
|
+
whiteSpace="pre-line"
|
|
21
|
+
>
|
|
22
|
+
{String(value)}
|
|
23
|
+
</Text>
|
|
24
|
+
)
|
|
25
|
+
case 'video':
|
|
26
|
+
return <VideoDetail {...field} key={id} />
|
|
27
|
+
case 'filter-size':
|
|
28
|
+
return <FilterSize {...field} key={id} icon={mappedIcon} />
|
|
29
|
+
case 'search':
|
|
30
|
+
return <SearchField {...field} key={id} callback={callback} />
|
|
31
|
+
default:
|
|
32
|
+
return null
|
|
33
|
+
}
|
|
34
|
+
})}
|
|
35
|
+
</Stack>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Flex, Image, Stack, Text } from '@chakra-ui/react'
|
|
2
|
+
import { CustomDivider } from '@/components'
|
|
3
|
+
import { ReportI } from '@/interfaces'
|
|
4
|
+
|
|
5
|
+
export const FilterSize = ({ name, icon, value }: ReportI) => {
|
|
6
|
+
return (
|
|
7
|
+
<Stack spacing="base">
|
|
8
|
+
<CustomDivider />
|
|
9
|
+
<Text fontWeight="semibold">{name}</Text>
|
|
10
|
+
<Flex gap="base">
|
|
11
|
+
<Image boxSize="86px" src={icon} />
|
|
12
|
+
<Text fontSize="sm" fontFamily="secondary" lineHeight="1.2">
|
|
13
|
+
{value}
|
|
14
|
+
</Text>
|
|
15
|
+
</Flex>
|
|
16
|
+
<CustomDivider />
|
|
17
|
+
</Stack>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Stack, Text } from '@chakra-ui/react'
|
|
2
|
+
import { SearchInput } from '@/components'
|
|
3
|
+
import { FieldTypesI, ReportI } from '@/interfaces'
|
|
4
|
+
import { useState } from 'react'
|
|
5
|
+
|
|
6
|
+
export const SearchField = ({
|
|
7
|
+
callback,
|
|
8
|
+
description,
|
|
9
|
+
...props
|
|
10
|
+
}: ReportI & Pick<FieldTypesI, 'callback'>) => {
|
|
11
|
+
const [search, setSearch] = useState('')
|
|
12
|
+
const handleSearch = (value: string) => {
|
|
13
|
+
callback?.({
|
|
14
|
+
...props,
|
|
15
|
+
value,
|
|
16
|
+
})
|
|
17
|
+
}
|
|
18
|
+
return (
|
|
19
|
+
<Stack spacing="base">
|
|
20
|
+
<Text fontSize="sm" fontFamily="secondary" lineHeight="1.2">
|
|
21
|
+
{description}
|
|
22
|
+
</Text>
|
|
23
|
+
<SearchInput
|
|
24
|
+
onChange={(e) => setSearch(e.target.value)}
|
|
25
|
+
value={search}
|
|
26
|
+
maxW="full"
|
|
27
|
+
onBlur={() => handleSearch(search)}
|
|
28
|
+
onKeyDown={(e) => {
|
|
29
|
+
if (e.key === 'Enter') {
|
|
30
|
+
handleSearch(search)
|
|
31
|
+
}
|
|
32
|
+
}}
|
|
33
|
+
/>
|
|
34
|
+
</Stack>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReportI } from '@/interfaces'
|
|
2
|
+
import { AspectRatio, Box, Container, Flex, Text } from '@chakra-ui/react'
|
|
3
|
+
|
|
4
|
+
export const VideoDetail = ({ name, label, link, description }: ReportI) => {
|
|
5
|
+
return (
|
|
6
|
+
<Container p="base">
|
|
7
|
+
<Flex gap="base">
|
|
8
|
+
<AspectRatio w="140px" ratio={16 / 9}>
|
|
9
|
+
<iframe title={name} src={link} allowFullScreen />
|
|
10
|
+
</AspectRatio>
|
|
11
|
+
<Box>
|
|
12
|
+
<Text fontWeight="semibold">{name}</Text>
|
|
13
|
+
<Text fontSize="sm" fontFamily="secondary">
|
|
14
|
+
{`${label} | ${description}`}
|
|
15
|
+
</Text>
|
|
16
|
+
</Box>
|
|
17
|
+
</Flex>
|
|
18
|
+
</Container>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
export * from './AlertFields'
|
|
1
2
|
export * from './ChangeAirFilter'
|
|
2
3
|
export * from './CustomDivider'
|
|
4
|
+
export * from './FilterSize'
|
|
5
|
+
export * from './SearchField'
|
|
3
6
|
export * from './SmokeDetectorBattery'
|
|
4
7
|
export * from './SmokeDetectorExpired'
|
|
8
|
+
export * from './VideoDetail'
|
|
@@ -56,7 +56,8 @@ import {
|
|
|
56
56
|
AALawn,
|
|
57
57
|
AAMowing,
|
|
58
58
|
AAWeed,
|
|
59
|
-
AApest
|
|
59
|
+
AApest,
|
|
60
|
+
FilterSize,
|
|
60
61
|
} from '@/assets/images'
|
|
61
62
|
import { IconTypes } from '@/interfaces'
|
|
62
63
|
|
|
@@ -119,5 +120,6 @@ export const fieldIcons: Record<IconTypes, string> = {
|
|
|
119
120
|
'aa-disease': AADisease,
|
|
120
121
|
'aa-weed': AAWeed,
|
|
121
122
|
'aa-dressing': AADressing,
|
|
122
|
-
'aa-pest': AApest
|
|
123
|
+
'aa-pest': AApest,
|
|
124
|
+
'filter-size': FilterSize,
|
|
123
125
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AIGridFieldI,
|
|
3
3
|
AlertFieldType,
|
|
4
|
+
AlertTabType,
|
|
4
5
|
FolderFileI,
|
|
5
6
|
MenuItemI,
|
|
6
7
|
PartnerFooterI,
|
|
@@ -31,8 +32,10 @@ export type KindTypes =
|
|
|
31
32
|
| 'text'
|
|
32
33
|
| 'textarea'
|
|
33
34
|
| 'default'
|
|
35
|
+
| 'video'
|
|
34
36
|
| UIKindTypes
|
|
35
37
|
| HomeItemTypes
|
|
38
|
+
| AlertTabType
|
|
36
39
|
| AlertFieldType
|
|
37
40
|
|
|
38
41
|
export type UIKindTypes =
|
|
@@ -119,6 +122,7 @@ export type UIIconTypes =
|
|
|
119
122
|
| 'aa-weed'
|
|
120
123
|
| 'aa-dressing'
|
|
121
124
|
| 'aa-pest'
|
|
125
|
+
| 'filter-size'
|
|
122
126
|
|
|
123
127
|
export type ValueTypes = string | string[] | number | boolean
|
|
124
128
|
export type OptionsTypes = string[] | number[] | null
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react'
|
|
2
2
|
|
|
3
|
-
interface
|
|
3
|
+
export interface TabI {
|
|
4
4
|
label: string
|
|
5
5
|
component: ReactNode | null
|
|
6
6
|
}
|
|
@@ -8,7 +8,7 @@ export interface TabsHeaderI {
|
|
|
8
8
|
defaultIndex?: number
|
|
9
9
|
onChange?: (index: number) => void
|
|
10
10
|
rightButton?: ReactNode
|
|
11
|
-
rightTabList?:
|
|
11
|
+
rightTabList?: TabI[]
|
|
12
12
|
tabIndex?: number
|
|
13
|
-
tabList:
|
|
13
|
+
tabList: TabI[]
|
|
14
14
|
}
|
|
@@ -4,12 +4,7 @@ export type AlertCategory = 'safeguard' | 'maintain' | 'budget' | 'improve'
|
|
|
4
4
|
|
|
5
5
|
export type AlertTabType = 'details' | 'filter-size' | 'purchase' | 'hire-out'
|
|
6
6
|
|
|
7
|
-
export type AlertFieldType =
|
|
8
|
-
| 'alertHeader'
|
|
9
|
-
| 'text'
|
|
10
|
-
| 'iconSection'
|
|
11
|
-
| 'tabList'
|
|
12
|
-
| 'list'
|
|
7
|
+
export type AlertFieldType = 'alert' | 'search'
|
|
13
8
|
|
|
14
9
|
export interface BackendAlertI extends DynamicFormI {
|
|
15
10
|
category: AlertCategory
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InputProps } from '@chakra-ui/react'
|
|
2
2
|
|
|
3
|
-
export interface SearchInputI extends
|
|
3
|
+
export interface SearchInputI extends InputProps {
|
|
4
4
|
maxW?: string
|
|
5
5
|
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void
|
|
6
6
|
placeholder?: string
|
|
7
7
|
size?: string
|
|
8
8
|
value: string
|
|
9
|
-
}
|
|
9
|
+
}
|
|
@@ -863,6 +863,88 @@ export const alertFieldsMock: ReportI[] = [
|
|
|
863
863
|
'Changing your air filter every 30 days ensures efficient system performance and improves indoor air quality by trapping dust and allergens.',
|
|
864
864
|
icon: 'wind',
|
|
865
865
|
value: false,
|
|
866
|
-
type: '
|
|
866
|
+
type: 'alert',
|
|
867
|
+
children: [
|
|
868
|
+
{
|
|
869
|
+
id: faker.database.mongodbObjectId(),
|
|
870
|
+
name: 'Details',
|
|
871
|
+
label: '',
|
|
872
|
+
description: faker.lorem.sentence(),
|
|
873
|
+
comments: faker.lorem.sentence(),
|
|
874
|
+
value: '',
|
|
875
|
+
type: 'details',
|
|
876
|
+
visible: true,
|
|
877
|
+
children: [
|
|
878
|
+
{
|
|
879
|
+
id: faker.database.mongodbObjectId(),
|
|
880
|
+
name: '',
|
|
881
|
+
label: '',
|
|
882
|
+
description: '',
|
|
883
|
+
comments: '',
|
|
884
|
+
value:
|
|
885
|
+
'Changing your air filter is critical for maintaining your home’s HVAC system efficiency and ensuring good air quality. A clogged filter forces your system to work harder, leading to higher energy bills and potential damage to components. \n\nNeglecting this simple maintenance can result in costly repairs or even a full system replacement, which can run into thousands of dollars. Regularly replacing your air filter not only saves money but also extends the lifespan of your HVAC system, keeping your home comfortable and your expenses in check.',
|
|
886
|
+
type: 'text',
|
|
887
|
+
visible: true,
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
id: faker.database.mongodbObjectId(),
|
|
891
|
+
name: 'Where to find and change the Air Filter',
|
|
892
|
+
label: 'Dec 5, 2024',
|
|
893
|
+
description: '1:39',
|
|
894
|
+
comments: '',
|
|
895
|
+
value: '',
|
|
896
|
+
link: 'https://www.youtube.com/embed/qCNIc1y18pA?si=oC1NmAjuh0JZTYcr',
|
|
897
|
+
type: 'video',
|
|
898
|
+
visible: true,
|
|
899
|
+
},
|
|
900
|
+
],
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
id: faker.database.mongodbObjectId(),
|
|
904
|
+
name: 'Filter Size',
|
|
905
|
+
label: 'Upload Image',
|
|
906
|
+
description: faker.lorem.sentence(),
|
|
907
|
+
comments: faker.lorem.sentence(),
|
|
908
|
+
value: faker.image.urlPicsumPhotos(),
|
|
909
|
+
type: 'filter-size',
|
|
910
|
+
visible: true,
|
|
911
|
+
children: [
|
|
912
|
+
{
|
|
913
|
+
id: faker.database.mongodbObjectId(),
|
|
914
|
+
name: '',
|
|
915
|
+
label: '',
|
|
916
|
+
description: '',
|
|
917
|
+
comments: '',
|
|
918
|
+
value:
|
|
919
|
+
'Home air filters are typically located in the HVAC system’s return air vent, furnace compartment, or air handler, usually near the blower unit or ductwork intake.',
|
|
920
|
+
type: 'text',
|
|
921
|
+
visible: true,
|
|
922
|
+
},
|
|
923
|
+
{
|
|
924
|
+
id: faker.database.mongodbObjectId(),
|
|
925
|
+
name: 'Check the filter:',
|
|
926
|
+
label: '',
|
|
927
|
+
description: '',
|
|
928
|
+
comments: '',
|
|
929
|
+
icon: 'filter-size',
|
|
930
|
+
value:
|
|
931
|
+
'The size of the filter is usually printed on the side of the filter in inches. The size may be written as length x width x depth. For example, a filter that is 16 in long, 20 in wide, and 1 in deep would be written as 16 x 20 x 1. ',
|
|
932
|
+
type: 'filter-size',
|
|
933
|
+
visible: true,
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
id: faker.database.mongodbObjectId(),
|
|
937
|
+
name: '',
|
|
938
|
+
label: '',
|
|
939
|
+
description:
|
|
940
|
+
'or enter your air conditioning/furnace model number below.',
|
|
941
|
+
comments: '',
|
|
942
|
+
value: '',
|
|
943
|
+
type: 'search',
|
|
944
|
+
visible: true,
|
|
945
|
+
},
|
|
946
|
+
],
|
|
947
|
+
},
|
|
948
|
+
],
|
|
867
949
|
},
|
|
868
950
|
]
|