{"version":3,"file":"lookupDirective.js","sourceRoot":"","sources":["../../../../src/modules/directives/applicationcore/lookupDirective.ts"],"names":[],"mappings":"AAAA,IAAO,UAAU,CA8EhB;AA9ED,WAAO,UAAU;IACb,IAAc,eAAe,CA4E5B;IA5ED,WAAc,eAAe;QAYzB;YAqBI,yBAAmB,SAAwC,EAC/C,UAAyC,EACzC,cAA0D;gBAFtE,iBAGC;gBAHkB,cAAS,GAAT,SAAS,CAA+B;gBAC/C,eAAU,GAAV,UAAU,CAA+B;gBACzC,mBAAc,GAAd,cAAc,CAA4C;gBAtBtE,aAAQ,GAAG,syBAOE,CAAC;gBACd,UAAK,GAAG;oBACJ,EAAE,EAAE,GAAG;oBACP,IAAI,EAAE,GAAG;oBACT,WAAW,EAAE,GAAG;oBAChB,QAAQ,EAAE,GAAG;oBACb,YAAY,EAAE,GAAG;oBACjB,IAAI,EAAE,GAAG;oBACT,IAAI,EAAE,GAAG;oBACT,MAAM,EAAE,GAAG;oBACX,UAAU,EAAE,GAAG;iBAClB,CAAA;gBAOD,SAAI,GAAG,UAAC,MAAoB,EAAE,QAA6B;oBACvD,wBAAwB;oBACxB,MAAM,CAAC,UAAU,GAAG;wBAChB,KAAI,CAAC,SAAS,CAAC,IAAI,CAAC;4BAChB,SAAS,EAAE,IAAI;4BACf,WAAW,EAAE,mDAAmD;4BAChE,UAAU,EAAE,YAAY;4BACxB,YAAY,EAAE,YAAY;4BAC1B,OAAO,EAAE;gCACL,KAAK,EAAE;oCACH,OAAO,MAAM,CAAC,YAAY,CAAC;gCAC/B,CAAC;6BACJ;yBACJ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,UAAC,IAAgD;4BAC5D,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;4BACpB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;4BACxB,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;4BACtC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;wBAE/B,CAAC,EAAE,UAAC,IAAI;wBACR,CAAC,CAAC,CAAC;oBACX,CAAC,CAAA;oBAED,MAAM,CAAC,WAAW,GAAG,UAAC,IAAY;wBAC9B,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAClC,CAAC,CAAA;gBACL,CAAC,CAAA;YA5BD,CAAC;YA+BM,uBAAO,GAAd;gBACI,IAAM,SAAS,GAAG,UAAC,SAAS,EAAE,UAAU,EAAE,cAAc,IAAK,OAAA,IAAI,eAAe,CAAC,SAAS,EAAE,UAAU,EAAE,cAAc,CAAC,EAA1D,CAA0D,CAAC;gBACxH,SAAS,CAAC,OAAO,GAAG,CAAC,WAAW,EAAE,YAAY,EAAE,gBAAgB,CAAC,CAAC;gBAElE,OAAO,SAAS,CAAC;YACrB,CAAC;YACL,sBAAC;QAAD,CAAC,AA7DD,IA6DC;QA7DY,+BAAe,kBA6D3B,CAAA;QAED,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,WAAW,EAAE,eAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC,EA5Ea,eAAe,GAAf,0BAAe,KAAf,0BAAe,QA4E5B;AACL,CAAC,EA9EM,UAAU,KAAV,UAAU,QA8EhB","sourcesContent":["module directives {\r\n export module applicationcore {\r\n interface ILookupScope extends ng.IScope {\r\n code: string,\r\n description: string,\r\n id: number,\r\n openLookup(): void,\r\n codeChanged(code: string): void,\r\n change(any): void,\r\n lookupConfig: interfaces.applicationcore.ILookupDirective,\r\n isBusy: boolean\r\n }\r\n\r\n export class lookupDirective implements ng.IDirective {\r\n template = `

\r\n \r\n \r\n \r\n \r\n \r\n

\r\n `;\r\n scope = {\r\n id: \"=\",\r\n code: \"=\",\r\n description: \"=\",\r\n required: \"=\",\r\n lookupConfig: \"=\",\r\n form: \"=\",\r\n name: '@',\r\n change: '&',\r\n ngDisabled: '='\r\n }\r\n\r\n constructor(public $uibModal: ng.ui.bootstrap.IModalService,\r\n private skuService: interfaces.master.ISKUService,\r\n private generalService: interfaces.applicationcore.IGeneralService) {\r\n }\r\n\r\n link = ($scope: ILookupScope, $element: ng.IAugmentedJQuery) => {\r\n //$scope.isBusy = false;\r\n $scope.openLookup = () => {\r\n this.$uibModal.open({\r\n animation: true,\r\n templateUrl: 'templates/modules/applicationcore/lookupView.html',\r\n controller: 'lookupCtrl',\r\n controllerAs: 'LookupCtrl',\r\n resolve: {\r\n items: function () {\r\n return $scope.lookupConfig;\r\n }\r\n }\r\n }).result.then((data: interfaces.applicationcore.ILookupResponse) => {\r\n $scope.id = data.id;\r\n $scope.code = data.code;\r\n $scope.description = data.description;\r\n $scope.change({ Id: data.id });\r\n\r\n }, (data) => {\r\n });\r\n }\r\n\r\n $scope.codeChanged = (code: string) => {\r\n $scope.change({ code: code });\r\n }\r\n }\r\n\r\n\r\n static factory(): ng.IDirectiveFactory {\r\n const directive = ($uibModal, skuService, generalService) => new lookupDirective($uibModal, skuService, generalService);\r\n directive.$inject = ['$uibModal', 'skuService', 'generalService'];\r\n\r\n return directive;\r\n }\r\n }\r\n\r\n angular.module(\"app\").directive(\"gtsLookup\", lookupDirective.factory());\r\n }\r\n}"]}