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 Themes;
(function (Themes) {
let Compact;
(function (Compact) {
let Components;
(function (Components) {
class Index extends Unibase.Platform.Core.BaseComponent {
constructor() {
super(...arguments);
this.layoutIndex = 0;
this.modes = {};
this.currentTheme = {};
this.detailsViewIndex = 1;
this.Logo = '';
this.desktopMode = $(document).outerWidth() >= 1200;
this.tabMode = $(document).outerWidth() >= 768;
this.mobileLMode = $(document).outerWidth() >= 576;
this.widgetHeightPx = "300px";
this.widgetHeightNum = 300;
this.leftLayout = 1;
this.topLayout = 2;
this.topLeftLayout = 3;
this.themePalette = [];
this.currentUser = Unibase.Platform.Membership.Infos.Identity.currentUser;
this.isTouchScreen = ('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0);
this.isIframe = false;
this.isIframeObj = { "isDetailsPage": false, "isNotifiPage": false, "isListPage": false, "isForm": false, "isPopupPage": false, "isDetailsForm": false, "isListDetailPage": true };
}
init(callback) {
const instance = this;
var _fileCacheHelper = Unibase.Platform.Helpers.FileCacheHelper.Instance();
Unibase.Platform.Helpers.NavigationHelper.SetInstance(new Compact.NavigationHelper());
instance.indexAddCachedFiles();
_fileCacheHelper.loadJsFile("platform/bundle/index.reportviewer.js", function () {
_fileCacheHelper.loadJsFiles(["platform/analytics/components/reportbuilder/dynamicfilter.js", "platform/analytics/managers/reportmanager.js", "libs/chartjs/chart.min.js"], function () {
_fileCacheHelper.loadCssFiles(["platform/bundle/index.compact.min.css"], null);
instance.indexAddCachedSubFiles();
instance.render();
Unibase.Platform.Automation.Components.Notifier.Instance().init();
if (Unibase.Themes.Compact.Components.Index.Instance().currentUser.tenant != null) {
if (Unibase.Themes.Compact.Components.Index.Instance().currentUser.tenant.isChatAppEnabled) {
Unibase.Platform.Connect.Components.Chatter.Instance().init();
}
}
window.history.pushState(null, "", window.location.href);
window.addEventListener("popstate", function (ev) {
console.log('popstated');
window.history.pushState(null, "", window.location.href);
Unibase.Themes.Compact.Components.Nav.Instance().exitMobileApp();
});
var app = new Compact.DefaultApp();
app.init();
if (callback != null) {
callback();
}
$(".nav-item-branch").click(function () {
_fileCacheHelper.loadJsFile('tenants/themes/compact/components/settings/settings.js', function () {
Components.DefaultSettingPanel.Instance().init("#settings-panel-container");
$(".biz-settings-panel").addClass("hidden").removeClass("biz-settings-panel");
$("#biz-settings-panel").addClass("biz-settings-panel").removeClass("hidden");
$(".biz-wrapper").addClass('biz-settings-toggle');
$("#biz-settings-panel").find(".settings-panel-wrap").removeClass("hidden");
$(".chat-panel-wrap").addClass("hidden");
$(document).on('click', '#settings_panel_close', function (e) {
$(".biz-wrapper").removeClass('biz-settings-toggle');
$("#biz-settings-panel").find(".settings-panel-wrap").addClass("hidden");
$(".chat-panel-wrap").addClass("hidden");
$(".biz-settings-panel").addClass("hidden").removeClass("biz-settings-panel");
return false;
});
});
return false;
});
});
});
}
detailsInit(callback) {
const instance = this;
let settings = Unibase.Platform.Membership.Infos.Identity.getCurrentUser().settings;
if (settings != null && settings != undefined) {
instance.currentTheme = settings.find(x => x.settingName == "themeobj").settingValue;
instance.isAppStructureEnable = settings.find(x => x.settingName == "themeobj").settingValue.isstructenable;
}
var _fileCacheHelper = Unibase.Platform.Helpers.FileCacheHelper.Instance();
Unibase.Platform.Helpers.NavigationHelper.SetInstance(new Compact.NavigationHelper());
instance.indexAddCachedFiles();
_fileCacheHelper.loadJsFile("platform/bundle/index.reportviewer.js", function () {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(["platform/analytics/components/reportbuilder/dynamicfilter.js", "platform/analytics/managers/reportmanager.js", "platform/bundle/dashboard.min.js", "libs/chartjs/chart.min.js"], function () {
_fileCacheHelper.loadCssFiles(["platform/bundle/index.compact.min.css"], null);
instance.indexAddCachedSubFiles();
instance.isPageType = 'details-page';
Unibase.Platform.Automation.Components.Notifier.Instance().init();
if (Unibase.Themes.Compact.Components.Index.Instance().currentUser.tenant != null) {
if (Unibase.Themes.Compact.Components.Index.Instance().currentUser.tenant.isChatAppEnabled) {
Unibase.Platform.Connect.Components.Chatter.Instance().init();
}
}
instance.appendHtml(instance.currentTheme, "details-page");
$('#bizgaze_body').html('
');
if (callback) {
callback();
}
});
});
}
documentinit(callback) {
this.indexAddCachedFiles();
var _fileCacheHelper = Unibase.Platform.Helpers.FileCacheHelper.Instance();
Unibase.Platform.Helpers.NavigationHelper.SetInstance(new Compact.NavigationHelper());
_fileCacheHelper.loadCssFile("tenants/themes/compact/css/style.ext.css", null);
this.documentRender(true);
var app = new Compact.DefaultApp();
app.init();
if (callback != null)
callback();
}
documentRender(isdocument) {
let instance = this;
var settings = Unibase.Platform.Membership.Infos.Identity.getCurrentUser().settings;
var themeobj = "";
instance.currentTheme.layoutName = 'Document Nav';
instance.currentTheme.layoutHtmlPath = "themes/layouts/documentnav.js";
instance.layoutIndex = instance.leftLayout;
instance.detailsViewIndex = 1;
instance.fileCacheHelper.loadJsFiles([instance.currentTheme.layoutHtmlPath], function () {
if (instance.layoutIndex != null && instance.layoutIndex != undefined) {
instance.appendDocumentHtml(instance.currentTheme, isdocument);
}
});
}
render() {
let instance = this;
var settings = Unibase.Platform.Membership.Infos.Identity.getCurrentUser().settings;
var themeobj = "";
if (settings != null && settings != undefined) {
var themeSettings = settings.find(x => x.settingName == "themeobj");
if (themeSettings != undefined && themeSettings != null) {
themeobj = themeSettings.settingValue;
if (themeobj != null && themeobj != "" && themeobj != undefined) {
if (themeobj.themeId == 0 || themeobj.themeId == undefined || themeobj.themeId == "" || themeobj.themeId == null) {
this.setDefaultNavigation();
}
else {
instance.currentTheme = themeobj;
if (instance.currentTheme.layoutName == null || instance.currentTheme.layoutName == undefined || instance.currentTheme.layoutName == "") {
{
instance.currentTheme.layoutName = "Top and Left Navigation";
}
}
instance.layoutIndex = instance.currentTheme.layoutIndex;
instance.currentTheme.primaryTransparentColor = instance.currentTheme.primaryColor;
instance.detailsViewIndex = instance.currentTheme.detailsViewIndex;
instance.isAppStructureEnable = false;
if (instance.currentTheme.isstructenable != undefined) {
instance.isAppStructureEnable = instance.currentTheme.isstructenable;
}
else {
instance.isAppStructureEnable = false;
}
if (themeobj.isstructenable != undefined) {
instance.isAppStructureEnable = themeobj.isstructenable;
}
if (instance.currentTheme.thumbnail != "" && instance.currentTheme.thumbnail != undefined) {
if (instance.desktopMode) {
instance.currentTheme.primaryColor = "transparent";
}
else if (!instance.desktopMode) {
instance.currentTheme.transparentPrimaryColor = "transparent";
}
instance.currentTheme.secondaryColor = "#ffffff52";
}
if (instance.currentTheme.paletteId) {
instance.getThemePaletteColors(instance.currentTheme.paletteId);
}
}
}
else {
this.setDefaultNavigation();
}
}
else {
this.setDefaultNavigation();
}
}
else {
this.setDefaultNavigation();
}
instance.currentTheme.layoutHtmlPath = "themes/layouts/" + instance.currentTheme.layoutName.toLowerCase().replace(/ /g, "") + ".js";
if (Unibase.Platform.Membership.Infos.Identity.currentUser.settings) {
let companyLogo = Unibase.Platform.Membership.Infos.Identity.currentUser.settings.find(x => x.settingName == "imageurl");
if (companyLogo != undefined) {
instance.Logo = companyLogo.settingValue == null ? "/_files/companylogo.png" : companyLogo.settingValue;
}
}
instance.fileCacheHelper.loadJsFiles([instance.currentTheme.layoutHtmlPath], function () {
if (instance.layoutIndex != null && instance.layoutIndex != undefined) {
if (instance.layoutIndex == instance.leftLayout) {
instance.fileCacheHelper.loadCssFiles(['tenants/themes/compact/css/style.left_layout.css'], function () {
instance.appendHtml(instance.currentTheme);
instance.loadLayout1Js();
});
}
else if (instance.layoutIndex == instance.topLayout) {
instance.fileCacheHelper.loadCssFiles(['tenants/themes/compact/css/style.top_layout.css'], function () {
instance.appendHtml(instance.currentTheme);
instance.loadLayout2Js();
});
}
else if (instance.layoutIndex == instance.topLeftLayout) {
instance.fileCacheHelper.loadCssFiles(['tenants/themes/compact/css/style.biz-layout-3.css'], function () {
instance.appendHtml(instance.currentTheme);
instance.loadLayout3Js();
});
}
instance.closeMobileNav();
}
else {
instance.render2();
}
});
}
loadLayout1Js() {
$(document).on('click', '#navbar_toggle_btn', function (e) {
$('.biz-wrapper').toggleClass('biz__nav__toggle');
$(window).trigger("resize");
$('.biz-nav-fullwidth').removeClass('hidden');
$('.hk-settings-panel').removeClass('show');
return false;
});
}
loadLayout2Js() {
const instance = this;
$(document).on('click', '#navbar_toggle_btn', function (e) {
$('.hk-wrapper').toggleClass('biz__nav__toggle');
$('.hk-nav-backdrop').removeClass('hk-nav-backdrop');
$(window).trigger("resize");
if (!instance.desktopMode)
$('.biz-nav-fullwidth').removeClass('hidden');
return false;
});
$(document).on('click', '#hk_nav_backdrop,#biz_nav_close', function (e) {
$('.hk-wrapper').removeClass('biz__nav__toggle');
return false;
});
if (!instance.desktopMode) {
$('#layoutMainNavWrap').addClass('simple-scroll-bar').attr('data-simplebar', '');
}
else {
$('#layoutMainNavWrap').find('.nav-group-collapse-link').removeAttr('data-target');
}
}
loadLayout3Js() {
const instance = this;
$(document).on('click', '#navbar_toggle_btn', function (e) {
$('.hk-wrapper').toggleClass('biz__nav__toggle');
let isNavIconsHidden = true, toggleClass = 'hk-nav-toggle';
$('.hk-nav').find('.nav-link-icon').each(function (i, e) {
if ($(e).is(':visible')) {
isNavIconsHidden = false;
return false;
}
});
if (isNavIconsHidden) {
toggleClass = 'hk-nav-toggle hk-nav-icons-hidden';
}
$('.biz-layout-3-top-navbar,.biz-layout-3-biz-pg-wrapper').removeClass('hk-nav-icons-hidden').toggleClass(toggleClass);
$('.hk-nav').toggleClass('biz__nav__toggle');
$('.hk-nav-backdrop').removeClass('hk-nav-backdrop');
if (instance.desktopMode) {
if ($('#navbar_toggle_btn').attr('data-nav-visible') === 'true') {
$('.biz-layout-3-top-navbar,.biz-layout-3-left-nav,.biz-layout-3-biz-pg-wrapper').removeClass('biz__nav__toggle hk-nav-toggle');
$('#navbar_toggle_btn').removeAttr('data-nav-visible');
}
if (!$('.biz-layout-3-left-nav').hasClass('biz__nav__toggle')) {
$('._bizgaze_popup_container').each(function (i, e) {
const panel = $(e).attr('id');
const navigationInstance = new Unibase.Themes.Compact.NavigationHelper();
if (navigationInstance.isReportPopup(panel)) {
$(e).addClass('active-left-nav');
}
});
}
else {
$('.active-left-nav').removeClass('active-left-nav');
}
}
$(window).trigger("resize");
if (!instance.desktopMode)
$('.biz-nav-fullwidth').removeClass('hidden');
return false;
});
$(document).on('click', '#biz_nav_close', function (e) {
$('.hk-wrapper').removeClass('biz__nav__toggle');
return false;
});
}
closeMobileNav() {
const instance = this;
let closeElement = '#biz_nav_close';
if (!this.desktopMode)
closeElement = '#biz_nav_close,.biz-nav-fullwidth,#hk_nav_close';
$(document).on('click', closeElement, function () {
$('.biz-nav-fullwidth').addClass('hidden');
$('.biz-bottom-nav-menu').find(".dropdown-menu-right").removeClass('show');
$('.hk-settings-panel').removeClass('show');
if (instance.layoutIndex == instance.leftLayout) {
$('.biz-wrapper').removeClass('biz__nav__toggle');
}
else if (instance.layoutIndex == instance.topLeftLayout) {
$('.hk-wrapper').removeClass('hk-nav-toggle');
}
else if (instance.layoutIndex == instance.topLayout) {
$('.hk-wrapper').removeClass('biz__nav__toggle');
}
});
}
setLeftNavigation() {
this.detailsViewIndex = 1;
this.layoutIndex = this.leftLayout;
this.currentTheme.layoutName = "Left Navigation";
}
setDefaultNavigation() {
this.detailsViewIndex = 1;
this.layoutIndex = this.topLeftLayout;
this.currentTheme.layoutName = "Top and Left Navigation";
}
render2() {
let instance = this;
instance.layoutIndex = instance.leftLayout;
let _fileCacheHelper = Unibase.Platform.Helpers.FileCacheHelper.Instance();
_fileCacheHelper.loadJsFiles(['platform/membership/infos/identity.js', 'platform/layout/managers/themelayoutmanager.js'], function () {
jQuery("#bizgaze_body").html(eval(instance.currentTheme.layoutHtmlPath));
instance.loadLayout1Js();
instance.loadCommonJs(false);
});
}
appendHtml(result, pageType) {
let instance = this;
if (result.themeId == undefined) {
result.backgroundImageId = 0;
result.detailsViewIndex = 1;
result.highlightColor = "rgba(0, 176, 255, 1)";
result.primaryColor = "#2A2E33";
result.primaryTextColor = "rgba(242.089, 230.939, 230.939, 1)";
result.primaryTransparentColor = "#2A2E33";
result.secondaryColor = "#E8FCFD";
result.secondaryTextColor = "rgba(15.307, 15.307, 15.307, 1)";
result.thumbnail = "";
result.transparentPrimaryColor = "rgba(42, 46, 51, 1)";
if (!result.layoutHtmlPath) {
result.layoutHtmlPath = "themes/layouts/topandleftnavigation.js";
result.layoutIndex = instance.topLeftLayout;
result.layoutName = "Top and Left Navigation";
}
}
let html;
if (pageType != 'details-page') {
let layoutHtml = "Themes_Layouts." + result.layoutName.toLowerCase().replace(/ /g, "") + "()";
let template = eval(layoutHtml);
let templateScript = Handlebars.compile(template);
let context = {
"Logo": this.Logo,
};
html = templateScript(context);
}
else {
$('body').css("background-color", "unset");
}
const highlightColor_25 = instance.convertToRgba(result.highlightColor, 0.25);
const highlightColor_20 = instance.convertToRgba(result.highlightColor, 0.20);
const highlightColor_10 = instance.convertToRgba(result.highlightColor, 0.10);
const highlightColor_5 = instance.convertToRgba(result.highlightColor, 0.05);
const secondaryColor_40 = instance.convertToRgba(result.secondaryTextColor, 0.40);
let colorClasses = ``;
$("style#themeColorClasses").remove();
$('body').prepend(colorClasses);
if (pageType != 'details-page' || pageType != undefined || pageType != '' || pageType != null) {
jQuery("#bizgaze_body").html(html);
}
jQuery("#bizgaze_body").css("background-color", "");
if (instance.currentTheme.thumbnail != '' && instance.currentTheme.thumbnail != null) {
if (instance.currentTheme.thumbnail.includes('tenants\\default\\layoutbuilder\\backgroundimages')) {
let imgUrl = `'${instance.currentTheme.thumbnail.replace(/\\/g, "/")}'`;
$('body').css('background-image', 'url(' + imgUrl + ')').addClass('background-image');
}
else {
this.getImageUrl(instance.currentTheme.thumbnail).then(function (imgUrl) {
$('body').css('background-image', 'url(' + imgUrl + ')').addClass('background-image');
});
}
}
else {
$('body').css('background-image', '').removeClass('background-image');
}
if (pageType != 'details-page') {
instance.loadCommonJs(false);
}
}
appendDocumentHtml(result, isdocument) {
let instance = this;
instance.fileCacheHelper.loadJsFile('libs/handlebars/handlebars.min.js', function () {
let layoutHtml = "Themes_Layouts." + result.layoutName.toLowerCase().replace(/ /g, "") + "()";
let template = eval(layoutHtml);
let templateScript = Handlebars.compile(template);
let context = {
"Logo": ""
};
let html = templateScript(context);
jQuery("#bizgaze_body").html(html);
$("style#themeColorClasses").remove();
jQuery("#bizgaze_body").css("background-color", "");
instance.loadCommonJs(true);
});
}
loadCommonJs(isdocument) {
let instance = this;
var identity = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
$("#loginname").text(identity.name + $("#loginname").text());
const _fileCacheHelper = Unibase.Platform.Helpers.FileCacheHelper.Instance();
if (isdocument != true) {
Unibase.Platform.Helpers.NavigationHelper.Instance().loadSection(0, "", Unibase.Themes.Compact.Components.Dashboard.Instance(), null, function () {
Unibase.Themes.Compact.Components.Nav.Instance().load(0, "layout-nav", null);
});
$(".preloader-it").delay(1000).fadeOut("slow");
$(".layout-container").delay(500).fadeIn("slow");
let skelHtml = '';
skelHtml += Unibase.Themes.Compact.Components.Nav_Template.Instance().skelTonDashboardHeader();
skelHtml += Unibase.Themes.Compact.Components.Nav_Template.Instance().skelTonDashboardStructure();
skelHtml += '
';
$("#layout-detail").before(skelHtml);
$(".biz__submenu").removeClass("hidden");
}
$(document).on("click", '.liappgrp-item .nav-link,.li-dashboard-item .nav-link,.lireportgrp-item .nav-link', function (e) {
var _a;
if (!instance.desktopMode) {
if (instance.layoutIndex == instance.leftLayout) {
$('.biz-wrapper').removeClass('biz__nav__toggle');
$('.biz-bottom-nav-menu').find(".dropdown-menu-right").removeClass('show');
}
else if (instance.layoutIndex == instance.topLayout || instance.layoutIndex == instance.topLeftLayout) {
$('.hk-wrapper').removeClass('biz__nav__toggle hk-nav-toggle');
}
$('.biz-nav-fullwidth').addClass('hidden');
if ($(this).closest('.li-dashboard-item').length) {
$('._bizgaze_popup_container').remove();
}
}
else {
if ($(this).closest('.li-dashboard-item').length && ((_a = instance.currentUser) === null || _a === void 0 ? void 0 : _a.isAdmin)) {
$('.db-setting-dp-item').removeClass('d-none');
}
else {
$('.db-setting-dp-item').addClass('d-none');
if ($('#bizCmnFilterPanel').hasClass('show'))
$('#cmnFilterPanelClose').trigger('click');
}
}
});
$("#btn_bizgaze_designmode").click(function () {
_fileCacheHelper.loadJsFile("tenants/themes/compact/js/designmode/designmode.js", function () {
if ($("#navlkn_AddWidget").find(".zmdi").hasClass("zmdi-caret-up")) {
$("#navlkn_AddWidget").find(".zmdi").removeClass("zmdi-caret-up").addClass("zmdi-caret-down");
}
let IsAdmin = true;
let InstalledAppId = 0;
var isadmin = $("#hfBizgaze_IsAdmin").val();
if (isadmin === 1)
IsAdmin = true;
var installedAppId = $("#hfLayout_InstalledPageId").val();
if (installedAppId !== undefined && installedAppId !== 0 && installedAppId !== "")
installedAppId = Number(installedAppId);
Unibase.Themes.Compact.Components.DesignMode.Instance().loadDesignMode(IsAdmin, InstalledAppId);
});
});
$("#btn_bizgaze_normalmode").click(function () {
_fileCacheHelper.loadJsFile("tenants/themes/compact/js/designmode/designmode.js", function () {
let IsAdmin = true;
let InstalledAppId = 0;
var isadmin = $("#hfBizgaze_IsAdmin").val();
if (isadmin === 1)
IsAdmin = true;
var installedAppId = $("#hfLayout_InstalledPageId").val();
if (installedAppId !== undefined && installedAppId !== 0 && installedAppId !== "")
InstalledAppId = Number(installedAppId);
Unibase.Themes.Compact.Components.DesignMode.Instance().closeDesignMode(IsAdmin, InstalledAppId);
});
});
$(document).on('shown.bs.modal', '.modal', function (e) {
const modalEl = $(e.currentTarget);
let visiblePopUpZIndex = 0;
if ($(".modal:visible").not(modalEl).length) {
visiblePopUpZIndex = Number($(".modal:visible").not(modalEl).last().css('z-index'));
modalEl.css('z-index', visiblePopUpZIndex + 20);
if (modalEl.data('bs.modal')._config.backdrop != false) {
$(modalEl.data('bs.modal')._backdrop).css('z-index', visiblePopUpZIndex + 10);
}
}
});
$(document).click(function (e) {
$(".templateviewer-tableview .column-dp-menu.show").removeClass("show");
if (document.body.contains(e.target) && !$(e.target).parents('.biz-settings-panel,.dropdown-notifications,.chat-nav-item,.profile-dropdown-menu,.divSectionProperties_SelectTheme,.user_login_card,.chat-panel-wrap').length && !$(e.currentTarget.activeElement).hasClass('custom-chat-input')) {
$('.biz-settings-toggle').removeClass('biz-settings-toggle');
$('#cam_pic').length && Unibase.Platform.Connect.Components.Chat.Instance().closecam();
}
});
instance.initializeCustomToolTip();
instance.autoAdjustHeightOnWindowResize();
instance.adjustAutoCompleteDropdownOnTouchScreens();
}
initializeCustomToolTip() {
const instance = this;
if (instance.desktopMode) {
$(document).tooltip({
items: "[data-tooltip='true']",
position: {
my: "center top+5", at: "center bottom",
},
});
}
}
autoAdjustHeightOnWindowResize() {
$(window).on('resize orientationchange', function (e) {
const windowHeight = window.innerHeight;
const elements = $("._bizgaze_popup_container .modal-body,.cmn-daterange-picker,#bizAppSettingsDpMenu,.common-filter-dropdown-body,.filter-dropdown-body").not(':hidden');
elements.each(function (i, e) {
let deductHeight = 0;
if ($(e).attr('data-deductheight') !== undefined) {
deductHeight = Number($(e).attr('data-deductheight'));
let heightProperty = 'max-height';
if ($(e).is('.modal-body')) {
heightProperty = 'height';
}
$(e).css(heightProperty, `${windowHeight - deductHeight}px`);
}
});
});
}
adjustAutoCompleteDropdownOnTouchScreens() {
if (window.matchMedia("(pointer: coarse)").matches) {
$(document).on('select2:opening', 'select', function (e) {
if ($(e.currentTarget).parents('._bizgaze_popup_container').length > 0) {
const containerEl = $(e.currentTarget).parents('._bizgaze_popup_container');
let scrollableEl = containerEl.find('.simplebar-content-wrapper').first();
if (!scrollableEl) {
scrollableEl = containerEl.find('.simple-scroll-bar.modal-body');
}
const targetPos = window.innerHeight - $(e.currentTarget).offset().top;
if (window.innerHeight > 550 && targetPos < 300) {
scrollableEl.scrollTop(scrollableEl.scrollTop() + 300);
}
}
});
}
}
getImageUrl(tenantImageUrl) {
return __awaiter(this, void 0, void 0, function* () {
let path = tenantImageUrl.replace("file://" + '/', '');
path = path.replace(window.location.origin + '/', '');
if (path != null && path != undefined && path != "") {
const imgurl = 'apis/v4/Documents/GetFile?path=' + path;
return yield Unibase.Platform.Analytics.Managers.ReportManager.Instance().dataHelper().getAsync(imgurl).then(function (response) {
return 'data:image/png;base64,' + response.file;
});
}
});
}
convertToRgba(color, alpha) {
const instance = this;
const hexReg = /^#([0-9a-f]{3}){1,2}$/i;
if (color && alpha) {
if (color.includes('rgb') && color.match(/,/g) != null) {
const rgba = 'rgba' + color.slice(color.indexOf('('), ((color.match(/,/g).length == 2) ? -1 : color.lastIndexOf(',') - color.length)) + ', ' + alpha + ')';
const rgb = instance.convertRgbaToRgb(rgba);
return rgb;
}
else if (hexReg.test(color)) {
const rgba = 'rgba(' + (color = color.replace('#', '')).match(new RegExp('(.{' + color.length / 3 + '})', 'g')).map(function (l) { return parseInt(color.length % 2 ? l + l : l, 16); }).concat(isFinite(alpha) ? alpha : 1).join(',') + ')';
const rgb = instance.convertRgbaToRgb(rgba);
return rgb;
}
else {
return color;
}
}
}
convertRgbaToRgb(rgbaColor) {
if (rgbaColor.includes('rgba')) {
const rgba = rgbaColor.replace(/^rgba?\(|\s+|\)$/g, '').split(',');
const r = rgba[0], g = rgba[1], b = rgba[2], a = rgba[3];
const r2 = Math.round(((1 - a) * 255) + (a * r));
const g2 = Math.round(((1 - a) * 255) + (a * g));
const b2 = Math.round(((1 - a) * 255) + (a * b));
return "rgb(" + r2 + ", " + g2 + ", " + b2 + ")";
}
else {
return rgbaColor;
}
}
getThemePaletteColors(paletteId) {
const instance = this;
Bizgaze.Apps.Crm.Palettes.Managers.PaletteManager.Instance().getPalletteColors(paletteId).then(function (response) {
if (response.result) {
instance.themePalette = [];
response.result.sort((x, y) => { return Number(x.paletteindex) - Number(y.paletteindex); });
for (const color of response.result) {
instance.themePalette.push(color.colorcode);
}
}
});
}
isLeftLayout() {
return this.layoutIndex === this.leftLayout;
}
isTopLeftLayout() {
return this.layoutIndex === this.topLeftLayout;
}
isTopLayout() {
return this.layoutIndex === this.topLayout;
}
indexAddCachedFiles() {
var _fileCacheHelper = Unibase.Platform.Helpers.FileCacheHelper.Instance();
_fileCacheHelper.addCacheFiles(["tenants/themes/compact/components/dashboard/wizard.js",
"libs/simplebar/simplebar.min.js",
"libs/summernote/summernote.min.js",
"libs/jquery.sortable/jquery.sortable.js",
"libs/jquery/ui/jquery-ui.min.js",
"libs/floatinglabels/floatinglabel.js",
"libs/bootstrap/js/dropdown-bootstrap-extended.js",
"libs/jquery-toggles/toggles.min.js",
"libs/handlebars/handlebars.min.js",
"libs/jquery.counterup/jquery.counterup.min.js",
"libs/select2/js/select2.min.js",
"libs/moment/moment.min.js",
"libs/daterangepicker/daterangepicker.js",
"libs/gpslocation/jquery.geocomplete.js",
"libs/jquery/ui/jquery-ui.js",
"libs/jquery-slimscroll/jquery.slimscroll.min.js",
"libs/chartjs/chartjs-plugin-datalabels.js",
"libs/mobile/jquerySwipeHandler.js",
"libs/jquery/pagination/jquery.pagination.js",
"libs/parsley/parsley.min.js",
"libs/querybuilder/sql-parser.min.js",
"libs/dragula/dist/dragula.min.js",
"libs/querybuilder/query-builder.standalone.min.js",
"libs/querybuilder/query-builder.min.js",
"libs/tabulator-tables/js/tabulator.min.js",
"libs/dragula/dist/init.js",
"libs/bootstrap-datepicker/bootstrap-datepicker.min.js",
"libs/nestable/jquery.nestable.js",
"platform/membership/infos/identity.js",
"platform/analytics/enums/globaldaterangetype.js",
"platform/apps/enums/appconfigurationtypes.js",
"platform/permission/enums/permission.js",
"platform/analytics/enums/reporttype.js",
"platform/analytics/enums/aggregationtype.js",
"platform/analytics/enums/controltype.js",
"platform/analytics/enums/colortype.js",
"platform/analytics/enums/datatype.js",
"platform/analytics/enums/pivottype.js",
"platform/analytics/enums/subreporttype.js",
"platform/analytics/enums/displaymodetype.js",
"platform/analytics/enums/conjectiveop.js",
"platform/analytics/enums/viewertype.js",
"platform/datasources/enums/datasource.js",
"platform/core/enums/expressionoperator.js",
"platform/analytics/enums/legendtitletype.js",
"platform/analytics/enums/charttype.js",
"platform/analytics/enums/filtertype.js",
"platform/analytics/enums/legendtype.js",
"platform/analytics/enums/dateformat.js",
"platform/filters/components/filter.js",
"platform/datasources/enums/staticfilterinputtype.js",
"platform/datasources/managers/interfaces/idatalistmanager.js",
"platform/forms/enums/enums.js",
"libs/jquery-toast/jquery.toast.min.css",
"libs/pre.loader/preloader.css",
"libs/index.compact.min.css",
"tenants/themes/compact/components/nav/nav.style.css",
"libs/owl.carousel/assets/owl.carousel.min.css",
"libs/owl.carousel/assets/owl.theme.default.min.css",
"tenants/themes/shared/fonts/css/*.css",
"libs/select2/css/select2.min.css",
"libs/bootstrap/css/bootstrap.min.css",
"libs/bootstrap-datepicker/bootstrap-datepicker.min.css",
"libs/dragula/dist/style.css",
"libs/tabulator-tables/css/bootstrap/tabulator_bootstrap4.min.css",
"libs/vectormap/jquery-jvectormap-2.0.3.css",
"libs/dragula/dist/dragula.min.css",
"libs/querybuilder/query-builder.default.min.css",
"libs/jquery-toggles/css/themes/toggles-light.css",
"tenants/themes/compact/css/style.basic.css",
"tenants/themes/compact/css/style.ext.css"]);
_fileCacheHelper.addCacheFiles([
"platform/core/helpers/filecache/filecachehelper.js",
"platform/core/helpers/url/urlhelper.js",
"platform/core/helpers/asset/assethelper.js",
"platform/core/basemanager.js",
"platform/core/baseinfo.js",
"platform/core/baserequest.js",
"platform/core/basecomponent.js",
"platform/core/interfaces/iappsetting.js",
"platform/core/helpers/data/datahelper.js",
"platform/core/helpers/navigation/navigationhelper.js",
"platform/core/helpers/navigation/size.js",
"platform/core/helpers/messages/messagehelper.js",
"platform/core/helpers/cookies/cookiehelper.js",
"platform/core/helpers/cryptohelper/cryptoprovider.js",
"platform/core/helpers/cryptohelper/cryptohelper.js",
"tenants/themes/providers/dashboard/idashboard.js",
"tenants/themes/providers/details/idetails.js",
"tenants/themes/providers/details/detailhelper.js",
"tenants/themes/providers/details/detail.settings.js",
"tenants/themes/providers/dashboard/dashboardhelper.js",
"tenants/themes/providers/settings/settings.js",
"platform/filters/components/editfilter.js",
"platform/analytics/components/templateviewer/templateviewer.settings.js",
"platform/datasources/managers/datalistmanager.js",
"platform/datasources/infos/datalist.js",
"platform/analytics/components/reportviewer/reportpermissions.js",
"platform/analytics/components/reportviewer/duplicatereport.js",
"platform/analytics/requests/new/report.js",
"platform/analytics/providers/ireportviewer.js",
"platform/analytics/components/tableviewer/tableviewer.js",
"platform/analytics/components/templateviewer/templateviewer.js",
"platform/membership/managers/accountmanager.js",
"platform/membership/managers/interfaces/iaccountmanager.js",
"tenants/themes/providers/login/login.js",
"platform/domainsettings/enums/domainsettingtype.js",
"tenants/themes/providers/register/register.js",
"tenants/themes/providers/signup/signup.js",
"tenants/themes/providers/createcustomer/createcustomer.js",
"tenants/themes/providers/forgotpassword/forgotpassword.js",
"tenants/themes/providers/logoff/logoff.js",
"tenants/themes/compact/components/login/defaultlogin.js",
"tenants/themes/compact/components/register/registeruser.js",
"tenants/themes/compact/components/signup/signup.js",
"tenants/themes/compact/components/signup/createcontact.js",
"tenants/themes/compact/components/forgotpassword/forgotpassword.js",
"tenants/themes/compact/index.anonymous.js",
"platform/membership/requests/login.js",
"platform/core/enums/rowstatus.js",
"tenants/themes/compact/index.js",
"platform/membership/infos/identity.js",
"platform/core/helpers/routes/routehelper.js",
"tenants/themes/compact/js/navigation/navigationhelper.js",
"tenants/themes/compact/components/notifications/notification.js",
"platform/automation/components/notificationhub.packets.js",
"platform/automation/enums/noitfyalerts.js",
"platform/automation/components/notifier.js",
"platform/automation/components/notificationhub.js",
"platform/connect/components/chat.template.js",
"platform/connect/components/chathub.packets.js",
"platform/hubs/providers/basepacket.js",
"platform/connect/components/chathub.server.packets.js",
"platform/connect/managers/chatmanager.js",
"platform/connect/hubs/chathub.js",
"platform/connect/components/chatter.js",
"platform/connect/requests/chat.js",
"tenants/themes/compact/js/app.js",
"tenants/themes/compact/components/dashboard/dashboard.js",
"tenants/themes/compact/components/nav/nav.js",
"platform/core/infos/status.js",
"platform/core/helpers/datetimehelper/datetimehelper.js",
"tenants/themes/compact/js/tabs/collapsetabs.js",
"platform/core/helpers/autocomplete/autocompletehelper.js",
"platform/core/helpers/file/filehelper.js",
"apps/crm/palettes/managers/palettemanager.js",
"tenants/themes/compact/components/nav/nav.template.js",
"platform/layout/managers/themelayoutmanager.js",
"platform/analytics/components/filterpanel/filterpanel.js",
"apps/communications/managers/tasks/taskmanager.js",
"platform/dashboards/managers/dashboardmanager.js",
"platform/connect/components/chat.js",
"platform/portlets/managers/interfaces/iportletmanager.js",
"platform/widgets/managers/interfaces/iwidgetmanager.js",
"platform/widgets/managers/widgetmanager.js",
"platform/portlets/managers/portletmanager.js",
"platform/analytics/components/commonfilter/_commonfilter.js",
"platform/analytics/providers/ifiltersettings.js",
"apps/crm/companies/managers/companymanager.js",
"platform/communications/enums/reminders/remindertype.js",
"platform/communications/managers/reminders/remindermanager.js",
"tenants/themes/compact/components/details/details.js",
"platform/forms/managers/formmanager.js",
"platform/forms/components/formviewer/formviewer.js",
"platform/forms/requests/forms.js",
"platform/portlets/components/portlet.js",
"platform/analytics/components/reportviewer/reportviewerhiddenfields.js",
"platform/analytics/components/reportbuilder/reportbuilderhiddenfields.js",
"platform/permission/managers/permissionmanager.js",
"platform/permission/components/permissions.js",
"platform/apps/enums/appconfigurationtypes.js",
"tenants/themes/compact/components/list/list.js",
"platform/core/helpers/token/tokenhelper.js",
"platform/apps/managers/appmanager.js",
"platform/dataapis/managers/dataapimanager.js",
"platform/tag/managers/tagmanager.js",
"platform/datasources/managers/doctypemanager.js",
"platform/core/helpers/navigation/interfaces/inavigationhelper.js",
"platform/core/helpers/mobile/basemobilehelper.js",
"platform/core/helpers/mobile/mobilehelper.js",
"platform/core/helpers/mobile/android/androidhelper.js",
"platform/core/helpers/mobile/ios/ioshelper.js",
"platform/core/helpers/mobile/enums/mobilepermissiontype.js",
"platform/core/helpers/mobile/flutter/flutterhelper.js",
"platform/core/helpers/propertyhelper/propertyhelper.js",
"platform/core/helpers/numberhelper/numberhelper.js",
"apps/transact/managers/payments/paymentmanager.js",
"apps/crm/contacts/managers/contactmanager.js",
"apps/crm/lobs/managers/lobmanager.js",
"apps/transact/managers/paymentterms/paymenttermmanager.js",
"platform/apps/managers/stagemanager.js",
"apps/transact/managers/orders/ordermanager.js",
"apps/transact/managers/invoicemanager.js",
"apps/transact/managers/offers/offermanager.js",
]);
}
indexAddCachedSubFiles() {
var _fileCacheHelper = Unibase.Platform.Helpers.FileCacheHelper.Instance();
_fileCacheHelper.addCacheFiles(["platform/analytics/components/chartbuilder/chartbuilderhiddenfields.js",
"platform/analytics/infos/reportbuilder/reportbuilderinfo.js",
"platform/analytics/components/reportbuilder/tenure.js",
"platform/analytics/components/reportbuilder/reportbuilder.template.js",
"platform/analytics/components/calendarviewer/calendarviewer.settings.js",
"platform/analytics/components/calendarviewer/calendarviewer.js",
"platform/analytics/components/cardviewer/cardviewer.settings.js",
"platform/analytics/components/cardviewer/cardviewer.js",
"platform/analytics/components/chartviewer/_chart.js",
"platform/analytics/components/reportbuilder/pivot.js",
"platform/analytics/components/chartbuilder/chartbuilder.js",
"platform/analytics/components/chartviewer/chartviewer.js",
"platform/analytics/components/reportviewer/_reportviewer.js",
"platform/analytics/components/reportviewer/reportviewer.js",
"platform/analytics/components/reportviewer/linkreport.js",
"platform/analytics/managers/viewermanager.js",
"platform/filters/managers/interfaces/ifiltermanager.js",
"platform/filters/managers/filtermanager.js",
"platform/core/helpers/html/htmlhelper.js",
"platform/apps/managers/appmanager.js",
"platform/analytics/components/filterpanel/filterpanel.js",
"platform/analytics/infos/report.js",
"platform/analytics/components/reportbuilder/reportbuilder.js",
"platform/analytics/managers/reportmanager.js",
"platform/analytics/components/reportviewer/widgetreportviewer.js",
"platform/analytics/components/menuuserdesign/userdesignconfigapps.js",
"platform/analytics/components/reportviewer/userdesignsettingreports.js",
"apps/crm/contacts/components/selfdeclaration.js",
"platform/membership/components/userlogindetailswidget.js",
"apps/hrms/components/attendence.js",
"platform/membership/components/checkindetails.js",
"apps/hrms/managers/attendencemanager.js",
"apps/communications/ai/components/resumeparsingmanager.js",
"tenants/themes/compact/components/notifications/userdesignnotificationwidget.js",
"tenants/themes/compact/components/notifications/userdesigntaskwidget.js"
]);
_fileCacheHelper.addCacheFiles(["libs/jquery-toggles/css/toggles.css",
"libs/jquery-toggles/css/themes/toggles-light.css",
"libs/jquery-toast-plugin/jquery.toast.min.css",
"libs/jquery/ui/jquery-ui.min.css",
"libs/summernote/summernote.css",
"libs/daterangepicker/daterangepicker.css",
"libs/floatinglabels/floatinglabel.css",
"libs/simplebar/simplebar.min.css"]);
}
static Instance() {
if (this._instance === undefined) {
this._instance = new Components.Index();
}
return this._instance;
}
}
Components.Index = Index;
})(Components = Compact.Components || (Compact.Components = {}));
})(Compact = Themes.Compact || (Themes.Compact = {}));
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
})(Unibase || (Unibase = {}));