next-recomponents 1.9.0 → 1.9.2
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 +4 -5
- package/dist/index.mjs +4 -5
- package/package.json +2 -2
- package/src/table/h.tsx +6 -5
package/dist/index.js
CHANGED
|
@@ -44151,21 +44151,20 @@ function HTable(_a) {
|
|
|
44151
44151
|
const newData = data.length > 0 && data.map((d, trkey) => {
|
|
44152
44152
|
var _a2, _b2, _c, _d;
|
|
44153
44153
|
const obj = {};
|
|
44154
|
+
const id3 = (d == null ? void 0 : d.id) || trkey;
|
|
44154
44155
|
for (let key in d) {
|
|
44155
44156
|
const item = {};
|
|
44156
|
-
|
|
44157
|
-
item[key2] = ((_a2 = d[key2]) == null ? void 0 : _a2.content) || d[key2];
|
|
44158
|
-
}
|
|
44157
|
+
item[key] = ((_a2 = d[key]) == null ? void 0 : _a2.content) || d[key];
|
|
44159
44158
|
const typeOf = typeof d[key];
|
|
44160
44159
|
const isObject2 = typeOf == "object";
|
|
44161
44160
|
const regex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
44162
44161
|
const isDate = !isObject2 && regex.test(`${d[key]}`);
|
|
44163
44162
|
const cellTypeOf = isDate ? "date" : isObject2 ? "object" : typeOf;
|
|
44164
|
-
const mapedContent = (_c = (_b2 = mapedData == null ? void 0 : mapedData[
|
|
44163
|
+
const mapedContent = (_c = (_b2 = mapedData == null ? void 0 : mapedData[id3]) == null ? void 0 : _b2[key]) == null ? void 0 : _c.content;
|
|
44165
44164
|
const content = mapedContent || (cellTypeOf == "date" ? d[key].split("T").join(" ").split(".")[0] : cellTypeOf == "object" ? import_react25.default.isValidElement(d[key]) ? ((_d = d[key]) == null ? void 0 : _d.props).value : JSON.stringify(d[key]) : d[key]);
|
|
44166
44165
|
const handler = import_react25.default.isValidElement(d[key]) ? d[key] : null;
|
|
44167
44166
|
obj[key] = {
|
|
44168
|
-
index:
|
|
44167
|
+
index: id3,
|
|
44169
44168
|
originalData: content,
|
|
44170
44169
|
cellTypeOf,
|
|
44171
44170
|
title: content,
|
package/dist/index.mjs
CHANGED
|
@@ -44132,21 +44132,20 @@ function HTable(_a) {
|
|
|
44132
44132
|
const newData = data.length > 0 && data.map((d, trkey) => {
|
|
44133
44133
|
var _a2, _b2, _c, _d;
|
|
44134
44134
|
const obj = {};
|
|
44135
|
+
const id3 = (d == null ? void 0 : d.id) || trkey;
|
|
44135
44136
|
for (let key in d) {
|
|
44136
44137
|
const item = {};
|
|
44137
|
-
|
|
44138
|
-
item[key2] = ((_a2 = d[key2]) == null ? void 0 : _a2.content) || d[key2];
|
|
44139
|
-
}
|
|
44138
|
+
item[key] = ((_a2 = d[key]) == null ? void 0 : _a2.content) || d[key];
|
|
44140
44139
|
const typeOf = typeof d[key];
|
|
44141
44140
|
const isObject2 = typeOf == "object";
|
|
44142
44141
|
const regex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
44143
44142
|
const isDate = !isObject2 && regex.test(`${d[key]}`);
|
|
44144
44143
|
const cellTypeOf = isDate ? "date" : isObject2 ? "object" : typeOf;
|
|
44145
|
-
const mapedContent = (_c = (_b2 = mapedData == null ? void 0 : mapedData[
|
|
44144
|
+
const mapedContent = (_c = (_b2 = mapedData == null ? void 0 : mapedData[id3]) == null ? void 0 : _b2[key]) == null ? void 0 : _c.content;
|
|
44146
44145
|
const content = mapedContent || (cellTypeOf == "date" ? d[key].split("T").join(" ").split(".")[0] : cellTypeOf == "object" ? React4.isValidElement(d[key]) ? ((_d = d[key]) == null ? void 0 : _d.props).value : JSON.stringify(d[key]) : d[key]);
|
|
44147
44146
|
const handler = React4.isValidElement(d[key]) ? d[key] : null;
|
|
44148
44147
|
obj[key] = {
|
|
44149
|
-
index:
|
|
44148
|
+
index: id3,
|
|
44150
44149
|
originalData: content,
|
|
44151
44150
|
cellTypeOf,
|
|
44152
44151
|
title: content,
|
package/package.json
CHANGED
package/src/table/h.tsx
CHANGED
|
@@ -57,19 +57,20 @@ export default function HTable({
|
|
|
57
57
|
data.length > 0 &&
|
|
58
58
|
data.map((d: any, trkey: number) => {
|
|
59
59
|
const obj: any = {};
|
|
60
|
+
const id = d?.id || trkey;
|
|
60
61
|
for (let key in d) {
|
|
61
62
|
const item: any = {};
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
64
|
+
item[key] = d[key]?.content || d[key];
|
|
65
|
+
// for (let key in d) {
|
|
66
|
+
// }
|
|
66
67
|
const typeOf = typeof d[key];
|
|
67
68
|
const isObject = typeOf == "object";
|
|
68
69
|
const regex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
69
70
|
|
|
70
71
|
const isDate = !isObject && regex.test(`${d[key]}`);
|
|
71
72
|
const cellTypeOf = isDate ? "date" : isObject ? "object" : typeOf;
|
|
72
|
-
const mapedContent = (mapedData?.[
|
|
73
|
+
const mapedContent = (mapedData?.[id]?.[key] as any)?.content;
|
|
73
74
|
|
|
74
75
|
const content =
|
|
75
76
|
mapedContent ||
|
|
@@ -82,7 +83,7 @@ export default function HTable({
|
|
|
82
83
|
: d[key]);
|
|
83
84
|
const handler = React.isValidElement(d[key]) ? d[key] : null;
|
|
84
85
|
obj[key] = {
|
|
85
|
-
index:
|
|
86
|
+
index: id,
|
|
86
87
|
originalData: content,
|
|
87
88
|
cellTypeOf: cellTypeOf,
|
|
88
89
|
title: content,
|