componentes-sinco 1.0.8 → 1.0.9
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 +95 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +94 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -68,6 +68,7 @@ __export(src_exports, {
|
|
|
68
68
|
PageHeader: () => PageHeader,
|
|
69
69
|
SCAutocomplete: () => SCAutocomplete,
|
|
70
70
|
SCCalendarSwipeable: () => SCCalendarSwipeable,
|
|
71
|
+
SCCard: () => SCCard,
|
|
71
72
|
SCDataGrid: () => SCDataGrid,
|
|
72
73
|
SCDataGridInitial: () => SCDataGridInitial,
|
|
73
74
|
SCDateRange: () => SCDateRange,
|
|
@@ -2907,7 +2908,6 @@ var CalendarToolbar = ({
|
|
|
2907
2908
|
};
|
|
2908
2909
|
const getFormattedDate = () => {
|
|
2909
2910
|
const sunday = labelDate.day(0);
|
|
2910
|
-
const saturday = sunday.add(6, "day");
|
|
2911
2911
|
if (view === "month") {
|
|
2912
2912
|
const textMonth = labelDate.format("MMMM YYYY");
|
|
2913
2913
|
return textMonth.charAt(0).toUpperCase() + textMonth.slice(1);
|
|
@@ -3042,7 +3042,7 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
|
3042
3042
|
onMouseEnter: handlePopoverOpen,
|
|
3043
3043
|
onMouseLeave: handlePopoverClose
|
|
3044
3044
|
},
|
|
3045
|
-
|
|
3045
|
+
event2.title.charAt(0).toUpperCase() + event2.title.slice(1).toLowerCase()
|
|
3046
3046
|
),
|
|
3047
3047
|
/* @__PURE__ */ import_react25.default.createElement(
|
|
3048
3048
|
import_material18.Popover,
|
|
@@ -3062,7 +3062,7 @@ var CalendarEventCard = ({ event: event2, color, sx, onClick, onHover }) => {
|
|
|
3062
3062
|
onClose: handlePopoverClose,
|
|
3063
3063
|
disableRestoreFocus: true
|
|
3064
3064
|
},
|
|
3065
|
-
onHover ? onHover(event2) :
|
|
3065
|
+
onHover ? onHover(event2) : " "
|
|
3066
3066
|
)
|
|
3067
3067
|
)
|
|
3068
3068
|
);
|
|
@@ -3478,9 +3478,15 @@ var Calendar = ({
|
|
|
3478
3478
|
const handleNavigate = (action) => {
|
|
3479
3479
|
let newDate = currentDate;
|
|
3480
3480
|
const unit = view === "month" ? "month" : "day";
|
|
3481
|
-
if (action === "PREV")
|
|
3482
|
-
|
|
3483
|
-
|
|
3481
|
+
if (action === "PREV") {
|
|
3482
|
+
if (view === "day") newDate = currentDate.subtract(1, "day");
|
|
3483
|
+
if (view === "week") newDate = currentDate.subtract(1, "week");
|
|
3484
|
+
if (view === "month") newDate = currentDate.subtract(1, "month");
|
|
3485
|
+
} else if (action === "NEXT") {
|
|
3486
|
+
if (view === "day") newDate = currentDate.add(1, "day");
|
|
3487
|
+
if (view === "week") newDate = currentDate.add(1, "week");
|
|
3488
|
+
if (view === "month") newDate = currentDate.add(1, "month");
|
|
3489
|
+
} else if (action === "TODAY") newDate = (0, import_dayjs7.default)();
|
|
3484
3490
|
setCurrentDate(newDate);
|
|
3485
3491
|
};
|
|
3486
3492
|
return /* @__PURE__ */ import_react29.default.createElement(import_material22.Box, null, /* @__PURE__ */ import_react29.default.createElement(
|
|
@@ -3684,11 +3690,88 @@ var SCTime = ({
|
|
|
3684
3690
|
)));
|
|
3685
3691
|
};
|
|
3686
3692
|
|
|
3693
|
+
// src/Components/SCCard.tsx
|
|
3694
|
+
var import_react31 = __toESM(require("react"), 1);
|
|
3695
|
+
var import_material24 = require("@mui/material");
|
|
3696
|
+
var import_IconButton = __toESM(require("@mui/material/IconButton"), 1);
|
|
3697
|
+
var import_Card = __toESM(require("@mui/material/Card"), 1);
|
|
3698
|
+
var import_CardHeader = __toESM(require("@mui/material/CardHeader"), 1);
|
|
3699
|
+
var import_CardMedia = __toESM(require("@mui/material/CardMedia"), 1);
|
|
3700
|
+
var import_CardContent = __toESM(require("@mui/material/CardContent"), 1);
|
|
3701
|
+
var import_CardActions = __toESM(require("@mui/material/CardActions"), 1);
|
|
3702
|
+
var import_Collapse = __toESM(require("@mui/material/Collapse"), 1);
|
|
3703
|
+
var import_ExpandMore = __toESM(require("@mui/icons-material/ExpandMore"), 1);
|
|
3704
|
+
var Muicon8 = __toESM(require("@mui/icons-material"), 1);
|
|
3705
|
+
var SCCard = ({ title, image, iconTitle, actionsTitle, subtitle, content, actions, expand }) => {
|
|
3706
|
+
let iconTitleValidation = "";
|
|
3707
|
+
let IconTitle;
|
|
3708
|
+
const [expanded, setExpanded] = import_react31.default.useState(false);
|
|
3709
|
+
if (iconTitle) {
|
|
3710
|
+
if (Muicon8[iconTitle] == void 0) {
|
|
3711
|
+
if (iconTitle && import_react31.default.isValidElement(iconTitle) && iconTitle.type == void 0) {
|
|
3712
|
+
iconTitleValidation = "image";
|
|
3713
|
+
IconTitle = iconTitle;
|
|
3714
|
+
} else {
|
|
3715
|
+
iconTitleValidation = "icon";
|
|
3716
|
+
IconTitle = iconTitle;
|
|
3717
|
+
}
|
|
3718
|
+
} else {
|
|
3719
|
+
iconTitleValidation = "icon";
|
|
3720
|
+
IconTitle = Muicon8[iconTitle];
|
|
3721
|
+
}
|
|
3722
|
+
}
|
|
3723
|
+
const handleExpandClick = () => {
|
|
3724
|
+
setExpanded(!expanded);
|
|
3725
|
+
};
|
|
3726
|
+
return /* @__PURE__ */ import_react31.default.createElement(import_Card.default, { sx: { maxWidth: 345 } }, title && /* @__PURE__ */ import_react31.default.createElement(
|
|
3727
|
+
import_CardHeader.default,
|
|
3728
|
+
{
|
|
3729
|
+
avatar: iconTitle ? iconTitleValidation === "image" ? /* @__PURE__ */ import_react31.default.createElement(import_material24.Box, { sx: { marginRight: "16px", width: "44px", height: "44px", borderRadius: "1px" } }, /* @__PURE__ */ import_react31.default.createElement("img", { src: IconTitle, width: "44px", height: "44px" })) : /* @__PURE__ */ import_react31.default.createElement(import_material24.SvgIcon, { color: "action", fontSize: "small", component: IconTitle, sx: { marginRight: "16px" } }) : void 0,
|
|
3730
|
+
action: (expand == null ? void 0 : expand.position) == "top" ? (expand == null ? void 0 : expand.type) === "text" ? /* @__PURE__ */ import_react31.default.createElement(import_material24.Button, { onClick: handleExpandClick, sx: { marginRight: "auto" } }, "Expandir") : (expand == null ? void 0 : expand.type) === "icon" && /* @__PURE__ */ import_react31.default.createElement(import_IconButton.default, { onClick: handleExpandClick, sx: { marginRight: "auto" }, size: "small" }, /* @__PURE__ */ import_react31.default.createElement(import_ExpandMore.default, { fontSize: "small" })) : actionsTitle,
|
|
3731
|
+
title,
|
|
3732
|
+
subheader: subtitle,
|
|
3733
|
+
sx: {
|
|
3734
|
+
"& .MuiCardHeader-title": {
|
|
3735
|
+
fontSize: "14px",
|
|
3736
|
+
color: "text.primary"
|
|
3737
|
+
},
|
|
3738
|
+
"& .MuiCardHeader-subheader": {
|
|
3739
|
+
fontSize: "13px",
|
|
3740
|
+
color: "text.secondary"
|
|
3741
|
+
},
|
|
3742
|
+
"& .MuiCardHeader-action": {
|
|
3743
|
+
height: "40px !important",
|
|
3744
|
+
display: "flex",
|
|
3745
|
+
alignItems: "center"
|
|
3746
|
+
}
|
|
3747
|
+
}
|
|
3748
|
+
}
|
|
3749
|
+
), image && /* @__PURE__ */ import_react31.default.createElement(
|
|
3750
|
+
import_CardMedia.default,
|
|
3751
|
+
{
|
|
3752
|
+
component: "img",
|
|
3753
|
+
height: "194",
|
|
3754
|
+
image
|
|
3755
|
+
}
|
|
3756
|
+
), content && /* @__PURE__ */ import_react31.default.createElement(import_CardContent.default, { sx: { padding: "8px 16px !important" } }, content), ((expand == null ? void 0 : expand.position) == "bottom" || actions != void 0) && /* @__PURE__ */ import_react31.default.createElement(import_CardActions.default, { disableSpacing: true, sx: { justifyContent: "flex-end" } }, (expand == null ? void 0 : expand.position) === "bottom" ? (expand == null ? void 0 : expand.type) === "text" ? /* @__PURE__ */ import_react31.default.createElement(import_material24.Button, { onClick: handleExpandClick, sx: { marginRight: "auto" } }, "Expandir") : (expand == null ? void 0 : expand.type) === "icon" && /* @__PURE__ */ import_react31.default.createElement(import_IconButton.default, { onClick: handleExpandClick, sx: { marginRight: "auto" } }, /* @__PURE__ */ import_react31.default.createElement(import_ExpandMore.default, null)) : null, actions && actions.length > 0 ? actions.map((action, index) => /* @__PURE__ */ import_react31.default.createElement(
|
|
3757
|
+
import_material24.Button,
|
|
3758
|
+
{
|
|
3759
|
+
key: index,
|
|
3760
|
+
size: "small",
|
|
3761
|
+
color: action.color || "primary",
|
|
3762
|
+
variant: action.variant || "text",
|
|
3763
|
+
onClick: action.fn,
|
|
3764
|
+
disabled: action.disabled || false
|
|
3765
|
+
},
|
|
3766
|
+
action.text
|
|
3767
|
+
)) : ""), expand && /* @__PURE__ */ import_react31.default.createElement(import_Collapse.default, { in: expanded, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ import_react31.default.createElement(import_CardContent.default, { sx: { padding: "8px 16px !important" } }, expand.content)));
|
|
3768
|
+
};
|
|
3769
|
+
|
|
3687
3770
|
// src/Theme/index.ts
|
|
3688
3771
|
var import_styles3 = require("@mui/material/styles");
|
|
3689
3772
|
|
|
3690
3773
|
// src/Theme/components.ts
|
|
3691
|
-
var
|
|
3774
|
+
var import_react32 = __toESM(require("react"), 1);
|
|
3692
3775
|
var import_icons_material11 = require("@mui/icons-material");
|
|
3693
3776
|
var components = {
|
|
3694
3777
|
MuiSelect: {
|
|
@@ -4386,10 +4469,10 @@ var components = {
|
|
|
4386
4469
|
MuiAlert: {
|
|
4387
4470
|
defaultProps: {
|
|
4388
4471
|
iconMapping: {
|
|
4389
|
-
success:
|
|
4390
|
-
error:
|
|
4391
|
-
warning:
|
|
4392
|
-
info:
|
|
4472
|
+
success: import_react32.default.createElement(import_icons_material11.CheckCircleRounded),
|
|
4473
|
+
error: import_react32.default.createElement(import_icons_material11.ErrorRounded),
|
|
4474
|
+
warning: import_react32.default.createElement(import_icons_material11.WarningRounded),
|
|
4475
|
+
info: import_react32.default.createElement(import_icons_material11.InfoRounded)
|
|
4393
4476
|
}
|
|
4394
4477
|
},
|
|
4395
4478
|
variants: [
|
|
@@ -5438,6 +5521,7 @@ var ADCSincoTheme = (0, import_styles3.createTheme)(__spreadValues({}, ADCTheme)
|
|
|
5438
5521
|
PageHeader,
|
|
5439
5522
|
SCAutocomplete,
|
|
5440
5523
|
SCCalendarSwipeable,
|
|
5524
|
+
SCCard,
|
|
5441
5525
|
SCDataGrid,
|
|
5442
5526
|
SCDataGridInitial,
|
|
5443
5527
|
SCDateRange,
|