@fctc/widget-logic 2.2.9 → 2.3.0

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/index.js CHANGED
@@ -6998,27 +6998,21 @@ var tableGroupController = (props) => {
6998
6998
  const {
6999
6999
  rows,
7000
7000
  columns,
7001
- indexRow,
7002
7001
  row,
7003
7002
  model,
7004
7003
  viewData,
7005
- renderField,
7006
7004
  level,
7007
7005
  specification,
7008
7006
  domain,
7009
7007
  context,
7010
7008
  checkedAll,
7011
7009
  isDisplayCheckbox,
7012
- isAutoSelect,
7013
- setIsAutoSelect,
7014
7010
  selectedRowKeysRef
7015
7011
  } = props;
7016
7012
  const [pageGroup, setPageGroup] = (0, import_react23.useState)(0);
7017
7013
  const { groupByDomain, selectedTags } = (0, import_store10.useAppSelector)(import_store10.selectSearch);
7018
7014
  const { selectedRowKeys } = (0, import_store10.useAppSelector)(import_store10.selectList);
7019
7015
  const appDispatch = (0, import_store10.useAppDispatch)();
7020
- const { toDataJS } = (0, import_hooks15.useOdooDataTransform)();
7021
- const initVal = toDataJS(row, viewData, model);
7022
7016
  const [isShowGroup, setIsShowGroup] = (0, import_react23.useState)(false);
7023
7017
  const [colEmptyGroup, setColEmptyGroup] = (0, import_react23.useState)({
7024
7018
  fromStart: 1,
@@ -7053,15 +7047,14 @@ var tableGroupController = (props) => {
7053
7047
  groupby: [groupByDomain?.contexts[level]?.group_by]
7054
7048
  };
7055
7049
  const queryKey = [
7056
- `data-${model}--${level}-row${indexRow}`,
7050
+ `data-${model}-level_${level}-row-${rows?.id}`,
7057
7051
  specification,
7058
7052
  domain,
7059
7053
  pageGroup
7060
7054
  ];
7061
7055
  const {
7062
7056
  data: dataResponse,
7063
- isFetched: isQueryFetched,
7064
- isPlaceholderData,
7057
+ isFetched: isDataGroupFetched,
7065
7058
  isLoading,
7066
7059
  isFetching
7067
7060
  } = (0, import_hooks15.useGetListData)(listDataProps, queryKey, enabled);
@@ -7078,7 +7071,6 @@ var tableGroupController = (props) => {
7078
7071
  typeTable: dataResponse?.groups ? "group" : "list"
7079
7072
  }
7080
7073
  });
7081
- const leftPadding = level > 1 ? level * 8 + "px" : "0px";
7082
7074
  (0, import_react23.useEffect)(() => {
7083
7075
  if (isShowGroup && selectedTags?.length > 0) {
7084
7076
  setIsShowGroup(false);
@@ -7090,7 +7082,7 @@ var tableGroupController = (props) => {
7090
7082
  )?.[1] : row[group_by_field_name];
7091
7083
  const nameGroupWithCount = `${typeof nameGroup === "string" ? nameGroup : typeof nameGroup === "boolean" && nameGroup ? i18n_default.t("yes") : i18n_default.t("no")} (${row[`${group_by_field_name?.split(":")?.[0]}_count`]})`;
7092
7084
  const allIdsNull = selectedRowKeys?.every((item) => item === void 0);
7093
- const handleExpandChildGroup = () => {
7085
+ const onExpandChildGroup = () => {
7094
7086
  if (isLoading || isFetching) return;
7095
7087
  const toggleShowGroup = () => setIsShowGroup((prev) => !prev);
7096
7088
  if (allIdsNull || typeTableGroup === "group") {
@@ -7103,7 +7095,7 @@ var tableGroupController = (props) => {
7103
7095
  (id) => !ids.includes(id)
7104
7096
  );
7105
7097
  appDispatch((0, import_store10.setSelectedRowKeys)(filteredIds));
7106
- } else if (!isShowGroup && selectedRowKeys?.length > 0 && typeTableGroup === "list" && checkedAll && !allIdsNull && isQueryFetched) {
7098
+ } else if (!isShowGroup && selectedRowKeys?.length > 0 && typeTableGroup === "list" && checkedAll && !allIdsNull && isDataGroupFetched) {
7107
7099
  const clonedKeys = [...selectedRowKeys];
7108
7100
  appDispatch((0, import_store10.setSelectedRowKeys)([...clonedKeys, -1]));
7109
7101
  setTimeout(() => appDispatch((0, import_store10.setSelectedRowKeys)(clonedKeys)), 500);
@@ -7114,38 +7106,28 @@ var tableGroupController = (props) => {
7114
7106
  toggleShowGroup();
7115
7107
  };
7116
7108
  (0, import_react23.useEffect)(() => {
7117
- if (!isQueryFetched || !rowsGroup || !checkedAll || allIdsNull || typeTableGroup === "group") {
7109
+ if (!isDataGroupFetched || !rowsGroup || !checkedAll || allIdsNull || typeTableGroup === "group") {
7118
7110
  return;
7119
7111
  }
7120
7112
  const clonedKeys = [...selectedRowKeys];
7121
7113
  (0, import_store10.setSelectedRowKeys)([...clonedKeys, -1]);
7122
7114
  setTimeout(() => (0, import_store10.setSelectedRowKeys)(clonedKeys), 500);
7123
- }, [isQueryFetched]);
7115
+ }, [isDataGroupFetched]);
7124
7116
  return {
7125
- handleExpandChildGroup,
7117
+ onExpandChildGroup,
7126
7118
  colEmptyGroup,
7127
- leftPadding,
7128
7119
  isShowGroup,
7129
- isQueryFetched,
7120
+ isDataGroupFetched,
7130
7121
  nameGroupWithCount,
7131
- columns,
7132
- row,
7133
- isPlaceholderData,
7134
7122
  columnsGroup,
7135
- indexRow,
7136
7123
  rowsGroup,
7137
7124
  model,
7138
- viewData,
7139
- renderField,
7140
7125
  level,
7141
7126
  specification,
7142
7127
  context,
7143
7128
  checkedAll,
7144
7129
  isDisplayCheckbox,
7145
- isAutoSelect,
7146
- setIsAutoSelect,
7147
7130
  selectedRowKeysRef,
7148
- initVal,
7149
7131
  dataResponse,
7150
7132
  pageGroup,
7151
7133
  setPageGroup
package/dist/index.mjs CHANGED
@@ -7029,7 +7029,6 @@ var tableController = ({ data }) => {
7029
7029
  // src/widget/advance/table/table-group/controller.ts
7030
7030
  import { useEffect as useEffect14, useMemo as useMemo13, useState as useState15 } from "react";
7031
7031
  import {
7032
- useOdooDataTransform,
7033
7032
  useGetListData as useGetListData2
7034
7033
  } from "@fctc/interface-logic/hooks";
7035
7034
  import {
@@ -7051,27 +7050,21 @@ var tableGroupController = (props) => {
7051
7050
  const {
7052
7051
  rows,
7053
7052
  columns,
7054
- indexRow,
7055
7053
  row,
7056
7054
  model,
7057
7055
  viewData,
7058
- renderField,
7059
7056
  level,
7060
7057
  specification,
7061
7058
  domain,
7062
7059
  context,
7063
7060
  checkedAll,
7064
7061
  isDisplayCheckbox,
7065
- isAutoSelect,
7066
- setIsAutoSelect,
7067
7062
  selectedRowKeysRef
7068
7063
  } = props;
7069
7064
  const [pageGroup, setPageGroup] = useState15(0);
7070
7065
  const { groupByDomain, selectedTags } = useAppSelector6(selectSearch5);
7071
7066
  const { selectedRowKeys } = useAppSelector6(selectList4);
7072
7067
  const appDispatch = useAppDispatch6();
7073
- const { toDataJS } = useOdooDataTransform();
7074
- const initVal = toDataJS(row, viewData, model);
7075
7068
  const [isShowGroup, setIsShowGroup] = useState15(false);
7076
7069
  const [colEmptyGroup, setColEmptyGroup] = useState15({
7077
7070
  fromStart: 1,
@@ -7106,15 +7099,14 @@ var tableGroupController = (props) => {
7106
7099
  groupby: [groupByDomain?.contexts[level]?.group_by]
7107
7100
  };
7108
7101
  const queryKey = [
7109
- `data-${model}--${level}-row${indexRow}`,
7102
+ `data-${model}-level_${level}-row-${rows?.id}`,
7110
7103
  specification,
7111
7104
  domain,
7112
7105
  pageGroup
7113
7106
  ];
7114
7107
  const {
7115
7108
  data: dataResponse,
7116
- isFetched: isQueryFetched,
7117
- isPlaceholderData,
7109
+ isFetched: isDataGroupFetched,
7118
7110
  isLoading,
7119
7111
  isFetching
7120
7112
  } = useGetListData2(listDataProps, queryKey, enabled);
@@ -7131,7 +7123,6 @@ var tableGroupController = (props) => {
7131
7123
  typeTable: dataResponse?.groups ? "group" : "list"
7132
7124
  }
7133
7125
  });
7134
- const leftPadding = level > 1 ? level * 8 + "px" : "0px";
7135
7126
  useEffect14(() => {
7136
7127
  if (isShowGroup && selectedTags?.length > 0) {
7137
7128
  setIsShowGroup(false);
@@ -7143,7 +7134,7 @@ var tableGroupController = (props) => {
7143
7134
  )?.[1] : row[group_by_field_name];
7144
7135
  const nameGroupWithCount = `${typeof nameGroup === "string" ? nameGroup : typeof nameGroup === "boolean" && nameGroup ? i18n_default.t("yes") : i18n_default.t("no")} (${row[`${group_by_field_name?.split(":")?.[0]}_count`]})`;
7145
7136
  const allIdsNull = selectedRowKeys?.every((item) => item === void 0);
7146
- const handleExpandChildGroup = () => {
7137
+ const onExpandChildGroup = () => {
7147
7138
  if (isLoading || isFetching) return;
7148
7139
  const toggleShowGroup = () => setIsShowGroup((prev) => !prev);
7149
7140
  if (allIdsNull || typeTableGroup === "group") {
@@ -7156,7 +7147,7 @@ var tableGroupController = (props) => {
7156
7147
  (id) => !ids.includes(id)
7157
7148
  );
7158
7149
  appDispatch(setSelectedRowKeys2(filteredIds));
7159
- } else if (!isShowGroup && selectedRowKeys?.length > 0 && typeTableGroup === "list" && checkedAll && !allIdsNull && isQueryFetched) {
7150
+ } else if (!isShowGroup && selectedRowKeys?.length > 0 && typeTableGroup === "list" && checkedAll && !allIdsNull && isDataGroupFetched) {
7160
7151
  const clonedKeys = [...selectedRowKeys];
7161
7152
  appDispatch(setSelectedRowKeys2([...clonedKeys, -1]));
7162
7153
  setTimeout(() => appDispatch(setSelectedRowKeys2(clonedKeys)), 500);
@@ -7167,38 +7158,28 @@ var tableGroupController = (props) => {
7167
7158
  toggleShowGroup();
7168
7159
  };
7169
7160
  useEffect14(() => {
7170
- if (!isQueryFetched || !rowsGroup || !checkedAll || allIdsNull || typeTableGroup === "group") {
7161
+ if (!isDataGroupFetched || !rowsGroup || !checkedAll || allIdsNull || typeTableGroup === "group") {
7171
7162
  return;
7172
7163
  }
7173
7164
  const clonedKeys = [...selectedRowKeys];
7174
7165
  setSelectedRowKeys2([...clonedKeys, -1]);
7175
7166
  setTimeout(() => setSelectedRowKeys2(clonedKeys), 500);
7176
- }, [isQueryFetched]);
7167
+ }, [isDataGroupFetched]);
7177
7168
  return {
7178
- handleExpandChildGroup,
7169
+ onExpandChildGroup,
7179
7170
  colEmptyGroup,
7180
- leftPadding,
7181
7171
  isShowGroup,
7182
- isQueryFetched,
7172
+ isDataGroupFetched,
7183
7173
  nameGroupWithCount,
7184
- columns,
7185
- row,
7186
- isPlaceholderData,
7187
7174
  columnsGroup,
7188
- indexRow,
7189
7175
  rowsGroup,
7190
7176
  model,
7191
- viewData,
7192
- renderField,
7193
7177
  level,
7194
7178
  specification,
7195
7179
  context,
7196
7180
  checkedAll,
7197
7181
  isDisplayCheckbox,
7198
- isAutoSelect,
7199
- setIsAutoSelect,
7200
7182
  selectedRowKeysRef,
7201
- initVal,
7202
7183
  dataResponse,
7203
7184
  pageGroup,
7204
7185
  setPageGroup
package/dist/widget.d.mts CHANGED
@@ -238,35 +238,23 @@ declare const tableController: ({ data }: ITableProps) => {
238
238
  };
239
239
 
240
240
  declare const tableGroupController: (props: any) => {
241
- handleExpandChildGroup: () => void;
241
+ onExpandChildGroup: () => void;
242
242
  colEmptyGroup: {
243
243
  fromStart: number;
244
244
  fromEnd: number;
245
245
  };
246
- leftPadding: string;
247
246
  isShowGroup: boolean;
248
- isQueryFetched: boolean;
247
+ isDataGroupFetched: boolean;
249
248
  nameGroupWithCount: string;
250
- columns: any;
251
- row: any;
252
- isPlaceholderData: boolean;
253
249
  columnsGroup: any;
254
- indexRow: any;
255
250
  rowsGroup: any[];
256
251
  model: any;
257
- viewData: any;
258
- renderField: any;
259
252
  level: any;
260
253
  specification: any;
261
254
  context: any;
262
255
  checkedAll: any;
263
256
  isDisplayCheckbox: any;
264
- isAutoSelect: any;
265
- setIsAutoSelect: any;
266
257
  selectedRowKeysRef: any;
267
- initVal: {
268
- [x: string]: any;
269
- };
270
258
  dataResponse: any;
271
259
  pageGroup: any;
272
260
  setPageGroup: react.Dispatch<any>;
package/dist/widget.d.ts CHANGED
@@ -238,35 +238,23 @@ declare const tableController: ({ data }: ITableProps) => {
238
238
  };
239
239
 
240
240
  declare const tableGroupController: (props: any) => {
241
- handleExpandChildGroup: () => void;
241
+ onExpandChildGroup: () => void;
242
242
  colEmptyGroup: {
243
243
  fromStart: number;
244
244
  fromEnd: number;
245
245
  };
246
- leftPadding: string;
247
246
  isShowGroup: boolean;
248
- isQueryFetched: boolean;
247
+ isDataGroupFetched: boolean;
249
248
  nameGroupWithCount: string;
250
- columns: any;
251
- row: any;
252
- isPlaceholderData: boolean;
253
249
  columnsGroup: any;
254
- indexRow: any;
255
250
  rowsGroup: any[];
256
251
  model: any;
257
- viewData: any;
258
- renderField: any;
259
252
  level: any;
260
253
  specification: any;
261
254
  context: any;
262
255
  checkedAll: any;
263
256
  isDisplayCheckbox: any;
264
- isAutoSelect: any;
265
- setIsAutoSelect: any;
266
257
  selectedRowKeysRef: any;
267
- initVal: {
268
- [x: string]: any;
269
- };
270
258
  dataResponse: any;
271
259
  pageGroup: any;
272
260
  setPageGroup: react.Dispatch<any>;
package/dist/widget.js CHANGED
@@ -6723,27 +6723,21 @@ var tableGroupController = (props) => {
6723
6723
  const {
6724
6724
  rows,
6725
6725
  columns,
6726
- indexRow,
6727
6726
  row,
6728
6727
  model,
6729
6728
  viewData,
6730
- renderField,
6731
6729
  level,
6732
6730
  specification,
6733
6731
  domain,
6734
6732
  context,
6735
6733
  checkedAll,
6736
6734
  isDisplayCheckbox,
6737
- isAutoSelect,
6738
- setIsAutoSelect,
6739
6735
  selectedRowKeysRef
6740
6736
  } = props;
6741
6737
  const [pageGroup, setPageGroup] = (0, import_react23.useState)(0);
6742
6738
  const { groupByDomain, selectedTags } = (0, import_store10.useAppSelector)(import_store10.selectSearch);
6743
6739
  const { selectedRowKeys } = (0, import_store10.useAppSelector)(import_store10.selectList);
6744
6740
  const appDispatch = (0, import_store10.useAppDispatch)();
6745
- const { toDataJS } = (0, import_hooks15.useOdooDataTransform)();
6746
- const initVal = toDataJS(row, viewData, model);
6747
6741
  const [isShowGroup, setIsShowGroup] = (0, import_react23.useState)(false);
6748
6742
  const [colEmptyGroup, setColEmptyGroup] = (0, import_react23.useState)({
6749
6743
  fromStart: 1,
@@ -6778,15 +6772,14 @@ var tableGroupController = (props) => {
6778
6772
  groupby: [groupByDomain?.contexts[level]?.group_by]
6779
6773
  };
6780
6774
  const queryKey = [
6781
- `data-${model}--${level}-row${indexRow}`,
6775
+ `data-${model}-level_${level}-row-${rows?.id}`,
6782
6776
  specification,
6783
6777
  domain,
6784
6778
  pageGroup
6785
6779
  ];
6786
6780
  const {
6787
6781
  data: dataResponse,
6788
- isFetched: isQueryFetched,
6789
- isPlaceholderData,
6782
+ isFetched: isDataGroupFetched,
6790
6783
  isLoading,
6791
6784
  isFetching
6792
6785
  } = (0, import_hooks15.useGetListData)(listDataProps, queryKey, enabled);
@@ -6803,7 +6796,6 @@ var tableGroupController = (props) => {
6803
6796
  typeTable: dataResponse?.groups ? "group" : "list"
6804
6797
  }
6805
6798
  });
6806
- const leftPadding = level > 1 ? level * 8 + "px" : "0px";
6807
6799
  (0, import_react23.useEffect)(() => {
6808
6800
  if (isShowGroup && selectedTags?.length > 0) {
6809
6801
  setIsShowGroup(false);
@@ -6815,7 +6807,7 @@ var tableGroupController = (props) => {
6815
6807
  )?.[1] : row[group_by_field_name];
6816
6808
  const nameGroupWithCount = `${typeof nameGroup === "string" ? nameGroup : typeof nameGroup === "boolean" && nameGroup ? i18n_default.t("yes") : i18n_default.t("no")} (${row[`${group_by_field_name?.split(":")?.[0]}_count`]})`;
6817
6809
  const allIdsNull = selectedRowKeys?.every((item) => item === void 0);
6818
- const handleExpandChildGroup = () => {
6810
+ const onExpandChildGroup = () => {
6819
6811
  if (isLoading || isFetching) return;
6820
6812
  const toggleShowGroup = () => setIsShowGroup((prev) => !prev);
6821
6813
  if (allIdsNull || typeTableGroup === "group") {
@@ -6828,7 +6820,7 @@ var tableGroupController = (props) => {
6828
6820
  (id) => !ids.includes(id)
6829
6821
  );
6830
6822
  appDispatch((0, import_store10.setSelectedRowKeys)(filteredIds));
6831
- } else if (!isShowGroup && selectedRowKeys?.length > 0 && typeTableGroup === "list" && checkedAll && !allIdsNull && isQueryFetched) {
6823
+ } else if (!isShowGroup && selectedRowKeys?.length > 0 && typeTableGroup === "list" && checkedAll && !allIdsNull && isDataGroupFetched) {
6832
6824
  const clonedKeys = [...selectedRowKeys];
6833
6825
  appDispatch((0, import_store10.setSelectedRowKeys)([...clonedKeys, -1]));
6834
6826
  setTimeout(() => appDispatch((0, import_store10.setSelectedRowKeys)(clonedKeys)), 500);
@@ -6839,38 +6831,28 @@ var tableGroupController = (props) => {
6839
6831
  toggleShowGroup();
6840
6832
  };
6841
6833
  (0, import_react23.useEffect)(() => {
6842
- if (!isQueryFetched || !rowsGroup || !checkedAll || allIdsNull || typeTableGroup === "group") {
6834
+ if (!isDataGroupFetched || !rowsGroup || !checkedAll || allIdsNull || typeTableGroup === "group") {
6843
6835
  return;
6844
6836
  }
6845
6837
  const clonedKeys = [...selectedRowKeys];
6846
6838
  (0, import_store10.setSelectedRowKeys)([...clonedKeys, -1]);
6847
6839
  setTimeout(() => (0, import_store10.setSelectedRowKeys)(clonedKeys), 500);
6848
- }, [isQueryFetched]);
6840
+ }, [isDataGroupFetched]);
6849
6841
  return {
6850
- handleExpandChildGroup,
6842
+ onExpandChildGroup,
6851
6843
  colEmptyGroup,
6852
- leftPadding,
6853
6844
  isShowGroup,
6854
- isQueryFetched,
6845
+ isDataGroupFetched,
6855
6846
  nameGroupWithCount,
6856
- columns,
6857
- row,
6858
- isPlaceholderData,
6859
6847
  columnsGroup,
6860
- indexRow,
6861
6848
  rowsGroup,
6862
6849
  model,
6863
- viewData,
6864
- renderField,
6865
6850
  level,
6866
6851
  specification,
6867
6852
  context,
6868
6853
  checkedAll,
6869
6854
  isDisplayCheckbox,
6870
- isAutoSelect,
6871
- setIsAutoSelect,
6872
6855
  selectedRowKeysRef,
6873
- initVal,
6874
6856
  dataResponse,
6875
6857
  pageGroup,
6876
6858
  setPageGroup
package/dist/widget.mjs CHANGED
@@ -6731,7 +6731,6 @@ var tableController = ({ data }) => {
6731
6731
  // src/widget/advance/table/table-group/controller.ts
6732
6732
  import { useEffect as useEffect14, useMemo as useMemo13, useState as useState15 } from "react";
6733
6733
  import {
6734
- useOdooDataTransform,
6735
6734
  useGetListData as useGetListData2
6736
6735
  } from "@fctc/interface-logic/hooks";
6737
6736
  import {
@@ -6753,27 +6752,21 @@ var tableGroupController = (props) => {
6753
6752
  const {
6754
6753
  rows,
6755
6754
  columns,
6756
- indexRow,
6757
6755
  row,
6758
6756
  model,
6759
6757
  viewData,
6760
- renderField,
6761
6758
  level,
6762
6759
  specification,
6763
6760
  domain,
6764
6761
  context,
6765
6762
  checkedAll,
6766
6763
  isDisplayCheckbox,
6767
- isAutoSelect,
6768
- setIsAutoSelect,
6769
6764
  selectedRowKeysRef
6770
6765
  } = props;
6771
6766
  const [pageGroup, setPageGroup] = useState15(0);
6772
6767
  const { groupByDomain, selectedTags } = useAppSelector6(selectSearch5);
6773
6768
  const { selectedRowKeys } = useAppSelector6(selectList4);
6774
6769
  const appDispatch = useAppDispatch6();
6775
- const { toDataJS } = useOdooDataTransform();
6776
- const initVal = toDataJS(row, viewData, model);
6777
6770
  const [isShowGroup, setIsShowGroup] = useState15(false);
6778
6771
  const [colEmptyGroup, setColEmptyGroup] = useState15({
6779
6772
  fromStart: 1,
@@ -6808,15 +6801,14 @@ var tableGroupController = (props) => {
6808
6801
  groupby: [groupByDomain?.contexts[level]?.group_by]
6809
6802
  };
6810
6803
  const queryKey = [
6811
- `data-${model}--${level}-row${indexRow}`,
6804
+ `data-${model}-level_${level}-row-${rows?.id}`,
6812
6805
  specification,
6813
6806
  domain,
6814
6807
  pageGroup
6815
6808
  ];
6816
6809
  const {
6817
6810
  data: dataResponse,
6818
- isFetched: isQueryFetched,
6819
- isPlaceholderData,
6811
+ isFetched: isDataGroupFetched,
6820
6812
  isLoading,
6821
6813
  isFetching
6822
6814
  } = useGetListData2(listDataProps, queryKey, enabled);
@@ -6833,7 +6825,6 @@ var tableGroupController = (props) => {
6833
6825
  typeTable: dataResponse?.groups ? "group" : "list"
6834
6826
  }
6835
6827
  });
6836
- const leftPadding = level > 1 ? level * 8 + "px" : "0px";
6837
6828
  useEffect14(() => {
6838
6829
  if (isShowGroup && selectedTags?.length > 0) {
6839
6830
  setIsShowGroup(false);
@@ -6845,7 +6836,7 @@ var tableGroupController = (props) => {
6845
6836
  )?.[1] : row[group_by_field_name];
6846
6837
  const nameGroupWithCount = `${typeof nameGroup === "string" ? nameGroup : typeof nameGroup === "boolean" && nameGroup ? i18n_default.t("yes") : i18n_default.t("no")} (${row[`${group_by_field_name?.split(":")?.[0]}_count`]})`;
6847
6838
  const allIdsNull = selectedRowKeys?.every((item) => item === void 0);
6848
- const handleExpandChildGroup = () => {
6839
+ const onExpandChildGroup = () => {
6849
6840
  if (isLoading || isFetching) return;
6850
6841
  const toggleShowGroup = () => setIsShowGroup((prev) => !prev);
6851
6842
  if (allIdsNull || typeTableGroup === "group") {
@@ -6858,7 +6849,7 @@ var tableGroupController = (props) => {
6858
6849
  (id) => !ids.includes(id)
6859
6850
  );
6860
6851
  appDispatch(setSelectedRowKeys2(filteredIds));
6861
- } else if (!isShowGroup && selectedRowKeys?.length > 0 && typeTableGroup === "list" && checkedAll && !allIdsNull && isQueryFetched) {
6852
+ } else if (!isShowGroup && selectedRowKeys?.length > 0 && typeTableGroup === "list" && checkedAll && !allIdsNull && isDataGroupFetched) {
6862
6853
  const clonedKeys = [...selectedRowKeys];
6863
6854
  appDispatch(setSelectedRowKeys2([...clonedKeys, -1]));
6864
6855
  setTimeout(() => appDispatch(setSelectedRowKeys2(clonedKeys)), 500);
@@ -6869,38 +6860,28 @@ var tableGroupController = (props) => {
6869
6860
  toggleShowGroup();
6870
6861
  };
6871
6862
  useEffect14(() => {
6872
- if (!isQueryFetched || !rowsGroup || !checkedAll || allIdsNull || typeTableGroup === "group") {
6863
+ if (!isDataGroupFetched || !rowsGroup || !checkedAll || allIdsNull || typeTableGroup === "group") {
6873
6864
  return;
6874
6865
  }
6875
6866
  const clonedKeys = [...selectedRowKeys];
6876
6867
  setSelectedRowKeys2([...clonedKeys, -1]);
6877
6868
  setTimeout(() => setSelectedRowKeys2(clonedKeys), 500);
6878
- }, [isQueryFetched]);
6869
+ }, [isDataGroupFetched]);
6879
6870
  return {
6880
- handleExpandChildGroup,
6871
+ onExpandChildGroup,
6881
6872
  colEmptyGroup,
6882
- leftPadding,
6883
6873
  isShowGroup,
6884
- isQueryFetched,
6874
+ isDataGroupFetched,
6885
6875
  nameGroupWithCount,
6886
- columns,
6887
- row,
6888
- isPlaceholderData,
6889
6876
  columnsGroup,
6890
- indexRow,
6891
6877
  rowsGroup,
6892
6878
  model,
6893
- viewData,
6894
- renderField,
6895
6879
  level,
6896
6880
  specification,
6897
6881
  context,
6898
6882
  checkedAll,
6899
6883
  isDisplayCheckbox,
6900
- isAutoSelect,
6901
- setIsAutoSelect,
6902
6884
  selectedRowKeysRef,
6903
- initVal,
6904
6885
  dataResponse,
6905
6886
  pageGroup,
6906
6887
  setPageGroup
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fctc/widget-logic",
3
- "version": "2.2.9",
3
+ "version": "2.3.0",
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": "^2.2.8",
77
+ "@fctc/interface-logic": "^2.2.3",
78
78
  "@headlessui/react": "^2.2.6",
79
79
  "@tanstack/react-query": "^5.84.0",
80
80
  "i18next": "^25.3.2",