@homefile/components-v2 2.14.12 → 2.14.14
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/ItemFormPanel/ItemFormTabs.d.ts +1 -1
- package/dist/components/forms/dynamicForm/ItemFormPanel/ItemFormTabs.js +2 -2
- package/dist/components/forms/dynamicForm/fields/GridField.js +1 -1
- package/dist/interfaces/forms/ItemFormPanel/ItemFormTabs.interface.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/forms/dynamicForm/ItemFormPanel/ItemFormTabs.tsx +2 -2
- package/src/components/forms/dynamicForm/fields/GridField.tsx +1 -1
- package/src/interfaces/forms/ItemFormPanel/ItemFormTabs.interface.ts +2 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ItemFormTabsI } from '../../../../interfaces';
|
|
2
|
-
export declare const ItemFormTabs: ({ form, onAISend, searching, ...props }: ItemFormTabsI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const ItemFormTabs: ({ form, onAISend, searching, formUpload, ...props }: ItemFormTabsI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,12 +14,12 @@ import { t } from 'i18next';
|
|
|
14
14
|
import { DynamicForm, TabsHeader, ItemFormTabImage } from '../../..';
|
|
15
15
|
import { v4 as uuidv4 } from 'uuid';
|
|
16
16
|
export const ItemFormTabs = (_a) => {
|
|
17
|
-
var { form = [], onAISend, searching } = _a, props = __rest(_a, ["form", "onAISend", "searching"]);
|
|
17
|
+
var { form = [], onAISend, searching, formUpload } = _a, props = __rest(_a, ["form", "onAISend", "searching", "formUpload"]);
|
|
18
18
|
const formWithIds = form.map((item) => (Object.assign(Object.assign({}, item), { id: item.id || uuidv4() })));
|
|
19
19
|
const tabList = [
|
|
20
20
|
{
|
|
21
21
|
label: t('createDocument.tabs.tab1'),
|
|
22
|
-
component: _jsx(DynamicForm, { searching: searching, onAISend: onAISend, form: formWithIds }),
|
|
22
|
+
component: _jsx(DynamicForm, { searching: searching, onUpload: formUpload, onAISend: onAISend, form: formWithIds }),
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
label: t('createDocument.tabs.tab2'),
|
|
@@ -8,7 +8,7 @@ export const GridField = ({ children, onRemove, onUpload }) => {
|
|
|
8
8
|
const baseProps = {
|
|
9
9
|
id,
|
|
10
10
|
value,
|
|
11
|
-
placeholder: name
|
|
11
|
+
placeholder: Boolean(name) ? name : description,
|
|
12
12
|
label,
|
|
13
13
|
icon: icon ? fieldIcons[icon] : undefined,
|
|
14
14
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ItemFormTabImageI, ReportI, AIGridFieldI } from '../..';
|
|
1
|
+
import { ItemFormTabImageI, ReportI, AIGridFieldI, FolderFileI } from '../..';
|
|
2
2
|
export interface ItemFormTabsI extends ItemFormTabImageI {
|
|
3
3
|
form?: ReportI[];
|
|
4
4
|
onAISend?: AIGridFieldI['onAISend'];
|
|
5
5
|
searching?: boolean;
|
|
6
|
+
formUpload?: (filesByFieldId: Record<string, FolderFileI[]>) => void;
|
|
6
7
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { DynamicForm, TabsHeader, ItemFormTabImage } from '@/components'
|
|
|
3
3
|
import { ItemFormTabsI } from '@/interfaces'
|
|
4
4
|
import { v4 as uuidv4 } from 'uuid'
|
|
5
5
|
|
|
6
|
-
export const ItemFormTabs = ({ form = [], onAISend, searching, ...props }: ItemFormTabsI) => {
|
|
6
|
+
export const ItemFormTabs = ({ form = [], onAISend, searching, formUpload, ...props }: ItemFormTabsI) => {
|
|
7
7
|
const formWithIds = form.map((item) => ({
|
|
8
8
|
...item,
|
|
9
9
|
id: item.id || uuidv4(),
|
|
@@ -12,7 +12,7 @@ export const ItemFormTabs = ({ form = [], onAISend, searching, ...props }: ItemF
|
|
|
12
12
|
const tabList = [
|
|
13
13
|
{
|
|
14
14
|
label: t('createDocument.tabs.tab1'),
|
|
15
|
-
component: <DynamicForm searching={searching} onAISend={onAISend} form={formWithIds} />,
|
|
15
|
+
component: <DynamicForm searching={searching} onUpload={formUpload} onAISend={onAISend} form={formWithIds} />,
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
label: t('createDocument.tabs.tab2'),
|
|
@@ -18,7 +18,7 @@ export const GridField = ({ children, onRemove, onUpload }: GridFieldI) => {
|
|
|
18
18
|
const baseProps = {
|
|
19
19
|
id,
|
|
20
20
|
value,
|
|
21
|
-
placeholder: name
|
|
21
|
+
placeholder: Boolean(name) ? name : description,
|
|
22
22
|
label,
|
|
23
23
|
icon: icon ? (fieldIcons[icon] as IconTypes) : undefined,
|
|
24
24
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ItemFormTabImageI, ReportI, AIGridFieldI } from '@/interfaces'
|
|
1
|
+
import { ItemFormTabImageI, ReportI, AIGridFieldI, FolderFileI } from '@/interfaces'
|
|
2
2
|
|
|
3
3
|
export interface ItemFormTabsI extends ItemFormTabImageI {
|
|
4
4
|
form?: ReportI[]
|
|
5
5
|
onAISend?: AIGridFieldI['onAISend']
|
|
6
6
|
searching?: boolean
|
|
7
|
+
formUpload?: (filesByFieldId: Record<string, FolderFileI[]>) => void
|
|
7
8
|
}
|