react-table-edit 1.1.4 → 1.1.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
@@ -982,7 +982,7 @@ var SelectTable = (0, import_react6.forwardRef)((props, ref) => {
982
982
  let countDisplay = 0;
983
983
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
984
984
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("table", { style: { width: "100%" }, children: [
985
- !noHeader && (columns?.length ?? 0) > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("thead", { className: "r-select-gridheader", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("tr", { className: "r-select-row", role: "row", children: [
985
+ !(noHeader || (columns?.length ?? 0) === 0) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("thead", { className: "r-select-gridheader", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("tr", { className: "r-select-row", role: "row", children: [
986
986
  isMulti && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("th", { className: (0, import_classnames4.default)(`r-select-headercell`), style: { width: 40, top: `0px` }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
987
987
  "div",
988
988
  {
@@ -1143,7 +1143,7 @@ var SelectTable = (0, import_react6.forwardRef)((props, ref) => {
1143
1143
  }
1144
1144
  },
1145
1145
  children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "r-select-grid", children: [
1146
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_classnames4.default)("r-select-gridtable", { "no-header": noHeader && (columns?.length ?? 0) === 0 }), ref: selectMenuTableRef, style: { width: menuWidth, minWidth: selectTableRef?.current?.clientWidth, maxHeight: maxHeight ?? defaultMaxHeight }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RenderTable, {}) }),
1146
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_classnames4.default)("r-select-gridtable", { "no-header": noHeader || (columns?.length ?? 0) === 0 }), ref: selectMenuTableRef, style: { width: menuWidth, minWidth: selectTableRef?.current?.clientWidth, maxHeight: maxHeight ?? defaultMaxHeight }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RenderTable, {}) }),
1147
1147
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_classnames4.default)("r-select-footer", { "d-none": !(showFooter === true || handleAdd) }), children: [
1148
1148
  /* @__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: [
1149
1149
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_becoxy_icons2.Plus, { className: "me-50", fontSize: 16 }),
@@ -2627,7 +2627,7 @@ var SelectTableTree = (0, import_react15.forwardRef)((props, ref) => {
2627
2627
  let countDisplay = 0;
2628
2628
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
2629
2629
  /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("table", { style: { width: "100%" }, children: [
2630
- !noHeader && (columns?.length ?? 0) > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("thead", { className: "r-select-gridheader", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("tr", { className: "r-select-row", role: "row", children: [
2630
+ !(noHeader && (columns?.length ?? 0) > 0) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("thead", { className: "r-select-gridheader", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("tr", { className: "r-select-row", role: "row", children: [
2631
2631
  isMulti && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2632
2632
  "th",
2633
2633
  {
@@ -3273,8 +3273,6 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3273
3273
  className: (0, import_classnames14.default)("form-control border-0 rounded-0 input-numeric", { "is-invalid": col.validate && col.validate(row[col.field], row) }),
3274
3274
  onValueChange: (values) => {
3275
3275
  floatValue = values?.floatValue;
3276
- const textBeforeDot = values?.value.split(".")[1];
3277
- row[col.field] = textBeforeDot ? parseFloat(values?.value).toFixed(textBeforeDot.length) : values?.floatValue;
3278
3276
  },
3279
3277
  onFocus: (e) => {
3280
3278
  e.target.setSelectionRange(0, e.target.innerText.length - 1);
package/dist/index.mjs CHANGED
@@ -943,7 +943,7 @@ var SelectTable = forwardRef((props, ref) => {
943
943
  let countDisplay = 0;
944
944
  return /* @__PURE__ */ jsxs5(Fragment6, { children: [
945
945
  /* @__PURE__ */ jsxs5("table", { style: { width: "100%" }, children: [
946
- !noHeader && (columns?.length ?? 0) > 0 && /* @__PURE__ */ jsx5("thead", { className: "r-select-gridheader", children: /* @__PURE__ */ jsxs5("tr", { className: "r-select-row", role: "row", children: [
946
+ !(noHeader || (columns?.length ?? 0) === 0) && /* @__PURE__ */ jsx5("thead", { className: "r-select-gridheader", children: /* @__PURE__ */ jsxs5("tr", { className: "r-select-row", role: "row", children: [
947
947
  isMulti && /* @__PURE__ */ jsx5("th", { className: classnames3(`r-select-headercell`), style: { width: 40, top: `0px` }, children: /* @__PURE__ */ jsx5(
948
948
  "div",
949
949
  {
@@ -1104,7 +1104,7 @@ var SelectTable = forwardRef((props, ref) => {
1104
1104
  }
1105
1105
  },
1106
1106
  children: /* @__PURE__ */ jsxs5("div", { className: "r-select-grid", children: [
1107
- /* @__PURE__ */ jsx5("div", { className: classnames3("r-select-gridtable", { "no-header": noHeader && (columns?.length ?? 0) === 0 }), ref: selectMenuTableRef, style: { width: menuWidth, minWidth: selectTableRef?.current?.clientWidth, maxHeight: maxHeight ?? defaultMaxHeight }, children: /* @__PURE__ */ jsx5(RenderTable, {}) }),
1107
+ /* @__PURE__ */ jsx5("div", { className: classnames3("r-select-gridtable", { "no-header": noHeader || (columns?.length ?? 0) === 0 }), ref: selectMenuTableRef, style: { width: menuWidth, minWidth: selectTableRef?.current?.clientWidth, maxHeight: maxHeight ?? defaultMaxHeight }, children: /* @__PURE__ */ jsx5(RenderTable, {}) }),
1108
1108
  /* @__PURE__ */ jsxs5("div", { className: classnames3("r-select-footer", { "d-none": !(showFooter === true || handleAdd) }), children: [
1109
1109
  /* @__PURE__ */ jsxs5(Button, { outline: true, color: "primary", onClick: handleAdd, className: classnames3("r-btn d-flex align-items-center", { "d-none": !handleAdd }), children: [
1110
1110
  /* @__PURE__ */ jsx5(Plus, { className: "me-50", fontSize: 16 }),
@@ -2596,7 +2596,7 @@ var SelectTableTree = forwardRef3((props, ref) => {
2596
2596
  let countDisplay = 0;
2597
2597
  return /* @__PURE__ */ jsxs14(Fragment19, { children: [
2598
2598
  /* @__PURE__ */ jsxs14("table", { style: { width: "100%" }, children: [
2599
- !noHeader && (columns?.length ?? 0) > 0 && /* @__PURE__ */ jsx15("thead", { className: "r-select-gridheader", children: /* @__PURE__ */ jsxs14("tr", { className: "r-select-row", role: "row", children: [
2599
+ !(noHeader && (columns?.length ?? 0) > 0) && /* @__PURE__ */ jsx15("thead", { className: "r-select-gridheader", children: /* @__PURE__ */ jsxs14("tr", { className: "r-select-row", role: "row", children: [
2600
2600
  isMulti && /* @__PURE__ */ jsx15(
2601
2601
  "th",
2602
2602
  {
@@ -3242,8 +3242,6 @@ var TableEdit = forwardRef4((props, ref) => {
3242
3242
  className: classnames9("form-control border-0 rounded-0 input-numeric", { "is-invalid": col.validate && col.validate(row[col.field], row) }),
3243
3243
  onValueChange: (values) => {
3244
3244
  floatValue = values?.floatValue;
3245
- const textBeforeDot = values?.value.split(".")[1];
3246
- row[col.field] = textBeforeDot ? parseFloat(values?.value).toFixed(textBeforeDot.length) : values?.floatValue;
3247
3245
  },
3248
3246
  onFocus: (e) => {
3249
3247
  e.target.setSelectionRange(0, e.target.innerText.length - 1);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-table-edit",
3
3
  "license": "MIT",
4
- "version": "1.1.4",
4
+ "version": "1.1.6",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",