diff options
Diffstat (limited to 'plugins/CoreHome/vue')
4 files changed, 36 insertions, 32 deletions
diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.js b/plugins/CoreHome/vue/dist/CoreHome.umd.js index 6019b20262..0f7a209045 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.js @@ -5761,44 +5761,44 @@ PeriodDatePickervue_type_script_lang_ts.render = PeriodDatePickervue_type_templa directiveName: 'piwikPeriodDatePicker', restrict: 'E' })); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue?vue&type=template&id=72269392 +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue?vue&type=template&id=2c07efef -var SiteSelectorvue_type_template_id_72269392_hoisted_1 = ["value", "name"]; -var SiteSelectorvue_type_template_id_72269392_hoisted_2 = ["title"]; -var SiteSelectorvue_type_template_id_72269392_hoisted_3 = ["textContent"]; -var SiteSelectorvue_type_template_id_72269392_hoisted_4 = { +var SiteSelectorvue_type_template_id_2c07efef_hoisted_1 = ["value", "name"]; +var SiteSelectorvue_type_template_id_2c07efef_hoisted_2 = ["title"]; +var SiteSelectorvue_type_template_id_2c07efef_hoisted_3 = ["textContent"]; +var SiteSelectorvue_type_template_id_2c07efef_hoisted_4 = { key: 1, class: "placeholder" }; -var SiteSelectorvue_type_template_id_72269392_hoisted_5 = { +var SiteSelectorvue_type_template_id_2c07efef_hoisted_5 = { class: "dropdown" }; -var SiteSelectorvue_type_template_id_72269392_hoisted_6 = { +var SiteSelectorvue_type_template_id_2c07efef_hoisted_6 = { class: "custom_select_search" }; -var SiteSelectorvue_type_template_id_72269392_hoisted_7 = ["placeholder"]; -var SiteSelectorvue_type_template_id_72269392_hoisted_8 = { +var SiteSelectorvue_type_template_id_2c07efef_hoisted_7 = ["placeholder"]; +var SiteSelectorvue_type_template_id_2c07efef_hoisted_8 = { key: 0 }; -var SiteSelectorvue_type_template_id_72269392_hoisted_9 = { +var SiteSelectorvue_type_template_id_2c07efef_hoisted_9 = { class: "custom_select_container" }; -var SiteSelectorvue_type_template_id_72269392_hoisted_10 = ["onClick"]; -var SiteSelectorvue_type_template_id_72269392_hoisted_11 = ["innerHTML", "href", "title"]; -var SiteSelectorvue_type_template_id_72269392_hoisted_12 = { +var SiteSelectorvue_type_template_id_2c07efef_hoisted_10 = ["onClick"]; +var SiteSelectorvue_type_template_id_2c07efef_hoisted_11 = ["innerHTML", "href", "title"]; +var SiteSelectorvue_type_template_id_2c07efef_hoisted_12 = { class: "ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all\n siteSelect" }; -var SiteSelectorvue_type_template_id_72269392_hoisted_13 = { +var SiteSelectorvue_type_template_id_2c07efef_hoisted_13 = { class: "ui-menu-item" }; -var SiteSelectorvue_type_template_id_72269392_hoisted_14 = { +var SiteSelectorvue_type_template_id_2c07efef_hoisted_14 = { class: "ui-corner-all", tabindex: "-1" }; var _hoisted_15 = { key: 1 }; -function SiteSelectorvue_type_template_id_72269392_render(_ctx, _cache, $props, $setup, $data, $options) { +function SiteSelectorvue_type_template_id_2c07efef_render(_ctx, _cache, $props, $setup, $data, $options) { var _ctx$modelValue, _ctx$modelValue2, _ctx$modelValue3, _ctx$modelValue4; var _component_AllSitesLink = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("AllSitesLink"); @@ -5817,7 +5817,7 @@ function SiteSelectorvue_type_template_id_72269392_render(_ctx, _cache, $props, type: "hidden", value: (_ctx$modelValue = _ctx.modelValue) === null || _ctx$modelValue === void 0 ? void 0 : _ctx$modelValue.id, name: _ctx.name - }, null, 8, SiteSelectorvue_type_template_id_72269392_hoisted_1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + }, null, 8, SiteSelectorvue_type_template_id_2c07efef_hoisted_1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { ref: "selectorLink", onClick: _cache[0] || (_cache[0] = function () { return _ctx.onClickSelector && _ctx.onClickSelector.apply(_ctx, arguments); @@ -5839,7 +5839,7 @@ function SiteSelectorvue_type_template_id_72269392_render(_ctx, _cache, $props, }, null, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [(_ctx$modelValue2 = _ctx.modelValue) !== null && _ctx$modelValue2 !== void 0 && _ctx$modelValue2.name || !_ctx.placeholder ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", { key: 0, textContent: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(((_ctx$modelValue3 = _ctx.modelValue) === null || _ctx$modelValue3 === void 0 ? void 0 : _ctx$modelValue3.name) || _ctx.firstSiteName) - }, null, 8, SiteSelectorvue_type_template_id_72269392_hoisted_3)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !((_ctx$modelValue4 = _ctx.modelValue) !== null && _ctx$modelValue4 !== void 0 && _ctx$modelValue4.name) && _ctx.placeholder ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", SiteSelectorvue_type_template_id_72269392_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.placeholder), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 42, SiteSelectorvue_type_template_id_72269392_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_72269392_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_72269392_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + }, null, 8, SiteSelectorvue_type_template_id_2c07efef_hoisted_3)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !((_ctx$modelValue4 = _ctx.modelValue) !== null && _ctx$modelValue4 !== void 0 && _ctx$modelValue4.name) && _ctx.placeholder ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", SiteSelectorvue_type_template_id_2c07efef_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.placeholder), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 42, SiteSelectorvue_type_template_id_2c07efef_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_2c07efef_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_2c07efef_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { type: "text", onClick: _cache[2] || (_cache[2] = function ($event) { _ctx.searchTerm = ''; @@ -5852,7 +5852,7 @@ function SiteSelectorvue_type_template_id_72269392_render(_ctx, _cache, $props, tabindex: "4", class: "websiteSearch inp browser-default", placeholder: _ctx.translate('General_Search') - }, null, 8, SiteSelectorvue_type_template_id_72269392_hoisted_7), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelText"], _ctx.searchTerm], [_directive_focus_if, {}, _ctx.shouldFocusOnSearch]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { + }, null, 8, SiteSelectorvue_type_template_id_2c07efef_hoisted_7), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelText"], _ctx.searchTerm], [_directive_focus_if, {}, _ctx.shouldFocusOnSearch]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { title: "Clear", onClick: _cache[4] || (_cache[4] = function ($event) { _ctx.searchTerm = ''; @@ -5861,13 +5861,13 @@ function SiteSelectorvue_type_template_id_72269392_render(_ctx, _cache, $props, }), class: "reset", src: "plugins/CoreHome/images/reset_search.png" - }, null, 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.searchTerm]])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.autocompleteMinSites <= _ctx.sites.length || _ctx.searchTerm]]), _ctx.allSitesLocation === 'top' && _ctx.showAllSitesItem ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", SiteSelectorvue_type_template_id_72269392_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_AllSitesLink, { + }, null, 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.searchTerm]])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.autocompleteMinSites <= _ctx.sites.length || _ctx.searchTerm]]), _ctx.allSitesLocation === 'top' && _ctx.showAllSitesItem ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", SiteSelectorvue_type_template_id_2c07efef_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_AllSitesLink, { href: _ctx.urlAllSites, "all-sites-text": _ctx.allSitesText, onClick: _cache[5] || (_cache[5] = function ($event) { return _ctx.onAllSitesClick($event); }) - }, null, 8, ["href", "all-sites-text"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_72269392_hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", { + }, null, 8, ["href", "all-sites-text"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_2c07efef_hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", { class: "custom_select_ul_list", onClick: _cache[7] || (_cache[7] = function ($event) { return _ctx.showSitesList = false; @@ -5888,8 +5888,8 @@ function SiteSelectorvue_type_template_id_72269392_render(_ctx, _cache, $props, tabindex: "4", href: _ctx.getUrlForSiteId(site.idsite), title: site.name - }, null, 8, SiteSelectorvue_type_template_id_72269392_hoisted_11)], 8, SiteSelectorvue_type_template_id_72269392_hoisted_10)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !(!_ctx.showSelectedSite && _ctx.activeSiteId === site.idsite)]]); - }), 128))]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", SiteSelectorvue_type_template_id_72269392_hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", SiteSelectorvue_type_template_id_72269392_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", SiteSelectorvue_type_template_id_72269392_hoisted_14, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_NotFound') + ' ' + _ctx.searchTerm), 1)])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.sites.length && _ctx.searchTerm]])]), _ctx.allSitesLocation === 'bottom' && _ctx.showAllSitesItem ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_15, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_AllSitesLink, { + }, null, 8, SiteSelectorvue_type_template_id_2c07efef_hoisted_11)], 8, SiteSelectorvue_type_template_id_2c07efef_hoisted_10)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !(!_ctx.showSelectedSite && "".concat(_ctx.activeSiteId) === "".concat(site.idsite))]]); + }), 128))]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", SiteSelectorvue_type_template_id_2c07efef_hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", SiteSelectorvue_type_template_id_2c07efef_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", SiteSelectorvue_type_template_id_2c07efef_hoisted_14, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_NotFound') + ' ' + _ctx.searchTerm), 1)])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.sites.length && _ctx.searchTerm]])]), _ctx.allSitesLocation === 'bottom' && _ctx.showAllSitesItem ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_15, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_AllSitesLink, { href: _ctx.urlAllSites, "all-sites-text": _ctx.allSitesText, onClick: _cache[8] || (_cache[8] = function ($event) { @@ -5899,7 +5899,7 @@ function SiteSelectorvue_type_template_id_72269392_render(_ctx, _cache, $props, blur: _ctx.onBlur }]]); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue?vue&type=template&id=72269392 +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue?vue&type=template&id=2c07efef // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/SiteSelector/AllSitesLink.vue?vue&type=template&id=45607d28 @@ -6372,7 +6372,7 @@ function debounce(fn) { -SiteSelectorvue_type_script_lang_ts.render = SiteSelectorvue_type_template_id_72269392_render +SiteSelectorvue_type_script_lang_ts.render = SiteSelectorvue_type_template_id_2c07efef_render /* harmony default export */ var SiteSelector = (SiteSelectorvue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/SiteSelector.adapter.ts @@ -6468,15 +6468,17 @@ SiteSelectorvue_type_script_lang_ts.render = SiteSelectorvue_type_template_id_72 }); if (attrs.siteid && attrs.sitename) { - vm.modelValue = { + scope.value = { id: attrs.siteid, name: Matomo_Matomo.helper.htmlDecode(attrs.sitename) }; + vm.modelValue = scope.value; } else if (Matomo_Matomo.idSite) { - vm.modelValue = { + scope.value = { id: Matomo_Matomo.idSite, name: Matomo_Matomo.helper.htmlDecode(Matomo_Matomo.siteName) }; + vm.modelValue = scope.value; } // setup ng-model mapping diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js index 46595f74a7..40d28457eb 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js @@ -324,7 +324,7 @@ function On(e){return{restrict:"A",priority:10,link:function(t,n,r){var i={insta * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Bi(e,t,n,r,i,o){var l,c,s,u,d=Object(a["resolveComponent"])("AllSitesLink"),p=Object(a["resolveDirective"])("focus-if"),m=Object(a["resolveDirective"])("focus-anywhere-but-here");return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:Object(a["normalizeClass"])(["siteSelector piwikSelector borderedControl",{expanded:e.showSitesList,disabled:!e.hasMultipleSites}])},[e.name?(Object(a["openBlock"])(),Object(a["createElementBlock"])("input",{key:0,type:"hidden",value:null===(l=e.modelValue)||void 0===l?void 0:l.id,name:e.name},null,8,wi)):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("a",{ref:"selectorLink",onClick:t[0]||(t[0]=function(){return e.onClickSelector&&e.onClickSelector.apply(e,arguments)}),onKeydown:t[1]||(t[1]=function(t){return e.onPressEnter(t)}),href:"javascript:void(0)",class:Object(a["normalizeClass"])([{loading:e.isLoading},"title"]),tabindex:"4",title:e.selectorLinkTitle},[Object(a["createElementVNode"])("span",{class:Object(a["normalizeClass"])(["icon icon-arrow-bottom",{iconHidden:e.isLoading,collapsed:!e.showSitesList}])},null,2),Object(a["createElementVNode"])("span",null,[null!==(c=e.modelValue)&&void 0!==c&&c.name||!e.placeholder?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",{key:0,textContent:Object(a["toDisplayString"])((null===(s=e.modelValue)||void 0===s?void 0:s.name)||e.firstSiteName)},null,8,ji)):Object(a["createCommentVNode"])("",!0),null!==(u=e.modelValue)&&void 0!==u&&u.name||!e.placeholder?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",ki,Object(a["toDisplayString"])(e.placeholder),1))])],42,Oi),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",Si,[Object(a["withDirectives"])(Object(a["createElementVNode"])("div",Ci,[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"text",onClick:t[2]||(t[2]=function(t){e.searchTerm="",e.loadInitialSites()}),"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.searchTerm=t}),tabindex:"4",class:"websiteSearch inp browser-default",placeholder:e.translate("General_Search")},null,8,Ei),[[a["vModelText"],e.searchTerm],[p,{},e.shouldFocusOnSearch]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("img",{title:"Clear",onClick:t[4]||(t[4]=function(t){e.searchTerm="",e.loadInitialSites()}),class:"reset",src:"plugins/CoreHome/images/reset_search.png"},null,512),[[a["vShow"],e.searchTerm]])],512),[[a["vShow"],e.autocompleteMinSites<=e.sites.length||e.searchTerm]]),"top"===e.allSitesLocation&&e.showAllSitesItem?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Di,[Object(a["createVNode"])(d,{href:e.urlAllSites,"all-sites-text":e.allSitesText,onClick:t[5]||(t[5]=function(t){return e.onAllSitesClick(t)})},null,8,["href","all-sites-text"])])):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("div",Pi,[Object(a["createElementVNode"])("ul",{class:"custom_select_ul_list",onClick:t[7]||(t[7]=function(t){return e.showSitesList=!1})},[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.sites,(function(n,r){return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("li",{onClick:function(t){return e.switchSite(Object.assign(Object.assign({},n),{},{id:n.idsite}),t)},key:r},[Object(a["createElementVNode"])("a",{onClick:t[6]||(t[6]=function(e){return e.preventDefault()}),innerHTML:e.$sanitize(e.getMatchedSiteName(n.name)),tabindex:"4",href:e.getUrlForSiteId(n.idsite),title:n.name},null,8,Ni)],8,Vi)),[[a["vShow"],!(!e.showSelectedSite&&e.activeSiteId===n.idsite)]])})),128))]),Object(a["withDirectives"])(Object(a["createElementVNode"])("ul",Ti,[Object(a["createElementVNode"])("li",Ai,[Object(a["createElementVNode"])("a",Ii,Object(a["toDisplayString"])(e.translate("SitesManager_NotFound")+" "+e.searchTerm),1)])],512),[[a["vShow"],!e.sites.length&&e.searchTerm]])]),"bottom"===e.allSitesLocation&&e.showAllSitesItem?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",xi,[Object(a["createVNode"])(d,{href:e.urlAllSites,"all-sites-text":e.allSitesText,onClick:t[8]||(t[8]=function(t){return e.onAllSitesClick(t)})},null,8,["href","all-sites-text"])])):Object(a["createCommentVNode"])("",!0)],512),[[a["vShow"],e.showSitesList]])],2)),[[m,{blur:e.onBlur}]])}var Mi=["innerHTML","href"];function Li(e,t,n,r,i,o){var l=this;return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{onClick:t[1]||(t[1]=function(e){return l.onClick(e)}),class:"custom_select_all"},[Object(a["createElementVNode"])("a",{onClick:t[0]||(t[0]=function(e){return e.preventDefault()}),innerHTML:e.$sanitize(e.allSitesText),tabindex:"4",href:e.href},null,8,Mi)])}var Fi=Object(a["defineComponent"])({props:{href:String,allSitesText:String},emits:["click"],methods:{onClick:function(e){this.$emit("click",e)}}});Fi.render=Li;var Ri=Fi;function _i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Hi(e,t,n){return t&&$i(e.prototype,t),n&&$i(e,n),e}function Ui(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */function Bi(e,t,n,r,i,o){var l,c,s,u,d=Object(a["resolveComponent"])("AllSitesLink"),p=Object(a["resolveDirective"])("focus-if"),m=Object(a["resolveDirective"])("focus-anywhere-but-here");return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:Object(a["normalizeClass"])(["siteSelector piwikSelector borderedControl",{expanded:e.showSitesList,disabled:!e.hasMultipleSites}])},[e.name?(Object(a["openBlock"])(),Object(a["createElementBlock"])("input",{key:0,type:"hidden",value:null===(l=e.modelValue)||void 0===l?void 0:l.id,name:e.name},null,8,wi)):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("a",{ref:"selectorLink",onClick:t[0]||(t[0]=function(){return e.onClickSelector&&e.onClickSelector.apply(e,arguments)}),onKeydown:t[1]||(t[1]=function(t){return e.onPressEnter(t)}),href:"javascript:void(0)",class:Object(a["normalizeClass"])([{loading:e.isLoading},"title"]),tabindex:"4",title:e.selectorLinkTitle},[Object(a["createElementVNode"])("span",{class:Object(a["normalizeClass"])(["icon icon-arrow-bottom",{iconHidden:e.isLoading,collapsed:!e.showSitesList}])},null,2),Object(a["createElementVNode"])("span",null,[null!==(c=e.modelValue)&&void 0!==c&&c.name||!e.placeholder?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",{key:0,textContent:Object(a["toDisplayString"])((null===(s=e.modelValue)||void 0===s?void 0:s.name)||e.firstSiteName)},null,8,ji)):Object(a["createCommentVNode"])("",!0),null!==(u=e.modelValue)&&void 0!==u&&u.name||!e.placeholder?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",ki,Object(a["toDisplayString"])(e.placeholder),1))])],42,Oi),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",Si,[Object(a["withDirectives"])(Object(a["createElementVNode"])("div",Ci,[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"text",onClick:t[2]||(t[2]=function(t){e.searchTerm="",e.loadInitialSites()}),"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.searchTerm=t}),tabindex:"4",class:"websiteSearch inp browser-default",placeholder:e.translate("General_Search")},null,8,Ei),[[a["vModelText"],e.searchTerm],[p,{},e.shouldFocusOnSearch]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("img",{title:"Clear",onClick:t[4]||(t[4]=function(t){e.searchTerm="",e.loadInitialSites()}),class:"reset",src:"plugins/CoreHome/images/reset_search.png"},null,512),[[a["vShow"],e.searchTerm]])],512),[[a["vShow"],e.autocompleteMinSites<=e.sites.length||e.searchTerm]]),"top"===e.allSitesLocation&&e.showAllSitesItem?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Di,[Object(a["createVNode"])(d,{href:e.urlAllSites,"all-sites-text":e.allSitesText,onClick:t[5]||(t[5]=function(t){return e.onAllSitesClick(t)})},null,8,["href","all-sites-text"])])):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("div",Pi,[Object(a["createElementVNode"])("ul",{class:"custom_select_ul_list",onClick:t[7]||(t[7]=function(t){return e.showSitesList=!1})},[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.sites,(function(n,r){return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("li",{onClick:function(t){return e.switchSite(Object.assign(Object.assign({},n),{},{id:n.idsite}),t)},key:r},[Object(a["createElementVNode"])("a",{onClick:t[6]||(t[6]=function(e){return e.preventDefault()}),innerHTML:e.$sanitize(e.getMatchedSiteName(n.name)),tabindex:"4",href:e.getUrlForSiteId(n.idsite),title:n.name},null,8,Ni)],8,Vi)),[[a["vShow"],!(!e.showSelectedSite&&"".concat(e.activeSiteId)==="".concat(n.idsite))]])})),128))]),Object(a["withDirectives"])(Object(a["createElementVNode"])("ul",Ti,[Object(a["createElementVNode"])("li",Ai,[Object(a["createElementVNode"])("a",Ii,Object(a["toDisplayString"])(e.translate("SitesManager_NotFound")+" "+e.searchTerm),1)])],512),[[a["vShow"],!e.sites.length&&e.searchTerm]])]),"bottom"===e.allSitesLocation&&e.showAllSitesItem?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",xi,[Object(a["createVNode"])(d,{href:e.urlAllSites,"all-sites-text":e.allSitesText,onClick:t[8]||(t[8]=function(t){return e.onAllSitesClick(t)})},null,8,["href","all-sites-text"])])):Object(a["createCommentVNode"])("",!0)],512),[[a["vShow"],e.showSitesList]])],2)),[[m,{blur:e.onBlur}]])}var Mi=["innerHTML","href"];function Li(e,t,n,r,i,o){var l=this;return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{onClick:t[1]||(t[1]=function(e){return l.onClick(e)}),class:"custom_select_all"},[Object(a["createElementVNode"])("a",{onClick:t[0]||(t[0]=function(e){return e.preventDefault()}),innerHTML:e.$sanitize(e.allSitesText),tabindex:"4",href:e.href},null,8,Mi)])}var Fi=Object(a["defineComponent"])({props:{href:String,allSitesText:String},emits:["click"],methods:{onClick:function(e){this.$emit("click",e)}}});Fi.render=Li;var Ri=Fi;function _i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Hi(e,t,n){return t&&$i(e.prototype,t),n&&$i(e,n),e}function Ui(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * @@ -336,7 +336,7 @@ function On(e){return{restrict:"A",priority:10,link:function(t,n,r){var i={insta * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */kt({component:Yi,require:"?ngModel",scope:{showSelectedSite:{angularJsBind:"="},showAllSitesItem:{angularJsBind:"="},switchSiteOnSelect:{angularJsBind:"="},onlySitesWithAdminAccess:{angularJsBind:"="},name:{angularJsBind:"@"},allSitesText:{angularJsBind:"@"},allSitesLocation:{angularJsBind:"@"},placeholder:{angularJsBind:"@"},modelValue:{default:function(e,t,n){return n.siteid&&n.sitename?{id:n.siteid,name:S.helper.htmlDecode(n.sitename)}:S.idSite?{id:S.idSite,name:S.helper.htmlDecode(S.siteName)}:void 0}}},$inject:["$timeout"],directiveName:"piwikSiteselector",events:{"update:modelValue":function(e,t,n,r,i,a,o){(e&&!t.modelValue||!e&&t.modelValue||e.id!==t.modelValue.id)&&o((function(){n.value=e,r.attr("siteid",e.id),r.trigger("change",e),a&&(a.$setViewValue(e),a.$render())}))},blur:function(e,t,n){setTimeout((function(){return n.$apply()}))}},postCreate:function(e,t,n,r,i){var o=i;t.$watch("value",(function(t){Object(a["nextTick"])((function(){t!==e.modelValue&&(e.modelValue=t)}))})),r.siteid&&r.sitename?e.modelValue={id:r.siteid,name:S.helper.htmlDecode(r.sitename)}:S.idSite&&(e.modelValue={id:S.idSite,name:S.helper.htmlDecode(S.siteName)}),o&&(o.$setViewValue(e.modelValue),o.$render=function(){Object(a["nextTick"])((function(){Object(a["nextTick"])((function(){window.angular.isString(o.$viewValue)?e.modelValue=JSON.parse(o.$viewValue):e.modelValue=o.$viewValue}))}))})}}); + */kt({component:Yi,require:"?ngModel",scope:{showSelectedSite:{angularJsBind:"="},showAllSitesItem:{angularJsBind:"="},switchSiteOnSelect:{angularJsBind:"="},onlySitesWithAdminAccess:{angularJsBind:"="},name:{angularJsBind:"@"},allSitesText:{angularJsBind:"@"},allSitesLocation:{angularJsBind:"@"},placeholder:{angularJsBind:"@"},modelValue:{default:function(e,t,n){return n.siteid&&n.sitename?{id:n.siteid,name:S.helper.htmlDecode(n.sitename)}:S.idSite?{id:S.idSite,name:S.helper.htmlDecode(S.siteName)}:void 0}}},$inject:["$timeout"],directiveName:"piwikSiteselector",events:{"update:modelValue":function(e,t,n,r,i,a,o){(e&&!t.modelValue||!e&&t.modelValue||e.id!==t.modelValue.id)&&o((function(){n.value=e,r.attr("siteid",e.id),r.trigger("change",e),a&&(a.$setViewValue(e),a.$render())}))},blur:function(e,t,n){setTimeout((function(){return n.$apply()}))}},postCreate:function(e,t,n,r,i){var o=i;t.$watch("value",(function(t){Object(a["nextTick"])((function(){t!==e.modelValue&&(e.modelValue=t)}))})),r.siteid&&r.sitename?(t.value={id:r.siteid,name:S.helper.htmlDecode(r.sitename)},e.modelValue=t.value):S.idSite&&(t.value={id:S.idSite,name:S.helper.htmlDecode(S.siteName)},e.modelValue=t.value),o&&(o.$setViewValue(e.modelValue),o.$render=function(){Object(a["nextTick"])((function(){Object(a["nextTick"])((function(){window.angular.isString(o.$viewValue)?e.modelValue=JSON.parse(o.$viewValue):e.modelValue=o.$viewValue}))}))})}}); /*! * Matomo - free/libre analytics platform * diff --git a/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.adapter.ts b/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.adapter.ts index a29f6c4a1f..68edc0d5ff 100644 --- a/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.adapter.ts +++ b/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.adapter.ts @@ -98,12 +98,14 @@ export default createAngularJsAdapter<[ITimeoutService]>({ }); if (attrs.siteid && attrs.sitename) { - vm.modelValue = { id: attrs.siteid, name: Matomo.helper.htmlDecode(attrs.sitename) }; + scope.value = { id: attrs.siteid, name: Matomo.helper.htmlDecode(attrs.sitename) }; + vm.modelValue = scope.value; } else if (Matomo.idSite) { - vm.modelValue = { + scope.value = { id: Matomo.idSite, name: Matomo.helper.htmlDecode(Matomo.siteName), }; + vm.modelValue = scope.value; } // setup ng-model mapping diff --git a/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue b/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue index ab537111ab..a255203521 100644 --- a/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue +++ b/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue @@ -80,7 +80,7 @@ > <li @click="switchSite({ ...site, id: site.idsite }, $event)" - v-show="!(!showSelectedSite && activeSiteId === site.idsite)" + v-show="!(!showSelectedSite && `${activeSiteId}` === `${site.idsite}`)" v-for="(site, index) in sites" :key="index" > |