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.d.cts CHANGED
@@ -445,6 +445,7 @@ interface SCTextFieldProps {
445
445
  };
446
446
  size?: "small" | "medium";
447
447
  variant?: "outlined" | "filled" | "standard";
448
+ alignText?: "left" | "right" | "center";
448
449
  maxLength?: number;
449
450
  disabled?: boolean;
450
451
  required?: boolean;
@@ -455,7 +456,7 @@ interface SCTextFieldProps {
455
456
  onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
456
457
  }
457
458
 
458
- declare const SCTextField: ({ title, iconTitle, infoTitle, label, placeholder, infoElement, iconInputStart, iconInputEnd, maxLength, variant, format, disabled, required, size, width, color, background, setState, state, onChange, onBlur, onKeyDown, }: SCTextFieldProps) => React__default.JSX.Element;
459
+ declare const SCTextField: ({ title, iconTitle, infoTitle, label, placeholder, infoElement, iconInputStart, iconInputEnd, maxLength, variant, format, disabled, required, size, width, alignText, color, background, setState, state, onChange, onBlur, onKeyDown, }: SCTextFieldProps) => React__default.JSX.Element;
459
460
 
460
461
  interface SCAccordionProps {
461
462
  title?: string | React__default.ReactNode;
@@ -666,8 +667,9 @@ interface SCDownloadExcelTableProps {
666
667
  fileName?: string;
667
668
  data?: Record<string, any>[];
668
669
  columns?: ColumnDef[];
670
+ extraRowsHeader?: (string | number | null | undefined | any)[][];
669
671
  }
670
- declare const SCDownloadExcelTable: ({ downloadButton, fileName, data, columns, }: SCDownloadExcelTableProps) => React__default.JSX.Element;
672
+ declare const SCDownloadExcelTable: ({ downloadButton, fileName, data, columns, extraRowsHeader, }: SCDownloadExcelTableProps) => React__default.JSX.Element;
671
673
 
672
674
  interface Option$2 {
673
675
  title?: string;
package/dist/index.d.ts CHANGED
@@ -445,6 +445,7 @@ interface SCTextFieldProps {
445
445
  };
446
446
  size?: "small" | "medium";
447
447
  variant?: "outlined" | "filled" | "standard";
448
+ alignText?: "left" | "right" | "center";
448
449
  maxLength?: number;
449
450
  disabled?: boolean;
450
451
  required?: boolean;
@@ -455,7 +456,7 @@ interface SCTextFieldProps {
455
456
  onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
456
457
  }
457
458
 
458
- declare const SCTextField: ({ title, iconTitle, infoTitle, label, placeholder, infoElement, iconInputStart, iconInputEnd, maxLength, variant, format, disabled, required, size, width, color, background, setState, state, onChange, onBlur, onKeyDown, }: SCTextFieldProps) => React__default.JSX.Element;
459
+ declare const SCTextField: ({ title, iconTitle, infoTitle, label, placeholder, infoElement, iconInputStart, iconInputEnd, maxLength, variant, format, disabled, required, size, width, alignText, color, background, setState, state, onChange, onBlur, onKeyDown, }: SCTextFieldProps) => React__default.JSX.Element;
459
460
 
460
461
  interface SCAccordionProps {
461
462
  title?: string | React__default.ReactNode;
@@ -666,8 +667,9 @@ interface SCDownloadExcelTableProps {
666
667
  fileName?: string;
667
668
  data?: Record<string, any>[];
668
669
  columns?: ColumnDef[];
670
+ extraRowsHeader?: (string | number | null | undefined | any)[][];
669
671
  }
670
- declare const SCDownloadExcelTable: ({ downloadButton, fileName, data, columns, }: SCDownloadExcelTableProps) => React__default.JSX.Element;
672
+ declare const SCDownloadExcelTable: ({ downloadButton, fileName, data, columns, extraRowsHeader, }: SCDownloadExcelTableProps) => React__default.JSX.Element;
671
673
 
672
674
  interface Option$2 {
673
675
  title?: string;
package/dist/index.js CHANGED
@@ -605,6 +605,7 @@ var Attachment = ({
605
605
 
606
606
  // src/Components/Adjuntar/mobile/AdjuntarMobile.tsx
607
607
  import React19, { useEffect as useEffect11, useRef as useRef3, useState as useState13, useCallback as useCallback2 } from "react";
608
+ import { createPortal } from "react-dom";
608
609
  import Webcam from "react-webcam";
609
610
 
610
611
  // src/Components/Adjuntar/mobile/components/button.tsx
@@ -1359,6 +1360,7 @@ var SCTextField = ({
1359
1360
  required,
1360
1361
  size,
1361
1362
  width = "100%",
1363
+ alignText = "left",
1362
1364
  color,
1363
1365
  background,
1364
1366
  //Funcionales
@@ -1516,7 +1518,7 @@ var SCTextField = ({
1516
1518
  onKeyDown: handleKeyDown,
1517
1519
  onChange: handleInputChange,
1518
1520
  onBlur: handleBlur,
1519
- inputProps: { maxLength: maxLength ? maxLength : 50 },
1521
+ inputProps: { maxLength: maxLength ? maxLength : 50, style: { textAlign: alignText } },
1520
1522
  type: !showPassword && format3 === "password" ? "password" : (format3 || "text").toUpperCase() === "INT" || (format3 || "text").toUpperCase() === "DECIMAL" ? "number" : "text",
1521
1523
  className: format3 === "password" && !showPassword ? "" : "",
1522
1524
  placeholder,
@@ -2925,6 +2927,7 @@ var AttachmentMobile = ({
2925
2927
  }) => {
2926
2928
  const webcamRef = useRef3(null);
2927
2929
  const [abrirCamara, setAbrirCamara] = useState13(false);
2930
+ const [camReady, setCamReady] = useState13(false);
2928
2931
  const [capturedImage, setCapturedImage] = useState13(null);
2929
2932
  const [files, setFiles] = useState13([]);
2930
2933
  const [fileToDelete, setFileToDelete] = useState13(null);
@@ -2944,15 +2947,21 @@ var AttachmentMobile = ({
2944
2947
  }
2945
2948
  const closeCam = () => {
2946
2949
  setAbrirCamara(false);
2950
+ setCamReady(false);
2947
2951
  };
2948
2952
  const openCam = () => {
2949
2953
  setOpen(false);
2954
+ setCamReady(false);
2950
2955
  setAbrirCamara(true);
2951
2956
  };
2952
2957
  let capturedImage2 = null;
2953
2958
  const capture = useCallback2((e) => {
2954
2959
  if (webcamRef.current) {
2955
2960
  const imageSrc = webcamRef.current.getScreenshot();
2961
+ if (!imageSrc) {
2962
+ setToast({ open: true, type: "error", mensaje: "La c\xE1mara a\xFAn no est\xE1 lista, intenta de nuevo." });
2963
+ return;
2964
+ }
2956
2965
  setCapturedImage(imageSrc);
2957
2966
  capturedImage2 = imageSrc;
2958
2967
  setOpen(false);
@@ -3165,49 +3174,56 @@ var AttachmentMobile = ({
3165
3174
  ),
3166
3175
  /* @__PURE__ */ React19.createElement(Typography9, { variant: "body2", color: "text.secondary" }, option.label)
3167
3176
  ))))
3168
- ), abrirCamara && /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(CancelOutlinedIcon, { onClick: closeCam, sx: { borderRadius: "50px", height: "35px", width: "35px", zIndex: 2e3, background: "white", position: "absolute", left: `calc(100% - 50px)`, bottom: `calc(100% - 50px)` } }), /* @__PURE__ */ React19.createElement(Stack7, { className: "camras" }, /* @__PURE__ */ React19.createElement(
3169
- Webcam,
3170
- {
3171
- audio: false,
3172
- ref: webcamRef,
3173
- width: "100%",
3174
- height: "100%",
3175
- screenshotFormat: "image/jpeg",
3176
- videoConstraints: {
3177
- //facingMode: { exact: "environment" }
3178
- facingMode: "environment"
3179
- //facingMode: "environment" // cámara trasera
3180
- },
3181
- style: {
3182
- position: "fixed",
3183
- // Fijo para cubrir toda la ventana
3184
- top: 0,
3185
- left: 0,
3186
- objectFit: "cover",
3187
- backgroundColor: "black",
3188
- zIndex: 2e3
3189
- // Encima de todo
3190
- }
3191
- }
3192
- ), /* @__PURE__ */ React19.createElement(
3193
- PhotoCameraIcon,
3194
- {
3195
- onClick: capture,
3196
- sx: {
3197
- height: "45px",
3198
- width: "45px",
3199
- padding: "6px",
3200
- backgroundColor: "white",
3201
- color: "#1E62A1",
3202
- borderRadius: "50px",
3203
- zIndex: 2100,
3204
- position: "absolute",
3205
- bottom: "10px",
3206
- left: "50%"
3207
- },
3208
- fontSize: "medium"
3209
- }
3210
- ))), files.length > 0 && /* @__PURE__ */ React19.createElement(
3177
+ ), abrirCamara && createPortal(
3178
+ /* @__PURE__ */ React19.createElement(Box12, { sx: { position: "fixed", inset: 0, zIndex: 2e3 } }, /* @__PURE__ */ React19.createElement(CancelOutlinedIcon, { 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__ */ React19.createElement(Stack7, { className: "camras" }, /* @__PURE__ */ React19.createElement(
3179
+ Webcam,
3180
+ {
3181
+ audio: false,
3182
+ ref: webcamRef,
3183
+ width: "100%",
3184
+ height: "100%",
3185
+ screenshotFormat: "image/jpeg",
3186
+ onUserMedia: () => setCamReady(true),
3187
+ videoConstraints: {
3188
+ //facingMode: { exact: "environment" }
3189
+ facingMode: "environment"
3190
+ //facingMode: "environment" // cámara trasera
3191
+ },
3192
+ style: {
3193
+ position: "fixed",
3194
+ // Fijo para cubrir toda la ventana
3195
+ top: 0,
3196
+ left: 0,
3197
+ objectFit: "cover",
3198
+ backgroundColor: "black",
3199
+ zIndex: 2e3
3200
+ // Encima de todo
3201
+ }
3202
+ }
3203
+ ), /* @__PURE__ */ React19.createElement(
3204
+ PhotoCameraIcon,
3205
+ {
3206
+ onClick: camReady ? capture : void 0,
3207
+ sx: {
3208
+ height: "45px",
3209
+ width: "45px",
3210
+ padding: "6px",
3211
+ backgroundColor: "white",
3212
+ color: "#1E62A1",
3213
+ borderRadius: "50px",
3214
+ zIndex: 2100,
3215
+ position: "absolute",
3216
+ bottom: "10px",
3217
+ left: "50%",
3218
+ opacity: camReady ? 1 : 0.5,
3219
+ pointerEvents: camReady ? "auto" : "none",
3220
+ cursor: camReady ? "pointer" : "not-allowed"
3221
+ },
3222
+ fontSize: "medium"
3223
+ }
3224
+ ))),
3225
+ document.body
3226
+ ), files.length > 0 && /* @__PURE__ */ React19.createElement(
3211
3227
  Stack7,
3212
3228
  {
3213
3229
  "data-testid": "ContenedorArchivosAdjuntos",
@@ -5792,7 +5808,8 @@ var SCDownloadExcelTable = ({
5792
5808
  downloadButton,
5793
5809
  fileName = "archivo excel",
5794
5810
  data = [],
5795
- columns = []
5811
+ columns = [],
5812
+ extraRowsHeader = []
5796
5813
  }) => {
5797
5814
  const formatValue = (value, type) => {
5798
5815
  if (value === null || value === void 0) return "";
@@ -5812,7 +5829,7 @@ var SCDownloadExcelTable = ({
5812
5829
  return formatValue(resolved, col.type);
5813
5830
  })
5814
5831
  );
5815
- const worksheet = XLSX.utils.aoa_to_sheet([headers, ...rows]);
5832
+ const worksheet = XLSX.utils.aoa_to_sheet([...extraRowsHeader, headers, ...rows]);
5816
5833
  const workbook = XLSX.utils.book_new();
5817
5834
  XLSX.utils.book_append_sheet(workbook, worksheet, "Hoja1");
5818
5835
  XLSX.writeFile(workbook, `${fileName}.xlsx`);
@@ -6088,6 +6105,10 @@ var SCTime = ({
6088
6105
  setIsOpenPopover(false);
6089
6106
  setAnchorEl(null);
6090
6107
  };
6108
+ const handleTimeFieldChange = (newValue) => {
6109
+ const dayjsValue = newValue ? dayjs11(newValue) : null;
6110
+ setState(dayjsValue);
6111
+ };
6091
6112
  const handleClose = () => {
6092
6113
  setIsOpenPopover(false);
6093
6114
  setAnchorEl(null);
@@ -6101,6 +6122,7 @@ var SCTime = ({
6101
6122
  required,
6102
6123
  error: hasError,
6103
6124
  onClick: handleTimeFieldClick,
6125
+ onChange: handleTimeFieldChange,
6104
6126
  slotProps: {
6105
6127
  textField: {
6106
6128
  InputProps: {