@m4l/layouts 0.1.23 → 0.1.26

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/dist/contexts/index.b46a2699.js +1 -0
  18. package/dist/hooks/index.2022a179.js +4 -0
  19. package/{hooks/useMasterDetail/index.8e9e900b.js → dist/hooks/useMasterDetail/index.1b024fd5.js} +1 -1
  20. package/{hooks/useModule/index.096d7d13.js → dist/hooks/useModule/index.6ff7d08a.js} +1 -1
  21. package/dist/index.js +41 -0
  22. package/dist/layouts/MasterDetailLayout/index.3da0ffda.js +104 -0
  23. package/{layouts → dist/layouts}/ModuleLayout/contexts/ModuleContext/types.d.ts +2 -7
  24. package/dist/layouts/ModuleLayout/index.a76397df.js +101 -0
  25. package/dist/layouts/ModuleLayout/types.d.ts +15 -0
  26. package/dist/layouts/index.014e41ba.js +8 -0
  27. package/{layouts → dist/layouts}/index.d.ts +0 -1
  28. package/dist/package.json +36 -0
  29. package/package.json +57 -12
  30. package/src/@types/index.ts +8 -0
  31. package/src/components/BaseModule/index.tsx +59 -0
  32. package/src/components/BaseModule/types.ts +12 -0
  33. package/src/components/MFHostApp/index.tsx +95 -0
  34. package/src/components/MFHostApp/types.ts +16 -0
  35. package/src/components/MFIsolationApp/index.tsx +164 -0
  36. package/src/components/MFIsolationApp/subcomponents/MFAuthApp/index.tsx +98 -0
  37. package/src/components/MFIsolationApp/subcomponents/MFAuthApp/types.ts +7 -0
  38. package/src/components/MFIsolationApp/types.ts +12 -0
  39. package/src/components/index.ts +5 -0
  40. package/src/contexts/AuthContext/index.tsx +189 -0
  41. package/src/contexts/AuthContext/types.ts +65 -0
  42. package/src/contexts/index.ts +1 -0
  43. package/src/hooks/index.ts +5 -0
  44. package/src/hooks/useAuth/index.ts +12 -0
  45. package/src/hooks/useMasterDetail/index.ts +6 -0
  46. package/src/hooks/useModule/index.ts +13 -0
  47. package/src/index.ts +7 -0
  48. package/src/layouts/MasterDetailLayout/components/ButtonDetail/index.tsx +38 -0
  49. package/src/layouts/MasterDetailLayout/contexts/MasterDetailContext/index.tsx +34 -0
  50. package/src/layouts/MasterDetailLayout/contexts/MasterDetailContext/types.ts +19 -0
  51. package/src/layouts/MasterDetailLayout/dicctionary.ts +20 -0
  52. package/src/layouts/MasterDetailLayout/index.tsx +165 -0
  53. package/src/layouts/MasterDetailLayout/types.ts +11 -0
  54. package/src/layouts/ModuleLayout/contexts/ModuleContext/index.tsx +56 -0
  55. package/src/layouts/ModuleLayout/contexts/ModuleContext/types.ts +23 -0
  56. package/src/layouts/ModuleLayout/dicctionary.ts +11 -0
  57. package/src/layouts/ModuleLayout/index.tsx +59 -0
  58. package/src/layouts/ModuleLayout/subcomponents/InnerModule/index.tsx +35 -0
  59. package/src/layouts/ModuleLayout/subcomponents/InnerModule/styles.tsx +31 -0
  60. package/src/layouts/ModuleLayout/subcomponents/InnerModule/types.ts +11 -0
  61. package/src/layouts/ModuleLayout/types.ts +31 -0
  62. package/src/layouts/NoAuthModuleLayout/dicctionary.ts +9 -0
  63. package/src/layouts/NoAuthModuleLayout/index.tsx +85 -0
  64. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/index.tsx +43 -0
  65. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/styles.tsx +6 -0
  66. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/index.tsx +14 -0
  67. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/styles.tsx +7 -0
  68. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/AppBar/index.tsx +25 -0
  69. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/AppBar/styles.tsx +11 -0
  70. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/index.tsx +17 -0
  71. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/styles.tsx +19 -0
  72. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/subcomponents/NameDescription/index.tsx +25 -0
  73. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/subcomponents/NameDescription/styles.tsx +8 -0
  74. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/subcomponents/Form/types.ts +5 -0
  75. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/AppBarForm/types.ts +5 -0
  76. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/LogoLeyend/index.tsx +28 -0
  77. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/LogoLeyend/styles.tsx +16 -0
  78. package/src/layouts/NoAuthModuleLayout/subcomponents/InnerModule/types.ts +5 -0
  79. package/src/layouts/NoAuthModuleLayout/types.ts +22 -0
  80. package/src/layouts/index.ts +8 -0
  81. package/src/test/setup.ts +1 -0
  82. package/src/test/utils.tsx +20 -0
  83. package/src/vite-env.d.ts +3 -0
  84. package/tsconfig.json +29 -0
  85. package/tsconfig.node.json +8 -0
  86. package/vite.config.ts +172 -0
  87. package/components/MFHostApp/index.55a1f3a4.js +0 -52
  88. package/components/MFIsolationApp/index.eaf655eb.js +0 -116
  89. package/components/MFIsolationApp/types.d.ts +0 -10
  90. package/components/index.d.ts +0 -3
  91. package/index.js +0 -38
  92. package/layouts/MasterDetailLayout/components/ButtonDetail/index.d.ts +0 -3
  93. package/layouts/MasterDetailLayout/index.71de0dc7.js +0 -141
  94. package/layouts/ModuleLayout/index.842072c5.js +0 -348
  95. package/layouts/ModuleLayout/subcomponents/InnerModule/subcomponents/Header/index.d.ts +0 -2
  96. package/layouts/ModuleLayout/subcomponents/InnerModule/subcomponents/Header/skeleton.d.ts +0 -2
  97. package/layouts/ModuleLayout/subcomponents/InnerModule/subcomponents/Header/styles.d.ts +0 -8
  98. package/layouts/ModuleLayout/subcomponents/InnerModule/subcomponents/Header/types.d.ts +0 -2
  99. package/layouts/ModuleLayout/types.d.ts +0 -29
  100. package/node_modules.d8c1c0ec.js +0 -1601
  101. package/vendor.172dc010.js +0 -20
  102. /package/{components → dist/components}/MFHostApp/index.d.ts +0 -0
  103. /package/{components → dist/components}/MFIsolationApp/index.d.ts +0 -0
  104. /package/{components → dist/components}/MFIsolationApp/subcomponents/MFAuthApp/index.d.ts +0 -0
  105. /package/{components → dist/components}/MFIsolationApp/subcomponents/MFAuthApp/types.d.ts +0 -0
  106. /package/{contexts → dist/contexts}/AuthContext/index.6f966215.js +0 -0
  107. /package/{contexts → dist/contexts}/AuthContext/index.d.ts +0 -0
  108. /package/{contexts → dist/contexts}/AuthContext/types.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 a } from "react-router-dom";
