componentes-sinco 1.1.18 → 1.1.20

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
@@ -347,6 +347,7 @@ interface SCDataGridInitialProps<T> {
347
347
  declare function SCDataGridInitial<T>({ data, columns, getRowId, groupColumns, rowsTable, rowSelection, checkboxSelection, width, maxHeight, density, disableColumnMenu, disableColumnSorting, setSelectedIndex, selectedIndex, setSelectedRow, selectedRow }: SCDataGridInitialProps<T>): React__default.JSX.Element;
348
348
  declare const SCDataGrid: React__default.MemoExoticComponent<typeof SCDataGridInitial>;
349
349
 
350
+ declare const StopEvent: React__default.FC<React__default.PropsWithChildren>;
350
351
  interface SCAutocompleteProps<T> {
351
352
  label?: string;
352
353
  data: T[];
@@ -356,6 +357,7 @@ interface SCAutocompleteProps<T> {
356
357
  text: string;
357
358
  value: string;
358
359
  component?: any;
360
+ onComponentClick?: (event: React__default.MouseEvent<HTMLElement>, item: T) => void;
359
361
  };
360
362
  typeFormat?: "normal" | "multiselect";
361
363
  checkMassive?: boolean;
@@ -723,4 +725,4 @@ declare const SincoTheme: _mui_material_styles.Theme;
723
725
  declare let AdproSincoTheme: _mui_material_styles.Theme;
724
726
  declare let ADCSincoTheme: _mui_material_styles.Theme;
725
727
 
726
- 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, SCDatePicker, 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 };
728
+ 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, SCDatePicker, SCDateRange, SCDialog, SCDrawer, SCListContent, SCMenu, SCModal, SCSelect, SCSnackBar, SCTabs, SCTextArea, type SCTextAreaProps, SCTextField, type SCTextFieldProps, SCTime, SCToastNotification, SincoTheme, StopEvent, 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
@@ -347,6 +347,7 @@ interface SCDataGridInitialProps<T> {
347
347
  declare function SCDataGridInitial<T>({ data, columns, getRowId, groupColumns, rowsTable, rowSelection, checkboxSelection, width, maxHeight, density, disableColumnMenu, disableColumnSorting, setSelectedIndex, selectedIndex, setSelectedRow, selectedRow }: SCDataGridInitialProps<T>): React__default.JSX.Element;
348
348
  declare const SCDataGrid: React__default.MemoExoticComponent<typeof SCDataGridInitial>;
349
349
 
350
+ declare const StopEvent: React__default.FC<React__default.PropsWithChildren>;
350
351
  interface SCAutocompleteProps<T> {
351
352
  label?: string;
352
353
  data: T[];
@@ -356,6 +357,7 @@ interface SCAutocompleteProps<T> {
356
357
  text: string;
357
358
  value: string;
358
359
  component?: any;
360
+ onComponentClick?: (event: React__default.MouseEvent<HTMLElement>, item: T) => void;
359
361
  };
360
362
  typeFormat?: "normal" | "multiselect";
361
363
  checkMassive?: boolean;
@@ -723,4 +725,4 @@ declare const SincoTheme: _mui_material_styles.Theme;
723
725
  declare let AdproSincoTheme: _mui_material_styles.Theme;
724
726
  declare let ADCSincoTheme: _mui_material_styles.Theme;
725
727
 
726
- 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, SCDatePicker, 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 };
728
+ 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, SCDatePicker, SCDateRange, SCDialog, SCDrawer, SCListContent, SCMenu, SCModal, SCSelect, SCSnackBar, SCTabs, SCTextArea, type SCTextAreaProps, SCTextField, type SCTextFieldProps, SCTime, SCToastNotification, SincoTheme, StopEvent, type ToastBaseProperties, ToastProgress, type ToastType, capitalize, clampEventToVisibleRange, filterEventsForDay, getButtonColor, getCellBorderType, getIcon, getIconComponent, getIconMultiSelect, getModalColor, modalStateConfig, useCalendarNavigation, useFilteredItems, useMultiSelectHandlers, useProgress };
package/dist/index.js CHANGED
@@ -1704,10 +1704,25 @@ function SCSelect({
1704
1704
  }
1705
1705
 
1706
1706
  // src/Components/SCAutocomplete.tsx
1707
- import React11, { useEffect as useEffect10 } from "react";
1707
+ import React11, { useEffect as useEffect10, useMemo as useMemo3 } from "react";
1708
1708
  import { Autocomplete, Checkbox, InputAdornment as InputAdornment3, MenuItem as MenuItem2, TextField as TextField3, Typography as Typography7, SvgIcon as SvgIcon4, ListItemIcon as ListItemIcon2, ListItemText as ListItemText2, Divider as Divider3, FormControlLabel as FormControlLabel2, IconButton as IconButton7, Chip as Chip3, Box as Box8, Button as Button6, Grid as Grid3 } from "@mui/material";
1709
1709
  import { Search, Clear } from "@mui/icons-material";
1710
1710
  import * as Muicon4 from "@mui/icons-material";
1711
+ var StopEvent = ({ children }) => {
1712
+ return /* @__PURE__ */ React11.createElement(
1713
+ Box8,
1714
+ {
1715
+ onMouseDown: (e) => {
1716
+ e.preventDefault();
1717
+ e.stopPropagation();
1718
+ },
1719
+ onClick: (e) => e.stopPropagation(),
1720
+ display: "inline-flex",
1721
+ alignItems: "center"
1722
+ },
1723
+ children
1724
+ );
1725
+ };
1711
1726
  function SCAutocomplete({
1712
1727
  label = "",
1713
1728
  data,
@@ -1759,15 +1774,16 @@ function SCAutocomplete({
1759
1774
  setIsUserTyping(false);
1760
1775
  }
1761
1776
  }, [inputValue]);
1762
- data.map(function(option) {
1763
- if (option == null ? void 0 : option.icon) {
1764
- if ((option == null ? void 0 : option.icon.type) == void 0) {
1765
- option.icon = Muicon4[option == null ? void 0 : option.icon];
1766
- } else {
1767
- option;
1777
+ const normalizedData = useMemo3(() => {
1778
+ return data.map((option) => {
1779
+ if ((option == null ? void 0 : option.icon) && option.icon.type === void 0) {
1780
+ return __spreadProps(__spreadValues({}, option), {
1781
+ icon: Muicon4[option.icon]
1782
+ });
1768
1783
  }
1769
- }
1770
- });
1784
+ return option;
1785
+ });
1786
+ }, [data]);
1771
1787
  const cleanOptions = (event2) => {
1772
1788
  setState({ hiddenValue: "-1", textValue: "" });
1773
1789
  setSelectedOptions([]);
@@ -1812,14 +1828,26 @@ function SCAutocomplete({
1812
1828
  const selectedValue = typeFormat === "multiselect" ? selectedOptions : originalData.find(
1813
1829
  (item) => getItemValue(item).value === state.hiddenValue
1814
1830
  ) || null;
1831
+ const [open, setOpen] = React11.useState(false);
1832
+ const hayOnComponentClickGlobal = useMemo3(() => {
1833
+ return data.some((opt) => {
1834
+ const item = getItemValue(opt);
1835
+ return Boolean(item.onComponentClick);
1836
+ });
1837
+ }, [data]);
1815
1838
  return /* @__PURE__ */ React11.createElement(React11.Fragment, null, data && /* @__PURE__ */ React11.createElement(
1816
1839
  Autocomplete,
1817
- {
1840
+ __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, hayOnComponentClickGlobal ? { disableCloseOnSelect: true } : {}), hayOnComponentClickGlobal ? { blurOnSelect: false } : {}), hayOnComponentClickGlobal ? { open } : {}), hayOnComponentClickGlobal ? { onOpen: () => setOpen(true) } : {}), hayOnComponentClickGlobal ? {
1841
+ onClose: (event2, reason) => {
1842
+ if (reason === "blur") return;
1843
+ setOpen(false);
1844
+ }
1845
+ } : {}), {
1818
1846
  multiple: typeFormat === "multiselect",
1819
1847
  clearOnEscape: true,
1820
1848
  noOptionsText: "No se encuentra",
1821
1849
  disabled,
1822
- options: data,
1850
+ options: normalizedData,
1823
1851
  isOptionEqualToValue: (option, value) => getItemValue(option).value === getItemValue(value).value,
1824
1852
  onInputChange: (event2, value) => {
1825
1853
  setInputValue(value);
@@ -1871,9 +1899,11 @@ function SCAutocomplete({
1871
1899
  isValid = group == option[columnGroup];
1872
1900
  group = option[columnGroup];
1873
1901
  }
1902
+ const item = getItemValue(option);
1874
1903
  return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(React11.Fragment, { key }, columnGroup ? !isValid ? /* @__PURE__ */ React11.createElement(Typography7, { color: "text.secondary", sx: { margin: "7px 16px !important", fontSize: "13px !important" } }, option[columnGroup]) : "" : "", /* @__PURE__ */ React11.createElement(
1875
1904
  MenuItem2,
1876
1905
  __spreadProps(__spreadValues({}, optionProps), {
1906
+ component: "li",
1877
1907
  disabled: isDisabled,
1878
1908
  style: {
1879
1909
  //background: typeFormat != "multiselect" ? state.hiddenValue == getItemValue(option).value ? "#be308fff" : 'white' : 'white',
@@ -1892,7 +1922,16 @@ function SCAutocomplete({
1892
1922
  }
1893
1923
  ) : "",
1894
1924
  /* @__PURE__ */ React11.createElement(ListItemText2, { primary: getItemValue(option).text, color: "text.primary" }),
1895
- getItemValue(option).component != void 0 ? getItemValue(option).component : ""
1925
+ item.component != null ? /* @__PURE__ */ React11.createElement(StopEvent, null, /* @__PURE__ */ React11.createElement(
1926
+ "span",
1927
+ {
1928
+ onClick: (e) => {
1929
+ var _a2;
1930
+ (_a2 = item.onComponentClick) == null ? void 0 : _a2.call(item, e, option);
1931
+ }
1932
+ },
1933
+ item.component
1934
+ )) : null
1896
1935
  )));
1897
1936
  },
1898
1937
  renderInput: (params) => /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(
@@ -1971,7 +2010,7 @@ function SCAutocomplete({
1971
2010
  })
1972
2011
  }
1973
2012
  }
1974
- }
2013
+ })
1975
2014
  ));
1976
2015
  }
1977
2016
 
@@ -2290,7 +2329,7 @@ var DrawerHeader = ({
2290
2329
  alignContent: "center"
2291
2330
  }
2292
2331
  },
2293
- /* @__PURE__ */ React15.createElement(Typography8, { variant: "h6", color: colorTitle || "text.primary" }, title != null ? title : "Personaliza tu b\xFAsqueda"),
2332
+ /* @__PURE__ */ React15.createElement(Typography8, { variant: filterSideCard ? "body2" : "h6", color: colorTitle || "text.primary" }, title != null ? title : "Personaliza tu b\xFAsqueda"),
2294
2333
  filterSideCard ? /* @__PURE__ */ React15.createElement(React15.Fragment, null, filterSideCard) : /* @__PURE__ */ React15.createElement(IconButton8, { onClick: onClose }, /* @__PURE__ */ React15.createElement(CloseIcon, { "data-testid": "test-button-close", sx: { color: "text.primary" } }))
2295
2334
  );
2296
2335
  };
