{"version":3,"sources":["/source/modules/form/module_create.ts","/source/modules/form/providers/crFormOptionsProvider.ts","/source/modules/form/providers/crFormTemplateProvider.ts","/source/modules/form/factories/formPopupService.ts","/source/modules/form/controllers/formPopupController.ts","/source/modules/form/directives/crAutoCompleteField.ts","/source/modules/form/directives/crForm.ts","/source/modules/form/directives/crFormField.ts","/source/modules/form/directives/crFormFieldValidator.ts","/source/modules/form/directives/crFormName.ts","/source/modules/form/directives/crFormSection.ts","/source/modules/form/directives/crOptions.ts","/source/modules/form/directives/crPreviousNext.ts","/source/modules/form/directives/crRemoteValidation.ts","/source/modules/form/directives/crSelectField.ts","/source/modules/form/directives/crStrengthIndicator.ts","/source/modules/form/directives/crSubmit.ts","/source/modules/form/directives/crTransField.ts","/source/modules/form/directives/crUiSelect.ts","/source/modules/form/directives/integer.ts","/source/modules/form/config/registerTemplates.ts","/source/modules/form/contracts/contracts.ts","form-tmpl.js"],"names":["cr","cr.form","setOption","name","value","val","getOptions","options","uniqueFormId","context","submitCopy","cols","hideSubmit","this","$get","setTemplateUrl","templateUrl","getTemplateUrl","type","_this","templateMap","cr.form.formPopupService","cr.form.formPopupService.constructor","cr.form.formPopupService.editString","title","object","data","currentVal","params","validationCallback","buttons","rows","key","label","fieldName","cr.form.formPopupService.displayModal","$http","method","url","formDefinitionUrl","cr.form.formPopupController","cr.form.formPopupController.constructor","cr.form.formPopupController.submitForm","cr.form.formPopupController.submitClose","cr.form.formPopupController.handleButtons","restrict","replace","transclude","scope","definition","result","formOnParentScope","compile","iElement","iAttrs","controller","transcludeFn","post","ele","attr","formCtrl","$scope","$element","$parse","setSubmitHandler","h","submitHandler","angular","forEach","section","row","field","isDefined","watch","expression","listener","watchExpression","isFunction","args","Array","prototype","slice","call","arguments","unshift","apply","$watch","visibleFields","fields","index","newValue","expressionScope","hideExpression","hide","disabledExpression","disabled","validation","requiredExpression","required","$on","e","stopPropagation","window","setTimeout","formField","cr.form.crFormField","pre","iElem","$attr","setElementTemplate","templateData","template","crFormTemplate","get","cache","$templateCache","then","response","error","logger","firstLoad","optionsData","formOptions","formOptionsData","resets","optionKey","newVal","resetField","formControl","$setViewValue","$render","clickHandler","clickExpression","staticExpression","staticBinding","updateOptions","lurl","toLowerCase","indexOf","length","cfg","WebApiUrl","text","_","map","Id","Text","id","formId","parentIndex","$parent","$id","terminal","priority","$attrs","link","element","attrs","removeAttr","$set","$eval","crFormName","$emit","isArray","record","push","Data","showPrevious","showNext","onPrevious","isUndefined","previous","console","log","crRemoteValidation","errorFilter","$interpolate","newUrl","valid","holder","$filter","ErrorMessage","Success","ngModel","$setValidity","$sce","trustAsHtml","optionValue","i","indicatorValue","calculateScore","word","calculateScore.init","calculateScore.getVerdict","wordlen","lenScore","Math","pow","score","match","strength","strengthClass","verdict","progress","require","formElement","formController","attemptHandlers","submitCompleteHandlers","attempted","submitInProgress","setFormElement","submit","jQuery","onAttempt","handler","setAttempted","setFormController","needsAttention","fieldModelController","$invalid","$dirty","onSubmitComplete","setSubmitComplete","success","cElement","cAttributes","attributes","controllers","submitController","crFormController","rc","fn","rcSubmit","bind","event","firstInvalid","find","first","$","animate","scrollTop","offset","top","promise","focus","$valid","doSubmit","err","$q","when","$event","$$phase","$apply","html","$compile","contents","elm","ctrl","$parsers","viewValue","INTEGER_REGEXP","test","module","run","put"],"mappings":"AAGA,GAAOA,KAAP,SAAOA,IAAGA,GAAAA,OAAAA,SAAAA,MACNC,KAAAA,WAAaA,QAAQA,OAAOA,WAAYA,eAAgBA,UAAWA,YAAYA,oBADzED,KAAAA,GAAAA,OAAAA,GAAAA,WAAHA,KAAAA,OCFP,IAAOA,KAAP,SAAOA,IAAGA,GAAAA,OAAAA,SAAAA,MACNC,KAAAA,WAAWA,SAASA,gBAAiBA,WASjC,QAAAC,WAAmBC,KAAMC,OACDF,gBAATA,MACPA,QAAQA,MAAQA,MAEhBA,QAAQA,QAAQA,KAAMA,SAAUA,IAAKA,MACjCA,UAAUC,KAAME,OAI5B,QAAAC,cACIA,MAAOA,S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,OAAApM,QAAAoM,OAAA,cACAA,OAAAC,KAAA,iBAAA,SAAArJ,gBACAA,eAAAsJ,IAAA,sCACA,8iEAIA,SAAAF,QACA,IAAAA,OAAApM,QAAAoM,OAAA,WACA,MAAAf,KAAAe,OAAApM,QAAAoM,OAAA,cACAA,OAAAC,KAAA,iBAAA,SAAArJ,gBACAA,eAAAsJ,IAAA,0CACA,w6EAIA,SAAAF,QACA,IAAAA,OAAApM,QAAAoM,OAAA,WACA,MAAAf,KAAAe,OAAApM,QAAAoM,OAAA,cACAA,OAAAC,KAAA,iBAAA,SAAArJ,gBACAA,eAAAsJ,IAAA,6CACA,s0CAIA,SAAAF,QACA,IAAAA,OAAApM,QAAAoM,OAAA,WACA,MAAAf,KAAAe,OAAApM,QAAAoM,OAAA,cACAA,OAAAC,KAAA,iBAAA,SAAArJ,gBACAA,eAAAsJ,IAAA,oCACA","file":"form.js","sourcesContent":["/// \r\n/// \r\n\r\nmodule cr.form {\r\n formModule = angular.module(\"cr.form\", [\"ui.bootstrap\", \"ui.mask\", \"ui.select\",\"cr.translation\"]);\r\n}\r\n","\r\nmodule cr.form {\r\n formModule.provider(\"crFormOptions\", function () {\r\n var options = {\r\n uniqueFormId: null,\r\n context:null,\r\n submitCopy: 'Submit',\r\n cols: 12,\r\n hideSubmit: false\r\n };\r\n\r\n function setOption(name, value) {\r\n if (typeof name === 'string') {\r\n options[name] = value;\r\n } else {\r\n angular.forEach(name, function (val, name) {\r\n setOption(name, val);\r\n });\r\n }\r\n }\r\n function getOptions() {\r\n return angular.copy(options);\r\n }\r\n\r\n this.setOption = setOption;\r\n this.getOptions = getOptions;\r\n\r\n this.$get = function() {\r\n return this;\r\n };\r\n });\r\n}\r\n","\r\nmodule cr.form {\r\n formModule.provider(\"crFormTemplate\", function () {\r\n var templateMap = { };\r\n function setTemplateUrl(name, templateUrl) {\r\n if (typeof name === 'string') {\r\n templateMap[name] = templateUrl;\r\n } else {\r\n angular.forEach(name, function (templateUrl, name) {\r\n setTemplateUrl(name, templateUrl);\r\n });\r\n }\r\n }\r\n function getTemplateUrl(type) {\r\n return templateMap[type];\r\n }\r\n\r\n this.setTemplateUrl = setTemplateUrl;\r\n this.getTemplateUrl = getTemplateUrl;\r\n this.$get = ():IFormTemplateProvider => {\r\n return this;\r\n };\r\n });\r\n}\r\n","\r\nmodule cr.form {\r\n\r\n class formPopupService implements IFormPopupService\r\n {\r\n editString(title:string, fieldName:string, currentVal:any, params?:any) {\r\n var response, strButtons, buttons, buttonTokens, i;\r\n\r\n // config buttons\r\n strButtons = \"*OK|CANCEL\";\r\n\r\n // build array of buttons\r\n buttons = [];\r\n buttonTokens = strButtons.split('|');\r\n\r\n i = 0;\r\n while (i < buttonTokens.length) {\r\n var curToken = buttonTokens[i];\r\n if (curToken.substring(0, 1) == \"*\") {\r\n buttons.push({name: curToken.substring(1), default: true});\r\n } else {\r\n buttons.push({name: curToken, default: false});\r\n }\r\n i++;\r\n }\r\n\r\n // handle modal\r\n response = this.$q.defer();\r\n\r\n this.$modal.open({\r\n controller: 'formPopupController',\r\n resolve: {\r\n popupData: function () {\r\n return {\r\n title: title,\r\n object: {data: currentVal} || {},\r\n context: params ? (params.context ? params.context : \"Default\") : \"Default\",\r\n validationCallback: params ? (params.validationCallback ? params.validationCallback : null) : null,\r\n buttons: buttons\r\n }\r\n },\r\n formDefinition: function() {\r\n //{data: [{ \"label\":\"erg\", \"rows\": [ [ { \"cols\": 12, \"key\": \"data\", \"type\": \"text\", \"label\": fieldName } ] ] }] }\r\n return { \"data\" : [{ \"rows\": [ [ { \"cols\": 12, \"key\": \"data\", \"type\": \"text\", \"label\": fieldName } ] ] }] };\r\n }\r\n },\r\n size:'lg',\r\n templateUrl: 'modules/form/views/formpopup.html',\r\n show: true\r\n }).result.then(\r\n (buttonName:any) => {\r\n console.log(\"editstring response: \"+angular.toJson(buttonName));\r\n response.resolve(buttonName.object.data);\r\n },\r\n (reason:string) => { response.reject(reason); }\r\n );\r\n\r\n return response.promise;\r\n\r\n }\r\n\r\n displayModal(title:string, formDefinitionUrl:string, object?:any, params?:any) {\r\n var response, strButtons, buttons, buttonTokens, i;\r\n\r\n // config buttons\r\n strButtons = \"*OK|CANCEL\";\r\n\r\n // build array of buttons\r\n buttons = [];\r\n buttonTokens = strButtons.split('|');\r\n\r\n i = 0;\r\n while (i < buttonTokens.length) {\r\n var curToken = buttonTokens[i];\r\n if (curToken.substring(0, 1) == \"*\") {\r\n buttons.push({name: curToken.substring(1), default: true});\r\n } else {\r\n buttons.push({name: curToken, default: false});\r\n }\r\n i++;\r\n }\r\n\r\n // handle modal\r\n response = this.$q.defer();\r\n\r\n this.$modal.open({\r\n controller: 'formPopupController',\r\n resolve: {\r\n popupData: function () {\r\n return {\r\n title: title,\r\n object: object || {},\r\n context: params ? (params.context ? params.context : \"Default\") : \"Default\",\r\n validationCallback: params ? (params.validationCallback ? params.validationCallback : null) : null,\r\n buttons: buttons\r\n }\r\n },\r\n formDefinition: function ($http) {\r\n return $http({ method: \"GET\", url: formDefinitionUrl });\r\n }\r\n },\r\n size:'lg',\r\n templateUrl: 'modules/form/views/formpopup.html',\r\n show: true\r\n }).result.then(\r\n (buttonName:string) => { response.resolve(buttonName); },\r\n (reason:string) => { response.reject(reason); }\r\n );\r\n\r\n return response.promise;\r\n }\r\n\r\n constructor(private $q: angular.IQService, private $modal, private $http) {\r\n\r\n }\r\n\r\n }\r\n\r\n formModule.factory('formPopupService', ['$q','$modal', '$http', ($q,$modal, $http) => new formPopupService($q, $modal, $http)]);\r\n\r\n}\r\n","\r\nmodule cr.form {\r\n\r\n class formPopupController {\r\n\r\n submitForm() {\r\n\r\n // if validation callback given, wait for promise\r\n if (this.$scope.validationCallback) {\r\n this.$scope.validationCallback(this.$scope.formData).then(\r\n (response) => {\r\n this.submitClose(response);\r\n },\r\n data => {\r\n this.$scope.error = data;\r\n }\r\n );\r\n } else {\r\n this.submitClose();\r\n }\r\n }\r\n\r\n submitClose(validationResponse?) {\r\n var buttons, defaultButton;\r\n buttons = this.$scope.popupData.buttons;\r\n for (var button in buttons) {\r\n if (buttons[button].default) defaultButton = buttons[button];\r\n }\r\n var closeObj = {action:defaultButton.name, object:this.$scope.formData};\r\n if (validationResponse) closeObj['validationResponse'] = validationResponse;\r\n this.$modalInstance.close(closeObj);\r\n }\r\n\r\n handleButtons(obj:any) {\r\n if (obj.action === 'OK') {\r\n this.submitForm();\r\n } else {\r\n this.$modalInstance.dismiss(obj);\r\n }\r\n }\r\n\r\n constructor (private $scope:any, private $modalInstance:any,\r\n private currentLanguage:cr.translation.ICurrentLangage, popupData, formDefinition) {\r\n\r\n // define scope properties\r\n this.$scope.popupData = popupData;\r\n this.$scope.context = popupData.context ? popupData.context : $scope.context;\r\n this.$scope.validationCallback = popupData.validationCallback;\r\n\r\n // form settings\r\n this.$scope.formDefinition = formDefinition;\r\n this.$scope.formData = popupData.object || {};\r\n this.$scope.formOptions = {\r\n currentLanguage: currentLanguage.Langage,\r\n context: this.$scope.context,\r\n hideSubmit: true\r\n };\r\n\r\n // methods\r\n this.$scope.submitForm=()=> this.submitForm();\r\n this.$scope.handleButtons=(obj:any)=> this.handleButtons(obj);\r\n }\r\n\r\n }\r\n\r\n formModule.controller(\"formPopupController\", [\"$scope\", \"$modalInstance\", \"currentLangage\", \"popupData\", \"formDefinition\", formPopupController]);\r\n\r\n}\r\n","\r\nmodule cr.form {\r\n formModule.directive(\"crAutoCompleteField\", [() => {\r\n //var logger: angular.ILogService = $log.getInstance('crRemoteSelectField');\r\n\r\n return {\r\n scope: false,\r\n controller: [\r\n \"$scope\", \"$sce\",\r\n ($scope:any, $sce:any) => {\r\n //var url = \"\";\r\n\r\n //// Get url from options.\r\n //var datasourceUrl = $scope.options[\"datasource-url\"];\r\n //if (datasourceUrl) {\r\n\r\n // // Interpolate url.\r\n // $scope.$watch($interpolate($scope.options[\"datasource-url\"]), (url) => {\r\n // datasourceUrl = url;\r\n // });\r\n\r\n // // Configure select2.\r\n // $scope.loadAsync = {\r\n // id: function(item){\r\n // if (item.Text)\r\n // return item.Text;\r\n // return item;\r\n // },\r\n // formatResult: function(item){\r\n // return item.Text;\r\n // },\r\n // formatSelection: function(item){\r\n // if (item.Text)\r\n // return item.Text;\r\n // return item;\r\n // },\r\n // minimumInputLength: 3,\r\n // initSelection : function (element, callback) {\r\n // callback($(element).data('$ngModelController').$modelValue);\r\n // },\r\n // createSearchChoice: function (term) {\r\n // return { id: term, text: term };\r\n // },\r\n // ajax: {\r\n // data: function (term, page) {\r\n // return {\r\n // query: term\r\n // };\r\n // },\r\n // quietMillis: 500,\r\n // transport: function (queryParams) {\r\n\r\n // var data = [];\r\n // if(queryParams.data.query){\r\n // data.push({Id: queryParams.data.query, Text: queryParams.data.query });\r\n // }\r\n\r\n // return $http.get(cfg.WebApiUrl + datasourceUrl, { params: queryParams.data })\r\n // .then((response) => {\r\n // angular.forEach(response.data, (item) => { data.push(item); });\r\n // queryParams.success(data);\r\n // }, () => {\r\n // queryParams.success(data);\r\n // });\r\n // },\r\n // results: function (data, page) {\r\n // if (data)\r\n // return { results: data };\r\n // return {\r\n // results: []\r\n // };\r\n // }\r\n // }};\r\n //}\r\n\r\n var first = true;\r\n\r\n $scope.$watch('value', (val, old) => {\r\n\r\n if (first && val) {\r\n $scope.optionValue = {};\r\n $scope.optionValue.Id = val;\r\n\r\n first = false;\r\n }\r\n\r\n });\r\n\r\n $scope.$watch('optionValue',\r\n (val) => {\r\n var prop;\r\n\r\n if (val) {\r\n\r\n if (val.Id) {\r\n $scope.value = val.Id || '';\r\n }\r\n\r\n if (val.Data) {\r\n // Loop over object properties and render them if they are available\r\n if ($scope.formOptions && $scope.formOptions.formCtrl) {\r\n\r\n for (prop in val.Data) {\r\n var formControl: any = $scope.formOptions.formCtrl[prop];\r\n\r\n if (formControl\r\n && angular.isFunction(formControl.$setViewValue)\r\n && angular.isFunction(formControl.$render)) {\r\n\r\n formControl.$setViewValue(val.Data[prop]);\r\n formControl.$render();\r\n }\r\n }\r\n }\r\n } else {\r\n // Couldn't find any related fields\r\n $scope.value = val;\r\n }\r\n\r\n } else {\r\n $scope.value = \"\";\r\n }\r\n });\r\n }]\r\n };\r\n }]);\r\n}\r\n","\r\nmodule cr.form {\r\n formModule.directive('crForm', ['crFormOptions', '$compile',\r\n function (crFormOptions, $compile) {\r\n return {\r\n restrict: 'E',\r\n templateUrl: 'modules/form/templates/cr-form.html',\r\n replace: true,\r\n transclude: true,\r\n scope: {\r\n definition: '=',\r\n options: '=?',\r\n result: '=',\r\n formOnParentScope: '=name'\r\n },\r\n compile: function (scope:IFormScope, iElement, iAttrs, controller, transcludeFn) {\r\n return {\r\n post: function (scope, ele, attr, controller) {\r\n\r\n //Post gets called after angular has created the FormController\r\n //Now pass the FormController back up to the parent scope\r\n scope.formOnParentScope = scope[attr.name];\r\n scope.options.formCtrl = scope.formOnParentScope;\r\n }\r\n };\r\n },\r\n controller: ['$scope', '$element', '$parse',\r\n function ($scope:IFormScope, $element, $parse) {\r\n\r\n this.setSubmitHandler = (h) => {\r\n $scope.options.submitHandler = h;\r\n };\r\n\r\n // Loop each section in the definition.\r\n angular.forEach($scope.definition, (section) => {\r\n // Loop each row in the definition.\r\n angular.forEach(section.rows, (row) => {\r\n // Setup watches for watchExpressions\r\n angular.forEach(row, (field) => {\r\n if (angular.isDefined(field.watch)\r\n && angular.isDefined(field.watch.expression)\r\n && angular.isDefined(field.watch.listener)) {\r\n var watchExpression = field.watch.expression;\r\n if (angular.isFunction(watchExpression)) {\r\n // wrap the field's watch expression so we can call it with the field as the first arg as a helper\r\n watchExpression = function () {\r\n var args = Array.prototype.slice.call(arguments, 0);\r\n args.unshift(field);\r\n return field.watch.expression.apply(this, args);\r\n };\r\n }\r\n $scope.$watch(watchExpression, function () {\r\n // wrap the field's watch listener so we can call it with the field as the first arg as a helper\r\n var args = Array.prototype.slice.call(arguments, 0);\r\n args.unshift(field);\r\n return field.watch.listener.apply(this, args);\r\n });\r\n }\r\n });\r\n });\r\n });\r\n\r\n // Create a list of all fields and mark them as visible.\r\n $scope.visibleFields = {};\r\n angular.forEach($scope.definition, (section) => {\r\n angular.forEach(section.fields, function (field, index) {\r\n $scope.visibleFields[field.key] = true;\r\n });\r\n });\r\n\r\n // Watch for changes on the result and execute the expressions.\r\n $scope.$watch('result', function (newValue) {\r\n angular.forEach($scope.definition, (section) => {\r\n // Loop each row in the definition.\r\n angular.forEach(section.rows, (row) => {\r\n // Setup watches for watchExpressions\r\n angular.forEach(row, function (field) {\r\n\r\n // Create a temporary scope containing the actual object and the list of available fields.\r\n var expressionScope = {\r\n result: $scope.result,\r\n visibleFields: $scope.visibleFields\r\n };\r\n\r\n // Dynamically hide the field.\r\n if (field.hideExpression) {\r\n field.hide = $parse(field.hideExpression)(expressionScope);\r\n $scope.visibleFields[field.key] = !field.hide;\r\n }\r\n\r\n // Dynamically disable the field.\r\n if (field.disabledExpression) {\r\n field.disabled = $parse(field.disabledExpression)(expressionScope);\r\n }\r\n\r\n // Apply validation expressions.\r\n if (angular.isDefined(field.validation)){\r\n if (field.validation.requiredExpression) {\r\n field.validation.required = $parse(field.validation.requiredExpression)(expressionScope);\r\n //console.log(\"validation required? \"+field.validation.required+\" (\"+angular.toJson(field.validation.requiredExpression)+\")\")\r\n }\r\n }\r\n });\r\n });\r\n });\r\n }, true);\r\n\r\n $scope.$on('formly-dynamic-name-update', function(e) {\r\n e.stopPropagation();\r\n window.setTimeout(function() {\r\n\r\n // Loop each section in the definition.\r\n angular.forEach($scope.definition, (section) => {\r\n // Loop each row in the definition.\r\n angular.forEach(section.rows, (row) => {\r\n // Setup watches for watchExpressions\r\n angular.forEach(row, (field) => {\r\n\r\n var formField = $scope.formOnParentScope[field.key];\r\n if (formField) {\r\n field.formField = formField;\r\n }\r\n });\r\n });\r\n });\r\n });\r\n });\r\n }\r\n ]\r\n };\r\n }\r\n]);\r\n}\r\n","\r\nmodule cr.form {\r\n formModule.directive(\"crFormField\", ['$http', '$compile', '$templateCache', '$log', 'crFormTemplate', 'cfg',\r\n function crFormField($http, $compile, $templateCache, $log, crFormTemplate: cr.form.IFormTemplateProvider, cfg) {\r\n var logger: angular.ILogService = $log.getInstance('crFormField');\r\n\r\n return {\r\n restrict: 'AE',\r\n replace: true,\r\n priority:200,\r\n transclude: true,\r\n scope: {\r\n optionsData: '&options',\r\n formOptionsData: '&formOptions',\r\n formId: '=formId',\r\n index: '=index',\r\n parentIndex: '=parentIndex',\r\n // fieldName: '@',\r\n value: '=formValue',\r\n result: '=formResult'\r\n },\r\n compile: function (tElem, tAttrs) {\r\n //console.log(\"crFormField compile\");\r\n return {\r\n pre: function (scope, iElem, iAttrs) {\r\n var fName = scope.fieldName;\r\n\r\n },\r\n\r\n post: function ($scope, $element, $attr) {\r\n //console.log(\"field name: \"+$scope.fieldName);\r\n var template = $scope.options.template;\r\n if (template) {\r\n setElementTemplate(template);\r\n } else {\r\n var templateUrl = $scope.options.templateUrl || crFormTemplate.getTemplateUrl($scope.options.type);\r\n if (templateUrl) {\r\n $http.get(templateUrl, { cache: $templateCache }).then(function (response) {\r\n setElementTemplate(response.data);\r\n }, function (error) {\r\n logger.error('Problem loading template for ' + templateUrl);\r\n logger.error(error);\r\n });\r\n } else {\r\n logger.error('Template type \\'' + $scope.options.type + '\\' not supported.');\r\n }\r\n }\r\n function setElementTemplate(templateData) {\r\n $element.html(templateData);\r\n\r\n $compile($element.contents())($scope);\r\n }\r\n\r\n }\r\n }\r\n }\r\n ,\r\n controller: [\r\n '$scope', '$parse', '$http', 'cfg',\r\n function ($scope, $parse, $http, cfg) {\r\n var firstLoad = true;\r\n\r\n $scope.options = $scope.optionsData();\r\n $scope.formOptions = $scope.formOptionsData();\r\n\r\n if (!angular.isDefined($scope.value) && typeof $scope.options.default !== 'undefined') {\r\n $scope.value = $scope.options.default;\r\n }\r\n\r\n var type = $scope.options.type;\r\n if (!type && $scope.options.template) {\r\n type = 'template';\r\n } else if (!type && $scope.options.templateUrl) {\r\n type = 'templateUrl';\r\n }\r\n\r\n var resets = $scope.options.resets;\r\n\r\n //console.log(\"in crFormField - \"+$scope.options.key+\" = \"+ angular.toJson($scope.value)+\" / \"+angular.toJson(resets));\r\n\r\n\r\n if (resets) {\r\n var optionKey = $scope.options.key;\r\n\r\n // If value of this scope changes it should clear 'resets array' values\r\n $scope.$watch('formOptions.formCtrl.' + optionKey + '.$viewValue', function (newVal) {\r\n\r\n if (newVal) {\r\n\r\n if (! firstLoad) {\r\n angular.forEach(resets, function (resetField) {\r\n\r\n //console.log(firstLoad, \"MERD RESET DE : \" + angular.toJson(resets) + \" / \" + angular.toJson($scope.value) + \"/\" + angular.toJson(newVal));\r\n //$scope.value=newVal.Id;\r\n\r\n if ($scope.formOptions\r\n && $scope.formOptions.formCtrl\r\n && $scope.formOptions.formCtrl[resetField]) {\r\n\r\n var formControl: any = $scope.formOptions.formCtrl[resetField];\r\n\r\n if (formControl\r\n && angular.isFunction(formControl.$setViewValue)\r\n && angular.isFunction(formControl.$render)) {\r\n\r\n formControl.$setViewValue('');\r\n formControl.$render();\r\n }\r\n }\r\n });\r\n }\r\n\r\n firstLoad = false;\r\n }\r\n\r\n });\r\n\r\n }\r\n\r\n\r\n $scope.clickHandler = () => {\r\n if ($scope.options.clickExpression != null) {\r\n $parse($scope.options.clickExpression)({\r\n result: $scope.result\r\n });\r\n }\r\n };\r\n\r\n if ($scope.options.staticExpression != null) {\r\n $scope.$watch($scope.options.staticExpression, function (value) {\r\n $scope.staticBinding = value;\r\n });\r\n }\r\n\r\n $scope.updateOptions = ( value ) => {\r\n if (!angular.isDefined($scope.options[\"datasource-url\"])) return;\r\n \r\n var lurl = $scope.options[\"datasource-url\"].toLowerCase();\r\n if ( lurl.indexOf(\"search=\", lurl.length - \"search=\".length) >= 0 ) {\r\n var url = cfg.WebApiUrl + $scope.options[\"datasource-url\"] + value;\r\n $http.get(url).then((response) => {\r\n var key: string = \"Id\";\r\n var text: string = \"Text\";\r\n if( $scope.options[\"datasource-key\"] ){\r\n key = $scope.options[\"datasource-key\"];\r\n }\r\n if( $scope.options[\"datasource-value\"] ){\r\n text = $scope.options[\"datasource-value\"];\r\n }\r\n if( key === \"Id\" && text === \"text\"){\r\n $scope.options.options = response.data;\r\n } else {\r\n $scope.options.options = _.map( response.data, ( value ) => { return { \"Id\": value[key], \"Text\": value[text] }; } );\r\n }\r\n });\r\n }\r\n }\r\n\r\n // set field id to link labels and fields\r\n $scope.id = $scope.formId + '_' + type + '_' + (typeof $scope.parentIndex === 'undefined' ? $scope.$parent.$id : $scope.parentIndex) + '_' + $scope.index;\r\n }\r\n ]\r\n };\r\n }\r\n ]);\r\n}\r\n","\r\nmodule cr.form {\r\n formModule.directive('crFormFieldValidator',\r\n ['$compile', '$interpolate', '$http', 'cfg', function ($compile, $interpolate, $http, cfg) {\r\n return {\r\n restrict: 'A',\r\n terminal: true,\r\n priority: 1000,\r\n controller: function ($scope, $element, $attrs) {\r\n\r\n },\r\n link: function link(scope, element, attrs) {\r\n element.removeAttr('cr-form-field-validator');\r\n\r\n if (attrs.crFormFieldValidator) {\r\n var validation = scope.$eval(attrs.crFormFieldValidator);\r\n if (validation) {\r\n if (angular.isDefined(validation.compareTo)) {\r\n // The compareTo attribute requires the name of the field on which the binding will happen.\r\n element.attr('compare-to', validation.compareTo);\r\n }\r\n if (angular.isDefined(validation.required)) {\r\n element.attr('ng-required', 'options.validation.required');\r\n }\r\n\r\n if (angular.isDefined(validation.remote)) {\r\n\r\n //var url = scope.options.validation.remote;\r\n\r\n //scope.$watch($interpolate(url), function (newUrl) {\r\n // $http.get(cfg.WebApiUrl + url).then(function (result) {\r\n // console.log(result);\r\n // });\r\n //});\r\n element.attr('cr-remote-validation', '{{ options.validation.remote }}');\r\n\r\n }\r\n\r\n if (angular.isDefined(validation.minLength)) {\r\n //console.log(\"MINLENGTH!!!\"+angular.toJson(scope.options));\r\n element.attr('ng-minlength', '{{options.validation.minLength}}');\r\n }\r\n if (angular.isDefined(validation.maxLength)) {\r\n element.attr('ng-maxlength', '{{ options.validation.maxLength }}');\r\n }\r\n if (angular.isDefined(validation.pattern)) {\r\n // compiles regular expression if passed as a string\r\n if (angular.isString(validation.pattern)) validation.pattern=new RegExp(validation.pattern);\r\n element.attr('ng-pattern', 'options.validation.pattern');\r\n }\r\n }\r\n }\r\n\r\n $compile(element)(scope);\r\n }\r\n };\r\n }]\r\n );\r\n}\r\n","\r\nmodule cr.form {\r\n formModule.directive('crFormName',\r\n function () {\r\n return {\r\n restrict: 'A',\r\n priority: 599, // one after ngIf\r\n controller: function($scope, $element, $attrs) {\r\n $element.removeAttr('cr-form-name');\r\n $attrs.$set('name', $scope.$eval($attrs.crFormName));\r\n delete $attrs.crFormName;\r\n $scope.$emit('formly-dynamic-name-update');\r\n }\r\n };\r\n }\r\n );\r\n}\r\n","\r\nmodule cr.form {\r\n formModule.directive('crFormSection', [\r\n '$compile',\r\n function ($compile) {\r\n return {\r\n restrict: 'E',\r\n templateUrl: 'modules/form/templates/cr-section.html',\r\n replace: true,\r\n scope: true\r\n };\r\n }\r\n ]);\r\n}\r\n","\r\nmodule cr.form {\r\n formModule.directive('crOptions', ['$http', '$sce', 'cfg', '$timeout', ($http, $sce, cfg: cr.common.IConfig, $timeout) => {\r\n\r\n return {\r\n scope: false,\r\n controller: [\r\n \"$scope\", \"$interpolate\", \"$element\", ($scope, $interpolate, $element) => {\r\n var debounceInMs = 250,\r\n timeoutPromise;\r\n\r\n var datasourceUrl = $scope.options[\"datasource-url\"];\r\n\r\n if (datasourceUrl) {\r\n $scope.$watch($interpolate(datasourceUrl),\r\n (url) => {\r\n // Delay the http call with 250ms\r\n $timeout.cancel(timeoutPromise);\r\n\r\n url = url.replace(\"\\ufeff\", \"\");\r\n\r\n timeoutPromise = $timeout(function () {\r\n $http.get(cfg.WebApiUrl + url).then((response) => {\r\n\r\n if (response && response.data && angular.isArray(response.data)) {\r\n var result = [];\r\n angular.forEach(response.data, function (record) {\r\n\r\n result.push({\r\n Text: record.Text,\r\n Id: record.Id,\r\n Data: record.Data\r\n });\r\n });\r\n\r\n $scope.options[\"options\"] = response.data;\r\n }\r\n });\r\n }, debounceInMs);\r\n }\r\n );\r\n }\r\n }\r\n ]\r\n };\r\n }]);\r\n}\r\n","\r\nmodule cr.form {\r\n formModule.directive('crPreviousNext',\r\n function () {\r\n return {\r\n restrict: 'E',\r\n templateUrl: 'modules/form/templates/cr-previous-next.html',\r\n replace: true,\r\n scope: { showPrevious: '=', showNext: '=', onPrevious:'&onPrevious',context:'=' },\r\n link: function(scope,element,attrs) {\r\n if (angular.isUndefined(scope.showPrevious))\r\n scope.showPrevious = true;\r\n if (angular.isUndefined(scope.showNext))\r\n scope.showNext = true;\r\n scope.previous = scope.onPrevious;\r\n console.log(\"scope.context in crprev: \" +scope.context);\r\n }\r\n };\r\n }\r\n );\r\n}\r\n","\r\nmodule cr.form {\r\n formModule.directive('crRemoteValidation', ['$http', '$filter', '$interpolate', 'cfg', ($http, $filter, $interpolate, cfg: cr.common.IConfig) => {\r\n\r\n return {\r\n require: 'ngModel',\r\n\r\n link: function (scope, elm, attrs, ngModel) {\r\n var url = attrs.crRemoteValidation,\r\n errorFilter = {};\r\n\r\n scope.$watch($interpolate(url), (newUrl) => {\r\n //console.log(\"url: \"+cfg.WebApiUrl + newUrl);\r\n $http.get(cfg.WebApiUrl + newUrl).then((response) => {\r\n if (response.data) {\r\n var holder = $filter('tc')(response.data.ErrorMessage, scope.formOptions.context);\r\n var valid;\r\n\r\n if (response.data.Success === true) {\r\n valid = true;\r\n } else {\r\n errorFilter[holder] = holder;\r\n\r\n valid = false;\r\n }\r\n\r\n for (var key in errorFilter) {\r\n ngModel.$setValidity(key, valid);\r\n }\r\n }\r\n });\r\n });\r\n }\r\n };\r\n }]);\r\n}\r\n","\r\nmodule cr.form {\r\n formModule.directive(\"crSelectField\", ['$http', '$log', ($http, $log) => {\r\n var logger: angular.ILogService = $log.getInstance('crSelectField');\r\n\r\n return {\r\n scope: false,\r\n controller: [\r\n \"$scope\", \"$sce\", \"cfg\",\r\n ($scope: any, $sce: any) => {\r\n\r\n //console.log(\"opt: \"+angular.toJson($scope.optionValue)+\"/\"+angular.toJson($scope.value));\r\n\r\n $scope.trustAsHtml = function (value) {\r\n return $sce.trustAsHtml(value);\r\n };\r\n\r\n $scope.$watchCollection('options.options', function (options) {\r\n if (!options) {\r\n options = [];\r\n }\r\n\r\n //console.log(\"options.options: \"+angular.toJson($scope.optionValue));\r\n\r\n //Only change value if it's typeof string or undefined\r\n //Otherwise it's already set\r\n //(i.e. when language changes, do not check again)\r\n if (typeof $scope.optionValue === 'string' || typeof $scope.optionValue === 'undefined') {\r\n\r\n var val=$scope.value;\r\n if (!angular.isDefined(val)) val=$scope.options.default;\r\n\r\n //console.log(\"set defaut?\"+angular.toJson($scope.optionValue)+\"/\"+$scope.value);\r\n // $scope.options.default=\"NLD\";\r\n\r\n for (var i = 0; i < options.length; i += 1) {\r\n\r\n if (options[i].Id === val) {\r\n $scope.optionValue = options[i];\r\n }\r\n }\r\n\r\n if (!$scope.optionValue && options.length>0) {\r\n $scope.optionValue = options[0];\r\n }\r\n }\r\n\r\n // $scope.optionValue = \"ITA\";\r\n });\r\n\r\n $scope.$watch('value',(val)=>{\r\n logger.info(\"val watch...: \"+angular.toJson(val)+\"/\"+angular.toJson($scope.optionValue));\r\n\r\n if (typeof val === 'string' && angular.isDefined($scope.options.options)) {\r\n // If it's a string, convert it to an option value\r\n for (var i = 0; i < $scope.options.options.length; i++) {\r\n if ($scope.options.options[i].Id.replace(\"\\ufeff\", \"\") == val) {\r\n $scope.optionValue = $scope.options.options[i];\r\n }\r\n }\r\n }\r\n\r\n });\r\n\r\n\r\n $scope.$watch('optionValue',\r\n (val) => {\r\n //console.log(\"optionValue watch: \"+angular.toJson($scope.optionValue)+\"/\"+angular.toJson(val));\r\n var prop;\r\n\r\n if (typeof val === 'string' && angular.isDefined($scope.options.options)) {\r\n // If it's a string, convert it to an option value\r\n for (var i = 0; i < $scope.options.options.length; i++) {\r\n if ($scope.options.options[i].Id.replace(\"\\ufeff\", \"\") == val) {\r\n $scope.optionValue = $scope.options.options[i];\r\n }\r\n }\r\n }\r\n\r\n\r\n if (val) {\r\n\r\n //console.log(\"et ici : \"+angular.toJson($scope.optionValue)+\"/\"+angular.toJson(val));\r\n\r\n if (val.Id) {\r\n $scope.value = val.Id || '';\r\n }\r\n\r\n\r\n if (val.Data) {\r\n // Loop over object properties and render them if they are available\r\n if ($scope.formOptions && $scope.formOptions.formCtrl) {\r\n\r\n for (prop in val.Data) {\r\n var formControl: any = $scope.formOptions.formCtrl[prop];\r\n\r\n if (formControl\r\n && angular.isFunction(formControl.$setViewValue)\r\n && angular.isFunction(formControl.$render)) {\r\n\r\n formControl.$setViewValue(val.Data[prop]);\r\n formControl.$render();\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n //console.log(\"FAIT TROP CHIER\");\r\n // $scope.value = \"\";\r\n }\r\n });\r\n\r\n }\r\n ]\r\n };\r\n }\r\n ]);\r\n}\r\n","\r\nmodule cr.form {\r\n formModule.directive('crStrengthIndicator', [\r\n '$compile',\r\n function ($compile) {\r\n return {\r\n restrict: 'A',\r\n templateUrl: 'modules/form/templates/cr-strength-indicator.html',\r\n replace: true,\r\n scope: {\r\n indicatorValue: '='\r\n },\r\n controller: function ($scope) {\r\n function calculateScore(word) {\r\n var scores = [17, 20, 32, 40];\r\n var verdicts = [\r\n { name: \"Weak\", progress: 20 },\r\n { name: \"Normal\", progress: 40 },\r\n { name: \"Medium\", progress: 60 },\r\n { name: \"Strong\", progress: 80 },\r\n { name: \"Very Strong\", progress: 100 }\r\n ];\r\n\r\n var ruleScores = {\r\n wordLength: -100,\r\n wordLowercase: 1,\r\n wordUppercase: 3,\r\n wordOneNumber: 3,\r\n wordThreeNumbers: 5,\r\n wordOneSpecialChar: 3,\r\n wordTwoSpecialChar: 5,\r\n wordUpperLowerCombo: 2,\r\n wordLetterNumberCombo: 2,\r\n wordLetterNumberCharCombo: 2\r\n };\r\n\r\n var rules = {\r\n wordLength: true,\r\n wordLowercase: true,\r\n wordUppercase: true,\r\n wordOneNumber: true,\r\n wordThreeNumbers: true,\r\n wordOneSpecialChar: true,\r\n wordTwoSpecialChar: true,\r\n wordUpperLowerCombo: true,\r\n wordLetterNumberCombo: true,\r\n wordLetterNumberCharCombo: true\r\n };\r\n\r\n var validationRules = {\r\n wordLength: function (word, score) {\r\n var wordlen = word.length,\r\n lenScore = Math.pow(wordlen, 1.4);\r\n if (wordlen < 4) {\r\n lenScore = (lenScore + score);\r\n }\r\n return lenScore;\r\n },\r\n wordLowercase: function (word, score) {\r\n return word.match(/[a-z]/) && score;\r\n },\r\n wordUppercase: function (word, score) {\r\n return word.match(/[A-Z]/) && score;\r\n },\r\n wordOneNumber: function (word, score) {\r\n return word.match(/\\d+/) && score;\r\n },\r\n wordThreeNumbers: function (word, score) {\r\n return word.match(/(.*[0-9].*[0-9].*[0-9])/) && score;\r\n },\r\n wordOneSpecialChar: function (word, score) {\r\n return word.match(/.[!,@,#,$,%,\\^,&,*,?,_,~]/) && score;\r\n },\r\n wordTwoSpecialChar: function (word, score) {\r\n return word.match(/(.*[!,@,#,$,%,\\^,&,*,?,_,~].*[!,@,#,$,%,\\^,&,*,?,_,~])/) && score;\r\n },\r\n wordUpperLowerCombo: function (word, score) {\r\n return word.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/) && score;\r\n },\r\n wordLetterNumberCombo: function (word, score) {\r\n return word.match(/([a-zA-Z])/) && word.match(/([0-9])/) && score;\r\n },\r\n wordLetterNumberCharCombo: function (word, score) {\r\n return word.match(/([a-zA-Z0-9].*[!,@,#,$,%,\\^,&,*,?,_,~])|([!,@,#,$,%,\\^,&,*,?,_,~].*[a-zA-Z0-9])/) && score;\r\n }\r\n };\r\n\r\n function init() {\r\n var totalScore = 0;\r\n\r\n for (var key in rules) {\r\n var score = ruleScores[key],\r\n result = validationRules[key](word, score);\r\n\r\n if (result) {\r\n totalScore += result;\r\n }\r\n }\r\n\r\n return totalScore;\r\n }\r\n\r\n function getVerdict(score) {\r\n\r\n if (score < scores[0]) {\r\n return verdicts[0];\r\n } else if (score >= scores[0] && score < scores[1]) {\r\n return verdicts[1];\r\n } else if (score >= scores[1] && score < scores[2]) {\r\n return verdicts[2];\r\n } else if (score >= scores[2] && score < scores[3]) {\r\n return verdicts[3];\r\n } else if (score >= scores[3]) {\r\n return verdicts[4];\r\n }\r\n\r\n return verdicts[0];\r\n\r\n }\r\n\r\n var score = init();\r\n\r\n score = Math.round(score);\r\n\r\n var verdict = getVerdict(score);\r\n\r\n return {\r\n score: score,\r\n verdict: verdict\r\n };\r\n }\r\n\r\n $scope.$watch('indicatorValue', function (val) {\r\n if (!val) {\r\n val = \"\";\r\n }\r\n\r\n $scope.strength = calculateScore(val);\r\n $scope.strengthClass = 'strength-' + $scope.strength.verdict.progress;\r\n });\r\n },\r\n link: function (scope, element, attrs) {\r\n }\r\n };\r\n }\r\n ]);\r\n}\r\n","/**\r\n * @ngdoc directive\r\n * @name ng.directive:rcSubmit\r\n *\r\n * @description\r\n * Alternative to ngSubmit that verifies the ngFormController is valid before\r\n * executing the given expression. Otherwise it cancels the event.\r\n *\r\n * @element form\r\n * @param {expression} rcSubmit {@link guide/expression Expression} to eval.\r\n */\r\n\r\nmodule cr.form {\r\n formModule.directive('rcSubmit',['$parse', '$q', '$timeout', function ($parse, $q, $timeout) {\r\n return {\r\n restrict: 'A',\r\n require: ['rcSubmit', '?form', '?crForm'],\r\n controller: ['$scope', function ($scope) {\r\n\r\n var formElement = null;\r\n var formController = null;\r\n var attemptHandlers = [];\r\n var submitCompleteHandlers = [];\r\n\r\n this.attempted = false;\r\n this.submitInProgress = false;\r\n\r\n this.setFormElement = function(element) {\r\n formElement = element;\r\n }\r\n\r\n this.submit = function() {\r\n if (!formElement) return;\r\n\r\n jQuery(formElement).submit();\r\n }\r\n\r\n this.onAttempt = function(handler) {\r\n attemptHandlers.push(handler);\r\n };\r\n\r\n this.setAttempted = function() {\r\n this.attempted = true;\r\n\r\n angular.forEach(attemptHandlers, function (handler) {\r\n handler();\r\n });\r\n\r\n };\r\n\r\n this.setFormController = function(controller) {\r\n formController = controller;\r\n };\r\n\r\n this.needsAttention = function (fieldModelController) {\r\n if (!formController) return false;\r\n\r\n if (fieldModelController) {\r\n return fieldModelController.$invalid &&\r\n (fieldModelController.$dirty || this.attempted);\r\n } else {\r\n return formController && formController.$invalid &&\r\n (formController.$dirty || this.attempted);\r\n }\r\n };\r\n\r\n this.onSubmitComplete = function (handler) {\r\n\r\n submitCompleteHandlers.push(handler);\r\n };\r\n\r\n this.setSubmitComplete = function (success, data) {\r\n\r\n angular.forEach(submitCompleteHandlers, function (handler) {\r\n handler({ 'success': success, 'data': data });\r\n });\r\n };\r\n }],\r\n compile: function(cElement, cAttributes, transclude) {\r\n return {\r\n pre: function(scope, formElement, attributes, controllers) {\r\n\r\n var submitController = controllers[0];\r\n var formController = (controllers.length > 1) ? controllers[1] : null;\r\n var crFormController = (controllers.length > 2) ? controllers[2] : null;\r\n\r\n submitController.setFormElement(formElement);\r\n submitController.setFormController(formController);\r\n\r\n scope.rc = scope.rc || {};\r\n scope.rc[attributes.name] = submitController;\r\n\r\n if (crFormController != null)\r\n crFormController.setSubmitHandler(submitController);\r\n\r\n },\r\n post: function(scope, formElement, attributes, controllers) {\r\n\r\n var submitController = controllers[0];\r\n var formController = (controllers.length > 1) ? controllers[1] : null;\r\n var fn = $parse(attributes.rcSubmit);\r\n\r\n formElement.bind('submit', function (event) {\r\n submitController.setAttempted();\r\n\r\n var firstInvalid = formElement.find('.ng-invalid:visible').first();\r\n if (firstInvalid != null && firstInvalid.length > 0){\r\n $(\"body,html\").animate({ scrollTop: firstInvalid.offset().top - 50 }, 100).promise()\r\n .then(function(){\r\n firstInvalid.focus();\r\n });\r\n }\r\n\r\n if (!formController.$valid) return false;\r\n\r\n var doSubmit = function () {\r\n\r\n submitController.submitInProgress = true;\r\n\r\n $q.when(fn(scope, { $event: event })).then(success, error);\r\n\r\n\r\n function success(result) {\r\n submitController.submitInProgress = false;\r\n // if (!scope.$$phase) scope.$apply();\r\n\r\n // This is a small hack. We want the submitInProgress\r\n // flag to be applied to the scope before we actually\r\n // raise the submitComplete event. We do that by\r\n // using angular's $timeout service which even without\r\n // a timeout value specified will not fire until after\r\n // the scope is digested.\r\n $timeout(function() {\r\n submitController.setSubmitComplete(true, result);\r\n });\r\n }\r\n\r\n function error(err) {\r\n submitController.submitInProgress = false;\r\n if (!scope.$$phase) scope.$apply();\r\n $timeout(function() {\r\n submitController.setSubmitComplete(false, err);\r\n });\r\n }\r\n };\r\n\r\n if (!scope.$$phase) {\r\n scope.$apply(doSubmit);\r\n } else {\r\n doSubmit();\r\n if (!scope.$$phase) scope.$apply();\r\n }\r\n });\r\n }\r\n };\r\n }\r\n };\r\n }]\r\n );\r\n}","\r\nmodule cr.form {\r\n formModule.directive(\"crTransField\", ['$http', '$compile', '$templateCache', '$log', 'crFormTemplate','$interpolate',\r\n ($http, $compile, $templateCache, $log, crFormTemplate: cr.form.IFormTemplateProvider,$interpolate) =>\r\n { var logger: angular.ILogService = $log.getInstance('crTransField');\r\n\r\n return {\r\n restrict: 'AE',\r\n replace: true,\r\n compile: function (tElem, tAttrs) {\r\n\r\n return {\r\n pre: function (scope, iElem, iAttrs) {\r\n var fName = scope.fieldName;\r\n\r\n },\r\n\r\n post: function ($scope, $element, $attr) {\r\n //console.log(\"crTransField: \"+$attr[\"fieldName\"]);\r\n var html='';\r\n\r\n $element.html(html);\r\n $compile($element.contents())($scope);\r\n\r\n }\r\n }\r\n }\r\n };\r\n }\r\n ]);\r\n}\r\n","\r\nmodule cr.form {\r\n formModule.directive('crUiSelect', ['$http', '$sce', 'cfg', ($http, $sce, cfg: cr.common.IConfig) => {\r\n\r\n return {\r\n scope: false,\r\n controller: [\r\n \"$scope\", ($scope) => {\r\n $scope.trustAsHtml = function (value) {\r\n return $sce.trustAsHtml(value);\r\n };\r\n\r\n $scope.$watch('optionValue',\r\n (val) => {\r\n var prop;\r\n\r\n console.log(val, '<-- new option value');\r\n\r\n if (typeof val === 'string') {\r\n // If it's a string, convert it to an option value\r\n for (var i = 0; i < $scope.options.options.length; i++) {\r\n if ($scope.options.options[i].Id == val) {\r\n $scope.optionValue = $scope.options.options[i];\r\n }\r\n }\r\n }\r\n\r\n if (val) {\r\n if (val.Id) {\r\n $scope.value = val.Id || '';\r\n }\r\n\r\n if (val.Data) {\r\n // Loop over object properties and render them if they are available\r\n if ($scope.formOptions && $scope.formOptions.formCtrl) {\r\n\r\n for (prop in val.Data) {\r\n var formControl: any = $scope.formOptions.formCtrl[prop];\r\n\r\n if (formControl\r\n && angular.isFunction(formControl.$setViewValue)\r\n && angular.isFunction(formControl.$render)) {\r\n\r\n formControl.$setViewValue(val.Data[prop]);\r\n formControl.$render();\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n $scope.value = \"\";\r\n }\r\n }\r\n );\r\n }\r\n ]\r\n };\r\n }]);\r\n}\r\n","\r\nmodule cr.form {\r\n var INTEGER_REGEXP = /^\\-?\\d+$/;\r\n\r\n formModule.directive('integer',\r\n function () {\r\n return {\r\n require: 'ngModel',\r\n link: function (scope, elm, attrs, ctrl) {\r\n ctrl.$parsers.unshift(function (viewValue) {\r\n if (INTEGER_REGEXP.test(viewValue)) {\r\n // it is valid\r\n ctrl.$setValidity('integer', true);\r\n return viewValue;\r\n } else {\r\n // it is invalid, return undefined (no model update)\r\n ctrl.$setValidity('integer', false);\r\n return undefined;\r\n }\r\n });\r\n }\r\n };\r\n });\r\n\r\n}\r\n","\r\nmodule cr.form\r\n{\r\n formModule.config(['crFormTemplateProvider',(crFormTemplateProvider: cr.form.IFormTemplateProvider) => {\r\n crFormTemplateProvider.setTemplateUrl('autocomplete', 'modules/form/templates/cr-autocomplete.html');\r\n crFormTemplateProvider.setTemplateUrl('button', 'modules/form/templates/cr-button.html');\r\n crFormTemplateProvider.setTemplateUrl('static', 'modules/form/templates/cr-static.html');\r\n crFormTemplateProvider.setTemplateUrl('checkbox', 'modules/form/templates/cr-checkbox.html');\r\n crFormTemplateProvider.setTemplateUrl('date', 'modules/form/templates/cr-date.html');\r\n crFormTemplateProvider.setTemplateUrl('datepicker', 'modules/form/templates/cr-datepicker.html');\r\n crFormTemplateProvider.setTemplateUrl('password', 'modules/form/templates/cr-password.html');\r\n crFormTemplateProvider.setTemplateUrl('radio', 'modules/form/templates/cr-radio.html');\r\n crFormTemplateProvider.setTemplateUrl('select', 'modules/form/templates/cr-select.html');\r\n crFormTemplateProvider.setTemplateUrl('select2', 'modules/form/templates/cr-select2.html');\r\n crFormTemplateProvider.setTemplateUrl('text', 'modules/form/templates/cr-text.html');\r\n crFormTemplateProvider.setTemplateUrl('textarea', 'modules/form/templates/cr-textarea.html');\r\n crFormTemplateProvider.setTemplateUrl('translation', 'modules/form/templates/cr-translation.html');\r\n }]);\r\n}\r\n","\r\nmodule cr.form {\r\n export var formModule : angular.IModule;\r\n\r\n export interface IFormTemplateProvider {\r\n getTemplateUrl(name: string);\r\n setTemplateUrl(name: string, templateUrl: string);\r\n }\r\n\r\n export interface IFormScope extends angular.IScope {\r\n definition: IFormSection[];\r\n options: any;\r\n submitHandler: any;\r\n result: any;\r\n visibleFields: any;\r\n formOnParentScope: angular.IFormController\r\n }\r\n\r\n export interface IFormSection {\r\n label: string;\r\n fields: IFormField[];\r\n }\r\n\r\n export interface IFormField {\r\n\r\n }\r\n\r\n export interface IFormPopupService {\r\n displayModal(title:string, formDefinitionUrl:string, object?:any, params?:any);\r\n editString(title:string, fieldName:string, currentVal:any, params?:any);\r\n }\r\n}\r\n","(function(module) {\ntry { module = angular.module(\"cr.form\"); }\ncatch(err) { module = angular.module(\"cr.form\", []); }\nmodule.run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"modules/form/templates/cr-autocomplete.html\",\n \"
{{ options.help | tc:formOptions.context }} {{ key | uppercase | translate:formOptions.context }}

{{ value }}

\");\n}]);\n})();\n\n(function(module) {\ntry { module = angular.module(\"cr.form\"); }\ncatch(err) { module = angular.module(\"cr.form\", []); }\nmodule.run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"modules/form/templates/cr-button.html\",\n \"\");\n}]);\n})();\n\n(function(module) {\ntry { module = angular.module(\"cr.form\"); }\ncatch(err) { module = angular.module(\"cr.form\", []); }\nmodule.run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"modules/form/templates/cr-checkbox.html\",\n \"
1]\\\">
{{ options.help | tc:formOptions.context }} {{ key | uppercase | translate:formOptions.context }}

{{ value }}

\");\n}]);\n})();\n\n(function(module) {\ntry { module = angular.module(\"cr.form\"); }\ncatch(err) { module = angular.module(\"cr.form\", []); }\nmodule.run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"modules/form/templates/cr-date.html\",\n \"
{{ options.help | tc:formOptions.context:options }} {{ key | uppercase | translate:formOptions.context:options }}

{{ value || '-' }}

\");\n}]);\n})();\n\n(function(module) {\ntry { module = angular.module(\"cr.form\"); }\ncatch(err) { module = angular.module(\"cr.form\", []); }\nmodule.run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"modules/form/templates/cr-datepicker.html\",\n \"
{{ options.help | tc:formOptions.context:options }} {{ key | uppercase | translate:formOptions.context:options }}

{{ value || '-' | localTime }}

\");\n}]);\n})();\n\n(function(module) {\ntry { module = angular.module(\"cr.form\"); }\ncatch(err) { module = angular.module(\"cr.form\", []); }\nmodule.run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"modules/form/templates/cr-form.html\",\n \"
\");\n}]);\n})();\n\n(function(module) {\ntry { module = angular.module(\"cr.form\"); }\ncatch(err) { module = angular.module(\"cr.form\", []); }\nmodule.run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"modules/form/templates/cr-password.html\",\n \"
{{ options.help | tc:formOptions.context:options }} {{ key | uppercase | translate:formOptions.context:options }}

{{ '-' || value }}

\");\n}]);\n})();\n\n(function(module) {\ntry { module = angular.module(\"cr.form\"); }\ncatch(err) { module = angular.module(\"cr.form\", []); }\nmodule.run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"modules/form/templates/cr-previous-next.html\",\n \"
\");\n}]);\n})();\n\n(function(module) {\ntry { module = angular.module(\"cr.form\"); }\ncatch(err) { module = angular.module(\"cr.form\", []); }\nmodule.run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"modules/form/templates/cr-radio.html\",\n \"
1]\\\">
{{ options.help | tc:formOptions.context }} {{ key | uppercase | translate:formOptions.context }}