2
- import { EnvironmentProvider as l, HostToolsProvider as u, NetworkProvider as h, DomainCountryProvider as y } from "@m4l/core";
3
- import { LocalesProvider as F, HostThemeProvider as v, FormatterProvider as p } 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: c,
10
- environment: m,
11
- hostTools: e,
12
- axiosOperation: s,
13
- formatters: o,
14
- dynamicMFParameters: d
15
- } = t;
16
- return /* @__PURE__ */ r(l, {
17
- ...m,
18
- children: /* @__PURE__ */ r(u, {
19
- ...e,
20
- children: /* @__PURE__ */ r(h, {
21
- axiosOperation: s,
22
- children: /* @__PURE__ */ r(F, {
23
- isMicroFrontEnd: !0,
24
- localeHost: n,
25
- children: /* @__PURE__ */ r(v, {
26
- isMicroFrontEnd: !0,
27
- ...c,
28
- children: /* @__PURE__ */ r(a, {
29
- history: e.history,
30
- children: /* @__PURE__ */ r(y, {
31
- isMicroFrontEnd: !0,
32
- id: d?.id || 1,
33
- currency: o.currencyFormatter.code,
34
- currency_decimal_digits: o.currencyFormatter.decimalDigits,
35
- decimal_symbol: o.numberFormatter.decimalSymbol,
36
- thousands_symbol: o.numberFormatter.thousandsSymbol,
37
- children: /* @__PURE__ */ r(p, {
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,116 +0,0 @@
1
- import { useEffect as p, useMemo as u } from "react";
2
- import { unstable_HistoryRouter as v } from "react-router-dom";
3
- import { ToastContainer as g, toast as P } from "react-toastify";
4
- import { HostThemeProvider as F, defaultThemeOptions as b, fnComponentsOverrides as w, FormatterProvider as A, LocalesProvider as M, getLocaleFromNetwork as E } from "@m4l/graphics";
5
- import { A as T } from "../../contexts/AuthContext/index.6f966215.js";
6
- import { DomainCountryProvider as x, voidFunction as m, EnvironmentProvider as C, HostToolsProvider as D, NetworkProvider as H, axiosOperation as N } from "@m4l/core";
7
- import { f as O, c as k, N as l } from "../../node_modules.d8c1c0ec.js";
8
- import { u as L } from "../../hooks/useAuth/index.cb6a3420.js";
9
- import { jsx as o, jsxs as j } from "react/jsx-runtime";
10
- function I(s) {
11
- const {
12
- children: n,
13
- user: c,
14
- pwd: d
15
- } = s, {
16
- isAuthenticated: t,
17
- isInitialized: i,
18
- login: a,
19
- user: e
20
- } = L();
21
- if (p(() => {
22
- i && t === !1 && a(c, d, !1);
23
- }, [i, t]), !t)
24
- return /* @__PURE__ */ o("div", {
25
- children: "Pendiente x atenticar"
26
- });
27
- const r = {
28
- id: 1,
29
- currency: "USD",
30
- currency_decimal_digits: 2,
31
- decimal_symbol: ".",
32
- thousands_symbol: ","
33
- };
34
- return e?.domain_country && (r.id = e?.domain_country.id ?? r.id, r.currency = e?.domain_country.currency ?? r.currency, r.currency_decimal_digits = e?.domain_country.currency_decimal_digits ?? r.currency_decimal_digits, r.decimal_symbol = e?.domain_country.decimal_symbol ?? r.decimal_symbol, r.thousands_symbol = e?.domain_country?.thousands_symbol ?? r.thousands_symbol), /* @__PURE__ */ j(F, {
35
- hostThemeOptions: b,
36
- fnComponentsOverrides: w,
37
- isMicroFrontEnd: !0,
38
- children: [/* @__PURE__ */ o(g, {}), /* @__PURE__ */ o(x, {
39
- ...r,
40
- isMicroFrontEnd: !1,
41
- children: /* @__PURE__ */ o(A, {
42
- isMicroFrontEnd: !1,
43
- dateFormatter: {
44
- formatDate: O
45
- },
46
- currencyFormatter: {
47
- code: r.currency,
48
- decimalDigits: r.currency_decimal_digits
49
- },
50
- children: n
51
- })
52
- })]
53
- });
54
- }
55
- const _ = k({
56
- window
57
- });
58
- function Q(s) {
59
- const {
60
- children: n,
61
- user: c,
62
- pwd: d,
63
- host_api_local: t,
64
- host_api_remote: i,
65
- host_static_assets: a,
66
- environment_assets: e
67
- } = s, r = () => {
68
- l.configure({
69
- showSpinner: !0
70
- }), l.start();
71
- }, h = () => {
72
- l.done();
73
- }, y = u(() => ({
74
- host: "",
75
- isLocalhost: !0,
76
- domain_token: "lab1",
77
- host_api_local: t,
78
- host_api_remote: i,
79
- host_static_assets: a,
80
- environment_assets: e
81
- }), []), f = u(() => ({
82
- history: _,
83
- toast: P,
84
- startProgress: r,
85
- stopProgress: h,
86
- events_add_listener: m,
87
- events_remove_listener: m,
88
- events_emit: m
89
- }), []);
90
- return /* @__PURE__ */ o(C, {
91
- ...y,
92
- children: /* @__PURE__ */ o(D, {
93
- ...f,
94
- children: /* @__PURE__ */ o(H, {
95
- axiosOperation: N,
96
- children: /* @__PURE__ */ o(v, {
97
- history: _,
98
- children: /* @__PURE__ */ o(M, {
99
- isMicroFrontEnd: !1,
100
- getLocaleFromNetwork: E,
101
- children: /* @__PURE__ */ o(T, {
102
- children: /* @__PURE__ */ o(I, {
103
- user: c,
104
- pwd: d,
105
- children: n
106
- })
107
- })
108
- })
109
- })
110
- })
111
- })
112
- });
113
- }
114
- export {
115
- Q as M
116
- };
@@ -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.eaf655eb.js";
2
- import { M as f } from "./components/MFHostApp/index.55a1f3a4.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.d8c1c0ec.js";
16
- import "./vendor.172dc010.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;