next-recomponents 2.0.0 → 2.0.1
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 +25 -36
- package/dist/index.mjs +25 -38
- package/package.json +1 -1
- package/src/calendar/index.tsx +25 -28
package/dist/index.js
CHANGED
|
@@ -36916,6 +36916,7 @@ function CalendarIcon() {
|
|
|
36916
36916
|
}
|
|
36917
36917
|
|
|
36918
36918
|
// src/calendar/index.tsx
|
|
36919
|
+
var import_material4 = require("@mui/material");
|
|
36919
36920
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
36920
36921
|
function MyCalendar(_a) {
|
|
36921
36922
|
var _b = _a, {
|
|
@@ -36933,23 +36934,18 @@ function MyCalendar(_a) {
|
|
|
36933
36934
|
"label",
|
|
36934
36935
|
"value"
|
|
36935
36936
|
]);
|
|
36936
|
-
const modalRef = (0, import_react10.useRef)(null);
|
|
36937
36937
|
const [selectedDate, setSelectedDate] = (0, import_react10.useState)(null);
|
|
36938
36938
|
const [dateStr, setDateStr] = (0, import_react10.useState)(
|
|
36939
36939
|
defaultValue || value || ""
|
|
36940
36940
|
);
|
|
36941
|
-
const [
|
|
36942
|
-
(0, import_react10.useEffect)(() => {
|
|
36943
|
-
setVisible(typeof window !== "undefined");
|
|
36944
|
-
}, []);
|
|
36941
|
+
const [open, setOpen] = (0, import_react10.useState)(false);
|
|
36945
36942
|
function handleChange(date) {
|
|
36946
|
-
var _a2, _b2;
|
|
36947
36943
|
if (!date) return;
|
|
36948
36944
|
setSelectedDate(date);
|
|
36949
36945
|
const formattedDate = date.toISOString().split("T")[0];
|
|
36950
36946
|
setDateStr(formattedDate);
|
|
36951
36947
|
onChange == null ? void 0 : onChange({ target: { value: formattedDate } });
|
|
36952
|
-
(
|
|
36948
|
+
setOpen(false);
|
|
36953
36949
|
}
|
|
36954
36950
|
const normalizedEnabledDates = enabledDates.map((item) => {
|
|
36955
36951
|
if (item instanceof Date) return item;
|
|
@@ -36969,11 +36965,8 @@ function MyCalendar(_a) {
|
|
|
36969
36965
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
36970
36966
|
"div",
|
|
36971
36967
|
{
|
|
36972
|
-
onClick: () => {
|
|
36973
|
-
var _a2, _b2;
|
|
36974
|
-
return (_b2 = (_a2 = modalRef == null ? void 0 : modalRef.current) == null ? void 0 : _a2.showModal) == null ? void 0 : _b2.call(_a2);
|
|
36975
|
-
},
|
|
36976
36968
|
className: "cursor-pointer flex items-center justify-center",
|
|
36969
|
+
onClick: (e) => setOpen(true),
|
|
36977
36970
|
children: [
|
|
36978
36971
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
36979
36972
|
"input",
|
|
@@ -36994,29 +36987,25 @@ function MyCalendar(_a) {
|
|
|
36994
36987
|
}
|
|
36995
36988
|
) })
|
|
36996
36989
|
] }),
|
|
36997
|
-
|
|
36998
|
-
"
|
|
36999
|
-
|
|
37000
|
-
|
|
37001
|
-
|
|
37002
|
-
|
|
37003
|
-
|
|
37004
|
-
|
|
37005
|
-
|
|
37006
|
-
|
|
37007
|
-
|
|
37008
|
-
|
|
37009
|
-
|
|
37010
|
-
|
|
37011
|
-
|
|
37012
|
-
|
|
37013
|
-
|
|
37014
|
-
|
|
37015
|
-
|
|
37016
|
-
}
|
|
37017
|
-
) })
|
|
37018
|
-
}
|
|
37019
|
-
)
|
|
36990
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_material4.Dialog, { open, children: [
|
|
36991
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex justify-end p-5 font-bold", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
36992
|
+
"button",
|
|
36993
|
+
{
|
|
36994
|
+
className: " border-lg w-[20px] bg-red-500 text-white shadow rounded",
|
|
36995
|
+
onClick: (e) => setOpen(false),
|
|
36996
|
+
children: "x"
|
|
36997
|
+
}
|
|
36998
|
+
) }),
|
|
36999
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: " w-[300px] flex items-start justify-center h-[300px] p-5", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
37000
|
+
import_react_datepicker.default,
|
|
37001
|
+
{
|
|
37002
|
+
inline: true,
|
|
37003
|
+
selected: selectedDate,
|
|
37004
|
+
onChange: handleChange,
|
|
37005
|
+
includeDates: normalizedEnabledDates
|
|
37006
|
+
}
|
|
37007
|
+
) })
|
|
37008
|
+
] })
|
|
37020
37009
|
] });
|
|
37021
37010
|
}
|
|
37022
37011
|
|
|
@@ -37820,7 +37809,7 @@ function TableFooter({
|
|
|
37820
37809
|
// src/table3/dialog.tsx
|
|
37821
37810
|
var import_react14 = __toESM(require("react"));
|
|
37822
37811
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
37823
|
-
function
|
|
37812
|
+
function Dialog4({
|
|
37824
37813
|
modalRef,
|
|
37825
37814
|
children,
|
|
37826
37815
|
dialogRow,
|
|
@@ -37872,7 +37861,7 @@ function Dialog3({
|
|
|
37872
37861
|
}
|
|
37873
37862
|
);
|
|
37874
37863
|
}
|
|
37875
|
-
var dialog_default =
|
|
37864
|
+
var dialog_default = Dialog4;
|
|
37876
37865
|
|
|
37877
37866
|
// src/table3/index.tsx
|
|
37878
37867
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
package/dist/index.mjs
CHANGED
|
@@ -36882,8 +36882,6 @@ function useDates() {
|
|
|
36882
36882
|
|
|
36883
36883
|
// src/calendar/index.tsx
|
|
36884
36884
|
import {
|
|
36885
|
-
useEffect as useEffect6,
|
|
36886
|
-
useRef as useRef5,
|
|
36887
36885
|
useState as useState9
|
|
36888
36886
|
} from "react";
|
|
36889
36887
|
import DatePicker from "react-datepicker";
|
|
@@ -36907,6 +36905,7 @@ function CalendarIcon() {
|
|
|
36907
36905
|
}
|
|
36908
36906
|
|
|
36909
36907
|
// src/calendar/index.tsx
|
|
36908
|
+
import { Dialog as Dialog3 } from "@mui/material";
|
|
36910
36909
|
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
36911
36910
|
function MyCalendar(_a) {
|
|
36912
36911
|
var _b = _a, {
|
|
@@ -36924,23 +36923,18 @@ function MyCalendar(_a) {
|
|
|
36924
36923
|
"label",
|
|
36925
36924
|
"value"
|
|
36926
36925
|
]);
|
|
36927
|
-
const modalRef = useRef5(null);
|
|
36928
36926
|
const [selectedDate, setSelectedDate] = useState9(null);
|
|
36929
36927
|
const [dateStr, setDateStr] = useState9(
|
|
36930
36928
|
defaultValue || value || ""
|
|
36931
36929
|
);
|
|
36932
|
-
const [
|
|
36933
|
-
useEffect6(() => {
|
|
36934
|
-
setVisible(typeof window !== "undefined");
|
|
36935
|
-
}, []);
|
|
36930
|
+
const [open, setOpen] = useState9(false);
|
|
36936
36931
|
function handleChange(date) {
|
|
36937
|
-
var _a2, _b2;
|
|
36938
36932
|
if (!date) return;
|
|
36939
36933
|
setSelectedDate(date);
|
|
36940
36934
|
const formattedDate = date.toISOString().split("T")[0];
|
|
36941
36935
|
setDateStr(formattedDate);
|
|
36942
36936
|
onChange == null ? void 0 : onChange({ target: { value: formattedDate } });
|
|
36943
|
-
(
|
|
36937
|
+
setOpen(false);
|
|
36944
36938
|
}
|
|
36945
36939
|
const normalizedEnabledDates = enabledDates.map((item) => {
|
|
36946
36940
|
if (item instanceof Date) return item;
|
|
@@ -36960,11 +36954,8 @@ function MyCalendar(_a) {
|
|
|
36960
36954
|
/* @__PURE__ */ jsx15("div", { children: /* @__PURE__ */ jsxs9(
|
|
36961
36955
|
"div",
|
|
36962
36956
|
{
|
|
36963
|
-
onClick: () => {
|
|
36964
|
-
var _a2, _b2;
|
|
36965
|
-
return (_b2 = (_a2 = modalRef == null ? void 0 : modalRef.current) == null ? void 0 : _a2.showModal) == null ? void 0 : _b2.call(_a2);
|
|
36966
|
-
},
|
|
36967
36957
|
className: "cursor-pointer flex items-center justify-center",
|
|
36958
|
+
onClick: (e) => setOpen(true),
|
|
36968
36959
|
children: [
|
|
36969
36960
|
/* @__PURE__ */ jsx15(
|
|
36970
36961
|
"input",
|
|
@@ -36985,29 +36976,25 @@ function MyCalendar(_a) {
|
|
|
36985
36976
|
}
|
|
36986
36977
|
) })
|
|
36987
36978
|
] }),
|
|
36988
|
-
|
|
36989
|
-
"
|
|
36990
|
-
|
|
36991
|
-
|
|
36992
|
-
|
|
36993
|
-
|
|
36994
|
-
|
|
36995
|
-
|
|
36996
|
-
|
|
36997
|
-
|
|
36998
|
-
|
|
36999
|
-
|
|
37000
|
-
|
|
37001
|
-
|
|
37002
|
-
|
|
37003
|
-
|
|
37004
|
-
|
|
37005
|
-
|
|
37006
|
-
|
|
37007
|
-
}
|
|
37008
|
-
) })
|
|
37009
|
-
}
|
|
37010
|
-
)
|
|
36979
|
+
/* @__PURE__ */ jsxs9(Dialog3, { open, children: [
|
|
36980
|
+
/* @__PURE__ */ jsx15("div", { className: "flex justify-end p-5 font-bold", children: /* @__PURE__ */ jsx15(
|
|
36981
|
+
"button",
|
|
36982
|
+
{
|
|
36983
|
+
className: " border-lg w-[20px] bg-red-500 text-white shadow rounded",
|
|
36984
|
+
onClick: (e) => setOpen(false),
|
|
36985
|
+
children: "x"
|
|
36986
|
+
}
|
|
36987
|
+
) }),
|
|
36988
|
+
/* @__PURE__ */ jsx15("div", { className: " w-[300px] flex items-start justify-center h-[300px] p-5", children: /* @__PURE__ */ jsx15(
|
|
36989
|
+
DatePicker,
|
|
36990
|
+
{
|
|
36991
|
+
inline: true,
|
|
36992
|
+
selected: selectedDate,
|
|
36993
|
+
onChange: handleChange,
|
|
36994
|
+
includeDates: normalizedEnabledDates
|
|
36995
|
+
}
|
|
36996
|
+
) })
|
|
36997
|
+
] })
|
|
37011
36998
|
] });
|
|
37012
36999
|
}
|
|
37013
37000
|
|
|
@@ -37817,7 +37804,7 @@ function TableFooter({
|
|
|
37817
37804
|
// src/table3/dialog.tsx
|
|
37818
37805
|
import React8, { useMemo as useMemo5 } from "react";
|
|
37819
37806
|
import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
37820
|
-
function
|
|
37807
|
+
function Dialog4({
|
|
37821
37808
|
modalRef,
|
|
37822
37809
|
children,
|
|
37823
37810
|
dialogRow,
|
|
@@ -37869,7 +37856,7 @@ function Dialog3({
|
|
|
37869
37856
|
}
|
|
37870
37857
|
);
|
|
37871
37858
|
}
|
|
37872
|
-
var dialog_default =
|
|
37859
|
+
var dialog_default = Dialog4;
|
|
37873
37860
|
|
|
37874
37861
|
// src/table3/index.tsx
|
|
37875
37862
|
import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
|
package/package.json
CHANGED
package/src/calendar/index.tsx
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import DatePicker from "react-datepicker";
|
|
10
10
|
import "./react-datepicker.css";
|
|
11
11
|
import CalendarIcon from "./calendar.icon";
|
|
12
|
+
import { Dialog } from "@mui/material";
|
|
12
13
|
|
|
13
14
|
interface CalendarProps extends DetailedHTMLProps<
|
|
14
15
|
InputHTMLAttributes<HTMLInputElement>,
|
|
@@ -29,16 +30,15 @@ export default function MyCalendar({
|
|
|
29
30
|
value,
|
|
30
31
|
...otherProps
|
|
31
32
|
}: CalendarProps) {
|
|
32
|
-
const modalRef = useRef<HTMLDialogElement>(null);
|
|
33
33
|
const [selectedDate, setSelectedDate] = useState<Date | null>(null);
|
|
34
34
|
const [dateStr, setDateStr] = useState<string | number | readonly string[]>(
|
|
35
35
|
defaultValue || value || "",
|
|
36
36
|
);
|
|
37
|
-
const [
|
|
37
|
+
const [open, setOpen] = useState(false);
|
|
38
38
|
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
|
|
41
|
-
}, []);
|
|
39
|
+
// useEffect(() => {
|
|
40
|
+
// setVisible(typeof window !== "undefined");
|
|
41
|
+
// }, []);
|
|
42
42
|
|
|
43
43
|
function handleChange(date: Date | null) {
|
|
44
44
|
if (!date) return;
|
|
@@ -46,7 +46,7 @@ export default function MyCalendar({
|
|
|
46
46
|
const formattedDate = date.toISOString().split("T")[0];
|
|
47
47
|
setDateStr(formattedDate);
|
|
48
48
|
onChange?.({ target: { value: formattedDate } });
|
|
49
|
-
|
|
49
|
+
setOpen(false);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
// 🔧 Convertir strings a fechas sin zona horaria
|
|
@@ -69,8 +69,8 @@ export default function MyCalendar({
|
|
|
69
69
|
</div>
|
|
70
70
|
<div>
|
|
71
71
|
<div
|
|
72
|
-
onClick={() => modalRef?.current?.showModal?.()}
|
|
73
72
|
className="cursor-pointer flex items-center justify-center"
|
|
73
|
+
onClick={(e) => setOpen(true)}
|
|
74
74
|
>
|
|
75
75
|
<input
|
|
76
76
|
{...otherProps}
|
|
@@ -91,27 +91,24 @@ export default function MyCalendar({
|
|
|
91
91
|
</div>
|
|
92
92
|
</label>
|
|
93
93
|
|
|
94
|
-
{
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
</div>
|
|
113
|
-
</dialog>
|
|
114
|
-
)}
|
|
94
|
+
<Dialog open={open}>
|
|
95
|
+
<div className="flex justify-end p-5 font-bold">
|
|
96
|
+
<button
|
|
97
|
+
className=" border-lg w-[20px] bg-red-500 text-white shadow rounded"
|
|
98
|
+
onClick={(e) => setOpen(false)}
|
|
99
|
+
>
|
|
100
|
+
x
|
|
101
|
+
</button>
|
|
102
|
+
</div>
|
|
103
|
+
<div className=" w-[300px] flex items-start justify-center h-[300px] p-5">
|
|
104
|
+
<DatePicker
|
|
105
|
+
inline
|
|
106
|
+
selected={selectedDate}
|
|
107
|
+
onChange={handleChange}
|
|
108
|
+
includeDates={normalizedEnabledDates}
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
</Dialog>
|
|
115
112
|
</div>
|
|
116
113
|
);
|
|
117
114
|
}
|