Actualización de librerías
This commit is contained in:
parent
c60a34a16f
commit
6fc5c172ce
4 changed files with 6089 additions and 5935 deletions
11823
package-lock.json
generated
11823
package-lock.json
generated
File diff suppressed because it is too large
Load diff
131
package.json
131
package.json
|
@ -1,67 +1,68 @@
|
|||
{
|
||||
"name": "@chimera-pe/react-saas",
|
||||
"version": "0.3.2",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@emotion/react": "^11.13.0",
|
||||
"@emotion/styled": "^11.13.0",
|
||||
"@mui/icons-material": "^5.16.5",
|
||||
"@mui/lab": "^5.0.0-alpha.171",
|
||||
"@mui/material": "^5.16.5",
|
||||
"@mui/x-date-pickers": "^7.11.1",
|
||||
"@reduxjs/toolkit": "^2.2.7",
|
||||
"axios": "^1.7.2",
|
||||
"date-fns": "^2.30.0",
|
||||
"final-form": "^4.20.10",
|
||||
"lodash": "^4.17.21",
|
||||
"mui-rff": "^7.4.1",
|
||||
"node-polyglot": "^2.6.0",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-final-form": "^6.5.9",
|
||||
"react-polyglot": "^0.7.2",
|
||||
"react-redux": "^9.1.2",
|
||||
"react-router-dom": "^6.25.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"jwt-decode": "^4.0.0",
|
||||
"navigator-languages": "^2.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.3.3",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"@vitejs/plugin-react": "^4.3.1",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-react": "^7.35.0",
|
||||
"eslint-plugin-react-hooks": "^4.6.2",
|
||||
"eslint-plugin-react-refresh": "^0.4.9",
|
||||
"vite": "^5.3.5"
|
||||
},
|
||||
"description": "Componente integrador con SaaS",
|
||||
"main": "./dist/react-saas.umd.cjs",
|
||||
"module": "./dist/react-saas.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/react-saas.js",
|
||||
"require": "./dist/react-saas.umd.cjs"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git.chimera.com.pe/nodejs/react-saas.git"
|
||||
},
|
||||
"keywords": [
|
||||
"saas"
|
||||
],
|
||||
"author": "Germán Enríquez",
|
||||
"license": "ISC"
|
||||
"name": "@chimera-pe/react-saas",
|
||||
"version": "0.6.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"lint": "eslint .",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@emotion/react": "^11.14.0",
|
||||
"@emotion/styled": "^11.14.0",
|
||||
"@mui/icons-material": "^6.4.7",
|
||||
"@mui/lab": "^6.0.0-beta.22",
|
||||
"@mui/material": "^6.4.7",
|
||||
"@mui/x-date-pickers": "^7.27.3",
|
||||
"@reduxjs/toolkit": "^2.6.1",
|
||||
"axios": "^1.8.3",
|
||||
"date-fns": "^4.1.0",
|
||||
"final-form": "^4.20.10",
|
||||
"lodash": "^4.17.21",
|
||||
"mui-rff": "^8.0.1",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-final-form": "^6.5.9",
|
||||
"react-polyglot": "^0.7.2",
|
||||
"react-redux": "^9.2.0",
|
||||
"react-router-dom": "^7.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"jwt-decode": "^4.0.0",
|
||||
"navigator-languages": "^2.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.19.0",
|
||||
"@types/react": "^18.3.18",
|
||||
"@types/react-dom": "^18.3.5",
|
||||
"@vitejs/plugin-react": "^4.3.4",
|
||||
"eslint": "^9.22.0",
|
||||
"eslint-plugin-react": "^7.37.4",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.19",
|
||||
"globals": "^15.15.0",
|
||||
"vite": "^6.2.2"
|
||||
},
|
||||
"description": "Componente integrador con SaaS",
|
||||
"main": "./dist/react-saas.umd.cjs",
|
||||
"module": "./dist/react-saas.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/react-saas.js",
|
||||
"require": "./dist/react-saas.umd.cjs"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git.chimera.com.pe/nodejs/react-saas.git"
|
||||
},
|
||||
"keywords": [
|
||||
"saas"
|
||||
],
|
||||
"author": "Germán Enríquez",
|
||||
"license": "ISC"
|
||||
}
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
import {useEffect} from "react";
|
||||
import { useEffect } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import {useDispatch,useSelector} from "react-redux";
|
||||
import {I18n} from "react-polyglot";
|
||||
import {enGB,es} from "date-fns/locale"
|
||||
import {LocalizationProvider} from "@mui/x-date-pickers";
|
||||
import {AdapterDateFns} from "@mui/x-date-pickers/AdapterDateFns";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { I18n } from "react-polyglot";
|
||||
import { enGB, es } from "date-fns/locale"
|
||||
import { LocalizationProvider } from "@mui/x-date-pickers";
|
||||
import { AdapterDateFns } from "@mui/x-date-pickers/AdapterDateFnsV3";
|
||||
import navigatorLanguages from "navigator-languages";
|
||||
import {cambiarIdioma} from "../redux";
|
||||
import { cambiarIdioma } from "../redux";
|
||||
import saasMessages from "../i18n";
|
||||
|
||||
const supportedLocales={en: enGB,es};
|
||||
const supportedLocales = { en: enGB, es };
|
||||
|
||||
const IdiomaInner=({messages,children}) => {
|
||||
const idioma=useSelector(store => store.ui.idioma);
|
||||
const IdiomaInner = ({ messages, children }) => {
|
||||
const idioma = useSelector(store => store.ui.idioma);
|
||||
|
||||
return (
|
||||
<I18n locale={idioma} messages={messages[idioma]}>
|
||||
|
@ -23,41 +23,41 @@ const IdiomaInner=({messages,children}) => {
|
|||
);
|
||||
};
|
||||
|
||||
IdiomaInner.propTypes={
|
||||
IdiomaInner.propTypes = {
|
||||
messages: PropTypes.object,
|
||||
children: PropTypes.element.isRequired
|
||||
};
|
||||
|
||||
const getIdiomaNavegador=() => {
|
||||
const idiomas=navigatorLanguages();
|
||||
if(!idiomas?.length) {
|
||||
const getIdiomaNavegador = () => {
|
||||
const idiomas = navigatorLanguages();
|
||||
if (!idiomas?.length) {
|
||||
return undefined;
|
||||
}
|
||||
const idioma=idiomas[0];
|
||||
if(idioma.indexOf("-")) {
|
||||
return idioma.substring(0,idioma.indexOf("-"));
|
||||
const idioma = idiomas[0];
|
||||
if (idioma.indexOf("-")) {
|
||||
return idioma.substring(0, idioma.indexOf("-"));
|
||||
}
|
||||
return idioma;
|
||||
};
|
||||
|
||||
const Idioma=({messages,idiomaDefecto,children}) => {
|
||||
const dispatch=useDispatch();
|
||||
const idiomaNavegador=getIdiomaNavegador();
|
||||
const Idioma = ({ messages, idiomaDefecto, children }) => {
|
||||
const dispatch = useDispatch();
|
||||
const idiomaNavegador = getIdiomaNavegador();
|
||||
|
||||
useEffect(() => {
|
||||
let idioma=Reflect.ownKeys(messages)[0];
|
||||
if(idiomaNavegador && Object.hasOwn(messages,idiomaNavegador)) {
|
||||
idioma=idiomaNavegador;
|
||||
let idioma = Reflect.ownKeys(messages)[0];
|
||||
if (idiomaNavegador && Object.hasOwn(messages, idiomaNavegador)) {
|
||||
idioma = idiomaNavegador;
|
||||
}
|
||||
else if(idiomaDefecto && Object.hasOwn(messages,idiomaDefecto)) {
|
||||
idioma=idiomaDefecto;
|
||||
else if (idiomaDefecto && Object.hasOwn(messages, idiomaDefecto)) {
|
||||
idioma = idiomaDefecto;
|
||||
}
|
||||
dispatch(cambiarIdioma(idioma));
|
||||
},[dispatch,messages,idiomaDefecto,idiomaNavegador]);
|
||||
}, [dispatch, messages, idiomaDefecto, idiomaNavegador]);
|
||||
|
||||
const m={};
|
||||
const m = {};
|
||||
Object.keys(messages).forEach(key => {
|
||||
m[key]={
|
||||
m[key] = {
|
||||
...messages[key],
|
||||
saas: saasMessages[key]
|
||||
};
|
||||
|
@ -70,10 +70,10 @@ const Idioma=({messages,idiomaDefecto,children}) => {
|
|||
);
|
||||
};
|
||||
|
||||
Idioma.propTypes={
|
||||
Idioma.propTypes = {
|
||||
messages: PropTypes.object,
|
||||
idiomaDefecto: PropTypes.string,
|
||||
children: PropTypes.element.isRequired
|
||||
};
|
||||
|
||||
export default Idioma;
|
||||
export default Idioma;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {defineConfig} from "vite";
|
||||
import {resolve} from "path";
|
||||
import { defineConfig } from "vite";
|
||||
import { resolve } from "path";
|
||||
import react from "@vitejs/plugin-react";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
|
@ -7,7 +7,7 @@ export default defineConfig({
|
|||
plugins: [react()],
|
||||
build: {
|
||||
lib: {
|
||||
entry: resolve(__dirname,"src/index.js"),
|
||||
entry: resolve(__dirname, "src/index.js"),
|
||||
name: "react-saas",
|
||||
fileName: "react-saas"
|
||||
},
|
||||
|
@ -25,7 +25,7 @@ export default defineConfig({
|
|||
"@mui/material/styles",
|
||||
"@mui/material/colors",
|
||||
"@mui/x-date-pickers",
|
||||
"@mui/x-date-pickers/AdapterDateFns",
|
||||
"@mui/x-date-pickers/AdapterDateFnsV3",
|
||||
"@reduxjs/toolkit",
|
||||
"axios",
|
||||
"date-fns/locale",
|
||||
|
@ -56,7 +56,7 @@ export default defineConfig({
|
|||
"@mui/material/styles": "MuiMaterialStyles",
|
||||
"@mui/material/colors": "MuiMaterialColors",
|
||||
"@mui/x-date-pickers": "MuiXDatePickers",
|
||||
"@mui/x-date-pickers/AdapterDateFns": "MuiXDatePickersAdapter",
|
||||
"@mui/x-date-pickers/AdapterDateFnsV3": "MuiXDatePickersAdapter",
|
||||
"@reduxjs/toolkit": "ReduxToolkit",
|
||||
"axios": "Axios",
|
||||
"date-fns/locale": "DateFNSLocale",
|
||||
|
|
Loading…
Add table
Reference in a new issue