componentes-sinco 1.1.1 → 1.1.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
@@ -429,7 +429,7 @@ interface SCDialogProps {
429
429
  }
430
430
  declare const SCDialog: ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, typeView, setShow, show }: SCDialogProps) => React__default.JSX.Element;
431
431
 
432
- interface Option$2 {
432
+ interface Option$3 {
433
433
  title?: string;
434
434
  subtitle?: any;
435
435
  description?: any;
@@ -443,13 +443,13 @@ interface Option$2 {
443
443
  fn?: any;
444
444
  }
445
445
  interface SCListContentProps {
446
- options: Option$2[];
446
+ options: Option$3[];
447
447
  iconLeftType?: "Icon" | "Avatar";
448
448
  iconRightType?: "Icon" | "Avatar";
449
449
  }
450
450
  declare const SCListContent: ({ options, iconLeftType, iconRightType }: SCListContentProps) => React__default.JSX.Element;
451
451
 
452
- interface Option$1 {
452
+ interface Option$2 {
453
453
  name?: string;
454
454
  iconLeft?: any | React__default.ReactNode | React__default.ReactElement | React__default.ElementType | null;
455
455
  iconRight?: any | React__default.ReactNode | React__default.ReactElement | React__default.ElementType | null;
@@ -458,7 +458,7 @@ interface Option$1 {
458
458
  }
459
459
  interface SCMenuProps {
460
460
  header?: any;
461
- options: Option$1[];
461
+ options: Option$2[];
462
462
  defaultOption?: string;
463
463
  disable?: boolean;
464
464
  widthMenu?: string;
@@ -507,14 +507,14 @@ interface SCSelectProps<T> {
507
507
  }
508
508
  declare function SCSelect<T>({ label, data, getItemValue, width, size, variant, background, required, disabled, setState, state, }: SCSelectProps<T>): React__default.JSX.Element;
509
509
 
510
- interface Option {
510
+ interface Option$1 {
511
511
  name?: string;
512
512
  iconOrBadge: string | number | null | undefined | any | React__default.ReactNode | React__default.ReactElement | React__default.ElementType;
513
513
  disabled?: boolean;
514
514
  page: React__default.ReactNode | React__default.ReactElement;
515
515
  }
516
516
  interface SCTabsProps {
517
- options: Option[];
517
+ options: Option$1[];
518
518
  defaultOption?: string;
519
519
  typeIcon?: "badge" | "icon";
520
520
  background?: string;
@@ -658,14 +658,13 @@ interface AttachmentMobileProps<T> {
658
658
  maxSize?: number;
659
659
  sx?: SxProps;
660
660
  files?: T[];
661
- setAttachedFiles?: any;
662
661
  initialFiles?: UploadedFile[];
663
662
  fileAccepted?: string;
664
663
  onChange?: (archivos: File[]) => void;
665
664
  deleteAction?: (name: string) => Promise<void> | void;
666
665
  }
667
666
 
668
- declare const AttachmentMobile: ({ buttonAttachment, maxSize, fileAccepted, initialFiles, setAttachedFiles, deleteAction, children, onChange, sx }: AttachmentMobileProps<any>) => React__default.JSX.Element;
667
+ declare const AttachmentMobile: ({ buttonAttachment, maxSize, fileAccepted, initialFiles, deleteAction, children, onChange, sx }: AttachmentMobileProps<any>) => React__default.JSX.Element;
669
668
 
670
669
  interface SCSnackBarProps {
671
670
  type?: 'success' | 'error' | 'warning' | 'info';
@@ -678,8 +677,25 @@ interface SCSnackBarProps {
678
677
  }
679
678
  declare const SCSnackBar: ({ type, close, openState, setOpenState, mensaje, duration, position }: SCSnackBarProps) => React__default.JSX.Element;
680
679
 
680
+ interface Option {
681
+ name: string;
682
+ fn?: () => void;
683
+ disabled?: boolean;
684
+ }
685
+ interface SCAppBarProps {
686
+ background?: string;
687
+ contenidoExtra?: React__default.ReactNode;
688
+ menuItems?: React__default.ReactNode;
689
+ options: Option[];
690
+ fnVolver?: () => void;
691
+ visibleVolver?: boolean;
692
+ visibleConexion?: boolean;
693
+ visibleMenu?: boolean;
694
+ }
695
+ declare const SCAppBar: ({ background, contenidoExtra, options, fnVolver, visibleVolver, visibleConexion, visibleMenu, }: SCAppBarProps) => React__default.JSX.Element;
696
+
681
697
  declare const SincoTheme: _mui_material_styles.Theme;
682
698
  declare let AdproSincoTheme: _mui_material_styles.Theme;
683
699
  declare let ADCSincoTheme: _mui_material_styles.Theme;
684
700
 
685
- export { ADCSincoTheme, AdproSincoTheme, Attachment, AttachmentMobile, BasicMenu, type BasicMenuProps, CALENDAR_CONSTANTS, Calendar, type CalendarEvent, type CalendarProps, type CalendarView, type CellBorderType, DayEventsList, EmptyState, type EmptyStateProperties, type EmptyStateSize, type EmptyStateStates, type EventState, FooterAction, type FooterActionsProperties, type ModalProps, type ModalStates, MultiSelect, type MultiSelectProps, type NavigationAction, PageHeader, type PageheaderProperties, type ReplyButtonVariants, type ReplyPalette$1 as ReplyPalette, type ReplyTextPalette, type ReplyVariants, type RepplyAnchorPositions, type RepplySizeVariants, SCActivityCalendar, SCAutocomplete, SCCalendarSwipeable, SCCard, SCDataGrid, SCDataGridInitial, SCDateRange, SCDialog, SCDrawer, SCListContent, SCMenu, SCModal, SCSelect, SCSnackBar, SCTabs, SCTextArea, type SCTextAreaProps, SCTextField, type SCTextFieldProps, SCTime, SCToastNotification, SincoTheme, type ToastBaseProperties, ToastProgress, type ToastType, capitalize, clampEventToVisibleRange, filterEventsForDay, getButtonColor, getCellBorderType, getIcon, getIconComponent, getIconMultiSelect, getModalColor, modalStateConfig, useCalendarNavigation, useFilteredItems, useMultiSelectHandlers, useProgress };
701
+ export { ADCSincoTheme, AdproSincoTheme, Attachment, AttachmentMobile, BasicMenu, type BasicMenuProps, CALENDAR_CONSTANTS, Calendar, type CalendarEvent, type CalendarProps, type CalendarView, type CellBorderType, DayEventsList, EmptyState, type EmptyStateProperties, type EmptyStateSize, type EmptyStateStates, type EventState, FooterAction, type FooterActionsProperties, type ModalProps, type ModalStates, MultiSelect, type MultiSelectProps, type NavigationAction, PageHeader, type PageheaderProperties, type ReplyButtonVariants, type ReplyPalette$1 as ReplyPalette, type ReplyTextPalette, type ReplyVariants, type RepplyAnchorPositions, type RepplySizeVariants, SCActivityCalendar, SCAppBar, SCAutocomplete, SCCalendarSwipeable, SCCard, SCDataGrid, SCDataGridInitial, SCDateRange, SCDialog, SCDrawer, SCListContent, SCMenu, SCModal, SCSelect, SCSnackBar, SCTabs, SCTextArea, type SCTextAreaProps, SCTextField, type SCTextFieldProps, SCTime, SCToastNotification, SincoTheme, type ToastBaseProperties, ToastProgress, type ToastType, capitalize, clampEventToVisibleRange, filterEventsForDay, getButtonColor, getCellBorderType, getIcon, getIconComponent, getIconMultiSelect, getModalColor, modalStateConfig, useCalendarNavigation, useFilteredItems, useMultiSelectHandlers, useProgress };
package/dist/index.d.ts CHANGED
@@ -429,7 +429,7 @@ interface SCDialogProps {
429
429
  }
430
430
  declare const SCDialog: ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, typeView, setShow, show }: SCDialogProps) => React__default.JSX.Element;
431
431
 
432
- interface Option$2 {
432
+ interface Option$3 {
433
433
  title?: string;
434
434
  subtitle?: any;
435
435
  description?: any;
@@ -443,13 +443,13 @@ interface Option$2 {
443
443
  fn?: any;
444
444
  }
445
445
  interface SCListContentProps {
446
- options: Option$2[];
446
+ options: Option$3[];
447
447
  iconLeftType?: "Icon" | "Avatar";
448
448
  iconRightType?: "Icon" | "Avatar";
449
449
  }
450
450
  declare const SCListContent: ({ options, iconLeftType, iconRightType }: SCListContentProps) => React__default.JSX.Element;
451
451
 
452
- interface Option$1 {
452
+ interface Option$2 {
453
453
  name?: string;
454
454
  iconLeft?: any | React__default.ReactNode | React__default.ReactElement | React__default.ElementType | null;
455
455
  iconRight?: any | React__default.ReactNode | React__default.ReactElement | React__default.ElementType | null;
@@ -458,7 +458,7 @@ interface Option$1 {
458
458
  }
459
459
  interface SCMenuProps {
460
460
  header?: any;
461
- options: Option$1[];
461
+ options: Option$2[];
462
462
  defaultOption?: string;
463
463
  disable?: boolean;
464
464
  widthMenu?: string;
@@ -507,14 +507,14 @@ interface SCSelectProps<T> {
507
507
  }
508
508
  declare function SCSelect<T>({ label, data, getItemValue, width, size, variant, background, required, disabled, setState, state, }: SCSelectProps<T>): React__default.JSX.Element;
509
509
 
510
- interface Option {
510
+ interface Option$1 {
511
511
  name?: string;
512
512
  iconOrBadge: string | number | null | undefined | any | React__default.ReactNode | React__default.ReactElement | React__default.ElementType;
513
513
  disabled?: boolean;
514
514
  page: React__default.ReactNode | React__default.ReactElement;
515
515
  }
516
516
  interface SCTabsProps {
517
- options: Option[];
517
+ options: Option$1[];
518
518
  defaultOption?: string;
519
519
  typeIcon?: "badge" | "icon";
520
520
  background?: string;
@@ -658,14 +658,13 @@ interface AttachmentMobileProps<T> {
658
658
  maxSize?: number;
659
659
  sx?: SxProps;
660
660
  files?: T[];
661
- setAttachedFiles?: any;
662
661
  initialFiles?: UploadedFile[];
663
662
  fileAccepted?: string;
664
663
  onChange?: (archivos: File[]) => void;
665
664
  deleteAction?: (name: string) => Promise<void> | void;
666
665
  }
667
666
 
668
- declare const AttachmentMobile: ({ buttonAttachment, maxSize, fileAccepted, initialFiles, setAttachedFiles, deleteAction, children, onChange, sx }: AttachmentMobileProps<any>) => React__default.JSX.Element;
667
+ declare const AttachmentMobile: ({ buttonAttachment, maxSize, fileAccepted, initialFiles, deleteAction, children, onChange, sx }: AttachmentMobileProps<any>) => React__default.JSX.Element;
669
668
 
670
669
  interface SCSnackBarProps {
671
670
  type?: 'success' | 'error' | 'warning' | 'info';
@@ -678,8 +677,25 @@ interface SCSnackBarProps {
678
677
  }
679
678
  declare const SCSnackBar: ({ type, close, openState, setOpenState, mensaje, duration, position }: SCSnackBarProps) => React__default.JSX.Element;
680
679
 
680
+ interface Option {
681
+ name: string;
682
+ fn?: () => void;
683
+ disabled?: boolean;
684
+ }
685
+ interface SCAppBarProps {
686
+ background?: string;
687
+ contenidoExtra?: React__default.ReactNode;
688
+ menuItems?: React__default.ReactNode;
689
+ options: Option[];
690
+ fnVolver?: () => void;
691
+ visibleVolver?: boolean;
692
+ visibleConexion?: boolean;
693
+ visibleMenu?: boolean;
694
+ }
695
+ declare const SCAppBar: ({ background, contenidoExtra, options, fnVolver, visibleVolver, visibleConexion, visibleMenu, }: SCAppBarProps) => React__default.JSX.Element;
696
+
681
697
  declare const SincoTheme: _mui_material_styles.Theme;
682
698
  declare let AdproSincoTheme: _mui_material_styles.Theme;
683
699
  declare let ADCSincoTheme: _mui_material_styles.Theme;
684
700
 
685
- export { ADCSincoTheme, AdproSincoTheme, Attachment, AttachmentMobile, BasicMenu, type BasicMenuProps, CALENDAR_CONSTANTS, Calendar, type CalendarEvent, type CalendarProps, type CalendarView, type CellBorderType, DayEventsList, EmptyState, type EmptyStateProperties, type EmptyStateSize, type EmptyStateStates, type EventState, FooterAction, type FooterActionsProperties, type ModalProps, type ModalStates, MultiSelect, type MultiSelectProps, type NavigationAction, PageHeader, type PageheaderProperties, type ReplyButtonVariants, type ReplyPalette$1 as ReplyPalette, type ReplyTextPalette, type ReplyVariants, type RepplyAnchorPositions, type RepplySizeVariants, SCActivityCalendar, SCAutocomplete, SCCalendarSwipeable, SCCard, SCDataGrid, SCDataGridInitial, SCDateRange, SCDialog, SCDrawer, SCListContent, SCMenu, SCModal, SCSelect, SCSnackBar, SCTabs, SCTextArea, type SCTextAreaProps, SCTextField, type SCTextFieldProps, SCTime, SCToastNotification, SincoTheme, type ToastBaseProperties, ToastProgress, type ToastType, capitalize, clampEventToVisibleRange, filterEventsForDay, getButtonColor, getCellBorderType, getIcon, getIconComponent, getIconMultiSelect, getModalColor, modalStateConfig, useCalendarNavigation, useFilteredItems, useMultiSelectHandlers, useProgress };
701
+ export { ADCSincoTheme, AdproSincoTheme, Attachment, AttachmentMobile, BasicMenu, type BasicMenuProps, CALENDAR_CONSTANTS, Calendar, type CalendarEvent, type CalendarProps, type CalendarView, type CellBorderType, DayEventsList, EmptyState, type EmptyStateProperties, type EmptyStateSize, type EmptyStateStates, type EventState, FooterAction, type FooterActionsProperties, type ModalProps, type ModalStates, MultiSelect, type MultiSelectProps, type NavigationAction, PageHeader, type PageheaderProperties, type ReplyButtonVariants, type ReplyPalette$1 as ReplyPalette, type ReplyTextPalette, type ReplyVariants, type RepplyAnchorPositions, type RepplySizeVariants, SCActivityCalendar, SCAppBar, SCAutocomplete, SCCalendarSwipeable, SCCard, SCDataGrid, SCDataGridInitial, SCDateRange, SCDialog, SCDrawer, SCListContent, SCMenu, SCModal, SCSelect, SCSnackBar, SCTabs, SCTextArea, type SCTextAreaProps, SCTextField, type SCTextFieldProps, SCTime, SCToastNotification, SincoTheme, type ToastBaseProperties, ToastProgress, type ToastType, capitalize, clampEventToVisibleRange, filterEventsForDay, getButtonColor, getCellBorderType, getIcon, getIconComponent, getIconMultiSelect, getModalColor, modalStateConfig, useCalendarNavigation, useFilteredItems, useMultiSelectHandlers, useProgress };
package/dist/index.js CHANGED
@@ -4916,7 +4916,6 @@ var AttachmentMobile = ({
4916
4916
  maxSize = 400,
4917
4917
  fileAccepted = "",
4918
4918
  initialFiles,
4919
- setAttachedFiles,
4920
4919
  deleteAction,
4921
4920
  children,
4922
4921
  onChange,
@@ -5034,7 +5033,6 @@ var AttachmentMobile = ({
5034
5033
  if (nuevosArchivos.length > 0) {
5035
5034
  setFiles((prevFiles) => {
5036
5035
  const updatedFiles = [...prevFiles, ...nuevosArchivos];
5037
- setAttachedFiles(updatedFiles);
5038
5036
  if (archivosValidos.length > 0) {
5039
5037
  onChange == null ? void 0 : onChange([
5040
5038
  ...archivosValidos,
@@ -5056,7 +5054,6 @@ var AttachmentMobile = ({
5056
5054
  (file) => !(file.name === fileToRemove.name && file.size === fileToRemove.size)
5057
5055
  );
5058
5056
  setFiles(updatedFiles);
5059
- setAttachedFiles(updatedFiles);
5060
5057
  if (onChange) {
5061
5058
  const remainingValidFiles = updatedFiles.filter((f) => !f.uploadError).map((f) => new File([], f.name, { type: f.type }));
5062
5059
  onChange(remainingValidFiles);
@@ -5092,7 +5089,6 @@ var AttachmentMobile = ({
5092
5089
  useEffect21(() => {
5093
5090
  if (initialFiles && initialFiles.length > 0) {
5094
5091
  setFiles(initialFiles);
5095
- setAttachedFiles(initialFiles);
5096
5092
  }
5097
5093
  }, []);
5098
5094
  return /* @__PURE__ */ React44.createElement(Box28, { display: "flex", flexDirection: "column", gap: 1 }, /* @__PURE__ */ React44.createElement(Box28, { display: "flex", width: "100%", justifyContent: "space-between", alignItems: "center", sx }, children, /* @__PURE__ */ React44.createElement(
@@ -5273,7 +5269,7 @@ var AttachmentMobile = ({
5273
5269
  ));
5274
5270
  };
5275
5271
 
5276
- // src/Components/SCSnackbar.tsx
5272
+ // src/Components/SCSnackBar.tsx
5277
5273
  import React45 from "react";
5278
5274
  import MuiAlert from "@mui/material/Alert";
5279
5275
  import "dayjs/locale/es";
@@ -5313,11 +5309,88 @@ var SCSnackBar = ({
5313
5309
  ));
5314
5310
  };
5315
5311
 
5312
+ // src/Components/SCAppBar.tsx
5313
+ import React46, { useState as useState26, useEffect as useEffect22 } from "react";
5314
+ import { Menu as Menu3, Box as Box29, Typography as Typography27, MenuItem as MenuItem8, IconButton as IconButton17, Badge as Badge3 } from "@mui/material";
5315
+ import Grid12 from "@mui/material/Grid";
5316
+ import "dayjs/locale/es";
5317
+ import MenuIcon from "@mui/icons-material/Menu";
5318
+ import ArrowBackIcon from "@mui/icons-material/ArrowBack";
5319
+ import { Wifi, WifiOff } from "@mui/icons-material";
5320
+ var SCAppBar = ({
5321
+ background = "linear-gradient(180deg, #BBE9FC, #FFFFFF)",
5322
+ contenidoExtra,
5323
+ options,
5324
+ fnVolver,
5325
+ visibleVolver = true,
5326
+ visibleConexion = true,
5327
+ visibleMenu = true
5328
+ }) => {
5329
+ const [isOnline, setIsOnline] = useState26(window.navigator.onLine);
5330
+ const [anchorEl, setAnchorEl] = useState26(null);
5331
+ const openMenu = Boolean(anchorEl);
5332
+ const handleMenuClick = (event2) => {
5333
+ setAnchorEl(event2.currentTarget);
5334
+ };
5335
+ const handleMenuClose = () => {
5336
+ setAnchorEl(null);
5337
+ };
5338
+ useEffect22(() => {
5339
+ const handleOnline = () => {
5340
+ console.log("tiene internet");
5341
+ setIsOnline(true);
5342
+ };
5343
+ const handleOffline = () => {
5344
+ console.log(" no tiene internet");
5345
+ setIsOnline(false);
5346
+ };
5347
+ window.addEventListener("online", handleOnline);
5348
+ window.addEventListener("offline", handleOffline);
5349
+ return () => {
5350
+ window.removeEventListener("online", handleOnline);
5351
+ window.removeEventListener("offline", handleOffline);
5352
+ };
5353
+ }, []);
5354
+ return /* @__PURE__ */ React46.createElement(React46.Fragment, null, /* @__PURE__ */ React46.createElement(Grid12, { sx: { display: "flex", flexDirection: "column", background } }, /* @__PURE__ */ React46.createElement(Grid12, { size: 12, sx: { display: "flex", flexDirection: "row", alignItems: "center", padding: "0px 16px", justifyContent: "space-between" } }, visibleVolver && /* @__PURE__ */ React46.createElement(IconButton17, { size: "medium", onClick: fnVolver }, /* @__PURE__ */ React46.createElement(ArrowBackIcon, { color: "action" })), /* @__PURE__ */ React46.createElement(Grid12, { sx: { display: "flex", flexDirection: "row", alignItems: "center" } }, visibleConexion && /* @__PURE__ */ React46.createElement(Grid12, { sx: { display: "flex", flexDirection: "row", alignItems: "center" } }, isOnline ? /* @__PURE__ */ React46.createElement(Wifi, { color: "action", sx: { marginRight: "8px" } }) : /* @__PURE__ */ React46.createElement(WifiOff, { color: "action", sx: { marginRight: "8px" } }), /* @__PURE__ */ React46.createElement(
5355
+ Badge3,
5356
+ {
5357
+ anchorOrigin: {
5358
+ vertical: "top",
5359
+ horizontal: "left"
5360
+ },
5361
+ variant: "dot",
5362
+ sx: {
5363
+ position: "relative",
5364
+ top: "-3px",
5365
+ left: "-4px"
5366
+ },
5367
+ color: isOnline ? "success" : "error"
5368
+ }
5369
+ ), /* @__PURE__ */ React46.createElement(Typography27, { variant: "caption", color: "text.secondary" }, isOnline ? "Online" : "Offline")), visibleMenu && /* @__PURE__ */ React46.createElement(React46.Fragment, null, /* @__PURE__ */ React46.createElement(IconButton17, { size: "medium", onClick: handleMenuClick }, /* @__PURE__ */ React46.createElement(MenuIcon, { color: "action" })), /* @__PURE__ */ React46.createElement(
5370
+ Menu3,
5371
+ {
5372
+ anchorEl,
5373
+ open: openMenu,
5374
+ onClose: handleMenuClose,
5375
+ anchorOrigin: {
5376
+ vertical: "bottom",
5377
+ horizontal: "right"
5378
+ },
5379
+ transformOrigin: {
5380
+ vertical: "top",
5381
+ horizontal: "right"
5382
+ },
5383
+ sx: { zIndex: "2000" }
5384
+ },
5385
+ options.map((option, index) => /* @__PURE__ */ React46.createElement(MenuItem8, { onClick: option.fn, disabled: option.disabled, key: index }, /* @__PURE__ */ React46.createElement(Typography27, { variant: "body2" }, option.name)))
5386
+ )))), /* @__PURE__ */ React46.createElement(Box29, { sx: { padding: "0px 16px" } }, contenidoExtra)));
5387
+ };
5388
+
5316
5389
  // src/Theme/index.ts
5317
5390
  import { createTheme } from "@mui/material/styles";
5318
5391
 
5319
5392
  // src/Theme/components.ts
5320
- import React46 from "react";
5393
+ import React47 from "react";
5321
5394
  import {
5322
5395
  InfoRounded as InfoRounded2,
5323
5396
  CheckCircleRounded as CheckCircleRounded2,
@@ -6020,10 +6093,10 @@ var components = {
6020
6093
  MuiAlert: {
6021
6094
  defaultProps: {
6022
6095
  iconMapping: {
6023
- success: React46.createElement(CheckCircleRounded2),
6024
- error: React46.createElement(ErrorRounded2),
6025
- warning: React46.createElement(WarningRounded2),
6026
- info: React46.createElement(InfoRounded2)
6096
+ success: React47.createElement(CheckCircleRounded2),
6097
+ error: React47.createElement(ErrorRounded2),
6098
+ warning: React47.createElement(WarningRounded2),
6099
+ info: React47.createElement(InfoRounded2)
6027
6100
  }
6028
6101
  },
6029
6102
  variants: [
@@ -7075,6 +7148,7 @@ export {
7075
7148
  MultiSelect,
7076
7149
  PageHeader,
7077
7150
  SCActivityCalendar,
7151
+ SCAppBar,
7078
7152
  SCAutocomplete,
7079
7153
  SCCalendarSwipeable,
7080
7154
  SCCard,