@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
|
@@ -1,29 +1,38 @@
|
|
|
1
1
|
import { g as getMenuActionsComponentsDictionary } from "../MenuActions/dictionary.js";
|
|
2
2
|
import { g as getModalDictionary } from "../ModalDialog/dictionary.js";
|
|
3
3
|
import { g as getPagerComponentsDictionary } from "../Pager/dicctionary.js";
|
|
4
|
+
import { c as DATAGRID_ID_DICTIONARY } from "./constants.js";
|
|
4
5
|
const DATAGRID_DICTIONARY_ID = "data_grid";
|
|
5
6
|
function getDataGridComponentsDictionary() {
|
|
6
7
|
return [DATAGRID_DICTIONARY_ID].concat(getPagerComponentsDictionary()).concat(getMenuActionsComponentsDictionary()).concat(getModalDictionary());
|
|
7
8
|
}
|
|
8
9
|
const DICTIONARY = {
|
|
9
10
|
DENSITY_COMPACT: `${DATAGRID_DICTIONARY_ID}.density_compact`,
|
|
10
|
-
DENSITY_STANDARD: `${
|
|
11
|
-
DENSITY_CONFORTABLE: `${
|
|
12
|
-
DENSITY_TOOLTIP: `${
|
|
13
|
-
TOOLTIP_FILTER_HIDE: `${
|
|
14
|
-
TOOLTIP_FILTER_SHOW: `${
|
|
15
|
-
SETTINGS_COLUMN_NAME: `${
|
|
16
|
-
SETTINGS_COLUMN_POSITION: `${
|
|
17
|
-
SETTINGS_COLUMN_VISIBLE: `${
|
|
18
|
-
SETTINGS_COLUMNS_FROZEN: `${
|
|
19
|
-
SETTINGS_SEL_COLUMNS: `${
|
|
20
|
-
SETTINGS_MOVE_FIRST: `${
|
|
21
|
-
SETTINGS_MOVE_UP: `${
|
|
22
|
-
SETTINGS_MOVE_LAST: `${
|
|
23
|
-
SETTINGS_MOVE_DOWN: `${
|
|
24
|
-
SETTINGS_VISIBLE_ALL: `${
|
|
25
|
-
SETTINGS_NO_VISIBLE_ALL: `${
|
|
26
|
-
SETTINGS_RESTORE: `${
|
|
11
|
+
DENSITY_STANDARD: `${DATAGRID_ID_DICTIONARY}.density_standard`,
|
|
12
|
+
DENSITY_CONFORTABLE: `${DATAGRID_ID_DICTIONARY}.density_confortable`,
|
|
13
|
+
DENSITY_TOOLTIP: `${DATAGRID_ID_DICTIONARY}.tooltip_density`,
|
|
14
|
+
TOOLTIP_FILTER_HIDE: `${DATAGRID_ID_DICTIONARY}.tooltip_filter_hide`,
|
|
15
|
+
TOOLTIP_FILTER_SHOW: `${DATAGRID_ID_DICTIONARY}.tooltip_filter_show`,
|
|
16
|
+
SETTINGS_COLUMN_NAME: `${DATAGRID_ID_DICTIONARY}.settings_column_name`,
|
|
17
|
+
SETTINGS_COLUMN_POSITION: `${DATAGRID_ID_DICTIONARY}.settings_column_position`,
|
|
18
|
+
SETTINGS_COLUMN_VISIBLE: `${DATAGRID_ID_DICTIONARY}.settings_column_visible`,
|
|
19
|
+
SETTINGS_COLUMNS_FROZEN: `${DATAGRID_ID_DICTIONARY}.settings_column_frozen`,
|
|
20
|
+
SETTINGS_SEL_COLUMNS: `${DATAGRID_ID_DICTIONARY}.settings_sel_columns`,
|
|
21
|
+
SETTINGS_MOVE_FIRST: `${DATAGRID_ID_DICTIONARY}.settings_move_first`,
|
|
22
|
+
SETTINGS_MOVE_UP: `${DATAGRID_ID_DICTIONARY}.settings_move_up`,
|
|
23
|
+
SETTINGS_MOVE_LAST: `${DATAGRID_ID_DICTIONARY}.settings_move_last`,
|
|
24
|
+
SETTINGS_MOVE_DOWN: `${DATAGRID_ID_DICTIONARY}.settings_move_down`,
|
|
25
|
+
SETTINGS_VISIBLE_ALL: `${DATAGRID_ID_DICTIONARY}.settings_visible_all`,
|
|
26
|
+
SETTINGS_NO_VISIBLE_ALL: `${DATAGRID_ID_DICTIONARY}.settings_no_visible_all`,
|
|
27
|
+
SETTINGS_RESTORE: `${DATAGRID_ID_DICTIONARY}.settings_restore`,
|
|
28
|
+
NO_ACTIONS_LABEL: `${DATAGRID_ID_DICTIONARY}.no_actions_label`,
|
|
29
|
+
ORDER_ASC_COLUMN: `${DATAGRID_ID_DICTIONARY}.order_asc_column`,
|
|
30
|
+
ORDER_DESC_COLUMN: `${DATAGRID_ID_DICTIONARY}.order_desc_column`,
|
|
31
|
+
REMOVE_ORDER_COLUMN: `${DATAGRID_ID_DICTIONARY}.remove_order_column`,
|
|
32
|
+
FREEZE_COLUMN: `${DATAGRID_ID_DICTIONARY}.freeze_column`,
|
|
33
|
+
UNFREEZE_COLUMN: `${DATAGRID_ID_DICTIONARY}.unfreeze_column`,
|
|
34
|
+
HIDE_COLUMN: `${DATAGRID_ID_DICTIONARY}.hide_column`,
|
|
35
|
+
ADD_FILTER_COLUMN: `${DATAGRID_ID_DICTIONARY}.add_filter`
|
|
27
36
|
};
|
|
28
37
|
export {
|
|
29
38
|
DICTIONARY as D,
|
|
@@ -13,4 +13,11 @@ export declare const pathIcons: {
|
|
|
13
13
|
uncheckAll: string;
|
|
14
14
|
restoreColumns: string;
|
|
15
15
|
search: string;
|
|
16
|
+
sortAsc: string;
|
|
17
|
+
sortDesc: string;
|
|
18
|
+
filter2: string;
|
|
19
|
+
removeSort: string;
|
|
20
|
+
freezeColumn: string;
|
|
21
|
+
unfreezeColumn: string;
|
|
22
|
+
hideColumn: string;
|
|
16
23
|
};
|
|
@@ -12,7 +12,14 @@ const pathIcons = {
|
|
|
12
12
|
checkAll: "frontend/components/data_grid/assets/icons/check_all.svg",
|
|
13
13
|
uncheckAll: "frontend/components/data_grid/assets/icons/uncheck_all.svg",
|
|
14
14
|
restoreColumns: "frontend/components/data_grid/assets/icons/restore_columns.svg",
|
|
15
|
-
search: "frontend/components/data_grid/assets/icons/search.svg"
|
|
15
|
+
search: "frontend/components/data_grid/assets/icons/search.svg",
|
|
16
|
+
sortAsc: "frontend/components/data_grid/assets/icons/sort_asc.svg",
|
|
17
|
+
sortDesc: "frontend/components/data_grid/assets/icons/sort_desc.svg",
|
|
18
|
+
filter2: "frontend/components/data_grid/assets/icons/filter.svg",
|
|
19
|
+
removeSort: "frontend/components/data_grid/assets/icons/eraser.svg",
|
|
20
|
+
freezeColumn: "frontend/components/data_grid/assets/icons/pin.svg",
|
|
21
|
+
unfreezeColumn: "frontend/components/data_grid/assets/icons/pin-off.svg",
|
|
22
|
+
hideColumn: "frontend/components/data_grid/assets/icons/eye-off.svg"
|
|
16
23
|
};
|
|
17
24
|
export {
|
|
18
25
|
pathIcons as p
|
|
@@ -21,7 +21,11 @@ export declare enum TableSlots {
|
|
|
21
21
|
draggableWrapperInputBase = "draggableWrapperInputBase",
|
|
22
22
|
headerInputBase = "headerInputBase",
|
|
23
23
|
wrapperSkeleton = "wrapperSkeleton",
|
|
24
|
-
contentModalSetting = "contentModalSetting"
|
|
24
|
+
contentModalSetting = "contentModalSetting",
|
|
25
|
+
headerRenderClick = "headerRenderClick",
|
|
26
|
+
menuList = "menuList",
|
|
27
|
+
buttonHeaderActions = "buttonHeaderActions",
|
|
28
|
+
nameColumnIcon = "nameColumnIcon"
|
|
25
29
|
}
|
|
26
30
|
export declare enum TextEditorSlots {
|
|
27
31
|
inputTexEditor = "inputTexEditor"
|
|
@@ -25,6 +25,10 @@ var TableSlots = /* @__PURE__ */ ((TableSlots2) => {
|
|
|
25
25
|
TableSlots2["headerInputBase"] = "headerInputBase";
|
|
26
26
|
TableSlots2["wrapperSkeleton"] = "wrapperSkeleton";
|
|
27
27
|
TableSlots2["contentModalSetting"] = "contentModalSetting";
|
|
28
|
+
TableSlots2["headerRenderClick"] = "headerRenderClick";
|
|
29
|
+
TableSlots2["menuList"] = "menuList";
|
|
30
|
+
TableSlots2["buttonHeaderActions"] = "buttonHeaderActions";
|
|
31
|
+
TableSlots2["nameColumnIcon"] = "nameColumnIcon";
|
|
28
32
|
return TableSlots2;
|
|
29
33
|
})(TableSlots || {});
|
|
30
34
|
var TextEditorSlots = /* @__PURE__ */ ((TextEditorSlots2) => {
|
|
@@ -44,6 +44,10 @@ export declare const DraggableWrapperInputBaseStyled: import('@emotion/styled').
|
|
|
44
44
|
export declare const HeaderInputBaseStyled: import('@emotion/styled').StyledComponent<any, {}, {}>;
|
|
45
45
|
export declare const WrapperSkeletonStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
46
46
|
export declare const ContentModalSettingStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
47
|
+
export declare const HeaderRenderClickStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
48
|
+
export declare const MenuListStyled: import('@emotion/styled').StyledComponent<any, {}, {}>;
|
|
49
|
+
export declare const ButtonHeaderActionsStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
50
|
+
export declare const NameColumnIconStyled: import('@emotion/styled').StyledComponent<any, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
47
51
|
/**
|
|
48
52
|
* ****************
|
|
49
53
|
* Slots TextEditor
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { styled } from "@mui/material/styles";
|
|
2
|
-
import { InputBase } from "@mui/material";
|
|
2
|
+
import { MenuList, InputBase } from "@mui/material";
|
|
3
3
|
import { D as DATAGRID_PREFIX_NAME } from "../constants.js";
|
|
4
4
|
import { D as DataGridSlots, T as TextEditorSlots, A as ActionsSlots, b as TableSlots, C as ControlNavigateSlots, R as RowsCountSlots, a as ColumnsConfigSlots } from "./DataGridEnum.js";
|
|
5
5
|
import { d as dataGridStyles } from "../Datagrid.styles.js";
|
|
@@ -88,6 +88,22 @@ const ContentModalSettingStyled = styled("div", {
|
|
|
88
88
|
name: DATAGRID_PREFIX_NAME,
|
|
89
89
|
slot: TableSlots.contentModalSetting
|
|
90
90
|
})(dataGridStyles.contentModalSetting);
|
|
91
|
+
const HeaderRenderClickStyled = styled("div", {
|
|
92
|
+
name: DATAGRID_PREFIX_NAME,
|
|
93
|
+
slot: TableSlots.headerRenderClick
|
|
94
|
+
})(dataGridStyles.headerRenderClick);
|
|
95
|
+
const MenuListStyled = styled(MenuList, {
|
|
96
|
+
name: DATAGRID_PREFIX_NAME,
|
|
97
|
+
slot: TableSlots.menuList
|
|
98
|
+
})(dataGridStyles.menuList);
|
|
99
|
+
const ButtonHeaderActionsStyled = styled("div", {
|
|
100
|
+
name: DATAGRID_PREFIX_NAME,
|
|
101
|
+
slot: TableSlots.buttonHeaderActions
|
|
102
|
+
})(dataGridStyles.buttonHeaderActions);
|
|
103
|
+
const NameColumnIconStyled = styled("div", {
|
|
104
|
+
name: DATAGRID_PREFIX_NAME,
|
|
105
|
+
slot: TableSlots.nameColumnIcon
|
|
106
|
+
})(dataGridStyles.nameColumnIcon);
|
|
91
107
|
const InputTextEditorStyled = styled("input", {
|
|
92
108
|
name: DATAGRID_PREFIX_NAME,
|
|
93
109
|
slot: TextEditorSlots.inputTexEditor
|
|
@@ -98,10 +114,13 @@ const ControlNavigateStyled = styled("div", {
|
|
|
98
114
|
})(dataGridStyles.controlNavigate);
|
|
99
115
|
export {
|
|
100
116
|
ActionsRootStyled as A,
|
|
117
|
+
ButtonHeaderActionsStyled as B,
|
|
101
118
|
CustomHeaderStyled as C,
|
|
102
119
|
DataGridRootStyled as D,
|
|
103
120
|
HeaderInputBaseStyled as H,
|
|
104
121
|
IconSearchStyled as I,
|
|
122
|
+
MenuListStyled as M,
|
|
123
|
+
NameColumnIconStyled as N,
|
|
105
124
|
RowsCountRootStyled as R,
|
|
106
125
|
TableWrapperDataGridStyled as T,
|
|
107
126
|
WrapperSkeletonStyled as W,
|
|
@@ -119,5 +138,6 @@ export {
|
|
|
119
138
|
TableContainerStyled as l,
|
|
120
139
|
DraggableHeaderRootStyled as m,
|
|
121
140
|
DraggableWrapperInputBaseStyled as n,
|
|
122
|
-
|
|
141
|
+
HeaderRenderClickStyled as o,
|
|
142
|
+
InputTextEditorStyled as p
|
|
123
143
|
};
|
|
@@ -4,12 +4,20 @@ import { u as useFilters } from "../../../../hooks/useFilters.js";
|
|
|
4
4
|
import { I as IconButton } from "../../../../../mui_extended/IconButton/IconButton.js";
|
|
5
5
|
import { p as pathIcons } from "../../../../icons.js";
|
|
6
6
|
import { D as DICTIONARY } from "../../../../dictionary.js";
|
|
7
|
+
import { u as useDataGrid } from "../../../../hooks/useDataGrid.js";
|
|
7
8
|
function Filter() {
|
|
8
9
|
const { activeFilters, setActiveFilters } = useFilters();
|
|
9
10
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
10
11
|
const { getLabel } = useModuleDictionary();
|
|
12
|
+
const { externalFilterSettings } = useDataGrid();
|
|
11
13
|
const toggleIcon = () => {
|
|
12
|
-
|
|
14
|
+
if (externalFilterSettings) {
|
|
15
|
+
externalFilterSettings.onChange?.({
|
|
16
|
+
action: "openPopoverMenuFields"
|
|
17
|
+
});
|
|
18
|
+
} else {
|
|
19
|
+
setActiveFilters(!activeFilters);
|
|
20
|
+
}
|
|
13
21
|
};
|
|
14
22
|
return /* @__PURE__ */ jsx(
|
|
15
23
|
IconButton,
|
|
@@ -4,4 +4,6 @@ import { HeaderRendererProps } from 'react-data-grid';
|
|
|
4
4
|
* Función encargada de retornar el componente de renderizado de cabecera con la capacidad de arrastrar columnas
|
|
5
5
|
* @param handleColumnsReorder - Función que se ejecuta al reordenar columnas
|
|
6
6
|
*/
|
|
7
|
-
export declare const getDragHeaderRenderer: <TRow, TSummaryRow>(handleColumnsReorder: (sourceKey: string, targetKey: string) => void
|
|
7
|
+
export declare const getDragHeaderRenderer: <TRow, TSummaryRow>(handleColumnsReorder: (sourceKey: string, targetKey: string) => void, options?: {
|
|
8
|
+
openPopover?: (anchorEl: HTMLElement, columnKey: string) => void;
|
|
9
|
+
}) => FunctionComponent<HeaderRendererProps<TRow, TSummaryRow>>;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { D as DraggableHeaderRenderer } from "../subcomponents/DraggableHeaderRenderer.js";
|
|
3
|
-
const getDragHeaderRenderer = (handleColumnsReorder) => {
|
|
3
|
+
const getDragHeaderRenderer = (handleColumnsReorder, options) => {
|
|
4
4
|
function HeaderRenderer(props) {
|
|
5
|
-
return /* @__PURE__ */ jsx(
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
DraggableHeaderRenderer,
|
|
7
|
+
{
|
|
8
|
+
...props,
|
|
9
|
+
onColumnsReorder: handleColumnsReorder,
|
|
10
|
+
openPopover: options?.openPopover
|
|
11
|
+
}
|
|
12
|
+
);
|
|
6
13
|
}
|
|
7
14
|
return HeaderRenderer;
|
|
8
15
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Column } from 'react-data-grid';
|
|
2
|
+
import { MenuAction } from '../subcomponents/HeaderRenderClick/types';
|
|
3
|
+
/**
|
|
4
|
+
* Función que retorna las acciones del menu del header de la columna
|
|
5
|
+
*/
|
|
6
|
+
export declare function useHeaderMenuActions<Trow, TSummaryRow>(columnKey: string | null, finalColumns: readonly Column<Trow, TSummaryRow>[], defaultSortable: boolean): MenuAction[];
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { useMemo, useCallback } from "react";
|
|
2
|
+
import { u as useDataGrid } from "../../../hooks/useDataGrid.js";
|
|
3
|
+
import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
4
|
+
import { D as DICTIONARY } from "../../../dictionary.js";
|
|
5
|
+
import { p as pathIcons } from "../../../icons.js";
|
|
6
|
+
function useHeaderMenuActions(columnKey, finalColumns, defaultSortable) {
|
|
7
|
+
const {
|
|
8
|
+
columnsConfig,
|
|
9
|
+
onChangeColumnsConfig,
|
|
10
|
+
setSortColumns,
|
|
11
|
+
sortColumns,
|
|
12
|
+
externalSortSettings,
|
|
13
|
+
externalFilterSettings
|
|
14
|
+
} = useDataGrid();
|
|
15
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
16
|
+
const { getLabel } = useModuleDictionary();
|
|
17
|
+
const column = useMemo(() => {
|
|
18
|
+
return finalColumns.find((c) => c.key === columnKey);
|
|
19
|
+
}, [columnKey, finalColumns]);
|
|
20
|
+
const canSort = useMemo(() => {
|
|
21
|
+
if (!columnKey) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
if (typeof column?.sortable === "boolean") {
|
|
25
|
+
return column.sortable;
|
|
26
|
+
}
|
|
27
|
+
return defaultSortable;
|
|
28
|
+
}, [columnKey, column, defaultSortable]);
|
|
29
|
+
const canSortExternally = useMemo(() => {
|
|
30
|
+
if (!columnKey || !externalSortSettings) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
return externalSortSettings.sortsColumns.includes(columnKey);
|
|
34
|
+
}, [columnKey, externalSortSettings]);
|
|
35
|
+
const currentSort = useMemo(() => {
|
|
36
|
+
if (!columnKey || !externalSortSettings?.sortsApplied) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
return externalSortSettings.sortsApplied.find(
|
|
40
|
+
(s) => s.columnKey === columnKey
|
|
41
|
+
);
|
|
42
|
+
}, [columnKey, externalSortSettings?.sortsApplied]);
|
|
43
|
+
const hasExternalSortAsc = useMemo(() => {
|
|
44
|
+
return currentSort?.direction === "asc";
|
|
45
|
+
}, [currentSort]);
|
|
46
|
+
const hasExternalSortDesc = useMemo(() => {
|
|
47
|
+
return currentSort?.direction === "desc";
|
|
48
|
+
}, [currentSort]);
|
|
49
|
+
const isAsc = useMemo(
|
|
50
|
+
() => Boolean(
|
|
51
|
+
columnKey && sortColumns.some(
|
|
52
|
+
(s) => s.columnKey === columnKey && s.direction === "ASC"
|
|
53
|
+
)
|
|
54
|
+
),
|
|
55
|
+
[columnKey, sortColumns]
|
|
56
|
+
);
|
|
57
|
+
const isDesc = useMemo(
|
|
58
|
+
() => Boolean(
|
|
59
|
+
columnKey && sortColumns.some(
|
|
60
|
+
(s) => s.columnKey === columnKey && s.direction === "DESC"
|
|
61
|
+
)
|
|
62
|
+
),
|
|
63
|
+
[columnKey, sortColumns]
|
|
64
|
+
);
|
|
65
|
+
const clearLocalSort = useCallback(() => {
|
|
66
|
+
if (!columnKey) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
setSortColumns((prev) => prev.filter((s) => s.columnKey !== columnKey));
|
|
70
|
+
}, [columnKey, setSortColumns]);
|
|
71
|
+
const hasAnySortApplied = useMemo(() => {
|
|
72
|
+
return Boolean(currentSort);
|
|
73
|
+
}, [currentSort]);
|
|
74
|
+
const toggleFrozen = useCallback(() => {
|
|
75
|
+
if (!columnKey) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const next = columnsConfig.map(
|
|
79
|
+
(c) => c.key === columnKey ? { ...c, frozen: !c.frozen } : c
|
|
80
|
+
);
|
|
81
|
+
onChangeColumnsConfig(next);
|
|
82
|
+
}, [columnKey, columnsConfig, onChangeColumnsConfig]);
|
|
83
|
+
const toggleVisible = useCallback(() => {
|
|
84
|
+
if (!columnKey) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const next = columnsConfig.map(
|
|
88
|
+
(c) => c.key === columnKey ? { ...c, visible: !c.visible } : c
|
|
89
|
+
);
|
|
90
|
+
onChangeColumnsConfig(next);
|
|
91
|
+
}, [columnKey, columnsConfig, onChangeColumnsConfig]);
|
|
92
|
+
const addExternalSort = useCallback(
|
|
93
|
+
(direction) => {
|
|
94
|
+
if (!columnKey || !column || column?.type === "custom") {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
externalSortSettings?.onChange({
|
|
98
|
+
action: "add",
|
|
99
|
+
columnKey,
|
|
100
|
+
direction
|
|
101
|
+
});
|
|
102
|
+
},
|
|
103
|
+
[columnKey, column, externalSortSettings]
|
|
104
|
+
);
|
|
105
|
+
const isRemovable = useMemo(() => {
|
|
106
|
+
return currentSort?.removable;
|
|
107
|
+
}, [currentSort]);
|
|
108
|
+
const addExternalFilter = useCallback(() => {
|
|
109
|
+
if (!columnKey || !column) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
externalFilterSettings?.onChange({
|
|
113
|
+
action: "add",
|
|
114
|
+
columnKey
|
|
115
|
+
});
|
|
116
|
+
}, [columnKey, column, externalFilterSettings]);
|
|
117
|
+
const isAddFilterDisabled = useMemo(() => {
|
|
118
|
+
if (!columnKey || !column) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
if (column.type === "custom") {
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
const isInFilterColumns = externalFilterSettings?.filterColumns.some(
|
|
125
|
+
(filter) => filter.name === columnKey
|
|
126
|
+
);
|
|
127
|
+
if (!isInFilterColumns) {
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
const isFilterApplied = externalFilterSettings?.filtersApplied.some(
|
|
131
|
+
(filter) => filter.columnKey === columnKey && filter.isValid
|
|
132
|
+
);
|
|
133
|
+
const isFilterMultiple = externalFilterSettings?.filterColumns.find(
|
|
134
|
+
(filter) => filter.name === columnKey
|
|
135
|
+
)?.multiple;
|
|
136
|
+
return isFilterApplied && !isFilterMultiple;
|
|
137
|
+
}, [columnKey, column, externalFilterSettings]);
|
|
138
|
+
return useMemo(() => {
|
|
139
|
+
if (!columnKey) {
|
|
140
|
+
return [];
|
|
141
|
+
}
|
|
142
|
+
const sortActions = [
|
|
143
|
+
{
|
|
144
|
+
type: "menuItem",
|
|
145
|
+
startIcon: `${host_static_assets}/${environment_assets}/${pathIcons.sortAsc}`,
|
|
146
|
+
label: getLabel(DICTIONARY.ORDER_ASC_COLUMN),
|
|
147
|
+
dataTestId: "sort-ascending",
|
|
148
|
+
/**
|
|
149
|
+
* Función que agrega un sort externo en modo ascendente
|
|
150
|
+
*/
|
|
151
|
+
onClick: () => {
|
|
152
|
+
if (externalSortSettings) {
|
|
153
|
+
addExternalSort("asc");
|
|
154
|
+
} else {
|
|
155
|
+
setSortColumns([
|
|
156
|
+
{
|
|
157
|
+
columnKey,
|
|
158
|
+
direction: "ASC"
|
|
159
|
+
}
|
|
160
|
+
]);
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
disabled: !canSort || (externalSortSettings ? !canSortExternally || hasExternalSortAsc : isAsc)
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
type: "menuItem",
|
|
167
|
+
startIcon: `${host_static_assets}/${environment_assets}/${pathIcons.sortDesc}`,
|
|
168
|
+
label: getLabel(DICTIONARY.ORDER_DESC_COLUMN),
|
|
169
|
+
dataTestId: "sort-descending",
|
|
170
|
+
/**
|
|
171
|
+
* Función que agrega un sort externo en modo descendente
|
|
172
|
+
*/
|
|
173
|
+
onClick: () => {
|
|
174
|
+
if (externalSortSettings) {
|
|
175
|
+
addExternalSort("desc");
|
|
176
|
+
} else {
|
|
177
|
+
setSortColumns([
|
|
178
|
+
{
|
|
179
|
+
columnKey,
|
|
180
|
+
direction: "DESC"
|
|
181
|
+
}
|
|
182
|
+
]);
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
disabled: !canSort || (externalSortSettings ? !canSortExternally || hasExternalSortDesc : isDesc)
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
type: "menuItem",
|
|
189
|
+
startIcon: `${host_static_assets}/${environment_assets}/${pathIcons.removeSort}`,
|
|
190
|
+
label: getLabel(DICTIONARY.REMOVE_ORDER_COLUMN),
|
|
191
|
+
dataTestId: "sort-remove",
|
|
192
|
+
/**
|
|
193
|
+
* Función que elimina el sort externo
|
|
194
|
+
*/
|
|
195
|
+
onClick: () => {
|
|
196
|
+
if (columnKey) {
|
|
197
|
+
if (externalSortSettings && isRemovable) {
|
|
198
|
+
externalSortSettings.onChange({
|
|
199
|
+
action: "remove",
|
|
200
|
+
columnKey
|
|
201
|
+
});
|
|
202
|
+
return;
|
|
203
|
+
} else {
|
|
204
|
+
clearLocalSort();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
disabled: externalSortSettings ? !hasAnySortApplied || !isRemovable : !(isAsc || isDesc)
|
|
209
|
+
}
|
|
210
|
+
];
|
|
211
|
+
const filterAction = externalFilterSettings ? [
|
|
212
|
+
{
|
|
213
|
+
type: "menuItem",
|
|
214
|
+
startIcon: `${host_static_assets}/${environment_assets}/${pathIcons.filter2}`,
|
|
215
|
+
label: getLabel(DICTIONARY.ADD_FILTER_COLUMN),
|
|
216
|
+
dataTestId: "filter-add",
|
|
217
|
+
onClick: () => {
|
|
218
|
+
addExternalFilter();
|
|
219
|
+
},
|
|
220
|
+
disabled: isAddFilterDisabled
|
|
221
|
+
}
|
|
222
|
+
] : [];
|
|
223
|
+
const baseActions = [
|
|
224
|
+
{
|
|
225
|
+
type: "menuItem",
|
|
226
|
+
startIcon: columnsConfig.find((c) => c.key === columnKey)?.frozen ? `${host_static_assets}/${environment_assets}/${pathIcons.unfreezeColumn}` : `${host_static_assets}/${environment_assets}/${pathIcons.freezeColumn}`,
|
|
227
|
+
label: columnsConfig.find((c) => c.key === columnKey)?.frozen ? getLabel(DICTIONARY.UNFREEZE_COLUMN) : getLabel(DICTIONARY.FREEZE_COLUMN),
|
|
228
|
+
onClick: toggleFrozen,
|
|
229
|
+
disabled: !columnsConfig.find((c) => c.key === columnKey)?.visible,
|
|
230
|
+
dataTestId: "toggle-freeze"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
type: "menuItem",
|
|
234
|
+
startIcon: `${host_static_assets}/${environment_assets}/${pathIcons.hideColumn}`,
|
|
235
|
+
label: getLabel(DICTIONARY.HIDE_COLUMN),
|
|
236
|
+
onClick: toggleVisible,
|
|
237
|
+
dataTestId: "hide-column"
|
|
238
|
+
}
|
|
239
|
+
];
|
|
240
|
+
return [...sortActions, ...filterAction, ...baseActions];
|
|
241
|
+
}, [
|
|
242
|
+
columnKey,
|
|
243
|
+
canSort,
|
|
244
|
+
canSortExternally,
|
|
245
|
+
hasExternalSortAsc,
|
|
246
|
+
hasExternalSortDesc,
|
|
247
|
+
hasAnySortApplied,
|
|
248
|
+
addExternalSort,
|
|
249
|
+
toggleFrozen,
|
|
250
|
+
toggleVisible,
|
|
251
|
+
columnsConfig,
|
|
252
|
+
externalSortSettings,
|
|
253
|
+
externalFilterSettings,
|
|
254
|
+
host_static_assets,
|
|
255
|
+
environment_assets,
|
|
256
|
+
getLabel,
|
|
257
|
+
isAddFilterDisabled
|
|
258
|
+
]);
|
|
259
|
+
}
|
|
260
|
+
export {
|
|
261
|
+
useHeaderMenuActions as u
|
|
262
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { Column
|
|
1
|
+
import { Column } from 'react-data-grid';
|
|
2
2
|
/**
|
|
3
3
|
* Hook encargado de ordenar datos de las columnas y las filas.
|
|
4
4
|
* Se utiliza para ordenar las columnas y las filas de un DataGrid.
|
|
5
5
|
*/
|
|
6
|
-
export declare const useSortColumnsRows: <TRow, TSummaryRow>(sourceColumns: readonly Column<TRow, TSummaryRow>[], sourceRows: readonly TRow[]
|
|
6
|
+
export declare const useSortColumnsRows: <TRow, TSummaryRow>(sourceColumns: readonly Column<TRow, TSummaryRow>[], sourceRows: readonly TRow[], popoverHandlers?: {
|
|
7
|
+
openPopover?: (anchorEl: HTMLElement, columnKey: string) => void;
|
|
8
|
+
}) => {
|
|
7
9
|
finalColumns: readonly Column<TRow, TSummaryRow>[];
|
|
8
|
-
sortColumns:
|
|
9
|
-
setSortColumns: import('react').Dispatch<import('react').SetStateAction<
|
|
10
|
+
sortColumns: import('react-data-grid').SortColumn[];
|
|
11
|
+
setSortColumns: import('react').Dispatch<import('react').SetStateAction<import('react-data-grid').SortColumn[]>>;
|
|
10
12
|
finalRows: readonly TRow[];
|
|
11
13
|
};
|
|
@@ -6,7 +6,7 @@ import { useModuleSkeleton, getPropertyByString } from "@m4l/core";
|
|
|
6
6
|
import { u as useFilters } from "../../../hooks/useFilters.js";
|
|
7
7
|
import { u as useDataGrid } from "../../../hooks/useDataGrid.js";
|
|
8
8
|
import { S as SkeletonFormatter } from "../subcomponents/SkeletonFormatter/index.js";
|
|
9
|
-
import {
|
|
9
|
+
import { d as DATAGRID_SELECT_COLUMN_KEY } from "../../../constants.js";
|
|
10
10
|
function getComparator(columns, sortColumn) {
|
|
11
11
|
const column = columns.find((d) => d.key === sortColumn);
|
|
12
12
|
let typeOrder = "string";
|
|
@@ -43,15 +43,13 @@ const getInOrderColumns = (columns, hasCheckedRows, columnsConfig, columnsWidths
|
|
|
43
43
|
const columnConfigIndex = getColumIndex(column.key, columnsConfig);
|
|
44
44
|
const visible = columnConfigIndex > -1 ? columnsConfig[columnConfigIndex].visible : true;
|
|
45
45
|
return !column.hidden && visible;
|
|
46
|
-
}).sort(
|
|
47
|
-
(a,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
).map((columnSorted) => {
|
|
46
|
+
}).sort((a, b) => {
|
|
47
|
+
let indexA = getColumIndex(a.key, columnsConfig);
|
|
48
|
+
indexA = indexA === -1 ? columnsConfig.length : indexA;
|
|
49
|
+
let indexB = getColumIndex(b.key, columnsConfig);
|
|
50
|
+
indexB = indexB === -1 ? columnsConfig.length : indexB;
|
|
51
|
+
return indexA - indexB;
|
|
52
|
+
}).map((columnSorted) => {
|
|
55
53
|
const columnConfigIndex = getColumIndex(columnSorted.key, columnsConfig);
|
|
56
54
|
return {
|
|
57
55
|
...columnSorted,
|
|
@@ -83,21 +81,26 @@ const getAligByType = (columnType) => {
|
|
|
83
81
|
}
|
|
84
82
|
return "left";
|
|
85
83
|
};
|
|
86
|
-
const useSortColumnsRows = (sourceColumns, sourceRows) => {
|
|
84
|
+
const useSortColumnsRows = (sourceColumns, sourceRows, popoverHandlers) => {
|
|
87
85
|
const {
|
|
88
86
|
columnsConfig,
|
|
89
87
|
columnsWidths,
|
|
90
88
|
onChangeColumnsOrder,
|
|
91
89
|
rowActionsGetter,
|
|
92
90
|
checkedRows,
|
|
93
|
-
onCheckedRowsChange
|
|
91
|
+
onCheckedRowsChange,
|
|
92
|
+
sortColumns,
|
|
93
|
+
setSortColumns
|
|
94
94
|
} = useDataGrid();
|
|
95
|
-
const [columns, setColumns] = useState(
|
|
96
|
-
|
|
95
|
+
const [columns, setColumns] = useState(
|
|
96
|
+
() => []
|
|
97
|
+
);
|
|
97
98
|
const isSkeleton = useModuleSkeleton();
|
|
98
99
|
const { activeFilters, filters } = useFilters();
|
|
99
100
|
const findKeyInColumns = (key, cols) => {
|
|
100
|
-
const index = cols.findIndex(
|
|
101
|
+
const index = cols.findIndex(
|
|
102
|
+
(column) => key === column.key && column.hidden === false
|
|
103
|
+
);
|
|
101
104
|
return index !== -1;
|
|
102
105
|
};
|
|
103
106
|
useEffect(() => {
|
|
@@ -119,7 +122,12 @@ const useSortColumnsRows = (sourceColumns, sourceRows) => {
|
|
|
119
122
|
}
|
|
120
123
|
}, [sourceColumns, columnsConfig, rowActionsGetter]);
|
|
121
124
|
const finalColumns = useMemo(() => {
|
|
122
|
-
const DragAndDropHeaderRenderer = getDragHeaderRenderer(
|
|
125
|
+
const DragAndDropHeaderRenderer = getDragHeaderRenderer(
|
|
126
|
+
onChangeColumnsOrder,
|
|
127
|
+
{
|
|
128
|
+
openPopover: popoverHandlers?.openPopover
|
|
129
|
+
}
|
|
130
|
+
);
|
|
123
131
|
return columns.map((c) => {
|
|
124
132
|
const cellClass = c.align !== void 0 ? `rdg-cell-align-${c.align}` : `rdg-cell-align-${getAligByType(c.type)}`;
|
|
125
133
|
const newColumn = {
|
|
@@ -143,7 +151,13 @@ const useSortColumnsRows = (sourceColumns, sourceRows) => {
|
|
|
143
151
|
newColumn.headerRenderer = DragAndDropHeaderRenderer;
|
|
144
152
|
return newColumn;
|
|
145
153
|
});
|
|
146
|
-
}, [
|
|
154
|
+
}, [
|
|
155
|
+
isSkeleton,
|
|
156
|
+
columns,
|
|
157
|
+
activeFilters,
|
|
158
|
+
onChangeColumnsOrder,
|
|
159
|
+
popoverHandlers
|
|
160
|
+
]);
|
|
147
161
|
const finalRows = useMemo(() => {
|
|
148
162
|
const nextRows = sourceRows.filter((r) => {
|
|
149
163
|
if (!filters || filters.size === 0) {
|
|
@@ -154,7 +168,10 @@ const useSortColumnsRows = (sourceColumns, sourceRows) => {
|
|
|
154
168
|
for (let i = 0; i < filters.size; i++) {
|
|
155
169
|
const entry = iterator.next().value;
|
|
156
170
|
const columnKey = entry?.[0] ?? "";
|
|
157
|
-
const columnFilter = entry?.[1] ?? {
|
|
171
|
+
const columnFilter = entry?.[1] ?? {
|
|
172
|
+
value: "",
|
|
173
|
+
customFilter: void 0
|
|
174
|
+
};
|
|
158
175
|
let valCell;
|
|
159
176
|
const valueMaybeString = getPropertyByString(r, columnKey);
|
|
160
177
|
let fixedValue;
|