@fctc/widget-logic 1.6.8 → 1.6.10
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 -2
- package/dist/hooks.d.ts +1 -2
- package/dist/hooks.js +7 -8
- package/dist/hooks.mjs +14 -25
- package/dist/icons.d.mts +2 -4
- package/dist/icons.d.ts +2 -4
- package/dist/index.d.mts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +44 -45
- package/dist/index.mjs +32 -43
- package/dist/widget.js +40 -41
- package/dist/widget.mjs +28 -39
- package/package.json +98 -96
package/dist/hooks.d.mts
CHANGED
|
@@ -2,7 +2,6 @@ import * as _tanstack_react_query from '@tanstack/react-query';
|
|
|
2
2
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { RefObject } from 'react';
|
|
5
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
5
|
export * from '@fctc/interface-logic/hooks';
|
|
7
6
|
|
|
8
7
|
declare const useCallAction: () => readonly [ActionResult | undefined, ({ aid, actionType, }: {
|
|
@@ -952,7 +951,7 @@ type AppProviderType = {
|
|
|
952
951
|
};
|
|
953
952
|
declare const AppProvider: ({ children }: {
|
|
954
953
|
children: React.ReactNode;
|
|
955
|
-
}) =>
|
|
954
|
+
}) => JSX.Element;
|
|
956
955
|
declare const useAppProvider: () => AppProviderType;
|
|
957
956
|
|
|
958
957
|
declare const DEFAULT_EVENTS: readonly ["mousedown", "touchstart"];
|
package/dist/hooks.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import * as _tanstack_react_query from '@tanstack/react-query';
|
|
|
2
2
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { RefObject } from 'react';
|
|
5
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
5
|
export * from '@fctc/interface-logic/hooks';
|
|
7
6
|
|
|
8
7
|
declare const useCallAction: () => readonly [ActionResult | undefined, ({ aid, actionType, }: {
|
|
@@ -952,7 +951,7 @@ type AppProviderType = {
|
|
|
952
951
|
};
|
|
953
952
|
declare const AppProvider: ({ children }: {
|
|
954
953
|
children: React.ReactNode;
|
|
955
|
-
}) =>
|
|
954
|
+
}) => JSX.Element;
|
|
956
955
|
declare const useAppProvider: () => AppProviderType;
|
|
957
956
|
|
|
958
957
|
declare const DEFAULT_EVENTS: readonly ["mousedown", "touchstart"];
|
package/dist/hooks.js
CHANGED
|
@@ -100,7 +100,8 @@ var useConfig = ({ localStorageUtils, sessionStorageUtils }) => {
|
|
|
100
100
|
}, []);
|
|
101
101
|
(0, import_react2.useEffect)(() => {
|
|
102
102
|
try {
|
|
103
|
-
(0, import_environment2.
|
|
103
|
+
const env = (0, import_environment2.getEnv)();
|
|
104
|
+
env.setupEnv({
|
|
104
105
|
baseUrl: envConfig.baseUrl,
|
|
105
106
|
port: 3e3,
|
|
106
107
|
config: {
|
|
@@ -452,10 +453,10 @@ var useProfile = (accessToken) => {
|
|
|
452
453
|
if (userInfoQuery.data) {
|
|
453
454
|
const userInfo = userInfoQuery.data;
|
|
454
455
|
const env = (0, import_environment3.getEnv)();
|
|
455
|
-
|
|
456
|
+
env.setUid(userInfo?.sub);
|
|
456
457
|
dispatch((0, import_store4.setDataUser)(userInfo));
|
|
457
458
|
const userLocale = languages.find((lang) => lang?.id === userInfo?.locale);
|
|
458
|
-
|
|
459
|
+
env.setLang(userLocale?.id);
|
|
459
460
|
i18n.changeLanguage(userLocale?.id.split("_")[0]);
|
|
460
461
|
}
|
|
461
462
|
}, [dispatch, userInfoQuery.data]);
|
|
@@ -565,10 +566,8 @@ var import_react_query3 = require("@tanstack/react-query");
|
|
|
565
566
|
var import_react9 = require("react");
|
|
566
567
|
var import_environment4 = require("@fctc/interface-logic/environment");
|
|
567
568
|
var import_hooks8 = require("@fctc/interface-logic/hooks");
|
|
568
|
-
var import_store6 = require("@fctc/interface-logic/store");
|
|
569
569
|
var useCompany = (accessToken) => {
|
|
570
570
|
const getCurrentCompany = (0, import_hooks8.useGetCurrentCompany)();
|
|
571
|
-
const dispatch = (0, import_store6.useAppDispatch)();
|
|
572
571
|
const fetchCurrentCompany = async () => {
|
|
573
572
|
return await getCurrentCompany.mutateAsync();
|
|
574
573
|
};
|
|
@@ -584,8 +583,8 @@ var useCompany = (accessToken) => {
|
|
|
584
583
|
if (current_company_id) {
|
|
585
584
|
const companyIDs = [current_company_id];
|
|
586
585
|
const env = (0, import_environment4.getEnv)();
|
|
587
|
-
|
|
588
|
-
|
|
586
|
+
env.setAllowCompanies([...companyIDs]);
|
|
587
|
+
env.setCompanies(companyIDs);
|
|
589
588
|
}
|
|
590
589
|
}, [current_company_id]);
|
|
591
590
|
const getCompanyInfo = (0, import_hooks8.useGetCompanyInfo)();
|
|
@@ -599,7 +598,7 @@ var useCompany = (accessToken) => {
|
|
|
599
598
|
const companyInfoData = companyInfo.data;
|
|
600
599
|
if (companyInfoData?.length) {
|
|
601
600
|
const env = (0, import_environment4.getEnv)();
|
|
602
|
-
|
|
601
|
+
env.setDefaultCompany(companyInfoData[0]);
|
|
603
602
|
}
|
|
604
603
|
}
|
|
605
604
|
}, [companyInfo.data]);
|
package/dist/hooks.mjs
CHANGED
|
@@ -31,7 +31,7 @@ var useCallAction = () => {
|
|
|
31
31
|
|
|
32
32
|
// src/hooks/core/use-config.ts
|
|
33
33
|
import { useEffect, useMemo } from "react";
|
|
34
|
-
import {
|
|
34
|
+
import { getEnv as getEnv2 } from "@fctc/interface-logic/environment";
|
|
35
35
|
import { useAppDispatch, setEnvFile } from "@fctc/interface-logic/store";
|
|
36
36
|
var useConfig = ({ localStorageUtils, sessionStorageUtils }) => {
|
|
37
37
|
const dispatch = useAppDispatch();
|
|
@@ -61,7 +61,8 @@ var useConfig = ({ localStorageUtils, sessionStorageUtils }) => {
|
|
|
61
61
|
}, []);
|
|
62
62
|
useEffect(() => {
|
|
63
63
|
try {
|
|
64
|
-
|
|
64
|
+
const env = getEnv2();
|
|
65
|
+
env.setupEnv({
|
|
65
66
|
baseUrl: envConfig.baseUrl,
|
|
66
67
|
port: 3e3,
|
|
67
68
|
config: {
|
|
@@ -401,14 +402,9 @@ var useMenu = ({ context }) => {
|
|
|
401
402
|
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
|
402
403
|
import { useEffect as useEffect5, useMemo as useMemo4 } from "react";
|
|
403
404
|
import { useTranslation } from "react-i18next";
|
|
404
|
-
import { getEnv as
|
|
405
|
+
import { getEnv as getEnv3 } from "@fctc/interface-logic/environment";
|
|
405
406
|
import { useGetProfile } from "@fctc/interface-logic/hooks";
|
|
406
|
-
import {
|
|
407
|
-
useAppDispatch as useAppDispatch3,
|
|
408
|
-
setDataUser,
|
|
409
|
-
setUid,
|
|
410
|
-
setLang
|
|
411
|
-
} from "@fctc/interface-logic/store";
|
|
407
|
+
import { useAppDispatch as useAppDispatch3, setDataUser } from "@fctc/interface-logic/store";
|
|
412
408
|
var useProfile = (accessToken) => {
|
|
413
409
|
const getProfile = useGetProfile();
|
|
414
410
|
const dispatch = useAppDispatch3();
|
|
@@ -424,11 +420,11 @@ var useProfile = (accessToken) => {
|
|
|
424
420
|
useEffect5(() => {
|
|
425
421
|
if (userInfoQuery.data) {
|
|
426
422
|
const userInfo = userInfoQuery.data;
|
|
427
|
-
const env =
|
|
428
|
-
|
|
423
|
+
const env = getEnv3();
|
|
424
|
+
env.setUid(userInfo?.sub);
|
|
429
425
|
dispatch(setDataUser(userInfo));
|
|
430
426
|
const userLocale = languages.find((lang) => lang?.id === userInfo?.locale);
|
|
431
|
-
|
|
427
|
+
env.setLang(userLocale?.id);
|
|
432
428
|
i18n.changeLanguage(userLocale?.id.split("_")[0]);
|
|
433
429
|
}
|
|
434
430
|
}, [dispatch, userInfoQuery.data]);
|
|
@@ -541,20 +537,13 @@ import { createContext, useContext, useMemo as useMemo7 } from "react";
|
|
|
541
537
|
// src/hooks/core/use-company.ts
|
|
542
538
|
import { useQuery as useQuery3 } from "@tanstack/react-query";
|
|
543
539
|
import { useEffect as useEffect6, useMemo as useMemo6 } from "react";
|
|
544
|
-
import { getEnv as
|
|
540
|
+
import { getEnv as getEnv4 } from "@fctc/interface-logic/environment";
|
|
545
541
|
import {
|
|
546
542
|
useGetCurrentCompany,
|
|
547
543
|
useGetCompanyInfo
|
|
548
544
|
} from "@fctc/interface-logic/hooks";
|
|
549
|
-
import {
|
|
550
|
-
setAllowCompanies,
|
|
551
|
-
setCompanies,
|
|
552
|
-
setDefaultCompany,
|
|
553
|
-
useAppDispatch as useAppDispatch5
|
|
554
|
-
} from "@fctc/interface-logic/store";
|
|
555
545
|
var useCompany = (accessToken) => {
|
|
556
546
|
const getCurrentCompany = useGetCurrentCompany();
|
|
557
|
-
const dispatch = useAppDispatch5();
|
|
558
547
|
const fetchCurrentCompany = async () => {
|
|
559
548
|
return await getCurrentCompany.mutateAsync();
|
|
560
549
|
};
|
|
@@ -569,9 +558,9 @@ var useCompany = (accessToken) => {
|
|
|
569
558
|
useEffect6(() => {
|
|
570
559
|
if (current_company_id) {
|
|
571
560
|
const companyIDs = [current_company_id];
|
|
572
|
-
const env =
|
|
573
|
-
|
|
574
|
-
|
|
561
|
+
const env = getEnv4();
|
|
562
|
+
env.setAllowCompanies([...companyIDs]);
|
|
563
|
+
env.setCompanies(companyIDs);
|
|
575
564
|
}
|
|
576
565
|
}, [current_company_id]);
|
|
577
566
|
const getCompanyInfo = useGetCompanyInfo();
|
|
@@ -584,8 +573,8 @@ var useCompany = (accessToken) => {
|
|
|
584
573
|
if (companyInfo.data) {
|
|
585
574
|
const companyInfoData = companyInfo.data;
|
|
586
575
|
if (companyInfoData?.length) {
|
|
587
|
-
const env =
|
|
588
|
-
|
|
576
|
+
const env = getEnv4();
|
|
577
|
+
env.setDefaultCompany(companyInfoData[0]);
|
|
589
578
|
}
|
|
590
579
|
}
|
|
591
580
|
}, [companyInfo.data]);
|
package/dist/icons.d.mts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
|
|
3
1
|
declare const EyeIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
4
2
|
|
|
5
|
-
declare const LoadingIcon: ({ width, height, ...props }: React.SVGProps<SVGSVGElement>) =>
|
|
3
|
+
declare const LoadingIcon: ({ width, height, ...props }: React.SVGProps<SVGSVGElement>) => JSX.Element;
|
|
6
4
|
|
|
7
5
|
declare const CloseIcon: ({ className }: {
|
|
8
6
|
className?: string;
|
|
9
|
-
}) =>
|
|
7
|
+
}) => JSX.Element;
|
|
10
8
|
|
|
11
9
|
export { CloseIcon, EyeIcon, LoadingIcon };
|
package/dist/icons.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
|
|
3
1
|
declare const EyeIcon: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
4
2
|
|
|
5
|
-
declare const LoadingIcon: ({ width, height, ...props }: React.SVGProps<SVGSVGElement>) =>
|
|
3
|
+
declare const LoadingIcon: ({ width, height, ...props }: React.SVGProps<SVGSVGElement>) => JSX.Element;
|
|
6
4
|
|
|
7
5
|
declare const CloseIcon: ({ className }: {
|
|
8
6
|
className?: string;
|
|
9
|
-
}) =>
|
|
7
|
+
}) => JSX.Element;
|
|
10
8
|
|
|
11
9
|
export { CloseIcon, EyeIcon, LoadingIcon };
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -4166,7 +4166,8 @@ var useConfig = ({ localStorageUtils, sessionStorageUtils }) => {
|
|
|
4166
4166
|
}, []);
|
|
4167
4167
|
(0, import_react2.useEffect)(() => {
|
|
4168
4168
|
try {
|
|
4169
|
-
(0, import_environment2.
|
|
4169
|
+
const env = (0, import_environment2.getEnv)();
|
|
4170
|
+
env.setupEnv({
|
|
4170
4171
|
baseUrl: envConfig.baseUrl,
|
|
4171
4172
|
port: 3e3,
|
|
4172
4173
|
config: {
|
|
@@ -4597,10 +4598,10 @@ var useProfile = (accessToken) => {
|
|
|
4597
4598
|
if (userInfoQuery.data) {
|
|
4598
4599
|
const userInfo = userInfoQuery.data;
|
|
4599
4600
|
const env = (0, import_environment3.getEnv)();
|
|
4600
|
-
|
|
4601
|
+
env.setUid(userInfo?.sub);
|
|
4601
4602
|
dispatch((0, import_store4.setDataUser)(userInfo));
|
|
4602
4603
|
const userLocale = languages.find((lang) => lang?.id === userInfo?.locale);
|
|
4603
|
-
|
|
4604
|
+
env.setLang(userLocale?.id);
|
|
4604
4605
|
i18n2.changeLanguage(userLocale?.id.split("_")[0]);
|
|
4605
4606
|
}
|
|
4606
4607
|
}, [dispatch, userInfoQuery.data]);
|
|
@@ -4710,10 +4711,8 @@ var import_react_query3 = require("@tanstack/react-query");
|
|
|
4710
4711
|
var import_react9 = require("react");
|
|
4711
4712
|
var import_environment4 = require("@fctc/interface-logic/environment");
|
|
4712
4713
|
var import_hooks8 = require("@fctc/interface-logic/hooks");
|
|
4713
|
-
var import_store6 = require("@fctc/interface-logic/store");
|
|
4714
4714
|
var useCompany = (accessToken) => {
|
|
4715
4715
|
const getCurrentCompany = (0, import_hooks8.useGetCurrentCompany)();
|
|
4716
|
-
const dispatch = (0, import_store6.useAppDispatch)();
|
|
4717
4716
|
const fetchCurrentCompany = async () => {
|
|
4718
4717
|
return await getCurrentCompany.mutateAsync();
|
|
4719
4718
|
};
|
|
@@ -4729,8 +4728,8 @@ var useCompany = (accessToken) => {
|
|
|
4729
4728
|
if (current_company_id) {
|
|
4730
4729
|
const companyIDs = [current_company_id];
|
|
4731
4730
|
const env = (0, import_environment4.getEnv)();
|
|
4732
|
-
|
|
4733
|
-
|
|
4731
|
+
env.setAllowCompanies([...companyIDs]);
|
|
4732
|
+
env.setCompanies(companyIDs);
|
|
4734
4733
|
}
|
|
4735
4734
|
}, [current_company_id]);
|
|
4736
4735
|
const getCompanyInfo = (0, import_hooks8.useGetCompanyInfo)();
|
|
@@ -4744,7 +4743,7 @@ var useCompany = (accessToken) => {
|
|
|
4744
4743
|
const companyInfoData = companyInfo.data;
|
|
4745
4744
|
if (companyInfoData?.length) {
|
|
4746
4745
|
const env = (0, import_environment4.getEnv)();
|
|
4747
|
-
|
|
4746
|
+
env.setDefaultCompany(companyInfoData[0]);
|
|
4748
4747
|
}
|
|
4749
4748
|
}
|
|
4750
4749
|
}, [companyInfo.data]);
|
|
@@ -5044,7 +5043,7 @@ var statusDropdownController = (props) => {
|
|
|
5044
5043
|
// src/widget/basic/many2one-field/controller.ts
|
|
5045
5044
|
var import_react14 = require("react");
|
|
5046
5045
|
var import_hooks11 = require("@fctc/interface-logic/hooks");
|
|
5047
|
-
var
|
|
5046
|
+
var import_store6 = require("@fctc/interface-logic/store");
|
|
5048
5047
|
var import_utils3 = require("@fctc/interface-logic/utils");
|
|
5049
5048
|
var many2oneFieldController = (props) => {
|
|
5050
5049
|
const {
|
|
@@ -5063,8 +5062,8 @@ var many2oneFieldController = (props) => {
|
|
|
5063
5062
|
const [options, setOptions] = (0, import_react14.useState)([]);
|
|
5064
5063
|
const [isShowModalMany2Many, setIsShowModalMany2Many] = (0, import_react14.useState)(false);
|
|
5065
5064
|
const [tempSelectedOption, setTempSelectedOption] = (0, import_react14.useState)(null);
|
|
5066
|
-
const { menuList } = (0,
|
|
5067
|
-
const { context } = (0,
|
|
5065
|
+
const { menuList } = (0, import_store6.useAppSelector)(import_store6.selectNavbar);
|
|
5066
|
+
const { context } = (0, import_store6.useAppSelector)(import_store6.selectEnv);
|
|
5068
5067
|
const [domainModal, setDomainModal] = (0, import_react14.useState)(null);
|
|
5069
5068
|
const initValue = methods?.getValues(name);
|
|
5070
5069
|
const domainObject = (0, import_react14.useMemo)(
|
|
@@ -5114,7 +5113,7 @@ var many2oneFieldController = (props) => {
|
|
|
5114
5113
|
(0, import_react14.useEffect)(() => {
|
|
5115
5114
|
setOptions(selectOptions);
|
|
5116
5115
|
setDomainModal(domainObject);
|
|
5117
|
-
if (relation === "student.subject") (0,
|
|
5116
|
+
if (relation === "student.subject") (0, import_store6.setListSubject)(selectOptions);
|
|
5118
5117
|
}, [selectOptions]);
|
|
5119
5118
|
(0, import_react14.useEffect)(() => {
|
|
5120
5119
|
if (!propValue && tempSelectedOption) {
|
|
@@ -5245,7 +5244,7 @@ var many2oneButtonController = (props) => {
|
|
|
5245
5244
|
var import_react18 = require("react");
|
|
5246
5245
|
|
|
5247
5246
|
// src/widget/advance/table/table-body/controller.ts
|
|
5248
|
-
var
|
|
5247
|
+
var import_store7 = require("@fctc/interface-logic/store");
|
|
5249
5248
|
var import_react15 = require("react");
|
|
5250
5249
|
var tableBodyController = (props) => {
|
|
5251
5250
|
const {
|
|
@@ -5258,7 +5257,7 @@ var tableBodyController = (props) => {
|
|
|
5258
5257
|
selectedRowKeysRef,
|
|
5259
5258
|
onClickRow
|
|
5260
5259
|
} = props;
|
|
5261
|
-
const appDispatch = (0,
|
|
5260
|
+
const appDispatch = (0, import_store7.useAppDispatch)();
|
|
5262
5261
|
const checked = (0, import_react15.useMemo)(() => {
|
|
5263
5262
|
if (!row?.id) return false;
|
|
5264
5263
|
if (selectedRowKeys?.includes(row.id)) {
|
|
@@ -5275,7 +5274,7 @@ var tableBodyController = (props) => {
|
|
|
5275
5274
|
}
|
|
5276
5275
|
const newSelectedRowKeys = selectedRowKeys?.includes(row.id) ? selectedRowKeys?.filter((key) => key !== row.id) : [...selectedRowKeys, row.id];
|
|
5277
5276
|
console.log("newSelectedRowKeys", newSelectedRowKeys);
|
|
5278
|
-
appDispatch((0,
|
|
5277
|
+
appDispatch((0, import_store7.setSelectedRowKeys)(newSelectedRowKeys));
|
|
5279
5278
|
};
|
|
5280
5279
|
const handleClickRow = (col, row2) => {
|
|
5281
5280
|
onClickRow(col, row2);
|
|
@@ -5288,13 +5287,13 @@ var tableBodyController = (props) => {
|
|
|
5288
5287
|
(id) => id !== row.id
|
|
5289
5288
|
);
|
|
5290
5289
|
selectedRowKeysRef.current = filtered;
|
|
5291
|
-
appDispatch((0,
|
|
5290
|
+
appDispatch((0, import_store7.setSelectedRowKeys)(filtered));
|
|
5292
5291
|
} else {
|
|
5293
5292
|
const unique = Array.from(
|
|
5294
5293
|
/* @__PURE__ */ new Set([...selectedRowKeysRef?.current, row?.id])
|
|
5295
5294
|
);
|
|
5296
5295
|
selectedRowKeysRef.current = unique;
|
|
5297
|
-
appDispatch((0,
|
|
5296
|
+
appDispatch((0, import_store7.setSelectedRowKeys)(unique));
|
|
5298
5297
|
}
|
|
5299
5298
|
}
|
|
5300
5299
|
}, [isAutoSelect]);
|
|
@@ -5312,35 +5311,35 @@ var tableBodyController = (props) => {
|
|
|
5312
5311
|
};
|
|
5313
5312
|
|
|
5314
5313
|
// src/widget/advance/table/table-head/controller.ts
|
|
5315
|
-
var
|
|
5314
|
+
var import_store8 = require("@fctc/interface-logic/store");
|
|
5316
5315
|
var tableHeadController = (props) => {
|
|
5317
5316
|
const { typeTable, rows, selectedRowKeysRef } = props;
|
|
5318
|
-
const appDispatch = (0,
|
|
5319
|
-
const { groupByDomain } = (0,
|
|
5317
|
+
const appDispatch = (0, import_store8.useAppDispatch)();
|
|
5318
|
+
const { groupByDomain } = (0, import_store8.useAppSelector)(import_store8.selectSearch);
|
|
5320
5319
|
const handleCheckBoxAll = (event) => {
|
|
5321
5320
|
if (event?.target?.checked && typeTable === "list") {
|
|
5322
5321
|
const allRowKeys = Array.isArray(rows) ? rows.map((record) => record?.id) : [];
|
|
5323
|
-
appDispatch((0,
|
|
5322
|
+
appDispatch((0, import_store8.setSelectedRowKeys)(allRowKeys));
|
|
5324
5323
|
} else if (event?.target?.checked && typeTable === "group") {
|
|
5325
5324
|
const rowsIDs = document.querySelectorAll("tr[data-row-id]");
|
|
5326
5325
|
const ids = Array.from(rowsIDs)?.map(
|
|
5327
5326
|
(row) => Number(row?.getAttribute("data-row-id"))
|
|
5328
5327
|
);
|
|
5329
5328
|
if (ids?.length > 0) {
|
|
5330
|
-
appDispatch((0,
|
|
5329
|
+
appDispatch((0, import_store8.setSelectedRowKeys)(ids));
|
|
5331
5330
|
} else {
|
|
5332
5331
|
const sum = countSum(
|
|
5333
5332
|
rows,
|
|
5334
5333
|
typeof groupByDomain === "object" ? groupByDomain?.contexts?.[0]?.group_by : void 0
|
|
5335
5334
|
);
|
|
5336
5335
|
const keys = Array.from({ length: sum }, (_) => void 0);
|
|
5337
|
-
appDispatch((0,
|
|
5336
|
+
appDispatch((0, import_store8.setSelectedRowKeys)(keys));
|
|
5338
5337
|
}
|
|
5339
5338
|
if (selectedRowKeysRef) {
|
|
5340
5339
|
selectedRowKeysRef.current = [];
|
|
5341
5340
|
}
|
|
5342
5341
|
} else {
|
|
5343
|
-
appDispatch((0,
|
|
5342
|
+
appDispatch((0, import_store8.setSelectedRowKeys)([]));
|
|
5344
5343
|
}
|
|
5345
5344
|
};
|
|
5346
5345
|
return {
|
|
@@ -5350,7 +5349,7 @@ var tableHeadController = (props) => {
|
|
|
5350
5349
|
|
|
5351
5350
|
// src/widget/advance/table/table-view/controller.ts
|
|
5352
5351
|
var import_react16 = require("react");
|
|
5353
|
-
var
|
|
5352
|
+
var import_store9 = require("@fctc/interface-logic/store");
|
|
5354
5353
|
var import_utils5 = require("@fctc/interface-logic/utils");
|
|
5355
5354
|
var tableController = ({ data }) => {
|
|
5356
5355
|
const [rows, setRows] = (0, import_react16.useState)(data.records || []);
|
|
@@ -6198,7 +6197,7 @@ var i18n_default = import_i18next.default;
|
|
|
6198
6197
|
|
|
6199
6198
|
// src/widget/advance/table/table-group/controller.ts
|
|
6200
6199
|
var import_hooks13 = require("@fctc/interface-logic/hooks");
|
|
6201
|
-
var
|
|
6200
|
+
var import_store10 = require("@fctc/interface-logic/store");
|
|
6202
6201
|
|
|
6203
6202
|
// src/environment.ts
|
|
6204
6203
|
var environment_exports = {};
|
|
@@ -6226,9 +6225,9 @@ var tableGroupController = (props) => {
|
|
|
6226
6225
|
selectedRowKeysRef
|
|
6227
6226
|
} = props;
|
|
6228
6227
|
const [pageGroup, setPageGroup] = (0, import_react17.useState)(0);
|
|
6229
|
-
const { groupByDomain, selectedTags } = (0,
|
|
6230
|
-
const { selectedRowKeys } = (0,
|
|
6231
|
-
const appDispatch = (0,
|
|
6228
|
+
const { groupByDomain, selectedTags } = (0, import_store10.useAppSelector)(import_store10.selectSearch);
|
|
6229
|
+
const { selectedRowKeys } = (0, import_store10.useAppSelector)(import_store10.selectList);
|
|
6230
|
+
const appDispatch = (0, import_store10.useAppDispatch)();
|
|
6232
6231
|
const { toDataJS } = (0, import_hooks13.useOdooDataTransform)();
|
|
6233
6232
|
const initVal = toDataJS(row, viewData, model);
|
|
6234
6233
|
const [isShowGroup, setIsShowGroup] = (0, import_react17.useState)(false);
|
|
@@ -6314,14 +6313,14 @@ var tableGroupController = (props) => {
|
|
|
6314
6313
|
const filteredIds = selectedRowKeys.filter(
|
|
6315
6314
|
(id) => !ids.includes(id)
|
|
6316
6315
|
);
|
|
6317
|
-
appDispatch((0,
|
|
6316
|
+
appDispatch((0, import_store10.setSelectedRowKeys)(filteredIds));
|
|
6318
6317
|
} else if (!isShowGroup && selectedRowKeys?.length > 0 && typeTableGroup === "list" && checkedAll && !allIdsNull && isQueryFetched) {
|
|
6319
6318
|
const clonedKeys = [...selectedRowKeys];
|
|
6320
|
-
appDispatch((0,
|
|
6321
|
-
setTimeout(() => appDispatch((0,
|
|
6319
|
+
appDispatch((0, import_store10.setSelectedRowKeys)([...clonedKeys, -1]));
|
|
6320
|
+
setTimeout(() => appDispatch((0, import_store10.setSelectedRowKeys)(clonedKeys)), 500);
|
|
6322
6321
|
} else if (isShowGroup && selectedRowKeys?.length > 0 && typeTableGroup === "list" && !checkedAll && !allIdsNull) {
|
|
6323
6322
|
const filteredKeys = selectedRowKeys.filter((id) => id > -1);
|
|
6324
|
-
appDispatch((0,
|
|
6323
|
+
appDispatch((0, import_store10.setSelectedRowKeys)(filteredKeys));
|
|
6325
6324
|
}
|
|
6326
6325
|
toggleShowGroup();
|
|
6327
6326
|
};
|
|
@@ -6330,8 +6329,8 @@ var tableGroupController = (props) => {
|
|
|
6330
6329
|
return;
|
|
6331
6330
|
}
|
|
6332
6331
|
const clonedKeys = [...selectedRowKeys];
|
|
6333
|
-
(0,
|
|
6334
|
-
setTimeout(() => (0,
|
|
6332
|
+
(0, import_store10.setSelectedRowKeys)([...clonedKeys, -1]);
|
|
6333
|
+
setTimeout(() => (0, import_store10.setSelectedRowKeys)(clonedKeys), 500);
|
|
6335
6334
|
}, [isQueryFetched]);
|
|
6336
6335
|
return {
|
|
6337
6336
|
handleExpandChildGroup,
|
|
@@ -6366,7 +6365,7 @@ var tableGroupController = (props) => {
|
|
|
6366
6365
|
|
|
6367
6366
|
// src/widget/basic/many2many-field/controller.ts
|
|
6368
6367
|
var import_environment8 = require("@fctc/interface-logic/environment");
|
|
6369
|
-
var
|
|
6368
|
+
var import_store11 = require("@fctc/interface-logic/store");
|
|
6370
6369
|
var import_utils6 = require("@fctc/interface-logic/utils");
|
|
6371
6370
|
var many2manyFieldController = (props) => {
|
|
6372
6371
|
const {
|
|
@@ -6384,14 +6383,14 @@ var many2manyFieldController = (props) => {
|
|
|
6384
6383
|
options,
|
|
6385
6384
|
sessionStorageUtils
|
|
6386
6385
|
} = props;
|
|
6387
|
-
const appDispatch = (0,
|
|
6386
|
+
const appDispatch = (0, import_store11.useAppDispatch)();
|
|
6388
6387
|
const actionData = sessionStorageUtils.getActionData();
|
|
6389
6388
|
const [debouncedPage] = useDebounce(page, 500);
|
|
6390
6389
|
const [order, setOrder] = (0, import_react18.useState)();
|
|
6391
6390
|
const [isLoadedData, setIsLoadedData] = (0, import_react18.useState)(false);
|
|
6392
6391
|
const [domainMany2Many, setDomainMany2Many] = (0, import_react18.useState)(domain);
|
|
6393
6392
|
const env = (0, import_environment8.getEnv)();
|
|
6394
|
-
const { selectedTags } = (0,
|
|
6393
|
+
const { selectedTags } = (0, import_store11.useAppSelector)(import_store11.selectSearch);
|
|
6395
6394
|
const viewParams = {
|
|
6396
6395
|
model: relation,
|
|
6397
6396
|
views: [
|
|
@@ -6434,8 +6433,8 @@ var many2manyFieldController = (props) => {
|
|
|
6434
6433
|
const fetchData = async () => {
|
|
6435
6434
|
try {
|
|
6436
6435
|
setDomainMany2Many(domain);
|
|
6437
|
-
appDispatch((0,
|
|
6438
|
-
appDispatch((0,
|
|
6436
|
+
appDispatch((0, import_store11.setFirstDomain)(domain));
|
|
6437
|
+
appDispatch((0, import_store11.setViewDataStore)(viewResponse));
|
|
6439
6438
|
const modalData = viewResponse?.views?.list?.fields.map((field) => ({
|
|
6440
6439
|
...viewResponse?.models?.[String(model)]?.[field?.name],
|
|
6441
6440
|
...field
|
|
@@ -6446,7 +6445,7 @@ var many2manyFieldController = (props) => {
|
|
|
6446
6445
|
[`${aid}_${relation}_popupmany2many`]: modalData
|
|
6447
6446
|
});
|
|
6448
6447
|
}
|
|
6449
|
-
appDispatch((0,
|
|
6448
|
+
appDispatch((0, import_store11.setPage)(0));
|
|
6450
6449
|
} catch (err) {
|
|
6451
6450
|
console.log(err);
|
|
6452
6451
|
}
|
|
@@ -6482,12 +6481,12 @@ var many2manyFieldController = (props) => {
|
|
|
6482
6481
|
fetchData();
|
|
6483
6482
|
}
|
|
6484
6483
|
return () => {
|
|
6485
|
-
appDispatch((0,
|
|
6484
|
+
appDispatch((0, import_store11.setGroupByDomain)(null));
|
|
6486
6485
|
setFields((prevFields) => ({
|
|
6487
6486
|
...prevFields,
|
|
6488
6487
|
[`${aid}_${relation}_popupmany2many`]: null
|
|
6489
6488
|
}));
|
|
6490
|
-
appDispatch((0,
|
|
6489
|
+
appDispatch((0, import_store11.setPage)(0));
|
|
6491
6490
|
setSelectedRowKeys4([]);
|
|
6492
6491
|
setDomainMany2Many(null);
|
|
6493
6492
|
setIsLoadedData(false);
|
|
@@ -6600,7 +6599,7 @@ var many2manyTagsController = (props) => {
|
|
|
6600
6599
|
// src/widget/basic/status-bar-field/controller.ts
|
|
6601
6600
|
var import_react20 = require("react");
|
|
6602
6601
|
var import_hooks16 = require("@fctc/interface-logic/hooks");
|
|
6603
|
-
var
|
|
6602
|
+
var import_store12 = require("@fctc/interface-logic/store");
|
|
6604
6603
|
var import_utils8 = require("@fctc/interface-logic/utils");
|
|
6605
6604
|
var durationController = (props) => {
|
|
6606
6605
|
const {
|
|
@@ -6620,7 +6619,7 @@ var durationController = (props) => {
|
|
|
6620
6619
|
};
|
|
6621
6620
|
const [disabled, setDisabled] = (0, import_react20.useState)(false);
|
|
6622
6621
|
const [modelStatus, setModalStatus] = (0, import_react20.useState)(false);
|
|
6623
|
-
const { context } = (0,
|
|
6622
|
+
const { context } = (0, import_store12.useAppSelector)(import_store12.selectEnv);
|
|
6624
6623
|
const queryKey = [`data-status-duration`, specification];
|
|
6625
6624
|
const listDataProps = {
|
|
6626
6625
|
model: relation,
|