@visns-studio/visns-components 5.9.5 → 5.9.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.
- package/package.json +2 -1
- package/src/components/crm/BusinessCardOcr.jsx +1089 -0
- package/src/components/crm/DataGrid.jsx +21 -8
- package/src/components/crm/Navigation.jsx +37 -0
- package/src/components/crm/styles/BusinessCardOcr.module.scss +646 -0
- package/src/components/crm/styles/Notification.module.scss +0 -1
- package/src/components/crm/styles/global-datagrid.css +1 -1
- package/src/components/test/TooltipTest.jsx +104 -0
- package/src/index.js +2 -0
|
@@ -334,7 +334,7 @@ const CellWithTooltip = ({
|
|
|
334
334
|
}}
|
|
335
335
|
{...(shouldShowTooltip && {
|
|
336
336
|
'data-tooltip-id': tooltipId,
|
|
337
|
-
'data-tooltip-
|
|
337
|
+
'data-tooltip-html': tooltipContent,
|
|
338
338
|
})}
|
|
339
339
|
>
|
|
340
340
|
{children}
|
|
@@ -347,9 +347,9 @@ const CellWithTooltip = ({
|
|
|
347
347
|
borderRadius: '6px',
|
|
348
348
|
padding: '8px 12px',
|
|
349
349
|
fontSize: '13px',
|
|
350
|
-
maxWidth: '
|
|
350
|
+
maxWidth: '500px',
|
|
351
351
|
wordWrap: 'break-word',
|
|
352
|
-
zIndex:
|
|
352
|
+
zIndex: 1000,
|
|
353
353
|
}}
|
|
354
354
|
place="top"
|
|
355
355
|
offset={5}
|
|
@@ -683,16 +683,29 @@ const DataGrid = forwardRef(
|
|
|
683
683
|
});
|
|
684
684
|
|
|
685
685
|
// Initialize all groups as collapsed when data is first loaded
|
|
686
|
-
if (
|
|
687
|
-
|
|
686
|
+
if (
|
|
687
|
+
!groupsInitializedRef.current &&
|
|
688
|
+
res.data.length > 0
|
|
689
|
+
) {
|
|
690
|
+
const uniqueGroups = [
|
|
691
|
+
...new Set(
|
|
692
|
+
res.data.map((row) => row[groupField])
|
|
693
|
+
),
|
|
694
|
+
];
|
|
688
695
|
const initialCollapsedState = {};
|
|
689
|
-
uniqueGroups.forEach(groupValue => {
|
|
690
|
-
if (
|
|
696
|
+
uniqueGroups.forEach((groupValue) => {
|
|
697
|
+
if (
|
|
698
|
+
groupValue !== undefined &&
|
|
699
|
+
groupValue !== null
|
|
700
|
+
) {
|
|
691
701
|
initialCollapsedState[groupValue] = true;
|
|
692
702
|
}
|
|
693
703
|
});
|
|
694
704
|
|
|
695
|
-
console.log(
|
|
705
|
+
console.log(
|
|
706
|
+
'Initializing all groups as collapsed:',
|
|
707
|
+
initialCollapsedState
|
|
708
|
+
);
|
|
696
709
|
setCollapsedGroups(initialCollapsedState);
|
|
697
710
|
groupsInitializedRef.current = true;
|
|
698
711
|
}
|
|
@@ -3,16 +3,19 @@ import { Link, useLocation, useNavigate } from 'react-router-dom';
|
|
|
3
3
|
import {
|
|
4
4
|
Bug,
|
|
5
5
|
Calendar,
|
|
6
|
+
CreditCardAlt1,
|
|
6
7
|
Draft,
|
|
7
8
|
PeopleGroup,
|
|
8
9
|
Person,
|
|
9
10
|
Search,
|
|
10
11
|
SignOut,
|
|
11
12
|
Shield,
|
|
13
|
+
Image,
|
|
12
14
|
} from 'akar-icons';
|
|
13
15
|
import CustomFetch from './Fetch';
|
|
14
16
|
import Notification from './Notification';
|
|
15
17
|
import SwitchAccount from './SwitchAccount';
|
|
18
|
+
import BusinessCardOcr from './BusinessCardOcr';
|
|
16
19
|
import styles from './styles/Navigation.module.scss';
|
|
17
20
|
|
|
18
21
|
const SearchComponent = ({
|
|
@@ -193,6 +196,7 @@ function Navigation({
|
|
|
193
196
|
const [isOpen, setOpen] = useState(false);
|
|
194
197
|
const [isScrolled, setIsScrolled] = useState(false);
|
|
195
198
|
const [navData, setNavData] = useState(navConfig);
|
|
199
|
+
const [showBusinessCardOcr, setShowBusinessCardOcr] = useState(false);
|
|
196
200
|
|
|
197
201
|
const appNavClasses = styles['app-nav'];
|
|
198
202
|
|
|
@@ -223,6 +227,7 @@ function Navigation({
|
|
|
223
227
|
bug: Bug,
|
|
224
228
|
calendar: Calendar,
|
|
225
229
|
draft: Draft,
|
|
230
|
+
image: Image,
|
|
226
231
|
peopleGroup: PeopleGroup,
|
|
227
232
|
person: Person,
|
|
228
233
|
shield: Shield,
|
|
@@ -241,6 +246,20 @@ function Navigation({
|
|
|
241
246
|
<Notification setSystemAuth={setSystemAuth} />
|
|
242
247
|
</li>
|
|
243
248
|
);
|
|
249
|
+
} else if (n.id === 'businessCardOcr') {
|
|
250
|
+
return (
|
|
251
|
+
<li>
|
|
252
|
+
<button
|
|
253
|
+
title="Scan Business Card"
|
|
254
|
+
data-tooltip-id="system-tooltip"
|
|
255
|
+
data-tooltip-content="Scan Business Card"
|
|
256
|
+
onClick={() => setShowBusinessCardOcr(true)}
|
|
257
|
+
className={activeClass}
|
|
258
|
+
>
|
|
259
|
+
<CreditCardAlt1 size={20} />
|
|
260
|
+
</button>
|
|
261
|
+
</li>
|
|
262
|
+
);
|
|
244
263
|
} else if (n.id === 'switchAccount') {
|
|
245
264
|
return (
|
|
246
265
|
<li>
|
|
@@ -599,6 +618,15 @@ function Navigation({
|
|
|
599
618
|
</div>
|
|
600
619
|
{children}
|
|
601
620
|
</main>
|
|
621
|
+
|
|
622
|
+
<BusinessCardOcr
|
|
623
|
+
isOpen={showBusinessCardOcr}
|
|
624
|
+
onClose={() => setShowBusinessCardOcr(false)}
|
|
625
|
+
onContactSaved={(contact) => {
|
|
626
|
+
console.log('Contact saved:', contact);
|
|
627
|
+
}}
|
|
628
|
+
fields={navData.settings.find(s => s.id === 'businessCardOcr')?.fields || []}
|
|
629
|
+
/>
|
|
602
630
|
</div>
|
|
603
631
|
) : (
|
|
604
632
|
<div className={styles.hwrap}>
|
|
@@ -635,6 +663,15 @@ function Navigation({
|
|
|
635
663
|
)}
|
|
636
664
|
</ul>
|
|
637
665
|
</div>
|
|
666
|
+
|
|
667
|
+
<BusinessCardOcr
|
|
668
|
+
isOpen={showBusinessCardOcr}
|
|
669
|
+
onClose={() => setShowBusinessCardOcr(false)}
|
|
670
|
+
onContactSaved={(contact) => {
|
|
671
|
+
console.log('Contact saved:', contact);
|
|
672
|
+
}}
|
|
673
|
+
fields={navData.settings.find(s => s.id === 'businessCardOcr')?.fields || []}
|
|
674
|
+
/>
|
|
638
675
|
</div>
|
|
639
676
|
);
|
|
640
677
|
}
|