next-recomponents 1.3.3 → 1.3.4

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
@@ -11149,21 +11149,18 @@ function TD(_a) {
11149
11149
  "mapedData",
11150
11150
  "setMapedData"
11151
11151
  ]);
11152
+ var _a2, _b2, _c, _d;
11152
11153
  const [isHidded, setIsHidded] = (0, import_react23.useState)(false);
11153
- const isNode = (0, import_react23.useMemo)(() => {
11154
- var _a2;
11155
- return symbols && typeof symbols[item == null ? void 0 : item.name] == "object" && ((_a2 = symbols[item == null ? void 0 : item.name]) == null ? void 0 : _a2.props);
11156
- }, [symbols]);
11157
- const newProps = symbols && isNode && Object.keys(symbols[item == null ? void 0 : item.name].props).reduce(
11154
+ const newProps = symbols && import_react23.default.isValidElement(symbols[item == null ? void 0 : item.name]) && ((_b2 = Object.keys((_a2 = symbols[item == null ? void 0 : item.name]) == null ? void 0 : _a2.props)) == null ? void 0 : _b2.reduce(
11158
11155
  (acc, i) => {
11159
11156
  try {
11160
11157
  const newAcc = __spreadValues({}, acc);
11161
11158
  const hasEvent = `${i}`.startsWith("on");
11162
11159
  if (hasEvent) {
11163
11160
  newAcc[i] = (e) => {
11164
- var _a2, _b2;
11161
+ var _a3, _b3;
11165
11162
  e.item = item;
11166
- (_b2 = (_a2 = symbols[item == null ? void 0 : item.name].props)[i]) == null ? void 0 : _b2.call(_a2, e);
11163
+ (_b3 = (_a3 = symbols[item == null ? void 0 : item.name].props)[i]) == null ? void 0 : _b3.call(_a3, e);
11167
11164
  };
11168
11165
  }
11169
11166
  return newAcc;
@@ -11171,32 +11168,30 @@ function TD(_a) {
11171
11168
  }
11172
11169
  },
11173
11170
  { defaultValue: item == null ? void 0 : item.content }
11174
- );
11175
- const newProps2 = handlers && Object.keys(handlers[item == null ? void 0 : item.name].props).reduce(
11171
+ ));
11172
+ const newProps2 = handlers && import_react23.default.isValidElement(handlers[item == null ? void 0 : item.name]) && ((_d = Object.keys((_c = handlers[item == null ? void 0 : item.name]) == null ? void 0 : _c.props)) == null ? void 0 : _d.reduce(
11176
11173
  (acc, i) => {
11177
11174
  try {
11178
11175
  const newAcc = __spreadValues({}, acc);
11179
11176
  const hasEvent = `${i}`.startsWith("on");
11180
11177
  if (hasEvent) {
11181
11178
  newAcc[i] = (e) => {
11182
- var _a2, _b2;
11179
+ var _a3, _b3;
11183
11180
  e.item = item;
11184
- (_b2 = (_a2 = handlers[item == null ? void 0 : item.name].props)[i]) == null ? void 0 : _b2.call(_a2, e);
11181
+ (_b3 = (_a3 = handlers[item == null ? void 0 : item.name].props)[i]) == null ? void 0 : _b3.call(_a3, e);
11185
11182
  if (i == "onChange") {
11186
11183
  const newData = [...mapedData];
11187
11184
  newData[index][item == null ? void 0 : item.name].content = e.target.value;
11188
11185
  setMapedData == null ? void 0 : setMapedData(newData);
11189
11186
  }
11190
11187
  };
11191
- } else if (i == "value") {
11192
- newAcc[i] = item == null ? void 0 : item.content;
11193
11188
  }
11194
11189
  return newAcc;
11195
11190
  } catch (error) {
11196
11191
  }
11197
11192
  },
11198
- { defaultValue: item == null ? void 0 : item.content }
11199
- );
11193
+ { value: item == null ? void 0 : item.content }
11194
+ ));
11200
11195
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
11201
11196
  "td",
11202
11197
  {
package/dist/index.mjs CHANGED
@@ -11117,7 +11117,7 @@ import { useState as useState7 } from "react";
11117
11117
  import React4, { useEffect as useEffect7, useMemo as useMemo7, useRef as useRef4, useState as useState6 } from "react";
11118
11118
 
11119
11119
  // src/table/td.tsx
11120
- import React3, { useMemo as useMemo6, useState as useState4 } from "react";
11120
+ import React3, { useState as useState4 } from "react";
11121
11121
  import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
11122
11122
  function TD(_a) {
11123
11123
  var _b = _a, {
@@ -11139,21 +11139,18 @@ function TD(_a) {
11139
11139
  "mapedData",
11140
11140
  "setMapedData"
11141
11141
  ]);
11142
+ var _a2, _b2, _c, _d;
11142
11143
  const [isHidded, setIsHidded] = useState4(false);
11143
- const isNode = useMemo6(() => {
11144
- var _a2;
11145
- return symbols && typeof symbols[item == null ? void 0 : item.name] == "object" && ((_a2 = symbols[item == null ? void 0 : item.name]) == null ? void 0 : _a2.props);
11146
- }, [symbols]);
11147
- const newProps = symbols && isNode && Object.keys(symbols[item == null ? void 0 : item.name].props).reduce(
11144
+ const newProps = symbols && React3.isValidElement(symbols[item == null ? void 0 : item.name]) && ((_b2 = Object.keys((_a2 = symbols[item == null ? void 0 : item.name]) == null ? void 0 : _a2.props)) == null ? void 0 : _b2.reduce(
11148
11145
  (acc, i) => {
11149
11146
  try {
11150
11147
  const newAcc = __spreadValues({}, acc);
11151
11148
  const hasEvent = `${i}`.startsWith("on");
11152
11149
  if (hasEvent) {
11153
11150
  newAcc[i] = (e) => {
11154
- var _a2, _b2;
11151
+ var _a3, _b3;
11155
11152
  e.item = item;
11156
- (_b2 = (_a2 = symbols[item == null ? void 0 : item.name].props)[i]) == null ? void 0 : _b2.call(_a2, e);
11153
+ (_b3 = (_a3 = symbols[item == null ? void 0 : item.name].props)[i]) == null ? void 0 : _b3.call(_a3, e);
11157
11154
  };
11158
11155
  }
11159
11156
  return newAcc;
@@ -11161,32 +11158,30 @@ function TD(_a) {
11161
11158
  }
11162
11159
  },
11163
11160
  { defaultValue: item == null ? void 0 : item.content }
11164
- );
11165
- const newProps2 = handlers && Object.keys(handlers[item == null ? void 0 : item.name].props).reduce(
11161
+ ));
11162
+ const newProps2 = handlers && React3.isValidElement(handlers[item == null ? void 0 : item.name]) && ((_d = Object.keys((_c = handlers[item == null ? void 0 : item.name]) == null ? void 0 : _c.props)) == null ? void 0 : _d.reduce(
11166
11163
  (acc, i) => {
11167
11164
  try {
11168
11165
  const newAcc = __spreadValues({}, acc);
11169
11166
  const hasEvent = `${i}`.startsWith("on");
11170
11167
  if (hasEvent) {
11171
11168
  newAcc[i] = (e) => {
11172
- var _a2, _b2;
11169
+ var _a3, _b3;
11173
11170
  e.item = item;
11174
- (_b2 = (_a2 = handlers[item == null ? void 0 : item.name].props)[i]) == null ? void 0 : _b2.call(_a2, e);
11171
+ (_b3 = (_a3 = handlers[item == null ? void 0 : item.name].props)[i]) == null ? void 0 : _b3.call(_a3, e);
11175
11172
  if (i == "onChange") {
11176
11173
  const newData = [...mapedData];
11177
11174
  newData[index][item == null ? void 0 : item.name].content = e.target.value;
11178
11175
  setMapedData == null ? void 0 : setMapedData(newData);
11179
11176
  }
11180
11177
  };
11181
- } else if (i == "value") {
11182
- newAcc[i] = item == null ? void 0 : item.content;
11183
11178
  }
11184
11179
  return newAcc;
11185
11180
  } catch (error) {
11186
11181
  }
11187
11182
  },
11188
- { defaultValue: item == null ? void 0 : item.content }
11189
- );
11183
+ { value: item == null ? void 0 : item.content }
11184
+ ));
11190
11185
  return /* @__PURE__ */ jsx8(
11191
11186
  "td",
11192
11187
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-recomponents",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/table/td.tsx CHANGED
@@ -31,17 +31,11 @@ export default function TD({
31
31
  ...props
32
32
  }: TDProps) {
33
33
  const [isHidded, setIsHidded] = useState(false);
34
- const isNode = useMemo(() => {
35
- return (
36
- symbols &&
37
- typeof symbols[item?.name] == "object" &&
38
- symbols[item?.name]?.props
39
- );
40
- }, [symbols]);
34
+
41
35
  const newProps =
42
36
  symbols &&
43
- isNode &&
44
- Object.keys(symbols[item?.name].props).reduce(
37
+ React.isValidElement(symbols[item?.name]) &&
38
+ Object.keys(symbols[item?.name]?.props)?.reduce(
45
39
  (acc: any, i) => {
46
40
  try {
47
41
  const newAcc = { ...acc };
@@ -60,7 +54,8 @@ export default function TD({
60
54
 
61
55
  const newProps2 =
62
56
  handlers &&
63
- Object.keys(handlers[item?.name].props).reduce(
57
+ React.isValidElement(handlers[item?.name]) &&
58
+ Object.keys(handlers[item?.name]?.props)?.reduce(
64
59
  (acc: any, i) => {
65
60
  try {
66
61
  const newAcc = { ...acc };
@@ -75,13 +70,11 @@ export default function TD({
75
70
  setMapedData?.(newData);
76
71
  }
77
72
  };
78
- } else if (i == "value") {
79
- newAcc[i] = item?.content;
80
73
  }
81
74
  return newAcc;
82
75
  } catch (error) {}
83
76
  },
84
- { defaultValue: item?.content }
77
+ { value: item?.content }
85
78
  );
86
79
  return (
87
80
  <td