@homefile/components-v2 2.24.3 → 2.24.5
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/dynamicForm/DynamicForm.js +4 -4
- package/dist/components/forms/dynamicForm/fields/GridField.d.ts +1 -1
- package/dist/components/forms/dynamicForm/fields/GridField.js +4 -4
- package/dist/components/forms/dynamicForm/fields/GroupField.d.ts +1 -1
- package/dist/components/forms/dynamicForm/fields/GroupField.js +2 -2
- package/dist/components/forms/dynamicForm/fields/SingleFields.d.ts +1 -1
- package/dist/components/forms/dynamicForm/fields/SingleFields.js +5 -5
- package/dist/components/headers/GenericBackHeader.d.ts +1 -1
- package/dist/components/headers/GenericBackHeader.js +15 -3
- package/dist/components/receipts/receipt/ReceiptItems.js +1 -1
- package/dist/interfaces/forms/dynamicForm/fields/GridField.interface.d.ts +1 -0
- package/dist/interfaces/forms/dynamicForm/fields/GroupField.interface.d.ts +2 -0
- package/dist/interfaces/headers/GenericBackHeader.interface.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/forms/dynamicForm/DynamicForm.tsx +6 -3
- package/src/components/forms/dynamicForm/fields/GridField.tsx +23 -4
- package/src/components/forms/dynamicForm/fields/GroupField.tsx +2 -1
- package/src/components/forms/dynamicForm/fields/SingleFields.tsx +24 -5
- package/src/components/headers/GenericBackHeader.tsx +3 -2
- package/src/components/receipts/receipt/ReceiptItems.tsx +1 -1
- package/src/interfaces/forms/dynamicForm/fields/GridField.interface.ts +1 -0
- package/src/interfaces/forms/dynamicForm/fields/GroupField.interface.ts +2 -0
- package/src/interfaces/headers/GenericBackHeader.interface.ts +3 -1
|
@@ -52,11 +52,11 @@ export const DynamicForm = (_a) => {
|
|
|
52
52
|
_jsx(CurrencyField, Object.assign({}, baseProps))));
|
|
53
53
|
case 'telephone':
|
|
54
54
|
return (_createElement(FieldWithDelete, Object.assign({}, fieldWithDeleteBaseProps, { key: id }),
|
|
55
|
-
_jsx(TextField, Object.assign({}, baseProps, { type: "tel" }))));
|
|
55
|
+
_jsx(TextField, Object.assign({}, baseProps, { type: "tel", showIcon: showIcon }))));
|
|
56
56
|
case 'text':
|
|
57
57
|
case 'string':
|
|
58
58
|
return (_createElement(FieldWithDelete, Object.assign({}, fieldWithDeleteBaseProps, { key: id }),
|
|
59
|
-
_jsx(TextField, Object.assign({}, baseProps))));
|
|
59
|
+
_jsx(TextField, Object.assign({}, baseProps, { showIcon: showIcon }))));
|
|
60
60
|
case 'textarea':
|
|
61
61
|
return (_createElement(FieldWithDelete, Object.assign({}, fieldWithDeleteBaseProps, { key: id }),
|
|
62
62
|
_jsx(TextAreaField, Object.assign({}, baseProps))));
|
|
@@ -70,7 +70,7 @@ export const DynamicForm = (_a) => {
|
|
|
70
70
|
return (_jsxs(Stack, { p: "base", spacing: "base", bg: "lightBlue.2", children: [description && (_jsx(Text, { fontFamily: "secondary", children: description })), _jsx(AIGridField, Object.assign({}, baseProps, { onRemove: onRemoveImage, onUpload: (files) => handleFilesUpload({ id, files }), onAISend: onAISend, children: children }))] }, id));
|
|
71
71
|
case 'grid':
|
|
72
72
|
return (_createElement(FieldWithDelete, Object.assign({}, fieldWithDeleteBaseProps, { key: id }),
|
|
73
|
-
_jsx(GridField, Object.assign({}, baseProps, { children: children }))));
|
|
73
|
+
_jsx(GridField, Object.assign({}, baseProps, { showIcon: showIcon, children: children }))));
|
|
74
74
|
case 'switch':
|
|
75
75
|
return (_createElement(FieldWithDelete, Object.assign({}, fieldWithDeleteBaseProps, { key: id }),
|
|
76
76
|
_jsx(SwitchField, Object.assign({}, baseProps, { description: description }))));
|
|
@@ -78,7 +78,7 @@ export const DynamicForm = (_a) => {
|
|
|
78
78
|
return (_createElement(FieldWithDelete, Object.assign({}, fieldWithDeleteBaseProps, { key: id }),
|
|
79
79
|
_jsx(FileField, Object.assign({}, baseProps, { description: description, onRemove: onRemoveImage, onUpload: (files) => handleFilesUpload({ id, files }), uploading: uploadingFieldId === id, displayImages: displayImages, singleFileUpload: singleFileUpload, value: value }))));
|
|
80
80
|
case 'group':
|
|
81
|
-
return (_jsx(GroupField, { id: id, fields: children, onRemove: handleRemove, canBeHidden: canBeHidden }, id));
|
|
81
|
+
return (_jsx(GroupField, { id: id, fields: children, onRemove: handleRemove, canBeHidden: canBeHidden, showIcon: showIcon }, id));
|
|
82
82
|
case 'checkbox-group':
|
|
83
83
|
return (_createElement(FieldWithDelete, Object.assign({}, fieldWithDeleteBaseProps, { key: id }),
|
|
84
84
|
_jsx(CheckboxGroupField, { id: id, description: description, icon: baseProps.icon, children: children }, id)));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { GridFieldI } from '../../../../interfaces';
|
|
2
|
-
export declare const GridField: ({ children, onRemove, onUpload }: GridFieldI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const GridField: ({ children, onRemove, onUpload, showIcon, }: GridFieldI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { createElement as _createElement } from "react";
|
|
|
3
3
|
import { Flex } from '@chakra-ui/react';
|
|
4
4
|
import { DateField, NumberField, TextField, SelectField, CurrencyField, SingleImage, } from '../../..';
|
|
5
5
|
import { fieldIcons } from '../../../../helpers';
|
|
6
|
-
export const GridField = ({ children, onRemove, onUpload }) => {
|
|
6
|
+
export const GridField = ({ children, onRemove, onUpload, showIcon, }) => {
|
|
7
7
|
return (_jsx(Flex, { align: "stretch", gap: "base", children: children === null || children === void 0 ? void 0 : children.map(({ id, description, label, name, value, type, options = [], icon }) => {
|
|
8
8
|
const baseProps = {
|
|
9
9
|
id,
|
|
@@ -16,18 +16,18 @@ export const GridField = ({ children, onRemove, onUpload }) => {
|
|
|
16
16
|
case 'date':
|
|
17
17
|
return (_createElement(DateField, Object.assign({}, baseProps, { key: id, name: "", width: "230px", showCalendarIcon: false })));
|
|
18
18
|
case 'email':
|
|
19
|
-
return _createElement(TextField, Object.assign({}, baseProps, { key: id, type: "email" }));
|
|
19
|
+
return (_createElement(TextField, Object.assign({}, baseProps, { key: id, type: "email", showIcon: showIcon })));
|
|
20
20
|
case 'number':
|
|
21
21
|
return _createElement(NumberField, Object.assign({}, baseProps, { key: id }));
|
|
22
22
|
case 'currency':
|
|
23
23
|
return _createElement(CurrencyField, Object.assign({}, baseProps, { key: id }));
|
|
24
24
|
case 'text':
|
|
25
25
|
case 'string':
|
|
26
|
-
return _createElement(TextField, Object.assign({}, baseProps, { key: id }));
|
|
26
|
+
return _createElement(TextField, Object.assign({}, baseProps, { key: id, showIcon: showIcon }));
|
|
27
27
|
case 'select':
|
|
28
28
|
return _createElement(SelectField, Object.assign({}, baseProps, { key: id, options: options }));
|
|
29
29
|
case 'telephone':
|
|
30
|
-
return _createElement(TextField, Object.assign({}, baseProps, { key: id, type: "tel" }));
|
|
30
|
+
return (_createElement(TextField, Object.assign({}, baseProps, { key: id, type: "tel", showIcon: showIcon })));
|
|
31
31
|
case 'ai-image':
|
|
32
32
|
return (_createElement(SingleImage, Object.assign({}, baseProps, { key: id, onUpload: onUpload, onRemove: onRemove, value: value })));
|
|
33
33
|
default:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { GroupFieldI } from '../../../../interfaces';
|
|
2
|
-
export declare const GroupField: ({ id, fields, onRemove, canBeHidden, }: GroupFieldI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const GroupField: ({ id, fields, onRemove, canBeHidden, showIcon, }: GroupFieldI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,6 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Stack } from '@chakra-ui/react';
|
|
3
3
|
import { FieldWithDelete } from '../../..';
|
|
4
4
|
import { SingleFields } from './SingleFields';
|
|
5
|
-
export const GroupField = ({ id, fields, onRemove, canBeHidden, }) => {
|
|
6
|
-
return (_jsx(FieldWithDelete, { id: id, onRemove: onRemove, canBeHidden: canBeHidden, children: _jsx(Stack, { spacing: "base", flex: "1", children: _jsx(SingleFields, { fields: fields }) }) }));
|
|
5
|
+
export const GroupField = ({ id, fields, onRemove, canBeHidden, showIcon, }) => {
|
|
6
|
+
return (_jsx(FieldWithDelete, { id: id, onRemove: onRemove, canBeHidden: canBeHidden, children: _jsx(Stack, { spacing: "base", flex: "1", children: _jsx(SingleFields, { fields: fields, showIcon: showIcon }) }) }));
|
|
7
7
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FieldTypesI } from '../../../../interfaces';
|
|
2
|
-
export declare const SingleFields: ({ callback, fields, menuItems }: FieldTypesI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const SingleFields: ({ callback, fields, menuItems, showIcon, }: FieldTypesI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { createElement as _createElement } from "react";
|
|
3
3
|
import { fieldIcons } from '../../../../helpers';
|
|
4
4
|
import { GridField, RatingField, TextAreaField, TextField, SelectField, SwitchField, NumberField, DateField, CurrencyField, TileBodyHeader, TileBodyLogo, VerticalIcon, TileBodySectionGrid, TileBodyAction, TileCta, } from '../../..';
|
|
5
|
-
export const SingleFields = ({ callback, fields, menuItems }) => {
|
|
5
|
+
export const SingleFields = ({ callback, fields, menuItems, showIcon, }) => {
|
|
6
6
|
return (_jsx(_Fragment, { children: fields === null || fields === void 0 ? void 0 : fields.map(({ children, description, id, label, name, type, value, icon, link, options = [], }) => {
|
|
7
7
|
const baseProps = {
|
|
8
8
|
id,
|
|
@@ -15,9 +15,9 @@ export const SingleFields = ({ callback, fields, menuItems }) => {
|
|
|
15
15
|
case 'date':
|
|
16
16
|
return _createElement(DateField, Object.assign({}, baseProps, { key: id, name: name }));
|
|
17
17
|
case 'email':
|
|
18
|
-
return _createElement(TextField, Object.assign({}, baseProps, { key: id, type: "email" }));
|
|
18
|
+
return (_createElement(TextField, Object.assign({}, baseProps, { key: id, type: "email", showIcon: showIcon })));
|
|
19
19
|
case 'grid':
|
|
20
|
-
return (_createElement(GridField, Object.assign({}, baseProps, { key: id }), children));
|
|
20
|
+
return (_createElement(GridField, Object.assign({}, baseProps, { key: id, showIcon: showIcon }), children));
|
|
21
21
|
case 'number':
|
|
22
22
|
return _createElement(NumberField, Object.assign({}, baseProps, { key: id }));
|
|
23
23
|
case 'currency':
|
|
@@ -26,13 +26,13 @@ export const SingleFields = ({ callback, fields, menuItems }) => {
|
|
|
26
26
|
return _createElement(RatingField, Object.assign({}, baseProps, { key: id }));
|
|
27
27
|
case 'text':
|
|
28
28
|
case 'string':
|
|
29
|
-
return _createElement(TextField, Object.assign({}, baseProps, { key: id }));
|
|
29
|
+
return _createElement(TextField, Object.assign({}, baseProps, { key: id, showIcon: showIcon }));
|
|
30
30
|
case 'select':
|
|
31
31
|
return _createElement(SelectField, Object.assign({}, baseProps, { key: id, options: options }));
|
|
32
32
|
case 'switch':
|
|
33
33
|
return (_createElement(SwitchField, Object.assign({}, baseProps, { key: id, description: description })));
|
|
34
34
|
case 'telephone':
|
|
35
|
-
return _createElement(TextField, Object.assign({}, baseProps, { key: id, type: "tel" }));
|
|
35
|
+
return (_createElement(TextField, Object.assign({}, baseProps, { key: id, type: "tel", showIcon: showIcon })));
|
|
36
36
|
case 'textarea':
|
|
37
37
|
return _createElement(TextAreaField, Object.assign({}, baseProps, { key: id }));
|
|
38
38
|
case 'tile-body-section-grid':
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { GenericBackHeaderI } from '../../interfaces';
|
|
2
|
-
export declare const GenericBackHeader: ({ handleClick, label, backLabel, }: GenericBackHeaderI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const GenericBackHeader: ({ handleClick, label, backLabel, ...props }: GenericBackHeaderI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,21 @@
|
|
|
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
|
+
};
|
|
1
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
13
|
import { Text, Flex, Box, Show, Tooltip } from '@chakra-ui/react';
|
|
3
14
|
import { BackCircleButton } from '..';
|
|
4
|
-
export const GenericBackHeader = (
|
|
15
|
+
export const GenericBackHeader = (_a) => {
|
|
16
|
+
var { handleClick, label, backLabel } = _a, props = __rest(_a, ["handleClick", "label", "backLabel"]);
|
|
5
17
|
if (!label) {
|
|
6
|
-
return (_jsx(Box, { p: "base", children: _jsx(BackCircleButton, { onClick: handleClick }) }));
|
|
18
|
+
return (_jsx(Box, Object.assign({ p: "base" }, props, { children: _jsx(BackCircleButton, { onClick: handleClick }) })));
|
|
7
19
|
}
|
|
8
|
-
return (_jsx(Flex, { align: "center", justify: "space-between", children: _jsxs(Flex, { align: "center", gap: "2", children: [_jsx(Tooltip, { hasArrow: true, isDisabled: false, label: backLabel, placement: "right", children: _jsx(Box, { children: _jsx(BackCircleButton, { onClick: handleClick }) }) }), _jsx(Show, { breakpoint: "(min-width: 400px)", children: _jsx(Box, { borderLeft: "solid", borderWidth: "1px", borderColor: "divider", h: "1.75rem", mx: "2" }) }), _jsx(Show, { breakpoint: "(min-width: 500px)", children: _jsx(Text, { variant: "title", children: label }) })] }) }));
|
|
20
|
+
return (_jsx(Flex, Object.assign({ align: "center", justify: "space-between" }, props, { children: _jsxs(Flex, { align: "center", gap: "2", children: [_jsx(Tooltip, { hasArrow: true, isDisabled: false, label: backLabel, placement: "right", children: _jsx(Box, { children: _jsx(BackCircleButton, { onClick: handleClick }) }) }), _jsx(Show, { breakpoint: "(min-width: 400px)", children: _jsx(Box, { borderLeft: "solid", borderWidth: "1px", borderColor: "divider", h: "1.75rem", mx: "2" }) }), _jsx(Show, { breakpoint: "(min-width: 500px)", children: _jsx(Text, { variant: "title", children: label }) })] }) })));
|
|
9
21
|
};
|
|
@@ -10,6 +10,6 @@ export const ReceiptItems = ({ isSelectDisabled = true, leftOptions = [], onItem
|
|
|
10
10
|
});
|
|
11
11
|
return (_jsxs(Box, { mb: "10rem", children: [_jsxs(Stack, { bg: "lightBlue.2", px: "4", pb: "base", pt: "2", children: [_jsx(Text, { textTransform: "uppercase", variant: "home", children: title }), _jsxs(Flex, { gap: "base", align: "center", children: [_jsx(Checkbox, { onChange: handleSelectAll }), _jsx(DoubleSelects, { isSelectDisabled: isSelectDisabled, leftOptions: leftOptions, rightOptions: rightOptions, onLeftSelectChange: onLeftSelectChange, onRightSelectChange: onRightSelectChange })] })] }), receipts.map((receipt) => {
|
|
12
12
|
const hasRoomType = !!(receipt === null || receipt === void 0 ? void 0 : receipt.roomType);
|
|
13
|
-
return (_jsxs(Box, { children: [!hasRoomType && (_jsx(ReceiptItem, Object.assign({ onChange: () => handleItemSelect(receipt._id), isChecked: isItemSelected(receipt._id), onSelectedChange: onReceiptSelectedChange, onEditClick: () => onEditReceipt === null || onEditReceipt === void 0 ? void 0 : onEditReceipt(receipt.
|
|
13
|
+
return (_jsxs(Box, { children: [!hasRoomType && (_jsx(ReceiptItem, Object.assign({ onChange: () => handleItemSelect(receipt._id), isChecked: isItemSelected(receipt._id), onSelectedChange: onReceiptSelectedChange, onEditClick: () => onEditReceipt === null || onEditReceipt === void 0 ? void 0 : onEditReceipt(receipt.sku), selectItems: receiptOptions, variant: variant }, receipt))), hasRoomType && (_jsx(ReceiptItemAssigned, Object.assign({ onChange: () => handleItemSelect(receipt._id), onRoomClick: onRoomClick, isChecked: isItemSelected(receipt._id), onSelectedChange: onReceiptSelectedChange, initialSelectValue: receiptOptions === null || receiptOptions === void 0 ? void 0 : receiptOptions[1], selectItems: receiptOptions, variant: variant }, receipt)))] }, receipt._id));
|
|
14
14
|
})] }));
|
|
15
15
|
};
|
|
@@ -4,9 +4,11 @@ export interface GroupFieldI {
|
|
|
4
4
|
canBeHidden?: boolean;
|
|
5
5
|
fields?: DynamicFormI['form'];
|
|
6
6
|
onRemove: (id: string) => void;
|
|
7
|
+
showIcon?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export interface FieldTypesI {
|
|
9
10
|
callback?: TileCtaI['callback'];
|
|
10
11
|
fields?: DynamicFormI['form'];
|
|
11
12
|
menuItems?: MenuItemI[];
|
|
13
|
+
showIcon?: boolean;
|
|
12
14
|
}
|
package/package.json
CHANGED
|
@@ -129,14 +129,14 @@ export const DynamicForm = ({
|
|
|
129
129
|
case 'telephone':
|
|
130
130
|
return (
|
|
131
131
|
<FieldWithDelete {...fieldWithDeleteBaseProps} key={id}>
|
|
132
|
-
<TextField {...baseProps} type="tel" />
|
|
132
|
+
<TextField {...baseProps} type="tel" showIcon={showIcon} />
|
|
133
133
|
</FieldWithDelete>
|
|
134
134
|
)
|
|
135
135
|
case 'text':
|
|
136
136
|
case 'string':
|
|
137
137
|
return (
|
|
138
138
|
<FieldWithDelete {...fieldWithDeleteBaseProps} key={id}>
|
|
139
|
-
<TextField {...baseProps} />
|
|
139
|
+
<TextField {...baseProps} showIcon={showIcon} />
|
|
140
140
|
</FieldWithDelete>
|
|
141
141
|
)
|
|
142
142
|
case 'textarea':
|
|
@@ -176,7 +176,9 @@ export const DynamicForm = ({
|
|
|
176
176
|
case 'grid':
|
|
177
177
|
return (
|
|
178
178
|
<FieldWithDelete {...fieldWithDeleteBaseProps} key={id}>
|
|
179
|
-
<GridField {...baseProps}
|
|
179
|
+
<GridField {...baseProps} showIcon={showIcon}>
|
|
180
|
+
{children}
|
|
181
|
+
</GridField>
|
|
180
182
|
</FieldWithDelete>
|
|
181
183
|
)
|
|
182
184
|
case 'switch':
|
|
@@ -208,6 +210,7 @@ export const DynamicForm = ({
|
|
|
208
210
|
fields={children}
|
|
209
211
|
onRemove={handleRemove}
|
|
210
212
|
canBeHidden={canBeHidden}
|
|
213
|
+
showIcon={showIcon}
|
|
211
214
|
/>
|
|
212
215
|
)
|
|
213
216
|
case 'checkbox-group':
|
|
@@ -10,7 +10,12 @@ import {
|
|
|
10
10
|
} from '@/components'
|
|
11
11
|
import { fieldIcons } from '@/helpers'
|
|
12
12
|
|
|
13
|
-
export const GridField = ({
|
|
13
|
+
export const GridField = ({
|
|
14
|
+
children,
|
|
15
|
+
onRemove,
|
|
16
|
+
onUpload,
|
|
17
|
+
showIcon,
|
|
18
|
+
}: GridFieldI) => {
|
|
14
19
|
return (
|
|
15
20
|
<Flex align="stretch" gap="base">
|
|
16
21
|
{children?.map(
|
|
@@ -35,18 +40,32 @@ export const GridField = ({ children, onRemove, onUpload }: GridFieldI) => {
|
|
|
35
40
|
/>
|
|
36
41
|
)
|
|
37
42
|
case 'email':
|
|
38
|
-
return
|
|
43
|
+
return (
|
|
44
|
+
<TextField
|
|
45
|
+
{...baseProps}
|
|
46
|
+
key={id}
|
|
47
|
+
type="email"
|
|
48
|
+
showIcon={showIcon}
|
|
49
|
+
/>
|
|
50
|
+
)
|
|
39
51
|
case 'number':
|
|
40
52
|
return <NumberField {...baseProps} key={id} />
|
|
41
53
|
case 'currency':
|
|
42
54
|
return <CurrencyField {...baseProps} key={id} />
|
|
43
55
|
case 'text':
|
|
44
56
|
case 'string':
|
|
45
|
-
return <TextField {...baseProps} key={id} />
|
|
57
|
+
return <TextField {...baseProps} key={id} showIcon={showIcon} />
|
|
46
58
|
case 'select':
|
|
47
59
|
return <SelectField {...baseProps} key={id} options={options} />
|
|
48
60
|
case 'telephone':
|
|
49
|
-
return
|
|
61
|
+
return (
|
|
62
|
+
<TextField
|
|
63
|
+
{...baseProps}
|
|
64
|
+
key={id}
|
|
65
|
+
type="tel"
|
|
66
|
+
showIcon={showIcon}
|
|
67
|
+
/>
|
|
68
|
+
)
|
|
50
69
|
case 'ai-image':
|
|
51
70
|
return (
|
|
52
71
|
<SingleImage
|
|
@@ -8,11 +8,12 @@ export const GroupField = ({
|
|
|
8
8
|
fields,
|
|
9
9
|
onRemove,
|
|
10
10
|
canBeHidden,
|
|
11
|
+
showIcon,
|
|
11
12
|
}: GroupFieldI) => {
|
|
12
13
|
return (
|
|
13
14
|
<FieldWithDelete id={id} onRemove={onRemove} canBeHidden={canBeHidden}>
|
|
14
15
|
<Stack spacing="base" flex="1">
|
|
15
|
-
<SingleFields fields={fields} />
|
|
16
|
+
<SingleFields fields={fields} showIcon={showIcon} />
|
|
16
17
|
</Stack>
|
|
17
18
|
</FieldWithDelete>
|
|
18
19
|
)
|
|
@@ -18,7 +18,12 @@ import {
|
|
|
18
18
|
TileCta,
|
|
19
19
|
} from '@/components'
|
|
20
20
|
|
|
21
|
-
export const SingleFields = ({
|
|
21
|
+
export const SingleFields = ({
|
|
22
|
+
callback,
|
|
23
|
+
fields,
|
|
24
|
+
menuItems,
|
|
25
|
+
showIcon,
|
|
26
|
+
}: FieldTypesI) => {
|
|
22
27
|
return (
|
|
23
28
|
<>
|
|
24
29
|
{fields?.map(
|
|
@@ -45,10 +50,17 @@ export const SingleFields = ({ callback, fields, menuItems }: FieldTypesI) => {
|
|
|
45
50
|
case 'date':
|
|
46
51
|
return <DateField {...baseProps} key={id} name={name} />
|
|
47
52
|
case 'email':
|
|
48
|
-
return
|
|
53
|
+
return (
|
|
54
|
+
<TextField
|
|
55
|
+
{...baseProps}
|
|
56
|
+
key={id}
|
|
57
|
+
type="email"
|
|
58
|
+
showIcon={showIcon}
|
|
59
|
+
/>
|
|
60
|
+
)
|
|
49
61
|
case 'grid':
|
|
50
62
|
return (
|
|
51
|
-
<GridField {...baseProps} key={id}>
|
|
63
|
+
<GridField {...baseProps} key={id} showIcon={showIcon}>
|
|
52
64
|
{children}
|
|
53
65
|
</GridField>
|
|
54
66
|
)
|
|
@@ -60,7 +72,7 @@ export const SingleFields = ({ callback, fields, menuItems }: FieldTypesI) => {
|
|
|
60
72
|
return <RatingField {...baseProps} key={id} />
|
|
61
73
|
case 'text':
|
|
62
74
|
case 'string':
|
|
63
|
-
return <TextField {...baseProps} key={id} />
|
|
75
|
+
return <TextField {...baseProps} key={id} showIcon={showIcon} />
|
|
64
76
|
case 'select':
|
|
65
77
|
return <SelectField {...baseProps} key={id} options={options} />
|
|
66
78
|
case 'switch':
|
|
@@ -72,7 +84,14 @@ export const SingleFields = ({ callback, fields, menuItems }: FieldTypesI) => {
|
|
|
72
84
|
/>
|
|
73
85
|
)
|
|
74
86
|
case 'telephone':
|
|
75
|
-
return
|
|
87
|
+
return (
|
|
88
|
+
<TextField
|
|
89
|
+
{...baseProps}
|
|
90
|
+
key={id}
|
|
91
|
+
type="tel"
|
|
92
|
+
showIcon={showIcon}
|
|
93
|
+
/>
|
|
94
|
+
)
|
|
76
95
|
case 'textarea':
|
|
77
96
|
return <TextAreaField {...baseProps} key={id} />
|
|
78
97
|
|
|
@@ -6,16 +6,17 @@ export const GenericBackHeader = ({
|
|
|
6
6
|
handleClick,
|
|
7
7
|
label,
|
|
8
8
|
backLabel,
|
|
9
|
+
...props
|
|
9
10
|
}: GenericBackHeaderI) => {
|
|
10
11
|
if (!label) {
|
|
11
12
|
return (
|
|
12
|
-
<Box p="base">
|
|
13
|
+
<Box p="base" {...props}>
|
|
13
14
|
<BackCircleButton onClick={handleClick} />
|
|
14
15
|
</Box>
|
|
15
16
|
)
|
|
16
17
|
}
|
|
17
18
|
return (
|
|
18
|
-
<Flex align="center" justify="space-between">
|
|
19
|
+
<Flex align="center" justify="space-between" {...props}>
|
|
19
20
|
<Flex align="center" gap="2">
|
|
20
21
|
<Tooltip
|
|
21
22
|
hasArrow
|
|
@@ -51,7 +51,7 @@ export const ReceiptItems = ({
|
|
|
51
51
|
onChange={() => handleItemSelect(receipt._id)}
|
|
52
52
|
isChecked={isItemSelected(receipt._id)}
|
|
53
53
|
onSelectedChange={onReceiptSelectedChange}
|
|
54
|
-
onEditClick={() => onEditReceipt?.(receipt.
|
|
54
|
+
onEditClick={() => onEditReceipt?.(receipt.sku)}
|
|
55
55
|
selectItems={receiptOptions}
|
|
56
56
|
variant={variant}
|
|
57
57
|
{...receipt}
|
|
@@ -5,10 +5,12 @@ export interface GroupFieldI {
|
|
|
5
5
|
canBeHidden?: boolean
|
|
6
6
|
fields?: DynamicFormI['form']
|
|
7
7
|
onRemove: (id: string) => void
|
|
8
|
+
showIcon?: boolean
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export interface FieldTypesI {
|
|
11
12
|
callback?: TileCtaI['callback']
|
|
12
13
|
fields?: DynamicFormI['form']
|
|
13
14
|
menuItems?: MenuItemI[]
|
|
15
|
+
showIcon?: boolean
|
|
14
16
|
}
|