@fctc/widget-logic 2.9.2 → 2.9.3

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 CHANGED
@@ -787,23 +787,17 @@ declare const useListData: ({ action, context, viewData, model, service, xNode,
787
787
  }) => {
788
788
  state: {
789
789
  specification: Record<string, any> | null;
790
- type: string;
791
790
  page: number;
792
- mode: string;
793
791
  order: any;
794
792
  domain: any;
795
793
  pageLimit: number;
796
794
  groupByList: any;
797
- currentDate: Date;
798
795
  selectedRowKeys: number[];
799
- setType: react.Dispatch<react.SetStateAction<string>>;
800
- setMode: react.Dispatch<react.SetStateAction<string>>;
801
796
  setPage: react.Dispatch<react.SetStateAction<number>>;
802
797
  setOrder: react.Dispatch<any>;
803
798
  setDomain: react.Dispatch<any>;
804
799
  setPageLimit: react.Dispatch<react.SetStateAction<number>>;
805
800
  setGroupByList: react.Dispatch<any>;
806
- setCurrentDate: react.Dispatch<react.SetStateAction<Date>>;
807
801
  setSelectedRowKeys: react.Dispatch<react.SetStateAction<number[]>>;
808
802
  };
809
803
  data: any;
@@ -835,23 +829,17 @@ declare const useListData: ({ action, context, viewData, model, service, xNode,
835
829
  } | {
836
830
  state: {
837
831
  specification: Record<string, any> | null;
838
- type: string;
839
832
  page: number;
840
- mode: string;
841
833
  order: any;
842
834
  domain: any;
843
835
  pageLimit: number;
844
836
  groupByList: any;
845
- currentDate: Date;
846
837
  selectedRowKeys: number[];
847
- setType: react.Dispatch<react.SetStateAction<string>>;
848
- setMode: react.Dispatch<react.SetStateAction<string>>;
849
838
  setPage: react.Dispatch<react.SetStateAction<number>>;
850
839
  setOrder: react.Dispatch<any>;
851
840
  setDomain: react.Dispatch<any>;
852
841
  setPageLimit: react.Dispatch<react.SetStateAction<number>>;
853
842
  setGroupByList: react.Dispatch<any>;
854
- setCurrentDate: react.Dispatch<react.SetStateAction<Date>>;
855
843
  setSelectedRowKeys: react.Dispatch<react.SetStateAction<number[]>>;
856
844
  };
857
845
  data: any;
@@ -883,23 +871,17 @@ declare const useListData: ({ action, context, viewData, model, service, xNode,
883
871
  } | {
884
872
  state: {
885
873
  specification: Record<string, any> | null;
886
- type: string;
887
874
  page: number;
888
- mode: string;
889
875
  order: any;
890
876
  domain: any;
891
877
  pageLimit: number;
892
878
  groupByList: any;
893
- currentDate: Date;
894
879
  selectedRowKeys: number[];
895
- setType: react.Dispatch<react.SetStateAction<string>>;
896
- setMode: react.Dispatch<react.SetStateAction<string>>;
897
880
  setPage: react.Dispatch<react.SetStateAction<number>>;
898
881
  setOrder: react.Dispatch<any>;
899
882
  setDomain: react.Dispatch<any>;
900
883
  setPageLimit: react.Dispatch<react.SetStateAction<number>>;
901
884
  setGroupByList: react.Dispatch<any>;
902
- setCurrentDate: react.Dispatch<react.SetStateAction<Date>>;
903
885
  setSelectedRowKeys: react.Dispatch<react.SetStateAction<number[]>>;
904
886
  };
905
887
  data: undefined;
@@ -931,23 +913,17 @@ declare const useListData: ({ action, context, viewData, model, service, xNode,
931
913
  } | {
932
914
  state: {
933
915
  specification: Record<string, any> | null;
934
- type: string;
935
916
  page: number;
936
- mode: string;
937
917
  order: any;
938
918
  domain: any;
939
919
  pageLimit: number;
940
920
  groupByList: any;
941
- currentDate: Date;
942
921
  selectedRowKeys: number[];
943
- setType: react.Dispatch<react.SetStateAction<string>>;
944
- setMode: react.Dispatch<react.SetStateAction<string>>;
945
922
  setPage: react.Dispatch<react.SetStateAction<number>>;
946
923
  setOrder: react.Dispatch<any>;
947
924
  setDomain: react.Dispatch<any>;
948
925
  setPageLimit: react.Dispatch<react.SetStateAction<number>>;
949
926
  setGroupByList: react.Dispatch<any>;
950
- setCurrentDate: react.Dispatch<react.SetStateAction<Date>>;
951
927
  setSelectedRowKeys: react.Dispatch<react.SetStateAction<number[]>>;
952
928
  };
953
929
  data: undefined;
@@ -979,23 +955,17 @@ declare const useListData: ({ action, context, viewData, model, service, xNode,
979
955
  } | {
980
956
  state: {
981
957
  specification: Record<string, any> | null;
982
- type: string;
983
958
  page: number;
984
- mode: string;
985
959
  order: any;
986
960
  domain: any;
987
961
  pageLimit: number;
988
962
  groupByList: any;
989
- currentDate: Date;
990
963
  selectedRowKeys: number[];
991
- setType: react.Dispatch<react.SetStateAction<string>>;
992
- setMode: react.Dispatch<react.SetStateAction<string>>;
993
964
  setPage: react.Dispatch<react.SetStateAction<number>>;
994
965
  setOrder: react.Dispatch<any>;
995
966
  setDomain: react.Dispatch<any>;
996
967
  setPageLimit: react.Dispatch<react.SetStateAction<number>>;
997
968
  setGroupByList: react.Dispatch<any>;
998
- setCurrentDate: react.Dispatch<react.SetStateAction<Date>>;
999
969
  setSelectedRowKeys: react.Dispatch<react.SetStateAction<number[]>>;
1000
970
  };
1001
971
  data: undefined;
@@ -1027,23 +997,17 @@ declare const useListData: ({ action, context, viewData, model, service, xNode,
1027
997
  } | {
1028
998
  state: {
1029
999
  specification: Record<string, any> | null;
1030
- type: string;
1031
1000
  page: number;
1032
- mode: string;
1033
1001
  order: any;
1034
1002
  domain: any;
1035
1003
  pageLimit: number;
1036
1004
  groupByList: any;
1037
- currentDate: Date;
1038
1005
  selectedRowKeys: number[];
1039
- setType: react.Dispatch<react.SetStateAction<string>>;
1040
- setMode: react.Dispatch<react.SetStateAction<string>>;
1041
1006
  setPage: react.Dispatch<react.SetStateAction<number>>;
1042
1007
  setOrder: react.Dispatch<any>;
1043
1008
  setDomain: react.Dispatch<any>;
1044
1009
  setPageLimit: react.Dispatch<react.SetStateAction<number>>;
1045
1010
  setGroupByList: react.Dispatch<any>;
1046
- setCurrentDate: react.Dispatch<react.SetStateAction<Date>>;
1047
1011
  setSelectedRowKeys: react.Dispatch<react.SetStateAction<number[]>>;
1048
1012
  };
1049
1013
  data: any;
package/dist/hooks.d.ts CHANGED
@@ -787,23 +787,17 @@ declare const useListData: ({ action, context, viewData, model, service, xNode,
787
787
  }) => {
788
788
  state: {
789
789
  specification: Record<string, any> | null;
790
- type: string;
791
790
  page: number;
792
- mode: string;
793
791
  order: any;
794
792
  domain: any;
795
793
  pageLimit: number;
796
794
  groupByList: any;
797
- currentDate: Date;
798
795
  selectedRowKeys: number[];
799
- setType: react.Dispatch<react.SetStateAction<string>>;
800
- setMode: react.Dispatch<react.SetStateAction<string>>;
801
796
  setPage: react.Dispatch<react.SetStateAction<number>>;
802
797
  setOrder: react.Dispatch<any>;
803
798
  setDomain: react.Dispatch<any>;
804
799
  setPageLimit: react.Dispatch<react.SetStateAction<number>>;
805
800
  setGroupByList: react.Dispatch<any>;
806
- setCurrentDate: react.Dispatch<react.SetStateAction<Date>>;
807
801
  setSelectedRowKeys: react.Dispatch<react.SetStateAction<number[]>>;
808
802
  };
809
803
  data: any;
@@ -835,23 +829,17 @@ declare const useListData: ({ action, context, viewData, model, service, xNode,
835
829
  } | {
836
830
  state: {
837
831
  specification: Record<string, any> | null;
838
- type: string;
839
832
  page: number;
840
- mode: string;
841
833
  order: any;
842
834
  domain: any;
843
835
  pageLimit: number;
844
836
  groupByList: any;
845
- currentDate: Date;
846
837
  selectedRowKeys: number[];
847
- setType: react.Dispatch<react.SetStateAction<string>>;
848
- setMode: react.Dispatch<react.SetStateAction<string>>;
849
838
  setPage: react.Dispatch<react.SetStateAction<number>>;
850
839
  setOrder: react.Dispatch<any>;
851
840
  setDomain: react.Dispatch<any>;
852
841
  setPageLimit: react.Dispatch<react.SetStateAction<number>>;
853
842
  setGroupByList: react.Dispatch<any>;
854
- setCurrentDate: react.Dispatch<react.SetStateAction<Date>>;
855
843
  setSelectedRowKeys: react.Dispatch<react.SetStateAction<number[]>>;
856
844
  };
857
845
  data: any;
@@ -883,23 +871,17 @@ declare const useListData: ({ action, context, viewData, model, service, xNode,
883
871
  } | {
884
872
  state: {
885
873
  specification: Record<string, any> | null;
886
- type: string;
887
874
  page: number;
888
- mode: string;
889
875
  order: any;
890
876
  domain: any;
891
877
  pageLimit: number;
892
878
  groupByList: any;
893
- currentDate: Date;
894
879
  selectedRowKeys: number[];
895
- setType: react.Dispatch<react.SetStateAction<string>>;
896
- setMode: react.Dispatch<react.SetStateAction<string>>;
897
880
  setPage: react.Dispatch<react.SetStateAction<number>>;
898
881
  setOrder: react.Dispatch<any>;
899
882
  setDomain: react.Dispatch<any>;
900
883
  setPageLimit: react.Dispatch<react.SetStateAction<number>>;
901
884
  setGroupByList: react.Dispatch<any>;
902
- setCurrentDate: react.Dispatch<react.SetStateAction<Date>>;
903
885
  setSelectedRowKeys: react.Dispatch<react.SetStateAction<number[]>>;
904
886
  };
905
887
  data: undefined;
@@ -931,23 +913,17 @@ declare const useListData: ({ action, context, viewData, model, service, xNode,
931
913
  } | {
932
914
  state: {
933
915
  specification: Record<string, any> | null;
934
- type: string;
935
916
  page: number;
936
- mode: string;
937
917
  order: any;
938
918
  domain: any;
939
919
  pageLimit: number;
940
920
  groupByList: any;
941
- currentDate: Date;
942
921
  selectedRowKeys: number[];
943
- setType: react.Dispatch<react.SetStateAction<string>>;
944
- setMode: react.Dispatch<react.SetStateAction<string>>;
945
922
  setPage: react.Dispatch<react.SetStateAction<number>>;
946
923
  setOrder: react.Dispatch<any>;
947
924
  setDomain: react.Dispatch<any>;
948
925
  setPageLimit: react.Dispatch<react.SetStateAction<number>>;
949
926
  setGroupByList: react.Dispatch<any>;
950
- setCurrentDate: react.Dispatch<react.SetStateAction<Date>>;
951
927
  setSelectedRowKeys: react.Dispatch<react.SetStateAction<number[]>>;
952
928
  };
953
929
  data: undefined;
@@ -979,23 +955,17 @@ declare const useListData: ({ action, context, viewData, model, service, xNode,
979
955
  } | {
980
956
  state: {
981
957
  specification: Record<string, any> | null;
982
- type: string;
983
958
  page: number;
984
- mode: string;
985
959
  order: any;
986
960
  domain: any;
987
961
  pageLimit: number;
988
962
  groupByList: any;
989
- currentDate: Date;
990
963
  selectedRowKeys: number[];
991
- setType: react.Dispatch<react.SetStateAction<string>>;
992
- setMode: react.Dispatch<react.SetStateAction<string>>;
993
964
  setPage: react.Dispatch<react.SetStateAction<number>>;
994
965
  setOrder: react.Dispatch<any>;
995
966
  setDomain: react.Dispatch<any>;
996
967
  setPageLimit: react.Dispatch<react.SetStateAction<number>>;
997
968
  setGroupByList: react.Dispatch<any>;
998
- setCurrentDate: react.Dispatch<react.SetStateAction<Date>>;
999
969
  setSelectedRowKeys: react.Dispatch<react.SetStateAction<number[]>>;
1000
970
  };
1001
971
  data: undefined;
@@ -1027,23 +997,17 @@ declare const useListData: ({ action, context, viewData, model, service, xNode,
1027
997
  } | {
1028
998
  state: {
1029
999
  specification: Record<string, any> | null;
1030
- type: string;
1031
1000
  page: number;
1032
- mode: string;
1033
1001
  order: any;
1034
1002
  domain: any;
1035
1003
  pageLimit: number;
1036
1004
  groupByList: any;
1037
- currentDate: Date;
1038
1005
  selectedRowKeys: number[];
1039
- setType: react.Dispatch<react.SetStateAction<string>>;
1040
- setMode: react.Dispatch<react.SetStateAction<string>>;
1041
1006
  setPage: react.Dispatch<react.SetStateAction<number>>;
1042
1007
  setOrder: react.Dispatch<any>;
1043
1008
  setDomain: react.Dispatch<any>;
1044
1009
  setPageLimit: react.Dispatch<react.SetStateAction<number>>;
1045
1010
  setGroupByList: react.Dispatch<any>;
1046
- setCurrentDate: react.Dispatch<react.SetStateAction<Date>>;
1047
1011
  setSelectedRowKeys: react.Dispatch<react.SetStateAction<number[]>>;
1048
1012
  };
1049
1013
  data: any;
package/dist/hooks.js CHANGED
@@ -891,9 +891,6 @@ var useListData = ({
891
891
  const [groupByList, setGroupByList] = (0, import_react14.useState)(null);
892
892
  const [domain, setDomain] = (0, import_react14.useState)(null);
893
893
  const [order, setOrder] = (0, import_react14.useState)("");
894
- const [mode, setMode] = (0, import_react14.useState)("month");
895
- const [type, setType] = (0, import_react14.useState)("list");
896
- const [currentDate, setCurrentDate] = (0, import_react14.useState)(/* @__PURE__ */ new Date());
897
894
  const [selectedRowKeys, setSelectedRowKeys] = (0, import_react14.useState)([]);
898
895
  const [debouncedPage] = useDebounce(page, 500);
899
896
  const [debouncedDomain] = useDebounce(domain, 500);
@@ -906,14 +903,14 @@ var useListData = ({
906
903
  if (!viewData || !action || !context) {
907
904
  return null;
908
905
  }
909
- const domainParse = type === "calendar" ? getDateRange(currentDate, mode) : action?.domain ? Array.isArray(action?.domain) ? [...action?.domain] : (0, import_utils6.evalJSONDomain)(action?.domain, context) : [];
910
- const limit = type === "calendar" ? 2500 : pageLimit;
906
+ const domainParse = domain ? [...domain] : action?.domain ? Array.isArray(action?.domain) ? [...action?.domain] : (0, import_utils6.evalJSONDomain)(action?.domain, context) : [];
907
+ const limit = pageLimit;
911
908
  const offset = debouncedPage * pageLimit;
912
- const fields = type === "calendar" ? convertFieldsToArray(viewData?.views?.calendar?.fields) || [] : typeof groupByList === "object" ? groupByList?.fields : void 0;
909
+ const fields = typeof groupByList === "object" ? groupByList?.fields : void 0;
913
910
  const groupby = typeof groupByList === "object" ? [groupByList?.contexts?.[0]?.group_by] : [];
914
911
  const sort = order ? order : viewData?.views?.list?.default_order ? (0, import_utils6.formatSortingString)(viewData?.views?.list?.default_order) : "";
915
912
  return {
916
- model: action.res_model,
913
+ model: action?.res_model,
917
914
  specification,
918
915
  domain: domainParse,
919
916
  limit,
@@ -921,25 +918,19 @@ var useListData = ({
921
918
  fields,
922
919
  groupby,
923
920
  context,
924
- sort,
925
- type
921
+ sort
926
922
  };
927
- }, [
928
- action,
929
- context,
930
- currentDate,
931
- groupByList,
932
- mode,
933
- order,
934
- debouncedPage,
935
- pageLimit,
936
- type,
937
- debouncedDomain
938
- ]);
923
+ }, [action, groupByList, order, debouncedPage, pageLimit, debouncedDomain]);
939
924
  const list = useGetListData2(
940
- listDataProps,
941
- [listDataProps],
942
- !!listDataProps && !!specification && !(0, import_utils6.isObjectEmpty)(specification),
925
+ { ...listDataProps },
926
+ [
927
+ listDataProps?.domain,
928
+ listDataProps?.groupby,
929
+ listDataProps?.limit,
930
+ listDataProps?.offset,
931
+ listDataProps?.sort
932
+ ],
933
+ !!listDataProps && !!specification && !(0, import_utils6.isObjectEmpty)(specification) && !!domain,
943
934
  service,
944
935
  xNode
945
936
  );
@@ -947,23 +938,17 @@ var useListData = ({
947
938
  ...list,
948
939
  state: {
949
940
  specification,
950
- type,
951
941
  page,
952
- mode,
953
942
  order,
954
943
  domain: listDataProps?.domain,
955
944
  pageLimit,
956
945
  groupByList,
957
- currentDate,
958
946
  selectedRowKeys,
959
- setType,
960
- setMode,
961
947
  setPage,
962
948
  setOrder,
963
949
  setDomain,
964
950
  setPageLimit,
965
951
  setGroupByList,
966
- setCurrentDate,
967
952
  setSelectedRowKeys
968
953
  }
969
954
  };
package/dist/hooks.mjs CHANGED
@@ -876,9 +876,6 @@ var useListData = ({
876
876
  const [groupByList, setGroupByList] = useState5(null);
877
877
  const [domain, setDomain] = useState5(null);
878
878
  const [order, setOrder] = useState5("");
879
- const [mode, setMode] = useState5("month");
880
- const [type, setType] = useState5("list");
881
- const [currentDate, setCurrentDate] = useState5(/* @__PURE__ */ new Date());
882
879
  const [selectedRowKeys, setSelectedRowKeys] = useState5([]);
883
880
  const [debouncedPage] = useDebounce(page, 500);
884
881
  const [debouncedDomain] = useDebounce(domain, 500);
@@ -891,14 +888,14 @@ var useListData = ({
891
888
  if (!viewData || !action || !context) {
892
889
  return null;
893
890
  }
894
- const domainParse = type === "calendar" ? getDateRange(currentDate, mode) : action?.domain ? Array.isArray(action?.domain) ? [...action?.domain] : evalJSONDomain(action?.domain, context) : [];
895
- const limit = type === "calendar" ? 2500 : pageLimit;
891
+ const domainParse = domain ? [...domain] : action?.domain ? Array.isArray(action?.domain) ? [...action?.domain] : evalJSONDomain(action?.domain, context) : [];
892
+ const limit = pageLimit;
896
893
  const offset = debouncedPage * pageLimit;
897
- const fields = type === "calendar" ? convertFieldsToArray(viewData?.views?.calendar?.fields) || [] : typeof groupByList === "object" ? groupByList?.fields : void 0;
894
+ const fields = typeof groupByList === "object" ? groupByList?.fields : void 0;
898
895
  const groupby = typeof groupByList === "object" ? [groupByList?.contexts?.[0]?.group_by] : [];
899
896
  const sort = order ? order : viewData?.views?.list?.default_order ? formatSortingString(viewData?.views?.list?.default_order) : "";
900
897
  return {
901
- model: action.res_model,
898
+ model: action?.res_model,
902
899
  specification,
903
900
  domain: domainParse,
904
901
  limit,
@@ -906,25 +903,19 @@ var useListData = ({
906
903
  fields,
907
904
  groupby,
908
905
  context,
909
- sort,
910
- type
906
+ sort
911
907
  };
912
- }, [
913
- action,
914
- context,
915
- currentDate,
916
- groupByList,
917
- mode,
918
- order,
919
- debouncedPage,
920
- pageLimit,
921
- type,
922
- debouncedDomain
923
- ]);
908
+ }, [action, groupByList, order, debouncedPage, pageLimit, debouncedDomain]);
924
909
  const list = useGetListData2(
925
- listDataProps,
926
- [listDataProps],
927
- !!listDataProps && !!specification && !isObjectEmpty4(specification),
910
+ { ...listDataProps },
911
+ [
912
+ listDataProps?.domain,
913
+ listDataProps?.groupby,
914
+ listDataProps?.limit,
915
+ listDataProps?.offset,
916
+ listDataProps?.sort
917
+ ],
918
+ !!listDataProps && !!specification && !isObjectEmpty4(specification) && !!domain,
928
919
  service,
929
920
  xNode
930
921
  );
@@ -932,23 +923,17 @@ var useListData = ({
932
923
  ...list,
933
924
  state: {
934
925
  specification,
935
- type,
936
926
  page,
937
- mode,
938
927
  order,
939
928
  domain: listDataProps?.domain,
940
929
  pageLimit,
941
930
  groupByList,
942
- currentDate,
943
931
  selectedRowKeys,
944
- setType,
945
- setMode,
946
932
  setPage,
947
933
  setOrder,
948
934
  setDomain,
949
935
  setPageLimit,
950
936
  setGroupByList,
951
- setCurrentDate,
952
937
  setSelectedRowKeys
953
938
  }
954
939
  };
package/dist/index.js CHANGED
@@ -4941,9 +4941,6 @@ var useListData = ({
4941
4941
  const [groupByList, setGroupByList] = (0, import_react14.useState)(null);
4942
4942
  const [domain, setDomain] = (0, import_react14.useState)(null);
4943
4943
  const [order, setOrder] = (0, import_react14.useState)("");
4944
- const [mode, setMode] = (0, import_react14.useState)("month");
4945
- const [type, setType] = (0, import_react14.useState)("list");
4946
- const [currentDate, setCurrentDate] = (0, import_react14.useState)(/* @__PURE__ */ new Date());
4947
4944
  const [selectedRowKeys, setSelectedRowKeys] = (0, import_react14.useState)([]);
4948
4945
  const [debouncedPage] = useDebounce(page, 500);
4949
4946
  const [debouncedDomain] = useDebounce(domain, 500);
@@ -4956,14 +4953,14 @@ var useListData = ({
4956
4953
  if (!viewData || !action || !context) {
4957
4954
  return null;
4958
4955
  }
4959
- const domainParse = type === "calendar" ? getDateRange(currentDate, mode) : action?.domain ? Array.isArray(action?.domain) ? [...action?.domain] : (0, import_utils6.evalJSONDomain)(action?.domain, context) : [];
4960
- const limit = type === "calendar" ? 2500 : pageLimit;
4956
+ const domainParse = domain ? [...domain] : action?.domain ? Array.isArray(action?.domain) ? [...action?.domain] : (0, import_utils6.evalJSONDomain)(action?.domain, context) : [];
4957
+ const limit = pageLimit;
4961
4958
  const offset = debouncedPage * pageLimit;
4962
- const fields = type === "calendar" ? convertFieldsToArray(viewData?.views?.calendar?.fields) || [] : typeof groupByList === "object" ? groupByList?.fields : void 0;
4959
+ const fields = typeof groupByList === "object" ? groupByList?.fields : void 0;
4963
4960
  const groupby = typeof groupByList === "object" ? [groupByList?.contexts?.[0]?.group_by] : [];
4964
4961
  const sort = order ? order : viewData?.views?.list?.default_order ? (0, import_utils6.formatSortingString)(viewData?.views?.list?.default_order) : "";
4965
4962
  return {
4966
- model: action.res_model,
4963
+ model: action?.res_model,
4967
4964
  specification,
4968
4965
  domain: domainParse,
4969
4966
  limit,
@@ -4971,25 +4968,19 @@ var useListData = ({
4971
4968
  fields,
4972
4969
  groupby,
4973
4970
  context,
4974
- sort,
4975
- type
4971
+ sort
4976
4972
  };
4977
- }, [
4978
- action,
4979
- context,
4980
- currentDate,
4981
- groupByList,
4982
- mode,
4983
- order,
4984
- debouncedPage,
4985
- pageLimit,
4986
- type,
4987
- debouncedDomain
4988
- ]);
4973
+ }, [action, groupByList, order, debouncedPage, pageLimit, debouncedDomain]);
4989
4974
  const list = useGetListData2(
4990
- listDataProps,
4991
- [listDataProps],
4992
- !!listDataProps && !!specification && !(0, import_utils6.isObjectEmpty)(specification),
4975
+ { ...listDataProps },
4976
+ [
4977
+ listDataProps?.domain,
4978
+ listDataProps?.groupby,
4979
+ listDataProps?.limit,
4980
+ listDataProps?.offset,
4981
+ listDataProps?.sort
4982
+ ],
4983
+ !!listDataProps && !!specification && !(0, import_utils6.isObjectEmpty)(specification) && !!domain,
4993
4984
  service,
4994
4985
  xNode
4995
4986
  );
@@ -4997,23 +4988,17 @@ var useListData = ({
4997
4988
  ...list,
4998
4989
  state: {
4999
4990
  specification,
5000
- type,
5001
4991
  page,
5002
- mode,
5003
4992
  order,
5004
4993
  domain: listDataProps?.domain,
5005
4994
  pageLimit,
5006
4995
  groupByList,
5007
- currentDate,
5008
4996
  selectedRowKeys,
5009
- setType,
5010
- setMode,
5011
4997
  setPage,
5012
4998
  setOrder,
5013
4999
  setDomain,
5014
5000
  setPageLimit,
5015
5001
  setGroupByList,
5016
- setCurrentDate,
5017
5002
  setSelectedRowKeys
5018
5003
  }
5019
5004
  };
package/dist/index.mjs CHANGED
@@ -5020,9 +5020,6 @@ var useListData = ({
5020
5020
  const [groupByList, setGroupByList] = useState5(null);
5021
5021
  const [domain, setDomain] = useState5(null);
5022
5022
  const [order, setOrder] = useState5("");
5023
- const [mode, setMode] = useState5("month");
5024
- const [type, setType] = useState5("list");
5025
- const [currentDate, setCurrentDate] = useState5(/* @__PURE__ */ new Date());
5026
5023
  const [selectedRowKeys, setSelectedRowKeys] = useState5([]);
5027
5024
  const [debouncedPage] = useDebounce(page, 500);
5028
5025
  const [debouncedDomain] = useDebounce(domain, 500);
@@ -5035,14 +5032,14 @@ var useListData = ({
5035
5032
  if (!viewData || !action || !context) {
5036
5033
  return null;
5037
5034
  }
5038
- const domainParse = type === "calendar" ? getDateRange(currentDate, mode) : action?.domain ? Array.isArray(action?.domain) ? [...action?.domain] : evalJSONDomain(action?.domain, context) : [];
5039
- const limit = type === "calendar" ? 2500 : pageLimit;
5035
+ const domainParse = domain ? [...domain] : action?.domain ? Array.isArray(action?.domain) ? [...action?.domain] : evalJSONDomain(action?.domain, context) : [];
5036
+ const limit = pageLimit;
5040
5037
  const offset = debouncedPage * pageLimit;
5041
- const fields = type === "calendar" ? convertFieldsToArray(viewData?.views?.calendar?.fields) || [] : typeof groupByList === "object" ? groupByList?.fields : void 0;
5038
+ const fields = typeof groupByList === "object" ? groupByList?.fields : void 0;
5042
5039
  const groupby = typeof groupByList === "object" ? [groupByList?.contexts?.[0]?.group_by] : [];
5043
5040
  const sort = order ? order : viewData?.views?.list?.default_order ? formatSortingString(viewData?.views?.list?.default_order) : "";
5044
5041
  return {
5045
- model: action.res_model,
5042
+ model: action?.res_model,
5046
5043
  specification,
5047
5044
  domain: domainParse,
5048
5045
  limit,
@@ -5050,25 +5047,19 @@ var useListData = ({
5050
5047
  fields,
5051
5048
  groupby,
5052
5049
  context,
5053
- sort,
5054
- type
5050
+ sort
5055
5051
  };
5056
- }, [
5057
- action,
5058
- context,
5059
- currentDate,
5060
- groupByList,
5061
- mode,
5062
- order,
5063
- debouncedPage,
5064
- pageLimit,
5065
- type,
5066
- debouncedDomain
5067
- ]);
5052
+ }, [action, groupByList, order, debouncedPage, pageLimit, debouncedDomain]);
5068
5053
  const list = useGetListData2(
5069
- listDataProps,
5070
- [listDataProps],
5071
- !!listDataProps && !!specification && !isObjectEmpty4(specification),
5054
+ { ...listDataProps },
5055
+ [
5056
+ listDataProps?.domain,
5057
+ listDataProps?.groupby,
5058
+ listDataProps?.limit,
5059
+ listDataProps?.offset,
5060
+ listDataProps?.sort
5061
+ ],
5062
+ !!listDataProps && !!specification && !isObjectEmpty4(specification) && !!domain,
5072
5063
  service,
5073
5064
  xNode
5074
5065
  );
@@ -5076,23 +5067,17 @@ var useListData = ({
5076
5067
  ...list,
5077
5068
  state: {
5078
5069
  specification,
5079
- type,
5080
5070
  page,
5081
- mode,
5082
5071
  order,
5083
5072
  domain: listDataProps?.domain,
5084
5073
  pageLimit,
5085
5074
  groupByList,
5086
- currentDate,
5087
5075
  selectedRowKeys,
5088
- setType,
5089
- setMode,
5090
5076
  setPage,
5091
5077
  setOrder,
5092
5078
  setDomain,
5093
5079
  setPageLimit,
5094
5080
  setGroupByList,
5095
- setCurrentDate,
5096
5081
  setSelectedRowKeys
5097
5082
  }
5098
5083
  };
package/dist/widget.d.mts CHANGED
@@ -76,7 +76,7 @@ declare const many2manyFieldController: (props: IMany2ManyControllerProps) => {
76
76
  rows: any;
77
77
  columns: any;
78
78
  onToggleColumnOptional: (item: any) => void;
79
- typeTable: "list" | "calendar" | "group" | undefined;
79
+ typeTable: "list" | "group" | "calendar" | undefined;
80
80
  isLoading: boolean;
81
81
  isFetched: boolean;
82
82
  isPlaceholderData: boolean;
@@ -241,7 +241,7 @@ declare const tableController: ({ data }: ITableProps) => {
241
241
  rows: any;
242
242
  columns: any;
243
243
  onToggleColumnOptional: (item: any) => void;
244
- typeTable: "list" | "calendar" | "group" | undefined;
244
+ typeTable: "list" | "group" | "calendar" | undefined;
245
245
  };
246
246
 
247
247
  declare const tableGroupController: (props: any) => {
@@ -259,7 +259,7 @@ declare const tableGroupController: (props: any) => {
259
259
  dataGroup: any;
260
260
  pageGroup: any;
261
261
  setPageGroup: react.Dispatch<any>;
262
- typeTableGroup: "list" | "calendar" | "group" | undefined;
262
+ typeTableGroup: "list" | "group" | "calendar" | undefined;
263
263
  };
264
264
 
265
265
  declare const searchController: ({ viewData, model, domain, context, fieldsList, }: {
package/dist/widget.d.ts CHANGED
@@ -76,7 +76,7 @@ declare const many2manyFieldController: (props: IMany2ManyControllerProps) => {
76
76
  rows: any;
77
77
  columns: any;
78
78
  onToggleColumnOptional: (item: any) => void;
79
- typeTable: "list" | "calendar" | "group" | undefined;
79
+ typeTable: "list" | "group" | "calendar" | undefined;
80
80
  isLoading: boolean;
81
81
  isFetched: boolean;
82
82
  isPlaceholderData: boolean;
@@ -241,7 +241,7 @@ declare const tableController: ({ data }: ITableProps) => {
241
241
  rows: any;
242
242
  columns: any;
243
243
  onToggleColumnOptional: (item: any) => void;
244
- typeTable: "list" | "calendar" | "group" | undefined;
244
+ typeTable: "list" | "group" | "calendar" | undefined;
245
245
  };
246
246
 
247
247
  declare const tableGroupController: (props: any) => {
@@ -259,7 +259,7 @@ declare const tableGroupController: (props: any) => {
259
259
  dataGroup: any;
260
260
  pageGroup: any;
261
261
  setPageGroup: react.Dispatch<any>;
262
- typeTableGroup: "list" | "calendar" | "group" | undefined;
262
+ typeTableGroup: "list" | "group" | "calendar" | undefined;
263
263
  };
264
264
 
265
265
  declare const searchController: ({ viewData, model, domain, context, fieldsList, }: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fctc/widget-logic",
3
- "version": "2.9.2",
3
+ "version": "2.9.3",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",