react-table-edit 1.2.42 → 1.2.43

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
@@ -145,11 +145,11 @@ var messageHtmlBoxError = (t, message, title = "Important", btnCancel = "Ok") =>
145
145
  };
146
146
  var messageBoxConfirmDelete = (t, handle, data) => {
147
147
  MySwal.fire({
148
- title: t("Confirm"),
149
- text: t("Do you want to delete item?"),
148
+ title: t("reactTableEdit.Confirm"),
149
+ text: t("reactTableEdit.Do you want to delete item?"),
150
150
  allowOutsideClick: false,
151
151
  showCancelButton: true,
152
- confirmButtonText: t("Delete"),
152
+ confirmButtonText: t("reactTableEdit.Delete"),
153
153
  cancelButtonText: t("Cancel"),
154
154
  customClass: {
155
155
  confirmButton: "btn btn-primary",
@@ -214,11 +214,11 @@ var notificationSuccess = (param) => {
214
214
  var messageBoxConfirm2 = async (t, data, data2, message) => {
215
215
  return new Promise((resolve) => {
216
216
  MySwal.fire({
217
- title: t("Confirm"),
217
+ title: t("reactTableEdit.Confirm"),
218
218
  text: t(message),
219
219
  allowOutsideClick: false,
220
220
  showCancelButton: true,
221
- confirmButtonText: t("Ok"),
221
+ confirmButtonText: t("reactTableEdit.Ok"),
222
222
  cancelButtonText: t("Cancel"),
223
223
  customClass: {
224
224
  confirmButton: "btn btn-primary",
@@ -747,7 +747,7 @@ var SelectTable = (0, import_react6.forwardRef)((props, ref) => {
747
747
  } else if (e.code === "Space") {
748
748
  let newItem;
749
749
  if (haveCreateNew && indexFocus === 0) {
750
- newItem = { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("Create")} '${searchTerm}'`, isCreated: true };
750
+ newItem = { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("reactTableEdit.Create")} '${searchTerm}'`, isCreated: true };
751
751
  } else {
752
752
  newItem = (optionsLoad ? optionsLoad : options)[indexFocus];
753
753
  }
@@ -769,7 +769,7 @@ var SelectTable = (0, import_react6.forwardRef)((props, ref) => {
769
769
  } else if (e.code === "Enter" || e.code === "Tab" || e.code === "NumpadEnter") {
770
770
  let newItem;
771
771
  if (haveCreateNew && indexFocus === 0) {
772
- newItem = { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("Create")} '${searchTerm}'`, isCreated: true };
772
+ newItem = { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("reactTableEdit.Create")} '${searchTerm}'`, isCreated: true };
773
773
  } else {
774
774
  newItem = (optionsLoad ? optionsLoad : options)[indexFocus];
775
775
  }
@@ -1060,7 +1060,7 @@ var SelectTable = (0, import_react6.forwardRef)((props, ref) => {
1060
1060
  })
1061
1061
  ] }) }),
1062
1062
  (optionsLoad ? optionsLoad : options) && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("tbody", { className: "r-select-gridcontent", children: [
1063
- haveCreateNew && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RenderElement, { isSelected: false, indexRow: 0, row: { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("Create")} '${searchTerm}'`, isCreated: true } }),
1063
+ haveCreateNew && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RenderElement, { isSelected: false, indexRow: 0, row: { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("reactTableEdit.Create")} '${searchTerm}'`, isCreated: true } }),
1064
1064
  (optionsLoad ? optionsLoad : options)?.map((row, indexRow) => {
1065
1065
  const isSelected = isMulti && value?.some((x) => x[fieldValue ?? "value"] === row[fieldValue ?? "value"]);
1066
1066
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RenderElement, { isSelected: isSelected ?? false, indexRow: indexRow + (haveCreateNew ? 1 : 0), row }, `select-table-${indexRow}`);
@@ -1075,11 +1075,11 @@ var SelectTable = (0, import_react6.forwardRef)((props, ref) => {
1075
1075
  /* @__PURE__ */ (0, import_jsx_runtime5.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" })
1076
1076
  ] })
1077
1077
  ] }) }),
1078
- t("No data available.")
1078
+ t("reactTableEdit.No data available.")
1079
1079
  ] }),
1080
1080
  isLoading && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "r-no-data", children: [
1081
1081
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_reactstrap4.Spinner, { className: "me-1", children: " " }),
1082
- t("Loading...")
1082
+ t("reactTableEdit.Loading...")
1083
1083
  ] })