@@ -2531,7 +2570,7 @@ var FooterAction = ({
2531
2570
  };
2532
2571
 
2533
2572
  // src/Components/MultiSelect/MultiSelect.tsx
2534
- import React18, { useEffect as useEffect11, useMemo as useMemo4 } from "react";
2573
+ import React18, { useEffect as useEffect11, useMemo as useMemo5 } from "react";
2535
2574
  import { Button as Button9, Checkbox as Checkbox2, FormControl as FormControl3, InputAdornment as InputAdornment5, ListItemIcon as ListItemIcon3, MenuItem as MenuItem3, Popover as Popover3, Stack as Stack7, TextField as TextField4 } from "@mui/material";
2536
2575
  import { SearchOutlined } from "@mui/icons-material";
2537
2576
 
@@ -2583,15 +2622,15 @@ function getIconMultiSelect(name) {
2583
2622
  }
2584
2623
 
2585
2624
  // src/Components/MultiSelect/helpers/useFilteredItems.tsx
2586
- import { useMemo as useMemo3 } from "react";
2625
+ import { useMemo as useMemo4 } from "react";
2587
2626
  function useFilteredItems(items, filterValue, getItemLabel, selectedItems) {
2588
- const filteredItems = useMemo3(
2627
+ const filteredItems = useMemo4(
2589
2628
  () => items.filter(
2590
2629
  (item) => getItemLabel(item).toLowerCase().includes(filterValue.toLowerCase())
2591
2630
  ),
2592
2631
  [items, filterValue, getItemLabel]
2593
2632
  );
2594
- const sortedItems = useMemo3(() => {
2633
+ const sortedItems = useMemo4(() => {
2595
2634
  return [
2596
2635
  ...filteredItems.filter((item) => selectedItems.includes(item)),
2597
2636
  ...filteredItems.filter((item) => !selectedItems.includes(item))
@@ -2634,7 +2673,7 @@ function MultiSelect({
2634
2673
  setSelectedItems([]);
2635
2674
  }, [items, setSelectedItems]);
2636
2675
  const { filteredItems, sortedItems } = useFilteredItems(items, filterValue, getItemLabel, selectedItems);
2637
- const Icon = useMemo4(() => {
2676
+ const Icon = useMemo5(() => {
2638
2677
  var _a2;
2639
2678
  return getIconMultiSelect((_a2 = button == null ? void 0 : button.icon) != null ? _a2 : "FilterListOutlined");
2640
2679
  }, [button == null ? void 0 : button.icon]);
@@ -3010,7 +3049,6 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, rowsTable, r
3010
3049
  const [selectionModel, setSelectionModel] = useState13([]);
3011
3050
  useEffect13(() => {
3012
3051
  var _a;
3013
- debugger;
3014
3052
  if (setSelectedRow) {
3015
3053
  setSelectedRow(arrayRows[selectedIndex]);
3016
3054
  setSelectionModel(((_a = arrayRows[selectedIndex]) == null ? void 0 : _a.id) ? [arrayRows[selectedIndex].id] : []);
@@ -3037,7 +3075,6 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, rowsTable, r
3037
3075
  dataConvert = [...dataConvert, newKeys];
3038
3076
  });
3039
3077
  }
3040
- debugger;
3041
3078
  setArrayRows(dataConvert);
3042
3079
  if (arrayRows.length == 0 && (groupDataLenght < 1 && validationTreeData != true)) {
3043
3080
  setSelectedRow && setSelectedRow(dataConvert[selectedIndex]);
@@ -3045,7 +3082,6 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, rowsTable, r
3045
3082
  }
3046
3083
  };
3047
3084
  const handleSelectionChange = (newSelection) => {
3048
- debugger;
3049
3085
  if (groupDataLenght > 0 && validationTreeData == true) {
3050
3086
  let numberGrouped = 0;
3051
3087
  let idsRowSelectBefore = [];
@@ -3066,7 +3102,6 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, rowsTable, r
3066
3102
  }
3067
3103
  }
3068
3104
  });
3069
- debugger;
3070
3105
  if (idRowSelect !== null) {
3071
3106
  const soloEnArr1 = idsRowSelectBefore.filter((elemento) => !idRowSelect.includes(elemento));
3072
3107
  const hasCommonElements = idsRowSelectBefore.some((element) => idRowSelect.includes(element));
@@ -3077,7 +3112,6 @@ function SCDataGridInitial({ data, columns, getRowId, groupColumns, rowsTable, r
3077
3112
  }
3078
3113
  }
3079
3114
  } else {
3080
- debugger;
3081
3115
  setSelectionModel([...newSelection]);
3082
3116
  const selectedId = newSelection[0];
3083
3117
  const index = arrayRows.findIndex((row) => row.id === selectedId);
@@ -5031,7 +5065,7 @@ import React44, { useEffect as useEffect21, useRef as useRef8, useState as useSt
5031
5065
  import Webcam from "react-webcam";
5032
5066
 
5033
5067
  // src/Components/Adjuntar/mobile/components/button.tsx
5034
- import React43, { useMemo as useMemo5 } from "react";
5068
+ import React43, { useMemo as useMemo6 } from "react";
5035
5069
  import { Button as Button18 } from "@mui/material";
5036
5070
 
5037
5071
  // src/Components/Adjuntar/mobile/components/Utils.tsx
@@ -5057,7 +5091,7 @@ var AttachmentButton = ({ buttonAttachment, open, setOpen }) => {
5057
5091
  setOpen(!open);
5058
5092
  }
5059
5093
  };
5060
- const Icon = useMemo5(
5094
+ const Icon = useMemo6(
5061
5095
  () => getAttachmentIcon(buttonAttachment == null ? void 0 : buttonAttachment.icon),
5062
5096
  [buttonAttachment == null ? void 0 : buttonAttachment.icon]
5063
5097
  );
@@ -5616,11 +5650,17 @@ var SCDatePicker = ({ label, required, disabled, background, state, setState, wi
5616
5650
  minDate: dayjs11("2015-01-01"),
5617
5651
  maxDate: dayjs11().add(3, "month"),
5618
5652
  sx: {
5619
- minWidth: 140,
5653
+ minWidth: 120,
5620
5654
  width: width || "100%",
5621
5655
  background: background || "transparent",
5622
5656
  "& .MuiPickersInputBase-sectionsContainer": {
5623
5657
  padding: "6px 0px"
5658
+ },
5659
+ "& .MuiPickersOutlinedInput-root": {
5660
+ padding: "0px 10px !important"
5661
+ },
5662
+ "& .MuiIconButton-root": {
5663
+ padding: "0px 8px 0px 0px !important"
5624
5664
  }
5625
5665
  },
5626
5666
  slotProps: {
@@ -7425,6 +7465,7 @@ export {
7425
7465
  SCTime,
7426
7466
  SCToastNotification,
7427
7467
  SincoTheme,
7468
+ StopEvent,
7428
7469
  ToastProgress,
7429
7470
  capitalize,
7430
7471
  clampEventToVisibleRange,