@m4l/components 9.2.56-beta.2 → 9.2.56-beta.4

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.
Files changed (59) hide show
  1. package/.storybook/decorators/WithWindowsToolsContext/WithContextWindowTools.d.ts +5 -0
  2. package/components/DataGrid/DataGrid.js +8 -1
  3. package/components/DataGrid/Datagrid.styles.js +15 -3
  4. package/components/DataGrid/contexts/DataGridContext/index.js +39 -8
  5. package/components/DataGrid/contexts/DataGridContext/types.d.ts +1 -2
  6. package/components/DataGrid/dictionary.d.ts +2 -1
  7. package/components/DataGrid/dictionary.js +22 -21
  8. package/components/DataGrid/subcomponents/HeaderActions/index.js +4 -3
  9. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Density/index.js +5 -5
  10. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Filter/index.js +2 -2
  11. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/MobileMenuActions/index.d.ts +4 -1
  12. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/MobileMenuActions/index.js +3 -2
  13. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/index.d.ts +2 -1
  14. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/index.js +3 -2
  15. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +26 -26
  16. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/types.d.ts +2 -0
  17. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/types.d.ts +4 -0
  18. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettings/index.d.ts +2 -1
  19. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettings/index.js +3 -2
  20. package/components/DataGrid/subcomponents/HeaderActions/types.d.ts +1 -0
  21. package/components/DataGrid/types.d.ts +1 -1
  22. package/components/DynamicFilter/dictionary.d.ts +1 -0
  23. package/components/DynamicFilter/dictionary.js +2 -1
  24. package/components/DynamicFilter/types.d.ts +1 -1
  25. package/components/WindowBase/WindowBase.js +4 -1
  26. package/components/WindowBase/WindowBase.styles.js +54 -27
  27. package/components/WindowBase/subcomponents/Header/HeaderWindowBase.js +2 -0
  28. package/components/WindowBase/subcomponents/Header/types.d.ts +1 -1
  29. package/components/WindowBase/types.d.ts +6 -0
  30. package/components/areas/components/AreasViewer/AreasViewer.js +5 -2
  31. package/components/areas/components/AreasViewer/AreasViewer.styles.js +5 -3
  32. package/components/areas/components/AreasViewer/subcomponents/Area/Area.js +2 -2
  33. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.js +20 -4
  34. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/types.d.ts +2 -0
  35. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/BaseArea/BaseArea.js +7 -2
  36. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/BaseArea/types.d.ts +2 -0
  37. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js +1 -0
  38. package/components/areas/components/AreasViewer/subcomponents/Area/types.d.ts +2 -0
  39. package/components/areas/components/AreasViewer/types.d.ts +5 -0
  40. package/components/areas/contexts/AreasContext/helpers/helper.d.ts +2 -9
  41. package/components/areas/contexts/AreasContext/helpers/helper.js +14 -16
  42. package/components/areas/contexts/AreasContext/store.js +3 -3
  43. package/components/formatters/BooleanFormatter/BooleanFormatter.styles.js +2 -2
  44. package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.d.ts +2 -1
  45. package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.js +2 -1
  46. package/components/mui_extended/Accordion/Accordion.js +1 -1
  47. package/components/mui_extended/Accordion/styles.js +12 -8
  48. package/components/mui_extended/Autocomplete/renderOptions/index.d.ts +3 -1
  49. package/components/mui_extended/Autocomplete/renderOptions/index.js +3 -2
  50. package/components/mui_extended/Tab/Tab.styles.js +3 -3
  51. package/components/mui_extended/TabContent/TabContent.js +2 -2
  52. package/components/mui_extended/TabContent/TabContent.styles.js +4 -2
  53. package/components/mui_extended/TabContent/types.d.ts +1 -0
  54. package/components/popups/components/PopupsViewer/PopupsViewer.styles.js +2 -2
  55. package/hooks/useDynamicFilterAndSort/icons.d.ts +2 -2
  56. package/hooks/useDynamicFilterAndSort/icons.js +2 -2
  57. package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +15 -8
  58. package/package.json +3 -3
  59. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/types.d.ts +0 -2
@@ -3,9 +3,9 @@ import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.j
3
3
  import { T as TAB_CONTENT_KEY_COMPONENT } from "./constants.js";
4
4
  import { T as TabContentRootStyled } from "./slots/TabContentSlots.js";
5
5
  const TabContent = (props) => {
6
- const { children, className, ...others } = props;
6
+ const { children, className, background = false, ...others } = props;
7
7
  const root = getComponentSlotRoot(TAB_CONTENT_KEY_COMPONENT);
8
- return /* @__PURE__ */ jsx(TabContentRootStyled, { className: root, ...others, children });
8
+ return /* @__PURE__ */ jsx(TabContentRootStyled, { className: root, ownerState: { background }, ...others, children });
9
9
  };
