react-table-edit 0.2.5 → 0.2.6

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
@@ -1574,6 +1574,7 @@ var TableEdit = (0, import_react12.forwardRef)((props, ref) => {
1574
1574
  const handleKeyPress = (e) => {
1575
1575
  if (e.code === "Enter" || e.code === "NumpadEnter") {
1576
1576
  setSearchTerm(e.target.value);
1577
+ e.stopPropagation();
1577
1578
  }
1578
1579
  };
1579
1580
  const searchTemplate = () => {
@@ -2508,26 +2509,18 @@ var TableEdit = (0, import_react12.forwardRef)((props, ref) => {
2508
2509
  id: indexFocus === indexRow && typeDis !== 1 ? `${idTable}-col${indexCol + 1}-row${indexRow + 1}` : "",
2509
2510
  className: (0, import_classnames9.default)("r-rowcell-content", { "r-is-invalid": errorMessage }),
2510
2511
  style: {
2511
- padding: typeDis !== 1 && errorMessage ? "6px 10px" : 0,
2512
- margin: typeDis !== 1 && !errorMessage ? "6px 10px" : 2
2512
+ padding: typeDis === 1 ? 2 : !errorMessage ? "6px 10px" : 0,
2513
+ width: typeDis === 1 ? "calc(100% - 4px)" : !errorMessage ? "calc(100% - 20px)" : "0"
2513
2514
  },
2514
2515
  children: [
2515
- typeDis === 1 && !refreshRow ? renderEdit(row, col, indexRow, indexCol) : col.editType === "numeric" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2516
- "div",
2517
- {
2518
- className: "r-cell-text",
2519
- style: {
2520
- maxWidth: col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto"
2521
- },
2522
- children: typeDis === 2 ? col.template(row, indexRow) : value
2523
- }
2524
- ) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2516
+ typeDis === 1 && !refreshRow ? renderEdit(row, col, indexRow, indexCol) : col.editType === "numeric" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "r-cell-text", children: typeDis === 2 ? col.template(row, indexRow) : value }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2525
2517
  import_ej2_react_popups.TooltipComponent,
2526
2518
  {
2527
2519
  content: typeDis === 2 ? col.template(row, indexRow)?.toString() : value,
2528
2520
  className: "r-cell-text",
2529
2521
  style: {
2530
- maxWidth: col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto"
2522
+ display: "block",
2523
+ maxWidth: (col.editType ?? "text") === "text" ? col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto" : "auto"
2531
2524
  },
2532
2525
  children: typeDis === 2 ? col.template(row, indexRow) : value
2533
2526
  }
package/dist/index.mjs CHANGED
@@ -1548,6 +1548,7 @@ var TableEdit = forwardRef2((props, ref) => {
1548
1548
  const handleKeyPress = (e) => {
1549
1549
  if (e.code === "Enter" || e.code === "NumpadEnter") {
1550
1550
  setSearchTerm(e.target.value);
1551
+ e.stopPropagation();
1551
1552
  }
1552
1553
  };
1553
1554
  const searchTemplate = () => {
@@ -2482,26 +2483,18 @@ var TableEdit = forwardRef2((props, ref) => {
2482
2483
  id: indexFocus === indexRow && typeDis !== 1 ? `${idTable}-col${indexCol + 1}-row${indexRow + 1}` : "",
2483
2484
  className: classnames5("r-rowcell-content", { "r-is-invalid": errorMessage }),
2484
2485
  style: {
2485
- padding: typeDis !== 1 && errorMessage ? "6px 10px" : 0,
2486
- margin: typeDis !== 1 && !errorMessage ? "6px 10px" : 2
2486
+ padding: typeDis === 1 ? 2 : !errorMessage ? "6px 10px" : 0,
2487
+ width: typeDis === 1 ? "calc(100% - 4px)" : !errorMessage ? "calc(100% - 20px)" : "0"
2487
2488
  },
2488
2489
  children: [
2489
- typeDis === 1 && !refreshRow ? renderEdit(row, col, indexRow, indexCol) : col.editType === "numeric" ? /* @__PURE__ */ jsx12(
2490
- "div",
2491
- {
2492
- className: "r-cell-text",
2493
- style: {
2494
- maxWidth: col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto"
2495
- },
2496
- children: typeDis === 2 ? col.template(row, indexRow) : value
2497
- }
2498
- ) : /* @__PURE__ */ jsx12(
2490
+ typeDis === 1 && !refreshRow ? renderEdit(row, col, indexRow, indexCol) : col.editType === "numeric" ? /* @__PURE__ */ jsx12("div", { className: "r-cell-text", children: typeDis === 2 ? col.template(row, indexRow) : value }) : /* @__PURE__ */ jsx12(
2499
2491
  TooltipComponent,
2500
2492
  {
2501
2493
  content: typeDis === 2 ? col.template(row, indexRow)?.toString() : value,
2502
2494
  className: "r-cell-text",
2503
2495
  style: {
2504
- maxWidth: col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto"
2496
+ display: "block",
2497
+ maxWidth: (col.editType ?? "text") === "text" ? col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto" : "auto"
2505
2498
  },
2506
2499
  children: typeDis === 2 ? col.template(row, indexRow) : value
2507
2500
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-table-edit",
3
3
  "license": "MIT",
4
- "version": "0.2.5",
4
+ "version": "0.2.6",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",