next-recomponents 1.5.2 → 1.5.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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -8
- package/dist/index.mjs +5 -8
- package/package.json +1 -1
- package/src/table/h.tsx +2 -4
- package/src/table/index.tsx +1 -1
- package/src/table/td.tsx +1 -2
package/dist/index.d.mts
CHANGED
|
@@ -70,7 +70,7 @@ interface TableProps extends React.DetailedHTMLProps<React.TableHTMLAttributes<H
|
|
|
70
70
|
onSave?: (e: {
|
|
71
71
|
data: Record<string, any>;
|
|
72
72
|
}) => void | Promise<void>;
|
|
73
|
-
loader
|
|
73
|
+
loader?: React.ReactNode;
|
|
74
74
|
}
|
|
75
75
|
declare function Table({ ...props }: TableProps): react_jsx_runtime.JSX.Element;
|
|
76
76
|
|
package/dist/index.d.ts
CHANGED
|
@@ -70,7 +70,7 @@ interface TableProps extends React.DetailedHTMLProps<React.TableHTMLAttributes<H
|
|
|
70
70
|
onSave?: (e: {
|
|
71
71
|
data: Record<string, any>;
|
|
72
72
|
}) => void | Promise<void>;
|
|
73
|
-
loader
|
|
73
|
+
loader?: React.ReactNode;
|
|
74
74
|
}
|
|
75
75
|
declare function Table({ ...props }: TableProps): react_jsx_runtime.JSX.Element;
|
|
76
76
|
|
package/dist/index.js
CHANGED
|
@@ -11186,11 +11186,10 @@ function TD(_a) {
|
|
|
11186
11186
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: (item == null ? void 0 : item.handler) ? import_react23.default.Children.map(item.handler, (handler) => {
|
|
11187
11187
|
if (import_react23.default.isValidElement(handler)) {
|
|
11188
11188
|
const { type, props: props2 } = handler;
|
|
11189
|
-
|
|
11190
|
-
return import_react23.default.createElement(type, __spreadProps(__spreadValues({}, otherProps), {
|
|
11189
|
+
return import_react23.default.createElement(type, __spreadProps(__spreadValues({}, props2), {
|
|
11191
11190
|
value: mapedData[index][item.name].content,
|
|
11192
11191
|
onChange: (e) => {
|
|
11193
|
-
var
|
|
11192
|
+
var _a3, _b3;
|
|
11194
11193
|
const nmd = [...mapedData];
|
|
11195
11194
|
nmd[index][item.name].content = e.target.value;
|
|
11196
11195
|
e.item = Object.assign(
|
|
@@ -11207,7 +11206,7 @@ function TD(_a) {
|
|
|
11207
11206
|
setMapedData == null ? void 0 : setMapedData(nmd2);
|
|
11208
11207
|
};
|
|
11209
11208
|
setMapedData == null ? void 0 : setMapedData(nmd);
|
|
11210
|
-
(_b3 = (
|
|
11209
|
+
(_b3 = (_a3 = handler == null ? void 0 : handler.props) == null ? void 0 : _a3.onChange) == null ? void 0 : _b3.call(_a3, e);
|
|
11211
11210
|
}
|
|
11212
11211
|
}));
|
|
11213
11212
|
}
|
|
@@ -31987,7 +31986,7 @@ function HTable(_a) {
|
|
|
31987
31986
|
const isObject2 = typeOf == "object";
|
|
31988
31987
|
const isDate = typeOf == "string" && d[key].toString().includes("T");
|
|
31989
31988
|
const cellTypeOf = isDate ? "date" : isObject2 ? "object" : typeOf;
|
|
31990
|
-
const content = cellTypeOf == "date" ? d[key].split("T").join(" ").split(".")[0] : cellTypeOf == "object" ? import_react25.default.isValidElement(d[key]) ? ((_b2 = d[key]) == null ? void 0 : _b2.props).
|
|
31989
|
+
const content = cellTypeOf == "date" ? d[key].split("T").join(" ").split(".")[0] : cellTypeOf == "object" ? import_react25.default.isValidElement(d[key]) ? ((_b2 = d[key]) == null ? void 0 : _b2.props).value : JSON.stringify(d[key]) : d[key];
|
|
31991
31990
|
const handler = import_react25.default.isValidElement(d[key]) ? d[key] : null;
|
|
31992
31991
|
obj[key] = {
|
|
31993
31992
|
index: trkey,
|
|
@@ -32019,9 +32018,7 @@ function HTable(_a) {
|
|
|
32019
32018
|
onClick: (e) => __async(null, null, function* () {
|
|
32020
32019
|
setIsLoading(true);
|
|
32021
32020
|
yield onSave({ data: values });
|
|
32022
|
-
|
|
32023
|
-
setIsLoading(false);
|
|
32024
|
-
}, 100);
|
|
32021
|
+
setIsLoading(false);
|
|
32025
32022
|
}),
|
|
32026
32023
|
children: [
|
|
32027
32024
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SaveIcon, {}),
|
package/dist/index.mjs
CHANGED
|
@@ -11174,11 +11174,10 @@ function TD(_a) {
|
|
|
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
11176
|
const { type, props: props2 } = handler;
|
|
11177
|
-
|
|
11178
|
-
return React3.createElement(type, __spreadProps(__spreadValues({}, otherProps), {
|
|
11177
|
+
return React3.createElement(type, __spreadProps(__spreadValues({}, props2), {
|
|
11179
11178
|
value: mapedData[index][item.name].content,
|
|
11180
11179
|
onChange: (e) => {
|
|
11181
|
-
var
|
|
11180
|
+
var _a3, _b3;
|
|
11182
11181
|
const nmd = [...mapedData];
|
|
11183
11182
|
nmd[index][item.name].content = e.target.value;
|
|
11184
11183
|
e.item = Object.assign(
|
|
@@ -11195,7 +11194,7 @@ function TD(_a) {
|
|
|
11195
11194
|
setMapedData == null ? void 0 : setMapedData(nmd2);
|
|
11196
11195
|
};
|
|
11197
11196
|
setMapedData == null ? void 0 : setMapedData(nmd);
|
|
11198
|
-
(_b3 = (
|
|
11197
|
+
(_b3 = (_a3 = handler == null ? void 0 : handler.props) == null ? void 0 : _a3.onChange) == null ? void 0 : _b3.call(_a3, e);
|
|
11199
11198
|
}
|
|
11200
11199
|
}));
|
|
11201
11200
|
}
|
|
@@ -31975,7 +31974,7 @@ function HTable(_a) {
|
|
|
31975
31974
|
const isObject2 = typeOf == "object";
|
|
31976
31975
|
const isDate = typeOf == "string" && d[key].toString().includes("T");
|
|
31977
31976
|
const cellTypeOf = isDate ? "date" : isObject2 ? "object" : typeOf;
|
|
31978
|
-
const content = cellTypeOf == "date" ? d[key].split("T").join(" ").split(".")[0] : cellTypeOf == "object" ? React4.isValidElement(d[key]) ? ((_b2 = d[key]) == null ? void 0 : _b2.props).
|
|
31977
|
+
const content = cellTypeOf == "date" ? d[key].split("T").join(" ").split(".")[0] : cellTypeOf == "object" ? React4.isValidElement(d[key]) ? ((_b2 = d[key]) == null ? void 0 : _b2.props).value : JSON.stringify(d[key]) : d[key];
|
|
31979
31978
|
const handler = React4.isValidElement(d[key]) ? d[key] : null;
|
|
31980
31979
|
obj[key] = {
|
|
31981
31980
|
index: trkey,
|
|
@@ -32007,9 +32006,7 @@ function HTable(_a) {
|
|
|
32007
32006
|
onClick: (e) => __async(null, null, function* () {
|
|
32008
32007
|
setIsLoading(true);
|
|
32009
32008
|
yield onSave({ data: values });
|
|
32010
|
-
|
|
32011
|
-
setIsLoading(false);
|
|
32012
|
-
}, 100);
|
|
32009
|
+
setIsLoading(false);
|
|
32013
32010
|
}),
|
|
32014
32011
|
children: [
|
|
32015
32012
|
/* @__PURE__ */ jsx11(SaveIcon, {}),
|
package/package.json
CHANGED
package/src/table/h.tsx
CHANGED
|
@@ -57,7 +57,7 @@ export default function HTable({
|
|
|
57
57
|
? d[key].split("T").join(" ").split(".")[0]
|
|
58
58
|
: cellTypeOf == "object"
|
|
59
59
|
? React.isValidElement(d[key])
|
|
60
|
-
? (d[key]?.props as any).
|
|
60
|
+
? (d[key]?.props as any).value
|
|
61
61
|
: JSON.stringify(d[key])
|
|
62
62
|
: d[key];
|
|
63
63
|
const handler = React.isValidElement(d[key]) ? d[key] : null;
|
|
@@ -94,9 +94,7 @@ export default function HTable({
|
|
|
94
94
|
onClick={async (e) => {
|
|
95
95
|
setIsLoading(true);
|
|
96
96
|
await onSave({ data: values });
|
|
97
|
-
|
|
98
|
-
setIsLoading(false);
|
|
99
|
-
}, 100);
|
|
97
|
+
setIsLoading(false);
|
|
100
98
|
}}
|
|
101
99
|
>
|
|
102
100
|
<SaveIcon /> Guardar
|
package/src/table/index.tsx
CHANGED
|
@@ -15,7 +15,7 @@ export interface TableProps
|
|
|
15
15
|
symbols?: Record<string, ReactNode>;
|
|
16
16
|
exportName?: string;
|
|
17
17
|
onSave?: (e: { data: Record<string, any> }) => void | Promise<void>;
|
|
18
|
-
loader
|
|
18
|
+
loader?: React.ReactNode;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export default function Table({ ...props }: TableProps) {
|
package/src/table/td.tsx
CHANGED
|
@@ -78,10 +78,9 @@ export default function TD({
|
|
|
78
78
|
? React.Children.map(item.handler, (handler) => {
|
|
79
79
|
if (React.isValidElement(handler)) {
|
|
80
80
|
const { type, props } = handler;
|
|
81
|
-
const { defaultValue, ...otherProps } = props;
|
|
82
81
|
|
|
83
82
|
return React.createElement(type, {
|
|
84
|
-
...
|
|
83
|
+
...props,
|
|
85
84
|
value: mapedData[index][item.name].content,
|
|
86
85
|
onChange: (e: any) => {
|
|
87
86
|
const nmd = [...mapedData];
|