1084
1084
  ] });
1085
1085
  };
@@ -1196,7 +1196,7 @@ var SelectTable = (0, import_react6.forwardRef)((props, ref) => {
1196
1196
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_classnames4.default)("r-select-footer", { "d-none": !(showFooter === true || handleAdd) }), children: [
1197
1197
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_reactstrap4.Button, { outline: true, color: "primary", onClick: handleAdd, className: (0, import_classnames4.default)("r-btn d-flex align-items-center", { "d-none": !handleAdd }), children: [
1198
1198
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_becoxy_icons2.Plus, { className: "me-50", fontSize: 16 }),
1199
- t("AddNew"),
1199
+ t("reactTableEdit.AddNew"),
1200
1200
  " (F9)"
1201
1201
  ] }),
1202
1202
  footerComponent ? footerComponent() : null
@@ -1635,7 +1635,7 @@ var EditForm = (0, import_react8.forwardRef)((props, ref) => {
1635
1635
  closeMenu();
1636
1636
  }
1637
1637
  },
1638
- children: t("Clear")
1638
+ children: t("reactTableEdit.Clear")
1639
1639
  }
1640
1640
  ),
1641
1641
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
@@ -1650,7 +1650,7 @@ var EditForm = (0, import_react8.forwardRef)((props, ref) => {
1650
1650
  closeMenu();
1651
1651
  }
1652
1652
  },
1653
- children: t("Save")
1653
+ children: t("reactTableEdit.Save")
1654
1654
  }
1655
1655
  )
1656
1656
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, {})
@@ -1857,7 +1857,7 @@ var SidebarSetColumn = (props) => {
1857
1857
  const renderFooterButtons = () => {
1858
1858
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react10.Fragment, { children: [
1859
1859
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_reactstrap7.Button, { color: "primary", onClick: handleSubmit, className: "me-1", children: t("Confirm") }),
1860
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_reactstrap7.Button, { color: "secondary", onClick: handleCancel, outline: true, children: t("Close") })
1860
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_reactstrap7.Button, { color: "secondary", onClick: handleCancel, outline: true, children: t("reactTableEdit.Close") })
1861
1861
  ] });
1862
1862
  };
1863
1863
  const visibleTemplate = (item, index) => {
@@ -2148,12 +2148,12 @@ var PagingComponent = ({ totalItem, pageSize, currentPage, onChangePage, pageOpt
2148
2148
  },
2149
2149
  menuWidth: 90,
2150
2150
  width: 90,
2151
- placeholder: t("Select")
2151
+ placeholder: t("reactTableEdit.Select")
2152
2152
  }
2153
2153
  ) }),
2154
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { display: "inline", marginLeft: 10, fontSize: 13 }, children: t("pagerDropDown") })
2154
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { display: "inline", marginLeft: 10, fontSize: 13 }, children: t("reactTableEdit.pagerDropDown") })
2155
2155
  ] }),
2156
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "r-parentmsgbar", children: t("totalItemsInfo", { page: currentPage, countPage, totalItem }) })
2156
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "r-parentmsgbar", children: t("reactTableEdit.totalItemsInfo", { page: currentPage, countPage, totalItem }) })
2157
2157
  ] }) });
2158
2158
  };
2159
2159
 
@@ -2855,10 +2855,10 @@ var SelectTableTree = (0, import_react15.forwardRef)((props, ref) => {
2855
2855
  /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: (0, import_classnames13.default)("r-select-footer", { "d-none": !(showFooter === true || handleAdd || isMulti) }), children: [
2856
2856
  /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_reactstrap10.Button, { outline: true, color: "primary", onClick: handleAdd, className: (0, import_classnames13.default)("r-btn d-flex align-items-center", { "d-none": !handleAdd }), children: [
2857
2857
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_becoxy_icons6.Plus, { className: "me-50", fontSize: 16 }),
2858
- t("AddNew"),
2858
+ t("reactTableEdit.AddNew"),
2859
2859
  " (F9)"
2860
2860
  ] }),
2861
- isMulti && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "ms-50 text-primary h-100 d-flex align-items-center", onClick: handleAdd, children: t("countSelected", { item: value?.length ?? 0 }) }),
2861
+ isMulti && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "ms-50 text-primary h-100 d-flex align-items-center", onClick: handleAdd, children: t("reactTableEdit.countSelected", { item: value?.length ?? 0 }) }),
2862
2862
  footerComponent ? footerComponent() : null
