@m4l/graphics 0.1.17 → 0.1.19
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.
- package/.eslintignore +2 -0
- package/.eslintrc.cjs +118 -0
- package/.gitignore +24 -0
- package/.gitlab-ci.yml +15 -0
- package/.prettierignore +3 -0
- package/.prettierrc.json +26 -0
- package/.vscode/settings.json +50 -0
- package/{contexts/FormatterContext/index.0a135b60.js → dist/contexts/FormatterContext/index.92336f4c.js} +23 -23
- package/{contexts → dist/contexts}/FormatterContext/types.d.ts +1 -1
- package/{contexts/LocalesContext/index.3fcfbe02.js → dist/contexts/LocalesContext/index.5b555637.js} +22 -22
- package/dist/contexts/index.2f4a4040.js +4 -0
- package/{hooks/index.54438d3f.js → dist/hooks/index.c13bc37e.js} +2 -2
- package/{hooks/useFormatter/index.6463a320.js → dist/hooks/useFormatter/index.57ac8cca.js} +1 -1
- package/{hooks/useLocales/index.8154a401.js → dist/hooks/useLocales/index.f676279e.js} +1 -1
- package/{index.d.ts → dist/index.d.ts} +1 -0
- package/dist/index.js +55 -0
- package/dist/package.json +34 -0
- package/dist/theme/breakpoints.d.ts +10 -0
- package/{theme/defaultThemeOptions.9b9e7503.js → dist/theme/defaultThemeOptions.b2cdbe59.js} +11 -9
- package/{theme/typography.f5eadf47.js → dist/theme/typography.63fff3ec.js} +1 -1
- package/dist/utils/anchorEl.d.ts +13 -0
- package/dist/utils/index.7ab4fc54.js +159 -0
- package/dist/vendor.3b4b3674.js +27 -0
- package/package.json +49 -7
- package/src/components/ProgressBarStyle/index.tsx +39 -0
- package/src/components/index.ts +3 -0
- package/src/contexts/FormatterContext/index.tsx +131 -0
- package/src/contexts/FormatterContext/types.ts +73 -0
- package/src/contexts/HostThemeContext/index.tsx +85 -0
- package/src/contexts/HostThemeContext/types.ts +16 -0
- package/src/contexts/LocalesContext/helper.ts +67 -0
- package/src/contexts/LocalesContext/index.tsx +152 -0
- package/src/contexts/LocalesContext/types.ts +37 -0
- package/src/contexts/index.ts +15 -0
- package/src/hooks/index.ts +8 -0
- package/src/hooks/useFirstRender/index.ts +17 -0
- package/src/hooks/useFormatter/index.ts +10 -0
- package/src/hooks/useHostTheme/index.ts +10 -0
- package/src/hooks/useIsMountedRef/index.ts +16 -0
- package/src/hooks/useLocales/index.ts +10 -0
- package/src/hooks/useOffSetTop.ts +26 -0
- package/src/hooks/useResponsive/index.ts +44 -0
- package/src/index.ts +25 -0
- package/src/theme/breakpoints.ts +13 -0
- package/src/theme/defaultThemeOptions.ts +42 -0
- package/src/theme/overrides/Accordion.ts +85 -0
- package/src/theme/overrides/Alert.tsx +74 -0
- package/src/theme/overrides/Autocomplete.ts +31 -0
- package/src/theme/overrides/Avatar.ts +29 -0
- package/src/theme/overrides/Backdrop.ts +26 -0
- package/src/theme/overrides/Badge.ts +17 -0
- package/src/theme/overrides/Breadcrumbs.ts +16 -0
- package/src/theme/overrides/Button.ts +62 -0
- package/src/theme/overrides/ButtonGroup.ts +51 -0
- package/src/theme/overrides/Card.ts +36 -0
- package/src/theme/overrides/Checkbox.tsx +54 -0
- package/src/theme/overrides/Chip.tsx +49 -0
- package/src/theme/overrides/ControlLabel.ts +29 -0
- package/src/theme/overrides/CssBaseline.ts +46 -0
- package/src/theme/overrides/CustomIcons.tsx +122 -0
- package/src/theme/overrides/DataGrid.ts +101 -0
- package/src/theme/overrides/Dialog.ts +60 -0
- package/src/theme/overrides/Drawer.ts +30 -0
- package/src/theme/overrides/Fab.ts +40 -0
- package/src/theme/overrides/IconButton.ts +35 -0
- package/src/theme/overrides/Input.ts +94 -0
- package/src/theme/overrides/InputLabel.ts +17 -0
- package/src/theme/overrides/Link.ts +20 -0
- package/src/theme/overrides/List.ts +37 -0
- package/src/theme/overrides/LoadingButton.ts +28 -0
- package/src/theme/overrides/Menu.ts +20 -0
- package/src/theme/overrides/Pagination.ts +38 -0
- package/src/theme/overrides/Paper.ts +27 -0
- package/src/theme/overrides/Popover.ts +16 -0
- package/src/theme/overrides/Progress.ts +27 -0
- package/src/theme/overrides/Radio.ts +21 -0
- package/src/theme/overrides/Rating.tsx +30 -0
- package/src/theme/overrides/Select.tsx +14 -0
- package/src/theme/overrides/Skeleton.ts +19 -0
- package/src/theme/overrides/Slider.ts +31 -0
- package/src/theme/overrides/Stepper.ts +15 -0
- package/src/theme/overrides/SvgIcon.ts +21 -0
- package/src/theme/overrides/Switch.ts +35 -0
- package/src/theme/overrides/Table.ts +95 -0
- package/src/theme/overrides/Tabs.ts +61 -0
- package/src/theme/overrides/Timeline.ts +23 -0
- package/src/theme/overrides/ToggleButton.ts +54 -0
- package/src/theme/overrides/Tooltip.ts +20 -0
- package/src/theme/overrides/TreeView.tsx +25 -0
- package/src/theme/overrides/Typography.ts +18 -0
- package/src/theme/overrides/index.ts +102 -0
- package/src/theme/palette.ts +216 -0
- package/src/theme/shadows.ts +110 -0
- package/src/theme/stretch.ts +10 -0
- package/src/theme/typography.ts +91 -0
- package/src/types/index.ts +9 -0
- package/src/utils/anchorEl.ts +146 -0
- package/src/utils/getColorPresets.ts +91 -0
- package/src/utils/getFontValue.ts +73 -0
- package/src/utils/strings.ts +1 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.json +29 -0
- package/tsconfig.node.json +8 -0
- package/vite.config.ts +234 -0
- package/contexts/index.78a814ce.js +0 -4
- package/index.js +0 -53
- package/utils/index.d8b24456.js +0 -107
- /package/{components → dist/components}/ProgressBarStyle/index.d.ts +0 -0
- /package/{components → dist/components}/ProgressBarStyle/index.fb6fd9ed.js +0 -0
- /package/{components → dist/components}/index.80514d59.js +0 -0
- /package/{components → dist/components}/index.d.ts +0 -0
- /package/{contexts → dist/contexts}/FormatterContext/index.d.ts +0 -0
- /package/{contexts → dist/contexts}/HostThemeContext/index.a6a62c70.js +0 -0
- /package/{contexts → dist/contexts}/HostThemeContext/index.d.ts +0 -0
- /package/{contexts → dist/contexts}/HostThemeContext/types.d.ts +0 -0
- /package/{contexts → dist/contexts}/LocalesContext/helper.d.ts +0 -0
- /package/{contexts → dist/contexts}/LocalesContext/index.d.ts +0 -0
- /package/{contexts → dist/contexts}/LocalesContext/types.d.ts +0 -0
- /package/{contexts → dist/contexts}/index.d.ts +0 -0
- /package/{hooks → dist/hooks}/index.d.ts +0 -0
- /package/{hooks → dist/hooks}/useFirstRender/index.1e9b02fb.js +0 -0
- /package/{hooks → dist/hooks}/useFirstRender/index.d.ts +0 -0
- /package/{hooks → dist/hooks}/useFormatter/index.d.ts +0 -0
- /package/{hooks → dist/hooks}/useHostTheme/index.1c8e4ad7.js +0 -0
- /package/{hooks → dist/hooks}/useHostTheme/index.d.ts +0 -0
- /package/{hooks → dist/hooks}/useIsMountedRef/index.d.ts +0 -0
- /package/{hooks → dist/hooks}/useLocales/index.d.ts +0 -0
- /package/{hooks → dist/hooks}/useOffSetTop.d.ts +0 -0
- /package/{hooks → dist/hooks}/useResponsive/index.d.ts +0 -0
- /package/{hooks → dist/hooks}/useResponsive/index.fc5e1b4f.js +0 -0
- /package/{theme → dist/theme}/defaultThemeOptions.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Accordion.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Autocomplete.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Avatar.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Backdrop.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Badge.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Breadcrumbs.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Button.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/ButtonGroup.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Card.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Checkbox.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/ControlLabel.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/CssBaseline.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/DataGrid.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Dialog.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Drawer.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Fab.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/IconButton.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Input.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/InputLabel.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Link.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/List.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/LoadingButton.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Menu.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Pagination.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Paper.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Popover.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Progress.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Radio.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Skeleton.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Slider.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Stepper.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/SvgIcon.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Switch.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Table.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Tabs.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Timeline.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/ToggleButton.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Tooltip.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/Typography.d.ts +0 -0
- /package/{theme → dist/theme}/overrides/index.d.ts +0 -0
- /package/{theme → dist/theme}/overrides.7958c0ab.js +0 -0
- /package/{theme → dist/theme}/palette.2baf72f5.js +0 -0
- /package/{theme → dist/theme}/palette.d.ts +0 -0
- /package/{theme → dist/theme}/shadows.bf8dc290.js +0 -0
- /package/{theme → dist/theme}/shadows.d.ts +0 -0
- /package/{theme → dist/theme}/stretch.d.ts +0 -0
- /package/{theme → dist/theme}/typography.d.ts +0 -0
- /package/{types → dist/types}/index.d.ts +0 -0
- /package/{utils → dist/utils}/getColorPresets.d.ts +0 -0
- /package/{utils → dist/utils}/getFontValue.d.ts +0 -0
- /package/{utils → dist/utils}/strings.d.ts +0 -0
- /package/{vite-env.d.ts → dist/vite-env.d.ts} +0 -0
package/.eslintignore
ADDED
package/.eslintrc.cjs
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
const prettierOptions = JSON.parse(fs.readFileSync(path.resolve(__dirname, '.prettierrc.json'), 'utf8'));
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
env: {
|
|
9
|
+
browser: true,
|
|
10
|
+
es2021: true,
|
|
11
|
+
},
|
|
12
|
+
extends: [
|
|
13
|
+
'plugin:react/recommended',
|
|
14
|
+
// 'airbnb',
|
|
15
|
+
'eslint:recommended',
|
|
16
|
+
'plugin:jsx-a11y/recommended',
|
|
17
|
+
'plugin:import/typescript',
|
|
18
|
+
'plugin:react/jsx-runtime',
|
|
19
|
+
'plugin:prettier/recommended',
|
|
20
|
+
'plugin:@typescript-eslint/recommended',
|
|
21
|
+
'prettier',
|
|
22
|
+
],
|
|
23
|
+
parser: '@typescript-eslint/parser',
|
|
24
|
+
parserOptions: {
|
|
25
|
+
ecmaFeatures: {
|
|
26
|
+
jsx: true,
|
|
27
|
+
},
|
|
28
|
+
ecmaVersion: 'latest',
|
|
29
|
+
sourceType: 'module',
|
|
30
|
+
},
|
|
31
|
+
plugins: ['react', '@typescript-eslint', 'import', 'jsx-a11y', 'react-hooks', 'prettier', 'unused-imports'],
|
|
32
|
+
rules: {
|
|
33
|
+
'prettier/prettier': ['error', prettierOptions],
|
|
34
|
+
'react/jsx-filename-extension': [1, {extensions: ['.ts', '.tsx']}], //En que archivos va a haber jsx
|
|
35
|
+
'@typescript-eslint/no-explicit-any':"off",
|
|
36
|
+
'react/jsx-props-no-spreading':"off", //Que se pueda usar el spread
|
|
37
|
+
"react/prop-types":"off", //Desactivar los proptypes
|
|
38
|
+
"react/require-default-props":"off", //Cuando se usan props parametros opcionales no es necesariio definir los valores por defecto
|
|
39
|
+
"react/jsx-no-useless-fragment":"warn", //No usar jsx dentro de un fragment
|
|
40
|
+
"react/no-unstable-nested-components": [
|
|
41
|
+
"off",
|
|
42
|
+
{ "allowAsProps": true }
|
|
43
|
+
],
|
|
44
|
+
"@typescript-eslint/no-empty-interface":"warn",
|
|
45
|
+
"@typescript-eslint/ban-ts-comment":"off",
|
|
46
|
+
"no-empty-pattern":"warn",
|
|
47
|
+
"no-shadow":"warn", //que se puedan declarar las mismas variables dentro del scope
|
|
48
|
+
'no-console': 'off', //Que no se puedan imprimir en la consola
|
|
49
|
+
"no-empty": "off",
|
|
50
|
+
// "no-empty-function": "error",
|
|
51
|
+
"@typescript-eslint/no-empty-function": "off","no-unused-vars": "off",
|
|
52
|
+
"@typescript-eslint/no-unused-vars": [
|
|
53
|
+
"warn", // or "error"
|
|
54
|
+
{
|
|
55
|
+
"argsIgnorePattern": "^_",
|
|
56
|
+
"varsIgnorePattern": "^_",
|
|
57
|
+
"caughtErrorsIgnorePattern": "^_"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
|
|
61
|
+
'import/extensions': [
|
|
62
|
+
'off',
|
|
63
|
+
'ignorePackages',
|
|
64
|
+
{
|
|
65
|
+
// js: 'never',
|
|
66
|
+
// mjs: 'never',
|
|
67
|
+
// jsx: 'never',
|
|
68
|
+
ts: 'never', //se especifica q tipo de librerias se pueden importar
|
|
69
|
+
tsx: 'never',
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
'import/prefer-default-export': 'off',
|
|
73
|
+
},
|
|
74
|
+
overrides: [
|
|
75
|
+
{
|
|
76
|
+
files: ['**/*.ts?(x)','**/*.js?(x)'],
|
|
77
|
+
rules: {
|
|
78
|
+
'prettier/prettier': ['warn', prettierOptions],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
settings: {
|
|
83
|
+
"react": {
|
|
84
|
+
"createClass": "createReactClass", // Regex for Component Factory to use,
|
|
85
|
+
// default to "createReactClass"
|
|
86
|
+
"pragma": "React", // Pragma to use, default to "React"
|
|
87
|
+
"fragment": "Fragment", // Fragment to use (may be a property of <pragma>), default to "Fragment"
|
|
88
|
+
"version": "detect", // React version. "detect" automatically picks the version you have installed.
|
|
89
|
+
// You can also use `16.0`, `16.3`, etc, if you want to override the detected value.
|
|
90
|
+
// It will default to "latest" and warn if missing, and to "detect" in the future
|
|
91
|
+
"flowVersion": "0.53" // Flow version
|
|
92
|
+
},
|
|
93
|
+
'import/extensions': ['.js', '.mjs', '.jsx', '.ts', '.tsx'],
|
|
94
|
+
'import/resolver': { //Permite encontrar los alias de los paths de importación
|
|
95
|
+
alias: {
|
|
96
|
+
map: [['~', path.resolve(__dirname)]],
|
|
97
|
+
extensions: ['.ts', '.js', '.tsx'],
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
// {
|
|
104
|
+
// "jsxSingleQuote": false,
|
|
105
|
+
// "singleQuote": true,
|
|
106
|
+
// "semi": true,
|
|
107
|
+
// "tabWidth": 4,
|
|
108
|
+
// "trailingComma": "all",
|
|
109
|
+
// "printWidth": 100,
|
|
110
|
+
// "bracketSpacing": false,
|
|
111
|
+
// "bracketSameLine": false,
|
|
112
|
+
// "useTabs": false,
|
|
113
|
+
// "arrowParens": "always",
|
|
114
|
+
// "endOfLine": "crlf",
|
|
115
|
+
// "proseWrap": "preserve",
|
|
116
|
+
// "quoteProps": "as-needed",
|
|
117
|
+
// "htmlWhitespaceSensitivity": "css"
|
|
118
|
+
// }
|
package/.gitignore
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Logs
|
|
2
|
+
logs
|
|
3
|
+
*.log
|
|
4
|
+
npm-debug.log*
|
|
5
|
+
yarn-debug.log*
|
|
6
|
+
yarn-error.log*
|
|
7
|
+
pnpm-debug.log*
|
|
8
|
+
lerna-debug.log*
|
|
9
|
+
|
|
10
|
+
node_modules
|
|
11
|
+
dist
|
|
12
|
+
dist-ssr
|
|
13
|
+
*.local
|
|
14
|
+
package-lock.json
|
|
15
|
+
|
|
16
|
+
# Editor directories and files
|
|
17
|
+
.idea
|
|
18
|
+
.DS_Store
|
|
19
|
+
*.suo
|
|
20
|
+
*.ntvs*
|
|
21
|
+
*.njsproj
|
|
22
|
+
*.sln
|
|
23
|
+
*.sw?
|
|
24
|
+
./docs/*
|
package/.gitlab-ci.yml
ADDED
package/.prettierignore
ADDED
package/.prettierrc.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"printWidth": 100,
|
|
3
|
+
"endOfLine":"auto",
|
|
4
|
+
"tabWidth": 4,
|
|
5
|
+
"useTabs": false,
|
|
6
|
+
"semi": true,
|
|
7
|
+
"singleQuote": true,
|
|
8
|
+
"trailingComma": "all",
|
|
9
|
+
"arrowParens" : "avoid",
|
|
10
|
+
"bracketSpacing": true,
|
|
11
|
+
"bracketSameLine":false,
|
|
12
|
+
"proseWrap": "never",
|
|
13
|
+
"quoteProps": "as-needed",
|
|
14
|
+
"singleAttributePerLine":false ,
|
|
15
|
+
|
|
16
|
+
"overrides": [
|
|
17
|
+
{
|
|
18
|
+
"files": ".prettierrc",
|
|
19
|
+
"options": { "parser": "typescript" }
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"explorer.confirmDelete": false,
|
|
3
|
+
"code-runner.clearPreviousOutput": true,
|
|
4
|
+
"explorer.confirmDragAndDrop": false,
|
|
5
|
+
"liveServer.settings.donotShowInfoMsg": true,
|
|
6
|
+
"prettier.eslintIntegration": true,
|
|
7
|
+
"editor.codeActionsOnSave": {
|
|
8
|
+
"source.fixAll.eslint": true
|
|
9
|
+
},
|
|
10
|
+
"eslint.probe": [
|
|
11
|
+
"javascriptreact",
|
|
12
|
+
"typescript",
|
|
13
|
+
"typescriptreact",
|
|
14
|
+
"html",
|
|
15
|
+
"markdown"
|
|
16
|
+
],
|
|
17
|
+
"color-highlight.matchRgbWithNoFunction": true,
|
|
18
|
+
"color-highlight.matchWords": true,
|
|
19
|
+
"[typescript]": {
|
|
20
|
+
"editor.defaultFormatter": "vscode.typescript-language-features"
|
|
21
|
+
},
|
|
22
|
+
"thunder-client.codeSnippetLanguage": "js-axios",
|
|
23
|
+
"editor.formatOnSave": false,
|
|
24
|
+
"[typescriptreact]": {
|
|
25
|
+
"editor.defaultFormatter": "vscode.typescript-language-features"
|
|
26
|
+
},
|
|
27
|
+
"javascript.updateImportsOnFileMove.enabled": "always",
|
|
28
|
+
"typescript.updateImportsOnFileMove.enabled": "always",
|
|
29
|
+
// "git.autofetch": true,
|
|
30
|
+
"eslint.nodeEnv": "",
|
|
31
|
+
// "prettier.useEditorConfig": false,
|
|
32
|
+
// "prettier.typescriptEnable": [
|
|
33
|
+
// "typescript",
|
|
34
|
+
// "typescriptreact"
|
|
35
|
+
// ],
|
|
36
|
+
// "prettier.tabWidth": 4,
|
|
37
|
+
// "prettier.jsonEnable": [
|
|
38
|
+
// "json"
|
|
39
|
+
// ],
|
|
40
|
+
// "prettier.trailingComma": "all",
|
|
41
|
+
// "prettier.singleQuote": true,
|
|
42
|
+
// "prettier.printWidth": 100,
|
|
43
|
+
// "prettier.bracketSpacing": true,
|
|
44
|
+
// "prettier.singleAttributePerLine": false,
|
|
45
|
+
// "prettier.graphqlEnable": [
|
|
46
|
+
// "graphql"
|
|
47
|
+
// ],
|
|
48
|
+
// "eslint.rules.customizations": [],
|
|
49
|
+
// "eslint.runtime": ""
|
|
50
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { createContext as D, useState as
|
|
2
|
-
import { useHostTools as v, usePropageteMF as R, EmitEvents as
|
|
1
|
+
import { createContext as D, useState as C, useCallback as k, useEffect as p } from "react";
|
|
2
|
+
import { useHostTools as v, usePropageteMF as R, EmitEvents as f } from "@m4l/core";
|
|
3
3
|
import { u as h } from "../../hooks/useFirstRender/index.1e9b02fb.js";
|
|
4
4
|
import { jsx as V } from "react/jsx-runtime";
|
|
5
5
|
const x = D(null);
|
|
6
|
-
function I(
|
|
6
|
+
function I(T) {
|
|
7
7
|
const {
|
|
8
|
-
children:
|
|
9
|
-
isMicroFrontEnd:
|
|
10
|
-
currencyFormatter:
|
|
11
|
-
numberFormatter:
|
|
8
|
+
children: b,
|
|
9
|
+
isMicroFrontEnd: F,
|
|
10
|
+
currencyFormatter: l,
|
|
11
|
+
numberFormatter: M,
|
|
12
12
|
dateFormatter: t
|
|
13
|
-
} =
|
|
13
|
+
} = T, r = l?.decimalDigits || 0, o = l?.code || "USD", a = M?.decimalSymbol || 0.1 .toLocaleString().substring(1, 2), s = M?.thousandsSymbol || 1e3 .toLocaleString().substring(1, 2), m = t?.dateFormat || "yyyy-MM-dd", n = t?.dateMask || "____-__-__", c = t?.datetimeFormat || "yyyy-MM-dd HH:mm:ss", i = t?.datetimeMask || "____-__-__ __:__:__", _ = t?.timeFormat || "HH:mm:ss", d = t?.timeMask || "__:__:__", u = t?.formatDate || (() => {
|
|
14
14
|
throw new Error("Incorrect use of formatDate");
|
|
15
|
-
}),
|
|
15
|
+
}), y = h(), {
|
|
16
16
|
events_emit: g
|
|
17
|
-
} = v(), [H, E] =
|
|
17
|
+
} = v(), [H, E] = C({
|
|
18
18
|
currencyFormatter: {
|
|
19
19
|
decimalDigits: r,
|
|
20
|
-
|
|
20
|
+
code: o
|
|
21
21
|
},
|
|
22
22
|
numberFormatter: {
|
|
23
23
|
decimalSymbol: a,
|
|
@@ -29,23 +29,23 @@ function I(f) {
|
|
|
29
29
|
datetimeFormat: c,
|
|
30
30
|
datetimeMask: i,
|
|
31
31
|
timeFormat: _,
|
|
32
|
-
timeMask:
|
|
33
|
-
formatDate:
|
|
32
|
+
timeMask: d,
|
|
33
|
+
formatDate: u
|
|
34
34
|
}
|
|
35
|
-
}), S =
|
|
35
|
+
}), S = k((e) => {
|
|
36
36
|
E(e);
|
|
37
37
|
}, []);
|
|
38
38
|
return R({
|
|
39
|
-
isMicroFrontEnd:
|
|
40
|
-
event:
|
|
39
|
+
isMicroFrontEnd: F,
|
|
40
|
+
event: f.EMMIT_EVENT_HOST_FORMATTER_CHANGE,
|
|
41
41
|
setHandler: S
|
|
42
42
|
}), p(() => {
|
|
43
|
-
if (
|
|
43
|
+
if (F || y)
|
|
44
44
|
return;
|
|
45
45
|
const e = {
|
|
46
46
|
currencyFormatter: {
|
|
47
47
|
decimalDigits: r,
|
|
48
|
-
|
|
48
|
+
code: o
|
|
49
49
|
},
|
|
50
50
|
numberFormatter: {
|
|
51
51
|
decimalSymbol: a,
|
|
@@ -57,16 +57,16 @@ function I(f) {
|
|
|
57
57
|
datetimeFormat: c,
|
|
58
58
|
datetimeMask: i,
|
|
59
59
|
timeFormat: _,
|
|
60
|
-
timeMask:
|
|
61
|
-
formatDate:
|
|
60
|
+
timeMask: d,
|
|
61
|
+
formatDate: u
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
|
-
E(e), g(
|
|
65
|
-
}, [
|
|
64
|
+
E(e), g(f.EMMIT_EVENT_HOST_FORMATTER_CHANGE, e);
|
|
65
|
+
}, [y, o, r, a, s, m, n, c, i, _, d, u]), /* @__PURE__ */ V(x.Provider, {
|
|
66
66
|
value: {
|
|
67
67
|
...H
|
|
68
68
|
},
|
|
69
|
-
children:
|
|
69
|
+
children: b
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
export {
|
package/{contexts/LocalesContext/index.3fcfbe02.js → dist/contexts/LocalesContext/index.5b555637.js}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createContext as k, useState as _, useCallback as x, useEffect as L } from "react";
|
|
2
2
|
import { AdapterDateFns as F } from "@mui/x-date-pickers/AdapterDateFns";
|
|
3
|
-
import { LocalizationProvider as
|
|
4
|
-
import { useEnvironment as
|
|
5
|
-
import
|
|
3
|
+
import { LocalizationProvider as P } from "@mui/x-date-pickers";
|
|
4
|
+
import { useEnvironment as U, useNetwork as I, useHostTools as j, useLocalStorageWithListener as w, EmitEvents as u } from "@m4l/core";
|
|
5
|
+
import v from "date-fns/locale/en-US";
|
|
6
6
|
import { jsx as g } from "react/jsx-runtime";
|
|
7
|
-
async function B(t, e,
|
|
7
|
+
async function B(t, e, n) {
|
|
8
8
|
const s = f(t), r = { ...t };
|
|
9
9
|
let i;
|
|
10
|
-
return s === "es" ? i = (await import("date-fns/locale/es")).default : s === "fr" ? i = (await import("date-fns/locale/fr")).default : s === "en-US" ? i =
|
|
10
|
+
return s === "es" ? i = (await import("date-fns/locale/es")).default : s === "fr" ? i = (await import("date-fns/locale/fr")).default : s === "en-US" ? i = v : (i = v, r.lang = "en", r.script = void 0, r.region = "US", r.url_icon = `${e}/${n}/frontend/commons/assets/icons/langs/lang_en.svg`, r.name = "English US*"), {
|
|
11
11
|
...r,
|
|
12
12
|
module: i,
|
|
13
13
|
localeString: f(r)
|
|
@@ -37,35 +37,35 @@ const G = k(null);
|
|
|
37
37
|
function J(t) {
|
|
38
38
|
const {
|
|
39
39
|
children: e,
|
|
40
|
-
isMicroFrontEnd:
|
|
40
|
+
isMicroFrontEnd: n,
|
|
41
41
|
localeHost: s,
|
|
42
42
|
getLocaleFromNetwork: r
|
|
43
43
|
} = t;
|
|
44
|
-
if (
|
|
44
|
+
if (n && !s)
|
|
45
45
|
throw Error("Must set localeHost in microfrontend");
|
|
46
|
-
if (!
|
|
46
|
+
if (!n && !r)
|
|
47
47
|
throw Error("Must set getLocaleFromNetwork in host");
|
|
48
48
|
const {
|
|
49
49
|
domain_token: i,
|
|
50
|
-
host_static_assets:
|
|
50
|
+
host_static_assets: S,
|
|
51
51
|
environment_assets: h
|
|
52
|
-
} =
|
|
52
|
+
} = U(), {
|
|
53
53
|
networkOperation: C
|
|
54
54
|
} = I(), {
|
|
55
55
|
events_add_listener: N,
|
|
56
56
|
events_remove_listener: T,
|
|
57
57
|
events_emit: H
|
|
58
58
|
} = j(), [a, d] = _(() => {
|
|
59
|
-
if (
|
|
59
|
+
if (n)
|
|
60
60
|
return s;
|
|
61
|
-
}), [l, m] = w("localeHost", navigator.language), [M, A] = _(""), p = x((
|
|
62
|
-
d(
|
|
61
|
+
}), [l, m] = w("localeHost", navigator.language), [M, A] = _(""), p = x((o) => {
|
|
62
|
+
d(o);
|
|
63
63
|
}, []);
|
|
64
|
-
if (L(() => (
|
|
65
|
-
|
|
64
|
+
if (L(() => (n && N(u.EMMIT_EVENT_HOST_LOCALE_CHANGE, p), console.log("useEffect LocalesProvider"), () => {
|
|
65
|
+
n && T(u.EMMIT_EVENT_HOST_LOCALE_CHANGE, p);
|
|
66
66
|
}), []), L(() => {
|
|
67
|
-
let
|
|
68
|
-
if (!
|
|
67
|
+
let o = !0;
|
|
68
|
+
if (!n && !!r && !(l === M && l !== ""))
|
|
69
69
|
return C({
|
|
70
70
|
method: "POST",
|
|
71
71
|
endPoint: "na/locales",
|
|
@@ -74,24 +74,24 @@ function J(t) {
|
|
|
74
74
|
domain_token: i
|
|
75
75
|
}
|
|
76
76
|
}).then((E) => {
|
|
77
|
-
|
|
77
|
+
o && r(E.data, S, h).then((c) => {
|
|
78
78
|
d(c), A(c.localeString), l !== c.localeString && m(c.localeString), H(u.EMMIT_EVENT_HOST_LOCALE_CHANGE, c);
|
|
79
79
|
});
|
|
80
80
|
}).finally(() => {
|
|
81
81
|
}), function() {
|
|
82
|
-
|
|
82
|
+
o = !1;
|
|
83
83
|
};
|
|
84
84
|
}, [l]), !a)
|
|
85
85
|
return /* @__PURE__ */ g("div", {});
|
|
86
|
-
const O = (
|
|
87
|
-
(
|
|
86
|
+
const O = (o) => {
|
|
87
|
+
(o.lang !== a.lang || o.script !== a.script || o.region !== a.region) && m(f(o));
|
|
88
88
|
};
|
|
89
89
|
return /* @__PURE__ */ g(G.Provider, {
|
|
90
90
|
value: {
|
|
91
91
|
currentLocale: a,
|
|
92
92
|
onChangeLocale: O
|
|
93
93
|
},
|
|
94
|
-
children: /* @__PURE__ */ g(
|
|
94
|
+
children: /* @__PURE__ */ g(P, {
|
|
95
95
|
dateAdapter: F,
|
|
96
96
|
adapterLocale: a.module,
|
|
97
97
|
dateFormats: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useRef as f, useEffect as s, useState as n } from "react";
|
|
2
|
-
import "../contexts/FormatterContext/index.
|
|
2
|
+
import "../contexts/FormatterContext/index.92336f4c.js";
|
|
3
3
|
import "../contexts/HostThemeContext/index.a6a62c70.js";
|
|
4
|
-
import "../contexts/LocalesContext/index.
|
|
4
|
+
import "../contexts/LocalesContext/index.5b555637.js";
|
|
5
5
|
import "@mui/material/styles";
|
|
6
6
|
import "@mui/material/useMediaQuery";
|
|
7
7
|
function m() {
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { P as d } from "./components/ProgressBarStyle/index.fb6fd9ed.js";
|
|
2
|
+
import { F as c, a as P } from "./contexts/FormatterContext/index.92336f4c.js";
|
|
3
|
+
import { L as C, a as F, g } from "./contexts/LocalesContext/index.5b555637.js";
|
|
4
|
+
import { H as L, a as T } from "./contexts/HostThemeContext/index.a6a62c70.js";
|
|
5
|
+
import { u as H } from "./hooks/useFirstRender/index.1e9b02fb.js";
|
|
6
|
+
import { u as O } from "./hooks/useFormatter/index.57ac8cca.js";
|
|
7
|
+
import { u as k } from "./hooks/useHostTheme/index.1c8e4ad7.js";
|
|
8
|
+
import { u as y, a as z } from "./hooks/index.c13bc37e.js";
|
|
9
|
+
import { u as B } from "./hooks/useLocales/index.f676279e.js";
|
|
10
|
+
import { u as E, a as G } from "./hooks/useResponsive/index.fc5e1b4f.js";
|
|
11
|
+
import { d as M } from "./theme/defaultThemeOptions.b2cdbe59.js";
|
|
12
|
+
import { c as V, s as W } from "./theme/shadows.bf8dc290.js";
|
|
13
|
+
import { p as q } from "./theme/palette.2baf72f5.js";
|
|
14
|
+
import { C as K, a as Q, c as U, d as X, b as Y, g as Z } from "./utils/index.7ab4fc54.js";
|
|
15
|
+
import { f as $ } from "./theme/overrides.7958c0ab.js";
|
|
16
|
+
import "@mui/material/styles";
|
|
17
|
+
import "@mui/material";
|
|
18
|
+
import "react/jsx-runtime";
|
|
19
|
+
import "react";
|
|
20
|
+
import "@m4l/core";
|
|
21
|
+
import "@mui/x-date-pickers/AdapterDateFns";
|
|
22
|
+
import "@mui/x-date-pickers";
|
|
23
|
+
import "date-fns/locale/en-US";
|
|
24
|
+
import "@mui/material/useMediaQuery";
|
|
25
|
+
import "./theme/typography.63fff3ec.js";
|
|
26
|
+
import "./vendor.3b4b3674.js";
|
|
27
|
+
export {
|
|
28
|
+
K as Capitalize,
|
|
29
|
+
c as FormatterContext,
|
|
30
|
+
P as FormatterProvider,
|
|
31
|
+
Q as GetFontValue,
|
|
32
|
+
L as HostThemeContext,
|
|
33
|
+
T as HostThemeProvider,
|
|
34
|
+
C as LocalesContext,
|
|
35
|
+
F as LocalesProvider,
|
|
36
|
+
d as ProgressBarStyle,
|
|
37
|
+
U as colorPresets,
|
|
38
|
+
V as customShadows,
|
|
39
|
+
X as defaultPreset,
|
|
40
|
+
M as defaultThemeOptions,
|
|
41
|
+
$ as fnComponentsOverrides,
|
|
42
|
+
Y as getAnchorElPositionWindow,
|
|
43
|
+
Z as getColorPresets,
|
|
44
|
+
g as getLocaleFromNetwork,
|
|
45
|
+
q as palette,
|
|
46
|
+
W as shadows,
|
|
47
|
+
H as useFirstRender,
|
|
48
|
+
O as useFormatter,
|
|
49
|
+
k as useHostTheme,
|
|
50
|
+
y as useIsMountedRef,
|
|
51
|
+
B as useLocales,
|
|
52
|
+
z as useOffSetTop,
|
|
53
|
+
E as useResponsive,
|
|
54
|
+
G as useResponsiveDesktop
|
|
55
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@m4l/graphics",
|
|
3
|
+
"version": "0.1.19",
|
|
4
|
+
"license": "UNLICENSED",
|
|
5
|
+
"author": "M4L Team",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@m4l/core": "*",
|
|
8
|
+
"@mui/x-date-pickers": "^5.0.0-beta.3",
|
|
9
|
+
"date-fns": "^2.29.2"
|
|
10
|
+
},
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"@mui/material": "^5.10.4",
|
|
13
|
+
"@mui/system": "^5.10.4",
|
|
14
|
+
"@types/react": "^17.0.0 || ^18.0.0",
|
|
15
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
16
|
+
"react-dom": "^17.0.0 || ^18.0.0"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"*"
|
|
20
|
+
],
|
|
21
|
+
"source": "src/index.ts",
|
|
22
|
+
"main": "./index.js",
|
|
23
|
+
"module": "./index.js",
|
|
24
|
+
"type": "module",
|
|
25
|
+
"types": "./index.d.ts",
|
|
26
|
+
"sideEffects": false,
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=12.0.0"
|
|
32
|
+
},
|
|
33
|
+
"private": false
|
|
34
|
+
}
|
package/{theme/defaultThemeOptions.9b9e7503.js → dist/theme/defaultThemeOptions.b2cdbe59.js}
RENAMED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { alpha as
|
|
2
|
-
import { t as
|
|
3
|
-
import { p as r, G as
|
|
1
|
+
import { alpha as a } from "@mui/material/styles";
|
|
2
|
+
import { t as e } from "./typography.63fff3ec.js";
|
|
3
|
+
import { p as r, G as t } from "./palette.2baf72f5.js";
|
|
4
4
|
import { s as o, c as s } from "./shadows.bf8dc290.js";
|
|
5
|
-
import { g as i } from "../utils/index.
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { g as i } from "../utils/index.7ab4fc54.js";
|
|
6
|
+
import { b as m } from "../vendor.3b4b3674.js";
|
|
7
|
+
const f = {
|
|
8
|
+
typography: e,
|
|
9
|
+
breakpoints: m,
|
|
8
10
|
shadows: o.light,
|
|
9
11
|
customShadows: {
|
|
10
12
|
...s.light,
|
|
11
|
-
primary: `0 8px 16px 0 ${
|
|
13
|
+
primary: `0 8px 16px 0 ${a(i("default").main, 0.24)}`
|
|
12
14
|
},
|
|
13
15
|
palette: {
|
|
14
16
|
...r.light,
|
|
@@ -23,12 +25,12 @@ const c = {
|
|
|
23
25
|
DarkSelected: "#142827",
|
|
24
26
|
DarkSelectedHover: "#12342B"
|
|
25
27
|
},
|
|
26
|
-
text: { primary:
|
|
28
|
+
text: { primary: t[800], secondary: t[700], disabled: t[500] },
|
|
27
29
|
secondary: {
|
|
28
30
|
main: "#34ac4e"
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
};
|
|
32
34
|
export {
|
|
33
|
-
|
|
35
|
+
f as d
|
|
34
36
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare type AnchorEl = HTMLElement | (() => HTMLElement);
|
|
2
|
+
export interface AnchorOrigin {
|
|
3
|
+
vertical: 'top' | 'center' | 'bottom' | number;
|
|
4
|
+
horizontal: 'left' | 'center' | 'right' | number;
|
|
5
|
+
}
|
|
6
|
+
export interface AnchorPosition {
|
|
7
|
+
top: number;
|
|
8
|
+
left: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const getAnchorElPositionWindow: (anchorElement: HTMLElement, newWindowRect: Pick<DOMRect, 'width' | 'height'>, anchorOrigin: AnchorOrigin, transformOrigin: AnchorOrigin, marginThreshold?: number) => {
|
|
11
|
+
top: number;
|
|
12
|
+
left: number;
|
|
13
|
+
};
|