componentes-sinco 1.2.0 → 1.2.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.cjs +32 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +32 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2621,6 +2621,7 @@ function SCAutocomplete({
|
|
|
2621
2621
|
) || null;
|
|
2622
2622
|
const [open, setOpen] = import_react19.default.useState(false);
|
|
2623
2623
|
const componentClickActiveRef = import_react19.default.useRef(false);
|
|
2624
|
+
const listboxScrollRef = import_react19.default.useRef(null);
|
|
2624
2625
|
const containerRef = import_react19.default.useRef(null);
|
|
2625
2626
|
const [chipLimit, setChipLimit] = import_react19.default.useState(2);
|
|
2626
2627
|
const outsideChipsMeasureRef = import_react19.default.useRef(null);
|
|
@@ -2786,12 +2787,18 @@ function SCAutocomplete({
|
|
|
2786
2787
|
event2.defaultMuiPrevented = true;
|
|
2787
2788
|
},
|
|
2788
2789
|
onClick: (event2) => {
|
|
2789
|
-
var _a2;
|
|
2790
|
+
var _a2, _b, _c;
|
|
2790
2791
|
event2.preventDefault();
|
|
2791
2792
|
event2.stopPropagation();
|
|
2792
2793
|
event2.defaultMuiPrevented = true;
|
|
2793
|
-
(_a2 =
|
|
2794
|
+
const savedScroll = (_b = (_a2 = listboxScrollRef.current) == null ? void 0 : _a2.scrollTop) != null ? _b : 0;
|
|
2795
|
+
(_c = item.onComponentClick) == null ? void 0 : _c.call(item, event2, option);
|
|
2794
2796
|
setOpen(true);
|
|
2797
|
+
requestAnimationFrame(() => {
|
|
2798
|
+
if (listboxScrollRef.current) {
|
|
2799
|
+
listboxScrollRef.current.scrollTop = savedScroll;
|
|
2800
|
+
}
|
|
2801
|
+
});
|
|
2795
2802
|
setTimeout(() => {
|
|
2796
2803
|
componentClickActiveRef.current = false;
|
|
2797
2804
|
}, 200);
|
|
@@ -2832,7 +2839,11 @@ function SCAutocomplete({
|
|
|
2832
2839
|
return /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, /* @__PURE__ */ import_react19.default.createElement(
|
|
2833
2840
|
import_material13.Box,
|
|
2834
2841
|
__spreadProps(__spreadValues({
|
|
2835
|
-
ref
|
|
2842
|
+
ref: (node) => {
|
|
2843
|
+
listboxScrollRef.current = node;
|
|
2844
|
+
if (typeof ref === "function") ref(node);
|
|
2845
|
+
else if (ref) ref.current = node;
|
|
2846
|
+
}
|
|
2836
2847
|
}, props), {
|
|
2837
2848
|
sx: __spreadValues({
|
|
2838
2849
|
position: "relative",
|
|
@@ -3725,14 +3736,14 @@ var clampEventToVisibleRange = (event2, currentDate, startHour, endHour) => {
|
|
|
3725
3736
|
|
|
3726
3737
|
// src/Components/Calendario/Views/MonthView.tsx
|
|
3727
3738
|
import_dayjs5.default.extend(import_localeData.default);
|
|
3728
|
-
var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEventClick, onEventHover }) => {
|
|
3739
|
+
var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEventClick, onEventHover, seeDays = false }) => {
|
|
3729
3740
|
const noEvents = events.length === 0;
|
|
3730
3741
|
const days = getMonthDays(currentDate);
|
|
3731
3742
|
const weekDays = Array.from({ length: 7 }, (_, i) => (0, import_dayjs5.default)().day(i));
|
|
3732
3743
|
const [openDrawer, setOpenDrawer] = import_react32.default.useState(false);
|
|
3733
3744
|
const [selectedDay, setSelectedDay] = import_react32.default.useState(null);
|
|
3734
3745
|
const [selectedEvents, setSelectedEvents] = import_react32.default.useState([]);
|
|
3735
|
-
return /* @__PURE__ */ import_react32.default.createElement(import_react32.default.Fragment, null, /* @__PURE__ */ import_react32.default.createElement(import_material21.Box, { width: "100%", sx: { overflowX: "auto" } }, /* @__PURE__ */ import_react32.default.createElement(import_material21.Box, { minWidth: CALENDAR_CONSTANTS.MIN_WIDTH }, /* @__PURE__ */ import_react32.default.createElement(import_material21.Box, { display: "grid", gridTemplateColumns: CALENDAR_CONSTANTS.GRID_TEMPLATE, gap: 0.5, mb: 1 }, weekDays.map((day) => /* @__PURE__ */ import_react32.default.createElement(import_material21.Box, { key: day.day(), textAlign: "center", py: 0.5 }, /* @__PURE__ */ import_react32.default.createElement(import_material21.Typography, { variant: "caption", color: "text.secondary" }, day.format("dddd"))))), isLoading ? /* @__PURE__ */ import_react32.default.createElement(import_material21.Box, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: CALENDAR_CONSTANTS.LOADING_CONTAINER_HEIGHT }, /* @__PURE__ */ import_react32.default.createElement(import_material21.CircularProgress, { sx: { width: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE, height: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE }, variant: "indeterminate" })) :
|
|
3746
|
+
return /* @__PURE__ */ import_react32.default.createElement(import_react32.default.Fragment, null, /* @__PURE__ */ import_react32.default.createElement(import_material21.Box, { width: "100%", sx: { overflowX: "auto" } }, /* @__PURE__ */ import_react32.default.createElement(import_material21.Box, { minWidth: CALENDAR_CONSTANTS.MIN_WIDTH }, /* @__PURE__ */ import_react32.default.createElement(import_material21.Box, { display: "grid", gridTemplateColumns: CALENDAR_CONSTANTS.GRID_TEMPLATE, gap: 0.5, mb: 1 }, weekDays.map((day) => /* @__PURE__ */ import_react32.default.createElement(import_material21.Box, { key: day.day(), textAlign: "center", py: 0.5 }, /* @__PURE__ */ import_react32.default.createElement(import_material21.Typography, { variant: "caption", color: "text.secondary" }, day.format("dddd"))))), isLoading ? /* @__PURE__ */ import_react32.default.createElement(import_material21.Box, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: CALENDAR_CONSTANTS.LOADING_CONTAINER_HEIGHT }, /* @__PURE__ */ import_react32.default.createElement(import_material21.CircularProgress, { sx: { width: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE, height: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE }, variant: "indeterminate" })) : seeDays == false ? /* @__PURE__ */ import_react32.default.createElement(
|
|
3736
3747
|
EmptyState,
|
|
3737
3748
|
{
|
|
3738
3749
|
containerHeight: "calc(100vh - 130px)",
|
|
@@ -3740,7 +3751,7 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3740
3751
|
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
3741
3752
|
icon: /* @__PURE__ */ import_react32.default.createElement(LogoCalendario, null)
|
|
3742
3753
|
}
|
|
3743
|
-
) : /* @__PURE__ */ import_react32.default.createElement(import_material21.Box, { display: "grid", gridTemplateColumns: CALENDAR_CONSTANTS.GRID_TEMPLATE, gap: 0.5 }, days.map((day) => {
|
|
3754
|
+
) : seeDays == true ? /* @__PURE__ */ import_react32.default.createElement(import_material21.Box, { display: "grid", gridTemplateColumns: CALENDAR_CONSTANTS.GRID_TEMPLATE, gap: 0.5 }, days.map((day) => {
|
|
3744
3755
|
const dayEvents = filterEventsForDay(events, day);
|
|
3745
3756
|
const isCurrentMonth = day.month() === currentDate.month();
|
|
3746
3757
|
return /* @__PURE__ */ import_react32.default.createElement(
|
|
@@ -3831,7 +3842,7 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3831
3842
|
)
|
|
3832
3843
|
)
|
|
3833
3844
|
);
|
|
3834
|
-
})))), selectedDay && /* @__PURE__ */ import_react32.default.createElement(
|
|
3845
|
+
})) : null)), selectedDay && /* @__PURE__ */ import_react32.default.createElement(
|
|
3835
3846
|
SCDrawer,
|
|
3836
3847
|
{
|
|
3837
3848
|
width: CALENDAR_CONSTANTS.DRAWER_WIDTH,
|
|
@@ -3872,7 +3883,8 @@ var WeekView = ({
|
|
|
3872
3883
|
onEventClick,
|
|
3873
3884
|
onEventHover,
|
|
3874
3885
|
startHour = 0,
|
|
3875
|
-
endHour = 23
|
|
3886
|
+
endHour = 23,
|
|
3887
|
+
seeDays = false
|
|
3876
3888
|
}) => {
|
|
3877
3889
|
const noEvents = events.length === 0;
|
|
3878
3890
|
const todayString = (0, import_dayjs6.default)().format("YYYY-MM-DD");
|
|
@@ -3916,7 +3928,7 @@ var WeekView = ({
|
|
|
3916
3928
|
/* @__PURE__ */ import_react33.default.createElement(import_material22.Typography, { variant: "h6", color: "text.primary" }, day.format("D")),
|
|
3917
3929
|
/* @__PURE__ */ import_react33.default.createElement(import_material22.Typography, { variant: "caption", color: "text.secondary" }, day.format("dddd"))
|
|
3918
3930
|
);
|
|
3919
|
-
})), isLoading ? /* @__PURE__ */ import_react33.default.createElement(import_material22.Box, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "450px" }, /* @__PURE__ */ import_react33.default.createElement(import_material22.CircularProgress, { sx: { width: "60px", height: "60px" }, variant: "indeterminate" })) : !isLoading &&
|
|
3931
|
+
})), isLoading ? /* @__PURE__ */ import_react33.default.createElement(import_material22.Box, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "450px" }, /* @__PURE__ */ import_react33.default.createElement(import_material22.CircularProgress, { sx: { width: "60px", height: "60px" }, variant: "indeterminate" })) : !isLoading && seeDays == false ? /* @__PURE__ */ import_react33.default.createElement(
|
|
3920
3932
|
EmptyState,
|
|
3921
3933
|
{
|
|
3922
3934
|
containerHeight: "calc(100vh - 130px)",
|
|
@@ -4009,12 +4021,13 @@ var DayView = ({
|
|
|
4009
4021
|
onEventClick,
|
|
4010
4022
|
onEventHover,
|
|
4011
4023
|
startHour = CALENDAR_CONSTANTS.DEFAULT_START_HOUR,
|
|
4012
|
-
endHour = CALENDAR_CONSTANTS.DEFAULT_END_HOUR
|
|
4024
|
+
endHour = CALENDAR_CONSTANTS.DEFAULT_END_HOUR,
|
|
4025
|
+
seeDays
|
|
4013
4026
|
}) => {
|
|
4014
4027
|
const hours = Array.from({ length: endHour - startHour + 1 }, (_, i) => startHour + i);
|
|
4015
4028
|
const dayEvents = filterEventsForDay(events, currentDate);
|
|
4016
4029
|
const noEvents = events.length === 0;
|
|
4017
|
-
return /* @__PURE__ */ import_react34.default.createElement(import_material23.Box, { display: "flex", flexDirection: "column", height: "100%" }, /* @__PURE__ */ import_react34.default.createElement(import_material23.Box, { display: "flex", borderBottom: "1px solid", borderColor: "primary.main", bgcolor: "background.paper" }, /* @__PURE__ */ import_react34.default.createElement(import_material23.Box, { width: CALENDAR_CONSTANTS.SIDEBAR_WIDTH, bgcolor: "background.default", borderBottom: "1px solid", borderColor: "transparent" }), /* @__PURE__ */ import_react34.default.createElement(import_material23.Box, { flex: 1, display: "flex", flexDirection: "column", textAlign: "start", gap: 0.5, py: 1, bgcolor: "primary.50" }, /* @__PURE__ */ import_react34.default.createElement(import_material23.Typography, { variant: "h6", color: "text.secondary" }, currentDate.format("D")), /* @__PURE__ */ import_react34.default.createElement(import_material23.Typography, { variant: "caption", color: "text.secondary" }, currentDate.format("dddd")))), isLoading ? /* @__PURE__ */ import_react34.default.createElement(import_material23.Box, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: CALENDAR_CONSTANTS.LOADING_CONTAINER_HEIGHT }, /* @__PURE__ */ import_react34.default.createElement(import_material23.CircularProgress, { sx: { width: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE, height: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE }, variant: "indeterminate" })) :
|
|
4030
|
+
return /* @__PURE__ */ import_react34.default.createElement(import_material23.Box, { display: "flex", flexDirection: "column", height: "100%" }, /* @__PURE__ */ import_react34.default.createElement(import_material23.Box, { display: "flex", borderBottom: "1px solid", borderColor: "primary.main", bgcolor: "background.paper" }, /* @__PURE__ */ import_react34.default.createElement(import_material23.Box, { width: CALENDAR_CONSTANTS.SIDEBAR_WIDTH, bgcolor: "background.default", borderBottom: "1px solid", borderColor: "transparent" }), /* @__PURE__ */ import_react34.default.createElement(import_material23.Box, { flex: 1, display: "flex", flexDirection: "column", textAlign: "start", gap: 0.5, py: 1, bgcolor: "primary.50" }, /* @__PURE__ */ import_react34.default.createElement(import_material23.Typography, { variant: "h6", color: "text.secondary" }, currentDate.format("D")), /* @__PURE__ */ import_react34.default.createElement(import_material23.Typography, { variant: "caption", color: "text.secondary" }, currentDate.format("dddd")))), isLoading ? /* @__PURE__ */ import_react34.default.createElement(import_material23.Box, { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: CALENDAR_CONSTANTS.LOADING_CONTAINER_HEIGHT }, /* @__PURE__ */ import_react34.default.createElement(import_material23.CircularProgress, { sx: { width: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE, height: CALENDAR_CONSTANTS.LOADING_SPINNER_SIZE }, variant: "indeterminate" })) : seeDays == false ? /* @__PURE__ */ import_react34.default.createElement(
|
|
4018
4031
|
EmptyState,
|
|
4019
4032
|
{
|
|
4020
4033
|
containerHeight: "calc(100vh - 140px)",
|
|
@@ -4129,7 +4142,8 @@ var Calendar = ({
|
|
|
4129
4142
|
toolbar,
|
|
4130
4143
|
isLoading = false,
|
|
4131
4144
|
startHour = CALENDAR_CONSTANTS.DEFAULT_START_HOUR,
|
|
4132
|
-
endHour = CALENDAR_CONSTANTS.DEFAULT_END_HOUR
|
|
4145
|
+
endHour = CALENDAR_CONSTANTS.DEFAULT_END_HOUR,
|
|
4146
|
+
seeDays = false
|
|
4133
4147
|
}) => {
|
|
4134
4148
|
const [view, setView] = (0, import_react36.useState)(initialView);
|
|
4135
4149
|
const { currentDate, navigateDate } = useCalendarNavigation((0, import_dayjs9.default)(), onDateChange);
|
|
@@ -4178,7 +4192,8 @@ var Calendar = ({
|
|
|
4178
4192
|
onDayClick,
|
|
4179
4193
|
onMoreClick,
|
|
4180
4194
|
onEventClick,
|
|
4181
|
-
onEventHover
|
|
4195
|
+
onEventHover,
|
|
4196
|
+
seeDays
|
|
4182
4197
|
}
|
|
4183
4198
|
), view === "week" && /* @__PURE__ */ import_react36.default.createElement(
|
|
4184
4199
|
WeekView,
|
|
@@ -4190,7 +4205,8 @@ var Calendar = ({
|
|
|
4190
4205
|
onEventClick,
|
|
4191
4206
|
onEventHover,
|
|
4192
4207
|
startHour,
|
|
4193
|
-
endHour
|
|
4208
|
+
endHour,
|
|
4209
|
+
seeDays
|
|
4194
4210
|
}
|
|
4195
4211
|
), view === "day" && /* @__PURE__ */ import_react36.default.createElement(
|
|
4196
4212
|
DayView,
|
|
@@ -4200,7 +4216,8 @@ var Calendar = ({
|
|
|
4200
4216
|
onEventClick,
|
|
4201
4217
|
onEventHover,
|
|
4202
4218
|
startHour,
|
|
4203
|
-
endHour
|
|
4219
|
+
endHour,
|
|
4220
|
+
seeDays
|
|
4204
4221
|
}
|
|
4205
4222
|
)));
|
|
4206
4223
|
};
|