react-table-edit 0.2.5 → 0.2.7

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.d.mts CHANGED
@@ -47,6 +47,7 @@ type IColumnTable = {
47
47
  isPrimarykey?: boolean;
48
48
  isUnikey?: boolean;
49
49
  haveSum?: boolean;
50
+ haveToolTip?: boolean;
50
51
  validate?: any;
51
52
  disabledCondition?: any;
52
53
  callback?: any;
package/dist/index.d.ts CHANGED
@@ -47,6 +47,7 @@ type IColumnTable = {
47
47
  isPrimarykey?: boolean;
48
48
  isUnikey?: boolean;
49
49
  haveSum?: boolean;
50
+ haveToolTip?: boolean;
50
51
  validate?: any;
51
52
  disabledCondition?: any;
52
53
  callback?: any;
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,31 +2509,22 @@ 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
+ margin: typeDis === 1 ? 2 : !errorMessage ? "7px 9px" : 2
2513
2513
  },
2514
2514
  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)(
2515
+ typeDis === 1 && !refreshRow ? renderEdit(row, col, indexRow, indexCol) : !col.haveToolTip ? /* @__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
2516
  import_ej2_react_popups.TooltipComponent,
2526
2517
  {
2527
2518
  content: typeDis === 2 ? col.template(row, indexRow)?.toString() : value,
2528
2519
  className: "r-cell-text",
2529
2520
  style: {
2530
- maxWidth: col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto"
2521
+ display: "block",
2522
+ maxWidth: (col.editType ?? "text") === "text" ? col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto" : "auto"
2531
2523
  },
2532
2524
  children: typeDis === 2 ? col.template(row, indexRow) : value
2533
2525
  }
2534
2526
  ),
2535
- /* @__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 }) }) })
2527
+ /* @__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: 15.5 }) }) })
2536
2528
  ]
2537
2529
  }
2538
2530
  )
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,31 +2483,22 @@ 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
+ margin: typeDis === 1 ? 2 : !errorMessage ? "7px 9px" : 2
2487
2487
  },
2488
2488
  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(
2489
+ typeDis === 1 && !refreshRow ? renderEdit(row, col, indexRow, indexCol) : !col.haveToolTip ? /* @__PURE__ */ jsx12("div", { className: "r-cell-text", children: typeDis === 2 ? col.template(row, indexRow) : value }) : /* @__PURE__ */ jsx12(
2499
2490
  TooltipComponent,
2500
2491
  {
2501
2492
  content: typeDis === 2 ? col.template(row, indexRow)?.toString() : value,
2502
2493
  className: "r-cell-text",
2503
2494
  style: {
2504
- maxWidth: col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto"
2495
+ display: "block",
2496
+ maxWidth: (col.editType ?? "text") === "text" ? col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto" : "auto"
2505
2497
  },
2506
2498
  children: typeDis === 2 ? col.template(row, indexRow) : value
2507
2499
  }
2508
2500
  ),
2509
- /* @__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 }) }) })
2501
+ /* @__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: 15.5 }) }) })
2510
2502
  ]
2511
2503
  }
2512
2504
  )
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.7",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",