next-recomponents 1.2.3 → 1.2.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 +9 -9
- package/dist/index.mjs +9 -9
- package/package.json +1 -1
- package/src/table/td.tsx +12 -12
package/dist/index.js
CHANGED
|
@@ -11148,9 +11148,9 @@ function TD(_a) {
|
|
|
11148
11148
|
const [isHidded, setIsHidded] = (0, import_react23.useState)(false);
|
|
11149
11149
|
const isNode = (0, import_react23.useMemo)(() => {
|
|
11150
11150
|
var _a2;
|
|
11151
|
-
return symbols && typeof symbols[item.name] == "object" && ((_a2 = symbols[item.name]) == null ? void 0 : _a2.props);
|
|
11151
|
+
return symbols && typeof symbols[item == null ? void 0 : item.name] == "object" && ((_a2 = symbols[item == null ? void 0 : item.name]) == null ? void 0 : _a2.props);
|
|
11152
11152
|
}, [symbols]);
|
|
11153
|
-
const newProps = symbols && isNode && Object.keys(symbols[item.name].props).reduce(
|
|
11153
|
+
const newProps = symbols && isNode && Object.keys(symbols[item == null ? void 0 : item.name].props).reduce(
|
|
11154
11154
|
(acc, i) => {
|
|
11155
11155
|
try {
|
|
11156
11156
|
const newAcc = __spreadValues({}, acc);
|
|
@@ -11159,29 +11159,29 @@ function TD(_a) {
|
|
|
11159
11159
|
newAcc[i] = (e) => {
|
|
11160
11160
|
var _a2, _b2;
|
|
11161
11161
|
e.item = item;
|
|
11162
|
-
(_b2 = (_a2 = symbols[item.name].props)[i]) == null ? void 0 : _b2.call(_a2, e);
|
|
11162
|
+
(_b2 = (_a2 = symbols[item == null ? void 0 : item.name].props)[i]) == null ? void 0 : _b2.call(_a2, e);
|
|
11163
11163
|
};
|
|
11164
11164
|
}
|
|
11165
11165
|
return newAcc;
|
|
11166
11166
|
} catch (error) {
|
|
11167
11167
|
}
|
|
11168
11168
|
},
|
|
11169
|
-
{ defaultValue: item.content }
|
|
11169
|
+
{ defaultValue: item == null ? void 0 : item.content }
|
|
11170
11170
|
);
|
|
11171
11171
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
11172
11172
|
"td",
|
|
11173
11173
|
{
|
|
11174
11174
|
onDoubleClick: (e) => setIsHidded(!isHidded),
|
|
11175
|
-
title: item.title,
|
|
11175
|
+
title: item == null ? void 0 : item.title,
|
|
11176
11176
|
className: [
|
|
11177
11177
|
isHidded && color2,
|
|
11178
11178
|
!isHidded && "whitespace-nowrap overflow-hidden text-ellipsis ",
|
|
11179
11179
|
"border-b max-w-[200px] p-5 ",
|
|
11180
|
-
["number", "money"].includes(item.cellTypeOf) && "text-right"
|
|
11180
|
+
["number", "money"].includes(item == null ? void 0 : item.cellTypeOf) && "text-right"
|
|
11181
11181
|
].join(" "),
|
|
11182
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: symbols && symbols[item.name] && "flex justify-between", children: [
|
|
11183
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: symbols && symbols[item.name] && (isNode ? import_react23.default.cloneElement(symbols[item.name], __spreadValues({}, newProps)) : symbols[item.name]) }),
|
|
11184
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: item.content })
|
|
11182
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: symbols && symbols[item == null ? void 0 : item.name] && "flex justify-between", children: [
|
|
11183
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: symbols && symbols[item == null ? void 0 : item.name] && (isNode ? import_react23.default.cloneElement(symbols[item == null ? void 0 : item.name], __spreadValues({}, newProps)) : symbols[item == null ? void 0 : item.name]) }),
|
|
11184
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: item == null ? void 0 : item.content })
|
|
11185
11185
|
] })
|
|
11186
11186
|
}
|
|
11187
11187
|
);
|
package/dist/index.mjs
CHANGED
|
@@ -11139,9 +11139,9 @@ function TD(_a) {
|
|
|
11139
11139
|
const [isHidded, setIsHidded] = useState4(false);
|
|
11140
11140
|
const isNode = useMemo6(() => {
|
|
11141
11141
|
var _a2;
|
|
11142
|
-
return symbols && typeof symbols[item.name] == "object" && ((_a2 = symbols[item.name]) == null ? void 0 : _a2.props);
|
|
11142
|
+
return symbols && typeof symbols[item == null ? void 0 : item.name] == "object" && ((_a2 = symbols[item == null ? void 0 : item.name]) == null ? void 0 : _a2.props);
|
|
11143
11143
|
}, [symbols]);
|
|
11144
|
-
const newProps = symbols && isNode && Object.keys(symbols[item.name].props).reduce(
|
|
11144
|
+
const newProps = symbols && isNode && Object.keys(symbols[item == null ? void 0 : item.name].props).reduce(
|
|
11145
11145
|
(acc, i) => {
|
|
11146
11146
|
try {
|
|
11147
11147
|
const newAcc = __spreadValues({}, acc);
|
|
@@ -11150,29 +11150,29 @@ function TD(_a) {
|
|
|
11150
11150
|
newAcc[i] = (e) => {
|
|
11151
11151
|
var _a2, _b2;
|
|
11152
11152
|
e.item = item;
|
|
11153
|
-
(_b2 = (_a2 = symbols[item.name].props)[i]) == null ? void 0 : _b2.call(_a2, e);
|
|
11153
|
+
(_b2 = (_a2 = symbols[item == null ? void 0 : item.name].props)[i]) == null ? void 0 : _b2.call(_a2, e);
|
|
11154
11154
|
};
|
|
11155
11155
|
}
|
|
11156
11156
|
return newAcc;
|
|
11157
11157
|
} catch (error) {
|
|
11158
11158
|
}
|
|
11159
11159
|
},
|
|
11160
|
-
{ defaultValue: item.content }
|
|
11160
|
+
{ defaultValue: item == null ? void 0 : item.content }
|
|
11161
11161
|
);
|
|
11162
11162
|
return /* @__PURE__ */ jsx8(
|
|
11163
11163
|
"td",
|
|
11164
11164
|
{
|
|
11165
11165
|
onDoubleClick: (e) => setIsHidded(!isHidded),
|
|
11166
|
-
title: item.title,
|
|
11166
|
+
title: item == null ? void 0 : item.title,
|
|
11167
11167
|
className: [
|
|
11168
11168
|
isHidded && color2,
|
|
11169
11169
|
!isHidded && "whitespace-nowrap overflow-hidden text-ellipsis ",
|
|
11170
11170
|
"border-b max-w-[200px] p-5 ",
|
|
11171
|
-
["number", "money"].includes(item.cellTypeOf) && "text-right"
|
|
11171
|
+
["number", "money"].includes(item == null ? void 0 : item.cellTypeOf) && "text-right"
|
|
11172
11172
|
].join(" "),
|
|
11173
|
-
children: /* @__PURE__ */ jsxs6("div", { className: symbols && symbols[item.name] && "flex justify-between", children: [
|
|
11174
|
-
/* @__PURE__ */ jsx8("div", { children: symbols && symbols[item.name] && (isNode ? React3.cloneElement(symbols[item.name], __spreadValues({}, newProps)) : symbols[item.name]) }),
|
|
11175
|
-
/* @__PURE__ */ jsx8("div", { children: item.content })
|
|
11173
|
+
children: /* @__PURE__ */ jsxs6("div", { className: symbols && symbols[item == null ? void 0 : item.name] && "flex justify-between", children: [
|
|
11174
|
+
/* @__PURE__ */ jsx8("div", { children: symbols && symbols[item == null ? void 0 : item.name] && (isNode ? React3.cloneElement(symbols[item == null ? void 0 : item.name], __spreadValues({}, newProps)) : symbols[item == null ? void 0 : item.name]) }),
|
|
11175
|
+
/* @__PURE__ */ jsx8("div", { children: item == null ? void 0 : item.content })
|
|
11176
11176
|
] })
|
|
11177
11177
|
}
|
|
11178
11178
|
);
|
package/package.json
CHANGED
package/src/table/td.tsx
CHANGED
|
@@ -23,14 +23,14 @@ export default function TD({
|
|
|
23
23
|
const isNode = useMemo(() => {
|
|
24
24
|
return (
|
|
25
25
|
symbols &&
|
|
26
|
-
typeof symbols[item
|
|
27
|
-
symbols[item
|
|
26
|
+
typeof symbols[item?.name] == "object" &&
|
|
27
|
+
symbols[item?.name]?.props
|
|
28
28
|
);
|
|
29
29
|
}, [symbols]);
|
|
30
30
|
const newProps =
|
|
31
31
|
symbols &&
|
|
32
32
|
isNode &&
|
|
33
|
-
Object.keys(symbols[item
|
|
33
|
+
Object.keys(symbols[item?.name].props).reduce(
|
|
34
34
|
(acc: any, i) => {
|
|
35
35
|
try {
|
|
36
36
|
const newAcc = { ...acc };
|
|
@@ -38,36 +38,36 @@ export default function TD({
|
|
|
38
38
|
if (hasEvent) {
|
|
39
39
|
newAcc[i] = (e: any) => {
|
|
40
40
|
e.item = item;
|
|
41
|
-
symbols[item
|
|
41
|
+
symbols[item?.name].props[i]?.(e);
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
return newAcc;
|
|
45
45
|
} catch (error) {}
|
|
46
46
|
},
|
|
47
|
-
{ defaultValue: item
|
|
47
|
+
{ defaultValue: item?.content }
|
|
48
48
|
);
|
|
49
49
|
return (
|
|
50
50
|
<td
|
|
51
51
|
onDoubleClick={(e) => setIsHidded(!isHidded)}
|
|
52
|
-
title={item
|
|
52
|
+
title={item?.title}
|
|
53
53
|
className={[
|
|
54
54
|
isHidded && color,
|
|
55
55
|
!isHidded && "whitespace-nowrap overflow-hidden text-ellipsis ",
|
|
56
56
|
"border-b max-w-[200px] p-5 ",
|
|
57
|
-
["number", "money"].includes(item
|
|
57
|
+
["number", "money"].includes(item?.cellTypeOf) && "text-right",
|
|
58
58
|
].join(" ")}
|
|
59
59
|
>
|
|
60
|
-
<div className={symbols && symbols[item
|
|
60
|
+
<div className={symbols && symbols[item?.name] && "flex justify-between"}>
|
|
61
61
|
<div>
|
|
62
62
|
{symbols &&
|
|
63
|
-
symbols[item
|
|
63
|
+
symbols[item?.name] &&
|
|
64
64
|
(isNode
|
|
65
|
-
? React.cloneElement(symbols[item
|
|
65
|
+
? React.cloneElement(symbols[item?.name], {
|
|
66
66
|
...newProps,
|
|
67
67
|
})
|
|
68
|
-
: symbols[item
|
|
68
|
+
: symbols[item?.name])}
|
|
69
69
|
</div>
|
|
70
|
-
<div>{item
|
|
70
|
+
<div>{item?.content}</div>
|
|
71
71
|
</div>
|
|
72
72
|
</td>
|
|
73
73
|
);
|