componentes-sinco 1.1.18 → 1.1.19
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 +48 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +47 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
@@ -1708,6 +1708,20 @@ import React11, { useEffect as useEffect10 } 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
|
+
"span",
|
|
1714
|
+
{
|
|
1715
|
+
onMouseDown: (e) => {
|
|
1716
|
+
e.preventDefault();
|
|
1717
|
+
e.stopPropagation();
|
|
1718
|
+
},
|
|
1719
|
+
onClick: (e) => e.stopPropagation(),
|
|
1720
|
+
style: { display: "inline-flex", alignItems: "center" }
|
|
1721
|
+
},
|
|
1722
|
+
children
|
|
1723
|
+
);
|
|
1724
|
+
};
|
|
1711
1725
|
function SCAutocomplete({
|
|
1712
1726
|
label = "",
|
|
1713
1727
|
data,
|
|
@@ -1812,9 +1826,19 @@ function SCAutocomplete({
|
|
|
1812
1826
|
const selectedValue = typeFormat === "multiselect" ? selectedOptions : originalData.find(
|
|
1813
1827
|
(item) => getItemValue(item).value === state.hiddenValue
|
|
1814
1828
|
) || null;
|
|
1829
|
+
const [open, setOpen] = React11.useState(false);
|
|
1830
|
+
const hayOnComponentClickGlobal = React11.useMemo(() => {
|
|
1831
|
+
return data.some((opt) => Boolean(getItemValue(opt).onComponentClick));
|
|
1832
|
+
}, [data]);
|
|
1815
1833
|
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, data && /* @__PURE__ */ React11.createElement(
|
|
1816
1834
|
Autocomplete,
|
|
1817
|
-
{
|
|
1835
|
+
__spreadProps(__spreadValues(__spreadValues(__spreadValues({}, hayOnComponentClickGlobal ? { open } : {}), hayOnComponentClickGlobal ? { onOpen: () => setOpen(true) } : {}), hayOnComponentClickGlobal ? {
|
|
1836
|
+
onClose: (event2, reason) => {
|
|
1837
|
+
debugger;
|
|
1838
|
+
if (reason === "blur") return;
|
|
1839
|
+
setOpen(false);
|
|
1840
|
+
}
|
|
1841
|
+
} : {}), {
|
|
1818
1842
|
multiple: typeFormat === "multiselect",
|
|
1819
1843
|
clearOnEscape: true,
|
|
1820
1844
|
noOptionsText: "No se encuentra",
|
|
@@ -1871,9 +1895,11 @@ function SCAutocomplete({
|
|
|
1871
1895
|
isValid = group == option[columnGroup];
|
|
1872
1896
|
group = option[columnGroup];
|
|
1873
1897
|
}
|
|
1898
|
+
const item = getItemValue(option);
|
|
1874
1899
|
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
1900
|
MenuItem2,
|
|
1876
1901
|
__spreadProps(__spreadValues({}, optionProps), {
|
|
1902
|
+
component: "li",
|
|
1877
1903
|
disabled: isDisabled,
|
|
1878
1904
|
style: {
|
|
1879
1905
|
//background: typeFormat != "multiselect" ? state.hiddenValue == getItemValue(option).value ? "#be308fff" : 'white' : 'white',
|
|
@@ -1892,7 +1918,16 @@ function SCAutocomplete({
|
|
|
1892
1918
|
}
|
|
1893
1919
|
) : "",
|
|
1894
1920
|
/* @__PURE__ */ React11.createElement(ListItemText2, { primary: getItemValue(option).text, color: "text.primary" }),
|
|
1895
|
-
|
|
1921
|
+
item.component != null ? /* @__PURE__ */ React11.createElement(StopEvent, null, /* @__PURE__ */ React11.createElement(
|
|
1922
|
+
"span",
|
|
1923
|
+
{
|
|
1924
|
+
onClick: (e) => {
|
|
1925
|
+
var _a2;
|
|
1926
|
+
(_a2 = item.onComponentClick) == null ? void 0 : _a2.call(item, e, option);
|
|
1927
|
+
}
|
|
1928
|
+
},
|
|
1929
|
+
item.component
|
|
1930
|
+
)) : null
|
|
1896
1931
|
)));
|
|
1897
1932
|
},
|
|
1898
1933
|
renderInput: (params) => /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(
|
|
@@ -1971,7 +2006,7 @@ function SCAutocomplete({
|
|
|
1971
2006
|
})
|
|
1972
2007
|
}
|
|
1973
2008
|
}
|
|
1974
|
-
}
|
|
2009
|
+
})
|
|
1975
2010
|
));
|
|
1976
2011
|
}
|
|
1977
2012
|
|
|
@@ -2290,7 +2325,7 @@ var DrawerHeader = ({
|
|
|
2290
2325
|
alignContent: "center"
|
|
2291
2326
|
}
|
|
2292
2327
|
},
|
|
2293
|
-
/* @__PURE__ */ React15.createElement(Typography8, { variant: "h6", color: colorTitle || "text.primary" }, title != null ? title : "Personaliza tu b\xFAsqueda"),
|
|
2328
|
+
/* @__PURE__ */ React15.createElement(Typography8, { variant: filterSideCard ? "body2" : "h6", color: colorTitle || "text.primary" }, title != null ? title : "Personaliza tu b\xFAsqueda"),
|
|
2294
2329
|
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
2330
|
);
|
|
2296
2331
|
};
|
|
@@ -5616,11 +5651,17 @@ var SCDatePicker = ({ label, required, disabled, background, state, setState, wi
|
|
|
5616
5651
|
minDate: dayjs11("2015-01-01"),
|
|
5617
5652
|
maxDate: dayjs11().add(3, "month"),
|
|
5618
5653
|
sx: {
|
|
5619
|
-
minWidth:
|
|
5654
|
+
minWidth: 120,
|
|
5620
5655
|
width: width || "100%",
|
|
5621
5656
|
background: background || "transparent",
|
|
5622
5657
|
"& .MuiPickersInputBase-sectionsContainer": {
|
|
5623
5658
|
padding: "6px 0px"
|
|
5659
|
+
},
|
|
5660
|
+
"& .MuiPickersOutlinedInput-root": {
|
|
5661
|
+
padding: "0px 10px !important"
|
|
5662
|
+
},
|
|
5663
|
+
"& .MuiIconButton-root": {
|
|
5664
|
+
padding: "0px 8px 0px 0px !important"
|
|
5624
5665
|
}
|
|
5625
5666
|
},
|
|
5626
5667
|
slotProps: {
|
|
@@ -7425,6 +7466,7 @@ export {
|
|
|
7425
7466
|
SCTime,
|
|
7426
7467
|
SCToastNotification,
|
|
7427
7468
|
SincoTheme,
|
|
7469
|
+
StopEvent,
|
|
7428
7470
|
ToastProgress,
|
|
7429
7471
|
capitalize,
|
|
7430
7472
|
clampEventToVisibleRange,
|