var Unibase; (function (Unibase) { let Themes; (function (Themes) { let Compact; (function (Compact) { let DetailWidgets; (function (DetailWidgets) { class Detailwidgetsplitcolumn extends Unibase.Platform.Core.BaseComponent { jsFiles() { return []; } cssFiles() { return []; } html(id, containerid) { debugger; var title = id[0].WidgetName; let html = '
' + '
' + title + '
' + '
' + '
' + '
    ' + '' + '
' + '
' + '
' + '' + '
'; return html; } load(id, containerid, callback) { let instance = this; let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId); let fromDate = "", toDate = ""; var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate; var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate; if (cf_fromDate != null && cf_toDate != null) { fromDate = cf_fromDate.toString(); toDate = cf_toDate.toString(); } else { fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD"); toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD"); } var parameters = { WidgetId: id[0].WidgetId, PortletWidgetId: id[0].PortletWidgetId, InstalledAppId: id[0].InstalledAppId, InputParameters: inputparameters, FromDate: fromDate, ToDate: toDate }; instance.loadData(id[0].PortletWidgetId, containerid, parameters); } loadData(portletwidgetid, detailcontainer, parameters) { debugger; var instance = this; Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getDetailWidgetData(parameters).then(function (result) { if (result.errors != null && result.errors.length > 0) { $("." + detailcontainer).parent().find(".div_LineLoader").before(`
Error! ` + result.message + `
`).removeClass("line-loader"); return false; } var properties = result.result.DetailWidgetProperties; var tokenarray = []; var propertyarray = []; var HyperLink = []; var arraylength = 0; for (var i = 0; i < properties.length; i++) { var model = properties[i]; var propertyindex = model.PropertyIndex; if (model.Value != null) { var token = model.Value.replace(/\s/g, ""); } tokenarray.push(token); propertyarray.push(propertyindex); HyperLink.push(model.HyperLink); arraylength = arraylength + 1; } if (arraylength % 2 === 0) { arraylength = arraylength; } else { arraylength = arraylength + 1; } var arrayindex = (arraylength); var slicedarray = tokenarray.splice(0, arrayindex); var propertyslice = propertyarray; for (var k = 0; k < propertyarray.length; k++) { var replace = slicedarray[k]; var data = result.result.Data[0]; var templateScript = Handlebars.compile(replace); let token1 = Unibase.Core.Helpers.PropertyHelper.Instance().replace(replace, data); for (var i = 0; i < token1.split("|").length; i++) { var token2 = token1.split("|")[i]; if (token2 == "" || token2 == "null" || token2 == "Invalid date" || token2 == "1900/01/01" || token2 == "01/01/1900" || token2 == "[object Object]" || token2 == " " || token2 == "01/01/0001" || token2 == "0001/01/01" || token2 == "


") { token2 = "NA"; } if (result.result.Js != null || result.result.Js != "") { eval(result.result.Js); } if (HyperLink[propertyslice[k]] != null && HyperLink[propertyslice[k]] != "") { var HL = Unibase.Core.Helpers.TokenHelper.Instance().replace(HyperLink[propertyslice[k]], data); var href = "javascript:;"; var target = ""; if (HyperLink[propertyslice[k]].includes('href')) { var target = "target='_blank'"; href = HyperLink[propertyslice[k]].replace(/href=/, ''); HL = ''; } token2 = '' + token2 + ''; } let list1 = `
  • ${token2}
  • `; $('#widget_details_item' + portletwidgetid + '_col1:last').before(list1); } } }); $('.' + detailcontainer).siblings('.line-loader').remove(); $('.' + detailcontainer).removeClass('hidden'); } static Instance() { if (this.instance === null || this.instance === undefined) this.instance = new Detailwidgetsplitcolumn(); return this.instance; } } DetailWidgets.Detailwidgetsplitcolumn = Detailwidgetsplitcolumn; })(DetailWidgets = Compact.DetailWidgets || (Compact.DetailWidgets = {})); })(Compact = Themes.Compact || (Themes.Compact = {})); })(Themes = Unibase.Themes || (Unibase.Themes = {})); })(Unibase || (Unibase = {}));