componentes-sinco 1.2.1 → 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 +18 -12
- 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 +18 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3736,14 +3736,14 @@ var clampEventToVisibleRange = (event2, currentDate, startHour, endHour) => {
|
|
|
3736
3736
|
|
|
3737
3737
|
// src/Components/Calendario/Views/MonthView.tsx
|
|
3738
3738
|
import_dayjs5.default.extend(import_localeData.default);
|
|
3739
|
-
var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEventClick, onEventHover }) => {
|
|
3739
|
+
var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEventClick, onEventHover, seeDays = false }) => {
|
|
3740
3740
|
const noEvents = events.length === 0;
|
|
3741
3741
|
const days = getMonthDays(currentDate);
|
|
3742
3742
|
const weekDays = Array.from({ length: 7 }, (_, i) => (0, import_dayjs5.default)().day(i));
|
|
3743
3743
|
const [openDrawer, setOpenDrawer] = import_react32.default.useState(false);
|
|
3744
3744
|
const [selectedDay, setSelectedDay] = import_react32.default.useState(null);
|
|
3745
3745
|
const [selectedEvents, setSelectedEvents] = import_react32.default.useState([]);
|
|
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" })) :
|
|
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(
|
|
3747
3747
|
EmptyState,
|
|
3748
3748
|
{
|
|
3749
3749
|
containerHeight: "calc(100vh - 130px)",
|
|
@@ -3751,7 +3751,7 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3751
3751
|
subtitle: "Selecciona un mec\xE1nico y as\xEDgnale las actividades a realizar.",
|
|
3752
3752
|
icon: /* @__PURE__ */ import_react32.default.createElement(LogoCalendario, null)
|
|
3753
3753
|
}
|
|
3754
|
-
) : /* @__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) => {
|
|
3755
3755
|
const dayEvents = filterEventsForDay(events, day);
|
|
3756
3756
|
const isCurrentMonth = day.month() === currentDate.month();
|
|
3757
3757
|
return /* @__PURE__ */ import_react32.default.createElement(
|
|
@@ -3842,7 +3842,7 @@ var MonthView = ({ events, isLoading, onDayClick, onMoreClick, currentDate, onEv
|
|
|
3842
3842
|
)
|
|
3843
3843
|
)
|
|
3844
3844
|
);
|
|
3845
|
-
})))), selectedDay && /* @__PURE__ */ import_react32.default.createElement(
|
|
3845
|
+
})) : null)), selectedDay && /* @__PURE__ */ import_react32.default.createElement(
|
|
3846
3846
|
SCDrawer,
|
|
3847
3847
|
{
|
|
3848
3848
|
width: CALENDAR_CONSTANTS.DRAWER_WIDTH,
|
|
@@ -3883,7 +3883,8 @@ var WeekView = ({
|
|
|
3883
3883
|
onEventClick,
|
|
3884
3884
|
onEventHover,
|
|
3885
3885
|
startHour = 0,
|
|
3886
|
-
endHour = 23
|
|
3886
|
+
endHour = 23,
|
|
3887
|
+
seeDays = false
|
|
3887
3888
|
}) => {
|
|
3888
3889
|
const noEvents = events.length === 0;
|
|
3889
3890
|
const todayString = (0, import_dayjs6.default)().format("YYYY-MM-DD");
|
|
@@ -3927,7 +3928,7 @@ var WeekView = ({
|
|
|
3927
3928
|
/* @__PURE__ */ import_react33.default.createElement(import_material22.Typography, { variant: "h6", color: "text.primary" }, day.format("D")),
|
|
3928
3929
|
/* @__PURE__ */ import_react33.default.createElement(import_material22.Typography, { variant: "caption", color: "text.secondary" }, day.format("dddd"))
|
|
3929
3930
|
);
|
|
3930
|
-
})), 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(
|
|
3931
3932
|
EmptyState,
|
|
3932
3933
|
{
|
|
3933
3934
|
containerHeight: "calc(100vh - 130px)",
|
|
@@ -4020,12 +4021,13 @@ var DayView = ({
|
|
|
4020
4021
|
onEventClick,
|
|
4021
4022
|
onEventHover,
|
|
4022
4023
|
startHour = CALENDAR_CONSTANTS.DEFAULT_START_HOUR,
|
|
4023
|
-
endHour = CALENDAR_CONSTANTS.DEFAULT_END_HOUR
|
|
4024
|
+
endHour = CALENDAR_CONSTANTS.DEFAULT_END_HOUR,
|
|
4025
|
+
seeDays
|
|
4024
4026
|
}) => {
|
|
4025
4027
|
const hours = Array.from({ length: endHour - startHour + 1 }, (_, i) => startHour + i);
|
|
4026
4028
|
const dayEvents = filterEventsForDay(events, currentDate);
|
|
4027
4029
|
const noEvents = events.length === 0;
|
|
4028
|
-
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(
|
|
4029
4031
|
EmptyState,
|
|
4030
4032
|
{
|
|
4031
4033
|
containerHeight: "calc(100vh - 140px)",
|
|
@@ -4140,7 +4142,8 @@ var Calendar = ({
|
|
|
4140
4142
|
toolbar,
|
|
4141
4143
|
isLoading = false,
|
|
4142
4144
|
startHour = CALENDAR_CONSTANTS.DEFAULT_START_HOUR,
|
|
4143
|
-
endHour = CALENDAR_CONSTANTS.DEFAULT_END_HOUR
|
|
4145
|
+
endHour = CALENDAR_CONSTANTS.DEFAULT_END_HOUR,
|
|
4146
|
+
seeDays = false
|
|
4144
4147
|
}) => {
|
|
4145
4148
|
const [view, setView] = (0, import_react36.useState)(initialView);
|
|
4146
4149
|
const { currentDate, navigateDate } = useCalendarNavigation((0, import_dayjs9.default)(), onDateChange);
|
|
@@ -4189,7 +4192,8 @@ var Calendar = ({
|
|
|
4189
4192
|
onDayClick,
|
|
4190
4193
|
onMoreClick,
|
|
4191
4194
|
onEventClick,
|
|
4192
|
-
onEventHover
|
|
4195
|
+
onEventHover,
|
|
4196
|
+
seeDays
|
|
4193
4197
|
}
|
|
4194
4198
|
), view === "week" && /* @__PURE__ */ import_react36.default.createElement(
|
|
4195
4199
|
WeekView,
|
|
@@ -4201,7 +4205,8 @@ var Calendar = ({
|
|
|
4201
4205
|
onEventClick,
|
|
4202
4206
|
onEventHover,
|
|
4203
4207
|
startHour,
|
|
4204
|
-
endHour
|
|
4208
|
+
endHour,
|
|
4209
|
+
seeDays
|
|
4205
4210
|
}
|
|
4206
4211
|
), view === "day" && /* @__PURE__ */ import_react36.default.createElement(
|
|
4207
4212
|
DayView,
|
|
@@ -4211,7 +4216,8 @@ var Calendar = ({
|
|
|
4211
4216
|
onEventClick,
|
|
4212
4217
|
onEventHover,
|
|
4213
4218
|
startHour,
|
|
4214
|
-
endHour
|
|
4219
|
+
endHour,
|
|
4220
|
+
seeDays
|
|
4215
4221
|
}
|
|
4216
4222
|
)));
|
|
4217
4223
|
};
|