react-table-edit 0.2.0 → 0.2.2
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 +9 -9
- package/dist/index.mjs +9 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -977,7 +977,7 @@ var EditForm = (0, import_react9.forwardRef)((props, ref) => {
|
|
|
977
977
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
978
978
|
"div",
|
|
979
979
|
{
|
|
980
|
-
className: "
|
|
980
|
+
className: "form-edit",
|
|
981
981
|
ref,
|
|
982
982
|
id,
|
|
983
983
|
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { ref: editFormRef, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
@@ -1010,7 +1010,7 @@ var EditForm = (0, import_react9.forwardRef)((props, ref) => {
|
|
|
1010
1010
|
width: menuWidth ? menuWidth : "min-content",
|
|
1011
1011
|
maxWidth: innerWidth > 1280 ? 1280 : innerWidth,
|
|
1012
1012
|
borderRadius: 8,
|
|
1013
|
-
zIndex:
|
|
1013
|
+
zIndex: 1056
|
|
1014
1014
|
},
|
|
1015
1015
|
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_reactstrap6.DropdownItem, { className: "p-0", style: { borderRadius: "6px" }, tag: "div", header: true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_reactstrap6.Form, { className: "todo-modal", onKeyDown: (e) => formKeyDown(e, handleSubmit(handleOnSubmit)), children: [
|
|
1016
1016
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
@@ -1485,8 +1485,8 @@ var TableEdit = (0, import_react12.forwardRef)((props, ref) => {
|
|
|
1485
1485
|
setContentColumns(arrContentColumns);
|
|
1486
1486
|
}, [columns]);
|
|
1487
1487
|
const getNestedChildren = (array, arrHeaderColumns, arrContentColumns, level, maxLevel) => {
|
|
1488
|
-
array.forEach((item
|
|
1489
|
-
const ele = { ...item, visible: item.invisibleDisable ? item.visible :
|
|
1488
|
+
array.forEach((item) => {
|
|
1489
|
+
const ele = { ...item, visible: item.invisibleDisable ? item.visible : contentColumns[level]?.visible ?? item.visible, rowspan: 1, index: 0 };
|
|
1490
1490
|
if (item.columns && item.columns?.length > 0) {
|
|
1491
1491
|
const countLevel = getNestedChildren(item.columns, arrHeaderColumns, arrContentColumns, level + 1, maxLevel);
|
|
1492
1492
|
arrHeaderColumns[maxLevel - 1 - countLevel].push(ele);
|
|
@@ -2494,12 +2494,12 @@ var TableEdit = (0, import_react12.forwardRef)((props, ref) => {
|
|
|
2494
2494
|
id: indexFocus === indexRow && typeDis !== 1 ? `${idTable}-col${indexCol + 1}-row${indexRow + 1}` : "",
|
|
2495
2495
|
className: (0, import_classnames9.default)("r-rowcell-content", { "is-invalid": errorMessage }),
|
|
2496
2496
|
style: {
|
|
2497
|
-
|
|
2498
|
-
|
|
2497
|
+
padding: typeDis !== 1 && errorMessage ? "6px 10px" : 0,
|
|
2498
|
+
margin: typeDis !== 1 && !errorMessage ? "6px 10px" : 2
|
|
2499
2499
|
},
|
|
2500
2500
|
children: [
|
|
2501
|
-
typeDis === 1 && !refreshRow ? renderEdit(row, col, indexRow, indexCol) : typeDis === 2 ? col.template(row, indexRow) : value,
|
|
2502
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "icon-table", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_ej2_react_popups.TooltipComponent, { className: (0, import_classnames9.default)("cursor-pointer text-primary", { "d-none": !errorMessage }), content: errorMessage, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_becoxy_icons4.AlertCircle, { fontSize: 16.5 }) }) })
|
|
2501
|
+
typeDis === 1 && !refreshRow ? renderEdit(row, col, indexRow, indexCol) : typeDis === 2 ? col.template(row, indexRow) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "r-cell-text", style: { maxWidth: col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth }, children: value }),
|
|
2502
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "icon-table", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_ej2_react_popups.TooltipComponent, { className: (0, import_classnames9.default)("cursor-pointer text-primary", { "d-none": !errorMessage }), content: errorMessage?.toString() ?? "", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_becoxy_icons4.AlertCircle, { fontSize: 16.5 }) }) })
|
|
2503
2503
|
]
|
|
2504
2504
|
}
|
|
2505
2505
|
) })
|
|
@@ -2723,7 +2723,7 @@ var TableEdit = (0, import_react12.forwardRef)((props, ref) => {
|
|
|
2723
2723
|
return renderHeaderCol(col, index, indexParent);
|
|
2724
2724
|
}) }, indexParent);
|
|
2725
2725
|
}) }),
|
|
2726
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("tbody", { className: "r-gridcontent",
|
|
2726
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("tbody", { className: "r-gridcontent", children: dataSource?.map((row, indexRow) => {
|
|
2727
2727
|
const isSelected = selectedRows?.some((x) => x[fieldKey] === row[fieldKey]);
|
|
2728
2728
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2729
2729
|
"tr",
|
package/dist/index.mjs
CHANGED
|
@@ -943,7 +943,7 @@ var EditForm = forwardRef((props, ref) => {
|
|
|
943
943
|
return /* @__PURE__ */ jsx8(
|
|
944
944
|
"div",
|
|
945
945
|
{
|
|
946
|
-
className: "
|
|
946
|
+
className: "form-edit",
|
|
947
947
|
ref,
|
|
948
948
|
id,
|
|
949
949
|
children: /* @__PURE__ */ jsx8("div", { ref: editFormRef, children: /* @__PURE__ */ jsxs7(
|
|
@@ -976,7 +976,7 @@ var EditForm = forwardRef((props, ref) => {
|
|
|
976
976
|
width: menuWidth ? menuWidth : "min-content",
|
|
977
977
|
maxWidth: innerWidth > 1280 ? 1280 : innerWidth,
|
|
978
978
|
borderRadius: 8,
|
|
979
|
-
zIndex:
|
|
979
|
+
zIndex: 1056
|
|
980
980
|
},
|
|
981
981
|
children: /* @__PURE__ */ jsx8(DropdownItem, { className: "p-0", style: { borderRadius: "6px" }, tag: "div", header: true, children: /* @__PURE__ */ jsxs7(Form, { className: "todo-modal", onKeyDown: (e) => formKeyDown(e, handleSubmit(handleOnSubmit)), children: [
|
|
982
982
|
/* @__PURE__ */ jsx8(
|
|
@@ -1459,8 +1459,8 @@ var TableEdit = forwardRef2((props, ref) => {
|
|
|
1459
1459
|
setContentColumns(arrContentColumns);
|
|
1460
1460
|
}, [columns]);
|
|
1461
1461
|
const getNestedChildren = (array, arrHeaderColumns, arrContentColumns, level, maxLevel) => {
|
|
1462
|
-
array.forEach((item
|
|
1463
|
-
const ele = { ...item, visible: item.invisibleDisable ? item.visible :
|
|
1462
|
+
array.forEach((item) => {
|
|
1463
|
+
const ele = { ...item, visible: item.invisibleDisable ? item.visible : contentColumns[level]?.visible ?? item.visible, rowspan: 1, index: 0 };
|
|
1464
1464
|
if (item.columns && item.columns?.length > 0) {
|
|
1465
1465
|
const countLevel = getNestedChildren(item.columns, arrHeaderColumns, arrContentColumns, level + 1, maxLevel);
|
|
1466
1466
|
arrHeaderColumns[maxLevel - 1 - countLevel].push(ele);
|
|
@@ -2468,12 +2468,12 @@ var TableEdit = forwardRef2((props, ref) => {
|
|
|
2468
2468
|
id: indexFocus === indexRow && typeDis !== 1 ? `${idTable}-col${indexCol + 1}-row${indexRow + 1}` : "",
|
|
2469
2469
|
className: classnames5("r-rowcell-content", { "is-invalid": errorMessage }),
|
|
2470
2470
|
style: {
|
|
2471
|
-
|
|
2472
|
-
|
|
2471
|
+
padding: typeDis !== 1 && errorMessage ? "6px 10px" : 0,
|
|
2472
|
+
margin: typeDis !== 1 && !errorMessage ? "6px 10px" : 2
|
|
2473
2473
|
},
|
|
2474
2474
|
children: [
|
|
2475
|
-
typeDis === 1 && !refreshRow ? renderEdit(row, col, indexRow, indexCol) : typeDis === 2 ? col.template(row, indexRow) : value,
|
|
2476
|
-
/* @__PURE__ */ jsx12("span", { className: "icon-table", children: /* @__PURE__ */ jsx12(TooltipComponent, { className: classnames5("cursor-pointer text-primary", { "d-none": !errorMessage }), content: errorMessage, children: /* @__PURE__ */ jsx12(AlertCircle, { fontSize: 16.5 }) }) })
|
|
2475
|
+
typeDis === 1 && !refreshRow ? renderEdit(row, col, indexRow, indexCol) : typeDis === 2 ? col.template(row, indexRow) : /* @__PURE__ */ jsx12("div", { className: "r-cell-text", style: { maxWidth: col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth }, children: value }),
|
|
2476
|
+
/* @__PURE__ */ jsx12("span", { className: "icon-table", children: /* @__PURE__ */ jsx12(TooltipComponent, { className: classnames5("cursor-pointer text-primary", { "d-none": !errorMessage }), content: errorMessage?.toString() ?? "", children: /* @__PURE__ */ jsx12(AlertCircle, { fontSize: 16.5 }) }) })
|
|
2477
2477
|
]
|
|
2478
2478
|
}
|
|
2479
2479
|
) })
|
|
@@ -2697,7 +2697,7 @@ var TableEdit = forwardRef2((props, ref) => {
|
|
|
2697
2697
|
return renderHeaderCol(col, index, indexParent);
|
|
2698
2698
|
}) }, indexParent);
|
|
2699
2699
|
}) }),
|
|
2700
|
-
/* @__PURE__ */ jsx12("tbody", { className: "r-gridcontent",
|
|
2700
|
+
/* @__PURE__ */ jsx12("tbody", { className: "r-gridcontent", children: dataSource?.map((row, indexRow) => {
|
|
2701
2701
|
const isSelected = selectedRows?.some((x) => x[fieldKey] === row[fieldKey]);
|
|
2702
2702
|
return /* @__PURE__ */ jsx12(
|
|
2703
2703
|
"tr",
|