@m4l/components 0.1.69 → 0.1.71

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 (141) hide show
  1. package/@types/export.d.ts +27 -1
  2. package/components/CommonActions/components/ActionCancel/{index.e83053da.js → index.ff90f2c0.js} +2 -2
  3. package/components/CommonActions/components/ActionFormCancel/{index.ca378b0a.js → index.392a17c0.js} +26 -13
  4. package/components/CommonActions/components/ActionFormIntro/{index.fa2107df.js → index.f88d8849.js} +2 -2
  5. package/components/CommonActions/components/ActionIntro/{index.b8d5c8ee.js → index.e31ab7e9.js} +3 -3
  6. package/components/CommonActions/components/Actions/{index.1b2a0921.js → index.6b7d480a.js} +24 -13
  7. package/components/DataGrid/{index.75ea6038.js → index.77ae9b4c.js} +23 -20
  8. package/components/DynamicFilter/{index.aaeea668.js → index.b2ba5167.js} +53 -108
  9. package/components/HelperText/{index.742d547d.js → index.d7b1b21a.js} +11 -10
  10. package/components/Icon/{index.952f0635.js → index.6f2a5618.js} +6 -4
  11. package/components/Icon/types.d.ts +1 -0
  12. package/components/Image/{index.f30f79f0.js → index.1e3b7ff6.js} +3 -3
  13. package/components/LanguagePopover/{index.526e544e.js → index.310e9a3a.js} +11 -11
  14. package/components/ModalDialog/{index.4d663d0a.js → index.598f9a86.js} +19 -5
  15. package/components/NavLink/{index.92008184.js → index.ac3778af.js} +12 -11
  16. package/components/NoItemSelected/{index.6f2952ab.js → index.3809e3d1.js} +1 -1
  17. package/components/ObjectLogs/{index.d1eee18b.js → index.949d3595.js} +18 -15
  18. package/components/PaperForm/{index.e9db704b.js → index.cf8af08b.js} +1 -1
  19. package/components/Period/{index.3ff6f53b.js → index.53ea0562.js} +25 -14
  20. package/components/Resizeable/{index.ff97422e.js → index.ff4ce7a4.js} +20 -6
  21. package/components/SideBar/{index.365f64f0.js → index.4daafbab.js} +59 -58
  22. package/components/SideBar/subcomponents/ContentMobile/subcomponents/Drawer.d.ts +3 -0
  23. package/components/SideBar/subcomponents/ContentMobile/subcomponents/types.d.ts +8 -0
  24. package/components/areas/components/AreasAdmin/classes/types.d.ts +1 -0
  25. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/styles.d.ts +4 -0
  26. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/types.d.ts +5 -0
  27. package/components/areas/components/AreasViewer/classes/index.d.ts +1 -1
  28. package/components/areas/components/AreasViewer/classes/types.d.ts +3 -0
  29. package/components/areas/components/AreasViewer/subcomponents/Area/index.d.ts +2 -2
  30. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/GridLayout/index.d.ts +2 -1
  31. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/GridLayout/types.d.ts +3 -0
  32. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/InnerForHooks/index.d.ts +2 -1
  33. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/InnerForHooks/types.d.ts +3 -0
  34. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/PanelWindows/index.d.ts +2 -1
  35. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/PanelWindows/types.d.ts +3 -0
  36. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/index.d.ts +1 -1
  37. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/styles.d.ts +2 -0
  38. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Component/index.d.ts +4 -0
  39. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Component/types.d.ts +9 -0
  40. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/helper.d.ts +3 -0
  41. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/index.d.ts +9 -0
  42. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/MainActions/index.d.ts +6 -0
  43. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/index.d.ts +4 -0
  44. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/{InnerForHooks/subcomponents/MicroFrontend → MicroFrontend}/subcomponents/MFLoader/index.d.ts +2 -2
  45. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/types.d.ts +8 -0
  46. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/types.d.ts +8 -0
  47. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/types.d.ts +2 -0
  48. package/components/areas/components/AreasViewer/subcomponents/Area/types.d.ts +4 -0
  49. package/components/areas/components/{index.ffb147c7.js → index.31f39977.js} +601 -1034
  50. package/components/areas/components/index.d.ts +1 -1
  51. package/components/areas/contexts/AreasContext/helper.d.ts +59 -0
  52. package/components/areas/contexts/AreasContext/index.e14d6799.js +1030 -0
  53. package/components/areas/contexts/AreasContext/store.d.ts +1 -2
  54. package/components/areas/contexts/AreasContext/types.d.ts +91 -13
  55. package/components/areas/contexts/DynamicMFParmsContext/index.1607c78e.js +42 -0
  56. package/components/areas/contexts/DynamicMFParmsContext/index.d.ts +8 -0
  57. package/components/areas/{components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts → contexts}/DynamicMFParmsContext/store.d.ts +3 -9
  58. package/components/areas/contexts/WindowToolsMFContext/index.8f3e2a04.js +20 -0
  59. package/components/areas/{components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts → contexts}/WindowToolsMFContext/types.d.ts +3 -2
  60. package/components/areas/contexts/index.5ba05323.js +2 -0
  61. package/components/areas/contexts/index.d.ts +4 -4
  62. package/components/areas/dictionary.d.ts +3 -0
  63. package/components/areas/hooks/index.ae8d8631.js +13 -0
  64. package/components/areas/hooks/useArea/index.c135e0cf.js +12 -0
  65. package/components/areas/hooks/useDynamicMFParameters/index.d.ts +3 -9
  66. package/components/areas/hooks/useDynamicMFParameters/{index.7ce7176f.js → index.e52c5392.js} +1 -1
  67. package/components/areas/hooks/useWindowToolsMF/index.d.ts +1 -1
  68. package/components/areas/icons.d.ts +5 -0
  69. package/components/areas/{index.20cbd7b7.js → index.bd29b1db.js} +21 -9
  70. package/components/areas/types.d.ts +32 -23
  71. package/components/formatters/BooleanFormatter/{index.d5e21bdd.js → index.99c7fe49.js} +1 -1
  72. package/components/formatters/{index.650243bb.js → index.1a92006b.js} +3 -2
  73. package/components/hook-form/RHFAutocomplete/{index.21377a2c.js → index.c4ba070a.js} +12 -11
  74. package/components/hook-form/RHFAutocompleteAsync/{index.8c7e0842.js → index.a63f3704.js} +2 -2
  75. package/components/hook-form/RHFCheckbox/{index.83902d07.js → index.9055f88d.js} +3 -3
  76. package/components/hook-form/RHFDateTime/{index.166250d8.js → index.2cb94a66.js} +10 -10
  77. package/components/hook-form/RHFPeriod/{index.61baf76f.js → index.14dcf762.js} +2 -2
  78. package/components/hook-form/RHFTextField/{index.55687a39.js → index.7ce2b16e.js} +7 -7
  79. package/components/hook-form/RHFUpload/{index.eb4d0dac.js → index.c57a43f8.js} +1 -1
  80. package/components/modal/WindowBase/subcomponents/Header/types.d.ts +1 -1
  81. package/components/modal/WindowBase/types.d.ts +1 -0
  82. package/components/modal/{WindowBase.7ce0b21e.js → WindowBase.32d35d71.js} +28 -21
  83. package/components/modal/{WindowConfirm.7ae1326f.js → WindowConfirm.70bcbb69.js} +18 -15
  84. package/components/modal/index.ef3aa9ac.js +35 -0
  85. package/components/mui_extended/Accordion/{index.51feece8.js → index.44e96bb8.js} +2 -2
  86. package/components/mui_extended/Button/{index.b34c8b68.js → index.ec6525e0.js} +6 -4
  87. package/components/mui_extended/Button/types.d.ts +2 -0
  88. package/components/mui_extended/IconButton/{index.917f0d3c.js → index.7aab3e04.js} +7 -5
  89. package/components/mui_extended/MenuActions/{index.651dec44.js → index.bff47c06.js} +3 -3
  90. package/components/mui_extended/Pager/{index.e0663072.js → index.907d5801.js} +1 -1
  91. package/components/mui_extended/Popover/{index.226f247e.js → index.9f35d0eb.js} +1 -3
  92. package/components/mui_extended/Popover/types.d.ts +6 -2
  93. package/components/mui_extended/Typography/{index.79e2b06f.js → index.d5e0f69f.js} +1 -1
  94. package/components/mui_extended/index.1f766f93.js +20 -0
  95. package/contexts/ModalContext/{index.76d5ccee.js → index.fca184e2.js} +1 -1
  96. package/contexts/index.d.ts +1 -1
  97. package/hooks/useModal/{index.043e419b.js → index.9b244379.js} +1 -1
  98. package/index.js +101 -99
  99. package/package.json +5 -4
  100. package/{react-draggable.de1aac90.js → react-draggable.29f78f6d.js} +1 -1
  101. package/{react-resizable.e0470767.js → react-resizable.baf54eb2.js} +3 -3
  102. package/utils/{index.b5c62ef0.js → index.ee16888d.js} +1 -1
  103. package/{vendor.6a33c6d2.js → vendor.619c3533.js} +50 -48
  104. package/components/DynamicFilter/subcomponents/fieldstypes/BooleanFilter/styles.d.ts +0 -2
  105. package/components/DynamicFilter/subcomponents/fieldstypes/DateTimeFilter/styles.d.ts +0 -2
  106. package/components/DynamicFilter/subcomponents/fieldstypes/NumberFilter/styles.d.ts +0 -2
  107. package/components/DynamicFilter/subcomponents/fieldstypes/StringFilter/styles.d.ts +0 -2
  108. package/components/areas/components/AreasViewer/subcomponents/Area/contexts/AreaContext/helper.d.ts +0 -39
  109. package/components/areas/components/AreasViewer/subcomponents/Area/contexts/AreaContext/index.d.ts +0 -20
  110. package/components/areas/components/AreasViewer/subcomponents/Area/contexts/AreaContext/store.d.ts +0 -11
  111. package/components/areas/components/AreasViewer/subcomponents/Area/contexts/AreaContext/types.d.ts +0 -82
  112. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts/DynamicMFParmsContext/index.d.ts +0 -14
  113. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts/WindowContext/helper.d.ts +0 -1
  114. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts/WindowContext/index.d.ts +0 -13
  115. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts/WindowContext/store.d.ts +0 -36
  116. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts/WindowContext/types.d.ts +0 -5
  117. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/index.d.ts +0 -4
  118. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/Component/index.d.ts +0 -8
  119. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/Header/helper.d.ts +0 -3
  120. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/Header/index.d.ts +0 -2
  121. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/Header/subcomponents/MainActions/index.d.ts +0 -2
  122. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/MicroFrontend/index.d.ts +0 -4
  123. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/MicroFrontend/types.d.ts +0 -8
  124. package/components/areas/contexts/AreasContext/index.7c12b512.js +0 -230
  125. package/components/areas/contexts/index.1a823ffb.js +0 -2
  126. package/components/areas/hooks/index.d09ea7de.js +0 -26
  127. package/components/areas/hooks/useArea/index.3a0d4b8c.js +0 -34
  128. package/components/areas/hooks/useArea/index.d.ts +0 -11
  129. package/components/areas/hooks/useWindow/index.d.ts +0 -11
  130. package/components/modal/index.d6dcd1b1.js +0 -24
  131. package/components/mui_extended/index.8b30e8c8.js +0 -19
  132. /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/{InnerForHooks/subcomponents/Header → Header}/skeleton.d.ts +0 -0
  133. /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/{InnerForHooks/subcomponents/Header → Header}/styles.d.ts +0 -0
  134. /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/{InnerForHooks/subcomponents/MicroFrontend → MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/index.d.ts +0 -0
  135. /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/{InnerForHooks/subcomponents/MicroFrontend → MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/styles.d.ts +0 -0
  136. /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
  137. /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
  138. /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
  139. /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/{InnerForHooks/subcomponents/MicroFrontend → MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/types.d.ts +0 -0
  140. /package/components/areas/{components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts → contexts}/DynamicMFParmsContext/types.d.ts +0 -0
  141. /package/components/areas/{components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts → contexts}/WindowToolsMFContext/index.d.ts +0 -0
@@ -1,11 +0,0 @@
1
- import type { AreaStateWithActions, InitialStoreProps } from './types';
2
- export declare const createAreaStore: (initProps: InitialStoreProps) => 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 type AreaStore = ReturnType<typeof createAreaStore>;
@@ -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";