2863
2863
  ] })
2864
2864
  ] })
@@ -3069,7 +3069,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3069
3069
  style: { width: "230px" },
3070
3070
  value: searchSetting?.searchTerm !== void 0 ? searchSetting?.searchTerm : searchTerm,
3071
3071
  setSearchTerm: searchSetting?.setSearchTerm ? searchSetting?.setSearchTerm : setSearchTerm,
3072
- placeholder: t("Search"),
3072
+ placeholder: t("reactTableEdit.Search"),
3073
3073
  onKeyPress: handleKeyPress
3074
3074
  }
3075
3075
  ) }) });
@@ -3194,7 +3194,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3194
3194
  columns: col.selectSettings?.columns,
3195
3195
  isClearable: col.selectSettings?.isClearable ?? false,
3196
3196
  formatSetting,
3197
- placeholder: t("Select"),
3197
+ placeholder: t("reactTableEdit.Select"),
3198
3198
  loadOptions: col.selectSettings?.loadOptions,
3199
3199
  handleAdd: col.selectSettings?.handAddNew ? (e) => col.selectSettings?.handAddNew(e, indexRow, row) : void 0,
3200
3200
  isMulti: col.selectSettings?.isMulti,
@@ -3281,7 +3281,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3281
3281
  columns: col.selectSettings?.columns,
3282
3282
  isClearable: col.selectSettings?.isClearable ?? false,
3283
3283
  formatSetting,