10
10
  export {
11
11
  TabContent as T
@@ -2,14 +2,13 @@ const tabContentStyles = {
2
2
  /**
3
3
  * Elemento root referencia a `TabContent`
4
4
  */
5
- root: ({ theme }) => ({
5
+ root: ({ theme, ownerState }) => ({
6
6
  padding: theme.vars.size.baseSpacings.sp3,
7
7
  display: "flex",
8
8
  overflow: "hidden",
9
9
  // height: '100%',
10
10
  flexDirection: "column",
11
11
  gap: theme.vars.size.baseSpacings.sp2,
12
- background: theme.vars.palette.background.base,
13
12
  position: "relative",
14
13
  flex: 1,
15
14
  flexGrow: 1,
@@ -18,6 +17,9 @@ const tabContentStyles = {
18
17
  boxSizing: "border-box",
19
18
  zIndex: "0",
20
19
  top: "-1px",
20
+ ...ownerState?.background ? {
21
+ backgroundColor: theme.vars.palette.background.default
22
+ } : {},
21
23
  "& .M4LStack-root": {
22
24
  gap: `${theme.vars.size.baseSpacings.sp2} !important`
23
25
  },
@@ -7,5 +7,6 @@ export interface TabContentProps extends Omit<React.HTMLAttributes<HTMLDivElemen
7
7
  children: React.ReactNode;
8
8
  style?: React.CSSProperties;
9
9
  key?: Key | null | undefined;
10
+ background?: boolean;
10
11
  }
11
12
  export type TabContentStyles = M4LOverridesStyleRules<keyof typeof TabContentSlots, typeof TABS_KEY_COMPONENT, Theme>;
@@ -19,13 +19,13 @@ const popupsViewerStyles = {
19
19
  * id: 'global',
20
20
  * },
21
21
  */
22
- popupDragWindowRoot: ({ theme, ownerState }) => ({
22
+ popupDragWindowRoot: ({ ownerState }) => ({
23
23
  display: "flex",
24
24
  flexDirection: "column",
25
25
  position: "relative",
26
26
  width: "100%",
27
27
  height: "100%",
28
- backgroundColor: theme.vars.palette.background.default,
28
+ backgroundColor: "transparent",
29
29
  zIndex: ownerState?.zIndex || 0,
30
30
  "&.fade-enter": {
31
31
  opacity: 0
@@ -1,6 +1,6 @@
1
1
  export declare const ICON_PATH_FILTER = "frontend/components/data_grid/assets/icons/filter.svg";
2
2
  export declare const ICON_PATH_SORT = "frontend/components/data_grid/assets/icons/sort.svg";
3
- export declare const ASSETS_URL = "frontend/components/Dynamic_sort/assets/icons";
3
+ export declare const ASSETS_URL = "frontend/components/DynamincFilterAndSort/assets/icons";
4
4
  export declare const ASSETS: {
5
- readonly refresh: "frontend/components/Dynamic_sort/assets/icons/restart.svg";
5
+ readonly refresh: "frontend/components/DynamincFilterAndSort/assets/icons/refresh.svg";
6
6
  };
@@ -1,8 +1,8 @@
1
1
  const ICON_PATH_FILTER = "frontend/components/data_grid/assets/icons/filter.svg";
2
2
  const ICON_PATH_SORT = "frontend/components/data_grid/assets/icons/sort.svg";
3
- const ASSETS_URL = "frontend/components/Dynamic_sort/assets/icons";
3
+ const ASSETS_URL = "frontend/components/DynamincFilterAndSort/assets/icons";
4
4
  const ASSETS = {
5
- refresh: `${ASSETS_URL}/restart.svg`
5
+ refresh: `${ASSETS_URL}/refresh.svg`
6
6
  };
7
7
  export {
8
8
  ASSETS as A,
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { useEnvironment } from "@m4l/core";
2
+ import { useEnvironment, useModuleDictionary } from "@m4l/core";
3
3
  import { useState, useRef, useMemo, useCallback } from "react";
4
4
  import { D as DynamicFilter } from "../../components/DynamicFilter/DynamicFilter.js";
5
5
  import { D as DynamicSort } from "../../components/DynamicSort/DynamicSort.js";
@@ -12,6 +12,8 @@ import { D as DynamicFilterAndSortSlots } from "./slots/DynamicFilterAndSortEnum
12
12
  import { S as StackLeftActionsStyled, a as StackRightActionsStyled, b as StackCustomHeaderStyled } from "./slots/DynamicFilterAndSortSlots.js";
13
13
  import { deepEqual } from "fast-equals";
14
14
  import { g as getPurgedCookie } from "./helpers.js";
15
+ import { u as useWindowToolsMF } from "../../components/WindowBase/hooks/useWindowToolsMF/index.js";
16
+ import { a as DICCTIONARY } from "../../components/DynamicFilter/dictionary.js";
15
17
  const useDynamicFilterAndSort = (props) => {
16
18
  const { fields, sorts, onChangeFilterSort, dataTestId, withAllField, rightActions, initialFilterToggleed = true, initialSortToggleed = true, prefixCookie, setCookie, getCookie, filterSortAutomatic = true, visibleRefresh = false, withExternalRefresh } = props;
17
19
  const { host_static_assets, environment_assets } = useEnvironment();
@@ -25,6 +27,8 @@ const useDynamicFilterAndSort = (props) => {
25
27
  const refOnChangeFilterSort = useRef(0);
26
28
  const fireOnChangeFilterRef = useRef(null);
27
29
  const fireOnChangeSortRef = useRef(null);
30
+ const { toast } = useWindowToolsMF();
31
+ const { getLabel } = useModuleDictionary();
28
32
  const [invisibleBadge, setInvisibleBadge] = useState(() => ({
29
33
  filter: initialAppliedFilters?.length === 0,
30
34
  sort: initialAppliedSorts?.length === 0
@@ -59,14 +63,14 @@ const useDynamicFilterAndSort = (props) => {
59
63
  }
60
64
  refOnChangeFilterSort.current++;
61
65
  }, [onChangeFilterSort, prefixCookie, setCookie, setInvisibleBadge, sorts]);
62
- const handleChangeSorts = useCallback((Sorts, rawSorts) => {
63
- setInvisibleBadge((prev) => ({ ...prev, sort: Sorts.length === 0 }));
64
- if (eventRefs.current?.eventSorts?.sorts && !deepEqual(eventRefs.current?.eventSorts?.sorts, Sorts)) {
65
- setCookie?.(prefixCookie ? `${prefixCookie}_${COOKIE_APPLIED_SORTS}` : COOKIE_APPLIED_SORTS, "window", Sorts);
66
+ const handleChangeSorts = useCallback((newSorts, rawSorts) => {
67
+ setInvisibleBadge((prev) => ({ ...prev, sort: newSorts.length === 0 }));
68
+ if (eventRefs.current?.eventSorts?.sorts && !deepEqual(eventRefs.current?.eventSorts?.sorts, newSorts)) {
69
+ setCookie?.(prefixCookie ? `${prefixCookie}_${COOKIE_APPLIED_SORTS}` : COOKIE_APPLIED_SORTS, "window", newSorts);
66
70
  }
67
71
  eventRefs.current = {
68
72
  ...eventRefs.current,
69
- eventSorts: { sorts: Sorts, rawSorts }
73
+ eventSorts: { sorts: newSorts, rawSorts }
70
74
  };
71
75
  if (isValidFilters()) {
72
76
  onChangeFilterSort(eventRefs.current);
@@ -85,9 +89,11 @@ const useDynamicFilterAndSort = (props) => {
85
89
  } else {
86
90
  if (isValidFilters()) {
87
91
  onChangeFilterSort(eventRefs.current);
92
+ } else {
93
+ toast({ title: getLabel(DICCTIONARY.error_invalid_filters_before) }, { type: "error" });
88
94
  }
89
95
  }
90
- }, [filterSortAutomatic, isValidFilters, onChangeFilterSort]);
96
+ }, [filterSortAutomatic, getLabel, isValidFilters, onChangeFilterSort, toast]);
91
97
  const leftActions = useMemo(() => /* @__PURE__ */ jsxs(StackLeftActionsStyled, { direction: "row", ...getPropDataTestId(M4LDYNAMIC_KEY_FILTER_AND_SORT, DynamicFilterAndSortSlots.stackLeftActions, dataTestId), children: [
92
98
  /* @__PURE__ */ jsx(ToggleIconButton, { badgeProps: { variant: "dot", invisible: invisibleBadge.filter, color: "primary" }, icon: `${host_static_assets}/${environment_assets}/${ICON_PATH_FILTER}`, isToggled: togglesLeftActions.filter, onToggle: () => handleToggles("filter") }),
93
99
  /* @__PURE__ */ jsx(ToggleIconButton, { badgeProps: { variant: "dot", invisible: invisibleBadge.sort, color: "primary" }, icon: `${host_static_assets}/${environment_assets}/${ICON_PATH_SORT}`, isToggled: togglesLeftActions.sort, onToggle: () => handleToggles("sort") })
@@ -103,7 +109,8 @@ const useDynamicFilterAndSort = (props) => {
103
109
  {
104
110
  icon: refreshIconUrl,
105
111
  "aria-label": "refresh",
106
- onClick: onRefresh
112
+ onClick: onRefresh,
113
+ variant: "outline"
107
114
  }
108
115
  ),
109
116
  rightActions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "9.2.56-beta.2",
3
+ "version": "9.2.56-beta.4",
4
4
  "license": "UNLICENSED",
5
5
  "description": "M4L Components",
6
6
  "lint-staged": {
@@ -11,8 +11,8 @@
11
11
  "@googlemaps/js-api-loader": "^1.16.6",
12
12
  "@hookform/resolvers": "^2.9.5",
13
13
  "@m4l/core": "^2.0.0",
14
- "@m4l/graphics": "7.1.1-beta.2",
15
- "@m4l/styles": "7.1.28-beta.2",
14
+ "@m4l/graphics": "7.1.1-beta.4",
15
+ "@m4l/styles": "7.1.28-beta.4",
16
16
  "@microlink/react-json-view": "^1.23.3",
17
17
  "@mui/lab": "5.0.0-alpha.173",
18
18
  "@mui/material": "5.16.7",
@@ -1,2 +0,0 @@
1
- export interface SettingsProps {
2
- }