{{ value }}

\");\n}]);\n})();\n\n(function(module) {\ntry { module = angular.module(\"cr.form\"); }\ncatch(err) { module = angular.module(\"cr.form\", []); }\nmodule.run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"modules/form/templates/cr-section.html\",\n \"

{{ section.label | tc:options.context }}

{{ section.labelHelp | tc:options.context }}

\");\n}]);\n})();\n\n(function(module) {\ntry { module = angular.module(\"cr.form\"); }\ncatch(err) { module = angular.module(\"cr.form\", []); }\nmodule.run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"modules/form/templates/cr-select-bug.html\",\n \"
{{ options.help | tc:formOptions.context }} {{ key | uppercase | translate:formOptions.context }}

{{ value }}

\");\n}]);\n})();\n\n(function(module) {\ntry { module = angular.module(\"cr.form\"); }\ncatch(err) { module = angular.module(\"cr.form\", []); }\nmodule.run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"modules/form/templates/cr-select.html\",\n \"
{{ options.help | tc:formOptions.context }} {{ key | uppercase | translate:formOptions.context }}

{{ value }}

\");\n}]);\n})();\n\n(function(module) {\ntry { module = angular.module(\"cr.form\"); }\ncatch(err) { module = angular.module(\"cr.form\", []); }\nmodule.run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"modules/form/templates/cr-select2.html\",\n \"
{{ $parent.optionValue.Text }}
{{ options.help | tc:formOptions.context }} {{ key | uppercase | translate:formOptions.context:options }}

