site-accueil-insa/matomo/plugins/Dashboard/vue/dist/Dashboard.umd.min.js

27 lines
No EOL
7.1 KiB
JavaScript

(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue")):"function"===typeof define&&define.amd?define(["CoreHome"],t):"object"===typeof exports?exports["Dashboard"]=t(require("CoreHome"),require("vue")):e["Dashboard"]=t(e["CoreHome"],e["Vue"])})("undefined"!==typeof self?self:this,(function(e,t){return function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="plugins/Dashboard/vue/dist/",r(r.s="fae3")}({"19dc":function(t,r){t.exports=e},"8bbf":function(e,r){e.exports=t},fae3:function(e,t,r){"use strict";if(r.r(t),r.d(t,"DashboardStore",(function(){return f})),r.d(t,"Dashboard",(function(){return S})),"undefined"!==typeof window){var o=window.document.currentScript,n=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);n&&(r.p=n[1])}var a=r("8bbf"),i=r("19dc");function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e,t,r){return t&&d(e.prototype,t),r&&d(e,r),e}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/var c=function(){function e(){var t=this;u(this,e),l(this,"privateState",Object(a["reactive"])({dashboards:[]})),l(this,"state",Object(a["computed"])((function(){return Object(a["readonly"])(t.privateState)}))),l(this,"dashboards",Object(a["computed"])((function(){return t.state.value.dashboards}))),l(this,"dashboardsPromise",null)}return s(e,[{key:"getDashboard",value:function(e){return this.getAllDashboards().then((function(t){return t.find((function(t){return parseInt("".concat(t.id),10)===parseInt("".concat(e),10)}))}))}},{key:"getDashboardLayout",value:function(e){return i["AjaxHelper"].fetch({module:"Dashboard",action:"getDashboardLayout",idDashboard:e},{withTokenInUrl:!0})}},{key:"reloadAllDashboards",value:function(){return this.dashboardsPromise=null,this.getAllDashboards()}},{key:"getAllDashboards",value:function(){var e=this;return this.dashboardsPromise||(this.dashboardsPromise=i["AjaxHelper"].fetch({method:"Dashboard.getDashboards",filter_limit:"-1"}).then((function(t){return t&&(e.privateState.dashboards=t),e.dashboards.value}))),this.dashboardsPromise}}]),e}(),f=new c;function h(e,t){return v(e)||y(e,t)||p(e,t)||b()}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(e,t){if(e){if("string"===typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function y(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o,n,a=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(o=r.next()).done);i=!0)if(a.push(o.value),t&&a.length===t)break}catch(d){u=!0,n=d}finally{try{i||null==r["return"]||r["return"]()}finally{if(u)throw n}}return a}}function v(e){if(Array.isArray(e))return e}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
window.angular.module("piwikApp.service").factory("dashboardsModel",(function(){return f}));var g=window,w=g.$;function D(e,t,r){var o=w(".dashboardSettings");o.show(),window.initTopControls(),w("#topBars").length||(o.after(w("#Dashboard")),w("#Dashboard ul li").removeClass("active"),w("#Dashboard_embeddedIndex_".concat(e)).addClass("active")),window.widgetsHelper.getAvailableWidgets(),w("#dashboardWidgetsArea").off("dashboardempty",window.showEmptyDashboardNotification).on("dashboardempty",window.showEmptyDashboardNotification).dashboard({idDashboard:e,layout:r,name:t?t.name:""});var n=w("#columnPreview").find(">div");n.each((function(){var e=[];w("div",this).each((function(){e.push(this.className.replace(/width-/,""))})),w(this).attr("layout",e.join("-"))})),n.off("click.renderDashboard"),n.on("click.renderDashboard",(function(){n.removeClass("choosen"),w(this).addClass("choosen")}))}function j(e){return window.globalAjaxQueue.abort(),new Promise((function(e){return setTimeout(e)})).then((function(){return Promise.resolve(window.widgetsHelper.firstGetAvailableWidgetsCall)})).then((function(){var t=w("#dashboardWidgetsArea");return t.dashboard("destroyWidgets"),t.empty(),Promise.all([f.getDashboard(e),f.getDashboardLayout(e)])})).then((function(t){var r=h(t,2),o=r[0],n=r[1];return new Promise((function(t){w((function(){D(e,o,n),t()}))}))}))}function A(){w(".top_controls .dashboard-manager").hide(),w("#dashboardWidgetsArea").dashboard("destroy")}function P(e){"Widgetize"!==e.module&&"Dashboard_Dashboard"!==e.category&&A()}function x(e){"Dashboard_Dashboard"===e.category&&w.isNumeric(e.subcategory)&&(e.promise=j(parseInt(e.subcategory,10)))}function O(e){j(e)}var S={mounted:function(e,t){j(t.value.idDashboard),Object(a["watch"])((function(){return i["MatomoUrl"].parsed.value}),(function(e){P(e)})),i["Matomo"].on("ReportingPage.loadPage",x),i["Matomo"].on("Dashboard.loadDashboard",O)},unmounted:function(){P(i["MatomoUrl"].parsed.value),i["Matomo"].off("ReportingPage.loadPage",x),i["Matomo"].off("Dashboard.loadDashboard",O)}};
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/function k(){return{restrict:"A",scope:{dashboardid:"=",layout:"="},link:function(e,t){var r={instance:null,value:{idDashboard:e.dashboardid,layout:e.layout},oldValue:null,modifiers:{},dir:{}};S.mounted(t[0],r),e.$on("$destroy",(function(){S.unmounted()}))}}}window.angular.module("piwikApp").directive("piwikDashboard",k)}})}));
//# sourceMappingURL=Dashboard.umd.min.js.map