@homefile/components-v2 2.8.5 → 2.8.7

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.
@@ -2,5 +2,5 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { DrawerBody, DrawerHeader, DrawerContent, DrawerFooter, Box, } from '@chakra-ui/react';
3
3
  import { PanelHeader, FooterDrawer, ItemNameHeader, ItemFormFooter, Overlay, } from '../../..';
4
4
  export const ItemFormPanel = ({ children, itemName, onClose, onSaveItemName, onSubmitForm, panelIcon, panelTitle, showFooter = false, }) => {
5
- return (_jsxs(DrawerContent, { bg: "lightBlue.1", zIndex: 4, children: [_jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: onClose, icon: panelIcon, title: panelTitle }) }), _jsxs(DrawerBody, { padding: "0", bg: "lightBlue.1", children: [_jsx(ItemNameHeader, { id: "item-name", onSave: onSaveItemName, value: itemName }), _jsxs(Box, { position: "relative", overflowY: "scroll", h: "inherit", children: [_jsx(Overlay, { showOverlay: !itemName, position: "absolute", w: "inherit", h: "inherit", zIndex: "9" }), children] })] }), _jsx(FooterDrawer, { isOpen: showFooter, children: _jsx(DrawerFooter, { w: "100%", children: _jsx(ItemFormFooter, { onSave: onSubmitForm, onCancel: onClose }) }) })] }));
5
+ return (_jsxs(DrawerContent, { bg: "lightBlue.1", zIndex: 4, children: [_jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: onClose, icon: panelIcon, title: panelTitle }) }), _jsxs(DrawerBody, { padding: "0", bg: "lightBlue.1", children: [_jsx(ItemNameHeader, { id: "item-name", onSave: onSaveItemName, value: itemName }), _jsxs(Box, { position: "relative", overflowY: "scroll", h: "inherit", pb: "12", children: [_jsx(Overlay, { showOverlay: !itemName, position: "absolute", w: "inherit", h: "inherit", zIndex: "9" }), children] })] }), _jsx(FooterDrawer, { isOpen: showFooter, children: _jsx(DrawerFooter, { w: "100%", children: _jsx(ItemFormFooter, { onSave: onSubmitForm, onCancel: onClose }) }) })] }));
6
6
  };
@@ -13,12 +13,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { t } from 'i18next';
14
14
  import { Box } from '@chakra-ui/react';
15
15
  import { DynamicForm, TabsHeader, ItemFormTabImage } from '../../..';
16
+ import { v4 as uuidv4 } from 'uuid';
16
17
  export const ItemFormTabs = (_a) => {
17
18
  var { form = [] } = _a, props = __rest(_a, ["form"]);
19
+ const formWithIds = form.map((item) => (Object.assign(Object.assign({}, item), { id: item.id || uuidv4() })));
18
20
  const tabList = [
19
21
  {
20
22
  label: t('createDocument.tabs.tab1'),
21
- component: (_jsx(Box, { overflow: "scroll", minH: "100vh", children: _jsx(DynamicForm, { form: form }) })),
23
+ component: (_jsx(Box, { overflow: "scroll", minH: "100vh", children: _jsx(DynamicForm, { form: formWithIds }) })),
22
24
  },
23
25
  {
24
26
  label: t('createDocument.tabs.tab2'),
@@ -1,7 +1,7 @@
1
1
  import { FolderFileI, MenuItemI, PartnerFooterI, TileCtaI } from '../..';
2
- type KindTypes = '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;
3
- type UIKindTypes = 'tile-body' | 'tile-body-logo' | 'tile-body-header' | 'tile-body-section' | 'tile-body-section-grid' | 'tile-form' | 'tile-body-action' | 'vertical-icon' | 'primary-cta' | 'secondary-cta';
4
- type HomeItemTypes = 'appliances' | 'images' | 'guidelines' | 'item-related' | 'item-icon-btn';
2
+ export type KindTypes = '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;
3
+ export type UIKindTypes = 'tile-body' | 'tile-body-logo' | 'tile-body-header' | 'tile-body-section' | 'tile-body-section-grid' | 'tile-form' | 'tile-body-action' | 'vertical-icon' | 'primary-cta' | 'secondary-cta';
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
6
  export type UIIconTypes = 'sh-pressure' | 'sh-window' | 'sh-roof' | 'sh-lights' | 'sh-gutter' | 'sh-home' | 'sh-house';
7
7
  export type ValueTypes = string | string[] | number | boolean;
@@ -39,4 +39,3 @@ export interface ReadOnlyDynamicFormI extends Pick<DynamicFormI, 'form'> {
39
39
  onEdit?: (id: string) => void;
40
40
  onClick?: (id: string) => void;
41
41
  }
42
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.8.5",
3
+ "version": "2.8.7",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",
@@ -41,7 +41,7 @@ export const ItemFormPanel = ({
41
41
  onSave={onSaveItemName}
42
42
  value={itemName}
43
43
  />
44
- <Box position="relative" overflowY="scroll" h="inherit">
44
+ <Box position="relative" overflowY="scroll" h="inherit" pb="12">
45
45
  <Overlay
46
46
  showOverlay={!itemName}
47
47
  position="absolute"
@@ -2,14 +2,20 @@ import { t } from 'i18next'
2
2
  import { Box } from '@chakra-ui/react'
3
3
  import { DynamicForm, TabsHeader, ItemFormTabImage } from '@/components'
4
4
  import { ItemFormTabsI } from '@/interfaces'
5
+ import { v4 as uuidv4 } from 'uuid'
5
6
 
6
7
  export const ItemFormTabs = ({ form = [], ...props }: ItemFormTabsI) => {
8
+ const formWithIds = form.map((item) => ({
9
+ ...item,
10
+ id: item.id || uuidv4(),
11
+ }))
12
+
7
13
  const tabList = [
8
14
  {
9
15
  label: t('createDocument.tabs.tab1'),
10
16
  component: (
11
17
  <Box overflow="scroll" minH="100vh">
12
- <DynamicForm form={form} />
18
+ <DynamicForm form={formWithIds} />
13
19
  </Box>
14
20
  ),
15
21
  },
@@ -1,6 +1,6 @@
1
1
  import { FolderFileI, MenuItemI, PartnerFooterI, TileCtaI } from '@/interfaces'
2
2
 
3
- type KindTypes =
3
+ export type KindTypes =
4
4
  | 'checkbox'
5
5
  | 'checkbox-agreement'
6
6
  | 'checkbox-group'
@@ -25,7 +25,7 @@ type KindTypes =
25
25
  | UIKindTypes
26
26
  | HomeItemTypes
27
27
 
28
- type UIKindTypes =
28
+ export type UIKindTypes =
29
29
  | 'tile-body'
30
30
  | 'tile-body-logo'
31
31
  | 'tile-body-header'
@@ -37,7 +37,7 @@ type UIKindTypes =
37
37
  | 'primary-cta'
38
38
  | 'secondary-cta'
39
39
 
40
- type HomeItemTypes =
40
+ export type HomeItemTypes =
41
41
  | 'appliances'
42
42
  | 'images'
43
43
  | 'guidelines'