{{ value }}

\");\n}]);\n})();\n\n(function(module) {\ntry { module = angular.module(\"cr.form\"); }\ncatch(err) { module = angular.module(\"cr.form\", []); }\nmodule.run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"modules/form/templates/cr-static.html\",\n \"

\");\n}]);\n})();\n\n(function(module) {\ntry { module = angular.module(\"cr.form\"); }\ncatch(err) { module = angular.module(\"cr.form\", []); }\nmodule.run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"modules/form/templates/cr-strength-indicator.html\",\n \"
\");\n}]);\n})();\n\n(function(module) {\ntry { module = angular.module(\"cr.form\"); }\ncatch(err) { module = angular.module(\"cr.form\", []); }\nmodule.run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"modules/form/templates/cr-text.html\",\n \"
{{ options.help | tc:formOptions.context:options }} {{ key | uppercase | translate:formOptions.context:options }}

{{ value }}

{{ value | number : options.roundNumber }}

\");\n}]);\n})();\n\n(function(module) {\ntry { module = angular.module(\"cr.form\"); }\ncatch(err) { module = angular.module(\"cr.form\", []); }\nmodule.run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"modules/form/templates/cr-textarea.html\",\n \"
{{ options.help | tc:formOptions.context }} {{ 'REQUIRED' | translate:formOptions.context }} {{ 'MINLENGTH' | translate:formOptions.context:options }} {{ 'MAXLENGTH' | translate:formOptions.context:options }}

{{ value }}

\");\n}]);\n})();\n\n(function(module) {\ntry { module = angular.module(\"cr.form\"); }\ncatch(err) { module = angular.module(\"cr.form\", []); }\nmodule.run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"modules/form/templates/cr-translation.html\",\n \"
{{ options.help | tc:formOptions.context:options }} {{ key | uppercase | translate:formOptions.context:options }}

{{ value }}

\");\n}]);\n})();\n\n(function(module) {\ntry { module = angular.module(\"cr.form\"); }\ncatch(err) { module = angular.module(\"cr.form\", []); }\nmodule.run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"modules/form/views/formpopup.html\",\n \"

{{popupData.title|tc:null:popupData }}

{{error}}

\");\n}]);\n})();\n"],"sourceRoot":"/source/"}