@m4l/layouts 0.1.22 → 0.1.25

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 (146) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc.cjs +118 -0
  3. package/.gitignore +23 -0
  4. package/.gitlab-ci.yml +16 -0
  5. package/.prettierignore +3 -0
  6. package/.prettierrc.json +26 -0
  7. package/.vscode/settings.json +50 -0
  8. package/dist/components/BaseModule/index.6309486a.js +33 -0
  9. package/dist/components/BaseModule/index.d.ts +4 -0
  10. package/dist/components/BaseModule/types.d.ts +9 -0
  11. package/dist/components/MFHostApp/index.1700d13a.js +69 -0
  12. package/{components → dist/components}/MFHostApp/types.d.ts +3 -7
  13. package/dist/components/MFIsolationApp/index.b21e5671.js +151 -0
  14. package/dist/components/MFIsolationApp/types.d.ts +11 -0
  15. package/dist/components/index.d.ts +4 -0
  16. package/dist/components/index.deb4e7ac.js +6 -0
  17. package/{contexts → dist/contexts}/AuthContext/types.d.ts +1 -1
  18. package/dist/contexts/index.b46a2699.js +1 -0
  19. package/dist/hooks/index.2022a179.js +4 -0
  20. package/{hooks/useMasterDetail/index.8e9e900b.js → dist/hooks/useMasterDetail/index.1b024fd5.js} +1 -1
  21. package/{hooks/useModule/index.096d7d13.js → dist/hooks/useModule/index.6ff7d08a.js} +1 -1
  22. package/dist/index.js +41 -0
  23. package/dist/layouts/MasterDetailLayout/index.3da0ffda.js +104 -0
  24. package/{layouts → dist/layouts}/ModuleLayout/contexts/ModuleContext/types.d.ts +2 -7
  25. package/dist/layouts/ModuleLayout/index.a76397df.js +101 -0
  26. package/dist/layouts/ModuleLayout/types.d.ts +15 -0
  27. package/dist/layouts/index.014e41ba.js +8 -0
  28. package/{layouts → dist/layouts}/index.d.ts +0 -1
  29. package/dist/package.json +36 -0
  30. package/package.json +57 -12
  31. package/src/@types/index.ts +8 -0
  32. package/src/components/BaseModule/index.tsx +59 -0
  33. package/src/components/BaseModule/types.ts +12 -0
  34. package/src/components/MFHostApp/index.tsx +95 -0
  35. package/src/components/MFHostApp/types.ts +16 -0
  36. package/src/components/MFIsolationApp/index.tsx +164 -0
  37. package/src/components/MFIsolationApp/subcomponents/MFAuthApp/index.tsx +98 -0
  38. package/src/components/MFIsolationApp/subcomponents/MFAuthApp/types.ts +7 -0
  39. package/src/components/MFIsolationApp/types.ts +12 -0
  40. package/src/components/index.ts +5 -0
  41. package/src/contexts/AuthContext/index.tsx +189 -0
  42. package/src/contexts/AuthContext/types.ts +65 -0
  43. package/src/contexts/index.ts +1 -0
  44. package/src/hooks/index.ts +5 -0
  45. package/src/hooks/useAuth/index.ts +12 -0
  46. package/src/hooks/useMasterDetail/index.ts +6 -0
  47. package/src/hooks/useModule/index.ts +13 -0
  48. package/src/index.ts +7 -0
  49. package/src/layouts/MasterDetailLayout/components/ButtonDetail/index.tsx +38 -0
  50. package/src/layouts/MasterDetailLayout/contexts/MasterDetailContext/index.tsx +34 -0
  51. package/src/layouts/MasterDetailLayout/contexts/MasterDetailContext/types.ts +19 -0
  52. package/src/layouts/MasterDetailLayout/dicctionary.ts +20 -0
  53. package/src/layouts/MasterDetailLayout/index.tsx +165 -0
  54. package/src/layouts/MasterDetailLayout/types.ts +11 -0
  55. package/src/layouts/ModuleLayout/contexts/ModuleContext/index.tsx +56 -0
  56. package/src/layouts/ModuleLayout/contexts/ModuleContext/types.ts +23 -0
  57. package/src/layouts/ModuleLayout/dicctionary.ts +11 -0
  58. package/src/layouts/ModuleLayout/index.tsx +59 -0
  59. package/src/layouts/ModuleLayout/subcomponents/InnerModule/index.tsx +35 -0
  60. package/src/layouts/ModuleLayout/subcomponents/InnerModule/styles.tsx +31 -0
  61. package/src/layouts/ModuleLayout/subcomponents/InnerModule/types.ts +11 -0
  62. package/src/layouts/ModuleLayout/types.ts +31 -0
  63. package/src/layouts/NoAuthModuleLayout/dicctionary.ts +9 -0
  64. package/src/layouts/NoAuthModuleLayout/index.tsx +85 -0
  65. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/index.tsx +43 -0
  66. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/styles.tsx +6 -0
  67. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/index.tsx +14 -0
  68. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/styles.tsx +7 -0
  69. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/AppBar/index.tsx +25 -0
  70. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/AppBar/styles.tsx +11 -0
  71. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/index.tsx +17 -0
  72. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/styles.tsx +19 -0
  73. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/subcomponents/NameDescription/index.tsx +25 -0
  74. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/subcomponents/NameDescription/styles.tsx +8 -0
  75. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/types.ts +5 -0
  76. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/types.ts +5 -0
  77. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/LogoLeyend/index.tsx +28 -0
  78. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/LogoLeyend/styles.tsx +16 -0
  79. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/types.ts +5 -0
  80. package/src/layouts/NoAuthModuleLayout/types.ts +22 -0
  81. package/src/layouts/index.ts +8 -0
  82. package/src/test/setup.ts +1 -0
  83. package/src/test/utils.tsx +20 -0
  84. package/src/vite-env.d.ts +3 -0
  85. package/tsconfig.json +29 -0
  86. package/tsconfig.node.json +8 -0
  87. package/vite.config.ts +172 -0
  88. package/components/MFHostApp/index.b3c15ec3.js +0 -52
  89. package/components/MFIsolationApp/index.28f538a3.js +0 -106
  90. package/components/MFIsolationApp/types.d.ts +0 -10
  91. package/components/index.d.ts +0 -3
  92. package/index.js +0 -38
  93. package/layouts/MasterDetailLayout/components/ButtonDetail/index.d.ts +0 -3
  94. package/layouts/MasterDetailLayout/index.71de0dc7.js +0 -141
  95. package/layouts/ModuleLayout/index.842072c5.js +0 -348
  96. package/layouts/ModuleLayout/subcomponents/InnerModule/subcomponents/Header/index.d.ts +0 -2
  97. package/layouts/ModuleLayout/subcomponents/InnerModule/subcomponents/Header/skeleton.d.ts +0 -2
  98. package/layouts/ModuleLayout/subcomponents/InnerModule/subcomponents/Header/styles.d.ts +0 -8
  99. package/layouts/ModuleLayout/subcomponents/InnerModule/subcomponents/Header/types.d.ts +0 -2
  100. package/layouts/ModuleLayout/types.d.ts +0 -29
  101. package/node_modules.26043cf4.js +0 -1601
  102. package/vendor.95e38403.js +0 -20
  103. /package/{components → dist/components}/MFHostApp/index.d.ts +0 -0
  104. /package/{components → dist/components}/MFIsolationApp/index.d.ts +0 -0
  105. /package/{components → dist/components}/MFIsolationApp/subcomponents/MFAuthApp/index.d.ts +0 -0
  106. /package/{components → dist/components}/MFIsolationApp/subcomponents/MFAuthApp/types.d.ts +0 -0
  107. /package/{contexts → dist/contexts}/AuthContext/index.6f966215.js +0 -0
  108. /package/{contexts → dist/contexts}/AuthContext/index.d.ts +0 -0
  109. /package/{contexts → dist/contexts}/index.d.ts +0 -0
  110. /package/{hooks → dist/hooks}/index.d.ts +0 -0
  111. /package/{hooks → dist/hooks}/useAuth/index.cb6a3420.js +0 -0
  112. /package/{hooks → dist/hooks}/useAuth/index.d.ts +0 -0
  113. /package/{hooks → dist/hooks}/useMasterDetail/index.d.ts +0 -0
  114. /package/{hooks → dist/hooks}/useModule/index.d.ts +0 -0
  115. /package/{index.d.ts → dist/index.d.ts} +0 -0
  116. /package/{layouts → dist/layouts}/MasterDetailLayout/contexts/MasterDetailContext/index.d.ts +0 -0
  117. /package/{layouts → dist/layouts}/MasterDetailLayout/contexts/MasterDetailContext/types.d.ts +0 -0
  118. /package/{layouts → dist/layouts}/MasterDetailLayout/dicctionary.d.ts +0 -0
  119. /package/{layouts → dist/layouts}/MasterDetailLayout/index.d.ts +0 -0
  120. /package/{layouts → dist/layouts}/MasterDetailLayout/types.d.ts +0 -0
  121. /package/{layouts → dist/layouts}/ModuleLayout/contexts/ModuleContext/index.d.ts +0 -0
  122. /package/{layouts → dist/layouts}/ModuleLayout/dicctionary.d.ts +0 -0
  123. /package/{layouts → dist/layouts}/ModuleLayout/index.d.ts +0 -0
  124. /package/{layouts → dist/layouts}/ModuleLayout/subcomponents/InnerModule/index.d.ts +0 -0
  125. /package/{layouts → dist/layouts}/ModuleLayout/subcomponents/InnerModule/styles.d.ts +0 -0
  126. /package/{layouts → dist/layouts}/ModuleLayout/subcomponents/InnerModule/types.d.ts +0 -0
  127. /package/{layouts → dist/layouts}/NoAuthModuleLayout/dicctionary.d.ts +0 -0
  128. /package/{layouts → dist/layouts}/NoAuthModuleLayout/index.5d1098ef.js +0 -0
  129. /package/{layouts → dist/layouts}/NoAuthModuleLayout/index.d.ts +0 -0
  130. /package/{layouts → dist/layouts}/NoAuthModuleLayout/subcomponents/InnerModule/index.d.ts +0 -0
  131. /package/{layouts → dist/layouts}/NoAuthModuleLayout/subcomponents/InnerModule/styles.d.ts +0 -0
  132. /package/{layouts → dist/layouts}/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/index.d.ts +0 -0
  133. /package/{layouts → dist/layouts}/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/styles.d.ts +0 -0
  134. /package/{layouts → dist/layouts}/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/AppBar/index.d.ts +0 -0
  135. /package/{layouts → dist/layouts}/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/AppBar/styles.d.ts +0 -0
  136. /package/{layouts → dist/layouts}/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/index.d.ts +0 -0
  137. /package/{layouts → dist/layouts}/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/styles.d.ts +0 -0
  138. /package/{layouts → dist/layouts}/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/subcomponents/NameDescription/index.d.ts +0 -0
  139. /package/{layouts → dist/layouts}/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/subcomponents/NameDescription/styles.d.ts +0 -0
  140. /package/{layouts → dist/layouts}/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/types.d.ts +0 -0
  141. /package/{layouts → dist/layouts}/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/types.d.ts +0 -0
  142. /package/{layouts → dist/layouts}/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/LogoLeyend/index.d.ts +0 -0
  143. /package/{layouts → dist/layouts}/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/LogoLeyend/styles.d.ts +0 -0
  144. /package/{layouts → dist/layouts}/NoAuthModuleLayout/subcomponents/InnerModule/types.d.ts +0 -0
  145. /package/{layouts → dist/layouts}/NoAuthModuleLayout/types.d.ts +0 -0
  146. /package/{vite-env.d.ts → dist/vite-env.d.ts} +0 -0
