next-recomponents 1.4.3 → 1.4.5

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
@@ -11184,11 +11184,12 @@ function TD(_a) {
11184
11184
  }) }),
11185
11185
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: (item == null ? void 0 : item.handler) ? import_react23.default.Children.map(item.handler, (handler) => {
11186
11186
  if (import_react23.default.isValidElement(handler)) {
11187
- return import_react23.default.cloneElement(handler, {
11188
- defaultValue: null,
11187
+ const { type, props: props2 } = handler;
11188
+ const _a3 = props2, { defaultValue } = _a3, otherProps = __objRest(_a3, ["defaultValue"]);
11189
+ return import_react23.default.createElement(type, __spreadProps(__spreadValues({}, otherProps), {
11189
11190
  value: mapedData[index][item.name].content,
11190
11191
  onChange: (e) => {
11191
- var _a3, _b3;
11192
+ var _a4, _b3;
11192
11193
  const nmd = [...mapedData];
11193
11194
  nmd[index][item.name].content = e.target.value;
11194
11195
  e.item = Object.assign(
@@ -11205,9 +11206,9 @@ function TD(_a) {
11205
11206
  setMapedData == null ? void 0 : setMapedData(nmd2);
11206
11207
  };
11207
11208
  setMapedData == null ? void 0 : setMapedData(nmd);
11208
- (_b3 = (_a3 = handler == null ? void 0 : handler.props) == null ? void 0 : _a3.onChange) == null ? void 0 : _b3.call(_a3, e);
11209
+ (_b3 = (_a4 = handler == null ? void 0 : handler.props) == null ? void 0 : _a4.onChange) == null ? void 0 : _b3.call(_a4, e);
11209
11210
  }
11210
- });
11211
+ }));
11211
11212
  }
11212
11213
  return handler;
11213
11214
  }) : item == null ? void 0 : item.content })
package/dist/index.mjs CHANGED
@@ -11173,11 +11173,12 @@ function TD(_a) {
11173
11173
  }) }),
11174
11174
  /* @__PURE__ */ jsx8("div", { children: (item == null ? void 0 : item.handler) ? React3.Children.map(item.handler, (handler) => {
11175
11175
  if (React3.isValidElement(handler)) {
11176
- return React3.cloneElement(handler, {
11177
- defaultValue: null,
11176
+ const { type, props: props2 } = handler;
11177
+ const _a3 = props2, { defaultValue } = _a3, otherProps = __objRest(_a3, ["defaultValue"]);
11178
+ return React3.createElement(type, __spreadProps(__spreadValues({}, otherProps), {
11178
11179
  value: mapedData[index][item.name].content,
11179
11180
  onChange: (e) => {
11180
- var _a3, _b3;
11181
+ var _a4, _b3;
11181
11182
  const nmd = [...mapedData];
11182
11183
  nmd[index][item.name].content = e.target.value;
11183
11184
  e.item = Object.assign(
@@ -11194,9 +11195,9 @@ function TD(_a) {
11194
11195
  setMapedData == null ? void 0 : setMapedData(nmd2);
11195
11196
  };
11196
11197
  setMapedData == null ? void 0 : setMapedData(nmd);
11197
- (_b3 = (_a3 = handler == null ? void 0 : handler.props) == null ? void 0 : _a3.onChange) == null ? void 0 : _b3.call(_a3, e);
11198
+ (_b3 = (_a4 = handler == null ? void 0 : handler.props) == null ? void 0 : _a4.onChange) == null ? void 0 : _b3.call(_a4, e);
11198
11199
  }
11199
- });
11200
+ }));
11200
11201
  }
11201
11202
  return handler;
11202
11203
  }) : item == null ? void 0 : item.content })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-recomponents",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/table/td.tsx CHANGED
@@ -77,8 +77,11 @@ export default function TD({
77
77
  {item?.handler
78
78
  ? React.Children.map(item.handler, (handler) => {
79
79
  if (React.isValidElement(handler)) {
80
- return React.cloneElement(handler as any, {
81
- defaultValue: null,
80
+ const { type, props } = handler;
81
+ const { defaultValue, ...otherProps } = props;
82
+
83
+ return React.createElement(type, {
84
+ ...otherProps,
82
85
  value: mapedData[index][item.name].content,
83
86
  onChange: (e: any) => {
84
87
  const nmd = [...mapedData];