componentes-sinco 1.3.2 → 1.3.4

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 CHANGED
@@ -691,6 +691,7 @@ var Attachment = ({
691
691
 
692
692
  // src/Components/Adjuntar/mobile/AdjuntarMobile.tsx
693
693
  var import_react23 = __toESM(require("react"), 1);
694
+ var import_react_dom = require("react-dom");
694
695
  var import_react_webcam = __toESM(require("react-webcam"), 1);
695
696
 
696
697
  // src/Components/Adjuntar/mobile/components/button.tsx
@@ -1445,6 +1446,7 @@ var SCTextField = ({
1445
1446
  required,
1446
1447
  size,
1447
1448
  width = "100%",
1449
+ alignText = "left",
1448
1450
  color,
1449
1451
  background,
1450
1452
  //Funcionales
@@ -1602,7 +1604,7 @@ var SCTextField = ({
1602
1604
  onKeyDown: handleKeyDown,
1603
1605
  onChange: handleInputChange,
1604
1606
  onBlur: handleBlur,
1605
- inputProps: { maxLength: maxLength ? maxLength : 50 },
1607
+ inputProps: { maxLength: maxLength ? maxLength : 50, style: { textAlign: alignText } },
1606
1608
  type: !showPassword && format3 === "password" ? "password" : (format3 || "text").toUpperCase() === "INT" || (format3 || "text").toUpperCase() === "DECIMAL" ? "number" : "text",
1607
1609
  className: format3 === "password" && !showPassword ? "" : "",
1608
1610
  placeholder,
@@ -3011,6 +3013,7 @@ var AttachmentMobile = ({
3011
3013
  }) => {
3012
3014
  const webcamRef = (0, import_react23.useRef)(null);
3013
3015
  const [abrirCamara, setAbrirCamara] = (0, import_react23.useState)(false);
3016
+ const [camReady, setCamReady] = (0, import_react23.useState)(false);
3014
3017
  const [capturedImage, setCapturedImage] = (0, import_react23.useState)(null);
3015
3018
  const [files, setFiles] = (0, import_react23.useState)([]);
3016
3019
  const [fileToDelete, setFileToDelete] = (0, import_react23.useState)(null);
@@ -3030,15 +3033,21 @@ var AttachmentMobile = ({
3030
3033
  }
3031
3034
  const closeCam = () => {
3032
3035
  setAbrirCamara(false);
3036
+ setCamReady(false);
3033
3037
  };
3034
3038
  const openCam = () => {
3035
3039
  setOpen(false);
3040
+ setCamReady(false);
3036
3041
  setAbrirCamara(true);
3037
3042
  };
3038
3043
  let capturedImage2 = null;
3039
3044
  const capture = (0, import_react23.useCallback)((e) => {
3040
3045
  if (webcamRef.current) {
3041
3046
  const imageSrc = webcamRef.current.getScreenshot();
3047
+ if (!imageSrc) {
3048
+ setToast({ open: true, type: "error", mensaje: "La c\xE1mara a\xFAn no est\xE1 lista, intenta de nuevo." });
3049
+ return;
3050
+ }
3042
3051
  setCapturedImage(imageSrc);
3043
3052
  capturedImage2 = imageSrc;
3044
3053
  setOpen(false);
@@ -3251,49 +3260,56 @@ var AttachmentMobile = ({
3251
3260
  ),
3252
3261
  /* @__PURE__ */ import_react23.default.createElement(import_material16.Typography, { variant: "body2", color: "text.secondary" }, option.label)
3253
3262
  ))))
3254
- ), abrirCamara && /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, /* @__PURE__ */ import_react23.default.createElement(import_CancelOutlined.default, { onClick: closeCam, sx: { borderRadius: "50px", height: "35px", width: "35px", zIndex: 2e3, background: "white", position: "absolute", left: `calc(100% - 50px)`, bottom: `calc(100% - 50px)` } }), /* @__PURE__ */ import_react23.default.createElement(import_material16.Stack, { className: "camras" }, /* @__PURE__ */ import_react23.default.createElement(
3255
- import_react_webcam.default,
3256
- {
3257
- audio: false,
3258
- ref: webcamRef,
3259
- width: "100%",
3260
- height: "100%",
3261
- screenshotFormat: "image/jpeg",
3262
- videoConstraints: {
3263
- //facingMode: { exact: "environment" }
3264
- facingMode: "environment"
3265
- //facingMode: "environment" // cámara trasera
3266
- },
3267
- style: {
3268
- position: "fixed",
3269
- // Fijo para cubrir toda la ventana
3270
- top: 0,
3271
- left: 0,
3272
- objectFit: "cover",
3273
- backgroundColor: "black",
3274
- zIndex: 2e3
3275
- // Encima de todo
3276
- }
3277
- }
3278
- ), /* @__PURE__ */ import_react23.default.createElement(
3279
- import_PhotoCamera.default,
3280
- {
3281
- onClick: capture,
3282
- sx: {
3283
- height: "45px",
3284
- width: "45px",
3285
- padding: "6px",
3286
- backgroundColor: "white",
3287
- color: "#1E62A1",
3288
- borderRadius: "50px",
3289
- zIndex: 2100,
3290
- position: "absolute",
3291
- bottom: "10px",
3292
- left: "50%"
3293
- },
3294
- fontSize: "medium"
3295
- }
3296
- ))), files.length > 0 && /* @__PURE__ */ import_react23.default.createElement(
3263
+ ), abrirCamara && (0, import_react_dom.createPortal)(
3264
+ /* @__PURE__ */ import_react23.default.createElement(import_system.Box, { sx: { position: "fixed", inset: 0, zIndex: 2e3 } }, /* @__PURE__ */ import_react23.default.createElement(import_CancelOutlined.default, { onClick: closeCam, sx: { borderRadius: "50px", height: "35px", width: "35px", zIndex: 2100, background: "white", position: "absolute", left: `calc(100% - 50px)`, bottom: `calc(100% - 50px)`, cursor: "pointer" } }), /* @__PURE__ */ import_react23.default.createElement(import_material16.Stack, { className: "camras" }, /* @__PURE__ */ import_react23.default.createElement(
3265
+ import_react_webcam.default,
3266
+ {
3267
+ audio: false,
3268
+ ref: webcamRef,
3269
+ width: "100%",
3270
+ height: "100%",
3271
+ screenshotFormat: "image/jpeg",
3272
+ onUserMedia: () => setCamReady(true),
3273
+ videoConstraints: {
3274
+ //facingMode: { exact: "environment" }
3275
+ facingMode: "environment"
3276
+ //facingMode: "environment" // cámara trasera
3277
+ },
3278
+ style: {
3279
+ position: "fixed",
3280
+ // Fijo para cubrir toda la ventana
3281
+ top: 0,
3282
+ left: 0,
3283
+ objectFit: "cover",
3284
+ backgroundColor: "black",
3285
+ zIndex: 2e3
3286
+ // Encima de todo
3287
+ }
3288
+ }
3289
+ ), /* @__PURE__ */ import_react23.default.createElement(
3290
+ import_PhotoCamera.default,
3291
+ {
3292
+ onClick: camReady ? capture : void 0,
3293
+ sx: {
3294
+ height: "45px",
3295
+ width: "45px",
3296
+ padding: "6px",
3297
+ backgroundColor: "white",
3298
+ color: "#1E62A1",
3299
+ borderRadius: "50px",
3300
+ zIndex: 2100,
3301
+ position: "absolute",
3302
+ bottom: "10px",
3303
+ left: "50%",
3304
+ opacity: camReady ? 1 : 0.5,
3305
+ pointerEvents: camReady ? "auto" : "none",
3306
+ cursor: camReady ? "pointer" : "not-allowed"
3307
+ },
3308
+ fontSize: "medium"
3309
+ }
3310
+ ))),
3311
+ document.body
3312
+ ), files.length > 0 && /* @__PURE__ */ import_react23.default.createElement(
3297
3313
  import_material16.Stack,
3298
3314
  {
3299
3315
  "data-testid": "ContenedorArchivosAdjuntos",
@@ -5878,7 +5894,8 @@ var SCDownloadExcelTable = ({
5878
5894
  downloadButton,
5879
5895
  fileName = "archivo excel",
5880
5896
  data = [],
5881
- columns = []
5897
+ columns = [],
5898
+ extraRowsHeader = []
5882
5899
  }) => {
5883
5900
  const formatValue = (value, type) => {
5884
5901
  if (value === null || value === void 0) return "";
@@ -5898,7 +5915,7 @@ var SCDownloadExcelTable = ({
5898
5915
  return formatValue(resolved, col.type);
5899
5916
  })
5900
5917
  );
5901
- const worksheet = XLSX.utils.aoa_to_sheet([headers, ...rows]);
5918
+ const worksheet = XLSX.utils.aoa_to_sheet([...extraRowsHeader, headers, ...rows]);
5902
5919
  const workbook = XLSX.utils.book_new();
5903
5920
  XLSX.utils.book_append_sheet(workbook, worksheet, "Hoja1");
5904
5921
  XLSX.writeFile(workbook, `${fileName}.xlsx`);
@@ -6174,6 +6191,10 @@ var SCTime = ({
6174
6191
  setIsOpenPopover(false);
6175
6192
  setAnchorEl(null);
6176
6193
  };
6194
+ const handleTimeFieldChange = (newValue) => {
6195
+ const dayjsValue = newValue ? (0, import_dayjs11.default)(newValue) : null;
6196
+ setState(dayjsValue);
6197
+ };
6177
6198
  const handleClose = () => {
6178
6199
  setIsOpenPopover(false);
6179
6200
  setAnchorEl(null);
@@ -6187,6 +6208,7 @@ var SCTime = ({
6187
6208
  required,
6188
6209
  error: hasError,
6189
6210
  onClick: handleTimeFieldClick,
6211
+ onChange: handleTimeFieldChange,
6190
6212
  slotProps: {
6191
6213
  textField: {
6192
6214
  InputProps: {