3284
- placeholder: t("Select"),
3284
+ placeholder: t("reactTableEdit.Select"),
3285
3285
  onOpenMenu: () => {
3286
3286
  if (col.selectSettings?.onOpenMenu) {
3287
3287
  col.selectSettings?.onOpenMenu(row, col, indexRow);
@@ -3751,7 +3751,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3751
3751
  column.callback(rs, currenRowIndex + indexRow);
3752
3752
  }
3753
3753
  } else {
3754
- notificationError(t("PasteExcelNotExist", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
3754
+ notificationError(t("reactTableEdit.PasteExcelNotExist", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
3755
3755
  }
3756
3756
  } else {
3757
3757
  if (column.editType === "date") {
@@ -3766,7 +3766,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3766
3766
  column.callback(date, currenRowIndex + indexRow);
3767
3767
  }
3768
3768
  } else {
3769
- notificationError(t("PasteExcelIncorrectFormat", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
3769
+ notificationError(t("reactTableEdit.PasteExcelIncorrectFormat", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
3770
3770
  }
3771
3771
  } else if (column.editType === "numeric") {
3772
3772
  const number = Number(stringData);
@@ -3780,7 +3780,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3780
3780
  column.callback(number, currenRowIndex + indexRow);
3781
3781
  }
3782
3782
  } else {
3783
- notificationError(t("PasteExcelIncorrectFormat", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
3783
+ notificationError(t("reactTableEdit.PasteExcelIncorrectFormat", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
3784
3784
  }
3785
3785
  } else {
3786
3786
  if (column.onPaste) {
@@ -3893,7 +3893,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3893
3893
  onCopy: (e) => {
3894
3894
  if (!editDisable && (e.target.nodeName === "DIV" || e.target.nodeName === "TD")) {
3895
3895
  navigator.clipboard.writeText(JSON.stringify(row));
3896
- notificationSuccess(t("CopySuccessful"));
3896
+ notificationSuccess(t("reactTableEdit.CopySuccessful"));
3897
3897
  e.stopPropagation();
3898
3898
  }
3899
3899
  },
@@ -3905,7 +3905,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3905
3905
  dataSource[indexRow][fieldKey] = defaultValue[fieldKey];
3906
3906
  }
3907
3907
  changeDataSource(dataSource);
3908
- notificationSuccess(t("PasteSuccessful"));
3908
+ notificationSuccess(t("reactTableEdit.PasteSuccessful"));
3909
3909
  }).catch((ex) => {
3910
3910
  alert(ex);
3911
3911
  });
@@ -4111,15 +4111,15 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
4111
4111
  const renderToolbarBottom = () => {
4112
4112
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { id: "table_custom_bottom_toolbar", className: "r-toolbar r-toolbar-bottom", role: "toolbar", "aria-disabled": "false", "aria-haspopup": "false", "aria-orientation": "horizontal", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "r-toolbar-items", children: [
4113
4113
  /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "r-toolbar-left", children: [
4114
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: (0, import_classnames14.default)("r-toolbar-item", { "d-none": editDisable || addDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_reactstrap11.Button, { color: "success", outline: true, onClick: handleAdd, className: "d-flex", children: t("Add item") }) }),
4114
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: (0, import_classnames14.default)("r-toolbar-item", { "d-none": editDisable || addDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_reactstrap11.Button, { color: "success", outline: true, onClick: handleAdd, className: "d-flex", children: t("reactTableEdit.Add item") }) }),
4115
4115
  (indexFocus ?? -1) > -1 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
4116
4116
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: (0, import_classnames14.default)("r-toolbar-item", { "d-none": editDisable || addDisable || buttonSetting?.duplicateDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_reactstrap11.Button, { color: "success", outline: true, onClick: () => {
4117
4117
  handleDuplicate(dataSource[indexFocus ?? -1], indexFocus ?? -1);
4118
- }, className: "d-flex", children: t("Duplicate") }) }),
4119
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: (0, import_classnames14.default)("r-toolbar-item", { "d-none": editDisable || addDisable || buttonSetting?.insertBeforeDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_reactstrap11.Button, { color: "success", outline: true, onClick: handleInsertBefore, className: "d-flex", children: t("Insert item before") }) }),
4120
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: (0, import_classnames14.default)("r-toolbar-item", { "d-none": editDisable || addDisable || buttonSetting?.insertAfterDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_reactstrap11.Button, { color: "success", outline: true, onClick: handleInsertAfter, className: "d-flex", children: t("Insert item after") }) })
4118
+ }, className: "d-flex", children: t("reactTableEdit.Duplicate") }) }),
4119
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: (0, import_classnames14.default)("r-toolbar-item", { "d-none": editDisable || addDisable || buttonSetting?.insertBeforeDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_reactstrap11.Button, { color: "success", outline: true, onClick: handleInsertBefore, className: "d-flex", children: t("reactTableEdit.Insert item before") }) }),
4120
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: (0, import_classnames14.default)("r-toolbar-item", { "d-none": editDisable || addDisable || buttonSetting?.insertAfterDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_reactstrap11.Button, { color: "success", outline: true, onClick: handleInsertAfter, className: "d-flex", children: t("reactTableEdit.Insert item after") }) })
4121
4121
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, { children: " " }),
4122
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: (0, import_classnames14.default)("r-toolbar-item", { "d-none": editDisable || buttonSetting?.deleteAllDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_reactstrap11.Button, { color: "primary", outline: true, onClick: handleDeleteAll, className: "d-flex", children: t("Delete all item") }) }),
4122
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: (0, import_classnames14.default)("r-toolbar-item", { "d-none": editDisable || buttonSetting?.deleteAllDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_reactstrap11.Button, { color: "primary", outline: true, onClick: handleDeleteAll, className: "d-flex", children: t("reactTableEdit.Delete all item") }) }),
4123
4123
  toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
