componentes-sinco 1.0.39 → 1.0.41
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 +54 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.js +53 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -104,6 +104,7 @@ __export(index_exports, {
|
|
|
104
104
|
SCMenu: () => SCMenu,
|
|
105
105
|
SCModal: () => SCModal,
|
|
106
106
|
SCSelect: () => SCSelect,
|
|
107
|
+
SCSnackBar: () => SCSnackBar,
|
|
107
108
|
SCTabs: () => SCTabs,
|
|
108
109
|
SCTextArea: () => SCTextArea,
|
|
109
110
|
SCTextField: () => SCTextField,
|
|
@@ -2124,7 +2125,6 @@ var SCDateRange = ({
|
|
|
2124
2125
|
popper: {
|
|
2125
2126
|
sx: {
|
|
2126
2127
|
zIndex: 1400
|
|
2127
|
-
// muy alto para que quede encima
|
|
2128
2128
|
}
|
|
2129
2129
|
},
|
|
2130
2130
|
textField: ({ position }) => {
|
|
@@ -4995,6 +4995,7 @@ var AttachmentMobile = ({
|
|
|
4995
4995
|
maxSize = 400,
|
|
4996
4996
|
fileAccepted = "",
|
|
4997
4997
|
initialFiles,
|
|
4998
|
+
setAttachedFiles,
|
|
4998
4999
|
deleteAction,
|
|
4999
5000
|
children,
|
|
5000
5001
|
onChange,
|
|
@@ -5044,9 +5045,11 @@ var AttachmentMobile = ({
|
|
|
5044
5045
|
u8arr[n] = bstr.charCodeAt(n);
|
|
5045
5046
|
}
|
|
5046
5047
|
const fechaActual = new Date(Date.now());
|
|
5047
|
-
const fechaConFormato = fechaActual.getFullYear() + "" + (fechaActual.getMonth() + 1) + fechaActual.getDate();
|
|
5048
|
+
const fechaConFormato = fechaActual.getFullYear() + "" + (fechaActual.getMonth() + 1) + fechaActual.getDate() + fechaActual.getHours() + fechaActual.getMinutes() + fechaActual.getSeconds();
|
|
5048
5049
|
const capturedFile = new File([u8arr], `photo_${fechaConFormato}.jpg`, { type: mime });
|
|
5049
5050
|
newFiles = [capturedFile];
|
|
5051
|
+
setCapturedImage(null);
|
|
5052
|
+
capturedImage2 = null;
|
|
5050
5053
|
}
|
|
5051
5054
|
if (!newFiles) return;
|
|
5052
5055
|
const nuevosArchivos = [];
|
|
@@ -5110,6 +5113,7 @@ var AttachmentMobile = ({
|
|
|
5110
5113
|
if (nuevosArchivos.length > 0) {
|
|
5111
5114
|
setFiles((prevFiles) => {
|
|
5112
5115
|
const updatedFiles = [...prevFiles, ...nuevosArchivos];
|
|
5116
|
+
setAttachedFiles(updatedFiles);
|
|
5113
5117
|
if (archivosValidos.length > 0) {
|
|
5114
5118
|
onChange == null ? void 0 : onChange([
|
|
5115
5119
|
...archivosValidos,
|
|
@@ -5131,6 +5135,7 @@ var AttachmentMobile = ({
|
|
|
5131
5135
|
(file) => !(file.name === fileToRemove.name && file.size === fileToRemove.size)
|
|
5132
5136
|
);
|
|
5133
5137
|
setFiles(updatedFiles);
|
|
5138
|
+
setAttachedFiles(updatedFiles);
|
|
5134
5139
|
if (onChange) {
|
|
5135
5140
|
const remainingValidFiles = updatedFiles.filter((f) => !f.uploadError).map((f) => new File([], f.name, { type: f.type }));
|
|
5136
5141
|
onChange(remainingValidFiles);
|
|
@@ -5166,6 +5171,7 @@ var AttachmentMobile = ({
|
|
|
5166
5171
|
(0, import_react52.useEffect)(() => {
|
|
5167
5172
|
if (initialFiles && initialFiles.length > 0) {
|
|
5168
5173
|
setFiles(initialFiles);
|
|
5174
|
+
setAttachedFiles(initialFiles);
|
|
5169
5175
|
}
|
|
5170
5176
|
}, []);
|
|
5171
5177
|
return /* @__PURE__ */ import_react52.default.createElement(import_system.Box, { display: "flex", flexDirection: "column", gap: 1 }, /* @__PURE__ */ import_react52.default.createElement(import_system.Box, { display: "flex", width: "100%", justifyContent: "space-between", alignItems: "center", sx }, children, /* @__PURE__ */ import_react52.default.createElement(
|
|
@@ -5346,11 +5352,51 @@ var AttachmentMobile = ({
|
|
|
5346
5352
|
));
|
|
5347
5353
|
};
|
|
5348
5354
|
|
|
5355
|
+
// src/Components/SCSnackbar.tsx
|
|
5356
|
+
var import_react53 = __toESM(require("react"), 1);
|
|
5357
|
+
var import_Alert = __toESM(require("@mui/material/Alert"), 1);
|
|
5358
|
+
var import_es4 = require("dayjs/locale/es");
|
|
5359
|
+
var import_Snackbar = __toESM(require("@mui/material/Snackbar"), 1);
|
|
5360
|
+
var SCSnackBar = ({
|
|
5361
|
+
type = "success",
|
|
5362
|
+
close = true,
|
|
5363
|
+
openState,
|
|
5364
|
+
setOpenState,
|
|
5365
|
+
mensaje,
|
|
5366
|
+
duration = 3e3,
|
|
5367
|
+
position = "Center"
|
|
5368
|
+
}) => {
|
|
5369
|
+
const posicionVertical = position == "Center" ? "bottom" : position.split("-")[1] == "Up" ? "top" : "bottom";
|
|
5370
|
+
const posicionHorizontal = position == "Center" ? "center" : position.split("-")[0] == "Left" ? "left" : "right";
|
|
5371
|
+
const handleClose = (event2, reason) => {
|
|
5372
|
+
if (reason === "clickaway") {
|
|
5373
|
+
return;
|
|
5374
|
+
}
|
|
5375
|
+
setOpenState(false);
|
|
5376
|
+
};
|
|
5377
|
+
return /* @__PURE__ */ import_react53.default.createElement(import_react53.default.Fragment, null, /* @__PURE__ */ import_react53.default.createElement(
|
|
5378
|
+
import_Snackbar.default,
|
|
5379
|
+
__spreadValues({
|
|
5380
|
+
anchorOrigin: { vertical: posicionVertical, horizontal: posicionHorizontal },
|
|
5381
|
+
open: openState,
|
|
5382
|
+
autoHideDuration: duration
|
|
5383
|
+
}, close ? { onClose: handleClose } : {}),
|
|
5384
|
+
/* @__PURE__ */ import_react53.default.createElement(
|
|
5385
|
+
import_Alert.default,
|
|
5386
|
+
__spreadProps(__spreadValues({}, close ? { onClose: handleClose } : {}), {
|
|
5387
|
+
severity: type,
|
|
5388
|
+
sx: { backgroundColor: type == "success" ? "success.50" : type == "error" ? "#F9E8E8" : type == "warning" ? "#FFF0E0" : "#E6F3F8" }
|
|
5389
|
+
}),
|
|
5390
|
+
mensaje
|
|
5391
|
+
)
|
|
5392
|
+
));
|
|
5393
|
+
};
|
|
5394
|
+
|
|
5349
5395
|
// src/Theme/index.ts
|
|
5350
5396
|
var import_styles3 = require("@mui/material/styles");
|
|
5351
5397
|
|
|
5352
5398
|
// src/Theme/components.ts
|
|
5353
|
-
var
|
|
5399
|
+
var import_react54 = __toESM(require("react"), 1);
|
|
5354
5400
|
var import_icons_material14 = require("@mui/icons-material");
|
|
5355
5401
|
var components = {
|
|
5356
5402
|
MuiSelect: {
|
|
@@ -6048,10 +6094,10 @@ var components = {
|
|
|
6048
6094
|
MuiAlert: {
|
|
6049
6095
|
defaultProps: {
|
|
6050
6096
|
iconMapping: {
|
|
6051
|
-
success:
|
|
6052
|
-
error:
|
|
6053
|
-
warning:
|
|
6054
|
-
info:
|
|
6097
|
+
success: import_react54.default.createElement(import_icons_material14.CheckCircleRounded),
|
|
6098
|
+
error: import_react54.default.createElement(import_icons_material14.ErrorRounded),
|
|
6099
|
+
warning: import_react54.default.createElement(import_icons_material14.WarningRounded),
|
|
6100
|
+
info: import_react54.default.createElement(import_icons_material14.InfoRounded)
|
|
6055
6101
|
}
|
|
6056
6102
|
},
|
|
6057
6103
|
variants: [
|
|
@@ -7116,6 +7162,7 @@ var ADCSincoTheme = (0, import_styles3.createTheme)(__spreadValues({}, ADCTheme)
|
|
|
7116
7162
|
SCMenu,
|
|
7117
7163
|
SCModal,
|
|
7118
7164
|
SCSelect,
|
|
7165
|
+
SCSnackBar,
|
|
7119
7166
|
SCTabs,
|
|
7120
7167
|
SCTextArea,
|
|
7121
7168
|
SCTextField,
|