@@ -0,0 +1,17 @@
1
+ // import { useDomain } from '@m4l/core';
2
+ // import { useResponsive } from '@m4l/graphics';
3
+ import { WrapperFormScroll, WrapperForm } from './styles';
4
+ import { NameDescription } from './subcomponents/NameDescription';
5
+ import { WrapperFormScrollProps } from './types';
6
+
7
+ export const Form = (props: WrapperFormScrollProps) => {
8
+ const { children } = props;
9
+ return (
10
+ <WrapperFormScroll>
11
+ <WrapperForm>
12
+ <NameDescription />
13
+ {children}
14
+ </WrapperForm>
15
+ </WrapperFormScroll>
16
+ );
17
+ };
@@ -0,0 +1,19 @@
1
+ import { styled } from '@mui/material/styles';
2
+
3
+ export const WrapperFormScroll = styled('div')(() => ({
4
+ display: 'flex',
5
+ overflow: 'auto',
6
+ width: '100%',
7
+ height: '100%',
8
+ justifyContent: 'center',
9
+ }));
10
+
11
+ export const WrapperForm = styled('div')(({ theme }) => ({
12
+ display: 'flex',
13
+ width: '100%',
14
+ height: 'auto',
15
+ margin: 'auto',
16
+ maxWidth: '480px',
17
+ flexDirection: 'column',
18
+ gap: theme.spacing(3),
19
+ }));
@@ -0,0 +1,25 @@
1
+ // import { useDomain } from '@m4l/core';
2
+ // import { useResponsive } from '@m4l/graphics';
3
+ import { Typography } from '@m4l/components';
4
+ import { useModuleDictionary } from '@m4l/core';
5
+ import { WrapperNameDescription } from './styles';
6
+ export const NameDescription = () => {
7
+ /* const downMd = useResponsive('down', 'md'); */
8
+
9
+ const { getModuleLabel, getLabel } = useModuleDictionary();
10
+ return (
11
+ <WrapperNameDescription>
12
+ <Typography
13
+ key={'ModuleName'}
14
+ variant="h4"
15
+ skeletonWidth={'35%'}
16
+ skeletongHeight={'36px'}
17
+ >
18
+ {getModuleLabel()}
19
+ </Typography>
20
+ <Typography key={'ModuleDescription'} skeletonWidth={'60%'} skeletongHeight={'21px'}>
21
+ {getLabel('module_description')}
22
+ </Typography>
23
+ </WrapperNameDescription>
24
+ );
25
+ };
@@ -0,0 +1,8 @@
1
+ import { styled } from '@mui/material/styles';
2
+
3
+ export const WrapperNameDescription = styled('div')(({ theme }) => ({
4
+ display: 'flex',
5
+ flexDirection: 'column',
6
+ gap: theme.spacing(2),
7
+ padding: theme.spacing(0, 3),
8
+ }));
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ export interface WrapperFormScrollProps {
4
+ children: ReactNode;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ export interface WrapperAppBarFormProps {
4
+ children: ReactNode;
5
+ }
@@ -0,0 +1,28 @@
1
+ import { Image, Typography } from '@m4l/components';
2
+ import { useBase, useModuleDictionary } from '@m4l/core';
3
+ import { NoAuthBaseProviderProps } from '../../../../types';
4
+ import { WrapperLogoLeyend } from './styles';
5
+
6
+ export const LogoLeyend = () => {
7
+ const { getLabel } = useModuleDictionary();
8
+ const { companyLogoNormalUrl, moduleIlustrationUrl } = useBase<NoAuthBaseProviderProps>();
9
+ return (
10
+ <WrapperLogoLeyend>
11
+ <Image
12
+ key={'Logo'}
13
+ width={'400px'}
14
+ height={'400px'}
15
+ src={companyLogoNormalUrl}
16
+ // effect="opacity"
17
+ alt="logo"
18
+ />
19
+ {moduleIlustrationUrl ? (
20
+ <Image src={moduleIlustrationUrl} width={'100%'} height={'300px'} />
21
+ ) : null}
22
+
23
+ <Typography key={'Leyend'} variant="h3" skeletonWidth={'30%'} skeletongHeight={'18px'}>
24
+ {getLabel('module_leyend')}
25
+ </Typography>
26
+ </WrapperLogoLeyend>
27
+ );
28
+ };
@@ -0,0 +1,16 @@
1
+ import { styled } from '@mui/material/styles';
2
+
3
+ export const WrapperLogoLeyend = styled('div')(({ theme }) => ({
4
+ boxShadow: theme.customShadows.card,
5
+ borderRadius: theme.spacing(2),
6
+ width: '100%',
7
+ maxWidth: '464px',
8
+ display: 'flex',
9
+ flexDirection: 'column',
10
+ justifyContent: 'flex-start',
11
+ alignItems: 'center',
12
+ margin: theme.spacing(2, 0, 2, 2),
13
+ padding: theme.spacing(4, 3),
14
+ gap: theme.spacing(3),
15
+ overflow: 'hidden',
16
+ }));
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ export interface ModuleProps {
4
+ children: ReactNode;
5
+ }
@@ -0,0 +1,22 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ export interface ContainerProps {
4
+ vertical: boolean;
5
+ }
6
+
7
+ export type MenuActionType = 'main' | 'allways' | 'normal';
8
+
9
+ export declare interface NoAuthBaseProviderProps {
10
+ subtitle?: string;
11
+ companyLogoSmallUrl: string;
12
+ companyLogoNormalUrl: string;
13
+ moduleIlustrationUrl?: string;
14
+ }
15
+
16
+ export interface NoAuthModuleLayoutProps extends NoAuthBaseProviderProps {
17
+ moduleId: string;
18
+ moduleNameField?: string;
19
+ componentsDictionary: string[];
20
+ skeletonFlags: string[];
21
+ children: ReactNode;
22
+ }
@@ -0,0 +1,8 @@
1
+ export { ModuleLayout } from './ModuleLayout';
2
+ export * from './ModuleLayout/dicctionary';
3
+
4
+ export { MasterDetailLayout } from './MasterDetailLayout';
5
+ export * from './MasterDetailLayout/dicctionary';
6
+
7
+ export { NoAuthModuleLayout } from './NoAuthModuleLayout';
8
+ export * from './NoAuthModuleLayout/dicctionary';
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,20 @@
1
+ import { cleanup, render } from '@testing-library/react';
2
+ import React from 'react';
3
+ import { afterEach } from 'vitest';
4
+
5
+ afterEach(() => {
6
+ cleanup();
7
+ });
8
+
9
+ const customRender = (ui: React.ReactElement, options = {}) => {
10
+ return render(ui, {
11
+ // wrap provider(s) here if needed
12
+ wrapper: ({ children }) => children,
13
+ ...options,
14
+ });
15
+ };
16
+
17
+ export * from '@testing-library/react';
18
+ export { default as userEvent } from '@testing-library/user-event';
19
+
20
+ export { customRender as render };
@@ -0,0 +1,3 @@
1
+ /// <reference types="vite/client" />
2
+ /// <reference types="vitest" />
3
+ /// <reference types="vitest/importMeta" />
package/tsconfig.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "esNext",
4
+ "useDefineForClassFields": true,
5
+ "lib": ["DOM", "DOM.Iterable", "ESNext"],
6
+ "allowJs": false,
7
+ "skipLibCheck": true,
8
+ "esModuleInterop": false,
9
+ "allowSyntheticDefaultImports": true,
10
+ "strict": true,
11
+ "downlevelIteration":true,
12
+ "importHelpers": true,
13
+ "experimentalDecorators": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ "module": "ESNext",
16
+ "moduleResolution": "Node",
17
+ "resolveJsonModule": true,
18
+ "isolatedModules": true,
19
+ "noEmit": true,
20
+ "jsx": "preserve",
21
+ "importsNotUsedAsValues":"remove",
22
+ "baseUrl": ".",
23
+ "paths": {
24
+ }
25
+ },
26
+ "include": ["src", "../m4l_components/src/contexts/DynamicMFParmsContext", "../m4l_components/src/hooks/useDynamicMFParameters"],
27
+ "exclude": ["node_modules","dist"],
28
+ "references": [{ "path": "./tsconfig.node.json" }]
29
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "module": "esnext",
5
+ "moduleResolution": "node"
6
+ },
7
+ "include": ["vite.config.ts"]
8
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,172 @@
1
+ import react from '@vitejs/plugin-react';
2
+ import * as path from 'path';
3
+ import { defineConfig } from 'vite';
4
+ import dts from 'vite-plugin-dts';
5
+
6
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
7
+
8
+ function manualChunks(id: string, _api: any) {
9
+ //components
10
+ if (id.includes('src/components/')) {
11
+ if (id.includes('MFHostApp')) {
12
+ return 'components/MFHostApp/index';
13
+ }
14
+ if (id.includes('MFIsolationApp')) {
15
+ return 'components/MFIsolationApp/index';
16
+ }
17
+ if (id.includes('BaseModule')) {
18
+ return 'components/BaseModule/index';
19
+ }
20
+ return 'components/index';
21
+ }
22
+ if (id.includes('src/contexts/')) {
23
+ //context
24
+ if (id.includes('AuthContext')) {
25
+ return 'contexts/AuthContext/index';
26
+ }
27
+ return 'contexts/index';
28
+ }
29
+ //layouts
30
+ if (id.includes('src/layouts/')) {
31
+ if (id.includes('NoAuthModuleLayout')) {
32
+ return 'layouts/NoAuthModuleLayout/index';
33
+ }
34
+
35
+ if (id.includes('MasterDetailLayout')) {
36
+ return 'layouts/MasterDetailLayout/index';
37
+ }
38
+
39
+ if (id.includes('ModuleLayout')) {
40
+ return 'layouts/ModuleLayout/index';
41
+ }
42
+
43
+ return 'layouts/index';
44
+ }
45
+ //hooks
46
+ if (id.includes('src/hooks/')) {
47
+ if (id.includes('useMasterDetail')) {
48
+ return 'hooks/useMasterDetail/index';
49
+ }
50
+
51
+ if (id.includes('useModule')) {
52
+ return 'hooks/useModule/index';
53
+ }
54
+
55
+ if (id.includes('useAuth')) {
56
+ return 'hooks/useAuth/index';
57
+ }
58
+ return 'hooks/index';
59
+ }
60
+ //node_modules no reconocidos
61
+ if (id.includes('node_modules')) {
62
+ console.log('node_modules******^', id);
63
+ return 'node_modules';
64
+ }
65
+
66
+ return 'vendor';
67
+ }
68
+
69
+ const examined_libs = [];
70
+
71
+ const isExternal = (source: string, importer: string | undefined, isResolved: boolean): boolean => {
72
+ const internal_exact_libs = ['lib1', 'lib2']; //librerias que van incluirse en el bundle final da la librería
73
+ const external_exact_libs = [
74
+ 'react',
75
+ 'react-dom',
76
+ 'react/jsx-runtime',
77
+ '@m4l/core',
78
+ '@m4l/graphics',
79
+ '@m4l/components',
80
+ '@emotion/styled',
81
+ 'react-router-dom',
82
+ 'react-toastify',
83
+ ];
84
+ const external_parcial_libs = [
85
+ '@mui',
86
+ '@m4l',
87
+ 'date-fns',
88
+ 'nprogress',
89
+ 'history',
90
+ 'eventemitter3',
91
+ ];
92
+
93
+ if (internal_exact_libs.findIndex(l => source === l) > -1) {
94
+ return false;
95
+ }
96
+
97
+ const isExt =
98
+ external_exact_libs.findIndex(l => source === l) > -1 ||
99
+ external_parcial_libs.findIndex(pl => source.indexOf(pl) > -1) > -1;
100
+ if (isExt) {
101
+ if (examined_libs.findIndex(l => source === l) < 0) {
102
+ console.log(
103
+ 'Source: ',
104
+ source,
105
+ ' Importer:',
106
+ ' isResolved:',
107
+ isResolved,
108
+ ' IsExt:',
109
+ isExt,
110
+ );
111
+ examined_libs.push(source);
112
+ }
113
+ }
114
+
115
+ return isExt;
116
+ };
117
+
118
+ export default defineConfig({
119
+ server: { https: true, port: 4002 },
120
+ // test: {
121
+ // globals: true,
122
+ // include: ['**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
123
+ // environment: 'jsdom',
124
+ // setupFiles: './src/test/setup.ts',
125
+ // coverage: {
126
+ // all: true,
127
+ // include: ['**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
128
+ // reporter: ['text', 'json', 'html'],
129
+ // },
130
+ // },
131
+
132
+ plugins: [
133
+ dts({
134
+ insertTypesEntry: true,
135
+ beforeWriteFile: (filePath: string, content: string) => {
136
+ return { filePath: filePath.replace('m4l_layouts/src/', ''), content };
137
+ },
138
+ }),
139
+ react(),
140
+ // terser(),
141
+ ],
142
+ // mode: 'production',
143
+ build: {
144
+ //manifest: true,
145
+ target: 'esNext', //Compila en esNext teniendo en cuenta que va a ser leida no por el navedado,sino por otros proyectos
146
+ lib: {
147
+ entry: path.resolve(__dirname, 'src/index.ts'),
148
+ name: 'm4l_layouts',
149
+ formats: ['es'],
150
+ fileName: () => `index.js`,
151
+ },
152
+ rollupOptions: {
153
+ external: isExternal,
154
+
155
+ // input: ['src/index.ts'],
156
+
157
+ output: {
158
+ manualChunks,
159
+ exports: 'auto',
160
+ format: 'esm',
161
+ generatedCode: 'es2015',
162
+
163
+ dir: 'dist', // Carpenta donde se genera el bundle
164
+ globals: {
165
+ react: 'React',
166
+ 'react-dom': 'ReactDOM',
167
+ 'react/jsx-runtime': 'react/jsx-runtime',
168
+ },
169
+ },
170
+ },
171
+ },
172
+ });
@@ -1,52 +0,0 @@
1
- import { unstable_HistoryRouter as l } from "react-router-dom";
2
- import { EnvironmentProvider as a, HostToolsProvider as u, NetworkProvider as h, DomainCountryProvider as y } from "@m4l/core";
3
- import { LocalesProvider as F, HostThemeProvider as v, FormatterProvider as b } from "@m4l/graphics";
4
- import { jsx as r } from "react/jsx-runtime";
5
- function E(t) {
6
- const {
7
- children: i,
8
- currentLocale: n,
9
- hostTheme: m,
10
- environment: s,
11
- hostTools: e,
12
- axiosOperation: c,
13
- formatters: o,
14
- dynamicMFParameters: d
15
- } = t;
16
- return /* @__PURE__ */ r(a, {
17
- ...s,
18
- children: /* @__PURE__ */ r(u, {
19
- ...e,
20
- children: /* @__PURE__ */ r(h, {
21
- axiosOperation: c,
22
- children: /* @__PURE__ */ r(F, {
23
- isMicroFrontEnd: !0,
24
- localeHost: n,
25
- children: /* @__PURE__ */ r(v, {
26
- isMicroFrontEnd: !0,
27
- ...m,
28
- children: /* @__PURE__ */ r(l, {
29
- history: e.history,
30
- children: /* @__PURE__ */ r(y, {
31
- isMicroFrontEnd: !0,
32
- id: d?.id || 1,
33
- currency: o.currencyFormatter.symbol,
34
- currency_decimal_digits: o.currencyFormatter.decimalDigits,
35
- decimal_symbol: o.numberFormatter.decimalSymbol,
36
- thousands_symbol: o.numberFormatter.thousandsSymbol,
37
- children: /* @__PURE__ */ r(b, {
38
- isMicroFrontEnd: !0,
39
- ...o,
40
- children: i
41
- })
42
- })
43
- })
44
- })
45
- })
46
- })
47
- })
48
- });
49
- }
50
- export {
51
- E as M
52
- };
@@ -1,106 +0,0 @@
1
- import { useEffect as _, useMemo as m } from "react";
2
- import { unstable_HistoryRouter as P } from "react-router-dom";
3
- import { ToastContainer as F, toast as y } from "react-toastify";
4
- import { HostThemeProvider as g, defaultThemeOptions as w, fnComponentsOverrides as M, ProgressBarStyle as A, LocalesProvider as E, getLocaleFromNetwork as T, FormatterProvider as x } from "@m4l/graphics";
5
- import { A as b } from "../../contexts/AuthContext/index.6f966215.js";
6
- import { voidFunction as c, EnvironmentProvider as H, HostToolsProvider as N, NetworkProvider as O, axiosOperation as k, DomainCountryProvider as C } from "@m4l/core";
7
- import { c as L, f as j, N as d } from "../../node_modules.26043cf4.js";
8
- import { u as B } from "../../hooks/useAuth/index.cb6a3420.js";
9
- import { jsx as r, jsxs as D } from "react/jsx-runtime";
10
- function I(t) {
11
- const {
12
- children: s,
13
- user: i,
14
- pwd: n
15
- } = t, {
16
- isAuthenticated: o,
17
- isInitialized: e,
18
- login: a
19
- } = B();
20
- return _(() => {
21
- e && o === !1 && a(i, n, !1);
22
- }, [e, o]), o ? /* @__PURE__ */ D(g, {
23
- hostThemeOptions: w,
24
- fnComponentsOverrides: M,
25
- isMicroFrontEnd: !0,
26
- children: [/* @__PURE__ */ r(A, {}), /* @__PURE__ */ r(F, {}), s]
27
- }) : /* @__PURE__ */ r("div", {
28
- children: "Pendiente x atenticar"
29
- });
30
- }
31
- const l = L({
32
- window
33
- });
34
- function U(t) {
35
- const {
36
- children: s,
37
- user: i,
38
- pwd: n,
39
- host_api_local: o,
40
- host_api_remote: e,
41
- host_static_assets: a,
42
- environment_assets: h
43
- } = t, u = () => {
44
- d.configure({
45
- showSpinner: !0
46
- }), d.start();
47
- }, f = () => {
48
- d.done();
49
- }, p = m(() => ({
50
- host: "",
51
- isLocalhost: !0,
52
- domain_token: "lab1",
53
- host_api_local: o,
54
- host_api_remote: e,
55
- host_static_assets: a,
56
- environment_assets: h
57
- }), []), v = m(() => ({
58
- history: l,
59
- toast: y,
60
- startProgress: u,
61
- stopProgress: f,
62
- events_add_listener: c,
63
- events_remove_listener: c,
64
- events_emit: c
65
- }), []);
66
- return /* @__PURE__ */ r(H, {
67
- ...p,
68
- children: /* @__PURE__ */ r(N, {
69
- ...v,
70
- children: /* @__PURE__ */ r(O, {
71
- axiosOperation: k,
72
- children: /* @__PURE__ */ r(P, {
73
- history: l,
74
- children: /* @__PURE__ */ r(E, {
75
- isMicroFrontEnd: !1,
76
- getLocaleFromNetwork: T,
77
- children: /* @__PURE__ */ r(C, {
78
- id: 1,
79
- isMicroFrontEnd: !1,
80
- currency: "$",
81
- currency_decimal_digits: 0,
82
- decimal_symbol: ".",
83
- thousands_symbol: ",",
84
- children: /* @__PURE__ */ r(x, {
85
- isMicroFrontEnd: !1,
86
- dateFormatter: {
87
- formatDate: j
88
- },
89
- children: /* @__PURE__ */ r(b, {
90
- children: /* @__PURE__ */ r(I, {
91
- user: i,
92
- pwd: n,
93
- children: s
94
- })
95
- })
96
- })
97
- })
98
- })
99
- })
100
- })
101
- })
102
- });
103
- }
104
- export {
105
- U as M
106
- };
@@ -1,10 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export declare type MFIsolationAppProps = {
3
- host_api_local: string;
4
- host_api_remote: string;
5
- host_static_assets: string;
6
- environment_assets: string;
7
- user: string;
8
- pwd: string;
9
- children: ReactNode;
10
- };
@@ -1,3 +0,0 @@
1
- export { MFIsolationApp } from './MFIsolationApp';
2
- export { MFHostApp } from './MFHostApp';
3
- export type { ByHostProps, DynamicMFParameters } from './MFHostApp/types';
package/index.js DELETED
@@ -1,38 +0,0 @@
1
- import { M as n } from "./components/MFIsolationApp/index.28f538a3.js";
2
- import { M as f } from "./components/MFHostApp/index.b3c15ec3.js";
3
- import { a as D, A } from "./contexts/AuthContext/index.6f966215.js";
4
- import { a as c, d as g, g as h } from "./layouts/ModuleLayout/index.842072c5.js";
5
- import { a as N, d as F, g as v } from "./layouts/MasterDetailLayout/index.71de0dc7.js";
6
- import { N as I, d as P, g as b } from "./layouts/NoAuthModuleLayout/index.5d1098ef.js";
7
- import { u as k } from "./hooks/useMasterDetail/index.8e9e900b.js";
8
- import { u as w } from "./hooks/useAuth/index.cb6a3420.js";
9
- import { u as B } from "./hooks/useModule/index.096d7d13.js";
10
- import "react";
11
- import "react-router-dom";
12
- import "react-toastify";
13
- import "@m4l/graphics";
14
- import "@m4l/core";
15
- import "./node_modules.26043cf4.js";
16
- import "./vendor.95e38403.js";
17
- import "react/jsx-runtime";
18
- import "@m4l/components";
19
- import "@mui/material";
20
- import "@mui/material/styles";
21
- export {
22
- D as AuthContext,
23
- A as AuthProvider,
24
- f as MFHostApp,
25
- n as MFIsolationApp,
26
- N as MasterDetailLayout,
27
- c as ModuleLayout,
28
- I as NoAuthModuleLayout,
29
- F as defaultMasterDetailDictionary,
30
- g as defaultModuleLayoutDictionary,
31
- P as defaultNoAuthModuleLayoutDictionary,
32
- v as getMasterDetailLayoutComponentsDictionary,
33
- h as getModuleLayoutComponentsDictionary,
34
- b as getNoAuthModuleLayoutComponentsDictionary,
35
- w as useAuth,
36
- k as useMasterDetail,
37
- B as useModule
38
- };
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import { ComponentActionProps } from '@m4l/components';
3
- export declare function ButtonDetail(props: ComponentActionProps): JSX.Element;