@homefile/components-v2 2.14.13 → 2.14.15
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/appBar/NotificationsReminder.js +5 -1
- package/dist/components/forms/dynamicForm/ItemFormPanel/ItemFormTabs.d.ts +1 -1
- package/dist/components/forms/dynamicForm/ItemFormPanel/ItemFormTabs.js +2 -2
- package/dist/interfaces/forms/ItemFormPanel/ItemFormTabs.interface.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/appBar/NotificationsReminder.tsx +5 -1
- package/src/components/forms/dynamicForm/ItemFormPanel/ItemFormTabs.tsx +2 -2
- package/src/interfaces/forms/ItemFormPanel/ItemFormTabs.interface.ts +2 -1
|
@@ -9,7 +9,11 @@ import { MOBILE_WIDTH } from '../../utils';
|
|
|
9
9
|
export const NotificationsReminder = ({ onClick, total }) => {
|
|
10
10
|
const { windowDimensions: { width }, } = useWindowDimensions();
|
|
11
11
|
const isMobile = width < MOBILE_WIDTH;
|
|
12
|
-
|
|
12
|
+
const hasNotifications = total > 0;
|
|
13
|
+
const bg = hasNotifications
|
|
14
|
+
? 'linear-gradient(120deg, #0b8dd7, #730bd7, #0bd7ac)'
|
|
15
|
+
: '#730bd7';
|
|
16
|
+
return (_jsx(Tooltip, { label: t('tooltips.notifications'), children: _jsx(Box, { id: "notificationsRemember", "data-testid": "notifications-reminder", children: _jsxs(Flex, { gap: "1", as: "button", onClick: onClick, children: [_jsx(Img, { src: Speaker, "aria-label": t('tooltips.notifications'), h: "26px", w: "auto" }), !isMobile && (_jsx(NumberBadge, { total: total, background: bg, backgroundSize: 100, animation: `${bgGradient} 6s linear infinite` }))] }) }) }));
|
|
13
17
|
};
|
|
14
18
|
const bgGradient = keyframes `
|
|
15
19
|
0% {
|
|
@@ -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'),
|
|
@@ -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
|
@@ -12,6 +12,10 @@ export const NotificationsReminder = ({ onClick, total }: AppBarIconI) => {
|
|
|
12
12
|
windowDimensions: { width },
|
|
13
13
|
} = useWindowDimensions()
|
|
14
14
|
const isMobile = width < MOBILE_WIDTH
|
|
15
|
+
const hasNotifications = total > 0
|
|
16
|
+
const bg = hasNotifications
|
|
17
|
+
? 'linear-gradient(120deg, #0b8dd7, #730bd7, #0bd7ac)'
|
|
18
|
+
: '#730bd7'
|
|
15
19
|
return (
|
|
16
20
|
<Tooltip label={t('tooltips.notifications')}>
|
|
17
21
|
<Box id="notificationsRemember" data-testid="notifications-reminder">
|
|
@@ -25,7 +29,7 @@ export const NotificationsReminder = ({ onClick, total }: AppBarIconI) => {
|
|
|
25
29
|
{!isMobile && (
|
|
26
30
|
<NumberBadge
|
|
27
31
|
total={total}
|
|
28
|
-
background=
|
|
32
|
+
background={bg}
|
|
29
33
|
backgroundSize={100}
|
|
30
34
|
animation={`${bgGradient} 6s linear infinite`}
|
|
31
35
|
/>
|
|
@@ -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'),
|
|
@@ -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
|
}
|