componentes-sinco 1.0.34-rc.0 → 1.0.34-rc.2
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 +129 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -5
- package/dist/index.d.ts +3 -5
- package/dist/index.js +244 -177
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2064,7 +2064,6 @@ var SCDateRange = ({
|
|
|
2064
2064
|
const isStartEmpty = required && !state[0];
|
|
2065
2065
|
const isEndEmpty = required && !state[1];
|
|
2066
2066
|
const hasError = isStartEmpty || isEndEmpty;
|
|
2067
|
-
const minDate = new Date(2013, 0, 1);
|
|
2068
2067
|
const [notification, setNotification] = import_react16.default.useState(false);
|
|
2069
2068
|
const handleDateChange = (newValue) => {
|
|
2070
2069
|
const minDateDayjs = (0, import_dayjs.default)("2013-01-01");
|
|
@@ -2084,7 +2083,30 @@ var SCDateRange = ({
|
|
|
2084
2083
|
return;
|
|
2085
2084
|
}
|
|
2086
2085
|
}
|
|
2087
|
-
|
|
2086
|
+
const startDateChanged = convertedValue[0] && state[0] && !convertedValue[0].isSame(state[0], "day");
|
|
2087
|
+
const hasEndDate = convertedValue[1] !== null;
|
|
2088
|
+
if (startDateChanged && convertedValue[0]) {
|
|
2089
|
+
if (!hasEndDate || hasEndDate && convertedValue[0].isAfter(convertedValue[1])) {
|
|
2090
|
+
const correctedValue = [
|
|
2091
|
+
convertedValue[0],
|
|
2092
|
+
convertedValue[0]
|
|
2093
|
+
// Establecer fecha final igual a la inicial
|
|
2094
|
+
];
|
|
2095
|
+
setState(correctedValue);
|
|
2096
|
+
return;
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
const isInvalidRange = convertedValue[0] && convertedValue[1] && convertedValue[0].isAfter(convertedValue[1]);
|
|
2100
|
+
if (isInvalidRange) {
|
|
2101
|
+
const correctedValue = [
|
|
2102
|
+
convertedValue[0],
|
|
2103
|
+
convertedValue[0]
|
|
2104
|
+
// Establecer fecha final igual a la inicial
|
|
2105
|
+
];
|
|
2106
|
+
setState(correctedValue);
|
|
2107
|
+
} else {
|
|
2108
|
+
setState(convertedValue);
|
|
2109
|
+
}
|
|
2088
2110
|
};
|
|
2089
2111
|
return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, /* @__PURE__ */ import_react16.default.createElement(import_LocalizationProvider.LocalizationProvider, { dateAdapter: import_AdapterDayjs.AdapterDayjs, adapterLocale: "es" }, /* @__PURE__ */ import_react16.default.createElement(import_material10.Box, { sx: { width: "100%" } }, /* @__PURE__ */ import_react16.default.createElement(
|
|
2090
2112
|
import_DateRangePicker.DateRangePicker,
|
|
@@ -2096,44 +2118,38 @@ var SCDateRange = ({
|
|
|
2096
2118
|
field: import_MultiInputDateRangeField.MultiInputDateRangeField
|
|
2097
2119
|
},
|
|
2098
2120
|
slotProps: {
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2121
|
+
textField: ({ position }) => {
|
|
2122
|
+
const isStart = position === "start";
|
|
2123
|
+
return {
|
|
2124
|
+
label: isStart ? labelDateInitial : labelDateFinal,
|
|
2125
|
+
size: "small",
|
|
2126
|
+
variant: "outlined",
|
|
2127
|
+
required,
|
|
2128
|
+
error: isStart ? isStartEmpty : isEndEmpty,
|
|
2129
|
+
InputProps: {
|
|
2130
|
+
endAdornment: /* @__PURE__ */ import_react16.default.createElement(import_material10.InputAdornment, { position: "end" }, /* @__PURE__ */ import_react16.default.createElement(
|
|
2131
|
+
import_Event.default,
|
|
2132
|
+
{
|
|
2133
|
+
color: hasError ? "error" : "action",
|
|
2134
|
+
fontSize: "small"
|
|
2135
|
+
}
|
|
2136
|
+
))
|
|
2137
|
+
},
|
|
2138
|
+
sx: {
|
|
2139
|
+
flex: 1,
|
|
2140
|
+
"& .MuiOutlinedInput-root": {
|
|
2141
|
+
backgroundColor: background === "transparent" ? "transparent" : background
|
|
2115
2142
|
},
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
color: "error.main"
|
|
2123
|
-
},
|
|
2124
|
-
background: background != null ? background : "transparent"
|
|
2125
|
-
}
|
|
2126
|
-
})
|
|
2127
|
-
}
|
|
2143
|
+
"& .MuiInputLabel-asterisk": {
|
|
2144
|
+
color: "error.main"
|
|
2145
|
+
},
|
|
2146
|
+
background: background != null ? background : "transparent"
|
|
2147
|
+
}
|
|
2148
|
+
};
|
|
2128
2149
|
}
|
|
2129
|
-
},
|
|
2130
|
-
sx: {
|
|
2131
|
-
display: "flex",
|
|
2132
|
-
gap: 1,
|
|
2133
|
-
width: "100%"
|
|
2134
2150
|
}
|
|
2135
2151
|
}
|
|
2136
|
-
)))
|
|
2152
|
+
))));
|
|
2137
2153
|
};
|
|
2138
2154
|
|
|
2139
2155
|
// src/Components/Drawer/components/DrawerContent.tsx
|
|
@@ -2342,6 +2358,7 @@ function SCDrawer({
|
|
|
2342
2358
|
setOpen,
|
|
2343
2359
|
chipFilters
|
|
2344
2360
|
}) {
|
|
2361
|
+
const drawerBleeding = 56;
|
|
2345
2362
|
const { drawerOpen, handleDrawerClose, toggleDrawer } = useDrawerState({ open, setOpen });
|
|
2346
2363
|
const { toast, setToastWithDelay } = useToast();
|
|
2347
2364
|
const {
|
|
@@ -2404,12 +2421,12 @@ function SCDrawer({
|
|
|
2404
2421
|
onToggle: toggleDrawer(true)
|
|
2405
2422
|
}
|
|
2406
2423
|
)
|
|
2407
|
-
), /* @__PURE__ */ import_react20.default.createElement(
|
|
2424
|
+
), anchor != "bottom" ? /* @__PURE__ */ import_react20.default.createElement(
|
|
2408
2425
|
import_material14.Drawer,
|
|
2409
2426
|
{
|
|
2410
2427
|
open: drawerOpen,
|
|
2411
2428
|
onClose: toggleDrawer(false),
|
|
2412
|
-
anchor,
|
|
2429
|
+
anchor: anchor != null ? anchor : "left",
|
|
2413
2430
|
sx: {
|
|
2414
2431
|
"& .MuiDrawer-paper": {
|
|
2415
2432
|
width: width != null ? width : "450px",
|
|
@@ -2426,6 +2443,45 @@ function SCDrawer({
|
|
|
2426
2443
|
onClose: handleDrawerClose
|
|
2427
2444
|
}
|
|
2428
2445
|
), /* @__PURE__ */ import_react20.default.createElement(DrawerContent, { arrayElements }), /* @__PURE__ */ import_react20.default.createElement(DrawerActions, { actions: drawerActions, anchor }))
|
|
2446
|
+
) : /* @__PURE__ */ import_react20.default.createElement(
|
|
2447
|
+
import_material14.SwipeableDrawer,
|
|
2448
|
+
{
|
|
2449
|
+
open: drawerOpen,
|
|
2450
|
+
onClose: toggleDrawer(false),
|
|
2451
|
+
onOpen: toggleDrawer(true),
|
|
2452
|
+
anchor: "bottom",
|
|
2453
|
+
swipeAreaWidth: drawerBleeding,
|
|
2454
|
+
sx: {
|
|
2455
|
+
"& .MuiDrawer-paper": {
|
|
2456
|
+
width: "auto",
|
|
2457
|
+
height: `calc(50% - ${drawerBleeding}px)`,
|
|
2458
|
+
boxSizing: "border-box",
|
|
2459
|
+
borderRadius: "4px 4px 0px 0px"
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
},
|
|
2463
|
+
/* @__PURE__ */ import_react20.default.createElement(
|
|
2464
|
+
import_material14.Box,
|
|
2465
|
+
{
|
|
2466
|
+
sx: {
|
|
2467
|
+
width: 30,
|
|
2468
|
+
height: 6,
|
|
2469
|
+
backgroundColor: "#ccc",
|
|
2470
|
+
borderRadius: 3,
|
|
2471
|
+
position: "absolute",
|
|
2472
|
+
top: 8,
|
|
2473
|
+
left: "calc(50% - 15px)"
|
|
2474
|
+
}
|
|
2475
|
+
}
|
|
2476
|
+
),
|
|
2477
|
+
/* @__PURE__ */ import_react20.default.createElement(import_material14.Stack, { flexDirection: "column", height: "100%" }, /* @__PURE__ */ import_react20.default.createElement(
|
|
2478
|
+
DrawerHeader,
|
|
2479
|
+
{
|
|
2480
|
+
title,
|
|
2481
|
+
colorTitle,
|
|
2482
|
+
onClose: handleDrawerClose
|
|
2483
|
+
}
|
|
2484
|
+
), /* @__PURE__ */ import_react20.default.createElement(DrawerContent, { arrayElements }), /* @__PURE__ */ import_react20.default.createElement(DrawerActions, { actions: drawerActions, anchor }))
|
|
2429
2485
|
));
|
|
2430
2486
|
}
|
|
2431
2487
|
|
|
@@ -2759,20 +2815,6 @@ function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSel
|
|
|
2759
2815
|
import_x_license2.LicenseInfo.setLicenseKey(
|
|
2760
2816
|
"77d49a57fbc5f4af35ddb05c5f1742e0Tz0xMTI3MjgsRT0xNzc4MzcxMTk5MDAwLFM9cHJvLExNPXN1YnNjcmlwdGlvbixQVj1RMy0yMDI0LEtWPTI="
|
|
2761
2817
|
);
|
|
2762
|
-
const columnsWidthConfig = import_react27.default.useMemo(() => {
|
|
2763
|
-
var _a, _b;
|
|
2764
|
-
if (!columns || columns.length === 0) return columns;
|
|
2765
|
-
const cols = [...columns];
|
|
2766
|
-
const lastIndex = cols.length - 1;
|
|
2767
|
-
if (!cols[lastIndex].flex) {
|
|
2768
|
-
cols[lastIndex] = __spreadProps(__spreadValues({}, cols[lastIndex]), {
|
|
2769
|
-
flex: 1,
|
|
2770
|
-
minWidth: (_b = (_a = cols[lastIndex].minWidth) != null ? _a : cols[lastIndex].width) != null ? _b : 120
|
|
2771
|
-
});
|
|
2772
|
-
delete cols[lastIndex].width;
|
|
2773
|
-
}
|
|
2774
|
-
return cols;
|
|
2775
|
-
}, [columns]);
|
|
2776
2818
|
const theme = (0, import_styles.useTheme)();
|
|
2777
2819
|
const apiRef = (0, import_x_data_grid_pro.useGridApiRef)();
|
|
2778
2820
|
const isRowSelectable = (params) => params.row.bloqueoChecked == false ? false : true;
|
|
@@ -2862,7 +2904,7 @@ function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSel
|
|
|
2862
2904
|
overflow: "hidden",
|
|
2863
2905
|
textOverflow: "ellipsis",
|
|
2864
2906
|
whiteSpace: "nowrap",
|
|
2865
|
-
color: "
|
|
2907
|
+
color: "#101840DE",
|
|
2866
2908
|
display: "flex",
|
|
2867
2909
|
alignItems: "center",
|
|
2868
2910
|
paddingLeft: params.rowNode.depth == 0 ? "5px" : params.rowNode.depth == 1 ? "15px" : "25px",
|
|
@@ -2991,7 +3033,7 @@ function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSel
|
|
|
2991
3033
|
apiRef,
|
|
2992
3034
|
rowHeight: styleRowHeight,
|
|
2993
3035
|
rows: arrayRows,
|
|
2994
|
-
columns
|
|
3036
|
+
columns,
|
|
2995
3037
|
density: styleDensity,
|
|
2996
3038
|
treeData: validationTreeData,
|
|
2997
3039
|
getTreeDataPath: validationTreeData == true ? getTreeDataPaths : void 0,
|
|
@@ -3036,7 +3078,7 @@ function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSel
|
|
|
3036
3078
|
"&.MuiDataGrid-root": {
|
|
3037
3079
|
[`--DataGrid-topContainerHeight`]: `${styleTopContainerHeight} !important`
|
|
3038
3080
|
},
|
|
3039
|
-
"
|
|
3081
|
+
"MuiDataGrid-root .MuiDataGrid-virtualScrollerContent .MuiDataGrid-row": {
|
|
3040
3082
|
"--height": "0px !important",
|
|
3041
3083
|
"minHeight": "0px !important",
|
|
3042
3084
|
"maxHeight": "0px !important"
|
|
@@ -3045,21 +3087,46 @@ function SCDataGridInitial({ data, columns, groupColumns, rowsTable, checkboxSel
|
|
|
3045
3087
|
padding: "0 !important",
|
|
3046
3088
|
background: "white"
|
|
3047
3089
|
},
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3090
|
+
// Ocultar scrollbars personalizados de MUI completamente
|
|
3091
|
+
"& .MuiDataGrid-scrollbar": {
|
|
3092
|
+
display: "none !important",
|
|
3093
|
+
visibility: "hidden !important",
|
|
3094
|
+
width: "0 !important",
|
|
3095
|
+
opacity: "0 !important"
|
|
3096
|
+
},
|
|
3097
|
+
"& .MuiDataGrid-scrollbar--vertical": {
|
|
3098
|
+
display: "none !important",
|
|
3099
|
+
visibility: "hidden !important",
|
|
3100
|
+
width: "0 !important",
|
|
3101
|
+
opacity: "0 !important"
|
|
3102
|
+
},
|
|
3103
|
+
// Scrollbar filler y content siempre transparentes
|
|
3104
|
+
"& .MuiDataGrid-scrollbarFiller": {
|
|
3105
|
+
backgroundColor: "transparent !important",
|
|
3106
|
+
display: "none !important"
|
|
3051
3107
|
},
|
|
3108
|
+
"& .MuiDataGrid-scrollbarContent": {
|
|
3109
|
+
backgroundColor: "transparent !important",
|
|
3110
|
+
display: "none !important"
|
|
3111
|
+
},
|
|
3112
|
+
// Scrollbar nativo visible solo cuando hay overflow
|
|
3052
3113
|
"& .MuiDataGrid-virtualScroller": {
|
|
3053
3114
|
overflowY: "auto !important",
|
|
3115
|
+
scrollbarWidth: "thin",
|
|
3116
|
+
scrollbarColor: "#888 transparent",
|
|
3054
3117
|
"&::-webkit-scrollbar": {
|
|
3055
|
-
width: "
|
|
3118
|
+
width: "8px",
|
|
3119
|
+
height: "8px"
|
|
3056
3120
|
},
|
|
3057
|
-
"
|
|
3058
|
-
|
|
3121
|
+
"&::-webkit-scrollbar-track": {
|
|
3122
|
+
background: "transparent"
|
|
3059
3123
|
},
|
|
3060
3124
|
"&::-webkit-scrollbar-thumb": {
|
|
3061
|
-
|
|
3125
|
+
background: "#888",
|
|
3062
3126
|
borderRadius: "4px"
|
|
3127
|
+
},
|
|
3128
|
+
"&::-webkit-scrollbar-thumb:hover": {
|
|
3129
|
+
background: "#555"
|
|
3063
3130
|
}
|
|
3064
3131
|
}
|
|
3065
3132
|
}
|