@m4l/components 9.2.60-24062025.beta.1 → 9.2.60-J24062025.beta.1
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 +0 -8
- package/components/Chip/Chip.js +10 -9
- package/components/Chip/ChipStyles.js +2 -13
- package/components/Chip/constants.d.ts +0 -9
- package/components/Chip/constants.js +2 -6
- package/components/Chip/slots/ChipEnum.d.ts +0 -3
- package/components/Chip/slots/ChipEnum.js +1 -6
- package/components/Chip/slots/ChipSlots.js +1 -1
- package/components/DataGrid/DataGrid.js +17 -3
- package/components/DataGrid/Datagrid.styles.js +66 -27
- package/components/DataGrid/constants.d.ts +2 -0
- package/components/DataGrid/constants.js +7 -3
- package/components/DataGrid/contexts/DataGridContext/index.js +77 -30
- package/components/DataGrid/contexts/DataGridContext/types.d.ts +5 -2
- package/components/DataGrid/dictionary.d.ts +8 -0
- package/components/DataGrid/dictionary.js +26 -17
- package/components/DataGrid/icons.d.ts +7 -0
- package/components/DataGrid/icons.js +8 -1
- package/components/DataGrid/slots/DataGridEnum.d.ts +5 -1
- package/components/DataGrid/slots/DataGridEnum.js +4 -0
- package/components/DataGrid/slots/DataGridSlot.d.ts +4 -0
- package/components/DataGrid/slots/DataGridSlot.js +22 -2
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Filter/index.js +9 -1
- package/components/DataGrid/subcomponents/Table/hooks/getDragHeaderRenderer.d.ts +3 -1
- package/components/DataGrid/subcomponents/Table/hooks/getDragHeaderRenderer.js +9 -2
- package/components/DataGrid/subcomponents/Table/hooks/useHeaderMenuActions.d.ts +6 -0
- package/components/DataGrid/subcomponents/Table/hooks/useHeaderMenuActions.js +262 -0
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.d.ts +6 -4
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +35 -18
- package/components/DataGrid/subcomponents/Table/index.js +97 -34
- package/components/DataGrid/subcomponents/Table/subcomponents/ActionsColumn.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.d.ts +1 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +79 -4
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.d.ts +5 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +146 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/index.d.ts +1 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/types.d.ts +131 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/SelectColumn.js +1 -1
- package/components/DataGrid/subcomponents/editors/TextEditor/index.js +1 -1
- package/components/DataGrid/tests/HeaderRenderClick.test.d.ts +1 -0
- package/components/DataGrid/tests/useHeaderMenuActions.test.d.ts +1 -0
- package/components/DataGrid/types.d.ts +53 -0
- package/components/DynamicFilter/DynamicFilter.styles.js +90 -99
- package/components/DynamicFilter/slots/SlotsEnum.d.ts +3 -0
- package/components/DynamicFilter/slots/SlotsEnum.js +3 -0
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +9 -0
- package/components/DynamicFilter/slots/dynamicFilterSlots.js +19 -3
- package/components/DynamicFilter/store/DynamicFilterContext.js +67 -26
- package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/index.js +2 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/index.js +2 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/index.js +2 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectAsyncFilter/index.js +2 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/index.js +2 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/index.js +2 -2
- package/components/DynamicFilter/subcomponents/FilterActions/FilterActions.js +1 -1
- package/components/DynamicFilter/subcomponents/FilterActions/useFilterActions.d.ts +0 -1
- package/components/DynamicFilter/subcomponents/FilterActions/useFilterActions.js +1 -2
- package/components/DynamicFilter/subcomponents/InputFilter/InputFilter.js +0 -2
- package/components/DynamicFilter/subcomponents/PopoverFilter/PopoverFilter.js +18 -23
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/PopoverMenuFields.js +1 -4
- package/components/DynamicFilter/types.d.ts +3 -0
- package/components/DynamicSort/DynamicSort.js +10 -6
- package/components/DynamicSort/DynamicSort.styles.js +88 -90
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts +9 -0
- package/components/DynamicSort/slots/DynamicSortSlots.js +21 -5
- package/components/DynamicSort/slots/SlotsEnum.d.ts +4 -1
- package/components/DynamicSort/slots/SlotsEnum.js +4 -1
- package/components/DynamicSort/store/DynamicSortContext.js +96 -67
- package/components/DynamicSort/store/DynamicSortStore.js +53 -4
- package/components/DynamicSort/store/types.d.ts +11 -0
- package/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.js +2 -2
- package/components/DynamicSort/subcomponents/InputSort/InputSort.js +0 -2
- package/components/DynamicSort/subcomponents/PopoverSort/PopoverSort.js +17 -21
- package/components/DynamicSort/subcomponents/SortActions/SortActions.js +2 -2
- package/components/DynamicSort/subcomponents/SortActions/useSortActions.d.ts +0 -2
- package/components/DynamicSort/subcomponents/SortActions/useSortActions.js +1 -2
- package/components/DynamicSort/types.d.ts +4 -0
- package/components/LanguagePopover/LanguagePopover.js +6 -8
- package/components/LanguagePopover/LanguagePopover.styles.js +4 -25
- package/components/LanguagePopover/slots/LanguagePopoverSlots.d.ts +3 -9
- package/components/LanguagePopover/slots/LanguagePopoverSlots.js +3 -1
- package/components/LanguagePopover/types.d.ts +1 -6
- package/components/PaperForm/styles.js +1 -2
- package/components/PropertyValue/PropertyValue.js +1 -2
- package/components/PropertyValue/PropertyValue.styles.js +4 -7
- package/components/PropertyValue/types.d.ts +0 -4
- package/components/SideBar/SideBar.js +2 -4
- package/components/SideBar/constants.d.ts +2 -26
- package/components/SideBar/constants.js +7 -19
- package/components/SideBar/context/sideBarContext/index.js +5 -19
- package/components/SideBar/context/sideBarContext/types.d.ts +1 -22
- package/components/SideBar/helpers/getMenuDataWithState/index.js +8 -25
- package/components/SideBar/slots/SideBarEnum.d.ts +5 -5
- package/components/SideBar/slots/SideBarEnum.js +11 -9
- package/components/SideBar/slots/SideBarSlots.d.ts +3 -9
- package/components/SideBar/slots/SideBarSlots.js +28 -36
- package/components/SideBar/styles.js +4 -2
- package/components/SideBar/subcomponents/ContentComponent/index.js +19 -39
- package/components/SideBar/subcomponents/ContentComponent/style.js +22 -171
- package/components/SideBar/subcomponents/ContentGroups/index.d.ts +5 -0
- package/components/SideBar/subcomponents/{TreeGroupItems → ContentGroups}/index.js +18 -16
- package/components/SideBar/subcomponents/{TreeGroupItems → ContentGroups}/styles.js +7 -5
- package/components/SideBar/subcomponents/{TreeGroupItems/subcomponents/NodeMenuItem → ContentGroups/subcomponents/ContainerMenuItemsMain}/index.d.ts +3 -3
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/index.js +63 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/styles.d.ts +2 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/styles.js +47 -0
- package/components/SideBar/subcomponents/{TreeGroupItems → ContentGroups/subcomponents/ContainerMenuItemsMain}/subcomponents/ArrowIcon/index.js +7 -10
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/types.d.ts +7 -0
- package/components/SideBar/subcomponents/ContentGroups/types.d.ts +4 -0
- package/components/SideBar/subcomponents/{Promotion → FooterSidebar}/index.d.ts +2 -2
- package/components/SideBar/subcomponents/{Promotion → FooterSidebar}/index.js +15 -8
- package/components/SideBar/subcomponents/{Promotion → FooterSidebar}/styles.js +2 -2
- package/components/SideBar/subcomponents/FooterSidebar/types.d.ts +5 -0
- package/components/SideBar/subcomponents/HeaderSidebar/index.js +25 -0
- package/components/SideBar/subcomponents/SideBarDesktop/index.js +1 -1
- package/components/SideBar/subcomponents/SideBarDesktop/styles.js +14 -10
- package/components/SideBar/subcomponents/SideBarMobile/index.js +1 -1
- package/components/SideBar/types.d.ts +3 -7
- package/components/WindowBase/WindowBase.js +1 -4
- package/components/WindowBase/WindowBase.styles.js +13 -48
- package/components/WindowBase/constants.d.ts +0 -1
- package/components/WindowBase/constants.js +1 -5
- package/components/WindowBase/slots/WindowBaseEnum.d.ts +1 -2
- package/components/WindowBase/slots/WindowBaseEnum.js +0 -1
- package/components/WindowBase/slots/WindowBaseSlots.d.ts +0 -3
- package/components/WindowBase/slots/WindowBaseSlots.js +1 -6
- package/components/WindowBase/subcomponents/Header/HeaderWindowBase.js +4 -8
- package/components/WindowBase/subcomponents/Header/useButtonActions.js +2 -4
- package/components/WindowBase/subcomponents/MemoizedIconButton/MemoizedIconButton.d.ts +1 -1
- package/components/WindowBase/subcomponents/MemoizedIconButton/MemoizedIconButton.js +1 -1
- package/components/WindowBase/subcomponents/MemoizedIconButton/types.d.ts +0 -5
- package/components/WindowBase/types.d.ts +0 -11
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js +0 -13
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useRightActions.js +20 -21
- package/components/extended/React-Resizable/helpers.js +1 -1
- package/components/extended/React-resizable-panels/SplitLayout.js +3 -6
- package/components/extended/React-resizable-panels/SplitLayout.styles.js +36 -78
- package/components/extended/React-resizable-panels/constants.d.ts +0 -6
- package/components/extended/React-resizable-panels/constants.js +1 -5
- package/components/extended/React-resizable-panels/slots/SplitLayoutEnum.d.ts +1 -2
- package/components/extended/React-resizable-panels/slots/SplitLayoutEnum.js +0 -1
- package/components/extended/React-resizable-panels/slots/SplitLayoutSlots.d.ts +0 -3
- package/components/extended/React-resizable-panels/slots/SplitLayoutSlots.js +1 -7
- package/components/hook-form/RHFAutocomplete/RFHAutocompleteStyles.js +1 -1
- package/components/hook-form/RHFTextField/RHFTextField.js +0 -1
- package/components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.styles.js +1 -1
- package/components/mui_extended/Accordion/styles.js +2 -10
- package/components/mui_extended/Button/Button.js +1 -3
- package/components/mui_extended/Button/ButtonStyles.js +1 -6
- package/components/mui_extended/Button/types.d.ts +1 -1
- package/components/mui_extended/CheckBox/CheckBox.styles.js +2 -1
- package/components/mui_extended/NavLink/NavLink.js +1 -3
- package/components/mui_extended/NavLink/NavLink.styles.js +1 -2
- package/components/mui_extended/NavLink/types.d.ts +1 -3
- package/components/mui_extended/Tab/Tab.styles.js +1 -2
- package/components/mui_extended/TabContent/TabContent.styles.js +8 -2
- package/components/mui_extended/TextField/TextField.js +1 -1
- package/components/mui_extended/TextField/TextField.styles.js +13 -15
- package/components/mui_extended/index.d.ts +0 -1
- package/hooks/useDynamicFilterAndSort/styles.js +1 -1
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.d.ts +3 -0
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +334 -88
- package/index.d.ts +0 -1
- package/index.js +20 -23
- package/package.json +5 -6
- package/storybook/components/DataGrid/DataGrid.stories.d.ts +22 -0
- package/storybook/components/DataGrid/MswHandles.d.ts +1 -0
- package/storybook/components/DataGrid/helpers/filterFieldsSeedData.d.ts +5 -0
- package/storybook/components/DataGrid/helpers/getRows.d.ts +4 -0
- package/storybook/components/DataGrid/helpers/getRowsWithBackendSimulation.d.ts +9 -0
- package/storybook/components/DataGrid/helpers/sortsSeedData.d.ts +5 -0
- package/storybook/components/DataGrid/helpers/types.d.ts +1 -0
- package/storybook/components/DataGrid/helpers/useSeed.d.ts +3 -0
- package/storybook/components/DataGrid/subcomponents/DataGridRender.d.ts +2 -0
- package/storybook/components/DynamicFilter/DynamicFilter.stories.d.ts +11 -27
- package/storybook/components/DynamicSort/DynamicSort.stories.d.ts +10 -26
- package/storybook/components/extended/mui/IconButton/IconButton.stories.d.ts +0 -1
- package/storybook/components/extended/mui/TextField/TextFieldText.stories.d.ts +0 -1
- package/utils/index.d.ts +0 -1
- package/components/SideBar/hooks/useCollapse/index.d.ts +0 -1
- package/components/SideBar/hooks/useCollapse/useCollapse.d.ts +0 -11
- package/components/SideBar/hooks/useCollapse/useCollapse.js +0 -23
- package/components/SideBar/subcomponents/Promotion/types.d.ts +0 -5
- package/components/SideBar/subcomponents/TreeGroupItems/index.d.ts +0 -5
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/index.js +0 -69
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/types.d.ts +0 -9
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/NodeMenuItemMain.d.ts +0 -5
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/NodeMenuItemMain.js +0 -56
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/index.d.ts +0 -1
- package/components/SideBar/subcomponents/TreeGroupItems/types.d.ts +0 -4
- package/components/mui_extended/Divider/index.d.ts +0 -1
- package/components/mui_extended/Divider/index.js +0 -1
- package/storybook/components/SideBar/subcomponents/FooterPromotion/FooterPromotion.d.ts +0 -4
- package/storybook/components/SideBar/subcomponents/FooterPromotion/constants.d.ts +0 -3
- package/storybook/components/SideBar/subcomponents/FooterPromotion/index.d.ts +0 -1
- /package/components/{SideBar/hooks/useCollapse → DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick}/index.js +0 -0
- /package/components/SideBar/subcomponents/{TreeGroupItems → ContentGroups}/styles.d.ts +0 -0
- /package/components/SideBar/subcomponents/{TreeGroupItems → ContentGroups/subcomponents/ContainerMenuItemsMain}/subcomponents/ArrowIcon/index.d.ts +0 -0
- /package/components/SideBar/subcomponents/{TreeGroupItems → ContentGroups/subcomponents/ContainerMenuItemsMain}/subcomponents/ArrowIcon/types.d.ts +0 -0
- /package/components/SideBar/subcomponents/{Promotion → FooterSidebar}/styles.d.ts +0 -0
|
@@ -2,59 +2,50 @@ import { g as getTypographyStyles } from "../../utils/getTypographyStyles.js";
|
|
|
2
2
|
import { g as getSizeStyles } from "../../utils/getSizeStyles/getSizeStyles.js";
|
|
3
3
|
const CONTAINER_QUERY_NAME = "dynamic";
|
|
4
4
|
const dynamicFilterStyles = {
|
|
5
|
-
|
|
6
|
-
* root: Estilos del contenedor principal del componente.
|
|
7
|
-
*/
|
|
8
|
-
root: ({ theme, ownerState }) => ({
|
|
5
|
+
root: {
|
|
9
6
|
containerName: CONTAINER_QUERY_NAME,
|
|
10
7
|
containerType: "inline-size",
|
|
11
8
|
width: "100%",
|
|
12
9
|
height: "auto",
|
|
13
|
-
padding: 0
|
|
14
|
-
|
|
15
|
-
theme,
|
|
16
|
-
ownerState?.size || "medium",
|
|
17
|
-
"container",
|
|
18
|
-
(size) => ({
|
|
19
|
-
height: size,
|
|
20
|
-
maxHeight: size,
|
|
21
|
-
minHeight: size
|
|
22
|
-
})
|
|
23
|
-
)
|
|
24
|
-
}),
|
|
10
|
+
padding: 0
|
|
11
|
+
},
|
|
25
12
|
/**
|
|
26
13
|
* innerContainer: Estilos del contenedor interno del componente.
|
|
27
14
|
*/
|
|
28
15
|
innerContainer: ({ theme, ownerState }) => ({
|
|
29
|
-
display: "
|
|
16
|
+
display: "grid",
|
|
17
|
+
gridTemplateColumns: "auto 1fr auto",
|
|
18
|
+
gridTemplateAreas: '"input-filter applied-filters actions-filter"',
|
|
30
19
|
alignItems: "center",
|
|
31
20
|
justifyContent: "flex-start",
|
|
32
21
|
width: "100%",
|
|
33
22
|
height: "fit-content",
|
|
34
|
-
|
|
23
|
+
border: theme.vars.size.borderStroke.container,
|
|
24
|
+
borderRadius: theme.vars.size.borderRadius.r1,
|
|
25
|
+
borderColor: ownerState?.isValid ? theme.vars.palette.border?.default : theme.vars.palette.error.enabled,
|
|
35
26
|
background: theme.vars.palette.background.default,
|
|
36
|
-
boxShadow: ownerState?.isValid ? `inset 0px 0px 0px 1px ${theme.vars.palette.border.default}` : `inset 0px 0px 0px 1px ${theme.vars.palette.error.enabled}`,
|
|
37
|
-
overflow: "hidden",
|
|
38
27
|
'&:has([aria-expanded="true"])': {
|
|
39
|
-
|
|
28
|
+
borderColor: ownerState?.isValid ? theme.vars.palette.primary.active : theme.vars.palette.error.enabled
|
|
40
29
|
}
|
|
41
30
|
}),
|
|
42
31
|
/**
|
|
43
32
|
* inputFilter: Estilos del contenedor del campo de entrada de filtrado.
|
|
44
33
|
*/
|
|
45
34
|
inputFilter: ({ theme, ownerState }) => ({
|
|
35
|
+
gridArea: "input-filter",
|
|
46
36
|
display: "flex",
|
|
47
37
|
flexDirection: "row",
|
|
48
|
-
paddingLeft: theme.vars.size.baseSpacings.
|
|
38
|
+
paddingLeft: theme.vars.size.baseSpacings.sp1,
|
|
49
39
|
paddingRight: theme.vars.size.baseSpacings.sp1,
|
|
50
40
|
height: "100%",
|
|
51
41
|
overflow: "hidden",
|
|
52
|
-
maxWidth: "
|
|
42
|
+
maxWidth: "135px",
|
|
53
43
|
width: "100%",
|
|
54
44
|
alignItems: "center",
|
|
55
45
|
borderTopLeftRadius: theme.vars.size.borderRadius.r1,
|
|
56
46
|
borderBottomLeftRadius: theme.vars.size.borderRadius.r1,
|
|
57
|
-
|
|
47
|
+
borderRight: theme.vars.size.borderStroke.container,
|
|
48
|
+
borderColor: theme.vars.palette.border?.default,
|
|
58
49
|
...getSizeStyles(
|
|
59
50
|
theme,
|
|
60
51
|
ownerState?.size || "medium",
|
|
@@ -68,8 +59,6 @@ const dynamicFilterStyles = {
|
|
|
68
59
|
* inputFilterInput: Estilos del campo de entrada de filtrado.
|
|
69
60
|
*/
|
|
70
61
|
inputFilterInput: ({ theme, ownerState }) => ({
|
|
71
|
-
width: "100%",
|
|
72
|
-
background: "#ffffff00",
|
|
73
62
|
...getSizeStyles(
|
|
74
63
|
theme,
|
|
75
64
|
ownerState?.size || "medium",
|
|
@@ -80,12 +69,12 @@ const dynamicFilterStyles = {
|
|
|
80
69
|
maxHeight: size
|
|
81
70
|
})
|
|
82
71
|
),
|
|
83
|
-
fontFamily: "inherit",
|
|
84
72
|
...getTypographyStyles(
|
|
85
73
|
theme.generalSettings.isMobile,
|
|
86
74
|
ownerState?.size || "medium",
|
|
87
75
|
"body"
|
|
88
76
|
),
|
|
77
|
+
background: theme.vars.palette.background.default,
|
|
89
78
|
color: theme.vars.palette.text.secondary,
|
|
90
79
|
border: 0,
|
|
91
80
|
borderColor: "transparent",
|
|
@@ -97,40 +86,33 @@ const dynamicFilterStyles = {
|
|
|
97
86
|
},
|
|
98
87
|
"&:focus-visible": {
|
|
99
88
|
color: theme.vars.palette.text.secondary,
|
|
100
|
-
border:
|
|
89
|
+
border: theme.vars.size.borderStroke.container,
|
|
101
90
|
borderColor: theme.vars.palette.primary.opacity,
|
|
91
|
+
background: theme.vars.palette.primary.opacity,
|
|
102
92
|
BorderRadius: theme.vars.size.borderRadius["r0-5"],
|
|
103
93
|
outline: "none!important"
|
|
94
|
+
},
|
|
95
|
+
"&:hover": {
|
|
96
|
+
borderColor: theme.vars.palette.primary?.toneOpacity,
|
|
97
|
+
background: theme.vars.palette.background?.hover
|
|
104
98
|
}
|
|
105
99
|
}),
|
|
106
100
|
/**
|
|
107
101
|
* appliedFilters: Estilos del contenedor de los filtros aplicados.
|
|
108
102
|
*/
|
|
109
|
-
appliedFilters: ({ theme
|
|
103
|
+
appliedFilters: ({ theme }) => ({
|
|
104
|
+
gridArea: "applied-filters",
|
|
110
105
|
width: "100%",
|
|
111
106
|
height: "fit-content",
|
|
112
|
-
|
|
113
|
-
alignItems: "center",
|
|
107
|
+
overflow: "hidden",
|
|
114
108
|
borderLeft: "none",
|
|
115
109
|
margin: "0px",
|
|
116
|
-
padding: `0px ${theme.vars.size.baseSpacings.sp1}
|
|
117
|
-
flex: 1,
|
|
118
|
-
overflow: "hidden",
|
|
119
|
-
...getSizeStyles(
|
|
120
|
-
theme,
|
|
121
|
-
ownerState?.size || "medium",
|
|
122
|
-
"container",
|
|
123
|
-
(size) => ({
|
|
124
|
-
height: size,
|
|
125
|
-
maxHeight: size,
|
|
126
|
-
minHeight: size
|
|
127
|
-
})
|
|
128
|
-
)
|
|
110
|
+
padding: `0px ${theme.vars.size.baseSpacings.sp1}`
|
|
129
111
|
}),
|
|
130
112
|
/**
|
|
131
113
|
* appliedFilterInnerContainer: Estilos del contenedor interno de los filtros aplicados.
|
|
132
114
|
*/
|
|
133
|
-
appliedFilterInnerContainer: ({ theme
|
|
115
|
+
appliedFilterInnerContainer: ({ theme }) => ({
|
|
134
116
|
padding: theme.vars.size.baseSpacings["sp0-5"],
|
|
135
117
|
gap: theme.vars.size.baseSpacings.sp1,
|
|
136
118
|
height: "fit-content",
|
|
@@ -140,24 +122,7 @@ const dynamicFilterStyles = {
|
|
|
140
122
|
justifyContent: "flex-start",
|
|
141
123
|
alignItems: "center",
|
|
142
124
|
overflow: "auto hidden",
|
|
143
|
-
position: "relative"
|
|
144
|
-
"& .M4LChip-root": {
|
|
145
|
-
borderRadius: theme.vars.size.borderRadius.r1,
|
|
146
|
-
...getSizeStyles(
|
|
147
|
-
theme,
|
|
148
|
-
ownerState?.size || "medium",
|
|
149
|
-
"action",
|
|
150
|
-
(size) => ({
|
|
151
|
-
height: size
|
|
152
|
-
})
|
|
153
|
-
),
|
|
154
|
-
"& .M4LIconButton-styledMUIIconButton:hover": {
|
|
155
|
-
backgroundColor: `${theme.vars.palette.chips.error.contained.backgroundHover} !important`,
|
|
156
|
-
"& .M4LIcon-icon": {
|
|
157
|
-
backgroundColor: `${theme.vars.palette.chips.error.contained.backgroundColorTone} !important`
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
125
|
+
position: "relative"
|
|
161
126
|
}),
|
|
162
127
|
/**
|
|
163
128
|
* actions: Estilos del contenedor de los botones de acción.
|
|
@@ -173,32 +138,19 @@ const dynamicFilterStyles = {
|
|
|
173
138
|
alignItems: "center",
|
|
174
139
|
borderTopRightRadius: theme.vars.size.borderRadius.r1,
|
|
175
140
|
borderBottomRightRadius: theme.vars.size.borderRadius.r1,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
display: "none"
|
|
179
|
-
},
|
|
180
|
-
...ownerState?.inEdition && ownerState?.isValid && {
|
|
181
|
-
boxShadow: `inset 1px 0px 0px 0px ${theme.vars.palette.border.main}`
|
|
182
|
-
},
|
|
183
|
-
...!ownerState?.isValid && {
|
|
184
|
-
boxShadow: `inset 1px 0px 0px 0px ${theme.vars.palette.error.enabled}`
|
|
185
|
-
}
|
|
186
|
-
}),
|
|
187
|
-
/**
|
|
188
|
-
* actionsClearButton: Estilos del botón de acción de limpiar.
|
|
189
|
-
*/
|
|
190
|
-
actionsClearButton: ({ theme }) => ({
|
|
191
|
-
"&:hover": {
|
|
192
|
-
backgroundColor: `${theme.vars.palette.chips.error.contained.backgroundHover} !important`,
|
|
193
|
-
"& .M4LIcon-icon": {
|
|
194
|
-
backgroundColor: `${theme.vars.palette.chips.error.contained.backgroundColorTone} !important`
|
|
195
|
-
}
|
|
196
|
-
}
|
|
141
|
+
borderLeft: !ownerState?.visibleRefresh && !ownerState?.isDirty ? "none" : theme.vars.size.borderStroke.container,
|
|
142
|
+
borderColor: theme.vars.palette.border?.default
|
|
197
143
|
}),
|
|
144
|
+
actionsClearButton: {
|
|
145
|
+
visibility: "visible"
|
|
146
|
+
},
|
|
198
147
|
/**
|
|
199
148
|
* actionsSubmitButton: Estilos del botón de acción de filtrado.
|
|
200
149
|
*/
|
|
201
150
|
actionsSubmitButton: ({ theme, ownerState }) => ({
|
|
151
|
+
...ownerState?.isValid === false ? { border: `1px dashed ${theme.vars.palette.error.enabled}` } : {
|
|
152
|
+
visibility: "visible"
|
|
153
|
+
},
|
|
202
154
|
...ownerState?.isDirty ? {
|
|
203
155
|
animation: "changeBgColor 0.9s ease infinite",
|
|
204
156
|
"& .M4LIcon-icon": {
|
|
@@ -250,19 +202,66 @@ const dynamicFilterStyles = {
|
|
|
250
202
|
minWidth: "220px",
|
|
251
203
|
maxWidth: "420px",
|
|
252
204
|
height: "fit-content"
|
|
253
|
-
},
|
|
254
|
-
"& .M4LWindowBase-root": {
|
|
255
|
-
border: "unset!important",
|
|
256
|
-
"& .M4LWindowBase-headerWindowComponent": {
|
|
257
|
-
cursor: "unset"
|
|
258
|
-
}
|
|
259
205
|
}
|
|
260
206
|
}
|
|
261
207
|
}),
|
|
208
|
+
/**
|
|
209
|
+
* popoverFilterHeader: Estilos del encabezado del menú emergente de filtro.
|
|
210
|
+
*/
|
|
211
|
+
popoverFilterHeader: ({ theme, ownerState }) => ({
|
|
212
|
+
display: "flex",
|
|
213
|
+
alignItems: "center",
|
|
214
|
+
gap: theme.vars.size.baseSpacings.sp2,
|
|
215
|
+
padding: theme.vars.size.baseSpacings.sp1,
|
|
216
|
+
paddingLeft: theme.vars.size.baseSpacings.sp2,
|
|
217
|
+
borderTopLeftRadius: theme.vars.size.borderRadius.r1,
|
|
218
|
+
borderTopRightRadius: theme.vars.size.borderRadius.r1,
|
|
219
|
+
borderBottom: theme.vars.size.borderStroke.container,
|
|
220
|
+
borderColor: theme.vars.palette.border.secondary,
|
|
221
|
+
"& .M4LIcon-icon": {
|
|
222
|
+
backgroundColor: theme.vars.palette.primary.main
|
|
223
|
+
},
|
|
224
|
+
...getSizeStyles(
|
|
225
|
+
theme,
|
|
226
|
+
ownerState?.size || "medium",
|
|
227
|
+
"container",
|
|
228
|
+
(size) => ({
|
|
229
|
+
height: size
|
|
230
|
+
})
|
|
231
|
+
)
|
|
232
|
+
}),
|
|
233
|
+
/**
|
|
234
|
+
* popoverFilterHeaderTitle: Estilos del título del menú emergente de filtro.
|
|
235
|
+
*/
|
|
236
|
+
popoverFilterHeaderTitle: ({ theme }) => ({
|
|
237
|
+
color: `${theme.vars.palette.primary.main} !important`
|
|
238
|
+
}),
|
|
239
|
+
/**
|
|
240
|
+
* popoverFilterContainerFields: Estilos del contenedor de campos del menú emergente de filtro.
|
|
241
|
+
*/
|
|
242
|
+
popoverFilterContainerFields: ({ theme }) => ({
|
|
243
|
+
height: "fit-content",
|
|
244
|
+
"& > div": {
|
|
245
|
+
display: "flex",
|
|
246
|
+
flexDirection: "column",
|
|
247
|
+
gap: theme.vars.size.baseSpacings.sp2
|
|
248
|
+
}
|
|
249
|
+
}),
|
|
250
|
+
/**
|
|
251
|
+
* contentFilter: Estilos del contenedor entre el change filter y actions
|
|
252
|
+
*/
|
|
253
|
+
contentFilter: ({ theme }) => ({
|
|
254
|
+
display: "flex",
|
|
255
|
+
flexDirection: "column",
|
|
256
|
+
padding: theme.vars.size.baseSpacings.sp3,
|
|
257
|
+
gap: theme.vars.size.baseSpacings.sp3
|
|
258
|
+
}),
|
|
262
259
|
/**
|
|
263
260
|
* popoverFilterActions: Estilos del contenedor de acciones del menú emergente de filtro.
|
|
264
261
|
*/
|
|
265
|
-
popoverFilterActions: {}
|
|
262
|
+
popoverFilterActions: ({ theme }) => ({
|
|
263
|
+
padding: `${theme.vars.size.baseSpacings.sp3} 0px`
|
|
264
|
+
}),
|
|
266
265
|
/**
|
|
267
266
|
* inputSortInputSkeleton: Estilos del esqueleto del campo de entrada de ordenamiento.
|
|
268
267
|
*/
|
|
@@ -281,14 +280,6 @@ const dynamicFilterStyles = {
|
|
|
281
280
|
maxHeight: size
|
|
282
281
|
})
|
|
283
282
|
)
|
|
284
|
-
}),
|
|
285
|
-
/**
|
|
286
|
-
* popoverFilterContainerFields: Estilos del contenedor de los campos del menú emergente de filtro.
|
|
287
|
-
*/
|
|
288
|
-
popoverFilterContainerFields: ({ theme }) => ({
|
|
289
|
-
display: "flex",
|
|
290
|
-
flexDirection: "column",
|
|
291
|
-
gap: theme.vars.size.baseSpacings.sp4
|
|
292
283
|
})
|
|
293
284
|
};
|
|
294
285
|
export {
|
|
@@ -11,6 +11,9 @@ export declare enum DynamicFilterSlots {
|
|
|
11
11
|
popoverMenu = "popoverMenu",
|
|
12
12
|
popoverFilter = "popoverFilter",
|
|
13
13
|
popoverFilterContainerFields = "popoverFilterContainerFields",
|
|
14
|
+
popoverFilterHeader = "popoverFilterHeader",
|
|
15
|
+
contentFilter = "contentFilter",
|
|
16
|
+
popoverFilterHeaderTitle = "popoverFilterHeaderTitle",
|
|
14
17
|
popoverFilterActions = "popoverFilterActions",
|
|
15
18
|
inputFilterInputSkeleton = "inputFilterInputSkeleton"
|
|
16
19
|
}
|
|
@@ -11,6 +11,9 @@ var DynamicFilterSlots = /* @__PURE__ */ ((DynamicFilterSlots2) => {
|
|
|
11
11
|
DynamicFilterSlots2["popoverMenu"] = "popoverMenu";
|
|
12
12
|
DynamicFilterSlots2["popoverFilter"] = "popoverFilter";
|
|
13
13
|
DynamicFilterSlots2["popoverFilterContainerFields"] = "popoverFilterContainerFields";
|
|
14
|
+
DynamicFilterSlots2["popoverFilterHeader"] = "popoverFilterHeader";
|
|
15
|
+
DynamicFilterSlots2["contentFilter"] = "contentFilter";
|
|
16
|
+
DynamicFilterSlots2["popoverFilterHeaderTitle"] = "popoverFilterHeaderTitle";
|
|
14
17
|
DynamicFilterSlots2["popoverFilterActions"] = "popoverFilterActions";
|
|
15
18
|
DynamicFilterSlots2["inputFilterInputSkeleton"] = "inputFilterInputSkeleton";
|
|
16
19
|
return DynamicFilterSlots2;
|
|
@@ -34,6 +34,15 @@ export declare const PopoverStyled: import('@emotion/styled').StyledComponent<Pi
|
|
|
34
34
|
export declare const PopoverContainerFieldsStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
35
35
|
ownerState?: (Partial<import('../types').DynamicFilterOwnerState> & Record<string, unknown>) | undefined;
|
|
36
36
|
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
37
|
+
export declare const PopoverHeaderStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
38
|
+
ownerState?: (Partial<import('../types').DynamicFilterOwnerState> & Record<string, unknown>) | undefined;
|
|
39
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
40
|
+
export declare const ContentFilterStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
41
|
+
ownerState?: (Partial<import('../types').DynamicFilterOwnerState> & Record<string, unknown>) | undefined;
|
|
42
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
43
|
+
export declare const PopoverHeaderTitleStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Typography/types').TypographyProps, keyof import('../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
44
|
+
ownerState?: (Partial<import('../types').DynamicFilterOwnerState> & Record<string, unknown>) | undefined;
|
|
45
|
+
}, {}, {}>;
|
|
37
46
|
export declare const PopoverHeaderActionsStyled: import('@emotion/styled').StyledComponent<Pick<import('../../CommonActions/components/ActionsContainer').ActionsContainerProps & import('react').RefAttributes<HTMLDivElement>, keyof import('react').RefAttributes<HTMLDivElement> | keyof import('../../CommonActions/components/ActionsContainer').ActionsContainerProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
|
|
38
47
|
ownerState?: (Partial<import('../types').DynamicFilterOwnerState> & Record<string, unknown>) | undefined;
|
|
39
48
|
}, {}, {}>;
|
|
@@ -4,6 +4,7 @@ import { D as DYNAMIC_FILTER_KEY_COMPONENT } from "../constants.js";
|
|
|
4
4
|
import { d as dynamicFilterStyles } from "../DynamicFilter.styles.js";
|
|
5
5
|
import { D as DynamicFilterSlots } from "./SlotsEnum.js";
|
|
6
6
|
import { I as IconButton } from "../../mui_extended/IconButton/IconButton.js";
|
|
7
|
+
import { T as Typography } from "../../mui_extended/Typography/Typography.js";
|
|
7
8
|
import { A as ActionsContainer } from "../../CommonActions/components/ActionsContainer/ActionsContainer.js";
|
|
8
9
|
import { P as Popover } from "../../mui_extended/Popover/Popover.js";
|
|
9
10
|
const RootStyled = styled("div", {
|
|
@@ -54,6 +55,18 @@ const PopoverContainerFieldsStyled = styled("div", {
|
|
|
54
55
|
name: DYNAMIC_FILTER_KEY_COMPONENT,
|
|
55
56
|
slot: DynamicFilterSlots.popoverFilterContainerFields
|
|
56
57
|
})(dynamicFilterStyles?.popoverFilterContainerFields);
|
|
58
|
+
const PopoverHeaderStyled = styled("div", {
|
|
59
|
+
name: DYNAMIC_FILTER_KEY_COMPONENT,
|
|
60
|
+
slot: DynamicFilterSlots.popoverFilterHeader
|
|
61
|
+
})(dynamicFilterStyles?.popoverFilterHeader);
|
|
62
|
+
const ContentFilterStyled = styled("div", {
|
|
63
|
+
name: DYNAMIC_FILTER_KEY_COMPONENT,
|
|
64
|
+
slot: DynamicFilterSlots.contentFilter
|
|
65
|
+
})(dynamicFilterStyles?.contentFilter);
|
|
66
|
+
const PopoverHeaderTitleStyled = styled(Typography, {
|
|
67
|
+
name: DYNAMIC_FILTER_KEY_COMPONENT,
|
|
68
|
+
slot: DynamicFilterSlots.popoverFilterHeaderTitle
|
|
69
|
+
})(dynamicFilterStyles?.popoverFilterHeaderTitle);
|
|
57
70
|
const PopoverHeaderActionsStyled = styled(ActionsContainer, {
|
|
58
71
|
name: DYNAMIC_FILTER_KEY_COMPONENT,
|
|
59
72
|
slot: DynamicFilterSlots.popoverFilterActions
|
|
@@ -64,6 +77,7 @@ const InputFilterInputSkeletonStyled = styled(Skeleton, {
|
|
|
64
77
|
})(dynamicFilterStyles?.inputFilterInputSkeleton);
|
|
65
78
|
export {
|
|
66
79
|
AppliedFiltersStyled as A,
|
|
80
|
+
ContentFilterStyled as C,
|
|
67
81
|
InnerContainerStyled as I,
|
|
68
82
|
PopoverStyled as P,
|
|
69
83
|
RootStyled as R,
|
|
@@ -74,7 +88,9 @@ export {
|
|
|
74
88
|
InputFilterStyled as e,
|
|
75
89
|
InputFilterInputSkeletonStyled as f,
|
|
76
90
|
InputFilterInputStyled as g,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
91
|
+
PopoverHeaderStyled as h,
|
|
92
|
+
PopoverHeaderTitleStyled as i,
|
|
93
|
+
PopoverContainerFieldsStyled as j,
|
|
94
|
+
PopoverHeaderActionsStyled as k,
|
|
95
|
+
PopoverMenuStyled as l
|
|
80
96
|
};
|
|
@@ -25,6 +25,7 @@ const DynamicFilterProvider = forwardRef((props, ref) => {
|
|
|
25
25
|
visibleRefresh = true
|
|
26
26
|
} = props;
|
|
27
27
|
const { currentSize } = useComponentSize(size);
|
|
28
|
+
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
28
29
|
const { getLabel } = useModuleDictionary();
|
|
29
30
|
const dynamicFilterStoreRef = useRef();
|
|
30
31
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
@@ -32,29 +33,32 @@ const DynamicFilterProvider = forwardRef((props, ref) => {
|
|
|
32
33
|
const isSkeleton = useModuleSkeleton();
|
|
33
34
|
const isFirstRender = useFirstRender([isDesktop, isSkeleton]);
|
|
34
35
|
if (!dynamicFilterStoreRef.current) {
|
|
35
|
-
dynamicFilterStoreRef.current = createDynamicFilterStore(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
dynamicFilterStoreRef.current = createDynamicFilterStore(
|
|
37
|
+
{
|
|
38
|
+
allField: {
|
|
39
|
+
...ALL_FIELD,
|
|
40
|
+
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/all_fields.svg`
|
|
41
|
+
},
|
|
42
|
+
withAllField,
|
|
43
|
+
fields,
|
|
44
|
+
automatic,
|
|
45
|
+
getLabel,
|
|
46
|
+
dataTestId,
|
|
47
|
+
size,
|
|
48
|
+
storeId,
|
|
49
|
+
visibleRefresh,
|
|
50
|
+
ownerState: {
|
|
51
|
+
isSkeleton,
|
|
52
|
+
isDirty: false,
|
|
53
|
+
inEdition: false,
|
|
54
|
+
isValid: true,
|
|
55
|
+
isMobile: !isDesktop,
|
|
56
|
+
isEmpty: true,
|
|
57
|
+
size
|
|
58
|
+
}
|
|
39
59
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
automatic,
|
|
43
|
-
getLabel,
|
|
44
|
-
dataTestId,
|
|
45
|
-
size: currentSize,
|
|
46
|
-
storeId,
|
|
47
|
-
visibleRefresh,
|
|
48
|
-
ownerState: {
|
|
49
|
-
isSkeleton,
|
|
50
|
-
isDirty: false,
|
|
51
|
-
inEdition: false,
|
|
52
|
-
isValid: true,
|
|
53
|
-
isMobile: !isDesktop,
|
|
54
|
-
isEmpty: true,
|
|
55
|
-
size: currentSize
|
|
56
|
-
}
|
|
57
|
-
}, storeDevtoolsEnabled);
|
|
60
|
+
storeDevtoolsEnabled
|
|
61
|
+
);
|
|
58
62
|
dynamicFilterStoreRef.current.getState().actions.init(initialAppliedFilters);
|
|
59
63
|
}
|
|
60
64
|
const fireOnChangeFilters = useStore(
|
|
@@ -62,8 +66,45 @@ const DynamicFilterProvider = forwardRef((props, ref) => {
|
|
|
62
66
|
(state) => state.actions.fireOnChangeFilters,
|
|
63
67
|
shallow
|
|
64
68
|
);
|
|
69
|
+
const openPopoverMenuFields = useStore(
|
|
70
|
+
dynamicFilterStoreRef.current,
|
|
71
|
+
(state) => state.actions.openPopoverMenuFields,
|
|
72
|
+
shallow
|
|
73
|
+
);
|
|
74
|
+
const showPopoverFilterForAdd = useStore(
|
|
75
|
+
dynamicFilterStoreRef.current,
|
|
76
|
+
(state) => state.actions.showPopoverFilterForAdd,
|
|
77
|
+
shallow
|
|
78
|
+
);
|
|
79
|
+
const addExternalFilter = (columnKey) => {
|
|
80
|
+
try {
|
|
81
|
+
const state = dynamicFilterStoreRef.current?.getState();
|
|
82
|
+
if (!state) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const field = state.actions.getFieldByName(columnKey);
|
|
86
|
+
const isFilterApplied = state.appliedFilters.some(
|
|
87
|
+
(filter) => filter.field.name === columnKey && filter.isSet
|
|
88
|
+
);
|
|
89
|
+
const isFilterMultiple = field.multiple;
|
|
90
|
+
if (isFilterApplied && !isFilterMultiple) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
showPopoverFilterForAdd(field);
|
|
94
|
+
} catch (error) {
|
|
95
|
+
throw new Error(`Error al agregar el filtro externo: ${error}`);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const getCurrentFilters = useStore(
|
|
99
|
+
dynamicFilterStoreRef.current,
|
|
100
|
+
(state) => () => state.appliedFilters,
|
|
101
|
+
shallow
|
|
102
|
+
);
|
|
65
103
|
useImperativeHandle(ref, () => ({
|
|
66
|
-
fireOnChangeFilter: fireOnChangeFilters
|
|
104
|
+
fireOnChangeFilter: fireOnChangeFilters,
|
|
105
|
+
openPopoverMenuFields,
|
|
106
|
+
addExternalFilter,
|
|
107
|
+
getCurrentFilters
|
|
67
108
|
}));
|
|
68
109
|
const countOnChangeFiltersApplied = useStore(
|
|
69
110
|
dynamicFilterStoreRef.current,
|
|
@@ -95,13 +136,13 @@ const DynamicFilterProvider = forwardRef((props, ref) => {
|
|
|
95
136
|
}
|
|
96
137
|
}, []);
|
|
97
138
|
useEffect(() => {
|
|
98
|
-
if (dynamicFilterStoreRef.current?.getState().size !==
|
|
99
|
-
dynamicFilterStoreRef.current?.getState().actions.setSize(
|
|
139
|
+
if (dynamicFilterStoreRef.current?.getState().size !== adjustedSize) {
|
|
140
|
+
dynamicFilterStoreRef.current?.getState().actions.setSize(adjustedSize);
|
|
100
141
|
}
|
|
101
142
|
if (dynamicFilterStoreRef.current?.getState().visibleRefresh !== visibleRefresh) {
|
|
102
143
|
dynamicFilterStoreRef.current?.getState().actions.setVisibleRefresh(visibleRefresh);
|
|
103
144
|
}
|
|
104
|
-
}, [
|
|
145
|
+
}, [adjustedSize, visibleRefresh]);
|
|
105
146
|
return /* @__PURE__ */ jsx(DynamicFilterContext.Provider, { value: dynamicFilterStoreRef.current, children });
|
|
106
147
|
});
|
|
107
148
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs,
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useModuleDictionary } from "@m4l/core";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { B as BOOLEAN_OPERATORS } from "../../../constants.js";
|
|
@@ -29,7 +29,7 @@ function BooleanFilter() {
|
|
|
29
29
|
],
|
|
30
30
|
[getLabel]
|
|
31
31
|
);
|
|
32
|
-
return /* @__PURE__ */ jsxs(
|
|
32
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
33
33
|
/* @__PURE__ */ jsx(
|
|
34
34
|
RHFAutocomplete,
|
|
35
35
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs,
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useModuleDictionary } from "@m4l/core";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { useFormContext, useWatch } from "react-hook-form";
|
|
@@ -23,7 +23,7 @@ function DateTimeFilter() {
|
|
|
23
23
|
})).filter((o) => restritcOperatorsTo ? restritcOperatorsTo.includes(o.id) : true),
|
|
24
24
|
[getLabel, restritcOperatorsTo]
|
|
25
25
|
);
|
|
26
|
-
return /* @__PURE__ */ jsxs(
|
|
26
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
27
27
|
/* @__PURE__ */ jsx(
|
|
28
28
|
RHFAutocomplete,
|
|
29
29
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs,
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useModuleDictionary } from "@m4l/core";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { useFormContext, useWatch } from "react-hook-form";
|
|
@@ -24,7 +24,7 @@ function NumberFilter() {
|
|
|
24
24
|
})).filter((o) => restritcOperatorsTo ? restritcOperatorsTo.includes(o.id) : true),
|
|
25
25
|
[getLabel, restritcOperatorsTo]
|
|
26
26
|
);
|
|
27
|
-
return /* @__PURE__ */ jsxs(
|
|
27
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
28
28
|
/* @__PURE__ */ jsx(
|
|
29
29
|
RHFAutocomplete,
|
|
30
30
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs,
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useModuleDictionary } from "@m4l/core";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { S as SELECT_ASYNC_OPERATORS_MULTIPLE, c as SELECT_ASYNC_OPERATORS_SINGLE } from "../../../constants.js";
|
|
@@ -22,7 +22,7 @@ function SelectAsyncFilter() {
|
|
|
22
22
|
})).filter((o) => restritcOperatorsTo ? restritcOperatorsTo.includes(o.id) : true),
|
|
23
23
|
[getLabel, isMultiple, restritcOperatorsTo]
|
|
24
24
|
);
|
|
25
|
-
return /* @__PURE__ */ jsxs(
|
|
25
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
26
26
|
/* @__PURE__ */ jsx(
|
|
27
27
|
RHFAutocomplete,
|
|
28
28
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs,
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useModuleDictionary } from "@m4l/core";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { d as SELECT_OPERATORS_MULTIPLE, e as SELECT_OPERATORS_SINGLE } from "../../../constants.js";
|
|
@@ -19,7 +19,7 @@ function SelectFilter() {
|
|
|
19
19
|
})).filter((o) => restritcOperatorsTo ? restritcOperatorsTo.includes(o.id) : true),
|
|
20
20
|
[getLabel, isMultiple, restritcOperatorsTo]
|
|
21
21
|
);
|
|
22
|
-
return /* @__PURE__ */ jsxs(
|
|
22
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
23
23
|
/* @__PURE__ */ jsx(
|
|
24
24
|
RHFAutocomplete,
|
|
25
25
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs,
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useModuleDictionary } from "@m4l/core";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { f as STRING_OPERATORS } from "../../../constants.js";
|
|
@@ -17,7 +17,7 @@ function StringFilter() {
|
|
|
17
17
|
})).filter((o) => restritcOperatorsTo ? restritcOperatorsTo.includes(o.id) : true),
|
|
18
18
|
[getLabel, restritcOperatorsTo]
|
|
19
19
|
);
|
|
20
|
-
return /* @__PURE__ */ jsxs(
|
|
20
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
21
21
|
/* @__PURE__ */ jsx(
|
|
22
22
|
RHFAutocomplete,
|
|
23
23
|
{
|
|
@@ -16,7 +16,7 @@ function FilterActions() {
|
|
|
16
16
|
} = useFilterActions();
|
|
17
17
|
const { size, ownerState: { isDirty }, visibleRefresh } = useDynamicFilterBase();
|
|
18
18
|
const { getLabel } = useModuleDictionary();
|
|
19
|
-
return /* @__PURE__ */ jsxs(ActionsStyled, { ownerState: { isDirty: canShowRemoveAction, visibleRefresh
|
|
19
|
+
return /* @__PURE__ */ jsxs(ActionsStyled, { ownerState: { isDirty: canShowRemoveAction, visibleRefresh }, children: [
|
|
20
20
|
canShowRemoveAction && /* @__PURE__ */ jsx(
|
|
21
21
|
ActionsClearButtonStyled,
|
|
22
22
|
{
|
|
@@ -15,7 +15,6 @@ declare function useFilterActions(): {
|
|
|
15
15
|
filterButtonDictionaryTooltip: "dynamic_filter.filter_tooltip_refresh" | "dynamic_filter.filter_tooltip_dirty" | "dynamic_filter.filter_tooltip_invalid";
|
|
16
16
|
ownerState: {
|
|
17
17
|
isValid: boolean;
|
|
18
|
-
inEdition: boolean;
|
|
19
18
|
};
|
|
20
19
|
};
|
|
21
20
|
export default useFilterActions;
|
|
@@ -11,7 +11,6 @@ function useFilterActions() {
|
|
|
11
11
|
const automatic = useDynamicFilterStore((state) => state.automatic);
|
|
12
12
|
const isValid = useDynamicFilterStore((state) => state.ownerState?.isValid);
|
|
13
13
|
const isDirty = useDynamicFilterStore((state) => state.ownerState?.isDirty);
|
|
14
|
-
const inEdition = useDynamicFilterStore((state) => state.ownerState?.inEdition);
|
|
15
14
|
const appliedFilters = useDynamicFilterStore((state) => state.appliedFilters);
|
|
16
15
|
const { clearFilters, fireOnChangeFilters } = useDynamicFilterStore(
|
|
17
16
|
(state) => state.actions
|
|
@@ -30,7 +29,7 @@ function useFilterActions() {
|
|
|
30
29
|
onClickClearFilters,
|
|
31
30
|
onClickFilter: fireOnChangeFilters,
|
|
32
31
|
filterButtonDictionaryTooltip,
|
|
33
|
-
ownerState: { isValid
|
|
32
|
+
ownerState: { isValid }
|
|
34
33
|
};
|
|
35
34
|
}
|
|
36
35
|
export {
|