var Unibase; (function (Unibase) { let Platform; (function (Platform) { let Analytics; (function (Analytics) { let Components; (function (Components) { class UserDesignMenu extends Components._ReportViewer { constructor() { super(...arguments); this.appsHtml = ''; this.IsAppRefresh = false; } jsFiles() { return this._jsFiles(); } cssFiles() { return this._cssFiles(); } html(id, containerid) { var instance = this; let html = ``; return html; } load(id, containerid, callback) { var instance = this; } init(containerid) { var instance = this; instance.loadMenu(containerid); $('.BindData_' + containerid).find("#ListSearch").on('keyup', function () { $(".clear_icon").removeClass("d-none"); var _value = $(this).val().toString(), value = _value.toUpperCase(); if (_value == '') { $(".clear_icon").addClass("d-none"); } $('#userdesignmenu_apps').find('.appmenu_li').each(function () { let appName = $(this).find('.appname').text(); if (appName.toUpperCase().indexOf(value) > -1) { $(this).css('display', 'block'); } else { $(this).css('display', 'none'); } }); }); $('.clear_icon').click(function () { $("#ListSearch").val(''); $('#userdesignmenu_apps').find('.appmenu_li').removeAttr("style"); $(".clear_icon").addClass("d-none"); }); } loadMenu(containerid) { var instance = this; $(`.${containerid}`).append(``); let height = $(`.${containerid}`).siblings('#hf_portletwidgetheight').val(); if (height != '0px') { $('.userDesignWidgetCardBody').css({ "height": `` + height + ``, "overflow-x": "hidden" }).addClass("biz-custom-scrollbar"); } if ((this.appsHtml != '' && this.appsHtml != null) && !this.IsAppRefresh) { $('#userdesignmenu_apps').html(this.appsHtml); } else { Unibase.Platform.Apps.Managers.AppManager.Instance().getMyApps().then((res) => { this.IsAppRefresh = false; let totalcount = res.result.length; for (var i = 0; i < res.result.length; i++) { if (res.result[i].ParentAppId == 0) { let icon = ''; let imgurl = ''; let html = ''; var data = res.result[i]; let appname = data.AppTitle; icon = data.IconName; imgurl = data.ImageUrl; let installedappid = data.MyAppId; let count = i; if (($(window).width()) <= 575) { $('.appname.Mobile-menu').html(function (i, v) { return v.replace(' ', '
'); }); html = `
  • ` + appname + `
  • `; } else { html = `
  • ` + appname + `
  • `; } $("#userdesignmenu_apps").append(html); if (imgurl.length > 1) { let assesturl = _appsettings.asset_url(); imgurl = assesturl + imgurl; let imgtag = ''; $(".menu-icon-card_" + count).html(imgtag); } else { $(".menu-icon-card_" + count).html(``); } } } $(".userdesignmenu_apps").each(function () { let element = $(this).children("li"); $(this).html(element.sort(function (a, b) { return $(a).attr('data-name') < $(b).attr('data-name') ? -1 : 1; })); }); this.appsHtml = $('#userdesignmenu_apps').html(); }); } } static Instance() { if (this._instance === undefined) this._instance = new UserDesignMenu(); return this._instance; } } Components.UserDesignMenu = UserDesignMenu; })(Components = Analytics.Components || (Analytics.Components = {})); })(Analytics = Platform.Analytics || (Platform.Analytics = {})); })(Platform = Unibase.Platform || (Unibase.Platform = {})); })(Unibase || (Unibase = {}));