@fctc/widget-logic 3.10.6 → 3.10.8
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/hooks.d.mts +1 -4
- package/dist/hooks.d.ts +1 -4
- package/dist/hooks.js +4 -8
- package/dist/hooks.mjs +4 -8
- package/dist/index.js +4 -8
- package/dist/index.mjs +4 -8
- package/package.json +2 -2
package/dist/hooks.d.mts
CHANGED
|
@@ -534,9 +534,6 @@ declare const useCompany: ({ service }: {
|
|
|
534
534
|
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
535
535
|
promise: Promise<any>;
|
|
536
536
|
};
|
|
537
|
-
context: {
|
|
538
|
-
allowed_company_ids: (number | undefined)[];
|
|
539
|
-
};
|
|
540
537
|
} | undefined;
|
|
541
538
|
interface CompanyTuple extends Array<number | string> {
|
|
542
539
|
0: number;
|
|
@@ -1163,7 +1160,7 @@ interface PartnerID {
|
|
|
1163
1160
|
type ContextProfile = {
|
|
1164
1161
|
uid: number;
|
|
1165
1162
|
lang: string;
|
|
1166
|
-
allowed_company_ids
|
|
1163
|
+
allowed_company_ids?: number[];
|
|
1167
1164
|
[key: string]: any;
|
|
1168
1165
|
};
|
|
1169
1166
|
|
package/dist/hooks.d.ts
CHANGED
|
@@ -534,9 +534,6 @@ declare const useCompany: ({ service }: {
|
|
|
534
534
|
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
535
535
|
promise: Promise<any>;
|
|
536
536
|
};
|
|
537
|
-
context: {
|
|
538
|
-
allowed_company_ids: (number | undefined)[];
|
|
539
|
-
};
|
|
540
537
|
} | undefined;
|
|
541
538
|
interface CompanyTuple extends Array<number | string> {
|
|
542
539
|
0: number;
|
|
@@ -1163,7 +1160,7 @@ interface PartnerID {
|
|
|
1163
1160
|
type ContextProfile = {
|
|
1164
1161
|
uid: number;
|
|
1165
1162
|
lang: string;
|
|
1166
|
-
allowed_company_ids
|
|
1163
|
+
allowed_company_ids?: number[];
|
|
1167
1164
|
[key: string]: any;
|
|
1168
1165
|
};
|
|
1169
1166
|
|
package/dist/hooks.js
CHANGED
|
@@ -483,7 +483,6 @@ var useProfile = ({ service }) => {
|
|
|
483
483
|
if (userInfoQuery.data?.sub && userInfoQuery.data?.locale) {
|
|
484
484
|
return {
|
|
485
485
|
uid: Number(userInfoQuery.data.sub),
|
|
486
|
-
allowed_company_ids: [],
|
|
487
486
|
lang: String(userInfoQuery.data.locale),
|
|
488
487
|
tz: "Asia/Saigon"
|
|
489
488
|
};
|
|
@@ -568,7 +567,6 @@ var useCompany = ({ service }) => {
|
|
|
568
567
|
(0, import_react7.useEffect)(() => {
|
|
569
568
|
if (current_company_id) {
|
|
570
569
|
const companyIDs = [current_company_id];
|
|
571
|
-
setAllowCompanies([...companyIDs]);
|
|
572
570
|
setCompanies(companyIDs);
|
|
573
571
|
}
|
|
574
572
|
}, [current_company_id]);
|
|
@@ -592,8 +590,7 @@ var useCompany = ({ service }) => {
|
|
|
592
590
|
if (!companyInfo?.data || !currentCompany?.data) return;
|
|
593
591
|
return {
|
|
594
592
|
currentCompany: { ...currentCompany },
|
|
595
|
-
companyInfo: { ...companyInfo }
|
|
596
|
-
context: { allowed_company_ids: [current_company_id] }
|
|
593
|
+
companyInfo: { ...companyInfo }
|
|
597
594
|
};
|
|
598
595
|
};
|
|
599
596
|
|
|
@@ -619,12 +616,11 @@ var AppProvider = ({
|
|
|
619
616
|
return combineContexts([
|
|
620
617
|
{
|
|
621
618
|
...user?.context,
|
|
622
|
-
...!(0, utils_exports.isObjectEmpty)(env?.user)
|
|
619
|
+
...!(0, utils_exports.isObjectEmpty)(env?.user) ? { lang: env?.context?.lang } : {},
|
|
623
620
|
...menuParams?.context ?? {}
|
|
624
|
-
}
|
|
625
|
-
company?.context
|
|
621
|
+
}
|
|
626
622
|
]);
|
|
627
|
-
}, [user?.context
|
|
623
|
+
}, [user?.context]);
|
|
628
624
|
const menu = useMenu({
|
|
629
625
|
context: {
|
|
630
626
|
...menuContext
|
package/dist/hooks.mjs
CHANGED
|
@@ -464,7 +464,6 @@ var useProfile = ({ service }) => {
|
|
|
464
464
|
if (userInfoQuery.data?.sub && userInfoQuery.data?.locale) {
|
|
465
465
|
return {
|
|
466
466
|
uid: Number(userInfoQuery.data.sub),
|
|
467
|
-
allowed_company_ids: [],
|
|
468
467
|
lang: String(userInfoQuery.data.locale),
|
|
469
468
|
tz: "Asia/Saigon"
|
|
470
469
|
};
|
|
@@ -549,7 +548,6 @@ var useCompany = ({ service }) => {
|
|
|
549
548
|
useEffect4(() => {
|
|
550
549
|
if (current_company_id) {
|
|
551
550
|
const companyIDs = [current_company_id];
|
|
552
|
-
setAllowCompanies([...companyIDs]);
|
|
553
551
|
setCompanies(companyIDs);
|
|
554
552
|
}
|
|
555
553
|
}, [current_company_id]);
|
|
@@ -573,8 +571,7 @@ var useCompany = ({ service }) => {
|
|
|
573
571
|
if (!companyInfo?.data || !currentCompany?.data) return;
|
|
574
572
|
return {
|
|
575
573
|
currentCompany: { ...currentCompany },
|
|
576
|
-
companyInfo: { ...companyInfo }
|
|
577
|
-
context: { allowed_company_ids: [current_company_id] }
|
|
574
|
+
companyInfo: { ...companyInfo }
|
|
578
575
|
};
|
|
579
576
|
};
|
|
580
577
|
|
|
@@ -600,12 +597,11 @@ var AppProvider = ({
|
|
|
600
597
|
return combineContexts([
|
|
601
598
|
{
|
|
602
599
|
...user?.context,
|
|
603
|
-
...!(0, utils_exports.isObjectEmpty)(env?.user)
|
|
600
|
+
...!(0, utils_exports.isObjectEmpty)(env?.user) ? { lang: env?.context?.lang } : {},
|
|
604
601
|
...menuParams?.context ?? {}
|
|
605
|
-
}
|
|
606
|
-
company?.context
|
|
602
|
+
}
|
|
607
603
|
]);
|
|
608
|
-
}, [user?.context
|
|
604
|
+
}, [user?.context]);
|
|
609
605
|
const menu = useMenu({
|
|
610
606
|
context: {
|
|
611
607
|
...menuContext
|
package/dist/index.js
CHANGED
|
@@ -4533,7 +4533,6 @@ var useProfile = ({ service }) => {
|
|
|
4533
4533
|
if (userInfoQuery.data?.sub && userInfoQuery.data?.locale) {
|
|
4534
4534
|
return {
|
|
4535
4535
|
uid: Number(userInfoQuery.data.sub),
|
|
4536
|
-
allowed_company_ids: [],
|
|
4537
4536
|
lang: String(userInfoQuery.data.locale),
|
|
4538
4537
|
tz: "Asia/Saigon"
|
|
4539
4538
|
};
|
|
@@ -4618,7 +4617,6 @@ var useCompany = ({ service }) => {
|
|
|
4618
4617
|
(0, import_react7.useEffect)(() => {
|
|
4619
4618
|
if (current_company_id) {
|
|
4620
4619
|
const companyIDs = [current_company_id];
|
|
4621
|
-
setAllowCompanies([...companyIDs]);
|
|
4622
4620
|
setCompanies(companyIDs);
|
|
4623
4621
|
}
|
|
4624
4622
|
}, [current_company_id]);
|
|
@@ -4642,8 +4640,7 @@ var useCompany = ({ service }) => {
|
|
|
4642
4640
|
if (!companyInfo?.data || !currentCompany?.data) return;
|
|
4643
4641
|
return {
|
|
4644
4642
|
currentCompany: { ...currentCompany },
|
|
4645
|
-
companyInfo: { ...companyInfo }
|
|
4646
|
-
context: { allowed_company_ids: [current_company_id] }
|
|
4643
|
+
companyInfo: { ...companyInfo }
|
|
4647
4644
|
};
|
|
4648
4645
|
};
|
|
4649
4646
|
|
|
@@ -4669,12 +4666,11 @@ var AppProvider = ({
|
|
|
4669
4666
|
return combineContexts([
|
|
4670
4667
|
{
|
|
4671
4668
|
...user?.context,
|
|
4672
|
-
...!(0, utils_exports.isObjectEmpty)(env?.user)
|
|
4669
|
+
...!(0, utils_exports.isObjectEmpty)(env?.user) ? { lang: env?.context?.lang } : {},
|
|
4673
4670
|
...menuParams?.context ?? {}
|
|
4674
|
-
}
|
|
4675
|
-
company?.context
|
|
4671
|
+
}
|
|
4676
4672
|
]);
|
|
4677
|
-
}, [user?.context
|
|
4673
|
+
}, [user?.context]);
|
|
4678
4674
|
const menu = useMenu({
|
|
4679
4675
|
context: {
|
|
4680
4676
|
...menuContext
|
package/dist/index.mjs
CHANGED
|
@@ -4608,7 +4608,6 @@ var useProfile = ({ service }) => {
|
|
|
4608
4608
|
if (userInfoQuery.data?.sub && userInfoQuery.data?.locale) {
|
|
4609
4609
|
return {
|
|
4610
4610
|
uid: Number(userInfoQuery.data.sub),
|
|
4611
|
-
allowed_company_ids: [],
|
|
4612
4611
|
lang: String(userInfoQuery.data.locale),
|
|
4613
4612
|
tz: "Asia/Saigon"
|
|
4614
4613
|
};
|
|
@@ -4693,7 +4692,6 @@ var useCompany = ({ service }) => {
|
|
|
4693
4692
|
useEffect4(() => {
|
|
4694
4693
|
if (current_company_id) {
|
|
4695
4694
|
const companyIDs = [current_company_id];
|
|
4696
|
-
setAllowCompanies([...companyIDs]);
|
|
4697
4695
|
setCompanies(companyIDs);
|
|
4698
4696
|
}
|
|
4699
4697
|
}, [current_company_id]);
|
|
@@ -4717,8 +4715,7 @@ var useCompany = ({ service }) => {
|
|
|
4717
4715
|
if (!companyInfo?.data || !currentCompany?.data) return;
|
|
4718
4716
|
return {
|
|
4719
4717
|
currentCompany: { ...currentCompany },
|
|
4720
|
-
companyInfo: { ...companyInfo }
|
|
4721
|
-
context: { allowed_company_ids: [current_company_id] }
|
|
4718
|
+
companyInfo: { ...companyInfo }
|
|
4722
4719
|
};
|
|
4723
4720
|
};
|
|
4724
4721
|
|
|
@@ -4744,12 +4741,11 @@ var AppProvider = ({
|
|
|
4744
4741
|
return combineContexts([
|
|
4745
4742
|
{
|
|
4746
4743
|
...user?.context,
|
|
4747
|
-
...!(0, utils_exports.isObjectEmpty)(env?.user)
|
|
4744
|
+
...!(0, utils_exports.isObjectEmpty)(env?.user) ? { lang: env?.context?.lang } : {},
|
|
4748
4745
|
...menuParams?.context ?? {}
|
|
4749
|
-
}
|
|
4750
|
-
company?.context
|
|
4746
|
+
}
|
|
4751
4747
|
]);
|
|
4752
|
-
}, [user?.context
|
|
4748
|
+
}, [user?.context]);
|
|
4753
4749
|
const menu = useMenu({
|
|
4754
4750
|
context: {
|
|
4755
4751
|
...menuContext
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fctc/widget-logic",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.8",
|
|
4
4
|
"types": "dist/index.d.ts",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"test": "jest"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@fctc/interface-logic": "^3.5.
|
|
77
|
+
"@fctc/interface-logic": "^3.5.1",
|
|
78
78
|
"@headlessui/react": "^2.2.6",
|
|
79
79
|
"@tanstack/react-query": "^5.84.0",
|
|
80
80
|
"i18next": "^25.3.2",
|