@m4l/components 0.1.69 → 0.1.70

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 (129) hide show
  1. package/@types/export.d.ts +7 -1
  2. package/components/CommonActions/components/ActionCancel/{index.e83053da.js → index.9d521b2a.js} +2 -2
  3. package/components/CommonActions/components/ActionFormCancel/{index.ca378b0a.js → index.4756457f.js} +25 -13
  4. package/components/CommonActions/components/ActionFormIntro/{index.fa2107df.js → index.40321b1b.js} +2 -2
  5. package/components/CommonActions/components/ActionIntro/{index.b8d5c8ee.js → index.1ba5b02b.js} +3 -3
  6. package/components/CommonActions/components/Actions/{index.1b2a0921.js → index.154d7cb6.js} +23 -13
  7. package/components/DataGrid/{index.75ea6038.js → index.2f4a0e64.js} +21 -19
  8. package/components/DynamicFilter/{index.aaeea668.js → index.789ab474.js} +36 -40
  9. package/components/HelperText/{index.742d547d.js → index.a69e9509.js} +8 -8
  10. package/components/Icon/{index.952f0635.js → index.caaed284.js} +2 -2
  11. package/components/Image/{index.f30f79f0.js → index.82a6cd46.js} +1 -1
  12. package/components/LanguagePopover/{index.526e544e.js → index.5af28b9e.js} +9 -9
  13. package/components/ModalDialog/{index.4d663d0a.js → index.cdfd1ae8.js} +5 -5
  14. package/components/NavLink/{index.92008184.js → index.251fcf0d.js} +9 -9
  15. package/components/NoItemSelected/{index.6f2952ab.js → index.3b9d16e3.js} +1 -1
  16. package/components/ObjectLogs/{index.d1eee18b.js → index.57ea68b3.js} +17 -15
  17. package/components/PaperForm/{index.e9db704b.js → index.d2d492ea.js} +1 -1
  18. package/components/Period/{index.3ff6f53b.js → index.fbf074d3.js} +24 -14
  19. package/components/Resizeable/{index.ff97422e.js → index.aafda79e.js} +1 -1
  20. package/components/SideBar/{index.365f64f0.js → index.3bc6a634.js} +10 -24
  21. package/components/areas/components/AreasAdmin/classes/types.d.ts +1 -0
  22. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/types.d.ts +1 -0
  23. package/components/areas/components/AreasViewer/classes/types.d.ts +1 -0
  24. package/components/areas/components/AreasViewer/subcomponents/Area/index.d.ts +2 -2
  25. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/GridLayout/index.d.ts +2 -1
  26. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/GridLayout/types.d.ts +3 -0
  27. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/InnerForHooks/index.d.ts +2 -1
  28. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/InnerForHooks/types.d.ts +3 -0
  29. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/PanelWindows/index.d.ts +2 -1
  30. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/PanelWindows/types.d.ts +3 -0
  31. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/index.d.ts +1 -1
  32. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/styles.d.ts +2 -0
  33. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Component/index.d.ts +4 -0
  34. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Component/types.d.ts +9 -0
  35. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/helper.d.ts +3 -0
  36. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/index.d.ts +9 -0
  37. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/MainActions/index.d.ts +6 -0
  38. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/index.d.ts +4 -0
  39. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/{InnerForHooks/subcomponents/MicroFrontend → MicroFrontend}/subcomponents/MFLoader/index.d.ts +2 -2
  40. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/types.d.ts +8 -0
  41. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/types.d.ts +8 -0
  42. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/types.d.ts +2 -0
  43. package/components/areas/components/AreasViewer/subcomponents/Area/types.d.ts +4 -0
  44. package/components/areas/components/{index.ffb147c7.js → index.359c2b18.js} +443 -1069
  45. package/components/areas/components/index.d.ts +1 -1
  46. package/components/areas/contexts/AreasContext/helper.d.ts +59 -0
  47. package/components/areas/contexts/AreasContext/index.de8b4e78.js +1015 -0
  48. package/components/areas/contexts/AreasContext/store.d.ts +1 -2
  49. package/components/areas/contexts/AreasContext/types.d.ts +86 -13
  50. package/components/areas/contexts/DynamicMFParmsContext/index.1607c78e.js +42 -0
  51. package/components/areas/contexts/DynamicMFParmsContext/index.d.ts +8 -0
  52. package/components/areas/{components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts → contexts}/DynamicMFParmsContext/store.d.ts +3 -9
  53. package/components/areas/contexts/WindowToolsMFContext/index.8f3e2a04.js +20 -0
  54. package/components/areas/{components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts → contexts}/WindowToolsMFContext/types.d.ts +3 -2
  55. package/components/areas/contexts/index.771827bb.js +2 -0
  56. package/components/areas/contexts/index.d.ts +4 -4
  57. package/components/areas/dictionary.d.ts +1 -0
  58. package/components/areas/hooks/index.ae8d8631.js +13 -0
  59. package/components/areas/hooks/useArea/index.2adbe001.js +12 -0
  60. package/components/areas/hooks/useDynamicMFParameters/index.d.ts +3 -9
  61. package/components/areas/hooks/useDynamicMFParameters/{index.7ce7176f.js → index.e52c5392.js} +1 -1
  62. package/components/areas/hooks/useWindowToolsMF/index.d.ts +1 -1
  63. package/components/areas/icons.d.ts +3 -0
  64. package/components/areas/{index.20cbd7b7.js → index.8a58bcbf.js} +14 -8
  65. package/components/areas/types.d.ts +32 -23
  66. package/components/formatters/BooleanFormatter/{index.d5e21bdd.js → index.7eb0498c.js} +1 -1
  67. package/components/formatters/{index.650243bb.js → index.f6b9ed01.js} +2 -2
  68. package/components/hook-form/RHFAutocomplete/{index.21377a2c.js → index.09c400c3.js} +10 -10
  69. package/components/hook-form/RHFAutocompleteAsync/{index.8c7e0842.js → index.e8acff04.js} +2 -2
  70. package/components/hook-form/RHFCheckbox/{index.83902d07.js → index.70310f35.js} +3 -3
  71. package/components/hook-form/RHFDateTime/{index.166250d8.js → index.7b815072.js} +9 -9
  72. package/components/hook-form/RHFPeriod/{index.61baf76f.js → index.3c7d393c.js} +2 -2
  73. package/components/hook-form/RHFTextField/{index.55687a39.js → index.d4c39859.js} +6 -7
  74. package/components/hook-form/RHFUpload/{index.eb4d0dac.js → index.31044674.js} +1 -1
  75. package/components/modal/WindowBase/subcomponents/Header/types.d.ts +1 -1
  76. package/components/modal/WindowBase/types.d.ts +1 -0
  77. package/components/modal/{WindowBase.7ce0b21e.js → WindowBase.6a40a945.js} +28 -21
  78. package/components/modal/{WindowConfirm.7ae1326f.js → WindowConfirm.e21763cb.js} +17 -15
  79. package/components/modal/index.438777d9.js +34 -0
  80. package/components/mui_extended/Accordion/{index.51feece8.js → index.437bb3f8.js} +2 -2
  81. package/components/mui_extended/Button/{index.b34c8b68.js → index.f8ce9ccd.js} +3 -3
  82. package/components/mui_extended/IconButton/{index.917f0d3c.js → index.57824447.js} +1 -3
  83. package/components/mui_extended/MenuActions/{index.651dec44.js → index.37043326.js} +2 -2
  84. package/components/mui_extended/Pager/{index.e0663072.js → index.eeed3bd5.js} +1 -1
  85. package/components/mui_extended/Typography/{index.79e2b06f.js → index.b3c6e71c.js} +1 -1
  86. package/components/mui_extended/index.dacbb059.js +19 -0
  87. package/contexts/ModalContext/{index.76d5ccee.js → index.8e3cd7a8.js} +1 -1
  88. package/contexts/index.d.ts +1 -1
  89. package/hooks/useModal/{index.043e419b.js → index.d590f506.js} +1 -1
  90. package/index.js +96 -94
  91. package/package.json +3 -4
  92. package/{react-draggable.de1aac90.js → react-draggable.0d64c8b1.js} +1 -1
  93. package/{react-resizable.e0470767.js → react-resizable.8307e056.js} +2 -2
  94. package/utils/{index.b5c62ef0.js → index.a2312a73.js} +1 -1
  95. package/{vendor.6a33c6d2.js → vendor.8edaef93.js} +47 -45
  96. package/components/areas/components/AreasViewer/subcomponents/Area/contexts/AreaContext/helper.d.ts +0 -39
  97. package/components/areas/components/AreasViewer/subcomponents/Area/contexts/AreaContext/index.d.ts +0 -20
  98. package/components/areas/components/AreasViewer/subcomponents/Area/contexts/AreaContext/store.d.ts +0 -11
  99. package/components/areas/components/AreasViewer/subcomponents/Area/contexts/AreaContext/types.d.ts +0 -82
  100. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts/DynamicMFParmsContext/index.d.ts +0 -14
  101. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts/WindowContext/helper.d.ts +0 -1
  102. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts/WindowContext/index.d.ts +0 -13
  103. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts/WindowContext/store.d.ts +0 -36
  104. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts/WindowContext/types.d.ts +0 -5
  105. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/index.d.ts +0 -4
  106. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/Component/index.d.ts +0 -8
  107. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/Header/helper.d.ts +0 -3
  108. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/Header/index.d.ts +0 -2
  109. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/Header/subcomponents/MainActions/index.d.ts +0 -2
  110. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/MicroFrontend/index.d.ts +0 -4
  111. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/MicroFrontend/types.d.ts +0 -8
  112. package/components/areas/contexts/AreasContext/index.7c12b512.js +0 -230
  113. package/components/areas/contexts/index.1a823ffb.js +0 -2
  114. package/components/areas/hooks/index.d09ea7de.js +0 -26
  115. package/components/areas/hooks/useArea/index.3a0d4b8c.js +0 -34
  116. package/components/areas/hooks/useArea/index.d.ts +0 -11
  117. package/components/areas/hooks/useWindow/index.d.ts +0 -11
  118. package/components/modal/index.d6dcd1b1.js +0 -24
  119. package/components/mui_extended/index.8b30e8c8.js +0 -19
  120. /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/{InnerForHooks/subcomponents/Header → Header}/skeleton.d.ts +0 -0
  121. /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/{InnerForHooks/subcomponents/Header → Header}/styles.d.ts +0 -0
  122. /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/{InnerForHooks/subcomponents/MicroFrontend → MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/index.d.ts +0 -0
  123. /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/{InnerForHooks/subcomponents/MicroFrontend → MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/styles.d.ts +0 -0
  124. /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/{InnerForHooks/subcomponents/MicroFrontend → MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/index.d.ts +0 -0
  125. /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/{InnerForHooks/subcomponents/MicroFrontend → MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/styles.d.ts +0 -0
  126. /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/{InnerForHooks/subcomponents/MicroFrontend → MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/types.d.ts +0 -0
  127. /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/{InnerForHooks/subcomponents/MicroFrontend → MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/types.d.ts +0 -0
  128. /package/components/areas/{components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts → contexts}/DynamicMFParmsContext/types.d.ts +0 -0
  129. /package/components/areas/{components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts → contexts}/WindowToolsMFContext/index.d.ts +0 -0
@@ -1,82 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { DebouncedFunc } from 'lodash';
3
- import { Layout, Layouts } from 'react-grid-layout';
4
- import { HashWindowsByLayouts, HashWindowsByPopups, ModalProps, NewLayoutProps, NewModalProps, NewPopUpProps, NewWindowProps, WinType } from '../../../../../../types';
5
- import { AreaProps } from '../../../../../../types';
6
- import { AreaStore } from './store';
7
- import { Maybe, NetworkProps } from '@m4l/core';
8
- export declare type WinLayout = Layout & {
9
- winType: WinType;
10
- };
11
- export declare type AreaStatus = 'init' | 'load' | 'loaded' | 'error';
12
- export declare type Breakpoints = {
13
- [P: string]: number;
14
- };
15
- export declare type Cols = {
16
- [P: string]: number;
17
- };
18
- export declare type ViewAreaMode = 'multiple' | 'single';
19
- export interface AreaState {
20
- id: string;
21
- /**
22
- * "loadAreasFromNetwork" Indica si se deben cargar las ventanas desde la API
23
- */
24
- loadAreasFromNetwork: boolean;
25
- /**
26
- * "loadCookiesFromNetwork" Indica si se deben cargar/grabar las cookies en la API
27
- */
28
- loadCookiesFromNetwork: boolean;
29
- zPopUpIndex: number;
30
- loadWindows: boolean;
31
- status: AreaStatus;
32
- breakpointsLayouts: Layouts;
33
- beforeMaximizebreakpointsLayouts: Layouts;
34
- gridLayouts: Layout[];
35
- windowsPopUps: string[];
36
- windowModal?: Maybe<ModalProps>;
37
- hashWindowsPopups: HashWindowsByPopups;
38
- hashWindowsLayouts: HashWindowsByLayouts;
39
- networkOperation: (props: NetworkProps) => Promise<any>;
40
- currentLayoutId: string;
41
- currentPopUpId: string;
42
- breakpoints: Breakpoints;
43
- cols: Cols;
44
- viewMode: ViewAreaMode;
45
- singleId?: string;
46
- isDesktop: boolean;
47
- }
48
- export interface AreaStateWithActions extends AreaState {
49
- actions: {
50
- addWindow: (newWindow: NewWindowProps) => void;
51
- closeWindowModal: () => void;
52
- addWindowModal: (container_id: string, newWindowModalProps: NewModalProps) => void;
53
- closeWindowPopUp: (removePopUpId: string) => void;
54
- addWindowPopUp: (container_id: string, newWindowPopupProps: NewPopUpProps) => void;
55
- closeWindowLayout: (removeLayoutId: string) => void;
56
- addWindowLayout: (container_id: string, newWindow: NewLayoutProps) => void;
57
- saveLayouts: () => void;
58
- onBreakpointsLayoutsChange: (currentLayouts: Layout[], newAllLayouts: Layouts) => void;
59
- bouncedSaveBreakpointsLayouts: DebouncedFunc<() => void>;
60
- selectWindowLayout: (layoutId: string) => void;
61
- selectWindowPopUp: (popUpId: string) => void;
62
- maximizeLayout: (layoutId?: string) => void;
63
- normalizeLayouts: () => void;
64
- };
65
- internalActions: {
66
- loadFromApi: () => void;
67
- changeDesktopBreakpoint: (isDesktop: boolean) => void;
68
- };
69
- }
70
- export declare type DefaultStoreProps = Omit<AreaState, 'id'>;
71
- export declare type InitialStoreProps = Pick<AreaState, 'id' | 'networkOperation' | 'loadWindows' | 'isDesktop' | 'loadAreasFromNetwork' | 'loadCookiesFromNetwork'> & Partial<DefaultStoreProps>;
72
- export interface AreaProviderProps extends AreaProps {
73
- children: ReactNode;
74
- }
75
- export declare type AreaProviderRef = {
76
- store: AreaStore;
77
- addWindow: (newWindow: NewWindowProps) => string;
78
- };
79
- export interface AreaContextProps {
80
- store: AreaStore;
81
- addWindow: (newWindow: NewWindowProps) => string;
82
- }
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { DynamicMFParmsProviderProps } from './types';
3
- declare const DynamicMFParmsContext: React.Context<(Omit<Omit<import("zustand").StoreApi<import("./store").DynamicMFStateWithActions>, "setState"> & {
4
- setState<A extends string | {
5
- type: unknown;
6
- }>(partial: import("./store").DynamicMFStateWithActions | Partial<import("./store").DynamicMFStateWithActions> | ((state: import("./store").DynamicMFStateWithActions) => import("./store").DynamicMFStateWithActions | Partial<import("./store").DynamicMFStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
7
- }, "setState"> & {
8
- setState(nextStateOrUpdater: import("./store").DynamicMFStateWithActions | Partial<import("./store").DynamicMFStateWithActions> | ((state: import("immer/dist/internal").WritableDraft<import("./store").DynamicMFStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
9
- type: unknown;
10
- } | undefined): void;
11
- }) | null>;
12
- declare function DynamicMFParmsProvider(props: DynamicMFParmsProviderProps): React.JSX.Element;
13
- declare const MemonizedDynamicMFParmsProvider: React.MemoExoticComponent<typeof DynamicMFParmsProvider>;
14
- export { DynamicMFParmsProvider, DynamicMFParmsContext, MemonizedDynamicMFParmsProvider };
@@ -1 +0,0 @@
1
- export declare function getCookiesContainer(data: any, containerId: string): Record<string, any>;
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- import { WindowProviderProps } from './types';
3
- declare const WindowContext: import("react").Context<(Omit<Omit<import("zustand").StoreApi<import("./store").WindowStateWithActions>, "setState"> & {
4
- setState<A extends string | {
5
- type: unknown;
6
- }>(partial: import("./store").WindowStateWithActions | Partial<import("./store").WindowStateWithActions> | ((state: import("./store").WindowStateWithActions) => import("./store").WindowStateWithActions | Partial<import("./store").WindowStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
7
- }, "setState"> & {
8
- setState(nextStateOrUpdater: import("./store").WindowStateWithActions | Partial<import("./store").WindowStateWithActions> | ((state: import("immer/dist/internal").WritableDraft<import("./store").WindowStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
9
- type: unknown;
10
- } | undefined): void;
11
- }) | null>;
12
- declare function WindowMFProvider(props: WindowProviderProps): import("react").JSX.Element;
13
- export { WindowMFProvider, WindowContext };
@@ -1,36 +0,0 @@
1
- import { ModuleAction, WindowToolsMF } from '../../../../../../../../contexts';
2
- import { Cookies, WindowBaseProps } from '../../../../../../../../types';
3
- import { NetworkProps } from '@m4l/core';
4
- import { DynamicMFStore } from '../DynamicMFParmsContext/store';
5
- import { AreaStore } from '../../../../contexts/AreaContext/store';
6
- import { AreasStore } from '../../../../../../../../contexts/AreasContext/store';
7
- export declare type WindowStatus = 'init' | 'loaded' | 'error';
8
- export interface WindowState extends WindowBaseProps {
9
- status: WindowStatus;
10
- dynamicMFStore: DynamicMFStore;
11
- areaStore: AreaStore;
12
- areasStore: AreasStore;
13
- version?: string;
14
- moduleActions: ModuleAction[];
15
- networkOperation: (props: NetworkProps) => Promise<any>;
16
- cookies: Cookies;
17
- }
18
- export interface WindowStateWithActions extends WindowState {
19
- actions: WindowToolsMF;
20
- internalActions: {
21
- loadCookiesFromApi: () => void;
22
- saveModuleCookies: () => void;
23
- };
24
- }
25
- declare type InitialStoreProps = Omit<WindowState, 'moduleActions' | 'cookies' | 'status'>;
26
- export declare const createWindowStore: (initProps: InitialStoreProps) => Omit<Omit<import("zustand").StoreApi<WindowStateWithActions>, "setState"> & {
27
- setState<A extends string | {
28
- type: unknown;
29
- }>(partial: WindowStateWithActions | Partial<WindowStateWithActions> | ((state: WindowStateWithActions) => WindowStateWithActions | Partial<WindowStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
30
- }, "setState"> & {
31
- setState(nextStateOrUpdater: WindowStateWithActions | Partial<WindowStateWithActions> | ((state: import("immer/dist/internal").WritableDraft<WindowStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
32
- type: unknown;
33
- } | undefined): void;
34
- };
35
- export declare type WindowStore = ReturnType<typeof createWindowStore>;
36
- export {};
@@ -1,5 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { WindowBaseProps } from '../../../../../../../../types';
3
- export interface WindowProviderProps extends WindowBaseProps {
4
- children: ReactNode;
5
- }
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { WindowProps } from '../../../../../../../../types';
3
- export declare const InnerForHooks: (props: WindowProps) => React.JSX.Element | null;
4
- export declare const MemonizedInnerForHooks: React.MemoExoticComponent<(props: WindowProps) => React.JSX.Element | null>;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { JSX_REACT_NODE } from '../../../../../../../../../../types';
3
- export declare const Component: (props: {
4
- component: JSX_REACT_NODE;
5
- }) => React.JSX.Element;
6
- export declare const MemonizedComponent: React.MemoExoticComponent<(props: {
7
- component: JSX_REACT_NODE;
8
- }) => React.JSX.Element>;
@@ -1,3 +0,0 @@
1
- import { ModuleAction } from '../../../../../../../../../../contexts';
2
- export declare function getMainActions(isDesktop: boolean | undefined, moduleActions: ModuleAction[]): ModuleAction[];
3
- export declare function getMenuActions(isDesktop: boolean | undefined, moduleActions: ModuleAction[], urlPrefix: string, saveModuleCookies: () => void, version?: string): ModuleAction[];
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare function Header(): import("react").JSX.Element;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare function MainActions(): import("react").JSX.Element;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { MFBaseProps } from '../../../../../../../../../../types';
3
- export declare const MicroFrontend: (props: MFBaseProps) => React.JSX.Element;
4
- export declare const MemonizedMF: React.MemoExoticComponent<(props: MFBaseProps) => React.JSX.Element>;
@@ -1,8 +0,0 @@
1
- import { WindowToolsMF } from '../../../../contexts/WindowToolsMFContext/types';
2
- import { MFBaseProps } from '../../../../../../../../../../types';
3
- import { DynamicMFStore } from '../../../../contexts/DynamicMFParmsContext/store';
4
- export interface MicroFrontendProps extends MFBaseProps {
5
- moduleId: string;
6
- dynamicMFStore?: DynamicMFStore;
7
- windowTools: WindowToolsMF;
8
- }
@@ -1,230 +0,0 @@
1
- import { createContext, useRef, useCallback, useEffect } from "react";
2
- import { createStore, useStore } from "zustand";
3
- import { shallow } from "zustand/shallow";
4
- import { useResponsiveDesktop, useFirstRender } from "@m4l/graphics";
5
- import { useHostTools, useModuleDictionary, useNetwork, useModuleSkeleton, EmitEvents } from "@m4l/core";
6
- import { devtools } from "zustand/middleware";
7
- import { immer } from "zustand/middleware/immer";
8
- import { g as getAreasDictionary } from "../../index.20cbd7b7.js";
9
- import { u as useAreasViewerUtilityClasses, a as useAreasAdminUtilityClasses } from "../../components/index.ffb147c7.js";
10
- import { jsx } from "react/jsx-runtime";
11
- const addArea = (state) => {
12
- let newName = "";
13
- const newId = `area_${new Date().getTime()}_${(Math.random() * 1e3).toFixed(0)}`;
14
- newName = `${state.getLabel(getAreasDictionary("label_new_area"))} ${state.areas.length + 1}`;
15
- state.areas.push({ id: newId, name: newName, loadWindows: false });
16
- state.currentArea = newId;
17
- if (state.loadAreasFromNetwork) {
18
- state.networkOperation({
19
- method: "POST",
20
- endPoint: `areas`,
21
- data: { id: newId, name: newName },
22
- toastSuccess: false,
23
- toastError: false
24
- });
25
- }
26
- return newId;
27
- };
28
- const updateOwnerStateClasses = (state) => {
29
- state.viwerClasses = useAreasViewerUtilityClasses(state.ownerState);
30
- state.adminClasses = useAreasAdminUtilityClasses(state.ownerState);
31
- };
32
- const createAreasStore = (initProps) => {
33
- const startProps = {
34
- viwerClasses: useAreasViewerUtilityClasses(initProps.ownerState),
35
- adminClasses: useAreasAdminUtilityClasses(initProps.ownerState),
36
- currentArea: "",
37
- areas: [],
38
- ...initProps
39
- };
40
- return createStore(
41
- devtools(
42
- immer((set, get) => ({
43
- ...startProps,
44
- actions: {
45
- init: () => {
46
- if (get().ownerState.status === "init") {
47
- if (!get().loadAreasFromNetwork) {
48
- get().actions.addArea();
49
- set((state) => {
50
- state.ownerState.status = "loaded";
51
- updateOwnerStateClasses(state);
52
- });
53
- } else {
54
- set((state) => {
55
- state.ownerState.status = "loading";
56
- updateOwnerStateClasses(state);
57
- state.networkOperation({
58
- method: "GET",
59
- endPoint: `areas`,
60
- parms: {},
61
- toastSuccess: false
62
- }).then((response) => {
63
- set((otherState) => {
64
- if (response?.data && Array.isArray(response.data) && response.data.length > 0) {
65
- otherState.areas = response.data;
66
- otherState.currentArea = response.data[0].id;
67
- } else {
68
- addArea(otherState);
69
- }
70
- });
71
- }).finally(() => {
72
- set((state2) => {
73
- state2.ownerState.status = "loaded";
74
- updateOwnerStateClasses(state2);
75
- });
76
- });
77
- });
78
- }
79
- }
80
- },
81
- addArea: () => {
82
- let newId = "";
83
- set((state) => {
84
- newId = addArea(state);
85
- });
86
- return newId;
87
- },
88
- deleteArea: (areaId) => {
89
- set((state) => {
90
- const removeIndex = state.areas.findIndex((area) => area.id === areaId);
91
- if (removeIndex > -1) {
92
- state.areas.splice(removeIndex, 1);
93
- }
94
- if (state.currentArea === areaId) {
95
- if (state.areas.length > 0) {
96
- state.currentArea = state.areas[0].id;
97
- } else {
98
- state.currentArea = "";
99
- }
100
- }
101
- if (state.loadAreasFromNetwork) {
102
- state.networkOperation({
103
- method: "DELETE",
104
- endPoint: `areas/${areaId}`,
105
- parms: {},
106
- toastSuccess: false,
107
- toastError: false
108
- });
109
- }
110
- });
111
- },
112
- selectArea: (newAreaId) => {
113
- set((state) => {
114
- if (state.areas.findIndex((area) => area.id === newAreaId) > -1) {
115
- state.currentArea = newAreaId;
116
- }
117
- });
118
- }
119
- },
120
- internalActions: {
121
- setHandlerGetLabel: (newHandler) => {
122
- set((state) => {
123
- state.getLabel = newHandler;
124
- });
125
- },
126
- setAreaLink: (areaId, store) => {
127
- set((state) => {
128
- const areaIndex = state.areas.findIndex((area) => area.id === areaId);
129
- if (areaIndex > -1) {
130
- state.areas[areaIndex].store = store;
131
- state.areas[areaIndex].linked = true;
132
- }
133
- });
134
- },
135
- setExternalState: (newExternalState) => {
136
- set((state) => {
137
- state.ownerState = { ...state.ownerState, ...newExternalState };
138
- updateOwnerStateClasses(state);
139
- });
140
- }
141
- }
142
- })),
143
- { name: `Areas store` }
144
- )
145
- );
146
- };
147
- const AreasContext = createContext(null);
148
- function AreasProvider(props) {
149
- const {
150
- children,
151
- loadAreasFromNetwork,
152
- loadCookiesFromNetwork,
153
- onLoad
154
- } = props;
155
- const {
156
- events_add_listener,
157
- events_remove_listener
158
- } = useHostTools();
159
- const {
160
- getLabel
161
- } = useModuleDictionary();
162
- const {
163
- networkOperation
164
- } = useNetwork();
165
- const isDesktop = useResponsiveDesktop();
166
- const isSkeleton = useModuleSkeleton();
167
- const isFirstRender = useFirstRender([getLabel]);
168
- const areasStoreRef = useRef();
169
- if (!areasStoreRef.current) {
170
- areasStoreRef.current = createAreasStore({
171
- getLabel,
172
- loadAreasFromNetwork,
173
- loadCookiesFromNetwork,
174
- networkOperation,
175
- ownerState: {
176
- status: "init",
177
- isMobile: !isDesktop,
178
- isSkeleton
179
- }
180
- });
181
- areasStoreRef.current?.getState().actions.init();
182
- }
183
- const status = useStore(areasStoreRef.current, (state) => state.ownerState.status, shallow);
184
- const {
185
- setHandlerGetLabel
186
- } = useStore(areasStoreRef.current, (state) => state.internalActions, shallow);
187
- const addWindow = useCallback((newWindow) => {
188
- const currentArea = areasStoreRef.current?.getState().currentArea;
189
- const areas = areasStoreRef.current?.getState().areas;
190
- if (currentArea && areas) {
191
- const areaIndex = areas.findIndex((area) => area.id == currentArea);
192
- if (areaIndex > -1 && areas[areaIndex].store) {
193
- areas[areaIndex].store?.getState().actions.addWindow(newWindow);
194
- }
195
- }
196
- }, []);
197
- useEffect(() => {
198
- if (status === "loaded") {
199
- onLoad && onLoad();
200
- }
201
- }, [status]);
202
- useEffect(() => {
203
- if (!isFirstRender) {
204
- setHandlerGetLabel(getLabel);
205
- }
206
- }, [getLabel]);
207
- useEffect(() => {
208
- events_add_listener(EmitEvents.EMMIT_EVENT_HOST_EMERGE_WINDOW, addWindow);
209
- return () => {
210
- events_remove_listener(EmitEvents.EMMIT_EVENT_HOST_EMERGE_WINDOW, addWindow);
211
- };
212
- }, []);
213
- useEffect(() => {
214
- if (isFirstRender) {
215
- return;
216
- }
217
- areasStoreRef.current?.getState().internalActions.setExternalState({
218
- isMobile: !isDesktop,
219
- isSkeleton
220
- });
221
- }, [isDesktop, isSkeleton]);
222
- return /* @__PURE__ */ jsx(AreasContext.Provider, {
223
- value: areasStoreRef.current,
224
- children
225
- });
226
- }
227
- export {
228
- AreasContext as A,
229
- AreasProvider as a
230
- };
@@ -1,2 +0,0 @@
1
- import "./AreasContext/index.7c12b512.js";
2
- import "../components/index.ffb147c7.js";
@@ -1,26 +0,0 @@
1
- import { useContext } from "react";
2
- import { useStore } from "zustand";
3
- import { W as WindowContext, b as WindowToolsMFContext } from "../components/index.ffb147c7.js";
4
- const useWindow = () => {
5
- const context = useContext(WindowContext);
6
- if (!context)
7
- throw new Error("useWindow context must be use inside WindowContext");
8
- return context;
9
- };
10
- function useWindowStore(selector, equalityFn) {
11
- const store = useContext(WindowContext);
12
- if (!store)
13
- throw new Error("useWindow context must be use inside WindowContext");
14
- return useStore(store, selector, equalityFn);
15
- }
16
- const useWindowToolsMF = () => {
17
- const context = useContext(WindowToolsMFContext);
18
- if (!context)
19
- throw new Error("useWindowToolsMF context must be use inside WindowToolsMFContext");
20
- return context;
21
- };
22
- export {
23
- useWindow as a,
24
- useWindowStore as b,
25
- useWindowToolsMF as u
26
- };
@@ -1,34 +0,0 @@
1
- import { useContext } from "react";
2
- import { useStore } from "zustand";
3
- import { A as AreasContext } from "../../contexts/AreasContext/index.7c12b512.js";
4
- import { A as AreaContext } from "../../components/index.ffb147c7.js";
5
- function useAreas() {
6
- const context = useContext(AreasContext);
7
- if (!context)
8
- throw new Error("useAreas context must be use inside AreasContext");
9
- return context;
10
- }
11
- function useAreasStore(selector, equalityFn) {
12
- const context = useContext(AreasContext);
13
- if (!context)
14
- throw new Error("useAreasStore context must be use inside AreasContext");
15
- return useStore(context, selector, equalityFn);
16
- }
17
- const useArea = () => {
18
- const context = useContext(AreaContext);
19
- if (!context)
20
- throw new Error("useArea context must be use inside AreaContext");
21
- return context;
22
- };
23
- function useAreaStore(selector, equalityFn) {
24
- const context = useContext(AreaContext);
25
- if (!context)
26
- throw new Error("useAreaStore context must be use inside AreaContext");
27
- return useStore(context, selector, equalityFn);
28
- }
29
- export {
30
- useArea as a,
31
- useAreas as b,
32
- useAreaStore as c,
33
- useAreasStore as u
34
- };
@@ -1,11 +0,0 @@
1
- import { AreaStateWithActions } from '../../components/AreasViewer/subcomponents/Area/contexts/AreaContext/types';
2
- export declare const useArea: () => Omit<Omit<import("zustand").StoreApi<AreaStateWithActions>, "setState"> & {
3
- setState<A extends string | {
4
- type: unknown;
5
- }>(partial: AreaStateWithActions | Partial<AreaStateWithActions> | ((state: AreaStateWithActions) => AreaStateWithActions | Partial<AreaStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
6
- }, "setState"> & {
7
- setState(nextStateOrUpdater: AreaStateWithActions | Partial<AreaStateWithActions> | ((state: import("immer/dist/internal").WritableDraft<AreaStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
8
- type: unknown;
9
- } | undefined): void;
10
- };
11
- export declare function useAreaStore<T>(selector: (state: AreaStateWithActions) => T, equalityFn?: (left: T, right: T) => boolean): T;
@@ -1,11 +0,0 @@
1
- import { WindowStateWithActions } from '../../components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts/WindowContext/store';
2
- export declare const useWindow: () => Omit<Omit<import("zustand").StoreApi<WindowStateWithActions>, "setState"> & {
3
- setState<A extends string | {
4
- type: unknown;
5
- }>(partial: WindowStateWithActions | Partial<WindowStateWithActions> | ((state: WindowStateWithActions) => WindowStateWithActions | Partial<WindowStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
6
- }, "setState"> & {
7
- setState(nextStateOrUpdater: WindowStateWithActions | Partial<WindowStateWithActions> | ((state: import("immer/dist/internal").WritableDraft<WindowStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
8
- type: unknown;
9
- } | undefined): void;
10
- };
11
- export declare function useWindowStore<T>(selector: (state: WindowStateWithActions) => T, equalityFn?: (left: T, right: T) => boolean): T;
@@ -1,24 +0,0 @@
1
- import "@mui/material";
2
- import "../../react-draggable.de1aac90.js";
3
- import "react";
4
- import "../../contexts/ModalContext/index.76d5ccee.js";
5
- import "../ModalDialog/index.4d663d0a.js";
6
- import "../Resizeable/index.ff97422e.js";
7
- import "react/jsx-runtime";
8
- import "@m4l/graphics";
9
- import "@m4l/core";
10
- import "../CommonActions/components/Actions/index.1b2a0921.js";
11
- import "@mui/material/Button";
12
- import "../mui_extended/Button/index.b34c8b68.js";
13
- import "clsx";
14
- import "react-hook-form";
15
- import "./WindowBase.7ce0b21e.js";
16
- import "../Icon/index.952f0635.js";
17
- import "../mui_extended/IconButton/index.917f0d3c.js";
18
- import "zustand";
19
- import "../areas/contexts/AreasContext/index.7c12b512.js";
20
- import "../areas/components/index.ffb147c7.js";
21
- import "zustand/shallow";
22
- import "@mui/lab";
23
- import "../mui_extended/Typography/index.79e2b06f.js";
24
- import "./WindowConfirm.7ae1326f.js";
@@ -1,19 +0,0 @@
1
- import "@mui/material";
2
- import "react";
3
- import "@m4l/core";
4
- import "../Icon/index.952f0635.js";
5
- import "react/jsx-runtime";
6
- import "./IconButton/index.917f0d3c.js";
7
- import "clsx";
8
- import "./Accordion/index.51feece8.js";
9
- import "./Avatar/index.fe06afd7.js";
10
- import "react-router-dom";
11
- import "@mui/material/Button";
12
- import "./Button/index.b34c8b68.js";
13
- import "../Image/index.f30f79f0.js";
14
- import "@mui/lab";
15
- import "./Typography/index.79e2b06f.js";
16
- import "./Popover/index.226f247e.js";
17
- import "./MenuActions/index.651dec44.js";
18
- import "./Pager/index.e0663072.js";
19
- import "./Tab/index.e0653a0a.js";