@m4l/components 9.2.60 → 9.2.62-B07072025beta.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 +8 -0
- package/components/AppBar/AppBar.js +12 -10
- package/components/AppBar/slots/AppBarEnum.d.ts +1 -5
- package/components/AppBar/slots/AppBarEnum.js +0 -4
- package/components/AppBar/slots/AppBarSlots.d.ts +4 -18
- package/components/AppBar/slots/AppBarSlots.js +3 -27
- package/components/AppBar/styles.js +0 -42
- package/components/AppBar/types.d.ts +8 -0
- package/components/Chip/Chip.js +9 -10
- package/components/Chip/ChipStyles.js +13 -2
- package/components/Chip/constants.d.ts +9 -0
- package/components/Chip/constants.js +6 -2
- package/components/Chip/slots/ChipEnum.d.ts +3 -0
- package/components/Chip/slots/ChipEnum.js +6 -1
- package/components/Chip/slots/ChipSlots.js +1 -1
- package/components/DataGrid/DataGrid.js +17 -3
- package/components/DataGrid/Datagrid.styles.js +80 -33
- 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 +7 -1
- package/components/DataGrid/slots/DataGridEnum.js +6 -0
- package/components/DataGrid/slots/DataGridSlot.d.ts +6 -0
- package/components/DataGrid/slots/DataGridSlot.js +35 -5
- 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/index.js +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 +99 -90
- package/components/DynamicFilter/slots/SlotsEnum.d.ts +0 -3
- package/components/DynamicFilter/slots/SlotsEnum.js +0 -3
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +0 -9
- package/components/DynamicFilter/slots/dynamicFilterSlots.js +3 -19
- package/components/DynamicFilter/store/DynamicFilterContext.js +67 -28
- 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 +1 -0
- package/components/DynamicFilter/subcomponents/FilterActions/useFilterActions.js +2 -1
- package/components/DynamicFilter/subcomponents/InputFilter/InputFilter.js +2 -0
- package/components/DynamicFilter/subcomponents/PopoverFilter/PopoverFilter.js +24 -18
- package/components/DynamicFilter/subcomponents/PopoverFilter/usePopoverFilter.d.ts +3 -3
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/PopoverMenuFields.js +4 -1
- package/components/DynamicFilter/types.d.ts +3 -0
- package/components/DynamicSort/DynamicSort.js +10 -6
- package/components/DynamicSort/DynamicSort.styles.js +92 -90
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts +0 -9
- package/components/DynamicSort/slots/DynamicSortSlots.js +7 -23
- package/components/DynamicSort/slots/SlotsEnum.d.ts +1 -4
- package/components/DynamicSort/slots/SlotsEnum.js +1 -4
- 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 +2 -0
- package/components/DynamicSort/subcomponents/PopoverSort/PopoverSort.js +22 -17
- package/components/DynamicSort/subcomponents/PopoverSort/usePopoverSort.d.ts +3 -3
- package/components/DynamicSort/subcomponents/SortActions/SortActions.js +2 -2
- package/components/DynamicSort/subcomponents/SortActions/useSortActions.d.ts +2 -0
- package/components/DynamicSort/subcomponents/SortActions/useSortActions.js +2 -1
- package/components/DynamicSort/types.d.ts +4 -0
- package/components/LanguagePopover/LanguagePopover.js +7 -5
- package/components/LanguagePopover/LanguagePopover.styles.js +32 -4
- package/components/LanguagePopover/slots/LanguagePopoverSlots.d.ts +9 -3
- package/components/LanguagePopover/slots/LanguagePopoverSlots.js +1 -3
- package/components/LanguagePopover/types.d.ts +6 -1
- package/components/LoadingError/slots/LoadingErrorSlots.js +1 -1
- package/components/PaperForm/styles.js +2 -1
- package/components/PropertyValue/PropertyValue.js +2 -1
- package/components/PropertyValue/PropertyValue.styles.js +7 -4
- package/components/PropertyValue/types.d.ts +4 -0
- package/components/SideBar/SideBar.js +8 -2
- package/components/SideBar/constants.d.ts +26 -2
- package/components/SideBar/constants.js +20 -10
- package/components/SideBar/context/sideBarContext/index.js +17 -4
- package/components/SideBar/context/sideBarContext/types.d.ts +14 -1
- package/components/SideBar/helpers/getMenuDataWithState/index.js +25 -8
- package/components/SideBar/hooks/useCollapse/index.d.ts +1 -0
- package/components/SideBar/hooks/useCollapse/index.js +1 -0
- package/components/SideBar/hooks/useCollapse/useCollapse.d.ts +11 -0
- package/components/SideBar/hooks/useCollapse/useCollapse.js +23 -0
- package/components/SideBar/slots/SideBarEnum.d.ts +11 -11
- package/components/SideBar/slots/SideBarEnum.js +13 -15
- package/components/SideBar/slots/SideBarSlots.d.ts +15 -9
- package/components/SideBar/slots/SideBarSlots.js +50 -39
- package/components/SideBar/styles.js +4 -6
- package/components/SideBar/subcomponents/ContentComponent/index.js +13 -49
- package/components/SideBar/subcomponents/ContentComponent/style.js +148 -23
- package/components/SideBar/subcomponents/{FooterSidebar → FooterComponent}/index.d.ts +2 -2
- package/components/SideBar/subcomponents/{FooterSidebar → FooterComponent}/index.js +8 -15
- package/components/SideBar/subcomponents/{FooterSidebar → FooterComponent}/styles.js +8 -2
- package/components/SideBar/subcomponents/FooterComponent/types.d.ts +5 -0
- package/components/SideBar/subcomponents/HeaderComponent/HeaderComponent.d.ts +5 -0
- package/components/SideBar/subcomponents/HeaderComponent/HeaderComponent.js +37 -0
- package/components/SideBar/subcomponents/HeaderComponent/index.d.ts +1 -0
- package/components/SideBar/subcomponents/HeaderComponent/index.js +1 -0
- package/components/SideBar/subcomponents/HeaderComponent/styles.d.ts +2 -0
- package/components/SideBar/subcomponents/HeaderComponent/styles.js +43 -0
- package/components/SideBar/subcomponents/SideBarDesktop/index.js +4 -3
- package/components/SideBar/subcomponents/SideBarDesktop/styles.js +3 -35
- package/components/SideBar/subcomponents/SideBarMobile/index.js +1 -1
- package/components/SideBar/subcomponents/TreeGroupItems/index.d.ts +5 -0
- package/components/SideBar/subcomponents/TreeGroupItems/index.js +51 -0
- package/components/SideBar/subcomponents/TreeGroupItems/styles.js +146 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/AdormentIcon.d.ts +7 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/AdormentIcon.js +12 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/types.d.ts +4 -0
- package/components/SideBar/subcomponents/{ContentGroups/subcomponents/ContainerMenuItemsMain → TreeGroupItems}/subcomponents/ArrowIcon/index.js +10 -7
- package/components/SideBar/subcomponents/{ContentGroups/subcomponents/ContainerMenuItemsMain → TreeGroupItems/subcomponents/NodeMenuItem}/index.d.ts +3 -3
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/index.js +70 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/types.d.ts +10 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/NodeMenuItemMain.d.ts +5 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/NodeMenuItemMain.js +61 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/index.d.ts +1 -0
- package/components/SideBar/subcomponents/TreeGroupItems/types.d.ts +4 -0
- package/components/SideBar/types.d.ts +17 -8
- package/components/WindowBase/WindowBase.js +7 -1
- package/components/WindowBase/WindowBase.styles.js +50 -15
- package/components/WindowBase/constants.d.ts +1 -0
- package/components/WindowBase/constants.js +5 -1
- package/components/WindowBase/slots/WindowBaseEnum.d.ts +2 -1
- package/components/WindowBase/slots/WindowBaseEnum.js +1 -0
- package/components/WindowBase/slots/WindowBaseSlots.d.ts +3 -0
- package/components/WindowBase/slots/WindowBaseSlots.js +6 -1
- package/components/WindowBase/subcomponents/Header/HeaderWindowBase.js +11 -5
- package/components/WindowBase/subcomponents/Header/types.d.ts +1 -1
- package/components/WindowBase/subcomponents/Header/useButtonActions.js +4 -2
- 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 +5 -0
- package/components/WindowBase/types.d.ts +16 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js +13 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useRightActions.js +26 -20
- package/components/areas/contexts/AreasContext/store.js +2 -2
- package/components/commercial/HamburgerMenu/HamburgerMenu.js +1 -2
- package/components/extended/React-Resizable/helpers.js +1 -1
- package/components/extended/React-resizable-panels/SplitLayout.js +6 -3
- package/components/extended/React-resizable-panels/SplitLayout.styles.js +78 -36
- package/components/extended/React-resizable-panels/constants.d.ts +6 -0
- package/components/extended/React-resizable-panels/constants.js +5 -1
- package/components/extended/React-resizable-panels/slots/SplitLayoutEnum.d.ts +2 -1
- package/components/extended/React-resizable-panels/slots/SplitLayoutEnum.js +1 -0
- package/components/extended/React-resizable-panels/slots/SplitLayoutSlots.d.ts +3 -0
- package/components/extended/React-resizable-panels/slots/SplitLayoutSlots.js +7 -1
- package/components/hook-form/RHFAutocomplete/RFHAutocompleteStyles.js +1 -1
- package/components/hook-form/RHFPeriod/subcomponents/Period/dictionary.js +5 -4
- package/components/hook-form/RHFTextField/RHFTextField.js +1 -0
- package/components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.styles.js +3 -38
- package/components/hook-form/RHFormContext/index.d.ts +1 -1
- package/components/mui_extended/Accordion/styles.js +10 -2
- package/components/mui_extended/Button/Button.js +3 -1
- package/components/mui_extended/Button/ButtonStyles.js +6 -1
- package/components/mui_extended/Button/types.d.ts +1 -1
- package/components/mui_extended/CheckBox/CheckBox.styles.js +2 -1
- package/components/mui_extended/Divider/index.d.ts +1 -0
- package/components/mui_extended/Divider/index.js +1 -0
- package/components/mui_extended/NavLink/NavLink.js +3 -1
- package/components/mui_extended/NavLink/NavLink.styles.js +2 -1
- package/components/mui_extended/NavLink/types.d.ts +3 -1
- package/components/mui_extended/Tab/Tab.styles.js +2 -1
- package/components/mui_extended/TabContent/TabContent.styles.js +2 -8
- package/components/mui_extended/TextField/TextField.js +1 -1
- package/components/mui_extended/TextField/TextField.styles.js +20 -18
- package/components/mui_extended/Typography/slots/typographySlots.d.ts +1 -1
- package/components/mui_extended/index.d.ts +1 -0
- 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 +1 -0
- package/index.js +23 -20
- package/package.json +5 -4
- 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 +27 -11
- package/storybook/components/DynamicSort/DynamicSort.stories.d.ts +26 -10
- package/storybook/components/SideBar/SideBar.stories.d.ts +5 -11
- package/storybook/components/SideBar/subcomponents/FooterComponentHost/FooterComponentHost.d.ts +4 -0
- package/storybook/components/SideBar/subcomponents/FooterComponentHost/constants.d.ts +3 -0
- package/storybook/components/SideBar/subcomponents/FooterComponentHost/index.d.ts +1 -0
- package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/FooterComponentMicrofrontend.d.ts +4 -0
- package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/FooterComponentMicrofrontend.stories.d.ts +14 -0
- package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/constants.d.ts +1 -0
- package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/index.d.ts +1 -0
- package/storybook/components/SideBar/subcomponents/HeaderComponentHost/HeaderComponentHost.d.ts +5 -0
- package/storybook/components/SideBar/subcomponents/HeaderComponentHost/constants.d.ts +1 -0
- package/storybook/components/SideBar/subcomponents/HeaderComponentMicrofrontend/HeaderComponentMicrofrontend.d.ts +5 -0
- package/storybook/components/SideBar/subcomponents/HeaderComponentMicrofrontend/constants.d.ts +1 -0
- package/storybook/components/extended/mui/IconButton/IconButton.stories.d.ts +1 -0
- package/storybook/components/extended/mui/TextField/TextFieldText.stories.d.ts +1 -0
- package/utils/index.d.ts +1 -0
- package/components/SideBar/subcomponents/ContentGroups/index.d.ts +0 -5
- package/components/SideBar/subcomponents/ContentGroups/index.js +0 -52
- package/components/SideBar/subcomponents/ContentGroups/styles.js +0 -71
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/index.js +0 -63
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/styles.d.ts +0 -2
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/styles.js +0 -47
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/types.d.ts +0 -7
- package/components/SideBar/subcomponents/ContentGroups/types.d.ts +0 -4
- package/components/SideBar/subcomponents/FooterSidebar/types.d.ts +0 -5
- package/components/SideBar/subcomponents/HeaderSidebar/index.d.ts +0 -6
- package/components/SideBar/subcomponents/HeaderSidebar/index.js +0 -25
- package/components/SideBar/subcomponents/HeaderSidebar/styles.d.ts +0 -2
- package/components/SideBar/subcomponents/HeaderSidebar/styles.js +0 -24
- package/components/SideBar/subcomponents/HeaderSidebar/types.d.ts +0 -5
- /package/components/SideBar/subcomponents/{FooterSidebar → FooterComponent}/styles.d.ts +0 -0
- /package/components/SideBar/subcomponents/{ContentGroups → TreeGroupItems}/styles.d.ts +0 -0
- /package/components/SideBar/subcomponents/{ContentGroups/subcomponents/ContainerMenuItemsMain → TreeGroupItems}/subcomponents/ArrowIcon/index.d.ts +0 -0
- /package/components/SideBar/subcomponents/{ContentGroups/subcomponents/ContainerMenuItemsMain → TreeGroupItems}/subcomponents/ArrowIcon/types.d.ts +0 -0
|
@@ -8,77 +8,106 @@ import { f as formatToRowSort } from "../helpers/formatToRowSort.js";
|
|
|
8
8
|
import { c as createDynamicSortStore } from "./DynamicSortStore.js";
|
|
9
9
|
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
10
10
|
const DynamicSortContext = createContext(null);
|
|
11
|
-
const DynamicSortProvider = forwardRef(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
initialAppliedSorts = [],
|
|
16
|
-
onChangeSorts,
|
|
17
|
-
dataTestId = "",
|
|
18
|
-
size = "medium",
|
|
19
|
-
storeId,
|
|
20
|
-
storeDevtoolsEnabled,
|
|
21
|
-
visibleRefresh = true,
|
|
22
|
-
children
|
|
23
|
-
} = props;
|
|
24
|
-
const { currentSize } = useComponentSize(size);
|
|
25
|
-
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
26
|
-
const { getLabel } = useModuleDictionary();
|
|
27
|
-
const dynamicSortStoreRef = useRef();
|
|
28
|
-
if (!dynamicSortStoreRef.current) {
|
|
29
|
-
dynamicSortStoreRef.current = createDynamicSortStore({
|
|
11
|
+
const DynamicSortProvider = forwardRef(
|
|
12
|
+
(props, ref) => {
|
|
13
|
+
const {
|
|
14
|
+
automatic = true,
|
|
30
15
|
fields,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
dataTestId,
|
|
34
|
-
size,
|
|
16
|
+
initialAppliedSorts = [],
|
|
17
|
+
onChangeSorts,
|
|
18
|
+
dataTestId = "",
|
|
19
|
+
size = "medium",
|
|
35
20
|
storeId,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
const state = dynamicSortStoreRef.current?.getState();
|
|
65
|
-
if (state) {
|
|
66
|
-
onChangeSorts?.(
|
|
67
|
-
formatToInitialSorts(state.appliedSorts),
|
|
68
|
-
formatToRowSort(state.appliedSorts)
|
|
21
|
+
storeDevtoolsEnabled,
|
|
22
|
+
visibleRefresh = true,
|
|
23
|
+
children
|
|
24
|
+
} = props;
|
|
25
|
+
const { currentSize } = useComponentSize(size);
|
|
26
|
+
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
27
|
+
const { getLabel } = useModuleDictionary();
|
|
28
|
+
const dynamicSortStoreRef = useRef();
|
|
29
|
+
if (!dynamicSortStoreRef.current) {
|
|
30
|
+
dynamicSortStoreRef.current = createDynamicSortStore(
|
|
31
|
+
{
|
|
32
|
+
fields,
|
|
33
|
+
automatic,
|
|
34
|
+
getLabel,
|
|
35
|
+
dataTestId,
|
|
36
|
+
size,
|
|
37
|
+
storeId,
|
|
38
|
+
visibleRefresh,
|
|
39
|
+
ownerState: {
|
|
40
|
+
isDirty: false,
|
|
41
|
+
inEdition: false,
|
|
42
|
+
isValid: true,
|
|
43
|
+
isEmpty: true,
|
|
44
|
+
size
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
storeDevtoolsEnabled
|
|
69
48
|
);
|
|
49
|
+
dynamicSortStoreRef.current.getState().actions.init(initialAppliedSorts);
|
|
70
50
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
dynamicSortStoreRef.current
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
51
|
+
const fireOnChangeSort = useStore(
|
|
52
|
+
dynamicSortStoreRef.current,
|
|
53
|
+
(state) => state.actions.fireOnChangeSorts,
|
|
54
|
+
shallow
|
|
55
|
+
);
|
|
56
|
+
const addExternalSort = useStore(
|
|
57
|
+
dynamicSortStoreRef.current,
|
|
58
|
+
(state) => state.actions.addExternalSort,
|
|
59
|
+
shallow
|
|
60
|
+
);
|
|
61
|
+
const removeExternalSort = useStore(
|
|
62
|
+
dynamicSortStoreRef.current,
|
|
63
|
+
(state) => state.actions.removeExternalSort,
|
|
64
|
+
shallow
|
|
65
|
+
);
|
|
66
|
+
const getNewId = useStore(
|
|
67
|
+
dynamicSortStoreRef.current,
|
|
68
|
+
(state) => state.actions.getNewId,
|
|
69
|
+
shallow
|
|
70
|
+
);
|
|
71
|
+
const getCurrentSorts = useStore(
|
|
72
|
+
dynamicSortStoreRef.current,
|
|
73
|
+
(state) => () => state.appliedSorts,
|
|
74
|
+
shallow
|
|
75
|
+
);
|
|
76
|
+
useImperativeHandle(ref, () => ({
|
|
77
|
+
fireOnChangeSort,
|
|
78
|
+
addExternalSort,
|
|
79
|
+
removeExternalSort,
|
|
80
|
+
getNewId,
|
|
81
|
+
getCurrentSorts
|
|
82
|
+
}));
|
|
83
|
+
const countOnChangeSortsApplyed = useStore(
|
|
84
|
+
dynamicSortStoreRef.current,
|
|
85
|
+
(state) => state.countOnChangeSortsApplyed,
|
|
86
|
+
shallow
|
|
87
|
+
);
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
if (countOnChangeSortsApplyed === 0) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const state = dynamicSortStoreRef.current?.getState();
|
|
93
|
+
if (state) {
|
|
94
|
+
onChangeSorts?.(
|
|
95
|
+
formatToInitialSorts(state.appliedSorts),
|
|
96
|
+
formatToRowSort(state.appliedSorts)
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
}, [countOnChangeSortsApplyed]);
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
if (dynamicSortStoreRef.current?.getState().size !== adjustedSize) {
|
|
102
|
+
dynamicSortStoreRef.current?.getState().actions.setSize(adjustedSize);
|
|
103
|
+
}
|
|
104
|
+
if (dynamicSortStoreRef.current?.getState().visibleRefresh !== visibleRefresh) {
|
|
105
|
+
dynamicSortStoreRef.current?.getState().actions.setVisibleRefresh(visibleRefresh);
|
|
106
|
+
}
|
|
107
|
+
}, [adjustedSize, visibleRefresh]);
|
|
108
|
+
return /* @__PURE__ */ jsx(DynamicSortContext.Provider, { value: dynamicSortStoreRef.current, children });
|
|
109
|
+
}
|
|
110
|
+
);
|
|
82
111
|
export {
|
|
83
112
|
DynamicSortProvider as D,
|
|
84
113
|
DynamicSortContext as a
|
|
@@ -9,7 +9,9 @@ const updateAvailableFields = (state) => {
|
|
|
9
9
|
let add;
|
|
10
10
|
const field = state.fields[index];
|
|
11
11
|
add = true;
|
|
12
|
-
const fIndx = state.appliedSorts.findIndex(
|
|
12
|
+
const fIndx = state.appliedSorts.findIndex(
|
|
13
|
+
(f) => f.field.name === field.name
|
|
14
|
+
);
|
|
13
15
|
if (fIndx > -1) {
|
|
14
16
|
add = false;
|
|
15
17
|
}
|
|
@@ -100,7 +102,26 @@ const createDynamicSortStore = (initProps, storeDevtoolsEnabled = false) => {
|
|
|
100
102
|
*/
|
|
101
103
|
removeSort: (id) => {
|
|
102
104
|
set((state) => {
|
|
103
|
-
const index_to_remove = state.appliedSorts.findIndex(
|
|
105
|
+
const index_to_remove = state.appliedSorts.findIndex(
|
|
106
|
+
(f) => id === f.id && !f.fixed
|
|
107
|
+
);
|
|
108
|
+
if (index_to_remove > -1) {
|
|
109
|
+
state.appliedSorts.splice(index_to_remove, 1);
|
|
110
|
+
updateAutomatic(state);
|
|
111
|
+
if (state.appliedSorts.length === 0) {
|
|
112
|
+
state.ownerState.isDirty = false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
},
|
|
117
|
+
/**
|
|
118
|
+
* Elimina un campo sort por el nombre de la columna
|
|
119
|
+
*/
|
|
120
|
+
removeExternalSort: (columnName) => {
|
|
121
|
+
set((state) => {
|
|
122
|
+
const index_to_remove = state.appliedSorts.findIndex(
|
|
123
|
+
(f) => f.field.name === columnName && !f.fixed
|
|
124
|
+
);
|
|
104
125
|
if (index_to_remove > -1) {
|
|
105
126
|
state.appliedSorts.splice(index_to_remove, 1);
|
|
106
127
|
updateAutomatic(state);
|
|
@@ -186,12 +207,37 @@ const createDynamicSortStore = (initProps, storeDevtoolsEnabled = false) => {
|
|
|
186
207
|
updateAutomatic(state);
|
|
187
208
|
});
|
|
188
209
|
},
|
|
210
|
+
/**
|
|
211
|
+
* Agrega un nuevo campo/atributo por el cual se va aplicar el sort externo
|
|
212
|
+
*/
|
|
213
|
+
addExternalSort: (newSort) => {
|
|
214
|
+
set((state) => {
|
|
215
|
+
const existingIndex = state.appliedSorts.findIndex(
|
|
216
|
+
(sort) => sort.field.name === newSort.field.name
|
|
217
|
+
);
|
|
218
|
+
if (existingIndex > -1) {
|
|
219
|
+
const existingSort = state.appliedSorts[existingIndex];
|
|
220
|
+
state.appliedSorts[existingIndex] = {
|
|
221
|
+
...newSort,
|
|
222
|
+
id: existingSort.id
|
|
223
|
+
};
|
|
224
|
+
} else {
|
|
225
|
+
if (!state.automatic) {
|
|
226
|
+
state.ownerState.isDirty = true;
|
|
227
|
+
}
|
|
228
|
+
state.appliedSorts.push(newSort);
|
|
229
|
+
}
|
|
230
|
+
updateAutomatic(state);
|
|
231
|
+
});
|
|
232
|
+
},
|
|
189
233
|
/**
|
|
190
234
|
* Actualiza un sort existente
|
|
191
235
|
*/
|
|
192
236
|
updateSort: (editSort) => {
|
|
193
237
|
set((state) => {
|
|
194
|
-
const index = state.appliedSorts.findIndex(
|
|
238
|
+
const index = state.appliedSorts.findIndex(
|
|
239
|
+
(ap) => ap.id === editSort.id
|
|
240
|
+
);
|
|
195
241
|
if (index > -1) {
|
|
196
242
|
state.appliedSorts[index] = editSort;
|
|
197
243
|
}
|
|
@@ -251,7 +297,10 @@ const createDynamicSortStore = (initProps, storeDevtoolsEnabled = false) => {
|
|
|
251
297
|
}
|
|
252
298
|
}
|
|
253
299
|
})),
|
|
254
|
-
{
|
|
300
|
+
{
|
|
301
|
+
name: `${DYNAMIC_SORT_STORE_ID}: ${initProps.storeId}`,
|
|
302
|
+
enabled: storeDevtoolsEnabled
|
|
303
|
+
}
|
|
255
304
|
)
|
|
256
305
|
);
|
|
257
306
|
};
|
|
@@ -98,6 +98,11 @@ export interface DynamicSortStateWithActions extends DynamicSortState {
|
|
|
98
98
|
* @param id //identificador unico de un sort
|
|
99
99
|
*/
|
|
100
100
|
removeSort: (id: number) => void;
|
|
101
|
+
/**
|
|
102
|
+
* remueve un sort externo por nombre de columna (para uso desde DataGrid)
|
|
103
|
+
* @param columnName nombre de la columna
|
|
104
|
+
*/
|
|
105
|
+
removeExternalSort: (columnName: string) => void;
|
|
101
106
|
/**
|
|
102
107
|
*
|
|
103
108
|
* @param anchorEl Elemento de donde va emerger el popup
|
|
@@ -136,6 +141,12 @@ export interface DynamicSortStateWithActions extends DynamicSortState {
|
|
|
136
141
|
* @returns
|
|
137
142
|
*/
|
|
138
143
|
addSort: (newSort: SortFieldApplied) => void;
|
|
144
|
+
/**
|
|
145
|
+
* Agrega un sort externo a los sorts aplicados (applyedFilters)
|
|
146
|
+
* @param newSort Sort a agregar
|
|
147
|
+
* @returns
|
|
148
|
+
*/
|
|
149
|
+
addExternalSort: (newSort: SortFieldApplied) => void;
|
|
139
150
|
/**
|
|
140
151
|
* Modifica un sort que se encuentra en applyedFilters
|
|
141
152
|
* @param sortToEdit sort a editar
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { S as SORT_ICONS } from "../../../icons.js";
|
|
@@ -25,7 +25,7 @@ function StringSort() {
|
|
|
25
25
|
],
|
|
26
26
|
[getLabel, host_static_assets, environment_assets]
|
|
27
27
|
);
|
|
28
|
-
return /* @__PURE__ */ jsx(
|
|
28
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
29
29
|
RHFSelect,
|
|
30
30
|
{
|
|
31
31
|
size,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { I as Icon } from "../../../Icon/Icon.js";
|
|
3
2
|
import { u as useDynamicSortBase } from "../DynamicSortBase/useDynamicSortBase.js";
|
|
4
3
|
import { D as DataTypeComponent } from "../FieldTypes/DataTypeComponent.js";
|
|
5
4
|
import { u as usePopoverSort } from "./usePopoverSort.js";
|
|
6
|
-
import { e as PopoverStyled, f as
|
|
5
|
+
import { e as PopoverStyled, f as PopoverContainerFieldsStyled, g as PopoverHeaderActionsStyled } from "../../slots/DynamicSortSlots.js";
|
|
7
6
|
import { R as RHFormProvider } from "../../../hook-form/RHFormContext/index.js";
|
|
7
|
+
import { W as WindowBase } from "../../../WindowBase/WindowBase.js";
|
|
8
8
|
import { A as ActionCancel } from "../../../CommonActions/components/ActionCancel/ActionCancel.js";
|
|
9
9
|
import { A as ActionIntro } from "../../../CommonActions/components/ActionIntro/ActionIntro.js";
|
|
10
10
|
function PopoverSort() {
|
|
@@ -22,7 +22,7 @@ function PopoverSort() {
|
|
|
22
22
|
statusLoad,
|
|
23
23
|
canRender
|
|
24
24
|
} = usePopoverSort();
|
|
25
|
-
const {
|
|
25
|
+
const { size } = useDynamicSortBase();
|
|
26
26
|
if (!canRender) {
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
@@ -38,26 +38,31 @@ function PopoverSort() {
|
|
|
38
38
|
anchorEl,
|
|
39
39
|
onKeyDown: handleKeyDownPopper,
|
|
40
40
|
onClose: handleClosePopover,
|
|
41
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ jsx(
|
|
42
42
|
RHFormProvider,
|
|
43
43
|
{
|
|
44
44
|
onSubmit,
|
|
45
45
|
values: sortFormValue,
|
|
46
46
|
validationSchema: popupValidationSchema,
|
|
47
47
|
statusLoad,
|
|
48
|
-
children:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
children: /* @__PURE__ */ jsxs(
|
|
49
|
+
WindowBase,
|
|
50
|
+
{
|
|
51
|
+
title: labelField,
|
|
52
|
+
iconUrl: field.urlIcon,
|
|
53
|
+
variant: "text",
|
|
54
|
+
type: "popup",
|
|
55
|
+
selected: true,
|
|
56
|
+
draggable: false,
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ jsx(PopoverContainerFieldsStyled, { children: /* @__PURE__ */ jsx(DataTypeComponent, { formSort, statusLoad }) }),
|
|
59
|
+
/* @__PURE__ */ jsxs(PopoverHeaderActionsStyled, { children: [
|
|
60
|
+
/* @__PURE__ */ jsx(ActionCancel, { size, onClick: onClose }),
|
|
61
|
+
/* @__PURE__ */ jsx(ActionIntro, { size, "aria-label": "applySort" })
|
|
62
|
+
] })
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
)
|
|
61
66
|
}
|
|
62
67
|
)
|
|
63
68
|
}
|
|
@@ -17,11 +17,11 @@ declare function usePopoverSort(): {
|
|
|
17
17
|
sortFormValue: import('../../types').FormSortValueBase;
|
|
18
18
|
formSort: FormSortFieldApplied;
|
|
19
19
|
popupValidationSchema: import('yup').ArraySchema<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown> | import('yup/lib/Lazy').default<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown>, import('yup/lib/object').AnyObject>, import('yup/lib/types').AnyObject, unknown[] | undefined, unknown[] | undefined> | import('yup').BaseSchema<any, import('yup/lib/object').AnyObject, any> | import('yup').ObjectSchema<{
|
|
20
|
-
[x: string]: import('yup').ObjectSchema
|
|
20
|
+
[x: string]: import('yup').ObjectSchema</*elided*/ any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape</*elided*/ any>, import('yup/lib/object').AssertsShape</*elided*/ any>> | import('yup').BaseSchema<any, import('yup/lib/object').AnyObject, any> | import('yup').ArraySchema<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown> | import('yup/lib/Lazy').default<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown>, import('yup/lib/object').AnyObject>, import('yup/lib/types').AnyObject, unknown[] | undefined, unknown[] | undefined> | import('yup/lib/Lazy').default<import('yup').ObjectSchema</*elided*/ any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape</*elided*/ any>, import('yup/lib/object').AssertsShape</*elided*/ any>>, any>;
|
|
21
21
|
}, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape<{
|
|
22
|
-
[x: string]: import('yup').ObjectSchema
|
|
22
|
+
[x: string]: import('yup').ObjectSchema</*elided*/ any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape</*elided*/ any>, import('yup/lib/object').AssertsShape</*elided*/ any>> | import('yup').BaseSchema<any, import('yup/lib/object').AnyObject, any> | import('yup').ArraySchema<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown> | import('yup/lib/Lazy').default<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown>, import('yup/lib/object').AnyObject>, import('yup/lib/types').AnyObject, unknown[] | undefined, unknown[] | undefined> | import('yup/lib/Lazy').default<import('yup').ObjectSchema</*elided*/ any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape</*elided*/ any>, import('yup/lib/object').AssertsShape</*elided*/ any>>, any>;
|
|
23
23
|
}>, import('yup/lib/object').AssertsShape<{
|
|
24
|
-
[x: string]: import('yup').ObjectSchema
|
|
24
|
+
[x: string]: import('yup').ObjectSchema</*elided*/ any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape</*elided*/ any>, import('yup/lib/object').AssertsShape</*elided*/ any>> | import('yup').BaseSchema<any, import('yup/lib/object').AnyObject, any> | import('yup').ArraySchema<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown> | import('yup/lib/Lazy').default<import('yup').BaseSchema<unknown, import('yup/lib/object').AnyObject, unknown>, import('yup/lib/object').AnyObject>, import('yup/lib/types').AnyObject, unknown[] | undefined, unknown[] | undefined> | import('yup/lib/Lazy').default<import('yup').ObjectSchema</*elided*/ any, import('yup/lib/object').AnyObject, import('yup/lib/object').TypeOfShape</*elided*/ any>, import('yup/lib/object').AssertsShape</*elided*/ any>>, any>;
|
|
25
25
|
}>> | undefined;
|
|
26
26
|
statusLoad: "initial" | "reload_values_provider" | "ready";
|
|
27
27
|
};
|
|
@@ -3,7 +3,7 @@ import { useModuleDictionary } from "@m4l/core";
|
|
|
3
3
|
import { g as getDynamicSortDictionary, D as DICCTIONARY } from "../../dictionary.js";
|
|
4
4
|
import { u as useDynamicSortBase } from "../DynamicSortBase/useDynamicSortBase.js";
|
|
5
5
|
import { u as useSortActions } from "./useSortActions.js";
|
|
6
|
-
import {
|
|
6
|
+
import { h as ActionsStyled, i as ActionsClearButtonStyled, j as ActionsSubmitButtonStyled } from "../../slots/DynamicSortSlots.js";
|
|
7
7
|
function SortActions() {
|
|
8
8
|
const {
|
|
9
9
|
sortIconUrl,
|
|
@@ -16,7 +16,7 @@ function SortActions() {
|
|
|
16
16
|
} = useSortActions();
|
|
17
17
|
const { size, visibleRefresh, ownerState: { isDirty } } = useDynamicSortBase();
|
|
18
18
|
const { getLabel } = useModuleDictionary();
|
|
19
|
-
return /* @__PURE__ */ jsxs(ActionsStyled, { ownerState: { isDirty: canShowRemoveAction, visibleRefresh }, children: [
|
|
19
|
+
return /* @__PURE__ */ jsxs(ActionsStyled, { ownerState: { ...ownerState, isDirty: canShowRemoveAction, visibleRefresh }, children: [
|
|
20
20
|
canShowRemoveAction && /* @__PURE__ */ jsx(
|
|
21
21
|
ActionsClearButtonStyled,
|
|
22
22
|
{
|
|
@@ -9,6 +9,7 @@ function useSortActions() {
|
|
|
9
9
|
const isValid = useDynamicSortStore((state) => state.ownerState?.isValid);
|
|
10
10
|
const isDirty = useDynamicSortStore((state) => state.ownerState?.isDirty);
|
|
11
11
|
const appliedSorts = useDynamicSortStore((state) => state.appliedSorts);
|
|
12
|
+
const inEdition = useDynamicSortStore((state) => state.ownerState?.inEdition);
|
|
12
13
|
const { hidePopoverSort, clearSorts, fireOnChangeSorts } = useDynamicSortStore(
|
|
13
14
|
(state) => state.actions
|
|
14
15
|
);
|
|
@@ -31,7 +32,7 @@ function useSortActions() {
|
|
|
31
32
|
onClickClearSorts,
|
|
32
33
|
onClickSort: fireOnChangeSorts,
|
|
33
34
|
sortButtonDictionaryTooltip,
|
|
34
|
-
ownerState: { isValid }
|
|
35
|
+
ownerState: { isValid, isDirty, inEdition }
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
38
|
export {
|
|
@@ -175,4 +175,8 @@ export type DynamicSortSlotsType = keyof typeof DynamicSortSlots;
|
|
|
175
175
|
export type DynamicSortStyles = M4LOverridesStyleRules<DynamicSortSlotsType, typeof DYNAMIC_SORT_KEY_COMPONENT, Theme>;
|
|
176
176
|
export interface DynamicSortRef {
|
|
177
177
|
fireOnChangeSort: () => void;
|
|
178
|
+
addExternalSort: (newSort: SortFieldApplied) => void;
|
|
179
|
+
removeExternalSort: (columnKey: string) => void;
|
|
180
|
+
getNewId: () => number;
|
|
181
|
+
getCurrentSorts: () => SortFieldApplied[];
|
|
178
182
|
}
|
|
@@ -5,17 +5,16 @@ import { useEnvironment, useNetwork } from "@m4l/core";
|
|
|
5
5
|
import { g as getPropDataTestId } from "../../test/getNameDataTestId.js";
|
|
6
6
|
import { a as getComponentSlotRoot } from "../../utils/getComponentSlotRoot.js";
|
|
7
7
|
import { I as Image } from "../Image/Image.js";
|
|
8
|
-
import { L as LanguagePopoverRootStyled, P as PaperStyled
|
|
8
|
+
import { L as LanguagePopoverRootStyled, P as PaperStyled } from "./slots/LanguagePopoverSlots.js";
|
|
9
9
|
import { L as LANGUAGE_POPOVER_KEY_COMPONENT } from "./constants.js";
|
|
10
10
|
import { L as LanguagePopoverSlots } from "./slots/LanguagePopoverEnum.js";
|
|
11
11
|
import { u as useComponentSize } from "../../hooks/useComponentSize/useComponentSize.js";
|
|
12
12
|
function LanguagePopover(props) {
|
|
13
13
|
const {
|
|
14
14
|
disabled,
|
|
15
|
-
size
|
|
15
|
+
size
|
|
16
16
|
} = props;
|
|
17
17
|
const { currentSize } = useComponentSize(size);
|
|
18
|
-
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
19
18
|
const isFirstRender = useFirstRender();
|
|
20
19
|
const { currentLocale, onChangeLocale } = useLocales();
|
|
21
20
|
const { domain_token } = useEnvironment();
|
|
@@ -68,11 +67,14 @@ function LanguagePopover(props) {
|
|
|
68
67
|
return /* @__PURE__ */ jsx(
|
|
69
68
|
LanguagePopoverRootStyled,
|
|
70
69
|
{
|
|
71
|
-
|
|
70
|
+
ownerState: {
|
|
71
|
+
size: currentSize
|
|
72
|
+
},
|
|
73
|
+
size: currentSize,
|
|
72
74
|
className: classRoot,
|
|
73
75
|
...getPropDataTestId(LANGUAGE_POPOVER_KEY_COMPONENT, LanguagePopoverSlots.root),
|
|
74
76
|
disabled,
|
|
75
|
-
icon: /* @__PURE__ */ jsx(
|
|
77
|
+
icon: /* @__PURE__ */ jsx(Image, { src: currentLocale?.urlIcon, enableIntersectionObserver: false }),
|
|
76
78
|
menuActions: getMenuActionsOptions(),
|
|
77
79
|
onOpen: handleMenuOpenChange,
|
|
78
80
|
slots: {
|
|
@@ -1,8 +1,36 @@
|
|
|
1
|
+
import { g as getSizeStyles } from "../../utils/getSizeStyles/getSizeStyles.js";
|
|
1
2
|
const languagePopoverStyles = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
3
|
+
/**
|
|
4
|
+
* Estilos del root
|
|
5
|
+
*/
|
|
6
|
+
root: ({ theme, ownerState }) => ({
|
|
7
|
+
"&": {
|
|
8
|
+
display: "flex",
|
|
9
|
+
justifyContent: "center",
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
...getSizeStyles(
|
|
12
|
+
theme,
|
|
13
|
+
ownerState?.size || "medium",
|
|
14
|
+
"action",
|
|
15
|
+
(size) => ({
|
|
16
|
+
width: size,
|
|
17
|
+
height: size
|
|
18
|
+
})
|
|
19
|
+
),
|
|
20
|
+
"& .MuiButtonBase-root .M4LImage-root": {
|
|
21
|
+
...getSizeStyles(
|
|
22
|
+
theme,
|
|
23
|
+
ownerState?.size || "medium",
|
|
24
|
+
"base",
|
|
25
|
+
(size) => ({
|
|
26
|
+
width: `${size}!important`,
|
|
27
|
+
height: `${size}!important`
|
|
28
|
+
})
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}),
|
|
33
|
+
image: {},
|
|
6
34
|
/**
|
|
7
35
|
* Estilos del paper
|
|
8
36
|
*/
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
export declare const LanguagePopoverRootStyled: import('@emotion/styled').StyledComponent<Pick<import('../../MenuActions/types').MenuActionsProps, keyof import('../../MenuActions/types').MenuActionsProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown
|
|
2
|
-
|
|
1
|
+
export declare const LanguagePopoverRootStyled: import('@emotion/styled').StyledComponent<Pick<import('../../MenuActions/types').MenuActionsProps, keyof import('../../MenuActions/types').MenuActionsProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
2
|
+
ownerState?: (Partial<import('..').LanguagePopoverOwnerState> & Record<string, unknown>) | undefined;
|
|
3
|
+
}, {}, {}>;
|
|
4
|
+
export declare const ImageStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
5
|
+
ownerState?: (Partial<import('..').LanguagePopoverOwnerState> & Record<string, unknown>) | undefined;
|
|
6
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
3
7
|
export declare const PaperStyled: import('@emotion/styled').StyledComponent<Pick<import('@mui/material').PaperOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
4
8
|
ref?: ((instance: HTMLDivElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLDivElement> | null | undefined;
|
|
5
|
-
}, "children" | "style" | "square" | "variant" | "className" | "classes" | "sx" | "elevation">, "children" | "ref" | "title" | "id" | "hidden" | "color" | "content" | "style" | "square" | "variant" | "translate" | "className" | "classes" | "sx" | "slot" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "elevation"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown
|
|
9
|
+
}, "children" | "style" | "square" | "variant" | "className" | "classes" | "sx" | "elevation">, "children" | "ref" | "title" | "id" | "hidden" | "color" | "content" | "style" | "square" | "variant" | "translate" | "className" | "classes" | "sx" | "slot" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "elevation"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
|
|
10
|
+
ownerState?: (Partial<import('..').LanguagePopoverOwnerState> & Record<string, unknown>) | undefined;
|
|
11
|
+
}, {}, {}>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { styled } from "@mui/material/styles";
|
|
2
|
-
import { I as Image } from "../../Image/Image.js";
|
|
3
2
|
import { M as MenuActions } from "../../MenuActions/MenuActions.js";
|
|
4
3
|
import { L as LANGUAGE_POPOVER_KEY_COMPONENT } from "../constants.js";
|
|
5
4
|
import { l as languagePopoverStyles } from "../LanguagePopover.styles.js";
|
|
@@ -9,7 +8,7 @@ const LanguagePopoverRootStyled = styled(MenuActions, {
|
|
|
9
8
|
name: LANGUAGE_POPOVER_KEY_COMPONENT,
|
|
10
9
|
slot: LanguagePopoverSlots.root
|
|
11
10
|
})(languagePopoverStyles.root);
|
|
12
|
-
|
|
11
|
+
styled("div", {
|
|
13
12
|
name: LANGUAGE_POPOVER_KEY_COMPONENT,
|
|
14
13
|
slot: LanguagePopoverSlots.image
|
|
15
14
|
})(languagePopoverStyles.image);
|
|
@@ -18,7 +17,6 @@ const PaperStyled = styled(Paper, {
|
|
|
18
17
|
slot: LanguagePopoverSlots.paper
|
|
19
18
|
})(languagePopoverStyles.paper);
|
|
20
19
|
export {
|
|
21
|
-
ImageStyled as I,
|
|
22
20
|
LanguagePopoverRootStyled as L,
|
|
23
21
|
PaperStyled as P
|
|
24
22
|
};
|
|
@@ -17,4 +17,9 @@ export interface LanguagePopoverProps {
|
|
|
17
17
|
*/
|
|
18
18
|
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
19
19
|
}
|
|
20
|
-
export type
|
|
20
|
+
export type LanguagePopoverSlotsType = keyof typeof Slots;
|
|
21
|
+
export interface LanguagePopoverOwnerState {
|
|
22
|
+
size: LanguagePopoverProps['size'];
|
|
23
|
+
image?: string;
|
|
24
|
+
}
|
|
25
|
+
export type LanguagePopoverStyles = M4LOverridesStyleRules<LanguagePopoverSlotsType, typeof LANGUAGE_POPOVER_KEY_COMPONENT, Theme>;
|