next-recomponents 1.2.4 → 1.2.6
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 -4
- package/dist/index.mjs +13 -13
- package/package.json +1 -1
- package/src/table/h.tsx +4 -2
- package/src/use-resources/index.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -11126,7 +11126,7 @@ var regular_expresions_default = regularExpresions;
|
|
|
11126
11126
|
var import_react26 = require("react");
|
|
11127
11127
|
|
|
11128
11128
|
// src/table/h.tsx
|
|
11129
|
-
var import_react25 = require("react");
|
|
11129
|
+
var import_react25 = __toESM(require("react"));
|
|
11130
11130
|
|
|
11131
11131
|
// src/table/td.tsx
|
|
11132
11132
|
var import_react23 = __toESM(require("react"));
|
|
@@ -11437,7 +11437,7 @@ function HTable(_a) {
|
|
|
11437
11437
|
const isObject2 = typeOf == "object";
|
|
11438
11438
|
const isDate = typeOf == "string" && d[key].includes("T");
|
|
11439
11439
|
const cellTypeOf = isDate ? "date" : isObject2 ? "object" : typeOf;
|
|
11440
|
-
const content = cellTypeOf == "date" ? d[key].split("T").join(" ").split(".")[0] : cellTypeOf == "object" ? JSON.stringify(d[key]) : d[key];
|
|
11440
|
+
const content = cellTypeOf == "date" ? d[key].split("T").join(" ").split(".")[0] : cellTypeOf == "object" ? import_react25.default.isValidElement(d[key]) ? d[key] : JSON.stringify(d[key]) : d[key];
|
|
11441
11441
|
obj[key] = {
|
|
11442
11442
|
originalData: content,
|
|
11443
11443
|
cellTypeOf,
|
|
@@ -32313,7 +32313,7 @@ function useResources({
|
|
|
32313
32313
|
}
|
|
32314
32314
|
}
|
|
32315
32315
|
setInfo(__spreadValues({}, newInfo));
|
|
32316
|
-
return d
|
|
32316
|
+
return d;
|
|
32317
32317
|
} catch (error) {
|
|
32318
32318
|
const item = http_codes_default.find((s) => s.code == error.status);
|
|
32319
32319
|
newInfo[key].state = "error";
|
|
@@ -32401,7 +32401,7 @@ function useResources({
|
|
|
32401
32401
|
}
|
|
32402
32402
|
}
|
|
32403
32403
|
setInfo(__spreadValues({}, newInfo));
|
|
32404
|
-
return d
|
|
32404
|
+
return d;
|
|
32405
32405
|
} catch (error) {
|
|
32406
32406
|
const item = http_codes_default.find((s) => s.code == error.status);
|
|
32407
32407
|
newInfo[key].state = "error";
|
package/dist/index.mjs
CHANGED
|
@@ -11117,7 +11117,7 @@ var regular_expresions_default = regularExpresions;
|
|
|
11117
11117
|
import { useState as useState7 } from "react";
|
|
11118
11118
|
|
|
11119
11119
|
// src/table/h.tsx
|
|
11120
|
-
import { useEffect as useEffect7, useMemo as useMemo7, useRef as useRef4, useState as useState6 } from "react";
|
|
11120
|
+
import React4, { useEffect as useEffect7, useMemo as useMemo7, useRef as useRef4, useState as useState6 } from "react";
|
|
11121
11121
|
|
|
11122
11122
|
// src/table/td.tsx
|
|
11123
11123
|
import React3, { useMemo as useMemo6, useState as useState4 } from "react";
|
|
@@ -11428,7 +11428,7 @@ function HTable(_a) {
|
|
|
11428
11428
|
const isObject2 = typeOf == "object";
|
|
11429
11429
|
const isDate = typeOf == "string" && d[key].includes("T");
|
|
11430
11430
|
const cellTypeOf = isDate ? "date" : isObject2 ? "object" : typeOf;
|
|
11431
|
-
const content = cellTypeOf == "date" ? d[key].split("T").join(" ").split(".")[0] : cellTypeOf == "object" ? JSON.stringify(d[key]) : d[key];
|
|
11431
|
+
const content = cellTypeOf == "date" ? d[key].split("T").join(" ").split(".")[0] : cellTypeOf == "object" ? React4.isValidElement(d[key]) ? d[key] : JSON.stringify(d[key]) : d[key];
|
|
11432
11432
|
obj[key] = {
|
|
11433
11433
|
originalData: content,
|
|
11434
11434
|
cellTypeOf,
|
|
@@ -32306,7 +32306,7 @@ function useResources({
|
|
|
32306
32306
|
}
|
|
32307
32307
|
}
|
|
32308
32308
|
setInfo(__spreadValues({}, newInfo));
|
|
32309
|
-
return d
|
|
32309
|
+
return d;
|
|
32310
32310
|
} catch (error) {
|
|
32311
32311
|
const item = http_codes_default.find((s) => s.code == error.status);
|
|
32312
32312
|
newInfo[key].state = "error";
|
|
@@ -32394,7 +32394,7 @@ function useResources({
|
|
|
32394
32394
|
}
|
|
32395
32395
|
}
|
|
32396
32396
|
setInfo(__spreadValues({}, newInfo));
|
|
32397
|
-
return d
|
|
32397
|
+
return d;
|
|
32398
32398
|
} catch (error) {
|
|
32399
32399
|
const item = http_codes_default.find((s) => s.code == error.status);
|
|
32400
32400
|
newInfo[key].state = "error";
|
|
@@ -32471,7 +32471,7 @@ function useResources({
|
|
|
32471
32471
|
}
|
|
32472
32472
|
|
|
32473
32473
|
// src/select/index.tsx
|
|
32474
|
-
import
|
|
32474
|
+
import React6, {
|
|
32475
32475
|
useEffect as useEffect9,
|
|
32476
32476
|
useRef as useRef5,
|
|
32477
32477
|
useState as useState10
|
|
@@ -32541,7 +32541,7 @@ function Select(_a) {
|
|
|
32541
32541
|
return options.find((opt) => opt.label == value);
|
|
32542
32542
|
};
|
|
32543
32543
|
useEffect9(() => {
|
|
32544
|
-
const parsedOptions =
|
|
32544
|
+
const parsedOptions = React6.Children.toArray(children).filter((child) => {
|
|
32545
32545
|
return child.type === "option";
|
|
32546
32546
|
}).map((child) => {
|
|
32547
32547
|
const el = child;
|
|
@@ -32700,7 +32700,7 @@ function Select(_a) {
|
|
|
32700
32700
|
}
|
|
32701
32701
|
|
|
32702
32702
|
// src/modal/index.tsx
|
|
32703
|
-
import
|
|
32703
|
+
import React7, { useRef as useRef6 } from "react";
|
|
32704
32704
|
import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
32705
32705
|
function Modal({ button, children, ref }) {
|
|
32706
32706
|
const modalRef = ref || useRef6(null);
|
|
@@ -32713,9 +32713,9 @@ function Modal({ button, children, ref }) {
|
|
|
32713
32713
|
typeof modalRef == "object" && ((_a = modalRef.current) == null ? void 0 : _a.close());
|
|
32714
32714
|
}
|
|
32715
32715
|
return /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
32716
|
-
|
|
32717
|
-
if (
|
|
32718
|
-
return
|
|
32716
|
+
React7.Children.map(button, (child) => {
|
|
32717
|
+
if (React7.isValidElement(child)) {
|
|
32718
|
+
return React7.cloneElement(child, {
|
|
32719
32719
|
onClick: (e) => {
|
|
32720
32720
|
var _a, _b;
|
|
32721
32721
|
show();
|
|
@@ -32734,9 +32734,9 @@ function Modal({ button, children, ref }) {
|
|
|
32734
32734
|
children: "X"
|
|
32735
32735
|
}
|
|
32736
32736
|
),
|
|
32737
|
-
/* @__PURE__ */ jsx17("div", { className: "flex flex-col gap-3 pt-6", children:
|
|
32738
|
-
if (
|
|
32739
|
-
return
|
|
32737
|
+
/* @__PURE__ */ jsx17("div", { className: "flex flex-col gap-3 pt-6", children: React7.Children.map(children, (child) => {
|
|
32738
|
+
if (React7.isValidElement(child)) {
|
|
32739
|
+
return React7.cloneElement(child, { hide });
|
|
32740
32740
|
}
|
|
32741
32741
|
return child;
|
|
32742
32742
|
}) })
|
package/package.json
CHANGED
package/src/table/h.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect, useMemo, useRef, useState } from "react";
|
|
1
|
+
import React, { useEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
import { TableProps } from ".";
|
|
3
3
|
import TD from "./td";
|
|
4
4
|
import { FilterOffIcon } from "./filters";
|
|
@@ -59,7 +59,9 @@ export default function HTable({
|
|
|
59
59
|
cellTypeOf == "date"
|
|
60
60
|
? d[key].split("T").join(" ").split(".")[0]
|
|
61
61
|
: cellTypeOf == "object"
|
|
62
|
-
?
|
|
62
|
+
? React.isValidElement(d[key])
|
|
63
|
+
? d[key]
|
|
64
|
+
: JSON.stringify(d[key])
|
|
63
65
|
: d[key];
|
|
64
66
|
obj[key] = {
|
|
65
67
|
originalData: content,
|
|
@@ -103,7 +103,7 @@ export default function useResources<T extends Record<string, ItemsRecord>>({
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
setInfo({ ...newInfo });
|
|
106
|
-
return d
|
|
106
|
+
return d;
|
|
107
107
|
} catch (error: any) {
|
|
108
108
|
const item = httpStatusCodes.find((s) => s.code == error.status);
|
|
109
109
|
|
|
@@ -195,7 +195,7 @@ export default function useResources<T extends Record<string, ItemsRecord>>({
|
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
setInfo({ ...newInfo });
|
|
198
|
-
return d
|
|
198
|
+
return d;
|
|
199
199
|
} catch (error: any) {
|
|
200
200
|
const item = httpStatusCodes.find((s) => s.code == error.status);
|
|
201
201
|
|