var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var Unibase; (function (Unibase) { let Platform; (function (Platform) { let Analytics; (function (Analytics) { let Components; (function (Components) { class UserDesignSvgMenu extends Components._ReportViewer { constructor() { super(...arguments); this.svgappsHtml = ''; 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.svgappsHtml != '' && this.svgappsHtml != null) && !this.IsAppRefresh) { $('#userdesignmenu_apps').html(this.svgappsHtml); } else { instance.fileCacheHelper.loadJsFile('platform/apps/managers/appmanager.js', () => { Unibase.Platform.Apps.Managers.AppManager.Instance().getMyApps().then((res) => __awaiter(this, void 0, void 0, function* () { this.IsAppRefresh = false; let html = ''; 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 apps_data = ''; let iconurl = ''; var data = res.result[i]; let appname = data.AppTitle; icon = data.IconName; imgurl = data.SvgIconUrl; iconurl = data.ImageUrl; let installedappid = data.MyAppId; let count = i; if (($(window).width()) <= 575) { apps_data = `
  • ` + appname + `
  • `; html += apps_data; } } $("#userdesignmenu_apps").append(html); if (screen.width > 1367) { $(".appmenu_li").addClass("w-10"); } else if (screen.width > 1198) { $(".appmenu_li").addClass("w-12"); } if (screen.width < 1198) { $(".svg-icons").addClass("w-35p h-35p").removeClass("w-40p h-40p"); } $(".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; })); }); $('.userdesignmenu_apps svg').addClass("h-100"); this.svgappsHtml = $('#userdesignmenu_apps').html(); })); }); } } static Instance() { if (this._instance === undefined) this._instance = new UserDesignSvgMenu(); return this._instance; } } Components.UserDesignSvgMenu = UserDesignSvgMenu; })(Components = Analytics.Components || (Analytics.Components = {})); })(Analytics = Platform.Analytics || (Platform.Analytics = {})); })(Platform = Unibase.Platform || (Unibase.Platform = {})); })(Unibase || (Unibase = {}));