4124
4124
  return item.align === "left" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-left-${index}`) : "";
4125
4125
  })
package/dist/index.mjs CHANGED
@@ -89,11 +89,11 @@ var messageHtmlBoxError = (t, message, title = "Important", btnCancel = "Ok") =>
89
89
  };
90
90
  var messageBoxConfirmDelete = (t, handle, data) => {
91
91
  MySwal.fire({
92
- title: t("Confirm"),
93
- text: t("Do you want to delete item?"),
92
+ title: t("reactTableEdit.Confirm"),
93
+ text: t("reactTableEdit.Do you want to delete item?"),
94
94
  allowOutsideClick: false,
95
95
  showCancelButton: true,
96
- confirmButtonText: t("Delete"),
96
+ confirmButtonText: t("reactTableEdit.Delete"),
97
97
  cancelButtonText: t("Cancel"),
98
98
  customClass: {
99
99
  confirmButton: "btn btn-primary",
@@ -158,11 +158,11 @@ var notificationSuccess = (param) => {
158
158
  var messageBoxConfirm2 = async (t, data, data2, message) => {
159
159
  return new Promise((resolve) => {
160
160
  MySwal.fire({
161
- title: t("Confirm"),
161
+ title: t("reactTableEdit.Confirm"),
162
162
  text: t(message),
163
163
  allowOutsideClick: false,
164
164
  showCancelButton: true,
165
- confirmButtonText: t("Ok"),
165
+ confirmButtonText: t("reactTableEdit.Ok"),
166
166
  cancelButtonText: t("Cancel"),
167
167
  customClass: {
168
168
  confirmButton: "btn btn-primary",
@@ -709,7 +709,7 @@ var SelectTable = forwardRef((props, ref) => {
709
709
  } else if (e.code === "Space") {
710
710
  let newItem;
711
711
  if (haveCreateNew && indexFocus === 0) {
712
- newItem = { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("Create")} '${searchTerm}'`, isCreated: true };
712
+ newItem = { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("reactTableEdit.Create")} '${searchTerm}'`, isCreated: true };
713
713
  } else {
714
714
  newItem = (optionsLoad ? optionsLoad : options)[indexFocus];
715
715
  }
@@ -731,7 +731,7 @@ var SelectTable = forwardRef((props, ref) => {
731
731
  } else if (e.code === "Enter" || e.code === "Tab" || e.code === "NumpadEnter") {
732
732
  let newItem;
733
733
  if (haveCreateNew && indexFocus === 0) {
734
- newItem = { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("Create")} '${searchTerm}'`, isCreated: true };
734
+ newItem = { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("reactTableEdit.Create")} '${searchTerm}'`, isCreated: true };
735
735
  } else {
736
736
  newItem = (optionsLoad ? optionsLoad : options)[indexFocus];
737
737
  }
@@ -1022,7 +1022,7 @@ var SelectTable = forwardRef((props, ref) => {
1022
1022
  })
1023
1023
  ] }) }),
1024
1024
  (optionsLoad ? optionsLoad : options) && !isLoading && /* @__PURE__ */ jsx5(Fragment6, { children: /* @__PURE__ */ jsxs5("tbody", { className: "r-select-gridcontent", children: [
1025
- haveCreateNew && /* @__PURE__ */ jsx5(RenderElement, { isSelected: false, indexRow: 0, row: { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("Create")} '${searchTerm}'`, isCreated: true } }),
1025
+ haveCreateNew && /* @__PURE__ */ jsx5(RenderElement, { isSelected: false, indexRow: 0, row: { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("reactTableEdit.Create")} '${searchTerm}'`, isCreated: true } }),
1026
1026
  (optionsLoad ? optionsLoad : options)?.map((row, indexRow) => {
1027
1027
  const isSelected = isMulti && value?.some((x) => x[fieldValue ?? "value"] === row[fieldValue ?? "value"]);
1028
1028
  return /* @__PURE__ */ jsx5(RenderElement, { isSelected: isSelected ?? false, indexRow: indexRow + (haveCreateNew ? 1 : 0), row }, `select-table-${indexRow}`);
@@ -1037,11 +1037,11 @@ var SelectTable = forwardRef((props, ref) => {
1037
1037
  /* @__PURE__ */ jsx5("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" })
1038
1038
  ] })
1039
1039
  ] }) }),
1040
- t("No data available.")
1040
+ t("reactTableEdit.No data available.")
1041
1041
  ] }),
1042
1042
  isLoading && /* @__PURE__ */ jsxs5("div", { className: "r-no-data", children: [
1043
1043
  /* @__PURE__ */ jsx5(Spinner, { className: "me-1", children: " " }),
1044
- t("Loading...")
1044
+ t("reactTableEdit.Loading...")
1045
1045
  ] })
1046
1046
  ] });
1047
1047
  };
@@ -1158,7 +1158,7 @@ var SelectTable = forwardRef((props, ref) => {
1158
1158
  /* @__PURE__ */ jsxs5("div", { className: classnames3("r-select-footer", { "d-none": !(showFooter === true || handleAdd) }), children: [
1159
1159
  /* @__PURE__ */ jsxs5(Button, { outline: true, color: "primary", onClick: handleAdd, className: classnames3("r-btn d-flex align-items-center", { "d-none": !handleAdd }), children: [
1160
1160
  /* @__PURE__ */ jsx5(Plus, { className: "me-50", fontSize: 16 }),
1161
- t("AddNew"),
1161
+ t("reactTableEdit.AddNew"),
1162
1162
  " (F9)"
1163
1163
  ] }),
1164
1164
  footerComponent ? footerComponent() : null
@@ -1597,7 +1597,7 @@ var EditForm = forwardRef2((props, ref) => {
1597
1597
  closeMenu();
1598
1598
  }
1599
1599
  },
1600
- children: t("Clear")
1600
+ children: t("reactTableEdit.Clear")
1601
1601
  }
1602
1602
  ),
1603
1603
  /* @__PURE__ */ jsx7(
@@ -1612,7 +1612,7 @@ var EditForm = forwardRef2((props, ref) => {
1612
1612
  closeMenu();
1613
1613
  }
1614
1614
  },
1615
- children: t("Save")
1615
+ children: t("reactTableEdit.Save")
1616
1616
  }
1617
1617
  )
1618
1618
  ] }) : /* @__PURE__ */ jsx7(Fragment9, {})
@@ -1819,7 +1819,7 @@ var SidebarSetColumn = (props) => {
1819
1819
  const renderFooterButtons = () => {
1820
1820
  return /* @__PURE__ */ jsxs10(Fragment11, { children: [
1821
1821
  /* @__PURE__ */ jsx10(Button3, { color: "primary", onClick: handleSubmit, className: "me-1", children: t("Confirm") }),
1822
- /* @__PURE__ */ jsx10(Button3, { color: "secondary", onClick: handleCancel, outline: true, children: t("Close") })
1822
+ /* @__PURE__ */ jsx10(Button3, { color: "secondary", onClick: handleCancel, outline: true, children: t("reactTableEdit.Close") })
1823
1823
  ] });
1824
1824
  };
1825
1825
  const visibleTemplate = (item, index) => {
@@ -2110,12 +2110,12 @@ var PagingComponent = ({ totalItem, pageSize, currentPage, onChangePage, pageOpt
2110
2110
  },
2111
2111
  menuWidth: 90,
2112
2112
  width: 90,
2113
- placeholder: t("Select")
2113
+ placeholder: t("reactTableEdit.Select")
2114
2114
  }
2115
2115
  ) }),
2116
- /* @__PURE__ */ jsx11("span", { style: { display: "inline", marginLeft: 10, fontSize: 13 }, children: t("pagerDropDown") })
2116
+ /* @__PURE__ */ jsx11("span", { style: { display: "inline", marginLeft: 10, fontSize: 13 }, children: t("reactTableEdit.pagerDropDown") })
2117
2117
  ] }),
2118
- /* @__PURE__ */ jsx11("div", { className: "r-parentmsgbar", children: t("totalItemsInfo", { page: currentPage, countPage, totalItem }) })
2118
+ /* @__PURE__ */ jsx11("div", { className: "r-parentmsgbar", children: t("reactTableEdit.totalItemsInfo", { page: currentPage, countPage, totalItem }) })
2119
2119
  ] }) });
2120
2120
  };
2121
2121
 
@@ -2825,10 +2825,10 @@ var SelectTableTree = forwardRef3((props, ref) => {
2825
2825
  /* @__PURE__ */ jsxs14("div", { className: classnames8("r-select-footer", { "d-none": !(showFooter === true || handleAdd || isMulti) }), children: [
2826
2826
  /* @__PURE__ */ jsxs14(Button5, { outline: true, color: "primary", onClick: handleAdd, className: classnames8("r-btn d-flex align-items-center", { "d-none": !handleAdd }), children: [
2827
2827
  /* @__PURE__ */ jsx15(Plus3, { className: "me-50", fontSize: 16 }),
2828
- t("AddNew"),
2828
+ t("reactTableEdit.AddNew"),
2829
2829
  " (F9)"
2830
2830
  ] }),
2831
- isMulti && /* @__PURE__ */ jsx15("div", { className: "ms-50 text-primary h-100 d-flex align-items-center", onClick: handleAdd, children: t("countSelected", { item: value?.length ?? 0 }) }),
2831
+ isMulti && /* @__PURE__ */ jsx15("div", { className: "ms-50 text-primary h-100 d-flex align-items-center", onClick: handleAdd, children: t("reactTableEdit.countSelected", { item: value?.length ?? 0 }) }),
2832
2832
  footerComponent ? footerComponent() : null
2833
2833
  ] })
2834
2834
  ] })
@@ -3039,7 +3039,7 @@ var TableEdit = forwardRef4((props, ref) => {
3039
3039
  style: { width: "230px" },
3040
3040
  value: searchSetting?.searchTerm !== void 0 ? searchSetting?.searchTerm : searchTerm,
3041
3041
  setSearchTerm: searchSetting?.setSearchTerm ? searchSetting?.setSearchTerm : setSearchTerm,
3042
- placeholder: t("Search"),
3042
+ placeholder: t("reactTableEdit.Search"),
3043
3043
  onKeyPress: handleKeyPress
3044
3044
  }
3045
3045
  ) }) });
@@ -3164,7 +3164,7 @@ var TableEdit = forwardRef4((props, ref) => {
3164
3164
  columns: col.selectSettings?.columns,
3165
3165
  isClearable: col.selectSettings?.isClearable ?? false,
3166
3166
  formatSetting,
3167
- placeholder: t("Select"),
3167
+ placeholder: t("reactTableEdit.Select"),
3168
3168
  loadOptions: col.selectSettings?.loadOptions,
3169
3169
  handleAdd: col.selectSettings?.handAddNew ? (e) => col.selectSettings?.handAddNew(e, indexRow, row) : void 0,
3170
3170
  isMulti: col.selectSettings?.isMulti,
@@ -3251,7 +3251,7 @@ var TableEdit = forwardRef4((props, ref) => {
3251
3251
  columns: col.selectSettings?.columns,
3252
3252
  isClearable: col.selectSettings?.isClearable ?? false,
3253
3253
  formatSetting,
3254
- placeholder: t("Select"),
3254
+ placeholder: t("reactTableEdit.Select"),
3255
3255
  onOpenMenu: () => {
3256
3256
  if (col.selectSettings?.onOpenMenu) {
3257
3257
  col.selectSettings?.onOpenMenu(row, col, indexRow);
@@ -3721,7 +3721,7 @@ var TableEdit = forwardRef4((props, ref) => {
3721
3721
  column.callback(rs, currenRowIndex + indexRow);
3722
3722
  }
3723
3723
  } else {
3724
- notificationError(t("PasteExcelNotExist", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
3724
+ notificationError(t("reactTableEdit.PasteExcelNotExist", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
3725
3725
  }
3726
3726
  } else {
3727
3727
  if (column.editType === "date") {
@@ -3736,7 +3736,7 @@ var TableEdit = forwardRef4((props, ref) => {
3736
3736
  column.callback(date, currenRowIndex + indexRow);
3737
3737
  }
3738
3738
  } else {
3739
- notificationError(t("PasteExcelIncorrectFormat", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
3739
+ notificationError(t("reactTableEdit.PasteExcelIncorrectFormat", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
3740
3740
  }
3741
3741
  } else if (column.editType === "numeric") {
3742
3742
  const number = Number(stringData);
@@ -3750,7 +3750,7 @@ var TableEdit = forwardRef4((props, ref) => {
3750
3750
  column.callback(number, currenRowIndex + indexRow);
3751
3751
  }
3752
3752
  } else {
3753
- notificationError(t("PasteExcelIncorrectFormat", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
3753
+ notificationError(t("reactTableEdit.PasteExcelIncorrectFormat", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
3754
3754
  }
3755
3755
  } else {
3756
3756
  if (column.onPaste) {
@@ -3863,7 +3863,7 @@ var TableEdit = forwardRef4((props, ref) => {
3863
3863
  onCopy: (e) => {
3864
3864
  if (!editDisable && (e.target.nodeName === "DIV" || e.target.nodeName === "TD")) {
3865
3865
  navigator.clipboard.writeText(JSON.stringify(row));
3866
- notificationSuccess(t("CopySuccessful"));
3866
+ notificationSuccess(t("reactTableEdit.CopySuccessful"));
3867
3867
  e.stopPropagation();
3868
3868
  }
3869
3869
  },
@@ -3875,7 +3875,7 @@ var TableEdit = forwardRef4((props, ref) => {
3875
3875
  dataSource[indexRow][fieldKey] = defaultValue[fieldKey];
3876
3876
  }
3877
3877
  changeDataSource(dataSource);
3878
- notificationSuccess(t("PasteSuccessful"));
3878
+ notificationSuccess(t("reactTableEdit.PasteSuccessful"));
3879
3879
  }).catch((ex) => {
3880
3880
  alert(ex);
3881
3881
  });
@@ -4081,15 +4081,15 @@ var TableEdit = forwardRef4((props, ref) => {
4081
4081
  const renderToolbarBottom = () => {
4082
4082
  return /* @__PURE__ */ jsx16("div", { id: "table_custom_bottom_toolbar", className: "r-toolbar r-toolbar-bottom", role: "toolbar", "aria-disabled": "false", "aria-haspopup": "false", "aria-orientation": "horizontal", children: /* @__PURE__ */ jsxs15("div", { className: "r-toolbar-items", children: [
4083
4083
  /* @__PURE__ */ jsxs15("div", { className: "r-toolbar-left", children: [
4084
- /* @__PURE__ */ jsx16("div", { className: classnames9("r-toolbar-item", { "d-none": editDisable || addDisable }), "aria-disabled": "false", children: /* @__PURE__ */ jsx16(Button6, { color: "success", outline: true, onClick: handleAdd, className: "d-flex", children: t("Add item") }) }),
4084
+ /* @__PURE__ */ jsx16("div", { className: classnames9("r-toolbar-item", { "d-none": editDisable || addDisable }), "aria-disabled": "false", children: /* @__PURE__ */ jsx16(Button6, { color: "success", outline: true, onClick: handleAdd, className: "d-flex", children: t("reactTableEdit.Add item") }) }),
4085
4085
  (indexFocus ?? -1) > -1 ? /* @__PURE__ */ jsxs15(Fragment21, { children: [
4086
4086
  /* @__PURE__ */ jsx16("div", { className: classnames9("r-toolbar-item", { "d-none": editDisable || addDisable || buttonSetting?.duplicateDisable }), "aria-disabled": "false", children: /* @__PURE__ */ jsx16(Button6, { color: "success", outline: true, onClick: () => {
4087
4087
  handleDuplicate(dataSource[indexFocus ?? -1], indexFocus ?? -1);
4088
- }, className: "d-flex", children: t("Duplicate") }) }),
4089
- /* @__PURE__ */ jsx16("div", { className: classnames9("r-toolbar-item", { "d-none": editDisable || addDisable || buttonSetting?.insertBeforeDisable }), "aria-disabled": "false", children: /* @__PURE__ */ jsx16(Button6, { color: "success", outline: true, onClick: handleInsertBefore, className: "d-flex", children: t("Insert item before") }) }),
4090
- /* @__PURE__ */ jsx16("div", { className: classnames9("r-toolbar-item", { "d-none": editDisable || addDisable || buttonSetting?.insertAfterDisable }), "aria-disabled": "false", children: /* @__PURE__ */ jsx16(Button6, { color: "success", outline: true, onClick: handleInsertAfter, className: "d-flex", children: t("Insert item after") }) })
4088
+ }, className: "d-flex", children: t("reactTableEdit.Duplicate") }) }),
4089
+ /* @__PURE__ */ jsx16("div", { className: classnames9("r-toolbar-item", { "d-none": editDisable || addDisable || buttonSetting?.insertBeforeDisable }), "aria-disabled": "false", children: /* @__PURE__ */ jsx16(Button6, { color: "success", outline: true, onClick: handleInsertBefore, className: "d-flex", children: t("reactTableEdit.Insert item before") }) }),
4090
+ /* @__PURE__ */ jsx16("div", { className: classnames9("r-toolbar-item", { "d-none": editDisable || addDisable || buttonSetting?.insertAfterDisable }), "aria-disabled": "false", children: /* @__PURE__ */ jsx16(Button6, { color: "success", outline: true, onClick: handleInsertAfter, className: "d-flex", children: t("reactTableEdit.Insert item after") }) })
4091
4091
  ] }) : /* @__PURE__ */ jsx16(Fragment21, { children: " " }),
4092
- /* @__PURE__ */ jsx16("div", { className: classnames9("r-toolbar-item", { "d-none": editDisable || buttonSetting?.deleteAllDisable }), "aria-disabled": "false", children: /* @__PURE__ */ jsx16(Button6, { color: "primary", outline: true, onClick: handleDeleteAll, className: "d-flex", children: t("Delete all item") }) }),
4092
+ /* @__PURE__ */ jsx16("div", { className: classnames9("r-toolbar-item", { "d-none": editDisable || buttonSetting?.deleteAllDisable }), "aria-disabled": "false", children: /* @__PURE__ */ jsx16(Button6, { color: "primary", outline: true, onClick: handleDeleteAll, className: "d-flex", children: t("reactTableEdit.Delete all item") }) }),
4093
4093
  toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
4094
4094
  return item.align === "left" ? /* @__PURE__ */ jsx16("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-left-${index}`) : "";
4095
4095
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-table-edit",
3
- "version": "1.2.42",
3
+ "version": "1.2.43",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",