@vlci/vlcishared 10.0.0 → 12.0.0
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/.eslintrc.json +3 -1
- package/dist/js/vlcishared.js +1 -2
- package/dist/js/vlcishared.js.map +1 -1
- package/package.json +1 -3
- package/webpack.config.dev.js +4 -4
- package/dist/js/camarasTrafico.js +0 -2
- package/dist/js/camarasTrafico.js.map +0 -1
- package/dist/js/tableCalidadAire.js +0 -2
- package/dist/js/tableCalidadAire.js.map +0 -1
- package/dist/js/vlcishared.js.LICENSE.txt +0 -33
- package/dist/js/vlcisharedInitialCalls.js +0 -2
- package/dist/js/vlcisharedInitialCalls.js.map +0 -1
- package/dist/js/vlcisharedKPI.js +0 -2
- package/dist/js/vlcisharedKPI.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vlci/vlcishared",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "Proyecto JavaScript que contine funciones comunes a todos los Cdm`s y V.Minut",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -32,9 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"buffer": "^6.0.3",
|
|
35
|
-
"echarts": "^5.4.3",
|
|
36
35
|
"process": "^0.11.10",
|
|
37
|
-
"tabulator-tables": "^5.5.2",
|
|
38
36
|
"util": "^0.12.4",
|
|
39
37
|
"wkx": "^0.5.0"
|
|
40
38
|
}
|
package/webpack.config.dev.js
CHANGED
|
@@ -14,10 +14,6 @@ module.exports = {
|
|
|
14
14
|
mode: 'development',
|
|
15
15
|
entry: {
|
|
16
16
|
vlcishared: './src/index.js',
|
|
17
|
-
tableCalidadAire: './src/medioambiente/table-calidad-aire.js',
|
|
18
|
-
camarasTrafico: './src/camaras/camaras-trafico.js',
|
|
19
|
-
vlcisharedInitialCalls: './src/indexInitialCalls.js',
|
|
20
|
-
vlcisharedKPI: './src/indexKPI.js',
|
|
21
17
|
},
|
|
22
18
|
output: {
|
|
23
19
|
path: path.resolve(__dirname, 'dist/js'),
|
|
@@ -37,4 +33,8 @@ module.exports = {
|
|
|
37
33
|
process: 'process/browser',
|
|
38
34
|
}),
|
|
39
35
|
],
|
|
36
|
+
externals: {
|
|
37
|
+
echarts: 'echarts',
|
|
38
|
+
'tabulator-tables': 'tabulator-tables',
|
|
39
|
+
},
|
|
40
40
|
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.camarasTrafico=t():e.camarasTrafico=t()}(self,(()=>(()=>{"use strict";var e={d:(t,a)=>{for(var o in a)e.o(a,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:a[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function a(e,t,a,o,r,s){let c=!1,n=!1;const i=document.querySelector(e),l=document.querySelector(t),u=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(i&&i.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=cas"),l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=cas")):(i&&i.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=val"),l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=val"))};function m(e=!0){const t=document.querySelector(a);e?(i&&(i.src="about:blank"),l&&(l.src="about:blank"),t.classList.add("blur"),n=!0):(t.classList.remove("blur"),u(),n=!1)}const d=e=>{new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&(n||u(),c||(c=!0,window.setTimeout(m,s)))}))})).observe(e)};!function(){const{userAgent:e}=navigator;return/iPad|iPhone|iPod|Macintosh/.test(e)&&!window.MSStream}()?(i&&(i.setAttribute("sandbox","allow-scripts"),d(i)),l&&(l.setAttribute("sandbox","allow-scripts"),d(l)),document.querySelector(r).addEventListener("click",(()=>{m(!1),window.setTimeout(m,s)}))):document.querySelectorAll(o)[0].style.display="none"}return e.r(t),e.d(t,{buildCamarasTrafico:()=>a}),t})()));
|
|
2
|
-
//# sourceMappingURL=camarasTrafico.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"camarasTrafico.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAwB,eAAID,IAE5BD,EAAqB,eAAIC,GAC1B,CATD,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CCA1BA,EAAwB,CAACL,EAASM,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDF,EAAwB,CAACQ,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFT,EAAyBL,IACH,oBAAXkB,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeV,EAASkB,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeV,EAAS,aAAc,CAAEoB,OAAO,GAAO,G,KCHvD,SAASC,EACdC,EACAC,EACAC,EACAC,EACAC,EACAC,GAYA,IAAIC,GAAc,EACdC,GAAiB,EAErB,MAAMC,EAAsBC,SAASC,cAAcV,GAC7CW,EAAwBF,SAASC,cACrCT,GAMIW,EAAiB,KAEA,oBAAZC,SAdc,UAgBrBA,QAAQC,aAAaC,sBAEjBP,GACFA,EAAoBQ,aAAa,MA3BrC,uEA6BML,GACFA,EAAsBK,aACpB,MA7BN,gEAkCMR,GACFA,EAAoBQ,aAAa,MAjCrC,uEAmCML,GACFA,EAAsBK,aACpB,MAnCN,8DAuCA,EA2BF,SAASC,EAASC,GAAS,GACzB,MAAMC,EAAmBV,SAASC,cAAcR,GAC5CgB,GAtBAV,IACFA,EAAoBY,IAAM,eAExBT,IACFA,EAAsBS,IAAM,eAoB5BD,EAAiBE,UAAUC,IAAI,QAC/Bf,GAAiB,IAEjBY,EAAiBE,UAAUE,OAAO,QAClCX,IACAL,GAAiB,EAErB,CASA,MAAMiB,EAA0BC,IACP,IAAIC,sBAAsBC,IAC/CA,EAAQC,SAASC,IACXA,EAAMC,iBACHvB,GACHK,IAGGN,IACHA,GAAc,EACdyB,OAAOC,WAAWf,EAAUZ,IAEhC,GACA,IAEW4B,QAAQR,EAAO,GCrG3B,WACL,MAAM,UAAES,GAAcC,UACtB,MAAO,6BAA6BC,KAAKF,KAAeH,OAAOM,QACjE,CDsGSC,IACC9B,IACFA,EAAoBQ,aAAa,UAAW,iBAC5CQ,EAAuBhB,IAErBG,IACFA,EAAsBK,aAAa,UAAW,iBAC9CQ,EAAuBb,IAEzBF,SAASC,cAAcN,GAAiBmC,iBAAiB,SAAS,KAChEtB,GAAS,GACTc,OAAOC,WAAWf,EAAUZ,EAAsB,KA1DnCI,SAAS+B,iBAAiBrC,GAAiB,GACnDsC,MAAMC,QAAU,MAgE/B,C","sources":["webpack://@vlci/vlcishared/webpack/universalModuleDefinition","webpack://@vlci/vlcishared/webpack/bootstrap","webpack://@vlci/vlcishared/webpack/runtime/define property getters","webpack://@vlci/vlcishared/webpack/runtime/hasOwnProperty shorthand","webpack://@vlci/vlcishared/webpack/runtime/make namespace object","webpack://@vlci/vlcishared/./src/camaras/camaras-trafico.js","webpack://@vlci/vlcishared/./src/common/common-navigation.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"camarasTrafico\"] = factory();\n\telse\n\t\troot[\"camarasTrafico\"] = factory();\n})(self, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { isIOSDevice } from '../common/common-navigation';\n\nexport function buildCamarasTrafico(\n paramIframeAccesosCiudad,\n paramIframeViasPrincipales,\n paramSectionContainer,\n paramDivCamaras,\n paramBlurButton,\n paramMillisBeforeBlur,\n) {\n const URL_CAMARA_ACCESO_CIUDAD_CAS =\n 'https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=cas';\n const URL_CAMARA_VIAS_PRINCIPALES_CAS =\n 'https://camaras.valencia.es/camaras/ocimovil.html?lang=cas';\n const URL_CAMARA_ACCESO_CIUDAD_VAL =\n 'https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=val';\n const URL_CAMARA_VIAS_PRINCIPALES_VAL =\n 'https://camaras.valencia.es/camaras/ocimovil.html?lang=val';\n\n const COD_ISO_VALENCIA = 'ca-ES';\n let firstAccess = false;\n let blurModeActive = false;\n\n const iframeAccesosCiudad = document.querySelector(paramIframeAccesosCiudad);\n const iframeViasPrincipales = document.querySelector(\n paramIframeViasPrincipales,\n );\n\n /**\n * Agregar al Iframe la url de las camaras de trafico\n */\n const refreshCamaras = () => {\n if (\n typeof Liferay !== 'undefined' &&\n // eslint-disable-next-line no-undef\n Liferay.ThemeDisplay.getBCP47LanguageId() === COD_ISO_VALENCIA\n ) {\n if (iframeAccesosCiudad) {\n iframeAccesosCiudad.setAttribute('src', URL_CAMARA_ACCESO_CIUDAD_CAS);\n }\n if (iframeViasPrincipales) {\n iframeViasPrincipales.setAttribute(\n 'src',\n URL_CAMARA_VIAS_PRINCIPALES_CAS,\n );\n }\n } else {\n if (iframeAccesosCiudad) {\n iframeAccesosCiudad.setAttribute('src', URL_CAMARA_ACCESO_CIUDAD_VAL);\n }\n if (iframeViasPrincipales) {\n iframeViasPrincipales.setAttribute(\n 'src',\n URL_CAMARA_VIAS_PRINCIPALES_VAL,\n );\n }\n }\n };\n\n /**\n * Quita las url de las camaras de los iframes\n */\n const stopCamaras = () => {\n if (iframeAccesosCiudad) {\n iframeAccesosCiudad.src = 'about:blank';\n }\n if (iframeViasPrincipales) {\n iframeViasPrincipales.src = 'about:blank';\n }\n };\n\n /**\n * Oculta toda la caja de camaras.\n */\n function hideCamaras() {\n const divCamaras = document.querySelectorAll(paramDivCamaras)[0];\n divCamaras.style.display = 'none';\n }\n\n /**\n * Permite activar el modo blur que muestra las camaras difuminadas con un boton de recarga.\n * @param {boolean} active true para activar, false para desactivar.\n */\n function blurMode(active = true) {\n const sectionContainer = document.querySelector(paramSectionContainer);\n if (active) {\n stopCamaras();\n sectionContainer.classList.add('blur');\n blurModeActive = true;\n } else {\n sectionContainer.classList.remove('blur');\n refreshCamaras();\n blurModeActive = false;\n }\n }\n\n /**\n * Evento que activa la visualizacion de las camaras si se muestra\n * por pantalla.\n * @param {Object} iframe\n * @param {String} urlCamarasCas\n * @param {String} urlCamarasVal\n */\n const handlerIsVisibleIframe = (iframe) => {\n const observerCamara = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n if (!blurModeActive) {\n refreshCamaras();\n }\n // Aqui solo entra la primera vez\n if (!firstAccess) {\n firstAccess = true;\n window.setTimeout(blurMode, paramMillisBeforeBlur);\n }\n }\n });\n });\n observerCamara.observe(iframe);\n };\n\n function linksCamarasTrafico() {\n if (!isIOSDevice()) {\n if (iframeAccesosCiudad) {\n iframeAccesosCiudad.setAttribute('sandbox', 'allow-scripts');\n handlerIsVisibleIframe(iframeAccesosCiudad);\n }\n if (iframeViasPrincipales) {\n iframeViasPrincipales.setAttribute('sandbox', 'allow-scripts');\n handlerIsVisibleIframe(iframeViasPrincipales);\n }\n document.querySelector(paramBlurButton).addEventListener('click', () => {\n blurMode(false);\n window.setTimeout(blurMode, paramMillisBeforeBlur);\n });\n } else {\n hideCamaras();\n }\n }\n linksCamarasTrafico();\n}\n","/**\n * Obtiene una ruta completa del Cdm de Pentaho donde nos encontramos\n * con la ruta relativa proporcionada.\n * @param {string} route Ruta relativa que se concatenara al path principal.\n */\nexport function calculatePentahoPath(route) {\n document.location = `${document.documentURI.split('%3A')[0]}%3A${\n document.documentURI.split('%3A')[1]\n }%3A${document.documentURI.split('%3A')[2]}%3A${\n document.documentURI.split('%3A')[3]\n }%3A${route}`;\n}\n\n/**\n * Indica si el dispositivo con el que se consulta la pagina es IOS o no.\n * @returns True si es IOS y False si no lo es.\n */\nexport function isIOSDevice() {\n const { userAgent } = navigator;\n return /iPad|iPhone|iPod|Macintosh/.test(userAgent) && !window.MSStream;\n}\n"],"names":["root","factory","exports","module","define","amd","self","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","buildCamarasTrafico","paramIframeAccesosCiudad","paramIframeViasPrincipales","paramSectionContainer","paramDivCamaras","paramBlurButton","paramMillisBeforeBlur","firstAccess","blurModeActive","iframeAccesosCiudad","document","querySelector","iframeViasPrincipales","refreshCamaras","Liferay","ThemeDisplay","getBCP47LanguageId","setAttribute","blurMode","active","sectionContainer","src","classList","add","remove","handlerIsVisibleIframe","iframe","IntersectionObserver","entries","forEach","entry","isIntersecting","window","setTimeout","observe","userAgent","navigator","test","MSStream","isIOSDevice","addEventListener","querySelectorAll","style","display"],"sourceRoot":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.tableCalidadAire=t():e.tableCalidadAire=t()}(self,(()=>(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function n(e){const t=[],n=[100,200,350,500,750,751],o=[40,90,120,230,340,341],d=[50,100,130,240,380,381],a=[20,40,50,100,150,151],i=[10,20,25,50,75,76],l={0:"b",1:"a",2:"d",3:"m",4:"mm",5:"em",6:"",7:"nd"};function r(e,t,n){const o=document.createElement("td");if(o.setAttribute("id",e),null!=t){o.innerHTML=t;const e=function(e,t){let n;return void 0===t?n=6:"ND"===t?n=7:(n=5,e.forEach(((e,o)=>{t<=e&&5===n&&(n=o)}))),l[n]}(n,t);o.classList.add(e)}return o}return e.forEach((e=>{const l=e;"noData"===l.operationalstatus&&(l.so2value="ND",l.no2value="ND",l.o3value="ND",l.pm10value="ND",l.pm25value="ND"),"A09_CABANYAL_60m"===l.entityid&&(l.pm10value=void 0,l.pm25value=void 0);const u=document.createElement("tr"),p=document.createElement("td");p.innerHTML=l.address,u.appendChild(p),u.appendChild(r(`${l.entityid}_so2`,l.so2value,n)),u.appendChild(r(`${l.entityid}_no2`,l.no2value,o)),u.appendChild(r(`${l.entityid}_o3`,l.o3value,d)),u.appendChild(r(`${l.entityid}_pm10`,l.pm10value,a)),u.appendChild(r(`${l.entityid}_pm25`,l.pm25value,i)),t.push(u)})),t}return e.r(t),e.d(t,{buildTableCalidadAire:()=>n}),t})()));
|
|
2
|
-
//# sourceMappingURL=tableCalidadAire.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tableCalidadAire.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAA0B,iBAAID,IAE9BD,EAAuB,iBAAIC,GAC5B,CATD,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CCA1BA,EAAwB,CAACL,EAASM,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDF,EAAwB,CAACQ,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFT,EAAyBL,IACH,oBAAXkB,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeV,EAASkB,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeV,EAAS,aAAc,CAAEoB,OAAO,GAAO,G,KCLvD,SAASC,EAAsBC,GACpC,MAAMC,EAAU,GACVC,EAAiB,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,KAC3CC,EAAiB,CAAC,GAAI,GAAI,IAAK,IAAK,IAAK,KACzCC,EAAgB,CAAC,GAAI,IAAK,IAAK,IAAK,IAAK,KACzCC,EAAkB,CAAC,GAAI,GAAI,GAAI,IAAK,IAAK,KACzCC,EAAkB,CAAC,GAAI,GAAI,GAAI,GAAI,GAAI,IACvCC,EAAsB,CAC1B,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KACH,EAAG,KACH,EAAG,GACH,EAAG,MAkCL,SAASC,EAAgBC,EAAQX,EAAOY,GACtC,MAAMC,EAAYC,SAASC,cAAc,MAEzC,GADAF,EAAUG,aAAa,KAAML,GACzBX,QAAuC,CACzCa,EAAUI,UAAYjB,EACtB,MAAMkB,EA7BV,SAAqBC,EAAOnB,GAC1B,IAAIY,EAaJ,YAZcQ,IAAVpB,EACFY,EAAY,EACO,OAAVZ,EACTY,EAAY,GAEZA,EAAY,EACZO,EAAME,SAAQ,CAACC,EAASC,KAClBvB,GAASsB,GAAyB,IAAdV,IACtBA,EAAYW,EACd,KAGGd,EAAoBG,EAC7B,CAcqBY,CAAYZ,EAAWZ,GACxCa,EAAUY,UAAUC,IAAIR,EAC1B,CACA,OAAOL,CACT,CA8DA,OA5DAX,EAAUmB,SAASM,IACjB,MAAMC,EAAWD,EAEkB,WAA/BC,EAASC,oBACXD,EAASE,SAAW,KACpBF,EAASG,SAAW,KACpBH,EAASI,QAAU,KACnBJ,EAASK,UAAY,KACrBL,EAASM,UAAY,MAIG,qBAAtBN,EAASO,WACXP,EAASK,eAAYb,EACrBQ,EAASM,eAAYd,GAGvB,MAAMgB,EAAkBtB,SAASC,cAAc,MACzCsB,EAAkBvB,SAASC,cAAc,MAC/CsB,EAAgBpB,UAAYW,EAASU,QACrCF,EAAgBG,YAAYF,GAE5BD,EAAgBG,YACd7B,EACE,GAAGkB,EAASO,eACZP,EAASE,SACT1B,IAGJgC,EAAgBG,YACd7B,EACE,GAAGkB,EAASO,eACZP,EAASG,SACT1B,IAGJ+B,EAAgBG,YACd7B,EACE,GAAGkB,EAASO,cACZP,EAASI,QACT1B,IAGJ8B,EAAgBG,YACd7B,EACE,GAAGkB,EAASO,gBACZP,EAASK,UACT1B,IAGJ6B,EAAgBG,YACd7B,EACE,GAAGkB,EAASO,gBACZP,EAASM,UACT1B,IAGJL,EAAQqC,KAAKJ,EAAgB,IAGxBjC,CACT,C","sources":["webpack://@vlci/vlcishared/webpack/universalModuleDefinition","webpack://@vlci/vlcishared/webpack/bootstrap","webpack://@vlci/vlcishared/webpack/runtime/define property getters","webpack://@vlci/vlcishared/webpack/runtime/hasOwnProperty shorthand","webpack://@vlci/vlcishared/webpack/runtime/make namespace object","webpack://@vlci/vlcishared/./src/medioambiente/table-calidad-aire.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"tableCalidadAire\"] = factory();\n\telse\n\t\troot[\"tableCalidadAire\"] = factory();\n})(self, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export function buildTableCalidadAire(resultset) {\n const trArray = [];\n const SO2_THRESHOLDS = [100, 200, 350, 500, 750, 751];\n const NO2_THRESHOLDS = [40, 90, 120, 230, 340, 341];\n const O3_THRESHOLDS = [50, 100, 130, 240, 380, 381];\n const PM10_THRESHOLDS = [20, 40, 50, 100, 150, 151];\n const PM25_THRESHOLDS = [10, 20, 25, 50, 75, 76];\n const CSS_CLASS_THRESHOLD = {\n 0: 'b',\n 1: 'a',\n 2: 'd',\n 3: 'm',\n 4: 'mm',\n 5: 'em',\n 6: '',\n 7: 'nd',\n };\n /**\n * Setea la clase CSS al objeto con el id que recibe por parámetro\n * dependiendo de en que umbral se encuentra el valor.\n * @param {Array} array\n * @param {Number} value\n * @param {String} idCss\n * @returns {String}\n */\n function getCssClass(array, value) {\n let threshold;\n if (value === undefined) {\n threshold = 6;\n } else if (value === 'ND') {\n threshold = 7;\n } else {\n threshold = 5;\n array.forEach((element, index) => {\n if (value <= element && threshold === 5) {\n threshold = index;\n }\n });\n }\n return CSS_CLASS_THRESHOLD[threshold];\n }\n\n /**\n * Crea un elemento td para una tabla html con un id y valor determinados.\n * @param {string} idName Id que se le asignará al td.\n * @param {string} value Valor del td.\n * @param {string} threshold Array que contenga los umbrales.\n * @returns {td node} Elemento td\n */\n function createTdElement(idName, value, threshold) {\n const tdElement = document.createElement('td');\n tdElement.setAttribute('id', idName);\n if (value !== undefined && value !== null) {\n tdElement.innerHTML = value;\n const cssClass = getCssClass(threshold, value);\n tdElement.classList.add(cssClass);\n }\n return tdElement;\n }\n\n resultset.forEach((row) => {\n const estacion = row;\n // Si los datos estan desactualizados mostramos N/D en la estación\n if (estacion.operationalstatus === 'noData') {\n estacion.so2value = 'ND';\n estacion.no2value = 'ND';\n estacion.o3value = 'ND';\n estacion.pm10value = 'ND';\n estacion.pm25value = 'ND';\n }\n\n // ELIMINAR PARA MOSTRAR DATOS PM10 Y PM25 DE CABANYAL\n if (estacion.entityid === 'A09_CABANYAL_60m') {\n estacion.pm10value = undefined;\n estacion.pm25value = undefined;\n }\n // Rellenando la tabla dinamica\n const markupTrElement = document.createElement('tr');\n const markupTdElement = document.createElement('td');\n markupTdElement.innerHTML = estacion.address;\n markupTrElement.appendChild(markupTdElement);\n\n markupTrElement.appendChild(\n createTdElement(\n `${estacion.entityid}_so2`,\n estacion.so2value,\n SO2_THRESHOLDS,\n ),\n );\n markupTrElement.appendChild(\n createTdElement(\n `${estacion.entityid}_no2`,\n estacion.no2value,\n NO2_THRESHOLDS,\n ),\n );\n markupTrElement.appendChild(\n createTdElement(\n `${estacion.entityid}_o3`,\n estacion.o3value,\n O3_THRESHOLDS,\n ),\n );\n markupTrElement.appendChild(\n createTdElement(\n `${estacion.entityid}_pm10`,\n estacion.pm10value,\n PM10_THRESHOLDS,\n ),\n );\n markupTrElement.appendChild(\n createTdElement(\n `${estacion.entityid}_pm25`,\n estacion.pm25value,\n PM25_THRESHOLDS,\n ),\n );\n trArray.push(markupTrElement);\n });\n\n return trArray;\n}\n"],"names":["root","factory","exports","module","define","amd","self","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","buildTableCalidadAire","resultset","trArray","SO2_THRESHOLDS","NO2_THRESHOLDS","O3_THRESHOLDS","PM10_THRESHOLDS","PM25_THRESHOLDS","CSS_CLASS_THRESHOLD","createTdElement","idName","threshold","tdElement","document","createElement","setAttribute","innerHTML","cssClass","array","undefined","forEach","element","index","getCssClass","classList","add","row","estacion","operationalstatus","so2value","no2value","o3value","pm10value","pm25value","entityid","markupTrElement","markupTdElement","address","appendChild","push"],"sourceRoot":""}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The buffer module from node.js, for the browser.
|
|
3
|
-
*
|
|
4
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
|
-
* @license MIT
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/*!
|
|
9
|
-
* ZRender, a high performance 2d drawing library.
|
|
10
|
-
*
|
|
11
|
-
* Copyright (c) 2013, Baidu Inc.
|
|
12
|
-
* All rights reserved.
|
|
13
|
-
*
|
|
14
|
-
* LICENSE
|
|
15
|
-
* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/*! *****************************************************************************
|
|
19
|
-
Copyright (c) Microsoft Corporation.
|
|
20
|
-
|
|
21
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
22
|
-
purpose with or without fee is hereby granted.
|
|
23
|
-
|
|
24
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
25
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
26
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
27
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
28
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
29
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
30
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
31
|
-
***************************************************************************** */
|
|
32
|
-
|
|
33
|
-
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vlcisharedInitialCalls=t():e.vlcisharedInitialCalls=t()}(self,(()=>(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function n(e){document.querySelectorAll(`[${e}]`).forEach((t=>{!function(e,t){const n=t;if(e){const t=new XMLHttpRequest;t.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(n.innerHTML=this.responseText),404===this.status&&(n.innerHTML="No se ha podido cargar correctamente."))},t.open("GET",e,!0),t.send()}}(t.getAttribute(e),t)}))}function o(){n("include-html-cabecera"),n("include-html-menu"),n("include-html-main-container"),n("include-html-copyright")}function i(e){document.location=`${document.documentURI.split("%3A")[0]}%3A${document.documentURI.split("%3A")[1]}%3A${document.documentURI.split("%3A")[2]}%3A${document.documentURI.split("%3A")[3]}%3A${e}`}return e.r(t),e.d(t,{calculatePentahoPath:()=>i,initialCalls:()=>o}),t})()));
|
|
2
|
-
//# sourceMappingURL=vlcisharedInitialCalls.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vlcisharedInitialCalls.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAgC,uBAAID,IAEpCD,EAA6B,uBAAIC,GAClC,CATD,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CCA1BA,EAAwB,CAACL,EAASM,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDF,EAAwB,CAACQ,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFT,EAAyBL,IACH,oBAAXkB,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeV,EAASkB,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeV,EAAS,aAAc,CAAEoB,OAAO,GAAO,G,KCyBvD,SAASC,EAA0BC,GACvBC,SAASC,iBAAiB,IAAIF,MACtCG,SAASC,KA3BpB,SAAkCC,EAAUC,GAC1C,MAAMF,EAAUE,EAChB,GAAID,EAAU,CACZ,MAAME,EAAQ,IAAIC,eAClBD,EAAME,mBAAqB,WACD,IAApBC,KAAKC,aACa,MAAhBD,KAAKE,SACPR,EAAQS,UAAYH,KAAKI,cAEP,MAAhBJ,KAAKE,SACPR,EAAQS,UAAY,yCAG1B,EACAN,EAAMQ,KAAK,MAAOV,GAAU,GAC5BE,EAAMS,MACR,CACF,CAYIC,CADiBb,EAAQc,aAAalB,GACHI,EAAQ,GAE/C,CAMO,SAASe,IACdpB,EAA0B,yBAC1BA,EAA0B,qBAC1BA,EAA0B,+BAC1BA,EAA0B,yBAC5B,CC1CO,SAASqB,EAAqBC,GACnCpB,SAASqB,SAAW,GAAGrB,SAASsB,YAAYC,MAAM,OAAO,QACvDvB,SAASsB,YAAYC,MAAM,OAAO,QAC9BvB,SAASsB,YAAYC,MAAM,OAAO,QACtCvB,SAASsB,YAAYC,MAAM,OAAO,QAC9BH,GACR,C","sources":["webpack://@vlci/vlcishared/webpack/universalModuleDefinition","webpack://@vlci/vlcishared/webpack/bootstrap","webpack://@vlci/vlcishared/webpack/runtime/define property getters","webpack://@vlci/vlcishared/webpack/runtime/hasOwnProperty shorthand","webpack://@vlci/vlcishared/webpack/runtime/make namespace object","webpack://@vlci/vlcishared/./src/common/common-initial-calls.js","webpack://@vlci/vlcishared/./src/common/common-navigation.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"vlcisharedInitialCalls\"] = factory();\n\telse\n\t\troot[\"vlcisharedInitialCalls\"] = factory();\n})(self, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Función que inyecta codigo html de un fichero determinado en una etiqueta html.\n * @param {string} filePath Ruta de fichero que vamos a cargar.\n * @param {element} elementParam Elemento HTML en el que vamos a inyectar la ruta.\n */\nfunction includeHTMLFileInElement(filePath, elementParam) {\n const element = elementParam;\n if (filePath) {\n const xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (this.readyState === 4) {\n if (this.status === 200) {\n element.innerHTML = this.responseText;\n }\n if (this.status === 404) {\n element.innerHTML = 'No se ha podido cargar correctamente.';\n }\n }\n };\n xhttp.open('GET', filePath, true);\n xhttp.send();\n }\n}\n\n/**\n * Función que inyecta codigo html de un fichero determinado en una serie de etiquetas html\n * que contienen un atributo en común.\n * @param {string} attrName Nombre del atributo html que se va a buscar entre los elementos.\n * @returns void\n */\nexport function includeHTMLFileInElements(attrName) {\n const elements = document.querySelectorAll(`[${attrName}]`);\n elements.forEach((element) => {\n const filePath = element.getAttribute(attrName);\n includeHTMLFileInElement(filePath, element);\n });\n}\n\n/**\n *Función que se ejecuta desde el html de pentaho y que carga diferentes partes de la página\n * @param {*} id\n */\nexport function initialCalls() {\n includeHTMLFileInElements('include-html-cabecera');\n includeHTMLFileInElements('include-html-menu');\n includeHTMLFileInElements('include-html-main-container');\n includeHTMLFileInElements('include-html-copyright');\n}\n","/**\n * Obtiene una ruta completa del Cdm de Pentaho donde nos encontramos\n * con la ruta relativa proporcionada.\n * @param {string} route Ruta relativa que se concatenara al path principal.\n */\nexport function calculatePentahoPath(route) {\n document.location = `${document.documentURI.split('%3A')[0]}%3A${\n document.documentURI.split('%3A')[1]\n }%3A${document.documentURI.split('%3A')[2]}%3A${\n document.documentURI.split('%3A')[3]\n }%3A${route}`;\n}\n\n/**\n * Indica si el dispositivo con el que se consulta la pagina es IOS o no.\n * @returns True si es IOS y False si no lo es.\n */\nexport function isIOSDevice() {\n const { userAgent } = navigator;\n return /iPad|iPhone|iPod|Macintosh/.test(userAgent) && !window.MSStream;\n}\n"],"names":["root","factory","exports","module","define","amd","self","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","includeHTMLFileInElements","attrName","document","querySelectorAll","forEach","element","filePath","elementParam","xhttp","XMLHttpRequest","onreadystatechange","this","readyState","status","innerHTML","responseText","open","send","includeHTMLFileInElement","getAttribute","initialCalls","calculatePentahoPath","route","location","documentURI","split"],"sourceRoot":""}
|
package/dist/js/vlcisharedKPI.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vlcisharedKPI=t():e.vlcisharedKPI=t()}(self,(()=>(()=>{"use strict";var e={d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function o(e){let t=navigator.language||navigator.userLanguage;t=t.length<=2?`${t}-${t.toUpperCase()}`:t;const o={minimumFractionDigits:0,maximumFractionDigits:2};return"es-ES"===t?e.toLocaleString("de-DE",o):e.toLocaleString(t,o)}function r(e){const{resultset:t,metadata:o}=e,r=[];return t.forEach((e=>{const t={};e.forEach(((e,r)=>{t[o[r].colName]=e})),r.push(t)})),r}function n(e,t){e.forEach((e=>{e.id in t&&Object.entries(t[e.id]).forEach((o=>{const r=o[0],n=o[1];"object"==typeof n?n.className?document.querySelector(n.className).className=e[r]:n.element&&n.format&&(document.querySelector(n.element).textContent=t[e.id][r].format(e[r])):document.querySelector(n).textContent=e[r]}))}))}e.r(t),e.d(t,{addPointInteger:()=>o,formatMonthAnyo:()=>c,formatTrimestre:()=>s,getMonth:()=>a,printDataInHTMLElements:()=>n,resultsetWithFields:()=>r});const i={"01":"Enero","02":"Febrero","03":"Marzo","04":"Abril","05":"Mayo","06":"Junio","07":"Julio","08":"Agosto","09":"Septiembre",10:"Octubre",11:"Noviembre",12:"Diciembre"};function a(e){return{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(e.toString(),10)]}function c(e){const t=e.substring(0,4);return`${i[e.substring(4,6)]} ${t}`}function s(e){const[t,o]=e.split("-");return`${parseFloat(o)/3}T ${t}`}return t})()));
|
|
2
|
-
//# sourceMappingURL=vlcisharedKPI.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vlcisharedKPI.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAuB,cAAID,IAE3BD,EAAoB,cAAIC,GACzB,CATD,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CCA1BA,EAAwB,CAACL,EAASM,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDF,EAAwB,CAACQ,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFT,EAAyBL,IACH,oBAAXkB,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeV,EAASkB,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeV,EAAS,aAAc,CAAEoB,OAAO,GAAO,G,KCAvD,SAASC,EAAgBD,GAE9B,IAAIE,EAAUC,UAAUC,UAAYD,UAAUE,aAC9CH,EACEA,EAAQI,QAAU,EAAI,GAAGJ,KAAWA,EAAQK,gBAAkBL,EAChE,MAAMM,EAAe,CACnBC,sBAAuB,EACvBC,sBAAuB,GAEzB,MAAmB,UAAZR,EACHF,EAAMW,eAAe,QAASH,GAC9BR,EAAMW,eAAeT,EAASM,EACpC,CCMO,SAASI,EAAoBC,GAClC,MAAM,UAAEC,EAAS,SAAEC,GAAaF,EAC1BG,EAA4B,GASlC,OARAF,EAAUG,SAASC,IACjB,MAAMC,EAAoB,CAAC,EAC3BD,EAAID,SAAQ,CAACG,EAAQC,KACnBF,EAAkBJ,EAASM,GAAQC,SAAWF,CAAM,IAGtDJ,EAA0BO,KAAKJ,EAAkB,IAE5CH,CACT,CA+BO,SAASQ,EAAwBX,EAAMY,GAC5CZ,EAAKI,SAASS,IACRA,EAAUC,MAAMF,GAClBpC,OAAOuC,QAAQH,EAAWC,EAAUC,KAAKV,SAASY,IAChD,MAAM1C,EAAM0C,EAAa,GACnB7B,EAAQ6B,EAAa,GACN,iBAAV7B,EACLA,EAAM8B,UACRC,SAASC,cAAchC,EAAM8B,WAAWA,UAAYJ,EAAUvC,GACrDa,EAAMiC,SAAWjC,EAAMkC,SAChCH,SAASC,cAAchC,EAAMiC,SAASE,YAAcV,EAClDC,EAAUC,IACVxC,GAAK+C,OAAOR,EAAUvC,KAG1B4C,SAASC,cAAchC,GAAOmC,YAAcT,EAAUvC,EACxD,GAEJ,GAEJ,C,yJCtFA,MAAMiD,EAAe,CACnB,KAAM,QACN,KAAM,UACN,KAAM,QACN,KAAM,QACN,KAAM,OACN,KAAM,QACN,KAAM,QACN,KAAM,SACN,KAAM,aACN,GAAI,UACJ,GAAI,YACJ,GAAI,aAQC,SAASC,EAASxB,GAevB,MAdkB,CAChB,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,GAAI,MACJ,GAAI,MACJ,GAAI,OAEWyB,SAASzB,EAAK0B,WAAY,IAC7C,CAOO,SAASC,EAAgB3B,GAC9B,MAAM4B,EAAO5B,EAAK6B,UAAU,EAAG,GAE/B,MAAO,GADKN,EAAavB,EAAK6B,UAAU,EAAG,OAC1BD,GACnB,CAOO,SAASE,EAAgBC,GAC9B,MAAOH,EAAMI,GAAOD,EAAKE,MAAM,KAC/B,MAAO,GAAGC,WAAWF,GAAO,MAAMJ,GACpC,C","sources":["webpack://@vlci/vlcishared/webpack/universalModuleDefinition","webpack://@vlci/vlcishared/webpack/bootstrap","webpack://@vlci/vlcishared/webpack/runtime/define property getters","webpack://@vlci/vlcishared/webpack/runtime/hasOwnProperty shorthand","webpack://@vlci/vlcishared/webpack/runtime/make namespace object","webpack://@vlci/vlcishared/./src/common/common-number.js","webpack://@vlci/vlcishared/./src/common/common-data.js","webpack://@vlci/vlcishared/./src/common/common-date.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"vlcisharedKPI\"] = factory();\n\telse\n\t\troot[\"vlcisharedKPI\"] = factory();\n})(self, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Introduce . cada 3 cifras del número pasado por parámetros: 1234->1.234\n * @param {integer} value Entero al que se le va a poner.\n * @returns String con el número transformado.\n */\nexport function addPointInteger(value) {\n // Obtiene el idioma del navegador\n let usrlang = navigator.language || navigator.userLanguage;\n usrlang =\n usrlang.length <= 2 ? `${usrlang}-${usrlang.toUpperCase()}` : usrlang;\n const factorDigits = {\n minimumFractionDigits: 0,\n maximumFractionDigits: 2,\n };\n return usrlang === 'es-ES'\n ? value.toLocaleString('de-DE', factorDigits)\n : value.toLocaleString(usrlang, factorDigits);\n}\n/**\n * Método que devuelve el máximo de una columna en concreto de un array.\n * @param {array} array Array que contiene la columna a tratar.\n * @param {integer} column Indice de la columna.\n * @param {float} add Si se quiere incrementar el máximo en X unidades.\n * @returns el valor máximo de array en la columna column\n */\nexport function getMaxValue(array, column, add = 1) {\n const max = Math.max(...array.map((row) => row[column])) * add;\n return Math.ceil(max / 5000) * 5000;\n}\n\n/**\n * Función que convierte un número a notación abreviada\n * @param {integer} value Entero que se va a formatear\n * @returns el valor abreviado a millones\n */\nexport function formatToMillions(value) {\n const million = 1000000;\n return value >= million ? `${value / million}M` : value.toString();\n}\n","/**\n * Separa el conjunto de datos \"data\" en función de la columna \"column\"\n * @param {array} data Conjunto de datos a separar y agrupar\n * @param {integer} column Columna por la que se va a agrupar\n * @returns Diccionario con el array \"data\" agrupado por \"column\"\n */\nexport function splitData(data, column) {\n return data.reduce((accumulator, currentValue) => {\n const key = currentValue[column];\n if (!accumulator[key]) {\n accumulator[key] = [];\n }\n accumulator[key].push(currentValue);\n return accumulator;\n }, {});\n}\n\n/**\n * Función que partiendo de los datos obtenidos de una query de Pentaho, devuelve el resultset\n * indicando el nombre de las columnas en cada valor\n * @param {Array} data Datos obtenidos de la query de Pentaho.\n * @returns {Array} Array que contiene un objeto por cada fila.\n */\nexport function resultsetWithFields(data) {\n const { resultset, metadata } = data;\n const resultsetWithFieldsResult = [];\n resultset.forEach((row) => {\n const columnsWithFields = {};\n row.forEach((column, indice) => {\n columnsWithFields[metadata[indice].colName] = column;\n });\n\n resultsetWithFieldsResult.push(columnsWithFields);\n });\n return resultsetWithFieldsResult;\n}\n\n/**\n * Pinta los datos obtenidos por una query de pentaho en el HTML aplicando una configuración.\n * @param {Object} data Objeto que devuelve pentaho tras realizar una query que contiene los datos que se van a pintar.\n * Requisitos:\n * 1- Tener una columna con el nombre id y coincida con el id del atributo del dataConfig.\n * 2- Cada fila del objeto debe tener un id distinto.\n * @param {Object} dataConfig Objeto que contiene la configuración de los datos que se van a pintar. Lo que no este declarado en este objeto, no se pintará.\n * Requisitos:\n * 1- El objeto contendra una lista de elementos que se corresponderan con el id de cada fila del objeto data.\n * 2- Dentro de cada elemento crearemos un nuevo atributo con el nombre de la columna que queremos pintar. Este atributo puede configurarse de dos formas distintas:\n * 2.1- Se puede asignar un valor directamente que correspondera con el selector del elemento html donde queremos pintarlo.\n * 2.2- Se puede crear un objeto que contendra dos elementos más:\n * 2.2.1- element contendra el selector del elemento html donde queremos pintarlo.\n * 2.2.2- format contendra una funcion con la que se podra formatear el valor antes de pintarlo.\n * 2.3 - Se puede crear un objeto que renombre el nombre de la clase por uno que venga de base de datos añadiendo un elemento className\n * Ejemplo:\n * const dataConfig = {\n NumeroQuejasSugerenciasMes: { <--- Id que debe coincidir con la columna id del data.\n value: '#indQuejasVal', <--- La columna value del data será pintada en el selector HTML indicado.\n variacion: {\n element: '#indQuejasVar', <--- La columna variacion del data será pintada en el selector HTML indicado.\n format: (value) => `${value}%`, <--- Además se le aplicará el formato indicado aqui antes de ser insertado.\n },\n tendencia: { <--- Id que debe coincidir con la columna que devuelve el valor por el que vamos a renombrar la clase\n className: '.prePrePrevioTrim', <--- El valor del elemento className será el de la clase indicada en el HTML.\n },\n RendimientoAdministrativo:{....}\n }\n */\nexport function printDataInHTMLElements(data, dataConfig) {\n data.forEach((indicador) => {\n if (indicador.id in dataConfig) {\n Object.entries(dataConfig[indicador.id]).forEach((elementArray) => {\n const key = elementArray[0];\n const value = elementArray[1];\n if (typeof value === 'object') {\n if (value.className) {\n document.querySelector(value.className).className = indicador[key];\n } else if (value.element && value.format) {\n document.querySelector(value.element).textContent = dataConfig[\n indicador.id\n ][key].format(indicador[key]);\n }\n } else {\n document.querySelector(value).textContent = indicador[key];\n }\n });\n }\n });\n}\n","const mesDescLarga = {\n '01': 'Enero',\n '02': 'Febrero',\n '03': 'Marzo',\n '04': 'Abril',\n '05': 'Mayo',\n '06': 'Junio',\n '07': 'Julio',\n '08': 'Agosto',\n '09': 'Septiembre',\n 10: 'Octubre',\n 11: 'Noviembre',\n 12: 'Diciembre',\n};\n\n/**\n * Dado un valor entero, devuelve el mes/meses asociados a el: 01->Gen\n * @param {object/integer} data Valor a convertir en cadena\n * @returns Cadena asociada al valor.\n */\nexport function getMonth(data) {\n const monthDict = {\n 1: 'Gen',\n 2: 'Feb',\n 3: 'Mar',\n 4: 'Abr',\n 5: 'Mai',\n 6: 'Jun',\n 7: 'Jul',\n 8: 'Ago',\n 9: 'Sep',\n 10: 'Oct',\n 11: 'Nov',\n 12: 'Des',\n };\n return monthDict[parseInt(data.toString(), 10)];\n}\n\n/**\n * Dado un valor entero yyyyMM, devuelve el valor del mes + año . Ejem: 202301 --> Enero 2023\n * @param {integer} data Valor a convertir en cadena\n * @returns Cadena asociada al valor.\n */\nexport function formatMonthAnyo(data) {\n const anyo = data.substring(0, 4);\n const mes = mesDescLarga[data.substring(4, 6)];\n return `${mes} ${anyo}`;\n}\n\n/**\n * Formateo de fecha de un trimestre\n * @param {*} date YYYY-MM\n * @returns trimestre formato MM'T' YYYY\n */\nexport function formatTrimestre(date) {\n const [anyo, mes] = date.split('-');\n return `${parseFloat(mes) / 3}T ${anyo}`;\n}\n"],"names":["root","factory","exports","module","define","amd","self","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","addPointInteger","usrlang","navigator","language","userLanguage","length","toUpperCase","factorDigits","minimumFractionDigits","maximumFractionDigits","toLocaleString","resultsetWithFields","data","resultset","metadata","resultsetWithFieldsResult","forEach","row","columnsWithFields","column","indice","colName","push","printDataInHTMLElements","dataConfig","indicador","id","entries","elementArray","className","document","querySelector","element","format","textContent","mesDescLarga","getMonth","parseInt","toString","formatMonthAnyo","anyo","substring","formatTrimestre","date","mes","split","parseFloat"],"sourceRoot":""}
|