react-table-edit 1.4.68 → 1.5.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.mjs CHANGED
@@ -19931,7 +19931,9 @@ const calculateTableStructure = (columns, settingColumns) => {
19931
19931
  }, 0);
19932
19932
  };
19933
19933
  calcTotalRightWidth(columns);
19934
- applySetting(columns);
19934
+ if ((settingColumns?.length ?? 0) > 0) {
19935
+ applySetting(columns);
19936
+ }
19935
19937
  traverse(columns);
19936
19938
  // Danh sách các cột được hiển thị
19937
19939
  const flatVisble = flat.filter((e) => e.visible !== false);
@@ -19942,7 +19944,6 @@ const calculateTableStructure = (columns, settingColumns) => {
19942
19944
  // Tính toán vị trí đầu tiên và cuối cùng của các cột có thể sửa
19943
19945
  const indexFirstEdit = flat.findIndex((item) => item.editEnable && item.visible !== false && !item.disabledCondition);
19944
19946
  const indexLastEdit = flat.map((item, idx) => (item.editEnable && item.visible !== false && !item.disabledCondition ? idx : -1)).reduce((acc, val) => (val > acc ? val : acc), -1);
19945
- console.log(flatVisble);
19946
19947
  return {
19947
19948
  levels,
19948
19949
  flat,
@@ -73001,7 +73002,7 @@ const ModalImportComponent = (props) => {
73001
73002
  const [dataInvalid, setDataInvalid] = useState([]);
73002
73003
  const [checkInit, setCheckInit] = useState(false);
73003
73004
  const [checkInitValidate, setCheckInitValidate] = useState(false);
73004
- const [validateExcelColumns, setValidateExcelColumns] = useState([]);
73005
+ const [validateExcelColumns, setValidateExcelColumns] = useState(mapColumn);
73005
73006
  const [dataError, setDataError] = useState([]);
73006
73007
  const [isSaveSetting, setIsSaveSetting] = useState(true);
73007
73008
  const formSchema = create().shape({
@@ -73134,10 +73135,13 @@ const ModalImportComponent = (props) => {
73134
73135
  }
73135
73136
  }
73136
73137
  ];
73138
+ useEffect(() => {
73139
+ console.log(watch('dataMap'));
73140
+ }, [watch('dataMap')]);
73137
73141
  const handleFormOpened = () => {
73138
73142
  getGeneralSettingApi().then((rs) => {
73139
73143
  const arr = rs?.value ? JSON.parse(rs.value) : [];
73140
- setValue('dataMap', mapColumn.map((x) => {
73144
+ setValue('dataMap', [...mapColumn].map((x) => {
73141
73145
  const ele = arr.find(y => x.field === y.field);
73142
73146
  if (ele) {
73143
73147
  x.headerDefault = ele.headerDefault;
@@ -73145,7 +73149,7 @@ const ModalImportComponent = (props) => {
73145
73149
  return x;
73146
73150
  }));
73147
73151
  }).catch(() => {
73148
- setValue('dataMap', mapColumn);
73152
+ setValue('dataMap', [...mapColumn]);
73149
73153
  });
73150
73154
  if (headerValidateExcelColumns && headerValidateExcelColumns.length > 0) {
73151
73155
  setValidateExcelColumns(headerValidateExcelColumns);
@@ -73784,7 +73788,7 @@ const TableView = ({ idTable, dataSource, rowHeight = 33, height = 400, columns,
73784
73788
  right: col.fixedType === 'right' ? objWidthFixRight[indexCol] : undefined,
73785
73789
  textAlign: col.textAlign ? col.textAlign : 'left'
73786
73790
  }, children: jsxs("div", { className: "r-footer-div", children: [(item || (col.haveSum === true && col.type === "numeric")) && col.type === "numeric" && (Number(sumValue) >= 0) && jsx(Fragment$1, { children: formartNumberic(sumValue, formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false) }), (item || (col.haveSum === true && col.type === "numeric")) && col.type === "numeric" && (Number(sumValue) < 0) && jsxs("div", { style: { color: formatSetting?.colorNegative ?? 'red' }, children: [" ", `${formatSetting?.prefixNegative ?? '-'}${formartNumberic(sumValue, formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false)}${formatSetting?.suffixNegative ?? ''}`] })] }) }, `summarycell-${indexCol}`);
73787
- }) }) : jsx(Fragment$1, {}) })] }), (((viewData.length ?? 0) === 0) && !isLoading) && jsxs("div", { className: "r-no-data", children: [jsx("svg", { width: "64", height: "41", viewBox: "0 0 64 41", xmlns: "http://www.w3.org/2000/svg", children: jsxs("g", { transform: "translate(0 1)", fill: "none", fillRule: "evenodd", children: [jsx("ellipse", { fill: "#f5f5f5", cx: "32", cy: "33", rx: "32", ry: "7" }), jsxs("g", { fillRule: "nonzero", stroke: "#d9d9d9", children: [jsx("path", { d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" }), jsx("path", { d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z", fill: "#fafafa" })] })] }) }), t('No data available.')] }), isLoading && jsx("div", { className: "r-loading-overlay", children: jsxs("div", { className: "r-loading", children: [jsx(Spinner$1, { className: "me-1" }), t('Loading...')] }) })] })] }), pagingSetting?.allowPaging ? jsx(PagingComponent, { onChangePage: onChangePage, pageSize: pagingSetting?.pageSize ?? 0, currentPage: pagingSetting?.currentPage ?? 0, pageOptions: pagingSetting?.pageOptions ?? [20, 30, 50, 100], totalItem: (pagingSetting?.pagingClient ? viewData.length : pagingSetting?.totalItem ?? 0), onChangePageSize: onChangePageSize }) : jsx(Fragment$1, {})] }));
73791
+ }) }) : jsx(Fragment$1, {}) })] }), (((viewData.length ?? 0) === 0) && !isLoading) && jsxs("div", { className: "r-no-data", children: [jsx("svg", { width: "64", height: "41", viewBox: "0 0 64 41", xmlns: "http://www.w3.org/2000/svg", children: jsxs("g", { transform: "translate(0 1)", fill: "none", fillRule: "evenodd", children: [jsx("ellipse", { fill: "#f5f5f5", cx: "32", cy: "33", rx: "32", ry: "7" }), jsxs("g", { fillRule: "nonzero", stroke: "#d9d9d9", children: [jsx("path", { d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" }), jsx("path", { d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z", fill: "#fafafa" })] })] }) }), t('No data available.')] }), isLoading && jsx("div", { className: "r-loading-overlay", children: jsxs("div", { className: "r-loading", children: [jsx(Spinner$1, { className: "me-1" }), t('Loading...')] }) })] })] }), pagingSetting?.allowPaging ? jsx(PagingComponent, { gridRef: gridRef, onChangePage: onChangePage, pageSize: pagingSetting?.pageSize ?? 0, currentPage: pagingSetting?.currentPage ?? 0, pageOptions: pagingSetting?.pageOptions ?? [20, 30, 50, 100], totalItem: (pagingSetting?.pagingClient ? viewData.length : pagingSetting?.totalItem ?? 0), onChangePageSize: onChangePageSize }) : jsx(Fragment$1, {})] }));
73788
73792
  };
73789
73793
 
73790
73794
  export { ExportExcelComponent, FindNodeByPath, InputStyleComponent, ModalImportComponent, SelectTable, SelectTableTree, TableView, TabsMenuComponent, Wizard, calculateTableStructure, checkDecimalSeparator, checkThousandSeparator, TableEdit as default, formartNumberic, formatDateTime, generateUUID, isNullOrUndefined$1 as isNullOrUndefined, messageBoxConfirm, messageBoxConfirmAsync, messageBoxConfirmDelete, messageBoxError, messageHtmlBoxConfirm, messageHtmlBoxConfirmAsync, messageHtmlBoxError, notificationError, notificationSuccess, roundNumber, useOnClickOutside };