@m4l/components 9.3.21 → 9.3.22
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/components/DataGrid/DataGrid.js +9 -4
- package/components/DataGrid/Datagrid.styles.js +270 -0
- package/components/DataGrid/constants.js +2 -2
- package/components/DataGrid/contexts/DataGridContext/index.js +317 -112
- package/components/DataGrid/contexts/DataGridContext/types.d.ts +63 -4
- package/components/DataGrid/dictionary.d.ts +5 -0
- package/components/DataGrid/dictionary.js +6 -1
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/formatter.js +2 -2
- package/components/DataGrid/hooks/useModalCardDetail.d.ts +6 -0
- package/components/DataGrid/hooks/useModalCardDetail.js +74 -0
- package/components/DataGrid/hooks/useProcessedColumns.d.ts +50 -0
- package/components/DataGrid/hooks/useProcessedColumns.js +44 -0
- package/components/DataGrid/icons.d.ts +7 -0
- package/components/DataGrid/icons.js +5 -1
- package/components/DataGrid/index.d.ts +1 -1
- package/components/DataGrid/slots/DataGridEnum.d.ts +22 -1
- package/components/DataGrid/slots/DataGridEnum.js +21 -0
- package/components/DataGrid/slots/DataGridSlot.d.ts +24 -0
- package/components/DataGrid/slots/DataGridSlot.js +123 -21
- package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.d.ts +9 -0
- package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.js +91 -0
- package/components/DataGrid/subcomponents/Cards/index.d.ts +5 -0
- package/components/DataGrid/subcomponents/Cards/index.js +40 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.d.ts +8 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.js +79 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.d.ts +7 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.js +98 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.d.ts +6 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.js +71 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/IntersectCard/index.d.ts +20 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/IntersectCard/index.js +46 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/LazyLoadCard/index.d.ts +17 -0
- package/components/DataGrid/subcomponents/Cards/subcomponents/LazyLoadCard/index.js +34 -0
- package/components/DataGrid/subcomponents/Cards/types.d.ts +118 -0
- package/components/DataGrid/subcomponents/CheckboxCellAdapter/index.d.ts +7 -0
- package/components/DataGrid/subcomponents/CheckboxCellAdapter/index.js +43 -0
- package/components/DataGrid/subcomponents/CheckboxCellAdapter/types.d.ts +7 -0
- package/components/DataGrid/subcomponents/ControlNavigate/ControlNavigate.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/index.js +5 -3
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/RowsCount/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/index.js +11 -2
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfigCards/index.d.ts +2 -0
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfigCards/index.js +304 -0
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfigCards/types.d.ts +31 -0
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/ViewMode/index.d.ts +4 -0
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/ViewMode/index.js +125 -0
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettings/index.js +2 -2
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettingsCards/index.d.ts +7 -0
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettingsCards/index.js +74 -0
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettingsCards/types.d.ts +4 -0
- package/components/DataGrid/subcomponents/RenderContent/index.d.ts +5 -0
- package/components/DataGrid/subcomponents/RenderContent/index.js +11 -0
- package/components/DataGrid/subcomponents/Table/hooks/useHeaderMenuActions.js +2 -2
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +1 -1
- package/components/DataGrid/subcomponents/Table/index.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/ActionsColumn.js +1 -1
- 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/tests/components/CardDetails.test.d.ts +1 -0
- package/components/DataGrid/tests/components/CardHeader.test.d.ts +1 -0
- package/components/DataGrid/tests/components/CardRow.test.d.ts +1 -0
- package/components/DataGrid/tests/components/Cards.test.d.ts +1 -0
- package/components/DataGrid/tests/components/CheckboxCellAdapter.test.d.ts +1 -0
- package/components/DataGrid/tests/components/ColumnsConfigCards.test.d.ts +1 -0
- package/components/DataGrid/tests/components/IntersectCard.test.d.ts +1 -0
- package/components/DataGrid/tests/components/ViewMode.test.d.ts +1 -0
- package/components/DataGrid/tests/helpers/useCardsViewConfig.d.ts +24 -0
- package/components/DataGrid/tests/helpers/useCustomCardExample.d.ts +7 -0
- package/components/DataGrid/tests/hooks/useCardContent.test.d.ts +1 -0
- package/components/DataGrid/tests/hooks/useModalDetail.test.d.ts +1 -0
- package/components/DataGrid/tests/hooks/useModalSettingsCards.test.d.ts +1 -0
- package/components/DataGrid/tests/hooks/useProcessedColumns.test.d.ts +1 -0
- package/components/DataGrid/types.d.ts +87 -5
- package/components/MFIsolationAppStorybook/MFIsolationAppStorybook.d.ts +5 -0
- package/components/MFIsolationAppStorybook/constants.d.ts +1 -0
- package/components/MFIsolationAppStorybook/icons.d.ts +3 -0
- package/components/MFIsolationAppStorybook/index.d.ts +1 -0
- package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/AppBarSettings.d.ts +4 -0
- package/components/MFIsolationAppStorybook/subcomponents/AppBarSettings/index.d.ts +1 -0
- package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/MFAuthAppStorybook.d.ts +5 -0
- package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/index.d.ts +1 -0
- package/components/MFIsolationAppStorybook/subcomponents/MFAuthAppStorybook/types.d.ts +4 -0
- package/components/MFIsolationAppStorybook/types.d.ts +31 -0
- package/components/MenuActions/MenuActions.js +105 -55
- package/components/areas/contexts/AreasContext/store.js +2 -2
- package/components/hook-form/RHFormContext/index.d.ts +1 -1
- package/hooks/useDataGridPersistence/helpers.d.ts +2 -2
- package/hooks/useDataGridPersistence/useDataGridPersistence.d.ts +2 -2
- package/hooks/useDataGridPersistence/useDataGridPersistence.js +5 -0
- package/index.js +8 -8
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { O as InputTextEditorStyled } from "../../../slots/DataGridSlot.js";
|
|
3
3
|
function autoFocusAndSelect(input) {
|
|
4
4
|
input?.focus();
|
|
5
5
|
input?.select();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CardsViewConfig } from '../../types';
|
|
2
|
+
interface UseCardsViewConfigProps {
|
|
3
|
+
/**
|
|
4
|
+
* Si es true, retorna cardsViewConfig con columnsConfig básica
|
|
5
|
+
*/
|
|
6
|
+
withBasicConfig?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Si es true, retorna cardsViewConfig con customRender
|
|
9
|
+
*/
|
|
10
|
+
withCustomRender?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Si es true, retorna cardsViewConfig solo con enabled=true (para demostrar error)
|
|
13
|
+
*/
|
|
14
|
+
withEnabledOnly?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Si es true, retorna cardsViewConfig con columnKey inválido (para demostrar error)
|
|
17
|
+
*/
|
|
18
|
+
withInvalidColumnKey?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Hook helper que genera configuraciones de cardsViewConfig para testing
|
|
22
|
+
*/
|
|
23
|
+
export declare const useCardsViewConfigHelper: <TRow = any>(props?: UseCardsViewConfigProps) => CardsViewConfig<TRow> | undefined;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,7 +5,7 @@ import { MenuAction } from '../MenuActions/types';
|
|
|
5
5
|
import { ActionsSlots, ColumnIconFormatterSlots, ColumnsConfigSlots, ControlNavigateSlots, DataGridSlots, RowsCountSlots, TableSlots, TextEditorSlots } from './slots/DataGridEnum';
|
|
6
6
|
import { OverridesStyleRules } from '@mui/material/styles/overrides';
|
|
7
7
|
import { DATAGRID_PREFIX_NAME } from './constants';
|
|
8
|
-
import {
|
|
8
|
+
import { IGridConfigExtended, ViewMode } from './contexts/DataGridContext/types';
|
|
9
9
|
import { Sizes } from '@m4l/styles';
|
|
10
10
|
import { PagerProps } from '../Pager';
|
|
11
11
|
import { SettingsProps } from './subcomponents/HeaderActions/subcomponents/Settings/types';
|
|
@@ -61,10 +61,10 @@ export interface ColumnConfig {
|
|
|
61
61
|
position?: number;
|
|
62
62
|
frozen?: Maybe<boolean>;
|
|
63
63
|
}
|
|
64
|
-
type KeyUserColumns = keyof
|
|
64
|
+
type KeyUserColumns = keyof IGridConfigExtended;
|
|
65
65
|
export interface ChangeUserColumn<T extends KeyUserColumns = KeyUserColumns> {
|
|
66
66
|
reason: T;
|
|
67
|
-
userConfig:
|
|
67
|
+
userConfig: IGridConfigExtended[T];
|
|
68
68
|
}
|
|
69
69
|
export type OnChangeUserColumns = (props: ChangeUserColumn) => void;
|
|
70
70
|
export type SortApplied = {
|
|
@@ -139,7 +139,7 @@ export interface GridProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> exte
|
|
|
139
139
|
/**
|
|
140
140
|
* Propiedad opcional que recibe la configuración de las columnas
|
|
141
141
|
*/
|
|
142
|
-
defaultUserColumns?:
|
|
142
|
+
defaultUserColumns?: IGridConfigExtended;
|
|
143
143
|
/**
|
|
144
144
|
* Propiedad que recibe la función que se ejecuta cuando se cambian
|
|
145
145
|
* las configuraciones de las columnas.
|
|
@@ -150,6 +150,15 @@ export interface GridProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> exte
|
|
|
150
150
|
* @default 'medium'
|
|
151
151
|
*/
|
|
152
152
|
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
153
|
+
/**
|
|
154
|
+
* Modo por defecto de visualización
|
|
155
|
+
*/
|
|
156
|
+
defaultViewMode?: ViewMode;
|
|
157
|
+
/**
|
|
158
|
+
* Configuración de la vista de "cards"
|
|
159
|
+
* Incluye habilitación, configuración de columnas y renderizado personalizado
|
|
160
|
+
*/
|
|
161
|
+
cardsViewConfig?: CardsViewConfig<TRow>;
|
|
153
162
|
}
|
|
154
163
|
export declare const DATAGRID_TEST_ID = "m4ldatagrid";
|
|
155
164
|
export declare const PREFIX_TEST_ATTRIBUTE = "data-testid";
|
|
@@ -170,6 +179,79 @@ export interface ActionsProps {
|
|
|
170
179
|
leftActions?: React.ReactNode;
|
|
171
180
|
rightActions?: React.ReactNode;
|
|
172
181
|
}
|
|
173
|
-
|
|
182
|
+
/**
|
|
183
|
+
* Props para el hook useModalDetail
|
|
184
|
+
*/
|
|
185
|
+
export interface UseModalDetailProps<TRow> {
|
|
186
|
+
row: TRow;
|
|
187
|
+
columns: readonly Column<TRow, any>[];
|
|
188
|
+
viewMode: ViewMode;
|
|
189
|
+
onRowsChange?: Maybe<(rows: TRow[], data: RowsChangeData<TRow, any>) => void>;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Configuración de una columna específica en vista "cards"
|
|
193
|
+
*/
|
|
194
|
+
export interface CardColumnConfig {
|
|
195
|
+
/**
|
|
196
|
+
* Key de la columna (debe coincidir con la key de la columna)
|
|
197
|
+
*/
|
|
198
|
+
columnKey: string;
|
|
199
|
+
/**
|
|
200
|
+
* Si se debe mostrar el título/label de esta columna en la card (Solo si no existe una config previa)
|
|
201
|
+
*/
|
|
202
|
+
showTitle: boolean;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Cards con columnsConfig
|
|
206
|
+
*/
|
|
207
|
+
export interface CardsViewConfigWithColumns {
|
|
208
|
+
columnsConfig: CardColumnConfig[];
|
|
209
|
+
customRender?: never;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Cards con customRender
|
|
213
|
+
*/
|
|
214
|
+
export interface CardsViewConfigWithCustomRender<TRow> {
|
|
215
|
+
columnsConfig?: never;
|
|
216
|
+
customRender: {
|
|
217
|
+
renderContent: (row: TRow) => React.ReactNode;
|
|
218
|
+
minHeight: number;
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Configuración para la vista de "cards"
|
|
223
|
+
*
|
|
224
|
+
* IMPORTANTE:
|
|
225
|
+
* Es OBLIGATORIO configurar al menos 1 columna cuando customRender=undefined
|
|
226
|
+
* Se ignora completamente si customRender está definido
|
|
227
|
+
* @throws Error si customRender=undefined y array está vacío
|
|
228
|
+
*/
|
|
229
|
+
export type CardsViewConfig<TRow> = CardsViewConfigWithColumns | CardsViewConfigWithCustomRender<TRow>;
|
|
230
|
+
/**
|
|
231
|
+
* Opciones para el procesamiento de columnas
|
|
232
|
+
*/
|
|
233
|
+
export interface ProcessedColumnsOptions {
|
|
234
|
+
/**
|
|
235
|
+
* Si es true, aplica el filtro de visibilidad configurado por el usuario.
|
|
236
|
+
* Si es false, muestra TODAS las columnas.
|
|
237
|
+
* @default true
|
|
238
|
+
*/
|
|
239
|
+
applyVisibilityFilter?: boolean;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Props para el hook useCardContent
|
|
243
|
+
*/
|
|
244
|
+
export interface CardContentProps<TRow> {
|
|
245
|
+
row: TRow;
|
|
246
|
+
columns: readonly Column<TRow, any>[];
|
|
247
|
+
originalColumns: readonly Column<TRow, any>[];
|
|
248
|
+
onRowsChange?: Maybe<(rows: TRow[], data: RowsChangeData<TRow, any>) => void>;
|
|
249
|
+
}
|
|
250
|
+
export type DataGridOwnerState<TRow, TSummaryRow, TKey extends RowKey = RowKey> = Pick<DataGridProps<TRow, TSummaryRow, TKey>, 'visibleCustomHeader'> & {
|
|
251
|
+
viewMode?: ViewMode;
|
|
252
|
+
isActive?: boolean;
|
|
253
|
+
hasActions?: boolean;
|
|
254
|
+
hasCheckedRows?: boolean;
|
|
255
|
+
};
|
|
174
256
|
export type DataGridSlotsType = DataGridSlots | TextEditorSlots | ActionsSlots | RowsCountSlots | ColumnsConfigSlots | TableSlots | ControlNavigateSlots | ColumnIconFormatterSlots;
|
|
175
257
|
export type DataGridStyles = OverridesStyleRules<DataGridSlotsType, typeof DATAGRID_PREFIX_NAME, Theme>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TOAST_CONTAINER_ID = "toast-host";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MFIsolationAppStorybook } from './MFIsolationAppStorybook';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AppBarSettings } from './AppBarSettings';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MFAuthAppStorybook } from './MFAuthAppStorybook';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ModuleDictionary } from '@m4l/core';
|
|
2
|
+
import { BaseModuleProps } from '../BaseModule';
|
|
3
|
+
import { DeviceType } from '@m4l/graphics';
|
|
4
|
+
export type MFIsolationAppStorybookProps = BaseModuleProps & {
|
|
5
|
+
host_api_local: string;
|
|
6
|
+
host_api_icons?: string;
|
|
7
|
+
database?: string;
|
|
8
|
+
host_api_remote: string;
|
|
9
|
+
host_static_assets: string;
|
|
10
|
+
environment_assets: string;
|
|
11
|
+
onLoad: () => void;
|
|
12
|
+
activeAreasNetwork?: boolean;
|
|
13
|
+
activeCookiesFromNetwork?: boolean;
|
|
14
|
+
appBarSettings?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Diccionario de componentes, se puede proporcionar ya el diccionario cargado, para evitar que se llame al endpoint nuevamente.
|
|
17
|
+
*/
|
|
18
|
+
moduleDictionaryLoaded?: ModuleDictionary;
|
|
19
|
+
/**
|
|
20
|
+
* Tipo de dispositivo forzado, si no se proporciona se determina automáticamente. Normalmente se usa esta propieadad para pruebas en storybook.
|
|
21
|
+
*/
|
|
22
|
+
forcedDeviceType?: DeviceType;
|
|
23
|
+
/**
|
|
24
|
+
* Id del store de las áreas
|
|
25
|
+
*/
|
|
26
|
+
areasStoreId?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Determina si se debe usar devtools para el store de las áreas
|
|
29
|
+
*/
|
|
30
|
+
areasStoreDevtoolsEnabled?: boolean;
|
|
31
|
+
};
|
|
@@ -34,6 +34,7 @@ function MenuActions(props) {
|
|
|
34
34
|
className,
|
|
35
35
|
onOpen,
|
|
36
36
|
slots = {},
|
|
37
|
+
variant = "text",
|
|
37
38
|
...other
|
|
38
39
|
} = props;
|
|
39
40
|
const { currentSize } = useComponentSize(size);
|
|
@@ -41,11 +42,14 @@ function MenuActions(props) {
|
|
|
41
42
|
const { getLabel } = useModuleDictionary();
|
|
42
43
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
43
44
|
const open = Boolean(externalOpen ?? anchorEl);
|
|
44
|
-
const ownerState = useMemo(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
const ownerState = useMemo(
|
|
46
|
+
() => ({
|
|
47
|
+
iconSize: currentSize,
|
|
48
|
+
selected: open,
|
|
49
|
+
paletteColor: color
|
|
50
|
+
}),
|
|
51
|
+
[currentSize, open, color]
|
|
52
|
+
);
|
|
49
53
|
useEffect(() => {
|
|
50
54
|
if (onOpen) {
|
|
51
55
|
onOpen(open);
|
|
@@ -60,21 +64,27 @@ function MenuActions(props) {
|
|
|
60
64
|
const finalIcon = useMemo(() => {
|
|
61
65
|
return icon || urlIcon || `${host_static_assets}/${environment_assets}/${ICON_PATH}/${ICONS.MENU}`;
|
|
62
66
|
}, [urlIcon, icon, host_static_assets, environment_assets]);
|
|
63
|
-
const handleClick = useCallback(
|
|
64
|
-
e
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
onOpen
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
67
|
+
const handleClick = useCallback(
|
|
68
|
+
(e, menuAction) => {
|
|
69
|
+
e.stopPropagation();
|
|
70
|
+
setAnchorEl(null);
|
|
71
|
+
if (onOpen) {
|
|
72
|
+
onOpen(false);
|
|
73
|
+
}
|
|
74
|
+
menuAction.onClick && menuAction.onClick(e);
|
|
75
|
+
},
|
|
76
|
+
[onOpen]
|
|
77
|
+
);
|
|
78
|
+
const handleButtonClick = useCallback(
|
|
79
|
+
(e) => {
|
|
80
|
+
e.stopPropagation();
|
|
81
|
+
setAnchorEl(e.currentTarget);
|
|
82
|
+
if (onOpen) {
|
|
83
|
+
onOpen(true);
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
[onOpen]
|
|
87
|
+
);
|
|
78
88
|
const renderMenuContent = useCallback(() => {
|
|
79
89
|
let processedActions = [];
|
|
80
90
|
let finalActions = [];
|
|
@@ -89,7 +99,16 @@ function MenuActions(props) {
|
|
|
89
99
|
finalActions = processedActions;
|
|
90
100
|
}
|
|
91
101
|
if (finalActions.length === 0) {
|
|
92
|
-
return /* @__PURE__ */ jsx(
|
|
102
|
+
return /* @__PURE__ */ jsx(
|
|
103
|
+
MenuItem,
|
|
104
|
+
{
|
|
105
|
+
disabled: true,
|
|
106
|
+
role: "menu-no-actions",
|
|
107
|
+
label: getLabel(
|
|
108
|
+
getMenuActionsDictionary(DICTIONARY.no_actions_label)
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
);
|
|
93
112
|
}
|
|
94
113
|
const RenderHeader = () => {
|
|
95
114
|
return /* @__PURE__ */ jsx(HeaderMenuActionsStyled, { children: header });
|
|
@@ -104,7 +123,14 @@ function MenuActions(props) {
|
|
|
104
123
|
const key = actionKey ?? index;
|
|
105
124
|
switch (menuAction.type ?? "menuItem") {
|
|
106
125
|
case "divider":
|
|
107
|
-
return /* @__PURE__ */ jsx(
|
|
126
|
+
return /* @__PURE__ */ jsx(
|
|
127
|
+
MenuDivider,
|
|
128
|
+
{
|
|
129
|
+
variant: "solid",
|
|
130
|
+
size
|
|
131
|
+
},
|
|
132
|
+
`divider-${key}`
|
|
133
|
+
);
|
|
108
134
|
case "loader":
|
|
109
135
|
return /* @__PURE__ */ jsx(MenuLoaderStyled, { size, children: /* @__PURE__ */ jsx(CircularProgress, { size }) }, `loader-${key}`);
|
|
110
136
|
case "customNode":
|
|
@@ -115,7 +141,9 @@ function MenuActions(props) {
|
|
|
115
141
|
{
|
|
116
142
|
size,
|
|
117
143
|
...menuAction,
|
|
118
|
-
label: menuAction.label ?? getLabel(
|
|
144
|
+
label: menuAction.label ?? getLabel(
|
|
145
|
+
getMenuActionsDictionary(DICTIONARY.no_actions_label)
|
|
146
|
+
),
|
|
119
147
|
onClick: menuAction.onClick ? (e) => handleClick(e, menuAction) : void 0
|
|
120
148
|
},
|
|
121
149
|
`${MENU_ACTIONS_}${menuAction.label ?? key}`
|
|
@@ -128,38 +156,60 @@ function MenuActions(props) {
|
|
|
128
156
|
footer && /* @__PURE__ */ jsx(RenderFooter, {}),
|
|
129
157
|
endListElement && endListElement
|
|
130
158
|
] });
|
|
131
|
-
}, [
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
{
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
}, [
|
|
160
|
+
menuActions,
|
|
161
|
+
header,
|
|
162
|
+
size,
|
|
163
|
+
footer,
|
|
164
|
+
endListElement,
|
|
165
|
+
objItem,
|
|
166
|
+
getLabel,
|
|
167
|
+
actionKey,
|
|
168
|
+
handleClick
|
|
169
|
+
]);
|
|
170
|
+
return /* @__PURE__ */ jsxs(
|
|
171
|
+
RootStyled,
|
|
172
|
+
{
|
|
173
|
+
className: clsx(
|
|
174
|
+
className,
|
|
175
|
+
MENU_ACTIONS_CLASSES.root,
|
|
176
|
+
ownerState.selected && MENU_ACTIONS_CLASSES.selected
|
|
177
|
+
),
|
|
178
|
+
ownerState: { ownerState },
|
|
179
|
+
children: [
|
|
180
|
+
/* @__PURE__ */ jsx(
|
|
181
|
+
IconButtonStyled,
|
|
182
|
+
{
|
|
183
|
+
ownerState: { ...ownerState },
|
|
184
|
+
tooltip: toolTip,
|
|
185
|
+
size,
|
|
186
|
+
icon: finalIcon,
|
|
187
|
+
onClick: handleButtonClick,
|
|
188
|
+
className: iconButtonClassName,
|
|
189
|
+
selected: open,
|
|
190
|
+
disabled,
|
|
191
|
+
badgeProps: { badgeContent },
|
|
192
|
+
"aria-label": "menu-actions",
|
|
193
|
+
variant
|
|
194
|
+
}
|
|
195
|
+
),
|
|
196
|
+
open && /* @__PURE__ */ jsx(
|
|
197
|
+
Popover,
|
|
198
|
+
{
|
|
199
|
+
id: "Popover",
|
|
200
|
+
open,
|
|
201
|
+
anchorEl,
|
|
202
|
+
onClose: handleOpenClose,
|
|
203
|
+
arrowType,
|
|
204
|
+
...other,
|
|
205
|
+
slots: { ...slots },
|
|
206
|
+
slotProps: { paper: { ...paperProps } },
|
|
207
|
+
children: renderMenuContent()
|
|
208
|
+
}
|
|
209
|
+
)
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
);
|
|
163
213
|
}
|
|
164
214
|
const MemonizedMenuActions = React.memo(MenuActions);
|
|
165
215
|
export {
|
|
@@ -441,8 +441,8 @@ const createAreasStore = (initProps, storeDevtoolsEnabled = false) => {
|
|
|
441
441
|
bounds: {
|
|
442
442
|
left: MARGIN_GRIDLAYOUT,
|
|
443
443
|
top: MARGIN_GRIDLAYOUT,
|
|
444
|
-
right: -
|
|
445
|
-
bottom: -
|
|
444
|
+
right: -MARGIN_GRIDLAYOUT,
|
|
445
|
+
bottom: -MARGIN_GRIDLAYOUT
|
|
446
446
|
}
|
|
447
447
|
});
|
|
448
448
|
}
|
|
@@ -3,7 +3,7 @@ import { CustomFormArguments, FormProviderCustomProps, FormProviderProps } from
|
|
|
3
3
|
/**
|
|
4
4
|
* TODO: Documentar
|
|
5
5
|
*/
|
|
6
|
-
export declare function useCustomForm({ validationSchema, values, statusLoad, mode, }: CustomFormArguments): import('react-hook-form').UseFormReturn<FieldValues, any,
|
|
6
|
+
export declare function useCustomForm({ validationSchema, values, statusLoad, mode, }: CustomFormArguments): import('react-hook-form').UseFormReturn<FieldValues, any, FieldValues>;
|
|
7
7
|
/**
|
|
8
8
|
* TODO: Documentar
|
|
9
9
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IGridConfigExtended } from '../../components/DataGrid';
|
|
2
2
|
/**
|
|
3
3
|
* Obtiene el sort de la cookie
|
|
4
4
|
*/
|
|
5
|
-
export declare const getColumnsConfigCookie: (cookie: Record<string, any> | undefined | Array<any>) =>
|
|
5
|
+
export declare const getColumnsConfigCookie: (cookie: Record<string, any> | undefined | Array<any>) => IGridConfigExtended["columnsConfig"];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { UseDataGridPersistenceProps } from './types';
|
|
2
|
-
import { ChangeUserColumn,
|
|
2
|
+
import { ChangeUserColumn, IGridConfigExtended } from '../../components/DataGrid';
|
|
3
3
|
/**
|
|
4
4
|
* Hook para manejar los filtros y ordenamientos dinamicos
|
|
5
5
|
*/
|
|
6
6
|
export declare const useDataGridPersistence: (props: UseDataGridPersistenceProps) => {
|
|
7
7
|
onChangeUserColumns: (newProps: ChangeUserColumn) => void;
|
|
8
|
-
defaultUserColumns:
|
|
8
|
+
defaultUserColumns: IGridConfigExtended;
|
|
9
9
|
};
|
|
@@ -13,10 +13,15 @@ const useDataGridPersistence = (props) => {
|
|
|
13
13
|
});
|
|
14
14
|
const onChangeUserColumns = useCallback((newProps) => {
|
|
15
15
|
const { reason, userConfig } = newProps;
|
|
16
|
+
if (userConfig === void 0) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
16
19
|
if (reason === "columnsConfig") {
|
|
17
20
|
setCookie(prefixCookie ? `${prefixCookie}_${COOKIE_COLUMNS_CONFIG}` : COOKIE_COLUMNS_CONFIG, "window", userConfig);
|
|
18
21
|
} else if (reason === "columnsWidths") {
|
|
19
22
|
setCookie(prefixCookie ? `${prefixCookie}_${COOKIE_COLUMNS_WIDTHS}` : COOKIE_COLUMNS_WIDTHS, "window", userConfig);
|
|
23
|
+
} else {
|
|
24
|
+
setCookie(prefixCookie ? `${prefixCookie}_${reason}` : reason, "window", userConfig);
|
|
20
25
|
}
|
|
21
26
|
}, [setCookie, prefixCookie]);
|
|
22
27
|
return {
|
package/index.js
CHANGED
|
@@ -35,7 +35,7 @@ import { D as D2 } from "./components/DataGrid/DataGrid.js";
|
|
|
35
35
|
import { g as g5 } from "./components/DataGrid/dictionary.js";
|
|
36
36
|
import { N, T as T2 } from "./components/DataGrid/subcomponents/editors/TextEditor/index.js";
|
|
37
37
|
import { g as g6 } from "./components/DataGrid/utils/getDataGridRowsFromSet.js";
|
|
38
|
-
import { b as b3, a as a4,
|
|
38
|
+
import { b as b3, a as a4, f } from "./components/DataGrid/constants.js";
|
|
39
39
|
import { C as C4 } from "./components/DataGrid/formatters/ColumnBooleanFormatter/formatter.js";
|
|
40
40
|
import { u as u2 } from "./components/DataGrid/formatters/ColumnBooleanFormatter/useColumnBoolean.js";
|
|
41
41
|
import { C as C5 } from "./components/DataGrid/formatters/ColumnConcatenatedValuesFormatter/formatter.js";
|
|
@@ -127,7 +127,7 @@ import { g as g18 } from "./components/formatters/dictionary.js";
|
|
|
127
127
|
import { F as F2 } from "./components/FormContainer/FormContainer.js";
|
|
128
128
|
import { G } from "./components/GridLayout/GridLayout.js";
|
|
129
129
|
import { R as R4 } from "./components/GridLayout/subcomponents/Responsive/index.js";
|
|
130
|
-
import { c as c2, e
|
|
130
|
+
import { c as c2, e, d as d3 } from "./components/GridLayout/subcomponents/Responsive/responsiveUtils.js";
|
|
131
131
|
import { i, k } from "./components/GridLayout/utils.js";
|
|
132
132
|
import { w } from "./components/GridLayout/subcomponents/withSizeProvider/index.js";
|
|
133
133
|
import { H as H2 } from "./components/HelmetPage/index.js";
|
|
@@ -207,7 +207,7 @@ import { S as S17 } from "./components/Stepper/subcomponents/StepperButtons/Step
|
|
|
207
207
|
import { S as S18 } from "./components/Stepper/subcomponents/StepperButtons/StepperPrevButton/index.js";
|
|
208
208
|
import { S as S19 } from "./components/Stepper/subcomponents/StepperButtons/StepperCancelButton/index.js";
|
|
209
209
|
import { S as S20 } from "./components/Stepper/subcomponents/StepperButtons/StepperSubmitButton/index.js";
|
|
210
|
-
import { e as
|
|
210
|
+
import { e as e2 } from "./components/Stepper/helpers/evaluateVisibilityStepCondition/index.js";
|
|
211
211
|
import { g as g29 } from "./components/Stepper/dictionary.js";
|
|
212
212
|
import { F as F3, R as R23, u as u18 } from "./components/hook-form/RHFormContext/index.js";
|
|
213
213
|
import { g as g30 } from "./components/hook-form/RHFormContext/dictionary.js";
|
|
@@ -239,7 +239,7 @@ import { g as g35 } from "./utils/getIconColor.js";
|
|
|
239
239
|
import { a as a16, g as g36 } from "./utils/getSizeStyles/getSizeStyles.js";
|
|
240
240
|
import { O as O2 } from "./utils/ObjectQueue.js";
|
|
241
241
|
import { g as g37, a as a17 } from "./utils/getComponentSlotRoot.js";
|
|
242
|
-
import { f } from "./utils/formatDistanceToNow/formatDistanteToNow.js";
|
|
242
|
+
import { f as f2 } from "./utils/formatDistanceToNow/formatDistanteToNow.js";
|
|
243
243
|
import { g as g38 } from "./utils/getValidDate.js";
|
|
244
244
|
import { g as g39 } from "./utils/getNullGuard.js";
|
|
245
245
|
import { c as c5, d as d4 } from "./utils/deepShallow.js";
|
|
@@ -289,7 +289,7 @@ export {
|
|
|
289
289
|
C3 as ContainerFlow,
|
|
290
290
|
b3 as DATAGRID_ROW_HEADER_HEIGHTS,
|
|
291
291
|
a4 as DATAGRID_ROW_HEIGHTS,
|
|
292
|
-
|
|
292
|
+
f as DATAGRID_SEMANTIC_WIDTHS,
|
|
293
293
|
D as DICTIONARY,
|
|
294
294
|
D2 as DataGrid,
|
|
295
295
|
D8 as DateFormatter,
|
|
@@ -428,7 +428,7 @@ export {
|
|
|
428
428
|
W3 as WindowToolsMFContext,
|
|
429
429
|
a12 as WindowToolsMFProvider,
|
|
430
430
|
c2 as addLayoutItemToBreakPointIfNoExists,
|
|
431
|
-
|
|
431
|
+
e as addLayoutItemToBreakPoints,
|
|
432
432
|
c4 as capitalizeFirstLetter,
|
|
433
433
|
d3 as cloneLayouts,
|
|
434
434
|
c5 as createCustomDeepShallow,
|
|
@@ -437,8 +437,8 @@ export {
|
|
|
437
437
|
d4 as deepShallow,
|
|
438
438
|
d as defaultCommonActionsDictionary,
|
|
439
439
|
d2 as dragResizeWindowRNDClasses,
|
|
440
|
-
|
|
441
|
-
|
|
440
|
+
e2 as evaluateVisibilityStepCondition,
|
|
441
|
+
f2 as formatDistanceToNow,
|
|
442
442
|
g as getAccountPopoverDictionary,
|
|
443
443
|
g2 as getAppBarDictionary,
|
|
444
444
|
b2 as getAreasComponentsDictionary,
|