react-table-edit 1.2.43 → 1.2.45
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 +39 -38
- package/dist/index.mjs +39 -38
- package/package.json +1 -1
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("
|
|
149
|
-
text: t("
|
|
148
|
+
title: t("Confirm"),
|
|
149
|
+
text: t("Do you want to delete item?"),
|
|
150
150
|
allowOutsideClick: false,
|
|
151
151
|
showCancelButton: true,
|
|
152
|
-
confirmButtonText: t("
|
|
152
|
+
confirmButtonText: t("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("
|
|
217
|
+
title: t("Confirm"),
|
|
218
218
|
text: t(message),
|
|
219
219
|
allowOutsideClick: false,
|
|
220
220
|
showCancelButton: true,
|
|
221
|
-
confirmButtonText: t("
|
|
221
|
+
confirmButtonText: t("Ok"),
|
|
222
222
|
cancelButtonText: t("Cancel"),
|
|
223
223
|
customClass: {
|
|
224
224
|
confirmButton: "btn btn-primary",
|
|
@@ -713,9 +713,11 @@ var SelectTable = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
713
713
|
}
|
|
714
714
|
}, [inputRef]);
|
|
715
715
|
(0, import_react6.useEffect)(() => {
|
|
716
|
-
if (searchTerm
|
|
717
|
-
|
|
718
|
-
|
|
716
|
+
if (searchTerm) {
|
|
717
|
+
if (!dropdownOpen) {
|
|
718
|
+
setDropdownOpen(true);
|
|
719
|
+
}
|
|
720
|
+
setIndexFocus(-1);
|
|
719
721
|
}
|
|
720
722
|
}, [searchTerm]);
|
|
721
723
|
(0, import_react6.useEffect)(() => {
|
|
@@ -747,17 +749,16 @@ var SelectTable = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
747
749
|
} else if (e.code === "Space") {
|
|
748
750
|
let newItem;
|
|
749
751
|
if (haveCreateNew && indexFocus === 0) {
|
|
750
|
-
newItem = { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("
|
|
752
|
+
newItem = { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("Create")} '${searchTerm}'`, isCreated: true };
|
|
751
753
|
} else {
|
|
752
754
|
newItem = (optionsLoad ? optionsLoad : options)[indexFocus];
|
|
753
755
|
}
|
|
754
756
|
if (dropdownOpen && newItem) {
|
|
755
757
|
handChange(newItem);
|
|
756
758
|
handleOpenClose();
|
|
757
|
-
flag = true;
|
|
758
759
|
}
|
|
759
|
-
if (!
|
|
760
|
-
|
|
760
|
+
if (!dropdownOpen) {
|
|
761
|
+
setDropdownOpen(true);
|
|
761
762
|
flag = true;
|
|
762
763
|
}
|
|
763
764
|
} else if (e.code === "Escape") {
|
|
@@ -769,7 +770,7 @@ var SelectTable = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
769
770
|
} else if (e.code === "Enter" || e.code === "Tab" || e.code === "NumpadEnter") {
|
|
770
771
|
let newItem;
|
|
771
772
|
if (haveCreateNew && indexFocus === 0) {
|
|
772
|
-
newItem = { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("
|
|
773
|
+
newItem = { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("Create")} '${searchTerm}'`, isCreated: true };
|
|
773
774
|
} else {
|
|
774
775
|
newItem = (optionsLoad ? optionsLoad : options)[indexFocus];
|
|
775
776
|
}
|
|
@@ -1060,7 +1061,7 @@ var SelectTable = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
1060
1061
|
})
|
|
1061
1062
|
] }) }),
|
|
1062
1063
|
(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("
|
|
1064
|
+
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 } }),
|
|
1064
1065
|
(optionsLoad ? optionsLoad : options)?.map((row, indexRow) => {
|
|
1065
1066
|
const isSelected = isMulti && value?.some((x) => x[fieldValue ?? "value"] === row[fieldValue ?? "value"]);
|
|
1066
1067
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RenderElement, { isSelected: isSelected ?? false, indexRow: indexRow + (haveCreateNew ? 1 : 0), row }, `select-table-${indexRow}`);
|
|
@@ -1075,11 +1076,11 @@ var SelectTable = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
1075
1076
|
/* @__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
1077
|
] })
|
|
1077
1078
|
] }) }),
|
|
1078
|
-
t("
|
|
1079
|
+
t("No data available.")
|
|
1079
1080
|
] }),
|
|
1080
1081
|
isLoading && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "r-no-data", children: [
|
|
1081
1082
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_reactstrap4.Spinner, { className: "me-1", children: " " }),
|
|
1082
|
-
t("
|
|
1083
|
+
t("Loading...")
|
|
1083
1084
|
] })
|
|
1084
1085
|
] });
|
|
1085
1086
|
};
|
|
@@ -1196,7 +1197,7 @@ var SelectTable = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
1196
1197
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_classnames4.default)("r-select-footer", { "d-none": !(showFooter === true || handleAdd) }), children: [
|
|
1197
1198
|
/* @__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
1199
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_becoxy_icons2.Plus, { className: "me-50", fontSize: 16 }),
|
|
1199
|
-
t("
|
|
1200
|
+
t("AddNew"),
|
|
1200
1201
|
" (F9)"
|
|
1201
1202
|
] }),
|
|
1202
1203
|
footerComponent ? footerComponent() : null
|
|
@@ -1635,7 +1636,7 @@ var EditForm = (0, import_react8.forwardRef)((props, ref) => {
|
|
|
1635
1636
|
closeMenu();
|
|
1636
1637
|
}
|
|
1637
1638
|
},
|
|
1638
|
-
children: t("
|
|
1639
|
+
children: t("Clear")
|
|
1639
1640
|
}
|
|
1640
1641
|
),
|
|
1641
1642
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
@@ -1650,7 +1651,7 @@ var EditForm = (0, import_react8.forwardRef)((props, ref) => {
|
|
|
1650
1651
|
closeMenu();
|
|
1651
1652
|
}
|
|
1652
1653
|
},
|
|
1653
|
-
children: t("
|
|
1654
|
+
children: t("Save")
|
|
1654
1655
|
}
|
|
1655
1656
|
)
|
|
1656
1657
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, {})
|
|
@@ -1857,7 +1858,7 @@ var SidebarSetColumn = (props) => {
|
|
|
1857
1858
|
const renderFooterButtons = () => {
|
|
1858
1859
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react10.Fragment, { children: [
|
|
1859
1860
|
/* @__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("
|
|
1861
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_reactstrap7.Button, { color: "secondary", onClick: handleCancel, outline: true, children: t("Close") })
|
|
1861
1862
|
] });
|
|
1862
1863
|
};
|
|
1863
1864
|
const visibleTemplate = (item, index) => {
|
|
@@ -2148,12 +2149,12 @@ var PagingComponent = ({ totalItem, pageSize, currentPage, onChangePage, pageOpt
|
|
|
2148
2149
|
},
|
|
2149
2150
|
menuWidth: 90,
|
|
2150
2151
|
width: 90,
|
|
2151
|
-
placeholder: t("
|
|
2152
|
+
placeholder: t("Select")
|
|
2152
2153
|
}
|
|
2153
2154
|
) }),
|
|
2154
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { display: "inline", marginLeft: 10, fontSize: 13 }, children: t("
|
|
2155
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { display: "inline", marginLeft: 10, fontSize: 13 }, children: t("pagerDropDown") })
|
|
2155
2156
|
] }),
|
|
2156
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "r-parentmsgbar", children: t("
|
|
2157
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "r-parentmsgbar", children: t("totalItemsInfo", { page: currentPage, countPage, totalItem }) })
|
|
2157
2158
|
] }) });
|
|
2158
2159
|
};
|
|
2159
2160
|
|
|
@@ -2855,10 +2856,10 @@ var SelectTableTree = (0, import_react15.forwardRef)((props, ref) => {
|
|
|
2855
2856
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: (0, import_classnames13.default)("r-select-footer", { "d-none": !(showFooter === true || handleAdd || isMulti) }), children: [
|
|
2856
2857
|
/* @__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
2858
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_becoxy_icons6.Plus, { className: "me-50", fontSize: 16 }),
|
|
2858
|
-
t("
|
|
2859
|
+
t("AddNew"),
|
|
2859
2860
|
" (F9)"
|
|
2860
2861
|
] }),
|
|
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("
|
|
2862
|
+
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 }) }),
|
|
2862
2863
|
footerComponent ? footerComponent() : null
|
|
2863
2864
|
] })
|
|
2864
2865
|
] })
|
|
@@ -3069,7 +3070,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
3069
3070
|
style: { width: "230px" },
|
|
3070
3071
|
value: searchSetting?.searchTerm !== void 0 ? searchSetting?.searchTerm : searchTerm,
|
|
3071
3072
|
setSearchTerm: searchSetting?.setSearchTerm ? searchSetting?.setSearchTerm : setSearchTerm,
|
|
3072
|
-
placeholder: t("
|
|
3073
|
+
placeholder: t("Search"),
|
|
3073
3074
|
onKeyPress: handleKeyPress
|
|
3074
3075
|
}
|
|
3075
3076
|
) }) });
|
|
@@ -3194,7 +3195,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
3194
3195
|
columns: col.selectSettings?.columns,
|
|
3195
3196
|
isClearable: col.selectSettings?.isClearable ?? false,
|
|
3196
3197
|
formatSetting,
|
|
3197
|
-
placeholder: t("
|
|
3198
|
+
placeholder: t("Select"),
|
|
3198
3199
|
loadOptions: col.selectSettings?.loadOptions,
|
|
3199
3200
|
handleAdd: col.selectSettings?.handAddNew ? (e) => col.selectSettings?.handAddNew(e, indexRow, row) : void 0,
|
|
3200
3201
|
isMulti: col.selectSettings?.isMulti,
|
|
@@ -3281,7 +3282,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
3281
3282
|
columns: col.selectSettings?.columns,
|
|
3282
3283
|
isClearable: col.selectSettings?.isClearable ?? false,
|
|
3283
3284
|
formatSetting,
|
|
3284
|
-
placeholder: t("
|
|
3285
|
+
placeholder: t("Select"),
|
|
3285
3286
|
onOpenMenu: () => {
|
|
3286
3287
|
if (col.selectSettings?.onOpenMenu) {
|
|
3287
3288
|
col.selectSettings?.onOpenMenu(row, col, indexRow);
|
|
@@ -3751,7 +3752,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
3751
3752
|
column.callback(rs, currenRowIndex + indexRow);
|
|
3752
3753
|
}
|
|
3753
3754
|
} else {
|
|
3754
|
-
notificationError(t("
|
|
3755
|
+
notificationError(t("PasteExcelNotExist", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
|
|
3755
3756
|
}
|
|
3756
3757
|
} else {
|
|
3757
3758
|
if (column.editType === "date") {
|
|
@@ -3766,7 +3767,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
3766
3767
|
column.callback(date, currenRowIndex + indexRow);
|
|
3767
3768
|
}
|
|
3768
3769
|
} else {
|
|
3769
|
-
notificationError(t("
|
|
3770
|
+
notificationError(t("PasteExcelIncorrectFormat", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
|
|
3770
3771
|
}
|
|
3771
3772
|
} else if (column.editType === "numeric") {
|
|
3772
3773
|
const number = Number(stringData);
|
|
@@ -3780,7 +3781,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
3780
3781
|
column.callback(number, currenRowIndex + indexRow);
|
|
3781
3782
|
}
|
|
3782
3783
|
} else {
|
|
3783
|
-
notificationError(t("
|
|
3784
|
+
notificationError(t("PasteExcelIncorrectFormat", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
|
|
3784
3785
|
}
|
|
3785
3786
|
} else {
|
|
3786
3787
|
if (column.onPaste) {
|
|
@@ -3893,7 +3894,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
3893
3894
|
onCopy: (e) => {
|
|
3894
3895
|
if (!editDisable && (e.target.nodeName === "DIV" || e.target.nodeName === "TD")) {
|
|
3895
3896
|
navigator.clipboard.writeText(JSON.stringify(row));
|
|
3896
|
-
notificationSuccess(t("
|
|
3897
|
+
notificationSuccess(t("CopySuccessful"));
|
|
3897
3898
|
e.stopPropagation();
|
|
3898
3899
|
}
|
|
3899
3900
|
},
|
|
@@ -3905,7 +3906,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
3905
3906
|
dataSource[indexRow][fieldKey] = defaultValue[fieldKey];
|
|
3906
3907
|
}
|
|
3907
3908
|
changeDataSource(dataSource);
|
|
3908
|
-
notificationSuccess(t("
|
|
3909
|
+
notificationSuccess(t("PasteSuccessful"));
|
|
3909
3910
|
}).catch((ex) => {
|
|
3910
3911
|
alert(ex);
|
|
3911
3912
|
});
|
|
@@ -4111,15 +4112,15 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
4111
4112
|
const renderToolbarBottom = () => {
|
|
4112
4113
|
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
4114
|
/* @__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("
|
|
4115
|
+
/* @__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") }) }),
|
|
4115
4116
|
(indexFocus ?? -1) > -1 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
4116
4117
|
/* @__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
4118
|
handleDuplicate(dataSource[indexFocus ?? -1], indexFocus ?? -1);
|
|
4118
|
-
}, className: "d-flex", children: t("
|
|
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("
|
|
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("
|
|
4119
|
+
}, className: "d-flex", children: t("Duplicate") }) }),
|
|
4120
|
+
/* @__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") }) }),
|
|
4121
|
+
/* @__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") }) })
|
|
4121
4122
|
] }) : /* @__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("
|
|
4123
|
+
/* @__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") }) }),
|
|
4123
4124
|
toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
|
|
4124
4125
|
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
4126
|
})
|
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("
|
|
93
|
-
text: t("
|
|
92
|
+
title: t("Confirm"),
|
|
93
|
+
text: t("Do you want to delete item?"),
|
|
94
94
|
allowOutsideClick: false,
|
|
95
95
|
showCancelButton: true,
|
|
96
|
-
confirmButtonText: t("
|
|
96
|
+
confirmButtonText: t("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("
|
|
161
|
+
title: t("Confirm"),
|
|
162
162
|
text: t(message),
|
|
163
163
|
allowOutsideClick: false,
|
|
164
164
|
showCancelButton: true,
|
|
165
|
-
confirmButtonText: t("
|
|
165
|
+
confirmButtonText: t("Ok"),
|
|
166
166
|
cancelButtonText: t("Cancel"),
|
|
167
167
|
customClass: {
|
|
168
168
|
confirmButton: "btn btn-primary",
|
|
@@ -675,9 +675,11 @@ var SelectTable = forwardRef((props, ref) => {
|
|
|
675
675
|
}
|
|
676
676
|
}, [inputRef]);
|
|
677
677
|
useEffect3(() => {
|
|
678
|
-
if (searchTerm
|
|
679
|
-
|
|
680
|
-
|
|
678
|
+
if (searchTerm) {
|
|
679
|
+
if (!dropdownOpen) {
|
|
680
|
+
setDropdownOpen(true);
|
|
681
|
+
}
|
|
682
|
+
setIndexFocus(-1);
|
|
681
683
|
}
|
|
682
684
|
}, [searchTerm]);
|
|
683
685
|
useEffect3(() => {
|
|
@@ -709,17 +711,16 @@ var SelectTable = forwardRef((props, ref) => {
|
|
|
709
711
|
} else if (e.code === "Space") {
|
|
710
712
|
let newItem;
|
|
711
713
|
if (haveCreateNew && indexFocus === 0) {
|
|
712
|
-
newItem = { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("
|
|
714
|
+
newItem = { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("Create")} '${searchTerm}'`, isCreated: true };
|
|
713
715
|
} else {
|
|
714
716
|
newItem = (optionsLoad ? optionsLoad : options)[indexFocus];
|
|
715
717
|
}
|
|
716
718
|
if (dropdownOpen && newItem) {
|
|
717
719
|
handChange(newItem);
|
|
718
720
|
handleOpenClose();
|
|
719
|
-
flag = true;
|
|
720
721
|
}
|
|
721
|
-
if (!
|
|
722
|
-
|
|
722
|
+
if (!dropdownOpen) {
|
|
723
|
+
setDropdownOpen(true);
|
|
723
724
|
flag = true;
|
|
724
725
|
}
|
|
725
726
|
} else if (e.code === "Escape") {
|
|
@@ -731,7 +732,7 @@ var SelectTable = forwardRef((props, ref) => {
|
|
|
731
732
|
} else if (e.code === "Enter" || e.code === "Tab" || e.code === "NumpadEnter") {
|
|
732
733
|
let newItem;
|
|
733
734
|
if (haveCreateNew && indexFocus === 0) {
|
|
734
|
-
newItem = { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("
|
|
735
|
+
newItem = { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("Create")} '${searchTerm}'`, isCreated: true };
|
|
735
736
|
} else {
|
|
736
737
|
newItem = (optionsLoad ? optionsLoad : options)[indexFocus];
|
|
737
738
|
}
|
|
@@ -1022,7 +1023,7 @@ var SelectTable = forwardRef((props, ref) => {
|
|
|
1022
1023
|
})
|
|
1023
1024
|
] }) }),
|
|
1024
1025
|
(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("
|
|
1026
|
+
haveCreateNew && /* @__PURE__ */ jsx5(RenderElement, { isSelected: false, indexRow: 0, row: { valueCreate: searchTerm, [fieldValue ?? "value"]: searchTerm, [fieldLabel ?? "label"]: `${t("Create")} '${searchTerm}'`, isCreated: true } }),
|
|
1026
1027
|
(optionsLoad ? optionsLoad : options)?.map((row, indexRow) => {
|
|
1027
1028
|
const isSelected = isMulti && value?.some((x) => x[fieldValue ?? "value"] === row[fieldValue ?? "value"]);
|
|
1028
1029
|
return /* @__PURE__ */ jsx5(RenderElement, { isSelected: isSelected ?? false, indexRow: indexRow + (haveCreateNew ? 1 : 0), row }, `select-table-${indexRow}`);
|
|
@@ -1037,11 +1038,11 @@ var SelectTable = forwardRef((props, ref) => {
|
|
|
1037
1038
|
/* @__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
1039
|
] })
|
|
1039
1040
|
] }) }),
|
|
1040
|
-
t("
|
|
1041
|
+
t("No data available.")
|
|
1041
1042
|
] }),
|
|
1042
1043
|
isLoading && /* @__PURE__ */ jsxs5("div", { className: "r-no-data", children: [
|
|
1043
1044
|
/* @__PURE__ */ jsx5(Spinner, { className: "me-1", children: " " }),
|
|
1044
|
-
t("
|
|
1045
|
+
t("Loading...")
|
|
1045
1046
|
] })
|
|
1046
1047
|
] });
|
|
1047
1048
|
};
|
|
@@ -1158,7 +1159,7 @@ var SelectTable = forwardRef((props, ref) => {
|
|
|
1158
1159
|
/* @__PURE__ */ jsxs5("div", { className: classnames3("r-select-footer", { "d-none": !(showFooter === true || handleAdd) }), children: [
|
|
1159
1160
|
/* @__PURE__ */ jsxs5(Button, { outline: true, color: "primary", onClick: handleAdd, className: classnames3("r-btn d-flex align-items-center", { "d-none": !handleAdd }), children: [
|
|
1160
1161
|
/* @__PURE__ */ jsx5(Plus, { className: "me-50", fontSize: 16 }),
|
|
1161
|
-
t("
|
|
1162
|
+
t("AddNew"),
|
|
1162
1163
|
" (F9)"
|
|
1163
1164
|
] }),
|
|
1164
1165
|
footerComponent ? footerComponent() : null
|
|
@@ -1597,7 +1598,7 @@ var EditForm = forwardRef2((props, ref) => {
|
|
|
1597
1598
|
closeMenu();
|
|
1598
1599
|
}
|
|
1599
1600
|
},
|
|
1600
|
-
children: t("
|
|
1601
|
+
children: t("Clear")
|
|
1601
1602
|
}
|
|
1602
1603
|
),
|
|
1603
1604
|
/* @__PURE__ */ jsx7(
|
|
@@ -1612,7 +1613,7 @@ var EditForm = forwardRef2((props, ref) => {
|
|
|
1612
1613
|
closeMenu();
|
|
1613
1614
|
}
|
|
1614
1615
|
},
|
|
1615
|
-
children: t("
|
|
1616
|
+
children: t("Save")
|
|
1616
1617
|
}
|
|
1617
1618
|
)
|
|
1618
1619
|
] }) : /* @__PURE__ */ jsx7(Fragment9, {})
|
|
@@ -1819,7 +1820,7 @@ var SidebarSetColumn = (props) => {
|
|
|
1819
1820
|
const renderFooterButtons = () => {
|
|
1820
1821
|
return /* @__PURE__ */ jsxs10(Fragment11, { children: [
|
|
1821
1822
|
/* @__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("
|
|
1823
|
+
/* @__PURE__ */ jsx10(Button3, { color: "secondary", onClick: handleCancel, outline: true, children: t("Close") })
|
|
1823
1824
|
] });
|
|
1824
1825
|
};
|
|
1825
1826
|
const visibleTemplate = (item, index) => {
|
|
@@ -2110,12 +2111,12 @@ var PagingComponent = ({ totalItem, pageSize, currentPage, onChangePage, pageOpt
|
|
|
2110
2111
|
},
|
|
2111
2112
|
menuWidth: 90,
|
|
2112
2113
|
width: 90,
|
|
2113
|
-
placeholder: t("
|
|
2114
|
+
placeholder: t("Select")
|
|
2114
2115
|
}
|
|
2115
2116
|
) }),
|
|
2116
|
-
/* @__PURE__ */ jsx11("span", { style: { display: "inline", marginLeft: 10, fontSize: 13 }, children: t("
|
|
2117
|
+
/* @__PURE__ */ jsx11("span", { style: { display: "inline", marginLeft: 10, fontSize: 13 }, children: t("pagerDropDown") })
|
|
2117
2118
|
] }),
|
|
2118
|
-
/* @__PURE__ */ jsx11("div", { className: "r-parentmsgbar", children: t("
|
|
2119
|
+
/* @__PURE__ */ jsx11("div", { className: "r-parentmsgbar", children: t("totalItemsInfo", { page: currentPage, countPage, totalItem }) })
|
|
2119
2120
|
] }) });
|
|
2120
2121
|
};
|
|
2121
2122
|
|
|
@@ -2825,10 +2826,10 @@ var SelectTableTree = forwardRef3((props, ref) => {
|
|
|
2825
2826
|
/* @__PURE__ */ jsxs14("div", { className: classnames8("r-select-footer", { "d-none": !(showFooter === true || handleAdd || isMulti) }), children: [
|
|
2826
2827
|
/* @__PURE__ */ jsxs14(Button5, { outline: true, color: "primary", onClick: handleAdd, className: classnames8("r-btn d-flex align-items-center", { "d-none": !handleAdd }), children: [
|
|
2827
2828
|
/* @__PURE__ */ jsx15(Plus3, { className: "me-50", fontSize: 16 }),
|
|
2828
|
-
t("
|
|
2829
|
+
t("AddNew"),
|
|
2829
2830
|
" (F9)"
|
|
2830
2831
|
] }),
|
|
2831
|
-
isMulti && /* @__PURE__ */ jsx15("div", { className: "ms-50 text-primary h-100 d-flex align-items-center", onClick: handleAdd, children: t("
|
|
2832
|
+
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 }) }),
|
|
2832
2833
|
footerComponent ? footerComponent() : null
|
|
2833
2834
|
] })
|
|
2834
2835
|
] })
|
|
@@ -3039,7 +3040,7 @@ var TableEdit = forwardRef4((props, ref) => {
|
|
|
3039
3040
|
style: { width: "230px" },
|
|
3040
3041
|
value: searchSetting?.searchTerm !== void 0 ? searchSetting?.searchTerm : searchTerm,
|
|
3041
3042
|
setSearchTerm: searchSetting?.setSearchTerm ? searchSetting?.setSearchTerm : setSearchTerm,
|
|
3042
|
-
placeholder: t("
|
|
3043
|
+
placeholder: t("Search"),
|
|
3043
3044
|
onKeyPress: handleKeyPress
|
|
3044
3045
|
}
|
|
3045
3046
|
) }) });
|
|
@@ -3164,7 +3165,7 @@ var TableEdit = forwardRef4((props, ref) => {
|
|
|
3164
3165
|
columns: col.selectSettings?.columns,
|
|
3165
3166
|
isClearable: col.selectSettings?.isClearable ?? false,
|
|
3166
3167
|
formatSetting,
|
|
3167
|
-
placeholder: t("
|
|
3168
|
+
placeholder: t("Select"),
|
|
3168
3169
|
loadOptions: col.selectSettings?.loadOptions,
|
|
3169
3170
|
handleAdd: col.selectSettings?.handAddNew ? (e) => col.selectSettings?.handAddNew(e, indexRow, row) : void 0,
|
|
3170
3171
|
isMulti: col.selectSettings?.isMulti,
|
|
@@ -3251,7 +3252,7 @@ var TableEdit = forwardRef4((props, ref) => {
|
|
|
3251
3252
|
columns: col.selectSettings?.columns,
|
|
3252
3253
|
isClearable: col.selectSettings?.isClearable ?? false,
|
|
3253
3254
|
formatSetting,
|
|
3254
|
-
placeholder: t("
|
|
3255
|
+
placeholder: t("Select"),
|
|
3255
3256
|
onOpenMenu: () => {
|
|
3256
3257
|
if (col.selectSettings?.onOpenMenu) {
|
|
3257
3258
|
col.selectSettings?.onOpenMenu(row, col, indexRow);
|
|
@@ -3721,7 +3722,7 @@ var TableEdit = forwardRef4((props, ref) => {
|
|
|
3721
3722
|
column.callback(rs, currenRowIndex + indexRow);
|
|
3722
3723
|
}
|
|
3723
3724
|
} else {
|
|
3724
|
-
notificationError(t("
|
|
3725
|
+
notificationError(t("PasteExcelNotExist", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
|
|
3725
3726
|
}
|
|
3726
3727
|
} else {
|
|
3727
3728
|
if (column.editType === "date") {
|
|
@@ -3736,7 +3737,7 @@ var TableEdit = forwardRef4((props, ref) => {
|
|
|
3736
3737
|
column.callback(date, currenRowIndex + indexRow);
|
|
3737
3738
|
}
|
|
3738
3739
|
} else {
|
|
3739
|
-
notificationError(t("
|
|
3740
|
+
notificationError(t("PasteExcelIncorrectFormat", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
|
|
3740
3741
|
}
|
|
3741
3742
|
} else if (column.editType === "numeric") {
|
|
3742
3743
|
const number = Number(stringData);
|
|
@@ -3750,7 +3751,7 @@ var TableEdit = forwardRef4((props, ref) => {
|
|
|
3750
3751
|
column.callback(number, currenRowIndex + indexRow);
|
|
3751
3752
|
}
|
|
3752
3753
|
} else {
|
|
3753
|
-
notificationError(t("
|
|
3754
|
+
notificationError(t("PasteExcelIncorrectFormat", { index: currenRowIndex + indexRow + 1, field: t(column.headerText ?? ""), value: stringData }));
|
|
3754
3755
|
}
|
|
3755
3756
|
} else {
|
|
3756
3757
|
if (column.onPaste) {
|
|
@@ -3863,7 +3864,7 @@ var TableEdit = forwardRef4((props, ref) => {
|
|
|
3863
3864
|
onCopy: (e) => {
|
|
3864
3865
|
if (!editDisable && (e.target.nodeName === "DIV" || e.target.nodeName === "TD")) {
|
|
3865
3866
|
navigator.clipboard.writeText(JSON.stringify(row));
|
|
3866
|
-
notificationSuccess(t("
|
|
3867
|
+
notificationSuccess(t("CopySuccessful"));
|
|
3867
3868
|
e.stopPropagation();
|
|
3868
3869
|
}
|
|
3869
3870
|
},
|
|
@@ -3875,7 +3876,7 @@ var TableEdit = forwardRef4((props, ref) => {
|
|
|
3875
3876
|
dataSource[indexRow][fieldKey] = defaultValue[fieldKey];
|
|
3876
3877
|
}
|
|
3877
3878
|
changeDataSource(dataSource);
|
|
3878
|
-
notificationSuccess(t("
|
|
3879
|
+
notificationSuccess(t("PasteSuccessful"));
|
|
3879
3880
|
}).catch((ex) => {
|
|
3880
3881
|
alert(ex);
|
|
3881
3882
|
});
|
|
@@ -4081,15 +4082,15 @@ var TableEdit = forwardRef4((props, ref) => {
|
|
|
4081
4082
|
const renderToolbarBottom = () => {
|
|
4082
4083
|
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
4084
|
/* @__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("
|
|
4085
|
+
/* @__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") }) }),
|
|
4085
4086
|
(indexFocus ?? -1) > -1 ? /* @__PURE__ */ jsxs15(Fragment21, { children: [
|
|
4086
4087
|
/* @__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
4088
|
handleDuplicate(dataSource[indexFocus ?? -1], indexFocus ?? -1);
|
|
4088
|
-
}, className: "d-flex", children: t("
|
|
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("
|
|
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("
|
|
4089
|
+
}, className: "d-flex", children: t("Duplicate") }) }),
|
|
4090
|
+
/* @__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") }) }),
|
|
4091
|
+
/* @__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") }) })
|
|
4091
4092
|
] }) : /* @__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("
|
|
4093
|
+
/* @__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") }) }),
|
|
4093
4094
|
toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
|
|
4094
4095
|
return item.align === "left" ? /* @__PURE__ */ jsx16("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-left-${index}`) : "";
|
|
4095
4096
|
})
|