@m4l/components 9.3.33 → 9.3.34-JT25112025.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/types.d.ts +1 -1
- package/components/DataGrid/Datagrid.styles.js +111 -39
- package/components/DataGrid/dictionary.d.ts +1 -0
- package/components/DataGrid/dictionary.js +2 -1
- package/components/DataGrid/formatters/ColumnColorFormatter/tests/ColumnColorFormatter.test.d.ts +1 -0
- package/components/DataGrid/formatters/ColumnColorFormatter/tests/useColumnColor.test.d.ts +1 -0
- package/components/DataGrid/formatters/ColumnTagsFormatter/tests/ColumnTagsFormatter.test.d.ts +1 -0
- package/components/DataGrid/formatters/ColumnTagsFormatter/tests/useColumnTags.test.d.ts +1 -0
- package/components/DataGrid/hooks/useModalCardDetail.d.ts +1 -1
- package/components/DataGrid/hooks/useModalCardDetail.js +6 -1
- package/components/DataGrid/icons.d.ts +1 -0
- package/components/DataGrid/icons.js +2 -1
- package/components/DataGrid/slots/DataGridEnum.d.ts +4 -1
- package/components/DataGrid/slots/DataGridEnum.js +3 -0
- package/components/DataGrid/slots/DataGridSlot.d.ts +3 -0
- package/components/DataGrid/slots/DataGridSlot.js +48 -33
- package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.d.ts +1 -1
- package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.js +47 -5
- package/components/DataGrid/subcomponents/Cards/index.js +6 -3
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.d.ts +1 -1
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.js +59 -15
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.js +1 -1
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.d.ts +2 -2
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.js +5 -1
- package/components/DataGrid/subcomponents/Cards/types.d.ts +16 -0
- package/components/DataGrid/subcomponents/CheckboxCellAdapter/index.js +1 -1
- package/components/DataGrid/subcomponents/ControlNavigate/ControlNavigate.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/index.js +2 -2
- 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/Table/index.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.js +1 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/CustomIcons.js +39 -14
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +1 -1
- package/components/DataGrid/subcomponents/editors/TextEditor/index.js +1 -1
- package/components/DataGrid/types.d.ts +12 -0
- package/components/TabsNavigator/hooks/useTabsNavigator/types.d.ts +1 -1
- package/package.json +1 -1
- package/components/DataGrid/formatters/ColumnIconFormatter/constants.d.ts +0 -4
package/@types/types.d.ts
CHANGED
|
@@ -293,7 +293,7 @@ import {
|
|
|
293
293
|
ImageTextSlotsType,
|
|
294
294
|
} from '../components/ImageText/types';
|
|
295
295
|
import { FormContainerOwnerState, FormContainerSlotsType } from '../components/FormContainer/types';
|
|
296
|
-
import { TabsNavigatorSlotsType } from '
|
|
296
|
+
import { TabsNavigatorSlotsType } from '../components/TabsNavigator/types';
|
|
297
297
|
import { EditLabelOwnerState, EditLabelSlotsType } from '../components/EditLabel/types';
|
|
298
298
|
import { MFIsolationAppOwnerState, MFIsolationAppSlotsType } from '../components/MFIsolationApp/types';
|
|
299
299
|
import {
|
|
@@ -24,6 +24,42 @@ const dataGridStyles = {
|
|
|
24
24
|
flex: 1,
|
|
25
25
|
overflow: "hidden",
|
|
26
26
|
"& .rdg .MuiCheckbox-root": {
|
|
27
|
+
overflow: "visible",
|
|
28
|
+
padding: 0,
|
|
29
|
+
...theme.generalSettings.isMobile ? {
|
|
30
|
+
width: theme.vars.size.mobile.small.action,
|
|
31
|
+
height: theme.vars.size.mobile.small.action
|
|
32
|
+
} : {
|
|
33
|
+
width: theme.vars.size.desktop.small.action,
|
|
34
|
+
height: theme.vars.size.desktop.small.action
|
|
35
|
+
},
|
|
36
|
+
display: "inline-flex",
|
|
37
|
+
justifyContent: "center",
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
borderRadius: theme.size.borderRadius.r1,
|
|
40
|
+
"&:hover": {
|
|
41
|
+
backgroundColor: theme.vars.palette.default.hoverOpacity
|
|
42
|
+
},
|
|
43
|
+
"&:active": {
|
|
44
|
+
backgroundColor: theme.vars.palette.default.activeOpacity
|
|
45
|
+
},
|
|
46
|
+
"&.Mui-checked": {
|
|
47
|
+
"&:hover": {
|
|
48
|
+
backgroundColor: theme.vars.palette.primary.hoverOpacity,
|
|
49
|
+
"& .M4LIcon-icon": {
|
|
50
|
+
backgroundColor: theme.vars.palette.primary.hover
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"&:active": {
|
|
54
|
+
backgroundColor: theme.vars.palette.primary.activeOpacity,
|
|
55
|
+
"& .M4LIcon-icon": {
|
|
56
|
+
backgroundColor: theme.vars.palette.primary.active
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"&.Mui-focusVisible, &:focus-visible": {
|
|
61
|
+
outline: `1px solid ${theme.vars.palette.primary.focusVisible}`
|
|
62
|
+
},
|
|
27
63
|
"& > svg": {
|
|
28
64
|
color: theme.vars.palette.text.secondary
|
|
29
65
|
}
|
|
@@ -380,33 +416,19 @@ const dataGridStyles = {
|
|
|
380
416
|
outline: `2px solid var(--rdg-selection-color)`,
|
|
381
417
|
outlineOffset: "-2px"
|
|
382
418
|
},
|
|
419
|
+
"&:has(> .MuiCheckbox-root)": {
|
|
420
|
+
overflow: "visible",
|
|
421
|
+
paddingInline: 0
|
|
422
|
+
},
|
|
383
423
|
"& .checkbox-checked": {
|
|
384
|
-
"&
|
|
385
|
-
|
|
386
|
-
}
|
|
387
|
-
...getSizeStyles(
|
|
388
|
-
theme,
|
|
389
|
-
ownerState?.size || "medium",
|
|
390
|
-
"base",
|
|
391
|
-
(size) => ({
|
|
392
|
-
minHeight: size,
|
|
393
|
-
height: size
|
|
394
|
-
})
|
|
395
|
-
)
|
|
424
|
+
"& .M4LIcon-icon": {
|
|
425
|
+
backgroundColor: theme.vars.palette.primary.enabled
|
|
426
|
+
}
|
|
396
427
|
},
|
|
397
428
|
"& .checkbox-unChecked": {
|
|
398
|
-
"&
|
|
399
|
-
|
|
400
|
-
}
|
|
401
|
-
...getSizeStyles(
|
|
402
|
-
theme,
|
|
403
|
-
ownerState?.size || "medium",
|
|
404
|
-
"base",
|
|
405
|
-
(size) => ({
|
|
406
|
-
minHeight: size,
|
|
407
|
-
height: size
|
|
408
|
-
})
|
|
409
|
-
)
|
|
429
|
+
"& .M4LIcon-icon": {
|
|
430
|
+
backgroundColor: theme.vars.palette.text.primary
|
|
431
|
+
}
|
|
410
432
|
},
|
|
411
433
|
"& .rdg-text-editor": {
|
|
412
434
|
textAlign: "inherit",
|
|
@@ -672,26 +694,54 @@ const dataGridStyles = {
|
|
|
672
694
|
* Estilos para el wrapper del CheckboxCellAdapter
|
|
673
695
|
* Aplica los mismos estilos que los checkboxes dentro de celdas rdg
|
|
674
696
|
*/
|
|
675
|
-
checkboxCellWrapper: ({ theme
|
|
697
|
+
checkboxCellWrapper: ({ theme }) => ({
|
|
676
698
|
"& .checkbox-checked": {
|
|
677
|
-
"&
|
|
678
|
-
|
|
679
|
-
}
|
|
680
|
-
...getSizeStyles(theme, ownerState?.size || "medium", "base", (size) => ({
|
|
681
|
-
minHeight: size,
|
|
682
|
-
height: size
|
|
683
|
-
}))
|
|
699
|
+
"& .M4LIcon-icon": {
|
|
700
|
+
backgroundColor: theme.vars.palette.primary.enabled
|
|
701
|
+
}
|
|
684
702
|
},
|
|
685
703
|
"& .checkbox-unChecked": {
|
|
686
|
-
"&
|
|
687
|
-
|
|
688
|
-
}
|
|
689
|
-
...getSizeStyles(theme, ownerState?.size || "medium", "base", (size) => ({
|
|
690
|
-
minHeight: size,
|
|
691
|
-
height: size
|
|
692
|
-
}))
|
|
704
|
+
"& .M4LIcon-icon": {
|
|
705
|
+
backgroundColor: theme.vars.palette.text.primary
|
|
706
|
+
}
|
|
693
707
|
},
|
|
694
708
|
"& .MuiCheckbox-root": {
|
|
709
|
+
overflow: "visible",
|
|
710
|
+
padding: 0,
|
|
711
|
+
...theme.generalSettings.isMobile ? {
|
|
712
|
+
width: theme.vars.size.mobile.small.action,
|
|
713
|
+
height: theme.vars.size.mobile.small.action
|
|
714
|
+
} : {
|
|
715
|
+
width: theme.vars.size.desktop.small.action,
|
|
716
|
+
height: theme.vars.size.desktop.small.action
|
|
717
|
+
},
|
|
718
|
+
display: "inline-flex",
|
|
719
|
+
justifyContent: "center",
|
|
720
|
+
alignItems: "center",
|
|
721
|
+
borderRadius: theme.size.borderRadius.r1,
|
|
722
|
+
"&:hover": {
|
|
723
|
+
backgroundColor: theme.vars.palette.default.hoverOpacity
|
|
724
|
+
},
|
|
725
|
+
"&:active": {
|
|
726
|
+
backgroundColor: theme.vars.palette.default.activeOpacity
|
|
727
|
+
},
|
|
728
|
+
"&.Mui-checked": {
|
|
729
|
+
"&:hover": {
|
|
730
|
+
backgroundColor: theme.vars.palette.primary.hoverOpacity,
|
|
731
|
+
"& .M4LIcon-icon": {
|
|
732
|
+
backgroundColor: theme.vars.palette.primary.hover
|
|
733
|
+
}
|
|
734
|
+
},
|
|
735
|
+
"&:active": {
|
|
736
|
+
backgroundColor: theme.vars.palette.primary.activeOpacity,
|
|
737
|
+
"& .M4LIcon-icon": {
|
|
738
|
+
backgroundColor: theme.vars.palette.primary.active
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
},
|
|
742
|
+
"&.Mui-focusVisible, &:focus-visible": {
|
|
743
|
+
outline: `1px solid ${theme.vars.palette.primary.focusVisible}`
|
|
744
|
+
},
|
|
695
745
|
"& > svg": {
|
|
696
746
|
color: theme.vars.palette.text.secondary
|
|
697
747
|
}
|
|
@@ -892,6 +942,28 @@ const dataGridStyles = {
|
|
|
892
942
|
}
|
|
893
943
|
}
|
|
894
944
|
}),
|
|
945
|
+
/**
|
|
946
|
+
* Placeholder editable
|
|
947
|
+
*/
|
|
948
|
+
editablePlaceholder: ({ theme }) => ({
|
|
949
|
+
display: "flex",
|
|
950
|
+
alignItems: "center",
|
|
951
|
+
gap: theme.spacing(1)
|
|
952
|
+
}),
|
|
953
|
+
/**
|
|
954
|
+
* EditLabel
|
|
955
|
+
*/
|
|
956
|
+
editLabel: ({ theme, ownerState }) => ({
|
|
957
|
+
width: "auto",
|
|
958
|
+
opacity: 1,
|
|
959
|
+
transition: "opacity 0.3s ease",
|
|
960
|
+
...getTypographyStyles(
|
|
961
|
+
theme.generalSettings.isMobile,
|
|
962
|
+
ownerState?.size || "medium",
|
|
963
|
+
"body"
|
|
964
|
+
)
|
|
965
|
+
}),
|
|
966
|
+
iconButtonEdit: () => ({}),
|
|
895
967
|
/**
|
|
896
968
|
* Header de la card personalizada (avatar + nombre + email)
|
|
897
969
|
*/
|
|
@@ -37,7 +37,8 @@ const DICTIONARY = {
|
|
|
37
37
|
VIEW_MODE_TABLE: `${DATAGRID_ID_DICTIONARY}.view_mode_table`,
|
|
38
38
|
VIEW_MODE_CARDS: `${DATAGRID_ID_DICTIONARY}.view_mode_cards`,
|
|
39
39
|
TOOLTIP_VIEW_MODE: `${DATAGRID_ID_DICTIONARY}.tooltip_view_mode`,
|
|
40
|
-
DETAILS: `${DATAGRID_ID_DICTIONARY}.details
|
|
40
|
+
DETAILS: `${DATAGRID_ID_DICTIONARY}.details`,
|
|
41
|
+
EDIT_PLACEHOLDER: `${DATAGRID_ID_DICTIONARY}.edit_placeholder`
|
|
41
42
|
};
|
|
42
43
|
export {
|
|
43
44
|
DICTIONARY as D,
|
package/components/DataGrid/formatters/ColumnColorFormatter/tests/ColumnColorFormatter.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/components/DataGrid/formatters/ColumnTagsFormatter/tests/ColumnTagsFormatter.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,4 +3,4 @@ import { UseModalDetailProps } from '../types';
|
|
|
3
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>({ columns, viewMode, onRowsChange, }: UseModalDetailProps<TRow>) => (row: TRow) => void;
|
|
6
|
+
export declare const useModalDetail: <TRow>({ columns, viewMode, onRowsChange, rows, }: UseModalDetailProps<TRow>) => (row: TRow) => void;
|
|
@@ -14,7 +14,8 @@ import { A as ActionCancel } from "../../CommonActions/components/ActionCancel/A
|
|
|
14
14
|
const useModalDetail = ({
|
|
15
15
|
columns,
|
|
16
16
|
viewMode,
|
|
17
|
-
onRowsChange
|
|
17
|
+
onRowsChange,
|
|
18
|
+
rows
|
|
18
19
|
}) => {
|
|
19
20
|
const { getConfigColumns, size } = useDataGrid();
|
|
20
21
|
const { openModal, closeModal } = useModal();
|
|
@@ -24,6 +25,7 @@ const useModalDetail = ({
|
|
|
24
25
|
const handleOpenDetail = useCallback(
|
|
25
26
|
(row) => {
|
|
26
27
|
const viewColumnsConfig = getConfigColumns(viewMode);
|
|
28
|
+
const rowIndex = rows.findIndex((r) => r === row);
|
|
27
29
|
openModal({
|
|
28
30
|
initialWidth: 500,
|
|
29
31
|
initialHeight: 680,
|
|
@@ -42,6 +44,8 @@ const useModalDetail = ({
|
|
|
42
44
|
CardDetails,
|
|
43
45
|
{
|
|
44
46
|
row,
|
|
47
|
+
rows,
|
|
48
|
+
rowIndex,
|
|
45
49
|
columns,
|
|
46
50
|
viewColumnsConfig,
|
|
47
51
|
onRowsChange,
|
|
@@ -56,6 +60,7 @@ const useModalDetail = ({
|
|
|
56
60
|
},
|
|
57
61
|
[
|
|
58
62
|
columns,
|
|
63
|
+
rows,
|
|
59
64
|
onRowsChange,
|
|
60
65
|
size,
|
|
61
66
|
getConfigColumns,
|
|
@@ -23,7 +23,8 @@ const pathIcons = {
|
|
|
23
23
|
viewTable: "frontend/components/data_grid/assets/icons/table.svg",
|
|
24
24
|
viewCards: "frontend/components/data_grid/assets/icons/card.svg",
|
|
25
25
|
info: "frontend/components/data_grid/assets/icons/info.svg",
|
|
26
|
-
expanded: "frontend/components/data_grid/assets/icons/expanded.svg"
|
|
26
|
+
expanded: "frontend/components/data_grid/assets/icons/expanded.svg",
|
|
27
|
+
edit: "frontend/components/EditLabel/assets/icons/pencil.svg"
|
|
27
28
|
};
|
|
28
29
|
export {
|
|
29
30
|
pathIcons as p
|
|
@@ -50,7 +50,10 @@ export declare enum TableSlots {
|
|
|
50
50
|
customCardFieldContent = "customCardFieldContent",
|
|
51
51
|
customCardIconContainer = "customCardIconContainer",
|
|
52
52
|
checkboxCellWrapper = "checkboxCellWrapper",
|
|
53
|
-
editorCellWrapper = "editorCellWrapper"
|
|
53
|
+
editorCellWrapper = "editorCellWrapper",
|
|
54
|
+
editablePlaceholder = "editablePlaceholder",
|
|
55
|
+
editLabel = "editLabel",
|
|
56
|
+
iconButtonEdit = "iconButtonEdit"
|
|
54
57
|
}
|
|
55
58
|
export declare enum TextEditorSlots {
|
|
56
59
|
inputTexEditor = "inputTexEditor"
|
|
@@ -54,6 +54,9 @@ var TableSlots = /* @__PURE__ */ ((TableSlots2) => {
|
|
|
54
54
|
TableSlots2["customCardIconContainer"] = "customCardIconContainer";
|
|
55
55
|
TableSlots2["checkboxCellWrapper"] = "checkboxCellWrapper";
|
|
56
56
|
TableSlots2["editorCellWrapper"] = "editorCellWrapper";
|
|
57
|
+
TableSlots2["editablePlaceholder"] = "editablePlaceholder";
|
|
58
|
+
TableSlots2["editLabel"] = "editLabel";
|
|
59
|
+
TableSlots2["iconButtonEdit"] = "iconButtonEdit";
|
|
57
60
|
return TableSlots2;
|
|
58
61
|
})(TableSlots || {});
|
|
59
62
|
var TextEditorSlots = /* @__PURE__ */ ((TextEditorSlots2) => {
|
|
@@ -76,6 +76,9 @@ export declare const ButtonHeaderActionsStyled: import('@emotion/styled').Styled
|
|
|
76
76
|
export declare const NameColumnIconStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
77
77
|
export declare const IconColumnStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
78
78
|
export declare const NameColumnStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
79
|
+
export declare const EditablePlaceholderStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
80
|
+
export declare const EditLabelStyled: import('@emotion/styled').StyledComponent<any, {}, {}>;
|
|
81
|
+
export declare const IconButtonEditStyled: import('@emotion/styled').StyledComponent<any, {}, {}>;
|
|
79
82
|
/**
|
|
80
83
|
* ****************
|
|
81
84
|
* Slots TextEditor
|
|
@@ -6,6 +6,7 @@ import { d as dataGridStyles } from "../Datagrid.styles.js";
|
|
|
6
6
|
import { I as Icon } from "../../Icon/Icon.js";
|
|
7
7
|
import { C as Card } from "../../Card/Card.js";
|
|
8
8
|
import { T as Typography } from "../../mui_extended/Typography/Typography.js";
|
|
9
|
+
import { I as IconButton } from "../../mui_extended/IconButton/IconButton.js";
|
|
9
10
|
const DataGridRootStyled = styled("div", {
|
|
10
11
|
name: DATAGRID_PREFIX_NAME,
|
|
11
12
|
slot: DataGridSlots.datagridRoot
|
|
@@ -206,6 +207,18 @@ const NameColumnStyled = styled("div", {
|
|
|
206
207
|
name: DATAGRID_PREFIX_NAME,
|
|
207
208
|
slot: TableSlots.nameColumn
|
|
208
209
|
})(dataGridStyles.nameColumn);
|
|
210
|
+
const EditablePlaceholderStyled = styled("div", {
|
|
211
|
+
name: DATAGRID_PREFIX_NAME,
|
|
212
|
+
slot: TableSlots.editablePlaceholder
|
|
213
|
+
})(dataGridStyles.editablePlaceholder);
|
|
214
|
+
styled(Typography, {
|
|
215
|
+
name: DATAGRID_PREFIX_NAME,
|
|
216
|
+
slot: TableSlots.editLabel
|
|
217
|
+
})(dataGridStyles.editLabel);
|
|
218
|
+
const IconButtonEditStyled = styled(IconButton, {
|
|
219
|
+
name: DATAGRID_PREFIX_NAME,
|
|
220
|
+
slot: TableSlots.iconButtonEdit
|
|
221
|
+
})(dataGridStyles.iconButtonEdit);
|
|
209
222
|
const InputTextEditorStyled = styled("input", {
|
|
210
223
|
name: DATAGRID_PREFIX_NAME,
|
|
211
224
|
slot: TextEditorSlots.inputTexEditor
|
|
@@ -220,49 +233,51 @@ styled("div", {
|
|
|
220
233
|
})(dataGridStyles.columnIconFormatter);
|
|
221
234
|
export {
|
|
222
235
|
ActionsRootStyled as A,
|
|
223
|
-
|
|
236
|
+
TableContainerStyled as B,
|
|
224
237
|
CustomHeaderStyled as C,
|
|
225
238
|
DataGridRootStyled as D,
|
|
226
239
|
EditorCellWrapperStyled as E,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
240
|
+
NameColumnStyled as F,
|
|
241
|
+
IconColumnStyled as G,
|
|
242
|
+
DraggableHeaderRootStyled as H,
|
|
243
|
+
IconButtonEditStyled as I,
|
|
244
|
+
ButtonHeaderActionsStyled as J,
|
|
245
|
+
DraggableWrapperInputBaseStyled as K,
|
|
233
246
|
LabelHeaderColumnStyled as L,
|
|
234
|
-
|
|
247
|
+
IconSearchStyled as M,
|
|
235
248
|
NameColumnIconStyled as N,
|
|
236
|
-
|
|
237
|
-
|
|
249
|
+
HeaderInputBaseStyled as O,
|
|
250
|
+
MenuListStyled as P,
|
|
251
|
+
HeaderRenderClickStyled as Q,
|
|
238
252
|
RowsCountRootStyled as R,
|
|
253
|
+
InputTextEditorStyled as S,
|
|
239
254
|
TableWrapperDataGridStyled as T,
|
|
240
255
|
ValueColumnStyled as V,
|
|
241
256
|
WrapperSkeletonStyled as W,
|
|
242
257
|
ContentModalSettingStyled as a,
|
|
243
258
|
ContainerLabelValueColumnStyled as b,
|
|
244
259
|
ContentWrapperColumnStyled as c,
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
260
|
+
EditablePlaceholderStyled as d,
|
|
261
|
+
CardsContainerStyled as e,
|
|
262
|
+
CardDetailContainerStyled as f,
|
|
263
|
+
CardHeaderStyled as g,
|
|
264
|
+
CardHeaderLeftStyled as h,
|
|
265
|
+
CardHeaderRightStyled as i,
|
|
266
|
+
CardContentWrapperStyled as j,
|
|
267
|
+
CardContentStyled as k,
|
|
268
|
+
CardStyled as l,
|
|
269
|
+
CheckboxCellWrapperStyled as m,
|
|
270
|
+
ControlNavigateStyled as n,
|
|
271
|
+
ActionsConfigContainerStyled as o,
|
|
272
|
+
ContainerLeftActionsStyled as p,
|
|
273
|
+
ContainerRightActionsStyled as q,
|
|
274
|
+
RowsCountLabelStyled as r,
|
|
275
|
+
RowsCountValueStyled as s,
|
|
276
|
+
ColumnsConfigWrapperStyled as t,
|
|
277
|
+
ColumnsConfigDataGridStyled as u,
|
|
278
|
+
ColumnsConfigSelColumnsStyled as v,
|
|
279
|
+
ColumnsConfigActiosStyled as w,
|
|
280
|
+
ContainerToggleCardsStyled as x,
|
|
281
|
+
CardToggleButtonStyled as y,
|
|
282
|
+
TextToggleCardButtonStyled as z
|
|
268
283
|
};
|
|
@@ -2,7 +2,7 @@ import { CardContentProps } from '../../../types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Hook que encapsula toda la lógica de renderizado del contenido de una Card
|
|
4
4
|
*/
|
|
5
|
-
export declare function useCardContent<TRow>({ row, columns, onRowsChange, }: CardContentProps<TRow>): {
|
|
5
|
+
export declare function useCardContent<TRow>({ row, rows, rowIndex, columns, onRowsChange, }: CardContentProps<TRow>): {
|
|
6
6
|
cardContent: import("react/jsx-runtime").JSX.Element[];
|
|
7
7
|
columnsCount: number;
|
|
8
8
|
};
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { u as useDataGrid } from "../../../hooks/useDataGrid.js";
|
|
4
|
-
import { b as ContainerLabelValueColumnStyled, c as ContentWrapperColumnStyled, L as LabelHeaderColumnStyled, E as EditorCellWrapperStyled, V as ValueColumnStyled } from "../../../slots/DataGridSlot.js";
|
|
4
|
+
import { b as ContainerLabelValueColumnStyled, c as ContentWrapperColumnStyled, L as LabelHeaderColumnStyled, E as EditorCellWrapperStyled, V as ValueColumnStyled, d as EditablePlaceholderStyled, I as IconButtonEditStyled } from "../../../slots/DataGridSlot.js";
|
|
5
|
+
import { D as DICTIONARY } from "../../../dictionary.js";
|
|
6
|
+
import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
7
|
+
import { p as pathIcons } from "../../../icons.js";
|
|
8
|
+
import { u as useComponentSize } from "../../../../../hooks/useComponentSize/useComponentSize.js";
|
|
5
9
|
function useCardContent({
|
|
6
10
|
row,
|
|
11
|
+
rows,
|
|
12
|
+
rowIndex,
|
|
7
13
|
columns,
|
|
8
14
|
onRowsChange
|
|
9
15
|
}) {
|
|
10
16
|
const { getConfigColumns, size } = useDataGrid();
|
|
17
|
+
const { getLabel } = useModuleDictionary();
|
|
18
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
19
|
+
const { currentSize } = useComponentSize(size);
|
|
11
20
|
const [editingColumnKey, setEditingColumnKey] = useState(null);
|
|
12
21
|
const columnsConfig = getConfigColumns("cards");
|
|
13
22
|
const cardContent = columns.map((column, index) => {
|
|
@@ -34,8 +43,11 @@ function useCardContent({
|
|
|
34
43
|
*/
|
|
35
44
|
onRowChange: (updatedRow) => {
|
|
36
45
|
if (onRowsChange) {
|
|
37
|
-
|
|
38
|
-
|
|
46
|
+
const updatedRows = rows.map(
|
|
47
|
+
(r, i) => i === rowIndex ? updatedRow : r
|
|
48
|
+
);
|
|
49
|
+
onRowsChange(updatedRows, {
|
|
50
|
+
indexes: [rowIndex],
|
|
39
51
|
column
|
|
40
52
|
});
|
|
41
53
|
}
|
|
@@ -55,8 +67,11 @@ function useCardContent({
|
|
|
55
67
|
*/
|
|
56
68
|
onRowChange: (updatedRow) => {
|
|
57
69
|
if (onRowsChange) {
|
|
58
|
-
|
|
59
|
-
|
|
70
|
+
const updatedRows = rows.map(
|
|
71
|
+
(r, i) => i === rowIndex ? updatedRow : r
|
|
72
|
+
);
|
|
73
|
+
onRowsChange(updatedRows, {
|
|
74
|
+
indexes: [rowIndex],
|
|
60
75
|
column
|
|
61
76
|
});
|
|
62
77
|
}
|
|
@@ -64,6 +79,33 @@ function useCardContent({
|
|
|
64
79
|
});
|
|
65
80
|
return /* @__PURE__ */ jsx(ValueColumnStyled, { variant: "body", color: "text.primary", children: cellContent });
|
|
66
81
|
}
|
|
82
|
+
const rawValue = row[column.key];
|
|
83
|
+
const isEmpty = rawValue === null || rawValue === void 0 || rawValue === "";
|
|
84
|
+
const isEditable = !!column.renderEditCell;
|
|
85
|
+
if (isEditable) {
|
|
86
|
+
return /* @__PURE__ */ jsxs(EditablePlaceholderStyled, { children: [
|
|
87
|
+
/* @__PURE__ */ jsx(
|
|
88
|
+
ValueColumnStyled,
|
|
89
|
+
{
|
|
90
|
+
variant: "body",
|
|
91
|
+
color: isEmpty ? "text.secondary" : "text.primary",
|
|
92
|
+
children: isEmpty ? getLabel(DICTIONARY.EDIT_PLACEHOLDER) : rawValue
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ jsx(
|
|
96
|
+
IconButtonEditStyled,
|
|
97
|
+
{
|
|
98
|
+
src: `${host_static_assets}/${environment_assets}/${pathIcons.edit}`,
|
|
99
|
+
onClick: () => {
|
|
100
|
+
setEditingColumnKey(column.key);
|
|
101
|
+
},
|
|
102
|
+
size: currentSize,
|
|
103
|
+
role: "button",
|
|
104
|
+
"aria-label": "Editar texto"
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
] });
|
|
108
|
+
}
|
|
67
109
|
return /* @__PURE__ */ jsx(ValueColumnStyled, { variant: "body", color: "text.primary", children: row[column.key] ?? "-" });
|
|
68
110
|
})()
|
|
69
111
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, useMemo, useEffect } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { e as CardsContainerStyled } from "../../slots/DataGridSlot.js";
|
|
4
4
|
import { C as CardRow } from "./subcomponents/CardRow/index.js";
|
|
5
5
|
import { u as useProcessedColumns } from "../../hooks/useProcessedColumns.js";
|
|
6
6
|
import { c as calculateCardHeight } from "./helpers/calculateCardHeight.js";
|
|
@@ -28,7 +28,8 @@ function Cards(props) {
|
|
|
28
28
|
const handleOpenDetail = useModalDetail({
|
|
29
29
|
columns: allProcessedColumns,
|
|
30
30
|
viewMode: "cards",
|
|
31
|
-
onRowsChange
|
|
31
|
+
onRowsChange,
|
|
32
|
+
rows
|
|
32
33
|
});
|
|
33
34
|
const cardHeight = useMemo(() => {
|
|
34
35
|
return calculateCardHeight({
|
|
@@ -64,7 +65,7 @@ function Cards(props) {
|
|
|
64
65
|
if (processedColumns.length === 0) {
|
|
65
66
|
return null;
|
|
66
67
|
}
|
|
67
|
-
return /* @__PURE__ */ jsx(CardsContainerStyled, { "data-testid": "cards-container", ref: containerRef, children: /* @__PURE__ */ jsx(ContainerFlow, { variant: "grid-layout", minWidth: 280, children: rows.map((row) => {
|
|
68
|
+
return /* @__PURE__ */ jsx(CardsContainerStyled, { "data-testid": "cards-container", ref: containerRef, children: /* @__PURE__ */ jsx(ContainerFlow, { variant: "grid-layout", minWidth: 280, children: rows.map((row, rowIndex) => {
|
|
68
69
|
const rowKey = rowKeyGetter(row);
|
|
69
70
|
const isChecked = checkedRows?.has(rowKey) || false;
|
|
70
71
|
const showCheckbox = checkedRows !== void 0 && onCheckedRowsChange !== void 0;
|
|
@@ -72,6 +73,8 @@ function Cards(props) {
|
|
|
72
73
|
CardRow,
|
|
73
74
|
{
|
|
74
75
|
row,
|
|
76
|
+
rows,
|
|
77
|
+
rowIndex,
|
|
75
78
|
columns: processedColumns,
|
|
76
79
|
originalColumns: allProcessedColumns,
|
|
77
80
|
rowKeyGetter,
|
|
@@ -5,4 +5,4 @@ import { CardDetailsProps } from '../../types';
|
|
|
5
5
|
*
|
|
6
6
|
* A diferencia del componente Cards, este muestra TODAS las columnas
|
|
7
7
|
*/
|
|
8
|
-
export declare function CardDetails<TRow>({ row, columns, viewColumnsConfig, onRowsChange, size, }: CardDetailsProps<TRow>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function CardDetails<TRow>({ row, columns, viewColumnsConfig, onRowsChange, size, rows, rowIndex, }: CardDetailsProps<TRow>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useCallback } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { f as CardDetailContainerStyled, b as ContainerLabelValueColumnStyled, c as ContentWrapperColumnStyled, L as LabelHeaderColumnStyled, E as EditorCellWrapperStyled, V as ValueColumnStyled, d as EditablePlaceholderStyled, I as IconButtonEditStyled } from "../../../../slots/DataGridSlot.js";
|
|
4
|
+
import { D as DICTIONARY } from "../../../../dictionary.js";
|
|
5
|
+
import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
6
|
+
import { p as pathIcons } from "../../../../icons.js";
|
|
7
|
+
import { u as useComponentSize } from "../../../../../../hooks/useComponentSize/useComponentSize.js";
|
|
4
8
|
function CardDetails({
|
|
5
9
|
row,
|
|
6
10
|
columns,
|
|
7
11
|
viewColumnsConfig,
|
|
8
12
|
onRowsChange,
|
|
9
|
-
size = "medium"
|
|
13
|
+
size = "medium",
|
|
14
|
+
rows,
|
|
15
|
+
rowIndex
|
|
10
16
|
}) {
|
|
11
17
|
const [editingColumnKey, setEditingColumnKey] = useState(null);
|
|
12
18
|
const [refreshCounter, setRefreshCounter] = useState(0);
|
|
19
|
+
const { getLabel } = useModuleDictionary();
|
|
20
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
21
|
+
const { currentSize } = useComponentSize(size);
|
|
22
|
+
const currentRow = rows[rowIndex] || row;
|
|
13
23
|
const handleForceRefresh = useCallback(() => {
|
|
14
24
|
setRefreshCounter((prev) => prev + 1);
|
|
15
25
|
}, []);
|
|
@@ -17,10 +27,8 @@ function CardDetails({
|
|
|
17
27
|
if (column.renderCell) {
|
|
18
28
|
return {
|
|
19
29
|
...column,
|
|
20
|
-
// Agregar onAfterChange al objeto de la columna
|
|
21
|
-
|
|
22
|
-
onAfterChange: handleForceRefresh
|
|
23
|
-
}
|
|
30
|
+
// Agregar onAfterChange al objeto de la columna
|
|
31
|
+
onAfterChange: handleForceRefresh
|
|
24
32
|
};
|
|
25
33
|
}
|
|
26
34
|
return column;
|
|
@@ -30,7 +38,8 @@ function CardDetails({
|
|
|
30
38
|
(config) => config.key === modifiedColumn.key
|
|
31
39
|
);
|
|
32
40
|
const originalColumn = columns[index];
|
|
33
|
-
const
|
|
41
|
+
const hasInteractiveFormatter = !!modifiedColumn.onAfterChange;
|
|
42
|
+
const columnKey = hasInteractiveFormatter ? `${originalColumn.key}-${refreshCounter}` : `${originalColumn.key}`;
|
|
34
43
|
const shouldShowTitle = configColumn?.showTitle !== false;
|
|
35
44
|
return /* @__PURE__ */ jsx(ContainerLabelValueColumnStyled, { children: /* @__PURE__ */ jsxs(
|
|
36
45
|
ContentWrapperColumnStyled,
|
|
@@ -48,17 +57,21 @@ function CardDetails({
|
|
|
48
57
|
if (modifiedColumn.renderEditCell && editingColumnKey === modifiedColumn.key) {
|
|
49
58
|
return /* @__PURE__ */ jsx(EditorCellWrapperStyled, { ownerState: { size }, children: modifiedColumn.renderEditCell({
|
|
50
59
|
column: originalColumn,
|
|
51
|
-
row,
|
|
60
|
+
row: currentRow,
|
|
52
61
|
rowIdx: index,
|
|
53
62
|
/**
|
|
54
63
|
* onRowChange es una función que se ejecuta cuando el usuario edita una celda.
|
|
55
64
|
*/
|
|
56
65
|
onRowChange: (updatedRow) => {
|
|
57
66
|
if (onRowsChange) {
|
|
58
|
-
|
|
59
|
-
|
|
67
|
+
const updatedRows = rows.map(
|
|
68
|
+
(r, i) => i === rowIndex ? updatedRow : r
|
|
69
|
+
);
|
|
70
|
+
onRowsChange(updatedRows, {
|
|
71
|
+
indexes: [rowIndex],
|
|
60
72
|
column: originalColumn
|
|
61
73
|
});
|
|
74
|
+
handleForceRefresh();
|
|
62
75
|
}
|
|
63
76
|
},
|
|
64
77
|
onClose: () => setEditingColumnKey(null)
|
|
@@ -66,8 +79,8 @@ function CardDetails({
|
|
|
66
79
|
}
|
|
67
80
|
if (modifiedColumn.renderCell) {
|
|
68
81
|
const cellContent = modifiedColumn.renderCell({
|
|
69
|
-
column:
|
|
70
|
-
row,
|
|
82
|
+
column: modifiedColumn,
|
|
83
|
+
row: currentRow,
|
|
71
84
|
rowIdx: index,
|
|
72
85
|
isCellSelected: false,
|
|
73
86
|
tabIndex: -1,
|
|
@@ -76,16 +89,47 @@ function CardDetails({
|
|
|
76
89
|
*/
|
|
77
90
|
onRowChange: (updatedRow) => {
|
|
78
91
|
if (onRowsChange) {
|
|
79
|
-
|
|
80
|
-
|
|
92
|
+
const updatedRows = rows.map(
|
|
93
|
+
(r, i) => i === rowIndex ? updatedRow : r
|
|
94
|
+
);
|
|
95
|
+
onRowsChange(updatedRows, {
|
|
96
|
+
indexes: [rowIndex],
|
|
81
97
|
column: originalColumn
|
|
82
98
|
});
|
|
99
|
+
handleForceRefresh();
|
|
83
100
|
}
|
|
84
101
|
}
|
|
85
102
|
});
|
|
86
103
|
return /* @__PURE__ */ jsx(ValueColumnStyled, { variant: "body", color: "text.primary", children: cellContent });
|
|
87
104
|
}
|
|
88
|
-
|
|
105
|
+
const rawValue = currentRow[modifiedColumn.key];
|
|
106
|
+
const isEmpty = rawValue === null || rawValue === void 0 || rawValue === "";
|
|
107
|
+
const isEditable = !!modifiedColumn.renderEditCell;
|
|
108
|
+
if (isEditable) {
|
|
109
|
+
return /* @__PURE__ */ jsxs(EditablePlaceholderStyled, { children: [
|
|
110
|
+
/* @__PURE__ */ jsx(
|
|
111
|
+
ValueColumnStyled,
|
|
112
|
+
{
|
|
113
|
+
variant: "body",
|
|
114
|
+
color: isEmpty ? "text.secondary" : "text.primary",
|
|
115
|
+
children: isEmpty ? getLabel(DICTIONARY.EDIT_PLACEHOLDER) : rawValue
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
/* @__PURE__ */ jsx(
|
|
119
|
+
IconButtonEditStyled,
|
|
120
|
+
{
|
|
121
|
+
src: `${host_static_assets}/${environment_assets}/${pathIcons.edit}`,
|
|
122
|
+
onClick: () => {
|
|
123
|
+
setEditingColumnKey(modifiedColumn.key);
|
|
124
|
+
},
|
|
125
|
+
size: currentSize,
|
|
126
|
+
role: "button",
|
|
127
|
+
"aria-label": "Editar texto"
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
] });
|
|
131
|
+
}
|
|
132
|
+
return /* @__PURE__ */ jsx(ValueColumnStyled, { variant: "body", color: "text.primary", children: rawValue ?? "-" });
|
|
89
133
|
})()
|
|
90
134
|
]
|
|
91
135
|
}
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMemo, useCallback } from "react";
|
|
3
3
|
import { useEnvironment } from "@m4l/core";
|
|
4
4
|
import { u as useDataGrid } from "../../../../hooks/useDataGrid.js";
|
|
5
|
-
import {
|
|
5
|
+
import { g as CardHeaderStyled, h as CardHeaderLeftStyled, i as CardHeaderRightStyled } from "../../../../slots/DataGridSlot.js";
|
|
6
6
|
import { p as pathIcons } from "../../../../icons.js";
|
|
7
7
|
import { C as CheckboxCellAdapter } from "../../../CheckboxCellAdapter/index.js";
|
|
8
8
|
import { I as IconButton } from "../../../../../mui_extended/IconButton/IconButton.js";
|
|
@@ -3,9 +3,9 @@ import { CardRowProps } from '../../types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Componente que muestra una fila de tarjetas.
|
|
5
5
|
*/
|
|
6
|
-
declare function CardRowComponent<TRow, TKey extends RowKey = RowKey>({ row, columns, originalColumns, rowKeyGetter, selectedRows, onSelectedRowsChange, onRowsChange, customRender, minHeight, isChecked, checkedRows, showCheckbox, onCheckedRowsChange, onOpenDetail, }: CardRowProps<TRow, TKey>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function CardRowComponent<TRow, TKey extends RowKey = RowKey>({ row, rows, rowIndex, columns, originalColumns, rowKeyGetter, selectedRows, onSelectedRowsChange, onRowsChange, customRender, minHeight, isChecked, checkedRows, showCheckbox, onCheckedRowsChange, onOpenDetail, }: CardRowProps<TRow, TKey>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Componente que muestra CardRow
|
|
9
9
|
*/
|
|
10
10
|
export declare const CardRow: typeof CardRowComponent;
|
|
11
11
|
export {};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import React, { useMemo } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { j as CardContentWrapperStyled, k as CardContentStyled, l as CardStyled } from "../../../../slots/DataGridSlot.js";
|
|
4
4
|
import { L as LazyLoadCard } from "../LazyLoadCard/index.js";
|
|
5
5
|
import { u as useCardContent } from "../../hooks/useCardContent.js";
|
|
6
6
|
import { C as CardHeader } from "../CardHeader/index.js";
|
|
7
7
|
import { deepEqual } from "fast-equals";
|
|
8
8
|
function CardRowComponent({
|
|
9
9
|
row,
|
|
10
|
+
rows,
|
|
11
|
+
rowIndex,
|
|
10
12
|
columns,
|
|
11
13
|
originalColumns,
|
|
12
14
|
rowKeyGetter,
|
|
@@ -24,6 +26,8 @@ function CardRowComponent({
|
|
|
24
26
|
const hasCustomRender = customRender !== void 0;
|
|
25
27
|
const { cardContent } = useCardContent({
|
|
26
28
|
row,
|
|
29
|
+
rows,
|
|
30
|
+
rowIndex,
|
|
27
31
|
columns,
|
|
28
32
|
onRowsChange
|
|
29
33
|
});
|
|
@@ -78,6 +78,14 @@ export interface CardRowProps<TRow, TKey extends RowKey = RowKey> {
|
|
|
78
78
|
* Fila que se mostrará en la tarjeta
|
|
79
79
|
*/
|
|
80
80
|
row: TRow;
|
|
81
|
+
/**
|
|
82
|
+
* Array completo de todas las filas (necesario para reconstruir el array al editar)
|
|
83
|
+
*/
|
|
84
|
+
rows: readonly TRow[];
|
|
85
|
+
/**
|
|
86
|
+
* Índice de la fila actual en el array de filas
|
|
87
|
+
*/
|
|
88
|
+
rowIndex: number;
|
|
81
89
|
/**
|
|
82
90
|
* Columnas que se mostrarán en la tarjeta (procesadas, filtradas por visibilidad)
|
|
83
91
|
*/
|
|
@@ -140,6 +148,14 @@ export interface CardDetailsProps<TRow> {
|
|
|
140
148
|
viewColumnsConfig: IViewConfig<any, any>[];
|
|
141
149
|
onRowsChange?: Maybe<(rows: TRow[], data: RowsChangeData<TRow, any>) => void>;
|
|
142
150
|
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
151
|
+
/**
|
|
152
|
+
* Array completo de todas las filas (necesario para reconstruir el array al editar)
|
|
153
|
+
*/
|
|
154
|
+
rows: readonly TRow[];
|
|
155
|
+
/**
|
|
156
|
+
* Índice de la fila actual en el array de filas
|
|
157
|
+
*/
|
|
158
|
+
rowIndex: number;
|
|
143
159
|
}
|
|
144
160
|
/**
|
|
145
161
|
* Props para el componente CardHeader
|
|
@@ -3,7 +3,7 @@ import { forwardRef, useContext } from "react";
|
|
|
3
3
|
import { SelectCellFormatter } from "react-data-grid";
|
|
4
4
|
import { C as CheckboxFormatter } from "../Table/subcomponents/CheckboxFormatter.js";
|
|
5
5
|
import { a as DataGridContext } from "../../contexts/DataGridContext/index.js";
|
|
6
|
-
import {
|
|
6
|
+
import { m as CheckboxCellWrapperStyled } from "../../slots/DataGridSlot.js";
|
|
7
7
|
const CheckboxCellAdapter = forwardRef(function CheckboxCellAdapter2(props, ref) {
|
|
8
8
|
const {
|
|
9
9
|
value,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useIsMobile } from "@m4l/graphics";
|
|
3
|
-
import {
|
|
3
|
+
import { n as ControlNavigateStyled } from "../../slots/DataGridSlot.js";
|
|
4
4
|
import { R as RowsCount } from "../HeaderActions/subcomponents/RowsCount/index.js";
|
|
5
5
|
import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
|
|
6
6
|
import { P as Pager } from "../../../Pager/Pager.js";
|
|
@@ -6,7 +6,7 @@ import { V as ViewMode } from "./subcomponents/ViewMode/index.js";
|
|
|
6
6
|
import { u as useDataGrid } from "../../hooks/useDataGrid.js";
|
|
7
7
|
import { useIsMobile } from "@m4l/graphics";
|
|
8
8
|
import { M as MobileMenuActions } from "./subcomponents/MobileMenuActions/index.js";
|
|
9
|
-
import { A as ActionsRootStyled,
|
|
9
|
+
import { A as ActionsRootStyled, o as ActionsConfigContainerStyled, p as ContainerLeftActionsStyled, q as ContainerRightActionsStyled } from "../../slots/DataGridSlot.js";
|
|
10
10
|
import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
|
|
11
11
|
function HeaderActions(props) {
|
|
12
12
|
const {
|
|
@@ -29,7 +29,7 @@ function HeaderActions(props) {
|
|
|
29
29
|
] }) : /* @__PURE__ */ jsxs(ActionsConfigContainerStyled, { ownerState: { withPager }, children: [
|
|
30
30
|
/* @__PURE__ */ jsxs(ContainerLeftActionsStyled, { children: [
|
|
31
31
|
leftActions,
|
|
32
|
-
typeof rowHeights !== "number" && /* @__PURE__ */ jsx(Density, {}),
|
|
32
|
+
typeof rowHeights !== "number" && viewMode !== "cards" && /* @__PURE__ */ jsx(Density, {}),
|
|
33
33
|
withLocalFilters && /* @__PURE__ */ jsx(Filter, {}),
|
|
34
34
|
withSettings && !(viewMode === "cards" && cardsViewConfig?.customRender) && /* @__PURE__ */ jsx(Settings, { ...settingsProps, columns }),
|
|
35
35
|
cardsViewConfig !== void 0 && /* @__PURE__ */ jsx(ViewMode, {})
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
|
|
3
3
|
import { Skeleton } from "@mui/material";
|
|
4
4
|
import { u as useDataGrid } from "../../../../hooks/useDataGrid.js";
|
|
5
|
-
import { R as RowsCountRootStyled,
|
|
5
|
+
import { R as RowsCountRootStyled, r as RowsCountLabelStyled, s as RowsCountValueStyled } from "../../../../slots/DataGridSlot.js";
|
|
6
6
|
function RowsCount() {
|
|
7
7
|
const { rowsCount, size } = useDataGrid();
|
|
8
8
|
const { getLabel } = useModuleDictionary();
|
|
@@ -4,7 +4,7 @@ import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
|
4
4
|
import DataGrid from "react-data-grid";
|
|
5
5
|
import { I as IconButton } from "../../../../../../../mui_extended/IconButton/IconButton.js";
|
|
6
6
|
import { p as pathIcons } from "../../../../../../icons.js";
|
|
7
|
-
import {
|
|
7
|
+
import { t as ColumnsConfigWrapperStyled, u as ColumnsConfigDataGridStyled, v as ColumnsConfigSelColumnsStyled, T as TableWrapperDataGridStyled, w as ColumnsConfigActiosStyled } from "../../../../../../slots/DataGridSlot.js";
|
|
8
8
|
import { D as DICTIONARY } from "../../../../../../dictionary.js";
|
|
9
9
|
import { C as ColumnInteractiveCheckFormatter } from "../../../../../../formatters/ColumnInteractiveCheckFormatter/formatter.js";
|
|
10
10
|
function getRowsFromColumnsConfig(columnsConfig, columns) {
|
|
@@ -4,7 +4,7 @@ import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
|
4
4
|
import DataGrid from "react-data-grid";
|
|
5
5
|
import { I as IconButton } from "../../../../../../../mui_extended/IconButton/IconButton.js";
|
|
6
6
|
import { p as pathIcons } from "../../../../../../icons.js";
|
|
7
|
-
import {
|
|
7
|
+
import { t as ColumnsConfigWrapperStyled, u as ColumnsConfigDataGridStyled, v as ColumnsConfigSelColumnsStyled, T as TableWrapperDataGridStyled, w as ColumnsConfigActiosStyled } from "../../../../../../slots/DataGridSlot.js";
|
|
8
8
|
import { D as DICTIONARY } from "../../../../../../dictionary.js";
|
|
9
9
|
import { C as ColumnInteractiveCheckFormatter } from "../../../../../../formatters/ColumnInteractiveCheckFormatter/formatter.js";
|
|
10
10
|
function getRowsFromColumnsConfigCards(columnsConfigCards, columns) {
|
|
@@ -6,7 +6,7 @@ import { I as IconButton } from "../../../../../mui_extended/IconButton/IconButt
|
|
|
6
6
|
import { P as Popover } from "../../../../../mui_extended/Popover/Popover.js";
|
|
7
7
|
import { p as pathIcons } from "../../../../icons.js";
|
|
8
8
|
import { D as DICTIONARY } from "../../../../dictionary.js";
|
|
9
|
-
import {
|
|
9
|
+
import { x as ContainerToggleCardsStyled, y as CardToggleButtonStyled, z as TextToggleCardButtonStyled } from "../../../../slots/DataGridSlot.js";
|
|
10
10
|
import { I as Icon } from "../../../../../Icon/Icon.js";
|
|
11
11
|
function ViewMode() {
|
|
12
12
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
@@ -8,7 +8,7 @@ import { a as filterHeight } from "./subcomponents/SelectColumn.js";
|
|
|
8
8
|
import { u as useSortColumnsRows } from "./hooks/useSortColumnsRows.js";
|
|
9
9
|
import { u as useFilters } from "../../hooks/useFilters.js";
|
|
10
10
|
import { u as useDataGrid } from "../../hooks/useDataGrid.js";
|
|
11
|
-
import {
|
|
11
|
+
import { B as TableContainerStyled, T as TableWrapperDataGridStyled } from "../../slots/DataGridSlot.js";
|
|
12
12
|
import { u as useHeaderMenuActions } from "./hooks/useHeaderMenuActions.js";
|
|
13
13
|
import { H as HeaderRenderClick } from "./subcomponents/HeaderRenderClick/HeaderRenderClick.js";
|
|
14
14
|
function Table(props) {
|
|
@@ -12,6 +12,7 @@ const CheckboxFormatter = forwardRef(function CheckboxFormatter2({ onChange, che
|
|
|
12
12
|
checked,
|
|
13
13
|
size: "small",
|
|
14
14
|
icon: /* @__PURE__ */ jsx(CheckboxIcon, {}),
|
|
15
|
+
disableRipple: true,
|
|
15
16
|
checkedIcon: /* @__PURE__ */ jsx(CheckboxCheckedIcon, {}),
|
|
16
17
|
indeterminateIcon: /* @__PURE__ */ jsx(CheckboxIndeterminateIcon, {}),
|
|
17
18
|
onChange: handleChange,
|
|
@@ -1,22 +1,47 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEnvironment } from "@m4l/core";
|
|
3
|
+
import "@mui/material";
|
|
4
|
+
import { I as Icon } from "../../../../Icon/Icon.js";
|
|
3
5
|
function CheckboxIcon(props) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
7
|
+
const uncheckedIconUrl = `${host_static_assets}/${environment_assets}/frontend/components/check_box/assets/icons/unchecked.svg`;
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
Icon,
|
|
10
|
+
{
|
|
11
|
+
src: uncheckedIconUrl,
|
|
12
|
+
size: "small",
|
|
13
|
+
color: "text.primary",
|
|
14
|
+
className: "checkbox-unChecked",
|
|
15
|
+
...props
|
|
16
|
+
}
|
|
17
|
+
);
|
|
8
18
|
}
|
|
9
19
|
function CheckboxCheckedIcon(props) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
21
|
+
const checkedIconUrl = `${host_static_assets}/${environment_assets}/frontend/components/check_box/assets/icons/checked.svg`;
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
Icon,
|
|
24
|
+
{
|
|
25
|
+
src: checkedIconUrl,
|
|
26
|
+
size: "small",
|
|
27
|
+
color: "primary.enabled",
|
|
28
|
+
className: "checkbox-checked",
|
|
29
|
+
...props
|
|
30
|
+
}
|
|
31
|
+
);
|
|
17
32
|
}
|
|
18
33
|
function CheckboxIndeterminateIcon(props) {
|
|
19
|
-
|
|
34
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
35
|
+
const indeterminateIconUrl = `${host_static_assets}/${environment_assets}/frontend/components/check_box/assets/icons/indeterminate.svg`;
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
Icon,
|
|
38
|
+
{
|
|
39
|
+
src: indeterminateIconUrl,
|
|
40
|
+
size: "small",
|
|
41
|
+
color: "primary.enabled",
|
|
42
|
+
...props
|
|
43
|
+
}
|
|
44
|
+
);
|
|
20
45
|
}
|
|
21
46
|
export {
|
|
22
47
|
CheckboxIndeterminateIcon as C,
|
|
@@ -5,7 +5,7 @@ import { useDrag, useDrop } from "react-dnd";
|
|
|
5
5
|
import { renderHeaderCell } from "react-data-grid";
|
|
6
6
|
import { u as useFocusRef } from "../hooks/useFocusRef.js";
|
|
7
7
|
import { u as useFilters } from "../../../hooks/useFilters.js";
|
|
8
|
-
import { N as NameColumnIconStyled,
|
|
8
|
+
import { N as NameColumnIconStyled, F as NameColumnStyled, G as IconColumnStyled, H as DraggableHeaderRootStyled, J as ButtonHeaderActionsStyled, K as DraggableWrapperInputBaseStyled, M as IconSearchStyled, O as HeaderInputBaseStyled } from "../../../slots/DataGridSlot.js";
|
|
9
9
|
import { p as pathIcons } from "../../../icons.js";
|
|
10
10
|
import { u as useDataGrid } from "../../../hooks/useDataGrid.js";
|
|
11
11
|
import { I as Icon } from "../../../../Icon/Icon.js";
|
package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useMemo, useEffect, useCallback } from "react";
|
|
3
3
|
import { useModuleDictionary } from "@m4l/core";
|
|
4
4
|
import { M as MenuItem } from "../../../../../mui_extended/MenuItem/MenuItem.js";
|
|
5
|
-
import {
|
|
5
|
+
import { P as MenuListStyled, Q as HeaderRenderClickStyled } from "../../../../slots/DataGridSlot.js";
|
|
6
6
|
import { M as MenuDivider } from "../../../../../mui_extended/MenuDivider/MenuDivider.js";
|
|
7
7
|
import { P as Popover } from "../../../../../mui_extended/Popover/Popover.js";
|
|
8
8
|
import { D as DICTIONARY } from "../../../../dictionary.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { S as InputTextEditorStyled } from "../../../slots/DataGridSlot.js";
|
|
3
3
|
function autoFocusAndSelect(input) {
|
|
4
4
|
input?.focus();
|
|
5
5
|
input?.select();
|
|
@@ -193,6 +193,10 @@ export interface UseModalDetailProps<TRow> {
|
|
|
193
193
|
columns: readonly Column<TRow, any>[];
|
|
194
194
|
viewMode: ViewMode;
|
|
195
195
|
onRowsChange?: Maybe<(rows: TRow[], data: RowsChangeData<TRow, any>) => void>;
|
|
196
|
+
/**
|
|
197
|
+
* Array completo de todas las filas (necesario para reconstruir el array al editar en el modal)
|
|
198
|
+
*/
|
|
199
|
+
rows: readonly TRow[];
|
|
196
200
|
}
|
|
197
201
|
/**
|
|
198
202
|
* Configuración de una columna específica en vista "cards"
|
|
@@ -252,6 +256,14 @@ export interface CardContentProps<TRow> {
|
|
|
252
256
|
columns: readonly Column<TRow, any>[];
|
|
253
257
|
originalColumns: readonly Column<TRow, any>[];
|
|
254
258
|
onRowsChange?: Maybe<(rows: TRow[], data: RowsChangeData<TRow, any>) => void>;
|
|
259
|
+
/**
|
|
260
|
+
* Array completo de todas las filas (necesario para reconstruir el array al editar)
|
|
261
|
+
*/
|
|
262
|
+
rows: readonly TRow[];
|
|
263
|
+
/**
|
|
264
|
+
* Índice de la fila actual en el array de filas
|
|
265
|
+
*/
|
|
266
|
+
rowIndex: number;
|
|
255
267
|
}
|
|
256
268
|
/**
|
|
257
269
|
* Configuración de densidad para el DataGrid.
|
package/package.json
CHANGED