@m4l/components 9.3.24-JT04112025.beta.1 → 9.3.24-JT04112025.beta.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/@types/export.d.ts +6 -0
- package/@types/types.d.ts +26 -1
- package/components/CommonActions/components/ActionFormCancel/ActionFormCancel.js +8 -17
- package/components/CommonActions/components/ActionFormCancel/types.d.ts +0 -9
- package/components/DataGrid/DataGrid.js +6 -2
- package/components/DataGrid/Datagrid.styles.js +67 -18
- package/components/DataGrid/constants.d.ts +19 -0
- package/components/DataGrid/formatters/ColumnIconFormatter/formatter.d.ts +1 -2
- package/components/DataGrid/formatters/ColumnIconFormatter/formatter.js +3 -6
- package/components/DataGrid/formatters/ColumnIconFormatter/index.d.ts +0 -1
- package/components/DataGrid/formatters/ColumnIconFormatter/types.d.ts +2 -4
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/formatter.js +7 -1
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/types.d.ts +1 -0
- package/components/DataGrid/formatters/ColumnTagsFormatter/formatter.d.ts +8 -0
- package/components/DataGrid/formatters/ColumnTagsFormatter/formatter.js +16 -0
- package/components/DataGrid/formatters/ColumnTagsFormatter/index.d.ts +3 -0
- package/components/DataGrid/formatters/ColumnTagsFormatter/index.js +1 -0
- package/components/DataGrid/formatters/ColumnTagsFormatter/types.d.ts +5 -0
- package/components/DataGrid/formatters/ColumnTagsFormatter/useColumnTags.d.ts +9 -0
- package/components/DataGrid/formatters/ColumnTagsFormatter/useColumnTags.js +60 -0
- package/components/DataGrid/formatters/index.d.ts +1 -0
- package/components/DataGrid/hooks/useModalCardDetail.d.ts +2 -2
- package/components/DataGrid/hooks/useModalCardDetail.js +49 -48
- package/components/DataGrid/index.d.ts +1 -1
- package/components/DataGrid/slots/DataGridEnum.d.ts +2 -0
- package/components/DataGrid/slots/DataGridEnum.js +2 -0
- package/components/DataGrid/slots/DataGridSlot.d.ts +3 -1
- package/components/DataGrid/slots/DataGridSlot.js +45 -37
- package/components/DataGrid/subcomponents/Cards/helpers/calculateCardHeight.d.ts +18 -0
- package/components/DataGrid/subcomponents/Cards/helpers/calculateCardHeight.js +10 -0
- package/components/DataGrid/subcomponents/Cards/helpers/scrollToCardElement.d.ts +9 -0
- package/components/DataGrid/subcomponents/Cards/helpers/scrollToCardElement.js +25 -0
- package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.d.ts +1 -2
- package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.js +62 -73
- package/components/DataGrid/subcomponents/Cards/index.js +71 -16
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.js +36 -18
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.d.ts +1 -1
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.js +13 -20
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.d.ts +6 -1
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.js +67 -36
- package/components/DataGrid/subcomponents/Cards/subcomponents/IntersectCard/index.js +9 -2
- package/components/DataGrid/subcomponents/Cards/subcomponents/LazyLoadCard/index.js +4 -2
- package/components/DataGrid/subcomponents/Cards/types.d.ts +50 -1
- package/components/DataGrid/subcomponents/CheckboxCellAdapter/index.js +5 -2
- package/components/DataGrid/subcomponents/ControlNavigate/ControlNavigate.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/RowsCount/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfigCards/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/ViewMode/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettings/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettingsCards/index.js +1 -1
- package/components/DataGrid/subcomponents/Table/index.js +60 -41
- package/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.js +16 -18
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +3 -3
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +1 -1
- package/components/DataGrid/subcomponents/editors/TextEditor/index.js +1 -1
- package/components/DataGrid/tests/helpers/types.d.ts +3 -0
- package/components/DataGrid/types.d.ts +17 -4
- package/components/Label/Label.js +1 -1
- package/components/ObjectLogs/slots/ObjectLogsSlots.js +3 -5
- package/components/PaperForm/PaperForm.js +1 -1
- package/components/PaperForm/components/Header.js +7 -9
- package/components/PaperForm/styles.js +4 -9
- package/components/PaperForm/types.d.ts +2 -3
- package/components/Stepper/Stepper.styles.js +0 -2
- package/components/Stepper/dictionary.js +1 -0
- package/components/Stepper/subcomponents/StepArea/index.js +115 -7
- package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.d.ts +2 -2
- package/components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.js +53 -3
- package/components/Stepper/subcomponents/StepperButtons/StepperNextButton/index.js +2 -3
- package/components/Stepper/subcomponents/StepperButtons/StepperPrevButton/index.js +2 -3
- package/components/Stepper/subcomponents/StepperButtons/StepperSubmitButton/index.js +5 -24
- package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/index.js +51 -2
- package/components/Stepper/types.d.ts +0 -4
- package/components/ToastContainer/ToastContainer.js +0 -1
- package/components/ToastContainer/constants.d.ts +1 -1
- package/components/ToastContainer/constants.js +1 -1
- package/components/WindowBase/contexts/WindowToolsMFContext/WindowToolsMFContext.js +3 -47
- package/components/WindowBase/contexts/WindowToolsMFContext/types.d.ts +1 -1
- package/components/WindowBase/subcomponents/Component/index.d.ts +1 -12
- package/components/WindowBase/subcomponents/Component/index.js +2 -56
- package/components/WindowBase/subcomponents/Component/types.d.ts +0 -1
- package/components/WindowBase/types.d.ts +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js +0 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useWindow.js +1 -1
- package/components/areas/contexts/AreasContext/store.js +1 -5
- package/components/areas/contexts/AreasContext/types.d.ts +1 -1
- package/components/formatters/IconsFormatter/IconsFormatter.d.ts +6 -0
- package/components/formatters/IconsFormatter/IconsFormatter.js +22 -0
- package/components/formatters/IconsFormatter/IconsFormatter.styles.d.ts +2 -0
- package/components/formatters/IconsFormatter/IconsFormatter.styles.js +29 -0
- package/components/formatters/IconsFormatter/constants.d.ts +1 -0
- package/components/formatters/IconsFormatter/constants.js +4 -0
- package/components/{DataGrid/formatters/ColumnIconFormatter → formatters/IconsFormatter}/helpers/renderIcon.d.ts +2 -2
- package/components/formatters/IconsFormatter/helpers/renderIcon.js +24 -0
- package/components/formatters/IconsFormatter/helpers/renderMultipleIcons.d.ts +7 -0
- package/components/formatters/IconsFormatter/helpers/renderMultipleIcons.js +16 -0
- package/components/formatters/IconsFormatter/index.d.ts +3 -0
- package/components/formatters/IconsFormatter/index.js +1 -0
- package/components/formatters/IconsFormatter/slots/IconsFormatterEnum.d.ts +5 -0
- package/components/formatters/IconsFormatter/slots/IconsFormatterEnum.js +9 -0
- package/components/formatters/IconsFormatter/slots/IconsFormatterSlots.d.ts +9 -0
- package/components/formatters/IconsFormatter/slots/IconsFormatterSlots.js +22 -0
- package/components/formatters/IconsFormatter/types.d.ts +57 -0
- package/components/formatters/IconsFormatter/types.js +1 -0
- package/components/formatters/TagsFormatter/TagsFormatter.d.ts +5 -0
- package/components/formatters/TagsFormatter/TagsFormatter.js +28 -0
- package/components/formatters/TagsFormatter/TagsFormatter.styles.d.ts +2 -0
- package/components/formatters/TagsFormatter/TagsFormatter.styles.js +41 -0
- package/components/formatters/TagsFormatter/constants.d.ts +5 -0
- package/components/formatters/TagsFormatter/constants.js +11 -0
- package/components/formatters/TagsFormatter/helpers/renderMultipleTag.d.ts +8 -0
- package/components/formatters/TagsFormatter/helpers/renderMultipleTag.js +19 -0
- package/components/formatters/TagsFormatter/helpers/renderTag.d.ts +7 -0
- package/components/formatters/TagsFormatter/helpers/renderTag.js +9 -0
- package/components/formatters/TagsFormatter/helpers/validateHexColor.d.ts +8 -0
- package/components/formatters/TagsFormatter/helpers/validateHexColor.js +9 -0
- package/components/formatters/TagsFormatter/index.d.ts +2 -0
- package/components/formatters/TagsFormatter/index.js +1 -0
- package/components/formatters/TagsFormatter/slots/TagsFormatterEnum.d.ts +5 -0
- package/components/formatters/TagsFormatter/slots/TagsFormatterEnum.js +9 -0
- package/components/formatters/TagsFormatter/slots/TagsFormatterSlots.d.ts +6 -0
- package/components/formatters/TagsFormatter/slots/TagsFormatterSlots.js +16 -0
- package/components/formatters/TagsFormatter/subcomponents/Tag/Tag.d.ts +5 -0
- package/components/formatters/TagsFormatter/subcomponents/Tag/Tag.js +35 -0
- package/components/formatters/TagsFormatter/subcomponents/Tag/index.d.ts +0 -0
- package/components/formatters/TagsFormatter/types.d.ts +47 -0
- package/components/formatters/index.d.ts +6 -5
- package/components/hook-form/RHFormContext/styles.js +1 -2
- package/components/mui_extended/CircularProgress/types.d.ts +1 -1
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/store.js +1 -5
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/types.d.ts +1 -1
- package/components/popups/components/PopupsProvider/hooks/usePopups.d.ts +4 -2
- package/components/popups/components/PopupsProvider/hooks/usePopups.js +7 -19
- package/components/popups/components/PopupsViewer/PopupsViewer.js +1 -1
- package/components/popups/components/PopupsViewer/PopupsViewer.styles.js +1 -1
- package/components/popups/components/PopupsViewer/subcomponents/Popup/Popup.js +21 -32
- package/contexts/ModalContext/index.js +5 -5
- package/index.js +32 -28
- package/package.json +1 -1
- package/components/DataGrid/formatters/ColumnIconFormatter/constants.js +0 -4
- package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderIcon.js +0 -58
- package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderMultipleIcons.d.ts +0 -7
- package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderMultipleIcons.js +0 -19
- package/components/Stepper/subcomponents/StepArea/hooks/useStepArea.d.ts +0 -13
- package/components/Stepper/subcomponents/StepArea/hooks/useStepArea.js +0 -111
- package/components/Stepper/subcomponents/StepArea/hooks/useVisibileSteps.d.ts +0 -8
- package/components/Stepper/subcomponents/StepArea/hooks/useVisibileSteps.js +0 -79
- package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/hooks/useIsStepVisible.d.ts +0 -8
- package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/hooks/useIsStepVisible.js +0 -93
package/@types/export.d.ts
CHANGED
|
@@ -235,5 +235,11 @@ declare module '@mui/material/styles' {
|
|
|
235
235
|
M4LTextField?: {
|
|
236
236
|
styleOverrides?: ComponentsOverrides<Theme>[' M4LTextField'];
|
|
237
237
|
};
|
|
238
|
+
M4LTagsFormatter?: {
|
|
239
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LTagsFormatter'];
|
|
240
|
+
};
|
|
241
|
+
M4LIconsFormatter?: {
|
|
242
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LIconsFormatter'];
|
|
243
|
+
};
|
|
238
244
|
}
|
|
239
245
|
}
|
package/@types/types.d.ts
CHANGED
|
@@ -292,7 +292,18 @@ import {
|
|
|
292
292
|
ImageTextOwnerState,
|
|
293
293
|
ImageTextSlotsType,
|
|
294
294
|
} from '../components/ImageText/types';
|
|
295
|
-
import {
|
|
295
|
+
import {
|
|
296
|
+
FormContainerOwnerState,
|
|
297
|
+
FormContainerSlotsType,
|
|
298
|
+
} from '../components/FormContainer/types';
|
|
299
|
+
import {
|
|
300
|
+
TagsFormatterOwnerState,
|
|
301
|
+
TagsFormatterSlotsType,
|
|
302
|
+
} from '../components/formatters/TagsFormatter/types';
|
|
303
|
+
import {
|
|
304
|
+
IconsFormatterOwnerState,
|
|
305
|
+
IconsFormatterSlotsType,
|
|
306
|
+
} from '../components/formatters/IconsFormatter/types';
|
|
296
307
|
|
|
297
308
|
declare module '@mui/material/styles' {
|
|
298
309
|
// Define the slots in the theme
|
|
@@ -381,6 +392,8 @@ declare module '@mui/material/styles' {
|
|
|
381
392
|
M4LStepper: StepperSlotsType;
|
|
382
393
|
M4LImageText: ImageTextSlotsType;
|
|
383
394
|
M4LFormContainer: FormContainerSlotsType;
|
|
395
|
+
M4LTagsFormatter: TagsFormatterSlotsType;
|
|
396
|
+
M4LIconsFormatter: IconsFormatterSlotsType;
|
|
384
397
|
}
|
|
385
398
|
interface ComponentsPropsList {
|
|
386
399
|
// Extend ComponentsProps or ComponentsOwnerState(this extend ComponentProps)
|
|
@@ -468,6 +481,8 @@ declare module '@mui/material/styles' {
|
|
|
468
481
|
M4LStepper: Partial<StepperOwnerState>;
|
|
469
482
|
M4LImageText: Partial<ImageTextOwnerState>;
|
|
470
483
|
M4LFormContainer: Partial<FormContainerOwnerState>;
|
|
484
|
+
M4LTagsFormatter: Partial<TagsFormatterOwnerState>;
|
|
485
|
+
M4LIconsFormatter: Partial<IconsFormatterOwnerState>;
|
|
471
486
|
}
|
|
472
487
|
interface Components {
|
|
473
488
|
M4LDynamicFilter?: {
|
|
@@ -900,5 +915,15 @@ declare module '@mui/material/styles' {
|
|
|
900
915
|
styleOverrides?: ComponentsOverrides<Theme>['M4LFormContainer'];
|
|
901
916
|
variants?: ComponentsVariants['M4LFormContainer'];
|
|
902
917
|
};
|
|
918
|
+
M4LTagsFormatter?: {
|
|
919
|
+
defaultProps?: ComponentsPropsList['M4LTagsFormatter'];
|
|
920
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LTagsFormatter'];
|
|
921
|
+
variants?: ComponentsVariants['M4LTagsFormatter'];
|
|
922
|
+
};
|
|
923
|
+
M4LIconsFormatter?: {
|
|
924
|
+
defaultProps?: ComponentsPropsList['M4LIconsFormatter'];
|
|
925
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LIconsFormatter'];
|
|
926
|
+
variants?: ComponentsVariants['M4LIconsFormatter'];
|
|
927
|
+
};
|
|
903
928
|
}
|
|
904
929
|
}
|
|
@@ -10,23 +10,17 @@ import { D as DICTIONARY } from "../../dictionary.js";
|
|
|
10
10
|
import { W as WindowConfirm } from "../../../WindowConfirm/WindowConfirm.js";
|
|
11
11
|
import { B as ButtonRootStyled } from "./slots/ActionFormCancelSlots.js";
|
|
12
12
|
function ActionFormCancel(props) {
|
|
13
|
-
const {
|
|
14
|
-
className,
|
|
15
|
-
onClose,
|
|
16
|
-
linkToCloseWindow,
|
|
17
|
-
"data-testid": dataTestId
|
|
18
|
-
} = props;
|
|
13
|
+
const { className } = props;
|
|
19
14
|
const { getLabel } = useModuleDictionary();
|
|
20
15
|
const { openModal } = useModal();
|
|
21
|
-
const { close, setFnQueryClose } = useWindowToolsMF();
|
|
16
|
+
const { close: closeWindow, setFnQueryClose: setQueryClose } = useWindowToolsMF();
|
|
22
17
|
const { control } = useFormContext();
|
|
23
18
|
const { isDirty } = useFormState({
|
|
24
19
|
control
|
|
25
20
|
});
|
|
26
21
|
const onConfirmQuit = useCallback(() => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}, [close, onClose]);
|
|
22
|
+
closeWindow();
|
|
23
|
+
}, []);
|
|
30
24
|
const onClickCancel = useCallback(() => {
|
|
31
25
|
if (isDirty) {
|
|
32
26
|
openModal({
|
|
@@ -44,12 +38,10 @@ function ActionFormCancel(props) {
|
|
|
44
38
|
} else {
|
|
45
39
|
onConfirmQuit();
|
|
46
40
|
}
|
|
47
|
-
}, [isDirty, openModal
|
|
41
|
+
}, [getLabel, isDirty, openModal]);
|
|
48
42
|
useEffect(() => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
}, [onClickCancel, setFnQueryClose, linkToCloseWindow]);
|
|
43
|
+
setQueryClose(onClickCancel);
|
|
44
|
+
}, []);
|
|
53
45
|
return /* @__PURE__ */ jsx(
|
|
54
46
|
ButtonRootStyled,
|
|
55
47
|
{
|
|
@@ -57,8 +49,7 @@ function ActionFormCancel(props) {
|
|
|
57
49
|
variant: "outlined",
|
|
58
50
|
onClick: onClickCancel,
|
|
59
51
|
className: clsx(classActoinFormCancelRoot, className),
|
|
60
|
-
label: getLabel(DICTIONARY.LABEL_CANCEL)
|
|
61
|
-
"data-testid": dataTestId
|
|
52
|
+
label: getLabel(DICTIONARY.LABEL_CANCEL)
|
|
62
53
|
}
|
|
63
54
|
);
|
|
64
55
|
}
|
|
@@ -10,15 +10,6 @@ export interface ActionFormCancelProps extends ButtonProps {
|
|
|
10
10
|
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
11
11
|
dictionaryId?: string;
|
|
12
12
|
className?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Cuando efectivamente se cierrar la ventana se ejecuta esta función.
|
|
15
|
-
*/
|
|
16
|
-
onClose?: () => void;
|
|
17
|
-
/**
|
|
18
|
-
* Vicular la funcion de cierre de consulta con la funcion de cierre de la ventana.
|
|
19
|
-
*/
|
|
20
|
-
linkToCloseWindow: boolean;
|
|
21
|
-
'data-testid'?: string;
|
|
22
13
|
}
|
|
23
14
|
export interface ActionFormCancelOwnerState {
|
|
24
15
|
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
@@ -39,7 +39,8 @@ function DataGrid(props) {
|
|
|
39
39
|
externalSortSettings,
|
|
40
40
|
externalFilterSettings,
|
|
41
41
|
defaultViewMode,
|
|
42
|
-
cardsViewConfig
|
|
42
|
+
cardsViewConfig,
|
|
43
|
+
focusOnRowKey
|
|
43
44
|
} = props;
|
|
44
45
|
const {
|
|
45
46
|
withSettings,
|
|
@@ -122,7 +123,10 @@ function DataGrid(props) {
|
|
|
122
123
|
onSelectedRowsChange,
|
|
123
124
|
rowKeyGetter,
|
|
124
125
|
onRowsChange,
|
|
125
|
-
cardsViewConfig
|
|
126
|
+
cardsViewConfig,
|
|
127
|
+
focusOnRowKey,
|
|
128
|
+
checkedRows,
|
|
129
|
+
onCheckedRowsChange
|
|
126
130
|
}
|
|
127
131
|
),
|
|
128
132
|
withPager && /* @__PURE__ */ jsx(
|
|
@@ -315,8 +315,6 @@ const dataGridStyles = {
|
|
|
315
315
|
display: "contents"
|
|
316
316
|
},
|
|
317
317
|
'& [role="columnheader"]': {
|
|
318
|
-
justifyContent: "center",
|
|
319
|
-
alignItems: "center",
|
|
320
318
|
paddingTop: theme.vars.size.baseSpacings.sp2,
|
|
321
319
|
paddingBottom: theme.vars.size.baseSpacings.sp2
|
|
322
320
|
},
|
|
@@ -427,8 +425,6 @@ const dataGridStyles = {
|
|
|
427
425
|
},
|
|
428
426
|
"&.rdg-cell-frozen": {
|
|
429
427
|
display: "flex",
|
|
430
|
-
justifyContent: "center",
|
|
431
|
-
alignItems: "center",
|
|
432
428
|
boxShadow: "unset",
|
|
433
429
|
position: "sticky !important",
|
|
434
430
|
zIndex: 1
|
|
@@ -437,6 +433,18 @@ const dataGridStyles = {
|
|
|
437
433
|
position: "sticky !important",
|
|
438
434
|
zIndex: 1
|
|
439
435
|
},
|
|
436
|
+
// Ajuste de celda checkbox (No header)
|
|
437
|
+
'&:has(> .MuiCheckbox-root):not([role="columnheader"])': {
|
|
438
|
+
overflow: "visible",
|
|
439
|
+
display: "flex",
|
|
440
|
+
alignItems: "center",
|
|
441
|
+
justifyContent: "center"
|
|
442
|
+
},
|
|
443
|
+
// Ajuste al checkbox (Header)
|
|
444
|
+
'&[role="columnheader"]:has(> .MuiCheckbox-root)': {
|
|
445
|
+
justifyContent: "center",
|
|
446
|
+
alignItems: "center"
|
|
447
|
+
},
|
|
440
448
|
"&:after": {
|
|
441
449
|
content: `""`,
|
|
442
450
|
borderRight: `${theme.vars.size.baseSpacings.sp0} solid ${theme.vars.palette.divider}`,
|
|
@@ -452,10 +460,13 @@ const dataGridStyles = {
|
|
|
452
460
|
position: "sticky",
|
|
453
461
|
top: 0,
|
|
454
462
|
zIndex: 2,
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
463
|
+
// Ajuste de header checkbox
|
|
464
|
+
"&:has(> .MuiCheckbox-root)": {
|
|
465
|
+
borderTopLeftRadius: theme.vars.size.baseSpacings.sp2,
|
|
466
|
+
overflow: "visible",
|
|
467
|
+
display: "flex",
|
|
468
|
+
alignItems: "center",
|
|
469
|
+
justifyContent: "center"
|
|
459
470
|
}
|
|
460
471
|
}
|
|
461
472
|
},
|
|
@@ -463,9 +474,13 @@ const dataGridStyles = {
|
|
|
463
474
|
...theme.colorSchemes.finalTheme.typography.bodyDens,
|
|
464
475
|
//ajuste de contenido filtro del DataGrid
|
|
465
476
|
width: "100%",
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
477
|
+
display: "-webkit-box !important",
|
|
478
|
+
WebkitBoxOrient: "vertical !important",
|
|
479
|
+
WebkitLineClamp: ownerState?.currentRowHeightVariant === "compact" ? "1 !important" : ownerState?.currentRowHeightVariant === "confortable" ? "3 !important" : "2 !important",
|
|
480
|
+
overflow: "hidden !important",
|
|
481
|
+
textOverflow: "ellipsis !important",
|
|
482
|
+
wordBreak: "break-word !important",
|
|
483
|
+
whiteSpace: "normal !important",
|
|
469
484
|
...getTypographyStyles(
|
|
470
485
|
theme.generalSettings.isMobile,
|
|
471
486
|
ownerState?.size || "medium",
|
|
@@ -474,6 +489,22 @@ const dataGridStyles = {
|
|
|
474
489
|
lineHeight: "var(--rdg-summary-row-height)!important",
|
|
475
490
|
color: `${theme.vars.palette.text.secondary}`
|
|
476
491
|
},
|
|
492
|
+
/**
|
|
493
|
+
* Estilos para las celdas de datos del grid (no headers, no checkbox)
|
|
494
|
+
* - .rdg-cell: Todas las celdas del grid
|
|
495
|
+
* - :not([role="columnheader"]): EXCLUYE las celdas de header
|
|
496
|
+
* - :not(:has(> .MuiCheckbox-root)): EXCLUYE las celdas que contienen checkbox
|
|
497
|
+
*/
|
|
498
|
+
'& .rdg-cell:not([role="columnheader"]):not(:has(> .MuiCheckbox-root))': {
|
|
499
|
+
display: "-webkit-box !important",
|
|
500
|
+
WebkitBoxOrient: "vertical !important",
|
|
501
|
+
WebkitLineClamp: ownerState?.currentRowHeightVariant === "compact" ? "1 !important" : ownerState?.currentRowHeightVariant === "confortable" ? "3 !important" : "2 !important",
|
|
502
|
+
overflow: "hidden !important",
|
|
503
|
+
textOverflow: "ellipsis !important",
|
|
504
|
+
wordBreak: "break-word !important",
|
|
505
|
+
whiteSpace: "normal !important",
|
|
506
|
+
lineHeight: ownerState?.currentRowHeightVariant === "compact" ? `${ownerState?.currentRowHeight}px !important` : ownerState?.currentRowHeightVariant === "confortable" ? `${(ownerState?.currentRowHeight ?? 48) / 3}px !important` : `${(ownerState?.currentRowHeight ?? 40) / 2}px !important`
|
|
507
|
+
},
|
|
477
508
|
'& .rdg-cell[role="columnheader"].filter-cell': {
|
|
478
509
|
"& .M4LDataGrid-draggableHeaderRoot": {
|
|
479
510
|
gap: theme.vars.size.baseSpacings.sp3,
|
|
@@ -501,7 +532,6 @@ const dataGridStyles = {
|
|
|
501
532
|
// Alineaciones
|
|
502
533
|
"& .rdg-cell.rdg-cell-align-left": {
|
|
503
534
|
textAlign: "start",
|
|
504
|
-
display: "inline",
|
|
505
535
|
justifyContent: "center",
|
|
506
536
|
alignContent: "center",
|
|
507
537
|
alignItems: "center",
|
|
@@ -576,7 +606,6 @@ const dataGridStyles = {
|
|
|
576
606
|
// Estilado de celdas de la cabecera
|
|
577
607
|
"& .rdg-header-row .rdg-cell": {
|
|
578
608
|
gridTemplateColumns: "auto",
|
|
579
|
-
placeContent: "center",
|
|
580
609
|
boxShadow: "unset!important",
|
|
581
610
|
borderBottom: theme.vars.size.borderStroke.container,
|
|
582
611
|
borderColor: `${theme.vars.palette?.background.surface}!important`,
|
|
@@ -726,6 +755,12 @@ const dataGridStyles = {
|
|
|
726
755
|
borderColor: theme.vars.palette.primary.selected
|
|
727
756
|
}
|
|
728
757
|
}),
|
|
758
|
+
/**
|
|
759
|
+
* Contenedor del contenido de la card
|
|
760
|
+
*/
|
|
761
|
+
cardContentWrapper: () => ({
|
|
762
|
+
width: "100%"
|
|
763
|
+
}),
|
|
729
764
|
/**
|
|
730
765
|
* Header de la card con checkbox y acciones
|
|
731
766
|
*/
|
|
@@ -752,6 +787,15 @@ const dataGridStyles = {
|
|
|
752
787
|
alignItems: "center",
|
|
753
788
|
gap: theme.vars.size.baseSpacings.sp1
|
|
754
789
|
}),
|
|
790
|
+
/**
|
|
791
|
+
* Contenido de la card (body)
|
|
792
|
+
*/
|
|
793
|
+
cardContent: ({ theme }) => ({
|
|
794
|
+
display: "flex",
|
|
795
|
+
flexDirection: "column",
|
|
796
|
+
gap: theme.vars.size.baseSpacings.sp2,
|
|
797
|
+
padding: theme.vars.size.density.compact
|
|
798
|
+
}),
|
|
755
799
|
/**
|
|
756
800
|
* Contenedor de las columnas de la card
|
|
757
801
|
*/
|
|
@@ -918,8 +962,8 @@ const dataGridStyles = {
|
|
|
918
962
|
flexDirection: "column",
|
|
919
963
|
lineHeight: "1",
|
|
920
964
|
height: "100%",
|
|
921
|
-
|
|
922
|
-
|
|
965
|
+
width: "100%",
|
|
966
|
+
justifyContent: "center"
|
|
923
967
|
}),
|
|
924
968
|
/**
|
|
925
969
|
* Estilos para el icono de busqueda para los campos de ordenamiento en columnas
|
|
@@ -989,10 +1033,15 @@ const dataGridStyles = {
|
|
|
989
1033
|
/**
|
|
990
1034
|
* Estilos para el contenedor del nombre de la columna
|
|
991
1035
|
*/
|
|
992
|
-
nameColumn: () => ({
|
|
993
|
-
|
|
1036
|
+
nameColumn: ({ ownerState }) => ({
|
|
1037
|
+
display: "-webkit-box",
|
|
1038
|
+
WebkitBoxOrient: "vertical",
|
|
1039
|
+
WebkitLineClamp: ownerState?.currentRowHeightVariant === "compact" ? 1 : ownerState?.currentRowHeightVariant === "confortable" ? 3 : 2,
|
|
994
1040
|
overflow: "hidden",
|
|
995
|
-
|
|
1041
|
+
textOverflow: "ellipsis",
|
|
1042
|
+
wordBreak: "break-word",
|
|
1043
|
+
whiteSpace: "normal",
|
|
1044
|
+
width: "100%"
|
|
996
1045
|
}),
|
|
997
1046
|
/**
|
|
998
1047
|
* Estilos para el contenedor del icono de la columna
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DataGridDensityConfig } from './types';
|
|
1
2
|
export declare const DATAGRID_PREFIX_NAME = "M4LDataGrid";
|
|
2
3
|
export declare const DATAGRID_SELECT_COLUMN_KEY = "M4LDataGrid-CheckedColumn";
|
|
3
4
|
export declare const DATAGRID_ACTIONS_COLUMN_KEY = "M4LDataGrid-ActionsColumn";
|
|
@@ -33,3 +34,21 @@ export declare const DATAGRID_ROW_HEADER_HEIGHTS: number[];
|
|
|
33
34
|
* Alturas de las filas del DataGrid
|
|
34
35
|
*/
|
|
35
36
|
export declare const DATAGRID_ROW_HEIGHTS: number[];
|
|
37
|
+
/**
|
|
38
|
+
* Configuración de densidad para el DataGrid.
|
|
39
|
+
* Densidad estándar
|
|
40
|
+
*/
|
|
41
|
+
export declare const DATAGRID_DENSITIES_STANDARD: DataGridDensityConfig;
|
|
42
|
+
/**
|
|
43
|
+
* Alturas de las filas del encabezado del DataGrid
|
|
44
|
+
*/
|
|
45
|
+
export declare const DATAGRID_ROW_HEADER_HEIGHTS_CONFORTABLE: number[];
|
|
46
|
+
/**
|
|
47
|
+
* Alturas de las filas del DataGrid
|
|
48
|
+
*/
|
|
49
|
+
export declare const DATAGRID_ROW_HEIGHTS_CONFORTABLE: number[];
|
|
50
|
+
/**
|
|
51
|
+
* Configuración de densidad para el DataGrid.
|
|
52
|
+
* Densidad confortable
|
|
53
|
+
*/
|
|
54
|
+
export declare const DATAGRID_DENSITIES_CONFORTABLE: DataGridDensityConfig;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ColumnIconFormatterProps } from './types';
|
|
2
2
|
import { RenderCellProps } from 'react-data-grid';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* @template TRow - Tipo de datos de la fila
|
|
4
|
+
* ColumnIconFormatter es un formatter que renderiza un icono o varios iconos en una columna de un DataGrid
|
|
6
5
|
*/
|
|
7
6
|
export declare function ColumnIconFormatter<TRow>(props: ColumnIconFormatterProps<TRow>): (renderProps: RenderCellProps<TRow>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { I as IconsFormatter } from "../../../formatters/IconsFormatter/IconsFormatter.js";
|
|
3
3
|
function ColumnIconFormatter(props) {
|
|
4
4
|
const { getIconProps } = props;
|
|
5
5
|
return (renderProps) => {
|
|
6
6
|
const iconProps = getIconProps(renderProps.row);
|
|
7
|
-
|
|
8
|
-
return renderMultipleIcons(iconProps);
|
|
9
|
-
}
|
|
10
|
-
return renderIcon(iconProps);
|
|
7
|
+
return /* @__PURE__ */ jsx(IconsFormatter, { icons: iconProps });
|
|
11
8
|
};
|
|
12
9
|
}
|
|
13
10
|
export {
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { DeepKeyOf } from '../../../../utils/types';
|
|
3
2
|
import { Theme } from '@mui/material';
|
|
3
|
+
import { Sizes } from '@m4l/styles';
|
|
4
4
|
export type IconColorDeep = DeepKeyOf<Theme['vars']['palette']> | string;
|
|
5
5
|
export type ColumnIconResponse = {
|
|
6
6
|
iconUrl: string;
|
|
7
7
|
tooltip?: string;
|
|
8
8
|
onClick?: () => void;
|
|
9
|
-
Component?: React.ElementType;
|
|
10
9
|
dataTestId?: string;
|
|
11
|
-
componentProps?: React.ComponentPropsWithoutRef<React.ElementType>;
|
|
12
10
|
visible?: boolean;
|
|
13
11
|
color?: IconColorDeep;
|
|
14
|
-
size?: 'small' | 'medium'
|
|
12
|
+
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
15
13
|
};
|
|
16
14
|
export interface ColumnIconFormatterProps<TRow> {
|
|
17
15
|
getIconProps: (obRowProps: TRow) => ColumnIconResponse | ColumnIconResponse[];
|
|
@@ -13,6 +13,11 @@ function ColumnSetCheckFormatter(parameters) {
|
|
|
13
13
|
newCheckedRows.delete(rowKeyGetter(props.row));
|
|
14
14
|
}
|
|
15
15
|
setCheckedRows(newCheckedRows);
|
|
16
|
+
if (parameters.onAfterChange) {
|
|
17
|
+
parameters.onAfterChange();
|
|
18
|
+
} else if (props.column.onAfterChange) {
|
|
19
|
+
props.column.onAfterChange();
|
|
20
|
+
}
|
|
16
21
|
};
|
|
17
22
|
let disabled = false;
|
|
18
23
|
if (disabledGetter) {
|
|
@@ -26,7 +31,8 @@ function ColumnSetCheckFormatter(parameters) {
|
|
|
26
31
|
tabIndex: props.tabIndex,
|
|
27
32
|
onChange,
|
|
28
33
|
"aria-label": "Select"
|
|
29
|
-
}
|
|
34
|
+
},
|
|
35
|
+
`${rowKeyGetter(row)}-${checkedRows.has(rowKeyGetter(row))}`
|
|
30
36
|
);
|
|
31
37
|
};
|
|
32
38
|
return formatter;
|
|
@@ -5,4 +5,5 @@ export type ColumnSetCheckFormatterProps<Row, TKey extends RowKey = RowKey> = {
|
|
|
5
5
|
disabledGetter?: (row: Row) => boolean;
|
|
6
6
|
rowKeyGetter: (row: Row) => TKey;
|
|
7
7
|
useHook: (field: string) => [ReadonlySet<TKey>, (newHas: ReadonlySet<TKey>) => void];
|
|
8
|
+
onAfterChange?: () => void;
|
|
8
9
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ColumnTagsFormatterProps } from './types';
|
|
2
|
+
import { RenderCellProps } from 'react-data-grid';
|
|
3
|
+
/**
|
|
4
|
+
* Formatter para mostrar tags en una columna
|
|
5
|
+
* @param props - Propiedades del formatter
|
|
6
|
+
* @returns Componente TagFormatter
|
|
7
|
+
*/
|
|
8
|
+
export declare const ColumnTagsFormatter: <TRow>(props: ColumnTagsFormatterProps<TRow>) => (renderProps: RenderCellProps<TRow>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getPropertyByString } from "@m4l/core";
|
|
3
|
+
import { T as TagsFormatter } from "../../../formatters/TagsFormatter/TagsFormatter.js";
|
|
4
|
+
const ColumnTagsFormatter = (props) => {
|
|
5
|
+
const { fieldTags, size, className } = props;
|
|
6
|
+
return (renderProps) => {
|
|
7
|
+
const tags = getPropertyByString(
|
|
8
|
+
renderProps.row,
|
|
9
|
+
fieldTags.toString()
|
|
10
|
+
);
|
|
11
|
+
return /* @__PURE__ */ jsx(TagsFormatter, { tags, size, className });
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
ColumnTagsFormatter as C
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DeepKeyOf } from '../../../../utils/types';
|
|
2
|
+
import { TagsFormatterProps } from '../../../formatters/TagsFormatter/types';
|
|
3
|
+
export interface ColumnTagsFormatterProps<TRow> extends Pick<TagsFormatterProps, 'size' | 'className'> {
|
|
4
|
+
fieldTags: DeepKeyOf<TRow>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ColumnTagsFormatterProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook que retorna el formatter, filter y customSort de la columna de tags
|
|
4
|
+
*/
|
|
5
|
+
export declare const useColumnTags: <TRow>(props: ColumnTagsFormatterProps<TRow>) => {
|
|
6
|
+
formatter: (renderProps: import('react-data-grid').RenderCellProps<TRow, unknown>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
customFilter: (row: TRow, value: string) => boolean;
|
|
8
|
+
customSort: (a: TRow, b: TRow) => 0 | 1 | -1;
|
|
9
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { getPropertyByString } from "@m4l/core";
|
|
2
|
+
import { C as ColumnTagsFormatter } from "./formatter.js";
|
|
3
|
+
import { g as getColumnKey } from "../../helpers/getColumnKey.js";
|
|
4
|
+
import { deepEqual } from "fast-equals";
|
|
5
|
+
import { useState, useRef, useEffect, useMemo } from "react";
|
|
6
|
+
const getCustomTagFilter = (props) => {
|
|
7
|
+
const { fieldTags } = props;
|
|
8
|
+
return (row, value) => {
|
|
9
|
+
const tags = getPropertyByString(
|
|
10
|
+
row,
|
|
11
|
+
getColumnKey(fieldTags),
|
|
12
|
+
null
|
|
13
|
+
);
|
|
14
|
+
if (!tags) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
const tagsArray = Array.isArray(tags) ? tags : [tags];
|
|
18
|
+
return tagsArray.some(
|
|
19
|
+
(tag) => tag.label.toLowerCase().includes(value.toLowerCase())
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
const getCustomTagSort = (props) => {
|
|
24
|
+
return (a, b) => {
|
|
25
|
+
const tagsA = getPropertyByString(
|
|
26
|
+
a,
|
|
27
|
+
getColumnKey(props.fieldTags),
|
|
28
|
+
null
|
|
29
|
+
);
|
|
30
|
+
const tagsB = getPropertyByString(
|
|
31
|
+
b,
|
|
32
|
+
getColumnKey(props.fieldTags),
|
|
33
|
+
null
|
|
34
|
+
);
|
|
35
|
+
const firstLabelA = tagsA ? Array.isArray(tagsA) ? tagsA[0]?.label : tagsA.label : "";
|
|
36
|
+
const firstLabelB = tagsB ? Array.isArray(tagsB) ? tagsB[0]?.label : tagsB.label : "";
|
|
37
|
+
return firstLabelA > firstLabelB ? 1 : firstLabelA < firstLabelB ? -1 : 0;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
const useColumnTags = (props) => {
|
|
41
|
+
const [stateProps, setStateProps] = useState(props);
|
|
42
|
+
const refProps = useRef({ ...props });
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (!deepEqual(refProps.current, props)) {
|
|
45
|
+
refProps.current = props;
|
|
46
|
+
setStateProps(props);
|
|
47
|
+
}
|
|
48
|
+
}, [props]);
|
|
49
|
+
return useMemo(
|
|
50
|
+
() => ({
|
|
51
|
+
formatter: ColumnTagsFormatter(stateProps),
|
|
52
|
+
customFilter: getCustomTagFilter(stateProps),
|
|
53
|
+
customSort: getCustomTagSort(stateProps)
|
|
54
|
+
}),
|
|
55
|
+
[stateProps]
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
useColumnTags as u
|
|
60
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UseModalDetailProps } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
* Hook
|
|
3
|
+
* Hook que renderiza el modal de detalle para cualquier vista
|
|
4
4
|
* mostrando TODAS las columnas sin excepción
|
|
5
5
|
*/
|
|
6
|
-
export declare const useModalDetail: <TRow>({
|
|
6
|
+
export declare const useModalDetail: <TRow>({ columns, viewMode, onRowsChange, }: UseModalDetailProps<TRow>) => (row: TRow) => void;
|