@m4l/components 9.4.14 → 9.4.15-BE20260120
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/AccountPopover/slots/AccountPopoverSlots.d.ts +7 -7
- package/components/ActionsGroup/slots/ActionsGroupSlots.d.ts +3 -3
- package/components/AppBar/slots/AppBarSlots.d.ts +1 -1
- package/components/Card/constants.d.ts +1 -1
- package/components/CheckableList/slots/styled.d.ts +9 -9
- package/components/Chip/slots/ChipSlots.d.ts +3 -3
- package/components/CommonActions/components/ActionCancel/slots/ActionsCancelSlots.d.ts +1 -1
- package/components/CommonActions/components/ActionFormCancel/slots/ActionFormCancelSlots.d.ts +1 -1
- package/components/CommonActions/components/ActionFormSubmitProgrammatic/slots/ActionFormSubmitProgrammaticSlots.d.ts +1 -1
- package/components/CommonActions/components/ActionIntro/slots/ActionsIntroSlots.d.ts +1 -1
- package/components/CommonActions/components/ActionsContainer/slots/ActionsContainerSlots.d.ts +1 -1
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +2 -2
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts +2 -2
- package/components/EditLabel/slots/EditLabelSlots.d.ts +4 -4
- package/components/GridLayout/classes/index.d.ts +1 -1
- package/components/HelperError/slots/HelperErrorSlots.d.ts +1 -1
- package/components/Icon/Icon.d.ts +3 -0
- package/components/Icon/Icon.js +52 -28
- package/components/Icon/Icon.styles.js +53 -61
- package/components/Icon/constants.d.ts +1 -0
- package/components/Icon/constants.js +5 -1
- package/components/Icon/slots/IconSlots.js +3 -3
- package/components/Icon/types.d.ts +44 -7
- package/components/ImageText/constants.d.ts +1 -1
- package/components/ImageText/slots/ImageTextSlots.d.ts +2 -2
- package/components/Label/slots/LabelSlots.d.ts +4 -4
- package/components/LanguagePopover/slots/LanguagePopoverSlots.d.ts +1 -1
- package/components/LoadingError/slots/LoadingErrorSlots.d.ts +1 -1
- package/components/MFIsolationApp/slots/MFIsolationAppSlots.d.ts +2 -2
- package/components/MenuActions/MenuActions.js +17 -5
- package/components/MenuActions/constants.d.ts +1 -1
- package/components/MenuActions/constants.js +2 -8
- package/components/MenuActions/slots/MenuActionsSlots.d.ts +2 -2
- package/components/MenuActions/slots/MenuActionsSlots.js +1 -1
- package/components/ModalDialog/slots/ModalDialogSlots.d.ts +2 -2
- package/components/NumberInput/hooks/useNumberInput/useNumberInput.js +2 -0
- package/components/NumberInput/slots/NumberInputSlots.d.ts +2 -2
- package/components/ObjectLogs/slots/ObjectLogsSlots.d.ts +4 -4
- package/components/Pager/slots/PagerSlots.d.ts +3 -3
- package/components/PaperForm/slots/PaperFormSlots.d.ts +2 -2
- package/components/SettingsLayout/slots/SettingsLayoutSlots.d.ts +5 -5
- package/components/SideBar/slots/SideBarSlots.d.ts +1 -1
- package/components/Stepper/slots/StepperSlot.d.ts +5 -5
- package/components/TabsNavigator/slots/TabsNavigatorSlots.d.ts +3 -3
- package/components/ToastContainer/slots/toastContainerSlots.d.ts +5 -5
- package/components/WindowBase/slots/WindowBaseSlots.d.ts +4 -4
- package/components/WindowBase/types.d.ts +2 -1
- package/components/areas/components/AreasAdmin/slots/AreasAdminSlots.d.ts +3 -3
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useWindow.d.ts +1 -1
- package/components/datagrids/formatters/ColumnIconFormatter/types.d.ts +2 -1
- package/components/datagrids/formatters/ColumnNestedValueFormatter/formatter.d.ts +33 -1
- package/components/datagrids/formatters/ColumnNestedValueFormatter/formatter.js +3 -2
- package/components/datagrids/formatters/ColumnNestedValueFormatter/types.d.ts +19 -1
- package/components/datagrids/formatters/ColumnNestedValueFormatter/useColumnNestedValue.d.ts +34 -2
- package/components/datagrids/formatters/ColumnNestedValueFormatter/useColumnNestedValue.js +23 -9
- package/components/datagrids/icons.js +0 -8
- package/components/datagrids/subcomponents/HeaderActions/subcomponents/Density/Density.js +11 -14
- package/components/datagrids/subcomponents/HeaderActions/subcomponents/MobileMenuActions/MobileMenuActions.js +6 -5
- package/components/datagrids/subcomponents/HeaderActions/subcomponents/ViewMode/ViewMode.js +9 -10
- package/components/datagrids/tests/helpers/types.d.ts +10 -0
- package/components/datagrids/views/CardsView/hooks/useCardContent/useCardContent.js +3 -4
- package/components/datagrids/views/CardsView/subcomponents/CardDetails/CardDetails.js +3 -4
- package/components/datagrids/views/CardsView/subcomponents/CardRow/subcomponents/CardHeader/CardHeader.js +2 -4
- package/components/datagrids/views/CardsView/subcomponents/Settings/Settings.js +3 -4
- package/components/datagrids/views/CardsView/subcomponents/Settings/hooks/useModalSettings/useModalSettings.js +3 -4
- package/components/datagrids/views/CardsView/subcomponents/Settings/subcomponents/ColumnsConfig/ColumnsConfig.js +9 -10
- package/components/datagrids/views/TableView/hooks/useHeaderMenuActions/useHeaderMenuActions.js +35 -49
- package/components/datagrids/views/TableView/hooks/useSortColumnsRows/useSortColumnsRows.js +2 -0
- package/components/extended/React-Resizable/Resizable/slots/ResizableSlots.d.ts +1 -1
- package/components/extended/React-Resizable/ResizableBox/slots/ResizableBoxSlots.d.ts +1 -1
- package/components/extended/React-resizable-panels/slots/SplitLayoutSlots.d.ts +7 -7
- package/components/formatters/BooleanFormatter/slots/BooleanFormatterSlots.d.ts +3 -3
- package/components/formatters/ConcatenatedFormatter/slots/ConcatenatedFormatterSlots.d.ts +1 -1
- package/components/formatters/DateFormatter/slots/DateFormatterSlots.d.ts +1 -1
- package/components/formatters/DistanceToNowFormatter/slots/DistanceToNowFormatterSlots.d.ts +1 -1
- package/components/formatters/IconsFormatter/slots/IconsFormatterSlots.d.ts +2 -2
- package/components/formatters/IconsFormatter/types.d.ts +2 -1
- package/components/formatters/ImageFormatter/slots/ImageFormatterSlots.d.ts +1 -1
- package/components/formatters/PeriodFormatter/slots/PeriodFormatterSlots.d.ts +1 -1
- package/components/formatters/PointsFormatter/slots/ointsFormatterSlots.d.ts +1 -1
- package/components/formatters/PriceFormatter/slots/PriceFormatterSlots.d.ts +1 -1
- package/components/formatters/UncertaintyFormatter/slots/UncertaintyFormatterSlots.d.ts +1 -1
- package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.js +5 -0
- package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxSlots.d.ts +1 -1
- package/components/hook-form/RHFColorPicker/slots/RHFColorPickerSlots.d.ts +1 -1
- package/components/hook-form/RHFDatePicker/slots/RHFDatePickerSlots.d.ts +3 -3
- package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.d.ts +1 -1
- package/components/hook-form/RHFSelect/constants.d.ts +1 -1
- package/components/hook-form/RHFSelect/slots/RHFSlots.d.ts +1 -1
- package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
- package/components/hook-form/RHFTextFieldPassword/slots/RHFTextFieldPasswordSlots.d.ts +2 -2
- package/components/hook-form/RHFUpload/RHFUploadImage/slots/RHFUploadImageSlots.d.ts +3 -3
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/constants.d.ts +1 -1
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/slots/RHFUploadSingleFileSlots.d.ts +7 -7
- package/components/hook-form/RHFormProvider/classes/index.d.ts +1 -1
- package/components/mui_extended/Accordion/Accordion.js +3 -2
- package/components/mui_extended/Accordion/constants.d.ts +0 -1
- package/components/mui_extended/Accordion/constants.js +1 -3
- package/components/mui_extended/Accordion/slots/AccordionSlots.d.ts +5 -5
- package/components/mui_extended/Autocomplete/hooks/useEndAdornments.js +3 -5
- package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.d.ts +6 -6
- package/components/mui_extended/Avatar/slots/AvatarSlots.d.ts +1 -1
- package/components/mui_extended/Badge/slots/BadgeSlots.d.ts +1 -1
- package/components/mui_extended/Button/slots/ButtonSlots.d.ts +3 -3
- package/components/mui_extended/CheckBox/slots/CheckBoxSlots.d.ts +4 -4
- package/components/mui_extended/DatePicker/DatePicker.styles.js +2 -2
- package/components/mui_extended/DatePicker/constants.d.ts +1 -1
- package/components/mui_extended/DatePicker/hooks/useDatePicker/useDatePicker.js +10 -11
- package/components/mui_extended/DatePicker/slots/DatePickerSlots.d.ts +3 -3
- package/components/mui_extended/DateTimePicker/DateTimePicker.d.ts +0 -4
- package/components/mui_extended/DateTimePicker/DateTimePicker.js +10 -11
- package/components/mui_extended/DateTimePicker/slots/DateTimePickerSlots.d.ts +4 -4
- package/components/mui_extended/Divider/slots/DividerSlots.d.ts +1 -1
- package/components/mui_extended/IconButton/IconButton.js +19 -8
- package/components/mui_extended/IconButton/constants.d.ts +1 -1
- package/components/mui_extended/IconButton/slots/IconButtonSlots.d.ts +2 -2
- package/components/mui_extended/IconButton/types.d.ts +3 -6
- package/components/mui_extended/LoadingButton/slots/LoadingButtonSlots.d.ts +1 -1
- package/components/mui_extended/MenuDivider/slots/MenuDividerSlots.d.ts +1 -1
- package/components/mui_extended/MenuItem/MenuItem.js +14 -4
- package/components/mui_extended/MenuItem/slots/MenuItemSlots.d.ts +4 -4
- package/components/mui_extended/MenuItem/types.d.ts +3 -3
- package/components/mui_extended/NavLink/slots/NavLinkSlots.d.ts +1 -1
- package/components/mui_extended/Popper/slots/PopperStlots.d.ts +1 -1
- package/components/mui_extended/Radio/Radio.js +4 -5
- package/components/mui_extended/Radio/slots/styled.d.ts +2 -2
- package/components/mui_extended/Select/Select.d.ts +2 -1
- package/components/mui_extended/Select/Select.js +7 -5
- package/components/mui_extended/Select/constants.d.ts +1 -1
- package/components/mui_extended/Select/slots/SelectSlots.d.ts +6 -6
- package/components/mui_extended/Skeleton/Slots/skeletonSlots.d.ts +1 -1
- package/components/mui_extended/Stack/slots/StackSlot.d.ts +1 -1
- package/components/mui_extended/Tab/Slots/TabSlots.d.ts +3 -3
- package/components/mui_extended/Tabs/Tabs.js +5 -9
- package/components/mui_extended/Tabs/slots/TabsSlots.d.ts +1 -1
- package/components/mui_extended/TextField/constants.d.ts +1 -1
- package/components/mui_extended/TextField/slots/TextFieldSlots.d.ts +4 -4
- package/components/mui_extended/TimePicker/slots/TimePickerSlots.d.ts +3 -3
- package/components/mui_extended/ToggleButton/slots/ToggleButtonSlots.d.ts +1 -1
- package/components/mui_extended/ToggleIconButton/slots/ToggleIconButtonSlots.d.ts +1 -1
- package/components/mui_extended/Typography/slots/typographySlots.d.ts +1 -1
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortSlots.d.ts +4 -4
- package/not_recognized/index.js +100 -25
- package/package.json +2 -1
- package/test/mocks.d.ts +2 -2
- package/components/hook-form/RHFDatePicker/icons.d.ts +0 -6
- package/components/mui_extended/Autocomplete/icons.js +0 -7
- package/components/mui_extended/DatePicker/icons.d.ts +0 -4
- package/components/mui_extended/DatePicker/icons.js +0 -10
- package/components/mui_extended/DateTimePicker/icons.d.ts +0 -4
- package/components/mui_extended/DateTimePicker/icons.js +0 -10
- package/components/mui_extended/Radio/icons.js +0 -7
- package/components/mui_extended/Tabs/icons.d.ts +0 -4
- package/components/mui_extended/Tabs/icons.js +0 -7
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
3
3
|
import { p as pathIcons } from "../../../../icons.js";
|
|
4
|
+
import { LayoutDensityCompactOutlined, LayoutDensityStandardOutlined, LayoutDensityConfortableOutlined, SettingsConfigOutlined, MenuMoreVerticalOutlined } from "@m4l/icons";
|
|
4
5
|
import { u as useModalSettings } from "../../../../views/TableView/subcomponents/Settings/hooks/useModalSettings/useModalSettings.js";
|
|
5
6
|
import { u as useModalSettings$1 } from "../../../../views/CardsView/subcomponents/Settings/hooks/useModalSettings/useModalSettings.js";
|
|
6
7
|
import { u as useDataGrid } from "../../../../hooks/shared/useDataGrid/useDataGrid.js";
|
|
@@ -21,21 +22,21 @@ const MobileMenuActions = (props) => {
|
|
|
21
22
|
const menuActions = [
|
|
22
23
|
{
|
|
23
24
|
type: "menuItem",
|
|
24
|
-
startIcon:
|
|
25
|
+
startIcon: /* @__PURE__ */ jsx(LayoutDensityCompactOutlined, {}),
|
|
25
26
|
onClick: () => setRowHeightVariant("compact"),
|
|
26
27
|
disabled: currentRowHeightVariant === "compact",
|
|
27
28
|
label: getLabel("data_grid.density_compact")
|
|
28
29
|
},
|
|
29
30
|
{
|
|
30
31
|
type: "menuItem",
|
|
31
|
-
startIcon:
|
|
32
|
+
startIcon: /* @__PURE__ */ jsx(LayoutDensityStandardOutlined, {}),
|
|
32
33
|
onClick: () => setRowHeightVariant("standard"),
|
|
33
34
|
disabled: currentRowHeightVariant === "standard",
|
|
34
35
|
label: getLabel("data_grid.density_standard")
|
|
35
36
|
},
|
|
36
37
|
{
|
|
37
38
|
type: "menuItem",
|
|
38
|
-
startIcon:
|
|
39
|
+
startIcon: /* @__PURE__ */ jsx(LayoutDensityConfortableOutlined, {}),
|
|
39
40
|
onClick: () => setRowHeightVariant("confortable"),
|
|
40
41
|
disabled: currentRowHeightVariant === "confortable",
|
|
41
42
|
label: getLabel("data_grid.density_confortable")
|
|
@@ -48,7 +49,7 @@ const MobileMenuActions = (props) => {
|
|
|
48
49
|
},
|
|
49
50
|
{
|
|
50
51
|
type: "menuItem",
|
|
51
|
-
startIcon:
|
|
52
|
+
startIcon: /* @__PURE__ */ jsx(SettingsConfigOutlined, {}),
|
|
52
53
|
onClick: () => modalSettings(),
|
|
53
54
|
label: getLabel("data_grid.tooltip_settings")
|
|
54
55
|
}
|
|
@@ -57,7 +58,7 @@ const MobileMenuActions = (props) => {
|
|
|
57
58
|
MenuActions,
|
|
58
59
|
{
|
|
59
60
|
className: "mobile-menu-actions",
|
|
60
|
-
icon:
|
|
61
|
+
icon: /* @__PURE__ */ jsx(MenuMoreVerticalOutlined, {}),
|
|
61
62
|
arrowType: "no-arrow",
|
|
62
63
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
63
64
|
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { jsxs, Fragment
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useMemo, useCallback } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
4
4
|
import { I as IconButton } from "../../../../../mui_extended/IconButton/IconButton.js";
|
|
5
5
|
import { P as Popover } from "../../../../../mui_extended/Popover/Popover.js";
|
|
6
|
-
import { p as pathIcons } from "../../../../icons.js";
|
|
7
6
|
import { D as DICTIONARY } from "../../../../dictionary.js";
|
|
8
7
|
import { g as ContainerToggleCardsStyled, h as CardToggleButtonStyled, T as TextToggleCardButtonStyled } from "../../../../slots/DataGridSlot.js";
|
|
8
|
+
import { LayoutTableOutlined, LayoutCardOutlined } from "@m4l/icons";
|
|
9
9
|
import { u as useDataGrid } from "../../../../hooks/shared/useDataGrid/useDataGrid.js";
|
|
10
10
|
import { I as Icon } from "../../../../../Icon/Icon.js";
|
|
11
11
|
function ViewMode() {
|
|
12
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
13
12
|
const { viewMode, onViewModeChange } = useDataGrid();
|
|
14
13
|
const { getLabel } = useModuleDictionary();
|
|
15
14
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
@@ -33,8 +32,8 @@ function ViewMode() {
|
|
|
33
32
|
},
|
|
34
33
|
[onViewModeChange, handleClose]
|
|
35
34
|
);
|
|
36
|
-
const
|
|
37
|
-
return viewMode === "table" ?
|
|
35
|
+
const RenderIconViewMode = useMemo(() => {
|
|
36
|
+
return viewMode === "table" ? /* @__PURE__ */ jsx(LayoutTableOutlined, {}) : /* @__PURE__ */ jsx(LayoutCardOutlined, {});
|
|
38
37
|
}, [viewMode]);
|
|
39
38
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
40
39
|
/* @__PURE__ */ jsx(
|
|
@@ -43,8 +42,8 @@ function ViewMode() {
|
|
|
43
42
|
tooltip: getLabel(DICTIONARY.TOOLTIP_VIEW_MODE),
|
|
44
43
|
onClick: handleClick,
|
|
45
44
|
"aria-label": "view-mode",
|
|
46
|
-
icon:
|
|
47
|
-
|
|
45
|
+
icon: RenderIconViewMode,
|
|
46
|
+
dataTestId: "view-mode-button"
|
|
48
47
|
}
|
|
49
48
|
),
|
|
50
49
|
/* @__PURE__ */ jsx(
|
|
@@ -73,7 +72,7 @@ function ViewMode() {
|
|
|
73
72
|
/* @__PURE__ */ jsx(
|
|
74
73
|
Icon,
|
|
75
74
|
{
|
|
76
|
-
|
|
75
|
+
icon: /* @__PURE__ */ jsx(LayoutTableOutlined, {}),
|
|
77
76
|
color: viewMode === "table" ? "primary.enabled" : "text.disabled"
|
|
78
77
|
}
|
|
79
78
|
),
|
|
@@ -100,7 +99,7 @@ function ViewMode() {
|
|
|
100
99
|
/* @__PURE__ */ jsx(
|
|
101
100
|
Icon,
|
|
102
101
|
{
|
|
103
|
-
|
|
102
|
+
icon: /* @__PURE__ */ jsx(LayoutCardOutlined, {}),
|
|
104
103
|
color: viewMode === "cards" ? "primary.enabled" : "text.disabled"
|
|
105
104
|
}
|
|
106
105
|
),
|
|
@@ -12,6 +12,16 @@ export interface SeedProps {
|
|
|
12
12
|
withMultipleIcons?: boolean;
|
|
13
13
|
withInteractiveCheck?: boolean;
|
|
14
14
|
withNestedValue?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Si es true, genera valores anidados con algunos null/undefined
|
|
17
|
+
* para mostrar el comportamiento del defaultValue ('-')
|
|
18
|
+
*/
|
|
19
|
+
withNestedValueWithNulls?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Si es true, genera valores anidados con null/undefined
|
|
22
|
+
* y usa un defaultValue personalizado ('N/A')
|
|
23
|
+
*/
|
|
24
|
+
withNestedValueCustomDefaultValue?: boolean;
|
|
15
25
|
withPoints?: boolean;
|
|
16
26
|
withPrice?: boolean;
|
|
17
27
|
withUncertainty?: boolean;
|
|
@@ -2,8 +2,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { j as ContainerLabelValueColumnStyled, k as ContentWrapperColumnStyled, L as LabelHeaderColumnStyled, E as EditorCellWrapperStyled, V as ValueColumnStyled, l as EditablePlaceholderStyled, m as IconButtonEditStyled } from "../../../../slots/DataGridSlot.js";
|
|
4
4
|
import { D as DICTIONARY } from "../../../../dictionary.js";
|
|
5
|
-
import { useModuleDictionary
|
|
6
|
-
import {
|
|
5
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
6
|
+
import { ActionsEditOutlined } from "@m4l/icons";
|
|
7
7
|
import { u as useComponentSize } from "../../../../../../hooks/useComponentSize/useComponentSize.js";
|
|
8
8
|
import { u as useDataGrid } from "../../../../hooks/shared/useDataGrid/useDataGrid.js";
|
|
9
9
|
function useCardContent({
|
|
@@ -15,7 +15,6 @@ function useCardContent({
|
|
|
15
15
|
}) {
|
|
16
16
|
const { getConfigColumns, size } = useDataGrid();
|
|
17
17
|
const { getLabel } = useModuleDictionary();
|
|
18
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
19
18
|
const { currentSize } = useComponentSize(size);
|
|
20
19
|
const [editingColumnKey, setEditingColumnKey] = useState(null);
|
|
21
20
|
const columnsConfig = getConfigColumns("cards");
|
|
@@ -95,7 +94,7 @@ function useCardContent({
|
|
|
95
94
|
/* @__PURE__ */ jsx(
|
|
96
95
|
IconButtonEditStyled,
|
|
97
96
|
{
|
|
98
|
-
src:
|
|
97
|
+
src: /* @__PURE__ */ jsx(ActionsEditOutlined, {}),
|
|
99
98
|
onClick: () => {
|
|
100
99
|
setEditingColumnKey(column.key);
|
|
101
100
|
},
|
|
@@ -2,8 +2,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useCallback } from "react";
|
|
3
3
|
import { o as CardDetailContainerStyled, j as ContainerLabelValueColumnStyled, k as ContentWrapperColumnStyled, L as LabelHeaderColumnStyled, E as EditorCellWrapperStyled, V as ValueColumnStyled, l as EditablePlaceholderStyled, m as IconButtonEditStyled } from "../../../../slots/DataGridSlot.js";
|
|
4
4
|
import { D as DICTIONARY } from "../../../../dictionary.js";
|
|
5
|
-
import { useModuleDictionary
|
|
6
|
-
import {
|
|
5
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
6
|
+
import { ActionsEditOutlined } from "@m4l/icons";
|
|
7
7
|
import { u as useComponentSize } from "../../../../../../hooks/useComponentSize/useComponentSize.js";
|
|
8
8
|
function CardDetails({
|
|
9
9
|
row,
|
|
@@ -17,7 +17,6 @@ function CardDetails({
|
|
|
17
17
|
const [editingColumnKey, setEditingColumnKey] = useState(null);
|
|
18
18
|
const [refreshCounter, setRefreshCounter] = useState(0);
|
|
19
19
|
const { getLabel } = useModuleDictionary();
|
|
20
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
21
20
|
const { currentSize } = useComponentSize(size);
|
|
22
21
|
const currentRow = rows[rowIndex] || row;
|
|
23
22
|
const handleForceRefresh = useCallback(() => {
|
|
@@ -116,7 +115,7 @@ function CardDetails({
|
|
|
116
115
|
/* @__PURE__ */ jsx(
|
|
117
116
|
IconButtonEditStyled,
|
|
118
117
|
{
|
|
119
|
-
src:
|
|
118
|
+
src: /* @__PURE__ */ jsx(ActionsEditOutlined, {}),
|
|
120
119
|
onClick: () => {
|
|
121
120
|
setEditingColumnKey(modifiedColumn.key);
|
|
122
121
|
},
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useCallback } from "react";
|
|
3
|
-
import { useEnvironment } from "@m4l/core";
|
|
4
3
|
import { s as CardHeaderStyled, t as CardHeaderLeftStyled, u as CardHeaderRightStyled } from "../../../../../../slots/DataGridSlot.js";
|
|
5
|
-
import {
|
|
4
|
+
import { LayoutExpandOutlined } from "@m4l/icons";
|
|
6
5
|
import { C as CheckboxCellAdapter } from "../../../../../adapters/CheckboxCellAdapter/CheckboxCellAdapter.js";
|
|
7
6
|
import { I as IconButton } from "../../../../../../../mui_extended/IconButton/IconButton.js";
|
|
8
7
|
import { u as useDataGrid } from "../../../../../../hooks/shared/useDataGrid/useDataGrid.js";
|
|
@@ -16,7 +15,6 @@ function CardHeader({
|
|
|
16
15
|
onCheckedRowsChange
|
|
17
16
|
}) {
|
|
18
17
|
const { rowKeyGetter, rowActionsGetter, size, checkedRowsMultiple } = useDataGrid();
|
|
19
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
20
18
|
const rowKey = useMemo(() => rowKeyGetter(row), [rowKeyGetter, row]);
|
|
21
19
|
const onChange = useCallback(
|
|
22
20
|
(checked, _isShiftClick) => {
|
|
@@ -69,7 +67,7 @@ function CardHeader({
|
|
|
69
67
|
/* @__PURE__ */ jsx(
|
|
70
68
|
IconButton,
|
|
71
69
|
{
|
|
72
|
-
icon:
|
|
70
|
+
icon: /* @__PURE__ */ jsx(LayoutExpandOutlined, {}),
|
|
73
71
|
size,
|
|
74
72
|
variant: "text",
|
|
75
73
|
"data-testid": `card-details-button-${rowKey}`,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { I as IconButton } from "../../../../../mui_extended/IconButton/IconButton.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
4
|
+
import { SettingsConfigOutlined } from "@m4l/icons";
|
|
5
5
|
import { u as useDataGrid } from "../../../../hooks/shared/useDataGrid/useDataGrid.js";
|
|
6
6
|
import { u as useModalSettings } from "./hooks/useModalSettings/useModalSettings.js";
|
|
7
7
|
function Settings(props) {
|
|
8
8
|
const { columns } = props;
|
|
9
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
10
9
|
const { size } = useDataGrid();
|
|
11
10
|
const modalSettings = useModalSettings(size, columns);
|
|
12
11
|
const { getLabel } = useModuleDictionary();
|
|
@@ -19,7 +18,7 @@ function Settings(props) {
|
|
|
19
18
|
tooltip: getLabel("data_grid.tooltip_settings"),
|
|
20
19
|
onClick: handleClick,
|
|
21
20
|
"aria-label": "settings",
|
|
22
|
-
icon:
|
|
21
|
+
icon: /* @__PURE__ */ jsx(SettingsConfigOutlined, {}),
|
|
23
22
|
"data-testid": "settings-button"
|
|
24
23
|
}
|
|
25
24
|
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useModuleDictionary
|
|
2
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
3
3
|
import { useIsMobile } from "@m4l/graphics";
|
|
4
4
|
import { useRef, useCallback } from "react";
|
|
5
5
|
import { u as useModal } from "../../../../../../../../hooks/useModal/index.js";
|
|
6
6
|
import { n as ContentModalSettingStyled, D as DataGridRootStyled } from "../../../../../../slots/DataGridSlot.js";
|
|
7
|
-
import {
|
|
7
|
+
import { SettingsConfigOutlined } from "@m4l/icons";
|
|
8
8
|
import { C as ColumnsConfig } from "../../subcomponents/ColumnsConfig/ColumnsConfig.js";
|
|
9
9
|
import { A as ActionsContainer } from "../../../../../../../CommonActions/components/ActionsContainer/ActionsContainer.js";
|
|
10
10
|
import { u as useDataGrid } from "../../../../../../hooks/shared/useDataGrid/useDataGrid.js";
|
|
@@ -16,7 +16,6 @@ const useModalSettings = (size, columns) => {
|
|
|
16
16
|
const { getConfigColumns, onChangeColumnsConfig, currentRowHeight, classes } = useDataGrid();
|
|
17
17
|
const columnsConfig = getConfigColumns("cards");
|
|
18
18
|
const { getLabel } = useModuleDictionary();
|
|
19
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
20
19
|
const isMobile = useIsMobile();
|
|
21
20
|
const ref = useRef(null);
|
|
22
21
|
const onCloseSettings = useCallback(() => {
|
|
@@ -39,7 +38,7 @@ const useModalSettings = (size, columns) => {
|
|
|
39
38
|
WindowBase,
|
|
40
39
|
{
|
|
41
40
|
title: getLabel("data_grid.settings_title"),
|
|
42
|
-
iconUrl:
|
|
41
|
+
iconUrl: /* @__PURE__ */ jsx(SettingsConfigOutlined, {}),
|
|
43
42
|
onClose: closeModal,
|
|
44
43
|
className: "settings-modal",
|
|
45
44
|
variant: "outlined",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useRef, useState, useImperativeHandle, useMemo, useEffect } from "react";
|
|
3
|
-
import { useModuleDictionary
|
|
3
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
4
4
|
import DataGrid from "react-data-grid";
|
|
5
5
|
import { I as IconButton } from "../../../../../../../mui_extended/IconButton/IconButton.js";
|
|
6
|
-
import { p as pathIcons } from "../../../../../../icons.js";
|
|
7
6
|
import { v as ColumnsConfigWrapperStyled, w as ColumnsConfigDataGridStyled, x as ColumnsConfigSelColumnsStyled, y as TableWrapperDataGridStyled, z as ColumnsConfigActiosStyled } from "../../../../../../slots/DataGridSlot.js";
|
|
8
7
|
import { D as DICTIONARY } from "../../../../../../dictionary.js";
|
|
8
|
+
import { ArrowChevronUpOutlined, ArrowChevronMdUpOutlined, ArrowChevronDownOutlined, ArrowChevronMdDownOutlined, ActionsMultiCheckOutlined, ActionsCheckIndeterminateOutlined, ArrowRestoreOutlined } from "@m4l/icons";
|
|
9
9
|
import { C as ColumnInteractiveCheckFormatter } from "../../../../../../formatters/ColumnInteractiveCheckFormatter/formatter.js";
|
|
10
10
|
function getRowsFromColumnsConfig(columnsConfig, columns) {
|
|
11
11
|
return columnsConfig.filter((cConfig) => !cConfig.hidden).map(
|
|
@@ -48,7 +48,6 @@ const ColumnsConfig = forwardRef(
|
|
|
48
48
|
() => /* @__PURE__ */ new Set()
|
|
49
49
|
);
|
|
50
50
|
const divRef = useRef(null);
|
|
51
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
52
51
|
useImperativeHandle(ref, () => ({
|
|
53
52
|
onClickIntro: handleIntro,
|
|
54
53
|
current: divRef.current
|
|
@@ -234,7 +233,7 @@ const ColumnsConfig = forwardRef(
|
|
|
234
233
|
onClick: handleMoveFirst,
|
|
235
234
|
"aria-label": "move first place",
|
|
236
235
|
disabled: rowSelectedIndex < 1,
|
|
237
|
-
icon:
|
|
236
|
+
icon: /* @__PURE__ */ jsx(ArrowChevronUpOutlined, {})
|
|
238
237
|
}
|
|
239
238
|
),
|
|
240
239
|
/* @__PURE__ */ jsx(
|
|
@@ -244,7 +243,7 @@ const ColumnsConfig = forwardRef(
|
|
|
244
243
|
onClick: () => handleMoveUpDownd(-1),
|
|
245
244
|
"aria-label": "move up place",
|
|
246
245
|
disabled: rowSelectedIndex < 1,
|
|
247
|
-
icon:
|
|
246
|
+
icon: /* @__PURE__ */ jsx(ArrowChevronMdUpOutlined, {})
|
|
248
247
|
}
|
|
249
248
|
),
|
|
250
249
|
/* @__PURE__ */ jsx(
|
|
@@ -254,7 +253,7 @@ const ColumnsConfig = forwardRef(
|
|
|
254
253
|
onClick: handleMoveLast,
|
|
255
254
|
"aria-label": "move last place",
|
|
256
255
|
disabled: !!(rowSelectedIndex === rows.length - 1 || rowSelectedIndex === -1),
|
|
257
|
-
icon:
|
|
256
|
+
icon: /* @__PURE__ */ jsx(ArrowChevronDownOutlined, {})
|
|
258
257
|
}
|
|
259
258
|
),
|
|
260
259
|
/* @__PURE__ */ jsx(
|
|
@@ -264,7 +263,7 @@ const ColumnsConfig = forwardRef(
|
|
|
264
263
|
onClick: () => handleMoveUpDownd(1),
|
|
265
264
|
"aria-label": "move down place",
|
|
266
265
|
disabled: !!(rowSelectedIndex === rows.length - 1 || rowSelectedIndex === -1),
|
|
267
|
-
icon:
|
|
266
|
+
icon: /* @__PURE__ */ jsx(ArrowChevronMdDownOutlined, {})
|
|
268
267
|
}
|
|
269
268
|
),
|
|
270
269
|
/* @__PURE__ */ jsx(
|
|
@@ -273,7 +272,7 @@ const ColumnsConfig = forwardRef(
|
|
|
273
272
|
tooltip: getLabel(DICTIONARY.SETTINGS_VISIBLE_ALL),
|
|
274
273
|
onClick: checkAll,
|
|
275
274
|
"aria-label": "check visible all",
|
|
276
|
-
icon:
|
|
275
|
+
icon: /* @__PURE__ */ jsx(ActionsMultiCheckOutlined, {})
|
|
277
276
|
}
|
|
278
277
|
),
|
|
279
278
|
/* @__PURE__ */ jsx(
|
|
@@ -282,7 +281,7 @@ const ColumnsConfig = forwardRef(
|
|
|
282
281
|
tooltip: getLabel(DICTIONARY.SETTINGS_NO_VISIBLE_ALL),
|
|
283
282
|
onClick: unCheckAll,
|
|
284
283
|
"aria-label": "un check all",
|
|
285
|
-
icon:
|
|
284
|
+
icon: /* @__PURE__ */ jsx(ActionsCheckIndeterminateOutlined, {})
|
|
286
285
|
}
|
|
287
286
|
),
|
|
288
287
|
/* @__PURE__ */ jsx(
|
|
@@ -291,7 +290,7 @@ const ColumnsConfig = forwardRef(
|
|
|
291
290
|
tooltip: getLabel(DICTIONARY.SETTINGS_RESTORE),
|
|
292
291
|
onClick: restoreAll,
|
|
293
292
|
"aria-label": "Restore columns",
|
|
294
|
-
icon:
|
|
293
|
+
icon: /* @__PURE__ */ jsx(ArrowRestoreOutlined, {})
|
|
295
294
|
}
|
|
296
295
|
)
|
|
297
296
|
] })
|
package/components/datagrids/views/TableView/hooks/useHeaderMenuActions/useHeaderMenuActions.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo } from "react";
|
|
2
3
|
import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
4
|
+
import { ActionsFilterOutlined } from "@m4l/icons";
|
|
3
5
|
import { D as DICTIONARY } from "../../../../dictionary.js";
|
|
4
6
|
import { p as pathIcons } from "../../../../icons.js";
|
|
5
7
|
import { u as useDataGrid } from "../../../../hooks/shared/useDataGrid/useDataGrid.js";
|
|
@@ -14,13 +16,16 @@ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable, handleSo
|
|
|
14
16
|
} = useDataGrid();
|
|
15
17
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
16
18
|
const { getLabel } = useModuleDictionary();
|
|
17
|
-
const executeSortChange = (
|
|
18
|
-
|
|
19
|
-
handleSortFromPopover
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
const executeSortChange = useCallback(
|
|
20
|
+
(newSortColumns) => {
|
|
21
|
+
if (handleSortFromPopover) {
|
|
22
|
+
handleSortFromPopover(newSortColumns);
|
|
23
|
+
} else {
|
|
24
|
+
setSortColumns(newSortColumns);
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
[handleSortFromPopover, setSortColumns]
|
|
28
|
+
);
|
|
24
29
|
const column = useMemo(() => {
|
|
25
30
|
return finalColumns.find((c) => c.key === columnKey);
|
|
26
31
|
}, [columnKey, finalColumns]);
|
|
@@ -235,18 +240,9 @@ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable, handleSo
|
|
|
235
240
|
disabled: externalSortSettings ? !hasAnySortApplied || !isRemovable : !(isAsc || isDesc)
|
|
236
241
|
}
|
|
237
242
|
];
|
|
238
|
-
const filterAction = externalFilterSettings ? [
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
startIcon: `${host_static_assets}/${environment_assets}/${pathIcons.filter2}`,
|
|
242
|
-
label: getLabel(DICTIONARY.ADD_FILTER_COLUMN),
|
|
243
|
-
dataTestId: "filter-add",
|
|
244
|
-
onClick: () => {
|
|
245
|
-
addExternalFilter();
|
|
246
|
-
},
|
|
247
|
-
disabled: isAddFilterDisabled
|
|
248
|
-
}
|
|
249
|
-
] : [];
|
|
243
|
+
const filterAction = externalFilterSettings ? [{ type: "menuItem", startIcon: /* @__PURE__ */ jsx(ActionsFilterOutlined, {}), label: getLabel(DICTIONARY.ADD_FILTER_COLUMN), dataTestId: "filter-add", onClick: () => {
|
|
244
|
+
addExternalFilter();
|
|
245
|
+
}, disabled: isAddFilterDisabled }] : [];
|
|
250
246
|
const toggleGrouped = (grouped) => {
|
|
251
247
|
if (!columnKey) {
|
|
252
248
|
return;
|
|
@@ -254,37 +250,23 @@ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable, handleSo
|
|
|
254
250
|
const currentGroupedColumns = columnsConfig.filter((c) => c.grouped);
|
|
255
251
|
const newGroupOrder = grouped ? currentGroupedColumns.length : 0;
|
|
256
252
|
const next = columnsConfig.map(
|
|
257
|
-
(c) => c.key === columnKey ? {
|
|
258
|
-
...c,
|
|
259
|
-
grouped,
|
|
260
|
-
groupOrder: grouped ? newGroupOrder : c.groupOrder
|
|
261
|
-
} : c
|
|
253
|
+
(c) => c.key === columnKey ? { ...c, grouped, groupOrder: grouped ? newGroupOrder : c.groupOrder } : c
|
|
262
254
|
);
|
|
263
255
|
onChangeColumnsConfig("table", next);
|
|
264
256
|
};
|
|
265
|
-
const groupActions = hasGroupableColumns ? [
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
disabled: !canGroup || isGrouped
|
|
257
|
+
const groupActions = hasGroupableColumns ? [{ type: "menuItem", startIcon: `${host_static_assets}/${environment_assets}/${pathIcons.group}`, label: getLabel(DICTIONARY.GROUP_BY_COLUMN), dataTestId: "group-add", onClick: () => {
|
|
258
|
+
toggleGrouped(true);
|
|
259
|
+
}, disabled: !canGroup || isGrouped }, {
|
|
260
|
+
type: "menuItem",
|
|
261
|
+
startIcon: `${host_static_assets}/${environment_assets}/${pathIcons.removeGroup}`,
|
|
262
|
+
label: getLabel(DICTIONARY.REMOVE_GROUP_COLUMN),
|
|
263
|
+
dataTestId: "group-remove",
|
|
264
|
+
onClick: () => {
|
|
265
|
+
toggleGrouped(false);
|
|
275
266
|
},
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
label: getLabel(DICTIONARY.REMOVE_GROUP_COLUMN),
|
|
280
|
-
dataTestId: "group-remove",
|
|
281
|
-
onClick: () => {
|
|
282
|
-
toggleGrouped(false);
|
|
283
|
-
},
|
|
284
|
-
// Solo deshabilitado si no está agrupada O si es una agrupación estática (groupable=false)
|
|
285
|
-
disabled: !isGrouped || !canGroup
|
|
286
|
-
}
|
|
287
|
-
] : [];
|
|
267
|
+
/** Solo deshabilitado si no está agrupada O si es una agrupación estática (groupable=false)*/
|
|
268
|
+
disabled: !isGrouped || !canGroup
|
|
269
|
+
}] : [];
|
|
288
270
|
const baseActions = [
|
|
289
271
|
{
|
|
290
272
|
type: "menuItem",
|
|
@@ -305,7 +287,6 @@ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable, handleSo
|
|
|
305
287
|
return [...sortActions, ...filterAction, ...groupActions, ...baseActions];
|
|
306
288
|
}, [
|
|
307
289
|
columnKey,
|
|
308
|
-
column,
|
|
309
290
|
canSort,
|
|
310
291
|
canSortExternally,
|
|
311
292
|
hasExternalSortAsc,
|
|
@@ -325,7 +306,12 @@ function useHeaderMenuActions(columnKey, finalColumns, defaultSortable, handleSo
|
|
|
325
306
|
environment_assets,
|
|
326
307
|
getLabel,
|
|
327
308
|
isAddFilterDisabled,
|
|
328
|
-
executeSortChange
|
|
309
|
+
executeSortChange,
|
|
310
|
+
addExternalFilter,
|
|
311
|
+
clearLocalSort,
|
|
312
|
+
isAsc,
|
|
313
|
+
isDesc,
|
|
314
|
+
isRemovable
|
|
329
315
|
]);
|
|
330
316
|
}
|
|
331
317
|
export {
|
|
@@ -20,6 +20,7 @@ function getComparator(columns, sortColumn) {
|
|
|
20
20
|
return column.customSort;
|
|
21
21
|
}
|
|
22
22
|
switch (typeOrder) {
|
|
23
|
+
//Si el tipo de dato de la columna es un numerico, retorna una función de ordenamiento numérica
|
|
23
24
|
case "number":
|
|
24
25
|
return (a, b) => {
|
|
25
26
|
try {
|
|
@@ -28,6 +29,7 @@ function getComparator(columns, sortColumn) {
|
|
|
28
29
|
return -1;
|
|
29
30
|
}
|
|
30
31
|
};
|
|
32
|
+
//Por defecto retorna una función de ordenamiento de string
|
|
31
33
|
default:
|
|
32
34
|
return (a, b) => {
|
|
33
35
|
try {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Resizable } from 'react-resizable';
|
|
2
|
-
export declare const RootStyled: import('@emotion/styled').StyledComponent<Pick<import('react-resizable').ResizableProps, "
|
|
2
|
+
export declare const RootStyled: import('@emotion/styled').StyledComponent<Pick<import('react-resizable').ResizableProps, "height" | "width" | "className" | "children" | "onResize" | "resizeHandles" | "handle" | "handleSize" | "lockAspectRatio" | "minConstraints" | "maxConstraints" | "onResizeStop" | "onResizeStart" | "draggableOpts" | "transformScale" | "axis"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {
|
|
3
3
|
ref?: import('react').Ref<Resizable> | undefined;
|
|
4
4
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ResizableBox } from 'react-resizable';
|
|
2
|
-
export declare const RootStyled: import('@emotion/styled').StyledComponent<Pick<import('react-resizable').ResizableBoxProps, "
|
|
2
|
+
export declare const RootStyled: import('@emotion/styled').StyledComponent<Pick<import('react-resizable').ResizableBoxProps, "height" | "width" | "className" | "style" | "children" | "onResize" | "resizeHandles" | "handle" | "handleSize" | "lockAspectRatio" | "minConstraints" | "maxConstraints" | "onResizeStop" | "onResizeStart" | "draggableOpts" | "transformScale" | "axis"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {
|
|
3
3
|
ref?: import('react').Ref<ResizableBox> | undefined;
|
|
4
4
|
}>;
|