{"version":3,"sources":["../LuV.LUMAS.Services/scripts/controls/materialDetailviewDirective.ts"],"names":["MaterialDetailviewController","prototype","showModal","self","this","show","templateAppended","templateUrl","templateHelperService","getTemplateUrl","$templateRequest","then","html","template","angular","element","$element","parent","append","$compile","$scope","appData","$parent","vm","portalConfig","window","PortalConfig","startPDFDownload","itemProductCode","showPDFDownload","open","_lumasContext","svcBaseUrl","pdfLanguage","pdfFormat","openPopup","url","EnsureScriptFunc","ExecuteOrDelayUntilScriptLoaded","alert","$inject","$log","$timeout","exports","MaterialDetailview","replace","restict","controller","controllerAs","scope","item"],"mappings":"qHAUA,IAAAA,GAsBQA,EAAAC,UAAAC,UAAP,WACC,IAAIC,EAAOC,KAEX,GADAD,EAAKE,MAAO,GACPF,EAAKG,iBAAkB,CAC3B,IAAIC,EAAcH,KAAKI,sBAAsBC,eAAe,oBAC5DN,EAAKO,iBAAiBH,GACpBI,KAAK,SAAUC,GACf,IAAIC,EAAWC,EAAQC,QAAQH,GAC/BT,EAAKa,SAASC,SAASC,OAAOL,GAC9BV,EAAKgB,SAASN,EAAdV,CAAwBA,EAAKiB,QAC7BjB,EAAKkB,QAAWlB,EAAKiB,OAAOE,QAA+CC,GAAGF,QAC9ElB,EAAKqB,aAAeC,OAAW,GAAEC,eAEnCvB,EAAKG,kBAAmB,IAGnBN,EAAAC,UAAA0B,iBAAP,SAAwBC,GACvB,IAAIzB,EAAOC;oBAEXD;EAAK0B,iBAAkB,EAEvBJ,OAAOK,KACN3B,EAAK4B,cAAcC,WAAa,cAAgBJ,EAAkB,IAAMzB,EAAK8B,YAAc,IAAM9B,EAAK+B,YAEjGlC,EAAAC,UAAAkC,UAAP,SAAiBC,GAChBC,iBAAiB,mBACjBC,gCAAgC,WAC/BC,MAAM,yBAA2BH,IAC/B,oBAjDUpC,EAAAwC,QAAU,CAAC,SAAU,OAAQ,WAAY,mBAAoB,WAAY,WAAY,wBAAyB,iBAmD7HxC,GAlDC,SAAAA,EAA2BoB,EAClBqB,EACAC,EACAhC,EACAS,EACAH,EACAR,EACAuB,GAPkB3B,KAAAgB,OAAAA,EAClBhB,KAAAqC,KAAAA,EACArC,KAAAsC,SAAAA,EACAtC,KAAAM,iBAAAA,EACAN,KAAAe,SAAAA,EACAf,KAAAY,SAAAA,EACAZ,KAAAI,sBAAAA,EACAJ,KAAA2B,cAAAA,EAKF3B,KAAAC,MAAgB,EACfD,KAAAE,kBAA4B,EAG7BF,KAAA8B,UAAoB,MACpB9B,KAAA6B,YAAsB,KACtB7B,KAAAyB,iBAA2B,EATjCT,EAAOG,GAAKnB,KAXDuC,EAAA3C,6BAAAA,EAsDb,SAAA4C,IACQxC,KAAAyC,SAAU,EACVzC,KAAA0C,QAAU,IAEV1C,KAAAS,SAAW,sFACXT,KAAA2C,WAAa,+BACb3C,KAAA4C,aAAe,KACf5C,KAAA6C,MAAQ,CACdC,KAAM,KARKP,EAAAC,mBAAAA","file":"materialDetailviewDirective.js","sourcesContent":["import angular = require('angular');\r\nimport * as ths from '../helpers/templateHelperService';\r\n\r\n// TODO: implement SharePoint Search for documents\r\n\r\ninterface IMaterialDetailviewControllerScope extends ng.IScope {\r\n\tvm: MaterialDetailviewController,\r\n\tproduct: any\r\n}\r\n\r\nexport class MaterialDetailviewController {\r\n\tpublic static $inject = [`$scope`, `$log`, `$timeout`, `$templateRequest`, `$compile`, `$element`, `templateHelperService`, `_lumasContext`];\r\n\tpublic constructor(private $scope: IMaterialDetailviewControllerScope,\r\n\t\tprivate $log: ng.ILogService,\r\n\t\tprivate $timeout: ng.ITimeoutService,\r\n\t\tprivate $templateRequest: ng.ITemplateRequestService,\r\n\t\tprivate $compile: ng.ICompileService,\r\n\t\tprivate $element,\r\n\t\tprivate templateHelperService: ths.TemplateHelperService,\r\n\t\tprivate _lumasContext: any,\r\n\t) {\r\n\t\t$scope.vm = this;\r\n\t}\r\n\r\n\tpublic show: boolean = false;\r\n\tprivate templateAppended: boolean = false;\r\n\tpublic appData: any;\r\n\tpublic portalConfig: any;\r\n\tpublic pdfFormat: string = \"ISO\";\r\n\tpublic pdfLanguage: string = \"en\";\r\n\tpublic showPDFDownload: boolean = false;\r\n\r\n\tpublic showModal() {\r\n\t\tvar self = this;\r\n\t\tself.show = true;\r\n\t\tif (!self.templateAppended) {\r\n\t\t\tvar templateUrl = this.templateHelperService.getTemplateUrl('modalWindow.html');\r\n\t\t\tself.$templateRequest(templateUrl)\r\n\t\t\t\t.then(function (html) {\r\n\t\t\t\t\tvar template = angular.element(html);\r\n\t\t\t\t\tself.$element.parent().append(template);\r\n\t\t\t\t\tself.$compile(template)(self.$scope);\r\n\t\t\t\t\tself.appData = (self.$scope.$parent as IMaterialDetailviewControllerScope).vm.appData;\r\n\t\t\t\t\tself.portalConfig = window[\"Ll\"].PortalConfig;\r\n\t\t\t\t});\r\n\t\t\tself.templateAppended = true;\r\n\t\t}\r\n\t}\r\n\tpublic startPDFDownload(itemProductCode) {\r\n\t\tvar self = this;\r\n\t\t//self.show = false;\r\n\t\tself.showPDFDownload = false;\r\n\r\n\t\twindow.open(\r\n\t\t\tself._lumasContext.svcBaseUrl + 'gettdsfile/' + itemProductCode + '/' + self.pdfLanguage + '/' + self.pdfFormat);\r\n\t}\r\n\tpublic openPopup(url) {\r\n\t\tEnsureScriptFunc('sp.ui.dialog.js');\r\n\t\tExecuteOrDelayUntilScriptLoaded(function () {\r\n\t\t\talert('ready for dialog from ' + url);\r\n\t\t}, 'sp.ui.dialog.js');\r\n\t}\r\n}\r\n\r\nexport class MaterialDetailview implements ng.IDirective {\r\n\tpublic replace = true;\r\n\tpublic restict = `E`;\r\n\r\n\tpublic template = `{{item.Name ? item.Name : product}}`;\r\n\tpublic controller = `materialDetailviewController`;\r\n\tpublic controllerAs = `vm`;\r\n\tpublic scope = {\r\n\t\titem: '='\r\n\t}\r\n}"]}