next-recomponents 1.9.95 → 1.9.97
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 +8 -9
- package/dist/index.mjs +24 -25
- package/package.json +1 -1
- package/src/modal/index.tsx +13 -13
package/dist/index.js
CHANGED
|
@@ -36781,16 +36781,15 @@ function CloseIcon2() {
|
|
|
36781
36781
|
}
|
|
36782
36782
|
|
|
36783
36783
|
// src/modal/index.tsx
|
|
36784
|
+
var import_material3 = require("@mui/material");
|
|
36784
36785
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
36785
36786
|
function Modal({ button, children, ref, title = "" }) {
|
|
36786
|
-
const
|
|
36787
|
+
const [open, setOpen] = (0, import_react9.useState)(false);
|
|
36787
36788
|
function show() {
|
|
36788
|
-
|
|
36789
|
-
typeof modalRef == "object" && ((_a = modalRef.current) == null ? void 0 : _a.showModal());
|
|
36789
|
+
setOpen(true);
|
|
36790
36790
|
}
|
|
36791
36791
|
function hide() {
|
|
36792
|
-
|
|
36793
|
-
typeof modalRef == "object" && ((_a = modalRef.current) == null ? void 0 : _a.close());
|
|
36792
|
+
setOpen(false);
|
|
36794
36793
|
}
|
|
36795
36794
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
36796
36795
|
import_react9.default.Children.map(button, (child) => {
|
|
@@ -36806,12 +36805,12 @@ function Modal({ button, children, ref, title = "" }) {
|
|
|
36806
36805
|
}
|
|
36807
36806
|
return child;
|
|
36808
36807
|
}),
|
|
36809
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
36808
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_material3.Dialog, { open, onClose: hide, fullWidth: true, maxWidth: "xl", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "m-auto p-5", children: [
|
|
36810
36809
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
36811
36810
|
"button",
|
|
36812
36811
|
{
|
|
36813
36812
|
onClick: hide,
|
|
36814
|
-
className: "absolute top-0 right-0 text-red-500
|
|
36813
|
+
className: "absolute top-0 right-0 text-red-500 ",
|
|
36815
36814
|
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CloseIcon2, {})
|
|
36816
36815
|
}
|
|
36817
36816
|
),
|
|
@@ -37802,7 +37801,7 @@ function TableFooter({
|
|
|
37802
37801
|
// src/table3/dialog.tsx
|
|
37803
37802
|
var import_react14 = __toESM(require("react"));
|
|
37804
37803
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
37805
|
-
function
|
|
37804
|
+
function Dialog3({
|
|
37806
37805
|
modalRef,
|
|
37807
37806
|
children,
|
|
37808
37807
|
dialogRow,
|
|
@@ -37854,7 +37853,7 @@ function Dialog2({
|
|
|
37854
37853
|
}
|
|
37855
37854
|
);
|
|
37856
37855
|
}
|
|
37857
|
-
var dialog_default =
|
|
37856
|
+
var dialog_default = Dialog3;
|
|
37858
37857
|
|
|
37859
37858
|
// src/table3/index.tsx
|
|
37860
37859
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
package/dist/index.mjs
CHANGED
|
@@ -36747,7 +36747,7 @@ function Select(_a) {
|
|
|
36747
36747
|
}
|
|
36748
36748
|
|
|
36749
36749
|
// src/modal/index.tsx
|
|
36750
|
-
import React6, {
|
|
36750
|
+
import React6, { useState as useState8 } from "react";
|
|
36751
36751
|
|
|
36752
36752
|
// src/modal/close.tsx
|
|
36753
36753
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
@@ -36768,16 +36768,15 @@ function CloseIcon2() {
|
|
|
36768
36768
|
}
|
|
36769
36769
|
|
|
36770
36770
|
// src/modal/index.tsx
|
|
36771
|
+
import { Dialog as Dialog2 } from "@mui/material";
|
|
36771
36772
|
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
36772
36773
|
function Modal({ button, children, ref, title = "" }) {
|
|
36773
|
-
const
|
|
36774
|
+
const [open, setOpen] = useState8(false);
|
|
36774
36775
|
function show() {
|
|
36775
|
-
|
|
36776
|
-
typeof modalRef == "object" && ((_a = modalRef.current) == null ? void 0 : _a.showModal());
|
|
36776
|
+
setOpen(true);
|
|
36777
36777
|
}
|
|
36778
36778
|
function hide() {
|
|
36779
|
-
|
|
36780
|
-
typeof modalRef == "object" && ((_a = modalRef.current) == null ? void 0 : _a.close());
|
|
36779
|
+
setOpen(false);
|
|
36781
36780
|
}
|
|
36782
36781
|
return /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
36783
36782
|
React6.Children.map(button, (child) => {
|
|
@@ -36793,12 +36792,12 @@ function Modal({ button, children, ref, title = "" }) {
|
|
|
36793
36792
|
}
|
|
36794
36793
|
return child;
|
|
36795
36794
|
}),
|
|
36796
|
-
/* @__PURE__ */ jsx12(
|
|
36795
|
+
/* @__PURE__ */ jsx12(Dialog2, { open, onClose: hide, fullWidth: true, maxWidth: "xl", children: /* @__PURE__ */ jsxs8("div", { className: "m-auto p-5", children: [
|
|
36797
36796
|
/* @__PURE__ */ jsx12(
|
|
36798
36797
|
"button",
|
|
36799
36798
|
{
|
|
36800
36799
|
onClick: hide,
|
|
36801
|
-
className: "absolute top-0 right-0 text-red-500
|
|
36800
|
+
className: "absolute top-0 right-0 text-red-500 ",
|
|
36802
36801
|
children: /* @__PURE__ */ jsx12(CloseIcon2, {})
|
|
36803
36802
|
}
|
|
36804
36803
|
),
|
|
@@ -36866,7 +36865,7 @@ function useDates() {
|
|
|
36866
36865
|
import {
|
|
36867
36866
|
useEffect as useEffect6,
|
|
36868
36867
|
useRef as useRef5,
|
|
36869
|
-
useState as
|
|
36868
|
+
useState as useState9
|
|
36870
36869
|
} from "react";
|
|
36871
36870
|
import DatePicker from "react-datepicker";
|
|
36872
36871
|
|
|
@@ -36907,11 +36906,11 @@ function MyCalendar(_a) {
|
|
|
36907
36906
|
"value"
|
|
36908
36907
|
]);
|
|
36909
36908
|
const modalRef = useRef5(null);
|
|
36910
|
-
const [selectedDate, setSelectedDate] =
|
|
36911
|
-
const [dateStr, setDateStr] =
|
|
36909
|
+
const [selectedDate, setSelectedDate] = useState9(null);
|
|
36910
|
+
const [dateStr, setDateStr] = useState9(
|
|
36912
36911
|
defaultValue || value || ""
|
|
36913
36912
|
);
|
|
36914
|
-
const [visible, setVisible] =
|
|
36913
|
+
const [visible, setVisible] = useState9(false);
|
|
36915
36914
|
useEffect6(() => {
|
|
36916
36915
|
setVisible(typeof window !== "undefined");
|
|
36917
36916
|
}, []);
|
|
@@ -37079,11 +37078,11 @@ import React9, {
|
|
|
37079
37078
|
useMemo as useMemo6,
|
|
37080
37079
|
useReducer as useReducer2,
|
|
37081
37080
|
useRef as useRef6,
|
|
37082
|
-
useState as
|
|
37081
|
+
useState as useState12
|
|
37083
37082
|
} from "react";
|
|
37084
37083
|
|
|
37085
37084
|
// src/table3/filter.tsx
|
|
37086
|
-
import { useEffect as useEffect7, useMemo as useMemo4, useState as
|
|
37085
|
+
import { useEffect as useEffect7, useMemo as useMemo4, useState as useState10 } from "react";
|
|
37087
37086
|
|
|
37088
37087
|
// src/table3/filters.tsx
|
|
37089
37088
|
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
@@ -37193,13 +37192,13 @@ function Filter({
|
|
|
37193
37192
|
sort,
|
|
37194
37193
|
setSort
|
|
37195
37194
|
}) {
|
|
37196
|
-
const [visible, setVisible] =
|
|
37197
|
-
const [text, setText] =
|
|
37195
|
+
const [visible, setVisible] = useState10(false);
|
|
37196
|
+
const [text, setText] = useState10("");
|
|
37198
37197
|
const items = useMemo4(
|
|
37199
37198
|
() => [...new Set(Object.values(objectData).map((o) => o[h]))],
|
|
37200
37199
|
[objectData]
|
|
37201
37200
|
);
|
|
37202
|
-
const [selected, setSelected] =
|
|
37201
|
+
const [selected, setSelected] = useState10(items);
|
|
37203
37202
|
const itemsFiltered = useMemo4(
|
|
37204
37203
|
() => items.sort((a, b) => `${a}`.localeCompare(b)).filter((item) => {
|
|
37205
37204
|
if (!text) return true;
|
|
@@ -37486,7 +37485,7 @@ function TableHead({
|
|
|
37486
37485
|
}
|
|
37487
37486
|
|
|
37488
37487
|
// src/table3/body.tsx
|
|
37489
|
-
import { useState as
|
|
37488
|
+
import { useState as useState11 } from "react";
|
|
37490
37489
|
|
|
37491
37490
|
// src/table3/tr.tsx
|
|
37492
37491
|
import React7 from "react";
|
|
@@ -37623,7 +37622,7 @@ function TableBody({
|
|
|
37623
37622
|
symbols,
|
|
37624
37623
|
sort
|
|
37625
37624
|
}) {
|
|
37626
|
-
const [selected, setSelected] =
|
|
37625
|
+
const [selected, setSelected] = useState11(-1);
|
|
37627
37626
|
const sorted = Object.entries(objectData).sort(([, a], [, b]) => {
|
|
37628
37627
|
for (const [key, order] of Object.entries(
|
|
37629
37628
|
sort || { id: "desc", _id: "desc" }
|
|
@@ -37799,7 +37798,7 @@ function TableFooter({
|
|
|
37799
37798
|
// src/table3/dialog.tsx
|
|
37800
37799
|
import React8, { useMemo as useMemo5 } from "react";
|
|
37801
37800
|
import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
37802
|
-
function
|
|
37801
|
+
function Dialog3({
|
|
37803
37802
|
modalRef,
|
|
37804
37803
|
children,
|
|
37805
37804
|
dialogRow,
|
|
@@ -37851,7 +37850,7 @@ function Dialog2({
|
|
|
37851
37850
|
}
|
|
37852
37851
|
);
|
|
37853
37852
|
}
|
|
37854
|
-
var dialog_default =
|
|
37853
|
+
var dialog_default = Dialog3;
|
|
37855
37854
|
|
|
37856
37855
|
// src/table3/index.tsx
|
|
37857
37856
|
import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
@@ -37883,8 +37882,8 @@ function Table3(_a) {
|
|
|
37883
37882
|
"symbols",
|
|
37884
37883
|
"sortBy"
|
|
37885
37884
|
]);
|
|
37886
|
-
const [handlers, setHandlers] =
|
|
37887
|
-
const [page, setPage] =
|
|
37885
|
+
const [handlers, setHandlers] = useState12({});
|
|
37886
|
+
const [page, setPage] = useState12(1);
|
|
37888
37887
|
function dataReducer(a, b) {
|
|
37889
37888
|
if (b == null) return {};
|
|
37890
37889
|
if (Array.isArray(b)) {
|
|
@@ -37938,9 +37937,9 @@ function Table3(_a) {
|
|
|
37938
37937
|
if (!objectData) return 0;
|
|
37939
37938
|
return maxItems ? Math.ceil(Object.keys(objectData).length / maxItems) : 1;
|
|
37940
37939
|
}, [objectData, maxItems]);
|
|
37941
|
-
const [sort, setSort] =
|
|
37940
|
+
const [sort, setSort] = useState12(sortBy);
|
|
37942
37941
|
const modalRef = useRef6(null);
|
|
37943
|
-
const [dialogRow, setDialogRow] =
|
|
37942
|
+
const [dialogRow, setDialogRow] = useState12({});
|
|
37944
37943
|
const context = __spreadValues({
|
|
37945
37944
|
objectData,
|
|
37946
37945
|
headers,
|
package/package.json
CHANGED
package/src/modal/index.tsx
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import React, { useRef } from "react";
|
|
1
|
+
import React, { useRef, useState } from "react";
|
|
2
2
|
import CloseIcon from "./close";
|
|
3
|
+
import { Dialog } from "@mui/material";
|
|
3
4
|
|
|
4
|
-
interface Props
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
> {
|
|
5
|
+
interface Props extends React.DetailedHTMLProps<
|
|
6
|
+
React.DialogHTMLAttributes<HTMLDialogElement>,
|
|
7
|
+
HTMLDialogElement
|
|
8
|
+
> {
|
|
9
9
|
button: React.ReactElement<{ onClick: (e: React.MouseEvent) => void }>;
|
|
10
10
|
children: React.ReactElement<{ hide: () => void }>;
|
|
11
11
|
}
|
|
12
12
|
export default function Modal({ button, children, ref, title = "" }: Props) {
|
|
13
|
-
const
|
|
13
|
+
const [open, setOpen] = useState(false);
|
|
14
14
|
function show() {
|
|
15
|
-
|
|
15
|
+
setOpen(true);
|
|
16
16
|
}
|
|
17
17
|
function hide() {
|
|
18
|
-
|
|
18
|
+
setOpen(false);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
return (
|
|
@@ -33,12 +33,12 @@ export default function Modal({ button, children, ref, title = "" }: Props) {
|
|
|
33
33
|
}
|
|
34
34
|
return child;
|
|
35
35
|
})}
|
|
36
|
-
<
|
|
37
|
-
<div className="
|
|
36
|
+
<Dialog open={open} onClose={hide} fullWidth maxWidth="xl">
|
|
37
|
+
<div className="m-auto p-5">
|
|
38
38
|
{/* Botón de cerrar en la esquina superior derecha */}
|
|
39
39
|
<button
|
|
40
40
|
onClick={hide}
|
|
41
|
-
className="absolute top-0 right-0 text-red-500
|
|
41
|
+
className="absolute top-0 right-0 text-red-500 "
|
|
42
42
|
>
|
|
43
43
|
<CloseIcon />
|
|
44
44
|
</button>
|
|
@@ -53,7 +53,7 @@ export default function Modal({ button, children, ref, title = "" }: Props) {
|
|
|
53
53
|
})}
|
|
54
54
|
</div>
|
|
55
55
|
</div>
|
|
56
|
-
</
|
|
56
|
+
</Dialog>
|
|
57
57
|
</>
|
|
58
58
|
);
|
|
59
59
|
}
|